(No, game, you can't allocate a map header for the credits, why were you doing that before and how did it not break anything??)
(cherry picked from commit e1f9a01229)
Use whatever names you want for your music. So long as you prefix the lumps with O_ or D_, it doesn't matter anymore.
DISCLAIMER: Linedef type 413 (change music) and Lua scripting is not tested.
(cherry picked from commit 025ca413a2)
# Conflicts:
# src/p_user.c
Travis-CI builds
Merge support to build SRB2 for Linux system via Travis-Ci
This will build SRB2 with GCC and Clang to make sure we do not break Linux/GNU builds
See merge request !41
Monster Iestyn's Miscellaneous (netplay-compatible) changes
Just cleaning up some unused or unnecessary things left in the source code, see the commits for exact changes made if you like.
May add more stuff to this branch later, there's no rush really.
See merge request !39
Diagonal spring rings tweak
If you didn't know before, those special placement ring lines for diagonal springs only use multiples of 45 for their angles in-game. In other words, they only face any of the 8 basic cardinal directions (N, S, E, W, NE, NW, etc). Considering that springs themselves don't follow the above behaviour, you can probably work out that's a bad thing.
This branch changes that of course, if you couldn't guess from context. Diagonal spring rings can now be placed with any angles like most thing types already could!
See merge request !37
some of the mess in here really bothers me
(cherry-picking this commit of mine from next since it only fixes a small oversight with compiling and adds a comment)
the screen texture does not need an alpha channel.
the fact that it had one made OGL copy the topmost pixel of the screen texture's alpha channel.
which, naturally results in the screen becoming partially transparent and letting you see the working texture in the background.
g_game.c: In function 'G_CheckDemoStatus':
g_game.c:5588:22: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!modeattacking == ATTACKING_RECORD)
^
This is not how you use pushlstring! This is actually sending uninitialized memory to Lua, which is making scripts have inconsistent results (duh?)
c/o JTE: "Tell Red they're a doofus."
Admittedly I knew of this particular method from the start but wanted to avoid it in favour of a less-hacky looking method of getting sector.lines' size ...but there was none to be found at all.
Coloropposite hotfix
Quick fix to prevent ColorOpposite(MAXSKINCOLORS) or higher input from giving results out of the actual array's bounds. In other words, preventing it from giving you nonsense values or something.
I created the function for Lua to begin with, so clearly this is 100% my fault once again. Welp.
See merge request !31
Objectplace reallocates the mapthings list to add one more mapthing. By itself there's no problem with this.
But, mobj->spawnpoint is a pointer to the mapthing's location in the mapthings list.
So by reallocating the mapthings list, all references to mobj->spawnpoints point to freed memory.
... Oops.
Now when objectplace reallocates the mapthings list it actually corrects the locations of all mobj's spawnpoints to point to the new list.
Hooray, you can use NiGHTS objectplace again if you really want to.
Objectplace reallocates the mapthings list to add one more mapthing. By itself there's no problem with this.
But, mobj->spawnpoint is a pointer to the mapthing's location in the mapthings list.
So by reallocating the mapthings list, all references to mobj->spawnpoints point to freed memory.
... Oops.
Now when objectplace reallocates the mapthings list it actually corrects the locations of all mobj's spawnpoints to point to the new list.
Hooray, you can use NiGHTS objectplace again if you really want to.
The point here is ColorOpposite(MAXSKINCOLORS) would have given an actual result of its own since MAXSKINCOLORS & MAXSKINCOLORS is still MAXSKINCOLORS. This shouldn't happen though, as both Color_Opposite[MAXSKINCOLORS*2] and Color_Opposite[MAXSKINCOLOR*2+1] aren't defined.
Note: polyobj_t's "translucency" is apparently a SIGNED integer, so in theory it's possible to get polyobj flats to use the "spanfunc = splatfunc" line using negative values. If this is not meant to happen, this should probably be fixed asap
Conflicts:
src/f_wipe.c
Also makes comptime.bat work with git if able.
Development builds will now show the branch and the SHA1 hash of the revision. Also been tested to work with subversion, where it displays "Subversion r####". You know, just in case.
Also makes comptime.bat work with git if able.
Development builds will now show the branch and the SHA1 hash of the revision. Also been tested to work with subversion, where it displays "Subversion r####". You know, just in case.
more detailed description: vissprites now store dispoffset in a separate variable from (y)scale, and uses it to influence order between sprites without it affecting the actual drawing of the sprites themselves
Rob request player anims
[21:44:35] <@Rob> As far as I can tell the player-anims that I requested work
[21:44:45] <@Rob> That can probably be merged at this point
See merge request !22
Monster's miscellaneous meddling
A miscellaneous assortment of code-cleanup and other changes, plus fixing up SRB2's tangent array so it behaves more as expected (especially on the Lua side).
More specific details of the changes:
(MUST-HAVE CHANGES)
* `finetangent[]` has been entirely redone in the same manner as finesine/finecosine.
* Lua's tan() function shifts `finetangent[]` results by `ANGLE_90` to get what you EXPECT it to return (e.g. `tan(0)` actually returns 0 now). This means finetangent itself doesn't need to change its general arrangment, this only affects Lua specifically.
* Lua's tan() function now also doesn't go out of `finetangent[]`'s bounds at all. Before, `tan(ANGLE_180)` through `tan(ANGLE_MAX)` and such would just give you values unrelated to the array in question, which was clearly a bad thing.
(CAN PROBABLY LIVE WITHOUT?)
* `finecosine`'s definition moved from r_main.c to tables.c.
* Created `P_CheckTimeLimit` for `cv_timelimit`, much like `cv_pointlimit` has `P_CheckPointLimit`. It cleans up `P_UpdateSpecials` a bit at least.
* Some code cleanup relating to translucency maps - these are kind of unimportant, I was about to stop `FF_TRANSMASK` being used everywhere, but this was apparently a bad idea so I backtracked a bit.
* Re-added `_MSC_VER` check around MSVC-specific code in doomtype.h, in case it wasn't defined (and `__OS2__` was). Also left a comment there regarding `__BYTEBOOL__`.
* Fixed an apparent copy+paste goofup in `joyaxis_cons_t[]` for the Wii-specific code.
See merge request !10
Fix md2s
shoutouts to MI for breaking them accidentally
I was about to just commit this straight to next but it's the perfect reason of why code review is beneficial and I'd be a hypocrite to point that out and then skip the process
See merge request !28
Reduced palette
You guys should know what this is by now. If you don't, you really need to catch up. =P
We should check with toaster and others involved to check this thing is actually ready to go though, the number of changes to the palette itself over the last year has been absurd.
See also http://git.magicalgirl.moe/STJr/SRB2Internal/issues/8
See merge request !13
Apparently all parts of the source code that require GLPatch_t are themselves used only if HWRENDER is defined. Do I need to say more?
Not sure if this will fix Wolfy's latest problem or not though
Basically, Wolfy's linux (non-CMake) compiling apparently fails here, and config.in.h actually lives outside of the sdl folder. Blame a particular someone for blindly copy+pasting these includes in this file without considering the consequences when adding support for CMake everywhere.
Apparently all parts of the source code that require GLPatch_t are themselves used only if HWRENDER is defined. Do I need to say more?
Not sure if this will fix Wolfy's latest problem or not though
Basically, Wolfy's linux (non-CMake) compiling apparently fails here, and config.in.h actually lives outside of the sdl folder. Blame a particular someone for blindly copy+pasting these includes in this file without considering the consequences when adding support for CMake everywhere.
Dispoffset changes
Dispoffset now works in OpenGL, and the feature has been optimized so high dispoffset values don't cause sprites to be distorted anymore.
See merge request !12
* SPR2_JUMP and SPR2_SJMP are now the jump sprite sets for spin chars
* SPR2_SPNG and SPR2_SSPG are the new sprite sets for spring up anims (instead of JUMP/SJMP)
* S_PLAY_JUMP and S_PLAY_SUPER_JUMP are now the states for spin char jumps
* S_PLAY_SPRING and S_PLAY_SUPER_SPRING are the new states for spring up (instead of the "JUMP" states)
* PA_JUMP is now PA_SPRING (jumping anims are lumped with PA_ROLL)
Compiling errors fixed in this commit:
* Various cases of mixed declaration and statement code
* Implicit declaration of slope functions (read: you forgot to put "include "p_slopes.h" in MORE than a few places)
* an odd case of a bad fixed_t to float typecase, cause by using P_GetZAt directly inside FIXED_TO_FLOAT
* a few minor cases of bad unsigned-signed comparisons
* no prototypes for some of the new slope functions. For goodness sake Red, this is basic stuff!
Actions tweaks
This just rewrites the action A_SetTargetsTarget currently, dunno if I'll bother to tweak any more actions in the near future \*shrugs\*
That said, PLEASE check whether the action works properly before accepting the merge. It's been a while since I last did anything with this branch, so I forget entirely whether I tested it or not.
See merge request !27
more detailed description: vissprites now store dispoffset in a separate variable from (y)scale, and uses it to influence order between sprites without it affecting the actual drawing of the sprites themselves
Note: polyobj_t's "translucency" is apparently a SIGNED integer, so in theory it's possible to get polyobj flats to use the "spanfunc = splatfunc" line using negative values. If this is not meant to happen, this should probably be fixed asap
Compiling errors fixed in this commit:
* Various cases of mixed declaration and statement code
* Implicit declaration of slope functions (read: you forgot to put "include "p_slopes.h" in MORE than a few places)
* an odd case of a bad fixed_t to float typecase, cause by using P_GetZAt directly inside FIXED_TO_FLOAT
* a few minor cases of bad unsigned-signed comparisons
* no prototypes for some of the new slope functions. For goodness sake Red, this is basic stuff!
Slopes and stuff
Adds support for slopes, slopes on FOFs, slopes on translucent FOFs, slopes on FOFs with holes in the flat, slope physics, dynamic slopes, vertex slopes, dynamic vertex slopes, and a ham sandwich to the game. Only for software mode right now, though. (OGL still gets the physics and the sandwich.) Some things still need to be done, but for now this can be merged in to be finished later.
Please make sure nothing in the vanilla game breaks before giving the thumbs up for this merge.
Since this doesn't merge automatically, if the code review turns out positive and nobody else has done it, I'll handle the merging.
See merge request !22
To be specific: when a sector had a sloped ceiling and a colormap was
placed above it, the colormap wouldn't fill anything above where the
ceiling height is at the sector's midpoint. This is fixed.
Oops. (Minor animation bugfix I forgot.)
Apparently I pushed this one commit to GitHub instead of SRB2Internal before the branch was merged...
Oops.
See merge request !8
Tweaks to R_PointToAngle and R_PointToAngle2
Exactly what it says in the title! See commit description for more information on what I did, since I'm too lazy to write it all up a second time. =P
Could someone check that these changes don't cause anything else in particular to go wrong in the game or source code? I haven't checked myself that much yet, mostly because I totally forgot about this thing until now, lol.
See merge request !19
Polyobj setup fixes
If you're wondering why ERZ2 crashes lately, yes, it's my fault once again it turns out! Ideally we shouldn't have loose spawn points or anchors without an actual PolyObject to go with them in the first place, but this fix re-adds the safety check that prevented them from crashing the game before.
If it wasn't clear already, this fix is rather important, so please get in asap.
See merge request !7
New player animations (Updated player.dta Sonic)
Adds support for several completely new player animations, mostly for Super Sonic.
See merge request !5
Note: Before this change, North and West directions would be returned as ANGLE_90-1 and ANGLE_180-1. This caused the pusher polyobjects in THZ2 to slowly move sideways as a side-effect (and probably caused similar bugs in the past too, these functions have barely been touched in a decade it turns out.)
This commit makes Super floating players break into
a normal walk again when they hit the floor, instead
of keeping their float animation on the ground.
Goo Water (THZ Goop) adjustements
At Nev3r's request:
Adjusted goop so that you spend less time bouncing around in it. The goop will become a walkable surface with a higher velocity threshold.
The actual goop physics haven't been altered as far as the initial entrance and underwater time is concerned, only leaving goop and subsequent bounces has been dampened significantly.
See merge request !7
finesine table
I pasted in finesine from #11 and made a merge request.
This has been lightly tested to ensure the renderer doesn't immediately break. No ill effects have been observed so far.
See merge request !17
A_SetObjectFlags tweak
Only reset the sector/blockmap links on an object calling A_SetObjectFlags if the MF_NOSECTOR|MF_NOBLOCKMAP flags change. Fixes a freeze related to LD442 demonstrated in MascaraSnake's example WAD at https://dl.dropboxusercontent.com/u/27962790/statetest.wad .
See merge request !11
Re-add/fix broken platform momz mobj code.
The changes in this branch re-add the platform's momentum to players and mobjs which leave the platform (eg. by jumping) so that they move with relative velocity as expected. This behavior was unintentionally broken in SRB2 2.0, which adds a lot of artificial difficulty to certain segments of the levels, where you have to jump between high velocity moving platforms which seemingly cut your jump height to nothing.
Not only has the behavior been fixed, but it has now been enhanced to move the camera while free-falling between platforms as well, completing the illusion of full relative velocity with minimal hiccups. [Observe.](http://i.imgur.com/zmSfUyp.gifv)
See merge request !14
Miscellanous fixes to merge
These are the commits from the "miscellanous-fixes" branch that are okay to merge in.
Bugs fixed include the following:
* CTF flags respawning incorrectly: they cannot z position themselves correctly, and they cannot flip themselves.
* The weird "jumping" spring/monitor effect: this is the result of an internal mobj_t pointer (tmfloorthing, specifically) not resetting itself to NULL for the next object's thinker, resulting in Z movement code thrusting the object vertically at tmfloorthing->momz.
See merge request !18
... because some things (Lua. custom header entries) move it.
https://mb.srb2.org/showthread.php?t=40580
(Technically breaks netgame compatibility for Lua-heavy mods, so in next.)
That's supposed to be run once a frame, not once per hook
per mobj per frame you moron. If you just run it seven
thousand times a frame, of course your framerate will drop.
Dummy, what do you think you're doing? If you
just push mobjs and players into Lua all willy-
nilly everywhere, you'll wind up generating
tons of metatables and stuff you arne't even
gonna use!
Oh. Thanks me, I'm really smart.
This _should_ solve some significant performance
issues Lua experiences. If not, I will be very
upset for having wasted so much time and effort.
There will be bugs, this kind of thing needs to
be thuroughly tested and this is just the first
iteration of it.
Assume that every frame the player is on the ground, their pmomz will
be re-set properly if the floor is moving, therefore if the platform
STOPS, we need this to set it to 0.
This fixes the issue with upside-down springs shooting downwards if you touch another of its kind. Also fixes one of the issues with monitors in Icicle Falls (after you phase inside the East-most float-bob FOF's monitor via the other bug and jump up to break it while there, the NEXT monitor moves upwards too)
Here's how it works: When a player walks off the
moving platform, it applies their pmomz once, and
then _keeps pmomz set_ so that the camera still
adds pmomz to its movements until they hit another
floor. This way, the camera doesn't jerk around.
Also gain velocity from walking off an "up" elevator normally?
This _looks_ incorrect because the camera stops matching
the platform movement the moment you step off, but I
assure you it is a correct and accurate movement.
(Try it with chasecam off.)
Now players will apply platform movement when jumping,
but only if the platform is moving the same direction
as their jump is, and all other objects will have an
appropriate pmomz in reverse gravity FOF situations.
Since PA_JUMP is used to determine when
springing upwards now and the nextstate
isn't used for falling, the jump state
can now be properly animated. :)
Added drowning to all players, and several new
Super animations for Sonic.
Removed A_Fall from S_PLAY_DEAD and moved its
effect into P_KillMobj for player avatars.
These functions were already here before, and I /swear/ the slope
physics became slightly less glitchy after switching to them...
Only issue is the slope plane mapping code hasn't been properly
converted yet, so they don't render properly for now.
tmthing must not be set outside of P_MapStart and P_MapEnd
or the game will fail a sanity check which ensures that
mobj references are not persistent across frames and crash.
Angles now go from 0 to 0xFFFF (360 degrees == FRACUNIT) instead
of using a full UINT32. Lua only has one number type, so signedness
gets in the way of using angle_t directly. This handling of angles
matches up with how ZDoom ACS scripting and the like does it.
I also changed all the integer casts and pushes of fixed_t to
their own macro in preperation for possible future seperation.
EvalMath is for SOC only.
It spawns an entirely seperate instance of Lua and requires
uppercase-only strings, and it's ability to parse strings to
enums is redundant to Lua's _G table (try using
_G["MT_BLUECRAWLA"] for instance)
Your acceleration vector parallel to the slope is reduced based on slope
angle if it's going up the slope. The pull physics' momentum increase was
toned down a bit to go along with this. Also, I removed the ifdefs for
OLD_MOVEMENT_CODE because why should that be kept around?
Actual blockmap fix
MI's "fix" was a reversion of something that allowed 2.0 maps to use the entire blockmap. This MR reverts that fix and adds a proper fix to the issue of west/south edges of the blockmap not working as they should. Tested with a thokbarrier-less square map (all sides were solid) and with AGZ (objects are tangible all around the map, like they are in 2.1.14).
See merge request !10
Re-fix the server global variable in Lua
I screwed up the conditions on my first attempt to fix this, since I only tested one scenario. Tested this in SP, at the main menu, and both clientside and (dedicated)serverside in MP. Everything works as intended.
See merge request !9
Polyobject more fixes
Extra fixes related to polyobjects; actually properly putting their flats alongside them in the draw list, and making them able to use single-waypoint zoom tube sequences. Also threw in a smoothness fix for swinging chains while I was there.
See merge request !8
Polyobject scroll hotfix
Things fixed:
* Polyobjects should now carry the same thing types as conveyors (notable example; they'll now carry Crawlas when they wouldn't before)
* The drifting issue with players on spinning polyobjects should be fixed. (I swapped in the old bad hack for a new hack that should work like it's supposed to)
See merge request !6
Now it will only bounce ONCE when you jump on it, and Knuckles
just barely gets enough velocity out of his jump for even that.
This will leave players vulnerable and annoyed for a lot less
time while they wait to finish bouncing.
...
(It's that infamous intangible West/South linedefs bug, which was really a blockmap-related bug all along. AND IT WAS SO SIMPLE TO FIX!)
git-svn-id: https://code.orospakr.ca/svn/srb2/trunk@9048 6de4a73c-47e2-0310-b8c1-93d6ecd3f8cd
Core code has too many #define dependencies on interface-specific
defines. This means that it's currently not possible to safely
separate the core and interface code into different contexts. The
core code should be refactored to accomadate for this because we
should not have any interface-specific code in core in the first
place.
This reverts the static library SRB2Core from a7135094 and instead
adds the core sources to the SRB2SDL2 target directly.
So frustrating...
Core and SDL2 are two separate targets now. Core is a static library
that is linked into SRB2SDL2. The sources for both are separated.
When using an IDE like Visual Studio or Xcode, the source code
organized into groups that explain what that group of sources does.
In the future, "Main" could be split into a few more groups based on
file prefixes, but I think the way it is set up works for now.
Makefile targets are not affected by source_groups and typing `make`
will automatically compile both the "Core" library and SRB2SDL2
itself.
Access the benefits of -debug, console devmode, and a complete gamedata.dat (all secrets unlocked) all in one go.
Moved "#if 0" and "#if 1" to "#ifdef DEVMODE" so the existance of this cheat and MD5 validation and all that can be toggled in one place too.
git-svn-id: https://code.orospakr.ca/svn/srb2/trunk@8998 6de4a73c-47e2-0310-b8c1-93d6ecd3f8cd
Todo: Stop the redundancy that currently goes on with adding MD2s on game start-up (note that HWR_AddSpriteMD2/HWR_AddPlayerMD2 are run for all sprites/skins BEFORE HWR_InitMD2 is called)
git-svn-id: https://code.orospakr.ca/svn/srb2/trunk@8988 6de4a73c-47e2-0310-b8c1-93d6ecd3f8cd