Commit graph

171 commits

Author SHA1 Message Date
Sal
653766010d FRIENDCODE (aka, Teamplay) 2024-09-17 01:41:26 +00:00
hayaunderscore
49c49dab3b Move V_ClearClipRect after call_mapped
based on toaster's suggestion
2024-08-26 10:31:48 +08:00
Sally Coolatta
7dfa597c7d SRB2 -> DRRR copyright in src, acs, android folder
Be consistent with toaster's recent changes to copyright
2024-04-05 02:08:23 -04:00
James R
61709d36a8 Add basic profiling for Lua hooks (except HUD hooks)
- Add lua_profile cheat: calculate average time spent in
  hooks over a period
- Show hook times in a sorted table, along with lump name,
  script line number and hook type
- Show cumulative time spent in game logic hooks and
  percentage of overhead to game logic
2023-11-11 02:27:39 -08:00
James R
4ec1e98b16 lua_hooklib.c: refactor HUD hook call 2023-11-11 02:27:06 -08:00
James R
646701c55c Remove Lua Music API
In preparation for replacing music handling entirely.
Eventually, we can make a new Lua API.
2023-08-05 16:26:53 -07:00
SteelT
047b84e3d0 Fix perfstats 4 not working properly 2023-02-16 23:48:37 -05:00
Sally Coolatta
3135d14387 Replace LinedefExecute hook
- It is now called the "SpecialExecute" hook, since it can be called from ACS in addition to linedef specials.
- The input arguments are completely different now. Instead of (line_t, mobj_t, sector_t), it's (activator_t, args array, stringargs array). activator_t is userdata containing valid, mo (mobj_t), line (line_t), side (side_t), sector (sector_t), and po (polyobject_t).
2022-12-27 09:24:59 -05:00
James R
842f375920 Remove global lua_save_p and use savebuffer_t for LUA_Archive / LUA_UnArchive 2022-12-25 14:11:44 -08:00
Sally Coolatta
b50fbce5ee Clear clipping rectangle before each hook call
Prevents Lua from being able to make a mess.
2022-12-11 14:14:12 -05:00
Sally Coolatta
80d9637dda devmode cheat online 2022-09-29 12:19:45 -04:00
James R
aa5063668e hooklib: revert ps_lua_mobjhooks to pre perfstats averaging refactor (77ecfb9cdc)
Revert later
2022-09-05 11:56:30 -07:00
James R
37c3a55dda Fix conflicts 522467a88 2022-09-05 11:56:30 -07:00
James R
b4d1fade5f Apply b4fa98d2f to lua_hudlib.c
Continued from 544812a45
2022-09-05 11:56:30 -07:00
James R
ceeda5c826 Lua hooklib refactor squash
commit 8d382e49fb3411cad1a3ef5ee1e546030c3a9d93
Author: James R <justsomejames2@gmail.com>
Date:   Tue Nov 17 04:14:45 2020 -0800

    Big Large Lua Hooklib Refactor

    * Hooks are no longer a mess of lua boiler plate. Helper functions reduce hooks
      to, at the most basic level, only two calls.
    * Lua tables (the array part) are used to index hooks. Such tables contain only
      hooks of the same type.
    * Hook types are defined in one place so you no longer need to sync up the enum
      and name array.

commit 3f7c2ae0b0c450cb8993ffe7664ead05fd9f5000
Author: James R <justsomejames2@gmail.com>
Date:   Thu Dec 10 05:39:53 2020 -0800

    Avoid using multiple tables to fetch hook

    String hooks still use a table to fetch the id, but the id indexes a C array.

    Also I fixed a missing call in the MusicChange hook.

commit dbd8903a538e7b87061795ce27ec5c72c26743af
Author: James R <justsomejames2@gmail.com>
Date:   Thu Dec 10 08:50:23 2020 -0800

    Use ref for pushing error handler

commit 9ddeb5f5896de0407b2b6fce8c949295a9e6d5e4
Author: James R <justsomejames2@gmail.com>
Date:   Sat Dec 12 02:05:21 2020 -0800

    Resolve GameQuit hook conflicts

