From 4f8d53b329cd115562621756be826e3dd2d454a5 Mon Sep 17 00:00:00 2001 From: Nevur Date: Fri, 11 Aug 2017 15:46:46 +0200 Subject: [PATCH] Got rid of functions I added once but turned out to be unnecessary. --- src/p_setup.c | 17 +++++++---------- src/r_things.c | 32 -------------------------------- src/r_things.h | 1 - 3 files changed, 7 insertions(+), 43 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 2feba84d5..b6c8f75ca 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2599,7 +2599,7 @@ static boolean CanSaveLevel(INT32 mapnum) if (G_IsSpecialStage(mapnum) // don't save in special stages || mapnum == lastmaploaded) // don't save if the last map loaded was this one return false; - + // Any levels that have the savegame flag can save normally. // If the game is complete for this save slot, then any level can save! // On the other side of the spectrum, if lastmaploaded is 0, then the save file has only just been created and needs to save ASAP! @@ -3271,7 +3271,7 @@ boolean P_AddWadFile(const char *wadfilename, char **firstmapname) // FindFolder("SOCs/", &socPos, &socNum); FindFolder("Sounds/", &sfxPos, &sfxNum); FindFolder("Music/", &musPos, &musNum); - FindFolder("Sprites/", &sprPos, &sprNum); +// FindFolder("Sprites/", &sprPos, &sprNum); FindFolder("Textures/", &texPos, &texNum); // FindFolder("Patches/", &patPos, &patNum); // FindFolder("Flats/", &flaPos, &flaNum); @@ -3290,8 +3290,8 @@ boolean P_AddWadFile(const char *wadfilename, char **firstmapname) P_LoadSoundsRange(wadnum, sfxPos, sfxNum); if (musNum) // Music. TODO: Useless function right now. P_LoadMusicsRange(wadnum, musPos, musNum); - if (sprNum) // Sprites. - R_LoadSpritsRange(wadnum, sprPos, sprNum); +// if (sprNum) // Sprites. +// R_LoadSpritsRange(wadnum, sprPos, sprNum); // if (texNum) // Textures. TODO: R_LoadTextures() does the folder positioning once again. New function maybe? // R_LoadTextures(); // if (mapNum) // Maps. TODO: Actually implement the map WAD loading code, lulz. @@ -3330,12 +3330,6 @@ boolean P_AddWadFile(const char *wadfilename, char **firstmapname) digmreplaces++; } } - - // - // search for sprite replacements - // - R_AddSpriteDefs(wadnum); - break; } if (!devparm && sreplaces) @@ -3359,6 +3353,9 @@ boolean P_AddWadFile(const char *wadfilename, char **firstmapname) ST_LoadGraphics(); ST_ReloadSkinFaceGraphics(); + // Search for sprite replacements. + R_AddSpriteDefs(wadnum); + // // look for skins // diff --git a/src/r_things.c b/src/r_things.c index 5b5d7527f..299c2dac7 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -368,38 +368,6 @@ static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, return true; } -// Auxiliary function for PK3 loading - Loads sprites from a specified range. -void R_LoadSpritsRange(UINT16 wadnum, UINT16 first, UINT16 num) -{ - size_t i, addsprites = 0; - char wadname[MAX_WADPATH]; - // - // scan through lumps, for each sprite, find all the sprite frames - // - for (i = 0; i < numsprites; i++) - { - spritename = sprnames[i]; - if (spritename[4] && wadnum >= (UINT16)spritename[4]) - continue; - - if (R_AddSingleSpriteDef(spritename, &sprites[i], wadnum, first, first + num + 1)) - { -#ifdef HWRENDER - if (rendermode == render_opengl) - HWR_AddSpriteMD2(i); -#endif - // if a new sprite was added (not just replaced) - addsprites++; -#ifndef ZDEBUG - CONS_Debug(DBG_SETUP, "sprite %s set in pwad %d\n", spritename, wadnum); -#endif - } - } - - nameonly(strcpy(wadname, wadfiles[wadnum]->filename)); - CONS_Printf(M_GetText("%s added %d frames in %s sprites\n"), wadname, num, sizeu1(addsprites)); -} - // // Search for sprites replacements in a wad whose names are in namelist // diff --git a/src/r_things.h b/src/r_things.h index f5b863022..3b7d6ba3f 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -50,7 +50,6 @@ void R_SortVisSprites(void); //faB: find sprites in wadfile, replace existing, add new ones // (only sprites from namelist are added or replaced) void R_AddSpriteDefs(UINT16 wadnum); -void R_LoadSpritsRange(UINT16 wadnum, UINT16 first, UINT16 num); #ifdef DELFILE