From 0c52e4f1912d370d51d8f57fbb30f42548e74134 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 10 Aug 2020 14:21:24 +0200 Subject: [PATCH] remove all non-critical uses of the GOODTIMES macro --- README.txt | 1 - version.h | 5 +- wl_def.h | 1 - wl_inter.cpp | 466 --------------------------------------------------- wl_main.cpp | 22 --- wl_menu.cpp | 67 -------- wl_menu.h | 15 -- 7 files changed, 2 insertions(+), 575 deletions(-) diff --git a/README.txt b/README.txt index 8f1d0f7..1bf6558 100644 --- a/README.txt +++ b/README.txt @@ -132,7 +132,6 @@ Wolf4SDL supports the following command line options: For Spear of Destiny the following additional options are available: --mission Mission number to play (1-3) - --goodtimes Disable copy protection quiz Compiling from source code: diff --git a/version.h b/version.h index 9ecf9c4..b9c6607 100644 --- a/version.h +++ b/version.h @@ -15,15 +15,14 @@ //#define APOGEE_1_2 /* - Wolf3d Full v1.1 Apogee (with ReadThis) - define CARMACIZED and APOGEE_1_1 - Wolf3d Full v1.4 Apogee (with ReadThis) - define CARMACIZED + Wolf3d Full v1.1 Apogee - define CARMACIZED and APOGEE_1_1 + Wolf3d Full v1.4 Apogee - define CARMACIZED Wolf3d Full v1.4 GT/ID/Activision - define CARMACIZED and GOODTIMES Wolf3d Shareware v1.0 - define UPLOAD and APOGEE_1_0 Wolf3d Shareware v1.1 - define CARMACIZED and UPLOAD and APOGEE_1_1 Wolf3d Shareware v1.2 - define CARMACIZED and UPLOAD and APOGEE_1_2 Wolf3d Shareware v1.4 - define CARMACIZED and UPLOAD Spear of Destiny Full and Mission Disks - define CARMACIZED and SPEAR - (and GOODTIMES for no FormGen quiz) Spear of Destiny Demo - define CARMACIZED and SPEAR and SPEARDEMO */ diff --git a/wl_def.h b/wl_def.h index 8499124..91f515c 100644 --- a/wl_def.h +++ b/wl_def.h @@ -939,7 +939,6 @@ extern int param_joystickhat; extern longword param_samplerate; extern int param_audiobuffer; extern int param_mission; -extern boolean param_goodtimes; extern boolean param_ignorenumchunks; diff --git a/wl_inter.cpp b/wl_inter.cpp index 328843c..534128a 100644 --- a/wl_inter.cpp +++ b/wl_inter.cpp @@ -1176,470 +1176,4 @@ CheckHighScore (int32_t score, word other) } } - - -#ifndef UPLOAD -#ifndef SPEAR -//////////////////////////////////////////////////////// -// -// NON-SHAREWARE NOTICE -// -//////////////////////////////////////////////////////// -void -NonShareware (void) -{ - VW_FadeOut (); - - ClearMScreen (); - DrawStripes (10); - - CA_CacheGrChunk (STARTFONT + 1); - fontnumber = 1; - - SETFONTCOLOR (READHCOLOR, BKGDCOLOR); - PrintX = 110; - PrintY = 15; - - US_Print ("Attention"); - - SETFONTCOLOR (HIGHLIGHT, BKGDCOLOR); - WindowX = PrintX = 40; - PrintY = 60; - US_Print ("This game is NOT shareware.\n"); - US_Print ("Please do not distribute it.\n"); - US_Print ("Thanks.\n\n"); - US_Print (" Id Software\n"); - - VW_UpdateScreen (); - VW_FadeIn (); - IN_Ack (); -} -#endif -#endif - -#ifdef SPEAR -#ifndef GOODTIMES -#ifndef SPEARDEMO -//////////////////////////////////////////////////////// -// -// COPY PROTECTION FOR FormGen -// -//////////////////////////////////////////////////////// -char CopyProFailedStrs[][100] = { - STR_COPY1, - STR_COPY2, - - STR_COPY3, - STR_COPY4, - - STR_COPY5, - STR_COPY6, - - STR_COPY7, - STR_COPY8, - - STR_COPY9, - "", - - STR_COPY10, - STR_COPY11, - - STR_COPY12, - "", - - STR_COPY13, - "", - - STR_COPY14, - "" -}; - -char BackDoorStrs[5][16] = { - "a spoon?", - "bite me!", - "joshua", - "pelt", - "snoops" -}; - -char GoodBoyStrs[10][40] = { - "...is the CORRECT ANSWER!", - "", - - "Consider yourself bitten, sir.", - "", - - "Greetings Professor Falken, would you", - "like to play Spear of Destiny?", - - "Do you have any gold spray paint?", - "", - - "I wish I had a 21\" monitor...", - "" -}; - -char bossstrs[4][24] = { - "DEATH KNIGHT", - "BARNACLE WILHELM", - "UBERMUTANTUBER MUTANT", - "TRANS GROSSE" -}; - -char WordStr[5][20] = { - "New Game", - "Sound...F4", - "Control...F6", - "Change View...F5", - "Quit...F10" -}; - -char WordCorrect[5][2] = { "3", "4", "4", "5", "5" }; - -char MemberStr[10][40] = { - STR_COPY15, - "", - - STR_COPY16, - "", - - STR_COPY17, - STR_COPY18, - - STR_COPY19, - STR_COPY20, - - STR_COPY21, - STR_COPY22 -}; - -char MemberCorrect[5][24] = { - "adrian carmack", - "john carmackjohn romero", - "tom hall", - "jay wilbur", - "kevin cloud" -}; - -char DosMessages[9][80] = { - STR_NOPE1, - STR_NOPE2, - STR_NOPE3, - STR_NOPE4, - STR_NOPE5, - STR_NOPE6, - STR_NOPE7, - STR_NOPE8, - STR_NOPE9 -}; - -char MiscTitle[4][20] = { - "BLOOD TEST", - "STRAIGHT-LACED", - "QUITE SHAPELY", - "I AM WHAT I AMMO" -}; - -char MiscStr[12][40] = { - STR_MISC1, - STR_MISC2, - "", - - STR_MISC3, - STR_MISC4, - "", - - STR_MISC5, - STR_MISC6, - "", - - STR_MISC7, - STR_MISC8, - STR_MISC9 -}; - -char MiscCorrect[4][5] = { "ss", "8", STR_STAR, "45" }; - - -int -BackDoor (char *s) -{ - for (int i = 0; i < 5; i++) - { - if (!strcasecmp (s, BackDoorStrs[i])) - { - SETFONTCOLOR (14, 15); - fontnumber = 0; - PrintY = 175; - VWB_DrawPic (0, 20 * 8, COPYPROTBOXPIC); - US_CPrint (GoodBoyStrs[i * 2]); - US_CPrint (GoodBoyStrs[i * 2 + 1]); - VW_UpdateScreen (); - return 1; - } - } - - return 0; -} - - -void -CopyProtection (void) -{ -#define TYPEBOX_Y 177 -#define TYPEBOX_BKGD 0x9c -#define PRINTCOLOR HIGHLIGHT - - unsigned i; - int match, whichboss, bossnum, attempt, whichline; - int enemypicked[4] = { 0, 0, 0, 0 }; - int bosses[4] = { BOSSPIC1PIC, BOSSPIC2PIC, BOSSPIC3PIC, BOSSPIC4PIC }; - int whichpicked[4] = { 0, 0, 0, 0 }; - int whichone, quiztype, whichmem, whichword; - int memberpicked[5] = { 0, 0, 0, 0, 0 }; - int wordpicked[5] = { 0, 0, 0, 0, 0 }; - - char inputbuffer[20]; - char message[80]; - - enum - { - debriefing, - checkmanual, - staffquiz, - miscquiz, - - totaltypes - }; - - - - attempt = 0; - VW_FadeOut (); - CA_CacheGrChunk (C_BACKDROPPIC); - CacheLump (COPYPROT_LUMP_START, COPYPROT_LUMP_END); - CA_CacheGrChunk (STARTFONT + 1); - CA_LoadAllSounds (); - StartCPMusic (COPYPRO_MUS); - US_InitRndT (true); - - while (attempt < 3) - { - fontnumber = 1; - SETFONTCOLOR (PRINTCOLOR - 2, 15); - VWB_DrawPic (0, 0, C_BACKDROPPIC); - VWB_DrawPic (0, 0, COPYPROTTOPPIC); - VWB_DrawPic (0, 20 * 8, COPYPROTBOXPIC); - WindowX = WindowY = 0; - WindowW = 320; - WindowH = 200; - PrintY = 65; - - quiztype = US_RndT () % totaltypes; - switch (quiztype) - { - // - // BOSSES QUIZ - // - case debriefing: - { - PrintX = 0; - US_Print (STR_DEBRIEF); - SETFONTCOLOR (PRINTCOLOR, 15); - - while (enemypicked[whichboss = US_RndT () & 3]); - enemypicked[whichboss] = 1; - bossnum = bosses[whichboss]; - VWB_DrawPic (128, 60, bossnum); - fontnumber = 0; - PrintY = 130; - US_CPrint (STR_ENEMY1 "\n"); - US_CPrint (STR_ENEMY2 "\n\n"); - - VW_UpdateScreen (); - VW_FadeIn (); - - PrintX = 100; - fontcolor = 15; - backcolor = TYPEBOX_BKGD; - inputbuffer[0] = 0; - PrintY = TYPEBOX_Y; - fontnumber = 1; - US_LineInput (PrintX, PrintY, inputbuffer, 0, true, 20, 100); - - match = 0; - size_t inputlen = strlen(inputbuffer); - if(inputlen > 3) - { - size_t bosslen = strlen(bossstrs[whichboss]); - for (i = 0; i < bosslen; i++) - { - if (!strncasecmp (inputbuffer, bossstrs[whichboss] + i, inputlen)) - { - match = 1; - break; - } - } - } - - match += BackDoor (inputbuffer); - break; - } - - // - // MANUAL CHECK - // - case checkmanual: - { - while (wordpicked[whichword = US_RndT () % 5]); - wordpicked[whichword] = 1; - US_CPrint (STR_CHECKMAN); - SETFONTCOLOR (PRINTCOLOR, 15); - PrintY += 25; - US_CPrint (STR_MAN1); - US_CPrint (STR_MAN2); - sprintf(message, STR_MAN3 " \"%s\" " STR_MAN4, WordStr[whichword]); - US_CPrint (message); - VW_UpdateScreen (); - VW_FadeIn (); - - PrintX = 146; - fontcolor = 15; - backcolor = TYPEBOX_BKGD; - inputbuffer[0] = 0; - PrintY = TYPEBOX_Y; - US_LineInput (PrintX, PrintY, inputbuffer, 0, true, 6, 100); - - match = 1 - (strcasecmp (inputbuffer, WordCorrect[whichword]) != 0); - match += BackDoor (inputbuffer); - break; - } - - // - // STAFF QUIZ - // - case staffquiz: - { - while (memberpicked[whichmem = US_RndT () % 5]); - memberpicked[whichmem] = 1; - US_CPrint (STR_ID1); - SETFONTCOLOR (PRINTCOLOR, 15); - PrintY += 25; - US_CPrint (MemberStr[whichmem * 2]); - US_CPrint (MemberStr[whichmem * 2 + 1]); - VW_UpdateScreen (); - VW_FadeIn (); - - PrintX = 100; - fontcolor = 15; - backcolor = TYPEBOX_BKGD; - inputbuffer[0] = 0; - PrintY = TYPEBOX_Y; - US_LineInput (PrintX, PrintY, inputbuffer, 0, true, 20, 120); - - match = 0; - size_t inputlen = strlen(inputbuffer); - if(inputlen > 2) - { - size_t memberlen = strlen(MemberCorrect[whichmem]); - for (i = 0; i < memberlen; i++) - { - if (!strncasecmp (inputbuffer, MemberCorrect[whichmem] + i, inputlen)) - { - match = 1; - break; - } - } - } - - match += BackDoor (inputbuffer); - break; - } - - // - // MISCELLANEOUS QUESTIONS - // - case miscquiz: - { - while (whichpicked[whichone = US_RndT () & 3]); - whichpicked[whichone] = 1; - US_CPrint (MiscTitle[whichone]); - SETFONTCOLOR (PRINTCOLOR, 15); - PrintY += 25; - US_CPrint (MiscStr[whichone * 3]); - US_CPrint (MiscStr[whichone * 3 + 1]); - US_CPrint (MiscStr[whichone * 3 + 2]); - VW_UpdateScreen (); - VW_FadeIn (); - - PrintX = 146; - fontcolor = 15; - backcolor = TYPEBOX_BKGD; - inputbuffer[0] = 0; - PrintY = TYPEBOX_Y; - US_LineInput (PrintX, PrintY, inputbuffer, 0, true, 6, 100); - - match = 1 - (strcasecmp (inputbuffer, MiscCorrect[whichone]) != 0); - match += BackDoor (inputbuffer); - break; - } - } - - // - // IF NO MATCH, WE'VE GOT A (MINOR) PROBLEM! - // - - if (!match) - { - whichline = 2 * (US_RndT () % 9); - SETFONTCOLOR (14, 15); - fontnumber = 0; - PrintY = 175; - VWB_DrawPic (0, 20 * 8, COPYPROTBOXPIC); - US_CPrint (CopyProFailedStrs[whichline]); - US_CPrint (CopyProFailedStrs[whichline + 1]); - - VW_UpdateScreen (); - SD_PlaySound (NOWAYSND); - IN_UserInput (TickBase * 6); - VW_FadeOut (); - attempt++; - } - else - { - int start; - - SD_PlaySound (BONUS1UPSND); - SD_WaitSoundDone (); - UNCACHEGRCHUNK (STARTFONT + 1); - UNCACHEGRCHUNK (C_BACKDROPPIC); - UnCacheLump (COPYPROT_LUMP_START, COPYPROT_LUMP_END); - - switch (SoundMode) - { - case sdm_Off: - return; - case sdm_PC: - start = STARTPCSOUNDS; - break; - case sdm_AdLib: - start = STARTADLIBSOUNDS; - } - -/* for (i=0;i Mission number to play (0-3)\n" " (default: 0 -> .sod, 1-3 -> .sd*)\n" - " --goodtimes Disable copy protection quiz\n" #endif , defaultSampleRate ); diff --git a/wl_menu.cpp b/wl_menu.cpp index 8eebc31..3ef31c2 100644 --- a/wl_menu.cpp +++ b/wl_menu.cpp @@ -22,20 +22,9 @@ extern int numEpisodesMissing; // // PRIVATE PROTOTYPES // -int CP_ReadThis (int); -#ifdef SPEAR -#define STARTITEM newgame - -#else -#ifdef GOODTIMES #define STARTITEM newgame -#else -#define STARTITEM readthis -#endif -#endif - // ENDSTRx constants are defined in foreign.h char endStrings[9][80] = { ENDSTR1, @@ -57,15 +46,6 @@ CP_itemtype MainMenu[] = { {1, STR_LG, CP_LoadGame}, {0, STR_SG, CP_SaveGame}, {1, STR_CV, CP_ChangeView}, - -#ifndef GOODTIMES -#ifndef SPEAR - - {2, "Read This!", CP_ReadThis}, - -#endif -#endif - {1, STR_VS, CP_ViewScores}, {1, STR_BD, 0}, {1, STR_QT, 0} @@ -384,15 +364,7 @@ US_ControlPanel (ScanCode scancode) switch (scancode) { case sc_F1: -#ifdef SPEAR - BossKey (); -#else -#ifdef GOODTIMES BossKey (); -#else - HelpScreens (); -#endif -#endif goto finishup; case sc_F2: @@ -584,24 +556,6 @@ DrawMainMenu (void) VW_UpdateScreen (); } -#ifndef GOODTIMES -#ifndef SPEAR -//////////////////////////////////////////////////////////////////// -// -// READ THIS! -// -//////////////////////////////////////////////////////////////////// -int -CP_ReadThis (int) -{ - StartCPMusic (CORNER_MUS); - HelpScreens (); - StartCPMusic (MENUSONG); - return true; -} -#endif -#endif - //////////////////////////////////////////////////////////////////// // @@ -998,15 +952,6 @@ CP_NewGame (int) StartGame = 1; MenuFadeOut (); - // - // CHANGE "READ THIS!" TO NORMAL COLOR - // -#ifndef SPEAR -#ifndef GOODTIMES - MainMenu[readthis].active = 1; -#endif -#endif - pickquick = 0; #ifdef SPEAR @@ -1427,15 +1372,6 @@ CP_LoadGame (int quick) StartGame = 1; ShootSnd (); - // - // CHANGE "READ THIS!" TO NORMAL COLOR - // - -#ifndef SPEAR -#ifndef GOODTIMES - MainMenu[readthis].active = 1; -#endif -#endif exit = 1; break; @@ -3862,9 +3798,6 @@ CheckForEpisodes (void) strcat (demoname, extension); #ifndef SPEAR -#ifndef GOODTIMES - strcat (helpfilename, extension); -#endif strcat (endfilename, extension); #endif } diff --git a/wl_menu.h b/wl_menu.h index b3a9ac4..1dab2ed 100644 --- a/wl_menu.h +++ b/wl_menu.h @@ -46,15 +46,7 @@ #define MENU_X 76 #define MENU_Y 55 #define MENU_W 178 -#ifndef SPEAR -#ifndef GOODTIMES -#define MENU_H 13*10+6 -#else -#define MENU_H 13*9+6 -#endif -#else #define MENU_H 13*9+6 -#endif #define SM_X 48 #define SM_W 250 @@ -210,13 +202,6 @@ enum menuitems loadgame, savegame, changeview, - -#ifndef GOODTIMES -#ifndef SPEAR - readthis, -#endif -#endif - viewscores, backtodemo, quit