This commit is contained in:
aozhiwei 2019-09-09 09:44:23 +08:00
parent 24b37d8d32
commit c36f0fc36c

View File

@ -24,6 +24,8 @@
#include "gamelog.h"
#include "typeconvert.h"
const int MAP_CELL_WIDTH = 64 * 8;
const int MAP_GRID_WIDTH = 64;
const int ROOM_MAX_PLAYER_NUM = 50;
static long long RoomXGetTickCount(void* context)
@ -39,19 +41,21 @@ Room::~Room()
void Room::Init()
{
const int MAP_HEIGHT = 8192;
const int MAP_WIDTH = 8192;
const int MAP_CELL_WIDTH = 64 * 8;
const int MAP_GRID_WIDTH = 64;
#if 1
((metatable::Map*)map_meta->i)->set_map_width(MAP_WIDTH);
((metatable::Map*)map_meta->i)->set_map_height(MAP_HEIGHT);
#endif
if (map_meta->i->map_width() < 1) {
abort();
}
if (map_meta->i->map_height() < 1) {
abort();
}
xtimer.Init(RoomXGetTickCount, this, 100, 100);
xtimer_attacher.xtimer = &xtimer;
grid_service.Init(MAP_WIDTH, MAP_HEIGHT, MAP_CELL_WIDTH);
map_service.Init(MAP_WIDTH / MAP_GRID_WIDTH, MAP_HEIGHT / MAP_GRID_WIDTH, MAP_GRID_WIDTH);
grid_service.Init(map_meta->i->map_width(),
map_meta->i->map_height(),
MAP_CELL_WIDTH);
map_service.Init(map_meta->i->map_width() / MAP_GRID_WIDTH,
map_meta->i->map_height() / MAP_GRID_WIDTH,
MAP_GRID_WIDTH);
CreateThings();
if (App::Instance()->HasFlag(1)) {