Merge remote-tracking branch 'origin/master' into nights-inufixes

This commit is contained in:
mazmazz 2018-08-30 08:13:34 -04:00
commit a44be49535
37 changed files with 1809 additions and 1082 deletions

View File

@ -57,49 +57,6 @@ matrix:
- gcc-4.8 - gcc-4.8
compiler: gcc-4.8 compiler: gcc-4.8
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- p7zip-full
- gcc-4.9
compiler: gcc-4.9
#gcc-4.9 (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- p7zip-full
- gcc-5
compiler: gcc-5
#gcc-5 (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- p7zip-full
- gcc-6
compiler: gcc-6
env: WFLAGS="-Wno-tautological-compare"
#gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511
- os: linux - os: linux
addons: addons:
apt: apt:

View File

@ -8,7 +8,7 @@
UINT8 cdaudio_started = 0; UINT8 cdaudio_started = 0;
consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};

View File

@ -811,6 +811,7 @@ void D_RegisterClientCommands(void)
COM_AddCommand("writethings", Command_Writethings_f); COM_AddCommand("writethings", Command_Writethings_f);
CV_RegisterVar(&cv_speed); CV_RegisterVar(&cv_speed);
CV_RegisterVar(&cv_opflags); CV_RegisterVar(&cv_opflags);
CV_RegisterVar(&cv_ophoopflags);
CV_RegisterVar(&cv_mapthingnum); CV_RegisterVar(&cv_mapthingnum);
// CV_RegisterVar(&cv_grid); // CV_RegisterVar(&cv_grid);
// CV_RegisterVar(&cv_snapto); // CV_RegisterVar(&cv_snapto);
@ -822,7 +823,6 @@ void D_RegisterClientCommands(void)
COM_AddCommand("getallemeralds", Command_Getallemeralds_f); COM_AddCommand("getallemeralds", Command_Getallemeralds_f);
COM_AddCommand("resetemeralds", Command_Resetemeralds_f); COM_AddCommand("resetemeralds", Command_Resetemeralds_f);
COM_AddCommand("setrings", Command_Setrings_f); COM_AddCommand("setrings", Command_Setrings_f);
COM_AddCommand("setspheres", Command_Setspheres_f);
COM_AddCommand("setlives", Command_Setlives_f); COM_AddCommand("setlives", Command_Setlives_f);
COM_AddCommand("setcontinues", Command_Setcontinues_f); COM_AddCommand("setcontinues", Command_Setcontinues_f);
COM_AddCommand("devmode", Command_Devmode_f); COM_AddCommand("devmode", Command_Devmode_f);

View File

@ -382,7 +382,7 @@ typedef struct player_s
fixed_t height; // Bounding box changes. fixed_t height; // Bounding box changes.
fixed_t spinheight; fixed_t spinheight;
SINT8 lives; SINT8 lives; // number of lives - if == INFLIVES, the player has infinite lives
SINT8 continues; // continues that player has acquired SINT8 continues; // continues that player has acquired
SINT8 xtralife; // Ring Extra Life counter SINT8 xtralife; // Ring Extra Life counter
@ -456,16 +456,25 @@ typedef struct player_s
boolean bonustime; // Capsule destroyed, now it's bonus time! boolean bonustime; // Capsule destroyed, now it's bonus time!
mobj_t *capsule; // Go inside the capsule mobj_t *capsule; // Go inside the capsule
UINT8 mare; // Current mare UINT8 mare; // Current mare
UINT8 marelap; // Current mare lap
UINT8 marebonuslap; // Current mare lap starting from bonus time
// Statistical purposes. // Statistical purposes.
tic_t marebegunat; // Leveltime when mare begun tic_t marebegunat; // Leveltime when mare begun
tic_t startedtime; // Time which you started this mare with. tic_t startedtime; // Time which you started this mare with.
tic_t finishedtime; // Time it took you to finish the mare (used for display) tic_t finishedtime; // Time it took you to finish the mare (used for display)
tic_t lapbegunat; // Leveltime when lap begun
tic_t lapstartedtime; // Time which you started this lap with.
INT16 finishedspheres; // The spheres you had left upon finishing the mare INT16 finishedspheres; // The spheres you had left upon finishing the mare
INT16 finishedrings; // The rings/stars you had left upon finishing the mare INT16 finishedrings; // The rings/stars you had left upon finishing the mare
UINT32 marescore; // score for this nights stage UINT32 marescore; // score for this nights stage
UINT32 lastmarescore; // score for the last mare UINT32 lastmarescore; // score for the last mare
UINT32 totalmarescore; // score for all mares
UINT8 lastmare; // previous mare UINT8 lastmare; // previous mare
UINT8 lastmarelap; // previous mare lap
UINT8 lastmarebonuslap; // previous mare bonus lap
UINT8 totalmarelap; // total mare lap
UINT8 totalmarebonuslap; // total mare bonus lap
INT32 maxlink; // maximum link obtained INT32 maxlink; // maximum link obtained
UINT8 texttimer; // nights_texttime should not be local UINT8 texttimer; // nights_texttime should not be local
UINT8 textvar; // which line of NiGHTS text to show -- let's not use cheap hacks UINT8 textvar; // which line of NiGHTS text to show -- let's not use cheap hacks
@ -491,4 +500,7 @@ typedef struct player_s
#endif #endif
} player_t; } player_t;
// Value for infinite lives
#define INFLIVES 0x7F
#endif #endif

View File

@ -1203,6 +1203,8 @@ static void readlevelheader(MYFILE *f, INT32 num)
deh_warning("Level header %d: invalid bonus type number %d", num, i); deh_warning("Level header %d: invalid bonus type number %d", num, i);
} }
else if (fastcmp(word, "MAXBONUSLIVES"))
mapheaderinfo[num-1]->maxbonuslives = (SINT8)i;
else if (fastcmp(word, "LEVELFLAGS")) else if (fastcmp(word, "LEVELFLAGS"))
mapheaderinfo[num-1]->levelflags = (UINT8)i; mapheaderinfo[num-1]->levelflags = (UINT8)i;
else if (fastcmp(word, "MENUFLAGS")) else if (fastcmp(word, "MENUFLAGS"))
@ -4925,6 +4927,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_SUSPICIOUSFACESTABBERSTATUE_WAIT", "S_SUSPICIOUSFACESTABBERSTATUE_WAIT",
"S_SUSPICIOUSFACESTABBERSTATUE_BURST1", "S_SUSPICIOUSFACESTABBERSTATUE_BURST1",
"S_SUSPICIOUSFACESTABBERSTATUE_BURST2", "S_SUSPICIOUSFACESTABBERSTATUE_BURST2",
"S_BRAMBLES",
// Big Tumbleweed // Big Tumbleweed
"S_BIGTUMBLEWEED", "S_BIGTUMBLEWEED",
@ -6581,6 +6584,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_CRAWLASTATUE", // Crawla statue "MT_CRAWLASTATUE", // Crawla statue
"MT_FACESTABBERSTATUE", // Facestabber statue "MT_FACESTABBERSTATUE", // Facestabber statue
"MT_SUSPICIOUSFACESTABBERSTATUE", // :eggthinking: "MT_SUSPICIOUSFACESTABBERSTATUE", // :eggthinking:
"MT_BRAMBLES", // Brambles
// Arid Canyon Scenery // Arid Canyon Scenery
"MT_BIGTUMBLEWEED", "MT_BIGTUMBLEWEED",
@ -7317,6 +7321,8 @@ struct {
{"CODEBASE",CODEBASE}, // or what release of SRB2 this is. {"CODEBASE",CODEBASE}, // or what release of SRB2 this is.
{"VERSION",VERSION}, // Grab the game's version! {"VERSION",VERSION}, // Grab the game's version!
{"SUBVERSION",SUBVERSION}, // more precise version number {"SUBVERSION",SUBVERSION}, // more precise version number
{"NEWTICRATE",NEWTICRATE}, // TICRATE*NEWTICRATERATIO
{"NEWTICRATERATIO",NEWTICRATERATIO},
// Special linedef executor tag numbers! // Special linedef executor tag numbers!
{"LE_PINCHPHASE",LE_PINCHPHASE}, // A boss entered pinch phase (and, in most cases, is preparing their pinch phase attack!) {"LE_PINCHPHASE",LE_PINCHPHASE}, // A boss entered pinch phase (and, in most cases, is preparing their pinch phase attack!)
@ -7611,6 +7617,9 @@ struct {
{"WEP_RAIL",WEP_RAIL}, {"WEP_RAIL",WEP_RAIL},
{"NUM_WEAPONS",NUM_WEAPONS}, {"NUM_WEAPONS",NUM_WEAPONS},
// Value for infinite lives
{"INFLIVES", INFLIVES},
// Got Flags, for player->gotflag! // Got Flags, for player->gotflag!
// Used to be MF_ for some stupid reason, now they're GF_ to stop them looking like mobjflags // Used to be MF_ for some stupid reason, now they're GF_ to stop them looking like mobjflags
{"GF_REDFLAG",GF_REDFLAG}, {"GF_REDFLAG",GF_REDFLAG},

View File

@ -50,7 +50,7 @@ static boolean wasPlaying;
static int cdVolume=0; // current cd volume (0-31) static int cdVolume=0; // current cd volume (0-31)
// 0-31 like Music & Sfx, though CD hardware volume is 0-255. // 0-31 like Music & Sfx, though CD hardware volume is 0-255.
consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// allow Update for next/loop track // allow Update for next/loop track
// some crap cd drivers take up to // some crap cd drivers take up to

View File

@ -244,6 +244,7 @@ typedef struct
SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no. SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no.
UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in? UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in?
SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.) SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.)
SINT8 maxbonuslives; ///< How many bonus lives to award at Intermission? (-1 for unlimited.)
UINT8 levelflags; ///< LF_flags: merged eight booleans into one UINT8 for space, see below UINT8 levelflags; ///< LF_flags: merged eight booleans into one UINT8 for space, see below
UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus

View File

@ -2231,6 +2231,8 @@ void G_PlayerReborn(INT32 player)
if (p->mare == 255) if (p->mare == 255)
p->mare = 0; p->mare = 0;
p->marelap = p->marebonuslap = 0;
// Check to make sure their color didn't change somehow... // Check to make sure their color didn't change somehow...
if (G_GametypeHasTeams()) if (G_GametypeHasTeams())
{ {
@ -4665,6 +4667,7 @@ void G_GhostTicker(void)
p->next = g->next; p->next = g->next;
else else
ghosts = g->next; ghosts = g->next;
Z_Free(g);
continue; continue;
} }
p = g; p = g;
@ -5665,29 +5668,28 @@ void G_AddGhost(char *defdemoname)
mthing = playerstarts[0]; mthing = playerstarts[0];
I_Assert(mthing); I_Assert(mthing);
{ // A bit more complex than P_SpawnPlayer because ghosts aren't solid and won't just push themselves out of the ceiling. { // A bit more complex than P_SpawnPlayer because ghosts aren't solid and won't just push themselves out of the ceiling.
fixed_t x,y,z; fixed_t z,f,c;
sector_t *sector; gh->mo = P_SpawnMobj(mthing->x << FRACBITS, mthing->y << FRACBITS, 0, MT_GHOST);
x = mthing->x << FRACBITS; gh->mo->angle = FixedAngle(mthing->angle*FRACUNIT);
y = mthing->y << FRACBITS; f = gh->mo->floorz;
sector = R_PointInSubsector(x, y)->sector; c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height;
if (!!(mthing->options & MTF_AMBUSH) ^ !!(mthing->options & MTF_OBJECTFLIP)) if (!!(mthing->options & MTF_AMBUSH) ^ !!(mthing->options & MTF_OBJECTFLIP))
{ {
z = sector->ceilingheight - mobjinfo[MT_PLAYER].height; z = c;
if (mthing->options >> ZSHIFT) if (mthing->options >> ZSHIFT)
z -= ((mthing->options >> ZSHIFT) << FRACBITS); z -= ((mthing->options >> ZSHIFT) << FRACBITS);
if (z < sector->floorheight) if (z < f)
z = sector->floorheight; z = f;
} }
else else
{ {
z = sector->floorheight; z = f;
if (mthing->options >> ZSHIFT) if (mthing->options >> ZSHIFT)
z += ((mthing->options >> ZSHIFT) << FRACBITS); z += ((mthing->options >> ZSHIFT) << FRACBITS);
if (z > sector->ceilingheight - mobjinfo[MT_PLAYER].height) if (z > c)
z = sector->ceilingheight - mobjinfo[MT_PLAYER].height; z = c;
} }
gh->mo = P_SpawnMobj(x, y, z, MT_GHOST); gh->mo->z = z;
gh->mo->angle = FixedAngle(mthing->angle*FRACUNIT);
} }
gh->oldmo.x = gh->mo->x; gh->oldmo.x = gh->mo->x;
@ -5886,8 +5888,14 @@ boolean G_CheckDemoStatus(void)
{ {
boolean saved; boolean saved;
if(ghosts) // ... ... ... while (ghosts)
ghosts = NULL; // :) {
demoghost *next = ghosts->next;
Z_Free(ghosts);
ghosts = next;
}
ghosts = NULL;
// DO NOT end metal sonic demos here // DO NOT end metal sonic demos here

View File

@ -69,6 +69,7 @@ patch_t *nightsnum[10]; // 0-9
// Level title and credits fonts // Level title and credits fonts
patch_t *lt_font[LT_FONTSIZE]; patch_t *lt_font[LT_FONTSIZE];
patch_t *cred_font[CRED_FONTSIZE]; patch_t *cred_font[CRED_FONTSIZE];
patch_t *ttlnum[20]; // act numbers (0-19)
static player_t *plr; static player_t *plr;
boolean chat_on; // entering a chat message? boolean chat_on; // entering a chat message?
@ -237,6 +238,13 @@ void HU_LoadGraphics(void)
tallminus = (patch_t *)W_CachePatchName("STTMINUS", PU_HUDGFX); tallminus = (patch_t *)W_CachePatchName("STTMINUS", PU_HUDGFX);
tallinfin = (patch_t *)W_CachePatchName("STTINFIN", PU_HUDGFX); tallinfin = (patch_t *)W_CachePatchName("STTINFIN", PU_HUDGFX);
// cache act numbers for level titles
for (i = 0; i < 20; i++)
{
sprintf(buffer, "TTL%.2d", i);
ttlnum[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
}
// cache the crosshairs, don't bother to know which one is being used, // cache the crosshairs, don't bother to know which one is being used,
// just cache all 3, they're so small anyway. // just cache all 3, they're so small anyway.
for (i = 0; i < HU_CROSSHAIRS; i++) for (i = 0; i < HU_CROSSHAIRS; i++)
@ -1267,7 +1275,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
} }
} }
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != 0x7f)) //show lives if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|(greycheck ? V_60TRANS : 0), va("%dx", players[tab[i].num].lives)); V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|(greycheck ? V_60TRANS : 0), va("%dx", players[tab[i].num].lives));
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT) else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
{ {
@ -1405,7 +1413,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
| (greycheck ? V_TRANSLUCENT : 0) | (greycheck ? V_TRANSLUCENT : 0)
| V_ALLOWLOWERCASE, name); | V_ALLOWLOWERCASE, name);
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != 0x7f)) //show lives if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives)); V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives));
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT) else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
V_DrawSmallScaledPatch(x-28, y-4, 0, tagico); V_DrawSmallScaledPatch(x-28, y-4, 0, tagico);

View File

