Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
117 results
Select Git revision
Show changes
......@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2023 by Sonic Team Junior.
// Copyright (C) 1999-2024 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
......@@ -1137,7 +1137,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
}
#endif
if (splitscreen && (c & V_PERPLAYER))
{
......@@ -1953,7 +1953,7 @@ char *V_FontWordWrap(INT32 x, INT32 w, INT32 option, fixed_t scale, const char *
INT32 spacewidth = font.spacewidth, charwidth = 0;
slen = strlen(string);
if (w == 0)
w = BASEVIDWIDTH;
w -= x;
......@@ -2131,7 +2131,7 @@ void V_DrawAlignedFontStringAtFixed(fixed_t x, fixed_t y, INT32 option, fixed_t
lx = x - (V_FontStringWidth(line, option, font)*pscale);
break;
}
V_DrawFontStringAtFixed(lx, ly, option, pscale, vscale, line, font);
ly += FixedMul(((option & V_RETURN8) ? 8 : font.linespacing)<<FRACBITS, vscale);
......@@ -2422,7 +2422,7 @@ INT32 V_FontStringWidth(const char *string, INT32 option, fontdef_t font)
if (wline < w) wline = w;
w = 0;
continue;
}
}
if (string[i] & 0x80)
continue;
......@@ -2455,7 +2455,7 @@ INT32 V_FontStringHeight(const char *string, INT32 option, fontdef_t font)
{
result += (option & V_RETURN8) ? 8 : font.linespacing;
h = 0;
}
}
continue;
}
......
......@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2023 by Sonic Team Junior.
// Copyright (C) 1999-2024 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
......
#define SRB2VERSION "2.2.14"/* this must be the first line, for cmake !! */
#define SRB2VERSION "2.2.16"/* this must be the first line, for cmake !! */
// The Modification ID; must be obtained from a Master Server Admin ( https://mb.srb2.org/members/?key=ms_admin ).
// DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server.
......@@ -9,7 +9,7 @@
// it's only for detection of the version the player is using so the MS can alert them of an update.
// Only set it higher, not lower, obviously.
// Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1".
#define MODVERSION 55
#define MODVERSION 57
// Define this as a prerelease version suffix (pre#, RC#)
#define BETAVERSION "nightly"
......@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2023 by Sonic Team Junior.
// Copyright (C) 1999-2024 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
......@@ -65,6 +65,7 @@
#include "i_video.h" // rendermode
#include "md5.h"
#include "lua_script.h"
#include "lua_hook.h"
#ifdef SCANTHINGS
#include "p_setup.h" // P_ScanThings
#endif
......@@ -98,6 +99,7 @@ typedef struct lumpnum_cache_s
{
char lumpname[32];
lumpnum_t lumpnum;
UINT32 hash;
} lumpnum_cache_t;
static lumpnum_cache_t lumpnumcache[LUMPNUMCACHESIZE];
......@@ -306,12 +308,10 @@ static void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile)
* \param resblock resulting MD5 checksum
* \return 0 if MD5 checksum was made, and is at resblock, 1 if error was found
*/
#ifndef NOMD5
static INT32 W_MakeFileMD5(const char *filename, void *resblock)
{
#ifdef NOMD5
(void)filename;
memset(resblock, 0x00, 16);
#else
FILE *fhandle;
if ((fhandle = fopen(filename, "rb")) != NULL)
......@@ -328,9 +328,9 @@ static INT32 W_MakeFileMD5(const char *filename, void *resblock)
fclose(fhandle);
return 0;
}
#endif
return 1;
}
#endif
// Invalidates the cache of lump numbers. Call this whenever a wad is added.
static void W_InvalidateLumpnumCache(void)
......@@ -1010,6 +1010,10 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup)
break;
}
lua_lumploading++;
LUA_HookVoid(HOOK(AddonLoaded));
lua_lumploading--;
W_InvalidateLumpnumCache();
return wadfile->numlumps;
}
......@@ -1170,6 +1174,11 @@ UINT16 W_InitFolder(const char *path, boolean mainfile, boolean startup)
W_ReadFileShaders(wadfile);
W_LoadTrnslateLumps(numwadfiles - 1);
W_LoadDehackedLumpsPK3(numwadfiles - 1, mainfile);
lua_lumploading++;
LUA_HookVoid(HOOK(AddonLoaded));
lua_lumploading--;
W_InvalidateLumpnumCache();
return wadfile->numlumps;
......@@ -1328,10 +1337,10 @@ UINT16 W_CheckNumForFolderStartPK3(const char *name, UINT16 wad, UINT16 startlum
/* SLADE is special and puts a single directory entry. Skip that. */
if (strlen(lump_p->fullname) == name_length)
i++;
break;
return i;
}
}
return i;
return INT16_MAX;
}
// In a PK3 type of resource file, it looks for the next lumpinfo entry that doesn't share the specified pathfile.
......@@ -1349,6 +1358,47 @@ UINT16 W_CheckNumForFolderEndPK3(const char *name, UINT16 wad, UINT16 startlump)
return i;
}
char *W_GetLumpFolderPathPK3(UINT16 wad, UINT16 lump)
{
const char *fullname = wadfiles[wad]->lumpinfo[lump].fullname;
const char *slash = strrchr(fullname, '/');
INT32 pathlen = slash ? slash - fullname : 0;
char *path = Z_Calloc(pathlen + 1, PU_STATIC, NULL);
strncpy(path, fullname, pathlen);
return path;
}
char *W_GetLumpFolderNamePK3(UINT16 wad, UINT16 lump)
{
const char *fullname = wadfiles[wad]->lumpinfo[lump].fullname;
size_t start, end;
INT32 i = strlen(fullname);
i--;
while (i >= 0 && fullname[i] != '/')
i--;
if (i < 0)
return NULL;
end = i;
i--;
while (i >= 0 && fullname[i] != '/')
i--;
if (i < 0)
return NULL;
start = i + 1;
size_t namelen = end - start;
char *foldername = Z_Calloc(namelen + 1, PU_STATIC, NULL);
strncpy(foldername, fullname + start, namelen);
return foldername;
}
void W_GetFolderLumpsPwad(const char *name, UINT16 wad, UINT32 **list, UINT16 *list_capacity, UINT16 *numlumps)
{
size_t name_length = strlen(name);
......@@ -1434,6 +1484,63 @@ UINT16 W_CheckNumForFullNamePK3(const char *name, UINT16 wad, UINT16 startlump)
return INT16_MAX;
}
static lumpnum_t CheckLumpInCache(const char *name, boolean longname)
{
if (longname)
{
UINT32 hash = quickncasehash(name, 32);
// Loop backwards so that we check most recent entries first
for (INT32 i = lumpnumcacheindex + LUMPNUMCACHESIZE; i > lumpnumcacheindex; i--)
{
if (lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].hash == hash
&& stricmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name) == 0)
{
lumpnumcacheindex = i & (LUMPNUMCACHESIZE - 1);
return lumpnumcache[lumpnumcacheindex].lumpnum;
}
}
}
else
{
UINT32 hash = quickncasehash(name, 8);
// Loop backwards so that we check most recent entries first
for (INT32 i = lumpnumcacheindex + LUMPNUMCACHESIZE; i > lumpnumcacheindex; i--)
{
if (lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].hash == hash
&& lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname[8] == '\0'
&& strnicmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name, 8) == 0)
{
lumpnumcacheindex = i & (LUMPNUMCACHESIZE - 1);
return lumpnumcache[lumpnumcacheindex].lumpnum;
}
}
}
return LUMPERROR;
}
static void AddLumpToCache(lumpnum_t lumpnum, const char *name, boolean longname)
{
if (longname && strlen(name) >= 32)
return;
lumpnumcacheindex = (lumpnumcacheindex + 1) & (LUMPNUMCACHESIZE - 1);
memset(lumpnumcache[lumpnumcacheindex].lumpname, '\0', 32);
if (longname)
{
strlcpy(lumpnumcache[lumpnumcacheindex].lumpname, name, 32);
lumpnumcache[lumpnumcacheindex].hash = quickncasehash(name, 32);
}
else
{
strncpy(lumpnumcache[lumpnumcacheindex].lumpname, name, 8);
lumpnumcache[lumpnumcacheindex].hash = quickncasehash(name, 8);
}
lumpnumcache[lumpnumcacheindex].lumpnum = lumpnum;
}
//
// W_CheckNumForName
// Returns LUMPERROR if name not found.
......@@ -1446,17 +1553,10 @@ lumpnum_t W_CheckNumForName(const char *name)
if (!*name) // some doofus gave us an empty string?
return LUMPERROR;
// Check the lumpnumcache first. Loop backwards so that we check
// most recent entries first
for (i = lumpnumcacheindex + LUMPNUMCACHESIZE; i > lumpnumcacheindex; i--)
{
if (!lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname[8]
&& strncmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name, 8) == 0)
{
lumpnumcacheindex = i & (LUMPNUMCACHESIZE - 1);
return lumpnumcache[lumpnumcacheindex].lumpnum;
}
}
// Check the lumpnumcache first.
lumpnum_t cachenum = CheckLumpInCache(name, false);
if (cachenum != LUMPERROR)
return cachenum;
// scan wad files backwards so patch lump files take precedence
for (i = numwadfiles - 1; i >= 0; i--)
......@@ -1470,12 +1570,11 @@ lumpnum_t W_CheckNumForName(const char *name)
else
{
// Update the cache.
lumpnumcacheindex = (lumpnumcacheindex + 1) & (LUMPNUMCACHESIZE - 1);
memset(lumpnumcache[lumpnumcacheindex].lumpname, '\0', 32);
strncpy(lumpnumcache[lumpnumcacheindex].lumpname, name, 8);
lumpnumcache[lumpnumcacheindex].lumpnum = (i<<16)+check;
lumpnum_t lumpnum = (i << 16) + check;
AddLumpToCache(lumpnum, name, false);
return lumpnumcache[lumpnumcacheindex].lumpnum;
return lumpnum;
}
}
......@@ -1493,16 +1592,10 @@ lumpnum_t W_CheckNumForLongName(const char *name)
if (!*name) // some doofus gave us an empty string?
return LUMPERROR;
// Check the lumpnumcache first. Loop backwards so that we check
// most recent entries first
for (i = lumpnumcacheindex + LUMPNUMCACHESIZE; i > lumpnumcacheindex; i--)
{
if (strcmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name) == 0)
{
lumpnumcacheindex = i & (LUMPNUMCACHESIZE - 1);
return lumpnumcache[lumpnumcacheindex].lumpnum;
}
}
// Check the lumpnumcache first.
lumpnum_t cachenum = CheckLumpInCache(name, true);
if (cachenum != LUMPERROR)
return cachenum;
// scan wad files backwards so patch lump files take precedence
for (i = numwadfiles - 1; i >= 0; i--)
......@@ -1515,16 +1608,12 @@ lumpnum_t W_CheckNumForLongName(const char *name)
if (check == INT16_MAX) return LUMPERROR;
else
{
if (strlen(name) < 32)
{
// Update the cache.
lumpnumcacheindex = (lumpnumcacheindex + 1) & (LUMPNUMCACHESIZE - 1);
memset(lumpnumcache[lumpnumcacheindex].lumpname, '\0', 32);
strlcpy(lumpnumcache[lumpnumcacheindex].lumpname, name, 32);
lumpnumcache[lumpnumcacheindex].lumpnum = (i << 16) + check;
}
// Update the cache.
lumpnum_t lumpnum = (i << 16) + check;
return (i << 16) + check;
AddLumpToCache(lumpnum, name, true);
return lumpnum;
}
}
......@@ -1606,6 +1695,166 @@ lumpnum_t W_GetNumForLongName(const char *name)
return i;
}
//
// Same as W_CheckNumForNamePwad, but handles namespaces.
//
static UINT16 W_CheckNumForPatchNamePwad(const char *name, UINT16 wad, boolean longname)
{
UINT16 i, start = INT16_MAX, end = INT16_MAX;
static char uname[8 + 1] = { 0 };
UINT32 hash = 0;
lumpinfo_t *lump_p;
if (!TestValidLump(wad,0))
return INT16_MAX;
if (!longname)
{
strlcpy(uname, name, sizeof uname);
strupr(uname);
hash = quickncasehash(uname, 8);
}
// SRB2 doesn't have a specific namespace for graphics, which means someone can do weird things
// like placing graphics inside a namespace it doesn't make sense for them to be in, like Sounds/ or SOC/
// So for now, this checks for lumps OUTSIDE of the flats namespace.
// When this situation changes, change the loops below to check for lumps INSIDE the namespaces to look in.
// TODO: cache namespace lump IDs
if (W_FileHasFolders(wadfiles[wad]))
{
start = W_CheckNumForFolderStartPK3("Flats/", wad, 0);
end = W_CheckNumForFolderEndPK3("Flats/", wad, start);
// if the start and end is the same, the folder is empty
if (end <= start)
{
start = INT16_MAX;
end = INT16_MAX;
}
}
else
{
start = W_CheckNumForMarkerStartPwad("F_START", wad, 0);
end = W_CheckNumForNamePwad("F_END", wad, start);
if (end != INT16_MAX)
end++;
}
lump_p = wadfiles[wad]->lumpinfo;
if (start == INT16_MAX)
start = wadfiles[wad]->numlumps;
for (i = 0; i < start; i++, lump_p++)
{
if ((!longname && lump_p->hash == hash && !strncmp(lump_p->name, uname, sizeof(uname) - 1))
|| (longname && stricmp(lump_p->longname, name) == 0))
return i;
}
if (end != INT16_MAX && start < end)
{
lump_p = wadfiles[wad]->lumpinfo + end;
for (i = end; i < wadfiles[wad]->numlumps; i++, lump_p++)
{
if ((!longname && lump_p->hash == hash && !strncmp(lump_p->name, uname, sizeof(uname) - 1))
|| (longname && stricmp(lump_p->longname, name) == 0))
return i;
}
}
// not found.
return INT16_MAX;
}
//
// W_CheckNumForPatchNameInternal
// Gets a lump number out of a patch name. Returns LUMPERROR if name not found.
//
static lumpnum_t W_CheckNumForPatchNameInternal(const char *name, boolean longname)
{
INT32 i;
lumpnum_t check = INT16_MAX;
if (!*name) // some doofus gave us an empty string?
return LUMPERROR;
// Check the lumpnumcache first.
lumpnum_t cachenum = CheckLumpInCache(name, longname);
if (cachenum != LUMPERROR)
return cachenum;
// scan wad files backwards so patch lump files take precedence
for (i = numwadfiles - 1; i >= 0; i--)
{
check = W_CheckNumForPatchNamePwad(name,(UINT16)i,longname);
if (check != INT16_MAX)
break; //found it
}
if (check == INT16_MAX) return LUMPERROR;
else
{
// Update the cache.
lumpnum_t lumpnum = (i << 16) + check;
AddLumpToCache(lumpnum, name, longname);
return lumpnum;
}
}
//
// W_CheckNumForPatchName
// Wrapper for W_CheckNumForPatchNameInternal(name, false). Returns LUMPERROR if name not found.
//
lumpnum_t W_CheckNumForPatchName(const char *name)
{
return W_CheckNumForPatchNameInternal(name, false);
}
//
// Like W_CheckNumForPatchName, but can find entries with long names.
// Wrapper for W_CheckNumForPatchNameInternal(name, true). Returns LUMPERROR if name not found.
//
lumpnum_t W_CheckNumForLongPatchName(const char *name)
{
return W_CheckNumForPatchNameInternal(name, true);
}
//
// W_GetNumForPatchName
//
// Calls W_CheckNumForPatchName, but bombs out if not found.
//
lumpnum_t W_GetNumForPatchName(const char *name)
{
lumpnum_t i;
i = W_CheckNumForPatchName(name);
if (i == LUMPERROR)
I_Error("W_CheckNumForPatchName: %s not found!\n", name);
return i;
}
//
// Like W_GetNumForPatchName, but can find entries with long names
//
lumpnum_t W_GetNumForLongPatchName(const char *name)
{
lumpnum_t i;
i = W_CheckNumForLongPatchName(name);
if (i == LUMPERROR)
I_Error("W_GetNumForLongPatchName: %s not found!\n", name);
return i;
}
//
// W_CheckNumForNameInBlock
// Checks only in blocks from blockstart lump to blockend lump
......@@ -2250,10 +2499,10 @@ void *W_CachePatchName(const char *name, INT32 tag)
{
lumpnum_t num;
num = W_CheckNumForName(name);
num = W_CheckNumForPatchName(name);
if (num == LUMPERROR)
return W_CachePatchNum(W_GetNumForName("MISSING"), tag);
return W_CachePatchNum(W_GetNumForPatchName("MISSING"), tag);
return W_CachePatchNum(num, tag);
}
......@@ -2261,10 +2510,10 @@ void *W_CachePatchLongName(const char *name, INT32 tag)
{
lumpnum_t num;
num = W_CheckNumForLongName(name);
num = W_CheckNumForLongPatchName(name);
if (num == LUMPERROR)
return W_CachePatchNum(W_GetNumForLongName("MISSING"), tag);
return W_CachePatchNum(W_GetNumForLongPatchName("MISSING"), tag);
return W_CachePatchNum(num, tag);
}
#ifndef NOMD5
......@@ -2409,7 +2658,8 @@ static lumpchecklist_t folderblacklist[] =
{
{"Lua/", 4},
{"SOC/", 4},
{"Sprites/", 8},
{"Sprites/", 8},
{"LongSprites/", 12},
{"Textures/", 9},
{"Patches/", 8},
{"Flats/", 6},
......
......@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2023 by Sonic Team Junior.
// Copyright (C) 1999-2024 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
......@@ -180,6 +180,8 @@ UINT16 W_CheckNumForMarkerStartPwad(const char *name, UINT16 wad, UINT16 startlu
UINT16 W_CheckNumForFullNamePK3(const char *name, UINT16 wad, UINT16 startlump);
UINT16 W_CheckNumForFolderStartPK3(const char *name, UINT16 wad, UINT16 startlump);
UINT16 W_CheckNumForFolderEndPK3(const char *name, UINT16 wad, UINT16 startlump);
char *W_GetLumpFolderPathPK3(UINT16 wad, UINT16 lump);
char *W_GetLumpFolderNamePK3(UINT16 wad, UINT16 lump);
void W_GetFolderLumpsPwad(const char *name, UINT16 wad, UINT32 **list, UINT16 *list_capacity, UINT16 *numlumps);
void W_GetFolderLumps(const char *name, UINT32 **list, UINT16 *list_capacity, UINT16 *numlumps);
......@@ -191,6 +193,12 @@ lumpnum_t W_CheckNumForName(const char *name);
lumpnum_t W_CheckNumForLongName(const char *name);
lumpnum_t W_GetNumForName(const char *name); // like W_CheckNumForName but I_Error on LUMPERROR
lumpnum_t W_GetNumForLongName(const char *name);
lumpnum_t W_CheckNumForPatchName(const char *name);
lumpnum_t W_CheckNumForLongPatchName(const char *name);
lumpnum_t W_GetNumForPatchName(const char *name); // like W_CheckNumForPatchName but I_Error on LUMPERROR
lumpnum_t W_GetNumForLongPatchName(const char *name);
lumpnum_t W_CheckNumForNameInBlock(const char *name, const char *blockstart, const char *blockend);
UINT8 W_LumpExists(const char *name); // Lua uses this.
......
......@@ -77,8 +77,8 @@ END
#include "../doomdef.h" // Needed for version string
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,2,14,0
PRODUCTVERSION 2,2,14,0
FILEVERSION 2,2,16,0
PRODUCTVERSION 2,2,16,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
......@@ -98,7 +98,7 @@ BEGIN
VALUE "FileDescription", "Sonic Robo Blast 2\0"
VALUE "FileVersion", VERSIONSTRING_RC
VALUE "InternalName", "srb2\0"
VALUE "LegalCopyright", "Copyright 1998-2023 by Sonic Team Junior\0"
VALUE "LegalCopyright", "Copyright 1998-2025 by Sonic Team Junior\0"
VALUE "LegalTrademarks", "Sonic the Hedgehog and related characters are trademarks of Sega.\0"
VALUE "OriginalFilename", "srb2win.exe\0"
VALUE "PrivateBuild", "\0"
......
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2004-2023 by Sonic Team Junior.
// Copyright (C) 2004-2024 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
......@@ -109,6 +109,7 @@ typedef union
UINT16 *color[MAXPLAYERS]; // Winner's color #
boolean spectator[MAXPLAYERS]; // Spectator list
UINT8 *character[MAXPLAYERS]; // Winner's character #
INT32 ctfteam[MAXPLAYERS]; // Winner's ctfteam #
INT32 num[MAXPLAYERS]; // Winner's player #
char *name[MAXPLAYERS]; // Winner's name
patch_t *result; // RESULT
......@@ -579,9 +580,9 @@ void Y_IntermissionDrawer(void)
{
if (LUA_HudEnabled(hud_intermissiontitletext))
{
const char *ringtext = "\x82" "get 50 rings, then";
const char *tut1text = "\x82" "press " "\x80" "shield";
const char *tut2text = "\x82" "to transform";
const char *ringtext = "\x82" "50 rings, no shield";
const char *tut1text = "\x82" "press " "\x80" "spin";
const char *tut2text = "\x82" "mid-" "\x80" "jump";
ttheight = 8;
V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1);
ttheight += V_LevelNameHeight(data.spec.passed3) + 2;
......@@ -849,7 +850,7 @@ void Y_IntermissionDrawer(void)
{
UINT8 *colormap = R_GetTranslationColormap(*data.match.character[i], *data.match.color[i], GTC_CACHE);
if (*data.match.color[i] == SKINCOLOR_RED) //red
if (data.match.ctfteam[i] == 1) //red
{
if (redplayers++ > 9)
continue;
......@@ -857,7 +858,7 @@ void Y_IntermissionDrawer(void)
y = (redplayers * 16) + 32;
V_DrawCenteredString(x+6, y, 0, va("%d", redplayers));
}
else if (*data.match.color[i] == SKINCOLOR_BLUE) //blue
else if (data.match.ctfteam[i] == 2) //blue
{
if (blueplayers++ > 9)
continue;
......@@ -1129,7 +1130,7 @@ void Y_Ticker(void)
else if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
S_ChangeMusicInternal(mapheaderinfo[gamemap-1]->musintername, false); // don't loop it
else
S_ChangeMusicInternal("_clear", false); // don't loop it
S_ChangeMusicInternal(stagefailed ? "CHFAIL" : "CHPASS", false); // don't loop it
tallydonetic = -1;
}
......@@ -1622,6 +1623,7 @@ static void Y_CalculateMatchWinners(void)
boolean completed[MAXPLAYERS];
// Initialize variables
memset(data.match.ctfteam, 0, sizeof (data.match.ctfteam));
memset(data.match.scores, 0, sizeof (data.match.scores));
memset(data.match.color, 0, sizeof (data.match.color));
memset(data.match.character, 0, sizeof (data.match.character));
......@@ -1642,8 +1644,15 @@ static void Y_CalculateMatchWinners(void)
if (players[i].score >= data.match.scores[data.match.numplayers] && completed[i] == false)
{
data.match.ctfteam[data.match.numplayers] = players[i].ctfteam;
data.match.scores[data.match.numplayers] = players[i].score;
data.match.color[data.match.numplayers] = &players[i].skincolor;
if (data.match.ctfteam[data.match.numplayers] == 1) // red team
data.match.color[data.match.numplayers] = &skincolor_redteam;
if (data.match.ctfteam[data.match.numplayers] == 2) // blue team
data.match.color[data.match.numplayers] = &skincolor_blueteam;
data.match.character[data.match.numplayers] = &players[i].skin;
data.match.name[data.match.numplayers] = player_names[i];
data.match.spectator[data.match.numplayers] = players[i].spectator;
......@@ -2065,7 +2074,7 @@ static void Y_AwardCoopBonuses(void)
(bonuses_list[bonusnum][j])(&players[i], &localbonuses[j]);
else
Y_SetNullBonus(&players[i], &localbonuses[j]);
players[i].score += localbonuses[j].points;
if (players[i].score > MAXSCORE)
players[i].score = MAXSCORE;
......
......@@ -671,6 +671,7 @@ static void Command_Memfree_f(void)
CONS_Printf(M_GetText("Cached textures : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRCACHE)>>10));
CONS_Printf(M_GetText("Texture colormaps : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPATCHCOLMIPMAP)>>10));
CONS_Printf(M_GetText("Model textures : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRMODELTEXTURE)>>10));
CONS_Printf(M_GetText("Light table textures : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRLIGHTTABLEDATA)>>10));
CONS_Printf(M_GetText("Plane polygons : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPLANE)>>10));
CONS_Printf(M_GetText("All GPU textures : %7d KB\n"), HWR_GetTextureUsed()>>10);
}
......
......@@ -55,6 +55,7 @@ enum
PU_HWRPATCHINFO = 21, // Hardware GLPatch_t struct for OpenGL texture cache
PU_HWRPATCHCOLMIPMAP = 22, // Hardware GLMipmap_t struct colormap variation of patch
PU_HWRMODELTEXTURE = 23, // Hardware model texture
PU_HWRLIGHTTABLEDATA = 24, // Hardware light table data
PU_HWRCACHE = 48, // static until unlocked
PU_CACHE = 49, // static until unlocked
......
......@@ -55,4 +55,3 @@ else()
endif()
FetchContent_MakeAvailable(curl)
......@@ -36,4 +36,3 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(SDL2_mixer_ext)
......@@ -33,4 +33,3 @@ FetchContent_MakeAvailable(ZLIB)
add_library(ZLIB::ZLIB ALIAS zlibstatic)
set(ZLIB_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/zlib" "${zlib_BINARY_DIR}" CACHE PATH "" FORCE)
......@@ -2,84 +2,67 @@
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "srb2",
"version": "1.0.0",
"builtin-baseline": "c823fd3e57035b10d970a96da2796a2db55e5df5",
"builtin-baseline": "d5ec528843d29e3a52d745a64b469f810b2cedbf",
"dependencies": [
"curl",
{
"name": "libgme",
"platform": "!(windows & mingw) & !native"
"name": "curl",
"platform": "!wasm32"
},
"libgme",
{
"name": "libopenmpt",
"platform": "!(windows & mingw)"
"name":"libopenmpt",
"platform": "!wasm32"
},
"libpng",
"miniupnpc",
"sdl2",
{
"name": "sdl2-mixer-ext",
"name": "sdl2",
"default-features": false,
"features": [
{
"name": "cmd",
"name": "wayland",
"platform": "linux"
},
{
"name": "libflac",
"platform": "!(windows & mingw & !static)"
},
{
"name": "libgme",
"platform": "!(windows & mingw) & !native"
},
{
"name": "libmodplug",
"platform": "!(windows & mingw)"
},
{
"name": "libopnmidi",
"platform": "!(windows & mingw)"
},
{
"name": "libvorbis",
"platform": "!(windows & mingw & !static)"
},
{
"name": "libxmp",
"platform": "!(windows & mingw)"
},
"name": "x11",
"platform": "!windows"
}
],
"platform": "!wasm32",
"version>=": "2.30.6#2"
},
{
"name": "sdl2-mixer-ext",
"features": [
{
"name": "mpg123",
"platform": "!(windows & mingw)"
"name":"fluidsynth",
"platform": "!static"
},
{
"name": "nativemidi",
"platform": "!(windows & mingw)"
"name":"libflac",
"platform": "!wasm32"
},
"libgme",
"libmodplug",
{
"name": "opusfile",
"platform": "!(windows & mingw)"
"name":"libvorbis",
"platform": "!wasm32"
},
"libxmp",
{
"name": "pxtone",
"platform": "!(windows & mingw)"
"name":"mpg123",
"platform": "!wasm32"
},
{
"name": "timidity",
"platform": "!(windows & mingw)"
"name":"opusfile",
"platform": "!wasm32"
},
{
"name": "wavpack",
"platform": "!(windows & mingw)"
}
]
"pxtone",
"timidity"
],
"platform": "!wasm32",
"version>=": "2.6.0#0"
},
"zlib"
],
"overrides": [
{
"name": "sdl2",
"version": "2.28.5",
"port-version": 1
}
]
}