From 69f9c10a994be7e2a8b2e99c81bb7eb7e6517b51 Mon Sep 17 00:00:00 2001 From: ZTsukei Date: Mon, 15 Feb 2016 11:08:41 -0500 Subject: [PATCH] 16/02/15 Starting some setup --- .../projects/visualc10/libpng.vcxproj | 6 +- libs/zlib/projects/visualc10/zlib.vcxproj | 6 +- src/d_player.h | 107 ++++++++++++++++++ src/d_ticcmd.h | 2 + src/dehacked.c | 18 ++- src/doomdef.h | 16 +-- src/doomstat.h | 6 +- src/g_game.c | 2 +- src/hardware/r_opengl/r_opengl-vc10.vcxproj | 6 +- src/hardware/s_openal/s_openal-vc10.vcxproj | 6 +- src/p_local.h | 8 ++ src/p_saveg.c | 18 +++ src/p_saveg.h | 8 ++ src/sdl/Srb2SDL-vc10.vcxproj | 8 +- src/win32/Srb2win-vc10.vcxproj | 6 +- 15 files changed, 202 insertions(+), 21 deletions(-) diff --git a/libs/libpng-src/projects/visualc10/libpng.vcxproj b/libs/libpng-src/projects/visualc10/libpng.vcxproj index 1893783c..4ef7b16d 100644 --- a/libs/libpng-src/projects/visualc10/libpng.vcxproj +++ b/libs/libpng-src/projects/visualc10/libpng.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -26,18 +26,22 @@ StaticLibrary false + v120 StaticLibrary false + v120 StaticLibrary false + v120 StaticLibrary false + v120 diff --git a/libs/zlib/projects/visualc10/zlib.vcxproj b/libs/zlib/projects/visualc10/zlib.vcxproj index 4f0a16f3..e3f8f2e6 100644 --- a/libs/zlib/projects/visualc10/zlib.vcxproj +++ b/libs/zlib/projects/visualc10/zlib.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -26,18 +26,22 @@ StaticLibrary false + v120 StaticLibrary false + v120 StaticLibrary false + v120 StaticLibrary false + v120 diff --git a/src/d_player.h b/src/d_player.h index b9fcdef7..ba3acb1c 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -227,6 +227,95 @@ typedef enum pw_nocontrol, pw_ingoop, // In goop + // /////////////// // + // SRB2kart Powers // // SRB2kart 16/02/15 (TODO: Remove Riders powers we don't need.) + // /////////////// // + + // Riders + pw_boost, + pw_brake, + pw_exrun, // Are you on your gear? + pw_exspeed, // Extreme Gear speed + pw_airtank, // Air points for your gear + pw_airstartpoint, // More points = Less airtank points + pw_bustable, + pw_ramp, + pw_rampspeed, + pw_rampheight, + pw_rampspeed2, + pw_rampheight2, + pw_rampangle, + pw_rampscore, + pw_jmpcharge, // Hold the jump button to charge it first + + // Race + pw_drift, // Drifting Left or Right, plus a bigger counter = sharper turn + pw_driftcharge, // Charge your drift so you can release a burst of speed + pw_jmp, // In Mario Kart, letting go of the jump button stops the drift + pw_positiondelay, // Similar to P_PlayTauntSound's delay + pw_oldposition, + + // Kart + pw_kartitem, + pw_itemslot, // If you have X item, and kartitem chose X too, save it. + + pw_star, // 1 = Star in inventory + + pw_mushroom, // Whether you are currently shroom boosting + + pw_shroom, // 1 = 1 Mushroom in inventory, 2 = 2 Mushrooms in inventory, + // 4 = 3 Mushrooms in inventory, 8 = Gold Shroom in inventory + pw_goldshroom, // Timer for gold shroom usage + + pw_megamushroom, // 1 = mega shroom in inventory + + // Moved here because I don't want to break maps + pw_bananacam, // Player turning timer + + pw_thunder, // 1 = lightning in inventory + + pw_blueshell, // 1 = Blue Shell in inventory + + pw_shell, // 1 = shell being held, 2 = shell in inventory + pw_tripleshell, // 1 = 1 shell circling, 2 = 2 shells circling, + // 4 = 3 shells circling, 8 = triple shells in inventory + + pw_redshell, // 1 = redshell being held, 2 = redshell in inventory + pw_tripleredshell, // 1 = 1 red shell circling, 2 = 2 red shells circling, + // 4 = 3 red shells circling, 8 = triple red shells in inventory + + pw_banana, // 1 = banana being held, 2 = banana in inventory + pw_triplebanana, // 1 = 1 banana following, 2 = 2 bananas following, + // 4 = 3 bananas following, 8 = triple bananas in inventory + + pw_fakeitem, // 1 = fake being held, 2 = fake in inventory + + pw_bomb, // 1 = bomb being held, 2 = bomb in inventory + + pw_shrink, // > 0 = small, < 0 = big + pw_squished, // Squashed timer + pw_boostcharge, // Charge your engine at the start of the race for a boost + pw_fishing, // Set up a timer that forces you to be in the air while respawning + + // Misc + pw_psychic, // Silver's floating power + + pw_waypoint, // Waypoints. 'nuff said. + pw_introcam, // Early joiners need this, or a new joiner's camera will randomly rotate + pw_sounds, // We use this to avoid sounds being played every tic + + pw_boo, // The initial boo, when used we decide who to swap with and + // if we will actually swap, 1 = have boo in inventory + pw_bootake, // You are stealing an item from another player with boo, this is your timer + pw_boostolen, // you are the player being stolen from, this is your timer + + pw_greenboo, + pw_kitchensink, + + pw_pcd, // Past Checkpoint Distance + pw_ncd, // Next Chekpoint Distance + + NUMPOWERS } powertype_t; @@ -366,6 +455,9 @@ typedef struct player_s tic_t realtime; // integer replacement for leveltime UINT8 laps; // Number of laps (optional) + tic_t checkpointtimes[256]; // Checkpoints for race mode, etc // SRB2kart 16/02/15 + INT32 playerahead; // is someone ahead of me or not? // " + //////////////////// // CTF Mode Stuff // //////////////////// @@ -434,6 +526,21 @@ typedef struct player_s #ifdef HWRENDER fixed_t fovadd; // adjust FOV for hw rendering #endif + + INT32 chargei; // SRB2kart 16/02/15 ++ All lines below until end of enum + + INT32 starpostwp; + INT32 position; + INT32 heldDir; // Held dir of controls; 1 = forward, 0 = none, -1 = backward + INT32 turning; + INT32 newfloorz; + INT32 lakitu; + + INT32 spinout; // Seperate timer from pw_bananacam so that you can't get stuck spinning + UINT8 spinouttype; // The type of spinout you are currently suffering, 0 = slipping forwards, 1 = completely still + + UINT8 boosting; // if you're currently shroomboosting + } player_t; #endif diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h index edbba552..81125cf9 100644 --- a/src/d_ticcmd.h +++ b/src/d_ticcmd.h @@ -41,6 +41,8 @@ typedef enum BT_CUSTOM1 = 1<<13, BT_CUSTOM2 = 1<<14, BT_CUSTOM3 = 1<<15, + BT_FORWARD = 1<<16, // SRB2kart 16/02/15 + BT_BACKWARD = 1<<17, } buttoncode_t; // The data sampled per tick (single player) diff --git a/src/dehacked.c b/src/dehacked.c index 2dc9d742..09f4d16b 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -987,6 +987,14 @@ static const struct { {"XMAS",TOL_XMAS}, {"CHRISTMAS",TOL_XMAS}, {"WINTER",TOL_XMAS}, + + {"RETRO",TOL_RETROKART}, // SRB2kart 16/02/15 + {"RETROKART",TOL_RETROKART}, + {"MARIOKART",TOL_RETROKART}, + + {"NEO",TOL_NEOKART}, + {"NEOKART",TOL_NEOKART}, + {"SONICKART",TOL_NEOKART}, {NULL, 0} }; @@ -1185,6 +1193,8 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->countdown = (INT16)i; else if (fastcmp(word, "PALETTE")) mapheaderinfo[num-1]->palette = (UINT16)i; + else if (fastcmp(word, "AUTOMAP")) // SRB2kart 16/02/15 + mapheaderinfo[num-1]->automap = (UINT16)i; else if (fastcmp(word, "NUMLAPS")) mapheaderinfo[num-1]->numlaps = (UINT8)i; else if (fastcmp(word, "UNLOCKABLE")) @@ -2008,9 +2018,9 @@ static void readsound(MYFILE *f, INT32 num, const char *savesfxnames[]) /** Checks if a game data file name for a mod is good. * "Good" means that it contains only alphanumerics, _, and -; * ends in ".dat"; has at least one character before the ".dat"; - * and is not "gamedata.dat" (tested case-insensitively). + * and is not "srb2kart.dat" (tested case-insensitively). * - * Assumption: that gamedata.dat is the only .dat file that will + * Assumption: that srb2kart.dat is the only .dat file that will * ever be treated specially by the game. * * Note: Check for the tail ".dat" case-insensitively since at @@ -2034,9 +2044,9 @@ static boolean GoodDataFileName(const char *s) if (p <= s) return false; // too short if (!fasticmp(p, tail)) return false; // doesn't end in .dat #ifdef DELFILE - if (fasticmp(s, "gamedata.dat") && !disableundo) return false; + if (fasticmp(s, "srb2kart.dat") && !disableundo) return false; // SRB2kart 16/02/15 #else - if (fasticmp(s, "gamedata.dat")) return false; + if (fasticmp(s, "srb2kart.dat")) return false; #endif return true; diff --git a/src/doomdef.h b/src/doomdef.h index d14cd5dd..7c8d5b4e 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -143,9 +143,9 @@ extern FILE *logstream; #define SUBVERSION 0 // more precise version number #define VERSIONSTRING "Trunk" #else -#define VERSION 201 // Game version -#define SUBVERSION 14 // more precise version number -#define VERSIONSTRING "v2.1.14" +#define VERSION 1602 // Game version // SRB2kart 16/02/15 +#define SUBVERSION 15 // more precise version number +#define VERSIONSTRING "v16.02.15" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif @@ -161,7 +161,7 @@ extern FILE *logstream; // The string used in the alert that pops up in the event of an update being available. // Please change to apply to your modification (we don't want everyone asking where your mod is on SRB2.org!). #define UPDATE_ALERT_STRING \ -"A new update is available for SRB2.\n"\ +"A new update is available for SRB2Kart.\n"\ // SRB2kart 16/02/15 (TODO: Put mod URL here) "Please visit SRB2.org to download it.\n"\ "\n"\ "You are using version: %s\n"\ @@ -178,7 +178,7 @@ extern FILE *logstream; // The string used in the I_Error alert upon trying to host through command line parameters. // Generally less filled with newlines, since Windows gives you lots more room to work with. #define UPDATE_ALERT_STRING_CONSOLE \ -"A new update is available for SRB2.\n"\ +"A new update is available for SRB2Kart.\n"\ // SRB2kart 16/02/15 (TODO: Put mod URL here) "Please visit SRB2.org to download it.\n"\ "\n"\ "You are using version: %s\n"\ @@ -197,13 +197,13 @@ extern FILE *logstream; // The Modification ID; must be obtained from Inuyasha ( http://mb.srb2.org/private.php?do=newpm&u=2604 ). // DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server. // "12" is the default mod ID for version 2.1 -#define MODID 12 +#define MODID 9 // SRB2kart 16/02/15 (TODO: Check if this needs to be updated) // The Modification Version, starting from 1. Do not follow your version string for this, // 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.1.0 is not version "1". -#define MODVERSION 19 +#define MODVERSION 7 @@ -350,7 +350,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG; #define DEVMAPS "devmaps" #define DEVDATA "devdata" -#define SAVEGAMENAME "srb2sav" +#define SAVEGAMENAME "srb2kartsav" // SRB2kart 16/02/15 char savegamename[256]; diff --git a/src/doomstat.h b/src/doomstat.h index 44cf6fea..c32ba4cc 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -235,6 +235,7 @@ typedef struct UINT8 cutscenenum; ///< Cutscene number to use, 0 for none. INT16 countdown; ///< Countdown until level end? UINT16 palette; ///< PAL lump to use on this map + boolean automap; ///< Displays a level's white map outline in modified games // SRB2kart 16/02/15 UINT8 numlaps; ///< Number of laps in circuit mode, unless overridden. SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no. UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in? @@ -289,7 +290,10 @@ enum TypeOfLevel TOL_MARIO = 0x0200, ///< Mario TOL_NIGHTS = 0x0400, ///< NiGHTS TOL_ERZ3 = 0x0800, ///< ERZ3 - TOL_XMAS = 0x1000 ///< Christmas NiGHTS + TOL_XMAS = 0x1000, ///< Christmas NiGHTS + + TOL_RETROKART = 0x2000, ///< SRB2kart 'Retro' mode // SRB2kart 16/02/15 + TOL_NEOKART = 0x4000 ///< SRB2kart 'Neo' mode }; // Gametypes diff --git a/src/g_game.c b/src/g_game.c index c59f23c0..2da70223 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -60,7 +60,7 @@ JoyType_t Joystick2; // 1024 bytes is plenty for a savegame #define SAVEGAMESIZE (1024) -char gamedatafilename[64] = "gamedata.dat"; +char gamedatafilename[64] = "srb2kart.dat"; // SRB2kart 16/02/15 char timeattackfolder[64] = "main"; char customversionstring[32] = "\0"; diff --git a/src/hardware/r_opengl/r_opengl-vc10.vcxproj b/src/hardware/r_opengl/r_opengl-vc10.vcxproj index b1bf2ee0..4d737b50 100644 --- a/src/hardware/r_opengl/r_opengl-vc10.vcxproj +++ b/src/hardware/r_opengl/r_opengl-vc10.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -27,18 +27,22 @@ DynamicLibrary false + v120 DynamicLibrary false + v120 DynamicLibrary false + v120 DynamicLibrary false + v120 diff --git a/src/hardware/s_openal/s_openal-vc10.vcxproj b/src/hardware/s_openal/s_openal-vc10.vcxproj index f6d053b7..b98450a5 100644 --- a/src/hardware/s_openal/s_openal-vc10.vcxproj +++ b/src/hardware/s_openal/s_openal-vc10.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -28,19 +28,23 @@ DynamicLibrary false MultiByte + v120 DynamicLibrary false + v120 DynamicLibrary false MultiByte + v120 DynamicLibrary false + v120 diff --git a/src/p_local.h b/src/p_local.h index 0b27c40f..f2f2f538 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -59,6 +59,9 @@ #define mariomode (maptol & TOL_MARIO) #define twodlevel (maptol & TOL_2D) +#define retrokart (maptol & TOL_RETROKART) // SRB2kart 16/02/15 +#define neokart (maptol & TOL_NEOKART) + // // P_TICK // @@ -360,6 +363,11 @@ void P_CheckPointLimit(void); void P_CheckSurvivors(void); boolean P_CheckRacers(void); +void P_PlayBoardSound(mobj_t *source); // SRB2kart 16/02/15 +void P_LookForWaypoints(player_t *player); // " +void P_Waypoint(mobj_t *source, mobj_t *enemy); // " +INT32 P_CheckPlayerAhead(player_t *player, INT32 tocheck); // " + void P_ClearStarPost(INT32 postnum); void P_ResetStarposts(void); diff --git a/src/p_saveg.c b/src/p_saveg.c index 851d653f..1c052fce 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -72,6 +72,9 @@ static inline void P_ArchivePlayer(void) WRITEINT32(save_p, pllives); WRITEINT32(save_p, player->continues); + WRITEUINT8(save_p, player->starpostwp); // SRB2kart 16/02/15 + WRITEUINT8(save_p, player->position); // " + if (botskin) { WRITEUINT8(save_p, botskin); @@ -91,6 +94,9 @@ static inline void P_UnArchivePlayer(void) savedata.lives = READINT32(save_p); savedata.continues = READINT32(save_p); + savedata.starpostwp = READUINT8(save_p); // SRB2kart 16/02/15 + savedata.position = READUINT8(save_p); // " + if (savedata.botcolor) { savedata.botskin = READUINT8(save_p); @@ -176,6 +182,10 @@ static inline void P_NetArchivePlayers(void) WRITEINT16(save_p, players[i].totalring); WRITEUINT32(save_p, players[i].realtime); WRITEUINT8(save_p, players[i].laps); + + for (j = 0; j < (256); j++) // SRB2kart 16/02/15 + WRITEUINT32(save_p, players[i].checkpointtimes[j]); // " + WRITEINT32(save_p, players[i].playerahead); // " //////////////////// // CTF Mode Stuff // @@ -271,6 +281,8 @@ static inline void P_NetArchivePlayers(void) WRITEUINT8(save_p, players[i].accelstart); WRITEUINT8(save_p, players[i].acceleration); WRITEFIXED(save_p, players[i].jumpfactor); + + WRITEINT32(save_p, players[i].position); // SRB2kart 16/02/15 } } @@ -352,6 +364,10 @@ static inline void P_NetUnArchivePlayers(void) players[i].realtime = READUINT32(save_p); // integer replacement for leveltime players[i].laps = READUINT8(save_p); // Number of laps (optional) + for (j = 0; j < (256); j++) // SRB2kart 16/02/15 + players[i].checkpointtimes[j] = READUINT32(save_p); // " + players[i].playerahead = READINT32(save_p); // " + //////////////////// // CTF Mode Stuff // //////////////////// @@ -437,6 +453,8 @@ static inline void P_NetUnArchivePlayers(void) players[i].accelstart = READUINT8(save_p); players[i].acceleration = READUINT8(save_p); players[i].jumpfactor = READFIXED(save_p); + + players[i].position = READINT32(save_p); } } diff --git a/src/p_saveg.h b/src/p_saveg.h index 924e515a..b72968d8 100644 --- a/src/p_saveg.h +++ b/src/p_saveg.h @@ -38,6 +38,14 @@ typedef struct INT32 lives; INT32 continues; UINT16 emeralds; + + INT32 starpostwp; // SRB2kart 16/02/15 + INT32 position; // " + INT32 helddir; // Held dir of controls; 1 = forward, 0 = none, -1 = backward + INT32 turning; // " + INT32 newfloorz; // " + INT32 lakitu; // " + } savedata_t; extern savedata_t savedata; diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index 7e25b5ad..e1caa4cc 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -27,18 +27,22 @@ Application false + v120 Application false + v120 Application false + v120 Application false + v120 @@ -1461,4 +1465,4 @@ - + \ No newline at end of file diff --git a/src/win32/Srb2win-vc10.vcxproj b/src/win32/Srb2win-vc10.vcxproj index 20687364..dbdebb28 100644 --- a/src/win32/Srb2win-vc10.vcxproj +++ b/src/win32/Srb2win-vc10.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -27,18 +27,22 @@ Application false + v120 Application false + v120 Application false + v120 Application false + v120