commit 93e4f43e4b3a24fc2d8032e8730cbf427e75b297
Author: James R <justsomejames2@gmail.com>
Date:   Sat Dec 12 03:06:57 2020 -0800

    Hooklib macros names -> uppercase + documentation

commit 80fe39bbd1433c91131d2cdb36ba709f37d3b5f3
Author: Steel Titanium <steeltitanium1@gmail.com>
Date:   Mon May 3 01:40:02 2021 -0400

    Fix MusicChange hook not returning some values correctly

commit 46ca9613c68422a26910cbb034a9f3e004a967c3
Author: James R <justsomejames2@gmail.com>
Date:   Thu Jun 10 18:09:39 2021 -0700

    Pop hook id fetched from table

commit a75d4a1c360874a3c301a494e38ea49cd89b6616
Author: James R <justsomejames2@gmail.com>
Date:   Tue Jul 6 18:42:08 2021 -0700

    Automatically count hook values

commit 331329306cad257d52f84e47a92d9214d9eaa8d3
Author: James R <justsomejames2@gmail.com>
Date:   Tue Jul 6 19:12:47 2021 -0700

    Refactor hook ref allocation

commit ae57b6ca8664e00ff4d9544339dbf29a41138040
Author: James R <justsomejames2@gmail.com>
Date:   Tue Jul 6 20:23:38 2021 -0700

    MORE MACROS

    I just can't stop myself!

commit b4fa98d2fbab180f487ce3efedb8ab715e5f3390
Author: James R <justsomejames2@gmail.com>
Date:   Wed Jul 7 00:23:51 2021 -0700

    Refactor hudlib hooks to hooklib

    HUD hooks now meet the standard of hooklib. HUD registry
    magic numbers are gone.

    HUD hooks may also be added using addHook.

        addHook('HUD', fn[, type])

    hud.add still exists, but the intention is to remove it
    eventually.

commit cb619fad5d762ba8d8dd20e9a979a04ced7c943f
Author: SMS Alfredo <65426124+SMS-Alfredo@users.noreply.github.com>
Date:   Wed Jul 7 19:57:28 2021 -0500

    Rebase on !1307

commit f271f88c7f3084523a03ca7f47060d6527724796
Author: LJ Sonic <lamr@free.fr>
Date:   Sun Dec 5 17:59:33 2021 +0100

    Fix MusicChange hook crashing when called

    BRUH MOMENT BRUH MOMENT
    PREPARE THE HALL OF SHAME

commit 0a0c17da7c793ec29e80c5bdaa66b02da0884078
Author: James R <justsomejames2@gmail.com>
Date:   Tue Feb 1 02:27:27 2022 -0800

    PARANOIA: I_Error if mobj hook is called with MT_NULL

commit 86336d6bed80bee6f8168078aa8856109091e50f
Author: katsy <katmint@live.com>
Date:   Mon Mar 7 18:33:15 2022 -0600

    remove MODID check from hooklib to fix compile issue
2022-09-05 11:56:04 -07:00
Sally Coolatta
7d67e02ea3 Bot perfstats
Show how long they take to think on all of their main tasks
2022-08-27 00:04:33 -04:00
Steel Titanium
e1e57c071b Fix MusicChange hook not returning some values correctly 2022-03-18 12:52:08 +00:00
Hannu Hanhi
44a8b01619 Fix incorrect values caused by outdated use of timing functions in perfstats 3 2022-03-18 11:58:29 +00:00
Sryder
8344ac3489 Actually just get rid of seenplayer and NAMECHECK altogether. 2021-03-03 18:03:41 +00:00
James R
98bcfc7cac Conflicts e9bbdb8cc3 ef1ca357de 2021-02-27 03:35:38 -08:00
Sally Coolatta
9d7ec0ab8f Merge SRB2 next
Probably doesn't compile yet, but I got rid of all of the conflicts for anyone who wants to take a stab at it.
2021-02-27 05:18:36 -05:00
James R
956fd338f0 Merge branch 'oldguards' into 'next'
Kill remaining HAVE_BLUA and SEENAMES