@ -63,6 +63,7 @@ extern patch_t *tallnum[10];
extern patch_t *nightsnum[10]; extern patch_t *nightsnum[10];
extern patch_t *lt_font[LT_FONTSIZE]; extern patch_t *lt_font[LT_FONTSIZE];
extern patch_t *cred_font[CRED_FONTSIZE]; extern patch_t *cred_font[CRED_FONTSIZE];
extern patch_t *ttlnum[20];
extern patch_t *emeraldpics[3][8]; extern patch_t *emeraldpics[3][8];
extern patch_t *rflagico; extern patch_t *rflagico;
extern patch_t *bflagico; extern patch_t *bflagico;

View File

@ -232,6 +232,7 @@ char sprnames[NUMSPRITES + 1][5] =
"CFLG", // Waving flag/segment "CFLG", // Waving flag/segment
"CSTA", // Crawla statue "CSTA", // Crawla statue
"CBBS", // Facestabber statue "CBBS", // Facestabber statue
"CABR", // Brambles
// Arid Canyon Scenery // Arid Canyon Scenery
"BTBL", // Big tumbleweed "BTBL", // Big tumbleweed
@ -2158,6 +2159,8 @@ state_t states[NUMSTATES] =
{SPR_CBBS, FF_ANIMATE, 23, {NULL}, 6, 1, S_SUSPICIOUSFACESTABBERSTATUE_BURST2}, // S_SUSPICIOUSFACESTABBERSTATUE_BURST1 {SPR_CBBS, FF_ANIMATE, 23, {NULL}, 6, 1, S_SUSPICIOUSFACESTABBERSTATUE_BURST2}, // S_SUSPICIOUSFACESTABBERSTATUE_BURST1
{SPR_NULL, 0, 40, {A_StatueBurst}, MT_FACESTABBER, S_FACESTABBER_CHARGE2, S_NULL}, // S_SUSPICIOUSFACESTABBERSTATUE_BURST2 {SPR_NULL, 0, 40, {A_StatueBurst}, MT_FACESTABBER, S_FACESTABBER_CHARGE2, S_NULL}, // S_SUSPICIOUSFACESTABBERSTATUE_BURST2
{SPR_CABR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BRAMBLES
// Big Tumbleweed // Big Tumbleweed
{SPR_BTBL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BIGTUMBLEWEED {SPR_BTBL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BIGTUMBLEWEED
{SPR_BTBL, 0, 5, {NULL}, 0, 0, S_BIGTUMBLEWEED_ROLL2}, // S_BIGTUMBLEWEED_ROLL1 {SPR_BTBL, 0, 5, {NULL}, 0, 0, S_BIGTUMBLEWEED_ROLL2}, // S_BIGTUMBLEWEED_ROLL1
@ -10685,6 +10688,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
MT_ROCKCRUMBLE3 // raisestate MT_ROCKCRUMBLE3 // raisestate
}, },
{ // MT_BRAMBLES
1125, // doomednum
S_BRAMBLES, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_SCENERY|MF_NOBLOCKMAP, // flags
S_NULL // raisestate
},
{ // MT_BIGTUMBLEWEED { // MT_BIGTUMBLEWEED
1200, // doomednum 1200, // doomednum
S_BIGTUMBLEWEED,// spawnstate S_BIGTUMBLEWEED,// spawnstate

View File

@ -450,6 +450,7 @@ typedef enum sprite
SPR_CFLG, // Waving flag/segment SPR_CFLG, // Waving flag/segment
SPR_CSTA, // Crawla statue SPR_CSTA, // Crawla statue
SPR_CBBS, // Facestabber statue SPR_CBBS, // Facestabber statue
SPR_CABR, // Brambles
// Arid Canyon Scenery // Arid Canyon Scenery
SPR_BTBL, // Big tumbleweed SPR_BTBL, // Big tumbleweed
@ -2275,6 +2276,7 @@ typedef enum state
S_SUSPICIOUSFACESTABBERSTATUE_WAIT, S_SUSPICIOUSFACESTABBERSTATUE_WAIT,
S_SUSPICIOUSFACESTABBERSTATUE_BURST1, S_SUSPICIOUSFACESTABBERSTATUE_BURST1,
S_SUSPICIOUSFACESTABBERSTATUE_BURST2, S_SUSPICIOUSFACESTABBERSTATUE_BURST2,
S_BRAMBLES,
// Big Tumbleweed // Big Tumbleweed
S_BIGTUMBLEWEED, S_BIGTUMBLEWEED,
@ -3951,6 +3953,7 @@ typedef enum mobj_type
MT_CRAWLASTATUE, // Crawla statue MT_CRAWLASTATUE, // Crawla statue
MT_FACESTABBERSTATUE, // Facestabber statue MT_FACESTABBERSTATUE, // Facestabber statue
MT_SUSPICIOUSFACESTABBERSTATUE, // :eggthinking: MT_SUSPICIOUSFACESTABBERSTATUE, // :eggthinking:
MT_BRAMBLES, // Brambles
// Arid Canyon Scenery // Arid Canyon Scenery
MT_BIGTUMBLEWEED, MT_BIGTUMBLEWEED,

View File

@ -421,6 +421,7 @@ static int sector_get(lua_State *L)
{ {
sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR)); sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR));
enum sector_e field = luaL_checkoption(L, 2, sector_opt[0], sector_opt); enum sector_e field = luaL_checkoption(L, 2, sector_opt[0], sector_opt);
INT16 i;
if (!sector) if (!sector)
{ {
@ -443,11 +444,23 @@ static int sector_get(lua_State *L)
lua_pushfixed(L, sector->ceilingheight); lua_pushfixed(L, sector->ceilingheight);
return 1; return 1;
case sector_floorpic: // floorpic case sector_floorpic: // floorpic
lua_pushlstring(L, levelflats[sector->floorpic].name, 8); {
levelflat_t *levelflat = &levelflats[sector->floorpic];
for (i = 0; i < 8; i++)
if (!levelflat->name[i])
break;
lua_pushlstring(L, levelflat->name, i);
return 1; return 1;
}
case sector_ceilingpic: // ceilingpic case sector_ceilingpic: // ceilingpic
lua_pushlstring(L, levelflats[sector->ceilingpic].name, 8); {
levelflat_t *levelflat = &levelflats[sector->ceilingpic];
for (i = 0; i < 8; i++)
if (!levelflat->name[i])
break;
lua_pushlstring(L, levelflat->name, i);
return 1; return 1;
}
case sector_lightlevel: case sector_lightlevel:
lua_pushinteger(L, sector->lightlevel); lua_pushinteger(L, sector->lightlevel);
return 1; return 1;
@ -1784,6 +1797,8 @@ static int mapheaderinfo_get(lua_State *L)
lua_pushinteger(L, header->levelselect); lua_pushinteger(L, header->levelselect);
else if (fastcmp(field,"bonustype")) else if (fastcmp(field,"bonustype"))
lua_pushinteger(L, header->bonustype); lua_pushinteger(L, header->bonustype);
else if (fastcmp(field,"maxbonuslives"))
lua_pushinteger(L, header->maxbonuslives);
else if (fastcmp(field,"levelflags")) else if (fastcmp(field,"levelflags"))
lua_pushinteger(L, header->levelflags); lua_pushinteger(L, header->levelflags);
else if (fastcmp(field,"menuflags")) else if (fastcmp(field,"menuflags"))

View File

@ -290,12 +290,20 @@ static int player_get(lua_State *L)
LUA_PushUserdata(L, plr->capsule, META_MOBJ); LUA_PushUserdata(L, plr->capsule, META_MOBJ);
else if (fastcmp(field,"mare")) else if (fastcmp(field,"mare"))
lua_pushinteger(L, plr->mare); lua_pushinteger(L, plr->mare);
else if (fastcmp(field,"marelap"))
lua_pushinteger(L, plr->marelap);
else if (fastcmp(field,"marebonuslap"))
lua_pushinteger(L, plr->marebonuslap);
else if (fastcmp(field,"marebegunat")) else if (fastcmp(field,"marebegunat"))
lua_pushinteger(L, plr->marebegunat); lua_pushinteger(L, plr->marebegunat);
else if (fastcmp(field,"startedtime")) else if (fastcmp(field,"startedtime"))
lua_pushinteger(L, plr->startedtime); lua_pushinteger(L, plr->startedtime);
else if (fastcmp(field,"finishedtime")) else if (fastcmp(field,"finishedtime"))
lua_pushinteger(L, plr->finishedtime); lua_pushinteger(L, plr->finishedtime);
else if (fastcmp(field,"lapbegunat"))
lua_pushinteger(L, plr->lapbegunat);
else if (fastcmp(field,"lapstartedtime"))
lua_pushinteger(L, plr->lapstartedtime);
else if (fastcmp(field,"finishedspheres")) else if (fastcmp(field,"finishedspheres"))
lua_pushinteger(L, plr->finishedspheres); lua_pushinteger(L, plr->finishedspheres);
else if (fastcmp(field,"finishedrings")) else if (fastcmp(field,"finishedrings"))
@ -304,8 +312,18 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->marescore); lua_pushinteger(L, plr->marescore);
else if (fastcmp(field,"lastmarescore")) else if (fastcmp(field,"lastmarescore"))
lua_pushinteger(L, plr->lastmarescore); lua_pushinteger(L, plr->lastmarescore);
else if (fastcmp(field,"totalmarescore"))
lua_pushinteger(L, plr->totalmarescore);
else if (fastcmp(field,"lastmare")) else if (fastcmp(field,"lastmare"))
lua_pushinteger(L, plr->lastmare); lua_pushinteger(L, plr->lastmare);
else if (fastcmp(field,"lastmarelap"))
lua_pushinteger(L, plr->lastmarelap);
else if (fastcmp(field,"lastmarebonuslap"))
lua_pushinteger(L, plr->lastmarebonuslap);
else if (fastcmp(field,"totalmarelap"))
lua_pushinteger(L, plr->totalmarelap);
else if (fastcmp(field,"totalmarebonuslap"))
lua_pushinteger(L, plr->totalmarebonuslap);
else if (fastcmp(field,"maxlink")) else if (fastcmp(field,"maxlink"))
lua_pushinteger(L, plr->maxlink); lua_pushinteger(L, plr->maxlink);
else if (fastcmp(field,"texttimer")) else if (fastcmp(field,"texttimer"))
@ -570,12 +588,20 @@ static int player_set(lua_State *L)
} }
else if (fastcmp(field,"mare")) else if (fastcmp(field,"mare"))
plr->mare = (UINT8)luaL_checkinteger(L, 3); plr->mare = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"marelap"))
plr->marelap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"marebonuslap"))
plr->marebonuslap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"marebegunat")) else if (fastcmp(field,"marebegunat"))
plr->marebegunat = (tic_t)luaL_checkinteger(L, 3); plr->marebegunat = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"startedtime")) else if (fastcmp(field,"startedtime"))
plr->startedtime = (tic_t)luaL_checkinteger(L, 3); plr->startedtime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"finishedtime")) else if (fastcmp(field,"finishedtime"))
plr->finishedtime = (tic_t)luaL_checkinteger(L, 3); plr->finishedtime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lapbegunat"))
plr->lapbegunat = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lapstartedtime"))
plr->lapstartedtime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"finishedspheres")) else if (fastcmp(field,"finishedspheres"))
plr->finishedspheres = (INT16)luaL_checkinteger(L, 3); plr->finishedspheres = (INT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"finishedrings")) else if (fastcmp(field,"finishedrings"))
@ -584,8 +610,18 @@ static int player_set(lua_State *L)
plr->marescore = (UINT32)luaL_checkinteger(L, 3); plr->marescore = (UINT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastmarescore")) else if (fastcmp(field,"lastmarescore"))
plr->lastmarescore = (UINT32)luaL_checkinteger(L, 3); plr->lastmarescore = (UINT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"totalmarescore"))
plr->totalmarescore = (UINT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastmare")) else if (fastcmp(field,"lastmare"))
plr->lastmare = (UINT8)luaL_checkinteger(L, 3); plr->lastmare = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastmarelap"))
plr->lastmarelap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastmarebonuslap"))
plr->lastmarebonuslap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"totalmarelap"))
plr->totalmarelap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"totalmarebonuslap"))
plr->totalmarebonuslap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"maxlink")) else if (fastcmp(field,"maxlink"))
plr->maxlink = (INT32)luaL_checkinteger(L, 3); plr->maxlink = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"texttimer")) else if (fastcmp(field,"texttimer"))

View File

