forked from 0ad/0ad
Ykkrosh
cf37e9cbe6
main.cpp: Allowed correct operation when not calling Init/Shutdown. Game.cpp: Stopped complaint when starting game with no GUI. This was SVN commit r2446.
30 lines
600 B
C++
30 lines
600 B
C++
#include "precompiled.h"
|
|
|
|
#include "MessageHandler.h"
|
|
|
|
#include "graphics/Patch.h"
|
|
#include "ps/Game.h"
|
|
|
|
namespace AtlasMessage {
|
|
|
|
|
|
void fGenerateMap(IMessage* msg)
|
|
{
|
|
mGenerateMap* cmd = static_cast<mGenerateMap*>(msg);
|
|
|
|
int tiles = cmd->size * PATCH_SIZE + 1;
|
|
|
|
u16* heightmap = new u16[tiles*tiles];
|
|
for (int y = 0; y < tiles; ++y)
|
|
for (int x = 0; x < tiles; ++x)
|
|
heightmap[x + y*tiles] = 32768;
|
|
|
|
g_Game->GetWorld()->GetTerrain()->Resize(cmd->size);
|
|
g_Game->GetWorld()->GetTerrain()->SetHeightMap(heightmap);
|
|
|
|
delete[] heightmap;
|
|
}
|
|
REGISTER(GenerateMap);
|
|
|
|
}
|