1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Precalculate mapblock relative size. This permit to remove many s16 calculs on runtime

This commit is contained in:
nerzhul 2015-07-29 10:49:40 +02:00
parent 88a6b9f52d
commit ca63f7f10d
2 changed files with 10 additions and 1 deletions

View file

@ -69,6 +69,7 @@ static const char *modified_reason_strings[] = {
MapBlock::MapBlock(Map *parent, v3s16 pos, IGameDef *gamedef, bool dummy):
m_parent(parent),
m_pos(pos),
m_pos_relative(pos * MAP_BLOCKSIZE),
m_gamedef(gamedef),
m_modified(MOD_STATE_WRITE_NEEDED),
m_modified_reason(MOD_REASON_INITIAL),