@ -880,28 +880,19 @@ void Command_Setrings_f(void)
if (COM_Argc() > 1) if (COM_Argc() > 1)
{ {
// P_GivePlayerRings does value clamping if (!(maptol & TOL_NIGHTS))
players[consoleplayer].rings = 0; {
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1))); // P_GivePlayerRings does value clamping
if (!G_IsSpecialStage(gamemap) || !(maptol & TOL_NIGHTS)) players[consoleplayer].rings = 0;
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
}
G_SetGameModified(multiplayer); else
} {
} players[consoleplayer].spheres = 0;
P_GivePlayerSpheres(&players[consoleplayer], atoi(COM_Argv(1)));
void Command_Setspheres_f(void) // no totalsphere addition to revert
{ }
REQUIRE_INLEVEL;
REQUIRE_SINGLEPLAYER;
REQUIRE_NOULTIMATE;
REQUIRE_PANDORA;
if (COM_Argc() > 1)
{
// P_GivePlayerRings does value clamping
players[consoleplayer].spheres = 0;
P_GivePlayerSpheres(&players[consoleplayer], atoi(COM_Argv(1)));
G_SetGameModified(multiplayer); G_SetGameModified(multiplayer);
} }
@ -918,7 +909,7 @@ void Command_Setlives_f(void)
{ {
SINT8 lives = atoi(COM_Argv(1)); SINT8 lives = atoi(COM_Argv(1));
if (lives == -1) if (lives == -1)
players[consoleplayer].lives = 0x7f; // infinity! players[consoleplayer].lives = INFLIVES; // infinity!
else else
{ {
// P_GivePlayerLives does value clamping // P_GivePlayerLives does value clamping
@ -957,10 +948,12 @@ void Command_Setcontinues_f(void)
static CV_PossibleValue_t op_mapthing_t[] = {{0, "MIN"}, {4095, "MAX"}, {0, NULL}}; static CV_PossibleValue_t op_mapthing_t[] = {{0, "MIN"}, {4095, "MAX"}, {0, NULL}};
static CV_PossibleValue_t op_speed_t[] = {{1, "MIN"}, {128, "MAX"}, {0, NULL}}; static CV_PossibleValue_t op_speed_t[] = {{1, "MIN"}, {128, "MAX"}, {0, NULL}};
static CV_PossibleValue_t op_flags_t[] = {{0, "MIN"}, {15, "MAX"}, {0, NULL}}; static CV_PossibleValue_t op_flags_t[] = {{0, "MIN"}, {15, "MAX"}, {0, NULL}};
static CV_PossibleValue_t op_hoopflags_t[] = {{0, "MIN"}, {15, "MAX"}, {0, NULL}};
consvar_t cv_mapthingnum = {"op_mapthingnum", "0", CV_NOTINNET, op_mapthing_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_mapthingnum = {"op_mapthingnum", "0", CV_NOTINNET, op_mapthing_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_speed = {"op_speed", "16", CV_NOTINNET, op_speed_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_speed = {"op_speed", "16", CV_NOTINNET, op_speed_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_opflags = {"op_flags", "0", CV_NOTINNET, op_flags_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_opflags = {"op_flags", "0", CV_NOTINNET, op_flags_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_ophoopflags = {"op_hoopflags", "4", CV_NOTINNET, op_hoopflags_t, NULL, 0, NULL, NULL, 0, 0, NULL};
boolean objectplacing = false; boolean objectplacing = false;
mobjtype_t op_currentthing = 0; // For the object placement mode mobjtype_t op_currentthing = 0; // For the object placement mode
@ -1164,17 +1157,10 @@ void OP_NightsObjectplace(player_t *player)
{ {
UINT16 angle = (UINT16)(player->anotherflyangle % 360); UINT16 angle = (UINT16)(player->anotherflyangle % 360);
INT16 temp = (INT16)FixedInt(AngleFixed(player->mo->angle)); // Traditional 2D Angle INT16 temp = (INT16)FixedInt(AngleFixed(player->mo->angle)); // Traditional 2D Angle
sector_t *sec = player->mo->subsector->sector;
#ifdef ESLOPE
fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight;
#else
fixed_t fheight = sec->floorheight;
#endif
player->pflags |= PF_ATTACKDOWN; player->pflags |= PF_ATTACKDOWN;
mt = OP_CreateNewMapThing(player, 1705, false); mt = OP_CreateNewMapThing(player, 1713, false);
// Tilt // Tilt
mt->angle = (INT16)FixedInt(FixedDiv(angle*FRACUNIT, 360*(FRACUNIT/256))); mt->angle = (INT16)FixedInt(FixedDiv(angle*FRACUNIT, 360*(FRACUNIT/256)));
@ -1185,7 +1171,7 @@ void OP_NightsObjectplace(player_t *player)
temp += 90; temp += 90;
temp %= 360; temp %= 360;
mt->options = (UINT16)((player->mo->z - fheight)>>FRACBITS); mt->options = (mt->options & ~(UINT16)cv_opflags.value) | (UINT16)cv_ophoopflags.value;
mt->angle = (INT16)(mt->angle+(INT16)((FixedInt(FixedDiv(temp*FRACUNIT, 360*(FRACUNIT/256))))<<8)); mt->angle = (INT16)(mt->angle+(INT16)((FixedInt(FixedDiv(temp*FRACUNIT, 360*(FRACUNIT/256))))<<8));
P_SpawnHoopsAndRings(mt, false); P_SpawnHoopsAndRings(mt, false);
@ -1194,11 +1180,52 @@ void OP_NightsObjectplace(player_t *player)
// This places a bumper! // This places a bumper!
if (cmd->buttons & BT_TOSSFLAG) if (cmd->buttons & BT_TOSSFLAG)
{ {
UINT16 vertangle = (UINT16)(player->anotherflyangle % 360);
UINT16 newflags, newz;
player->pflags |= PF_ATTACKDOWN; player->pflags |= PF_ATTACKDOWN;
if (!OP_HeightOkay(player, false)) if (!OP_HeightOkay(player, false))
return; return;
mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_NIGHTSBUMPER].doomednum, false); mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_NIGHTSBUMPER].doomednum, false);
newz = min((mt->options >> ZSHIFT) - (mobjinfo[MT_NIGHTSBUMPER].height/4), 0);
// height offset: from P_TouchSpecialThing case MT_NIGHTSBUMPER
// clockwise
if (vertangle >= 75 && vertangle < 105) // up
newflags = 3;
else if (vertangle >= 105 && vertangle < 135) // 60 upward tilt
newflags = 2;
else if (vertangle >= 135 && vertangle < 165) // 30 upward tilt
newflags = 1;
//else if (vertangle >= 165 && vertangle < 195) // forward, see else case
// newflags = 0;
else if (vertangle >= 195 && vertangle < 225) // 30 downward tilt
newflags = 11;
else if (vertangle >= 225 && vertangle < 255) // 60 downward tilt
newflags = 10;
else if (vertangle >= 255 && vertangle < 285) // down
newflags = 9;
else if (vertangle >= 285 && vertangle < 315) // 60 downward tilt backwards
newflags = 8;
else if (vertangle >= 315 && vertangle < 345) // 30 downward tilt backwards
newflags = 7;
else if (vertangle >= 345 || vertangle < 15) // backwards
newflags = 6;
else if (vertangle >= 15 && vertangle < 45) // 30 upward tilt backwards
newflags = 5;
else if (vertangle >= 45 && vertangle < 75) // 60 upward tilt backwards
newflags = 4;
else // forward
newflags = 0;
mt->options = (newz << ZSHIFT) | newflags;
// if NiGHTS is facing backwards, orient the Thing angle forwards so that the sprite angle
// displays correctly. Backwards movement via the Thing flags is unaffected.
if (vertangle < 90 || vertangle > 270)
mt->angle = (mt->angle + 180) % 360;
P_SpawnMapThing(mt); P_SpawnMapThing(mt);
} }

View File

@ -28,7 +28,7 @@ void cht_Init(void);
void Command_ObjectPlace_f(void); void Command_ObjectPlace_f(void);
void Command_Writethings_f(void); void Command_Writethings_f(void);
extern consvar_t cv_opflags, cv_mapthingnum, cv_speed; extern consvar_t cv_opflags, cv_ophoopflags, cv_mapthingnum, cv_speed;
//extern consvar_t cv_snapto, cv_grid; //extern consvar_t cv_snapto, cv_grid;
extern boolean objectplacing; extern boolean objectplacing;
@ -51,7 +51,6 @@ void Command_Savecheckpoint_f(void);
void Command_Getallemeralds_f(void); void Command_Getallemeralds_f(void);
void Command_Resetemeralds_f(void); void Command_Resetemeralds_f(void);
void Command_Setrings_f(void); void Command_Setrings_f(void);
void Command_Setspheres_f(void);
void Command_Setlives_f(void); void Command_Setlives_f(void);
void Command_Setcontinues_f(void); void Command_Setcontinues_f(void);
void Command_Devmode_f(void); void Command_Devmode_f(void);

View File

@ -5277,7 +5277,7 @@ static void M_PandorasBox(INT32 choice)
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].spheres, 0)); CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].spheres, 0));
else else
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].rings, 0)); CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].rings, 0));
if (players[consoleplayer].lives == 0x7f) if (players[consoleplayer].lives == INFLIVES)
CV_StealthSetValue(&cv_dummylives, -1); CV_StealthSetValue(&cv_dummylives, -1);
else else
CV_StealthSetValue(&cv_dummylives, players[consoleplayer].lives); CV_StealthSetValue(&cv_dummylives, players[consoleplayer].lives);
@ -6334,7 +6334,7 @@ skipsign:
y += 25; y += 25;
tempx = x + 10; tempx = x + 10;
if (savegameinfo[savetodraw].lives != 0x7f if (savegameinfo[savetodraw].lives != INFLIVES
&& savegameinfo[savetodraw].lives > 9) && savegameinfo[savetodraw].lives > 9)
tempx -= 4; tempx -= 4;
@ -6361,7 +6361,7 @@ skiplife:
V_DrawScaledPatch(tempx + 9, y + 2, 0, patch); V_DrawScaledPatch(tempx + 9, y + 2, 0, patch);
tempx += 16; tempx += 16;
if (savegameinfo[savetodraw].lives == 0x7f) if (savegameinfo[savetodraw].lives == INFLIVES)
V_DrawCharacter(tempx, y + 1, '\x16', false); V_DrawCharacter(tempx, y + 1, '\x16', false);
else else
V_DrawString(tempx, y, 0, va("%d", savegameinfo[savetodraw].lives)); V_DrawString(tempx, y, 0, va("%d", savegameinfo[savetodraw].lives));

View File

@ -1006,13 +1006,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
player->flyangle = special->threshold; player->flyangle = special->threshold;
player->speed = FixedMul(special->info->speed, special->scale); player->speed = FixedMul(special->info->speed, special->scale);
// Potentially causes axis transfer failures. P_SetTarget(&player->mo->hnext, special); // Reference bumper for position correction on next tic
// Also rarely worked properly anyway.
//P_UnsetThingPosition(player->mo);
//player->mo->x = special->x;
//player->mo->y = special->y;
//P_SetThingPosition(player->mo);
toucher->z = special->z+(special->height/4);
} }
else // More like a spring else // More like a spring
{ {
@ -1135,6 +1129,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{ {
player->nightstime += special->info->speed; player->nightstime += special->info->speed;
player->startedtime += special->info->speed; player->startedtime += special->info->speed;
player->lapstartedtime += special->info->speed;
P_RestoreMusic(player); P_RestoreMusic(player);
} }
else else
@ -1144,6 +1139,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{ {
players[i].nightstime += special->info->speed; players[i].nightstime += special->info->speed;
players[i].startedtime += special->info->speed; players[i].startedtime += special->info->speed;
players[i].lapstartedtime += special->info->speed;
P_RestoreMusic(&players[i]); P_RestoreMusic(&players[i]);
} }
if (special->info->deathsound != sfx_None) if (special->info->deathsound != sfx_None)
@ -2257,7 +2253,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
if ((target->player->lives <= 1) && (netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value == 0)) if ((target->player->lives <= 1) && (netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value == 0))
; ;
else if (!target->player->bot && !target->player->spectator && !G_IsSpecialStage(gamemap) && (target->player->lives != 0x7f) else if (!target->player->bot && !target->player->spectator && !G_IsSpecialStage(gamemap) && (target->player->lives != INFLIVES)
&& G_GametypeUsesLives()) && G_GametypeUsesLives())
{ {
target->player->lives -= 1; // Lose a life Tails 03-11-2000 target->player->lives -= 1; // Lose a life Tails 03-11-2000

View File

@ -1097,24 +1097,35 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetTarget(&thing->target, tmthing); P_SetTarget(&thing->target, tmthing);
} }
// Respawn rings and items // NiGHTS lap logic
if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE) if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE)
&& (tmthing->player || thing->player)) && (tmthing->player || thing->player))
{ {
mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing; mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing;
player_t *pl = (droneobj == thing) ? tmthing->player : thing->player; player_t *pl = (droneobj == thing) ? tmthing->player : thing->player;
// Must be in bonus time, and must be NiGHTS, must wait about a second // Must be NiGHTS, must wait about a second
// must be flying in the SAME DIRECTION as the last time you came through. // must be flying in the SAME DIRECTION as the last time you came through.
// not (your direction) xor (stored direction) // not (your direction) xor (stored direction)
// In other words, you can't u-turn and respawn rings near the drone. // In other words, you can't u-turn and respawn rings near the drone.
if (pl->bonustime && (pl->powers[pw_carry] == CR_NIGHTSMODE) && (INT32)leveltime > droneobj->extravalue2 && ( if ((pl->powers[pw_carry] == CR_NIGHTSMODE) && (INT32)leveltime > droneobj->extravalue2 && (
!(pl->flyangle > 90 && pl->flyangle < 270) !(pl->flyangle > 90 && pl->flyangle < 270)
^ (droneobj->extravalue1 > 90 && droneobj->extravalue1 < 270) ^ (droneobj->extravalue1 > 90 && droneobj->extravalue1 < 270)
)) ))
{ {
// Reload all the fancy ring stuff! pl->marelap++;
P_ReloadRings(); pl->totalmarelap++;
pl->lapbegunat = leveltime;
pl->lapstartedtime = pl->nightstime;
if (pl->bonustime)
{
pl->marebonuslap++;
pl->totalmarebonuslap++;
// Respawn rings and items
P_ReloadRings();
}
} }
droneobj->extravalue1 = pl->flyangle; droneobj->extravalue1 = pl->flyangle;
droneobj->extravalue2 = (INT32)leveltime + TICRATE; droneobj->extravalue2 = (INT32)leveltime + TICRATE;

View File

@ -198,15 +198,24 @@ static void P_NetArchivePlayers(void)
WRITEUINT8(save_p, players[i].drilldelay); WRITEUINT8(save_p, players[i].drilldelay);
WRITEUINT8(save_p, players[i].bonustime); WRITEUINT8(save_p, players[i].bonustime);
WRITEUINT8(save_p, players[i].mare); WRITEUINT8(save_p, players[i].mare);
WRITEUINT8(save_p, players[i].marelap);
WRITEUINT8(save_p, players[i].marebonuslap);
WRITEUINT32(save_p, players[i].marebegunat); WRITEUINT32(save_p, players[i].marebegunat);
WRITEUINT32(save_p, players[i].startedtime); WRITEUINT32(save_p, players[i].startedtime);
WRITEUINT32(save_p, players[i].finishedtime); WRITEUINT32(save_p, players[i].finishedtime);
WRITEUINT32(save_p, players[i].lapbegunat);
WRITEUINT32(save_p, players[i].lapstartedtime);
WRITEINT16(save_p, players[i].finishedspheres); WRITEINT16(save_p, players[i].finishedspheres);
WRITEINT16(save_p, players[i].finishedrings); WRITEINT16(save_p, players[i].finishedrings);
WRITEUINT32(save_p, players[i].marescore); WRITEUINT32(save_p, players[i].marescore);
WRITEUINT32(save_p, players[i].lastmarescore); WRITEUINT32(save_p, players[i].lastmarescore);
WRITEUINT32(save_p, players[i].totalmarescore);
WRITEUINT8(save_p, players[i].lastmare); WRITEUINT8(save_p, players[i].lastmare);
WRITEUINT8(save_p, players[i].lastmarelap);
WRITEUINT8(save_p, players[i].lastmarebonuslap);
WRITEUINT8(save_p, players[i].totalmarelap);
WRITEUINT8(save_p, players[i].totalmarebonuslap);
WRITEINT32(save_p, players[i].maxlink); WRITEINT32(save_p, players[i].maxlink);
WRITEUINT8(save_p, players[i].texttimer); WRITEUINT8(save_p, players[i].texttimer);
WRITEUINT8(save_p, players[i].textvar); WRITEUINT8(save_p, players[i].textvar);
@ -387,15 +396,24 @@ static void P_NetUnArchivePlayers(void)
players[i].drilldelay = READUINT8(save_p); players[i].drilldelay = READUINT8(save_p);
players[i].bonustime = (boolean)READUINT8(save_p); players[i].bonustime = (boolean)READUINT8(save_p);
players[i].mare = READUINT8(save_p); players[i].mare = READUINT8(save_p);
players[i].marelap = READUINT8(save_p);
players[i].marebonuslap = READUINT8(save_p);
players[i].marebegunat = READUINT32(save_p); players[i].marebegunat = READUINT32(save_p);
players[i].startedtime = READUINT32(save_p); players[i].startedtime = READUINT32(save_p);
players[i].finishedtime = READUINT32(save_p); players[i].finishedtime = READUINT32(save_p);
players[i].lapbegunat = READUINT32(save_p);
players[i].lapstartedtime = READUINT32(save_p);
players[i].finishedspheres = READINT16(save_p); players[i].finishedspheres = READINT16(save_p);
players[i].finishedrings = READINT16(save_p); players[i].finishedrings = READINT16(save_p);
players[i].marescore = READUINT32(save_p); players[i].marescore = READUINT32(save_p);
players[i].lastmarescore = READUINT32(save_p); players[i].lastmarescore = READUINT32(save_p);
players[i].totalmarescore = READUINT32(save_p);
players[i].lastmare = READUINT8(save_p); players[i].lastmare = READUINT8(save_p);
players[i].lastmarelap = READUINT8(save_p);
players[i].lastmarebonuslap = READUINT8(save_p);
players[i].totalmarelap = READUINT8(save_p);
players[i].totalmarebonuslap = READUINT8(save_p);
players[i].maxlink = READINT32(save_p); players[i].maxlink = READINT32(save_p);
players[i].texttimer = READUINT8(save_p); players[i].texttimer = READUINT8(save_p);
players[i].textvar = READUINT8(save_p); players[i].textvar = READUINT8(save_p);

View File

@ -225,6 +225,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
mapheaderinfo[num]->unlockrequired = -1; mapheaderinfo[num]->unlockrequired = -1;
mapheaderinfo[num]->levelselect = 0; mapheaderinfo[num]->levelselect = 0;
mapheaderinfo[num]->bonustype = 0; mapheaderinfo[num]->bonustype = 0;
mapheaderinfo[num]->maxbonuslives = -1;
mapheaderinfo[num]->levelflags = 0; mapheaderinfo[num]->levelflags = 0;
mapheaderinfo[num]->menuflags = 0; mapheaderinfo[num]->menuflags = 0;
#if 1 // equivalent to "FlickyList = DEMO" #if 1 // equivalent to "FlickyList = DEMO"
@ -2381,12 +2382,16 @@ static void P_LevelInitStuff(void)
players[i].maxlink = players[i].startedtime =\ players[i].maxlink = players[i].startedtime =\
players[i].finishedtime = players[i].finishedspheres =\ players[i].finishedtime = players[i].finishedspheres =\
players[i].finishedrings = players[i].lastmare =\ players[i].finishedrings = players[i].lastmare =\
players[i].lastmarelap = players[i].lastmarebonuslap =\
players[i].totalmarelap = players[i].totalmarebonuslap =\
players[i].marebegunat = players[i].textvar =\ players[i].marebegunat = players[i].textvar =\
players[i].texttimer = players[i].linkcount =\ players[i].texttimer = players[i].linkcount =\
players[i].linktimer = players[i].flyangle =\ players[i].linktimer = players[i].flyangle =\
players[i].anotherflyangle = players[i].nightstime =\ players[i].anotherflyangle = players[i].nightstime =\
players[i].mare = players[i].realtime =\ players[i].mare = players[i].marelap =\
players[i].exiting = 0; players[i].marebonuslap = players[i].lapbegunat =\
players[i].lapstartedtime = players[i].totalmarescore =\
players[i].realtime = players[i].exiting = 0;
// i guess this could be part of the above but i feel mildly uncomfortable implicitly casting // i guess this could be part of the above but i feel mildly uncomfortable implicitly casting
players[i].gotcontinue = false; players[i].gotcontinue = false;

View File

@ -1493,10 +1493,10 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
if (!playeringame[i] || players[i].spectator) if (!playeringame[i] || players[i].spectator)
continue; continue;
if (!players[i].mo || players[i].rings <= 0) if (!players[i].mo || ((maptol & TOL_NIGHTS) ? players[i].spheres : players[i].rings) <= 0)
continue; continue;
rings += players[i].rings; rings += (maptol & TOL_NIGHTS) ? players[i].spheres : players[i].rings;
} }
} }
else else
@ -1504,7 +1504,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
if (!(actor && actor->player)) if (!(actor && actor->player))
return false; // no player to count rings from here, sorry return false; // no player to count rings from here, sorry
rings = actor->player->rings; rings = (maptol & TOL_NIGHTS) ? actor->player->spheres : actor->player->rings;
} }
if (triggerline->flags & ML_NOCLIMB) if (triggerline->flags & ML_NOCLIMB)

