0ad/source/tools/atlas/GameInterface/Handlers/Command.cpp
Ykkrosh aa118403bb Terrain: CalcFromPosition, to convert world-space to tile-space.
ScEd: Compilation fixes.
Atlas: Screen-space to world-space conversion when editing terrain.
Wireframe option. Minor wxWidgets 2.6.1 fixes. AoE3Ed.

This was SVN commit r2698.
2005-09-12 20:04:26 +00:00

52 lines
783 B
C++

#include "precompiled.h"
#include "MessageHandler.h"
#include "../CommandProc.h"
namespace AtlasMessage {
void fDoCommand(IMessage* msg)
{
mDoCommand* cmd = static_cast<mDoCommand*>(msg);
Command* c = NULL;
cmdHandlers::const_iterator it = GetCmdHandlers().find("c" + cmd->name);
if (it != GetCmdHandlers().end())
{
c = (it->second)(cmd->data);
}
else
{
debug_warn("Unrecognised command");
return;
}
GetCommandProc().Submit(c);
}
REGISTER(DoCommand);
void fUndoCommand(IMessage*)
{
GetCommandProc().Undo();
}
REGISTER(UndoCommand);
void fRedoCommand(IMessage*)
{
GetCommandProc().Redo();
}
REGISTER(RedoCommand);
void fMergeCommand(IMessage*)
{
GetCommandProc().Merge();
}
REGISTER(MergeCommand);
}