See merge request STJr/SRB2!1319
2020-12-12 17:34:04 -05:00
James R
41f1b3b97c Kill SEENAMES 2020-12-12 02:11:23 -08:00
James R
477ae9d1af Merge branch 'gamequit-argument' into 'next'
Send a `quitting` argument to the GameQuit Lua hook.

See merge request STJr/SRB2!1276
2020-12-10 15:25:52 -05:00
James R
2e649de64f Merge branch 'high-resolution-timer-2' into next 2020-12-10 02:55:02 -08:00
GoldenTails
ded87cb54c Send a quitting argument to the GameQuit Lua hook 2020-11-29 08:30:50 -06:00
James R
27fbf77922 Huge perfstats refactor
I needed to update it to make it functional with the precise timer. But I also
got sick of looking at the mess of sprintf followed by draw call.
2020-11-07 01:32:59 -08:00
Steel Titanium
ef1ca357de Expose more music functions to Lua 2020-10-31 21:15:41 -04:00
Sally Coolatta
afbbfc9b1f Fix cvars
My wrist burns...
2020-10-24 21:32:07 -04:00
Sally Coolatta
7c2bd0d1c2 Merge remote-tracking branch 'srb2/next' into the-scary-22-merge 2020-10-24 20:50:58 -04:00
Louis-Antoine
4313f248a5 Fix unfortunate typos 2020-10-22 00:08:06 +02:00
Louis-Antoine
eda92f3f2a Only invoke the Lua API for mobj hooks that need it 2020-10-21 22:48:00 +02:00
Hannu Hanhi
24ff748c58 Performance stats 2020-10-10 22:12:34 +03:00
Sally Coolatta
3e446a167c Restructure how damage works in kart COMPLETELY
Instead of doing its best to avoid P_DamageMobj, it embraces it, using the damagetype system to decide how the player takes damage. Overall less stupid.
2020-08-19 00:55:36 -04:00
Sally Coolatta
0dc21106e5 Lua stuff is done 2020-08-15 07:47:18 -04:00
Sally Coolatta
9a21b3a46b g_demo compiles 2020-08-12 23:08:31 -04:00
Sally Coolatta
8731c6b7a4 Another round of fixing up
- gametyperules are now fitting for kart, not applied to the whole codebase though
- a few more files compile
2020-08-11 16:13:17 -04:00
SteelT
d502ca31cb Merge lua_hooklib.c 2020-08-10 12:34:38 -04:00
Sally Coolatta
e296e1309a YAY, round 2 2020-08-09 21:02:56 -04:00
Sally Coolatta
9a9f7b8b1f Merge lua_hooklib.c 2020-08-05 14:03:24 -04:00
Zachary McAlpin
70fc6854b1 Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2 into playercmd-kart-port 2020-07-30 15:37:41 -05:00
Zachary McAlpin
ad38289605 Bruh I screwed up 2020-07-17 00:33:07 -05:00
Zachary McAlpin
6877df94bc Ported Lat's PlayerCmd hook to vanilla SRB2 2020-07-17 00:08:38 -05:00
Nev3r
e301d268ec Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2/ into udmf-next
# Conflicts:
#	src/hardware/hw_main.c
2020-06-30 20:29:48 +02:00
Zachary McAlpin
8376c8e987 I forgot to pop the error handler 2020-06-12 07:50:57 -05:00
Zachary McAlpin
75932c45d4 Updated LUAh_GameQuit to use new error handler 2020-06-11 15:11:01 -05:00
MascaraSnake
3ce62d7780 Merge branch 'next' into udmf-next
# Conflicts:
#	src/p_mobj.c
#	src/p_polyobj.c
2020-06-09 09:38:01 +02:00
Zachary McAlpin
d7228562e3 Updated LUAh_GameQuit 2020-06-05 13:18:22 -05:00
Zachary McAlpin
c7e64d635c Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2 into gamequit-hook 2020-06-05 12:59:41 -05:00
Louis-Antoine
25cb181b8e Refactor hook library a little 2020-05-30 20:28:45 +02:00