View File

@ -387,6 +387,8 @@ boolean P_TransferToNextMare(player_t *player)
CONS_Debug(DBG_NIGHTS, "Mare is %d\n", mare); CONS_Debug(DBG_NIGHTS, "Mare is %d\n", mare);
player->mare = mare; player->mare = mare;
player->marelap = 0;
player->marebonuslap = 0;
// scan the thinkers // scan the thinkers
// to find the closest axis point // to find the closest axis point
@ -574,6 +576,10 @@ static void P_DeNightserizePlayer(player_t *player)
player->climbing = 0; player->climbing = 0;
player->mo->fuse = 0; player->mo->fuse = 0;
player->speed = 0; player->speed = 0;
player->marelap = 0;
player->marebonuslap = 0;
player->flyangle = 0;
player->anotherflyangle = 0;
P_SetTarget(&player->mo->target, NULL); P_SetTarget(&player->mo->target, NULL);
P_SetTarget(&player->axis1, P_SetTarget(&player->axis2, NULL)); P_SetTarget(&player->axis1, P_SetTarget(&player->axis2, NULL));
@ -633,7 +639,7 @@ static void P_DeNightserizePlayer(player_t *player)
// NiGHTS Time! // NiGHTS Time!
void P_NightserizePlayer(player_t *player, INT32 nighttime) void P_NightserizePlayer(player_t *player, INT32 nighttime)
{ {
INT32 oldmare; UINT8 oldmare, oldmarelap, oldmarebonuslap;
// Bots can't be NiGHTSerized, silly!1 :P // Bots can't be NiGHTSerized, silly!1 :P
if (player->bot) if (player->bot)
@ -648,6 +654,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
player->speed = 0; player->speed = 0;
player->climbing = 0; player->climbing = 0;
player->secondjump = 0; player->secondjump = 0;
player->flyangle = 0;
player->anotherflyangle = 0;
player->powers[pw_shield] = SH_NONE; player->powers[pw_shield] = SH_NONE;
player->powers[pw_super] = 0; player->powers[pw_super] = 0;
@ -662,7 +670,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
player->followitem = skins[DEFAULTNIGHTSSKIN].followitem; player->followitem = skins[DEFAULTNIGHTSSKIN].followitem;
} }
player->nightstime = player->startedtime = nighttime*TICRATE; player->nightstime = player->startedtime = player->lapstartedtime = nighttime*TICRATE;
player->bonustime = false; player->bonustime = false;
P_RestoreMusic(player); P_RestoreMusic(player);
@ -680,6 +688,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
} }
oldmare = player->mare; oldmare = player->mare;
oldmarelap = player->marelap;
oldmarebonuslap = player->marebonuslap;
if (!P_TransferToNextMare(player)) if (!P_TransferToNextMare(player))
{ {
@ -707,6 +717,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
players[i].texttimer = (3 * TICRATE) - 10; players[i].texttimer = (3 * TICRATE) - 10;
players[i].textvar = 4; // Score and grades players[i].textvar = 4; // Score and grades
players[i].lastmare = players[i].mare; players[i].lastmare = players[i].mare;
players[i].lastmarelap = players[i].marelap;
players[i].lastmarebonuslap = players[i].marebonuslap;
if (G_IsSpecialStage(gamemap)) if (G_IsSpecialStage(gamemap))
{ {
players[i].finishedspheres = (INT16)total_spheres; players[i].finishedspheres = (INT16)total_spheres;
@ -725,6 +737,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1); G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);
// transfer scores anyway // transfer scores anyway
players[i].totalmarescore += players[i].marescore;
players[i].lastmarescore = players[i].marescore; players[i].lastmarescore = players[i].marescore;
players[i].marescore = 0; players[i].marescore = 0;
@ -738,19 +751,24 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
// Spheres bonus // Spheres bonus
P_AddPlayerScore(player, (player->spheres) * 50); P_AddPlayerScore(player, (player->spheres) * 50);
player->lastmare = (UINT8)oldmare; player->lastmare = oldmare;
player->lastmarelap = oldmarelap;
player->lastmarebonuslap = oldmarebonuslap;
player->texttimer = 4*TICRATE; player->texttimer = 4*TICRATE;
player->textvar = 4; // Score and grades player->textvar = 4; // Score and grades
player->finishedspheres = (INT16)(player->spheres); player->finishedspheres = (INT16)(player->spheres);
player->finishedrings = (INT16)(player->rings);
// Add score to temp leaderboards // Add score to temp leaderboards
if (!(netgame||multiplayer) && P_IsLocalPlayer(player)) if (!(netgame||multiplayer) && P_IsLocalPlayer(player))
G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1)); G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));
// Starting a new mare, transfer scores // Starting a new mare, transfer scores
player->totalmarescore += player->marescore;
player->lastmarescore = player->marescore; player->lastmarescore = player->marescore;
player->marescore = 0; player->marescore = 0;
player->marebegunat = leveltime; player->marebegunat = leveltime;
player->lapbegunat = leveltime;
player->spheres = player->rings = 0; player->spheres = player->rings = 0;
} }
@ -765,6 +783,13 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
player->texttimer = (UINT8)(110 - timeinmap); player->texttimer = (UINT8)(110 - timeinmap);
} }
// force NiGHTS to face forward or backward
if (player->mo->target)
player->mo->angle = R_PointToAngle2(player->mo->target->x, player->mo->target->y, player->mo->x, player->mo->y) // player->angle_pos, won't be set on first instance
+ ((player->mo->target->flags2 & MF2_AMBUSH) ? // if axis is invert, take the opposite right angle
(player->flyangle > 90 && player->flyangle < 270 ? ANGLE_90 : -ANGLE_90)
: (player->flyangle > 90 && player->flyangle < 270 ? -ANGLE_90 : ANGLE_90));
player->powers[pw_carry] = CR_NIGHTSMODE; player->powers[pw_carry] = CR_NIGHTSMODE;
} }
@ -927,7 +952,7 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings)
player->rings = 0; player->rings = 0;
// Now extra life bonuses are handled here instead of in P_MovePlayer, since why not? // Now extra life bonuses are handled here instead of in P_MovePlayer, since why not?
if (!ultimatemode && !modeattacking && !G_IsSpecialStage(gamemap) && G_GametypeUsesLives() && player->lives != 0x7f) if (!ultimatemode && !modeattacking && !G_IsSpecialStage(gamemap) && G_GametypeUsesLives() && player->lives != INFLIVES)
{ {
INT32 gainlives = 0; INT32 gainlives = 0;
@ -986,7 +1011,7 @@ void P_GivePlayerLives(player_t *player, INT32 numlives)
if (gamestate == GS_LEVEL) if (gamestate == GS_LEVEL)
{ {
if (player->lives == 0x7f || (gametype != GT_COOP && gametype != GT_COMPETITION)) if (player->lives == INFLIVES || (gametype != GT_COOP && gametype != GT_COMPETITION))
{ {
P_GivePlayerRings(player, 100*numlives); P_GivePlayerRings(player, 100*numlives);
return; return;
@ -6174,7 +6199,6 @@ static void P_NiGHTSMovement(player_t *player)
// S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH // S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH
S_ChangeMusicInternal((((maptol & TOL_NIGHTS) && !G_IsSpecialStage(gamemap)) ? "_ntime" : "_drown"), false); S_ChangeMusicInternal((((maptol & TOL_NIGHTS) && !G_IsSpecialStage(gamemap)) ? "_ntime" : "_drown"), false);
if (player->mo->z < player->mo->floorz) if (player->mo->z < player->mo->floorz)
player->mo->z = player->mo->floorz; player->mo->z = player->mo->floorz;
@ -8384,7 +8408,7 @@ boolean P_GetLives(player_t *player)
if (!(netgame || multiplayer) if (!(netgame || multiplayer)
|| (gametype != GT_COOP) || (gametype != GT_COOP)
|| (cv_cooplives.value == 1) || (cv_cooplives.value == 1)
|| (player->lives == 0x7f)) || (player->lives == INFLIVES))
return true; return true;
if ((cv_cooplives.value == 2 || cv_cooplives.value == 0) && player->lives > 0) if ((cv_cooplives.value == 2 || cv_cooplives.value == 0) && player->lives > 0)
@ -8411,7 +8435,7 @@ boolean P_GetLives(player_t *player)
{ {
if (cv_cooplives.value == 2 && (P_IsLocalPlayer(player) || P_IsLocalPlayer(&players[maxlivesplayer]))) if (cv_cooplives.value == 2 && (P_IsLocalPlayer(player) || P_IsLocalPlayer(&players[maxlivesplayer])))
S_StartSound(NULL, sfx_jshard); // placeholder S_StartSound(NULL, sfx_jshard); // placeholder
if (players[maxlivesplayer].lives != 0x7f) if (players[maxlivesplayer].lives != INFLIVES)
players[maxlivesplayer].lives--; players[maxlivesplayer].lives--;
player->lives++; player->lives++;
if (player->lives < 1) if (player->lives < 1)
@ -9819,7 +9843,19 @@ void P_PlayerThink(player_t *player)
P_ResetScore(player); P_ResetScore(player);
} }
else else
{
if (player->bumpertime == TICRATE/2 && player->mo->hnext)
{
// Center player to NiGHTS bumper here because if you try to set player's position in
// P_TouchSpecialThing case MT_NIGHTSBUMPER, that position is fudged in the time
// between that routine in the previous tic
// and reaching here in the current tic
P_TeleportMove(player->mo, player->mo->hnext->x, player->mo->hnext->y
, player->mo->hnext->z + FixedMul(player->mo->hnext->height/4, player->mo->hnext->scale));
P_SetTarget(&player->mo->hnext, NULL);
}
P_MovePlayer(player); P_MovePlayer(player);
}
if (!player->mo) if (!player->mo)
return; // P_MovePlayer removed player->mo. return; // P_MovePlayer removed player->mo.
@ -9943,7 +9979,8 @@ void P_PlayerThink(player_t *player)
|| player->panim == PA_PAIN || player->panim == PA_PAIN
|| !player->mo->health || !player->mo->health
|| player->climbing || player->climbing
|| player->pflags & (PF_SPINNING|PF_SLIDING)) || player->pflags & (PF_SPINNING|PF_SLIDING)
|| player->bumpertime)
player->pflags &= ~PF_APPLYAUTOBRAKE; player->pflags &= ~PF_APPLYAUTOBRAKE;
else if (currentlyonground || player->powers[pw_tailsfly]) else if (currentlyonground || player->powers[pw_tailsfly])
player->pflags |= PF_APPLYAUTOBRAKE; player->pflags |= PF_APPLYAUTOBRAKE;

View File

@ -1362,7 +1362,7 @@ INT32 R_ColormapNumForName(char *name)
extra_colormaps[num_extra_colormaps].fadecolor = 0x0; extra_colormaps[num_extra_colormaps].fadecolor = 0x0;
extra_colormaps[num_extra_colormaps].maskamt = 0x0; extra_colormaps[num_extra_colormaps].maskamt = 0x0;
extra_colormaps[num_extra_colormaps].fadestart = 0; extra_colormaps[num_extra_colormaps].fadestart = 0;
extra_colormaps[num_extra_colormaps].fadeend = 33; extra_colormaps[num_extra_colormaps].fadeend = 31;
extra_colormaps[num_extra_colormaps].fog = 0; extra_colormaps[num_extra_colormaps].fog = 0;
num_extra_colormaps++; num_extra_colormaps++;
@ -1390,7 +1390,7 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
size_t mapnum = num_extra_colormaps; size_t mapnum = num_extra_colormaps;
size_t i; size_t i;
UINT32 cr, cg, cb, maskcolor, fadecolor; UINT32 cr, cg, cb, maskcolor, fadecolor;
UINT32 fadestart = 0, fadeend = 33, fadedist = 33; UINT32 fadestart = 0, fadeend = 31, fadedist = 31;
#define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0) #define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0)
if (p1[0] == '#') if (p1[0] == '#')
@ -1431,12 +1431,12 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
// Get parameters like fadestart, fadeend, and the fogflag // Get parameters like fadestart, fadeend, and the fogflag
fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10); fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10);
fadeend = NUMFROMCHAR(p2[5]) + (NUMFROMCHAR(p2[4]) * 10); fadeend = NUMFROMCHAR(p2[5]) + (NUMFROMCHAR(p2[4]) * 10);
if (fadestart > 32) if (fadestart > 30)
fadestart = 0; fadestart = 0;
if (fadeend > 33 || fadeend < 1) if (fadeend > 31 || fadeend < 1)
fadeend = 33; fadeend = 31;
fadedist = fadeend - fadestart; fadedist = fadeend - fadestart;
fog = NUMFROMCHAR(p2[1]) ? 1 : 0; fog = NUMFROMCHAR(p2[1]);
} }
#undef getnum #undef getnum
@ -1537,7 +1537,7 @@ void R_CreateColormap2(char *p1, char *p2, char *p3)
size_t i; size_t i;
char *colormap_p; char *colormap_p;
UINT32 cr, cg, cb, maskcolor, fadecolor; UINT32 cr, cg, cb, maskcolor, fadecolor;
UINT32 fadestart = 0, fadeend = 33, fadedist = 33; UINT32 fadestart = 0, fadeend = 31, fadedist = 31;
#define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0) #define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0)
if (p1[0] == '#') if (p1[0] == '#')
@ -1578,12 +1578,12 @@ void R_CreateColormap2(char *p1, char *p2, char *p3)
// Get parameters like fadestart, fadeend, and the fogflag // Get parameters like fadestart, fadeend, and the fogflag
fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10); fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10);
fadeend = NUMFROMCHAR(p2[5]) + (NUMFROMCHAR(p2[4]) * 10); fadeend = NUMFROMCHAR(p2[5]) + (NUMFROMCHAR(p2[4]) * 10);
if (fadestart > 32) if (fadestart > 30)
fadestart = 0; fadestart = 0;
if (fadeend > 33 || fadeend < 1) if (fadeend > 31 || fadeend < 1)
fadeend = 33; fadeend = 31;
fadedist = fadeend - fadestart; fadedist = fadeend - fadestart;
fog = NUMFROMCHAR(p2[1]) ? 1 : 0; fog = NUMFROMCHAR(p2[1]);
} }
#undef getnum #undef getnum

