mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
PCExhumed: Further improve the widescreen fix for the smoke in menu_DrawTheMap.
rotatesprite is now directly called, instead of going through the overwritesprite wrapper, in order to trim the smoke sprites, so they don't leave the map's boundaries in widescreen. A technical side-effect is that picanm[tilenum].sf is not temporarily set to 0, as done in overwritesprite. The call to videoClearScreen is still required, in case the console is shown and then hidden. It's now called after HandleAsync, just for the sake of it (less useful in case of quit, and maybe also in another scenario).
This commit is contained in:
parent
338dcef94c
commit
bb020c15f1
1 changed files with 15 additions and 1 deletions
|
@ -669,12 +669,23 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest)
|
||||||
|
|
||||||
int runtimer = (int)totalclock;
|
int runtimer = (int)totalclock;
|
||||||
|
|
||||||
|
// Trim smoke in widescreen
|
||||||
|
vec2_t mapwinxy1 = windowxy1, mapwinxy2 = windowxy2;
|
||||||
|
int32_t width = mapwinxy2.x - mapwinxy1.x + 1, height = mapwinxy2.y - mapwinxy1.y + 1;
|
||||||
|
if (3 * width > 4 * height)
|
||||||
|
{
|
||||||
|
mapwinxy1.x += (width - 4 * height / 3) / 2;
|
||||||
|
mapwinxy2.x -= (width - 4 * height / 3) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
// User has 12 seconds to do something on the map screen before loading the current level
|
// User has 12 seconds to do something on the map screen before loading the current level
|
||||||
while (nIdleSeconds < 12)
|
while (nIdleSeconds < 12)
|
||||||
{
|
{
|
||||||
HandleAsync();
|
HandleAsync();
|
||||||
twod->ClearScreen();
|
twod->ClearScreen();
|
||||||
|
|
||||||
|
videoClearScreen(overscanindex); // fix hall of mirrors when console renders offscreen in widescreen resolutions.
|
||||||
|
|
||||||
if (((int)totalclock - startTime) / kTimerTicks)
|
if (((int)totalclock - startTime) / kTimerTicks)
|
||||||
{
|
{
|
||||||
nIdleSeconds++;
|
nIdleSeconds++;
|
||||||
|
@ -711,7 +722,10 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest)
|
||||||
int smokeX = MapLevelFires[i].fires[j].xPos + FireTiles[nFireType][nFireFrame].xOffs;
|
int smokeX = MapLevelFires[i].fires[j].xPos + FireTiles[nFireType][nFireFrame].xOffs;
|
||||||
int smokeY = MapLevelFires[i].fires[j].yPos + FireTiles[nFireType][nFireFrame].yOffs + curYPos + screenY;
|
int smokeY = MapLevelFires[i].fires[j].yPos + FireTiles[nFireType][nFireFrame].yOffs + curYPos + screenY;
|
||||||
|
|
||||||
overwritesprite(smokeX, smokeY, nTile, 0, 2, kPalNormal);
|
// Use rotatesprite to trim smoke in widescreen
|
||||||
|
rotatesprite(smokeX << 16, smokeY << 16, 65536L, 0,
|
||||||
|
nTile, 0, kPalNormal, 16 + 2, mapwinxy1.x, mapwinxy1.y, mapwinxy2.x, mapwinxy2.y);
|
||||||
|
// overwritesprite(smokeX, smokeY, nTile, 0, 2, kPalNormal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue