1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 06:52:34 +02:00

Fix some unused variable compiler warnings in rwgame

This commit is contained in:
Daniel Evans 2016-06-20 20:35:54 +01:00
parent a08f20dd5b
commit cb49e59c86
2 changed files with 17 additions and 18 deletions

View File

@ -48,17 +48,26 @@ public:
virtual void activate(float clickX, float clickY) = 0;
};
struct Entry : public MenuEntry
{
std::function<void (void)> callback;
Entry(const std::string& title, std::function<void (void)> cb, float size)
: MenuEntry(title, size), callback(cb) {}
void activate(float clickX, float clickY) { callback(); }
std::function<void(void)> callback;
Entry(const std::string& title,
std::function<void(void)> cb,
float size)
: MenuEntry(title, size), callback(cb)
{
}
void activate(float clickX, float clickY)
{
RW_UNUSED(clickX);
RW_UNUSED(clickY);
callback();
}
};
static std::shared_ptr<MenuEntry> lambda(const std::string& n, std::function<void (void)> callback, float size = 30.f)
{
return std::shared_ptr<MenuEntry>(new Entry(n, callback, size));

View File

@ -213,11 +213,6 @@ Menu* DebugState::createMapMenu()
Menu* DebugState::createVehicleMenu()
{
CharacterObject* player = nullptr;
if (game->getPlayer()) {
player = game->getPlayer()->getCharacter();
}
Menu* m = new Menu(2);
m->offset = kDebugMenuOffset;
@ -252,11 +247,6 @@ Menu* DebugState::createVehicleMenu()
Menu* DebugState::createAIMenu()
{
CharacterObject* player = nullptr;
if (game->getPlayer()) {
player = game->getPlayer()->getCharacter();
}
Menu* m = new Menu(2);
m->offset = kDebugMenuOffset;