View File

@ -37,6 +37,9 @@
// Quincunx antialiasing of flats! // Quincunx antialiasing of flats!
//#define QUINCUNX //#define QUINCUNX
// good night sweet prince
#define SHITPLANESPARENCY
//SoM: 3/23/2000: Use Boom visplane hashing. //SoM: 3/23/2000: Use Boom visplane hashing.
#define MAXVISPLANES 512 #define MAXVISPLANES 512
@ -813,7 +816,11 @@ void R_DrawSinglePlane(visplane_t *pl)
else // Opaque, but allow transparent flat pixels else // Opaque, but allow transparent flat pixels
spanfunc = splatfunc; spanfunc = splatfunc;
if (pl->extra_colormap && pl->extra_colormap->fog) #ifdef SHITPLANESPARENCY
if (spanfunc == splatfunc || (pl->extra_colormap && pl->extra_colormap->fog))
#else
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
#endif
light = (pl->lightlevel >> LIGHTSEGSHIFT); light = (pl->lightlevel >> LIGHTSEGSHIFT);
else else
light = LIGHTLEVELS-1; light = LIGHTLEVELS-1;
@ -867,7 +874,11 @@ void R_DrawSinglePlane(visplane_t *pl)
else // Opaque, but allow transparent flat pixels else // Opaque, but allow transparent flat pixels
spanfunc = splatfunc; spanfunc = splatfunc;
if (pl->extra_colormap && pl->extra_colormap->fog) #ifdef SHITPLANESPARENCY
if (spanfunc == splatfunc || (pl->extra_colormap && pl->extra_colormap->fog))
#else
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
#endif
light = (pl->lightlevel >> LIGHTSEGSHIFT); light = (pl->lightlevel >> LIGHTSEGSHIFT);
else else
light = LIGHTLEVELS-1; light = LIGHTLEVELS-1;

View File

