rewrite calculation of map geometry bounding box

and rename client-side struct "mapdims" to clmapdims (to avoid confusion
with server-side data)
This commit is contained in:
ac-stef
2016-08-26 14:08:55 +02:00
parent 48e2ce3863
commit e1ce0979d0
13 changed files with 223 additions and 105 deletions
+7 -2
View File
@@ -178,7 +178,12 @@ VARF(ambient, 0, 0, 0xFFFFFF, if(!noteditmode("ambient")) { hdr.ambient = ambien
void calclight()
{
if(editmode) calcmapdims();
if(editmode)
{
servsqr *servworld = createservworld(world, cubicsize);
calcmapdims(clmapdims, servworld, ssize);
delete[] servworld;
}
uchar r = (hdr.ambient>>16) & 0xFF, g = (hdr.ambient>>8) & 0xFF, b = hdr.ambient & 0xFF;
if(!r && !g)
{
@@ -205,7 +210,7 @@ void calclight()
popMT(); // undo the static seedMT() from above
block bb = { mapdims.x1 - 1, mapdims.y1 - 1, mapdims.xspan + 2, mapdims.yspan + 2 };
block bb = { clmapdims.x1 - 1, clmapdims.y1 - 1, clmapdims.xspan + 2, clmapdims.yspan + 2 };
postlightarea(bb);
setvar("fullbright", 0);
lastcalclight = totalmillis;