Merge remote-tracking branch 'Lonsfor/pr-resume' into Galaxy-Redux
This commit is contained in:
commit
abfeffc7d6
30 files changed
+502
-89
No files matched your search
+38
-4
@@ -147,6 +147,8 @@ static void Command_RunSOC(void);
|
||||
static void Command_Pause(void);
|
||||
static void Command_Respawn(void);
|
||||
|
||||
static void Command_ReplayMarker(void);
|
||||
|
||||
static void Command_Version_f(void);
|
||||
#ifdef UPDATE_ALERT
|
||||
static void Command_ModDetails_f(void);
|
||||
@@ -378,7 +380,7 @@ static CV_PossibleValue_t kartvoterulechanges_cons_t[] = {{0, "Never"}, {1, "Som
|
||||
consvar_t cv_kartvoterulechanges = {"kartvoterulechanges", "Frequent", CV_NETVAR, kartvoterulechanges_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t kartgametypepreference_cons_t[] = {{-1, "None"}, {GT_RACE, "Race"}, {GT_MATCH, "Battle"}, {0, NULL}};
|
||||
consvar_t cv_kartgametypepreference = {"kartgametypepreference", "None", CV_NETVAR, kartgametypepreference_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}};
|
||||
static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {4, "Percent"}, {0, NULL}};
|
||||
consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display
|
||||
static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}};
|
||||
consvar_t cv_kartvoices = {"kartvoices", "Tasteful", CV_SAVE, kartvoices_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -478,6 +480,8 @@ consvar_t cv_mute = {"mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange,
|
||||
|
||||
consvar_t cv_sleep = {"cpusleep", "1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_showtrackaddon = {"showtrackaddon", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
INT16 gametype = GT_RACE; // SRB2kart
|
||||
boolean forceresetplayers = false;
|
||||
boolean deferencoremode = false;
|
||||
@@ -624,6 +628,8 @@ void D_RegisterServerCommands(void)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
COM_AddCommand("replaymarker", Command_ReplayMarker);
|
||||
|
||||
// for master server connection
|
||||
AddMServCommands();
|
||||
|
||||
@@ -722,6 +728,8 @@ void D_RegisterServerCommands(void)
|
||||
CV_RegisterVar(&cv_showping);
|
||||
CV_RegisterVar(&cv_pingmeasurement);
|
||||
|
||||
CV_RegisterVar(&cv_showtrackaddon);
|
||||
|
||||
#ifdef SEENAMES
|
||||
CV_RegisterVar(&cv_allowseenames);
|
||||
#endif
|
||||
@@ -734,6 +742,9 @@ void D_RegisterServerCommands(void)
|
||||
|
||||
CV_RegisterVar(&cv_discordinvites);
|
||||
RegisterNetXCmd(XD_DISCORD, Got_DiscordInfo);
|
||||
|
||||
CV_RegisterVar(&cv_recordmultiplayerdemos);
|
||||
CV_RegisterVar(&cv_netdemosyncquality);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
@@ -856,9 +867,6 @@ void D_RegisterClientCommands(void)
|
||||
|
||||
COM_AddCommand("displayplayer", Command_Displayplayer_f);
|
||||
|
||||
CV_RegisterVar(&cv_recordmultiplayerdemos);
|
||||
CV_RegisterVar(&cv_netdemosyncquality);
|
||||
|
||||
// FIXME: not to be here.. but needs be done for config loading
|
||||
CV_RegisterVar(&cv_usegamma);
|
||||
|
||||
@@ -940,6 +948,7 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_mouse2opt);
|
||||
#endif
|
||||
CV_RegisterVar(&cv_controlperkey);
|
||||
CV_RegisterVar(&cv_turnsmooth);
|
||||
|
||||
CV_RegisterVar(&cv_usemouse);
|
||||
CV_RegisterVar(&cv_usemouse2);
|
||||
@@ -2338,6 +2347,8 @@ static void Command_StopMovie_f(void)
|
||||
|
||||
INT32 mapchangepending = 0;
|
||||
|
||||
tic_t driftsparkGrowTimer[MAXPLAYERS];
|
||||
|
||||
/** Runs a map change.
|
||||
* The supplied data are assumed to be good. If provided by a user, they will
|
||||
* have already been checked in Command_Map_f().
|
||||
@@ -2371,6 +2382,9 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean r
|
||||
CONS_Debug(DBG_GAMELOGIC, "Map change: mapnum=%d gametype=%d encoremode=%d resetplayers=%d delay=%d skipprecutscene=%d\n",
|
||||
mapnum, newgametype, pencoremode, resetplayers, delay, skipprecutscene);
|
||||
|
||||
// just gonna hack in a timer reset here...
|
||||
memset(driftsparkGrowTimer, 0, sizeof(driftsparkGrowTimer));
|
||||
|
||||
if (netgame || multiplayer)
|
||||
FLS = false;
|
||||
|
||||
@@ -2941,6 +2955,26 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
|
||||
}
|
||||
}
|
||||
|
||||
static void Command_ReplayMarker(void)
|
||||
{
|
||||
if (gamestate != GS_LEVEL)
|
||||
{
|
||||
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
|
||||
return;
|
||||
}
|
||||
if (demo.savemode == DSM_WILLAUTOSAVE) {
|
||||
demo.savemode = DSM_NOTSAVING;
|
||||
CONS_Printf("Replay unmarked.\n");
|
||||
} else {
|
||||
int adjustedleveltime = leveltime - starttime;
|
||||
demo.savemode = DSM_WILLAUTOSAVE;
|
||||
if (adjustedleveltime < 0)
|
||||
adjustedleveltime = 0;
|
||||
snprintf(demo.titlename, 64, "%s [%i:%02d/%.5s]", G_BuildMapTitle(gamemap), G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
||||
CONS_Printf("Replay will be saved!\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Command for stuck characters in netgames, griefing, etc.
|
||||
static void Command_Respawn(void)
|
||||
{
|
||||
|
||||
@@ -154,6 +154,8 @@ extern consvar_t cv_skipmapcheck;
|
||||
|
||||
extern consvar_t cv_sleep;
|
||||
|
||||
extern consvar_t cv_showtrackaddon;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
XD_NAMEANDCOLOR = 1,
|
||||
@@ -231,6 +233,8 @@ typedef union {
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
extern tic_t driftsparkGrowTimer[16];
|
||||
|
||||
// add game commands, needs cleanup
|
||||
void D_RegisterServerCommands(void);
|
||||
void D_RegisterClientCommands(void);
|
||||
|
||||
+5
-2
@@ -883,7 +883,7 @@ static const struct {
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
static void readlevelheader(MYFILE *f, INT32 num)
|
||||
static void readlevelheader(MYFILE *f, INT32 num, INT32 wadnum)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
char *word;
|
||||
@@ -896,6 +896,9 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||
// This call automatically saves all previous information when DELFILE is defined.
|
||||
// We don't need to do it ourselves.
|
||||
P_AllocMapHeader((INT16)(num-1));
|
||||
|
||||
if (!strstr(wadfiles[wadnum]->filename, ".soc"))
|
||||
mapwads[num-1] = wadnum;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -3289,7 +3292,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
||||
{
|
||||
if (mapheaderinfo[i-1])
|
||||
G_SetGameModified(multiplayer, true); // only mark as a major mod if it replaces an already-existing mapheaderinfo
|
||||
readlevelheader(f, i);
|
||||
readlevelheader(f, i, wad);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@ extern INT16 gamemap;
|
||||
extern char mapmusname[7];
|
||||
extern UINT16 mapmusflags;
|
||||
extern UINT32 mapmusposition;
|
||||
extern UINT32 mapmusresume;
|
||||
#define MUSIC_TRACKMASK 0x0FFF // ----************
|
||||
#define MUSIC_RELOADRESET 0x8000 // *---------------
|
||||
#define MUSIC_FORCERESET 0x4000 // -*--------------
|
||||
|
||||
+16
-1
@@ -87,6 +87,7 @@ static void G_DoStartVote(void);
|
||||
char mapmusname[7]; // Music name
|
||||
UINT16 mapmusflags; // Track and reset bit
|
||||
UINT32 mapmusposition; // Position to jump to
|
||||
UINT32 mapmusresume;
|
||||
|
||||
INT16 gamemap = 1;
|
||||
INT16 maptol;
|
||||
@@ -530,6 +531,19 @@ consvar_t cv_lookbackaxis4 = {"joyaxis4_lookback", "None", CV_SAVE, joyaxis_cons
|
||||
consvar_t cv_xdeadzone4 = {"joy4_xdeadzone", "0.3", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_ydeadzone4 = {"joy4_ydeadzone", "0.5", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t driftsparkpulse_t[] = {{0, "MIN"}, {FRACUNIT*3, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_driftsparkpulse = {"driftsparkpulse", "1.4", CV_FLOAT | CV_SAVE, driftsparkpulse_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_invincmusicfade = {"invincmusicfade", "300", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_growmusicfade = {"growmusicfade", "500", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_respawnfademusicout = {"respawnfademusicout", "1000", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_respawnfademusicback = {"respawnfademusicback", "500", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_resetspecialmusic = {"resetspecialmusic", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_resume = {"resume", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fading = {"fading", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_respawnfademusicout = {"respawnfademusicout", "1000", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_respawnfademusicback = {"respawnfademusicback", "500", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -1449,7 +1463,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||
th = 0;
|
||||
|
||||
if (th < SLOWTURNTICS)
|
||||
tspeed = 2; // slow turn
|
||||
tspeed = cv_turnsmooth.value == 2 ? 2 : 0; // slow turn
|
||||
else
|
||||
tspeed = speed;
|
||||
|
||||
@@ -2871,6 +2885,7 @@ void G_PlayerReborn(INT32 player)
|
||||
mapmusname[6] = 0;
|
||||
mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK);
|
||||
mapmusposition = mapheaderinfo[gamemap-1]->muspos;
|
||||
mapmusresume = 0;
|
||||
songcredit = true;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -124,6 +124,8 @@ extern consvar_t cv_turnaxis3,cv_moveaxis3,cv_brakeaxis3,cv_aimaxis3,cv_lookaxis
|
||||
extern consvar_t cv_turnaxis4,cv_moveaxis4,cv_brakeaxis4,cv_aimaxis4,cv_lookaxis4,cv_fireaxis4,cv_driftaxis4,cv_lookbackaxis4,cv_xdeadzone4,cv_ydeadzone4;
|
||||
extern consvar_t cv_ghost_besttime, cv_ghost_bestlap, cv_ghost_last, cv_ghost_guest, cv_ghost_staff;
|
||||
|
||||
extern consvar_t cv_driftsparkpulse;
|
||||
|
||||
extern consvar_t cv_invincmusicfade;
|
||||
extern consvar_t cv_growmusicfade;
|
||||
|
||||
@@ -152,7 +154,7 @@ typedef enum
|
||||
// mouseaiming (looking up/down with the mouse or keyboard)
|
||||
#define KB_LOOKSPEED (1<<25)
|
||||
#define MAXPLMOVE (50)
|
||||
#define SLOWTURNTICS (6)
|
||||
#define SLOWTURNTICS (cv_turnsmooth.value * 3)
|
||||
|
||||
// build an internal map name MAPxx from map number
|
||||
const char *G_BuildMapName(INT32 map);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
static CV_PossibleValue_t mousesens_cons_t[] = {{1, "MIN"}, {MAXMOUSESENSITIVITY, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t onecontrolperkey_cons_t[] = {{1, "One"}, {2, "Several"}, {0, NULL}};
|
||||
static CV_PossibleValue_t turnsmooth_cons_t[] = {{2, "Slow"}, {1, "Fast"}, {0, "Off"}, {0, NULL}};
|
||||
|
||||
// mouse values are used once
|
||||
consvar_t cv_mousesens = {"mousesens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -30,6 +31,7 @@ consvar_t cv_mousesens2 = {"mousesens2", "20", CV_SAVE, mousesens_cons_t, NULL,
|
||||
consvar_t cv_mouseysens = {"mouseysens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_mouseysens2 = {"mouseysens2", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_controlperkey = {"controlperkey", "One", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_turnsmooth = {"turnsmoothing", "Slow", CV_SAVE, turnsmooth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
INT32 mousex, mousey;
|
||||
INT32 mlooky; // like mousey but with a custom sensitivity for mlook
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ typedef enum
|
||||
// mouse values are used once
|
||||
extern consvar_t cv_mousesens, cv_mouseysens;
|
||||
extern consvar_t cv_mousesens2, cv_mouseysens2;
|
||||
extern consvar_t cv_controlperkey;
|
||||
extern consvar_t cv_controlperkey, cv_turnsmooth;
|
||||
|
||||
extern INT32 mousex, mousey;
|
||||
extern INT32 mlooky; //mousey with mlookSensitivity
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#define ZCLIP_PLANE 4.0f // Used for the actual game drawing
|
||||
#define NZCLIP_PLANE 0.9f // Seems to be only used for the HUD and screen textures
|
||||
#define FAR_ZCLIP_DEFAULT 32768.0f
|
||||
|
||||
// ==========================================================================
|
||||
// SIMPLE TYPES
|
||||
|
||||
@@ -39,7 +39,7 @@ EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
|
||||
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FRGBAFloat *ClearColor);
|
||||
EXPORT void HWRAPI(SetTexture) (FTextureInfo *TexInfo);
|
||||
EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height, INT32 dst_stride, UINT16 *dst_data);
|
||||
EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip);
|
||||
EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip, float farclip);
|
||||
EXPORT void HWRAPI(ClearMipMapCache) (void);
|
||||
|
||||
//Hurdler: added for backward compatibility
|
||||
|
||||
+111
-6
@@ -80,6 +80,19 @@ consvar_t cv_grsolvetjoin = {"gr_solvetjoin", "On", 0, CV_OnOff, NULL, 0, NULL,
|
||||
|
||||
consvar_t cv_grbatching = {"gr_batching", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t grrenderdistance_cons_t[] = {
|
||||
{0, "Max"}, {1, "1024"}, {2, "2048"}, {3, "4096"}, {4, "6144"}, {5, "8192"},
|
||||
{6, "12288"}, {7, "16384"}, {0, NULL}};
|
||||
consvar_t cv_grrenderdistance = {"gr_renderdistance", "Max", CV_SAVE, grrenderdistance_cons_t,
|
||||
NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
// values for the far clipping plane
|
||||
static float clipping_distances[] = {1024.0f, 2048.0f, 4096.0f, 6144.0f, 8192.0f, 12288.0f, 16384.0f};
|
||||
// values for bsp culling
|
||||
// slightly higher than the far clipping plane to compensate for impreciseness
|
||||
static INT32 bsp_culling_distances[] = {(1024+512)*FRACUNIT, (2048+512)*FRACUNIT, (4096+512)*FRACUNIT,
|
||||
(6144+512)*FRACUNIT, (8192+512)*FRACUNIT, (12288+512)*FRACUNIT, (16384+512)*FRACUNIT};
|
||||
static INT32 current_bsp_culling_distance = 0;
|
||||
|
||||
static void CV_filtermode_ONChange(void)
|
||||
{
|
||||
HWD.pfnSetSpecialState(HWD_SET_TEXTUREFILTERMODE, cv_grfiltermode.value);
|
||||
@@ -2097,6 +2110,70 @@ boolean HWR_CheckBBox(fixed_t *bspcoord)
|
||||
px2 = bspcoord[checkcoord[boxpos][2]];
|
||||
py2 = bspcoord[checkcoord[boxpos][3]];
|
||||
|
||||
if (current_bsp_culling_distance)
|
||||
{
|
||||
//fixed_t midx = (px1 >> 1) + (px2 >> 1);
|
||||
//fixed_t midy = (py1 >> 1) + (py2 >> 1);
|
||||
//fixed_t mindist = min(min(R_PointToDist(px1, py1), R_PointToDist(px2, py2)), R_PointToDist(midx, midy));
|
||||
|
||||
//fixed_t mindist = ClosestPointOnLineDistance(px1, py1, px2, py2);
|
||||
|
||||
//fixed_t mindist1 = ClosestPointOnLineDistance(bspcoord[BOXLEFT], bspcoord[BOXTOP], bspcoord[BOXRIGHT], bspcoord[BOXTOP]); // top line
|
||||
//fixed_t mindist2 = ClosestPointOnLineDistance(bspcoord[BOXLEFT], bspcoord[BOXTOP], bspcoord[BOXLEFT], bspcoord[BOXBOTTOM]); // left line
|
||||
//fixed_t mindist3 = ClosestPointOnLineDistance(bspcoord[BOXLEFT], bspcoord[BOXBOTTOM], bspcoord[BOXRIGHT], bspcoord[BOXBOTTOM]); // bottom line
|
||||
//fixed_t mindist4 = ClosestPointOnLineDistance(bspcoord[BOXRIGHT], bspcoord[BOXTOP], bspcoord[BOXRIGHT], bspcoord[BOXBOTTOM]); // right line
|
||||
// this one seems too lax.. maybe closestpointonlinedistance is glitchy and returns points that are not on the line segment?
|
||||
// could try building an if-else structure that determines what point or line is closest
|
||||
// 1 | 2 | 3
|
||||
//--------------
|
||||
// 4 |node| 5
|
||||
//--------------
|
||||
// 6 | 7 | 8
|
||||
// y
|
||||
// ^
|
||||
// |
|
||||
// -----> x
|
||||
// inside node: always inside draw distance. the above boxpos thing might have returned true already?
|
||||
// 1. check top left corner 2. check top line 3. check top right corner
|
||||
// 4. check left line 5. check right line
|
||||
// 6. check bottom left corner 7. check bottom line 8. check bottom right corner
|
||||
// one if statement will split the space in two for one coordinate
|
||||
// for example:
|
||||
// x < BOXLEFT || BOXLEFT || !(x < BOXLEFT) <-- (same as x >= BOXLEFT)
|
||||
fixed_t mindist;// = min(min(mindist1, mindist2), min(mindist3, mindist4));
|
||||
|
||||
// new thing
|
||||
// calculate distance to axis aligned bounding box.
|
||||
if (viewx < bspcoord[BOXLEFT]) // 1,4,6
|
||||
{
|
||||
if (viewy > bspcoord[BOXTOP]) // 1
|
||||
mindist = R_PointToDist(bspcoord[BOXLEFT], bspcoord[BOXTOP]);
|
||||
else if (viewy < bspcoord[BOXBOTTOM]) // 6
|
||||
mindist = R_PointToDist(bspcoord[BOXLEFT], bspcoord[BOXBOTTOM]);
|
||||
else // 4
|
||||
mindist = bspcoord[BOXLEFT] - viewx;
|
||||
}
|
||||
else if (viewx > bspcoord[BOXRIGHT]) // 3,5,8
|
||||
{
|
||||
if (viewy > bspcoord[BOXTOP]) // 3
|
||||
mindist = R_PointToDist(bspcoord[BOXRIGHT], bspcoord[BOXTOP]);
|
||||
else if (viewy < bspcoord[BOXBOTTOM]) // 8
|
||||
mindist = R_PointToDist(bspcoord[BOXRIGHT], bspcoord[BOXBOTTOM]);
|
||||
else // 5
|
||||
mindist = viewx - bspcoord[BOXRIGHT];
|
||||
}
|
||||
else // 2,node,7
|
||||
{
|
||||
if (viewy > bspcoord[BOXTOP]) // 2
|
||||
mindist = viewy - bspcoord[BOXTOP];
|
||||
else if (viewy < bspcoord[BOXBOTTOM]) // 7
|
||||
mindist = bspcoord[BOXBOTTOM] - viewy;
|
||||
else // node
|
||||
mindist = 0;
|
||||
}
|
||||
if (mindist > current_bsp_culling_distance) return false;
|
||||
}
|
||||
|
||||
angle1 = R_PointToAngleEx(viewx, viewy, px1, py1);
|
||||
angle2 = R_PointToAngleEx(viewx, viewy, px2, py2);
|
||||
return gld_clipper_SafeCheckRange(angle2, angle1);
|
||||
@@ -4044,7 +4121,7 @@ void HWR_AddSprites(sector_t *sec)
|
||||
{
|
||||
mobj_t *thing;
|
||||
precipmobj_t *precipthing;
|
||||
fixed_t approx_dist, limit_dist;
|
||||
fixed_t approx_dist, limit_dist, precip_limit_dist;
|
||||
|
||||
INT32 splitflags;
|
||||
boolean split_drawsprite; // drawing with splitscreen flags
|
||||
@@ -4059,9 +4136,24 @@ void HWR_AddSprites(sector_t *sec)
|
||||
// Well, now it will be done.
|
||||
sec->validcount = validcount;
|
||||
|
||||
if (current_bsp_culling_distance)
|
||||
{
|
||||
// Use the smaller setting
|
||||
if (cv_drawdist.value)
|
||||
limit_dist = min(current_bsp_culling_distance, cv_drawdist.value << FRACBITS);
|
||||
else
|
||||
limit_dist = current_bsp_culling_distance;
|
||||
precip_limit_dist = min(current_bsp_culling_distance, cv_drawdist_precip.value << FRACBITS);
|
||||
}
|
||||
else
|
||||
{
|
||||
limit_dist = cv_drawdist.value << FRACBITS;
|
||||
precip_limit_dist = cv_drawdist_precip.value << FRACBITS;
|
||||
}
|
||||
|
||||
// Handle all things in sector.
|
||||
// If a limit exists, handle things a tiny bit different.
|
||||
if ((limit_dist = (fixed_t)(/*(maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : */cv_drawdist.value) << FRACBITS))
|
||||
if (limit_dist)
|
||||
{
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
{
|
||||
@@ -4147,7 +4239,7 @@ void HWR_AddSprites(sector_t *sec)
|
||||
}
|
||||
|
||||
// No to infinite precipitation draw distance.
|
||||
if ((limit_dist = (fixed_t)cv_drawdist_precip.value << FRACBITS))
|
||||
if (precip_limit_dist)
|
||||
{
|
||||
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
|
||||
{
|
||||
@@ -4156,7 +4248,7 @@ void HWR_AddSprites(sector_t *sec)
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y);
|
||||
|
||||
if (approx_dist > limit_dist)
|
||||
if (approx_dist > precip_limit_dist)
|
||||
continue;
|
||||
|
||||
HWR_ProjectPrecipitationSprite(precipthing);
|
||||
@@ -4588,7 +4680,7 @@ static inline void HWR_ClearView(void)
|
||||
(INT32)gr_viewwindowy,
|
||||
(INT32)(gr_viewwindowx + gr_viewwidth),
|
||||
(INT32)(gr_viewwindowy + gr_viewheight),
|
||||
ZCLIP_PLANE);
|
||||
ZCLIP_PLANE, FAR_ZCLIP_DEFAULT);
|
||||
HWD.pfnClearBuffer(false, true, 0);
|
||||
}
|
||||
|
||||
@@ -4724,6 +4816,16 @@ void HWR_RenderFrame(INT32 viewnumber, player_t *player, boolean skybox)
|
||||
if (skybox)
|
||||
drewsky = true;
|
||||
|
||||
if (!skybox && cv_grrenderdistance.value)
|
||||
{
|
||||
HWD.pfnGClipRect((INT32)gr_viewwindowx,
|
||||
(INT32)gr_viewwindowy,
|
||||
(INT32)(gr_viewwindowx + gr_viewwidth),
|
||||
(INT32)(gr_viewwindowy + gr_viewheight),
|
||||
ZCLIP_PLANE, clipping_distances[cv_grrenderdistance.value - 1]);
|
||||
current_bsp_culling_distance = bsp_culling_distances[cv_grrenderdistance.value - 1];
|
||||
}
|
||||
|
||||
a1 = gld_FrustumAngle(gr_aimingangle);
|
||||
gld_clipper_Clear();
|
||||
gld_clipper_SafeAddClipRange(viewangle + a1, viewangle - a1);
|
||||
@@ -4747,6 +4849,8 @@ void HWR_RenderFrame(INT32 viewnumber, player_t *player, boolean skybox)
|
||||
// Recursively "render" the BSP tree.
|
||||
HWR_RenderBSPNode((INT32)numnodes-1);
|
||||
|
||||
current_bsp_culling_distance = 0;
|
||||
|
||||
if (cv_grbatching.value)
|
||||
{
|
||||
int dummy = 0;// the vars in RenderBatches are meant for render stats. But we don't have that stuff in this branch
|
||||
@@ -4778,7 +4882,7 @@ void HWR_RenderFrame(INT32 viewnumber, player_t *player, boolean skybox)
|
||||
|
||||
// added by Hurdler for correct splitscreen
|
||||
// moved here by hurdler so it works with the new near clipping plane
|
||||
HWD.pfnGClipRect(0, 0, vid.width, vid.height, NZCLIP_PLANE);
|
||||
HWD.pfnGClipRect(0, 0, vid.width, vid.height, NZCLIP_PLANE, FAR_ZCLIP_DEFAULT);
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
@@ -4838,6 +4942,7 @@ void HWR_AddCommands(void)
|
||||
CV_RegisterVar(&cv_grsolvetjoin);
|
||||
|
||||
CV_RegisterVar(&cv_grbatching);
|
||||
CV_RegisterVar(&cv_grrenderdistance);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
@@ -148,6 +148,7 @@ extern consvar_t cv_grsolvetjoin;
|
||||
extern consvar_t cv_grspritebillboarding;
|
||||
extern consvar_t cv_grfakecontrast;
|
||||
extern consvar_t cv_grfallbackplayermodel;
|
||||
extern consvar_t cv_grrenderdistance;
|
||||
|
||||
extern CV_PossibleValue_t granisotropicmode_cons_t[];
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ static const GLubyte white[4] = { 255, 255, 255, 255 };
|
||||
#define N_PI_DEMI (M_PIl/2.0f) //(1.5707963268f)
|
||||
|
||||
#define ASPECT_RATIO (1.0f) //(320.0f/200.0f)
|
||||
#define FAR_CLIPPING_PLANE 32768.0f // Draw further! Tails 01-21-2001
|
||||
//#define FAR_CLIPPING_PLANE 32768.0f // Draw further! Tails 01-21-2001
|
||||
//#define FAR_CLIPPING_PLANE (4096.0f - 512.0f)
|
||||
static float FAR_CLIPPING_PLANE = 32768.0f;
|
||||
static float NEAR_CLIPPING_PLANE = NZCLIP_PLANE;
|
||||
|
||||
// **************************************************************************
|
||||
@@ -1232,12 +1234,13 @@ EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height,
|
||||
// -----------------+
|
||||
// GClipRect : Defines the 2D hardware clipping window
|
||||
// -----------------+
|
||||
EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip)
|
||||
EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip, float farclip)
|
||||
{
|
||||
//GL_DBG_Printf("GClipRect(%d, %d, %d, %d)\n", minx, miny, maxx, maxy);
|
||||
|
||||
pglViewport(minx, screen_height-maxy, maxx-minx, maxy-miny);
|
||||
NEAR_CLIPPING_PLANE = nearclip;
|
||||
FAR_CLIPPING_PLANE = farclip;
|
||||
|
||||
//pglScissor(minx, screen_height-maxy, maxx-minx, maxy-miny);
|
||||
pglMatrixMode(GL_PROJECTION);
|
||||
@@ -3152,7 +3155,7 @@ EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2])
|
||||
INT32 x, y;
|
||||
float float_x, float_y, float_nextx, float_nexty;
|
||||
float xfix, yfix;
|
||||
INT32 texsize = 2048;
|
||||
INT32 texsize = 512;
|
||||
|
||||
const float blackBack[16] =
|
||||
{
|
||||
@@ -3162,11 +3165,9 @@ EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2])
|
||||
16.0f, -16.0f, 6.0f
|
||||
};
|
||||
|
||||
// Use a power of two texture
|
||||
if(screen_width <= 1024)
|
||||
texsize = 1024;
|
||||
if(screen_width <= 512)
|
||||
texsize = 512;
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsize < screen_width || texsize < screen_height)
|
||||
texsize <<= 1;
|
||||
|
||||
// X/Y stretch fix for all resolutions(!)
|
||||
xfix = (float)(texsize)/((float)((screen_width)/(float)(SCREENVERTS-1)));
|
||||
@@ -3250,14 +3251,12 @@ EXPORT void HWRAPI(FlushScreenTextures) (void)
|
||||
// Create Screen to fade from
|
||||
EXPORT void HWRAPI(StartScreenWipe) (void)
|
||||
{
|
||||
INT32 texsize = 2048;
|
||||
INT32 texsize = 512;
|
||||
boolean firstTime = (startScreenWipe == 0);
|
||||
|
||||
// Use a power of two texture, dammit
|
||||
if(screen_width <= 512)
|
||||
texsize = 512;
|
||||
else if(screen_width <= 1024)
|
||||
texsize = 1024;
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsize < screen_width || texsize < screen_height)
|
||||
texsize <<= 1;
|
||||
|
||||
// Create screen texture
|
||||
if (firstTime)
|
||||
@@ -3281,14 +3280,12 @@ EXPORT void HWRAPI(StartScreenWipe) (void)
|
||||
// Create Screen to fade to
|
||||
EXPORT void HWRAPI(EndScreenWipe)(void)
|
||||
{
|
||||
INT32 texsize = 2048;
|
||||
INT32 texsize = 512;
|
||||
boolean firstTime = (endScreenWipe == 0);
|
||||
|
||||
// Use a power of two texture, dammit
|
||||
if(screen_width <= 512)
|
||||
texsize = 512;
|
||||
else if(screen_width <= 1024)
|
||||
texsize = 1024;
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsize < screen_width || texsize < screen_height)
|
||||
texsize <<= 1;
|
||||
|
||||
// Create screen texture
|
||||
if (firstTime)
|
||||
@@ -3313,7 +3310,7 @@ EXPORT void HWRAPI(EndScreenWipe)(void)
|
||||
EXPORT void HWRAPI(DrawIntermissionBG)(void)
|
||||
{
|
||||
float xfix, yfix;
|
||||
INT32 texsize = 2048;
|
||||
INT32 texsize = 512;
|
||||
|
||||
const float screenVerts[12] =
|
||||
{
|
||||
@@ -3325,10 +3322,9 @@ EXPORT void HWRAPI(DrawIntermissionBG)(void)
|
||||
|
||||
float fix[8];
|
||||
|
||||
if(screen_width <= 1024)
|
||||
texsize = 1024;
|
||||
if(screen_width <= 512)
|
||||
texsize = 512;
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsize < screen_width || texsize < screen_height)
|
||||
texsize <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsize)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsize)/((float)((screen_height))));
|
||||
@@ -3355,7 +3351,7 @@ EXPORT void HWRAPI(DrawIntermissionBG)(void)
|
||||
// Do screen fades!
|
||||
EXPORT void HWRAPI(DoScreenWipe)(void)
|
||||
{
|
||||
INT32 texsize = 2048;
|
||||
INT32 texsize = 512;
|
||||
float xfix, yfix;
|
||||
|
||||
INT32 fademaskdownloaded = tex_downloaded; // the fade mask that has been set
|
||||
@@ -3378,11 +3374,9 @@ EXPORT void HWRAPI(DoScreenWipe)(void)
|
||||
1.0f, 1.0f
|
||||
};
|
||||
|
||||
// Use a power of two texture, dammit
|
||||
if(screen_width <= 1024)
|
||||
texsize = 1024;
|
||||
if(screen_width <= 512)
|
||||
texsize = 512;
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsize < screen_width || texsize < screen_height)
|
||||
texsize <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsize)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsize)/((float)((screen_height))));
|
||||
@@ -3441,14 +3435,12 @@ EXPORT void HWRAPI(DoScreenWipe)(void)
|
||||
// Create a texture from the screen.
|
||||
EXPORT void HWRAPI(MakeScreenTexture) (void)
|
||||
{
|
||||
INT32 texsize = 2048;
|
||||
INT32 texsize = 512;
|
||||
boolean firstTime = (screentexture == 0);
|
||||
|
||||
// Use a power of two texture, dammit
|
||||
if(screen_width <= 512)
|
||||
texsize = 512;
|
||||
else if(screen_width <= 1024)
|
||||
texsize = 1024;
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsize < screen_width || texsize < screen_height)
|
||||
texsize <<= 1;
|
||||
|
||||
// Create screen texture
|
||||
if (firstTime)
|
||||
@@ -3471,14 +3463,12 @@ EXPORT void HWRAPI(MakeScreenTexture) (void)
|
||||
|
||||
EXPORT void HWRAPI(MakeScreenFinalTexture) (void)
|
||||
{
|
||||
INT32 texsize = 2048;
|
||||
INT32 texsize = 512;
|
||||
boolean firstTime = (finalScreenTexture == 0);
|
||||
|
||||
// Use a power of two texture, dammit
|
||||
if(screen_width <= 512)
|
||||
texsize = 512;
|
||||
else if(screen_width <= 1024)
|
||||
texsize = 1024;
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsize < screen_width || texsize < screen_height)
|
||||
texsize <<= 1;
|
||||
|
||||
// Create screen texture
|
||||
if (firstTime)
|
||||
@@ -3505,15 +3495,14 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int width, int height)
|
||||
float origaspect, newaspect;
|
||||
float xoff = 1, yoff = 1; // xoffset and yoffset for the polygon to have black bars around the screen
|
||||
FRGBAFloat clearColour;
|
||||
INT32 texsize = 2048;
|
||||
INT32 texsize = 512;
|
||||
|
||||
float off[12];
|
||||
float fix[8];
|
||||
|
||||
if(screen_width <= 1024)
|
||||
texsize = 1024;
|
||||
if(screen_width <= 512)
|
||||
texsize = 512;
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsize < screen_width || texsize < screen_height)
|
||||
texsize <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsize)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsize)/((float)((screen_height))));
|
||||
|
||||
@@ -158,6 +158,9 @@ UINT32 I_GetSongLoopPoint(void);
|
||||
boolean I_SetSongPosition(UINT32 position);
|
||||
UINT32 I_GetSongPosition(void);
|
||||
|
||||
void I_UpdateSongLagThreshold (void);
|
||||
void I_UpdateSongLagConditions (void);
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC PLAYBACK
|
||||
/// ------------------------
|
||||
|
||||
+77
-16
@@ -2811,6 +2811,8 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define DRIFTSPARKGROWTICS 8
|
||||
|
||||
static void K_SpawnDriftSparks(player_t *player)
|
||||
{
|
||||
fixed_t newx;
|
||||
@@ -2836,14 +2838,28 @@ static void K_SpawnDriftSparks(player_t *player)
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
UINT8 pindex;
|
||||
fixed_t driftExtraScale = 0;
|
||||
newx = player->mo->x + P_ReturnThrustX(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(32*FRACUNIT, player->mo->scale));
|
||||
newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(32*FRACUNIT, player->mo->scale));
|
||||
spark = P_SpawnMobj(newx, newy, player->mo->z, MT_DRIFTSPARK);
|
||||
|
||||
P_SetTarget(&spark->target, player->mo);
|
||||
spark->angle = travelangle-(ANGLE_45/5)*player->kartstuff[k_drift];
|
||||
spark->destscale = player->mo->scale;
|
||||
P_SetScale(spark, player->mo->scale);
|
||||
|
||||
// scale increase while driftspark level gained timer is running
|
||||
|
||||
// hack to find the correct player number
|
||||
for (pindex = 0; pindex < MAXPLAYERS; pindex++)
|
||||
{
|
||||
if (player == &players[pindex])
|
||||
{
|
||||
driftExtraScale = FixedDiv(driftsparkGrowTimer[pindex], DRIFTSPARKGROWTICS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
spark->destscale = FixedMul(player->mo->scale, FRACUNIT + FixedMul(driftExtraScale, cv_driftsparkpulse.value));
|
||||
P_SetScale(spark, FixedMul(player->mo->scale, FRACUNIT + FixedMul(driftExtraScale, cv_driftsparkpulse.value)));
|
||||
|
||||
spark->momx = player->mo->momx/2;
|
||||
spark->momy = player->mo->momy/2;
|
||||
@@ -5209,24 +5225,54 @@ static void K_KartDrift(player_t *player, boolean onground)
|
||||
if (player->speed > minspeed*2)
|
||||
player->kartstuff[k_getsparks] = 1;
|
||||
|
||||
// Sound whenever you get a different tier of sparks
|
||||
if ((player->kartstuff[k_driftcharge] < dsone && player->kartstuff[k_driftcharge]+driftadditive >= dsone)
|
||||
|| (player->kartstuff[k_driftcharge] < dstwo && player->kartstuff[k_driftcharge]+driftadditive >= dstwo)
|
||||
|| (player->kartstuff[k_driftcharge] < dsthree && player->kartstuff[k_driftcharge]+driftadditive >= dsthree))
|
||||
{
|
||||
UINT8 pindex;
|
||||
//S_StartSound(player->mo, sfx_s3ka2);
|
||||
if (P_IsLocalPlayer(player)) // UGHGHGH...
|
||||
S_StartSoundAtVolume(player->mo, sfx_s3ka2, 192); // Ugh...
|
||||
|
||||
// hack to find the correct player number
|
||||
for (pindex = 0; pindex < MAXPLAYERS; pindex++)
|
||||
{
|
||||
if (player == &players[pindex])
|
||||
{
|
||||
driftsparkGrowTimer[pindex] = DRIFTSPARKGROWTICS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// moved this below sounds to help with scaling
|
||||
// This spawns the drift sparks
|
||||
if (player->kartstuff[k_driftcharge] + driftadditive >= dsone)
|
||||
K_SpawnDriftSparks(player);
|
||||
|
||||
// Sound whenever you get a different tier of sparks
|
||||
if (P_IsLocalPlayer(player) // UGHGHGH...
|
||||
&& ((player->kartstuff[k_driftcharge] < dsone && player->kartstuff[k_driftcharge]+driftadditive >= dsone)
|
||||
|| (player->kartstuff[k_driftcharge] < dstwo && player->kartstuff[k_driftcharge]+driftadditive >= dstwo)
|
||||
|| (player->kartstuff[k_driftcharge] < dsthree && player->kartstuff[k_driftcharge]+driftadditive >= dsthree)))
|
||||
{
|
||||
//S_StartSound(player->mo, sfx_s3ka2);
|
||||
S_StartSoundAtVolume(player->mo, sfx_s3ka2, 192); // Ugh...
|
||||
}
|
||||
|
||||
player->kartstuff[k_driftcharge] += driftadditive;
|
||||
player->kartstuff[k_driftend] = 0;
|
||||
}
|
||||
|
||||
{
|
||||
//im putting this in a block because i want the variables here, not at the top of the block
|
||||
UINT8 pindex;
|
||||
|
||||
// hack to find the correct player number
|
||||
for (pindex = 0; pindex < MAXPLAYERS; pindex++)
|
||||
{
|
||||
if (player == &players[pindex])
|
||||
{
|
||||
if (driftsparkGrowTimer[pindex])
|
||||
driftsparkGrowTimer[pindex]--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Stop drifting
|
||||
if (player->kartstuff[k_spinouttimer] > 0 || player->speed < minspeed)
|
||||
{
|
||||
@@ -5593,9 +5639,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||
P_SetScale(overlay, player->mo->scale);
|
||||
}
|
||||
player->kartstuff[k_invincibilitytimer] = itemtime+(2*TICRATE); // 10 seconds
|
||||
P_RestoreMusic(player);
|
||||
if (!P_IsLocalPlayer(player))
|
||||
if (P_IsLocalPlayer(player))
|
||||
S_ChangeMusicSpecial("kinvnc");
|
||||
else
|
||||
S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmi : sfx_kinvnc));
|
||||
P_RestoreMusic(player);
|
||||
K_PlayPowerGloatSound(player->mo);
|
||||
player->kartstuff[k_itemamount]--;
|
||||
}
|
||||
@@ -5796,9 +5844,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||
if (cv_kartdebugshrink.value && !modeattacking && !player->bot)
|
||||
player->mo->destscale = (6*player->mo->destscale)/8;
|
||||
player->kartstuff[k_growshrinktimer] = itemtime+(4*TICRATE); // 12 seconds
|
||||
P_RestoreMusic(player);
|
||||
if (!P_IsLocalPlayer(player))
|
||||
if (P_IsLocalPlayer(player))
|
||||
S_ChangeMusicSpecial("kgrow");
|
||||
else
|
||||
S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmg : sfx_kgrow));
|
||||
P_RestoreMusic(player);
|
||||
S_StartSound(player->mo, sfx_kc5a);
|
||||
}
|
||||
player->kartstuff[k_itemamount]--;
|
||||
@@ -7941,6 +7991,17 @@ static void K_drawKartSpeedometer(void)
|
||||
convSpeed = FixedDiv(stplyr->speed, mapobjectscale)/FRACUNIT;
|
||||
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d fu/t", convSpeed));
|
||||
}
|
||||
else if (cv_kartspeedometer.value == 4) // Percent
|
||||
{
|
||||
// so code breaks if someone attempts to join from spectator since it sets
|
||||
// their mo to NULL
|
||||
// so can we just check if their mo is NULL????
|
||||
if (stplyr->mo)
|
||||
{
|
||||
convSpeed = (FixedDiv(stplyr->speed, FixedMul(K_GetKartSpeed(stplyr, false), ORIG_FRICTION))*100)>>FRACBITS;
|
||||
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%4d P", convSpeed));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void K_drawKartBumpersOrKarma(void)
|
||||
|
||||
+26
-3
@@ -137,6 +137,8 @@ const char *quitmsg[NUM_QUITMESSAGES];
|
||||
// Stuff for customizing the player select screen Tails 09-22-2003
|
||||
description_t description[MAXSKINS];
|
||||
|
||||
INT32 mapwads[NUMMAPS];
|
||||
|
||||
//static char *char_notes = NULL;
|
||||
//static fixed_t char_scroll = 0;
|
||||
|
||||
@@ -1118,7 +1120,8 @@ static menuitem_t OP_ControlsMenu[] =
|
||||
{IT_CALL | IT_STRING, NULL, "Player 3 Controls...", &M_Setup3PControlsMenu, 30},
|
||||
{IT_CALL | IT_STRING, NULL, "Player 4 Controls...", &M_Setup4PControlsMenu, 40},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Digital turn easing", &cv_turnsmooth, 70},
|
||||
};
|
||||
|
||||
static menuitem_t OP_AllControlsMenu[] =
|
||||
@@ -1284,6 +1287,7 @@ static menuitem_t OP_VideoOptionsMenu[] =
|
||||
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 90},
|
||||
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "FPS Cap", &cv_fpscap, 110},
|
||||
{IT_STRING | IT_CVAR, NULL, "Drift spark pulse size",&cv_driftsparkpulse, 125},
|
||||
|
||||
#ifdef HWRENDER
|
||||
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 130},
|
||||
@@ -1305,6 +1309,7 @@ enum
|
||||
op_video_fps,
|
||||
op_video_vsync,
|
||||
op_video_fpscap,
|
||||
op_video_driftsparkpulse,
|
||||
#ifdef HWRENDER
|
||||
op_video_ogl,
|
||||
#endif
|
||||
@@ -1330,7 +1335,9 @@ static menuitem_t OP_OpenGLOptionsMenu[] =
|
||||
{IT_STRING|IT_CVAR, NULL, "Sprite Billboarding", &cv_grspritebillboarding, 100},
|
||||
{IT_STRING|IT_CVAR, NULL, "Software Perspective", &cv_grshearing, 110},
|
||||
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Gamma...", &OP_OpenGLColorDef, 130},
|
||||
{IT_STRING|IT_CVAR, NULL, "Rendering Distance", &cv_grrenderdistance, 130},
|
||||
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Gamma...", &OP_OpenGLColorDef, 150},
|
||||
};
|
||||
|
||||
static menuitem_t OP_OpenGLColorMenu[] =
|
||||
@@ -1481,7 +1488,8 @@ static menuitem_t OP_HUDOptionsMenu[] =
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 120},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 135},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show Track Addon Name", &cv_showtrackaddon, 135},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 145},
|
||||
};
|
||||
|
||||
// Ok it's still called chatoptions but we'll put ping display in here to be clean
|
||||
@@ -9293,6 +9301,21 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade)
|
||||
trans = G_GetGametypeColor(cv_newgametype.value);
|
||||
|
||||
V_DrawFill(x-1, y-1, w+2, i+2, trans); // variable reuse...
|
||||
|
||||
if (cv_nextmap.value && cv_showtrackaddon.value)
|
||||
{
|
||||
char *addonname = wadfiles[mapwads[cv_nextmap.value-1]]->filename;
|
||||
INT32 len, sw = 0;
|
||||
INT32 charlimit = 21 + (dupadjust/5);
|
||||
nameonly(addonname);
|
||||
len = strlen(addonname);
|
||||
#define charsonside 14
|
||||
if (len > charlimit)
|
||||
V_DrawThinString(x+w+5, y+i-8, V_TRANSLUCENT, va("%.*s...%s", charsonside, addonname, addonname+((len-charlimit) + charsonside))); // variable reuse...
|
||||
#undef charsonside
|
||||
else
|
||||
V_DrawThinString(x+w+5, y+i-8, V_TRANSLUCENT, addonname); // variable reuse...
|
||||
}
|
||||
|
||||
if (!cv_kartencore.value || gamestate == GS_TIMEATTACK || cv_newgametype.value != GT_RACE)
|
||||
V_DrawSmallScaledPatch(x, y, 0, PictureOfLevel);
|
||||
|
||||
@@ -235,6 +235,8 @@ typedef struct
|
||||
UINT8 netgame;
|
||||
} saveinfo_t;
|
||||
|
||||
extern INT32 mapwads[NUMMAPS];
|
||||
|
||||
extern description_t description[MAXSKINS];
|
||||
|
||||
extern consvar_t cv_showfocuslost;
|
||||
|
||||
@@ -2132,6 +2132,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
{
|
||||
mobjtype_t item;
|
||||
mobj_t *mo;
|
||||
int ms;
|
||||
|
||||
//if (inflictor && (inflictor->type == MT_SHELL || inflictor->type == MT_FIREBALL))
|
||||
// P_SetTarget(&target->tracer, inflictor);
|
||||
|
||||
+4
-2
@@ -3237,14 +3237,16 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||
: mapheaderinfo[gamemap - 1]->numlaps);
|
||||
|
||||
// Start recording replay in multiplayer with a temp filename
|
||||
//@TODO I'd like to fix dedis crashing when recording replays for the future too...
|
||||
if (!demo.playback && multiplayer && !dedicated) {
|
||||
//Ensure dedis only record a replay if there is a player at the start of the map, otherwise we get invalid replays!
|
||||
if (!demo.playback && multiplayer && D_NumPlayers()) {
|
||||
static char buf[256];
|
||||
sprintf(buf, "replay"PATHSEP"online"PATHSEP"%d-%s", (int) (time(NULL)), G_BuildMapName(gamemap));
|
||||
|
||||
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
|
||||
I_mkdir(va("%s"PATHSEP"replay"PATHSEP"online", srb2home), 0755);
|
||||
G_RecordDemo(buf);
|
||||
if (dedicated)
|
||||
G_BeginRecording(); //this has to move here, since dedicated servers dont run got_mapcmd
|
||||
}
|
||||
|
||||
wantedcalcdelay = wantedfrequency*2;
|
||||
|
||||
@@ -2480,6 +2480,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||
mapmusflags |= MUSIC_FORCERESET;
|
||||
|
||||
mapmusposition = position;
|
||||
mapmusresume = 0;
|
||||
|
||||
S_ChangeMusicEx(mapmusname, mapmusflags, !(line->flags & ML_EFFECT4), position,
|
||||
!(line->flags & ML_EFFECT2) ? prefadems : 0,
|
||||
|
||||
@@ -780,6 +780,11 @@ void P_Ticker(boolean run)
|
||||
if (cv_recordmultiplayerdemos.value && (demo.savemode == DSM_NOTSAVING || demo.savemode == DSM_WILLAUTOSAVE))
|
||||
if (demo.savebutton && demo.savebutton + 3*TICRATE < leveltime && (InputDown(gc_lookback, 1) || (cv_usejoystick.value && axis > 0)))
|
||||
demo.savemode = DSM_TITLEENTRY;
|
||||
|
||||
//if there are no players left at all, stop demo recording
|
||||
//Demos that that dont have any players crash during playback, which can happen with dedicated servers
|
||||
if (cv_recordmultiplayerdemos.value && demo.savemode == DSM_WILLAUTOSAVE && !D_NumPlayers())
|
||||
G_SaveDemo();
|
||||
}
|
||||
else if (demo.playback) // Use Ghost data for consistency checks.
|
||||
{
|
||||
|
||||
+17
-1
@@ -1221,6 +1221,8 @@ boolean P_EndingMusic(player_t *player)
|
||||
//
|
||||
void P_RestoreMusic(player_t *player)
|
||||
{
|
||||
UINT32 position;
|
||||
|
||||
if (!P_IsLocalPlayer(player)) // Only applies to a local player
|
||||
return;
|
||||
|
||||
@@ -1277,10 +1279,16 @@ void P_RestoreMusic(player_t *player)
|
||||
|
||||
// Item - Grow
|
||||
if (wantedmus == 2)
|
||||
{
|
||||
S_ChangeMusicInternal("kgrow", true);
|
||||
S_SetRestoreMusicFadeInCvar(&cv_growmusicfade);
|
||||
}
|
||||
// Item - Invincibility
|
||||
else if (wantedmus == 1)
|
||||
{
|
||||
S_ChangeMusicInternal("kinvnc", true);
|
||||
S_SetRestoreMusicFadeInCvar(&cv_invincmusicfade);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
@@ -1289,7 +1297,15 @@ void P_RestoreMusic(player_t *player)
|
||||
if (G_RaceGametype() && player->laps >= (UINT8)(cv_numlaps.value - 1))
|
||||
S_SpeedMusic(1.2f);
|
||||
#endif
|
||||
S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0);
|
||||
if (mapmusresume && cv_resume.value)
|
||||
position = mapmusresume;
|
||||
else
|
||||
position = mapmusposition;
|
||||
|
||||
S_ChangeMusicEx(mapmusname, mapmusflags, true, position, 0,
|
||||
S_GetRestoreMusicFadeIn());
|
||||
S_ClearRestoreMusicFadeInCvar();
|
||||
mapmusresume = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1821,6 +1821,8 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_actionmovie);
|
||||
CV_RegisterVar(&cv_windowquake);
|
||||
|
||||
CV_RegisterVar(&cv_driftsparkpulse);
|
||||
|
||||
CV_RegisterVar(&cv_showhud);
|
||||
CV_RegisterVar(&cv_translucenthud);
|
||||
|
||||
|
||||
@@ -120,6 +120,16 @@ consvar_t cv_gamesounds = {"sounds", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff,
|
||||
consvar_t cv_playmusicifunfocused = {"playmusicifunfocused", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, PlayMusicIfUnfocused_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_playsoundifunfocused = {"playsoundsifunfocused", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, PlaySoundIfUnfocused_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t music_resync_threshold_cons_t[] = {
|
||||
{0, "MIN"},
|
||||
{1000, "MAX"},
|
||||
|
||||
{0}
|
||||
};
|
||||
consvar_t cv_music_resync_threshold = {"music_resync_threshold", "100", CV_SAVE|CV_CALL, music_resync_threshold_cons_t, I_UpdateSongLagThreshold, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_music_resync_powerups_only = {"music_resync_powerups_only", "No", CV_SAVE|CV_CALL, CV_YesNo, I_UpdateSongLagConditions, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#define S_MAX_VOLUME 127
|
||||
|
||||
// when to clip out sounds
|
||||
@@ -286,6 +296,9 @@ void S_RegisterSoundStuff(void)
|
||||
CV_RegisterVar(&cv_playmusicifunfocused);
|
||||
CV_RegisterVar(&cv_playsoundifunfocused);
|
||||
|
||||
CV_RegisterVar(&cv_music_resync_threshold);
|
||||
CV_RegisterVar(&cv_music_resync_powerups_only);
|
||||
|
||||
COM_AddCommand("tunes", Command_Tunes_f);
|
||||
COM_AddCommand("restartaudio", Command_RestartAudio_f);
|
||||
|
||||
@@ -1552,6 +1565,8 @@ static char music_name[7]; // up to 6-character name
|
||||
static void *music_data;
|
||||
static UINT16 music_flags;
|
||||
static boolean music_looping;
|
||||
static consvar_t *music_refade_cv;
|
||||
static int music_usage;
|
||||
|
||||
static char queue_name[7];
|
||||
static UINT16 queue_flags;
|
||||
@@ -1935,6 +1950,9 @@ static void S_UnloadMusic(void)
|
||||
music_name[0] = 0;
|
||||
music_flags = 0;
|
||||
music_looping = false;
|
||||
|
||||
music_refade_cv = 0;
|
||||
music_usage = 0;
|
||||
}
|
||||
|
||||
static boolean S_PlayMusic(boolean looping, UINT32 fadeinms)
|
||||
@@ -1942,6 +1960,8 @@ static boolean S_PlayMusic(boolean looping, UINT32 fadeinms)
|
||||
if (S_MusicDisabled())
|
||||
return false;
|
||||
|
||||
I_UpdateSongLagConditions();
|
||||
|
||||
if ((!fadeinms && !I_PlaySong(looping)) ||
|
||||
(fadeinms && !I_FadeInPlaySong(fadeinms, looping)))
|
||||
{
|
||||
@@ -2052,6 +2072,15 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
S_ChangeMusicSpecial (const char *mmusic)
|
||||
{
|
||||
if (cv_resetspecialmusic.value)
|
||||
S_ChangeMusic(mmusic, MUSIC_FORCERESET, true);
|
||||
else
|
||||
S_ChangeMusicInternal(mmusic, true);
|
||||
}
|
||||
|
||||
void S_StopMusic(void)
|
||||
{
|
||||
if (!I_SongPlaying()
|
||||
@@ -2059,6 +2088,9 @@ void S_StopMusic(void)
|
||||
|| demo.title) // SRB2Kart: Demos don't interrupt title screen music
|
||||
return;
|
||||
|
||||
if (strcasecmp(music_name, mapmusname) == 0)
|
||||
mapmusresume = I_GetSongPosition();
|
||||
|
||||
if (I_SongPaused())
|
||||
I_ResumeSong();
|
||||
|
||||
@@ -2228,6 +2260,7 @@ void S_Start(void)
|
||||
mapmusname[6] = 0;
|
||||
mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK);
|
||||
mapmusposition = mapheaderinfo[gamemap-1]->muspos;
|
||||
mapmusresume = 0;
|
||||
}
|
||||
|
||||
//if (cv_resetmusic.value) // Starting ambience should always be restarted
|
||||
@@ -2302,6 +2335,7 @@ static void Command_Tunes_f(void)
|
||||
mapmusname[6] = 0;
|
||||
mapmusflags = (track & MUSIC_TRACKMASK);
|
||||
mapmusposition = position;
|
||||
mapmusresume = 0;
|
||||
|
||||
S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0);
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ extern consvar_t cv_gamesounds;
|
||||
extern consvar_t cv_playmusicifunfocused;
|
||||
extern consvar_t cv_playsoundifunfocused;
|
||||
|
||||
extern consvar_t cv_music_resync_threshold;
|
||||
extern consvar_t cv_music_resync_powerups_only;
|
||||
|
||||
#ifdef SNDSERV
|
||||
extern consvar_t sndserver_cmd, sndserver_arg;
|
||||
#endif
|
||||
@@ -176,6 +179,11 @@ UINT32 S_GetMusicPosition(void);
|
||||
// Music Playback
|
||||
//
|
||||
|
||||
enum
|
||||
{
|
||||
MUS_SPECIAL = 1,/* powerups--invincibility, grow */
|
||||
};
|
||||
|
||||
// Start music track, arbitrary, given its name, and set whether looping
|
||||
// note: music flags 12 bits for tracknum (gme, other formats with more than one track)
|
||||
// 13-15 aren't used yet
|
||||
@@ -184,6 +192,16 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
||||
#define S_ChangeMusicInternal(a,b) S_ChangeMusicEx(a,0,b,0,0,0)
|
||||
#define S_ChangeMusic(a,b,c) S_ChangeMusicEx(a,b,c,0,0,0)
|
||||
|
||||
void S_ChangeMusicSpecial (const char *mmusic);
|
||||
|
||||
void S_SetRestoreMusicFadeInCvar (consvar_t *cvar);
|
||||
#define S_ClearRestoreMusicFadeInCvar() \
|
||||
S_SetRestoreMusicFadeInCvar(0)
|
||||
int S_GetRestoreMusicFadeIn (void);
|
||||
|
||||
void S_SetMusicUsage (int type);
|
||||
int S_MusicUsage (void);
|
||||
|
||||
// Stops the music.
|
||||
void S_StopMusic(void);
|
||||
|
||||
|
||||
+2
-2
@@ -53,8 +53,8 @@
|
||||
#define MAXVIDWIDTH 640
|
||||
#define MAXVIDHEIGHT 480
|
||||
#else
|
||||
#define MAXVIDWIDTH 1920 // don't set this too high because actually
|
||||
#define MAXVIDHEIGHT 1200 // lots of tables are allocated with the MAX size.
|
||||
#define MAXVIDWIDTH 3840 // don't set this too high because actually
|
||||
#define MAXVIDHEIGHT 2160 // lots of tables are allocated with the MAX size.
|
||||
#endif
|
||||
#define BASEVIDWIDTH 320 // NEVER CHANGE THIS! This is the original
|
||||
#define BASEVIDHEIGHT 200 // resolution of the graphics.
|
||||
|
||||
@@ -173,6 +173,10 @@ static INT32 windowedModes[MAXWINMODES][2] =
|
||||
{ 320, 200}, // 1.60,1.00
|
||||
};
|
||||
|
||||
#define CUSTOMMODENUM 9999
|
||||
static INT32 custom_width = 0;
|
||||
static INT32 custom_height = 0;
|
||||
|
||||
static void Impl_VideoSetupSDLBuffer(void);
|
||||
static void Impl_VideoSetupBuffer(void);
|
||||
static SDL_bool Impl_CreateWindow(SDL_bool fullscreen);
|
||||
@@ -1554,6 +1558,16 @@ INT32 VID_GetModeForSize(INT32 w, INT32 h)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
// did not find mode from list, make custom resolution if the values somewhat make sense
|
||||
// opengl mode does not mind about max resolution defined in screen.h
|
||||
// if not using opengl, check against the maximum as well
|
||||
if ((w >= BASEVIDWIDTH && h >= BASEVIDHEIGHT) &&
|
||||
(rendermode == render_opengl || (w <= MAXVIDWIDTH && h <= MAXVIDHEIGHT)))
|
||||
{
|
||||
custom_width = w;
|
||||
custom_height = h;
|
||||
return CUSTOMMODENUM;
|
||||
}
|
||||
return -1;
|
||||
#if 0
|
||||
INT32 matchMode = -1, i;
|
||||
@@ -1688,6 +1702,13 @@ INT32 VID_SetMode(INT32 modeNum)
|
||||
vid.height = windowedModes[modeNum][1];
|
||||
vid.modenum = modeNum;
|
||||
}
|
||||
else if (modeNum == CUSTOMMODENUM && custom_width && custom_height)
|
||||
{
|
||||
// at this point these values are assumed to be okay
|
||||
vid.width = custom_width;
|
||||
vid.height = custom_height;
|
||||
vid.modenum = modeNum;
|
||||
}
|
||||
else
|
||||
{
|
||||
// just set the desktop resolution as a fallback
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
|
||||
#if defined(HAVE_SDL) && defined(HAVE_MIXER) && SOUND==SOUND_MIXER
|
||||
|
||||
/*
|
||||
Just for hu_stopped. I promise I didn't
|
||||
write netcode into the sound code, OKAY?
|
||||
*/
|
||||
#include "../d_clisrv.h"
|
||||
|
||||
#include "../sounds.h"
|
||||
#include "../s_sound.h"
|
||||
#include "../i_sound.h"
|
||||
@@ -74,12 +80,17 @@
|
||||
|
||||
UINT8 sound_started = false;
|
||||
|
||||
static UINT32 stutter_threshold_user;
|
||||
static UINT32 stutter_threshold;
|
||||
|
||||
static Mix_Music *music;
|
||||
static UINT8 music_volume, sfx_volume, internal_volume;
|
||||
static float loop_point;
|
||||
static float song_length; // length in seconds
|
||||
static boolean songpaused;
|
||||
static UINT32 music_end_bytes;
|
||||
static UINT32 music_bytes;
|
||||
static UINT32 music_stutter_bytes;
|
||||
static boolean is_looping;
|
||||
|
||||
// fading
|
||||
@@ -101,6 +112,8 @@ static void var_cleanup(void)
|
||||
loop_point = song_length =\
|
||||
music_bytes = fading_source = fading_target =\
|
||||
fading_timer = fading_duration = 0;
|
||||
music_end_bytes = 0;
|
||||
music_stutter_bytes = 0;
|
||||
|
||||
songpaused = is_looping =\
|
||||
is_fading = false;
|
||||
@@ -535,6 +548,35 @@ static void do_fading_callback(void)
|
||||
/// Music Hooks
|
||||
/// ------------------------
|
||||
|
||||
static void
|
||||
Countstutter (int len)
|
||||
{
|
||||
UINT32 bytes;
|
||||
|
||||
if (hu_stopped)
|
||||
{
|
||||
music_stutter_bytes += len;
|
||||
}
|
||||
else if (stutter_threshold)
|
||||
{
|
||||
if (music_stutter_bytes >= stutter_threshold)
|
||||
{
|
||||
/*
|
||||
This would be after looping. If we're too near to the start of the
|
||||
file, subtracting the delta will just underflow.
|
||||
*/
|
||||
if (music_stutter_bytes > music_bytes)
|
||||
{
|
||||
/* We already know where the end is because we looped. */
|
||||
bytes = ( music_end_bytes - ( music_stutter_bytes - music_bytes ));
|
||||
}
|
||||
else
|
||||
bytes = ( music_bytes - music_stutter_bytes );
|
||||
I_SetSongPosition((int)( bytes/4/44100.0*1000 ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void count_music_bytes(int chan, void *stream, int len, void *udata)
|
||||
{
|
||||
(void)chan;
|
||||
@@ -544,12 +586,16 @@ static void count_music_bytes(int chan, void *stream, int len, void *udata)
|
||||
if (!music || I_SongType() == MU_GME || I_SongType() == MU_MOD || I_SongType() == MU_MID)
|
||||
return;
|
||||
music_bytes += len;
|
||||
|
||||
if (gamestate == GS_LEVEL)
|
||||
Countstutter(len);
|
||||
}
|
||||
|
||||
static void music_loop(void)
|
||||
{
|
||||
if (is_looping)
|
||||
{
|
||||
music_end_bytes = music_bytes;
|
||||
Mix_PlayMusic(music, 0);
|
||||
Mix_SetMusicPosition(loop_point);
|
||||
music_bytes = loop_point*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetSongPosition)
|
||||
@@ -831,6 +877,8 @@ boolean I_SetSongPosition(UINT32 position)
|
||||
// NOT if position input is greater than song length.
|
||||
music_bytes = 0;
|
||||
|
||||
music_stutter_bytes = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -875,6 +923,22 @@ UINT32 I_GetSongPosition(void)
|
||||
// 8M: 1 | 8S: 2 | 16M: 2 | 16S: 4
|
||||
}
|
||||
|
||||
void
|
||||
I_UpdateSongLagThreshold (void)
|
||||
{
|
||||
stutter_threshold_user = cv_music_resync_threshold.value/1000.0*(4*44100);
|
||||
I_UpdateSongLagConditions();
|
||||
}
|
||||
|
||||
void
|
||||
I_UpdateSongLagConditions (void)
|
||||
{
|
||||
if (! cv_music_resync_powerups_only.value || S_MusicUsage() == MUS_SPECIAL)
|
||||
stutter_threshold = stutter_threshold_user;
|
||||
else
|
||||
stutter_threshold = 0;
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
/// Music Playback
|
||||
/// ------------------------
|
||||
|
||||
+1
-1
@@ -229,7 +229,7 @@ void OglSdlFinishUpdate(boolean waitvbl)
|
||||
HWR_DrawScreenFinalTexture(sdlw, sdlh);
|
||||
SDL_GL_SwapWindow(window);
|
||||
|
||||
GClipRect(0, 0, realwidth, realheight, NZCLIP_PLANE);
|
||||
GClipRect(0, 0, realwidth, realheight, NZCLIP_PLANE, FAR_ZCLIP_DEFAULT);
|
||||
|
||||
// Sryder: We need to draw the final screen texture again into the other buffer in the original position so that
|
||||
// effects that want to take the old screen can do so after this
|
||||
|
||||
@@ -1409,6 +1409,9 @@ UINT32 I_GetSongPosition(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void I_UpdateSongLagThreshold (void) {}
|
||||
void I_UpdateSongLagConditions (void) {}
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC PLAYBACK
|
||||
/// ------------------------
|
||||
|
||||
Reference in new issue
Block a user