@ -1443,7 +1443,8 @@ static void R_RenderSegLoop (void)
#ifdef POLYOBJECTS_PLANES #ifdef POLYOBJECTS_PLANES
// Polyobject-specific hack to fix plane leaking -Red // Polyobject-specific hack to fix plane leaking -Red
if (ffloor[i].polyobj && top_w >= bottom_w) { if (ffloor[i].polyobj && top_w >= bottom_w) {
ffloor[i].plane->top[rw_x] = ffloor[i].plane->bottom[rw_x] = 0xFFFF; ffloor[i].plane->top[rw_x] = 0xFFFF;
ffloor[i].plane->bottom[rw_x] = 0x0000; // fix for sky plane drawing crashes - Monster Iestyn 25/05/18
} else } else
#endif #endif
@ -1467,7 +1468,8 @@ static void R_RenderSegLoop (void)
#ifdef POLYOBJECTS_PLANES #ifdef POLYOBJECTS_PLANES
// Polyobject-specific hack to fix plane leaking -Red // Polyobject-specific hack to fix plane leaking -Red
if (ffloor[i].polyobj && top_w >= bottom_w) { if (ffloor[i].polyobj && top_w >= bottom_w) {
ffloor[i].plane->top[rw_x] = ffloor[i].plane->bottom[rw_x] = 0xFFFF; ffloor[i].plane->top[rw_x] = 0xFFFF;
ffloor[i].plane->bottom[rw_x] = 0x0000; // fix for sky plane drawing crashes - Monster Iestyn 25/05/18
} else } else
#endif #endif
@ -2693,6 +2695,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (linedef->special == 41) { // HORIZON LINES if (linedef->special == 41) { // HORIZON LINES
topstep = bottomstep = 0; topstep = bottomstep = 0;
topfrac = bottomfrac = (centeryfrac>>4); topfrac = bottomfrac = (centeryfrac>>4);
topfrac++; // Prevent 1px HOM
} else { } else {
topstep = -FixedMul (rw_scalestep, worldtop); topstep = -FixedMul (rw_scalestep, worldtop);
topfrac = (centeryfrac>>4) - FixedMul (worldtop, rw_scale); topfrac = (centeryfrac>>4) - FixedMul (worldtop, rw_scale);

View File

@ -983,7 +983,8 @@ static void R_SplitSprite(vissprite_t *sprite)
newsprite->extra_colormap = sector->lightlist[i].extra_colormap; newsprite->extra_colormap = sector->lightlist[i].extra_colormap;
if (!((newsprite->cut & SC_FULLBRIGHT) && (!newsprite->extra_colormap || !newsprite->extra_colormap->fog))) if (!((newsprite->cut & SC_FULLBRIGHT)
&& (!newsprite->extra_colormap || !(newsprite->extra_colormap->fog & 1))))
{ {
lindex = FixedMul(sprite->xscale, FixedDiv(640, vid.width))>>(LIGHTSCALESHIFT); lindex = FixedMul(sprite->xscale, FixedDiv(640, vid.width))>>(LIGHTSCALESHIFT);
@ -1403,7 +1404,7 @@ static void R_ProjectSprite(mobj_t *thing)
vis->cut |= SC_FULLBRIGHT; vis->cut |= SC_FULLBRIGHT;
if (vis->cut & SC_FULLBRIGHT if (vis->cut & SC_FULLBRIGHT
&& (!vis->extra_colormap || !vis->extra_colormap->fog)) && (!vis->extra_colormap || !(vis->extra_colormap->fog & 1)))
{ {
// full bright: goggles // full bright: goggles
vis->colormap = colormaps; vis->colormap = colormaps;

View File

@ -75,7 +75,7 @@ consvar_t stereoreverse = {"stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL, 0, N
static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// actual general (maximum) sound & music volume, saved into the config // actual general (maximum) sound & music volume, saved into the config
consvar_t cv_soundvolume = {"soundvolume", "31", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};

File diff suppressed because it is too large Load Diff

View File

@ -1,425 +1,213 @@
/* XPM */ /* XPM */
static char * C:\Repo\srb2\src\sdl\SDL_icon_xpm[] = { static const char *SDL_icon_xpm[] = {
"32 32 390 2", /* columns rows colors chars-per-pixel */
" c None", "32 32 175 2 ",
". c #4F4F70", " c None",
"+ c #4D4D87", ". c #2E2E2E",
"@ c #4D4D84", "X c #3C3C3C",
"# c #4E4E6C", "o c #493939",
"$ c #6C6C95", "O c #4E473F",
"% c #5E5EB2", "+ c #161658",
"& c #6B6BE7", "@ c #131369",
"* c #7373F9", "# c #06067B",
"= c #7C7CFF", "$ c #111173",
"- c #6F70E7", "% c #16167F",
"; c #494BB2", "& c #252567",
"> c #4F4FA3", "* c #372B7C",
", c #6464D4", "= c #3D3679",
"' c #7979F5", "- c #41414A",
") c #5F5FCA", "; c #575655",
"! c #5D5D93", ": c #6A5841",
"~ c #3A3A9F", "> c #5B4B72",
"{ c #6060AC", ", c #616160",
"] c #777793", "< c #7B7B7B",
"^ c #5C5CB3", "1 c #906E49",
"/ c #7373EA", "2 c #89685D",
"( c #7A7AFF", "3 c #A67B4A",
"_ c #7575FF", "4 c #AA7F50",
": c #7979FF", "5 c #9B7560",
"< c #6264DD", "6 c #856C78",
"[ c #47478C", "7 c #997B7D",
"} c #564567", "8 c #B48552",
"| c #4647D0", "9 c #BA8A55",
"1 c #5C5CAE", "0 c #A48665",
"2 c #5E5EFF", "q c #B98F67",
"3 c #2929FF", "w c #B9946A",
"4 c #1D1DFF", "e c #B7937A",
"5 c #1919D1", "r c #C8955C",
"6 c #4F4F90", "t c #CA9966",
"7 c #1E1ECE", "y c #DAA469",
"8 c #5858FF", "u c #C9A37B",
"9 c #6767A8", "i c #D7AB7B",
"0 c #4949A0", "p c #DFB07D",
"a c #7070FB", "a c #EBAE6A",
"b c #7D7DFF", "s c #E5B27A",
"c c #7777FF", "d c #F1B779",
"d c #7373FF", "f c #0A0A83",
"e c #7272FF", "g c #05058B",
"f c #7878FF", "h c #060687",
"g c #6465D8", "j c #101089",
"h c #363886", "k c #131382",
"i c #9F7655", "l c #040494",
"j c #C89B5C", "z c #02029D",
"k c #1D1CB7", "x c #0C0B9C",
"l c #3031B1", "c c #120F9E",
"m c #1919F4", "v c #19199B",
"n c #1111FF", "b c #382D84",
"o c #1818FF", "n c #39398D",
"p c #1B1BFF", "m c #222296",
"q c #1C1CFF", "M c #0101A6",
"r c #2626B3", "N c #0A0AA2",
"s c #1E1EC8", "B c #0202AC",
"t c #1A1AE8", "V c #1919A2",
"u c #24249F", "C c #1616AD",
"v c #2F2FD2", "Z c #0000B5",
"w c #7676FF", "A c #0202BC",
"x c #6869E2", "S c #0C0CB6",
"y c #414290", "D c #1313B3",
"z c #8C6751", "F c #1011BD",
"A c #FCBA68", "G c #1B1BBE",
"B c #E9BD7D", "H c #2B2BAC",
"C c #201EB8", "J c #3737A1",
"D c #090AB8", "K c #2A26BE",
"E c #1616EB", "L c #2A29B4",
"F c #1818FD", "P c #3B3BB8",
"G c #1414EE", "I c #48478B",
"H c #1010E1", "U c #57578A",
"I c #0E0EE2", "Y c #4A499A",
"J c #0E0EF4", "T c #524F95",
"K c #0606B2", "R c #565399",
"L c #7A7A89", "E c #4C4CA8",
"M c #0C0C9A", "W c #524DA7",
"N c #0A0AA7", "Q c #5353A4",
"O c #2424E4", "! c #5555A9",
"P c #6669E6", "~ c #5555B4",
"Q c #4F4A8F", "^ c #5656B7",
"R c #BF853B", "/ c #6464A6",
"S c #FFD98D", "( c #6F67B5",
"T c #CDAB76", ") c #0404C3",
"U c #1717C4", "_ c #0707CA",
"V c #0F10BA", "` c #1414CB",
"W c #0909B6", "' c #1A1AC6",
"X c #0505C3", "] c #0A0AD3",
"Y c #0000B6", "[ c #0D0DDC",
"Z c #0000BE", "{ c #1A1AD4",
"` c #0000AD", "} c #1010DF",
" . c #1D1D83", "| c #1E1EDE",
".. c #63638E", " . c #1817DE",
"+. c #090975", ".. c #221FCA",
"@. c #1414F3", "X. c #2B2BCC",
"#. c #5B5BFF", "o. c #2727C9",
"$. c #7B7BFF", "O. c #3434C3",
"%. c #7070FF", "+. c #3434D4",
"&. c #6E6EFF", "@. c #0F0FE2",
"*. c #7172F6", "#. c #1313E5",
"=. c #625DAF", "$. c #1515ED",
"-. c #BA9E6C", "%. c #1B1BEA",
";. c #887167", "&. c #1C1CE4",
">. c #090DF2", "*. c #1515F4",
",. c #1313BE", "=. c #1818F3",
"'. c #000085", "-. c #1717FD",
"). c #0000AC", ";. c #1818FF",
"!. c #0202AA", ":. c #2B2BE9",
"~. c #242488", ">. c #2424FF",
"{. c #1414C7", ",. c #2A2AFF",
"]. c #1717FF", "<. c #2222F1",
"^. c #5959FF", "1. c #3737FF",
"/. c #7F7FFF", "2. c #5D5DC3",
"(. c #7474FF", "3. c #5F5FC9",
"_. c #7171FF", "4. c #5655C2",
":. c #8686FF", "5. c #4747D1",
"<. c #7574FF", "6. c #5B5BD4",
"[. c #797CFF", "7. c #6565C8",
"}. c #5756B8", "8. c #6363DA",
"|. c #1C19A4", "9. c #4545FF",
"1. c #1617FF", "0. c #4D4DFC",
"2. c #1212BD", "q. c #5454FF",
"3. c #040485", "w. c #5959FF",
"4. c #0707A4", "e. c #6969E5",
"5. c #1B1B71", "r. c #6B6CEA",
"6. c #373797", "t. c #6666E7",
"7. c #1616FF", "y. c #6B6BFE",
"8. c #5050FF", "u. c #6767F8",
"9. c #8080FF", "i. c #7070F6",
"0. c #AAAAFF", "p. c #7373FF",
"a. c #AEAEF6", "a. c #7C7CFF",
"b. c #8A8AEF", "s. c #91918F",
"c. c #6969FB", "d. c #8F9090",
"d. c #2728FF", "f. c #979797",
"e. c #1314FF", "g. c #9C9C9C",
"f. c #1919FF", "h. c #8585A1",
"g. c #1313E8", "j. c #9C9CA7",
"h. c #1F1FF4", "k. c #9292B6",
"i. c #5454FF", "l. c #A4A4A4",
"j. c #6D6DF0", "z. c #BDB2A4",
"k. c #6868B5", "x. c #A4A4B1",
"l. c #0B0BB8", "c. c #BFBFBD",
"m. c #1212C5", "v. c #BABAB7",
"n. c #1616FC", "b. c #C8AA87",
"o. c #1515FF", "n. c #DAAE82",
"p. c #1212FF", "m. c #DBB081",
"q. c #2323FF", "M. c #EBBA85",
"r. c #3636FF", "N. c #F3BF84",
"s. c #4040FF", "B. c #F2BE88",
"t. c #4343F9", "V. c #C2B3A3",
"u. c #5D5DB8", "C. c #FBC386",
"v. c #7F7F92", "Z. c #FCC68C",
"w. c #878793", "A. c #FFC88F",
"x. c #4B4B94", "S. c #F4C387",
"y. c #0B0CE2", "D. c #FFC990",
"z. c #1313FF", "F. c #C3C1BF",
"A. c #4C4CFF", "G. c #8F8FCB",
"B. c #8282FF", "H. c #BDBDC2",
"C. c #7171ED", "J. c #BDBDD1",
"D. c #636394", "K. c #8888F9",
"E. c #575785", "L. c #A4A4FB",
"F. c #A9A99C", "P. c #CDCDCC",
"G. c #1414BC", "I. c #CECAC6",
"H. c #1414FF", "U. c #D3CFCA",
"I. c #0707FD", "Y. c #D3D0CC",
"J. c #2525AA", "T. c #C0C0D5",
"K. c #A8A8A4", "R. c #D6D5D4",
"L. c #EBEBE2", "E. c #D7D7DD",
"M. c #F9F9F2", "W. c #E1E1DF",
"N. c #E1E1CC", "Q. c #DEDEE1",
"O. c #4D4D9F", "!. c #E4E4E4",
"P. c #0B0BF7", "~. c #E8E8E8",
"Q. c #2121FF", "^. c #F0F0EE",
"R. c #3232FF", "/. c #F5F5F2",
"S. c #5555FF", "(. c #FFFFFF",
"T. c #6161B4", /* pixels */
"U. c #B5B5B2",
"V. c #FFFFF8",
"W. c #4F4F9A",
"X. c #0B0BF5",
"Y. c #1616C5",
"Z. c #A8A8A1",
"`. c #FFFFFC",
" + c #FFFFFF",
".+ c #C0C0C4",
"++ c #1212D4",
"@+ c #4444FF",
"#+ c #6464FF",
"$+ c #8383FF",
"%+ c #6767C3",
"&+ c #E4E4E4",
"*+ c #9494AE",
"=+ c #0808DF",
"-+ c #0D0DF2",
";+ c #61619A",
">+ c #F1F1E0",
",+ c #E8E8DD",
"'+ c #2424BB",
")+ c #1010FF",
"!+ c #3434FF",
"~+ c #6161FF",
"{+ c #6969D2",
"]+ c #EFEFF0",
"^+ c #C2C2BA",
"/+ c #1010B6",
"(+ c #0909AC",
"_+ c #A4A49A",
":+ c #EAEADE",
"<+ c #2525B8",
"[+ c #2F2FFF",
"}+ c #3C3CB5",
"|+ c #EEEEEE",
"1+ c #BBBBAD",
"2+ c #0B0B56",
"3+ c #0B0BFC",
"4+ c #1212EF",
"5+ c #0C0C3E",
"6+ c #919187",
"7+ c #DEDED6",
"8+ c #1F1FC0",
"9+ c #1A1AFF",
"0+ c #1717FA",
"a+ c #1515F8",
"b+ c #1111FC",
"c+ c #494992",
"d+ c #999998",
"e+ c #3E3E3B",
"f+ c #3C3C99",
"g+ c #535397",
"h+ c #5A5A4D",
"i+ c #6F6F70",
"j+ c #BFBFC9",
"k+ c #1111D6",
"l+ c #1515F1",
"m+ c #0F0FE2",
"n+ c #0D0DD9",
"o+ c #0909CD",
"p+ c #0808C7",
"q+ c #0505C7",
"r+ c #0303CB",
"s+ c #0101C0",
"t+ c #0202AF",
"u+ c #0606AC",
"v+ c #121283",
"w+ c #BBBBBB",
"x+ c #BEBEBE",
"y+ c #2F2F2E",
"z+ c #C7C8BB",
"A+ c #D8DAD1",
"B+ c #272828",
"C+ c #929292",
"D+ c #8688C7",
"E+ c #0506F6",
"F+ c #1616F5",
"G+ c #0B0BD3",
"H+ c #0202B6",
"I+ c #0000AF",
"J+ c #0000B4",
"K+ c #0000BD",
"L+ c #0000BB",
"M+ c #00009E",
"N+ c #2C2C7E",
"O+ c #6A6A8B",
"P+ c #959595",
"Q+ c #F0F0F1",
"R+ c #E1E1E1",
"S+ c #8C8E90",
"T+ c #BEBEBF",
"U+ c #C9C7C5",
"V+ c #939699",
"W+ c #E7EAED",
"X+ c #CBCBC7",
"Y+ c #413B9B",
"Z+ c #0607DD",
"`+ c #0C0CE2",
" @ c #0303B9",
".@ c #0000A8",
"+@ c #181888",
"@@ c #6A6A6A",
"#@ c #626263",
"$@ c #4B4B4C",
"%@ c #3E3B36",
"&@ c #9B805C",
"*@ c #D9B07D",
"=@ c #C9AE89",
"-@ c #B9AF9E",
";@ c #C7C5C4",
">@ c #CBCCCF",
",@ c #C7C6C6",
"'@ c #AEA59A",
")@ c #B69974",
"!@ c #D8B87F",
"~@ c #9B8272",
"{@ c #0E0B9B",
"]@ c #0000B7",
"^@ c #0000B8",
"/@ c #000082",
"(@ c #00007A",
"_@ c #636379",
":@ c #62533E",
"<@ c #B59B6C",
"[@ c #DEB07B",
"}@ c #FECC90",
"|@ c #FFCE92",
"1@ c #FEC98C",
"2@ c #F1BD82",
"3@ c #D1A979",
"4@ c #BC9E73",
"5@ c #CCA777",
"6@ c #EAB980",
"7@ c #FFCD90",
"8@ c #FFD595",
"9@ c #FDD782",
"0@ c #413678",
"a@ c #0000AE",
"b@ c #000077",
"c@ c #010193",
"d@ c #0C0CE4",
"e@ c #38389E",
"f@ c #EEC585",
"g@ c #FFDA9D",
"h@ c #FFC992",
"i@ c #FFC88F",
"j@ c #FFC990",
"k@ c #FFCE93",
"l@ c #FFD094",
"m@ c #FFCC92",
"n@ c #C9A174",
"o@ c #EDBD88",
"p@ c #FAD287",
"q@ c #3A2F7F",
"r@ c #0000BA",
"s@ c #0000B0",
"t@ c #0101B2",
"u@ c #1111ED",
"v@ c #1919C1",
"w@ c #95887C",
"x@ c #DCAC6E",
"y@ c #FFD393",
"z@ c #FFCD94",
"A@ c #FFCA93",
"B@ c #FFC991",
"C@ c #FFC78E",
"D@ c #FFCB91",
"E@ c #E0B581",
"F@ c #BB9A6F",
"G@ c #FFDC97",
"H@ c #C1A173",
"I@ c #0E0B9A",
"J@ c #0000B5",
"K@ c #0101B6",
"L@ c #1010E0",
"M@ c #1616EC",
"N@ c #A68156",
"O@ c #E7AC6B",
"P@ c #FFC582",
"Q@ c #FFCF8F",
"R@ c #FFD195",
"S@ c #FFD296",
"T@ c #FFD396",
"U@ c #FFD193",
"V@ c #FFD28F",
"W@ c #D2A96B",
"X@ c #2F2482",
"Y@ c #0000C1",
"Z@ c #0000C0",
"`@ c #0000BF",
" # c #0101BF",
".# c #1212F0",
"+# c #767698",
"@# c #9C866E",
"## c #A9865D",
"$# c #C0915D",
"%# c #C89760",
"&# c #C29360",
"*# c #AD8A61",
"=# c #9D8971",
"-# c #7F7A7A",
";# c #70708F",
"># c #6F6F91",
",# c #575788",
"'# c #464687",
")# c #2F2F87",
"!# c #15158F",
"~# c #0101A8",
"{# c #1313FB",
"]# c #57579F",
"^# c #343487",
"/# c #434388",
" ", " ",
" ", " ",
" ", " ",
" . + @ # ", " I Q T = ",
" $ % & * = - ; > , ' ) ! ", " Q 7.e.r.i.8.E E 3.r.6.J ",
" ~ { ] ^ / = ( _ : < [ } | 1 2 3 4 5 6 ", " H ~ n 4.r.p.p.p.p.8.R > 5.^ w.,.-.{ v ",
" 7 8 9 0 a b c d e f g h i j k l m n o p q r ", " { 9.^ & P t.p.p.p.p.p.8.I 5 q K L <.;.;.;.-.' ",
" s t u v _ f d d d w x y z A B C D E F G H I J K L ", " { %.H +.y.p.p.p.p.p.e.Y 2 a n.K F $.*.$.@.} ] N ",
" M N O _ c e d d d _ P Q R S T U V W X Y Z ` ... ", " x D :.y.p.p.p.p.p.p.r.R 8 C.u ..F A ) A Z M h $ ",
" +.@.#.$.d d d d %.&._ *.=.-.;.>.,.'.).!.~. ", " f =.q.p.p.p.p.p.p.p.p.i.( e 6 $.` l B M g ",
" {.].^./.(.d d _.$.:._ <.[.}.|.1.2.3.4.5. ", " ` ;.q.p.p.p.p.p.a.K.a.p.p.4.L -.` l N % ",
" 6.7.7.4 8.e : w 9.0.a.b.c.2 d.e.f.g.h.i.j.k. ", " V =.-.>.q.y.p.p.p.L.L.K.i.w.,.-.;.$.<.q.u.2. ",
" l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.o o z.A.B./.b C.D. ", " D { =.-.;.>.1.1.9.( h.h.Q &.-.-.-.;.9.p.p.p.r.! ",
" E.F.G.].o H.z.I.J.K.L.M.N.O.P.o o o Q.R.S._.b B.T. ", " U j.o.-.;.-.;.-.P x.Q.^.R.~ *.-.;.;.>.1.q.y.p.i.2. ",
" U.V.W.X.f.f.7.Y.Z.`. + + +.+++].o o o.n z.q.@+#+$+%+ ", " H./.! *.;.;.;.o.x./.(.(.(.J.| -.-.;.-.-.;.,.9.u.p.7. ",
" &+ +*+=+].o -+;+>+ + + + +,+'+H.o o o o o H.)+o !+~+{+ ", " !.(.k.#.;.-.=./ !.(.(.(.(.Q.X.-.;.;.;.;.-.-.;.;.1.w.6. ",
" ]+ +^+/+H.o.(+_+ + + + + +:+<+z.o o o o o o o 7.n H.[+}+ ", " ~.(.H.G ;.-.D j.(.(.(.(.(.!.O.-.-.;.;.;.-.;.-.;.-.;.,.O. ",
" |+ +1+2+3+4+5+6+ + + + + +7+8+H.o o f.9+f.9+f.F 0+a+b+o.c+ ", " ~.(.v.@ *.$.+ d.(.(.(.(.(.E.o.-.-.;.;.-.;.;.;.*.=.=.*.$.v ",
" &+ +d+e+f+g+h+i+ + + + + +j+k+].f.9+l+m+n+o+p+q+r+s+t+u+v+ ", " ~.(.l.- Y T ; < (.(.(.(.(.J.&.-.;.;.$.@.[ ] _ ) ) Z B B f ",
" w+ +x+y+z+A+B+C+ + + + + +D+E+9+F+G+H+I+J+K+L+M+N+O+ ", " P.(.F.X c.I.X f.(.(.(.(.(.G.=.-.=.] A Z Z Z Z z f $ ",
" P+Q+R+S+T+U+V+W+ + + + +X+Y+Z+`+ @I+J+Z .@+@E. ", " l.!.R.s.F.I.g.W.(.(.(.(.R.E .[ A Z Z Z B g $ ",
" @@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@I+/@(@_@ ", " . , ; - 0 M.b.V.U.R.Y.z.u n.7 c Z Z B g # + ",
" :@<@[@}@|@1@2@3@4@5@6@7@8@9@0@L+a@b@c@d@e@ ", " : w p Z.D.A.S.p u i M.A.A.S.* Z B h z ] C ",
" f@g@h@i@i@j@k@l@|@m@n@o@p@q@r@s@t@u@p v@ ", " s D.D.A.A.A.A.A.A.A.i B.B.b A Z Z @.-.` ",
" w@x@y@z@A@B@i@C@D@E@F@G@H@I@L+J@K@L@p M@ ", " 1 y C.D.A.A.A.A.A.M.u Z.e c A Z Z [ ;.&. ",
" N@O@P@Q@R@S@T@U@V@W@X@Y@Z@Y@`@ #.#p +# ", " 8 y d C.A.A.A.C.B.t * B Z Z Z A #.=.m ",
" @###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]# ", " 3 9 r t r 9 8 o @ $ # f j l B #.V ",
" ^#/# ", " j k ",
" ", " ",
" ", " ",
" ", " ",
" "}; " "
};

View File

@ -39,6 +39,10 @@
#ifdef HAVE_IMAGE #ifdef HAVE_IMAGE
#include "SDL_image.h" #include "SDL_image.h"
#elif 1
#define LOAD_XPM //I want XPM!
#include "IMG_xpm.c" //Alam: I don't want to add SDL_Image.dll/so
#define HAVE_IMAGE //I have SDL_Image, sortof
#endif #endif
#ifdef HAVE_IMAGE #ifdef HAVE_IMAGE

View File

@ -178,7 +178,7 @@ static Mix_Chunk *ds2chunk(void *stream)
return NULL; // would and/or did wrap, can't store. return NULL; // would and/or did wrap, can't store.
break; break;
} }
sound = Z_Malloc(newsamples<<2, PU_SOUND, NULL); // samples * frequency shift * bytes per sample * channels sound = malloc(newsamples<<2); // samples * frequency shift * bytes per sample * channels
s = (SINT8 *)stream; s = (SINT8 *)stream;
d = (INT16 *)sound; d = (INT16 *)sound;
@ -306,7 +306,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0); gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2; len = (info->play_length * 441 / 10) << 2;
mem = Z_Malloc(len, PU_SOUND, NULL); mem = malloc(len);
gme_play(emu, len >> 1, mem); gme_play(emu, len >> 1, mem);
gme_delete(emu); gme_delete(emu);
@ -378,7 +378,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0); gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2; len = (info->play_length * 441 / 10) << 2;
mem = Z_Malloc(len, PU_SOUND, NULL); mem = malloc(len);
gme_play(emu, len >> 1, mem); gme_play(emu, len >> 1, mem);
gme_delete(emu); gme_delete(emu);

View File

@ -79,7 +79,6 @@ static patch_t *race1;
static patch_t *race2; static patch_t *race2;
static patch_t *race3; static patch_t *race3;
static patch_t *racego; static patch_t *racego;
static patch_t *ttlnum;
static patch_t *nightslink; static patch_t *nightslink;
static patch_t *curweapon; static patch_t *curweapon;
static patch_t *normring; static patch_t *normring;
@ -808,7 +807,7 @@ static void ST_drawLivesArea(void)
// lives number // lives number
if (gametype == GT_RACE) if (gametype == GT_RACE)
{ {
livescount = 0x7f; livescount = INFLIVES;
notgreyedout = true; notgreyedout = true;
} }
else if ((netgame || multiplayer) && gametype == GT_COOP && cv_cooplives.value == 3) else if ((netgame || multiplayer) && gametype == GT_COOP && cv_cooplives.value == 3)
@ -827,9 +826,9 @@ static void ST_drawLivesArea(void)
if (players[i].lives > 1) if (players[i].lives > 1)
notgreyedout = true; notgreyedout = true;
if (players[i].lives == 0x7f) if (players[i].lives == INFLIVES)
{ {
livescount = 0x7f; livescount = INFLIVES;
break; break;
} }
else if (livescount < 99) else if (livescount < 99)
@ -838,11 +837,11 @@ static void ST_drawLivesArea(void)
} }
else else
{ {
livescount = (((netgame || multiplayer) && gametype == GT_COOP && cv_cooplives.value == 0) ? 0x7f : stplyr->lives); livescount = (((netgame || multiplayer) && gametype == GT_COOP && cv_cooplives.value == 0) ? INFLIVES : stplyr->lives);
notgreyedout = true; notgreyedout = true;
} }
if (livescount == 0x7f) if (livescount == INFLIVES)
V_DrawCharacter(hudinfo[HUD_LIVES].x+50, hudinfo[HUD_LIVES].y+8, V_DrawCharacter(hudinfo[HUD_LIVES].x+50, hudinfo[HUD_LIVES].y+8,
'\x16' | 0x80 | hudinfo[HUD_LIVES].f|V_PERPLAYER|V_HUDTRANS, false); '\x16' | 0x80 | hudinfo[HUD_LIVES].f|V_PERPLAYER|V_HUDTRANS, false);
else else
@ -1120,13 +1119,10 @@ static void ST_drawLevelTitle(void)
if (!(timeinmap > 2 && timeinmap-3 < 110)) if (!(timeinmap > 2 && timeinmap-3 < 110))
return; return;
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2));
if (actnum > 0) if (actnum > 0)
{ lvlttlxpos -= V_LevelActNumWidth(actnum);
ttlnum = W_CachePatchName(va("TTL%.2d", actnum), PU_CACHE);
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2)) - SHORT(ttlnum->width);
}
else
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2));
ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl); ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl);
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE")); zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE"));
@ -1186,7 +1182,7 @@ static void ST_drawLevelTitle(void)
#endif #endif
if (actnum) if (actnum)
V_DrawScaledPatch(ttlnumxpos, zoney, V_PERPLAYER, ttlnum); V_DrawLevelActNum(ttlnumxpos, zoney, V_PERPLAYER, actnum);
V_DrawLevelTitle(lvlttlxpos, lvlttly, V_PERPLAYER, lvlttl); V_DrawLevelTitle(lvlttlxpos, lvlttly, V_PERPLAYER, lvlttl);
@ -1209,6 +1205,10 @@ static void ST_drawPowerupHUD(void)
if (stplyr->spectator || stplyr->playerstate != PST_LIVE) if (stplyr->spectator || stplyr->playerstate != PST_LIVE)
return; return;
// -------
// Shields
// -------
// Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right // Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right
if (stplyr->powers[pw_shield] & SH_NOSTACK) if (stplyr->powers[pw_shield] & SH_NOSTACK)
{ {
@ -1251,6 +1251,10 @@ static void ST_drawPowerupHUD(void)
offs -= shieldoffs[q]; offs -= shieldoffs[q];
// ---------
// CTF flags
// ---------
// YOU have a flag. Display a monitor-like icon for it. // YOU have a flag. Display a monitor-like icon for it.
if (stplyr->gotflag) if (stplyr->gotflag)
{ {
@ -1268,11 +1272,20 @@ static void ST_drawPowerupHUD(void)
offs -= flagoffs[q]; offs -= flagoffs[q];
// --------------------
// Timer-based powerups
// --------------------
#define DRAWTIMERICON(patch, timer) \
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, patch); \
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", timer/TICRATE));
// Invincibility, both from monitor and after being hit
invulntime = stplyr->powers[pw_flashing] ? stplyr->powers[pw_flashing] : stplyr->powers[pw_invulnerability]; invulntime = stplyr->powers[pw_flashing] ? stplyr->powers[pw_flashing] : stplyr->powers[pw_invulnerability];
// Note: pw_flashing always makes the icon flicker regardless of time, unlike pw_invulnerability
if (stplyr->powers[pw_invulnerability] > 3*TICRATE || (invulntime && leveltime & 1)) if (stplyr->powers[pw_invulnerability] > 3*TICRATE || (invulntime && leveltime & 1))
{ {
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, invincibility); DRAWTIMERICON(invincibility, invulntime)
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", invulntime/TICRATE));
} }
if (invulntime > 7) if (invulntime > 7)
@ -1285,10 +1298,10 @@ static void ST_drawPowerupHUD(void)
offs -= a; offs -= a;
} }
// Super Sneakers
if (stplyr->powers[pw_sneakers] > 3*TICRATE || (stplyr->powers[pw_sneakers] && leveltime & 1)) if (stplyr->powers[pw_sneakers] > 3*TICRATE || (stplyr->powers[pw_sneakers] && leveltime & 1))
{ {
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, sneakers); DRAWTIMERICON(sneakers, stplyr->powers[pw_sneakers])
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", stplyr->powers[pw_sneakers]/TICRATE));
} }
if (stplyr->powers[pw_sneakers] > 7) if (stplyr->powers[pw_sneakers] > 7)
@ -1301,12 +1314,13 @@ static void ST_drawPowerupHUD(void)
offs -= a; offs -= a;
} }
// Gravity Boots
if (stplyr->powers[pw_gravityboots] > 3*TICRATE || (stplyr->powers[pw_gravityboots] && leveltime & 1)) if (stplyr->powers[pw_gravityboots] > 3*TICRATE || (stplyr->powers[pw_gravityboots] && leveltime & 1))
{ {
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, gravboots); DRAWTIMERICON(gravboots, stplyr->powers[pw_gravityboots])
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", stplyr->powers[pw_gravityboots]/TICRATE));
} }
#undef DRAWTIMERICON
#undef ICONSEP #undef ICONSEP
} }
@ -1365,60 +1379,64 @@ static void ST_drawNightsRecords(void)
if (stplyr->texttimer < TICRATE/2) if (stplyr->texttimer < TICRATE/2)
aflag |= (9 - 9*stplyr->texttimer/(TICRATE/2)) << V_ALPHASHIFT; aflag |= (9 - 9*stplyr->texttimer/(TICRATE/2)) << V_ALPHASHIFT;
// A "Bonus Time Start" by any other name... switch (stplyr->textvar)
if (stplyr->textvar == 1)
{ {
V_DrawCenteredString(BASEVIDWIDTH/2, 52, V_GREENMAP|aflag, M_GetText("GET TO THE GOAL!")); case 1: // A "Bonus Time Start" by any other name...
V_DrawCenteredString(BASEVIDWIDTH/2, 60, aflag, M_GetText("SCORE MULTIPLIER START!"));
if (stplyr->finishedtime)
{ {
V_DrawString(BASEVIDWIDTH/2 - 48, 140, aflag, "TIME:"); V_DrawCenteredString(BASEVIDWIDTH/2, 52, V_GREENMAP|aflag, M_GetText("GET TO THE GOAL!"));
V_DrawString(BASEVIDWIDTH/2 - 48, 148, aflag, "BONUS:"); V_DrawCenteredString(BASEVIDWIDTH/2, 60, aflag, M_GetText("SCORE MULTIPLIER START!"));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, 140, V_ORANGEMAP|aflag, va("%d", (stplyr->startedtime - stplyr->finishedtime)/TICRATE));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, 148, V_ORANGEMAP|aflag, va("%d", (stplyr->finishedtime/TICRATE) * 100)); if (stplyr->finishedtime)
{
V_DrawString(BASEVIDWIDTH/2 - 48, 140, aflag, "TIME:");
V_DrawString(BASEVIDWIDTH/2 - 48, 148, aflag, "BONUS:");
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, 140, V_ORANGEMAP|aflag, va("%d", (stplyr->startedtime - stplyr->finishedtime)/TICRATE));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, 148, V_ORANGEMAP|aflag, va("%d", (stplyr->finishedtime/TICRATE) * 100));
}
break;
} }
} case 2: // Get n Spheres
case 3: // Get n more Spheres
// Get n [more] Spheres
else if (stplyr->textvar <= 3 && stplyr->textvar >= 2)
{
if (!stplyr->capsule)
return;
// Yes, this string is an abomination.
V_DrawCenteredString(BASEVIDWIDTH/2, 60, aflag,
va(M_GetText("\x80GET\x82 %d\x80 %s%s%s!"), stplyr->capsule->health,
(stplyr->textvar == 3) ? M_GetText("MORE ") : "",
(G_IsSpecialStage(gamemap)) ? "SPHERE" : "CHIP",
(stplyr->capsule->health > 1) ? "S" : ""));
}
// End Bonus
else if (stplyr->textvar == 4)
{
V_DrawString(BASEVIDWIDTH/2 - 56, 140, aflag, (G_IsSpecialStage(gamemap)) ? "SPHERES:" : "CHIPS:");
V_DrawString(BASEVIDWIDTH/2 - 56, 148, aflag, "BONUS:");
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 56, 140, V_ORANGEMAP|aflag, va("%d", stplyr->finishedspheres));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 56, 148, V_ORANGEMAP|aflag, va("%d", stplyr->finishedspheres * 50));
ST_DrawNightsOverlayNum((BASEVIDWIDTH/2 + 56)<<FRACBITS, 160<<FRACBITS, FRACUNIT, aflag, stplyr->lastmarescore, nightsnum, SKINCOLOR_AZURE);
// If new record, say so!
if (!(netgame || multiplayer) && G_GetBestNightsScore(gamemap, stplyr->lastmare + 1) <= stplyr->lastmarescore)
{ {
if (stplyr->texttimer & 16) if (!stplyr->capsule)
V_DrawCenteredString(BASEVIDWIDTH/2, 184, V_YELLOWMAP|aflag, "* NEW RECORD *"); return;
}
if (P_HasGrades(gamemap, stplyr->lastmare + 1)) // Yes, this string is an abomination.
{ V_DrawCenteredString(BASEVIDWIDTH/2, 60, aflag,
if (aflag) va(M_GetText("\x80GET\x82 %d\x80 %s%s%s!"), stplyr->capsule->health,
V_DrawTranslucentPatch(BASEVIDWIDTH/2 + 60, 160, aflag, (stplyr->textvar == 3) ? M_GetText("MORE ") : "",
ngradeletters[P_GetGrade(stplyr->lastmarescore, gamemap, stplyr->lastmare)]); (G_IsSpecialStage(gamemap)) ? "SPHERE" : "CHIP",
else (stplyr->capsule->health > 1) ? "S" : ""));
V_DrawScaledPatch(BASEVIDWIDTH/2 + 60, 160, 0, break;
ngradeletters[P_GetGrade(stplyr->lastmarescore, gamemap, stplyr->lastmare)]);
} }
case 4: // End Bonus
{
V_DrawString(BASEVIDWIDTH/2 - 56, 140, aflag, (G_IsSpecialStage(gamemap)) ? "SPHERES:" : "CHIPS:");
V_DrawString(BASEVIDWIDTH/2 - 56, 148, aflag, "BONUS:");
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 56, 140, V_ORANGEMAP|aflag, va("%d", stplyr->finishedspheres));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 56, 148, V_ORANGEMAP|aflag, va("%d", stplyr->finishedspheres * 50));
ST_DrawNightsOverlayNum((BASEVIDWIDTH/2 + 56)<<FRACBITS, 160<<FRACBITS, FRACUNIT, aflag, stplyr->lastmarescore, nightsnum, SKINCOLOR_AZURE);
// If new record, say so!
if (!(netgame || multiplayer) && G_GetBestNightsScore(gamemap, stplyr->lastmare + 1) <= stplyr->lastmarescore)
{
if (stplyr->texttimer & 16)
V_DrawCenteredString(BASEVIDWIDTH/2, 184, V_YELLOWMAP|aflag, "* NEW RECORD *");
}
if (P_HasGrades(gamemap, stplyr->lastmare + 1))
{
if (aflag)
V_DrawTranslucentPatch(BASEVIDWIDTH/2 + 60, 160, aflag,
ngradeletters[P_GetGrade(stplyr->lastmarescore, gamemap, stplyr->lastmare)]);
else
V_DrawScaledPatch(BASEVIDWIDTH/2 + 60, 160, 0,
ngradeletters[P_GetGrade(stplyr->lastmarescore, gamemap, stplyr->lastmare)]);
}
break;
}
default:
break;
} }
} }
@ -1454,20 +1472,60 @@ static skincolors_t linkColor[2][NUMLINKCOLORS] = {
{SKINCOLOR_SEAFOAM, SKINCOLOR_CYAN, SKINCOLOR_WAVE, SKINCOLOR_SAPPHIRE, SKINCOLOR_VAPOR, SKINCOLOR_BUBBLEGUM, {SKINCOLOR_SEAFOAM, SKINCOLOR_CYAN, SKINCOLOR_WAVE, SKINCOLOR_SAPPHIRE, SKINCOLOR_VAPOR, SKINCOLOR_BUBBLEGUM,
SKINCOLOR_VIOLET, SKINCOLOR_RUBY, SKINCOLOR_FLAME, SKINCOLOR_SUNSET, SKINCOLOR_SANDY, SKINCOLOR_LIME}}; SKINCOLOR_VIOLET, SKINCOLOR_RUBY, SKINCOLOR_FLAME, SKINCOLOR_SUNSET, SKINCOLOR_SANDY, SKINCOLOR_LIME}};
static void ST_drawNiGHTSLink(void)
{
static INT32 prevsel[2] = {0, 0}, prevtime[2] = {0, 0};
const UINT8 q = ((splitscreen && stplyr == &players[secondarydisplayplayer]) ? 1 : 0);
INT32 sel = ((stplyr->linkcount-1) / 5) % NUMLINKCOLORS, aflag = V_PERPLAYER, mag = ((stplyr->linkcount-1 >= 300) ? 1 : 0);
skincolors_t colornum;
fixed_t x, y, scale;
if (sel != prevsel[q])
{
prevsel[q] = sel;
prevtime[q] = 2 + mag;
}
if (stplyr->powers[pw_nights_linkfreeze] && (!(stplyr->powers[pw_nights_linkfreeze] & 2) || (stplyr->powers[pw_nights_linkfreeze] > flashingtics)))
colornum = SKINCOLOR_ICY;
else
colornum = linkColor[mag][sel];
aflag |= ((stplyr->linktimer < nightslinktics/3)
? (9 - 9*stplyr->linktimer/(nightslinktics/3)) << V_ALPHASHIFT
: 0);
y = (160+11)<<FRACBITS;
aflag |= V_SNAPTOBOTTOM;
x = (160+4)<<FRACBITS;
if (prevtime[q])
{
scale = ((32 + prevtime[q])<<FRACBITS)/32;
prevtime[q]--;
}
else
scale = FRACUNIT;
y -= (11*scale);
ST_DrawNightsOverlayNum(x-(4*scale), y, scale, aflag, (stplyr->linkcount-1), nightsnum, colornum);
V_DrawFixedPatch(x+(4*scale), y, scale, aflag, nightslink,
colornum == 0 ? colormaps : R_GetTranslationColormap(TC_DEFAULT, colornum, GTC_CACHE));
// Show remaining link time left in debug
if (cv_debug & DBG_NIGHTSBASIC)
V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_SNAPTOBOTTOM, va("End in %d.%02d", stplyr->linktimer/TICRATE, G_TicsToCentiseconds(stplyr->linktimer)));
}
static void ST_drawNiGHTSHUD(void) static void ST_drawNiGHTSHUD(void)
{ {
INT32 origamount; INT32 origamount;
INT32 minlink = 1;
INT32 total_spherecount; INT32 total_spherecount;
const boolean oldspecialstage = (G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS)); const boolean oldspecialstage = (G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS));
// Cheap hack: don't display when the score is showing (it popping up for a split second when exiting a map is intentional)
if (oldspecialstage || (stplyr->texttimer && stplyr->textvar == 4))
minlink = INT32_MAX;
// When debugging, show "0 Link".
else if (cv_debug & DBG_NIGHTSBASIC)
minlink = 0;
// Drill meter // Drill meter
if ( if (
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
@ -1512,55 +1570,15 @@ static void ST_drawNiGHTSHUD(void)
}*/ }*/
// Link drawing // Link drawing
if ( if (!oldspecialstage
// Don't display when the score is showing (it popping up for a split second when exiting a map is intentional)
&& !(stplyr->texttimer && stplyr->textvar == 4)
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
LUA_HudEnabled(hud_nightslink) && && LUA_HudEnabled(hud_nightslink)
#endif #endif
stplyr->linkcount > minlink) && ((cv_debug & DBG_NIGHTSBASIC) || stplyr->linkcount > 1)) // When debugging, show "0 Link".
{ {
static INT32 prevsel[2] = {0, 0}, prevtime[2] = {0, 0}; ST_drawNiGHTSLink();
const UINT8 q = ((splitscreen && stplyr == &players[secondarydisplayplayer]) ? 1 : 0);
INT32 sel = ((stplyr->linkcount-1) / 5) % NUMLINKCOLORS, aflag = V_PERPLAYER, mag = ((stplyr->linkcount-1 >= 300) ? 1 : 0);
skincolors_t colornum;
fixed_t x, y, scale;
if (sel != prevsel[q])
{
prevsel[q] = sel;
prevtime[q] = 2 + mag;
}
if (stplyr->powers[pw_nights_linkfreeze] && (!(stplyr->powers[pw_nights_linkfreeze] & 2) || (stplyr->powers[pw_nights_linkfreeze] > flashingtics)))
colornum = SKINCOLOR_ICY;
else
colornum = linkColor[mag][sel];
aflag |= ((stplyr->linktimer < nightslinktics/3)
? (9 - 9*stplyr->linktimer/(nightslinktics/3)) << V_ALPHASHIFT
: 0);
y = (160+11)<<FRACBITS;
aflag |= V_SNAPTOBOTTOM;
x = (160+4)<<FRACBITS;
if (prevtime[q])
{
scale = ((32 + prevtime[q])<<FRACBITS)/32;
prevtime[q]--;
}
else
scale = FRACUNIT;
y -= (11*scale);
ST_DrawNightsOverlayNum(x-(4*scale), y, scale, aflag, (stplyr->linkcount-1), nightsnum, colornum);
V_DrawFixedPatch(x+(4*scale), y, scale, aflag, nightslink,
colornum == 0 ? colormaps : R_GetTranslationColormap(TC_DEFAULT, colornum, GTC_CACHE));
// Show remaining link time left in debug
if (cv_debug & DBG_NIGHTSBASIC)
V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_SNAPTOBOTTOM, va("End in %d.%02d", stplyr->linktimer/TICRATE, G_TicsToCentiseconds(stplyr->linktimer)));
} }
if (gametype == GT_RACE || gametype == GT_COMPETITION) if (gametype == GT_RACE || gametype == GT_COMPETITION)
@ -2452,15 +2470,26 @@ void ST_Drawer(void)
#ifdef SEENAMES #ifdef SEENAMES
if (cv_seenames.value && cv_allowseenames.value && displayplayer == consoleplayer && seenplayer && seenplayer->mo) if (cv_seenames.value && cv_allowseenames.value && displayplayer == consoleplayer && seenplayer && seenplayer->mo)
{ {
if (cv_seenames.value == 1) INT32 c = 0;
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, player_names[seenplayer-players]); switch (cv_seenames.value)
else if (cv_seenames.value == 2) {
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, case 1: // Colorless
va("%s%s", G_GametypeHasTeams() ? ((seenplayer->ctfteam == 1) ? "\x85" : "\x84") : "", player_names[seenplayer-players])); break;
else //if (cv_seenames.value == 3) case 2: // Team
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, if (G_GametypeHasTeams())
va("%s%s", !G_RingSlingerGametype() || (G_GametypeHasTeams() && players[consoleplayer].ctfteam == seenplayer->ctfteam) c = (seenplayer->ctfteam == 1) ? V_REDMAP : V_BLUEMAP;
? "\x83" : "\x85", player_names[seenplayer-players])); break;
case 3: // Ally/Foe
default:
// Green = Ally, Red = Foe
if (G_GametypeHasTeams())
c = (players[consoleplayer].ctfteam == seenplayer->ctfteam) ? V_GREENMAP : V_REDMAP;
else // Everyone is an ally, or everyone is a foe!
c = (G_RingSlingerGametype()) ? V_REDMAP : V_GREENMAP;
break;
}
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF|c, player_names[seenplayer-players]);
} }
#endif #endif

