There is a caveat to this: The first time EvalMath is used, a
deprecated function warning will be shown to the user that tells
them to use _G[] instead.
This reverts commit 9d36cf37bd.
This appears to fix a few holes that have been known to appear with FOF slopes sometimes, dunno how they actually came about exactly but this apparently sorts them out
Lua sector lines
Adds support for "sector.lines" in Lua, an array containing all the linedefs in a particular sector variable:
#sector.lines returns the number of lines in the sector.
sector.lines\[ _i_ \] (e.g. sector.lines[0], sector.lines[1], sector.lines[2], etc ....) gives you individual linedefs in the sector. If the number you supply is equal to or greater than #sector.lines, this returns nil.
Test script for your benefit: (see comments)
Type "luatest" in console in any level and you'll get a few print messages that tests these features for sectors[0]
See merge request !32
SOC_**** lump name support
Exactly what it says on the tin: lumps with "SOC_" prefix now are read as SOC lumps like with MAINCFG/OBJCTCFG. Go nuts.
As a bonus, I've changed things with SOC lump detection so MAINCFG, OBJCTCFG and the new SOC_**** lumps are loaded in the order you find them in WAD files (rather than an arbitrary load-MAINCFG-then-load-OBJCTCFG thing as before). All of these are still loaded after Lua scripts though, mind.
See merge request !38
Lua video lib expansion
New video/drawer library functions for hud.add to use:
v.width() and v.height() return the screen width and height respectively (in other words you get the screen resolution), while v.renderer() returns the string for the renderer used ("software", "opengl", or "none").
Possibly add more stuff later, but for now these things at the least can be merged in next
See merge request !40
Add PlayerSpawn hook to Lua
I don't know how I did this but I did. Something about staring at code from 3AM till 5AM...
Here's a test script too:
```Lua
addHook("PlayerSpawn", function(player) player.health = 99 end)
```
See merge request !48
Version constants for Lua
Pretty simple thing. Allows scripters to use VERSION, SUBVERSION, and VERSIONSTRING to check the game's version and potentially futureproof scripts. Have tested and confirmed working on my end.
See merge request !55
BACKPORT: removal of music slots
Relevant commits cherry-picked. Basically everything except the internal music track name switches.
See merge request !43
The funny thing is you really can't see ANY change here unless you have a sloped FOF intersecting a sector floor/ceiling (and a second FOF on the other side), which has other problems anyway lol
BACKPORT: FF_ANIMATE simplistic state animations
this is a lot more complex due to the need to remove the dispoffset related code as well as a lot of the redefinitions; combined with the code changes due to the sprite2 system in internal master.
~~BEFORE ACCEPTING THIS: get sryder to look at and fix any possible brokenness with OpenGL MD2s~~
See merge request !45
Fof flag change hotfix
This fixes rendering issues caused by changing FOF flags mid-level via Lua or linedef type 445. Everything else that toggles FF_EXISTS already had this fix it turns out.
Not sure if this is safe for master too, could someone check that for me?
See merge request !53
This fixes how removing certain flags (such as FF_EXISTS) from FOFs can cause HOMs on walls bordering their target sectors. Also fixes how the force-FOF-to-vanish linedef special can leave behind the FOF's shadow
Fix chain launching
Basically you're not allowed to launch off a chain the frame you touch it anymore.
Coincidentally the changes here allow you to actually use PF_*STASIS in a Lua script now and have it work as you'd expect it to (it lasts for a tic).
See merge request !49
cpuaffinity/sdl_mixer changes
Hopefully this will alleviate SDL2 sound issues.
If not, hopefully this will give us info on what the hell is going on.
See merge request !51
(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