Merge branch 'Saturn-Next' into Saturn-Testing
This commit is contained in:
commit
7393eb728c
15 files changed
+304
-100
No files matched your search
+35
-14
@@ -816,12 +816,17 @@ static void COM_Help_f(void)
|
||||
cvar = CV_FindVar(help);
|
||||
if (cvar)
|
||||
{
|
||||
boolean floatmode = false;
|
||||
const char *cvalue = NULL;
|
||||
CONS_Printf("\x82""Variable %s:\n", cvar->name);
|
||||
CONS_Printf(M_GetText(" flags: "));
|
||||
if (cvar->flags & CV_SAVE)
|
||||
CONS_Printf("AUTOSAVE ");
|
||||
if (cvar->flags & CV_FLOAT)
|
||||
{
|
||||
CONS_Printf("FLOAT ");
|
||||
floatmode = true;
|
||||
}
|
||||
if (cvar->flags & CV_NETVAR)
|
||||
CONS_Printf("NETVAR ");
|
||||
if (cvar->flags & CV_CALL)
|
||||
@@ -831,30 +836,43 @@ static void COM_Help_f(void)
|
||||
CONS_Printf("\n");
|
||||
if (cvar->PossibleValue)
|
||||
{
|
||||
if (!stricmp(cvar->PossibleValue[0].strvalue, "MIN") && !stricmp(cvar->PossibleValue[1].strvalue, "MAX"))
|
||||
{
|
||||
CONS_Printf(" range from %d to %d\n", cvar->PossibleValue[0].value,
|
||||
cvar->PossibleValue[1].value);
|
||||
i = 2;
|
||||
}
|
||||
if (!stricmp(cvar->PossibleValue[0].strvalue, "MIN") && !stricmp(cvar->PossibleValue[1].strvalue, "MAX"))
|
||||
{
|
||||
if (floatmode)
|
||||
{
|
||||
float fu = FIXED_TO_FLOAT(cvar->PossibleValue[0].value);
|
||||
float ck = FIXED_TO_FLOAT(cvar->PossibleValue[1].value);
|
||||
CONS_Printf(" range from %ld%s to %ld%s\n",
|
||||
(long)fu, M_Ftrim(fu),
|
||||
(long)ck, M_Ftrim(ck));
|
||||
}
|
||||
else
|
||||
CONS_Printf(" range from %d to %d\n", cvar->PossibleValue[0].value,
|
||||
cvar->PossibleValue[1].value);
|
||||
i = 2;
|
||||
}
|
||||
|
||||
{
|
||||
const char *cvalue = NULL;
|
||||
//CONS_Printf(M_GetText(" possible value : %s\n"), cvar->name);
|
||||
while (cvar->PossibleValue[i].strvalue)
|
||||
{
|
||||
CONS_Printf(" %-2d : %s\n", cvar->PossibleValue[i].value,
|
||||
cvar->PossibleValue[i].strvalue);
|
||||
if (floatmode)
|
||||
CONS_Printf(" %-2f : %s\n", FIXED_TO_FLOAT(cvar->PossibleValue[i].value),
|
||||
cvar->PossibleValue[i].strvalue);
|
||||
else
|
||||
CONS_Printf(" %-2d : %s\n", cvar->PossibleValue[i].value,
|
||||
cvar->PossibleValue[i].strvalue);
|
||||
if (cvar->PossibleValue[i].value == cvar->value)
|
||||
cvalue = cvar->PossibleValue[i].strvalue;
|
||||
i++;
|
||||
}
|
||||
if (cvalue)
|
||||
CONS_Printf(" Current value: %s\n", cvalue);
|
||||
else
|
||||
CONS_Printf(" Current value: %d\n", cvar->value);
|
||||
}
|
||||
}
|
||||
|
||||
if (cvalue)
|
||||
CONS_Printf(" Current value: %s\n", cvalue);
|
||||
else if (cvar->string)
|
||||
CONS_Printf(" Current value: %s\n", cvar->string);
|
||||
else
|
||||
CONS_Printf(" Current value: %d\n", cvar->value);
|
||||
}
|
||||
@@ -1025,7 +1043,10 @@ static void COM_Add_f(void)
|
||||
}
|
||||
|
||||
if (( cvar->flags & CV_FLOAT ))
|
||||
CV_Set(cvar, va("%f", FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2))));
|
||||
{
|
||||
float n =FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2));
|
||||
CV_Set(cvar, va("%ld%s", (long)n, M_Ftrim(n)));
|
||||
}
|
||||
else
|
||||
CV_AddValue(cvar, atoi(COM_Argv(2)));
|
||||
}
|
||||
|
||||
+108
-5
@@ -87,6 +87,9 @@ boolean serverrunning = false;
|
||||
INT32 serverplayer = 0;
|
||||
char motd[254], server_context[8]; // Message of the Day, Unique Context (even without Mumble support)
|
||||
|
||||
plrinfo playerinfo[MAXPLAYERS];
|
||||
SINT8 joinnode = 0; // used for CL_VIEWSERVER
|
||||
|
||||
// Server specific vars
|
||||
UINT8 playernode[MAXPLAYERS];
|
||||
|
||||
@@ -1185,6 +1188,7 @@ typedef enum
|
||||
#endif
|
||||
CL_CONNECTED,
|
||||
CL_ABORTED,
|
||||
CL_VIEWSERVER,
|
||||
CL_ASKFULLFILELIST,
|
||||
CL_CONFIRMCONNECT,
|
||||
#ifdef HAVE_CURL
|
||||
@@ -1248,7 +1252,7 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
if (!menuactive) // menu already draws its own fade
|
||||
V_DrawFadeScreen(0xFF00, 16); // force default
|
||||
|
||||
if (cl_mode != CL_DOWNLOADFILES && cl_mode != CL_LOADFILES && cl_mode != CL_CHECKFILES
|
||||
if (cl_mode != CL_DOWNLOADFILES && cl_mode != CL_LOADFILES && cl_mode != CL_CHECKFILES && cl_mode != CL_VIEWSERVER
|
||||
#ifdef HAVE_CURL
|
||||
&& cl_mode != CL_DOWNLOADHTTPFILES
|
||||
#endif
|
||||
@@ -1368,6 +1372,78 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %2u/%2u Files",loadcompletednum,fileneedednum));
|
||||
}
|
||||
else if (cl_mode == CL_VIEWSERVER)
|
||||
{
|
||||
V_DrawFill(8, 16, BASEVIDWIDTH - 16, 54, 239);
|
||||
|
||||
V_DrawThinString(12 + 80, 18, V_ALLOWLOWERCASE, va("%s", serverlist[joinnode].info.servername));
|
||||
|
||||
const char *map = va("%sP", serverlist[joinnode].info.mapname);
|
||||
patch_t *current_map = W_LumpExists(map) ? W_CachePatchName(map, PU_CACHE) : W_CachePatchName("BLANKLVL", PU_CACHE);
|
||||
V_DrawSmallScaledPatch(10, 18, 0, current_map);
|
||||
|
||||
V_DrawThinString(12 + 80, 38, V_ALLOWLOWERCASE, va("%s", serverlist[joinnode].info.maptitle));
|
||||
V_DrawThinString(12 + 80, 48, V_ALLOWLOWERCASE, va("%s", Gametype_Names[serverlist[joinnode].info.gametype]));
|
||||
|
||||
if (fileneedednum > 0)
|
||||
{
|
||||
V_DrawThinString(12 + 80, 58, V_ALLOWLOWERCASE|V_ORANGEMAP, va("%i Addons", fileneedednum));
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawThinString(12 + 80, 58, V_ALLOWLOWERCASE|V_YELLOWMAP, "Vanilla");
|
||||
}
|
||||
|
||||
if (serverlist[joinnode].info.cheatsenabled)
|
||||
{
|
||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 12, 58, V_ALLOWLOWERCASE|V_GREENMAP, "Cheats");
|
||||
}
|
||||
|
||||
V_DrawFill(8, 72, BASEVIDWIDTH - 16, 112, 239);
|
||||
|
||||
V_DrawString(12, 74, V_ALLOWLOWERCASE|V_YELLOWMAP, "Players");
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - 12, 74, V_ALLOWLOWERCASE|V_YELLOWMAP, va("%i / %i", serverlist[joinnode].info.numberofplayer, serverlist[joinnode].info.maxplayer));
|
||||
|
||||
INT32 i;
|
||||
INT32 count = 0;
|
||||
INT32 x = 14;
|
||||
INT32 y = 84;
|
||||
INT32 statuscolor = 1;
|
||||
char player_name[MAXPLAYERNAME+1];
|
||||
if (serverlist[joinnode].info.numberofplayer > 0)
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playerinfo[i].node < 255)
|
||||
{
|
||||
strncpy(player_name, playerinfo[i].name, MAXPLAYERNAME);
|
||||
V_DrawThinString(x + 10, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE, player_name);
|
||||
|
||||
if (playerinfo[i].team == 0) { statuscolor = 184; } // playing
|
||||
if (playerinfo[i].data & 0x20) { statuscolor = 86; } // tag IT
|
||||
if (playerinfo[i].team == 1) { statuscolor = 128; } // ctf red team
|
||||
if (playerinfo[i].team == 2) { statuscolor = 232; } // ctf blue team
|
||||
if (playerinfo[i].team == 255) { statuscolor = 16; } // spectator or non-team
|
||||
|
||||
V_DrawFill(x, y, 7, 7, 31);
|
||||
V_DrawFill(x, y, 6, 6, statuscolor);
|
||||
|
||||
y += 9;
|
||||
count++;
|
||||
if ((count == 11) || (count == 22))
|
||||
{
|
||||
x += 104;
|
||||
y = 84;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Buttons
|
||||
V_DrawFill(8, BASEVIDHEIGHT - 14, BASEVIDWIDTH - 16, 12, 239);
|
||||
V_DrawThinString(16, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sESC%s] = Abort", "\x82", "\x80"));
|
||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 12, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sENTER%s] = Join", "\x82", "\x80"));
|
||||
}
|
||||
else if (filedownload.current != -1)
|
||||
{
|
||||
INT32 dldlength;
|
||||
@@ -2469,6 +2545,7 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||
if (i < 0)
|
||||
return true;
|
||||
}
|
||||
joinnode = i;
|
||||
|
||||
// Quit here rather than downloading files and being refused later.
|
||||
if (serverlist[i].info.numberofplayer >= serverlist[i].info.maxplayer)
|
||||
@@ -2495,7 +2572,7 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||
return true;
|
||||
}
|
||||
|
||||
cl_mode = CL_CHECKFILES;
|
||||
cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2549,7 +2626,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
|
||||
case CL_ASKFULLFILELIST:
|
||||
if (cl_lastcheckedfilecount == UINT16_MAX) // All files retrieved
|
||||
cl_mode = CL_CHECKFILES;
|
||||
cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES;
|
||||
else if (fileneedednum != cl_lastcheckedfilecount || I_GetTime() >= *asksent)
|
||||
{
|
||||
if (CL_AskFileList(fileneedednum))
|
||||
@@ -2715,6 +2792,15 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
D_ProcessEvents(); //needed for menu system to receive inputs
|
||||
|
||||
key = I_GetKey();
|
||||
|
||||
if (cl_mode == CL_VIEWSERVER)
|
||||
{
|
||||
if (key == KEY_ENTER || key == KEY_JOY1)
|
||||
cl_mode = CL_CHECKFILES;
|
||||
else if (key == KEY_ESCAPE || key == KEY_JOY1+1)
|
||||
cl_mode = CL_ABORTED;
|
||||
}
|
||||
|
||||
// Only ESC and non-keyboard keys abort connection
|
||||
if (!modeattacking && (key == KEY_ESCAPE || key == KEY_JOY1+1 || cl_mode == CL_ABORTED))
|
||||
{
|
||||
@@ -4142,6 +4228,8 @@ consvar_t cv_downloadspeed = {"downloadspeed", "300", CV_SAVE, downloadspeed_con
|
||||
static CV_PossibleValue_t connectawaittime_cons_t[] = {{1, "MIN"}, {60, "MAX"}, {0, "Inf"}, {0, NULL}};
|
||||
consvar_t cv_connectawaittime = {"connectawaittime", "5", CV_SAVE, connectawaittime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_serverinfoscreen = {"serverinfoscreen", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static void Got_AddPlayer(UINT8 **p, INT32 playernum);
|
||||
static void Got_RemovePlayer(UINT8 **p, INT32 playernum);
|
||||
|
||||
@@ -4909,6 +4997,16 @@ static void HandleServerInfo(SINT8 node)
|
||||
if (client && cl_mode > CL_SEARCHING && node == servernode)
|
||||
memcpy(connectedservername, netbuffer->u.serverinfo.servername, MAXSERVERNAME);
|
||||
}
|
||||
|
||||
|
||||
static void HandlePlayerInfo(SINT8 node)
|
||||
{
|
||||
(void)node;
|
||||
|
||||
INT32 i;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
playerinfo[i] = netbuffer->u.playerinfo[i];
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SATURNPAK
|
||||
@@ -5197,6 +5295,10 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
||||
|
||||
case PT_CLIENTCMD:
|
||||
break; // This is not an "unknown packet"
|
||||
|
||||
case PT_PLAYERINFO:
|
||||
HandlePlayerInfo(node);
|
||||
break;
|
||||
|
||||
case PT_SERVERTICS:
|
||||
// Do not remove my own server (we have just get a out of order packet)
|
||||
@@ -5792,8 +5894,9 @@ static void GetPackets(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (netbuffer->packettype == PT_PLAYERINFO)
|
||||
continue; // We do nothing with PLAYERINFO, that's for the MS browser.
|
||||
/*if (netbuffer->packettype == PT_PLAYERINFO)
|
||||
continue; // We do nothing with PLAYERINFO, that's for the MS browser. Not quite true anymore :p*/
|
||||
|
||||
|
||||
// We also count unknown packets, hence "<="
|
||||
if (netbuffer->packettype <= NUMPACKETTYPE)
|
||||
|
||||
@@ -577,6 +577,9 @@ extern boolean acceptnewnode;
|
||||
extern SINT8 servernode;
|
||||
extern char connectedservername[MAXSERVERNAME+1];
|
||||
|
||||
extern plrinfo playerinfo[MAXPLAYERS];
|
||||
extern SINT8 joinnode;
|
||||
|
||||
void Command_Ping_f(void);
|
||||
extern tic_t connectiontimeout;
|
||||
extern tic_t jointimeout;
|
||||
@@ -608,6 +611,8 @@ extern consvar_t cv_connectawaittime;
|
||||
|
||||
extern consvar_t cv_discordinvites;
|
||||
|
||||
extern consvar_t cv_serverinfoscreen;
|
||||
|
||||
// Used in d_net, the only dependence
|
||||
//tic_t ExpandTics(INT32 low, tic_t basetic);
|
||||
void D_ClientServerInit(void);
|
||||
|
||||
+1
-1
@@ -345,7 +345,7 @@ static void D_Renderview(void)
|
||||
{
|
||||
HWR_RenderPlayerView();
|
||||
R_RestoreLevelInterpolators();
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (issplitscreen) // Splitscreen-specific
|
||||
|
||||
@@ -900,6 +900,7 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_netticbuffer);
|
||||
CV_RegisterVar(&cv_mindelay);
|
||||
CV_RegisterVar(&cv_gentlemens);
|
||||
CV_RegisterVar(&cv_serverinfoscreen);
|
||||
|
||||
#ifdef NETGAME_DEVMODE
|
||||
CV_RegisterVar(&cv_fishcake);
|
||||
|
||||
+2
-1
@@ -385,7 +385,8 @@ consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, N
|
||||
consvar_t cv_pauseifunfocused = {"pauseifunfocused", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Display song credits
|
||||
consvar_t cv_songcredits = {"songcredits", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t songcredits_cons_t[] = {{0, "Off"}, {1, "Default"}, {2, "Box"}, {0, NULL}};
|
||||
consvar_t cv_songcredits = {"songcredits", "Default", CV_SAVE, songcredits_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Show "FREE PLAY" when you're alone. :(
|
||||
consvar_t cv_showfreeplay = { "showfreeplay", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
+11
-29
@@ -89,32 +89,23 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
{
|
||||
if (!pSurf)
|
||||
{
|
||||
I_Error("Got a null FSurfaceInfo in batching");// nulls should not come in the stuff that batching currently applies to
|
||||
I_Error("Got a null FSurfaceInfo in batching"); // nulls should not come in the stuff that batching currently applies to
|
||||
}
|
||||
|
||||
if (polygonArraySize == polygonArrayAllocSize)
|
||||
{
|
||||
PolygonArrayEntry* new_array;
|
||||
// ran out of space, make new array double the size
|
||||
// ran out of space, double the array size
|
||||
polygonArrayAllocSize *= 2;
|
||||
new_array = malloc(polygonArrayAllocSize * sizeof(PolygonArrayEntry));
|
||||
memcpy(new_array, polygonArray, polygonArraySize * sizeof(PolygonArrayEntry));
|
||||
free(polygonArray);
|
||||
polygonArray = new_array;
|
||||
polygonArray = realloc(polygonArray, polygonArrayAllocSize * sizeof(PolygonArrayEntry));
|
||||
// also need to redo the index array, dont need to copy it though
|
||||
free(polygonArraySorted);
|
||||
polygonArraySorted = malloc(polygonArrayAllocSize * sizeof(PolygonArrayEntry *));
|
||||
polygonArraySorted = realloc(polygonArraySorted, polygonArrayAllocSize * sizeof(PolygonArrayEntry*));
|
||||
}
|
||||
|
||||
while (unsortedVertexArraySize + (int)iNumPts > unsortedVertexArrayAllocSize)
|
||||
{
|
||||
FOutVector* new_array;
|
||||
// need more space for vertices in unsortedVertexArray
|
||||
unsortedVertexArrayAllocSize *= 2;
|
||||
new_array = malloc(unsortedVertexArrayAllocSize * sizeof(FOutVector));
|
||||
memcpy(new_array, unsortedVertexArray, unsortedVertexArraySize * sizeof(FOutVector));
|
||||
free(unsortedVertexArray);
|
||||
unsortedVertexArray = new_array;
|
||||
unsortedVertexArray = realloc(unsortedVertexArray, unsortedVertexArrayAllocSize * sizeof(FOutVector));
|
||||
}
|
||||
|
||||
// add the polygon data to the arrays
|
||||
@@ -138,10 +129,11 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int comparePolygons(const void *p1, const void *p2)
|
||||
{
|
||||
PolygonArrayEntry *poly1 = *(PolygonArrayEntry *const *)p1;
|
||||
PolygonArrayEntry *poly2 = *(PolygonArrayEntry *const *)p2;
|
||||
const PolygonArrayEntry *poly1 = *(PolygonArrayEntry *const *)p1;
|
||||
const PolygonArrayEntry *poly2 = *(PolygonArrayEntry *const *)p2;
|
||||
int diff;
|
||||
INT64 diff64;
|
||||
|
||||
@@ -177,9 +169,7 @@ static int comparePolygons(const void *p1, const void *p2)
|
||||
diff = poly1->surf.LightInfo.fade_end - poly2->surf.LightInfo.fade_end;
|
||||
if (diff != 0) return diff;
|
||||
|
||||
diff = poly1->surf.LightInfo.directional - poly2->surf.LightInfo.directional;
|
||||
|
||||
return diff;
|
||||
return poly1->surf.LightInfo.directional - poly2->surf.LightInfo.directional;
|
||||
}
|
||||
|
||||
static int comparePolygonsNoShaders(const void *p1, const void *p2)
|
||||
@@ -328,19 +318,11 @@ void HWR_RenderBatches(void)
|
||||
// probably never will this loop run more than once though
|
||||
while (finalVertexWritePos + numVerts > finalVertexArrayAllocSize)
|
||||
{
|
||||
FOutVector* new_array;
|
||||
unsigned int* new_index_array;
|
||||
finalVertexArrayAllocSize *= 2;
|
||||
new_array = malloc(finalVertexArrayAllocSize * sizeof(FOutVector));
|
||||
memcpy(new_array, finalVertexArray, finalVertexWritePos * sizeof(FOutVector));
|
||||
free(finalVertexArray);
|
||||
finalVertexArray = new_array;
|
||||
finalVertexArray = realloc(finalVertexArray, finalVertexArrayAllocSize * sizeof(FOutVector));
|
||||
// also increase size of index array, 3x of vertex array since
|
||||
// going from fans to triangles increases vertex count to 3x
|
||||
new_index_array = malloc(finalVertexArrayAllocSize * 3 * sizeof(UINT32));
|
||||
memcpy(new_index_array, finalVertexIndexArray, finalIndexWritePos * sizeof(UINT32));
|
||||
free(finalVertexIndexArray);
|
||||
finalVertexIndexArray = new_index_array;
|
||||
finalVertexIndexArray = realloc(finalVertexIndexArray, finalVertexArrayAllocSize * 3 * sizeof(UINT32));
|
||||
}
|
||||
// write the vertices of the polygon
|
||||
memcpy(&finalVertexArray[finalVertexWritePos], &unsortedVertexArray[entry->vertsIndex],
|
||||
|
||||
+30
-21
@@ -241,16 +241,16 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
||||
if (option & V_SNAPTORIGHT)
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx));
|
||||
else if (!(option & V_SNAPTOLEFT))
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx))/2;
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx))/2.0f;
|
||||
}
|
||||
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
{
|
||||
if ((option & (V_SPLITSCREEN|V_SNAPTOTOP)) == (V_SPLITSCREEN|V_SNAPTOTOP))
|
||||
cy += (fvh/2 - (FLOATBASEVIDHEIGHT/2 * dupy));
|
||||
cy += (fvh/2.0f - (FLOATBASEVIDHEIGHT/2.0f * dupy));
|
||||
else if (option & V_SNAPTOBOTTOM)
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
|
||||
else if (!(option & V_SNAPTOTOP))
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy))/2;
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy))/2.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -305,10 +305,13 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
||||
FSurfaceInfo Surf;
|
||||
Surf.PolyColor.s.red = Surf.PolyColor.s.green = Surf.PolyColor.s.blue = 0xff;
|
||||
|
||||
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[hudtrans];
|
||||
else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[hudtrans];
|
||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans];
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
switch (alphalevel)
|
||||
{
|
||||
case 13: Surf.PolyColor.s.alpha = softwaretranstogl_lo[hudtrans]; break;
|
||||
case 14: Surf.PolyColor.s.alpha = softwaretranstogl[hudtrans]; break;
|
||||
case 15: Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans]; break;
|
||||
default: Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel]; break;
|
||||
}
|
||||
|
||||
flags |= PF_Modulated;
|
||||
GL_DrawPolygon(&Surf, v, 4, flags);
|
||||
@@ -392,16 +395,16 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||
if (option & V_SNAPTORIGHT)
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx));
|
||||
else if (!(option & V_SNAPTOLEFT))
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx))/2;
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx))/2.0f;
|
||||
}
|
||||
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
{
|
||||
if ((option & (V_SPLITSCREEN|V_SNAPTOTOP)) == (V_SPLITSCREEN|V_SNAPTOTOP))
|
||||
cy += (fvh/2 - (FLOATBASEVIDHEIGHT/2 * dupy));
|
||||
cy += (fvh/2.0f - (FLOATBASEVIDHEIGHT/2.0f * dupy));
|
||||
else if (option & V_SNAPTOBOTTOM)
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
|
||||
else if (!(option & V_SNAPTOTOP))
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy))/2;
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy))/2.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -467,10 +470,13 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||
FSurfaceInfo Surf;
|
||||
Surf.PolyColor.s.red = Surf.PolyColor.s.green = Surf.PolyColor.s.blue = 0xff;
|
||||
|
||||
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value];
|
||||
else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[cv_translucenthud.value];
|
||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
switch (alphalevel)
|
||||
{
|
||||
case 13: Surf.PolyColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value]; break;
|
||||
case 14: Surf.PolyColor.s.alpha = softwaretranstogl[cv_translucenthud.value]; break;
|
||||
case 15: Surf.PolyColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value]; break;
|
||||
default: Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel]; break;
|
||||
}
|
||||
|
||||
flags |= PF_Modulated;
|
||||
GL_DrawPolygon(&Surf, v, 4, flags);
|
||||
@@ -487,7 +493,7 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||
// --------------------------------------------------------------------------
|
||||
// Fills a box of pixels using a flat texture as a pattern
|
||||
// --------------------------------------------------------------------------
|
||||
void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum)
|
||||
void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum)
|
||||
{
|
||||
FOutVector v[4];
|
||||
double dflatsize;
|
||||
@@ -840,7 +846,7 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
|
||||
if (color & V_SNAPTORIGHT)
|
||||
fx += (fvw - (FLOATBASEVIDWIDTH * dupx));
|
||||
else if (!(color & V_SNAPTOLEFT))
|
||||
fx += (fvw - (FLOATBASEVIDWIDTH * dupx)) / 2;
|
||||
fx += (fvw - (FLOATBASEVIDWIDTH * dupx)) / 2.0f;
|
||||
}
|
||||
if (fabsf(fvh - (FLOATBASEVIDHEIGHT * dupy)) > 1.0E-36f)
|
||||
{
|
||||
@@ -848,7 +854,7 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
|
||||
if (color & V_SNAPTOBOTTOM)
|
||||
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
|
||||
else if (!(color & V_SNAPTOTOP))
|
||||
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy)) / 2;
|
||||
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy)) / 2.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1122,10 +1128,13 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||
|
||||
if (alphalevel)
|
||||
{
|
||||
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[hudtrans];
|
||||
else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[hudtrans];
|
||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans];
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
switch (alphalevel)
|
||||
{
|
||||
case 13: Surf.PolyColor.s.alpha = softwaretranstogl_lo[hudtrans]; break;
|
||||
case 14: Surf.PolyColor.s.alpha = softwaretranstogl[hudtrans]; break;
|
||||
case 15: Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans]; break;
|
||||
default: Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel]; break;
|
||||
}
|
||||
}
|
||||
|
||||
GL_DrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
|
||||
+4
-4
@@ -220,9 +220,9 @@ HMS_connect (const char *format, ...)
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
|
||||
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V4);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, cv_masterserver_timeout.value);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)cv_masterserver_timeout.value);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HMS_on_read);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);
|
||||
|
||||
@@ -339,8 +339,8 @@ HMS_unlist (void)
|
||||
if (! hms)
|
||||
return 0;
|
||||
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POST, 1);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, 0);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POST, (long)1);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, (long)0);
|
||||
|
||||
okay = HMS_do(hms);
|
||||
HMS_end(hms);
|
||||
|
||||
+65
-4
@@ -2131,7 +2131,7 @@ void HU_TickSongCredits(void)
|
||||
}
|
||||
}
|
||||
|
||||
void HU_DrawSongCredits(void)
|
||||
static void HU_DrawSongCreditsVanilla(void)
|
||||
{
|
||||
char *str;
|
||||
INT32 len;
|
||||
@@ -2139,9 +2139,6 @@ void HU_DrawSongCredits(void)
|
||||
INT32 y = (splitscreen ? (BASEVIDHEIGHT/2)-4 : 32);
|
||||
INT32 bgt;
|
||||
|
||||
if (!cursongcredit.def) // No def
|
||||
return;
|
||||
|
||||
str = va("\x1F"" %s", cursongcredit.def->source);
|
||||
len = V_ThinStringWidth(str, V_ALLOWLOWERCASE|V_6WIDTHSPACE);
|
||||
destx = (len + 7) * FRACUNIT;
|
||||
@@ -2171,6 +2168,70 @@ void HU_DrawSongCredits(void)
|
||||
V_DrawRightAlignedThinString(cursongcredit.x / FRACUNIT, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans<<V_ALPHASHIFT), str);
|
||||
}
|
||||
|
||||
#define BOXCREDITSLIDEIN (5*TICRATE-TICRATE/2)
|
||||
#define BOXCREDITSLIDEOUT (TICRATE/2)
|
||||
#define BOXCREDITHEIGHT 8
|
||||
static void HU_DrawSongCreditsBox(void)
|
||||
{
|
||||
char *str = cursongcredit.def->source;
|
||||
INT32 strwidth = V_SmallStringWidth(str, V_ALLOWLOWERCASE) + 4;
|
||||
|
||||
// dup dup dup dup
|
||||
INT32 dup = min(vid.dupx, vid.dupy);
|
||||
|
||||
// Center it
|
||||
INT32 x = (BASEVIDWIDTH/2 - strwidth/2)*dup + ((vid.width - (BASEVIDWIDTH * vid.dupx)) / 2);
|
||||
INT32 y = 0;
|
||||
|
||||
INT32 flags = V_SNAPTOTOP|V_NOSCALESTART;
|
||||
INT32 t = cursongcredit.anim;
|
||||
INT32 bgt;
|
||||
|
||||
fixed_t interpoffset = FixedMul(BOXCREDITHEIGHT*dup*FRACUNIT/(TICRATE/2), R_GetHudUncap());
|
||||
|
||||
if (t > BOXCREDITSLIDEIN)
|
||||
{
|
||||
// Sliding in
|
||||
t = TICRATE/2 - (t - BOXCREDITSLIDEIN);
|
||||
y = -BOXCREDITHEIGHT*dup + (FixedMul(BOXCREDITHEIGHT*FRACUNIT, FixedDiv(t*FRACUNIT, TICRATE*FRACUNIT/2))*dup + interpoffset)/FRACUNIT;
|
||||
}
|
||||
else if (t < TICRATE/2)
|
||||
{
|
||||
// Sliding out
|
||||
y = -BOXCREDITHEIGHT*dup + (FixedMul(BOXCREDITHEIGHT*FRACUNIT, FixedDiv(t*FRACUNIT, TICRATE*FRACUNIT/2))*dup - interpoffset)/FRACUNIT;
|
||||
}
|
||||
|
||||
bgt = (NUMTRANSMAPS/2) + (cursongcredit.trans/2);
|
||||
|
||||
if (bgt < NUMTRANSMAPS)
|
||||
{
|
||||
V_DrawFill(x, y, strwidth*dup, BOXCREDITHEIGHT*dup, 28|flags|(bgt<<V_ALPHASHIFT));
|
||||
V_DrawFill(x+dup, y+dup, (strwidth-2)*dup, (BOXCREDITHEIGHT-2)*dup, 30|flags|(bgt<<V_ALPHASHIFT));
|
||||
}
|
||||
if (cursongcredit.trans < NUMTRANSMAPS)
|
||||
{
|
||||
V_DrawSmallString(x+2*dup, y+2*dup, V_ALLOWLOWERCASE|flags|(cursongcredit.trans<<V_ALPHASHIFT), str);
|
||||
}
|
||||
}
|
||||
|
||||
void HU_DrawSongCredits(void)
|
||||
{
|
||||
if (!cursongcredit.def) // No def
|
||||
return;
|
||||
|
||||
switch (cv_songcredits.value)
|
||||
{
|
||||
case 1:
|
||||
HU_DrawSongCreditsVanilla();
|
||||
break;
|
||||
case 2:
|
||||
HU_DrawSongCreditsBox();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Heads up displays drawer, call each frame
|
||||
//
|
||||
|
||||
+17
-15
@@ -2188,29 +2188,30 @@ static menuitem_t OP_SaturnMenu[] =
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Minimum Input Delay", &cv_mindelay, 20},
|
||||
{IT_STRING | IT_CVAR, NULL, "Gentlemens Ping", &cv_gentlemens, 25},
|
||||
{IT_STRING | IT_CVAR, NULL, "Server Info Screen", &cv_serverinfoscreen, 30},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Skin Select Spinning Speed", &cv_skinselectspin, 35},
|
||||
{IT_STRING | IT_CVAR, NULL, "Skin Select Spinning Speed", &cv_skinselectspin, 40},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Colorized Speedlines", &cv_coloredspeedlines, 45},
|
||||
{IT_STRING | IT_CVAR, NULL, "Colorized Sneakertrails", &cv_coloredsneakertrail, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Colorized Speedlines", &cv_coloredspeedlines, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Colorized Sneakertrails", &cv_coloredsneakertrail, 55},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Player Blendeffects", &cv_playerblendeffects, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Player Blendeffects", &cv_playerblendeffects, 65},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Bananadrag Jitter", &cv_bananajitter, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Bananadrag Jitter", &cv_bananajitter, 75},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Midair Driftsparks", &cv_airsparks, 80},
|
||||
{IT_STRING | IT_CVAR, NULL, "Midair Driftsparks", &cv_airsparks, 85},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Show Localskin Menus", &cv_showlocalskinmenus, 90},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show Localskin Menus", &cv_showlocalskinmenus, 95},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Uppercase Menu", &cv_menucaps, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "Uppercase Menu", &cv_menucaps, 105},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Keyboard Layout", &cv_keyboardlayout, 110},
|
||||
{IT_STRING | IT_CVAR, NULL, "Keyboard Layout", &cv_keyboardlayout, 115},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Less Midnight Channel Flicker", &cv_lessflicker, 120},
|
||||
{IT_STRING | IT_CVAR, NULL, "Less Midnight Channel Flicker", &cv_lessflicker, 125},
|
||||
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Hud...", &OP_SaturnHudDef, 130},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Sprite Distortion...", &OP_PlayerDistortDef, 135},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 140}, // uwu
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Hud...", &OP_SaturnHudDef, 135},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Sprite Distortion...", &OP_PlayerDistortDef, 140},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 145}, // uwu
|
||||
};
|
||||
|
||||
static const char* OP_SaturnTooltips[] =
|
||||
@@ -2219,6 +2220,7 @@ static const char* OP_SaturnTooltips[] =
|
||||
"How long can the game wait before it kicks you out from the server\nconnecting screen.",
|
||||
"Practice for online play! 0 = instant response.",
|
||||
"Simulate online input delay when hosting a server.\nValue choosen by Player with the lowest ping",
|
||||
"Show a screen before joining a server displaying important information about it",
|
||||
"How much speen do you want?",
|
||||
"Colourize the speedlines in your skincolor if you go fast enough!",
|
||||
"Colourize the sneaker flame trails in your skincolor!",
|
||||
@@ -3600,8 +3602,8 @@ static void M_ChangeCvar(INT32 choice)
|
||||
char s[20];
|
||||
float increment;
|
||||
|
||||
increment = (currentMenu->menuitems[itemOn].status & IT_CV_BIGFLOAT) ? 0.5f : (1.0f/16.0f);
|
||||
sprintf(s, "%f",FIXED_TO_FLOAT(cv->value)+(choice)*increment);
|
||||
increment = FIXED_TO_FLOAT(cv->value)+(choice)*((currentMenu->menuitems[itemOn].status & IT_CV_BIGFLOAT) ? 0.5f : (1.0f/16.0f));
|
||||
sprintf(s,"%ld%s",(long)increment,M_Ftrim(increment));
|
||||
CV_Set(cv, s);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1918,6 +1918,25 @@ char *M_GetToken(const char *inputString)
|
||||
return texturesToken;
|
||||
}
|
||||
|
||||
|
||||
const char * M_Ftrim (double f)
|
||||
{
|
||||
static char dig[9];/* "0." + 6 digits (6 is printf's default) */
|
||||
int i;
|
||||
/* I know I said it's the default, but just in case... */
|
||||
sprintf(dig, "%.6f", fabs(modf(f, &f)));
|
||||
/* trim trailing zeroes */
|
||||
for (i = strlen(dig)-1; dig[i] == '0'; --i)
|
||||
;
|
||||
if (dig[i] == '.')/* :NOTHING: */
|
||||
return "";
|
||||
else
|
||||
{
|
||||
dig[i + 1] = '\0';
|
||||
return &dig[1];/* skip the 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/** Count bits in a number.
|
||||
*/
|
||||
UINT8 M_CountBits(UINT32 num, UINT8 size)
|
||||
|
||||
@@ -104,6 +104,12 @@ boolean M_IsPathAbsolute (const char *path);
|
||||
void M_MkdirEach (const char *path, int start, int mode);
|
||||
void M_MkdirEachUntil (const char *path, int start, int end, int mode);
|
||||
|
||||
/*
|
||||
Return dot and then the fractional part of a float, without
|
||||
trailing zeros, or "" if the fractional part is zero.
|
||||
*/
|
||||
const char * M_Ftrim (double);
|
||||
|
||||
// counting bits, for weapon ammo code, usually
|
||||
FUNCMATH UINT8 M_CountBits(UINT32 num, UINT8 size);
|
||||
|
||||
|
||||
@@ -2750,8 +2750,6 @@ static void P_SetupPlayer(void)
|
||||
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
|
||||
I_mkdir(va("%s"PATHSEP"replay"PATHSEP"online", srb2home), 0755);
|
||||
G_RecordDemo(buf);
|
||||
if (dedicated)
|
||||
G_BeginRecording(); //this has to move here, since dedicated servers dont run got_mapcmd
|
||||
}
|
||||
|
||||
wantedcalcdelay = wantedfrequency*2;
|
||||
|
||||
@@ -782,10 +782,6 @@ void R_DrawSpan_8 (void)
|
||||
xposition <<= nflatshiftup; yposition <<= nflatshiftup;
|
||||
xstep <<= nflatshiftup; ystep <<= nflatshiftup;
|
||||
|
||||
source = ds_source;
|
||||
colormap = ds_colormap;
|
||||
dest = ylookup[ds_y] + columnofs[ds_x1];
|
||||
|
||||
if (dest+8 > deststop)
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user