View File

@ -622,7 +622,7 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
if (scrn & V_FLIP) if (scrn & V_FLIP)
{ {
flip = true; flip = true;
x -= FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<<FRACBITS, pscale); x -= FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<<FRACBITS, pscale) + 1;
} }
else else
x -= FixedMul(SHORT(patch->leftoffset)<<FRACBITS, pscale); x -= FixedMul(SHORT(patch->leftoffset)<<FRACBITS, pscale);
@ -1236,7 +1236,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT) if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
{ // Clear the entire screen, from dest to deststop. Yes, this really works. { // Clear the entire screen, from dest to deststop. Yes, this really works.
memset(screens[0], (UINT8)(c&255), vid.width * vid.height * vid.bpp); memset(screens[0], (c&255), vid.width * vid.height * vid.bpp);
return; return;
} }
@ -1299,7 +1299,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
c &= 255; c &= 255;
for (;(--h >= 0) && dest < deststop; dest += vid.width) for (;(--h >= 0) && dest < deststop; dest += vid.width)
memset(dest, (UINT8)(c&255), w * vid.bpp); memset(dest, c, w * vid.bpp);
} }
// //
@ -1642,6 +1642,7 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
dupx = dupy = 1; dupx = dupy = 1;
scrwidth = vid.width/vid.dupx; scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2; left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
} }
switch (option & V_SPACINGMASK) switch (option & V_SPACINGMASK)
@ -1701,7 +1702,7 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
else else
w = SHORT(hu_font[c]->width) * dupx; w = SHORT(hu_font[c]->width) * dupx;
if (cx+left > scrwidth) if (cx > scrwidth)
break; break;
if (cx+left + w < 0) //left boundary check if (cx+left + w < 0) //left boundary check
{ {
@ -1754,6 +1755,7 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string)
dupx = dupy = 1; dupx = dupy = 1;
scrwidth = vid.width/vid.dupx; scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2; left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
} }
charflags = (option & V_CHARCOLORMASK); charflags = (option & V_CHARCOLORMASK);
@ -1813,7 +1815,8 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string)
} }
else else
w = SHORT(hu_font[c]->width) * dupx / 2; w = SHORT(hu_font[c]->width) * dupx / 2;
if (cx+left > scrwidth)
if (cx > scrwidth)
break; break;
if (cx+left + w < 0) //left boundary check if (cx+left + w < 0) //left boundary check
{ {
@ -1860,6 +1863,7 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string)
dupx = dupy = 1; dupx = dupy = 1;
scrwidth = vid.width/vid.dupx; scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2; left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
} }
charflags = (option & V_CHARCOLORMASK); charflags = (option & V_CHARCOLORMASK);
@ -1917,7 +1921,7 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string)
else else
w = (SHORT(tny_font[c]->width) * dupx); w = (SHORT(tny_font[c]->width) * dupx);
if (cx+left > scrwidth) if (cx > scrwidth)
break; break;
if (cx+left + w < 0) //left boundary check if (cx+left + w < 0) //left boundary check
{ {
@ -1960,6 +1964,7 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
dupx = dupy = 1; dupx = dupy = 1;
scrwidth = vid.width/vid.dupx; scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2; left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
} }
switch (option & V_SPACINGMASK) switch (option & V_SPACINGMASK)
@ -2014,9 +2019,9 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
else else
w = SHORT(hu_font[c]->width) * dupx; w = SHORT(hu_font[c]->width) * dupx;
if ((cx>>FRACBITS)+left > scrwidth) if ((cx>>FRACBITS) > scrwidth)
break; break;
if (cx+left + w < 0) //left boundary check if ((cx>>FRACBITS)+left + w < 0) //left boundary check
{ {
cx += w<<FRACBITS; cx += w<<FRACBITS;
continue; continue;
@ -2074,6 +2079,16 @@ void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits)
} while (--digits); } while (--digits);
} }
// Draw an act number for a level title
// Todo: actually draw two-digit numbers as two act num patches
void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, INT32 num)
{
if (num < 0 || num > 19)
return; // not supported
V_DrawScaledPatch(x, y, flags, ttlnum[num]);
}
// Write a string using the credit font // Write a string using the credit font
// NOTE: the text is centered for screens larger than the base width // NOTE: the text is centered for screens larger than the base width
// //
@ -2116,7 +2131,7 @@ void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string)
} }
w = SHORT(cred_font[c]->width) * dupx; w = SHORT(cred_font[c]->width) * dupx;
if ((cx>>FRACBITS) + w > scrwidth) if ((cx>>FRACBITS) > scrwidth)
break; break;
V_DrawSciencePatch(cx, cy, option, cred_font[c], FRACUNIT); V_DrawSciencePatch(cx, cy, option, cred_font[c], FRACUNIT);
@ -2168,6 +2183,7 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string)
dupx = dupy = 1; dupx = dupy = 1;
scrwidth = vid.width/vid.dupx; scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2; left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
} }
for (;;ch++) for (;;ch++)
@ -2197,10 +2213,9 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string)
w = SHORT(lt_font[c]->width) * dupx; w = SHORT(lt_font[c]->width) * dupx;
if (cx+left > scrwidth) if (cx > scrwidth)
break; break;
//left boundary check if (cx+left + w < 0) //left boundary check
if (cx+left + w < 0)
{ {
cx += w; cx += w;
continue; continue;
@ -2254,6 +2269,16 @@ INT32 V_LevelNameHeight(const char *string)
return w; return w;
} }
// For ST_drawLevelTitle
// Returns the width of the act num patch
INT32 V_LevelActNumWidth(INT32 num)
{
if (num < 0 || num > 19)
return 0; // not a valid number
return SHORT(ttlnum[num]->width);
}
// //
// Find string width from hu_font chars // Find string width from hu_font chars
// //

