From ca63f7f10d912382ebc24a54995f7153598ed429 Mon Sep 17 00:00:00 2001 From: nerzhul Date: Wed, 29 Jul 2015 10:49:40 +0200 Subject: Precalculate mapblock relative size. This permit to remove many s16 calculs on runtime --- src/mapblock.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mapblock.cpp') diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 1d2e1e250..43057f3a5 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -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), -- cgit v1.2.3