mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
game.c: make fadepal/fadepaltile first calculate inclusive end limit.
When requesting an increasing ramp, the upper limit is taken to be exclusive. When it is passed to G_FadePalette, only the lowest 6 bits are passed further to setpalettefade, which means that a limit of 64 is incorrectly set as 0. Also, when breaking from the fade loop, set the fade value to the end one for fadepal! git-svn-id: https://svn.eduke32.com/eduke32@2582 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
fa1521703c
commit
2113959dd5
1 changed files with 19 additions and 4 deletions
|
@ -1991,6 +1991,10 @@ void G_FadePalette(int32_t r,int32_t g,int32_t b,int32_t e)
|
|||
|
||||
void fadepal(int32_t r, int32_t g, int32_t b, int32_t start, int32_t end, int32_t step)
|
||||
{
|
||||
// for positive steps, the upper limit is exclusive!
|
||||
if (step > 0)
|
||||
end--; // ... make it inclusive
|
||||
|
||||
if (getrendermode() >= 3)
|
||||
{
|
||||
G_FadePalette(r, g, b, end);
|
||||
|
@ -1999,13 +2003,15 @@ void fadepal(int32_t r, int32_t g, int32_t b, int32_t start, int32_t end, int32_
|
|||
|
||||
if (step > 0)
|
||||
{
|
||||
for (; start < end; start += step)
|
||||
for (; start <= end; start += step)
|
||||
{
|
||||
if (KB_KeyPressed(sc_Space))
|
||||
{
|
||||
KB_ClearKeyDown(sc_Space);
|
||||
setpalettefade(r,g,b,end); // have to set to end fade value if we break!
|
||||
return;
|
||||
}
|
||||
|
||||
G_FadePalette(r,g,b,start);
|
||||
}
|
||||
}
|
||||
|
@ -2014,17 +2020,26 @@ void fadepal(int32_t r, int32_t g, int32_t b, int32_t start, int32_t end, int32_
|
|||
if (KB_KeyPressed(sc_Space))
|
||||
{
|
||||
KB_ClearKeyDown(sc_Space);
|
||||
setpalettefade(r,g,b,end);
|
||||
return;
|
||||
}
|
||||
|
||||
G_FadePalette(r,g,b,start);
|
||||
}
|
||||
}
|
||||
|
||||
static void fadepaltile(int32_t r, int32_t g, int32_t b, int32_t start, int32_t end, int32_t step, int32_t tile)
|
||||
{
|
||||
if (getrendermode() >= 3)
|
||||
clearview(0);
|
||||
|
||||
// for positive steps, the upper limit is exclusive!
|
||||
if (step > 0)
|
||||
end--; // ... make it inclusive
|
||||
|
||||
if (step > 0)
|
||||
{
|
||||
for (; start < end; start += step)
|
||||
for (; start <= end; start += step)
|
||||
{
|
||||
if (KB_KeyPressed(sc_Space))
|
||||
{
|
||||
|
@ -11379,8 +11394,8 @@ FRAGBONUS:
|
|||
{
|
||||
int32_t yy = 0, zz;
|
||||
|
||||
Net_GetPackets();
|
||||
handleevents();
|
||||
G_HandleAsync();
|
||||
|
||||
MUSIC_Update();
|
||||
|
||||
if (g_player[myconnectindex].ps->gm&MODE_EOL)
|
||||
|
|
Loading…
Reference in a new issue