View File

@ -185,10 +185,12 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
// Draw tall nums, used for menu, HUD, intermission // Draw tall nums, used for menu, HUD, intermission
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num); void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num);
void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits); void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits);
void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, INT32 num);
// Find string width from lt_font chars // Find string width from lt_font chars
INT32 V_LevelNameWidth(const char *string); INT32 V_LevelNameWidth(const char *string);
INT32 V_LevelNameHeight(const char *string); INT32 V_LevelNameHeight(const char *string);
INT32 V_LevelActNumWidth(INT32 num); // act number width
void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string); void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string);
INT32 V_CreditStringWidth(const char *string); INT32 V_CreditStringWidth(const char *string);

View File

@ -161,7 +161,7 @@ static BOOL wasPlaying;
//static INT cdVolume = 0; // current cd volume (0-31) //static INT cdVolume = 0; // current cd volume (0-31)
// 0-31 like Music & Sfx, though CD hardware volume is 0-255. // 0-31 like Music & Sfx, though CD hardware volume is 0-255.
consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// allow Update for next/loop track // allow Update for next/loop track
// some crap cd drivers take up to // some crap cd drivers take up to

View File

@ -70,7 +70,7 @@ typedef union
UINT32 score, total; // fake score, total UINT32 score, total; // fake score, total
UINT32 tics; // time UINT32 tics; // time
patch_t *ttlnum; // act number being displayed INT32 actnum; // act number being displayed
patch_t *ptotal; // TOTAL patch_t *ptotal; // TOTAL
UINT8 gotlife; // Number of extra lives obtained UINT8 gotlife; // Number of extra lives obtained
} coop; } coop;
@ -288,8 +288,8 @@ void Y_IntermissionDrawer(void)
V_DrawLevelTitle(data.coop.passedx1, 49, 0, data.coop.passed1); V_DrawLevelTitle(data.coop.passedx1, 49, 0, data.coop.passed1);
V_DrawLevelTitle(data.coop.passedx2, 49+V_LevelNameHeight(data.coop.passed2)+2, 0, data.coop.passed2); V_DrawLevelTitle(data.coop.passedx2, 49+V_LevelNameHeight(data.coop.passed2)+2, 0, data.coop.passed2);
if (mapheaderinfo[gamemap-1]->actnum) if (data.coop.actnum)
V_DrawScaledPatch(244, 57, 0, data.coop.ttlnum); V_DrawLevelActNum(244, 57, 0, data.coop.actnum);
bonusy = 150; bonusy = 150;
// Total // Total
@ -1183,11 +1183,7 @@ void Y_StartIntermission(void)
data.coop.ptotal = W_CachePatchName("YB_TOTAL", PU_STATIC); data.coop.ptotal = W_CachePatchName("YB_TOTAL", PU_STATIC);
// get act number // get act number
if (mapheaderinfo[prevmap]->actnum) data.coop.actnum = mapheaderinfo[gamemap-1]->actnum;
data.coop.ttlnum = W_CachePatchName(va("TTL%.2d", mapheaderinfo[prevmap]->actnum),
PU_STATIC);
else
data.coop.ttlnum = W_CachePatchName("TTL01", PU_STATIC);
// get background patches // get background patches
widebgpatch = W_CachePatchName("INTERSCW", PU_STATIC); widebgpatch = W_CachePatchName("INTERSCW", PU_STATIC);
@ -1878,7 +1874,9 @@ static void Y_AwardCoopBonuses(void)
players[i].score = MAXSCORE; players[i].score = MAXSCORE;
} }
ptlives = (!ultimatemode && !modeattacking && players[i].lives != 0x7f) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0; ptlives = min(
((!ultimatemode && !modeattacking && players[i].lives != INFLIVES) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0),
(mapheaderinfo[prevmap]->maxbonuslives < 0 ? INT32_MAX : mapheaderinfo[prevmap]->maxbonuslives));
if (ptlives) if (ptlives)
P_GivePlayerLives(&players[i], ptlives); P_GivePlayerLives(&players[i], ptlives);
@ -1922,7 +1920,9 @@ static void Y_AwardSpecialStageBonus(void)
players[i].score = MAXSCORE; players[i].score = MAXSCORE;
// grant extra lives right away since tally is faked // grant extra lives right away since tally is faked
ptlives = (!ultimatemode && !modeattacking && players[i].lives != 0x7f) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0; ptlives = min(
((!ultimatemode && !modeattacking && players[i].lives != INFLIVES) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0),
(mapheaderinfo[prevmap]->maxbonuslives < 0 ? INT32_MAX : mapheaderinfo[prevmap]->maxbonuslives));
if (ptlives) if (ptlives)
P_GivePlayerLives(&players[i], ptlives); P_GivePlayerLives(&players[i], ptlives);
@ -1994,7 +1994,6 @@ static void Y_UnloadData(void)
{ {
case int_coop: case int_coop:
// unload the coop and single player patches // unload the coop and single player patches
UNLOAD(data.coop.ttlnum);
UNLOAD(data.coop.bonuspatches[3]); UNLOAD(data.coop.bonuspatches[3]);
UNLOAD(data.coop.bonuspatches[2]); UNLOAD(data.coop.bonuspatches[2]);
UNLOAD(data.coop.bonuspatches[1]); UNLOAD(data.coop.bonuspatches[1]);