Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lisu188 committed Oct 14, 2024
1 parent 31b0762 commit ba263cc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 34 deletions.
8 changes: 0 additions & 8 deletions src/gui/object/CProxyGraphicsObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ CProxyGraphicsObject::CProxyGraphicsObject(int x, int y) : x(x), y(y) {

}

void CProxyGraphicsObject::render(std::shared_ptr<CGui> gui, int frameTime) {
CGameGraphicsObject::render(gui, frameTime);
}

void CProxyGraphicsObject::refresh() {
vstd::with<void>(getGui(), [this](auto gui) {
std::list<std::shared_ptr<CGameGraphicsObject>> objects = vstd::cast<CProxyTargetGraphicsObject>(
Expand All @@ -43,7 +39,3 @@ void CProxyGraphicsObject::refresh() {
}
});
}

bool CProxyGraphicsObject::event(std::shared_ptr<CGui> gui, SDL_Event *event) {
return CGameGraphicsObject::event(gui, event);
}
4 changes: 0 additions & 4 deletions src/gui/object/CProxyGraphicsObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ V_META(CProxyGraphicsObject, CGameGraphicsObject,
V_PROPERTY(CProxyGraphicsObject, int, y, getY, setY)
)

void render(std::shared_ptr<CGui> reneder, int frameTime) override;

bool event(std::shared_ptr<CGui> gui, SDL_Event *event) override;

private:
int x, y;

Expand Down
12 changes: 2 additions & 10 deletions src/gui/object/CProxyTargetGraphicsObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "gui/CLayout.h"
#include "gui/CGui.h"

void CProxyTargetGraphicsObject::render(std::shared_ptr<CGui> gui, int frameTime) {
CGameGraphicsObject::render(gui, frameTime);
}

void CProxyTargetGraphicsObject::refresh() {
vstd::with<void>(getGui(), [this](auto gui) {
Expand Down Expand Up @@ -75,7 +72,7 @@ void CProxyTargetGraphicsObject::refresh() {
void CProxyTargetGraphicsObject::addProxyObject(auto gui, int &x, int &y) {
std::shared_ptr<CProxyGraphicsObject> nh = std::make_shared<CProxyGraphicsObject>(x, y);
std::shared_ptr<CLayout> layout1 = gui->getGame()->template createObject<CLayout>(
proxyLayout);
proxyLayout);
layout1->setNumericProperty("tileSize", getTileSize(this->ptr<CGameGraphicsObject>()));
nh->setLayout(layout1);
proxyObjects[x][y] = nh;
Expand Down Expand Up @@ -106,11 +103,6 @@ void CProxyTargetGraphicsObject::refreshObject(int x, int y) {
}
}

bool CProxyTargetGraphicsObject::event(std::shared_ptr<CGui> gui, SDL_Event *event) {
return CGameGraphicsObject::event(gui, event);
}


int CProxyTargetGraphicsObject::getSizeX(std::shared_ptr<CGui> gui) {
return 0;
}
Expand All @@ -119,7 +111,7 @@ int CProxyTargetGraphicsObject::getSizeY(std::shared_ptr<CGui> gui) {
return 0;
}

std::list<std::shared_ptr<CGameGraphicsObject>>
std::list<std::shared_ptr<CGameGraphicsObject> >
CProxyTargetGraphicsObject::getProxiedObjects(std::shared_ptr<CGui> gui, int x, int y) {
return {};
}
Expand Down
19 changes: 7 additions & 12 deletions src/gui/object/CProxyTargetGraphicsObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
class CProxyGraphicsObject;

class CProxyTargetGraphicsObject : public CGameGraphicsObject {
V_META(CProxyTargetGraphicsObject, CGameGraphicsObject,
V_METHOD(CProxyTargetGraphicsObject, refresh),
V_METHOD(CProxyTargetGraphicsObject, refreshAll),
V_PROPERTY(CProxyTargetGraphicsObject, std::string, proxyLayout, getProxyLayout, setProxyLayout))
V_META(CProxyTargetGraphicsObject, CGameGraphicsObject,
V_METHOD(CProxyTargetGraphicsObject, refresh),
V_METHOD(CProxyTargetGraphicsObject, refreshAll),
V_PROPERTY(CProxyTargetGraphicsObject, std::string, proxyLayout, getProxyLayout, setProxyLayout))
public:
void render(std::shared_ptr<CGui> reneder, int frameTime) override;

bool event(std::shared_ptr<CGui> gui, SDL_Event *event) override;

virtual std::list<std::shared_ptr<CGameGraphicsObject>>
virtual std::list<std::shared_ptr<CGameGraphicsObject> >
getProxiedObjects(std::shared_ptr<CGui> gui, int x, int y);

virtual int getSizeX(std::shared_ptr<CGui> gui);
Expand All @@ -41,10 +37,9 @@ V_META(CProxyTargetGraphicsObject, CGameGraphicsObject,
CProxyTargetGraphicsObject() = default;

private:
std::map<int, std::map<int, std::shared_ptr<CProxyGraphicsObject>>> proxyObjects;
std::map<int, std::map<int, std::shared_ptr<CProxyGraphicsObject> > > proxyObjects;
std::string proxyLayout = "CProxyGraphicsLayout";


public:
std::string getProxyLayout();

Expand All @@ -59,4 +54,4 @@ V_META(CProxyTargetGraphicsObject, CGameGraphicsObject,
void addProxyObject(auto gui, int &x, int &y);

void removeProxyObject(int &x, int &y);
};
};

0 comments on commit ba263cc

Please sign in to comment.