mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 04:21:23 +00:00
Merge branch 'udmf-next' into udmf-fofs-mkii
This commit is contained in:
commit
02c2aeb46a
40 changed files with 717 additions and 679 deletions
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
|
|||
# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string.
|
||||
# Version change is fine.
|
||||
project(SRB2
|
||||
VERSION 2.2.2
|
||||
VERSION 2.2.4
|
||||
LANGUAGES C)
|
||||
|
||||
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
version: 2.2.2.{branch}-{build}
|
||||
version: 2.2.4.{branch}-{build}
|
||||
os: MinGW
|
||||
|
||||
environment:
|
||||
|
|
|
@ -760,6 +760,7 @@ linedeftypes
|
|||
{
|
||||
title = "Parameters";
|
||||
prefix = "(22)";
|
||||
flags8text = "[3] Set translucency by X offset";
|
||||
flags32text = "[5] Render outer sides only";
|
||||
flags64text = "[6] Trigger linedef executor";
|
||||
flags128text = "[7] Intangible";
|
||||
|
@ -1908,6 +1909,27 @@ linedeftypes
|
|||
prefix = "(333)";
|
||||
}
|
||||
|
||||
334
|
||||
{
|
||||
title = "Object Dye - Continuous";
|
||||
flags64text = "[6] Disable for this color";
|
||||
prefix = "(334)";
|
||||
}
|
||||
|
||||
335
|
||||
{
|
||||
title = "Object Dye - Each Time";
|
||||
flags64text = "[6] Disable for this color";
|
||||
prefix = "(335)";
|
||||
}
|
||||
|
||||
336
|
||||
{
|
||||
title = "Object Dye - Once";
|
||||
flags64text = "[6] Disable for this color";
|
||||
prefix = "(336)";
|
||||
}
|
||||
|
||||
399
|
||||
{
|
||||
title = "Level Load";
|
||||
|
@ -2218,6 +2240,19 @@ linedeftypes
|
|||
prefix = "(462)";
|
||||
flags8text = "[3] Set delay by backside sector";
|
||||
}
|
||||
|
||||
463
|
||||
{
|
||||
title = "Dye Object";
|
||||
prefix = "(463)";
|
||||
}
|
||||
|
||||
464
|
||||
{
|
||||
title = "Trigger Egg Capsule";
|
||||
prefix = "(464)";
|
||||
flags64text = "[6] Don't end level";
|
||||
}
|
||||
}
|
||||
|
||||
linedefexecmisc
|
||||
|
@ -3704,6 +3739,7 @@ thingtypes
|
|||
width = 8;
|
||||
height = 16;
|
||||
sprite = "internal:capsule";
|
||||
angletext = "Tag";
|
||||
}
|
||||
292
|
||||
{
|
||||
|
|
|
@ -459,7 +459,6 @@ boolean B_CheckRespawn(player_t *player)
|
|||
if (!sonic || sonic->health <= 0)
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// B_RespawnBot doesn't do anything if the condition above this isn't met
|
||||
{
|
||||
UINT8 shouldForce = LUAh_BotRespawn(sonic, tails);
|
||||
|
@ -472,7 +471,6 @@ boolean B_CheckRespawn(player_t *player)
|
|||
else if (shouldForce == 2)
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check if Sonic is busy first.
|
||||
// If he's doing any of these things, he probably doesn't want to see us.
|
||||
|
|
|
@ -28,12 +28,14 @@
|
|||
/* Manually defined asset hashes for non-CMake builds
|
||||
* Last updated 2020 / 02 / 15 - v2.2.1 - main assets
|
||||
* Last updated 2020 / 02 / 22 - v2.2.2 - patch.pk3
|
||||
* Last updated 2020 / 05 / 10 - v2.2.3 - player.dta & patch.pk3
|
||||
* Last updated 2020 / 05 / 11 - v2.2.4 - patch.pk3
|
||||
*/
|
||||
#define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28"
|
||||
#define ASSET_HASH_ZONES_PK3 "f7e88afb6af7996a834c7d663144bead"
|
||||
#define ASSET_HASH_PLAYER_DTA "ad49e07b17cc662f1ad70c454910b4ae"
|
||||
#define ASSET_HASH_PLAYER_DTA "8a4507ddf9bc0682c09174400f26ad65"
|
||||
#ifdef USE_PATCH_DTA
|
||||
#define ASSET_HASH_PATCH_PK3 "ee54330ecb743314c5f962af4db731ff"
|
||||
#define ASSET_HASH_PATCH_PK3 "bbbf6af3b20349612ee06e0b55979a76"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5062,7 +5062,7 @@ void NetUpdate(void)
|
|||
|
||||
// In case the cvar value was lowered
|
||||
if (joindelay)
|
||||
joindelay = min(joindelay - 1, 3 * cv_joindelay.value * TICRATE);
|
||||
joindelay = min(joindelay - 1, 3 * (tic_t)cv_joindelay.value * TICRATE);
|
||||
}
|
||||
|
||||
nowtime /= NEWTICRATERATIO;
|
||||
|
|
|
@ -125,6 +125,8 @@ boolean advancedemo;
|
|||
INT32 debugload = 0;
|
||||
#endif
|
||||
|
||||
char savegamename[256];
|
||||
|
||||
char srb2home[256] = ".";
|
||||
char srb2path[256] = ".";
|
||||
boolean usehome = true;
|
||||
|
@ -310,7 +312,9 @@ static void D_Display(void)
|
|||
F_WipeStartScreen();
|
||||
// Check for Mega Genesis fade
|
||||
wipestyleflags = WSF_FADEOUT;
|
||||
if (F_TryColormapFade(31))
|
||||
if (wipegamestate == (gamestate_t)FORCEWIPE)
|
||||
F_WipeColorFill(31);
|
||||
else if (F_TryColormapFade(31))
|
||||
wipetypepost = -1; // Don't run the fade below this one
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
|
||||
|
@ -991,6 +995,7 @@ static void IdentifyVersion(void)
|
|||
}
|
||||
|
||||
MUSICTEST("music.dta")
|
||||
MUSICTEST("patch_music.pk3")
|
||||
#ifdef DEVELOP // remove when music_new.dta is merged into music.dta
|
||||
MUSICTEST("music_new.dta")
|
||||
#endif
|
||||
|
|
|
@ -1863,6 +1863,12 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
|||
}
|
||||
else if (fastcmp(word, "STARTRINGS"))
|
||||
mapheaderinfo[num-1]->startrings = (UINT16)i;
|
||||
else if (fastcmp(word, "SPECIALSTAGETIME"))
|
||||
mapheaderinfo[num-1]->sstimer = i;
|
||||
else if (fastcmp(word, "SPECIALSTAGESPHERES"))
|
||||
mapheaderinfo[num-1]->ssspheres = i;
|
||||
else if (fastcmp(word, "GRAVITY"))
|
||||
mapheaderinfo[num-1]->gravity = FLOAT_TO_FIXED(atof(word2));
|
||||
else
|
||||
deh_warning("Level header %d: unknown word '%s'", num, word);
|
||||
}
|
||||
|
@ -3027,6 +3033,7 @@ static actionpointer_t actionpointers[] =
|
|||
{{A_DragonbomberSpawn}, "A_DRAGONBOMERSPAWN"},
|
||||
{{A_DragonWing}, "A_DRAGONWING"},
|
||||
{{A_DragonSegment}, "A_DRAGONSEGMENT"},
|
||||
{{A_ChangeHeight}, "A_CHANGEHEIGHT"},
|
||||
{{NULL}, "NONE"},
|
||||
|
||||
// This NULL entry must be the last in the list
|
||||
|
@ -6225,6 +6232,14 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_ROCKET",
|
||||
|
||||
"S_LASER",
|
||||
"S_LASER2",
|
||||
"S_LASERFLASH",
|
||||
|
||||
"S_LASERFLAME1",
|
||||
"S_LASERFLAME2",
|
||||
"S_LASERFLAME3",
|
||||
"S_LASERFLAME4",
|
||||
"S_LASERFLAME5",
|
||||
|
||||
"S_TORPEDO",
|
||||
|
||||
|
@ -9224,6 +9239,7 @@ static const char *const MENUTYPES_LIST[] = {
|
|||
"MP_CONNECT",
|
||||
"MP_ROOM",
|
||||
"MP_PLAYERSETUP", // MP_PlayerSetupDef shared with SPLITSCREEN if #defined NONET
|
||||
"MP_SERVER_OPTIONS",
|
||||
|
||||
// Options
|
||||
"OP_MAIN",
|
||||
|
@ -9233,10 +9249,14 @@ static const char *const MENUTYPES_LIST[] = {
|
|||
"OP_P1MOUSE",
|
||||
"OP_P1JOYSTICK",
|
||||
"OP_JOYSTICKSET", // OP_JoystickSetDef shared with P2
|
||||
"OP_P1CAMERA",
|
||||
|
||||
"OP_P2CONTROLS",
|
||||
"OP_P2MOUSE",
|
||||
"OP_P2JOYSTICK",
|
||||
"OP_P2CAMERA",
|
||||
|
||||
"OP_PLAYSTYLE",
|
||||
|
||||
"OP_VIDEO",
|
||||
"OP_VIDEOMODE",
|
||||
|
|
|
@ -143,9 +143,9 @@ extern char logfilename[1024];
|
|||
// we use comprevision and compbranch instead.
|
||||
#else
|
||||
#define VERSION 202 // Game version
|
||||
#define SUBVERSION 2 // more precise version number
|
||||
#define VERSIONSTRING "v2.2.2"
|
||||
#define VERSIONSTRINGW L"v2.2.2"
|
||||
#define SUBVERSION 4 // more precise version number
|
||||
#define VERSIONSTRING "v2.2.4"
|
||||
#define VERSIONSTRINGW L"v2.2.4"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below!
|
||||
// Otherwise we can't force updates!
|
||||
#endif
|
||||
|
@ -213,7 +213,7 @@ extern char logfilename[1024];
|
|||
// it's only for detection of the version the player is using so the MS can alert them of an update.
|
||||
// Only set it higher, not lower, obviously.
|
||||
// Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1".
|
||||
#define MODVERSION 42
|
||||
#define MODVERSION 44
|
||||
|
||||
// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
|
||||
// Increment MINOREXECVERSION whenever a config change is needed that does not correspond
|
||||
|
@ -458,7 +458,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG;
|
|||
|
||||
// Things that used to be in dstrings.h
|
||||
#define SAVEGAMENAME "srb2sav"
|
||||
char savegamename[256];
|
||||
extern char savegamename[256];
|
||||
|
||||
// m_misc.h
|
||||
#ifdef GETTEXT
|
||||
|
|
|
@ -319,6 +319,9 @@ typedef struct
|
|||
|
||||
char selectheading[22]; ///< Level select heading. Allows for controllable grouping.
|
||||
UINT16 startrings; ///< Number of rings players start with.
|
||||
INT32 sstimer; ///< Timer for special stages.
|
||||
UINT32 ssspheres; ///< Sphere requirement in special stages.
|
||||
fixed_t gravity; ///< Map-wide gravity.
|
||||
|
||||
// Title card.
|
||||
char ltzzpatch[8]; ///< Zig zag patch.
|
||||
|
@ -542,7 +545,7 @@ extern recorddata_t *mainrecords[NUMMAPS];
|
|||
extern UINT8 mapvisited[NUMMAPS];
|
||||
|
||||
// Temporary holding place for nights data for the current map
|
||||
nightsdata_t ntemprecords;
|
||||
extern nightsdata_t ntemprecords;
|
||||
|
||||
extern UINT32 token; ///< Number of tokens collected in a level
|
||||
extern UINT32 tokenlist; ///< List of tokens collected
|
||||
|
|
|
@ -298,6 +298,8 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
|
||||
// Projectiles
|
||||
&lspr[NOLIGHT], // SPR_MISL
|
||||
&lspr[SMALLREDBALL_L], // SPR_LASR
|
||||
&lspr[REDSHINE_L], // SPR_LASF
|
||||
&lspr[NOLIGHT], // SPR_TORP
|
||||
&lspr[NOLIGHT], // SPR_ENRG
|
||||
&lspr[NOLIGHT], // SPR_MINE
|
||||
|
|
|
@ -3907,7 +3907,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale
|
|||
HWR_GetPatch(gpatch);
|
||||
|
||||
scalemul = FixedMul(FRACUNIT - floordiff/640, scale);
|
||||
scalemul = FixedMul(scalemul, (thing->radius*2) / gpatch->height);
|
||||
scalemul = FixedMul(scalemul, (thing->radius*2) / SHORT(gpatch->height));
|
||||
|
||||
fscale = FIXED_TO_FLOAT(scalemul);
|
||||
fx = FIXED_TO_FLOAT(thing->x);
|
||||
|
@ -3919,9 +3919,9 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale
|
|||
// 0--1
|
||||
|
||||
if (thing && fabsf(fscale - 1.0f) > 1.0E-36f)
|
||||
offset = (gpatch->height/2) * fscale;
|
||||
offset = (SHORT(gpatch->height)/2) * fscale;
|
||||
else
|
||||
offset = (float)(gpatch->height/2);
|
||||
offset = (float)(SHORT(gpatch->height)/2);
|
||||
|
||||
shadowVerts[0].x = shadowVerts[3].x = fx - offset;
|
||||
shadowVerts[2].x = shadowVerts[1].x = fx + offset;
|
||||
|
@ -3996,7 +3996,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale
|
|||
}
|
||||
|
||||
// This is expecting a pointer to an array containing 4 wallVerts for a sprite
|
||||
static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts)
|
||||
static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts, const boolean precip)
|
||||
{
|
||||
if (cv_grspritebillboarding.value
|
||||
&& spr && spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE)
|
||||
|
@ -4004,7 +4004,7 @@ static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts
|
|||
{
|
||||
float basey = FIXED_TO_FLOAT(spr->mobj->z);
|
||||
float lowy = wallVerts[0].y;
|
||||
if (P_MobjFlip(spr->mobj) == -1)
|
||||
if (!precip && P_MobjFlip(spr->mobj) == -1) // precip doesn't have eflags so they can't flip
|
||||
{
|
||||
basey = FIXED_TO_FLOAT(spr->mobj->z + spr->mobj->height);
|
||||
}
|
||||
|
@ -4117,7 +4117,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
|||
}
|
||||
|
||||
// Let dispoffset work first since this adjust each vertex
|
||||
HWR_RotateSpritePolyToAim(spr, baseWallVerts);
|
||||
HWR_RotateSpritePolyToAim(spr, baseWallVerts, false);
|
||||
|
||||
realtop = top = baseWallVerts[3].y;
|
||||
realbot = bot = baseWallVerts[0].y;
|
||||
|
@ -4396,7 +4396,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
|||
}
|
||||
|
||||
// Let dispoffset work first since this adjust each vertex
|
||||
HWR_RotateSpritePolyToAim(spr, wallVerts);
|
||||
HWR_RotateSpritePolyToAim(spr, wallVerts, false);
|
||||
|
||||
// This needs to be AFTER the shadows so that the regular sprites aren't drawn completely black.
|
||||
// sprite lighting by modulating the RGB components
|
||||
|
@ -4480,7 +4480,7 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
|||
wallVerts[1].z = wallVerts[2].z = spr->z2;
|
||||
|
||||
// Let dispoffset work first since this adjust each vertex
|
||||
HWR_RotateSpritePolyToAim(spr, wallVerts);
|
||||
HWR_RotateSpritePolyToAim(spr, wallVerts, true);
|
||||
|
||||
wallVerts[0].sow = wallVerts[3].sow = 0;
|
||||
wallVerts[2].sow = wallVerts[1].sow = gpatch->max_s;
|
||||
|
@ -5230,10 +5230,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
rotsprite = sprframe->rotsprite.patch[rot][rollangle];
|
||||
if (rotsprite != NULL)
|
||||
{
|
||||
spr_width = rotsprite->width << FRACBITS;
|
||||
spr_height = rotsprite->height << FRACBITS;
|
||||
spr_offset = rotsprite->leftoffset << FRACBITS;
|
||||
spr_topoffset = rotsprite->topoffset << FRACBITS;
|
||||
spr_width = SHORT(rotsprite->width) << FRACBITS;
|
||||
spr_height = SHORT(rotsprite->height) << FRACBITS;
|
||||
spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS;
|
||||
spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS;
|
||||
// flip -> rotate, not rotate -> flip
|
||||
flip = 0;
|
||||
}
|
||||
|
|
30
src/info.c
30
src/info.c
|
@ -187,6 +187,8 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
|
||||
// Projectiles
|
||||
"MISL",
|
||||
"LASR", // GFZ3 laser
|
||||
"LASF", // GFZ3 laser flames
|
||||
"TORP", // Torpedo
|
||||
"ENRG", // Energy ball
|
||||
"MINE", // Skim mine
|
||||
|
@ -2058,7 +2060,15 @@ state_t states[NUMSTATES] =
|
|||
|
||||
{SPR_MISL, FF_FULLBRIGHT, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_ROCKET}, // S_ROCKET
|
||||
|
||||
{SPR_MISL, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_LASER
|
||||
{SPR_LASR, FF_FULLBRIGHT|0, 2, {NULL}, 0, 0, S_NULL}, // S_LASER
|
||||
{SPR_LASR, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_NULL}, // S_LASER2
|
||||
{SPR_LASR, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_NULL}, // S_LASERFLASH
|
||||
|
||||
{SPR_LASF, FF_FULLBRIGHT|0, 2, {NULL}, 0, 0, S_LASERFLAME2}, // S_LASERFLAME1
|
||||
{SPR_LASF, FF_FULLBRIGHT|1, 1, {A_ChangeHeight}, 156*FRACUNIT, 3, S_LASERFLAME3}, // S_LASERFLAME2
|
||||
{SPR_LASF, FF_FULLBRIGHT|2, 0, {A_ChangeHeight}, 32*FRACUNIT, 3, S_LASERFLAME4}, // S_LASERFLAME3
|
||||
{SPR_LASF, FF_ANIMATE|FF_PAPERSPRITE|FF_FULLBRIGHT|2, 4, {NULL}, 1, 2, S_LASERFLAME5}, // S_LASERFLAME4
|
||||
{SPR_LASF, FF_ANIMATE|FF_PAPERSPRITE|FF_FULLBRIGHT|4, 28, {NULL}, 2, 2, S_NULL}, // S_LASERFLAME5
|
||||
|
||||
{SPR_TORP, 0, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_TORPEDO}, // S_TORPEDO
|
||||
|
||||
|
@ -5665,28 +5675,28 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_EGGMOBILE_FIRE
|
||||
-1, // doomednum
|
||||
S_SPINFIRE1, // spawnstate
|
||||
S_LASERFLAME1, // spawnstate
|
||||
1, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
sfx_s3kc2s, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
sfx_s3k8d, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
0, // speed
|
||||
8*FRACUNIT, // radius
|
||||
14*FRACUNIT, // height
|
||||
24*FRACUNIT, // radius
|
||||
84*FRACUNIT, // height
|
||||
0, // display offset
|
||||
DMG_FIRE, // mass
|
||||
1, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE, // flags
|
||||
MF_NOGRAVITY|MF_FIRE|MF_PAIN, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -9637,8 +9647,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_LASERFLASH, // meleestate
|
||||
S_LASER2, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
|
@ -9649,7 +9659,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
0, // mass
|
||||
20, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY, // flags
|
||||
MF_MISSILE|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
11
src/info.h
11
src/info.h
|
@ -284,6 +284,7 @@ void A_RolloutRock();
|
|||
void A_DragonbomberSpawn();
|
||||
void A_DragonWing();
|
||||
void A_DragonSegment();
|
||||
void A_ChangeHeight();
|
||||
|
||||
// ratio of states to sprites to mobj types is roughly 6 : 1 : 1
|
||||
#define NUMMOBJFREESLOTS 512
|
||||
|
@ -451,6 +452,8 @@ typedef enum sprite
|
|||
|
||||
// Projectiles
|
||||
SPR_MISL,
|
||||
SPR_LASR, // GFZ3 laser
|
||||
SPR_LASF, // GFZ3 laser flames
|
||||
SPR_TORP, // Torpedo
|
||||
SPR_ENRG, // Energy ball
|
||||
SPR_MINE, // Skim mine
|
||||
|
@ -2220,6 +2223,14 @@ typedef enum state
|
|||
S_ROCKET,
|
||||
|
||||
S_LASER,
|
||||
S_LASER2,
|
||||
S_LASERFLASH,
|
||||
|
||||
S_LASERFLAME1,
|
||||
S_LASERFLAME2,
|
||||
S_LASERFLAME3,
|
||||
S_LASERFLAME4,
|
||||
S_LASERFLAME5,
|
||||
|
||||
S_TORPEDO,
|
||||
|
||||
|
|
|
@ -2163,6 +2163,12 @@ static int mapheaderinfo_get(lua_State *L)
|
|||
lua_pushinteger(L, header->menuflags);
|
||||
else if (fastcmp(field,"startrings"))
|
||||
lua_pushinteger(L, header->startrings);
|
||||
else if (fastcmp(field, "sstimer"))
|
||||
lua_pushinteger(L, header->sstimer);
|
||||
else if (fastcmp(field, "ssspheres"))
|
||||
lua_pushinteger(L, header->ssspheres);
|
||||
else if (fastcmp(field, "gravity"))
|
||||
lua_pushfixed(L, header->gravity);
|
||||
// TODO add support for reading numGradedMares and grades
|
||||
else {
|
||||
// Read custom vars now
|
||||
|
|
|
@ -733,9 +733,13 @@ void LUA_InvalidatePlayer(player_t *player)
|
|||
enum
|
||||
{
|
||||
ARCH_NULL=0,
|
||||
ARCH_BOOLEAN,
|
||||
ARCH_SIGNED,
|
||||
ARCH_STRING,
|
||||
ARCH_TRUE,
|
||||
ARCH_FALSE,
|
||||
ARCH_INT8,
|
||||
ARCH_INT16,
|
||||
ARCH_INT32,
|
||||
ARCH_SMALLSTRING,
|
||||
ARCH_LARGESTRING,
|
||||
ARCH_TABLE,
|
||||
|
||||
ARCH_MOBJINFO,
|
||||
|
@ -820,22 +824,33 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
|||
WRITEUINT8(save_p, ARCH_NULL);
|
||||
return 2;
|
||||
case LUA_TBOOLEAN:
|
||||
WRITEUINT8(save_p, ARCH_BOOLEAN);
|
||||
WRITEUINT8(save_p, lua_toboolean(gL, myindex));
|
||||
WRITEUINT8(save_p, lua_toboolean(gL, myindex) ? ARCH_TRUE : ARCH_FALSE);
|
||||
break;
|
||||
case LUA_TNUMBER:
|
||||
{
|
||||
lua_Integer number = lua_tointeger(gL, myindex);
|
||||
WRITEUINT8(save_p, ARCH_SIGNED);
|
||||
if (number >= INT8_MIN && number <= INT8_MAX)
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_INT8);
|
||||
WRITESINT8(save_p, number);
|
||||
}
|
||||
else if (number >= INT16_MIN && number <= INT16_MAX)
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_INT16);
|
||||
WRITEINT16(save_p, number);
|
||||
}
|
||||
else
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_INT32);
|
||||
WRITEFIXED(save_p, number);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LUA_TSTRING:
|
||||
{
|
||||
UINT16 len = (UINT16)lua_objlen(gL, myindex); // get length of string, including embedded zeros
|
||||
UINT32 len = (UINT32)lua_objlen(gL, myindex); // get length of string, including embedded zeros
|
||||
const char *s = lua_tostring(gL, myindex);
|
||||
UINT16 i = 0;
|
||||
WRITEUINT8(save_p, ARCH_STRING);
|
||||
UINT32 i = 0;
|
||||
// if you're wondering why we're writing a string to save_p this way,
|
||||
// it turns out that Lua can have embedded zeros ('\0') in the strings,
|
||||
// so we can't use WRITESTRING as that cuts off when it finds a '\0'.
|
||||
|
@ -843,7 +858,16 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
|||
// fixing the awful crashes previously encountered for reading strings longer than 1024
|
||||
// (yes I know that's kind of a stupid thing to care about, but it'd be evil to trim or ignore them?)
|
||||
// -- Monster Iestyn 05/08/18
|
||||
WRITEUINT16(save_p, len); // save size of string
|
||||
if (len < 255)
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_SMALLSTRING);
|
||||
WRITEUINT8(save_p, len); // save size of string
|
||||
}
|
||||
else
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_LARGESTRING);
|
||||
WRITEUINT32(save_p, len); // save size of string
|
||||
}
|
||||
while (i < len)
|
||||
WRITECHAR(save_p, s[i++]); // write chars individually, including the embedded zeros
|
||||
break;
|
||||
|
@ -1173,21 +1197,36 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
|
|||
case ARCH_NULL:
|
||||
lua_pushnil(gL);
|
||||
break;
|
||||
case ARCH_BOOLEAN:
|
||||
lua_pushboolean(gL, READUINT8(save_p));
|
||||
case ARCH_TRUE:
|
||||
lua_pushboolean(gL, true);
|
||||
break;
|
||||
case ARCH_SIGNED:
|
||||
case ARCH_FALSE:
|
||||
lua_pushboolean(gL, false);
|
||||
break;
|
||||
case ARCH_INT8:
|
||||
lua_pushinteger(gL, READSINT8(save_p));
|
||||
break;
|
||||
case ARCH_INT16:
|
||||
lua_pushinteger(gL, READINT16(save_p));
|
||||
break;
|
||||
case ARCH_INT32:
|
||||
lua_pushinteger(gL, READFIXED(save_p));
|
||||
break;
|
||||
case ARCH_STRING:
|
||||
case ARCH_SMALLSTRING:
|
||||
case ARCH_LARGESTRING:
|
||||
{
|
||||
UINT16 len = READUINT16(save_p); // length of string, including embedded zeros
|
||||
UINT32 len;
|
||||
char *value;
|
||||
UINT16 i = 0;
|
||||
UINT32 i = 0;
|
||||
|
||||
// See my comments in the ArchiveValue function;
|
||||
// it's much the same for reading strings as writing them!
|
||||
// (i.e. we can't use READSTRING either)
|
||||
// -- Monster Iestyn 05/08/18
|
||||
if (type == ARCH_SMALLSTRING)
|
||||
len = READUINT8(save_p); // length of string, including embedded zeros
|
||||
else
|
||||
len = READUINT32(save_p); // length of string, including embedded zeros
|
||||
value = malloc(len); // make temp buffer of size len
|
||||
// now read the actual string
|
||||
while (i < len)
|
||||
|
|
126
src/m_menu.c
126
src/m_menu.c
|
@ -1702,7 +1702,7 @@ static INT32 highlightflags, recommendedflags, warningflags;
|
|||
// Sky Room
|
||||
menu_t SR_PandoraDef =
|
||||
{
|
||||
MN_SR_MAIN + (MN_SR_PANDORA << 6),
|
||||
MTREE2(MN_SR_MAIN, MN_SR_PANDORA),
|
||||
"M_PANDRA",
|
||||
sizeof (SR_PandorasBox)/sizeof (menuitem_t),
|
||||
&SPauseDef,
|
||||
|
@ -1716,12 +1716,12 @@ menu_t SR_PandoraDef =
|
|||
menu_t SR_MainDef = DEFAULTMENUSTYLE(MN_SR_MAIN, "M_SECRET", SR_MainMenu, &MainDef, 60, 40);
|
||||
|
||||
menu_t SR_LevelSelectDef = MAPPLATTERMENUSTYLE(
|
||||
MN_SR_MAIN + (MN_SR_LEVELSELECT << 6),
|
||||
MTREE2(MN_SR_MAIN, MN_SR_LEVELSELECT),
|
||||
NULL, SR_LevelSelectMenu);
|
||||
|
||||
menu_t SR_UnlockChecklistDef =
|
||||
{
|
||||
MN_SR_MAIN + (MN_SR_UNLOCKCHECKLIST << 6),
|
||||
MTREE2(MN_SR_MAIN, MN_SR_UNLOCKCHECKLIST),
|
||||
"M_SECRET",
|
||||
1,
|
||||
&SR_MainDef,
|
||||
|
@ -1734,7 +1734,7 @@ menu_t SR_UnlockChecklistDef =
|
|||
|
||||
menu_t SR_SoundTestDef =
|
||||
{
|
||||
MN_SR_MAIN + (MN_SR_SOUNDTEST << 6),
|
||||
MTREE2(MN_SR_MAIN, MN_SR_SOUNDTEST),
|
||||
NULL,
|
||||
sizeof (SR_SoundTestMenu)/sizeof (menuitem_t),
|
||||
&SR_MainDef,
|
||||
|
@ -1747,7 +1747,7 @@ menu_t SR_SoundTestDef =
|
|||
|
||||
menu_t SR_EmblemHintDef =
|
||||
{
|
||||
MN_SR_MAIN + (MN_SR_EMBLEMHINT << 6),
|
||||
MTREE2(MN_SR_MAIN, MN_SR_EMBLEMHINT),
|
||||
NULL,
|
||||
sizeof (SR_EmblemHintMenu)/sizeof (menuitem_t),
|
||||
&SPauseDef,
|
||||
|
@ -1774,7 +1774,7 @@ menu_t SP_MainDef = //CENTERMENUSTYLE(NULL, SP_MainMenu, &MainDef, 72);
|
|||
|
||||
menu_t SP_LoadDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_LOAD << 6),
|
||||
MTREE2(MN_SP_MAIN, MN_SP_LOAD),
|
||||
"M_PICKG",
|
||||
1,
|
||||
&SP_MainDef,
|
||||
|
@ -1786,12 +1786,12 @@ menu_t SP_LoadDef =
|
|||
};
|
||||
|
||||
menu_t SP_LevelSelectDef = MAPPLATTERMENUSTYLE(
|
||||
MN_SP_MAIN + (MN_SP_LOAD << 6) + (MN_SP_PLAYER << 12) + (MN_SP_LEVELSELECT << 18),
|
||||
MTREE4(MN_SP_MAIN, MN_SP_LOAD, MN_SP_PLAYER, MN_SP_LEVELSELECT),
|
||||
NULL, SP_LevelSelectMenu);
|
||||
|
||||
menu_t SP_LevelStatsDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_LEVELSTATS << 6),
|
||||
MTREE2(MN_SP_MAIN, MN_SP_LEVELSTATS),
|
||||
"M_STATS",
|
||||
1,
|
||||
&SP_MainDef,
|
||||
|
@ -1803,12 +1803,12 @@ menu_t SP_LevelStatsDef =
|
|||
};
|
||||
|
||||
menu_t SP_TimeAttackLevelSelectDef = MAPPLATTERMENUSTYLE(
|
||||
MN_SP_MAIN + (MN_SP_TIMEATTACK << 6) + (MN_SP_TIMEATTACK_LEVELSELECT << 12),
|
||||
MTREE3(MN_SP_MAIN, MN_SP_TIMEATTACK, MN_SP_TIMEATTACK_LEVELSELECT),
|
||||
"M_ATTACK", SP_TimeAttackLevelSelectMenu);
|
||||
|
||||
static menu_t SP_TimeAttackDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_TIMEATTACK << 6),
|
||||
MTREE2(MN_SP_MAIN, MN_SP_TIMEATTACK),
|
||||
"M_ATTACK",
|
||||
sizeof (SP_TimeAttackMenu)/sizeof (menuitem_t),
|
||||
&MainDef, // Doesn't matter.
|
||||
|
@ -1820,7 +1820,7 @@ static menu_t SP_TimeAttackDef =
|
|||
};
|
||||
static menu_t SP_ReplayDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_TIMEATTACK << 6) + (MN_SP_REPLAY << 12),
|
||||
MTREE3(MN_SP_MAIN, MN_SP_TIMEATTACK, MN_SP_REPLAY),
|
||||
"M_ATTACK",
|
||||
sizeof(SP_ReplayMenu)/sizeof(menuitem_t),
|
||||
&SP_TimeAttackDef,
|
||||
|
@ -1832,7 +1832,7 @@ static menu_t SP_ReplayDef =
|
|||
};
|
||||
static menu_t SP_GuestReplayDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_TIMEATTACK << 6) + (MN_SP_GUESTREPLAY << 12),
|
||||
MTREE3(MN_SP_MAIN, MN_SP_TIMEATTACK, MN_SP_GUESTREPLAY),
|
||||
"M_ATTACK",
|
||||
sizeof(SP_GuestReplayMenu)/sizeof(menuitem_t),
|
||||
&SP_TimeAttackDef,
|
||||
|
@ -1844,7 +1844,7 @@ static menu_t SP_GuestReplayDef =
|
|||
};
|
||||
static menu_t SP_GhostDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_TIMEATTACK << 6) + (MN_SP_GHOST << 12),
|
||||
MTREE3(MN_SP_MAIN, MN_SP_TIMEATTACK, MN_SP_GHOST),
|
||||
"M_ATTACK",
|
||||
sizeof(SP_GhostMenu)/sizeof(menuitem_t),
|
||||
&SP_TimeAttackDef,
|
||||
|
@ -1856,12 +1856,12 @@ static menu_t SP_GhostDef =
|
|||
};
|
||||
|
||||
menu_t SP_NightsAttackLevelSelectDef = MAPPLATTERMENUSTYLE(
|
||||
MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6) + (MN_SP_NIGHTS_LEVELSELECT << 12),
|
||||
MTREE3(MN_SP_MAIN, MN_SP_NIGHTSATTACK, MN_SP_NIGHTS_LEVELSELECT),
|
||||
"M_NIGHTS", SP_NightsAttackLevelSelectMenu);
|
||||
|
||||
static menu_t SP_NightsAttackDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6),
|
||||
MTREE2(MN_SP_MAIN, MN_SP_NIGHTSATTACK),
|
||||
"M_NIGHTS",
|
||||
sizeof (SP_NightsAttackMenu)/sizeof (menuitem_t),
|
||||
&MainDef, // Doesn't matter.
|
||||
|
@ -1873,7 +1873,7 @@ static menu_t SP_NightsAttackDef =
|
|||
};
|
||||
static menu_t SP_NightsReplayDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6) + (MN_SP_NIGHTS_REPLAY << 12),
|
||||
MTREE3(MN_SP_MAIN, MN_SP_NIGHTSATTACK, MN_SP_NIGHTS_REPLAY),
|
||||
"M_NIGHTS",
|
||||
sizeof(SP_NightsReplayMenu)/sizeof(menuitem_t),
|
||||
&SP_NightsAttackDef,
|
||||
|
@ -1885,7 +1885,7 @@ static menu_t SP_NightsReplayDef =
|
|||
};
|
||||
static menu_t SP_NightsGuestReplayDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6) + (MN_SP_NIGHTS_GUESTREPLAY << 12),
|
||||
MTREE3(MN_SP_MAIN, MN_SP_NIGHTSATTACK, MN_SP_NIGHTS_GUESTREPLAY),
|
||||
"M_NIGHTS",
|
||||
sizeof(SP_NightsGuestReplayMenu)/sizeof(menuitem_t),
|
||||
&SP_NightsAttackDef,
|
||||
|
@ -1897,7 +1897,7 @@ static menu_t SP_NightsGuestReplayDef =
|
|||
};
|
||||
static menu_t SP_NightsGhostDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6) + (MN_SP_NIGHTS_GHOST << 12),
|
||||
MTREE3(MN_SP_MAIN, MN_SP_NIGHTSATTACK, MN_SP_NIGHTS_GHOST),
|
||||
"M_NIGHTS",
|
||||
sizeof(SP_NightsGhostMenu)/sizeof(menuitem_t),
|
||||
&SP_NightsAttackDef,
|
||||
|
@ -1911,7 +1911,7 @@ static menu_t SP_NightsGhostDef =
|
|||
|
||||
menu_t SP_PlayerDef =
|
||||
{
|
||||
MN_SP_MAIN + (MN_SP_LOAD << 6) + (MN_SP_PLAYER << 12),
|
||||
MTREE3(MN_SP_MAIN, MN_SP_LOAD, MN_SP_PLAYER),
|
||||
"M_PICKP",
|
||||
sizeof (SP_PlayerMenu)/sizeof (menuitem_t),
|
||||
&SP_MainDef,
|
||||
|
@ -1926,7 +1926,7 @@ menu_t SP_PlayerDef =
|
|||
|
||||
menu_t MP_SplitServerDef =
|
||||
{
|
||||
MN_MP_MAIN + (MN_MP_SPLITSCREEN << 6),
|
||||
MTREE2(MN_MP_MAIN, MN_MP_SPLITSCREEN),
|
||||
"M_MULTI",
|
||||
sizeof (MP_SplitServerMenu)/sizeof (menuitem_t),
|
||||
#ifndef NONET
|
||||
|
@ -1958,7 +1958,7 @@ menu_t MP_MainDef =
|
|||
|
||||
menu_t MP_ServerDef =
|
||||
{
|
||||
MN_MP_MAIN + (MN_MP_SERVER << 6),
|
||||
MTREE2(MN_MP_MAIN, MN_MP_SERVER),
|
||||
"M_MULTI",
|
||||
sizeof (MP_ServerMenu)/sizeof (menuitem_t),
|
||||
&MP_MainDef,
|
||||
|
@ -1971,7 +1971,7 @@ menu_t MP_ServerDef =
|
|||
|
||||
menu_t MP_ConnectDef =
|
||||
{
|
||||
MN_MP_MAIN + (MN_MP_CONNECT << 6),
|
||||
MTREE2(MN_MP_MAIN, MN_MP_CONNECT),
|
||||
"M_MULTI",
|
||||
sizeof (MP_ConnectMenu)/sizeof (menuitem_t),
|
||||
&MP_MainDef,
|
||||
|
@ -1984,7 +1984,7 @@ menu_t MP_ConnectDef =
|
|||
|
||||
menu_t MP_RoomDef =
|
||||
{
|
||||
MN_MP_MAIN + (MN_MP_ROOM << 6),
|
||||
MTREE2(MN_MP_MAIN, MN_MP_ROOM),
|
||||
"M_MULTI",
|
||||
sizeof (MP_RoomMenu)/sizeof (menuitem_t),
|
||||
&MP_ConnectDef,
|
||||
|
@ -1999,9 +1999,9 @@ menu_t MP_RoomDef =
|
|||
menu_t MP_PlayerSetupDef =
|
||||
{
|
||||
#ifdef NONET
|
||||
MN_MP_MAIN + (MN_MP_PLAYERSETUP << 6),
|
||||
MTREE2(MN_MP_MAIN, MN_MP_PLAYERSETUP),
|
||||
#else
|
||||
MN_MP_MAIN + (MN_MP_SPLITSCREEN << 6) + (MN_MP_PLAYERSETUP << 12),
|
||||
MTREE3(MN_MP_MAIN, MN_MP_SPLITSCREEN, MN_MP_PLAYERSETUP),
|
||||
#endif
|
||||
"M_SPLAYR",
|
||||
sizeof (MP_PlayerSetupMenu)/sizeof (menuitem_t),
|
||||
|
@ -2017,12 +2017,13 @@ menu_t MP_PlayerSetupDef =
|
|||
menu_t OP_MainDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN,
|
||||
"M_OPTTTL", OP_MainMenu, &MainDef, 50, 30);
|
||||
|
||||
menu_t OP_ChangeControlsDef = CONTROLMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_CHANGECONTROLS << 12), // second level (<<6) set on runtime
|
||||
MTREE3(MN_OP_MAIN, 0, MN_OP_CHANGECONTROLS), // second level set on runtime
|
||||
OP_ChangeControlsMenu, &OP_MainDef);
|
||||
|
||||
menu_t OP_P1ControlsDef = {
|
||||
MN_OP_MAIN + (MN_OP_P1CONTROLS << 6),
|
||||
MTREE2(MN_OP_MAIN, MN_OP_P1CONTROLS),
|
||||
"M_CONTRO",
|
||||
sizeof(OP_P1ControlsMenu)/sizeof(menuitem_t),
|
||||
&OP_MainDef,
|
||||
|
@ -2030,7 +2031,7 @@ menu_t OP_P1ControlsDef = {
|
|||
M_DrawControlsDefMenu,
|
||||
50, 30, 0, NULL};
|
||||
menu_t OP_P2ControlsDef = {
|
||||
MN_OP_MAIN + (MN_OP_P2CONTROLS << 6),
|
||||
MTREE2(MN_OP_MAIN, MN_OP_P2CONTROLS),
|
||||
"M_CONTRO",
|
||||
sizeof(OP_P2ControlsMenu)/sizeof(menuitem_t),
|
||||
&OP_MainDef,
|
||||
|
@ -2039,20 +2040,22 @@ menu_t OP_P2ControlsDef = {
|
|||
50, 30, 0, NULL};
|
||||
|
||||
menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_P1MOUSE << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_P1CONTROLS, MN_OP_P1MOUSE),
|
||||
"M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 35, 30);
|
||||
menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_P2CONTROLS << 6) + (MN_OP_P2MOUSE << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_P2CONTROLS, MN_OP_P2MOUSE),
|
||||
"M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 35, 30);
|
||||
|
||||
menu_t OP_Joystick1Def = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_P1JOYSTICK << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_P1CONTROLS, MN_OP_P1JOYSTICK),
|
||||
"M_CONTRO", OP_Joystick1Menu, &OP_P1ControlsDef, 50, 30);
|
||||
menu_t OP_Joystick2Def = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_P2CONTROLS << 6) + (MN_OP_P2JOYSTICK << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_P2CONTROLS, MN_OP_P2JOYSTICK),
|
||||
"M_CONTRO", OP_Joystick2Menu, &OP_P2ControlsDef, 50, 30);
|
||||
|
||||
menu_t OP_JoystickSetDef =
|
||||
{
|
||||
MN_OP_MAIN + (MN_OP_JOYSTICKSET << MENUBITS*3), // second (<<6) and third level (<<12) set on runtime
|
||||
MTREE4(MN_OP_MAIN, 0, 0, MN_OP_JOYSTICKSET), // second and third level set on runtime
|
||||
"M_CONTRO",
|
||||
sizeof (OP_JoystickSetMenu)/sizeof (menuitem_t),
|
||||
&OP_Joystick1Def,
|
||||
|
@ -2064,7 +2067,7 @@ menu_t OP_JoystickSetDef =
|
|||
};
|
||||
|
||||
menu_t OP_CameraOptionsDef = {
|
||||
MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_P1CAMERA << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_P1CONTROLS, MN_OP_P1CAMERA),
|
||||
"M_CONTRO",
|
||||
sizeof (OP_CameraOptionsMenu)/sizeof (menuitem_t),
|
||||
&OP_P1ControlsDef,
|
||||
|
@ -2075,7 +2078,7 @@ menu_t OP_CameraOptionsDef = {
|
|||
NULL
|
||||
};
|
||||
menu_t OP_Camera2OptionsDef = {
|
||||
MN_OP_MAIN + (MN_OP_P2CONTROLS << 6) + (MN_OP_P2CAMERA << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_P2CONTROLS, MN_OP_P2CAMERA),
|
||||
"M_CONTRO",
|
||||
sizeof (OP_Camera2OptionsMenu)/sizeof (menuitem_t),
|
||||
&OP_P2ControlsDef,
|
||||
|
@ -2089,7 +2092,7 @@ menu_t OP_Camera2OptionsDef = {
|
|||
static menuitem_t OP_PlaystyleMenu[] = {{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandlePlaystyleMenu, 0}};
|
||||
|
||||
menu_t OP_PlaystyleDef = {
|
||||
MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_PLAYSTYLE << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_P1CONTROLS, MN_OP_PLAYSTYLE), ///@TODO the second level should be set in runtime
|
||||
NULL,
|
||||
1,
|
||||
&OP_P1ControlsDef,
|
||||
|
@ -2115,7 +2118,7 @@ static void M_VideoOptions(INT32 choice)
|
|||
|
||||
menu_t OP_VideoOptionsDef =
|
||||
{
|
||||
MN_OP_MAIN + (MN_OP_VIDEO << 6),
|
||||
MTREE2(MN_OP_MAIN, MN_OP_VIDEO),
|
||||
"M_VIDEO",
|
||||
sizeof (OP_VideoOptionsMenu)/sizeof (menuitem_t),
|
||||
&OP_MainDef,
|
||||
|
@ -2127,7 +2130,7 @@ menu_t OP_VideoOptionsDef =
|
|||
};
|
||||
menu_t OP_VideoModeDef =
|
||||
{
|
||||
MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_VIDEOMODE << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_VIDEOMODE),
|
||||
"M_VIDEO",
|
||||
1,
|
||||
&OP_VideoOptionsDef,
|
||||
|
@ -2139,7 +2142,7 @@ menu_t OP_VideoModeDef =
|
|||
};
|
||||
menu_t OP_ColorOptionsDef =
|
||||
{
|
||||
MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_COLOR << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_COLOR),
|
||||
"M_VIDEO",
|
||||
sizeof (OP_ColorOptionsMenu)/sizeof (menuitem_t),
|
||||
&OP_VideoOptionsDef,
|
||||
|
@ -2150,17 +2153,19 @@ menu_t OP_ColorOptionsDef =
|
|||
NULL
|
||||
};
|
||||
menu_t OP_SoundOptionsDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_SOUND << 6),
|
||||
MTREE2(MN_OP_MAIN, MN_OP_SOUND),
|
||||
"M_SOUND", OP_SoundOptionsMenu, &OP_MainDef, 30, 30);
|
||||
menu_t OP_SoundAdvancedDef = DEFAULTMENUSTYLE(MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30);
|
||||
menu_t OP_SoundAdvancedDef = DEFAULTMENUSTYLE(
|
||||
MTREE2(MN_OP_MAIN, MN_OP_SOUND),
|
||||
"M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30);
|
||||
|
||||
menu_t OP_ServerOptionsDef = DEFAULTSCROLLMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_SERVER << 6),
|
||||
MTREE2(MN_OP_MAIN, MN_OP_SERVER),
|
||||
"M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 30, 30);
|
||||
|
||||
menu_t OP_MonitorToggleDef =
|
||||
{
|
||||
MN_OP_MAIN + (MN_OP_SERVER << 6) + (MN_OP_MONITORTOGGLE << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_SOUND, MN_OP_MONITORTOGGLE),
|
||||
"M_SERVER",
|
||||
sizeof (OP_MonitorToggleMenu)/sizeof (menuitem_t),
|
||||
&OP_ServerOptionsDef,
|
||||
|
@ -2181,16 +2186,16 @@ static void M_OpenGLOptionsMenu(void)
|
|||
}
|
||||
|
||||
menu_t OP_OpenGLOptionsDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_OPENGL << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_OPENGL),
|
||||
"M_VIDEO", OP_OpenGLOptionsMenu, &OP_VideoOptionsDef, 30, 30);
|
||||
#ifdef ALAM_LIGHTING
|
||||
menu_t OP_OpenGLLightingDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_OPENGL << 12) + (MN_OP_OPENGL_LIGHTING << 18),
|
||||
MTREE4(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_OPENGL, MN_OP_OPENGL_LIGHTING),
|
||||
"M_VIDEO", OP_OpenGLLightingMenu, &OP_OpenGLOptionsDef, 60, 40);
|
||||
#endif
|
||||
menu_t OP_OpenGLFogDef =
|
||||
{
|
||||
MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_OPENGL << 12) + (MN_OP_OPENGL_FOG << 18),
|
||||
MTREE4(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_OPENGL, MN_OP_OPENGL_FOG),
|
||||
"M_VIDEO",
|
||||
sizeof (OP_OpenGLFogMenu)/sizeof (menuitem_t),
|
||||
&OP_OpenGLOptionsDef,
|
||||
|
@ -2202,12 +2207,12 @@ menu_t OP_OpenGLFogDef =
|
|||
};
|
||||
#endif
|
||||
menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_DATA << 6),
|
||||
MTREE2(MN_OP_MAIN, MN_OP_DATA),
|
||||
"M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30);
|
||||
|
||||
menu_t OP_ScreenshotOptionsDef =
|
||||
{
|
||||
MN_OP_MAIN + (MN_OP_DATA << 6) + (MN_OP_SCREENSHOTS << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_SCREENSHOTS),
|
||||
"M_SCREEN",
|
||||
sizeof (OP_ScreenshotOptionsMenu)/sizeof (menuitem_t),
|
||||
&OP_DataOptionsDef,
|
||||
|
@ -2219,11 +2224,11 @@ menu_t OP_ScreenshotOptionsDef =
|
|||
};
|
||||
|
||||
menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_DATA << 6) + (MN_OP_ADDONS << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_ADDONS),
|
||||
"M_ADDONS", OP_AddonsOptionsMenu, &OP_DataOptionsDef, 30, 30);
|
||||
|
||||
menu_t OP_EraseDataDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_DATA << 6) + (MN_OP_ERASEDATA << 12),
|
||||
MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_ERASEDATA),
|
||||
"M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 60, 30);
|
||||
|
||||
// ==========================================================================
|
||||
|
@ -8940,16 +8945,11 @@ static void M_SetupChoosePlayer(INT32 choice)
|
|||
/* the menus suck -James */
|
||||
if (currentMenu == &SP_LoadDef)/* from save states */
|
||||
{
|
||||
SP_PlayerDef.menuid =
|
||||
MN_SP_MAIN +
|
||||
( MN_SP_LOAD << 6 ) +
|
||||
( MN_SP_PLAYER << 12 );
|
||||
SP_PlayerDef.menuid = MTREE3(MN_SP_MAIN, MN_SP_LOAD, MN_SP_PLAYER);
|
||||
}
|
||||
else/* from Secret level select */
|
||||
{
|
||||
SP_PlayerDef.menuid =
|
||||
MN_SR_MAIN +
|
||||
( MN_SR_PLAYER << 6 );
|
||||
SP_PlayerDef.menuid = MTREE2(MN_SR_MAIN, MN_SR_PLAYER);
|
||||
}
|
||||
|
||||
SP_PlayerDef.prevMenu = currentMenu;
|
||||
|
@ -10842,9 +10842,9 @@ static void M_ServerOptions(INT32 choice)
|
|||
|
||||
/* Disable fading because of different menu head. */
|
||||
if (currentMenu == &OP_MainDef)/* from Options menu */
|
||||
OP_ServerOptionsDef.menuid = MN_OP_MAIN + ( MN_OP_SERVER << 6 );
|
||||
OP_ServerOptionsDef.menuid = MTREE2(MN_OP_MAIN, MN_OP_SERVER);
|
||||
else/* from Multiplayer menu */
|
||||
OP_ServerOptionsDef.menuid = MN_MP_MAIN + ( MN_MP_SERVER_OPTIONS << 6 );
|
||||
OP_ServerOptionsDef.menuid = MTREE2(MN_MP_MAIN, MN_MP_SERVER_OPTIONS);
|
||||
|
||||
OP_ServerOptionsDef.prevMenu = currentMenu;
|
||||
M_SetupNextMenu(&OP_ServerOptionsDef);
|
||||
|
@ -11761,8 +11761,8 @@ static void M_Setup1PControlsMenu(INT32 choice)
|
|||
OP_ChangeControlsMenu[27+3].status = IT_CALL|IT_STRING2;
|
||||
|
||||
OP_ChangeControlsDef.prevMenu = &OP_P1ControlsDef;
|
||||
OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove first level (<< 6)
|
||||
OP_ChangeControlsDef.menuid |= MN_OP_P1CONTROLS << MENUBITS; // combine first level (<< 6)
|
||||
OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove second level
|
||||
OP_ChangeControlsDef.menuid |= MN_OP_P1CONTROLS << MENUBITS; // combine second level
|
||||
M_SetupNextMenu(&OP_ChangeControlsDef);
|
||||
}
|
||||
|
||||
|
@ -11792,8 +11792,8 @@ static void M_Setup2PControlsMenu(INT32 choice)
|
|||
OP_ChangeControlsMenu[27+3].status = IT_GRAYEDOUT2;
|
||||
|
||||
OP_ChangeControlsDef.prevMenu = &OP_P2ControlsDef;
|
||||
OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove first level (<< 6)
|
||||
OP_ChangeControlsDef.menuid |= MN_OP_P2CONTROLS << MENUBITS; // combine first level (<< 6)
|
||||
OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove second level
|
||||
OP_ChangeControlsDef.menuid |= MN_OP_P2CONTROLS << MENUBITS; // combine second level
|
||||
M_SetupNextMenu(&OP_ChangeControlsDef);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
#define MENUBITS 6
|
||||
|
||||
// Menu IDs sectioned by numeric places to signify hierarchy
|
||||
/**
|
||||
* IF YOU MODIFY THIS, MODIFY MENUTYPES_LIST[] IN dehacked.c TO MATCH.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
MN_NONE,
|
||||
|
@ -129,6 +132,9 @@ typedef enum
|
|||
MN_SPECIAL,
|
||||
NUMMENUTYPES,
|
||||
} menutype_t; // up to 63; MN_SPECIAL = 53
|
||||
#define MTREE2(a,b) (a | (b<<MENUBITS))
|
||||
#define MTREE3(a,b,c) MTREE2(a, MTREE2(b,c))
|
||||
#define MTREE4(a,b,c,d) MTREE2(a, MTREE3(b,c,d))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ extern consvar_t cv_masterserver, cv_servername;
|
|||
// < 0 to not connect (usually -1) (offline mode)
|
||||
// == 0 to show all rooms, not a valid hosting room
|
||||
// anything else is whatever room the MS assigns to that number (online mode)
|
||||
INT16 ms_RoomId;
|
||||
extern INT16 ms_RoomId;
|
||||
|
||||
const char *GetMasterServerPort(void);
|
||||
const char *GetMasterServerIP(void);
|
||||
|
|
116
src/p_enemy.c
116
src/p_enemy.c
|
@ -312,6 +312,7 @@ void A_RolloutRock(mobj_t *actor);
|
|||
void A_DragonbomberSpawn(mobj_t *actor);
|
||||
void A_DragonWing(mobj_t *actor);
|
||||
void A_DragonSegment(mobj_t *actor);
|
||||
void A_ChangeHeight(mobj_t *actor);
|
||||
|
||||
//for p_enemy.c
|
||||
|
||||
|
@ -2990,6 +2991,19 @@ void A_Boss1Laser(mobj_t *actor)
|
|||
angle_t angle;
|
||||
mobj_t *point;
|
||||
tic_t dur;
|
||||
static const UINT8 LASERCOLORS[] =
|
||||
{
|
||||
SKINCOLOR_SUPERRED3,
|
||||
SKINCOLOR_SUPERRED4,
|
||||
SKINCOLOR_SUPERRED5,
|
||||
SKINCOLOR_FLAME,
|
||||
SKINCOLOR_RED,
|
||||
SKINCOLOR_RED,
|
||||
SKINCOLOR_FLAME,
|
||||
SKINCOLOR_SUPERRED5,
|
||||
SKINCOLOR_SUPERRED4,
|
||||
SKINCOLOR_SUPERRED3,
|
||||
};
|
||||
|
||||
if (LUA_CallAction("A_Boss1Laser", actor))
|
||||
return;
|
||||
|
@ -3064,7 +3078,7 @@ void A_Boss1Laser(mobj_t *actor)
|
|||
point = P_SpawnMobj(x, y, z, locvar1);
|
||||
P_SetTarget(&point->target, actor);
|
||||
point->angle = actor->angle;
|
||||
speed = point->radius*2;
|
||||
speed = point->radius;
|
||||
point->momz = FixedMul(FINECOSINE(angle>>ANGLETOFINESHIFT), speed);
|
||||
point->momx = FixedMul(FINESINE(angle>>ANGLETOFINESHIFT), FixedMul(FINECOSINE(point->angle>>ANGLETOFINESHIFT), speed));
|
||||
point->momy = FixedMul(FINESINE(angle>>ANGLETOFINESHIFT), FixedMul(FINESINE(point->angle>>ANGLETOFINESHIFT), speed));
|
||||
|
@ -3073,23 +3087,69 @@ void A_Boss1Laser(mobj_t *actor)
|
|||
{
|
||||
mobj_t *mo = P_SpawnMobj(point->x, point->y, point->z, point->type);
|
||||
mo->angle = point->angle;
|
||||
mo->color = LASERCOLORS[((UINT8)(i + 3*dur) >> 2) % sizeof(LASERCOLORS)]; // codeing
|
||||
P_UnsetThingPosition(mo);
|
||||
mo->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY;
|
||||
mo->flags = MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY;
|
||||
P_SetThingPosition(mo);
|
||||
|
||||
if (dur & 1 && mo->info->missilestate)
|
||||
{
|
||||
P_SetMobjState(mo, mo->info->missilestate);
|
||||
if (mo->info->meleestate)
|
||||
{
|
||||
mobj_t *mo2 = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_PARTICLE);
|
||||
mo2->flags2 |= MF2_LINKDRAW;
|
||||
P_SetTarget(&mo2->tracer, actor);
|
||||
P_SetMobjState(mo2, mo->info->meleestate);
|
||||
}
|
||||
}
|
||||
|
||||
if (dur == 1)
|
||||
P_SpawnGhostMobj(mo);
|
||||
|
||||
x = point->x, y = point->y, z = point->z;
|
||||
if (P_RailThinker(point))
|
||||
break;
|
||||
}
|
||||
|
||||
x += point->momx;
|
||||
y += point->momy;
|
||||
floorz = P_FloorzAtPos(x, y, z, mobjinfo[MT_EGGMOBILE_FIRE].height);
|
||||
if (z - floorz < mobjinfo[MT_EGGMOBILE_FIRE].height>>1)
|
||||
if (z - floorz < mobjinfo[MT_EGGMOBILE_FIRE].height>>1 && dur & 1)
|
||||
{
|
||||
point = P_SpawnMobj(x, y, floorz+1, MT_EGGMOBILE_FIRE);
|
||||
point = P_SpawnMobj(x, y, floorz, MT_EGGMOBILE_FIRE);
|
||||
point->angle = actor->angle;
|
||||
point->destscale = actor->scale;
|
||||
P_SetScale(point, point->destscale);
|
||||
P_SetTarget(&point->target, actor);
|
||||
point->destscale = 3*FRACUNIT;
|
||||
point->scalespeed = FRACUNIT>>2;
|
||||
point->fuse = TICRATE;
|
||||
P_MobjCheckWater(point);
|
||||
if (point->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
|
||||
{
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
UINT8 size = 3;
|
||||
mobj_t *steam = P_SpawnMobj(x, y, point->watertop - size*mobjinfo[MT_DUST].height, MT_DUST);
|
||||
P_SetScale(steam, size*actor->scale);
|
||||
P_SetObjectMomZ(steam, FRACUNIT + 2*P_RandomFixed(), true);
|
||||
P_InstaThrust(steam, FixedAngle(P_RandomKey(360)*FRACUNIT), 2*P_RandomFixed());
|
||||
if (point->info->painsound)
|
||||
S_StartSound(steam, point->info->painsound);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed_t distx = P_ReturnThrustX(point, point->angle, point->radius);
|
||||
fixed_t disty = P_ReturnThrustY(point, point->angle, point->radius);
|
||||
if (P_TryMove(point, point->x + distx, point->y + disty, false) // prevents the sprite from clipping into the wall or dangling off ledges
|
||||
&& P_TryMove(point, point->x - 2*distx, point->y - 2*disty, false)
|
||||
&& P_TryMove(point, point->x + distx, point->y + disty, false))
|
||||
{
|
||||
if (point->info->seesound)
|
||||
S_StartSound(point, point->info->seesound);
|
||||
}
|
||||
else
|
||||
P_RemoveMobj(point);
|
||||
}
|
||||
}
|
||||
|
||||
if (dur > 1)
|
||||
|
@ -8788,10 +8848,8 @@ void A_Dye(mobj_t *actor)
|
|||
|
||||
mobj_t *target = ((locvar1 && actor->target) ? actor->target : actor);
|
||||
UINT8 color = (UINT8)locvar2;
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_CallAction("A_Dye", actor))
|
||||
return;
|
||||
#endif
|
||||
if (color >= MAXTRANSLATIONS)
|
||||
return;
|
||||
|
||||
|
@ -14409,3 +14467,43 @@ void A_DragonSegment(mobj_t *actor)
|
|||
actor->angle = hangle;
|
||||
P_TeleportMove(actor, target->x + xdist, target->y + ydist, target->z + zdist);
|
||||
}
|
||||
|
||||
// Function: A_ChangeHeight
|
||||
//
|
||||
// Description: Changes the actor's height by var1
|
||||
//
|
||||
// var1 = height
|
||||
// var2 =
|
||||
// &1: height is absolute
|
||||
// &2: scale with actor's scale
|
||||
//
|
||||
void A_ChangeHeight(mobj_t *actor)
|
||||
{
|
||||
INT32 locvar1 = var1;
|
||||
INT32 locvar2 = var2;
|
||||
fixed_t height = locvar1;
|
||||
boolean reverse;
|
||||
|
||||
if (LUA_CallAction("A_ChangeHeight", actor))
|
||||
return;
|
||||
|
||||
reverse = (actor->eflags & MFE_VERTICALFLIP) || (actor->flags2 & MF2_OBJECTFLIP);
|
||||
|
||||
if (locvar2 & 2)
|
||||
height = FixedMul(height, actor->scale);
|
||||
|
||||
P_UnsetThingPosition(actor);
|
||||
if (locvar2 & 1)
|
||||
{
|
||||
if (reverse)
|
||||
actor->z += actor->height - locvar1;
|
||||
actor->height = locvar1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (reverse)
|
||||
actor->z -= locvar1;
|
||||
actor->height += locvar1;
|
||||
}
|
||||
P_SetThingPosition(actor);
|
||||
}
|
||||
|
|
15
src/p_mobj.c
15
src/p_mobj.c
|
@ -7100,8 +7100,7 @@ static void P_MobjScaleThink(mobj_t *mobj)
|
|||
fixed_t oldheight = mobj->height;
|
||||
UINT8 correctionType = 0; // Don't correct Z position, just gain height
|
||||
|
||||
if ((mobj->flags & MF_NOCLIPHEIGHT || (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz))
|
||||
&& mobj->type != MT_EGGMOBILE_FIRE)
|
||||
if (mobj->flags & MF_NOCLIPHEIGHT || (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz))
|
||||
correctionType = 1; // Correct Z position by centering
|
||||
else if (mobj->eflags & MFE_VERTICALFLIP)
|
||||
correctionType = 2; // Correct Z position by moving down
|
||||
|
@ -7122,10 +7121,6 @@ static void P_MobjScaleThink(mobj_t *mobj)
|
|||
/// \todo Lua hook for "reached destscale"?
|
||||
switch (mobj->type)
|
||||
{
|
||||
case MT_EGGMOBILE_FIRE:
|
||||
mobj->destscale = FRACUNIT;
|
||||
mobj->scalespeed = FRACUNIT>>4;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -8301,6 +8296,7 @@ static boolean P_MobjDeadThink(mobj_t *mobj)
|
|||
// See Linedef Exec 457 (Track mobj angle to point)
|
||||
static void P_TracerAngleThink(mobj_t *mobj)
|
||||
{
|
||||
angle_t looking;
|
||||
angle_t ang;
|
||||
|
||||
if (!mobj->tracer)
|
||||
|
@ -8315,7 +8311,12 @@ static void P_TracerAngleThink(mobj_t *mobj)
|
|||
// mobj->cvval - Allowable failure delay
|
||||
// mobj->cvmem - Failure timer
|
||||
|
||||
ang = mobj->angle - R_PointToAngle2(mobj->x, mobj->y, mobj->tracer->x, mobj->tracer->y);
|
||||
if (mobj->player)
|
||||
looking = ( mobj->player->cmd.angleturn << 16 );/* fixes CS_LMAOGALOG */
|
||||
else
|
||||
looking = mobj->angle;
|
||||
|
||||
ang = looking - R_PointToAngle2(mobj->x, mobj->y, mobj->tracer->x, mobj->tracer->y);
|
||||
|
||||
// \todo account for distance between mobj and tracer
|
||||
// Because closer mobjs can be facing beyond the angle tolerance
|
||||
|
|
427
src/p_polyobj.c
427
src/p_polyobj.c
File diff suppressed because it is too large
Load diff
|
@ -29,7 +29,6 @@
|
|||
#define POLYOBJ_SPAWNCRUSH_DOOMEDNUM 762 // todo: REMOVE
|
||||
|
||||
#define POLYOBJ_START_LINE 20
|
||||
#define POLYOBJ_EXPLICIT_LINE 21
|
||||
#define POLYINFO_SPECIALNUM 22
|
||||
|
||||
typedef enum
|
||||
|
@ -299,6 +298,14 @@ typedef struct polyrotdisplacedata_s
|
|||
UINT8 turnobjs;
|
||||
} polyrotdisplacedata_t;
|
||||
|
||||
typedef struct polyflagdata_s
|
||||
{
|
||||
INT32 polyObjNum;
|
||||
INT32 speed;
|
||||
UINT32 angle;
|
||||
fixed_t momx;
|
||||
} polyflagdata_t;
|
||||
|
||||
typedef struct polyfadedata_s
|
||||
{
|
||||
INT32 polyObjNum;
|
||||
|
@ -320,7 +327,6 @@ boolean P_PointInsidePolyobj(polyobj_t *po, fixed_t x, fixed_t y);
|
|||
boolean P_MobjTouchingPolyobj(polyobj_t *po, mobj_t *mo);
|
||||
boolean P_MobjInsidePolyobj(polyobj_t *po, mobj_t *mo);
|
||||
boolean P_BBoxInsidePolyobj(polyobj_t *po, fixed_t *bbox);
|
||||
void Polyobj_GetInfo(INT16 poid, INT32 *poflags, INT32 *parentID, INT32 *potrans);
|
||||
|
||||
// thinkers (needed in p_saveg.c)
|
||||
void T_PolyObjRotate(polyrotate_t *);
|
||||
|
@ -333,14 +339,14 @@ void T_PolyObjRotDisplace (polyrotdisplace_t *);
|
|||
void T_PolyObjFlag (polymove_t *);
|
||||
void T_PolyObjFade (polyfade_t *);
|
||||
|
||||
INT32 EV_DoPolyDoor(polydoordata_t *);
|
||||
INT32 EV_DoPolyObjMove(polymovedata_t *);
|
||||
INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *);
|
||||
INT32 EV_DoPolyObjRotate(polyrotdata_t *);
|
||||
INT32 EV_DoPolyObjDisplace(polydisplacedata_t *);
|
||||
INT32 EV_DoPolyObjRotDisplace(polyrotdisplacedata_t *);
|
||||
INT32 EV_DoPolyObjFlag(struct line_s *);
|
||||
INT32 EV_DoPolyObjFade(polyfadedata_t *);
|
||||
boolean EV_DoPolyDoor(polydoordata_t *);
|
||||
boolean EV_DoPolyObjMove(polymovedata_t *);
|
||||
boolean EV_DoPolyObjWaypoint(polywaypointdata_t *);
|
||||
boolean EV_DoPolyObjRotate(polyrotdata_t *);
|
||||
boolean EV_DoPolyObjDisplace(polydisplacedata_t *);
|
||||
boolean EV_DoPolyObjRotDisplace(polyrotdisplacedata_t *);
|
||||
boolean EV_DoPolyObjFlag(polyflagdata_t *);
|
||||
boolean EV_DoPolyObjFade(polyfadedata_t *);
|
||||
|
||||
|
||||
//
|
||||
|
|
|
@ -219,6 +219,9 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
|||
mapheaderinfo[num]->typeoflevel = 0;
|
||||
mapheaderinfo[num]->nextlevel = (INT16)(i + 1);
|
||||
mapheaderinfo[num]->startrings = 0;
|
||||
mapheaderinfo[num]->sstimer = 90;
|
||||
mapheaderinfo[num]->ssspheres = 1;
|
||||
mapheaderinfo[num]->gravity = FRACUNIT/2;
|
||||
mapheaderinfo[num]->keywords[0] = '\0';
|
||||
snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i));
|
||||
mapheaderinfo[num]->musname[6] = 0;
|
||||
|
|
166
src/p_spec.c
166
src/p_spec.c
|
@ -1045,9 +1045,6 @@ static INT32 P_FindLineFromTag(INT32 tag, INT32 start)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// P_FindSpecialLineFromTag
|
||||
//
|
||||
INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
|
||||
{
|
||||
if (tag == -1)
|
||||
|
@ -1077,11 +1074,8 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// PolyDoor
|
||||
//
|
||||
|
||||
// Parses arguments for parameterized polyobject door types
|
||||
//
|
||||
static boolean PolyDoor(line_t *line)
|
||||
{
|
||||
polydoordata_t pdd;
|
||||
|
@ -1118,11 +1112,7 @@ static boolean PolyDoor(line_t *line)
|
|||
return EV_DoPolyDoor(&pdd);
|
||||
}
|
||||
|
||||
//
|
||||
// PolyMove
|
||||
//
|
||||
// Parses arguments for parameterized polyobject move specials
|
||||
//
|
||||
static boolean PolyMove(line_t *line)
|
||||
{
|
||||
polymovedata_t pmd;
|
||||
|
@ -1137,12 +1127,8 @@ static boolean PolyMove(line_t *line)
|
|||
return EV_DoPolyObjMove(&pmd);
|
||||
}
|
||||
|
||||
//
|
||||
// PolyInvisible
|
||||
//
|
||||
// Makes a polyobject invisible and intangible
|
||||
// If NOCLIMB is ticked, the polyobject will still be tangible, just not visible.
|
||||
//
|
||||
static void PolyInvisible(line_t *line)
|
||||
{
|
||||
INT32 polyObjNum = line->tag;
|
||||
|
@ -1165,12 +1151,8 @@ static void PolyInvisible(line_t *line)
|
|||
po->flags &= ~POF_RENDERALL;
|
||||
}
|
||||
|
||||
//
|
||||
// PolyVisible
|
||||
//
|
||||
// Makes a polyobject visible and tangible
|
||||
// If NOCLIMB is ticked, the polyobject will not be tangible, just visible.
|
||||
//
|
||||
static void PolyVisible(line_t *line)
|
||||
{
|
||||
INT32 polyObjNum = line->tag;
|
||||
|
@ -1193,16 +1175,14 @@ static void PolyVisible(line_t *line)
|
|||
po->flags |= (po->spawnflags & POF_RENDERALL);
|
||||
}
|
||||
|
||||
//
|
||||
// PolyTranslucency
|
||||
//
|
||||
|
||||
// Sets the translucency of a polyobject
|
||||
// Frontsector floor / 100 = translevel
|
||||
//
|
||||
static void PolyTranslucency(line_t *line)
|
||||
{
|
||||
INT32 polyObjNum = line->tag;
|
||||
polyobj_t *po;
|
||||
INT32 value;
|
||||
|
||||
if (!(po = Polyobj_GetForNum(polyObjNum)))
|
||||
{
|
||||
|
@ -1214,37 +1194,28 @@ static void PolyTranslucency(line_t *line)
|
|||
if (po->isBad)
|
||||
return;
|
||||
|
||||
// if DONTPEGBOTTOM, specify raw translucency value in Front X Offset
|
||||
// else, take it out of 1000. If Front X Offset is specified, use that. Else, use floorheight.
|
||||
// If Front X Offset is specified, use that. Else, use floorheight.
|
||||
value = (sides[line->sidenum[0]].textureoffset ? sides[line->sidenum[0]].textureoffset : line->frontsector->floorheight) >> FRACBITS;
|
||||
|
||||
// If DONTPEGBOTTOM, specify raw translucency value. Else, take it out of 1000.
|
||||
if (!(line->flags & ML_DONTPEGBOTTOM))
|
||||
value /= 100;
|
||||
|
||||
if (line->flags & ML_EFFECT3) // relative calc
|
||||
po->translucency = max(min(po->translucency + ((line->flags & ML_DONTPEGBOTTOM) ?
|
||||
(sides[line->sidenum[0]].textureoffset ?
|
||||
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, NUMTRANSMAPS), -NUMTRANSMAPS)
|
||||
: max(min(line->frontsector->floorheight>>FRACBITS, NUMTRANSMAPS), -NUMTRANSMAPS))
|
||||
: (sides[line->sidenum[0]].textureoffset ?
|
||||
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, 1000), -1000) / 100
|
||||
: max(min(line->frontsector->floorheight>>FRACBITS, 1000), -1000) / 100)),
|
||||
NUMTRANSMAPS), 0);
|
||||
po->translucency += value;
|
||||
else
|
||||
po->translucency = (line->flags & ML_DONTPEGBOTTOM) ?
|
||||
(sides[line->sidenum[0]].textureoffset ?
|
||||
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, NUMTRANSMAPS), 0)
|
||||
: max(min(line->frontsector->floorheight>>FRACBITS, NUMTRANSMAPS), 0))
|
||||
: (sides[line->sidenum[0]].textureoffset ?
|
||||
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, 1000), 0) / 100
|
||||
: max(min(line->frontsector->floorheight>>FRACBITS, 1000), 0) / 100);
|
||||
po->translucency = value;
|
||||
|
||||
po->translucency = max(min(po->translucency, NUMTRANSMAPS), 0);
|
||||
}
|
||||
|
||||
//
|
||||
// PolyFade
|
||||
//
|
||||
// Makes a polyobject translucency fade and applies tangibility
|
||||
//
|
||||
static boolean PolyFade(line_t *line)
|
||||
{
|
||||
INT32 polyObjNum = line->tag;
|
||||
polyobj_t *po;
|
||||
polyfadedata_t pfd;
|
||||
INT32 value;
|
||||
|
||||
if (!(po = Polyobj_GetForNum(polyObjNum)))
|
||||
{
|
||||
|
@ -1267,25 +1238,19 @@ static boolean PolyFade(line_t *line)
|
|||
|
||||
pfd.polyObjNum = polyObjNum;
|
||||
|
||||
// if DONTPEGBOTTOM, specify raw translucency value in Front X Offset
|
||||
// else, take it out of 1000. If Front X Offset is specified, use that. Else, use floorheight.
|
||||
// If Front X Offset is specified, use that. Else, use floorheight.
|
||||
value = (sides[line->sidenum[0]].textureoffset ? sides[line->sidenum[0]].textureoffset : line->frontsector->floorheight) >> FRACBITS;
|
||||
|
||||
// If DONTPEGBOTTOM, specify raw translucency value. Else, take it out of 1000.
|
||||
if (!(line->flags & ML_DONTPEGBOTTOM))
|
||||
value /= 100;
|
||||
|
||||
if (line->flags & ML_EFFECT3) // relative calc
|
||||
pfd.destvalue = max(min(po->translucency + ((line->flags & ML_DONTPEGBOTTOM) ?
|
||||
(sides[line->sidenum[0]].textureoffset ?
|
||||
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, NUMTRANSMAPS), -NUMTRANSMAPS)
|
||||
: max(min(line->frontsector->floorheight>>FRACBITS, NUMTRANSMAPS), -NUMTRANSMAPS))
|
||||
: (sides[line->sidenum[0]].textureoffset ?
|
||||
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, 1000), -1000) / 100
|
||||
: max(min(line->frontsector->floorheight>>FRACBITS, 1000), -1000) / 100)),
|
||||
NUMTRANSMAPS), 0);
|
||||
pfd.destvalue = po->translucency + value;
|
||||
else
|
||||
pfd.destvalue = (line->flags & ML_DONTPEGBOTTOM) ?
|
||||
(sides[line->sidenum[0]].textureoffset ?
|
||||
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, NUMTRANSMAPS), 0)
|
||||
: max(min(line->frontsector->floorheight>>FRACBITS, NUMTRANSMAPS), 0))
|
||||
: (sides[line->sidenum[0]].textureoffset ?
|
||||
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, 1000), 0) / 100
|
||||
: max(min(line->frontsector->floorheight>>FRACBITS, 1000), 0) / 100);
|
||||
pfd.destvalue = value;
|
||||
|
||||
pfd.destvalue = max(min(pfd.destvalue, NUMTRANSMAPS), 0);
|
||||
|
||||
// already equal, nothing to do
|
||||
if (po->translucency == pfd.destvalue)
|
||||
|
@ -1304,11 +1269,7 @@ static boolean PolyFade(line_t *line)
|
|||
return EV_DoPolyObjFade(&pfd);
|
||||
}
|
||||
|
||||
//
|
||||
// PolyWaypoint
|
||||
//
|
||||
// Parses arguments for parameterized polyobject waypoint movement
|
||||
//
|
||||
static boolean PolyWaypoint(line_t *line)
|
||||
{
|
||||
polywaypointdata_t pwd;
|
||||
|
@ -1324,11 +1285,7 @@ static boolean PolyWaypoint(line_t *line)
|
|||
return EV_DoPolyObjWaypoint(&pwd);
|
||||
}
|
||||
|
||||
//
|
||||
// PolyRotate
|
||||
//
|
||||
// Parses arguments for parameterized polyobject rotate specials
|
||||
//
|
||||
static boolean PolyRotate(line_t *line)
|
||||
{
|
||||
polyrotdata_t prd;
|
||||
|
@ -1353,11 +1310,20 @@ static boolean PolyRotate(line_t *line)
|
|||
return EV_DoPolyObjRotate(&prd);
|
||||
}
|
||||
|
||||
//
|
||||
// PolyDisplace
|
||||
//
|
||||
// Parses arguments for polyobject flag waving special
|
||||
static boolean PolyFlag(line_t *line)
|
||||
{
|
||||
polyflagdata_t pfd;
|
||||
|
||||
pfd.polyObjNum = line->tag;
|
||||
pfd.speed = P_AproxDistance(line->dx, line->dy) >> FRACBITS;
|
||||
pfd.angle = R_PointToAngle2(line->v1->x, line->v1->y, line->v2->x, line->v2->y) >> ANGLETOFINESHIFT;
|
||||
pfd.momx = sides[line->sidenum[0]].textureoffset >> FRACBITS;
|
||||
|
||||
return EV_DoPolyObjFlag(&pfd);
|
||||
}
|
||||
|
||||
// Parses arguments for parameterized polyobject move-by-sector-heights specials
|
||||
//
|
||||
static boolean PolyDisplace(line_t *line)
|
||||
{
|
||||
polydisplacedata_t pdd;
|
||||
|
@ -1372,8 +1338,7 @@ static boolean PolyDisplace(line_t *line)
|
|||
}
|
||||
|
||||
|
||||
/** Similar to PolyDisplace().
|
||||
*/
|
||||
// Parses arguments for parameterized polyobject rotate-by-sector-heights specials
|
||||
static boolean PolyRotDisplace(line_t *line)
|
||||
{
|
||||
polyrotdisplacedata_t pdd;
|
||||
|
@ -4024,6 +3989,47 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
}
|
||||
break;
|
||||
|
||||
case 464: // Trigger Egg Capsule
|
||||
{
|
||||
thinker_t *th;
|
||||
mobj_t *mo2;
|
||||
|
||||
// Find the center of the Eggtrap and release all the pretty animals!
|
||||
// The chimps are my friends.. heeheeheheehehee..... - LouisJM
|
||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
|
||||
if (mo2->type != MT_EGGTRAP)
|
||||
continue;
|
||||
|
||||
if (!mo2->spawnpoint)
|
||||
continue;
|
||||
|
||||
if (mo2->spawnpoint->angle != line->tag)
|
||||
continue;
|
||||
|
||||
P_KillMobj(mo2, NULL, mo, 0);
|
||||
}
|
||||
|
||||
if (!(line->flags & ML_NOCLIMB))
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
// Mark all players with the time to exit thingy!
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
P_DoPlayerExit(&players[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 480: // Polyobj_DoorSlide
|
||||
case 481: // Polyobj_DoorSwing
|
||||
PolyDoor(line);
|
||||
|
@ -6240,11 +6246,11 @@ static void P_RunLevelLoadExecutors(void)
|
|||
void P_InitSpecials(void)
|
||||
{
|
||||
// Set the default gravity. Custom gravity overrides this setting.
|
||||
gravity = FRACUNIT/2;
|
||||
gravity = mapheaderinfo[gamemap-1]->gravity;
|
||||
|
||||
// Defaults in case levels don't have them set.
|
||||
sstimer = 90*TICRATE + 6;
|
||||
ssspheres = 1;
|
||||
sstimer = mapheaderinfo[gamemap-1]->sstimer*TICRATE + 6;
|
||||
ssspheres = mapheaderinfo[gamemap-1]->ssspheres;
|
||||
|
||||
CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false;
|
||||
|
||||
|
@ -7459,7 +7465,7 @@ void P_SpawnSpecials(boolean fromnetsave)
|
|||
switch (lines[i].special)
|
||||
{
|
||||
case 30: // Polyobj_Flag
|
||||
EV_DoPolyObjFlag(&lines[i]);
|
||||
PolyFlag(&lines[i]);
|
||||
break;
|
||||
|
||||
case 31: // Polyobj_Displace
|
||||
|
@ -7881,7 +7887,7 @@ static void P_SpawnScrollers(void)
|
|||
// scroll wall according to linedef
|
||||
// (same direction and speed as scrolling floors)
|
||||
case 502:
|
||||
for (s = -1; (s = P_FindSectorFromTag(l->tag, s)) >= 0 ;)
|
||||
for (s = -1; (s = P_FindLineFromTag(l->tag, s)) >= 0 ;)
|
||||
if (s != (INT32)i)
|
||||
Add_Scroller(sc_side, dx, dy, control, lines[s].sidenum[0], accel, 0);
|
||||
break;
|
||||
|
|
41
src/p_user.c
41
src/p_user.c
|
@ -1490,17 +1490,10 @@ void P_PlayLivesJingle(player_t *player)
|
|||
if (player && !P_IsLocalPlayer(player))
|
||||
return;
|
||||
|
||||
if (use1upSound)
|
||||
if (use1upSound || cv_1upsound.value)
|
||||
S_StartSound(NULL, sfx_oneup);
|
||||
else if (mariomode)
|
||||
S_StartSound(NULL, sfx_marioa);
|
||||
else if (cv_1upsound.value)
|
||||
{
|
||||
if (S_sfx[sfx_oneup].lumpnum != LUMPERROR)
|
||||
S_StartSound(NULL, sfx_oneup);
|
||||
else
|
||||
S_StartSound(NULL, sfx_chchng);/* at least play something! */
|
||||
}
|
||||
else
|
||||
{
|
||||
P_PlayJingle(player, JT_1UP);
|
||||
|
@ -1548,10 +1541,6 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname)
|
|||
int i;
|
||||
boolean result = false;
|
||||
|
||||
#ifndef HAVE_BLUA
|
||||
(void)musname;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!P_IsLocalPlayer(&players[i]))
|
||||
|
@ -4454,13 +4443,16 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
else if (player->powers[pw_carry] == CR_ROLLOUT)
|
||||
{
|
||||
player->mo->momz = 9*FRACUNIT;
|
||||
if (player->mo->tracer)
|
||||
{
|
||||
if (P_MobjFlip(player->mo->tracer)*player->mo->tracer->momz > 0)
|
||||
player->mo->momz += player->mo->tracer->momz;
|
||||
if (!P_IsObjectOnGround(player->mo->tracer))
|
||||
P_SetObjectMomZ(player->mo->tracer, -9*FRACUNIT, true);
|
||||
player->powers[pw_carry] = CR_NONE;
|
||||
player->mo->tracer->flags |= MF_PUSHABLE;
|
||||
P_SetTarget(&player->mo->tracer->tracer, NULL);
|
||||
}
|
||||
player->powers[pw_carry] = CR_NONE;
|
||||
P_SetTarget(&player->mo->tracer, NULL);
|
||||
}
|
||||
else if (player->mo->eflags & MFE_GOOWATER)
|
||||
|
@ -5018,6 +5010,15 @@ void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range)
|
|||
player->pflags |= PF_THOKKED;
|
||||
}
|
||||
|
||||
static void P_DoTwinSpin(player_t *player)
|
||||
{
|
||||
player->pflags &= ~PF_NOJUMPDAMAGE;
|
||||
player->pflags |= P_GetJumpFlags(player) | PF_THOKKED;
|
||||
S_StartSound(player->mo, sfx_s3k42);
|
||||
player->mo->frame = 0;
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
|
||||
}
|
||||
|
||||
//
|
||||
// P_DoJumpStuff
|
||||
//
|
||||
|
@ -5188,12 +5189,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
break;
|
||||
case CA_TWINSPIN:
|
||||
if ((player->charability2 == CA2_MELEE) && (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || player->charflags & SF_MULTIABILITY))
|
||||
{
|
||||
player->pflags |= PF_THOKKED;
|
||||
S_StartSound(player->mo, sfx_s3k42);
|
||||
player->mo->frame = 0;
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
|
||||
}
|
||||
P_DoTwinSpin(player);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -5450,12 +5446,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
break;
|
||||
case CA_TWINSPIN:
|
||||
if (!(player->pflags & PF_THOKKED) || player->charflags & SF_MULTIABILITY)
|
||||
{
|
||||
player->pflags |= PF_THOKKED;
|
||||
S_StartSound(player->mo, sfx_s3k42);
|
||||
player->mo->frame = 0;
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
|
||||
}
|
||||
P_DoTwinSpin(player);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -1231,9 +1231,9 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
|
|||
if (!R_CheckIfPatch(lump))
|
||||
return;
|
||||
|
||||
width = patch->width;
|
||||
height = patch->height;
|
||||
leftoffset = patch->leftoffset;
|
||||
width = SHORT(patch->width);
|
||||
height = SHORT(patch->height);
|
||||
leftoffset = SHORT(patch->leftoffset);
|
||||
|
||||
// rotation pivot
|
||||
px = SPRITE_XCENTER;
|
||||
|
@ -1348,7 +1348,7 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
|
|||
newpatch = R_MaskedFlatToPatch(rawdst, newwidth, newheight, 0, 0, &size);
|
||||
{
|
||||
newpatch->leftoffset = (newpatch->width / 2) + (leftoffset - px);
|
||||
newpatch->topoffset = (newpatch->height / 2) + (patch->topoffset - py);
|
||||
newpatch->topoffset = (newpatch->height / 2) + (SHORT(patch->topoffset) - py);
|
||||
}
|
||||
|
||||
//BP: we cannot use special tric in hardware mode because feet in ground caused by z-buffer
|
||||
|
@ -1358,6 +1358,12 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
|
|||
// P_PrecacheLevel
|
||||
if (devparm) spritememory += size;
|
||||
|
||||
// convert everything to little-endian, for big-endian support
|
||||
newpatch->width = SHORT(newpatch->width);
|
||||
newpatch->height = SHORT(newpatch->height);
|
||||
newpatch->leftoffset = SHORT(newpatch->leftoffset);
|
||||
newpatch->topoffset = SHORT(newpatch->topoffset);
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
|
|
|
@ -888,7 +888,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
|||
vis->x2 = vid.width-1;
|
||||
|
||||
localcolfunc = (vis->cut & SC_VFLIP) ? R_DrawFlippedMaskedColumn : R_DrawMaskedColumn;
|
||||
lengthcol = patch->height;
|
||||
lengthcol = SHORT(patch->height);
|
||||
|
||||
// Split drawing loops for paper and non-paper to reduce conditional checks per sprite
|
||||
if (vis->scalestep)
|
||||
|
@ -1230,8 +1230,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
|||
yscale = FixedDiv(projectiony, tz);
|
||||
shadowxscale = FixedMul(thing->radius*2, scalemul);
|
||||
shadowyscale = FixedMul(FixedMul(thing->radius*2, scalemul), FixedDiv(abs(floorz - viewz), tz));
|
||||
shadowyscale = min(shadowyscale, shadowxscale) / patch->height;
|
||||
shadowxscale /= patch->width;
|
||||
shadowyscale = min(shadowyscale, shadowxscale) / SHORT(patch->height);
|
||||
shadowxscale /= SHORT(patch->width);
|
||||
shadowskew = 0;
|
||||
|
||||
if (floorslope)
|
||||
|
@ -1246,24 +1246,24 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
|||
//CONS_Printf("Shadow is sloped by %d %d\n", xslope, zslope);
|
||||
|
||||
if (viewz < floorz)
|
||||
shadowyscale += FixedMul(FixedMul(thing->radius*2 / patch->height, scalemul), zslope);
|
||||
shadowyscale += FixedMul(FixedMul(thing->radius*2 / SHORT(patch->height), scalemul), zslope);
|
||||
else
|
||||
shadowyscale -= FixedMul(FixedMul(thing->radius*2 / patch->height, scalemul), zslope);
|
||||
shadowyscale -= FixedMul(FixedMul(thing->radius*2 / SHORT(patch->height), scalemul), zslope);
|
||||
|
||||
shadowyscale = abs(shadowyscale);
|
||||
|
||||
shadowskew = xslope;
|
||||
}
|
||||
|
||||
tx -= patch->width * shadowxscale/2;
|
||||
tx -= SHORT(patch->width) * shadowxscale/2;
|
||||
x1 = (centerxfrac + FixedMul(tx,xscale))>>FRACBITS;
|
||||
if (x1 >= viewwidth) return;
|
||||
|
||||
tx += patch->width * shadowxscale;
|
||||
tx += SHORT(patch->width) * shadowxscale;
|
||||
x2 = ((centerxfrac + FixedMul(tx,xscale))>>FRACBITS); x2--;
|
||||
if (x2 < 0 || x2 <= x1) return;
|
||||
|
||||
if (shadowyscale < FRACUNIT/patch->height) return; // fix some crashes?
|
||||
if (shadowyscale < FRACUNIT/SHORT(patch->height)) return; // fix some crashes?
|
||||
|
||||
shadow = R_NewVisSprite();
|
||||
shadow->patch = patch;
|
||||
|
@ -1278,8 +1278,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
|||
shadow->dispoffset = vis->dispoffset - 5;
|
||||
shadow->gx = thing->x;
|
||||
shadow->gy = thing->y;
|
||||
shadow->gzt = shadow->pz + shadow->patch->height * shadowyscale / 2;
|
||||
shadow->gz = shadow->gzt - shadow->patch->height * shadowyscale;
|
||||
shadow->gzt = shadow->pz + SHORT(patch->height) * shadowyscale / 2;
|
||||
shadow->gz = shadow->gzt - SHORT(patch->height) * shadowyscale;
|
||||
shadow->texturemid = FixedMul(thing->scale, FixedDiv(shadow->gzt - viewz, shadowyscale));
|
||||
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
||||
shadow->texturemid = FixedMul(shadow->texturemid, ((skin_t *)thing->skin)->highresscale);
|
||||
|
@ -1300,7 +1300,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
|||
|
||||
shadow->startfrac = 0;
|
||||
//shadow->xiscale = 0x7ffffff0 / (shadow->xscale/2);
|
||||
shadow->xiscale = (patch->width<<FRACBITS)/(x2-x1+1); // fuck it
|
||||
shadow->xiscale = (SHORT(patch->width)<<FRACBITS)/(x2-x1+1); // fuck it
|
||||
|
||||
if (shadow->x1 > x1)
|
||||
shadow->startfrac += shadow->xiscale*(shadow->x1-x1);
|
||||
|
@ -1527,10 +1527,10 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
rotsprite = sprframe->rotsprite.patch[rot][rollangle];
|
||||
if (rotsprite != NULL)
|
||||
{
|
||||
spr_width = rotsprite->width << FRACBITS;
|
||||
spr_height = rotsprite->height << FRACBITS;
|
||||
spr_offset = rotsprite->leftoffset << FRACBITS;
|
||||
spr_topoffset = rotsprite->topoffset << FRACBITS;
|
||||
spr_width = SHORT(rotsprite->width) << FRACBITS;
|
||||
spr_height = SHORT(rotsprite->height) << FRACBITS;
|
||||
spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS;
|
||||
spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS;
|
||||
// flip -> rotate, not rotate -> flip
|
||||
flip = 0;
|
||||
}
|
||||
|
|
|
@ -134,6 +134,7 @@ consvar_t cv_playmusicifunfocused = {"playmusicifunfocused", "No", CV_SAVE, CV_Y
|
|||
consvar_t cv_playsoundsifunfocused = {"playsoundsifunfocused", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifdef HAVE_OPENMPT
|
||||
openmpt_module *openmpt_mhandle = NULL;
|
||||
static CV_PossibleValue_t interpolationfilter_cons_t[] = {{0, "Default"}, {1, "None"}, {2, "Linear"}, {4, "Cubic"}, {8, "Windowed sinc"}, {0, NULL}};
|
||||
consvar_t cv_modfilter = {"modfilter", "0", CV_SAVE|CV_CALL, interpolationfilter_cons_t, ModFilter_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
@ -1675,7 +1676,7 @@ void S_LoadMusicDefs(UINT16 wadnum)
|
|||
char *lf;
|
||||
char *stoken;
|
||||
|
||||
size_t nlf;
|
||||
size_t nlf = 0xFFFFFFFF;
|
||||
size_t ncr;
|
||||
|
||||
musicdef_t *def = NULL;
|
||||
|
@ -1910,6 +1911,10 @@ UINT32 S_GetMusicPosition(void)
|
|||
/// In this section: mazmazz doesn't know how to do dynamic arrays or struct pointers!
|
||||
/// ------------------------
|
||||
|
||||
char music_stack_nextmusname[7];
|
||||
boolean music_stack_noposition = false;
|
||||
UINT32 music_stack_fadeout = 0;
|
||||
UINT32 music_stack_fadein = 0;
|
||||
static musicstack_t *music_stacks = NULL;
|
||||
static musicstack_t *last_music_stack = NULL;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#ifdef HAVE_OPENMPT
|
||||
#include "libopenmpt/libopenmpt.h"
|
||||
openmpt_module *openmpt_mhandle;
|
||||
extern openmpt_module *openmpt_mhandle;
|
||||
#endif
|
||||
|
||||
// mask used to indicate sound origin is player item pickup
|
||||
|
@ -262,10 +262,10 @@ typedef struct musicstack_s
|
|||
struct musicstack_s *next;
|
||||
} musicstack_t;
|
||||
|
||||
char music_stack_nextmusname[7];
|
||||
boolean music_stack_noposition;
|
||||
UINT32 music_stack_fadeout;
|
||||
UINT32 music_stack_fadein;
|
||||
extern char music_stack_nextmusname[7];
|
||||
extern boolean music_stack_noposition;
|
||||
extern UINT32 music_stack_fadeout;
|
||||
extern UINT32 music_stack_fadein;
|
||||
|
||||
void S_SetStackAdjustmentStart(void);
|
||||
void S_AdjustMusicStackTics(void);
|
||||
|
@ -333,7 +333,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum);
|
|||
#ifdef MUSICSLOT_COMPATIBILITY
|
||||
// For compatibility with code/scripts relying on older versions
|
||||
// This is a list of all the "special" slot names and their associated numbers
|
||||
const char *compat_special_music_slots[16];
|
||||
extern const char *compat_special_music_slots[16];
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -526,6 +526,9 @@ void SCR_DisplayTicRate(void)
|
|||
INT32 ticcntcolor = 0;
|
||||
const INT32 h = vid.height-(8*vid.dupy);
|
||||
|
||||
if (gamestate == GS_NULL)
|
||||
return;
|
||||
|
||||
for (i = lasttic + 1; i < TICRATE+lasttic && i < ontic; ++i)
|
||||
fpsgraph[i % TICRATE] = false;
|
||||
|
||||
|
@ -538,10 +541,16 @@ void SCR_DisplayTicRate(void)
|
|||
if (totaltics <= TICRATE/2) ticcntcolor = V_REDMAP;
|
||||
else if (totaltics == TICRATE) ticcntcolor = V_GREENMAP;
|
||||
|
||||
if (cv_ticrate.value == 2) // compact counter
|
||||
V_DrawString(vid.width-(16*vid.dupx), h,
|
||||
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%02d", totaltics));
|
||||
else if (cv_ticrate.value == 1) // full counter
|
||||
{
|
||||
V_DrawString(vid.width-(72*vid.dupx), h,
|
||||
V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:");
|
||||
V_DrawString(vid.width-(40*vid.dupx), h,
|
||||
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%02d/%02u", totaltics, TICRATE));
|
||||
}
|
||||
|
||||
lasttic = ontic;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __unix__
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
|
@ -142,7 +142,7 @@ int main(int argc, char **argv)
|
|||
const char *reldir;
|
||||
int left;
|
||||
boolean fileabs;
|
||||
#ifdef __unix__
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
const char *link;
|
||||
#endif
|
||||
|
||||
|
@ -201,7 +201,7 @@ int main(int argc, char **argv)
|
|||
M_PathParts(logdir) - 1,
|
||||
M_PathParts(logfilename) - 1, 0755);
|
||||
|
||||
#ifdef __unix__
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
logstream = fopen(logfilename, "w");
|
||||
#ifdef DEFAULTDIR
|
||||
if (logdir)
|
||||
|
@ -214,9 +214,9 @@ int main(int argc, char **argv)
|
|||
{
|
||||
I_OutputMsg("Error symlinking latest-log.txt: %s\n", strerror(errno));
|
||||
}
|
||||
#else/*__unix__*/
|
||||
#else/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
||||
logstream = fopen("latest-log.txt", "wt+");
|
||||
#endif/*__unix__*/
|
||||
#endif/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
||||
}
|
||||
|
||||
//I_OutputMsg("I_StartupSystem() ...\n");
|
||||
|
|
|
@ -2484,7 +2484,7 @@ void I_RemoveExitFunc(void (*func)())
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef __unix__
|
||||
#if !(defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON))
|
||||
static void Shittycopyerror(const char *name)
|
||||
{
|
||||
I_OutputMsg(
|
||||
|
@ -2524,7 +2524,7 @@ static void Shittylogcopy(void)
|
|||
Shittycopyerror(logfilename);
|
||||
}
|
||||
}
|
||||
#endif/*__unix__*/
|
||||
#endif/*!(defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON))*/
|
||||
|
||||
//
|
||||
// Closes down everything. This includes restoring the initial
|
||||
|
@ -2548,7 +2548,7 @@ void I_ShutdownSystem(void)
|
|||
if (logstream)
|
||||
{
|
||||
I_OutputMsg("I_ShutdownSystem(): end of logstream.\n");
|
||||
#ifndef __unix__
|
||||
#if !(defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON))
|
||||
Shittylogcopy();
|
||||
#endif
|
||||
fclose(logstream);
|
||||
|
|
|
@ -1219,7 +1219,7 @@
|
|||
C01FCF4B08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CURRENT_PROJECT_VERSION = 2.2.2;
|
||||
CURRENT_PROJECT_VERSION = 2.2.4;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
NORMALSRB2,
|
||||
|
@ -1231,7 +1231,7 @@
|
|||
C01FCF4C08A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CURRENT_PROJECT_VERSION = 2.2.2;
|
||||
CURRENT_PROJECT_VERSION = 2.2.4;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
|
|
|
@ -527,7 +527,7 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
{"s3k8a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Boing"},
|
||||
{"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powerful hit"},
|
||||
{"s3k8c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Humming power"},
|
||||
{"s3k8d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"s3k8d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "/"},
|
||||
{"s3k8e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Accelerating"},
|
||||
{"s3k8f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Opening"},
|
||||
{"s3k90", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Impact"},
|
||||
|
|
|
@ -1333,10 +1333,9 @@ void ST_drawTitleCard(void)
|
|||
patch_t *actpat, *zigzag, *zztext;
|
||||
UINT8 colornum;
|
||||
const UINT8 *colormap;
|
||||
stplyr = &players[consoleplayer];
|
||||
|
||||
if (stplyr->skincolor)
|
||||
colornum = stplyr->skincolor;
|
||||
if (players[consoleplayer].skincolor)
|
||||
colornum = players[consoleplayer].skincolor;
|
||||
else
|
||||
colornum = cv_playercolor.value;
|
||||
|
||||
|
|
|
@ -42,7 +42,8 @@ UINT8 *screens[5];
|
|||
// screens[3] = fade screen start
|
||||
// screens[4] = fade screen end, postimage tempoarary buffer
|
||||
|
||||
consvar_t cv_ticrate = {"showfps", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t ticrate_cons_t[] = {{0, "No"}, {1, "Full"}, {2, "Compact"}, {0, NULL}};
|
||||
consvar_t cv_ticrate = {"showfps", "No", CV_SAVE, ticrate_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static void CV_palette_OnChange(void);
|
||||
|
||||
|
|
|
@ -76,6 +76,10 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
|
|||
//int vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include "console.h"
|
||||
#endif
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
|
|
@ -3199,7 +3199,7 @@ INT32 I_GetKey(void)
|
|||
// -----------------
|
||||
#define DI_KEYBOARD_BUFFERSIZE 32 // number of data elements in keyboard buffer
|
||||
|
||||
void I_StartupKeyboard(void)
|
||||
static void I_StartupKeyboard(void)
|
||||
{
|
||||
DIPROPDWORD dip;
|
||||
|
||||
|
@ -3435,6 +3435,8 @@ INT32 I_StartupSystem(void)
|
|||
// some 'more global than globals' things to initialize here ?
|
||||
graphics_started = keyboard_started = sound_started = cdaudio_started = false;
|
||||
|
||||
I_StartupKeyboard();
|
||||
|
||||
#ifdef NDEBUG
|
||||
|
||||
#ifdef BUGTRAP
|
||||
|
|
|
@ -56,6 +56,7 @@ static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff,
|
|||
static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
boolean highcolor;
|
||||
int vid_opengl_state = 0;
|
||||
|
||||
static BOOL bDIBMode; // means we are using DIB instead of DirectDraw surfaces
|
||||
static LPBITMAPINFO bmiMain = NULL;
|
||||
|
@ -949,7 +950,10 @@ INT32 VID_SetMode(INT32 modenum)
|
|||
}
|
||||
|
||||
void VID_CheckRenderer(void) {}
|
||||
void VID_CheckGLLoaded(rendermode_t oldrender) {}
|
||||
void VID_CheckGLLoaded(rendermode_t oldrender)
|
||||
{
|
||||
(void)oldrender;
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// Free the video buffer of the last video mode,
|
||||
|
|
Loading…
Reference in a new issue