mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
- cleanup and removal of unused code.
compat.h probably needs a bit more attention, it's a horrendous mess of the wrong type of "compatibility" concerns.
This commit is contained in:
parent
cc332486b4
commit
2e261a7468
12 changed files with 32 additions and 386 deletions
|
@ -548,12 +548,9 @@ MAPHEADER2 byte_19AE44;
|
||||||
|
|
||||||
unsigned int dbReadMapCRC(const char *pPath)
|
unsigned int dbReadMapCRC(const char *pPath)
|
||||||
{
|
{
|
||||||
char name2[BMAX_PATH];
|
|
||||||
byte_1A76C7 = 0;
|
byte_1A76C7 = 0;
|
||||||
byte_1A76C8 = 0;
|
byte_1A76C8 = 0;
|
||||||
|
|
||||||
Bstrncpy(name2, pPath, BMAX_PATH);
|
|
||||||
Bstrupr(name2);
|
|
||||||
DICTNODE* pNode;
|
DICTNODE* pNode;
|
||||||
pNode = gSysRes.Lookup(pPath, "MAP");
|
pNode = gSysRes.Lookup(pPath, "MAP");
|
||||||
if (!pNode)
|
if (!pNode)
|
||||||
|
@ -604,7 +601,7 @@ const int nXSpriteSize = 56;
|
||||||
const int nXWallSize = 24;
|
const int nXWallSize = 24;
|
||||||
|
|
||||||
int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short *pSector, unsigned int *pCRC) {
|
int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short *pSector, unsigned int *pCRC) {
|
||||||
char name2[BMAX_PATH]; int16_t tpskyoff[256];
|
int16_t tpskyoff[256];
|
||||||
memset(show2dsector, 0, sizeof(show2dsector));
|
memset(show2dsector, 0, sizeof(show2dsector));
|
||||||
memset(show2dwall, 0, sizeof(show2dwall));
|
memset(show2dwall, 0, sizeof(show2dwall));
|
||||||
memset(show2dsprite, 0, sizeof(show2dsprite));
|
memset(show2dsprite, 0, sizeof(show2dsprite));
|
||||||
|
@ -615,8 +612,6 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
|
||||||
Polymost_prepare_loadboard();
|
Polymost_prepare_loadboard();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Bstrncpy(name2, pPath, BMAX_PATH);
|
|
||||||
Bstrupr(name2);
|
|
||||||
DICTNODE* pNode;
|
DICTNODE* pNode;
|
||||||
|
|
||||||
pNode = gSysRes.Lookup(pPath, "MAP");
|
pNode = gSysRes.Lookup(pPath, "MAP");
|
||||||
|
|
|
@ -635,7 +635,6 @@ bool CCheatMgr::Check(char *pzString)
|
||||||
{
|
{
|
||||||
char buffer[80];
|
char buffer[80];
|
||||||
strcpy(buffer, pzString);
|
strcpy(buffer, pzString);
|
||||||
Bstrupr(buffer);
|
|
||||||
for (size_t i = 0; i < strlen(pzString); i++)
|
for (size_t i = 0; i < strlen(pzString); i++)
|
||||||
buffer[i]++;
|
buffer[i]++;
|
||||||
for (int i = 0; i < 36; i++)
|
for (int i = 0; i < 36; i++)
|
||||||
|
@ -643,7 +642,7 @@ bool CCheatMgr::Check(char *pzString)
|
||||||
int nCheatLen = strlen(s_CheatInfo[i].pzString);
|
int nCheatLen = strlen(s_CheatInfo[i].pzString);
|
||||||
if (s_CheatInfo[i].flags & 1)
|
if (s_CheatInfo[i].flags & 1)
|
||||||
{
|
{
|
||||||
if (!strncmp(buffer, s_CheatInfo[i].pzString, nCheatLen))
|
if (!strnicmp(buffer, s_CheatInfo[i].pzString, nCheatLen))
|
||||||
{
|
{
|
||||||
Process(s_CheatInfo[i].id, buffer+nCheatLen);
|
Process(s_CheatInfo[i].id, buffer+nCheatLen);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1346,10 +1346,9 @@ void viewDrawPlayerSlots(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char gTempStr[128];
|
|
||||||
|
|
||||||
void viewDrawPlayerFrags(void)
|
void viewDrawPlayerFrags(void)
|
||||||
{
|
{
|
||||||
|
FString gTempStr;
|
||||||
viewDrawPlayerSlots();
|
viewDrawPlayerSlots();
|
||||||
for (int i = 0, p = connecthead; p >= 0; i++, p = connectpoint2[p])
|
for (int i = 0, p = connecthead; p >= 0; i++, p = connectpoint2[p])
|
||||||
{
|
{
|
||||||
|
@ -1358,18 +1357,19 @@ void viewDrawPlayerFrags(void)
|
||||||
int col = gPlayer[p].teamId & 3;
|
int col = gPlayer[p].teamId & 3;
|
||||||
char* name = gProfile[p].name;
|
char* name = gProfile[p].name;
|
||||||
if (gProfile[p].skill == 2)
|
if (gProfile[p].skill == 2)
|
||||||
sprintf(gTempStr, "%s", name);
|
gTempStr.Format("%s", name);
|
||||||
else
|
else
|
||||||
sprintf(gTempStr, "%s [%d]", name, gProfile[p].skill);
|
gTempStr.Format("%s [%d]", name, gProfile[p].skill);
|
||||||
Bstrupr(gTempStr);
|
gTempStr.ToUpper();
|
||||||
viewDrawText(4, gTempStr, x + 4, y + 1, -128, 11 + col, 0, 0);
|
viewDrawText(4, gTempStr, x + 4, y + 1, -128, 11 + col, 0, 0);
|
||||||
sprintf(gTempStr, "%2d", gPlayer[p].fragCount);
|
gTempStr.Format("%2d", gPlayer[p].fragCount);
|
||||||
viewDrawText(4, gTempStr, x + 76, y + 1, -128, 11 + col, 2, 0);
|
viewDrawText(4, gTempStr, x + 76, y + 1, -128, 11 + col, 2, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void viewDrawPlayerFlags(void)
|
void viewDrawPlayerFlags(void)
|
||||||
{
|
{
|
||||||
|
FString gTempStr;
|
||||||
viewDrawPlayerSlots();
|
viewDrawPlayerSlots();
|
||||||
for (int i = 0, p = connecthead; p >= 0; i++, p = connectpoint2[p])
|
for (int i = 0, p = connecthead; p >= 0; i++, p = connectpoint2[p])
|
||||||
{
|
{
|
||||||
|
@ -1378,13 +1378,13 @@ void viewDrawPlayerFlags(void)
|
||||||
int col = gPlayer[p].teamId & 3;
|
int col = gPlayer[p].teamId & 3;
|
||||||
char* name = gProfile[p].name;
|
char* name = gProfile[p].name;
|
||||||
if (gProfile[p].skill == 2)
|
if (gProfile[p].skill == 2)
|
||||||
sprintf(gTempStr, "%s", name);
|
gTempStr.Format("%s", name);
|
||||||
else
|
else
|
||||||
sprintf(gTempStr, "%s [%d]", name, gProfile[p].skill);
|
gTempStr.Format("%s [%d]", name, gProfile[p].skill);
|
||||||
Bstrupr(gTempStr);
|
gTempStr.ToUpper();
|
||||||
viewDrawText(4, gTempStr, x + 4, y + 1, -128, 11 + col, 0, 0);
|
viewDrawText(4, gTempStr, x + 4, y + 1, -128, 11 + col, 0, 0);
|
||||||
|
|
||||||
sprintf(gTempStr, "F");
|
gTempStr.Format("F");
|
||||||
x += 76;
|
x += 76;
|
||||||
if (gPlayer[p].hasFlag & 2)
|
if (gPlayer[p].hasFlag & 2)
|
||||||
{
|
{
|
||||||
|
@ -1399,6 +1399,7 @@ void viewDrawPlayerFlags(void)
|
||||||
|
|
||||||
void viewDrawCtfHudVanilla(ClockTicks arg)
|
void viewDrawCtfHudVanilla(ClockTicks arg)
|
||||||
{
|
{
|
||||||
|
FString gTempStr;
|
||||||
int x = 1, y = 1;
|
int x = 1, y = 1;
|
||||||
if (dword_21EFD0[0] == 0 || ((int)totalclock & 8))
|
if (dword_21EFD0[0] == 0 || ((int)totalclock & 8))
|
||||||
{
|
{
|
||||||
|
@ -1406,7 +1407,7 @@ void viewDrawCtfHudVanilla(ClockTicks arg)
|
||||||
dword_21EFD0[0] = dword_21EFD0[0] - arg;
|
dword_21EFD0[0] = dword_21EFD0[0] - arg;
|
||||||
if (dword_21EFD0[0] < 0)
|
if (dword_21EFD0[0] < 0)
|
||||||
dword_21EFD0[0] = 0;
|
dword_21EFD0[0] = 0;
|
||||||
sprintf(gTempStr, "%-3d", dword_21EFB0[0]);
|
gTempStr.Format("%-3d", dword_21EFB0[0]);
|
||||||
viewDrawText(0, gTempStr, x, y + 10, -128, 10, 0, 0, 256);
|
viewDrawText(0, gTempStr, x, y + 10, -128, 10, 0, 0, 256);
|
||||||
}
|
}
|
||||||
x = 319;
|
x = 319;
|
||||||
|
@ -1416,7 +1417,7 @@ void viewDrawCtfHudVanilla(ClockTicks arg)
|
||||||
dword_21EFD0[1] = dword_21EFD0[1] - arg;
|
dword_21EFD0[1] = dword_21EFD0[1] - arg;
|
||||||
if (dword_21EFD0[1] < 0)
|
if (dword_21EFD0[1] < 0)
|
||||||
dword_21EFD0[1] = 0;
|
dword_21EFD0[1] = 0;
|
||||||
sprintf(gTempStr, "%3d", dword_21EFB0[1]);
|
gTempStr.Format("%3d", dword_21EFB0[1]);
|
||||||
viewDrawText(0, gTempStr, x, y + 10, -128, 7, 2, 0, 512);
|
viewDrawText(0, gTempStr, x, y + 10, -128, 7, 2, 0, 512);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1673,7 +1674,8 @@ void UpdateStatusBar(ClockTicks arg)
|
||||||
TileHGauge(2208, 44, 190, pPlayer->armor[2], 3200);
|
TileHGauge(2208, 44, 190, pPlayer->armor[2], 3200);
|
||||||
DrawStatNumber("%3d", pPlayer->armor[2]>>4, 2230, 50, 193, 0, 0);
|
DrawStatNumber("%3d", pPlayer->armor[2]>>4, 2230, 50, 193, 0, 0);
|
||||||
}
|
}
|
||||||
sprintf(gTempStr, "v%s", GetVersionString());
|
FString gTempStr;
|
||||||
|
gTempStr.Format("v%s", GetVersionString());
|
||||||
viewDrawText(3, gTempStr, 20, 191, 32, 0, 1, 0);
|
viewDrawText(3, gTempStr, 20, 191, 32, 0, 1, 0);
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < 6; i++)
|
||||||
|
@ -3532,7 +3534,7 @@ RORHACK:
|
||||||
}
|
}
|
||||||
else if (gView != gMe)
|
else if (gView != gMe)
|
||||||
{
|
{
|
||||||
sprintf(gTempStr, "] %s [", gProfile[gView->nPlayer].name);
|
FStringf gTempStr("] %s [", gProfile[gView->nPlayer].name);
|
||||||
viewDrawText(0, gTempStr, 160, 10, 0, 0, 1, 0);
|
viewDrawText(0, gTempStr, 160, 10, 0, 0, 1, 0);
|
||||||
}
|
}
|
||||||
if (errMsg[0])
|
if (errMsg[0])
|
||||||
|
|
|
@ -808,30 +808,9 @@ typedef struct {
|
||||||
|
|
||||||
////////// Language tricks that depend on size_t //////////
|
////////// Language tricks that depend on size_t //////////
|
||||||
|
|
||||||
#if defined _MSC_VER
|
#include "basics.h"
|
||||||
# define ARRAY_SIZE(arr) _countof(arr)
|
|
||||||
#elif defined HAVE_CONSTEXPR
|
# define ARRAY_SIZE(arr) countof(arr)
|
||||||
template <typename T, size_t N>
|
|
||||||
static FORCE_INLINE constexpr size_t ARRAY_SIZE(T const (&)[N]) noexcept
|
|
||||||
{
|
|
||||||
return N;
|
|
||||||
}
|
|
||||||
#elif defined __cplusplus
|
|
||||||
struct bad_arg_to_ARRAY_SIZE
|
|
||||||
{
|
|
||||||
class Is_pointer; // incomplete
|
|
||||||
class Is_array {};
|
|
||||||
template <typename T>
|
|
||||||
static Is_pointer check_type(const T*, const T* const*);
|
|
||||||
static Is_array check_type(const void*, const void*);
|
|
||||||
};
|
|
||||||
# define ARRAY_SIZE(arr) ( \
|
|
||||||
0 * sizeof(reinterpret_cast<const ::bad_arg_to_ARRAY_SIZE*>(arr)) + \
|
|
||||||
0 * sizeof(::bad_arg_to_ARRAY_SIZE::check_type((arr), &(arr))) + \
|
|
||||||
sizeof(arr) / sizeof((arr)[0]) )
|
|
||||||
#else
|
|
||||||
# define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
|
||||||
#endif
|
|
||||||
#define ARRAY_SSIZE(arr) (native_t)ARRAY_SIZE(arr)
|
#define ARRAY_SSIZE(arr) (native_t)ARRAY_SIZE(arr)
|
||||||
|
|
||||||
|
|
||||||
|
@ -961,9 +940,6 @@ static FORCE_INLINE CONSTEXPR uint64_t B_PASS64(uint64_t const x) { return x; }
|
||||||
# define B_BIG16(x) B_PASS16(x)
|
# define B_BIG16(x) B_PASS16(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Determine when, if ever, we should use the bit-shift-and-mask variants
|
|
||||||
// due to alignment issues or performance gains.
|
|
||||||
#if 1
|
|
||||||
static FORCE_INLINE void B_BUF16(void * const buf, uint16_t const x) { *(uint16_t *) buf = x; }
|
static FORCE_INLINE void B_BUF16(void * const buf, uint16_t const x) { *(uint16_t *) buf = x; }
|
||||||
static FORCE_INLINE void B_BUF32(void * const buf, uint32_t const x) { *(uint32_t *) buf = x; }
|
static FORCE_INLINE void B_BUF32(void * const buf, uint32_t const x) { *(uint32_t *) buf = x; }
|
||||||
static FORCE_INLINE void B_BUF64(void * const buf, uint64_t const x) { *(uint64_t *) buf = x; }
|
static FORCE_INLINE void B_BUF64(void * const buf, uint64_t const x) { *(uint64_t *) buf = x; }
|
||||||
|
@ -971,54 +947,6 @@ static FORCE_INLINE void B_BUF64(void * const buf, uint64_t const x) { *(uint64_
|
||||||
static FORCE_INLINE CONSTEXPR uint16_t B_UNBUF16(void const * const buf) { return *(uint16_t const *) buf; }
|
static FORCE_INLINE CONSTEXPR uint16_t B_UNBUF16(void const * const buf) { return *(uint16_t const *) buf; }
|
||||||
static FORCE_INLINE CONSTEXPR uint32_t B_UNBUF32(void const * const buf) { return *(uint32_t const *) buf; }
|
static FORCE_INLINE CONSTEXPR uint32_t B_UNBUF32(void const * const buf) { return *(uint32_t const *) buf; }
|
||||||
static FORCE_INLINE CONSTEXPR uint64_t B_UNBUF64(void const * const buf) { return *(uint64_t const *) buf; }
|
static FORCE_INLINE CONSTEXPR uint64_t B_UNBUF64(void const * const buf) { return *(uint64_t const *) buf; }
|
||||||
#else
|
|
||||||
static FORCE_INLINE void B_BUF16(void * const vbuf, uint16_t const x)
|
|
||||||
{
|
|
||||||
uint8_t * const buf = (uint8_t *) vbuf;
|
|
||||||
buf[0] = (x & 0x00FF);
|
|
||||||
buf[1] = (x & 0xFF00) >> 8;
|
|
||||||
}
|
|
||||||
static FORCE_INLINE void B_BUF32(void * const vbuf, uint32_t const x)
|
|
||||||
{
|
|
||||||
uint8_t * const buf = (uint8_t *) vbuf;
|
|
||||||
buf[0] = (x & 0x000000FF);
|
|
||||||
buf[1] = (x & 0x0000FF00) >> 8;
|
|
||||||
buf[2] = (x & 0x00FF0000) >> 16;
|
|
||||||
buf[3] = (x & 0xFF000000) >> 24;
|
|
||||||
}
|
|
||||||
# if 0
|
|
||||||
// i686-apple-darwin11-llvm-gcc-4.2 complains "integer constant is too large for 'long' type"
|
|
||||||
static FORCE_INLINE void B_BUF64(void * const vbuf, uint64_t const x)
|
|
||||||
{
|
|
||||||
uint8_t * const buf = (uint8_t *) vbuf;
|
|
||||||
buf[0] = (x & 0x00000000000000FF);
|
|
||||||
buf[1] = (x & 0x000000000000FF00) >> 8;
|
|
||||||
buf[2] = (x & 0x0000000000FF0000) >> 16;
|
|
||||||
buf[3] = (x & 0x00000000FF000000) >> 24;
|
|
||||||
buf[4] = (x & 0x000000FF00000000) >> 32;
|
|
||||||
buf[5] = (x & 0x0000FF0000000000) >> 40;
|
|
||||||
buf[6] = (x & 0x00FF000000000000) >> 48;
|
|
||||||
buf[7] = (x & 0xFF00000000000000) >> 56;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
static FORCE_INLINE uint16_t B_UNBUF16(void const * const vbuf)
|
|
||||||
{
|
|
||||||
uint8_t const * const buf = (uint8_t const *) vbuf;
|
|
||||||
return (buf[1] << 8) | (buf[0]);
|
|
||||||
}
|
|
||||||
static FORCE_INLINE uint32_t B_UNBUF32(void const * const vbuf)
|
|
||||||
{
|
|
||||||
uint8_t const * const buf = (uint8_t const *) vbuf;
|
|
||||||
return (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | (buf[0]);
|
|
||||||
}
|
|
||||||
static FORCE_INLINE uint64_t B_UNBUF64(void const * const vbuf)
|
|
||||||
{
|
|
||||||
uint8_t const * const buf = (uint8_t const *) vbuf;
|
|
||||||
return ((uint64_t)buf[7] << 56) | ((uint64_t)buf[6] << 48) | ((uint64_t)buf[5] << 40) |
|
|
||||||
((uint64_t)buf[4] << 32) | (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | (buf[0]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
////////// Abstract data operations //////////
|
////////// Abstract data operations //////////
|
||||||
|
@ -1174,18 +1102,6 @@ int32_t Bcorrectfilename(char *filename, int32_t removefn);
|
||||||
char *Bstrtoken(char *s, const char *delim, char **ptrptr, int chop);
|
char *Bstrtoken(char *s, const char *delim, char **ptrptr, int chop);
|
||||||
char *Bstrtolower(char *str);
|
char *Bstrtolower(char *str);
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
# ifdef _MSC_VER
|
|
||||||
# define Bstrlwr _strlwr
|
|
||||||
# define Bstrupr _strupr
|
|
||||||
# else
|
|
||||||
# define Bstrlwr strlwr
|
|
||||||
# define Bstrupr strupr
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
char *Bstrlwr(char *);
|
|
||||||
char *Bstrupr(char *);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
////////// Miscellaneous //////////
|
////////// Miscellaneous //////////
|
||||||
|
|
||||||
|
|
|
@ -6,28 +6,6 @@
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "debugbreak.h"
|
#include "debugbreak.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
# define NEED_SHLOBJ_H
|
|
||||||
# include "windows_inc.h"
|
|
||||||
#elif __APPLE__
|
|
||||||
# include "osxbits.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef USE_PHYSFS
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
# include <io.h>
|
|
||||||
#else
|
|
||||||
# include <dirent.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined __linux || defined EDUKE32_BSD
|
|
||||||
# include <libgen.h> // for dirname()
|
|
||||||
#endif
|
|
||||||
#if defined EDUKE32_BSD
|
|
||||||
# include <limits.h> // for PATH_MAX
|
|
||||||
# include <sys/sysctl.h> // for sysctl() to get path to executable
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "baselayer.h"
|
#include "baselayer.h"
|
||||||
|
|
||||||
|
@ -161,7 +139,7 @@ char *Bstrtolower(char *str)
|
||||||
if (!str)
|
if (!str)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
int len = Bstrlen(str);
|
int len = strlen(str);
|
||||||
|
|
||||||
if (len <= 0)
|
if (len <= 0)
|
||||||
return str;
|
return str;
|
||||||
|
@ -170,28 +148,9 @@ char *Bstrtolower(char *str)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
*(str + i) = Btolower(*(str + i));
|
*(str + i) = tolower(*(str + i));
|
||||||
i++;
|
i++;
|
||||||
} while (--len);
|
} while (--len);
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(_WIN32)
|
|
||||||
char *Bstrlwr(char *s)
|
|
||||||
{
|
|
||||||
if (!s) return s;
|
|
||||||
char *t = s;
|
|
||||||
while (*t) { *t = Btolower(*t); t++; }
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *Bstrupr(char *s)
|
|
||||||
{
|
|
||||||
if (!s) return s;
|
|
||||||
char *t = s;
|
|
||||||
while (*t) { *t = Btoupper(*t); t++; }
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
|
@ -1075,8 +1075,8 @@ static int32_t G_StaticToDynamicSound(int32_t const sound)
|
||||||
} while (0)
|
} while (0)
|
||||||
#else
|
#else
|
||||||
# define ADDWEAPONVAR(Weapidx, Membname) do { \
|
# define ADDWEAPONVAR(Weapidx, Membname) do { \
|
||||||
Bsprintf(aszBuf, "WEAPON%d_" #Membname, Weapidx); \
|
FStringf aszBuf("WEAPON%d_" #Membname, Weapidx); \
|
||||||
Bstrupr(aszBuf); \
|
aszBuf.ToUpper(); \
|
||||||
Gv_NewVar(aszBuf, weapondefaults[Weapidx].Membname, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); \
|
Gv_NewVar(aszBuf, weapondefaults[Weapidx].Membname, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2394,14 +2394,8 @@ GAMELOOP:
|
||||||
nBestLevel = levelnew - 1;
|
nBestLevel = levelnew - 1;
|
||||||
goto LOOP2;
|
goto LOOP2;
|
||||||
|
|
||||||
case 3: // When selecting 'Training' from ingame menu when already playing a level
|
case 3:
|
||||||
if (levelnum == 0 || !Query(2, 4, "Quit current game?", "Y/N", 'Y', 13, 'N', 27))
|
goto STARTGAME2;
|
||||||
{
|
|
||||||
levelnew = 0;
|
|
||||||
levelnum = 0;
|
|
||||||
|
|
||||||
goto STARTGAME2;
|
|
||||||
}
|
|
||||||
case 6:
|
case 6:
|
||||||
goto GAMELOOP;
|
goto GAMELOOP;
|
||||||
}
|
}
|
||||||
|
@ -2762,112 +2756,6 @@ void EraseScreen(int nVal)
|
||||||
videoClearScreen(nVal);
|
videoClearScreen(nVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Query(short nLines, short nKeys, ...)
|
|
||||||
{
|
|
||||||
short i;
|
|
||||||
|
|
||||||
char strings[20][80];
|
|
||||||
char keys[20];
|
|
||||||
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
short bPrevClip = bClip;
|
|
||||||
NoClip();
|
|
||||||
|
|
||||||
short nWidth = 0;
|
|
||||||
|
|
||||||
va_start(args, nKeys);
|
|
||||||
|
|
||||||
for (i = 0; i < nLines; i++)
|
|
||||||
{
|
|
||||||
char *str = va_arg(args, char*);
|
|
||||||
strcpy(strings[i], str);
|
|
||||||
Bstrupr(strings[i]);
|
|
||||||
|
|
||||||
int strWidth = MyGetStringWidth(strings[i]);
|
|
||||||
|
|
||||||
if (strWidth > nWidth) {
|
|
||||||
nWidth = strWidth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < nKeys; i++) {
|
|
||||||
keys[i] = (char)va_arg(args, int);
|
|
||||||
}
|
|
||||||
|
|
||||||
va_end(args);
|
|
||||||
|
|
||||||
int nHeight = (nLines + 1) * 10;
|
|
||||||
int y1 = (200 - nHeight) / 2;
|
|
||||||
int yB = y1;
|
|
||||||
|
|
||||||
// add some padding to left and right sides of text in the box
|
|
||||||
nWidth += 30;
|
|
||||||
|
|
||||||
int x1 = (320 - nWidth) / 2;
|
|
||||||
int x2 = x1 + nWidth;
|
|
||||||
|
|
||||||
// if (bHiRes)
|
|
||||||
// {
|
|
||||||
// x1 *= 2;
|
|
||||||
// y1 *= 2;
|
|
||||||
// nHeight *= 2;
|
|
||||||
// x2 *= 2;
|
|
||||||
// }
|
|
||||||
|
|
||||||
y1 = scale(y1, ydim, 200);
|
|
||||||
nHeight = scale(nHeight, ydim, 200);
|
|
||||||
x1 = scale(x1-160, ydim*4/3, 320)+xdim/2;
|
|
||||||
x2 = scale(x2-160, ydim*4/3, 320)+xdim/2;
|
|
||||||
|
|
||||||
// draw background box that the text sits in
|
|
||||||
for (i = 0; i < nHeight; i++) {
|
|
||||||
renderDrawLine(x1 << 12, (y1 + i) << 12, x2 << 12, (y1 + i) << 12, overscanindex);
|
|
||||||
}
|
|
||||||
|
|
||||||
y1 = yB + 5;
|
|
||||||
|
|
||||||
// draw each line of text
|
|
||||||
for (i = 0; i < nLines; i++) {
|
|
||||||
myprintext((320 - MyGetStringWidth(strings[i])) / 2, (y1 + i*10) , strings[i], 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
videoNextPage();
|
|
||||||
|
|
||||||
if (bPrevClip) {
|
|
||||||
Clip();
|
|
||||||
}
|
|
||||||
|
|
||||||
i = 0;
|
|
||||||
|
|
||||||
if (nKeys)
|
|
||||||
{
|
|
||||||
inputState.keyFlushChars();
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
HandleAsync();
|
|
||||||
|
|
||||||
char key = toupper(inputState.keyGetChar());
|
|
||||||
|
|
||||||
for (i = 0; i < nKeys; i++)
|
|
||||||
{
|
|
||||||
if (keys[i] == 0 || key == keys[i])
|
|
||||||
{
|
|
||||||
RefreshStatus();
|
|
||||||
ClearAllKeys();
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RefreshStatus();
|
|
||||||
ClearAllKeys();
|
|
||||||
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitSpiritHead()
|
void InitSpiritHead()
|
||||||
{
|
{
|
||||||
char filename[20];
|
char filename[20];
|
||||||
|
|
|
@ -98,7 +98,6 @@ set( PCH_SOURCES
|
||||||
src/spike.cpp
|
src/spike.cpp
|
||||||
src/sprite.cpp
|
src/sprite.cpp
|
||||||
src/sumo.cpp
|
src/sumo.cpp
|
||||||
src/swconfig.cpp
|
|
||||||
src/sync.cpp
|
src/sync.cpp
|
||||||
src/text.cpp
|
src/text.cpp
|
||||||
src/track.cpp
|
src/track.cpp
|
||||||
|
|
|
@ -50,7 +50,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
BEGIN_SW_NS
|
BEGIN_SW_NS
|
||||||
|
|
||||||
SWBOOL CheatInputMode = FALSE;
|
SWBOOL CheatInputMode = FALSE;
|
||||||
char CheatInputString[256];
|
|
||||||
SWBOOL EveryCheat = FALSE;
|
SWBOOL EveryCheat = FALSE;
|
||||||
SWBOOL ResCheat = FALSE;
|
SWBOOL ResCheat = FALSE;
|
||||||
|
|
||||||
|
@ -480,17 +479,14 @@ void CheatInput(void)
|
||||||
|
|
||||||
//if (CommEnabled)
|
//if (CommEnabled)
|
||||||
// return;
|
// return;
|
||||||
|
FString CheatInputString = MessageInputString;
|
||||||
strcpy(CheatInputString,MessageInputString);
|
CheatInputString.ToLower();
|
||||||
|
|
||||||
// make sure string is lower cased
|
|
||||||
Bstrlwr(CheatInputString);
|
|
||||||
|
|
||||||
// check for at least one single match
|
// check for at least one single match
|
||||||
for (i = 0; i < SIZ(ci); i++)
|
for (i = 0; i < SIZ(ci); i++)
|
||||||
{
|
{
|
||||||
// compare without the NULL
|
// compare without the NULL
|
||||||
if (cheatcmp(CheatInputString, ci[i].CheatInputCode, strlen(CheatInputString)) == 0)
|
if (cheatcmp(CheatInputString, ci[i].CheatInputCode, CheatInputString.Len()) == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
// if they are equal in length then its a complet match
|
// if they are equal in length then its a complet match
|
||||||
|
|
|
@ -458,6 +458,7 @@ InitNetPlayerOptions(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
void
|
void
|
||||||
SendMulitNameChange(char *new_name)
|
SendMulitNameChange(char *new_name)
|
||||||
{
|
{
|
||||||
|
@ -468,7 +469,6 @@ SendMulitNameChange(char *new_name)
|
||||||
if (!CommEnabled)
|
if (!CommEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Bstrupr(new_name);
|
|
||||||
strcpy(pp->PlayerName, new_name);
|
strcpy(pp->PlayerName, new_name);
|
||||||
playername = new_name;
|
playername = new_name;
|
||||||
SetRedrawScreen(pp);
|
SetRedrawScreen(pp);
|
||||||
|
@ -484,6 +484,7 @@ SendMulitNameChange(char *new_name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
SendVersion(int version)
|
SendVersion(int version)
|
||||||
|
|
|
@ -100,9 +100,6 @@ SWBOOL LoadScriptFile(const char *filename)
|
||||||
|
|
||||||
scriptbuffer[readsize] = '\0';
|
scriptbuffer[readsize] = '\0';
|
||||||
|
|
||||||
// Convert filebuffer to all upper case
|
|
||||||
//Bstrupr(scriptbuffer);
|
|
||||||
|
|
||||||
script_p = scriptbuffer;
|
script_p = scriptbuffer;
|
||||||
scriptend_p = script_p + size;
|
scriptend_p = script_p + size;
|
||||||
scriptline = 1;
|
scriptline = 1;
|
||||||
|
|
|
@ -1,106 +0,0 @@
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
/*
|
|
||||||
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
|
||||||
|
|
||||||
This file is part of Shadow Warrior version 1.2
|
|
||||||
|
|
||||||
Shadow Warrior is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU General Public License
|
|
||||||
as published by the Free Software Foundation; either version 2
|
|
||||||
of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
See the GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
Original Source: 1997 - Frank Maddin and Jim Norwood
|
|
||||||
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|
||||||
*/
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
#include "ns.h"
|
|
||||||
#include "build.h"
|
|
||||||
|
|
||||||
#include "keys.h"
|
|
||||||
#include "names2.h"
|
|
||||||
#include "panel.h"
|
|
||||||
#include "game.h"
|
|
||||||
|
|
||||||
//#include "settings.h"
|
|
||||||
#include "mytypes.h"
|
|
||||||
#include "gamedefs.h"
|
|
||||||
#include "common_game.h"
|
|
||||||
#include "config.h"
|
|
||||||
#include "gamecontrol.h"
|
|
||||||
|
|
||||||
#include "rts.h"
|
|
||||||
|
|
||||||
BEGIN_SW_NS
|
|
||||||
|
|
||||||
short GamePlays = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
===================
|
|
||||||
=
|
|
||||||
= SetGameDefaults
|
|
||||||
=
|
|
||||||
===================
|
|
||||||
*/
|
|
||||||
|
|
||||||
void SetGameDefaults(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
extern SWBOOL DrawScreen;
|
|
||||||
|
|
||||||
void EncodePassword(char *pw)
|
|
||||||
{
|
|
||||||
int bak_DrawScreen = DrawScreen;
|
|
||||||
int bak_randomseed = randomseed;
|
|
||||||
int i;
|
|
||||||
int len;
|
|
||||||
|
|
||||||
DrawScreen = FALSE;
|
|
||||||
randomseed = 1234L;
|
|
||||||
|
|
||||||
Bstrupr(pw);
|
|
||||||
|
|
||||||
len = strlen(pw);
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
pw[i] += RANDOM_RANGE(26);
|
|
||||||
|
|
||||||
randomseed = bak_randomseed;
|
|
||||||
DrawScreen = bak_DrawScreen;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DecodePassword(char *pw)
|
|
||||||
{
|
|
||||||
int bak_DrawScreen = DrawScreen;
|
|
||||||
int bak_randomseed = randomseed;
|
|
||||||
int i;
|
|
||||||
int len;
|
|
||||||
|
|
||||||
DrawScreen = FALSE;
|
|
||||||
randomseed = 1234L;
|
|
||||||
|
|
||||||
Bstrupr(pw);
|
|
||||||
|
|
||||||
len = strlen(pw);
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
pw[i] -= RANDOM_RANGE(26);
|
|
||||||
|
|
||||||
randomseed = bak_randomseed;
|
|
||||||
DrawScreen = bak_DrawScreen;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void TermSetup(void)
|
|
||||||
{
|
|
||||||
extern SWBOOL BotMode;
|
|
||||||
}
|
|
||||||
END_SW_NS
|
|
Loading…
Reference in a new issue