mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart.git into boss
# Conflicts: # src/m_menu.c
This commit is contained in:
commit
f073218532
37 changed files with 670 additions and 674 deletions
|
|
@ -22,7 +22,7 @@ ifndef GCC295
|
||||||
#WFLAGS+=-Wno-packed
|
#WFLAGS+=-Wno-packed
|
||||||
endif
|
endif
|
||||||
ifndef RELAXWARNINGS
|
ifndef RELAXWARNINGS
|
||||||
WFLAGS+=-W
|
WFLAGS+=-W -pedantic
|
||||||
#WFLAGS+=-Wno-sign-compare
|
#WFLAGS+=-Wno-sign-compare
|
||||||
ifndef GCC295
|
ifndef GCC295
|
||||||
WFLAGS+=-Wno-div-by-zero
|
WFLAGS+=-Wno-div-by-zero
|
||||||
|
|
@ -46,6 +46,7 @@ endif
|
||||||
WFLAGS+=-Wpointer-arith -Wbad-function-cast
|
WFLAGS+=-Wpointer-arith -Wbad-function-cast
|
||||||
ifdef GCC45
|
ifdef GCC45
|
||||||
#WFLAGS+=-Wc++-compat
|
#WFLAGS+=-Wc++-compat
|
||||||
|
WFLAGS+=-std=gnu99
|
||||||
endif
|
endif
|
||||||
WFLAGS+=-Wcast-qual
|
WFLAGS+=-Wcast-qual
|
||||||
ifndef NOCASTALIGNWARN
|
ifndef NOCASTALIGNWARN
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2019-2020, James R.
|
Copyright 2019-2022, James R.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
|
@ -116,7 +116,7 @@ apng_default_flush (png_structp pngp)
|
||||||
if (!( pngp ))
|
if (!( pngp ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fflush((png_FILE_p)png_get_io_ptr);
|
fflush((png_FILE_p)png_get_io_ptr(pngp));
|
||||||
}
|
}
|
||||||
#endif/* PNG_STDIO_SUPPORTED */
|
#endif/* PNG_STDIO_SUPPORTED */
|
||||||
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@
|
||||||
#define WRITEANGLE(p,b) do { angle_t *p_tmp = (angle_t *)p; *p_tmp = (angle_t)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
#define WRITEANGLE(p,b) do { angle_t *p_tmp = (angle_t *)p; *p_tmp = (angle_t)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
// what is this?
|
||||||
#ifdef DEALIGNED
|
#if defined (__GNUC__) && defined (DEALIGNED)
|
||||||
#define READUINT8(p) ({ UINT8 *p_tmp = (void *)p; UINT8 b; memcpy(&b, p, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; b; })
|
#define READUINT8(p) ({ UINT8 *p_tmp = (void *)p; UINT8 b; memcpy(&b, p, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; b; })
|
||||||
#define READSINT8(p) ({ SINT8 *p_tmp = (void *)p; SINT8 b; memcpy(&b, p, sizeof( SINT8)); p_tmp++; p = (void *)p_tmp; b; })
|
#define READSINT8(p) ({ SINT8 *p_tmp = (void *)p; SINT8 b; memcpy(&b, p, sizeof( SINT8)); p_tmp++; p = (void *)p_tmp; b; })
|
||||||
#define READINT16(p) ({ INT16 *p_tmp = (void *)p; INT16 b; memcpy(&b, p, sizeof( INT16)); p_tmp++; p = (void *)p_tmp; b; })
|
#define READINT16(p) ({ INT16 *p_tmp = (void *)p; INT16 b; memcpy(&b, p, sizeof( INT16)); p_tmp++; p = (void *)p_tmp; b; })
|
||||||
|
|
@ -55,26 +55,15 @@
|
||||||
#define READFIXED(p) ({ fixed_t *p_tmp = (void *)p; fixed_t b; memcpy(&b, p, sizeof(fixed_t)); p_tmp++; p = (void *)p_tmp; b; })
|
#define READFIXED(p) ({ fixed_t *p_tmp = (void *)p; fixed_t b; memcpy(&b, p, sizeof(fixed_t)); p_tmp++; p = (void *)p_tmp; b; })
|
||||||
#define READANGLE(p) ({ angle_t *p_tmp = (void *)p; angle_t b; memcpy(&b, p, sizeof(angle_t)); p_tmp++; p = (void *)p_tmp; b; })
|
#define READANGLE(p) ({ angle_t *p_tmp = (void *)p; angle_t b; memcpy(&b, p, sizeof(angle_t)); p_tmp++; p = (void *)p_tmp; b; })
|
||||||
#else
|
#else
|
||||||
#define READUINT8(p) ({ UINT8 *p_tmp = ( UINT8 *)p; UINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READUINT8(p) ((UINT8*)(p = (void*)&((UINT8*)p)[1]))[-1]
|
||||||
#define READSINT8(p) ({ SINT8 *p_tmp = ( SINT8 *)p; SINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READSINT8(p) ((SINT8*)(p = (void*)&((SINT8*)p)[1]))[-1]
|
||||||
#define READINT16(p) ({ INT16 *p_tmp = ( INT16 *)p; INT16 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READINT16(p) ((INT16*)(p = (void*)&((INT16*)p)[1]))[-1]
|
||||||
#define READUINT16(p) ({ UINT16 *p_tmp = ( UINT16 *)p; UINT16 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READUINT16(p) ((UINT16*)(p = (void*)&((UINT16*)p)[1]))[-1]
|
||||||
#define READINT32(p) ({ INT32 *p_tmp = ( INT32 *)p; INT32 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READINT32(p) ((INT32*)(p = (void*)&((INT32*)p)[1]))[-1]
|
||||||
#define READUINT32(p) ({ UINT32 *p_tmp = ( UINT32 *)p; UINT32 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READUINT32(p) ((UINT32*)(p = (void*)&((UINT32*)p)[1]))[-1]
|
||||||
#define READCHAR(p) ({ char *p_tmp = ( char *)p; char b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READCHAR(p) ((char*)(p = (void*)&((char*)p)[1]))[-1]
|
||||||
#define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READFIXED(p) ((fixed_t*)(p = (void*)&((fixed_t*)p)[1]))[-1]
|
||||||
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READANGLE(p) ((angle_t*)(p = (void*)&((angle_t*)p)[1]))[-1]
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define READUINT8(p) *(( UINT8 *)p)++
|
|
||||||
#define READSINT8(p) *(( SINT8 *)p)++
|
|
||||||
#define READINT16(p) *(( INT16 *)p)++
|
|
||||||
#define READUINT16(p) *(( UINT16 *)p)++
|
|
||||||
#define READINT32(p) *(( INT32 *)p)++
|
|
||||||
#define READUINT32(p) *(( UINT32 *)p)++
|
|
||||||
#define READCHAR(p) *(( char *)p)++
|
|
||||||
#define READFIXED(p) *((fixed_t *)p)++
|
|
||||||
#define READANGLE(p) *((angle_t *)p)++
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else //SRB2_BIG_ENDIAN
|
#else //SRB2_BIG_ENDIAN
|
||||||
|
|
@ -137,15 +126,15 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
|
||||||
return (ucp[3] << 24) | (ucp[2] << 16) | (ucp[1] << 8) | ucp[0];
|
return (ucp[3] << 24) | (ucp[2] << 16) | (ucp[1] << 8) | ucp[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
#define READUINT8(p) ({ UINT8 *p_tmp = ( UINT8 *)p; UINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READUINT8(p) ((UINT8*)(p = (void*)&((UINT8*)p)[1]))[-1]
|
||||||
#define READSINT8(p) ({ SINT8 *p_tmp = ( SINT8 *)p; SINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READSINT8(p) ((SINT8*)(p = (void*)&((SINT8*)p)[1]))[-1]
|
||||||
#define READINT16(p) ({ INT16 *p_tmp = ( INT16 *)p; INT16 b = readshort(p); p_tmp++; p = (void *)p_tmp; b; })
|
#define READINT16(p) readshort(&((INT16*)(p = (void*)&((INT16*)p)[1]))[-1])
|
||||||
#define READUINT16(p) ({ UINT16 *p_tmp = ( UINT16 *)p; UINT16 b = readushort(p); p_tmp++; p = (void *)p_tmp; b; })
|
#define READUINT16(p) readushort(&((UINT16*)(p = (void*)&((UINT16*)p)[1]))[-1])
|
||||||
#define READINT32(p) ({ INT32 *p_tmp = ( INT32 *)p; INT32 b = readlong(p); p_tmp++; p = (void *)p_tmp; b; })
|
#define READINT32(p) readlong(&((INT32*)(p = (void*)&((INT32*)p)[1]))[-1])
|
||||||
#define READUINT32(p) ({ UINT32 *p_tmp = ( UINT32 *)p; UINT32 b = readulong(p); p_tmp++; p = (void *)p_tmp; b; })
|
#define READUINT32(p) readulong(&((UINT32*)(p = (void*)&((UINT32*)p)[1]))
|
||||||
#define READCHAR(p) ({ char *p_tmp = ( char *)p; char b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
#define READCHAR(p) ((char*)(p = (void*)&((char*)p)[1]))[-1]
|
||||||
#define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b = readlong(p); p_tmp++; p = (void *)p_tmp; b; })
|
#define READFIXED(p) readlong(&((fixed_t*)(p = (void*)&((fixed_t*)p)[1]))[-1])
|
||||||
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = readulong(p); p_tmp++; p = (void *)p_tmp; b; })
|
#define READANGLE(p) readulong(&((angle_t*)(p = (void*)&((angle_t*)p)[1]))[-1])
|
||||||
#endif //SRB2_BIG_ENDIAN
|
#endif //SRB2_BIG_ENDIAN
|
||||||
|
|
||||||
#undef DEALIGNED
|
#undef DEALIGNED
|
||||||
|
|
@ -156,20 +145,6 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
|
||||||
|
|
||||||
#define SKIPSTRING(p) while (READCHAR(p) != '\0')
|
#define SKIPSTRING(p) while (READCHAR(p) != '\0')
|
||||||
|
|
||||||
#define READSTRINGN(p,s,n) ({ size_t tmp_i = 0; for (; tmp_i < n && (s[tmp_i] = READCHAR(p)) != '\0'; tmp_i++); s[tmp_i] = '\0';})
|
#define READSTRINGN(p,s,n) do { size_t tmp_i = 0; for (; tmp_i < n && (s[tmp_i] = READCHAR(p)) != '\0'; tmp_i++); s[tmp_i] = '\0';} while (0)
|
||||||
#define READSTRING(p,s) ({ size_t tmp_i = 0; for (; (s[tmp_i] = READCHAR(p)) != '\0'; tmp_i++); s[tmp_i] = '\0';})
|
#define READSTRING(p,s) do { size_t tmp_i = 0; for (; (s[tmp_i] = READCHAR(p)) != '\0'; tmp_i++); s[tmp_i] = '\0';} while (0)
|
||||||
#define READMEM(p,s,n) ({ memcpy(s, p, n); p += n; })
|
#define READMEM(p,s,n) do { memcpy(s, p, n); p += n; } while (0)
|
||||||
|
|
||||||
#if 0 // old names
|
|
||||||
#define WRITEBYTE(p,b) WRITEUINT8(p,b)
|
|
||||||
#define WRITESHORT(p,b) WRITEINT16(p,b)
|
|
||||||
#define WRITEUSHORT(p,b) WRITEUINT16(p,b)
|
|
||||||
#define WRITELONG(p,b) WRITEINT32(p,b)
|
|
||||||
#define WRITEULONG(p,b) WRITEUINT32(p,b)
|
|
||||||
|
|
||||||
#define READBYTE(p) READUINT8(p)
|
|
||||||
#define READSHORT(p) READINT16(p)
|
|
||||||
#define READUSHORT(p) READUINT16(p)
|
|
||||||
#define READLONG(p) READINT32(p)
|
|
||||||
#define READULONG(p) READUINT32(p)
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -1549,7 +1549,7 @@ static boolean CL_FinishedFileList(void)
|
||||||
"You may load server addons (if any), and wait for a slot.\n"
|
"You may load server addons (if any), and wait for a slot.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||||
), M_ConfirmConnect, MM_EVENTHANDLER);
|
), FUNCPTRCAST (M_ConfirmConnect), MM_EVENTHANDLER);
|
||||||
cl_mode = CL_CONFIRMCONNECT;
|
cl_mode = CL_CONFIRMCONNECT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1616,13 +1616,13 @@ static boolean CL_FinishedFileList(void)
|
||||||
"You may download, load server addons, and wait for a slot.\n"
|
"You may download, load server addons, and wait for a slot.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||||
), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
|
), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER);
|
||||||
else
|
else
|
||||||
M_StartMessage(va(M_GetText(
|
M_StartMessage(va(M_GetText(
|
||||||
"Download of %s additional content is required to join.\n"
|
"Download of %s additional content is required to join.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||||
), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
|
), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER);
|
||||||
|
|
||||||
Z_Free(downloadsize);
|
Z_Free(downloadsize);
|
||||||
cl_mode = CL_CONFIRMCONNECT;
|
cl_mode = CL_CONFIRMCONNECT;
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ typedef struct
|
||||||
UINT8 iteration;
|
UINT8 iteration;
|
||||||
UINT32 position;
|
UINT32 position;
|
||||||
UINT16 size;
|
UINT16 size;
|
||||||
UINT8 data[0]; // Size is variable using hardware_MAXPACKETLENGTH
|
UINT8 data[]; // Size is variable using hardware_MAXPACKETLENGTH
|
||||||
} ATTRPACK filetx_pak;
|
} ATTRPACK filetx_pak;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
@ -227,7 +227,7 @@ typedef struct
|
||||||
UINT8 fileid;
|
UINT8 fileid;
|
||||||
UINT8 iteration;
|
UINT8 iteration;
|
||||||
UINT8 numsegments;
|
UINT8 numsegments;
|
||||||
fileacksegment_t segments[0];
|
fileacksegment_t segments[];
|
||||||
} ATTRPACK fileack_pak;
|
} ATTRPACK fileack_pak;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
@ -358,8 +358,8 @@ typedef struct
|
||||||
servertics_pak serverpak; // 132495 bytes (more around 360, no?)
|
servertics_pak serverpak; // 132495 bytes (more around 360, no?)
|
||||||
serverconfig_pak servercfg; // 773 bytes
|
serverconfig_pak servercfg; // 773 bytes
|
||||||
UINT8 textcmd[MAXTEXTCMD+1]; // 66049 bytes (wut??? 64k??? More like 257 bytes...)
|
UINT8 textcmd[MAXTEXTCMD+1]; // 66049 bytes (wut??? 64k??? More like 257 bytes...)
|
||||||
filetx_pak filetxpak; // 139 bytes
|
char filetxpak[sizeof (filetx_pak)];// 139 bytes
|
||||||
fileack_pak fileack;
|
char fileack[sizeof (fileack_pak)];
|
||||||
UINT8 filereceived;
|
UINT8 filereceived;
|
||||||
clientconfig_pak clientcfg; // 136 bytes
|
clientconfig_pak clientcfg; // 136 bytes
|
||||||
UINT8 md5sum[16];
|
UINT8 md5sum[16];
|
||||||
|
|
|
||||||
|
|
@ -820,7 +820,7 @@ void D_SRB2Loop(void)
|
||||||
|
|
||||||
// Update display, next frame, with current state.
|
// Update display, next frame, with current state.
|
||||||
// (Only display if not already done for frame interp)
|
// (Only display if not already done for frame interp)
|
||||||
cv_frameinterpolation.value == 0 ? D_Display() : 0;
|
cv_frameinterpolation.value == 0 ? D_Display() : (void)0;
|
||||||
|
|
||||||
if (moviemode)
|
if (moviemode)
|
||||||
M_SaveFrame();
|
M_SaveFrame();
|
||||||
|
|
@ -830,7 +830,7 @@ void D_SRB2Loop(void)
|
||||||
else if (rendertimeout < entertic) // in case the server hang or netsplit
|
else if (rendertimeout < entertic) // in case the server hang or netsplit
|
||||||
{
|
{
|
||||||
// (Only display if not already done for frame interp)
|
// (Only display if not already done for frame interp)
|
||||||
cv_frameinterpolation.value == 0 ? D_Display() : 0;
|
cv_frameinterpolation.value == 0 ? D_Display() : (void)0;
|
||||||
|
|
||||||
if (moviemode)
|
if (moviemode)
|
||||||
M_SaveFrame();
|
M_SaveFrame();
|
||||||
|
|
|
||||||
|
|
@ -913,11 +913,13 @@ static void DebugPrintpacket(const char *header)
|
||||||
case PT_SERVERREFUSE:
|
case PT_SERVERREFUSE:
|
||||||
fprintf(debugfile, " reason %s\n", netbuffer->u.serverrefuse.reason);
|
fprintf(debugfile, " reason %s\n", netbuffer->u.serverrefuse.reason);
|
||||||
break;
|
break;
|
||||||
case PT_FILEFRAGMENT:
|
case PT_FILEFRAGMENT: {
|
||||||
|
filetx_pak *pak = (void*)&netbuffer->u.filetxpak;
|
||||||
fprintf(debugfile, " fileid %d datasize %d position %u\n",
|
fprintf(debugfile, " fileid %d datasize %d position %u\n",
|
||||||
netbuffer->u.filetxpak.fileid, (UINT16)SHORT(netbuffer->u.filetxpak.size),
|
pak->fileid, (UINT16)SHORT(pak->size),
|
||||||
(UINT32)LONG(netbuffer->u.filetxpak.position));
|
(UINT32)LONG(pak->position));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case PT_REQUESTFILE:
|
case PT_REQUESTFILE:
|
||||||
default: // write as a raw packet
|
default: // write as a raw packet
|
||||||
fprintfstringnewline((char *)netbuffer->u.textcmd,
|
fprintfstringnewline((char *)netbuffer->u.textcmd,
|
||||||
|
|
|
||||||
|
|
@ -416,14 +416,13 @@ static CV_PossibleValue_t kartdebugitem_cons_t[] =
|
||||||
consvar_t cv_kartdebugitem = CVAR_INIT ("kartdebugitem", "0", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugitem_cons_t, NULL);
|
consvar_t cv_kartdebugitem = CVAR_INIT ("kartdebugitem", "0", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugitem_cons_t, NULL);
|
||||||
static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugamount_cons_t, NULL);
|
consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugamount_cons_t, NULL);
|
||||||
consvar_t cv_kartallowgiveitem = CVAR_INIT ("kartallowgiveitem",
|
|
||||||
#ifdef DEVELOP
|
#ifdef DEVELOP
|
||||||
"Yes",
|
#define VALUE "Yes"
|
||||||
#else
|
#else
|
||||||
"No",
|
#define VALUE "No"
|
||||||
#endif
|
#endif
|
||||||
CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_YesNo, NULL
|
consvar_t cv_kartallowgiveitem = CVAR_INIT ("kartallowgiveitem", VALUE, CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_YesNo, NULL);
|
||||||
);
|
#undef VALUE
|
||||||
|
|
||||||
consvar_t cv_kartdebugdistribution = CVAR_INIT ("kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugdistribution = CVAR_INIT ("kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
|
||||||
consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
|
||||||
|
|
|
||||||
|
|
@ -1124,7 +1124,7 @@ void FileSendTicker(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build a packet containing a file fragment
|
// Build a packet containing a file fragment
|
||||||
p = &netbuffer->u.filetxpak;
|
p = (void*)&netbuffer->u.filetxpak;
|
||||||
fragmentsize = FILEFRAGMENTSIZE;
|
fragmentsize = FILEFRAGMENTSIZE;
|
||||||
if (f->size-transfer[i].position < fragmentsize)
|
if (f->size-transfer[i].position < fragmentsize)
|
||||||
fragmentsize = f->size-transfer[i].position;
|
fragmentsize = f->size-transfer[i].position;
|
||||||
|
|
@ -1166,7 +1166,7 @@ void FileSendTicker(void)
|
||||||
|
|
||||||
void PT_FileAck(void)
|
void PT_FileAck(void)
|
||||||
{
|
{
|
||||||
fileack_pak *packet = &netbuffer->u.fileack;
|
fileack_pak *packet = (void*)&netbuffer->u.fileack;
|
||||||
INT32 node = doomcom->remotenode;
|
INT32 node = doomcom->remotenode;
|
||||||
filetran_t *trans = &transfer[node];
|
filetran_t *trans = &transfer[node];
|
||||||
INT32 i, j;
|
INT32 i, j;
|
||||||
|
|
@ -1310,10 +1310,11 @@ void FileReceiveTicker(void)
|
||||||
|
|
||||||
void PT_FileFragment(void)
|
void PT_FileFragment(void)
|
||||||
{
|
{
|
||||||
INT32 filenum = netbuffer->u.filetxpak.fileid;
|
filetx_pak *pak = (void*)&netbuffer->u.filetxpak;
|
||||||
|
INT32 filenum = pak->fileid;
|
||||||
fileneeded_t *file = &fileneeded[filenum];
|
fileneeded_t *file = &fileneeded[filenum];
|
||||||
UINT32 fragmentpos = LONG(netbuffer->u.filetxpak.position);
|
UINT32 fragmentpos = LONG(pak->position);
|
||||||
UINT16 fragmentsize = SHORT(netbuffer->u.filetxpak.size);
|
UINT16 fragmentsize = SHORT(pak->size);
|
||||||
UINT16 boundedfragmentsize = doomcom->datalength - BASEPACKETSIZE - sizeof(netbuffer->u.filetxpak);
|
UINT16 boundedfragmentsize = doomcom->datalength - BASEPACKETSIZE - sizeof(netbuffer->u.filetxpak);
|
||||||
char *filename;
|
char *filename;
|
||||||
|
|
||||||
|
|
@ -1381,7 +1382,7 @@ void PT_FileFragment(void)
|
||||||
CONS_Printf("\r%s...\n",filename);
|
CONS_Printf("\r%s...\n",filename);
|
||||||
|
|
||||||
file->currentsize = 0;
|
file->currentsize = 0;
|
||||||
file->totalsize = LONG(netbuffer->u.filetxpak.filesize);
|
file->totalsize = LONG(pak->filesize);
|
||||||
file->ackresendposition = UINT32_MAX; // Only used for resumed downloads
|
file->ackresendposition = UINT32_MAX; // Only used for resumed downloads
|
||||||
|
|
||||||
file->receivedfragments = calloc(file->totalsize / fragmentsize + 1, sizeof(*file->receivedfragments));
|
file->receivedfragments = calloc(file->totalsize / fragmentsize + 1, sizeof(*file->receivedfragments));
|
||||||
|
|
@ -1397,7 +1398,7 @@ void PT_FileFragment(void)
|
||||||
if (fragmentpos >= file->totalsize)
|
if (fragmentpos >= file->totalsize)
|
||||||
I_Error("Invalid file fragment\n");
|
I_Error("Invalid file fragment\n");
|
||||||
|
|
||||||
file->iteration = max(file->iteration, netbuffer->u.filetxpak.iteration);
|
file->iteration = max(file->iteration, pak->iteration);
|
||||||
|
|
||||||
if (!file->receivedfragments[fragmentpos / fragmentsize]) // Not received yet
|
if (!file->receivedfragments[fragmentpos / fragmentsize]) // Not received yet
|
||||||
{
|
{
|
||||||
|
|
@ -1405,7 +1406,7 @@ void PT_FileFragment(void)
|
||||||
|
|
||||||
// We can receive packets in the wrong order, anyway all OSes support gaped files
|
// We can receive packets in the wrong order, anyway all OSes support gaped files
|
||||||
fseek(file->file, fragmentpos, SEEK_SET);
|
fseek(file->file, fragmentpos, SEEK_SET);
|
||||||
if (fragmentsize && fwrite(netbuffer->u.filetxpak.data, boundedfragmentsize, 1, file->file) != 1)
|
if (fragmentsize && fwrite(pak->data, boundedfragmentsize, 1, file->file) != 1)
|
||||||
I_Error("Can't write to %s: %s\n",filename, M_FileError(file->file));
|
I_Error("Can't write to %s: %s\n",filename, M_FileError(file->file));
|
||||||
file->currentsize += boundedfragmentsize;
|
file->currentsize += boundedfragmentsize;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -673,7 +673,7 @@ void LUA_SetActionByName(void *state, const char *actiontocompare)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum actionnum LUA_GetActionNumByName(const char *actiontocompare)
|
size_t LUA_GetActionNumByName(const char *actiontocompare)
|
||||||
{
|
{
|
||||||
size_t z;
|
size_t z;
|
||||||
for (z = 0; actionpointers[z].name; z++)
|
for (z = 0; actionpointers[z].name; z++)
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,6 @@
|
||||||
boolean LUA_SetLuaAction(void *state, const char *actiontocompare);
|
boolean LUA_SetLuaAction(void *state, const char *actiontocompare);
|
||||||
const char *LUA_GetActionName(void *action);
|
const char *LUA_GetActionName(void *action);
|
||||||
void LUA_SetActionByName(void *state, const char *actiontocompare);
|
void LUA_SetActionByName(void *state, const char *actiontocompare);
|
||||||
enum actionnum LUA_GetActionNumByName(const char *actiontocompare);
|
size_t LUA_GetActionNumByName(const char *actiontocompare);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ void deh_strlcpy(char *dst, const char *src, size_t size, const char *warntext)
|
||||||
strlcpy(dst, src, size);
|
strlcpy(dst, src, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTRINLINE static FUNCINLINE char myfget_color(MYFILE *f)
|
ATTRINLINE static FUNCINLINE unsigned char myfget_color(MYFILE *f)
|
||||||
{
|
{
|
||||||
char c = *f->curpos++;
|
char c = *f->curpos++;
|
||||||
if (c == '^') // oh, nevermind then.
|
if (c == '^') // oh, nevermind then.
|
||||||
|
|
|
||||||
|
|
@ -409,4 +409,12 @@ typedef UINT64 precise_t;
|
||||||
#define intsign(n) \
|
#define intsign(n) \
|
||||||
((n) < 0 ? -1 : (n) > 0 ? 1 : 0)
|
((n) < 0 ? -1 : (n) > 0 ? 1 : 0)
|
||||||
|
|
||||||
|
// ISO C forbids function pointer -> void pointer cast but
|
||||||
|
// if it's wrapped in a struct, we can take a pointer to
|
||||||
|
// that struct and it's fine...
|
||||||
|
|
||||||
|
// Cast function pointer to (void*)
|
||||||
|
#define FUNCPTRCAST(p) ((union{void(*f)(void);void*v;})\
|
||||||
|
{(void(*)(void))p}).v
|
||||||
|
|
||||||
#endif //__DOOMTYPE__
|
#endif //__DOOMTYPE__
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ typedef struct
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
INT32 numpts;
|
INT32 numpts;
|
||||||
polyvertex_t pts[0];
|
polyvertex_t pts[];
|
||||||
} poly_t;
|
} poly_t;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
@ -140,4 +140,4 @@ void HWR_SetPalette(RGBA_t *palette);
|
||||||
extern INT32 patchformat;
|
extern INT32 patchformat;
|
||||||
extern INT32 textureformat;
|
extern INT32 textureformat;
|
||||||
|
|
||||||
#endif //_HW_GLOB_
|
#endif //_HW_GLOB_
|
||||||
|
|
|
||||||
|
|
@ -144,13 +144,13 @@ static inline void md2_printModelInfo (model_t *model)
|
||||||
#ifdef HAVE_PNG
|
#ifdef HAVE_PNG
|
||||||
static void PNG_error(png_structp PNG, png_const_charp pngtext)
|
static void PNG_error(png_structp PNG, png_const_charp pngtext)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_RENDER, "libpng error at %p: %s", PNG, pngtext);
|
CONS_Debug(DBG_RENDER, "libpng error at %p: %s", (void*)PNG, pngtext);
|
||||||
//I_Error("libpng error at %p: %s", PNG, pngtext);
|
//I_Error("libpng error at %p: %s", PNG, pngtext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PNG_warn(png_structp PNG, png_const_charp pngtext)
|
static void PNG_warn(png_structp PNG, png_const_charp pngtext)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", PNG, pngtext);
|
CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", (void*)PNG, pngtext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_t *grpatch)
|
static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_t *grpatch)
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,7 @@ boolean SetupGLfunc(void)
|
||||||
{
|
{
|
||||||
#ifndef STATIC_OPENGL
|
#ifndef STATIC_OPENGL
|
||||||
#define GETOPENGLFUNC(func, proc) \
|
#define GETOPENGLFUNC(func, proc) \
|
||||||
func = GetGLFunc(#proc); \
|
*(void**)&func = GetGLFunc(#proc); \
|
||||||
if (!func) \
|
if (!func) \
|
||||||
{ \
|
{ \
|
||||||
GL_MSG_Warning("failed to get OpenGL function: %s", #proc); \
|
GL_MSG_Warning("failed to get OpenGL function: %s", #proc); \
|
||||||
|
|
@ -900,46 +900,46 @@ static struct {
|
||||||
|
|
||||||
void SetupGLFunc4(void)
|
void SetupGLFunc4(void)
|
||||||
{
|
{
|
||||||
pglActiveTexture = GetGLFunc("glActiveTexture");
|
*(void**)&pglActiveTexture = GetGLFunc("glActiveTexture");
|
||||||
pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2f");
|
*(void**)&pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2f");
|
||||||
pglClientActiveTexture = GetGLFunc("glClientActiveTexture");
|
*(void**)&pglClientActiveTexture = GetGLFunc("glClientActiveTexture");
|
||||||
pglMultiTexCoord2fv = GetGLFunc("glMultiTexCoord2fv");
|
*(void**)&pglMultiTexCoord2fv = GetGLFunc("glMultiTexCoord2fv");
|
||||||
|
|
||||||
/* 1.5 funcs */
|
/* 1.5 funcs */
|
||||||
pglGenBuffers = GetGLFunc("glGenBuffers");
|
*(void**)&pglGenBuffers = GetGLFunc("glGenBuffers");
|
||||||
pglBindBuffer = GetGLFunc("glBindBuffer");
|
*(void**)&pglBindBuffer = GetGLFunc("glBindBuffer");
|
||||||
pglBufferData = GetGLFunc("glBufferData");
|
*(void**)&pglBufferData = GetGLFunc("glBufferData");
|
||||||
pglDeleteBuffers = GetGLFunc("glDeleteBuffers");
|
*(void**)&pglDeleteBuffers = GetGLFunc("glDeleteBuffers");
|
||||||
|
|
||||||
/* 2.0 funcs */
|
/* 2.0 funcs */
|
||||||
pglBlendEquation = GetGLFunc("glBlendEquation");
|
*(void**)&pglBlendEquation = GetGLFunc("glBlendEquation");
|
||||||
|
|
||||||
#ifdef GL_SHADERS
|
#ifdef GL_SHADERS
|
||||||
pglCreateShader = GetGLFunc("glCreateShader");
|
*(void**)&pglCreateShader = GetGLFunc("glCreateShader");
|
||||||
pglShaderSource = GetGLFunc("glShaderSource");
|
*(void**)&pglShaderSource = GetGLFunc("glShaderSource");
|
||||||
pglCompileShader = GetGLFunc("glCompileShader");
|
*(void**)&pglCompileShader = GetGLFunc("glCompileShader");
|
||||||
pglGetShaderiv = GetGLFunc("glGetShaderiv");
|
*(void**)&pglGetShaderiv = GetGLFunc("glGetShaderiv");
|
||||||
pglGetShaderInfoLog = GetGLFunc("glGetShaderInfoLog");
|
*(void**)&pglGetShaderInfoLog = GetGLFunc("glGetShaderInfoLog");
|
||||||
pglDeleteShader = GetGLFunc("glDeleteShader");
|
*(void**)&pglDeleteShader = GetGLFunc("glDeleteShader");
|
||||||
pglCreateProgram = GetGLFunc("glCreateProgram");
|
*(void**)&pglCreateProgram = GetGLFunc("glCreateProgram");
|
||||||
pglDeleteProgram = GetGLFunc("glDeleteProgram");
|
*(void**)&pglDeleteProgram = GetGLFunc("glDeleteProgram");
|
||||||
pglAttachShader = GetGLFunc("glAttachShader");
|
*(void**)&pglAttachShader = GetGLFunc("glAttachShader");
|
||||||
pglLinkProgram = GetGLFunc("glLinkProgram");
|
*(void**)&pglLinkProgram = GetGLFunc("glLinkProgram");
|
||||||
pglGetProgramiv = GetGLFunc("glGetProgramiv");
|
*(void**)&pglGetProgramiv = GetGLFunc("glGetProgramiv");
|
||||||
pglUseProgram = GetGLFunc("glUseProgram");
|
*(void**)&pglUseProgram = GetGLFunc("glUseProgram");
|
||||||
pglUniform1i = GetGLFunc("glUniform1i");
|
*(void**)&pglUniform1i = GetGLFunc("glUniform1i");
|
||||||
pglUniform1f = GetGLFunc("glUniform1f");
|
*(void**)&pglUniform1f = GetGLFunc("glUniform1f");
|
||||||
pglUniform2f = GetGLFunc("glUniform2f");
|
*(void**)&pglUniform2f = GetGLFunc("glUniform2f");
|
||||||
pglUniform3f = GetGLFunc("glUniform3f");
|
*(void**)&pglUniform3f = GetGLFunc("glUniform3f");
|
||||||
pglUniform4f = GetGLFunc("glUniform4f");
|
*(void**)&pglUniform4f = GetGLFunc("glUniform4f");
|
||||||
pglUniform1fv = GetGLFunc("glUniform1fv");
|
*(void**)&pglUniform1fv = GetGLFunc("glUniform1fv");
|
||||||
pglUniform2fv = GetGLFunc("glUniform2fv");
|
*(void**)&pglUniform2fv = GetGLFunc("glUniform2fv");
|
||||||
pglUniform3fv = GetGLFunc("glUniform3fv");
|
*(void**)&pglUniform3fv = GetGLFunc("glUniform3fv");
|
||||||
pglGetUniformLocation = GetGLFunc("glGetUniformLocation");
|
*(void**)&pglGetUniformLocation = GetGLFunc("glGetUniformLocation");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// GLU
|
// GLU
|
||||||
pgluBuild2DMipmaps = GetGLFunc("gluBuild2DMipmaps");
|
*(void**)&pgluBuild2DMipmaps = GetGLFunc("gluBuild2DMipmaps");
|
||||||
}
|
}
|
||||||
|
|
||||||
// jimita
|
// jimita
|
||||||
|
|
|
||||||
|
|
@ -80,10 +80,10 @@ static HMODULE WS_getfunctions(HMODULE tmp)
|
||||||
{
|
{
|
||||||
if (tmp != NULL)
|
if (tmp != NULL)
|
||||||
{
|
{
|
||||||
WS_getaddrinfo = (p_getaddrinfo)(LPVOID)GetProcAddress(tmp, "getaddrinfo");
|
*(void**)&WS_getaddrinfo = FUNCPTRCAST(GetProcAddress(tmp, "getaddrinfo"));
|
||||||
if (WS_getaddrinfo == NULL)
|
if (WS_getaddrinfo == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
WS_freeaddrinfo = (p_freeaddrinfo)(LPVOID)GetProcAddress(tmp, "freeaddrinfo");
|
*(void**)&WS_freeaddrinfo = FUNCPTRCAST(GetProcAddress(tmp, "freeaddrinfo"));
|
||||||
if (WS_freeaddrinfo == NULL)
|
if (WS_freeaddrinfo == NULL)
|
||||||
{
|
{
|
||||||
WS_getaddrinfo = NULL;
|
WS_getaddrinfo = NULL;
|
||||||
|
|
|
||||||
|
|
@ -7722,7 +7722,7 @@ void K_UpdateDistanceFromFinishLine(player_t *const player)
|
||||||
const boolean useshortcuts = false;
|
const boolean useshortcuts = false;
|
||||||
const boolean huntbackwards = false;
|
const boolean huntbackwards = false;
|
||||||
boolean pathfindsuccess = false;
|
boolean pathfindsuccess = false;
|
||||||
path_t pathtofinish = {};
|
path_t pathtofinish = {0};
|
||||||
|
|
||||||
pathfindsuccess =
|
pathfindsuccess =
|
||||||
K_PathfindToWaypoint(player->nextwaypoint, finishline, &pathtofinish, useshortcuts, huntbackwards);
|
K_PathfindToWaypoint(player->nextwaypoint, finishline, &pathtofinish, useshortcuts, huntbackwards);
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ boolean K_PathfindAStar(path_t *const path, pathfindsetup_t *const pathfindsetup
|
||||||
else if (pathfindsetup->startnodedata == pathfindsetup->endnodedata)
|
else if (pathfindsetup->startnodedata == pathfindsetup->endnodedata)
|
||||||
{
|
{
|
||||||
// At the destination, return a simple 1 node path
|
// At the destination, return a simple 1 node path
|
||||||
pathfindnode_t singlenode = {};
|
pathfindnode_t singlenode = {0};
|
||||||
singlenode.camefrom = NULL;
|
singlenode.camefrom = NULL;
|
||||||
singlenode.nodedata = pathfindsetup->endnodedata;
|
singlenode.nodedata = pathfindsetup->endnodedata;
|
||||||
singlenode.heapindex = SIZE_MAX;
|
singlenode.heapindex = SIZE_MAX;
|
||||||
|
|
@ -311,8 +311,8 @@ boolean K_PathfindAStar(path_t *const path, pathfindsetup_t *const pathfindsetup
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bheap_t openset = {};
|
bheap_t openset = {0};
|
||||||
bheapitem_t poppedbheapitem = {};
|
bheapitem_t poppedbheapitem = {0};
|
||||||
pathfindnode_t *nodesarray = NULL;
|
pathfindnode_t *nodesarray = NULL;
|
||||||
pathfindnode_t **closedset = NULL;
|
pathfindnode_t **closedset = NULL;
|
||||||
pathfindnode_t *newnode = NULL;
|
pathfindnode_t *newnode = NULL;
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ static void K_CompareOverlappingWaypoint
|
||||||
const boolean useshortcuts = false;
|
const boolean useshortcuts = false;
|
||||||
const boolean huntbackwards = false;
|
const boolean huntbackwards = false;
|
||||||
boolean pathfindsuccess = false;
|
boolean pathfindsuccess = false;
|
||||||
path_t pathtofinish = {};
|
path_t pathtofinish = {0};
|
||||||
|
|
||||||
pathfindsuccess =
|
pathfindsuccess =
|
||||||
K_PathfindToWaypoint(checkwaypoint, finishline, &pathtofinish, useshortcuts, huntbackwards);
|
K_PathfindToWaypoint(checkwaypoint, finishline, &pathtofinish, useshortcuts, huntbackwards);
|
||||||
|
|
@ -1064,7 +1064,7 @@ boolean K_PathfindToWaypoint(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pathfindsetup_t pathfindsetup = {};
|
pathfindsetup_t pathfindsetup = {0};
|
||||||
getconnectednodesfunc nextnodesfunc = K_WaypointPathfindGetNext;
|
getconnectednodesfunc nextnodesfunc = K_WaypointPathfindGetNext;
|
||||||
getnodeconnectioncostsfunc nodecostsfunc = K_WaypointPathfindGetNextCosts;
|
getnodeconnectioncostsfunc nodecostsfunc = K_WaypointPathfindGetNextCosts;
|
||||||
getnodeheuristicfunc heuristicfunc = K_WaypointPathfindGetHeuristic;
|
getnodeheuristicfunc heuristicfunc = K_WaypointPathfindGetHeuristic;
|
||||||
|
|
@ -1158,8 +1158,8 @@ waypoint_t *K_GetNextWaypointToDestination(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
path_t pathtowaypoint = {};
|
path_t pathtowaypoint = {0};
|
||||||
pathfindsetup_t pathfindsetup = {};
|
pathfindsetup_t pathfindsetup = {0};
|
||||||
boolean pathfindsuccess = false;
|
boolean pathfindsuccess = false;
|
||||||
getconnectednodesfunc nextnodesfunc = K_WaypointPathfindGetNext;
|
getconnectednodesfunc nextnodesfunc = K_WaypointPathfindGetNext;
|
||||||
getnodeconnectioncostsfunc nodecostsfunc = K_WaypointPathfindGetNextCosts;
|
getnodeconnectioncostsfunc nodecostsfunc = K_WaypointPathfindGetNextCosts;
|
||||||
|
|
@ -1559,7 +1559,7 @@ static UINT32 K_SetupCircuitLength(void)
|
||||||
{
|
{
|
||||||
// Create a fake finishline waypoint, then try and pathfind to the finishline from it
|
// Create a fake finishline waypoint, then try and pathfind to the finishline from it
|
||||||
waypoint_t fakefinishline = *finishline;
|
waypoint_t fakefinishline = *finishline;
|
||||||
path_t bestcircuitpath = {};
|
path_t bestcircuitpath = {0};
|
||||||
const boolean useshortcuts = false;
|
const boolean useshortcuts = false;
|
||||||
const boolean huntbackwards = false;
|
const boolean huntbackwards = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
UINT8 *p;
|
UINT8 *p;
|
||||||
UINT8 (*func)(void); // called when cheat confirmed.
|
UINT8 (*func)(void); // called when cheat confirmed.
|
||||||
UINT8 sequence[];
|
UINT8 *sequence;
|
||||||
} cheatseq_t;
|
} cheatseq_t;
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
@ -149,7 +149,7 @@ static UINT8 cheatf_devmode(void)
|
||||||
static cheatseq_t cheat_warp = {
|
static cheatseq_t cheat_warp = {
|
||||||
0, cheatf_warp,
|
0, cheatf_warp,
|
||||||
//{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff }
|
//{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff }
|
||||||
{ SCRAMBLE('b'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), 0xff }
|
(UINT8[]){ SCRAMBLE('b'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), 0xff }
|
||||||
};
|
};
|
||||||
|
|
||||||
static cheatseq_t cheat_warp_joy = {
|
static cheatseq_t cheat_warp_joy = {
|
||||||
|
|
@ -158,7 +158,7 @@ static cheatseq_t cheat_warp_joy = {
|
||||||
SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW),
|
SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW),
|
||||||
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
|
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
|
||||||
SCRAMBLE(KEY_ENTER), 0xff }*/
|
SCRAMBLE(KEY_ENTER), 0xff }*/
|
||||||
{ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_RIGHTARROW),
|
(UINT8[]){ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_RIGHTARROW),
|
||||||
SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW),
|
SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW),
|
||||||
SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_RIGHTARROW),
|
SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_RIGHTARROW),
|
||||||
SCRAMBLE(KEY_ENTER), 0xff }
|
SCRAMBLE(KEY_ENTER), 0xff }
|
||||||
|
|
@ -167,7 +167,7 @@ static cheatseq_t cheat_warp_joy = {
|
||||||
#ifdef DEVELOP
|
#ifdef DEVELOP
|
||||||
static cheatseq_t cheat_devmode = {
|
static cheatseq_t cheat_devmode = {
|
||||||
0, cheatf_devmode,
|
0, cheatf_devmode,
|
||||||
{ SCRAMBLE('d'), SCRAMBLE('e'), SCRAMBLE('v'), SCRAMBLE('m'), SCRAMBLE('o'), SCRAMBLE('d'), SCRAMBLE('e'), 0xff }
|
(UINT8[]){ SCRAMBLE('d'), SCRAMBLE('e'), SCRAMBLE('v'), SCRAMBLE('m'), SCRAMBLE('o'), SCRAMBLE('d'), SCRAMBLE('e'), 0xff }
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
964
src/m_menu.c
964
src/m_menu.c
File diff suppressed because it is too large
Load diff
|
|
@ -315,6 +315,7 @@ typedef union
|
||||||
struct menu_s *submenu; // IT_SUBMENU
|
struct menu_s *submenu; // IT_SUBMENU
|
||||||
consvar_t *cvar; // IT_CVAR
|
consvar_t *cvar; // IT_CVAR
|
||||||
void (*routine)(INT32 choice); // IT_CALL, IT_KEYHANDLER, IT_ARROWS
|
void (*routine)(INT32 choice); // IT_CALL, IT_KEYHANDLER, IT_ARROWS
|
||||||
|
void (*eventhandler)(event_t *ev); // MM_EVENTHANDLER
|
||||||
} itemaction_t;
|
} itemaction_t;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -328,8 +329,7 @@ typedef struct menuitem_s
|
||||||
const char *patch;
|
const char *patch;
|
||||||
const char *text; // used when FONTBxx lump is found
|
const char *text; // used when FONTBxx lump is found
|
||||||
|
|
||||||
// FIXME: should be itemaction_t
|
itemaction_t itemaction;
|
||||||
void *itemaction;
|
|
||||||
|
|
||||||
// hotkey in menu or y of the item
|
// hotkey in menu or y of the item
|
||||||
UINT16 alphaKey;
|
UINT16 alphaKey;
|
||||||
|
|
|
||||||
13
src/m_misc.c
13
src/m_misc.c
|
|
@ -63,7 +63,14 @@ typedef off_t off64_t;
|
||||||
#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) && (__GNUC__ < 8)
|
#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) && (__GNUC__ < 8)
|
||||||
#define PRIdS "u"
|
#define PRIdS "u"
|
||||||
#elif defined (_WIN32)
|
#elif defined (_WIN32)
|
||||||
#define PRIdS "Iu"
|
// pedantic: %I is nonstandard, is it ok to assume
|
||||||
|
// unsigned int?
|
||||||
|
//#define PRIdS "Iu"
|
||||||
|
#ifdef _WIN64
|
||||||
|
#define PRIdS "lu"
|
||||||
|
#else
|
||||||
|
#define PRIdS "u"
|
||||||
|
#endif
|
||||||
#elif defined (DJGPP)
|
#elif defined (DJGPP)
|
||||||
#define PRIdS "u"
|
#define PRIdS "u"
|
||||||
#else
|
#else
|
||||||
|
|
@ -746,12 +753,12 @@ static const char *Newsnapshotfile(const char *pathname, const char *ext)
|
||||||
FUNCNORETURN static void PNG_error(png_structp PNG, png_const_charp pngtext)
|
FUNCNORETURN static void PNG_error(png_structp PNG, png_const_charp pngtext)
|
||||||
{
|
{
|
||||||
//CONS_Debug(DBG_RENDER, "libpng error at %p: %s", PNG, pngtext);
|
//CONS_Debug(DBG_RENDER, "libpng error at %p: %s", PNG, pngtext);
|
||||||
I_Error("libpng error at %p: %s", PNG, pngtext);
|
I_Error("libpng error at %p: %s", (void*)PNG, pngtext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PNG_warn(png_structp PNG, png_const_charp pngtext)
|
static void PNG_warn(png_structp PNG, png_const_charp pngtext)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", PNG, pngtext);
|
CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", (void*)PNG, pngtext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_PNGhdr(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png_uint_32 width, PNG_CONST png_uint_32 height, PNG_CONST png_byte *palette)
|
static void M_PNGhdr(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png_uint_32 width, PNG_CONST png_uint_32 height, PNG_CONST png_byte *palette)
|
||||||
|
|
|
||||||
|
|
@ -8237,7 +8237,7 @@ void A_RemoteAction(mobj_t *actor)
|
||||||
astate = &states[locvar2];
|
astate = &states[locvar2];
|
||||||
|
|
||||||
CONS_Debug(DBG_GAMELOGIC, "A_RemoteAction: Calling action on %p\n"
|
CONS_Debug(DBG_GAMELOGIC, "A_RemoteAction: Calling action on %p\n"
|
||||||
"var1 is %d\nvar2 is %d\n", actor->target, var1, var2);
|
"var1 is %d\nvar2 is %d\n", (void*)actor->target, var1, var2);
|
||||||
states[locvar2].action.acp1(actor->target);
|
states[locvar2].action.acp1(actor->target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3920,7 +3920,7 @@ static void P_RingThinker(mobj_t *mobj)
|
||||||
spark = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_SIGNSPARKLE); // Spawn a fancy sparkle
|
spark = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_SIGNSPARKLE); // Spawn a fancy sparkle
|
||||||
K_MatchGenericExtraFlags(spark, mobj);
|
K_MatchGenericExtraFlags(spark, mobj);
|
||||||
spark->colorized = true;
|
spark->colorized = true;
|
||||||
spark->color = mobj->color ? : SKINCOLOR_YELLOW; // Use yellow if the ring doesn't use a skin color. (It should be red for SPB rings, but let normal rings look fancy too!)
|
spark->color = mobj->color ? mobj->color : SKINCOLOR_YELLOW; // Use yellow if the ring doesn't use a skin color. (It should be red for SPB rings, but let normal rings look fancy too!)
|
||||||
P_RemoveMobj(mobj); // Adieu, monde cruel!
|
P_RemoveMobj(mobj); // Adieu, monde cruel!
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -9090,7 +9090,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
INT32 dur = (mobj->flags2 & MF2_BOSSNOTRAP)
|
UINT32 dur = (mobj->flags2 & MF2_BOSSNOTRAP)
|
||||||
? (2*mobj->fuse)/3
|
? (2*mobj->fuse)/3
|
||||||
: mobj->fuse/2;
|
: mobj->fuse/2;
|
||||||
if (((mobj->renderflags & RF_TRANSMASK) >> RF_TRANSSHIFT) < ((NUMTRANSMAPS-1) - dur))
|
if (((mobj->renderflags & RF_TRANSMASK) >> RF_TRANSSHIFT) < ((NUMTRANSMAPS-1) - dur))
|
||||||
|
|
@ -12819,7 +12819,7 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numi
|
||||||
static void P_SpawnSingularItemRow(mapthing_t* mthing, mobjtype_t itemtype, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle)
|
static void P_SpawnSingularItemRow(mapthing_t* mthing, mobjtype_t itemtype, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle)
|
||||||
{
|
{
|
||||||
mobjtype_t itemtypes[1] = { itemtype };
|
mobjtype_t itemtypes[1] = { itemtype };
|
||||||
return P_SpawnItemRow(mthing, itemtypes, 1, numitems, horizontalspacing, verticalspacing, fixedangle);
|
P_SpawnItemRow(mthing, itemtypes, 1, numitems, horizontalspacing, verticalspacing, fixedangle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t size)
|
static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t size)
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ typedef enum
|
||||||
// Disable momentum-based squash and stretch.
|
// Disable momentum-based squash and stretch.
|
||||||
MF_NOSQUISH = 1<<30,
|
MF_NOSQUISH = 1<<30,
|
||||||
// Disable hitlag for this object
|
// Disable hitlag for this object
|
||||||
MF_NOHITLAGFORME = 1<<31,
|
MF_NOHITLAGFORME = (INT32)(1U<<31),
|
||||||
// no more free slots, next up I suppose we can get rid of shit like MF_BOXICON?
|
// no more free slots, next up I suppose we can get rid of shit like MF_BOXICON?
|
||||||
} mobjflag_t;
|
} mobjflag_t;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1531,7 +1531,7 @@ typedef enum
|
||||||
MD_DSCALE = 1<<28,
|
MD_DSCALE = 1<<28,
|
||||||
MD_BLUEFLAG = 1<<29,
|
MD_BLUEFLAG = 1<<29,
|
||||||
MD_REDFLAG = 1<<30,
|
MD_REDFLAG = 1<<30,
|
||||||
MD_MORE = 1<<31
|
MD_MORE = (INT32)(1U<<31)
|
||||||
} mobj_diff_t;
|
} mobj_diff_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
|
||||||
|
|
@ -2466,7 +2466,7 @@ static boolean P_LoadExtendedSubsectorsAndSegs(UINT8 **data, nodetype_t nodetype
|
||||||
|
|
||||||
segs[k - 1 + ((m == 0) ? subsectors[i].numlines : 0)].v2 = segs[k].v1 = &vertexes[vertexnum];
|
segs[k - 1 + ((m == 0) ? subsectors[i].numlines : 0)].v2 = segs[k].v1 = &vertexes[vertexnum];
|
||||||
|
|
||||||
READUINT32((*data)); // partner, can be ignored by software renderer
|
*data += sizeof (UINT32); // partner, can be ignored by software renderer
|
||||||
|
|
||||||
linenum = (nodetype == NT_XGL3) ? READUINT32((*data)) : READUINT16((*data));
|
linenum = (nodetype == NT_XGL3) ? READUINT32((*data)) : READUINT16((*data));
|
||||||
if (linenum != 0xFFFF && linenum >= numlines)
|
if (linenum != 0xFFFF && linenum >= numlines)
|
||||||
|
|
|
||||||
10
src/r_defs.h
10
src/r_defs.h
|
|
@ -150,7 +150,7 @@ typedef enum
|
||||||
FF_SPINBUST = 0x10000000, ///< Used with ::FF_BUSTUP. Also bustable if you're in your spinning frames.
|
FF_SPINBUST = 0x10000000, ///< Used with ::FF_BUSTUP. Also bustable if you're in your spinning frames.
|
||||||
FF_STRONGBUST = 0x20000000, ///< Used with ::FF_BUSTUP. Only bustable by "strong" characters (Knuckles) and abilities (bouncing, twinspin, melee).
|
FF_STRONGBUST = 0x20000000, ///< Used with ::FF_BUSTUP. Only bustable by "strong" characters (Knuckles) and abilities (bouncing, twinspin, melee).
|
||||||
FF_RIPPLE = 0x40000000, ///< Ripple the flats
|
FF_RIPPLE = 0x40000000, ///< Ripple the flats
|
||||||
FF_COLORMAPONLY = 0x80000000, ///< Only copy the colormap, not the lightlevel
|
FF_COLORMAPONLY = (INT32)0x80000000, ///< Only copy the colormap, not the lightlevel
|
||||||
FF_GOOWATER = FF_SHATTERBOTTOM, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.
|
FF_GOOWATER = FF_SHATTERBOTTOM, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.
|
||||||
} ffloortype_e;
|
} ffloortype_e;
|
||||||
|
|
||||||
|
|
@ -718,7 +718,7 @@ typedef struct
|
||||||
UINT8 mode; // see pic_mode_t above
|
UINT8 mode; // see pic_mode_t above
|
||||||
INT16 height;
|
INT16 height;
|
||||||
INT16 reserved1; // set to 0
|
INT16 reserved1; // set to 0
|
||||||
UINT8 data[0];
|
UINT8 data[];
|
||||||
} ATTRPACK pic_t;
|
} ATTRPACK pic_t;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
@ -775,7 +775,7 @@ typedef enum
|
||||||
RF_MODULATE = ((AST_MODULATE-1)<<RF_BLENDSHIFT),
|
RF_MODULATE = ((AST_MODULATE-1)<<RF_BLENDSHIFT),
|
||||||
RF_OVERLAY = ((AST_OVERLAY-1)<<RF_BLENDSHIFT),
|
RF_OVERLAY = ((AST_OVERLAY-1)<<RF_BLENDSHIFT),
|
||||||
|
|
||||||
RF_TRANSMASK = 0xF0000000, // --Transparency override
|
RF_TRANSMASK = (INT32)0xF0000000, // --Transparency override
|
||||||
RF_TRANSSHIFT = (7*4),
|
RF_TRANSSHIFT = (7*4),
|
||||||
RF_TRANS10 = (1<<RF_TRANSSHIFT), // 10%
|
RF_TRANS10 = (1<<RF_TRANSSHIFT), // 10%
|
||||||
RF_TRANS20 = (2<<RF_TRANSSHIFT), // 20%
|
RF_TRANS20 = (2<<RF_TRANSSHIFT), // 20%
|
||||||
|
|
@ -784,8 +784,8 @@ typedef enum
|
||||||
RF_TRANS50 = (5<<RF_TRANSSHIFT), // 50%
|
RF_TRANS50 = (5<<RF_TRANSSHIFT), // 50%
|
||||||
RF_TRANS60 = (6<<RF_TRANSSHIFT), // 60%
|
RF_TRANS60 = (6<<RF_TRANSSHIFT), // 60%
|
||||||
RF_TRANS70 = (7<<RF_TRANSSHIFT), // 70%
|
RF_TRANS70 = (7<<RF_TRANSSHIFT), // 70%
|
||||||
RF_TRANS80 = (8<<RF_TRANSSHIFT), // 80%
|
RF_TRANS80 = (INT32)(8U<<RF_TRANSSHIFT), // 80%
|
||||||
RF_TRANS90 = (9<<RF_TRANSSHIFT), // 90%
|
RF_TRANS90 = (INT32)(9U<<RF_TRANSSHIFT), // 90%
|
||||||
RF_GHOSTLY = (RF_TRANS80 | RF_FULLBRIGHT),
|
RF_GHOSTLY = (RF_TRANS80 | RF_FULLBRIGHT),
|
||||||
RF_GHOSTLYMASK = (RF_TRANSMASK | RF_FULLBRIGHT),
|
RF_GHOSTLYMASK = (RF_TRANSMASK | RF_FULLBRIGHT),
|
||||||
} renderflags_t;
|
} renderflags_t;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ extern size_t validcount, linecount, loopcount, framecount;
|
||||||
// The fraction of a tic being drawn (for interpolation between two tics)
|
// The fraction of a tic being drawn (for interpolation between two tics)
|
||||||
extern fixed_t rendertimefrac;
|
extern fixed_t rendertimefrac;
|
||||||
// Evaluated delta tics for this frame (how many tics since the last frame)
|
// Evaluated delta tics for this frame (how many tics since the last frame)
|
||||||
extern fixed_t renderdeltatics;;
|
extern fixed_t renderdeltatics;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Lighting LUT.
|
// Lighting LUT.
|
||||||
|
|
|
||||||
|
|
@ -873,13 +873,13 @@ static int PNG_ChunkReader(png_structp png_ptr, png_unknown_chunkp chonk)
|
||||||
|
|
||||||
static void PNG_error(png_structp PNG, png_const_charp pngtext)
|
static void PNG_error(png_structp PNG, png_const_charp pngtext)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_RENDER, "libpng error at %p: %s", PNG, pngtext);
|
CONS_Debug(DBG_RENDER, "libpng error at %p: %s", (void*)PNG, pngtext);
|
||||||
//I_Error("libpng error at %p: %s", PNG, pngtext);
|
//I_Error("libpng error at %p: %s", PNG, pngtext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PNG_warn(png_structp PNG, png_const_charp pngtext)
|
static void PNG_warn(png_structp PNG, png_const_charp pngtext)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", PNG, pngtext);
|
CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", (void*)PNG, pngtext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static png_byte grAb_chunk[5] = {'g', 'r', 'A', 'b', (png_byte)'\0'};
|
static png_byte grAb_chunk[5] = {'g', 'r', 'A', 'b', (png_byte)'\0'};
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ typedef struct
|
||||||
|
|
||||||
// All the patches[patchcount] are drawn back to front into the cached texture.
|
// All the patches[patchcount] are drawn back to front into the cached texture.
|
||||||
INT16 patchcount;
|
INT16 patchcount;
|
||||||
texpatch_t patches[0];
|
texpatch_t patches[];
|
||||||
} texture_t;
|
} texture_t;
|
||||||
|
|
||||||
// all loaded and prepared textures from the start of the game
|
// all loaded and prepared textures from the start of the game
|
||||||
|
|
|
||||||
|
|
@ -1794,7 +1794,11 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
|
|
||||||
range++; // fencepost problem
|
range++; // fencepost problem
|
||||||
|
|
||||||
scalestep = ((yscale2 - yscale)/range) ?: 1;
|
scalestep = ((yscale2 - yscale)/range);
|
||||||
|
|
||||||
|
if (scalestep == 0)
|
||||||
|
scalestep = 1;
|
||||||
|
|
||||||
xscale = FixedDiv(range<<FRACBITS, abs(offset2));
|
xscale = FixedDiv(range<<FRACBITS, abs(offset2));
|
||||||
|
|
||||||
// The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2?
|
// The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2?
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
#define GETFUNC(func) \
|
#define GETFUNC(func) \
|
||||||
else if (0 == strcmp(#func, funcName)) \
|
else if (0 == strcmp(#func, funcName)) \
|
||||||
funcPointer = &func \
|
funcPointer = FUNCPTRCAST(&func) \
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
/** \brief The *hwSym function
|
/** \brief The *hwSym function
|
||||||
|
|
@ -75,7 +75,7 @@ void *hwSym(const char *funcName,void *handle)
|
||||||
void *funcPointer = NULL;
|
void *funcPointer = NULL;
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (0 == strcmp("SetPalette", funcName))
|
if (0 == strcmp("SetPalette", funcName))
|
||||||
funcPointer = &OglSdlSetPalette;
|
funcPointer = FUNCPTRCAST(&OglSdlSetPalette);
|
||||||
|
|
||||||
GETFUNC(Init);
|
GETFUNC(Init);
|
||||||
GETFUNC(Draw2DLine);
|
GETFUNC(Draw2DLine);
|
||||||
|
|
|
||||||
|
|
@ -2120,7 +2120,7 @@ void I_GetDiskFreeSpace(INT64 *freespace)
|
||||||
|
|
||||||
if (!testwin95)
|
if (!testwin95)
|
||||||
{
|
{
|
||||||
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
|
*(void**)&pfnGetDiskFreeSpaceEx = FUNCPTRCAST(GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA"));
|
||||||
testwin95 = true;
|
testwin95 = true;
|
||||||
}
|
}
|
||||||
if (pfnGetDiskFreeSpaceEx)
|
if (pfnGetDiskFreeSpaceEx)
|
||||||
|
|
@ -2628,7 +2628,8 @@ const CPUInfoFlags *I_CPUInfo(void)
|
||||||
#if defined (_WIN32)
|
#if defined (_WIN32)
|
||||||
static CPUInfoFlags WIN_CPUInfo;
|
static CPUInfoFlags WIN_CPUInfo;
|
||||||
SYSTEM_INFO SI;
|
SYSTEM_INFO SI;
|
||||||
p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent");
|
p_IsProcessorFeaturePresent pfnCPUID;
|
||||||
|
*(void**)&pfnCPUID = FUNCPTRCAST(GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent"));
|
||||||
|
|
||||||
ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo));
|
ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo));
|
||||||
if (pfnCPUID)
|
if (pfnCPUID)
|
||||||
|
|
|
||||||
|
|
@ -1971,43 +1971,43 @@ void VID_StartupOpenGL(void)
|
||||||
if (!glstartup)
|
if (!glstartup)
|
||||||
{
|
{
|
||||||
CONS_Printf("VID_StartupOpenGL()...\n");
|
CONS_Printf("VID_StartupOpenGL()...\n");
|
||||||
HWD.pfnInit = hwSym("Init",NULL);
|
*(void**)&HWD.pfnInit = hwSym("Init",NULL);
|
||||||
HWD.pfnFinishUpdate = NULL;
|
*(void**)&HWD.pfnFinishUpdate = NULL;
|
||||||
HWD.pfnDraw2DLine = hwSym("Draw2DLine",NULL);
|
*(void**)&HWD.pfnDraw2DLine = hwSym("Draw2DLine",NULL);
|
||||||
HWD.pfnDrawPolygon = hwSym("DrawPolygon",NULL);
|
*(void**)&HWD.pfnDrawPolygon = hwSym("DrawPolygon",NULL);
|
||||||
HWD.pfnDrawIndexedTriangles = hwSym("DrawIndexedTriangles",NULL);
|
*(void**)&HWD.pfnDrawIndexedTriangles = hwSym("DrawIndexedTriangles",NULL);
|
||||||
HWD.pfnRenderSkyDome = hwSym("RenderSkyDome",NULL);
|
*(void**)&HWD.pfnRenderSkyDome = hwSym("RenderSkyDome",NULL);
|
||||||
HWD.pfnSetBlend = hwSym("SetBlend",NULL);
|
*(void**)&HWD.pfnSetBlend = hwSym("SetBlend",NULL);
|
||||||
HWD.pfnClearBuffer = hwSym("ClearBuffer",NULL);
|
*(void**)&HWD.pfnClearBuffer = hwSym("ClearBuffer",NULL);
|
||||||
HWD.pfnSetTexture = hwSym("SetTexture",NULL);
|
*(void**)&HWD.pfnSetTexture = hwSym("SetTexture",NULL);
|
||||||
HWD.pfnUpdateTexture = hwSym("UpdateTexture",NULL);
|
*(void**)&HWD.pfnUpdateTexture = hwSym("UpdateTexture",NULL);
|
||||||
HWD.pfnDeleteTexture = hwSym("DeleteTexture",NULL);
|
*(void**)&HWD.pfnDeleteTexture = hwSym("DeleteTexture",NULL);
|
||||||
HWD.pfnReadRect = hwSym("ReadRect",NULL);
|
*(void**)&HWD.pfnReadRect = hwSym("ReadRect",NULL);
|
||||||
HWD.pfnGClipRect = hwSym("GClipRect",NULL);
|
*(void**)&HWD.pfnGClipRect = hwSym("GClipRect",NULL);
|
||||||
HWD.pfnClearMipMapCache = hwSym("ClearMipMapCache",NULL);
|
*(void**)&HWD.pfnClearMipMapCache = hwSym("ClearMipMapCache",NULL);
|
||||||
HWD.pfnSetSpecialState = hwSym("SetSpecialState",NULL);
|
*(void**)&HWD.pfnSetSpecialState = hwSym("SetSpecialState",NULL);
|
||||||
HWD.pfnSetPalette = hwSym("SetPalette",NULL);
|
*(void**)&HWD.pfnSetPalette = hwSym("SetPalette",NULL);
|
||||||
HWD.pfnGetTextureUsed = hwSym("GetTextureUsed",NULL);
|
*(void**)&HWD.pfnGetTextureUsed = hwSym("GetTextureUsed",NULL);
|
||||||
HWD.pfnDrawModel = hwSym("DrawModel",NULL);
|
*(void**)&HWD.pfnDrawModel = hwSym("DrawModel",NULL);
|
||||||
HWD.pfnCreateModelVBOs = hwSym("CreateModelVBOs",NULL);
|
*(void**)&HWD.pfnCreateModelVBOs = hwSym("CreateModelVBOs",NULL);
|
||||||
HWD.pfnSetTransform = hwSym("SetTransform",NULL);
|
*(void**)&HWD.pfnSetTransform = hwSym("SetTransform",NULL);
|
||||||
HWD.pfnPostImgRedraw = hwSym("PostImgRedraw",NULL);
|
*(void**)&HWD.pfnPostImgRedraw = hwSym("PostImgRedraw",NULL);
|
||||||
HWD.pfnFlushScreenTextures=hwSym("FlushScreenTextures",NULL);
|
*(void**)&HWD.pfnFlushScreenTextures=hwSym("FlushScreenTextures",NULL);
|
||||||
HWD.pfnStartScreenWipe = hwSym("StartScreenWipe",NULL);
|
*(void**)&HWD.pfnStartScreenWipe = hwSym("StartScreenWipe",NULL);
|
||||||
HWD.pfnEndScreenWipe = hwSym("EndScreenWipe",NULL);
|
*(void**)&HWD.pfnEndScreenWipe = hwSym("EndScreenWipe",NULL);
|
||||||
HWD.pfnDoScreenWipe = hwSym("DoScreenWipe",NULL);
|
*(void**)&HWD.pfnDoScreenWipe = hwSym("DoScreenWipe",NULL);
|
||||||
HWD.pfnDrawIntermissionBG=hwSym("DrawIntermissionBG",NULL);
|
*(void**)&HWD.pfnDrawIntermissionBG=hwSym("DrawIntermissionBG",NULL);
|
||||||
HWD.pfnMakeScreenTexture= hwSym("MakeScreenTexture",NULL);
|
*(void**)&HWD.pfnMakeScreenTexture= hwSym("MakeScreenTexture",NULL);
|
||||||
HWD.pfnMakeScreenFinalTexture=hwSym("MakeScreenFinalTexture",NULL);
|
*(void**)&HWD.pfnMakeScreenFinalTexture=hwSym("MakeScreenFinalTexture",NULL);
|
||||||
HWD.pfnDrawScreenFinalTexture=hwSym("DrawScreenFinalTexture",NULL);
|
*(void**)&HWD.pfnDrawScreenFinalTexture=hwSym("DrawScreenFinalTexture",NULL);
|
||||||
|
|
||||||
HWD.pfnCompileShaders = hwSym("CompileShaders",NULL);
|
*(void**)&HWD.pfnCompileShaders = hwSym("CompileShaders",NULL);
|
||||||
HWD.pfnCleanShaders = hwSym("CleanShaders",NULL);
|
*(void**)&HWD.pfnCleanShaders = hwSym("CleanShaders",NULL);
|
||||||
HWD.pfnSetShader = hwSym("SetShader",NULL);
|
*(void**)&HWD.pfnSetShader = hwSym("SetShader",NULL);
|
||||||
HWD.pfnUnSetShader = hwSym("UnSetShader",NULL);
|
*(void**)&HWD.pfnUnSetShader = hwSym("UnSetShader",NULL);
|
||||||
|
|
||||||
HWD.pfnSetShaderInfo = hwSym("SetShaderInfo",NULL);
|
*(void**)&HWD.pfnSetShaderInfo = hwSym("SetShaderInfo",NULL);
|
||||||
HWD.pfnLoadCustomShader = hwSym("LoadCustomShader",NULL);
|
*(void**)&HWD.pfnLoadCustomShader = hwSym("LoadCustomShader",NULL);
|
||||||
|
|
||||||
vid.glstate = HWD.pfnInit() ? VID_GL_LIBRARY_LOADED : VID_GL_LIBRARY_ERROR; // let load the OpenGL library
|
vid.glstate = HWD.pfnInit() ? VID_GL_LIBRARY_LOADED : VID_GL_LIBRARY_ERROR; // let load the OpenGL library
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue