1
This commit is contained in:
parent
24b37d8d32
commit
c36f0fc36c
@ -24,6 +24,8 @@
|
|||||||
#include "gamelog.h"
|
#include "gamelog.h"
|
||||||
#include "typeconvert.h"
|
#include "typeconvert.h"
|
||||||
|
|
||||||
|
const int MAP_CELL_WIDTH = 64 * 8;
|
||||||
|
const int MAP_GRID_WIDTH = 64;
|
||||||
const int ROOM_MAX_PLAYER_NUM = 50;
|
const int ROOM_MAX_PLAYER_NUM = 50;
|
||||||
|
|
||||||
static long long RoomXGetTickCount(void* context)
|
static long long RoomXGetTickCount(void* context)
|
||||||
@ -39,19 +41,21 @@ Room::~Room()
|
|||||||
|
|
||||||
void Room::Init()
|
void Room::Init()
|
||||||
{
|
{
|
||||||
const int MAP_HEIGHT = 8192;
|
if (map_meta->i->map_width() < 1) {
|
||||||
const int MAP_WIDTH = 8192;
|
abort();
|
||||||
const int MAP_CELL_WIDTH = 64 * 8;
|
}
|
||||||
const int MAP_GRID_WIDTH = 64;
|
if (map_meta->i->map_height() < 1) {
|
||||||
#if 1
|
abort();
|
||||||
((metatable::Map*)map_meta->i)->set_map_width(MAP_WIDTH);
|
}
|
||||||
((metatable::Map*)map_meta->i)->set_map_height(MAP_HEIGHT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
xtimer.Init(RoomXGetTickCount, this, 100, 100);
|
xtimer.Init(RoomXGetTickCount, this, 100, 100);
|
||||||
xtimer_attacher.xtimer = &xtimer;
|
xtimer_attacher.xtimer = &xtimer;
|
||||||
grid_service.Init(MAP_WIDTH, MAP_HEIGHT, MAP_CELL_WIDTH);
|
grid_service.Init(map_meta->i->map_width(),
|
||||||
map_service.Init(MAP_WIDTH / MAP_GRID_WIDTH, MAP_HEIGHT / MAP_GRID_WIDTH, MAP_GRID_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();
|
CreateThings();
|
||||||
if (App::Instance()->HasFlag(1)) {
|
if (App::Instance()->HasFlag(1)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user