/source/duke3d/src/duke3d.h |
---|
123,6 → 123,8 |
// JBF 20040604: sync is a function on some platforms |
#define sync dsync |
#define WT_WIDE(x) (WORLDTOUR ? (x ## WIDE) : (x)) |
// Uncomment the following to remove calls to a.nasm functions with the GL renderers |
// so that debugging with valgrind --smc-check=none is possible: |
//#define DEBUG_VALGRIND_NO_SMC |
/source/duke3d/src/menus.cpp |
---|
34,6 → 34,7 |
#include "savegame.h" |
#include "xxhash.h" |
#include "music.h" |
#include "sbar.h" |
#ifndef __ANDROID__ |
droidinput_t droidinput; |
2439,9 → 2440,11 |
case MENU_COLCORR: |
case MENU_COLCORR_INGAME: |
{ |
// center panel |
rotatesprite_fs(origin.x + (120<<16), origin.y + (32<<16), 16384, 0, 3290, 0, 0, 2|8|16); |
rotatesprite_fs(origin.x + (160<<16) - (tilesiz[BOTTOMSTATUSBAR].x<<13), origin.y + (82<<16) - (tilesiz[BOTTOMSTATUSBAR].y<<14), 16384, 0, BOTTOMSTATUSBAR, 0, 0, 2|8|16); |
int32_t const statusTile = sbartile(); |
rotatesprite_fs(origin.x + (160<<16) - (tilesiz[statusTile].x<<13), origin.y + (82<<16) - (tilesiz[statusTile].y<<14), 16384, 0, statusTile, 0, 0, 2|8|16); |
// left panel |
rotatesprite_fs(origin.x + (40<<16), origin.y + (32<<16), 16384, 0, BONUSSCREEN, 0, 0, 2|8|16); |
2449,6 → 2452,7 |
// right panel |
rotatesprite_fs(origin.x + (200<<16), origin.y + (32<<16), 16384, 0, LOADSCREEN, 0, 0, 2|8|16); |
break; |
} |
case MENU_NETSETUP: |
case MENU_NETHOST: |
/source/duke3d/src/player.cpp |
---|
2400,7 → 2400,7 |
weaponX -= sintable[(768 + ((*weaponFrame) << 7)) & 2047] >> 11; |
weaponYOffset += sintable[(768 + ((*weaponFrame) << 7)) & 2047] >> 11; |
if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) |
if (!WORLDTOUR && !(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) |
weaponBits |= 512; |
if (*weaponFrame > 0) |
2420,7 → 2420,7 |
} |
} |
G_DrawWeaponTileWithID(currentWeapon, weaponX + 164, (weaponY << 1) + 176 - weaponYOffset, RPGGUN, weaponShade, |
G_DrawWeaponTileWithID(currentWeapon, weaponX + 164, (weaponY << 1) + 176 - weaponYOffset, WT_WIDE(RPGGUN), weaponShade, |
weaponBits, weaponPal); |
break; |
2659,6 → 2659,7 |
break; |
case PISTOL_WEAPON: |
{ |
if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, TotalTime)+1) |
{ |
static uint8_t pistolFrames[] = { 0, 1, 2 }; |
2674,9 → 2675,11 |
break; |
} |
if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING) && DUKE) |
if (!WORLDTOUR && !(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING) && DUKE) |
weaponBits |= 512; |
int32_t const FIRSTGUN_5 = WORLDTOUR ? FIRSTGUNRELOADWIDE : FIRSTGUN + 5; |
if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - (NAM_WW2GI ? 40 : 17)) |
G_DrawWeaponTileWithID(currentWeapon, 194 - (pPlayer->look_ang >> 1), weaponY + 230 - weaponYOffset, FIRSTGUN + 4, |
weaponShade, weaponBits, weaponPal); |
2685,7 → 2688,7 |
G_DrawWeaponTileWithID(currentWeapon << 1, 244 - ((*weaponFrame) << 3) - (pPlayer->look_ang >> 1), |
weaponY + 130 - weaponYOffset + ((*weaponFrame) << 4), FIRSTGUN + 6, weaponShade, |
weaponBits, weaponPal); |
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN + 5, |
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN_5, |
weaponShade, weaponBits, weaponPal); |
} |
else if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - (NAM_WW2GI ? 30 : 7)) |
2693,7 → 2696,7 |
G_DrawWeaponTileWithID(currentWeapon << 1, 124 + ((*weaponFrame) << 1) - (pPlayer->look_ang >> 1), |
weaponY + 430 - weaponYOffset - ((*weaponFrame) << 3), FIRSTGUN + 6, weaponShade, |
weaponBits, weaponPal); |
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN + 5, |
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN_5, |
weaponShade, weaponBits, weaponPal); |
} |
2701,7 → 2704,7 |
{ |
G_DrawWeaponTileWithID(currentWeapon << 2, 184 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset, |
FIRSTGUN + 8, weaponShade, weaponBits, weaponPal); |
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 210 - weaponYOffset, FIRSTGUN + 5, |
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 210 - weaponYOffset, FIRSTGUN_5, |
weaponShade, weaponBits, weaponPal); |
} |
else if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - (NAM_WW2GI ? 6 : 2)) |
2708,14 → 2711,15 |
{ |
G_DrawWeaponTileWithID(currentWeapon << 2, 164 - (pPlayer->look_ang >> 1), weaponY + 245 - weaponYOffset, |
FIRSTGUN + 8, weaponShade, weaponBits, weaponPal); |
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN + 5, |
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN_5, |
weaponShade, weaponBits, weaponPal); |
} |
else if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload)) |
G_DrawWeaponTileWithID(currentWeapon, 194 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset, FIRSTGUN + 5, |
G_DrawWeaponTileWithID(currentWeapon, 194 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset, FIRSTGUN_5, |
weaponShade, weaponBits, weaponPal); |
break; |
} |
case HANDBOMB_WEAPON: |
{ |
2866,7 → 2870,7 |
break; |
case FREEZE_WEAPON: |
if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING) && DUKE) |
if (!WORLDTOUR && !(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING) && DUKE) |
weaponBits |= 512; |
if ((*weaponFrame) < (PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime) + 1) && (*weaponFrame) > 0) |
2880,13 → 2884,13 |
} |
weaponYOffset -= 16; |
G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 261 - weaponYOffset, |
FREEZE + 2, -32, weaponBits, weaponPal); |
WORLDTOUR ? FREEZEFIREWIDE : FREEZE + 2, -32, weaponBits, weaponPal); |
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset, |
FREEZE + 3 + freezerFrames[*weaponFrame % 6], -32, weaponBits, weaponPal); |
} |
else |
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 261 - weaponYOffset, |
FREEZE, weaponShade, weaponBits, weaponPal); |
WT_WIDE(FREEZE), weaponShade, weaponBits, weaponPal); |
break; |
case FLAMETHROWER_WEAPON: |
2989,7 → 2993,7 |
G_DrawWeaponTileUnfadedWithID(currentWeapon << 1, weaponX + 184 - halfLookAng, weaponY + 240 - weaponYOffset, |
SHRINKER + 3 + ((*weaponFrame) & 3), -32, weaponBits, currentWeapon == GROW_WEAPON ? 2 : 0); |
G_DrawWeaponTileWithID(currentWeapon, weaponX + 188 - halfLookAng, weaponY + 240 - weaponYOffset, |
currentWeapon == GROW_WEAPON ? SHRINKER - 1 : SHRINKER + 1, weaponShade, weaponBits, weaponPal); |
WT_WIDE(SHRINKER) + (currentWeapon == GROW_WEAPON ? -1 : 1), weaponShade, weaponBits, weaponPal); |
} |
else |
{ |
2997,7 → 3001,7 |
SHRINKER + 2, 16 - (sintable[pPlayer->random_club_frame & 2047] >> 10), weaponBits, |
currentWeapon == GROW_WEAPON ? 2 : 0); |
G_DrawWeaponTileWithID(currentWeapon, weaponX + 188 - halfLookAng, weaponY + 240 - weaponYOffset, |
currentWeapon == GROW_WEAPON ? SHRINKER - 2 : SHRINKER, weaponShade, weaponBits, weaponPal); |
WT_WIDE(SHRINKER) + (currentWeapon == GROW_WEAPON ? -2 : 0), weaponShade, weaponBits, weaponPal); |
} |
break; |
} |
/source/duke3d/src/premap.cpp |
---|
26,6 → 26,7 |
#include "duke3d.h" |
#include "menus.h" |
#include "savegame.h" |
#include "sbar.h" |
#include "vfs.h" |
175,15 → 176,22 |
for (int j=CHAINGUN; j<=CHAINGUN+7; j++) tloadtile(j,1); |
break; |
case RPGSPRITE__STATIC: |
for (int j=RPGGUN; j<=RPGGUN+2; j++) tloadtile(j,1); |
tloadtile(WT_WIDE(RPGGUN), 1); |
for (int j=RPGGUN+1; j<=RPGGUN+2; j++) tloadtile(j,1); |
break; |
case FREEZESPRITE__STATIC: |
for (int j=FREEZE; j<=FREEZE+5; j++) tloadtile(j,1); |
tloadtile(WT_WIDE(FREEZE), 1); |
tloadtile(WORLDTOUR ? FREEZEFIREWIDE : FREEZE+2, 1); |
for (int j=FREEZE+3; j<=FREEZE+5; j++) tloadtile(j,1); |
break; |
case GROWSPRITEICON__STATIC: |
case SHRINKERSPRITE__STATIC: |
for (int j=SHRINKER-2; j<=SHRINKER+5; j++) tloadtile(j,1); |
{ |
int32_t const tile = WT_WIDE(SHRINKER); |
for (int j=tile-2; j<=tile+1; j++) tloadtile(j,1); |
for (int j=SHRINKER+2; j<=SHRINKER+5; j++) tloadtile(j,1); |
break; |
} |
case HBOMBAMMO__STATIC: |
case HEAVYHBOMB__STATIC: |
for (int j=HANDREMOTE; j<=HANDREMOTE+5; j++) tloadtile(j,1); |
208,7 → 216,7 |
#ifndef EDUKE32_STANDALONE |
static void cacheDukeTiles(void) |
{ |
tloadtile(BOTTOMSTATUSBAR, 1); |
tloadtile(sbartile(), 1); |
if ((g_netServer || ud.multimode > 1)) |
tloadtile(FRAGBAR, 1); |
235,7 → 243,11 |
for (int i = FIRSTGUN; i < FIRSTGUN+3; i++) |
tloadtile(i, 1); |
for (int i = FIRSTGUNRELOAD; i < FIRSTGUNRELOAD+8; i++) |
tloadtile(FIRSTGUNRELOAD, 1); |
tloadtile(WORLDTOUR ? FIRSTGUNRELOADWIDE : FIRSTGUNRELOAD+1, 1); |
tloadtile(FIRSTGUNRELOAD+2, 1); |
tloadtile(FIRSTGUNRELOAD+4, 1); |
for (int i = SHELL; i < SHELL+2; i++) |
tloadtile(i, 1); |
for (int i = EXPLOSION2; i < EXPLOSION2+21; i++) |
573,7 → 585,7 |
renderFlushPerms(); |
int const screenSize = max(ud.screen_size - 8, 0); |
int const bottomStatusY = tilesiz[BOTTOMSTATUSBAR].y; |
int const bottomStatusY = tilesiz[sbartile()].y; |
vec2_t v1 = { scale(screenSize, xdim, 160), |
scale(screenSize, (200 * 100) - (bottomStatusY * ud.statusbarscale), 200 - bottomStatusY) }; |
/source/duke3d/src/sbar.cpp |
---|
73,15 → 73,16 |
static void G_PatchStatusBar(int32_t x1, int32_t y1, int32_t x2, int32_t y2) |
{ |
int32_t const statusTile = sbartile(); |
int32_t const scl = sbarsc(65536); |
int32_t const tx = sbarx16((160<<16) - (tilesiz[BOTTOMSTATUSBAR].x<<15)); // centered |
int32_t const ty = sbary(200-tilesiz[BOTTOMSTATUSBAR].y); |
int32_t const tx = sbarx16((160<<16) - (tilesiz[statusTile].x<<15)); // centered |
int32_t const ty = sbary(200-tilesiz[statusTile].y); |
int32_t const clx1 = sbarsc(scale(x1, xdim, 320)), cly1 = sbarsc(scale(y1, ydim, 200)); |
int32_t const clx2 = sbarsc(scale(x2, xdim, 320)), cly2 = sbarsc(scale(y2, ydim, 200)); |
int32_t const clofx = (xdim - sbarsc(xdim)) >> 1, clofy = (ydim - sbarsc(ydim)); |
rotatesprite(tx, ty, scl, 0, BOTTOMSTATUSBAR, 4, 0, 10+16+64, clx1+clofx, cly1+clofy, clx2+clofx-1, cly2+clofy-1); |
rotatesprite(tx, ty, scl, 0, statusTile, 4, 0, 10+16+64, clx1+clofx, cly1+clofy, clx2+clofx-1, cly2+clofy-1); |
} |
#define POLYMOSTTRANS (1) |
415,10 → 416,12 |
} |
else // full HUD |
{ |
y = (200<<16) - (sbarsc(tilesiz[BOTTOMSTATUSBAR].y<<16) + (12<<16) + (tilesiz[BOTTOMSTATUSBAR].y<<(16-1))); |
int32_t const statusTile = sbartile(); |
y = (200<<16) - (sbarsc(tilesiz[statusTile].y<<16) + (12<<16) + (tilesiz[statusTile].y<<(16-1))); |
if (!ud.statusbarmode) // original non-overlay mode |
y += sbarsc(tilesiz[BOTTOMSTATUSBAR].y<<16)>>1; // account for the viewport y-size as the HUD scales |
y += sbarsc(tilesiz[statusTile].y<<16)>>1; // account for the viewport y-size as the HUD scales |
} |
if (ud.screen_size == 4 && !ud.althud) // classic mini-HUD |
564,7 → 567,7 |
const int32_t althud = ud.althud; |
#endif |
const int32_t SBY = (200-tilesiz[BOTTOMSTATUSBAR].y); |
const int32_t SBY = (200-tilesiz[sbartile()].y); |
const int32_t sb15 = sbarsc(32768), sb15h = sbarsc(49152); |
const int32_t sb16 = sbarsc(65536); |
/source/duke3d/src/sbar.h |
---|
36,3 → 36,8 |
int32_t sbary16(int32_t y); |
void G_DrawInventory(const DukePlayer_t *p); |
void G_DrawStatusBar(int32_t snum); |
static FORCE_INLINE int32_t sbartile(void) |
{ |
return WORLDTOUR ? WIDESCREENSTATUSBAR : BOTTOMSTATUSBAR; |
} |
/source/duke3d/src/screens.cpp |
---|
1305,7 → 1305,7 |
i -= sbarsc(ud.althud ? (tilesiz[BIGALPHANUM].y+8)<<16 : tilesiz[INVENTORYBOX].y<<16); |
} |
else if (ud.screen_size > 2) |
i -= sbarsc(tilesiz[BOTTOMSTATUSBAR].y<<16); |
i -= sbarsc(tilesiz[sbartile()].y<<16); |
int32_t const xbetween = (tilesiz[MF_Bluefont.tilenum + 'A' - '!'].x<<16) + MF_Bluefont.between.x; |