Skip to content

Commit

Permalink
Client: Fixed initial plane heights update
Browse files Browse the repository at this point in the history
The client receives a number of plane height updates
when joining a game. However, the viewer is reset
immediately after a map is loaded, so the updates
were not carried out as they should've been. Now the
reset will explicitly update the visible height of the
planes so they match the logical heights.
  • Loading branch information
skyjake committed Jul 28, 2011
1 parent d1b8c24 commit 379c2ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions doomsday/engine/portable/src/r_world.c
Expand Up @@ -431,7 +431,7 @@ void R_InterpolateWatchedPlanes(watchedplanelist_t *wpl,
pln = wpl->list[i];

pln->visHeightDelta = 0;
pln->oldHeight[0] = pln->oldHeight[1] = pln->height;
pln->visHeight = pln->oldHeight[0] = pln->oldHeight[1] = pln->height;

if(pln->type == PLN_FLOOR || pln->type == PLN_CEILING)
{
Expand Down Expand Up @@ -464,9 +464,11 @@ void R_InterpolateWatchedPlanes(watchedplanelist_t *wpl,
}

// Has this plane reached its destination?
if(pln->visHeight == pln->height)
if(pln->visHeight == pln->height) /// @todo Can this fail? (float equality)
{
if(R_RemoveWatchedPlane(wpl, pln))
i = (i > 0? i-1 : 0);
}
}
}
}
Expand Down Expand Up @@ -1412,6 +1414,10 @@ void R_SetupMap(int mode, int flags)
// numbers of mallocs with no frees in between.
Z_EnableFastMalloc(false);

#ifdef _DEBUG
Con_Message("R_SetupMap: ddMapSetup begins (fast mallocs).\n");
#endif

// A new map is about to be setup.
ddMapSetup = true;
return;
Expand Down Expand Up @@ -1556,6 +1562,10 @@ void R_SetupMap(int mode, int flags)
// We've finished setting up the map.
ddMapSetup = false;

#ifdef _DEBUG
Con_Message("R_SetupMap: ddMapSetup done (normal mallocs from now on).\n");
#endif

// Inform the timing system to suspend the starting of the clock.
firstFrameAfterLoad = true;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jdoom/src/m_cheat.c
Expand Up @@ -491,7 +491,7 @@ static void printDebugInfo(player_t* plr)
// Also print some information to the console.
Con_Message("%s", textBuffer);
sub = plr->plr->mo->subsector;
Con_Message("\nSubsector %i:\n", P_ToIndex(sub));
Con_Message("\nSubsector %i / Sector %i:\n", P_ToIndex(sub), P_ToIndex(P_GetPtrp(sub, DMU_SECTOR)));
Con_Message(" FloorZ:%g Material:%s\n",
P_GetFloatp(sub, DMU_FLOOR_HEIGHT),
P_GetMaterialName(P_GetPtrp(sub, DMU_FLOOR_MATERIAL)));
Expand Down

0 comments on commit 379c2ef

Please sign in to comment.