mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
Fix compile errors, backport input code for RR
# Conflicts: # platform/Windows/voidsw.vcxproj # source/blood/src/controls.cpp # source/blood/src/m32common.cpp # source/rr/src/actors.cpp # source/rr/src/anim.cpp # source/rr/src/demo.cpp # source/rr/src/game.cpp # source/rr/src/gameexec.cpp # source/rr/src/global.h # source/rr/src/menus.cpp # source/rr/src/menus.h # source/rr/src/net.cpp # source/rr/src/player.cpp # source/rr/src/premap.cpp # source/rr/src/savegame.cpp # source/rr/src/sbar.cpp # source/rr/src/screens.cpp # source/rr/src/sector.cpp
This commit is contained in:
parent
f6cd86d77e
commit
996dfde6d0
21 changed files with 395 additions and 385 deletions
|
@ -187,29 +187,26 @@ void ctrlGetInput(void)
|
||||||
|
|
||||||
CONTROL_GetInput(&info);
|
CONTROL_GetInput(&info);
|
||||||
|
|
||||||
#if 0
|
|
||||||
// these don't seem to have an on switch
|
|
||||||
if (MouseDeadZone)
|
if (MouseDeadZone)
|
||||||
{
|
{
|
||||||
if (info.mousey > 0)
|
if (info.mousey > 0)
|
||||||
info.mousey = max(info.mousey - MouseDeadZone, 0);
|
info.mousey = max(info.mousey - MouseDeadZone, 0);
|
||||||
else if (info.mousey < 0)
|
else if (info.mousey < 0)
|
||||||
info.mousey = min(info.mousey + MouseDeadZone, 0);
|
info.mousey = min(info.mousey + MouseDeadZone, 0);
|
||||||
|
|
||||||
if (info.mousex > 0)
|
if (info.mousex > 0)
|
||||||
info.mousex = max(info.mousex - MouseDeadZone, 0);
|
info.mousex = max(info.mousex - MouseDeadZone, 0);
|
||||||
else if (info.mousex < 0)
|
else if (info.mousex < 0)
|
||||||
info.mousex = min(info.mousex + MouseDeadZone, 0);
|
info.mousex = min(info.mousex + MouseDeadZone, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MouseBias)
|
if (MouseBias)
|
||||||
{
|
{
|
||||||
if (klabs(info.mousex) > klabs(info.mousey))
|
if (klabs(info.mousex) > klabs(info.mousey))
|
||||||
info.mousey = tabledivide32_noinline(info.mousey, MouseBias);
|
info.mousey = tabledivide32_noinline(info.mousey, MouseBias);
|
||||||
else
|
else
|
||||||
info.mousex = tabledivide32_noinline(info.mousex, MouseBias);
|
info.mousex = tabledivide32_noinline(info.mousex, MouseBias);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (gQuitRequest)
|
if (gQuitRequest)
|
||||||
gInput.keyFlags.quit = 1;
|
gInput.keyFlags.quit = 1;
|
||||||
|
|
|
@ -2929,16 +2929,17 @@ int viewFPSLimit(void)
|
||||||
if (!r_maxfps)
|
if (!r_maxfps)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
static double nextPageDelay;
|
static double nextPageDelay;
|
||||||
static double lastFrameTicks;
|
static uint64_t lastFrameTicks;
|
||||||
|
|
||||||
double const frameTicks = timerGetTicksU64();
|
uint64_t const frameTicks = timerGetTicksU64();
|
||||||
double const elapsedTime = frameTicks-lastFrameTicks;
|
uint64_t const elapsedTime = frameTicks - lastFrameTicks;
|
||||||
|
double const dElapsedTime = elapsedTime;
|
||||||
|
|
||||||
if (elapsedTime >= nextPageDelay)
|
if (dElapsedTime >= floor(nextPageDelay))
|
||||||
{
|
{
|
||||||
if (elapsedTime <= nextPageDelay+g_frameDelay)
|
if (dElapsedTime <= nextPageDelay+g_frameDelay)
|
||||||
nextPageDelay += g_frameDelay-elapsedTime;
|
nextPageDelay += g_frameDelay-dElapsedTime;
|
||||||
|
|
||||||
lastFrameTicks = frameTicks;
|
lastFrameTicks = frameTicks;
|
||||||
|
|
||||||
|
|
|
@ -3308,7 +3308,7 @@ ACTOR_STATIC void G_MoveTransports(void)
|
||||||
|
|
||||||
if (onFloor == 0 && klabs(SZ(spriteNum) - pPlayer->pos.z) < 6144)
|
if (onFloor == 0 && klabs(SZ(spriteNum) - pPlayer->pos.z) < 6144)
|
||||||
if (!pPlayer->jetpack_on || TEST_SYNC_KEY(g_player[playerNum].inputBits->bits, SK_JUMP)
|
if (!pPlayer->jetpack_on || TEST_SYNC_KEY(g_player[playerNum].inputBits->bits, SK_JUMP)
|
||||||
|| TEST_SYNC_KEY(g_player[playerNum].inputBits->bits, SK_CROUCH))
|
|| (TEST_SYNC_KEY(g_player[playerNum].inputBits->bits, SK_CROUCH) ^ pPlayer->crouch_toggle))
|
||||||
{
|
{
|
||||||
pPlayer->pos.x += sprite[OW(spriteNum)].x - SX(spriteNum);
|
pPlayer->pos.x += sprite[OW(spriteNum)].x - SX(spriteNum);
|
||||||
pPlayer->pos.y += sprite[OW(spriteNum)].y - SY(spriteNum);
|
pPlayer->pos.y += sprite[OW(spriteNum)].y - SY(spriteNum);
|
||||||
|
@ -3505,6 +3505,7 @@ default_case:
|
||||||
|
|
||||||
actor[sectSprite].lasttransport = ((int32_t)totalclock & UINT8_MAX);
|
actor[sectSprite].lasttransport = ((int32_t)totalclock & UINT8_MAX);
|
||||||
|
|
||||||
|
|
||||||
if (sectLotag == ST_1_ABOVE_WATER || sectLotag == ST_2_UNDERWATER)
|
if (sectLotag == ST_1_ABOVE_WATER || sectLotag == ST_2_UNDERWATER)
|
||||||
{
|
{
|
||||||
sprite[sectSprite].x += sprite[OW(spriteNum)].x - SX(spriteNum);
|
sprite[sectSprite].x += sprite[OW(spriteNum)].x - SX(spriteNum);
|
||||||
|
|
|
@ -535,7 +535,7 @@ int32_t Anim_Play(const char *fn)
|
||||||
g_restorePalette = 0;
|
g_restorePalette = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
frametime = (int32_t)totalclock;
|
frametime = (int32_t) totalclock;
|
||||||
|
|
||||||
videoClearScreen(0);
|
videoClearScreen(0);
|
||||||
|
|
||||||
|
|
|
@ -669,7 +669,7 @@ RECHECK:
|
||||||
lastsyncofs = ktell(g_demo_recFilePtr);
|
lastsyncofs = ktell(g_demo_recFilePtr);
|
||||||
initsyncofs = lastsyncofs;
|
initsyncofs = lastsyncofs;
|
||||||
lastsynctic = g_demo_cnt;
|
lastsynctic = g_demo_cnt;
|
||||||
lastsyncclock = (int32_t)totalclock;
|
lastsyncclock = (int32_t) totalclock;
|
||||||
outofsync = 0;
|
outofsync = 0;
|
||||||
#if KRANDDEBUG
|
#if KRANDDEBUG
|
||||||
krd_enable(2);
|
krd_enable(2);
|
||||||
|
@ -822,7 +822,7 @@ RECHECK:
|
||||||
{
|
{
|
||||||
lastsyncofs = ktell(g_demo_recFilePtr);
|
lastsyncofs = ktell(g_demo_recFilePtr);
|
||||||
lastsynctic = g_demo_cnt;
|
lastsynctic = g_demo_cnt;
|
||||||
lastsyncclock = (int32_t)totalclock;
|
lastsyncclock = (int32_t) totalclock;
|
||||||
|
|
||||||
if (kread(g_demo_recFilePtr, tmpbuf, 4) != 4)
|
if (kread(g_demo_recFilePtr, tmpbuf, 4) != 4)
|
||||||
CORRUPT(7);
|
CORRUPT(7);
|
||||||
|
|
|
@ -103,6 +103,7 @@ enum GameFunction_t
|
||||||
gamefunc_Last_Weapon,
|
gamefunc_Last_Weapon,
|
||||||
gamefunc_Quick_Save,
|
gamefunc_Quick_Save,
|
||||||
gamefunc_Quick_Load,
|
gamefunc_Quick_Load,
|
||||||
|
gamefunc_Toggle_Crouch, // TODO: Implement properly for mp
|
||||||
};
|
};
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,7 +227,7 @@ void G_GameQuit(void)
|
||||||
if (g_gameQuit == 0)
|
if (g_gameQuit == 0)
|
||||||
{
|
{
|
||||||
g_gameQuit = 1;
|
g_gameQuit = 1;
|
||||||
g_quitDeadline = (int32_t)totalclock + 120;
|
g_quitDeadline = (int32_t) totalclock+120;
|
||||||
//g_netDisconnect = 1;
|
//g_netDisconnect = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,8 +500,8 @@ static int32_t G_DoThirdPerson(const DukePlayer_t *pp, vec3_t *vect, int16_t *vs
|
||||||
vect->y += mulscale16(n.y,CAMERADIST);
|
vect->y += mulscale16(n.y,CAMERADIST);
|
||||||
vect->z += mulscale16(n.z,CAMERADIST);
|
vect->z += mulscale16(n.z,CAMERADIST);
|
||||||
|
|
||||||
CAMERADIST = min(CAMERADIST + (((int32_t)totalclock - CAMERACLOCK) << 10), 65536);
|
CAMERADIST = min(CAMERADIST+(((int32_t) totalclock-CAMERACLOCK)<<10),65536);
|
||||||
CAMERACLOCK = (int32_t)totalclock;
|
CAMERACLOCK = (int32_t) totalclock;
|
||||||
|
|
||||||
updatesectorz(vect->x,vect->y,vect->z,vsectnum);
|
updatesectorz(vect->x,vect->y,vect->z,vsectnum);
|
||||||
|
|
||||||
|
@ -1573,7 +1573,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
|
||||||
}
|
}
|
||||||
|
|
||||||
pPlayer->visibility += visinc;
|
pPlayer->visibility += visinc;
|
||||||
lastvist = (int32_t)totalclock;
|
lastvist = (int32_t) totalclock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4772,7 +4772,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura
|
||||||
|
|
||||||
if (t->lotag == SE_27_DEMO_CAM && ud.recstat == 1)
|
if (t->lotag == SE_27_DEMO_CAM && ud.recstat == 1)
|
||||||
{
|
{
|
||||||
t->picnum = 11 + (((int32_t)totalclock >> 3) & 1);
|
t->picnum = 11+(((int) totalclock>>3)&1);
|
||||||
t->cstat |= 128;
|
t->cstat |= 128;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4956,7 +4956,7 @@ default_case1:
|
||||||
case RESPAWNMARKERYELLOW__STATICRR:
|
case RESPAWNMARKERYELLOW__STATICRR:
|
||||||
case RESPAWNMARKERGREEN__STATICRR:
|
case RESPAWNMARKERGREEN__STATICRR:
|
||||||
if (!RR) goto default_case2;
|
if (!RR) goto default_case2;
|
||||||
t->picnum = 861 + (((int32_t)totalclock >> 4) & 13);
|
t->picnum = 861 + (((int32_t) totalclock >> 4) & 13);
|
||||||
if (pSprite->picnum == RESPAWNMARKERRED)
|
if (pSprite->picnum == RESPAWNMARKERRED)
|
||||||
t->pal = 0;
|
t->pal = 0;
|
||||||
else if (pSprite->picnum == RESPAWNMARKERYELLOW)
|
else if (pSprite->picnum == RESPAWNMARKERYELLOW)
|
||||||
|
@ -5040,7 +5040,7 @@ default_case1:
|
||||||
t->z -= ZOFFSET6;
|
t->z -= ZOFFSET6;
|
||||||
break;
|
break;
|
||||||
case CRYSTALAMMO__STATIC:
|
case CRYSTALAMMO__STATIC:
|
||||||
t->shade = (sintable[((int32_t)totalclock << 4) & 2047] >> 10);
|
t->shade = (sintable[((int32_t) totalclock<<4)&2047]>>10);
|
||||||
if (RR) break;
|
if (RR) break;
|
||||||
continue;
|
continue;
|
||||||
case VIEWSCREEN__STATIC:
|
case VIEWSCREEN__STATIC:
|
||||||
|
@ -5087,33 +5087,33 @@ default_case1:
|
||||||
{
|
{
|
||||||
if (RRRA && (sprite[pSprite->owner].picnum == CHEER || sprite[pSprite->owner].picnum == CHEERSTAYPUT))
|
if (RRRA && (sprite[pSprite->owner].picnum == CHEER || sprite[pSprite->owner].picnum == CHEERSTAYPUT))
|
||||||
{
|
{
|
||||||
t->picnum = CHEERBLADE + (((int32_t)totalclock >> 4) & 3);
|
t->picnum = CHEERBLADE + (((int32_t) totalclock >> 4) & 3);
|
||||||
t->shade = -127;
|
t->shade = -127;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
t->picnum = SHRINKSPARK + (((int32_t)totalclock >> 4) & 7);
|
t->picnum = SHRINKSPARK + (((int32_t) totalclock >> 4) & 7);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
t->picnum = SHRINKSPARK + (((int32_t)totalclock >> 4) & 3);
|
t->picnum = SHRINKSPARK+(((int32_t) totalclock>>4)&3);
|
||||||
break;
|
break;
|
||||||
case CHEERBOMB__STATICRR:
|
case CHEERBOMB__STATICRR:
|
||||||
if (!RRRA) goto default_case2;
|
if (!RRRA) goto default_case2;
|
||||||
t->picnum = CHEERBOMB + (((int32_t)totalclock >> 4) & 3);
|
t->picnum = CHEERBOMB+( ((int32_t) totalclock>>4)&3 );
|
||||||
break;
|
break;
|
||||||
case GROWSPARK__STATIC:
|
case GROWSPARK__STATIC:
|
||||||
if (RR) goto default_case2;
|
if (RR) goto default_case2;
|
||||||
t->picnum = GROWSPARK + (((int32_t)totalclock >> 4) & 3);
|
t->picnum = GROWSPARK+(((int32_t) totalclock>>4)&3);
|
||||||
break;
|
break;
|
||||||
case SPIT__STATIC:
|
case SPIT__STATIC:
|
||||||
if (!RR) goto default_case2;
|
if (!RR) goto default_case2;
|
||||||
t->picnum = SPIT + (((int32_t)totalclock >> 4) & 3);
|
t->picnum = SPIT + (((int32_t) totalclock >> 4) & 3);
|
||||||
if (RRRA)
|
if (RRRA)
|
||||||
{
|
{
|
||||||
if (sprite[pSprite->owner].picnum == MINION && sprite[pSprite->owner].pal == 8)
|
if (sprite[pSprite->owner].picnum == MINION && sprite[pSprite->owner].pal == 8)
|
||||||
t->picnum = RRTILE3500 + (((int32_t)totalclock >> 4) % 6);
|
t->picnum = RRTILE3500 + (((int32_t) totalclock >> 4) % 6);
|
||||||
else if (sprite[pSprite->owner].picnum == MINION && sprite[pSprite->owner].pal == 19)
|
else if (sprite[pSprite->owner].picnum == MINION && sprite[pSprite->owner].pal == 19)
|
||||||
{
|
{
|
||||||
t->picnum = RRTILE5090 + (((int32_t)totalclock >> 4) & 3);
|
t->picnum = RRTILE5090 + (((int32_t) totalclock >> 4) & 3);
|
||||||
t->shade = -127;
|
t->shade = -127;
|
||||||
}
|
}
|
||||||
else if (sprite[pSprite->owner].picnum == MAMA)
|
else if (sprite[pSprite->owner].picnum == MAMA)
|
||||||
|
@ -5757,7 +5757,7 @@ rrcoolexplosion1:
|
||||||
t->pal = 0;
|
t->pal = 0;
|
||||||
}
|
}
|
||||||
else if (RR && t->picnum == FIRELASER)
|
else if (RR && t->picnum == FIRELASER)
|
||||||
t->picnum = FIRELASER + (((int32_t)totalclock >> 2) & 5);
|
t->picnum = FIRELASER+(((int32_t) totalclock>>2)&5);
|
||||||
t->shade = -127;
|
t->shade = -127;
|
||||||
t->cstat |= 8192+1024;
|
t->cstat |= 8192+1024;
|
||||||
break;
|
break;
|
||||||
|
@ -5872,11 +5872,11 @@ rrcoolexplosion1:
|
||||||
t->shade = -127;
|
t->shade = -127;
|
||||||
break;
|
break;
|
||||||
case RRTILE2034__STATICRR:
|
case RRTILE2034__STATICRR:
|
||||||
t->picnum = RRTILE2034 + ((int32_t)totalclock & 1);
|
t->picnum = RRTILE2034 + ((int32_t) totalclock & 1);
|
||||||
break;
|
break;
|
||||||
case RRTILE2944__STATICRR:
|
case RRTILE2944__STATICRR:
|
||||||
t->shade = -127;
|
t->shade = -127;
|
||||||
t->picnum = RRTILE2944 + (((int32_t)totalclock >> 2) & 4);
|
t->picnum = RRTILE2944 + (((int32_t) totalclock >> 2) & 4);
|
||||||
break;
|
break;
|
||||||
case PLAYERONWATER__STATIC:
|
case PLAYERONWATER__STATIC:
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
|
@ -6487,7 +6487,7 @@ FAKE_F3:
|
||||||
g_player[myconnectindex].ps->over_shoulder_on = !g_player[myconnectindex].ps->over_shoulder_on;
|
g_player[myconnectindex].ps->over_shoulder_on = !g_player[myconnectindex].ps->over_shoulder_on;
|
||||||
|
|
||||||
CAMERADIST = 0;
|
CAMERADIST = 0;
|
||||||
CAMERACLOCK = (int32_t)totalclock;
|
CAMERACLOCK = (int32_t) totalclock;
|
||||||
|
|
||||||
P_DoQuote(QUOTE_VIEW_MODE_OFF + g_player[myconnectindex].ps->over_shoulder_on, g_player[myconnectindex].ps);
|
P_DoQuote(QUOTE_VIEW_MODE_OFF + g_player[myconnectindex].ps->over_shoulder_on, g_player[myconnectindex].ps);
|
||||||
}
|
}
|
||||||
|
@ -6553,7 +6553,7 @@ FAKE_F3:
|
||||||
|
|
||||||
if (ud.overhead_on != 0)
|
if (ud.overhead_on != 0)
|
||||||
{
|
{
|
||||||
int const timerOffset = ((int32_t)totalclock - nonsharedtimer);
|
int const timerOffset = ((int) totalclock - nonsharedtimer);
|
||||||
nonsharedtimer += timerOffset;
|
nonsharedtimer += timerOffset;
|
||||||
|
|
||||||
if (BUTTON(gamefunc_Enlarge_Screen))
|
if (BUTTON(gamefunc_Enlarge_Screen))
|
||||||
|
@ -8363,7 +8363,7 @@ MAIN_LOOP_RESTART:
|
||||||
|
|
||||||
ototalclock += TICSPERFRAME;
|
ototalclock += TICSPERFRAME;
|
||||||
|
|
||||||
int const moveClock = (int32_t)totalclock;
|
int const moveClock = (int) totalclock;
|
||||||
|
|
||||||
if (((ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
|
if (((ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
|
||||||
(g_player[myconnectindex].ps->gm&MODE_GAME))
|
(g_player[myconnectindex].ps->gm&MODE_GAME))
|
||||||
|
@ -8413,12 +8413,7 @@ MAIN_LOOP_RESTART:
|
||||||
}
|
}
|
||||||
else */if (G_FPSLimit() || g_saveRequested)
|
else */if (G_FPSLimit() || g_saveRequested)
|
||||||
{
|
{
|
||||||
int const smoothRatio
|
int const smoothRatio = calc_smoothratio(totalclock, ototalclock);
|
||||||
= ((ud.show_help == 0 && (!g_netServer && ud.multimode < 2) && !(g_player[myconnectindex].ps->gm & MODE_MENU))
|
|
||||||
|| (g_netServer || ud.multimode > 1)
|
|
||||||
|| ud.recstat == 2)
|
|
||||||
? calc_smoothratio((int32_t)totalclock, (int32_t)ototalclock)
|
|
||||||
: 65536;
|
|
||||||
|
|
||||||
G_DrawRooms(screenpeek, smoothRatio);
|
G_DrawRooms(screenpeek, smoothRatio);
|
||||||
if (videoGetRenderMode() >= REND_POLYMOST)
|
if (videoGetRenderMode() >= REND_POLYMOST)
|
||||||
|
|
|
@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "gamedefs.h"
|
#include "gamedefs.h"
|
||||||
#include "gamedef.h"
|
#include "gamedef.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
#include "mmulti.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -414,9 +415,28 @@ static inline void G_HandleAsync(void)
|
||||||
Net_GetPackets();
|
Net_GetPackets();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t calc_smoothratio(int32_t totalclk, int32_t ototalclk)
|
static inline int32_t calc_smoothratio_demo(ClockTicks totalclk, ClockTicks ototalclk)
|
||||||
{
|
{
|
||||||
return clamp((totalclk-ototalclk)*(65536/TICSPERFRAME), 0, 65536);
|
int32_t rfreq = (refreshfreq != -1 ? refreshfreq : 60);
|
||||||
|
uint64_t elapsedFrames = tabledivide64(((uint64_t) (totalclk - ototalclk).toScale16()) * rfreq, 65536*TICRATE);
|
||||||
|
#if 0
|
||||||
|
//POGO: additional debug info for testing purposes
|
||||||
|
OSD_Printf("Elapsed frames: %" PRIu64 ", smoothratio: %" PRIu64 "\n", elapsedFrames, tabledivide64(65536*elapsedFrames*REALGAMETICSPERSEC, rfreq));
|
||||||
|
#endif
|
||||||
|
return clamp(tabledivide64(65536*elapsedFrames*REALGAMETICSPERSEC, rfreq), 0, 65536);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int32_t calc_smoothratio(ClockTicks totalclk, ClockTicks ototalclk)
|
||||||
|
{
|
||||||
|
if (!((ud.show_help == 0 && (!g_netServer && ud.multimode < 2) && ((g_player[myconnectindex].ps->gm & MODE_MENU) == 0)) ||
|
||||||
|
(g_netServer || ud.multimode > 1) ||
|
||||||
|
ud.recstat == 2) ||
|
||||||
|
ud.pause_on)
|
||||||
|
{
|
||||||
|
return 65536;
|
||||||
|
}
|
||||||
|
|
||||||
|
return calc_smoothratio_demo(totalclk, ototalclk);
|
||||||
}
|
}
|
||||||
|
|
||||||
// sector effector lotags
|
// sector effector lotags
|
||||||
|
|
|
@ -1090,7 +1090,7 @@ static int32_t VM_ResetPlayer(int const playerNum, int32_t vmFlags)
|
||||||
if (playerNum == myconnectindex)
|
if (playerNum == myconnectindex)
|
||||||
{
|
{
|
||||||
CAMERADIST = 0;
|
CAMERADIST = 0;
|
||||||
CAMERACLOCK = (int32_t)totalclock;
|
CAMERACLOCK = (int32_t) totalclock;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (g_fakeMultiMode)
|
//if (g_fakeMultiMode)
|
||||||
|
@ -2231,7 +2231,7 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop)
|
||||||
int const playerXVel = sprite[pPlayer->i].xvel;
|
int const playerXVel = sprite[pPlayer->i].xvel;
|
||||||
int const syncBits = g_player[vm.playerNum].inputBits->bits;
|
int const syncBits = g_player[vm.playerNum].inputBits->bits;
|
||||||
|
|
||||||
if (((moveFlags & pducking) && pPlayer->on_ground && TEST_SYNC_KEY(syncBits, SK_CROUCH))
|
if (((moveFlags & pducking) && pPlayer->on_ground && (TEST_SYNC_KEY(syncBits, SK_CROUCH) ^ vm.pPlayer->crouch_toggle))
|
||||||
|| ((moveFlags & pfalling) && pPlayer->jumping_counter == 0 && !pPlayer->on_ground && pPlayer->vel.z > 2048)
|
|| ((moveFlags & pfalling) && pPlayer->jumping_counter == 0 && !pPlayer->on_ground && pPlayer->vel.z > 2048)
|
||||||
|| ((moveFlags & pjumping) && pPlayer->jumping_counter > 348)
|
|| ((moveFlags & pjumping) && pPlayer->jumping_counter > 348)
|
||||||
|| ((moveFlags & pstanding) && playerXVel >= 0 && playerXVel < 8)
|
|| ((moveFlags & pstanding) && playerXVel >= 0 && playerXVel < 8)
|
||||||
|
|
|
@ -155,7 +155,7 @@ G_EXTERN int32_t g_animateVel[MAXANIMATES];
|
||||||
G_EXTERN int16_t g_cloudSect[256];
|
G_EXTERN int16_t g_cloudSect[256];
|
||||||
G_EXTERN int16_t g_cloudX;
|
G_EXTERN int16_t g_cloudX;
|
||||||
G_EXTERN int16_t g_cloudY;
|
G_EXTERN int16_t g_cloudY;
|
||||||
G_EXTERN int32_t g_cloudClock;
|
G_EXTERN ClockTicks g_cloudClock;
|
||||||
|
|
||||||
G_EXTERN int16_t SpriteDeletionQueue[1024];
|
G_EXTERN int16_t SpriteDeletionQueue[1024];
|
||||||
G_EXTERN int16_t g_cyclers[MAXCYCLERS][6];
|
G_EXTERN int16_t g_cyclers[MAXCYCLERS][6];
|
||||||
|
@ -163,7 +163,7 @@ G_EXTERN int16_t g_mirrorSector[64];
|
||||||
G_EXTERN int16_t g_mirrorWall[64];
|
G_EXTERN int16_t g_mirrorWall[64];
|
||||||
G_EXTERN int32_t *labelcode;
|
G_EXTERN int32_t *labelcode;
|
||||||
G_EXTERN int32_t *labeltype;
|
G_EXTERN int32_t *labeltype;
|
||||||
G_EXTERN int32_t lockclock;
|
G_EXTERN ClockTicks lockclock;
|
||||||
G_EXTERN ClockTicks ototalclock;
|
G_EXTERN ClockTicks ototalclock;
|
||||||
|
|
||||||
G_EXTERN int32_t g_wupass;
|
G_EXTERN int32_t g_wupass;
|
||||||
|
|
|
@ -136,7 +136,7 @@ static void Menu_DrawTopBarCaption(const char *caption, const vec2_t origin)
|
||||||
|
|
||||||
static FORCE_INLINE int32_t Menu_CursorShade(void)
|
static FORCE_INLINE int32_t Menu_CursorShade(void)
|
||||||
{
|
{
|
||||||
return 4-(sintable[((int32_t)totalclock<<4)&2047]>>11);
|
return 4-(sintable[((int32_t) totalclock<<4)&2047]>>11);
|
||||||
}
|
}
|
||||||
static void Menu_DrawCursorCommon(int32_t x, int32_t y, int32_t z, int32_t picnum, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1)
|
static void Menu_DrawCursorCommon(int32_t x, int32_t y, int32_t z, int32_t picnum, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1)
|
||||||
{
|
{
|
||||||
|
@ -145,12 +145,12 @@ static void Menu_DrawCursorCommon(int32_t x, int32_t y, int32_t z, int32_t picnu
|
||||||
static void Menu_DrawCursorLeft(int32_t x, int32_t y, int32_t z)
|
static void Menu_DrawCursorLeft(int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
const int frames = RR ? 16 : 7;
|
const int frames = RR ? 16 : 7;
|
||||||
Menu_DrawCursorCommon(x, y, z, SPINNINGNUKEICON + (((int32_t)totalclock >> 3) % frames));
|
Menu_DrawCursorCommon(x, y, z, SPINNINGNUKEICON+(((int32_t) totalclock>>3)%frames));
|
||||||
}
|
}
|
||||||
static void Menu_DrawCursorRight(int32_t x, int32_t y, int32_t z)
|
static void Menu_DrawCursorRight(int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
const int frames = RR ? 16 : 7;
|
const int frames = RR ? 16 : 7;
|
||||||
Menu_DrawCursorCommon(x, y, z, SPINNINGNUKEICON + frames - 1 - ((frames - 1 + ((int32_t)totalclock >> 3)) % frames));
|
Menu_DrawCursorCommon(x, y, z, SPINNINGNUKEICON+frames-1-((frames-1+((int32_t) totalclock>>3))%frames));
|
||||||
}
|
}
|
||||||
static void Menu_DrawCursorTextTile(int32_t x, int32_t y, int32_t h, int32_t picnum, vec2_16_t const & siz, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1)
|
static void Menu_DrawCursorTextTile(int32_t x, int32_t y, int32_t h, int32_t picnum, vec2_16_t const & siz, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1)
|
||||||
{
|
{
|
||||||
|
@ -168,7 +168,7 @@ static void Menu_DrawCursorText(int32_t x, int32_t y, int32_t h, int32_t ydim_up
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu_DrawCursorTextTile(x, y, h, SPINNINGNUKEICON + (((int32_t)totalclock >> 3) % frames), siz, ydim_upper, ydim_lower);
|
Menu_DrawCursorTextTile(x, y, h, SPINNINGNUKEICON+(((int32_t) totalclock>>3)%frames), siz, ydim_upper, ydim_lower);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2254,7 +2254,7 @@ static void Menu_PreDraw(MenuID_t cm, MenuEntry_t *entry, const vec2_t origin)
|
||||||
{
|
{
|
||||||
rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + ((28+l)<<16), 65536L,0,INGAMEDUKETHREEDEE,0,0,10);
|
rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + ((28+l)<<16), 65536L,0,INGAMEDUKETHREEDEE,0,0,10);
|
||||||
if (PLUTOPAK) // JBF 20030804
|
if (PLUTOPAK) // JBF 20030804
|
||||||
rotatesprite_fs(origin.x + ((MENU_MARGIN_CENTER+100)<<16), origin.y + (36<<16), 65536L,0,PLUTOPAKSPRITE+2,(sintable[((int32_t)totalclock<<4)&2047]>>11),0,2+8);
|
rotatesprite_fs(origin.x + ((MENU_MARGIN_CENTER+100)<<16), origin.y + (36<<16), 65536L,0,PLUTOPAKSPRITE+2,(sintable[((int32_t) totalclock<<4)&2047]>>11),0,2+8);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2264,9 +2264,9 @@ static void Menu_PreDraw(MenuID_t cm, MenuEntry_t *entry, const vec2_t origin)
|
||||||
|
|
||||||
case MENU_PLAYER:
|
case MENU_PLAYER:
|
||||||
if (RR)
|
if (RR)
|
||||||
rotatesprite_fs(origin.x + (260<<16), origin.y + ((24+(tilesiz[APLAYER].y>>2))<<16), 24576L,0,3845+36-((((8-((int32_t)totalclock>>4)))&7)*5),0,entry == &ME_PLAYER_TEAM ? G_GetTeamPalette(ud.team) : ud.color,10);
|
rotatesprite_fs(origin.x + (260<<16), origin.y + ((24+(tilesiz[APLAYER].y>>2))<<16), 24576L,0,3845+36-((((8-((int32_t) totalclock>>4)))&7)*5),0,entry == &ME_PLAYER_TEAM ? G_GetTeamPalette(ud.team) : ud.color,10);
|
||||||
else
|
else
|
||||||
rotatesprite_fs(origin.x + (260<<16), origin.y + ((24+(tilesiz[APLAYER].y>>1))<<16), 49152L,0,1441-((((4-((int32_t)totalclock>>4)))&3)*5),0,entry == &ME_PLAYER_TEAM ? G_GetTeamPalette(ud.team) : ud.color,10);
|
rotatesprite_fs(origin.x + (260<<16), origin.y + ((24+(tilesiz[APLAYER].y>>1))<<16), 49152L,0,1441-((((4-((int32_t) totalclock>>4)))&3)*5),0,entry == &ME_PLAYER_TEAM ? G_GetTeamPalette(ud.team) : ud.color,10);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_MACROS:
|
case MENU_MACROS:
|
||||||
|
@ -4396,19 +4396,19 @@ MenuAnimation_t m_animation;
|
||||||
|
|
||||||
int32_t Menu_Anim_SinOutRight(MenuAnimation_t *animdata)
|
int32_t Menu_Anim_SinOutRight(MenuAnimation_t *animdata)
|
||||||
{
|
{
|
||||||
return sintable[divscale10((int32_t)totalclock - animdata->start, animdata->length) + 512] - 16384;
|
return sintable[divscale10((int32_t) totalclock - animdata->start, animdata->length) + 512] - 16384;
|
||||||
}
|
}
|
||||||
int32_t Menu_Anim_SinInRight(MenuAnimation_t *animdata)
|
int32_t Menu_Anim_SinInRight(MenuAnimation_t *animdata)
|
||||||
{
|
{
|
||||||
return sintable[divscale10((int32_t)totalclock - animdata->start, animdata->length) + 512] + 16384;
|
return sintable[divscale10((int32_t) totalclock - animdata->start, animdata->length) + 512] + 16384;
|
||||||
}
|
}
|
||||||
int32_t Menu_Anim_SinOutLeft(MenuAnimation_t *animdata)
|
int32_t Menu_Anim_SinOutLeft(MenuAnimation_t *animdata)
|
||||||
{
|
{
|
||||||
return -sintable[divscale10((int32_t)totalclock - animdata->start, animdata->length) + 512] + 16384;
|
return -sintable[divscale10((int32_t) totalclock - animdata->start, animdata->length) + 512] + 16384;
|
||||||
}
|
}
|
||||||
int32_t Menu_Anim_SinInLeft(MenuAnimation_t *animdata)
|
int32_t Menu_Anim_SinInLeft(MenuAnimation_t *animdata)
|
||||||
{
|
{
|
||||||
return -sintable[divscale10((int32_t)totalclock - animdata->start, animdata->length) + 512] - 16384;
|
return -sintable[divscale10((int32_t) totalclock - animdata->start, animdata->length) + 512] - 16384;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu_AnimateChange(int32_t cm, MenuAnimationType_t animtype)
|
void Menu_AnimateChange(int32_t cm, MenuAnimationType_t animtype)
|
||||||
|
@ -4423,7 +4423,7 @@ void Menu_AnimateChange(int32_t cm, MenuAnimationType_t animtype)
|
||||||
{
|
{
|
||||||
m_animation.out = Menu_Anim_SinOutRight;
|
m_animation.out = Menu_Anim_SinOutRight;
|
||||||
m_animation.in = Menu_Anim_SinInRight;
|
m_animation.in = Menu_Anim_SinInRight;
|
||||||
m_animation.start = (int32_t)totalclock;
|
m_animation.start = (int32_t) totalclock;
|
||||||
m_animation.length = 30;
|
m_animation.length = 30;
|
||||||
|
|
||||||
m_animation.previous = previousMenu;
|
m_animation.previous = previousMenu;
|
||||||
|
@ -4440,7 +4440,7 @@ void Menu_AnimateChange(int32_t cm, MenuAnimationType_t animtype)
|
||||||
{
|
{
|
||||||
m_animation.out = Menu_Anim_SinOutLeft;
|
m_animation.out = Menu_Anim_SinOutLeft;
|
||||||
m_animation.in = Menu_Anim_SinInLeft;
|
m_animation.in = Menu_Anim_SinInLeft;
|
||||||
m_animation.start = (int32_t)totalclock;
|
m_animation.start = (int32_t) totalclock;
|
||||||
m_animation.length = 30;
|
m_animation.length = 30;
|
||||||
|
|
||||||
m_animation.previous = previousMenu;
|
m_animation.previous = previousMenu;
|
||||||
|
@ -4862,7 +4862,7 @@ void Menu_Close(uint8_t playerID)
|
||||||
{
|
{
|
||||||
ready2send = 1;
|
ready2send = 1;
|
||||||
totalclock = ototalclock;
|
totalclock = ototalclock;
|
||||||
CAMERACLOCK =(int32_t) totalclock;
|
CAMERACLOCK = (int32_t) totalclock;
|
||||||
CAMERADIST = 65536;
|
CAMERADIST = 65536;
|
||||||
m_animation.start = 0;
|
m_animation.start = 0;
|
||||||
m_animation.length = 0;
|
m_animation.length = 0;
|
||||||
|
@ -4870,7 +4870,7 @@ void Menu_Close(uint8_t playerID)
|
||||||
// Reset next-viewscreen-redraw counter.
|
// Reset next-viewscreen-redraw counter.
|
||||||
// XXX: are there any other cases like that in need of handling?
|
// XXX: are there any other cases like that in need of handling?
|
||||||
if (g_curViewscreen >= 0)
|
if (g_curViewscreen >= 0)
|
||||||
actor[g_curViewscreen].t_data[0] = (int32_t)totalclock;
|
actor[g_curViewscreen].t_data[0] = (int32_t) totalclock;
|
||||||
}
|
}
|
||||||
|
|
||||||
walock[TILE_SAVESHOT] = 199;
|
walock[TILE_SAVESHOT] = 199;
|
||||||
|
@ -4917,7 +4917,7 @@ enum MenuTextFlags_t
|
||||||
static void Menu_GetFmt(const MenuFont_t *font, uint8_t const status, int32_t *s)
|
static void Menu_GetFmt(const MenuFont_t *font, uint8_t const status, int32_t *s)
|
||||||
{
|
{
|
||||||
if (status & MT_Selected)
|
if (status & MT_Selected)
|
||||||
*s = sintable[((int32_t)totalclock << 5) & 2047] >> 12;
|
*s = sintable[((int32_t) totalclock<<5)&2047]>>12;
|
||||||
else
|
else
|
||||||
*s = font->shade_deselected;
|
*s = font->shade_deselected;
|
||||||
// sum shade values
|
// sum shade values
|
||||||
|
@ -5986,7 +5986,7 @@ static void Menu_Run_MouseReturn(Menu_t *cm, const vec2_t origin)
|
||||||
uint32_t const posx = tilesiz[SELECTDIR].y * SELECTDIR_z;
|
uint32_t const posx = tilesiz[SELECTDIR].y * SELECTDIR_z;
|
||||||
|
|
||||||
rotatesprite_(origin.x + posx, 0, SELECTDIR_z, 512, SELECTDIR,
|
rotatesprite_(origin.x + posx, 0, SELECTDIR_z, 512, SELECTDIR,
|
||||||
Menu_RunInput_MouseReturn_status ? 4 - (sintable[((int32_t)totalclock << 4) & 2047] >> 11) : 6, 0,
|
Menu_RunInput_MouseReturn_status ? 4 - (sintable[((int32_t) totalclock << 4) & 2047] >> 11) : 6, 0,
|
||||||
2 | 8 | 16 | RS_ALIGN_L, MOUSEALPHA, 0, xdim_from_320_16(origin.x + x_widescreen_left()), 0,
|
2 | 8 | 16 | RS_ALIGN_L, MOUSEALPHA, 0, xdim_from_320_16(origin.x + x_widescreen_left()), 0,
|
||||||
xdim_from_320_16(origin.x + x_widescreen_left() + (posx>>1)), ydim - 1);
|
xdim_from_320_16(origin.x + x_widescreen_left() + (posx>>1)), ydim - 1);
|
||||||
}
|
}
|
||||||
|
@ -7686,7 +7686,7 @@ void M_DisplayMenus(void)
|
||||||
if (MOUSEACTIVECONDITIONAL(mouseAdvanceClickState()) || m_mousepos.x != m_prevmousepos.x || m_mousepos.y != m_prevmousepos.y)
|
if (MOUSEACTIVECONDITIONAL(mouseAdvanceClickState()) || m_mousepos.x != m_prevmousepos.x || m_mousepos.y != m_prevmousepos.y)
|
||||||
{
|
{
|
||||||
m_prevmousepos = m_mousepos;
|
m_prevmousepos = m_mousepos;
|
||||||
m_mouselastactivity = (int32_t)totalclock;
|
m_mouselastactivity = (int32_t) totalclock;
|
||||||
}
|
}
|
||||||
#if !defined EDUKE32_TOUCH_DEVICES
|
#if !defined EDUKE32_TOUCH_DEVICES
|
||||||
else
|
else
|
||||||
|
@ -7729,7 +7729,7 @@ void M_DisplayMenus(void)
|
||||||
if ((g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU)
|
if ((g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU)
|
||||||
{
|
{
|
||||||
G_UpdateScreenArea();
|
G_UpdateScreenArea();
|
||||||
CAMERACLOCK = (int32_t)totalclock;
|
CAMERACLOCK = (int32_t) totalclock;
|
||||||
CAMERADIST = 65536;
|
CAMERADIST = 65536;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -513,9 +513,9 @@ extern int32_t m_mousewake_watchpoint, m_menuchange_watchpoint;
|
||||||
// alpha increments of 3 --> 255 / 3 = 85 --> round up to power of 2 --> 128 --> divide by 2 --> 64 alphatabs required
|
// alpha increments of 3 --> 255 / 3 = 85 --> round up to power of 2 --> 128 --> divide by 2 --> 64 alphatabs required
|
||||||
// use 16 anyway :P
|
// use 16 anyway :P
|
||||||
# define MOUSEUSEALPHA (videoGetRenderMode() != REND_CLASSIC || numalphatabs >= 15)
|
# define MOUSEUSEALPHA (videoGetRenderMode() != REND_CLASSIC || numalphatabs >= 15)
|
||||||
#define MOUSEALPHA (MOUSEUSEALPHA ? clamp(((int32_t)totalclock - m_mouselastactivity - 90) * 3, 0, 255) : 0)
|
# define MOUSEALPHA (MOUSEUSEALPHA ? clamp(((int32_t) totalclock - m_mouselastactivity - 90)*3, 0, 255) : 0)
|
||||||
#define CURSORALPHA (MOUSEUSEALPHA ? clamp(((int32_t)totalclock - m_mouselastactivity - 90) * 2 + (255 / 3), (255 / 3), 255) : 255 / 3)
|
# define CURSORALPHA (MOUSEUSEALPHA ? clamp(((int32_t) totalclock - m_mouselastactivity - 90)*2 + (255/3), (255/3), 255) : 255/3)
|
||||||
# define MOUSEACTIVECONDITION (totalclock - m_mouselastactivity < M_MOUSETIMEOUT)
|
# define MOUSEACTIVECONDITION ((int32_t) totalclock - m_mouselastactivity < M_MOUSETIMEOUT)
|
||||||
# define MOUSEACTIVECONDITIONAL(condition) (MOUSEACTIVECONDITION && (condition))
|
# define MOUSEACTIVECONDITIONAL(condition) (MOUSEACTIVECONDITION && (condition))
|
||||||
# define MOUSEINACTIVECONDITIONAL(condition) (!MOUSEACTIVECONDITION && (condition))
|
# define MOUSEINACTIVECONDITIONAL(condition) (!MOUSEACTIVECONDITION && (condition))
|
||||||
# define MOUSEWATCHPOINTCONDITIONAL(condition) ((condition) || m_mousewake_watchpoint || m_menuchange_watchpoint == 3)
|
# define MOUSEWATCHPOINTCONDITIONAL(condition) ((condition) || m_mousewake_watchpoint || m_menuchange_watchpoint == 3)
|
||||||
|
|
|
@ -3701,7 +3701,7 @@ void Net_SendMessage(void)
|
||||||
int32_t const text_x = fullwidth >= (320<<16) ? (320<<16) - fullwidth : mpgametext_x;
|
int32_t const text_x = fullwidth >= (320<<16) ? (320<<16) - fullwidth : mpgametext_x;
|
||||||
mpgametext(text_x, y, typebuf, 1, 2|8|16|ROTATESPRITE_FULL16, 0, TEXT_YCENTER|TEXT_LITERALESCAPE);
|
mpgametext(text_x, y, typebuf, 1, 2|8|16|ROTATESPRITE_FULL16, 0, TEXT_YCENTER|TEXT_LITERALESCAPE);
|
||||||
int32_t const cursor_x = text_x + width + textsc((tilesiz[SPINNINGNUKEICON].x<<14)+(1<<16));
|
int32_t const cursor_x = text_x + width + textsc((tilesiz[SPINNINGNUKEICON].x<<14)+(1<<16));
|
||||||
rotatesprite_fs(cursor_x, y, textsc(32768), 0, SPINNINGNUKEICON+(((int32_t)totalclock>>3)%7), 4-(sintable[((int32_t)totalclock<<4)&2047]>>11), 0, 2|8);
|
rotatesprite_fs(cursor_x, y, textsc(32768), 0, SPINNINGNUKEICON+(((int32_t) totalclock>>3)%7), 4-(sintable[((int32_t) totalclock<<4)&2047]>>11), 0, 2|8);
|
||||||
|
|
||||||
if (hitstate == 1)
|
if (hitstate == 1)
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -205,7 +205,8 @@ typedef struct {
|
||||||
int32_t sea_sick;
|
int32_t sea_sick;
|
||||||
uint8_t hurt_delay2, nocheat;
|
uint8_t hurt_delay2, nocheat;
|
||||||
|
|
||||||
int8_t padding_[4];
|
int8_t crouch_toggle;
|
||||||
|
int8_t padding_[3];
|
||||||
} DukePlayer_t;
|
} DukePlayer_t;
|
||||||
|
|
||||||
// KEEPINSYNC lunatic/_defs_game.lua
|
// KEEPINSYNC lunatic/_defs_game.lua
|
||||||
|
@ -241,7 +242,6 @@ extern int32_t g_levelTextTime;
|
||||||
extern int32_t g_myAimMode;
|
extern int32_t g_myAimMode;
|
||||||
extern int32_t g_numObituaries;
|
extern int32_t g_numObituaries;
|
||||||
extern int32_t g_numSelfObituaries;
|
extern int32_t g_numSelfObituaries;
|
||||||
extern int32_t g_emuJumpTics;
|
|
||||||
extern int32_t mouseyaxismode;
|
extern int32_t mouseyaxismode;
|
||||||
extern int32_t ticrandomseed;
|
extern int32_t ticrandomseed;
|
||||||
|
|
||||||
|
|
|
@ -595,7 +595,7 @@ void G_CacheMapData(void)
|
||||||
G_CacheSpriteNum(j);
|
G_CacheSpriteNum(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
tc = (int32_t)totalclock;
|
tc = (int32_t) totalclock;
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
||||||
int lpc = -1;
|
int lpc = -1;
|
||||||
|
@ -674,14 +674,14 @@ void G_CacheMapData(void)
|
||||||
|
|
||||||
if (totalclock - tc >= 1)
|
if (totalclock - tc >= 1)
|
||||||
{
|
{
|
||||||
tc = (int32_t)totalclock;
|
tc = (int32_t) totalclock;
|
||||||
lpc++;
|
lpc++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OSD_Printf("percentage %d lpc %d\n", percentage, lpc);
|
// OSD_Printf("percentage %d lpc %d\n", percentage, lpc);
|
||||||
}
|
}
|
||||||
|
|
||||||
tc = (int32_t)totalclock;
|
tc = (int32_t) totalclock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2192,8 +2192,6 @@ void G_ClearFIFO(void)
|
||||||
{
|
{
|
||||||
Net_ClearFIFO();
|
Net_ClearFIFO();
|
||||||
|
|
||||||
g_emuJumpTics = 0;
|
|
||||||
|
|
||||||
clearbufbyte(&localInput, sizeof(input_t), 0L);
|
clearbufbyte(&localInput, sizeof(input_t), 0L);
|
||||||
clearbufbyte(&inputfifo, sizeof(input_t) * MOVEFIFOSIZ * MAXPLAYERS, 0L);
|
clearbufbyte(&inputfifo, sizeof(input_t) * MOVEFIFOSIZ * MAXPLAYERS, 0L);
|
||||||
|
|
||||||
|
|
|
@ -419,10 +419,10 @@ static struct {
|
||||||
|
|
||||||
static void G_SaveTimers(void)
|
static void G_SaveTimers(void)
|
||||||
{
|
{
|
||||||
g_timers.totalclock = (int32_t)totalclock;
|
g_timers.totalclock = (int32_t) totalclock;
|
||||||
g_timers.totalclocklock = (int32_t)totalclocklock;
|
g_timers.totalclocklock = (int32_t) totalclocklock;
|
||||||
g_timers.ototalclock = (int32_t)ototalclock;
|
g_timers.ototalclock = (int32_t) ototalclock;
|
||||||
g_timers.lockclock = lockclock;
|
g_timers.lockclock = (int32_t) lockclock;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void G_RestoreTimers(void)
|
static void G_RestoreTimers(void)
|
||||||
|
|
|
@ -711,11 +711,11 @@ void G_DrawStatusBar(int32_t snum)
|
||||||
|
|
||||||
if (sprite[p->i].pal == 1 && p->last_extra < 2)
|
if (sprite[p->i].pal == 1 && p->last_extra < 2)
|
||||||
G_DrawAltDigiNum(44, -(hudoffset-22), 1, -16, 10+16+256);
|
G_DrawAltDigiNum(44, -(hudoffset-22), 1, -16, 10+16+256);
|
||||||
else if (!althud_flashing || p->last_extra > (p->max_player_health >> 2) || (int32_t)totalclock & 32)
|
else if (!althud_flashing || p->last_extra >(p->max_player_health>>2) || (int32_t) totalclock&32)
|
||||||
{
|
{
|
||||||
int32_t s = -8;
|
int32_t s = -8;
|
||||||
if (althud_flashing && p->last_extra > p->max_player_health)
|
if (althud_flashing && p->last_extra > p->max_player_health)
|
||||||
s += (sintable[((int32_t)totalclock << 5) & 2047] >> 10);
|
s += (sintable[((int32_t) totalclock<<5)&2047]>>10);
|
||||||
G_DrawAltDigiNum(44, -(hudoffset-22), p->last_extra, s, 10+16+256);
|
G_DrawAltDigiNum(44, -(hudoffset-22), p->last_extra, s, 10+16+256);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -738,7 +738,7 @@ void G_DrawStatusBar(int32_t snum)
|
||||||
else i = p->curr_weapon;
|
else i = p->curr_weapon;
|
||||||
|
|
||||||
if (p->curr_weapon != KNEE_WEAPON && p->curr_weapon != SLINGBLADE_WEAPON &&
|
if (p->curr_weapon != KNEE_WEAPON && p->curr_weapon != SLINGBLADE_WEAPON &&
|
||||||
(!althud_flashing || (int32_t)totalclock&32 || p->ammo_amount[i] > (p->max_ammo_amount[i]/10)))
|
(!althud_flashing || (int32_t) totalclock&32 || p->ammo_amount[i] > (p->max_ammo_amount[i]/10)))
|
||||||
G_DrawAltDigiNum(-20, -(hudoffset-22), p->ammo_amount[i], -16, 10+16+512);
|
G_DrawAltDigiNum(-20, -(hudoffset-22), p->ammo_amount[i], -16, 10+16+512);
|
||||||
|
|
||||||
o = 102;
|
o = 102;
|
||||||
|
@ -806,11 +806,11 @@ void G_DrawStatusBar(int32_t snum)
|
||||||
|
|
||||||
if (sprite[p->i].pal == 1 && p->last_extra < 2)
|
if (sprite[p->i].pal == 1 && p->last_extra < 2)
|
||||||
G_DrawAltDigiNum(40, -(hudoffset-22), 1, -16, 10+16+256);
|
G_DrawAltDigiNum(40, -(hudoffset-22), 1, -16, 10+16+256);
|
||||||
else if (!althud_flashing || p->last_extra > (p->max_player_health >> 2) || (int32_t)totalclock & 32)
|
else if (!althud_flashing || p->last_extra >(p->max_player_health>>2) || (int32_t) totalclock&32)
|
||||||
{
|
{
|
||||||
int32_t s = -8;
|
int32_t s = -8;
|
||||||
if (althud_flashing && p->last_extra > p->max_player_health)
|
if (althud_flashing && p->last_extra > p->max_player_health)
|
||||||
s += (sintable[((int32_t)totalclock << 5) & 2047] >> 10);
|
s += (sintable[((int32_t) totalclock<<5)&2047]>>10);
|
||||||
G_DrawAltDigiNum(40, -(hudoffset-22), p->last_extra, s, 10+16+256);
|
G_DrawAltDigiNum(40, -(hudoffset-22), p->last_extra, s, 10+16+256);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -827,7 +827,7 @@ void G_DrawStatusBar(int32_t snum)
|
||||||
else i = p->curr_weapon;
|
else i = p->curr_weapon;
|
||||||
|
|
||||||
if (p->curr_weapon != KNEE_WEAPON &&
|
if (p->curr_weapon != KNEE_WEAPON &&
|
||||||
(!althud_flashing || (int32_t)totalclock&32 || p->ammo_amount[i] > (p->max_ammo_amount[i]/10)))
|
(!althud_flashing || (int32_t) totalclock&32 || p->ammo_amount[i] > (p->max_ammo_amount[i]/10)))
|
||||||
G_DrawAltDigiNum(-20, -(hudoffset-22), p->ammo_amount[i], -16, 10+16+512);
|
G_DrawAltDigiNum(-20, -(hudoffset-22), p->ammo_amount[i], -16, 10+16+512);
|
||||||
|
|
||||||
o = 102;
|
o = 102;
|
||||||
|
|
|
@ -273,12 +273,12 @@ static void G_DrawCameraText(int16_t i)
|
||||||
rotatesprite_win(22<<16, 163<<16, 65536L, 512, CAMCORNER+1, 0, 0, 2+4);
|
rotatesprite_win(22<<16, 163<<16, 65536L, 512, CAMCORNER+1, 0, 0, 2+4);
|
||||||
rotatesprite_win((310-10)<<16, 163<<16, 65536L, 512, CAMCORNER+1, 0, 0, 2);
|
rotatesprite_win((310-10)<<16, 163<<16, 65536L, 512, CAMCORNER+1, 0, 0, 2);
|
||||||
|
|
||||||
if ((int32_t)totalclock & 16)
|
if ((int32_t) totalclock&16)
|
||||||
rotatesprite_win(46<<16, 32<<16, 65536L, 0, CAMLIGHT, 0, 0, 2);
|
rotatesprite_win(46<<16, 32<<16, 65536L, 0, CAMLIGHT, 0, 0, 2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int32_t flipbits = ((int32_t)totalclock << 1) & 48;
|
int32_t flipbits = ((int32_t) totalclock<<1)&48;
|
||||||
|
|
||||||
for (bssize_t x=-64; x<394; x+=64)
|
for (bssize_t x=-64; x<394; x+=64)
|
||||||
for (bssize_t y=0; y<200; y+=64)
|
for (bssize_t y=0; y<200; y+=64)
|
||||||
|
@ -584,7 +584,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16
|
||||||
if (p == screenpeek || GTFLAGS(GAMETYPE_OTHERPLAYERSINMAP))
|
if (p == screenpeek || GTFLAGS(GAMETYPE_OTHERPLAYERSINMAP))
|
||||||
{
|
{
|
||||||
if (pSprite->xvel > 16 && pPlayer->on_ground)
|
if (pSprite->xvel > 16 && pPlayer->on_ground)
|
||||||
i = APLAYERTOP + (((int32_t)totalclock >> 4) & 3);
|
i = APLAYERTOP+(((int32_t) totalclock>>4)&3);
|
||||||
else
|
else
|
||||||
i = APLAYERTOP;
|
i = APLAYERTOP;
|
||||||
|
|
||||||
|
@ -1367,8 +1367,8 @@ void G_FadePalette(int32_t r, int32_t g, int32_t b, int32_t e)
|
||||||
videoFadePalette(r, g, b, e);
|
videoFadePalette(r, g, b, e);
|
||||||
videoNextPage();
|
videoNextPage();
|
||||||
|
|
||||||
int32_t tc = (int32_t)totalclock;
|
int32_t tc = (int32_t) totalclock;
|
||||||
while ((int32_t)totalclock < tc + 4)
|
while (totalclock < tc + 4)
|
||||||
G_HandleAsync();
|
G_HandleAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1676,7 +1676,7 @@ void G_DisplayLogo(void)
|
||||||
soundanm++;
|
soundanm++;
|
||||||
S_PlaySound(PIPEBOMB_EXPLODE);
|
S_PlaySound(PIPEBOMB_EXPLODE);
|
||||||
}
|
}
|
||||||
rotatesprite_fs(160 << 16, 104 << 16, ((int32_t)totalclock - 120) << 10, 0, DUKENUKEM, 0, 0, 2 + 8);
|
rotatesprite_fs(160<<16, 104<<16, ((int32_t) totalclock-120)<<10, 0, DUKENUKEM, 0, 0, 2+8);
|
||||||
}
|
}
|
||||||
else if (totalclock >= (120+60))
|
else if (totalclock >= (120+60))
|
||||||
rotatesprite_fs(160<<16, (104)<<16, 60<<10, 0, DUKENUKEM, 0, 0, 2+8);
|
rotatesprite_fs(160<<16, (104)<<16, 60<<10, 0, DUKENUKEM, 0, 0, 2+8);
|
||||||
|
@ -1690,7 +1690,7 @@ void G_DisplayLogo(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
rotatesprite_fs(160<<16, (104)<<16, 60<<10, 0, DUKENUKEM, 0, 0, 2+8);
|
rotatesprite_fs(160<<16, (104)<<16, 60<<10, 0, DUKENUKEM, 0, 0, 2+8);
|
||||||
rotatesprite_fs(160 << 16, (129) << 16, ((int32_t)totalclock - 220) << 11, 0, THREEDEE, 0, 0, 2 + 8);
|
rotatesprite_fs(160<<16, (129)<<16, ((int32_t) totalclock - 220)<<11, 0, THREEDEE, 0, 0, 2+8);
|
||||||
}
|
}
|
||||||
else if (totalclock >= (220+30))
|
else if (totalclock >= (220+30))
|
||||||
rotatesprite_fs(160<<16, (129)<<16, 30<<11, 0, THREEDEE, 0, 0, 2+8);
|
rotatesprite_fs(160<<16, (129)<<16, 30<<11, 0, THREEDEE, 0, 0, 2+8);
|
||||||
|
@ -1700,7 +1700,7 @@ void G_DisplayLogo(void)
|
||||||
// JBF 20030804
|
// JBF 20030804
|
||||||
if (totalclock >= 280 && totalclock < 395)
|
if (totalclock >= 280 && totalclock < 395)
|
||||||
{
|
{
|
||||||
rotatesprite_fs(160<<16, (151)<<16, (410-(int32_t)totalclock)<<12, 0, PLUTOPAKSPRITE+1, (sintable[((int32_t)totalclock<<4)&2047]>>11), 0, 2+8);
|
rotatesprite_fs(160<<16, (151)<<16, (410-(int32_t) totalclock)<<12, 0, PLUTOPAKSPRITE+1, (sintable[((int32_t) totalclock<<4)&2047]>>11), 0, 2+8);
|
||||||
if (soundanm == 2)
|
if (soundanm == 2)
|
||||||
{
|
{
|
||||||
soundanm++;
|
soundanm++;
|
||||||
|
@ -1714,7 +1714,7 @@ void G_DisplayLogo(void)
|
||||||
soundanm++;
|
soundanm++;
|
||||||
S_PlaySound(PIPEBOMB_EXPLODE);
|
S_PlaySound(PIPEBOMB_EXPLODE);
|
||||||
}
|
}
|
||||||
rotatesprite_fs(160<<16, (151)<<16, 30<<11, 0, PLUTOPAKSPRITE+1, (sintable[((int32_t)totalclock<<4)&2047]>>11), 0, 2+8);
|
rotatesprite_fs(160<<16, (151)<<16, 30<<11, 0, PLUTOPAKSPRITE+1, (sintable[((int32_t) totalclock<<4)&2047]>>11), 0, 2+8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2383,7 +2383,7 @@ void G_BonusScreen(int32_t bonusonly)
|
||||||
|
|
||||||
if (totalclock >= 1000000000 && totalclock < 1000000320)
|
if (totalclock >= 1000000000 && totalclock < 1000000320)
|
||||||
{
|
{
|
||||||
switch (((int32_t)totalclock >> 4) % 15)
|
switch (((int32_t) totalclock>>4)%15)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (bonuscnt == 6)
|
if (bonuscnt == 6)
|
||||||
|
@ -2423,7 +2423,7 @@ void G_BonusScreen(int32_t bonusonly)
|
||||||
else if ((int32_t)totalclock > (10240+120L)) break;
|
else if ((int32_t)totalclock > (10240+120L)) break;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (((int32_t)totalclock >> 5) & 3)
|
switch (((int32_t) totalclock>>5)&3)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -2977,7 +2977,7 @@ void G_BonusScreenRRRA(int32_t bonusonly)
|
||||||
|
|
||||||
if (totalclock >= 1000000000 && totalclock < 1000000320)
|
if (totalclock >= 1000000000 && totalclock < 1000000320)
|
||||||
{
|
{
|
||||||
switch (((uint32_t)totalclock>>4)%15)
|
switch (((int32_t) totalclock>>4)%15)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (bonuscnt == 6)
|
if (bonuscnt == 6)
|
||||||
|
@ -3013,7 +3013,7 @@ void G_BonusScreenRRRA(int32_t bonusonly)
|
||||||
else if ((int32_t)totalclock > (10240+120L)) break;
|
else if ((int32_t)totalclock > (10240+120L)) break;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (((int32_t)totalclock >> 5) & 3)
|
switch (((int32_t) totalclock>>5)&3)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -3205,7 +3205,7 @@ void G_BonusScreenRRRA(int32_t bonusonly)
|
||||||
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1);
|
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1);
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
switch (((int32_t)totalclock >> 4) & 1)
|
switch (((int32_t) totalclock >> 4) & 1)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
rotatesprite(0,0,65536,0,RRTILE8677,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1);
|
rotatesprite(0,0,65536,0,RRTILE8677,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1);
|
||||||
|
|
|
@ -552,7 +552,7 @@ void G_AnimateCamSprite(int smoothRatio)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
T1(spriteNum) = (int32_t)totalclock;
|
T1(spriteNum) = (int32_t) totalclock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ void CheckSndData(char *file, int line)
|
||||||
//
|
//
|
||||||
|
|
||||||
void
|
void
|
||||||
SoundCallBack(unsigned int num)
|
SoundCallBack(intptr_t num)
|
||||||
{
|
{
|
||||||
VOC_INFOp vp;
|
VOC_INFOp vp;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue