Merge remote-tracking branch 'origin/Saturn-Next' into moreopengl
This commit is contained in:
commit
c7f54a98e0
43 files changed
+1542
-366
No files matched your search
@@ -16,3 +16,5 @@
|
||||
#Appveyor
|
||||
/appveyor.yml -crlf -whitespace
|
||||
# Other
|
||||
*.c text=auto
|
||||
*.h text=auto
|
||||
+10
-2
@@ -1939,12 +1939,13 @@ static void CL_LoadReceivedSavegame(void)
|
||||
static void SendAskInfo(INT32 node)
|
||||
{
|
||||
tic_t asktime;
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
if (node != 0 && node != BROADCASTADDR &&
|
||||
cv_rendezvousserver.string[0])
|
||||
{
|
||||
I_NetRequestHolePunch(node);
|
||||
}
|
||||
#endif
|
||||
|
||||
asktime = I_GetTime();
|
||||
|
||||
@@ -6153,6 +6154,7 @@ static void UpdatePingTable(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
static void RenewHolePunch(void)
|
||||
{
|
||||
if (cv_rendezvousserver.string[0])
|
||||
@@ -6168,6 +6170,7 @@ static void RenewHolePunch(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Handle timeouts to prevent definitive freezes from happenning
|
||||
static void HandleNodeTimeouts(void)
|
||||
@@ -6201,11 +6204,14 @@ void NetKeepAlive(void)
|
||||
#ifdef MASTERSERVER
|
||||
MasterClient_Ticker();
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
if (netgame && serverrunning)
|
||||
{
|
||||
RenewHolePunch();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (client)
|
||||
{
|
||||
@@ -6318,10 +6324,12 @@ void NetUpdate(void)
|
||||
MasterClient_Ticker(); // Acking the Master Server
|
||||
#endif
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
if (netgame && serverrunning)
|
||||
{
|
||||
RenewHolePunch();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (client)
|
||||
{
|
||||
|
||||
+8
-2
@@ -94,8 +94,6 @@
|
||||
|
||||
// platform independant focus loss
|
||||
UINT8 window_notinfocus = false;
|
||||
INT32 window_x;
|
||||
INT32 window_y;
|
||||
|
||||
//
|
||||
// DEMO LOOP
|
||||
@@ -921,6 +919,7 @@ boolean snw_speedo; // snowy speedometer check
|
||||
boolean clr_hud; // colour hud check
|
||||
boolean big_lap; // bigger lap counter
|
||||
boolean big_lap_color; // bigger lap counter but colour
|
||||
boolean kartzspeedo; // kartZ speedometer
|
||||
|
||||
static void IdentifyVersion(void)
|
||||
{
|
||||
@@ -1295,6 +1294,13 @@ void D_SRB2Main(void)
|
||||
// check for bigger lap count but color** its color bitch
|
||||
if (W_CheckMultipleLumps("K_SCLAPB", "K_SCLA2B", NULL))
|
||||
big_lap_color = true;
|
||||
|
||||
// kartzspeedo
|
||||
if (W_CheckMultipleLumps("K_KZSP1", "K_KZSP2", "K_KZSP3", "K_KZSP4", "K_KZSP5", \
|
||||
"K_KZSP6", "K_KZSP7", "K_KZSP8", "K_KZSP9", "K_KZSP10", "K_KZSP11", "K_KZSP12", \
|
||||
"K_KZSP13", "K_KZSP14", "K_KZSP15", "K_KZSP16", "K_KZSP17", "K_KZSP18", "K_KZSP19", \
|
||||
"K_KZSP20", "K_KZSP21", "K_KZSP22", "K_KZSP23", "K_KZSP24", "K_KZSP25", NULL))
|
||||
kartzspeedo = true;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -32,6 +32,7 @@ extern boolean snw_speedo; // snowy speedometer check
|
||||
extern boolean clr_hud; // colour hud check
|
||||
extern boolean big_lap; // bigger lap counter
|
||||
extern boolean big_lap_color; //bigger lap counter but colour
|
||||
extern boolean kartzspeedo; //kartZ speedo
|
||||
|
||||
// the infinite loop of D_SRB2Loop() called from win_main for windows version
|
||||
void D_SRB2Loop(void) FUNCNORETURN;
|
||||
|
||||
@@ -51,7 +51,9 @@ doomcom_t *doomcom = NULL;
|
||||
/// \brief network packet data, points inside doomcom
|
||||
doomdata_t *netbuffer = NULL;
|
||||
/// \brief hole punching packet, also points inside doomcom
|
||||
#ifdef HOLEPUNCH
|
||||
holepunch_t *holepunchpacket = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUGFILE
|
||||
FILE *debugfile = NULL; // put some net info in a file during the game
|
||||
@@ -75,8 +77,10 @@ boolean (*I_NetCanGet)(void) = NULL;
|
||||
void (*I_NetCloseSocket)(void) = NULL;
|
||||
void (*I_NetFreeNodenum)(INT32 nodenum) = NULL;
|
||||
SINT8 (*I_NetMakeNodewPort)(const char *address, const char* port) = NULL;
|
||||
#ifdef HOLEPUNCH
|
||||
void (*I_NetRequestHolePunch)(INT32 node) = NULL;
|
||||
void (*I_NetRegisterHolePunch)(void) = NULL;
|
||||
#endif
|
||||
boolean (*I_NetOpenSocket)(void) = NULL;
|
||||
boolean (*I_Ban) (INT32 node) = NULL;
|
||||
void (*I_ClearBans)(void) = NULL;
|
||||
@@ -1349,7 +1353,9 @@ boolean D_CheckNetGame(void)
|
||||
I_Error("Too many nodes (%d), max:%d", doomcom->numnodes, MAXNETNODES);
|
||||
|
||||
netbuffer = (doomdata_t *)(void *)&doomcom->data;
|
||||
#ifdef HOLEPUNCH
|
||||
holepunchpacket = (holepunch_t *)(void *)&doomcom->data;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUGFILE
|
||||
if (M_CheckParm("-debugfile"))
|
||||
|
||||
+1
-1
@@ -1342,7 +1342,7 @@ void CURLGetFile(void)
|
||||
if (easyres == CURLE_HTTP_RETURNED_ERROR)
|
||||
curl_easy_getinfo(e, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
|
||||
easy_handle_error = (response_code) ? va("HTTP reponse code %ld", response_code) : curl_easy_strerror(easyres);
|
||||
easy_handle_error = (response_code) ? va("HTTP response code %ld", response_code) : curl_easy_strerror(easyres);
|
||||
curl_curfile->status = FS_FALLBACK;
|
||||
curl_curfile->currentsize = curl_origfilesize;
|
||||
curl_curfile->totalsize = curl_origtotalfilesize;
|
||||
|
||||
+2
-2
@@ -416,8 +416,8 @@ typedef struct player_s
|
||||
UINT8 skincolor;
|
||||
|
||||
INT32 skin;
|
||||
INT32 localskin;
|
||||
boolean skinlocal;
|
||||
INT32 localskin; // current localskin number
|
||||
boolean skinlocal; // determines if localskin is a skin already loaded in the server
|
||||
|
||||
UINT32 score; // player score
|
||||
fixed_t dashspeed; // dashing speed
|
||||
|
||||
@@ -639,6 +639,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||
|
||||
#if defined (HAVE_CURL) && ! defined (NONET)
|
||||
#define MASTERSERVER
|
||||
#define HOLEPUNCH
|
||||
#else
|
||||
#undef UPDATE_ALERT
|
||||
#endif
|
||||
|
||||
@@ -108,8 +108,6 @@ extern boolean digital_disabled;
|
||||
extern boolean menuactive; // Menu overlaid?
|
||||
extern UINT8 paused; // Game paused?
|
||||
extern UINT8 window_notinfocus; // are we in focus? (backend independant -- handles auto pausing and display of "focus lost" message)
|
||||
extern INT32 window_x;
|
||||
extern INT32 window_y;
|
||||
|
||||
extern boolean nodrawers;
|
||||
extern boolean noblit;
|
||||
|
||||
+26
-9
@@ -496,8 +496,12 @@ consvar_t cv_ydeadzone4 = {"joy4_ydeadzone", "0.5", CV_FLOAT|CV_SAVE, deadzone_c
|
||||
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};
|
||||
|
||||
static CV_PossibleValue_t stretchfactor_t[] = {{0, "MIN"}, {FRACUNIT, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_gravstretch = {"gravstretch", "0", CV_FLOAT | CV_SAVE, stretchfactor_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t stretchfactor_t[] = {
|
||||
{0, "Off"}, {FRACUNIT/8, "0.125"}, {FRACUNIT/4, "0.250"},
|
||||
{3*FRACUNIT/8, "0.375"}, {FRACUNIT/2, "0.500"}, {5*FRACUNIT/8, "0.625"},
|
||||
{3*FRACUNIT/4, "0.750"}, {7*FRACUNIT/8, "0.875"}, {FRACUNIT, "Max"}, {0, NULL}};
|
||||
consvar_t cv_gravstretch = {"gravstretch", "0", CV_SAVE, stretchfactor_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_sloperoll = {"sloperoll", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -5036,16 +5040,29 @@ void G_FreeMapSearch(mapsearchfreq_t *freq, INT32 freqc)
|
||||
INT32 G_FindMapByNameOrCode(const char *mapname, char **realmapnamep)
|
||||
{
|
||||
boolean usemapcode = false;
|
||||
|
||||
INT32 newmapnum;
|
||||
|
||||
size_t mapnamelen;
|
||||
size_t mapnamelen = strlen(mapname);
|
||||
|
||||
char *p;
|
||||
|
||||
mapnamelen = strlen(mapname);
|
||||
|
||||
if (mapnamelen == 2)/* maybe two digit code */
|
||||
|
||||
if (mapnamelen == 1)
|
||||
{
|
||||
if (mapname[0] == '*') // current map
|
||||
return gamemap;
|
||||
else if (mapname[0] == '+' && mapheaderinfo[gamemap-1]) // next map
|
||||
{
|
||||
newmapnum = mapheaderinfo[gamemap-1]->nextlevel;
|
||||
if (newmapnum < 1 || newmapnum > NUMMAPS)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("NextLevel (%d) is not a valid map.\n"), newmapnum);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return newmapnum;
|
||||
}
|
||||
}
|
||||
else if (mapnamelen == 2)/* maybe two digit code */
|
||||
{
|
||||
if (( newmapnum = M_MapNumber(mapname[0], mapname[1]) ))
|
||||
usemapcode = true;
|
||||
@@ -8189,7 +8206,7 @@ void G_AddGhost(char *defdemoname)
|
||||
count = READUINT16(p);
|
||||
while (count--)
|
||||
{
|
||||
SKIPSTRING(p);
|
||||
p += 2;
|
||||
SKIPSTRING(p);
|
||||
p++;
|
||||
}
|
||||
|
||||
+169
-109
@@ -61,14 +61,11 @@ struct hwdriver_s hwdriver;
|
||||
// Commands and console variables
|
||||
// ==========================================================================
|
||||
|
||||
// keep the state here instead of in the cv var, so it always matches the state in r_opengl.c
|
||||
int gr_use_palette_shader = 0;
|
||||
|
||||
static void CV_filtermode_ONChange(void);
|
||||
static void CV_anisotropic_ONChange(void);
|
||||
static void CV_screentextures_ONChange(void);
|
||||
static void CV_useCustomShaders_ONChange(void);
|
||||
static void CV_grpaletteshader_OnChange(void);
|
||||
static void CV_grshaders_OnChange(void);
|
||||
static void CV_Gammaxxx_ONChange(void);
|
||||
|
||||
static CV_PossibleValue_t grgamma_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
|
||||
@@ -102,6 +99,8 @@ 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};
|
||||
|
||||
consvar_t cv_grfofcut = {"gr_fofcut", "On", CV_SAVE, 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}};
|
||||
@@ -137,12 +136,12 @@ static INT32 current_bsp_culling_distance = 0;
|
||||
consvar_t cv_grscreentextures = {"gr_screentextures", "On", CV_CALL, CV_OnOff,
|
||||
CV_screentextures_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_grshaders = {"gr_shaders", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grshaders = {"gr_shaders", "On", CV_CALL|CV_SAVE, CV_OnOff, CV_grshaders_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grusecustomshaders = {"gr_usecustomshaders", "Yes", CV_CALL|CV_SAVE, CV_OnOff, CV_useCustomShaders_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_grpaletteshader = {"gr_paletteshader", "Off", CV_CALL|CV_SAVE, CV_OnOff, CV_grpaletteshader_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grpaletteshader = {"gr_paletteshader", "Off", CV_CALL|CV_SAVE, CV_OnOff, CV_grshaders_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_grflashpal = {"gr_flashpal", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grflashpal = {"gr_flashpal", "On", CV_CALL|CV_SAVE, CV_OnOff, CV_grshaders_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_grmdls = {"gr_mdls", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grfallbackplayermodel = {"gr_fallbackplayermodel", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -152,6 +151,12 @@ consvar_t cv_grspritebillboarding = {"gr_spritebillboarding", "On", CV_SAVE, CV_
|
||||
consvar_t cv_grfakecontrast = {"gr_fakecontrast", "Standard", CV_SAVE, grfakecontrast_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grslopecontrast = {"gr_slopecontrast", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
||||
boolean HWR_ShouldUsePaletteRendering(void)
|
||||
{
|
||||
return (cv_grpaletteshader.value && cv_grshaders.value);
|
||||
}
|
||||
|
||||
static void CV_filtermode_ONChange(void)
|
||||
{
|
||||
if (rendermode == render_opengl)
|
||||
@@ -170,6 +175,19 @@ static void CV_screentextures_ONChange(void)
|
||||
HWD.pfnSetSpecialState(HWD_SET_SCREEN_TEXTURES, cv_grscreentextures.value);
|
||||
}
|
||||
|
||||
static void CV_grshaders_OnChange(void)
|
||||
{
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
InitPalette(0, false);
|
||||
}
|
||||
|
||||
V_SetPalette(0);
|
||||
}
|
||||
}
|
||||
|
||||
static void CV_useCustomShaders_ONChange(void)
|
||||
{
|
||||
if (rendermode == render_opengl)
|
||||
@@ -179,19 +197,6 @@ static void CV_useCustomShaders_ONChange(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void CV_grpaletteshader_OnChange(void)
|
||||
{
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
if (cv_grshaders.value)
|
||||
{
|
||||
HWD.pfnSetSpecialState(HWD_SET_PALETTE_SHADER_ENABLED, cv_grpaletteshader.value);
|
||||
gr_use_palette_shader = cv_grpaletteshader.value;
|
||||
V_SetPalette(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// change the palette directly to see the change
|
||||
static void CV_Gammaxxx_ONChange(void)
|
||||
{
|
||||
@@ -199,6 +204,7 @@ static void CV_Gammaxxx_ONChange(void)
|
||||
V_SetPalette(0);
|
||||
}
|
||||
|
||||
|
||||
// ==========================================================================
|
||||
// Globals
|
||||
// ==========================================================================
|
||||
@@ -514,7 +520,7 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
|
||||
Surface->LightInfo.fade_start = (colormap != NULL) ? colormap->fadestart : 0;
|
||||
Surface->LightInfo.fade_end = (colormap != NULL) ? colormap->fadeend : 31;
|
||||
|
||||
if (gr_use_palette_shader)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
if (!colormap)
|
||||
{
|
||||
@@ -868,7 +874,7 @@ void HWR_RenderPlane(extrasubsector_t *xsub, boolean isceiling, fixed_t fixedhei
|
||||
else if (PolyFlags & PF_Ripple)
|
||||
HWD.pfnSetShader(5); // water shader
|
||||
else
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 9 : 1); // floor shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 9 : 1); // floor shader
|
||||
|
||||
PolyFlags |= PF_ColorMapped;
|
||||
}
|
||||
@@ -1027,7 +1033,7 @@ static void HWR_DrawSegsSplats(FSurfaceInfo * pSurf)
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 2); // wall shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 10 : 2); // wall shader
|
||||
}
|
||||
|
||||
HWD.pfnDrawPolygon(&pSurf, wallVerts, 4, i|PF_Modulated|PF_Decal, false);
|
||||
@@ -1065,7 +1071,7 @@ void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 2); // wall shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 10 : 2); // wall shader
|
||||
blendmode |= PF_ColorMapped;
|
||||
}
|
||||
|
||||
@@ -1087,12 +1093,10 @@ void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend
|
||||
//
|
||||
// HWR_SplitWall
|
||||
//
|
||||
void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor, FBITFIELD polyflags)
|
||||
// SoM: split up and light walls according to the lightlist.
|
||||
// This may also include leaving out parts of the wall that can't be seen
|
||||
static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor, FBITFIELD polyflags)
|
||||
{
|
||||
/* SoM: split up and light walls according to the
|
||||
lightlist. This may also include leaving out parts
|
||||
of the wall that can't be seen */
|
||||
|
||||
float realtop, realbot, top, bot;
|
||||
float pegt, pegb, pegmul;
|
||||
float height = 0.0f, bheight = 0.0f;
|
||||
@@ -1101,49 +1105,50 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
|
||||
float endrealtop, endrealbot, endtop, endbot;
|
||||
float endpegt, endpegb, endpegmul;
|
||||
float endheight = 0.0f, endbheight = 0.0f;
|
||||
|
||||
float diff;
|
||||
|
||||
fixed_t v1x = FLOAT_TO_FIXED(wallVerts[0].x);
|
||||
fixed_t v1y = FLOAT_TO_FIXED(wallVerts[0].z); // not a typo
|
||||
fixed_t v2x = FLOAT_TO_FIXED(wallVerts[1].x);
|
||||
fixed_t v2y = FLOAT_TO_FIXED(wallVerts[1].z); // not a typo
|
||||
// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
|
||||
// use this as a temp var to store P_GetZAt's return value each time
|
||||
fixed_t temp;
|
||||
fixed_t v1x = FloatToFixed(wallVerts[0].x);
|
||||
fixed_t v1y = FloatToFixed(wallVerts[0].z);
|
||||
fixed_t v2x = FloatToFixed(wallVerts[1].x);
|
||||
fixed_t v2y = FloatToFixed(wallVerts[1].z);
|
||||
#endif
|
||||
|
||||
INT32 solid, i;
|
||||
lightlist_t * list = sector->lightlist;
|
||||
const UINT8 alpha = Surf->PolyColor.s.alpha;
|
||||
FUINT lightnum = HWR_CalcWallLight(sector->lightlevel, v1x, v1y, v2x, v2y);
|
||||
extracolormap_t *colormap = NULL;
|
||||
|
||||
realtop = top = wallVerts[3].y;
|
||||
realbot = bot = wallVerts[0].y;
|
||||
diff = top - bot;
|
||||
|
||||
pegt = wallVerts[3].t;
|
||||
pegb = wallVerts[0].t;
|
||||
pegmul = (pegb - pegt) / (top - bot);
|
||||
|
||||
if (fpclassify(pegmul) == FP_NAN)
|
||||
// Lactozilla: If both heights of a side lay on the same position, then this wall is a triangle.
|
||||
// To avoid division by zero, which would result in a NaN, we check if the vertical difference
|
||||
// between the two vertices is not zero.
|
||||
if (fpclassify(diff) == FP_ZERO)
|
||||
pegmul = 0.0;
|
||||
else
|
||||
pegmul = (pegb - pegt) / diff;
|
||||
|
||||
|
||||
#ifdef ESLOPE
|
||||
endrealtop = endtop = wallVerts[2].y;
|
||||
endrealbot = endbot = wallVerts[1].y;
|
||||
endrealbot = endbot = wallVerts[1].y;
|
||||
endpegt = wallVerts[2].t;
|
||||
endpegb = wallVerts[1].t;
|
||||
endpegmul = (endpegb - endpegt) / (endtop - endbot);
|
||||
#endif
|
||||
|
||||
if (fpclassify(endpegmul) == FP_NAN)
|
||||
endpegmul = 0.0;
|
||||
|
||||
for (i = 0; i < sector->numlights; i++)
|
||||
for (INT32 i = 0; i < sector->numlights; i++)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
if (endtop < endrealbot)
|
||||
#endif
|
||||
if (top < realbot)
|
||||
if (endtop < endrealbot && top < realbot)
|
||||
return;
|
||||
|
||||
lightlist_t *list = sector->lightlist;
|
||||
|
||||
if (!(list[i].flags & FF_NOSHADE))
|
||||
{
|
||||
@@ -1161,7 +1166,7 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
|
||||
}
|
||||
}
|
||||
|
||||
solid = false;
|
||||
boolean solid = false;
|
||||
|
||||
if ((sector->lightlist[i].flags & FF_CUTSOLIDS) && !(cutflag & FF_EXTRA))
|
||||
solid = true;
|
||||
@@ -1180,11 +1185,9 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (list[i].slope)
|
||||
{
|
||||
temp = P_GetZAt(list[i].slope, v1x, v1y);
|
||||
height = FIXED_TO_FLOAT(temp);
|
||||
temp = P_GetZAt(list[i].slope, v2x, v2y);
|
||||
endheight = FIXED_TO_FLOAT(temp);
|
||||
{
|
||||
height = FixedToFloat(P_GetZAt(list[i].slope, v1x, v1y));
|
||||
endheight = FixedToFloat(P_GetZAt(list[i].slope, v2x, v2y));
|
||||
}
|
||||
else
|
||||
height = endheight = FIXED_TO_FLOAT(list[i].height);
|
||||
@@ -1192,10 +1195,8 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
|
||||
{
|
||||
if (*list[i].caster->b_slope)
|
||||
{
|
||||
temp = P_GetZAt(*list[i].caster->b_slope, v1x, v1y);
|
||||
bheight = FIXED_TO_FLOAT(temp);
|
||||
temp = P_GetZAt(*list[i].caster->b_slope, v2x, v2y);
|
||||
endbheight = FIXED_TO_FLOAT(temp);
|
||||
bheight = FixedToFloat(P_GetZAt(*list[i].caster->b_slope, v1x, v1y));
|
||||
endbheight = FixedToFloat(P_GetZAt(*list[i].caster->b_slope, v2x, v2y));
|
||||
}
|
||||
else
|
||||
bheight = endbheight = FIXED_TO_FLOAT(*list[i].caster->bottomheight);
|
||||
@@ -1224,10 +1225,8 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
|
||||
{
|
||||
if (list[i+1].slope)
|
||||
{
|
||||
temp = P_GetZAt(list[i+1].slope, v1x, v1y);
|
||||
bheight = FIXED_TO_FLOAT(temp);
|
||||
temp = P_GetZAt(list[i+1].slope, v2x, v2y);
|
||||
endbheight = FIXED_TO_FLOAT(temp);
|
||||
bheight = FixedToFloat(P_GetZAt(list[i+1].slope, v1x, v1y));
|
||||
endbheight = FixedToFloat(P_GetZAt(list[i+1].slope, v2x, v2y));
|
||||
}
|
||||
else
|
||||
bheight = endbheight = FIXED_TO_FLOAT(list[i+1].height);
|
||||
@@ -2254,10 +2253,21 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
INT32 texnum;
|
||||
line_t * newline = NULL; // Multi-Property FOF
|
||||
|
||||
lowcut = max(worldbottom, worldlow);
|
||||
highcut = min(worldtop, worldhigh);
|
||||
lowcutslope = max(worldbottomslope, worldlowslope);
|
||||
highcutslope = min(worldtopslope, worldhighslope);
|
||||
if (!cv_grfofcut.value)
|
||||
{
|
||||
///TODO add slope support (fixing cutoffs, proper wall clipping) - maybe just disable highcut/lowcut if either sector or FOF has a slope
|
||||
/// to allow fun plane intersecting in OGL? But then people would abuse that and make software look bad. :C
|
||||
highcut = gr_frontsector->ceilingheight < gr_backsector->ceilingheight ? gr_frontsector->ceilingheight : gr_backsector->ceilingheight;
|
||||
lowcut = gr_frontsector->floorheight > gr_backsector->floorheight ? gr_frontsector->floorheight : gr_backsector->floorheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
lowcut = max(worldbottom, worldlow);
|
||||
highcut = min(worldtop, worldhigh);
|
||||
lowcutslope = max(worldbottomslope, worldlowslope);
|
||||
highcutslope = min(worldtopslope, worldhighslope);
|
||||
}
|
||||
|
||||
|
||||
if (gr_backsector->ffloors)
|
||||
{
|
||||
@@ -2266,17 +2276,26 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERSIDES) || (rover->flags & FF_INVERTSIDES))
|
||||
continue;
|
||||
|
||||
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
|
||||
SLOPEPARAMS(*rover->b_slope, low1, lowslope1, *rover->bottomheight)
|
||||
if (!cv_grfofcut.value)
|
||||
{
|
||||
if (*rover->topheight < lowcut || *rover->bottomheight > highcut)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
|
||||
SLOPEPARAMS(*rover->b_slope, low1, lowslope1, *rover->bottomheight)
|
||||
|
||||
if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope))
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope))
|
||||
continue;
|
||||
|
||||
texnum = R_GetTextureNum(sides[rover->master->sidenum[0]].midtexture);
|
||||
|
||||
if (rover->master->flags & ML_TFERLINE)
|
||||
{
|
||||
size_t linenum = gr_curline->linedef-gr_backsector->lines[0];
|
||||
size_t linenum = min(gr_curline->linedef-gr_backsector->lines[0], rover->master->frontsector->linecount);
|
||||
newline = rover->master->frontsector->lines[0] + linenum;
|
||||
texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture);
|
||||
}
|
||||
@@ -2286,17 +2305,31 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight;
|
||||
l = *rover->b_slope ? P_GetZAt(*rover->b_slope, v1x, v1y) : *rover->bottomheight;
|
||||
lS = *rover->b_slope ? P_GetZAt(*rover->b_slope, v2x, v2y) : *rover->bottomheight;
|
||||
// Adjust the heights so the FOF does not overlap with top and bottom textures.
|
||||
if (h >= highcut && hS >= highcutslope)
|
||||
|
||||
|
||||
if (!cv_grfofcut.value)
|
||||
{
|
||||
h = highcut;
|
||||
hS = highcutslope;
|
||||
if (!(*rover->t_slope) && !gr_frontsector->c_slope && !gr_backsector->c_slope && h > highcut)
|
||||
h = hS = highcut;
|
||||
if (!(*rover->b_slope) && !gr_frontsector->f_slope && !gr_backsector->f_slope && l < lowcut)
|
||||
l = lS = lowcut;
|
||||
}
|
||||
if (l <= lowcut && lS <= lowcutslope)
|
||||
else
|
||||
{
|
||||
l = lowcut;
|
||||
lS = lowcutslope;
|
||||
// Adjust the heights so the FOF does not overlap with top and bottom textures.
|
||||
if (h >= highcut && hS >= highcutslope)
|
||||
{
|
||||
h = highcut;
|
||||
hS = highcutslope;
|
||||
}
|
||||
if (l <= lowcut && lS <= lowcutslope)
|
||||
{
|
||||
l = lowcut;
|
||||
lS = lowcutslope;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Hurdler: HW code starts here
|
||||
//FIXME: check if peging is correct
|
||||
// set top/bottom coords
|
||||
@@ -2400,7 +2433,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
lightnum = rover->master->frontsector->lightlevel;
|
||||
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, vs.x, vs.y, ve.x, ve.y);
|
||||
|
||||
|
||||
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
|
||||
|
||||
if (gr_frontsector->numlights)
|
||||
@@ -2438,17 +2470,26 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_ALLSIDES))
|
||||
continue;
|
||||
|
||||
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
|
||||
SLOPEPARAMS(*rover->b_slope, low1, lowslope1, *rover->bottomheight)
|
||||
if (!cv_grfofcut.value)
|
||||
{
|
||||
if (*rover->topheight < lowcut || *rover->bottomheight > highcut)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
|
||||
SLOPEPARAMS(*rover->b_slope, low1, lowslope1, *rover->bottomheight)
|
||||
|
||||
if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope))
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope))
|
||||
continue;
|
||||
|
||||
texnum = R_GetTextureNum(sides[rover->master->sidenum[0]].midtexture);
|
||||
|
||||
if (rover->master->flags & ML_TFERLINE)
|
||||
{
|
||||
size_t linenum = gr_curline->linedef-gr_backsector->lines[0];
|
||||
size_t linenum = min(gr_curline->linedef-gr_backsector->lines[0], rover->master->frontsector->linecount);
|
||||
newline = rover->master->frontsector->lines[0] + linenum;
|
||||
texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture);
|
||||
}
|
||||
@@ -2457,17 +2498,29 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight;
|
||||
l = *rover->b_slope ? P_GetZAt(*rover->b_slope, v1x, v1y) : *rover->bottomheight;
|
||||
lS = *rover->b_slope ? P_GetZAt(*rover->b_slope, v2x, v2y) : *rover->bottomheight;
|
||||
// Adjust the heights so the FOF does not overlap with top and bottom textures.
|
||||
if (h >= highcut && hS >= highcutslope)
|
||||
|
||||
if (!cv_grfofcut.value)
|
||||
{
|
||||
h = highcut;
|
||||
hS = highcutslope;
|
||||
if (!(*rover->t_slope) && !gr_frontsector->c_slope && !gr_backsector->c_slope && h > highcut)
|
||||
h = hS = highcut;
|
||||
if (!(*rover->b_slope) && !gr_frontsector->f_slope && !gr_backsector->f_slope && l < lowcut)
|
||||
l = lS = lowcut;
|
||||
}
|
||||
if (l <= lowcut && lS <= lowcutslope)
|
||||
else
|
||||
{
|
||||
l = lowcut;
|
||||
lS = lowcutslope;
|
||||
// Adjust the heights so the FOF does not overlap with top and bottom textures.
|
||||
if (h >= highcut && hS >= highcutslope)
|
||||
{
|
||||
h = highcut;
|
||||
hS = highcutslope;
|
||||
}
|
||||
if (l <= lowcut && lS <= lowcutslope)
|
||||
{
|
||||
l = lowcut;
|
||||
lS = lowcutslope;
|
||||
}
|
||||
}
|
||||
|
||||
//Hurdler: HW code starts here
|
||||
//FIXME: check if peging is correct
|
||||
// set top/bottom coords
|
||||
@@ -2758,8 +2811,8 @@ void HWR_AddLine(seg_t *line)
|
||||
}
|
||||
|
||||
// OPTIMIZE: quickly reject orthogonal back sides.
|
||||
angle1 = R_PointToAngle64(v1x, v1y);
|
||||
angle2 = R_PointToAngle64(v2x, v2y);
|
||||
angle1 = R_PointToAngleEx64(viewx, viewy, v1x, v1y);
|
||||
angle2 = R_PointToAngleEx64(viewx, viewy, v2x, v2y);
|
||||
|
||||
// do an extra culling check when rendering portals
|
||||
// check if any line vertex is on the viewable side of the portal target line
|
||||
@@ -3054,8 +3107,8 @@ boolean HWR_CheckBBox(fixed_t *bspcoord)
|
||||
if (mindist > current_bsp_culling_distance) return false;
|
||||
}
|
||||
|
||||
angle1 = R_PointToAngle64(px1, py1);
|
||||
angle2 = R_PointToAngle64(px2, py2);
|
||||
angle1 = R_PointToAngleEx64(viewx, viewy, px1, py1);
|
||||
angle2 = R_PointToAngleEx64(viewx, viewy, px2, py2);
|
||||
return gld_clipper_SafeCheckRange(angle2, angle1);
|
||||
}
|
||||
|
||||
@@ -3266,7 +3319,7 @@ void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 9 : 1); // floor shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 9 : 1); // floor shader
|
||||
blendmode |= PF_ColorMapped;
|
||||
}
|
||||
|
||||
@@ -4083,7 +4136,7 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 9 : 1); // floor shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 9 : 1); // floor shader
|
||||
}
|
||||
|
||||
HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated, false);
|
||||
@@ -4455,7 +4508,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 3); // sprite shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 10 : 3); // sprite shader
|
||||
blend |= PF_ColorMapped;
|
||||
}
|
||||
|
||||
@@ -4500,7 +4553,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 3); // sprite shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 10 : 3); // sprite shader
|
||||
blend |= PF_ColorMapped;
|
||||
}
|
||||
|
||||
@@ -4658,7 +4711,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 3); // sprite shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 10 : 3); // sprite shader
|
||||
blend |= PF_ColorMapped;
|
||||
}
|
||||
|
||||
@@ -4743,9 +4796,15 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
||||
HWR_Lighting(&Surf, lightlevel, colormap);
|
||||
}
|
||||
|
||||
if (spr->mobj->frame & FF_TRANSMASK)
|
||||
if (spr->mobj->flags2 & MF2_SHADOW)
|
||||
{
|
||||
Surf.PolyColor.s.alpha = 0x40;
|
||||
blend = PF_Translucent;
|
||||
}
|
||||
else if (spr->mobj->frame & FF_TRANSMASK)
|
||||
blend = HWR_TranstableToAlpha((spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT, &Surf);
|
||||
else
|
||||
|
||||
{
|
||||
// BP: i agree that is little better in environement but it don't
|
||||
// work properly under glide nor with fogcolor to ffffff :(
|
||||
@@ -4757,7 +4816,7 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 3); // sprite shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 10 : 3); // sprite shader
|
||||
blend |= PF_ColorMapped;
|
||||
}
|
||||
|
||||
@@ -5026,7 +5085,7 @@ void HWR_RenderDrawNodes(void)
|
||||
{
|
||||
planeinfo_t *plane = &drawnode->u.plane;
|
||||
|
||||
// We aren't traversing the BSP tree, so make gl_frontsector null to avoid crashes.
|
||||
// We aren't traversing the BSP tree, so make gr_frontsector null to avoid crashes.
|
||||
gr_frontsector = NULL;
|
||||
|
||||
if (!(plane->blend & PF_NoTexture))
|
||||
@@ -5038,7 +5097,7 @@ void HWR_RenderDrawNodes(void)
|
||||
{
|
||||
polyplaneinfo_t *polyplane = &drawnode->u.polyplane;
|
||||
|
||||
// We aren't traversing the BSP tree, so make gl_frontsector null to avoid crashes.
|
||||
// We aren't traversing the BSP tree, so make gr_frontsector null to avoid crashes.
|
||||
gr_frontsector = NULL;
|
||||
|
||||
if (!(polyplane->blend & PF_NoTexture))
|
||||
@@ -5902,8 +5961,8 @@ void HWR_PortalClipping(portal_t *portal)
|
||||
|
||||
line_t *line = &lines[portal->clipline];
|
||||
|
||||
angle1 = R_PointToAngleEx(viewx, viewy, line->v1->x, line->v1->y);
|
||||
angle2 = R_PointToAngleEx(viewx, viewy, line->v2->x, line->v2->y);
|
||||
angle1 = R_PointToAngleEx64(viewx, viewy, line->v1->x, line->v1->y);
|
||||
angle2 = R_PointToAngleEx64(viewx, viewy, line->v2->x, line->v2->y);
|
||||
|
||||
// clip things that are not inside the portal window from our viewpoint
|
||||
gld_clipper_SafeAddClipRange(angle2, angle1);
|
||||
@@ -6304,6 +6363,7 @@ void HWR_AddCommands(void)
|
||||
CV_RegisterVar(&cv_grsolvetjoin);
|
||||
|
||||
CV_RegisterVar(&cv_grbatching);
|
||||
CV_RegisterVar(&cv_grfofcut);
|
||||
CV_RegisterVar(&cv_grscreentextures);
|
||||
CV_RegisterVar(&cv_grrenderdistance);
|
||||
|
||||
@@ -6406,7 +6466,7 @@ void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend,
|
||||
{
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 2); // wall shader
|
||||
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 10 : 2); // wall shader
|
||||
blendmode |= PF_ColorMapped;
|
||||
}
|
||||
}
|
||||
@@ -6442,7 +6502,7 @@ void HWR_DoPostProcessor(player_t *player)
|
||||
|
||||
// Armageddon Blast Flash!
|
||||
// Could this even be considered postprocessor?
|
||||
if ((player->flashcount && !cv_grpaletteshader.value) || (player->flashcount && cv_grpaletteshader.value && !cv_grflashpal.value))
|
||||
if ((player->flashcount) && !(HWR_ShouldUsePaletteRendering() && cv_grflashpal.value))
|
||||
{
|
||||
FOutVector v[4];
|
||||
FSurfaceInfo Surf;
|
||||
@@ -6569,7 +6629,7 @@ void HWR_MakeScreenFinalTexture(void)
|
||||
|
||||
void HWR_DrawScreenFinalTexture(int width, int height)
|
||||
{
|
||||
if (gr_use_palette_shader)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
HWD.pfnSetShader(11); //post processing
|
||||
HWD.pfnDrawScreenFinalTexture(width, height);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ void HWR_ProcessSeg(void); // Sort of like GLWall::Process in GZDoom
|
||||
void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
|
||||
void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blendmode, INT32 lightlevel, extracolormap_t *wallcolormap);
|
||||
void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo * pSurf, INT32 texnum, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
|
||||
void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor, FBITFIELD polyflags);
|
||||
static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor, FBITFIELD polyflags);
|
||||
void HWR_DrawSkyWall(FOutVector *wallVerts, FSurfaceInfo *Surf);
|
||||
void HWR_DrawSkyBackground(float fpov);
|
||||
|
||||
@@ -162,6 +162,7 @@ void HWR_CorrectSWTricks(void);
|
||||
|
||||
// Console variables
|
||||
extern consvar_t cv_grshaders;
|
||||
extern consvar_t cv_grfofcut;
|
||||
extern consvar_t cv_grshearing;
|
||||
extern consvar_t cv_grfov;
|
||||
extern consvar_t cv_grmdls;
|
||||
|
||||
@@ -629,7 +629,6 @@ static boolean gl_shaderprogramchanged = true;
|
||||
static boolean gl_batching = false;// are we currently collecting batches?
|
||||
|
||||
static GLint gl_palette[768];
|
||||
static INT32 gl_use_palette_shader = 0;
|
||||
boolean gl_palette_initialized = false;
|
||||
|
||||
static INT32 gl_enable_screen_textures = 1;
|
||||
@@ -1251,7 +1250,7 @@ EXPORT boolean HWRAPI(InitCustomShaders) (void)
|
||||
KillShaders();
|
||||
return LoadShaders();
|
||||
|
||||
if (gl_use_palette_shader)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
InitPalette(0, false);
|
||||
}
|
||||
@@ -2369,10 +2368,10 @@ static int comparePolygons(const void *p1, const void *p2)
|
||||
diff = poly1->texNum - poly2->texNum;
|
||||
if (diff != 0) return diff;
|
||||
|
||||
if (gl_use_palette_shader)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
diff = poly1->surf.LightTableId - poly2->surf.LightTableId;
|
||||
if (diff != 0) return diff;
|
||||
diff = poly1->surf.LightTableId - poly2->surf.LightTableId;
|
||||
if (diff != 0) return diff;
|
||||
}
|
||||
|
||||
diff = poly1->polyFlags - poly2->polyFlags;
|
||||
@@ -2512,7 +2511,7 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i
|
||||
if (gl_allowshaders)
|
||||
{
|
||||
Shader_Load(¤tSurfaceInfo, &firstPoly, &firstTint, &firstFade);
|
||||
if (gl_use_palette_shader)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
pglActiveTexture(GL_TEXTURE2);// this stuff could be done better but gonna do it quick like this for now
|
||||
pglBindTexture(GL_TEXTURE_2D, currentSurfaceInfo.LightTableId);
|
||||
@@ -2629,7 +2628,7 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i
|
||||
changeState = true;
|
||||
changePolyFlags = true;
|
||||
}
|
||||
if ((gl_allowshaders) && (gl_use_palette_shader))
|
||||
if ((gl_allowshaders) && (HWR_ShouldUsePaletteRendering()))
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||
currentSurfaceInfo.TintColor.rgba != nextSurfaceInfo.TintColor.rgba ||
|
||||
@@ -2643,7 +2642,7 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i
|
||||
changeSurfaceInfo = true;
|
||||
}
|
||||
}
|
||||
else if ((gl_allowshaders) && (!gl_use_palette_shader))
|
||||
else if ((gl_allowshaders) && (!HWR_ShouldUsePaletteRendering()))
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||
currentSurfaceInfo.TintColor.rgba != nextSurfaceInfo.TintColor.rgba ||
|
||||
@@ -2774,7 +2773,7 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i
|
||||
|
||||
Shader_Load(&nextSurfaceInfo, &poly, &tint, &fade);
|
||||
|
||||
if (gl_use_palette_shader)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
pglActiveTexture(GL_TEXTURE2);// this stuff could be done better but gonna do it quick like this for now
|
||||
pglBindTexture(GL_TEXTURE_2D, nextSurfaceInfo.LightTableId);
|
||||
@@ -2885,7 +2884,7 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI
|
||||
fade.alpha = byte2float[pSurf->FadeColor.s.alpha];
|
||||
}
|
||||
|
||||
if (gl_use_palette_shader && gl_allowshaders)
|
||||
if (HWR_ShouldUsePaletteRendering() && gl_allowshaders)
|
||||
{
|
||||
pglActiveTexture(GL_TEXTURE2);
|
||||
pglBindTexture(GL_TEXTURE_2D, pSurf->LightTableId);
|
||||
@@ -3233,10 +3232,6 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case HWD_SET_PALETTE_SHADER_ENABLED:
|
||||
gl_use_palette_shader = Value;
|
||||
break;
|
||||
|
||||
case HWD_SET_TEXTUREFILTERMODE:
|
||||
switch (Value)
|
||||
@@ -4309,7 +4304,7 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int width, int height)
|
||||
// prepare shader, if it is enabled
|
||||
Shader_SetUniforms(NULL, NULL, NULL, NULL);
|
||||
|
||||
if (gl_use_palette_shader && cv_grshaders.value)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
pglUseProgram(gl_shaderprograms[8].program); // palette shader
|
||||
pglActiveTexture(GL_TEXTURE1);
|
||||
@@ -4323,7 +4318,7 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int width, int height)
|
||||
|
||||
tex_downloaded = finalScreenTexture;
|
||||
|
||||
if (gl_use_palette_shader && cv_grshaders.value)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
pglUseProgram(0);
|
||||
pglActiveTexture(GL_TEXTURE0);
|
||||
|
||||
@@ -87,9 +87,13 @@ Printf_url (const char *url)
|
||||
{
|
||||
boolean startup;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
I_lock_mutex(&con_mutex);
|
||||
startup = con_startup;
|
||||
I_unlock_mutex(con_mutex);
|
||||
#else
|
||||
startup = con_startup;
|
||||
#endif
|
||||
|
||||
if (cv_masterserver_debug.value)
|
||||
(startup ? I_OutputMsg : CONS_Printf)(
|
||||
|
||||
+9
-2
@@ -79,19 +79,24 @@ typedef struct
|
||||
char data[MAXPACKETLENGTH];
|
||||
} ATTRPACK doomcom_t;
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
typedef struct
|
||||
{
|
||||
INT32 magic;
|
||||
INT32 addr;
|
||||
INT16 port;
|
||||
} ATTRPACK holepunch_t;
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
extern doomcom_t *doomcom;
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
extern holepunch_t *holepunchpacket;
|
||||
#endif
|
||||
|
||||
/** \brief return packet in doomcom struct
|
||||
*/
|
||||
@@ -152,12 +157,14 @@ extern void (*I_NetCloseSocket)(void);
|
||||
|
||||
/** \brief send a hole punching request
|
||||
*/
|
||||
#ifdef HOLEPUNCH
|
||||
extern void (*I_NetRequestHolePunch)(INT32 node);
|
||||
|
||||
#endif
|
||||
/** \brief register this machine on the hole punching server
|
||||
*/
|
||||
#ifdef HOLEPUNCH
|
||||
extern void (*I_NetRegisterHolePunch)(void);
|
||||
|
||||
#endif
|
||||
|
||||
extern boolean (*I_Ban) (INT32 node);
|
||||
extern void (*I_ClearBans)(void);
|
||||
|
||||
@@ -369,6 +369,4 @@ const char *I_ClipboardPaste(void);
|
||||
|
||||
void I_RegisterSysCommands(void);
|
||||
|
||||
void I_CursedWindowMovement(int xd, int yd);
|
||||
|
||||
#endif
|
||||
+15
-2
@@ -201,8 +201,10 @@ static size_t broadcastaddresses = 0;
|
||||
static boolean nodeconnected[MAXNETNODES+1];
|
||||
static banned_t *banned;
|
||||
/* See ../doc/Holepunch-Protocol.txt */
|
||||
#ifdef HOLEPUNCH
|
||||
static const INT32 hole_punch_magic = MSBF_LONG (0x52eb11);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static size_t numbans = 0;
|
||||
static size_t banned_size = 0;
|
||||
@@ -609,8 +611,10 @@ is_external_address (UINT32 p)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
static boolean hole_punch(ssize_t c)
|
||||
{
|
||||
|
||||
/* See ../doc/Holepunch-Protocol.txt */
|
||||
if (cv_rendezvousserver.string[0] &&
|
||||
c == 10 && holepunchpacket->magic == hole_punch_magic &&
|
||||
@@ -631,7 +635,9 @@ static boolean hole_punch(ssize_t c)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
// Returns true if a packet was received from a new node, false in all other cases
|
||||
static boolean SOCK_Get(void)
|
||||
@@ -655,11 +661,12 @@ static boolean SOCK_Get(void)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
if (hole_punch(c))
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
// find remote node number
|
||||
for (j = 1; j <= MAXNETNODES; j++) //include LAN
|
||||
@@ -1363,7 +1370,7 @@ static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port)
|
||||
}
|
||||
|
||||
/* See ../doc/Holepunch-Protocol.txt */
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
static void rendezvous(int size)
|
||||
{
|
||||
char *addrs = strdup(cv_rendezvousserver.string);
|
||||
@@ -1391,7 +1398,9 @@ static void rendezvous(int size)
|
||||
|
||||
if (tic == refreshtic)
|
||||
{
|
||||
#ifdef HOLEPUNCH
|
||||
holepunchpacket->magic = hole_punch_magic;
|
||||
#endif
|
||||
sendto(mysockets[0], doomcom->data, size, 0, &rzv.any, sizeof rzv.ip4);
|
||||
}
|
||||
|
||||
@@ -1417,6 +1426,8 @@ static void SOCK_RegisterHolePunch(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
static boolean SOCK_OpenSocket(void)
|
||||
{
|
||||
#ifndef NONET
|
||||
@@ -1439,9 +1450,11 @@ static boolean SOCK_OpenSocket(void)
|
||||
I_NetCanSend = SOCK_CanSend;
|
||||
I_NetCanGet = SOCK_CanGet;
|
||||
#endif
|
||||
#ifdef HOLEPUNCH
|
||||
|
||||
I_NetRequestHolePunch = SOCK_RequestHolePunch;
|
||||
I_NetRegisterHolePunch = SOCK_RegisterHolePunch;
|
||||
#endif
|
||||
|
||||
// build the socket but close it first
|
||||
SOCK_CloseSocket();
|
||||
|
||||
+257
-17
@@ -8,6 +8,7 @@
|
||||
#include "hu_stuff.h"
|
||||
#include "g_game.h"
|
||||
#include "m_random.h"
|
||||
#include "m_menu.h" // ffdhidshfuisduifigergho9igj89dgodhfih AAAAAAAAAA
|
||||
#include "p_local.h"
|
||||
#include "p_slopes.h"
|
||||
#include "r_draw.h"
|
||||
@@ -54,18 +55,22 @@ consvar_t cv_mini_yoffset = {"hud_minimap_yoffset", "0", CV_SAVE, NULL, NULL, 0,
|
||||
consvar_t cv_want_xoffset = {"hud_wanted_xoffset", "0", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_want_yoffset = {"hud_wanted_yoffset", "0", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_stat_xoffset = {"hud_stat_xoffset", "0", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_stat_yoffset = {"hud_stat_yoffset", "0", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_showstats = {"showstats", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_showinput = {"showinput", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_newspeedometer = {"newspeedometer", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t speedo_cons_t[] = {{0, "Default"}, {1, "Small"}, {2, "PMeter"}};
|
||||
consvar_t cv_newspeedometer = {"newspeedometer", "Default", CV_SAVE, speedo_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_saltyhop = {"hardcodehop", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_saltyhopsfx = {"hardcodehopsfx", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_saltysquish = {"hardcodehopsquish", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
//Colourized HUD
|
||||
consvar_t cv_colorizedhud = {"colorizedhud", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_colorizedhud = {"colorizedhud", "Off", CV_SAVE|CV_CALL, CV_OnOff, Saturn_menu_Onchange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_colorizeditembox = {"colorizeditembox", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
||||
static CV_PossibleValue_t HudColor_cons_t[MAXSKINCOLORS+1];
|
||||
consvar_t cv_colorizedhudcolor = {"colorizedhudcolor", "Skin Color", CV_SAVE, HudColor_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -587,11 +592,13 @@ UINT8 K_GetKartColorByName(const char *name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT8 K_GetHudColor()
|
||||
UINT8 K_GetHudColor(void)
|
||||
{
|
||||
if (stplyr && players - stplyr != consoleplayer) return stplyr->skincolor;
|
||||
if (cv_colorizedhudcolor.value) return cv_colorizedhudcolor.value;
|
||||
return cv_playercolor.value;
|
||||
if (cv_colorizedhud.value){
|
||||
if (cv_colorizedhudcolor.value) return cv_colorizedhudcolor.value;
|
||||
}
|
||||
return (stplyr ? stplyr->skincolor : cv_playercolor.value);
|
||||
}
|
||||
|
||||
//}
|
||||
@@ -679,10 +686,14 @@ void K_RegisterKartStuff(void)
|
||||
CV_RegisterVar(&cv_mini_yoffset);
|
||||
CV_RegisterVar(&cv_want_xoffset);
|
||||
CV_RegisterVar(&cv_want_yoffset);
|
||||
CV_RegisterVar(&cv_stat_xoffset);
|
||||
CV_RegisterVar(&cv_stat_yoffset);
|
||||
|
||||
CV_RegisterVar(&cv_showstats);
|
||||
CV_RegisterVar(&cv_showinput);
|
||||
CV_RegisterVar(&cv_newspeedometer);
|
||||
|
||||
|
||||
CV_RegisterVar(&cv_saltyhop);
|
||||
CV_RegisterVar(&cv_saltyhopsfx);
|
||||
CV_RegisterVar(&cv_saltysquish);
|
||||
@@ -6007,7 +6018,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||
P_SetScale(overlay, player->mo->scale);
|
||||
}
|
||||
player->kartstuff[k_invincibilitytimer] = itemtime+(2*TICRATE); // 10 seconds
|
||||
if (P_IsLocalPlayer(player))
|
||||
if (P_IsLocalPlayer(player) && cv_supermusic.value)
|
||||
S_ChangeMusicSpecial("kinvnc");
|
||||
else
|
||||
S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmi : sfx_kinvnc));
|
||||
@@ -6212,7 +6223,7 @@ 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
|
||||
if (P_IsLocalPlayer(player))
|
||||
if (P_IsLocalPlayer(player) && cv_growmusic.value)
|
||||
S_ChangeMusicSpecial("kgrow");
|
||||
else
|
||||
S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmg : sfx_kgrow));
|
||||
@@ -6944,6 +6955,10 @@ static patch_t *skp_smallstickerclr;
|
||||
static patch_t *kp_itemmulstickerclr[2];
|
||||
static patch_t *kp_itembgclr[4];
|
||||
|
||||
|
||||
//Kartz speedo
|
||||
static patch_t *kp_kartzspeedo[25];
|
||||
|
||||
static patch_t *kp_startcountdown[16];
|
||||
static patch_t *kp_racefinish[6];
|
||||
|
||||
@@ -7060,8 +7075,41 @@ void K_LoadKartHUDGraphics(void)
|
||||
if (snw_speedo){
|
||||
skp_smallstickerclr = W_CachePatchName("SC_SMSTC", PU_HUDGFX);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//KartZ speedo
|
||||
if (kartzspeedo){
|
||||
|
||||
kp_kartzspeedo[0] = W_CachePatchName("K_KZSP1", PU_HUDGFX);
|
||||
kp_kartzspeedo[1] = W_CachePatchName("K_KZSP2", PU_HUDGFX);
|
||||
kp_kartzspeedo[2] = W_CachePatchName("K_KZSP3", PU_HUDGFX);
|
||||
kp_kartzspeedo[3] = W_CachePatchName("K_KZSP4", PU_HUDGFX);
|
||||
kp_kartzspeedo[4] = W_CachePatchName("K_KZSP5", PU_HUDGFX);
|
||||
kp_kartzspeedo[5] = W_CachePatchName("K_KZSP6", PU_HUDGFX);
|
||||
kp_kartzspeedo[6] = W_CachePatchName("K_KZSP7", PU_HUDGFX);
|
||||
kp_kartzspeedo[7] = W_CachePatchName("K_KZSP8", PU_HUDGFX);
|
||||
kp_kartzspeedo[8] = W_CachePatchName("K_KZSP9", PU_HUDGFX);
|
||||
kp_kartzspeedo[9] = W_CachePatchName("K_KZSP10", PU_HUDGFX);
|
||||
kp_kartzspeedo[10] = W_CachePatchName("K_KZSP11", PU_HUDGFX);
|
||||
kp_kartzspeedo[11] = W_CachePatchName("K_KZSP12", PU_HUDGFX);
|
||||
kp_kartzspeedo[12] = W_CachePatchName("K_KZSP13", PU_HUDGFX);
|
||||
kp_kartzspeedo[13] = W_CachePatchName("K_KZSP14", PU_HUDGFX);
|
||||
kp_kartzspeedo[14] = W_CachePatchName("K_KZSP15", PU_HUDGFX);
|
||||
kp_kartzspeedo[15] = W_CachePatchName("K_KZSP16", PU_HUDGFX);
|
||||
kp_kartzspeedo[16] = W_CachePatchName("K_KZSP17", PU_HUDGFX);
|
||||
kp_kartzspeedo[17] = W_CachePatchName("K_KZSP18", PU_HUDGFX);
|
||||
kp_kartzspeedo[18] = W_CachePatchName("K_KZSP19", PU_HUDGFX);
|
||||
kp_kartzspeedo[19] = W_CachePatchName("K_KZSP20", PU_HUDGFX);
|
||||
kp_kartzspeedo[20] = W_CachePatchName("K_KZSP21", PU_HUDGFX);
|
||||
kp_kartzspeedo[21] = W_CachePatchName("K_KZSP22", PU_HUDGFX);
|
||||
kp_kartzspeedo[22] = W_CachePatchName("K_KZSP23", PU_HUDGFX);
|
||||
kp_kartzspeedo[23] = W_CachePatchName("K_KZSP24", PU_HUDGFX);
|
||||
kp_kartzspeedo[24] = W_CachePatchName("K_KZSP25", PU_HUDGFX);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Starting countdown
|
||||
kp_startcountdown[0] = W_CachePatchName("K_CNT3A", PU_HUDGFX);
|
||||
kp_startcountdown[1] = W_CachePatchName("K_CNT2A", PU_HUDGFX);
|
||||
@@ -7531,6 +7579,118 @@ INT32 K_calcSplitFlags(INT32 snapflags)
|
||||
return (splitflags|snapflags);
|
||||
}
|
||||
|
||||
static void K_drawKartStats(void)
|
||||
{
|
||||
INT32 x, y, spdoffset, flags;
|
||||
|
||||
// For 1-player display
|
||||
x = 15;
|
||||
y = 150;
|
||||
spdoffset = 0;
|
||||
flags = V_SNAPTOBOTTOM|V_SNAPTOLEFT;
|
||||
|
||||
UINT8 splitnum = 0;
|
||||
|
||||
for (; splitnum < MAXSPLITSCREENPLAYERS; ++splitnum)
|
||||
{
|
||||
if (stplyr == &players[displayplayers[splitnum]])
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (!LUA_HudEnabled(hud_statdisplay))
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
||||
// I tried my best, but this is still mess :/
|
||||
if (splitscreen)
|
||||
{
|
||||
if (splitscreen == 1)
|
||||
{
|
||||
// If we are in 2-player splitscreen, for player 1 we move hud to up and remove snapping
|
||||
// to bottom
|
||||
if (splitnum == 0)
|
||||
{
|
||||
y /= 2;
|
||||
flags = V_SNAPTOLEFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Can move it down a bit
|
||||
y += 20;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// In 4-player splitscreen...
|
||||
flags = 0;
|
||||
|
||||
// ...For players 2 and 4, which are at right side, we move x coordinate...
|
||||
if (splitnum == 1 || splitnum == 3)
|
||||
x += BASEVIDWIDTH/2;
|
||||
// ...Else, for players on left side we can snap position to left...
|
||||
else
|
||||
flags |= V_SNAPTOLEFT;
|
||||
|
||||
// ...For players 1 and 2, which are at top side, we move y coordinate...
|
||||
if (splitnum == 0 || splitnum == 1)
|
||||
y /= 2;
|
||||
// ...Else, for players on bottom side we can snap position to bottom
|
||||
else
|
||||
{
|
||||
flags |= V_SNAPTOBOTTOM;
|
||||
// Can move it down a bit
|
||||
y += 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Internal offset for speedometer
|
||||
if (cv_kartspeedometer.value)
|
||||
{
|
||||
if (cv_newspeedometer.value == 1 && snw_speedo)
|
||||
spdoffset = -10;
|
||||
else
|
||||
spdoffset = -14;
|
||||
}
|
||||
else
|
||||
spdoffset = 0;
|
||||
|
||||
// Customizations c:
|
||||
x += cv_stat_xoffset.value;
|
||||
y += cv_stat_yoffset.value + (G_BattleGametype() ? (stplyr->kartstuff[k_bumper] ? -5 : -8) : 0) + spdoffset;
|
||||
flags |= V_HUDTRANS;
|
||||
|
||||
skin_t *fakeskin;
|
||||
fakeskin = &skins[stplyr->skin];
|
||||
|
||||
// local skinner
|
||||
if (stplyr->localskin)
|
||||
{
|
||||
if (stplyr->skinlocal)
|
||||
fakeskin = &localskins[stplyr->localskin - 1];
|
||||
else
|
||||
fakeskin = &skins[stplyr->localskin - 1];
|
||||
}
|
||||
|
||||
if (!splitscreen)
|
||||
{
|
||||
// Skin name
|
||||
V_DrawSmallString(x+20, y+12, flags|V_ALLOWLOWERCASE, va("%c%s", V_GetSkincolorChar(stplyr->skincolor), fakeskin->realname));
|
||||
|
||||
// Icon and stats
|
||||
V_DrawMappedPatch(x, y, flags, R_GetSkinFaceRank(stplyr), R_GetLocalTranslationColormap(fakeskin, fakeskin, stplyr->skincolor, GTC_CACHE, stplyr->skinlocal));
|
||||
V_DrawMappedPatch(x-3, y-2, flags, kp_facenum[min(9, max(1, stplyr->kartspeed))], R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_BLUEBERRY, GTC_CACHE));
|
||||
V_DrawMappedPatch(x+10, y+10, flags, kp_facenum[min(9, max(1, stplyr->kartweight))], R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_BURGUNDY, GTC_CACHE));
|
||||
}
|
||||
else
|
||||
{
|
||||
// In splitscreen, just draw a string with stats
|
||||
V_DrawString(x, y+10, flags, va("\x84%dS \x87%dW", stplyr->kartspeed, stplyr->kartweight));
|
||||
}
|
||||
}
|
||||
|
||||
static void K_drawKartItem(void)
|
||||
{
|
||||
// ITEM_X = BASEVIDWIDTH-50; // 270
|
||||
@@ -7856,7 +8016,7 @@ static void K_drawKartItem(void)
|
||||
V_DrawString(fx+24, fy+31, V_ALLOWLOWERCASE|V_HUDTRANS|fflags, va("x%d", stplyr->kartstuff[k_itemamount]));
|
||||
else
|
||||
{
|
||||
V_DrawScaledPatch(fy+28, fy+41, V_HUDTRANS|fflags, kp_itemx);
|
||||
V_DrawScaledPatch(fx+28, fy+41, V_HUDTRANS|fflags, kp_itemx);
|
||||
V_DrawKartString(fx+38, fy+36, V_HUDTRANS|fflags, va("%d", stplyr->kartstuff[k_itemamount]));
|
||||
}
|
||||
}
|
||||
@@ -8285,7 +8445,7 @@ static boolean K_drawKartPositionFaces(void)
|
||||
{
|
||||
player_t *p;
|
||||
p = &players[rankplayer[i]];
|
||||
V_DrawMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, ( (p->skinlocal) ? localfacerankprefix : facerankprefix )[( (p->localskin) ? p->localskin-1 : p->skin )], colormap);
|
||||
V_DrawMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, R_GetSkinFaceRank(p), colormap);
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
@@ -8375,7 +8535,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||
{
|
||||
player_t *p;
|
||||
p = &players[tab[i].num];
|
||||
V_DrawMappedPatch(x, y-4, 0, ( (p->skinlocal) ? localfacerankprefix : facerankprefix )[( (p->localskin) ? p->localskin-1 : p->skin )], colormap);
|
||||
V_DrawMappedPatch(x, y-4, 0, R_GetSkinFaceRank(p), colormap);
|
||||
}
|
||||
/*if (G_BattleGametype() && players[tab[i].num].kartstuff[k_bumper] > 0) -- not enough space for this
|
||||
{
|
||||
@@ -8497,7 +8657,7 @@ static void K_drawKartLaps(void)
|
||||
{
|
||||
|
||||
if (!cv_colorizedhud.value || !clr_hud){
|
||||
if ((cv_numlaps.value > 9) && (big_lap) && (cv_biglaps.value)){
|
||||
if ((cv_numlaps.value > 9) && (big_lap) && (cv_biglaps.value) && (!stplyr->exiting)){
|
||||
if (stplyr->laps+1 > 9)
|
||||
V_DrawScaledPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_lapstickerbig2);
|
||||
else
|
||||
@@ -8510,7 +8670,7 @@ static void K_drawKartLaps(void)
|
||||
{
|
||||
//Colourized hud
|
||||
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
|
||||
if ((cv_numlaps.value > 9) && (big_lap_color) && (cv_biglaps.value)){
|
||||
if ((cv_numlaps.value > 9) && (big_lap_color) && (cv_biglaps.value) && (!stplyr->exiting)){
|
||||
if (stplyr->laps+1 > 9)
|
||||
V_DrawMappedPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_lapstickerbig2clr, colormap);
|
||||
else
|
||||
@@ -8534,6 +8694,11 @@ static void K_drawKartSpeedometer(void)
|
||||
return;
|
||||
|
||||
fixed_t convSpeed = 0;
|
||||
|
||||
//KartZ speedo
|
||||
fixed_t fuspeed = 0;
|
||||
INT32 spdpatch = 0;
|
||||
|
||||
INT32 speedtype = 0;
|
||||
INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTOLEFT);
|
||||
|
||||
@@ -8562,7 +8727,7 @@ static void K_drawKartSpeedometer(void)
|
||||
}
|
||||
|
||||
// man.
|
||||
if ((!cv_newspeedometer.value) || (cv_newspeedometer.value && !snw_speedo))
|
||||
if ((!cv_newspeedometer.value) || (cv_newspeedometer.value == 1 && !snw_speedo) || (cv_newspeedometer.value == 2 && !kartzspeedo) )
|
||||
{
|
||||
switch (speedtype) {
|
||||
case 1:
|
||||
@@ -8581,7 +8746,7 @@ static void K_drawKartSpeedometer(void)
|
||||
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%4d %%", convSpeed));
|
||||
}
|
||||
}
|
||||
else if (cv_newspeedometer.value && snw_speedo) { // why bother if we dont?
|
||||
else if (cv_newspeedometer.value == 1 && snw_speedo ) { // why bother if we dont?
|
||||
if (!cv_colorizedhud.value || !clr_hud)
|
||||
V_DrawScaledPatch(SPDM_X + 1, SPDM_Y + 4, (V_HUDTRANS|splitflags), (skp_smallsticker));
|
||||
else
|
||||
@@ -8595,7 +8760,76 @@ static void K_drawKartSpeedometer(void)
|
||||
V_DrawRankNum(SPDM_X + 26, SPDM_Y + 4, V_HUDTRANS|splitflags, convSpeed, 3, NULL);
|
||||
|
||||
V_DrawScaledPatch(SPDM_X + 31, SPDM_Y + 4, V_HUDTRANS|splitflags, skp_speedpatches[cv_kartspeedometer.value]);
|
||||
|
||||
|
||||
}
|
||||
// Kart Z speedo bullshit...
|
||||
// Draw the Speed counter.
|
||||
// Warning large if statement below...
|
||||
else if (cv_newspeedometer.value == 2 && kartzspeedo){
|
||||
|
||||
fuspeed = FixedDiv(stplyr->speed, mapobjectscale)/FRACUNIT;
|
||||
|
||||
if (fuspeed < 2 && fuspeed > 0)
|
||||
spdpatch = 0;
|
||||
else if (fuspeed < 5 && fuspeed > 1)
|
||||
spdpatch = 1;
|
||||
else if (fuspeed < 7 && fuspeed > 4)
|
||||
spdpatch = 2;
|
||||
else if (fuspeed < 10 && fuspeed > 6)
|
||||
spdpatch = 3;
|
||||
else if (fuspeed < 12 && fuspeed > 9)
|
||||
spdpatch = 4;
|
||||
else if (fuspeed < 15 && fuspeed > 11)
|
||||
spdpatch = 5;
|
||||
else if (fuspeed < 17 && fuspeed > 14)
|
||||
spdpatch = 6;
|
||||
else if (fuspeed < 20 && fuspeed > 16)
|
||||
spdpatch = 7;
|
||||
else if (fuspeed < 22 && fuspeed > 19)
|
||||
spdpatch = 8;
|
||||
else if (fuspeed < 25 && fuspeed > 21)
|
||||
spdpatch = 9;
|
||||
else if (fuspeed < 27 && fuspeed > 24)
|
||||
spdpatch = 10;
|
||||
else if (fuspeed < 30 && fuspeed > 26)
|
||||
spdpatch = 11;
|
||||
else if (fuspeed < 32 && fuspeed > 29)
|
||||
spdpatch = 12;
|
||||
else if (fuspeed < 35 && fuspeed > 31)
|
||||
spdpatch = 13;
|
||||
else if (fuspeed < 37 && fuspeed > 34)
|
||||
spdpatch = 14;
|
||||
else if (fuspeed < 40 && fuspeed > 36)
|
||||
spdpatch = 15;
|
||||
else if (fuspeed < 42 && fuspeed > 39)
|
||||
spdpatch = 16;
|
||||
else if (fuspeed < 45 && fuspeed > 41)
|
||||
spdpatch = 17;
|
||||
else if (fuspeed < 47 && fuspeed > 44)
|
||||
spdpatch = 18;
|
||||
else if (fuspeed < 50 && fuspeed > 46)
|
||||
spdpatch = 19;
|
||||
else if (fuspeed < 52 && fuspeed > 49)
|
||||
spdpatch = 20;
|
||||
else if (fuspeed < 55 && fuspeed > 51)
|
||||
spdpatch = 21;
|
||||
else if (fuspeed < 57 && fuspeed > 54 && (leveltime&4))
|
||||
spdpatch = 24;
|
||||
else if (fuspeed < 57 && fuspeed > 54 && !(leveltime&4))
|
||||
spdpatch = 23;
|
||||
else if (fuspeed < 60 && fuspeed > 56 && (leveltime&4))
|
||||
spdpatch = 24;
|
||||
else if (fuspeed < 60 && fuspeed > 56 && !(leveltime&4))
|
||||
spdpatch = 23;
|
||||
else if (fuspeed > 59 && (leveltime&4))
|
||||
spdpatch = 24;
|
||||
else if (fuspeed > 59 && !(leveltime&4))
|
||||
spdpatch = 23;
|
||||
|
||||
|
||||
V_DrawScaledPatch(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, kp_kartzspeedo[spdpatch]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8783,7 +9017,7 @@ static void K_drawKartWanted(void)
|
||||
if (players[battlewanted[i]].skincolor)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, p->skincolor, GTC_CACHE);
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, V_HUDTRANS|(splitscreen < 3 ? V_SNAPTORIGHT : 0)|V_SNAPTOBOTTOM, (scale == FRACUNIT ? ( (p->skinlocal) ? localfacewantprefix : facewantprefix )[( (p->localskin) ? p->localskin-1 : p->skin )] : ( (p->skinlocal) ? localfacerankprefix : facerankprefix )[( (p->localskin) ? p->localskin-1 : p->skin )]), colormap);
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, V_HUDTRANS|(splitscreen < 3 ? V_SNAPTORIGHT : 0)|V_SNAPTOBOTTOM, (scale == FRACUNIT ? R_GetSkinFaceWant(p) : R_GetSkinFaceRank(p)), colormap);
|
||||
/*if (basey2) // again with 4p stuff
|
||||
V_DrawFixedPatch(x<<FRACBITS, (y - (basey-basey2))<<FRACBITS, FRACUNIT, V_HUDTRANS|V_SNAPTOTOP, (scale == FRACUNIT ? facewantprefix[p->skin] : facerankprefix[p->skin]), colormap);*/
|
||||
}
|
||||
@@ -9809,6 +10043,12 @@ void K_drawKartHUD(void)
|
||||
#endif
|
||||
K_drawInput();
|
||||
|
||||
if (!demo.title && cv_showstats.value)
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_statdisplay))
|
||||
#endif
|
||||
K_drawKartStats();
|
||||
|
||||
if (demo.title) // Draw title logo instead in demo.titles
|
||||
{
|
||||
INT32 x = BASEVIDWIDTH - 32, y = 128, offs;
|
||||
|
||||
+4
-1
@@ -17,7 +17,7 @@ extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
|
||||
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
|
||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color, boolean local);
|
||||
UINT8 K_GetKartColorByName(const char *name);
|
||||
UINT8 K_GetHudColor();
|
||||
UINT8 K_GetHudColor(void);
|
||||
|
||||
void K_RegisterKartStuff(void);
|
||||
|
||||
@@ -26,6 +26,9 @@ extern consvar_t cv_colorizeditembox;
|
||||
extern consvar_t cv_colorizedhudcolor;
|
||||
extern consvar_t cv_darkitembox;
|
||||
extern consvar_t cv_biglaps;
|
||||
extern consvar_t cv_stat_xoffset;
|
||||
extern consvar_t cv_stat_yoffset;
|
||||
extern consvar_t cv_showstats;
|
||||
|
||||
boolean K_IsPlayerLosing(player_t *player);
|
||||
boolean K_IsPlayerWanted(player_t *player);
|
||||
|
||||
@@ -31,6 +31,7 @@ enum hud {
|
||||
hud_battlecomebacktimer, // comeback timer in battlefullscreen. separated for ease of use.
|
||||
hud_wanted,
|
||||
hud_speedometer,
|
||||
hud_statdisplay,
|
||||
hud_freeplay,
|
||||
hud_rankings, // Tab rankings
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ static const char *const hud_disable_options[] = {
|
||||
"battlecomebacktimer", // come back timer in battlefullscreen
|
||||
"wanted",
|
||||
"speedometer",
|
||||
"statdisplay",
|
||||
"freeplay",
|
||||
"rankings",
|
||||
NULL};
|
||||
|
||||
+656
-68
File diff suppressed because it is too large.
Load diff
@@ -147,6 +147,8 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt);
|
||||
|
||||
#define MAXSTRINGLENGTH 32
|
||||
|
||||
#define MAXTOOLTIPS 255
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct menu_s *submenu; // IT_SUBMENU
|
||||
@@ -184,6 +186,7 @@ typedef struct menu_s
|
||||
INT16 x, y; // x, y of menu
|
||||
INT16 lastOn; // last item user was on in menu
|
||||
boolean (*quitroutine)(void); // called before quit a menu return true if we can
|
||||
const char* tooltips[MAXTOOLTIPS]; // tooltips! give me that info bitch
|
||||
} menu_t;
|
||||
|
||||
void M_SetupNextMenu(menu_t *menudef);
|
||||
@@ -269,6 +272,9 @@ void PDistort_menu_Onchange(void);
|
||||
// Bird menu updating
|
||||
void Bird_menu_Onchange(void);
|
||||
|
||||
// Saturn menu updating
|
||||
void Saturn_menu_Onchange(void);
|
||||
|
||||
void M_ReplayHut(INT32 choice);
|
||||
void M_SetPlaybackMenuPointer(void);
|
||||
|
||||
@@ -288,6 +294,20 @@ void M_PopupMasterServerRules(void);
|
||||
M_DrawGenericMenu,\
|
||||
x, y,\
|
||||
0,\
|
||||
NULL,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define DEFAULTSCROLLSTYLE(header, source, prev, x, y)\
|
||||
{\
|
||||
header,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
prev,\
|
||||
source,\
|
||||
M_DrawGenericScrollMenu,\
|
||||
x, y,\
|
||||
0,\
|
||||
NULL,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
@@ -300,6 +320,7 @@ void M_PopupMasterServerRules(void);
|
||||
M_DrawPauseMenu,\
|
||||
x, y,\
|
||||
0,\
|
||||
NULL,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
@@ -312,6 +333,7 @@ void M_PopupMasterServerRules(void);
|
||||
M_DrawCenteredMenu,\
|
||||
BASEVIDWIDTH/2, y,\
|
||||
0,\
|
||||
NULL,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
@@ -324,6 +346,7 @@ void M_PopupMasterServerRules(void);
|
||||
M_DrawServerMenu,\
|
||||
24,40,\
|
||||
0,\
|
||||
NULL,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
@@ -336,6 +359,7 @@ void M_PopupMasterServerRules(void);
|
||||
M_DrawControl,\
|
||||
26, 40,\
|
||||
0,\
|
||||
NULL,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
@@ -348,6 +372,7 @@ void M_PopupMasterServerRules(void);
|
||||
M_DrawImageDef,\
|
||||
0, 0,\
|
||||
0,\
|
||||
NULL,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
|
||||
+26
-5
@@ -57,8 +57,12 @@ static void Command_Listserv_f(void);
|
||||
|
||||
#endif/*MASTERSERVER*/
|
||||
|
||||
|
||||
|
||||
static void Update_parameters (void);
|
||||
|
||||
#ifdef MASTERSERVER
|
||||
|
||||
static void MasterServer_OnChange(void);
|
||||
|
||||
static void Advertise_OnChange(void);
|
||||
@@ -69,16 +73,26 @@ static CV_PossibleValue_t masterserver_update_rate_cons_t[] = {
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MASTERSERVER
|
||||
consvar_t cv_masterserver = {"masterserver", "https://ms.kartkrew.org/ms/api", CV_SAVE|CV_CALL, NULL, MasterServer_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
consvar_t cv_rendezvousserver = {"holepunchserver", "relay.kartkrew.org", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
consvar_t cv_servername = {"servername", "SRB2Kart server", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Update_parameters, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_server_contact = {"server_contact", "", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Update_parameters, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifdef MASTERSERVER
|
||||
consvar_t cv_masterserver_update_rate = {"masterserver_update_rate", "15", CV_SAVE|CV_CALL|CV_NOINIT, masterserver_update_rate_cons_t, MasterClient_Ticker, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_advertise = {"advertise", "No", CV_NETVAR|CV_CALL|CV_NOINIT, CV_YesNo, Advertise_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_masterserver_nagattempts = {"masterserver_nagattempts", "5", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
|
||||
int ms_QueryId;
|
||||
@@ -98,6 +112,7 @@ UINT16 current_port = 0;
|
||||
void AddMServCommands(void)
|
||||
{
|
||||
#ifndef NONET
|
||||
#ifdef MASTERSERVER
|
||||
CV_RegisterVar(&cv_masterserver);
|
||||
CV_RegisterVar(&cv_masterserver_update_rate);
|
||||
CV_RegisterVar(&cv_masterserver_timeout);
|
||||
@@ -105,7 +120,11 @@ void AddMServCommands(void)
|
||||
CV_RegisterVar(&cv_masterserver_token);
|
||||
CV_RegisterVar(&cv_masterserver_nagattempts);
|
||||
CV_RegisterVar(&cv_advertise);
|
||||
#endif
|
||||
#ifdef HOLEPUNCH
|
||||
CV_RegisterVar(&cv_rendezvousserver);
|
||||
#endif
|
||||
|
||||
CV_RegisterVar(&cv_servername);
|
||||
CV_RegisterVar(&cv_server_contact);
|
||||
#ifdef MASTERSERVER
|
||||
@@ -548,19 +567,20 @@ Update_parameters (void)
|
||||
}
|
||||
#endif/*MASTERSERVER*/
|
||||
}
|
||||
|
||||
#ifdef MASTERSERVER
|
||||
static void MasterServer_OnChange(void)
|
||||
{
|
||||
#ifdef MASTERSERVER
|
||||
|
||||
UnregisterServer();
|
||||
|
||||
Set_api(cv_masterserver.string);
|
||||
|
||||
if (Online())
|
||||
RegisterServer();
|
||||
#endif/*MASTERSERVER*/
|
||||
}
|
||||
|
||||
}
|
||||
#endif/*MASTERSERVER*/
|
||||
#ifdef MASTERSERVER
|
||||
static void
|
||||
Advertise_OnChange(void)
|
||||
{
|
||||
@@ -596,3 +616,4 @@ Advertise_OnChange(void)
|
||||
M_PopupMasterServerRules();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+13
-4
@@ -51,18 +51,25 @@ typedef struct
|
||||
#endif
|
||||
|
||||
// ================================ GLOBALS ===============================
|
||||
|
||||
extern consvar_t cv_masterserver, cv_servername;
|
||||
#ifdef MASTERSERVER
|
||||
extern consvar_t cv_masterserver;
|
||||
#endif
|
||||
extern consvar_t cv_servername;
|
||||
extern consvar_t cv_server_contact;
|
||||
#ifdef MASTERSERVER
|
||||
extern consvar_t cv_masterserver_update_rate;
|
||||
extern consvar_t cv_masterserver_timeout;
|
||||
extern consvar_t cv_masterserver_debug;
|
||||
extern consvar_t cv_masterserver_token;
|
||||
extern consvar_t cv_rendezvousserver;
|
||||
|
||||
extern consvar_t cv_advertise;
|
||||
|
||||
extern consvar_t cv_masterserver_nagattempts;
|
||||
#endif
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
extern consvar_t cv_rendezvousserver;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
extern int ms_QueryId;
|
||||
@@ -71,7 +78,7 @@ extern I_mutex ms_QueryId_mutex;
|
||||
extern msg_server_t *ms_ServerList;
|
||||
extern I_mutex ms_ServerList_mutex;
|
||||
#endif
|
||||
|
||||
#ifdef MASTERSERVER
|
||||
void RegisterServer(void);
|
||||
void UnregisterServer(void);
|
||||
|
||||
@@ -97,3 +104,5 @@ int HMS_compare_mod_version (char *buffer, size_t size_of_buffer);
|
||||
const char * HMS_fetch_rules (char *buffer, size_t size_of_buffer);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -142,7 +142,6 @@ extern consvar_t cv_quaketilt;
|
||||
extern consvar_t cv_tiltsmoothing;
|
||||
|
||||
extern consvar_t cv_actionmovie;
|
||||
extern consvar_t cv_windowquake;
|
||||
|
||||
extern fixed_t t_cam_dist, t_cam_height, t_cam_rotate;
|
||||
extern fixed_t t_cam2_dist, t_cam2_height, t_cam2_rotate;
|
||||
|
||||
+45
-17
@@ -6063,13 +6063,22 @@ static void P_AddOverlay(mobj_t *thing)
|
||||
static void P_RemoveOverlay(mobj_t *thing)
|
||||
{
|
||||
mobj_t *mo;
|
||||
if (overlaycap == thing)
|
||||
{
|
||||
P_SetTarget(&overlaycap, thing->hnext);
|
||||
P_SetTarget(&thing->hnext, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
for (mo = overlaycap; mo; mo = mo->hnext)
|
||||
if (mo->hnext == thing)
|
||||
{
|
||||
P_SetTarget(&mo->hnext, thing->hnext);
|
||||
P_SetTarget(&thing->hnext, NULL);
|
||||
return;
|
||||
}
|
||||
{
|
||||
if (mo->hnext != thing)
|
||||
continue;
|
||||
|
||||
P_SetTarget(&mo->hnext, thing->hnext);
|
||||
P_SetTarget(&thing->hnext, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void P_RunShadows(void)
|
||||
@@ -6175,12 +6184,14 @@ static void P_RemoveShadow(mobj_t *thing)
|
||||
}
|
||||
|
||||
for (mo = shadowcap; mo; mo = mo->hnext)
|
||||
if (mo->hnext == thing)
|
||||
{
|
||||
P_SetTarget(&mo->hnext, thing->hnext);
|
||||
P_SetTarget(&thing->hnext, NULL);
|
||||
return;
|
||||
}
|
||||
{
|
||||
if (mo->hnext != thing)
|
||||
continue;
|
||||
|
||||
P_SetTarget(&mo->hnext, thing->hnext);
|
||||
P_SetTarget(&thing->hnext, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void A_BossDeath(mobj_t *mo);
|
||||
@@ -10359,7 +10370,7 @@ void P_SpawnPrecipitation(void)
|
||||
subsector_t *precipsector = NULL;
|
||||
precipmobj_t *rainmo = NULL;
|
||||
|
||||
if (dedicated || !(cv_drawdist_precip.value) || curWeather == PRECIP_NONE || curWeather == PRECIP_STORM_NORAIN) // SRB2Kart
|
||||
if (dedicated || /*!cv_precipdensity*/!cv_drawdist_precip.value || curWeather == PRECIP_NONE) // SRB2Kart
|
||||
return;
|
||||
|
||||
// Use the blockmap to narrow down our placing patterns
|
||||
@@ -10370,8 +10381,16 @@ void P_SpawnPrecipitation(void)
|
||||
|
||||
//for (j = 0; j < cv_precipdensity.value; ++j) -- density is 1 for kart always
|
||||
{
|
||||
x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||
y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||
if (cv_lessprecip.value)
|
||||
{
|
||||
x = basex*1.5 + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||
y = basey*1.5 + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||
}
|
||||
else
|
||||
{
|
||||
x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||
y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||
}
|
||||
|
||||
precipsector = R_IsPointInSubsector(x, y);
|
||||
|
||||
@@ -10402,13 +10421,22 @@ void P_SpawnPrecipitation(void)
|
||||
}
|
||||
else // everything else.
|
||||
rainmo = P_SpawnRainMobj(x, y, height, MT_RAIN);
|
||||
if (curWeather == PRECIP_BLANK)
|
||||
rainmo->precipflags |= PCF_INVISIBLE;
|
||||
|
||||
// Randomly assign a height, now that floorz is set.
|
||||
rainmo->z = M_RandomRange(rainmo->floorz>>FRACBITS, rainmo->ceilingz>>FRACBITS)<<FRACBITS;
|
||||
}
|
||||
}
|
||||
|
||||
if (curWeather == PRECIP_BLANK)
|
||||
{
|
||||
curWeather = PRECIP_RAIN;
|
||||
P_SwitchWeather(PRECIP_BLANK);
|
||||
}
|
||||
else if (curWeather == PRECIP_STORM_NORAIN)
|
||||
{
|
||||
curWeather = PRECIP_RAIN;
|
||||
P_SwitchWeather(PRECIP_STORM_NORAIN);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
+76
-17
@@ -2002,14 +2002,53 @@ void P_LinedefExecute(INT16 tag, mobj_t *actor, sector_t *caller)
|
||||
//
|
||||
void P_SwitchWeather(INT32 weathernum)
|
||||
{
|
||||
boolean purge = true;
|
||||
boolean raintype = (PRECIP_SNOW || PRECIP_RAIN || PRECIP_STORM || PRECIP_STORM_NOSTRIKES || PRECIP_BLANK);
|
||||
boolean purge = false;
|
||||
INT32 swap = 0;
|
||||
|
||||
if (weathernum == curWeather)
|
||||
return;
|
||||
|
||||
if (weathernum == raintype && curWeather == raintype)
|
||||
purge = false;
|
||||
switch (weathernum)
|
||||
{
|
||||
case PRECIP_NONE: // None
|
||||
if (curWeather == PRECIP_NONE)
|
||||
return; // Nothing to do.
|
||||
purge = true;
|
||||
break;
|
||||
case PRECIP_STORM: // Storm
|
||||
case PRECIP_STORM_NOSTRIKES: // Storm w/ no lightning
|
||||
case PRECIP_RAIN: // Rain
|
||||
if (curWeather == PRECIP_SNOW || curWeather == PRECIP_BLANK || curWeather == PRECIP_STORM_NORAIN)
|
||||
swap = PRECIP_RAIN;
|
||||
break;
|
||||
case PRECIP_SNOW: // Snow
|
||||
if (curWeather == PRECIP_SNOW)
|
||||
return; // Nothing to do.
|
||||
if (curWeather == PRECIP_RAIN || curWeather == PRECIP_STORM || curWeather == PRECIP_STORM_NOSTRIKES || curWeather == PRECIP_BLANK || curWeather == PRECIP_STORM_NORAIN)
|
||||
swap = PRECIP_SNOW; // Need to delete the other precips.
|
||||
break;
|
||||
case PRECIP_STORM_NORAIN: // Storm w/o rain
|
||||
if (curWeather == PRECIP_SNOW
|
||||
|| curWeather == PRECIP_STORM
|
||||
|| curWeather == PRECIP_STORM_NOSTRIKES
|
||||
|| curWeather == PRECIP_RAIN
|
||||
|| curWeather == PRECIP_BLANK)
|
||||
swap = PRECIP_STORM_NORAIN;
|
||||
else if (curWeather == PRECIP_STORM_NORAIN)
|
||||
return;
|
||||
break;
|
||||
case PRECIP_BLANK:
|
||||
if (curWeather == PRECIP_SNOW
|
||||
|| curWeather == PRECIP_STORM
|
||||
|| curWeather == PRECIP_STORM_NOSTRIKES
|
||||
|| curWeather == PRECIP_RAIN)
|
||||
swap = PRECIP_BLANK;
|
||||
else if (curWeather == PRECIP_STORM_NORAIN)
|
||||
swap = PRECIP_BLANK;
|
||||
else if (curWeather == PRECIP_BLANK)
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
CONS_Debug(DBG_GAMELOGIC, "P_SwitchWeather: Unknown weather type %d.\n", weathernum);
|
||||
break;
|
||||
}
|
||||
|
||||
if (purge)
|
||||
{
|
||||
@@ -2026,7 +2065,7 @@ void P_SwitchWeather(INT32 weathernum)
|
||||
P_RemovePrecipMobj(precipmobj);
|
||||
}
|
||||
}
|
||||
else // Rather than respawn all that crap, reuse it!
|
||||
else if (swap && !((swap == PRECIP_BLANK && curWeather == PRECIP_STORM_NORAIN) || (swap == PRECIP_STORM_NORAIN && curWeather == PRECIP_BLANK))) // Rather than respawn all that crap, reuse it!
|
||||
{
|
||||
thinker_t *think;
|
||||
precipmobj_t *precipmobj;
|
||||
@@ -2038,7 +2077,7 @@ void P_SwitchWeather(INT32 weathernum)
|
||||
continue; // not a precipmobj thinker
|
||||
precipmobj = (precipmobj_t *)think;
|
||||
|
||||
if (weathernum == PRECIP_RAIN || weathernum == PRECIP_STORM || weathernum == PRECIP_STORM_NOSTRIKES) // Snow To Rain
|
||||
if (swap == PRECIP_RAIN) // Snow To Rain
|
||||
{
|
||||
precipmobj->flags = mobjinfo[MT_RAIN].flags;
|
||||
st = &states[mobjinfo[MT_RAIN].spawnstate];
|
||||
@@ -2053,7 +2092,7 @@ void P_SwitchWeather(INT32 weathernum)
|
||||
precipmobj->precipflags |= PCF_RAIN;
|
||||
//think->function.acp1 = (actionf_p1)P_RainThinker;
|
||||
}
|
||||
else if (weathernum == PRECIP_SNOW) // Rain To Snow
|
||||
else if (swap == PRECIP_SNOW) // Rain To Snow
|
||||
{
|
||||
INT32 z;
|
||||
|
||||
@@ -2078,7 +2117,7 @@ void P_SwitchWeather(INT32 weathernum)
|
||||
|
||||
//think->function.acp1 = (actionf_p1)P_SnowThinker;
|
||||
}
|
||||
else // Remove precip, but keep it around for reuse.
|
||||
else if (swap == PRECIP_BLANK || swap == PRECIP_STORM_NORAIN) // Remove precip, but keep it around for reuse.
|
||||
{
|
||||
//think->function.acp1 = (actionf_p1)P_NullPrecipThinker;
|
||||
|
||||
@@ -2092,31 +2131,48 @@ void P_SwitchWeather(INT32 weathernum)
|
||||
case PRECIP_SNOW: // snow
|
||||
curWeather = PRECIP_SNOW;
|
||||
|
||||
if (purge)
|
||||
if (!swap)
|
||||
P_SpawnPrecipitation();
|
||||
|
||||
break;
|
||||
case PRECIP_RAIN: // rain
|
||||
{
|
||||
boolean dontspawn = false;
|
||||
|
||||
if (curWeather == PRECIP_RAIN || curWeather == PRECIP_STORM || curWeather == PRECIP_STORM_NOSTRIKES)
|
||||
dontspawn = true;
|
||||
|
||||
curWeather = PRECIP_RAIN;
|
||||
|
||||
if (purge)
|
||||
if (!dontspawn && !swap)
|
||||
P_SpawnPrecipitation();
|
||||
|
||||
break;
|
||||
}
|
||||
case PRECIP_STORM: // storm
|
||||
{
|
||||
boolean dontspawn = false;
|
||||
|
||||
if (curWeather == PRECIP_RAIN || curWeather == PRECIP_STORM || curWeather == PRECIP_STORM_NOSTRIKES)
|
||||
dontspawn = true;
|
||||
|
||||
curWeather = PRECIP_STORM;
|
||||
|
||||
if (purge)
|
||||
if (!dontspawn && !swap)
|
||||
P_SpawnPrecipitation();
|
||||
|
||||
break;
|
||||
}
|
||||
case PRECIP_STORM_NOSTRIKES: // storm w/o lightning
|
||||
{
|
||||
if (purge)
|
||||
boolean dontspawn = false;
|
||||
|
||||
if (curWeather == PRECIP_RAIN || curWeather == PRECIP_STORM || curWeather == PRECIP_STORM_NOSTRIKES)
|
||||
dontspawn = true;
|
||||
|
||||
curWeather = PRECIP_STORM_NOSTRIKES;
|
||||
|
||||
if (!dontspawn && !swap)
|
||||
P_SpawnPrecipitation();
|
||||
|
||||
break;
|
||||
@@ -2124,11 +2180,14 @@ void P_SwitchWeather(INT32 weathernum)
|
||||
case PRECIP_STORM_NORAIN: // storm w/o rain
|
||||
curWeather = PRECIP_STORM_NORAIN;
|
||||
|
||||
if (!swap)
|
||||
P_SpawnPrecipitation();
|
||||
|
||||
break;
|
||||
case PRECIP_BLANK: //preloaded
|
||||
case PRECIP_BLANK:
|
||||
curWeather = PRECIP_BLANK;
|
||||
|
||||
if (purge)
|
||||
if (!swap)
|
||||
P_SpawnPrecipitation();
|
||||
|
||||
break;
|
||||
|
||||
+2
-2
@@ -772,8 +772,6 @@ void P_Ticker(boolean run)
|
||||
quake.x = M_RandomRange(-ir,ir);
|
||||
quake.y = M_RandomRange(-ir,ir);
|
||||
quake.z = M_RandomRange(-ir,ir);
|
||||
if (cv_windowquake.value)
|
||||
I_CursedWindowMovement(FixedInt(quake.x), FixedInt(quake.y));
|
||||
ir >>= 2;
|
||||
ir = M_RandomRange(-ir,ir);
|
||||
if (ir < 0)
|
||||
@@ -920,6 +918,8 @@ void P_PreTicker(INT32 frames)
|
||||
// Run shield positioning
|
||||
//P_RunShields();
|
||||
P_RunOverlays();
|
||||
|
||||
P_RunShadows();
|
||||
|
||||
P_UpdateSpecials();
|
||||
P_RespawnSpecials();
|
||||
|
||||
@@ -7159,7 +7159,6 @@ consvar_t cv_quaketilt = {"quaketilt", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL,
|
||||
consvar_t cv_tiltsmoothing = {"tiltsmoothing", "32", CV_SAVE, CV_Natural, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_actionmovie = {"actionmovie", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_windowquake = {"windowquake", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
fixed_t t_cam_dist = -42;
|
||||
fixed_t t_cam_height = -42;
|
||||
|
||||
+4
-4
@@ -410,8 +410,8 @@ static void R_AddLine(seg_t *line)
|
||||
return;
|
||||
|
||||
// big room fix
|
||||
angle1 = R_PointToAngle64(line->v1->x, line->v1->y);
|
||||
angle2 = R_PointToAngle64(line->v2->x, line->v2->y);
|
||||
angle1 = R_PointToAngleEx64(viewx, viewy, line->v1->x, line->v1->y);
|
||||
angle2 = R_PointToAngleEx64(viewx, viewy, line->v2->x, line->v2->y);
|
||||
curline = line;
|
||||
|
||||
// Clip to view edges.
|
||||
@@ -613,8 +613,8 @@ static boolean R_CheckBBox(const fixed_t *bspcoord)
|
||||
check = checkcoord[boxpos];
|
||||
|
||||
// big room fix
|
||||
angle1 = R_PointToAngle64(bspcoord[check[0]], bspcoord[check[1]]) - viewangle;
|
||||
angle2 = R_PointToAngle64(bspcoord[check[2]], bspcoord[check[3]]) - viewangle;
|
||||
angle1 = R_PointToAngleEx64(viewx, viewy, bspcoord[check[0]], bspcoord[check[1]]) - viewangle;
|
||||
angle2 = R_PointToAngleEx64(viewx, viewy, bspcoord[check[2]], bspcoord[check[3]]) - viewangle;
|
||||
|
||||
if ((signed)angle1 < (signed)angle2)
|
||||
{
|
||||
|
||||
@@ -579,6 +579,33 @@ UINT8* R_GetLocalTranslationColormap(skin_t *skin, skin_t *localskin, skincolors
|
||||
return RGetTranslationColormap(( skin - skins ), color, flags, false);
|
||||
}
|
||||
|
||||
patch_t* R_GetSkinFaceRank(player_t* ply)
|
||||
{
|
||||
if (ply->skinlocal && ply->localskin)
|
||||
return localfacerankprefix[ply->localskin - 1];
|
||||
else if (ply->localskin)
|
||||
return facerankprefix[ply->localskin - 1];
|
||||
return facerankprefix[ply->skin];
|
||||
}
|
||||
|
||||
patch_t* R_GetSkinFaceWant(player_t* ply)
|
||||
{
|
||||
if (ply->skinlocal && ply->localskin)
|
||||
return localfacewantprefix[ply->localskin - 1];
|
||||
else if (ply->localskin)
|
||||
return facewantprefix[ply->localskin - 1];
|
||||
return facewantprefix[ply->skin];
|
||||
}
|
||||
|
||||
patch_t* R_GetSkinFaceMini(player_t* ply)
|
||||
{
|
||||
if (ply->skinlocal && ply->localskin)
|
||||
return localfacemmapprefix[ply->localskin - 1];
|
||||
else if (ply->localskin)
|
||||
return facemmapprefix[ply->localskin - 1];
|
||||
return facemmapprefix[ply->skin];
|
||||
}
|
||||
|
||||
/** \brief Flushes cache of translation colormaps.
|
||||
|
||||
Flushes cache of translation colormaps, but doesn't actually free the
|
||||
|
||||
@@ -117,6 +117,9 @@ extern lumpnum_t viewborderlump[8];
|
||||
void R_InitTranslationTables(void);
|
||||
UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags);
|
||||
UINT8* R_GetLocalTranslationColormap(skin_t *skin, skin_t *localskin, skincolors_t color, UINT8 flags, boolean local);
|
||||
patch_t* R_GetSkinFaceRank(player_t* ply);
|
||||
patch_t* R_GetSkinFaceWant(player_t* ply);
|
||||
patch_t* R_GetSkinFaceMini(player_t* ply);
|
||||
void R_FlushTranslationColormapCache(void);
|
||||
UINT8 R_GetColorByName(const char *name);
|
||||
|
||||
|
||||
+33
-41
@@ -37,16 +37,6 @@
|
||||
#include "hardware/hw_main.h"
|
||||
#endif
|
||||
|
||||
//profile stuff ---------------------------------------------------------
|
||||
//#define TIMING
|
||||
#ifdef TIMING
|
||||
#include "p5prof.h"
|
||||
INT64 mycount;
|
||||
INT64 mytotal = 0;
|
||||
//unsigned long nombre = 100000;
|
||||
#endif
|
||||
//profile stuff ---------------------------------------------------------
|
||||
|
||||
// Fineangles in the SCREENWIDTH wide window.
|
||||
#define FIELDOFVIEW 2048
|
||||
|
||||
@@ -197,7 +187,8 @@ consvar_t cv_flipcam4 = {"flipcam4", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo,
|
||||
consvar_t cv_shadow = {"shadow", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_shadowoffs = {"offsetshadows", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_skybox = {"skybox", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_ffloorclip = {"ffloorclip", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_ffloorclip = {"r_ffloorclip", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_spriteclip = {"r_spriteclip", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_soniccd = {"soniccd", "Off", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_allowmlook = {"allowmlook", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_showhud = {"showhud", "Yes", CV_CALL, CV_YesNo, R_SetViewSize, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -207,6 +198,7 @@ consvar_t cv_translucency = {"translucency", "On", CV_SAVE, CV_OnOff, NULL, 0, N
|
||||
consvar_t cv_drawdist = {"drawdist", "Infinite", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
//consvar_t cv_drawdist_nights = {"drawdist_nights", "2048", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE, drawdist_precip_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_lessprecip = {"lessweathereffects", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
//consvar_t cv_precipdensity = {"precipdensity", "Moderate", CV_SAVE, precipdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// cap fov, fov too high tears software apart.
|
||||
@@ -404,22 +396,6 @@ angle_t R_PointToAngle(fixed_t x, fixed_t y)
|
||||
0;
|
||||
}
|
||||
|
||||
angle_t R_PointToAngle64(INT64 x, INT64 y)
|
||||
{
|
||||
return (y -= viewy, (x -= viewx) || y) ?
|
||||
x >= 0 ?
|
||||
y >= 0 ?
|
||||
(x > y) ? tantoangle[SlopeDivEx(y,x)] : // octant 0
|
||||
ANGLE_90-tantoangle[SlopeDivEx(x,y)] : // octant 1
|
||||
x > (y = -y) ? 0-tantoangle[SlopeDivEx(y,x)] : // octant 8
|
||||
ANGLE_270+tantoangle[SlopeDivEx(x,y)] : // octant 7
|
||||
y >= 0 ? (x = -x) > y ? ANGLE_180-tantoangle[SlopeDivEx(y,x)] : // octant 3
|
||||
ANGLE_90 + tantoangle[SlopeDivEx(x,y)] : // octant 2
|
||||
(x = -x) > (y = -y) ? ANGLE_180+tantoangle[SlopeDivEx(y,x)] : // octant 4
|
||||
ANGLE_270-tantoangle[SlopeDivEx(x,y)] : // octant 5
|
||||
0;
|
||||
}
|
||||
|
||||
angle_t R_PointToAngle2(fixed_t pviewx, fixed_t pviewy, fixed_t x, fixed_t y)
|
||||
{
|
||||
return (y -= pviewy, (x -= pviewx) || y) ?
|
||||
@@ -514,6 +490,32 @@ angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1)
|
||||
0;
|
||||
}
|
||||
|
||||
angle_t R_PointToAngleEx64(INT64 x2, INT64 y2, INT64 x1, INT64 y1)
|
||||
{
|
||||
INT64 dx = x1 - x2;
|
||||
INT64 dy = y1 - y2;
|
||||
|
||||
// Check for potential overflow or underflow
|
||||
if (dx < INT64_MIN || dx > INT64_MAX || dy < INT64_MIN || dy > INT64_MAX)
|
||||
{
|
||||
x1 = (INT64)(dx / 2 + x2);
|
||||
y1 = (INT64)(dy / 2 + y2);
|
||||
}
|
||||
|
||||
return (y1 -= y2, (x1 -= x2) || y1) ?
|
||||
x1 >= 0 ?
|
||||
y1 >= 0 ?
|
||||
(x1 > y1) ? tantoangle[SlopeDivEx(y1, x1)] : // octant 0
|
||||
ANGLE_90 - tantoangle[SlopeDivEx(x1, y1)] : // octant 1
|
||||
x1 > (y1 = -y1) ? 0 - tantoangle[SlopeDivEx(y1, x1)] : // octant 8
|
||||
ANGLE_270 + tantoangle[SlopeDivEx(x1, y1)] : // octant 7
|
||||
y1 >= 0 ? (x1 = -x1) > y1 ? ANGLE_180 - tantoangle[SlopeDivEx(y1, x1)] : // octant 3
|
||||
ANGLE_90 + tantoangle[SlopeDivEx(x1, y1)] : // octant 2
|
||||
(x1 = -x1) > (y1 = -y1) ? ANGLE_180 + tantoangle[SlopeDivEx(y1, x1)] : // octant 4
|
||||
ANGLE_270 - tantoangle[SlopeDivEx(x1, y1)] : // octant 5
|
||||
0;
|
||||
}
|
||||
|
||||
//
|
||||
// R_ScaleFromGlobalAngle
|
||||
// Returns the texture mapping scale for the current line (horizontal span)
|
||||
@@ -1811,26 +1813,15 @@ void R_RenderPlayerView(player_t *player)
|
||||
|
||||
// The head node is the last node output.
|
||||
|
||||
//profile stuff ---------------------------------------------------------
|
||||
#ifdef TIMING
|
||||
mytotal = 0;
|
||||
ProfZeroTimer();
|
||||
#endif
|
||||
ps_numbspcalls.value.i = ps_numpolyobjects.value.i = ps_numdrawnodes.value.i = 0;
|
||||
PS_START_TIMING(ps_bsptime);
|
||||
R_RenderBSPNode((INT32)numnodes - 1);
|
||||
PS_STOP_TIMING(ps_bsptime);
|
||||
ps_numsprites.value.i = visspritecount;
|
||||
PS_START_TIMING(ps_sw_spritecliptime);
|
||||
R_ClipSprites();
|
||||
PS_STOP_TIMING(ps_sw_spritecliptime);
|
||||
#ifdef TIMING
|
||||
RDMSR(0x10, &mycount);
|
||||
mytotal += mycount; // 64bit add
|
||||
|
||||
CONS_Debug(DBG_RENDER, "RenderBSPNode: 0x%d %d\n", *((INT32 *)&mytotal + 1), (INT32)mytotal);
|
||||
#endif
|
||||
//profile stuff ---------------------------------------------------------
|
||||
|
||||
ps_numsprites.value.i = numvisiblesprites;
|
||||
|
||||
// PORTAL RENDERING
|
||||
PS_START_TIMING(ps_sw_portaltime);
|
||||
@@ -1916,6 +1907,7 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_drawdist);
|
||||
//CV_RegisterVar(&cv_drawdist_nights);
|
||||
CV_RegisterVar(&cv_drawdist_precip);
|
||||
CV_RegisterVar(&cv_lessprecip);
|
||||
CV_RegisterVar(&cv_fov);
|
||||
|
||||
CV_RegisterVar(&cv_chasecam);
|
||||
@@ -1926,6 +1918,7 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_shadowoffs);
|
||||
CV_RegisterVar(&cv_skybox);
|
||||
CV_RegisterVar(&cv_ffloorclip);
|
||||
CV_RegisterVar(&cv_spriteclip);
|
||||
|
||||
CV_RegisterVar(&cv_cam_dist);
|
||||
CV_RegisterVar(&cv_cam_still);
|
||||
@@ -1959,7 +1952,6 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_quaketilt);
|
||||
CV_RegisterVar(&cv_tiltsmoothing);
|
||||
CV_RegisterVar(&cv_actionmovie);
|
||||
CV_RegisterVar(&cv_windowquake);
|
||||
|
||||
CV_RegisterVar(&cv_driftsparkpulse);
|
||||
CV_RegisterVar(&cv_gravstretch);
|
||||
|
||||
+3
-3
@@ -68,9 +68,9 @@ extern lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ];
|
||||
INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node);
|
||||
INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line);
|
||||
angle_t R_PointToAngle(fixed_t x, fixed_t y);
|
||||
angle_t R_PointToAngle64(INT64 x, INT64 y);
|
||||
angle_t R_PointToAngle2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
|
||||
angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1);
|
||||
angle_t R_PointToAngleEx64(INT64 x2, INT64 y2, INT64 x1, INT64 y1);
|
||||
fixed_t R_PointToDist(fixed_t x, fixed_t y);
|
||||
fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
|
||||
angle_t R_PlayerSliptideAngle(player_t *player);
|
||||
@@ -111,9 +111,9 @@ extern consvar_t cv_homremoval;
|
||||
extern consvar_t cv_chasecam, cv_chasecam2, cv_chasecam3, cv_chasecam4;
|
||||
extern consvar_t cv_flipcam, cv_flipcam2, cv_flipcam3, cv_flipcam4;
|
||||
extern consvar_t cv_shadow, cv_shadowoffs;
|
||||
extern consvar_t cv_ffloorclip;
|
||||
extern consvar_t cv_ffloorclip, cv_spriteclip;
|
||||
extern consvar_t cv_translucency;
|
||||
extern consvar_t /*cv_precipdensity,*/ cv_drawdist, /*cv_drawdist_nights,*/ cv_drawdist_precip;
|
||||
extern consvar_t /*cv_precipdensity,*/ cv_drawdist, /*cv_drawdist_nights,*/ cv_drawdist_precip, cv_lessprecip;
|
||||
extern consvar_t cv_fov;
|
||||
extern consvar_t cv_skybox;
|
||||
extern consvar_t cv_tailspickup;
|
||||
|
||||
+1
-1
@@ -755,7 +755,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||
|
||||
if (pfloor->master->flags & ML_TFERLINE)
|
||||
{
|
||||
size_t linenum = curline->linedef-backsector->lines[0];
|
||||
size_t linenum = min(curline->linedef-backsector->lines[0], pfloor->master->frontsector->linecount);
|
||||
newline = pfloor->master->frontsector->lines[0] + linenum;
|
||||
texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture);
|
||||
}
|
||||
|
||||
+84
-15
@@ -589,7 +589,8 @@ void R_DelSpriteDefs(UINT16 wadnum)
|
||||
//
|
||||
// GAME FUNCTIONS
|
||||
//
|
||||
UINT32 visspritecount;
|
||||
UINT32 visspritecount, numvisiblesprites;
|
||||
|
||||
static UINT32 clippedvissprites;
|
||||
static vissprite_t *visspritechunks[MAXVISSPRITES >> VISSPRITECHUNKBITS] = {NULL};
|
||||
|
||||
@@ -661,7 +662,7 @@ void R_InitSprites(void)
|
||||
//
|
||||
void R_ClearSprites(void)
|
||||
{
|
||||
visspritecount = clippedvissprites = 0;
|
||||
visspritecount = numvisiblesprites = clippedvissprites = 0;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -940,10 +941,10 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
||||
{
|
||||
vis->scale = FixedMul(vis->scale, this_scale);
|
||||
vis->scalestep = FixedMul(vis->scalestep, this_scale);
|
||||
vis->xiscale = FixedDiv(vis->xiscale,this_scale);
|
||||
vis->xiscale = FixedDiv(vis->xiscale, this_scale);
|
||||
vis->isScaled = true;
|
||||
}
|
||||
dc_texturemid = FixedDiv(dc_texturemid,this_scale);
|
||||
dc_texturemid = FixedDiv(dc_texturemid, this_scale);
|
||||
}
|
||||
|
||||
spryscale = vis->scale;
|
||||
@@ -1318,6 +1319,8 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||
INT32 lindex;
|
||||
|
||||
vissprite_t *vis;
|
||||
|
||||
spritecut_e cut = SC_NONE;
|
||||
|
||||
angle_t ang = 0; // gcc 4.6 and lower fix
|
||||
fixed_t iscale;
|
||||
@@ -1468,7 +1471,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||
}
|
||||
|
||||
I_Assert(lump < max_spritelumps);
|
||||
|
||||
|
||||
if (thing->localskin && ((skin_t *)thing->localskin)->flags & SF_HIRES)
|
||||
this_scale = FixedMul(this_scale, ((skin_t *)thing->localskin)->highresscale);
|
||||
else if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
||||
@@ -1480,7 +1483,6 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||
spr_topoffset = spritecachedinfo[lump].topoffset;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
|
||||
if (thing->player)
|
||||
{
|
||||
sliptiderollangle = FixedMul(FINECOSINE((ang) >> ANGLETOFINESHIFT), ((cv_sloperoll.value == 1) ? thing->player->sliproll*(thing->player->sliptidemem) : 0));
|
||||
@@ -1515,6 +1517,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||
// calculate edges of the shape
|
||||
spritexscale = interp.spritexscale;
|
||||
spriteyscale = interp.spriteyscale;
|
||||
|
||||
if (spritexscale < 1 || spriteyscale < 1)
|
||||
return;
|
||||
|
||||
@@ -2193,6 +2196,14 @@ void R_SortVisSprites(void)
|
||||
bestscale = bestdispoffset = INT32_MAX;
|
||||
for (ds = unsorted.next; ds != &unsorted; ds = ds->next)
|
||||
{
|
||||
// Remove this sprite if it was determined to not be visible
|
||||
if (ds->cut & SC_NOTVISIBLE)
|
||||
{
|
||||
ds->next->prev = ds->prev;
|
||||
ds->prev->next = ds->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ds->sortscale < bestscale)
|
||||
{
|
||||
bestscale = ds->sortscale;
|
||||
@@ -2206,12 +2217,15 @@ void R_SortVisSprites(void)
|
||||
best = ds;
|
||||
}
|
||||
}
|
||||
best->next->prev = best->prev;
|
||||
best->prev->next = best->next;
|
||||
best->next = &vsprsortedhead;
|
||||
best->prev = vsprsortedhead.prev;
|
||||
vsprsortedhead.prev->next = best;
|
||||
vsprsortedhead.prev = best;
|
||||
if (best)
|
||||
{
|
||||
best->next->prev = best->prev;
|
||||
best->prev->next = best->next;
|
||||
best->next = &vsprsortedhead;
|
||||
best->prev = vsprsortedhead.prev;
|
||||
vsprsortedhead.prev->next = best;
|
||||
vsprsortedhead.prev = best;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2573,7 +2587,45 @@ static void R_DrawPrecipitationSprite(vissprite_t *spr)
|
||||
R_DrawPrecipitationVisSprite(spr);
|
||||
}
|
||||
|
||||
// R_ClipSprites
|
||||
static boolean R_CheckSpriteVisible(vissprite_t *spr, INT32 x1, INT32 x2)
|
||||
{
|
||||
INT16 sz = spr->sz;
|
||||
INT16 szt = spr->szt;
|
||||
|
||||
fixed_t texturemid, yscale, scalestep = spr->scalestep;
|
||||
INT32 height;
|
||||
|
||||
if (scalestep)
|
||||
{
|
||||
height = spr->patch->height;
|
||||
yscale = spr->scale;
|
||||
scalestep = FixedMul(scalestep, spr->spriteyscale);
|
||||
|
||||
if (spr->thingscale != FRACUNIT)
|
||||
texturemid = FixedDiv(spr->texturemid, max(spr->thingscale, 1));
|
||||
else
|
||||
texturemid = spr->texturemid;
|
||||
}
|
||||
|
||||
for (INT32 x = x1; x <= x2; x++)
|
||||
{
|
||||
if (scalestep)
|
||||
{
|
||||
fixed_t top = centeryfrac - FixedMul(texturemid, yscale);
|
||||
fixed_t bottom = top + (height * yscale);
|
||||
szt = (INT16)(top >> FRACBITS);
|
||||
sz = (INT16)(bottom >> FRACBITS);
|
||||
yscale += scalestep;
|
||||
}
|
||||
|
||||
if (spr->cliptop[x] < spr->clipbot[x] && sz > spr->cliptop[x] && szt < spr->clipbot[x])
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// R_ClipVisSprite
|
||||
// Clips vissprites without drawing, so that portals can work. -Red
|
||||
void R_ClipVisSprite(vissprite_t *spr, INT32 x1, INT32 x2)
|
||||
{
|
||||
@@ -2756,8 +2808,15 @@ void R_ClipVisSprite(vissprite_t *spr, INT32 x1, INT32 x2)
|
||||
spr->clipbot[x] = (INT16)viewheight;
|
||||
|
||||
if (spr->cliptop[x] == -2)
|
||||
//Fab : 26-04-98: was -1, now clips against console bottom
|
||||
spr->cliptop[x] = (INT16)con_clipviewtop;
|
||||
spr->cliptop[x] = -1;
|
||||
}
|
||||
|
||||
// Check if it'll be visible
|
||||
// Not done for floorsprites.
|
||||
if (cv_spriteclip.value)
|
||||
{
|
||||
if (!R_CheckSpriteVisible(spr, x1, x2))
|
||||
spr->cut |= SC_NOTVISIBLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2826,6 +2885,13 @@ void R_ClipSprites(void)
|
||||
for (; clippedvissprites < visspritecount; clippedvissprites++)
|
||||
{
|
||||
vissprite_t *spr = R_GetVisSprite(clippedvissprites);
|
||||
|
||||
if (cv_spriteclip.value
|
||||
&& (spr->szt > vid.height || spr->sz < 0))
|
||||
{
|
||||
spr->cut |= SC_NOTVISIBLE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spr->x2 < cx)
|
||||
{
|
||||
@@ -2844,6 +2910,9 @@ void R_ClipSprites(void)
|
||||
}
|
||||
|
||||
R_ClipVisSprite(spr, spr->x1, spr->x2);
|
||||
|
||||
if ((spr->cut & SC_NOTVISIBLE) == 0)
|
||||
numvisiblesprites++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-2
@@ -114,7 +114,10 @@ typedef enum
|
||||
SC_NONE = 0,
|
||||
SC_TOP = 1,
|
||||
SC_BOTTOM = 2,
|
||||
SC_VFLIP = 3
|
||||
SC_VFLIP = 3,
|
||||
SC_NOTVISIBLE = 4,
|
||||
SC_CUTMASK = SC_TOP|SC_BOTTOM|SC_NOTVISIBLE,
|
||||
SC_FLAGMASK = ~SC_CUTMASK
|
||||
} spritecut_e;
|
||||
|
||||
// A vissprite_t is a thing that will be drawn during a refresh,
|
||||
@@ -175,7 +178,7 @@ typedef struct vissprite_s
|
||||
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
|
||||
} vissprite_t;
|
||||
|
||||
extern UINT32 visspritecount;
|
||||
extern UINT32 visspritecount, numvisiblesprites;
|
||||
|
||||
void R_ClipSprites(void);
|
||||
void R_ClipVisSprite(vissprite_t *spr, INT32 x1, INT32 x2);
|
||||
|
||||
+2
-2
@@ -43,8 +43,8 @@
|
||||
#define MAXVIDWIDTH 320
|
||||
#define MAXVIDHEIGHT 200
|
||||
#else
|
||||
#define MAXVIDWIDTH 2560 // don't set this too high because actually
|
||||
#define MAXVIDHEIGHT 1440 // 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.
|
||||
|
||||
@@ -1034,12 +1034,6 @@ INT32 I_GetKey (void)
|
||||
return rc;
|
||||
}
|
||||
|
||||
void
|
||||
I_CursedWindowMovement (int xd, int yd)
|
||||
{
|
||||
SDL_SetWindowPosition(window, window_x + xd, window_y + yd);
|
||||
}
|
||||
|
||||
//
|
||||
// I_JoyScale
|
||||
//
|
||||
|
||||
@@ -640,9 +640,6 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
||||
break;
|
||||
case SDL_WINDOWEVENT_MAXIMIZED:
|
||||
break;
|
||||
case SDL_WINDOWEVENT_MOVED:
|
||||
window_x = evt.data1;
|
||||
window_y = evt.data2;
|
||||
}
|
||||
|
||||
if (mousefocus && kbfocus)
|
||||
|
||||
+3
-3
@@ -245,7 +245,7 @@ void ST_doPaletteStuff(void)
|
||||
palette = 0;
|
||||
|
||||
#ifdef HWRENDER
|
||||
if ((rendermode == render_opengl && !cv_grpaletteshader.value) || (rendermode == render_opengl && cv_grpaletteshader.value && !cv_grflashpal.value))
|
||||
if ((rendermode == render_opengl && !cv_grpaletteshader.value) || (rendermode == render_opengl && HWR_ShouldUsePaletteRendering() && !cv_grflashpal.value))
|
||||
palette = 0; // No flashpals here in OpenGL
|
||||
#endif
|
||||
|
||||
@@ -254,7 +254,7 @@ void ST_doPaletteStuff(void)
|
||||
st_palette = palette;
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_soft || (rendermode == render_opengl && cv_grpaletteshader.value && cv_grflashpal.value))
|
||||
if (rendermode == render_soft || (rendermode == render_opengl && HWR_ShouldUsePaletteRendering() && cv_grflashpal.value))
|
||||
#else
|
||||
if (rendermode != render_none)
|
||||
#endif
|
||||
@@ -2207,7 +2207,7 @@ void ST_Drawer(void)
|
||||
//25/08/99: Hurdler: palette changes is done for all players,
|
||||
// not only player1! That's why this part
|
||||
// of code is moved somewhere else.
|
||||
if (rendermode == render_soft || (rendermode == render_opengl && cv_grpaletteshader.value && cv_grflashpal.value))
|
||||
if (rendermode == render_soft || (rendermode == render_opengl && HWR_ShouldUsePaletteRendering() && cv_grflashpal.value))
|
||||
#endif
|
||||
if (rendermode != render_none) ST_doPaletteStuff();
|
||||
|
||||
|
||||
+4
-3
@@ -203,14 +203,14 @@ void V_SetPalette(INT32 palettenum)
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft && rendermode != render_none) {
|
||||
// in palette rendering mode, we already manage our palette ourselves
|
||||
if (cv_grpaletteshader.value == 1)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
// reset our palette lookups n shit
|
||||
gl_palette_initialized = false;
|
||||
InitPalette(palettenum, true);
|
||||
}
|
||||
else
|
||||
HWR_SetPalette(pLocalPalette);
|
||||
HWR_SetPalette(&pLocalPalette[palettenum*256]);
|
||||
}
|
||||
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||
else
|
||||
@@ -225,12 +225,13 @@ void V_SetPaletteLump(const char *pal)
|
||||
LoadPalette(pal);
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft && rendermode != render_none) {
|
||||
if (cv_grpaletteshader.value == 1)
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
// reset our palette lookups n shit
|
||||
gl_palette_initialized = false;
|
||||
InitPalette(0, false);
|
||||
}
|
||||
|
||||
HWR_SetPalette(pLocalPalette);
|
||||
}
|
||||
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||
|
||||
Reference in new issue
Block a user