Commit graph

403 commits

Author SHA1 Message Date
PeachyPeach
d9f5869fcd
Fix Texture type; add various get_name functions (#945)
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
2025-09-15 20:59:26 +02:00
Beckowl
1c71449ed2
Add lua params support to level macros (allocate dialog pt. 2) (#905)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* all OBJECT fields are now Lua variables

* add lua variable support to SHOW_DIALOG

* fix object_with_acts

* minor tweak

* Peachy review

---------

Co-authored-by: PeachyPeachSM64 <72323920+PeachyPeachSM64@users.noreply.github.com>
2025-09-13 20:36:28 +02:00
ManIsCat2
6524e709a3
Fresnel Lighting from F3DEX3 (#941)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* Fresnel part1

* Fresnel part2

* vmacu
2025-09-13 12:40:38 +02:00
PeachyPeachSM64
cee5957e11 Fix cap sequences not replaced/playing on dynos warp and level entry; Add gLevelValues.shellSequence
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-08-29 22:54:40 +02:00
ManIsCat2
5f1a2d0b42
Gfx commands to Copy Lights into Env/Prim color (#927)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-08-28 06:27:25 +10:00
ManIsCat2
4fb5375d0d
GEO_BONE GeoLayout command (#913)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-08-20 12:46:32 +10:00
PeachyPeach
6e4373adc9
Fix graph node interpolation (#917)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
Shared graph nodes were incorrectly interpolated, only the first object with a shared graph node was interpolated properly.
Thanks to @Cooliokid956 for noticing that most of node types were **never** interpolated.

- Use a double hashmap to store interpolated data for each graph node and object. All translations, rotations and scales are now interpolated correctly.
- Add `GraphNodeScaleXYZ` type to scale to all 3 dimensions; Add `GEO_SCALE_XYZ` command.

gMtxTbl was also reaching it's limit, so dynamic allocation was added.
2025-08-19 08:15:30 +10:00
PeachyPeachSM64
b671458f81 Enforce function pointers types in dynos
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
geo layouts -> geo_* functions only
behaviors -> bhv_* functions only
level scripts -> lvl_* functions only
other -> no function allowed

thanks maniscat for reporting the issue
2025-08-17 19:27:41 +02:00
PeachyPeachSM64
f0a0a10544 dynos behaviors: adding missing fields and small bug fix
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
2025-07-29 16:33:22 +02:00
ManIsCat2
b93e5e17fd
Show Ping option (#889)
---------

Co-authored-by: NoNameWasDefined <nonename@outlook.fr>
Co-authored-by: PeachyPeachSM64 <72323920+PeachyPeachSM64@users.noreply.github.com>
Co-authored-by: rPhase <github@rphase.net>
2025-07-29 22:39:36 +10:00
Beckowl
3d458d0212
Fix inconsistent mapping between sSm64CharMap and str_ascii_to_dialog (#892)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
This fixes inconsistent mappings between `sSm64CharMap` and `str_ascii_to_dialog` (used in `smlua_text_utils_dialog_replace`) to make the `text` field of `dialogEntry` consistent

`str_ascii_to_dialog` now also has mappings for the interpunct (`•`) and the double opening (`<<`) and closing (`>>`) quotes, which were missing before.
2025-07-29 11:53:53 +10:00
Agent X
74115c2aac Speed up lighting engine by 80%
Lights are also zero indexed now which I could change to being one indexed but I think this is better anyway.
I restored ambient light objects setting it every frame since it broke a mod I was working on.
Sorry if any of these changes break anything you're working on dj.
Kaze would be proud though I bet
2025-07-17 15:41:06 -04:00
PeachyPeachSM64
9c28364d81 Fix warnings and some bugs
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
thanks maniscat
2025-07-02 18:49:44 +02:00
djoslin0
81af37eef6
Regenerate DynOS assets when source files are modified (#873)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
Previously to recompile DynOS assets you had to remove the
bin/lvl/bhv/tex/col/etc files. Now the game will compare the
last-modified-timestamps of the generated/compiled assets vs
the other files that are within those directories. If the presumed-
source files have a later modified timestamp DynOS will regenerate
those assets.

While this results in scanning the attributes of files more, it
also prevents parsing files unnecessarily. Previously actors
would always parse their source files and build up GfxData
unnecessarily.

---------

Co-authored-by: MysterD <myster@d>
2025-07-02 23:24:35 +10:00
Agent X
6a5af9d23a Lighting engine full documentation and more improvements
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-07-01 13:41:28 -04:00
djoslin0
cf43b5d465
Fix warping from one custom level to another (#878)
* Fix warping from one custom level to another

* Remove cached level warps

* More comments, use LEVEL_UNKNOWN_X

* more readability

* clear custom level slots on unload

---------

Co-authored-by: MysterD <myster@d>
2025-07-01 01:52:17 +02:00
Isaac0-dev
066481b59e
type checking for dynos gfx symbol parsing (#849)
* type checking for dynos gfx symbol parsing

* peachy review

* better parameter counting

* using peachy's changes

* Update dynos_bin_gfx.cpp

seems like fast64 write 0 instead of NULL for null pointer, which is technically valid

---------

Co-authored-by: PeachyPeach <72323920+PeachyPeachSM64@users.noreply.github.com>
2025-07-01 01:51:15 +02:00
Agent X
7009e7da86 Lighting Engine: Awesome Edition
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
Just making a brief commit and thats all to add onto dj's lighting engine improvements because I heard about the PR, in mine I
* allowed all Vtx objects to be manipulated/retrieved
* updated lighting engine demo to be an SM64 night mode with a flashlight
* Fixed longterm bug where lighting bugs out unless you spawn a light
* Added new default LE mode LE_MODE_AFFECT_ALL_SHADED_AND_COLORED which also affects vertex colored surfaces
2025-06-29 12:08:04 -04:00
Isaac0-dev
873bbd3c1d thought i fixed this ages ago
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-06-28 22:47:48 +10:00
djoslin0
c68ee859ea
Add mod development mode (#851)
With mod development mode on you can press the L bind while paused to
reload the active mods. This reload will rescan the directories for
the active modes and thus refresh their file caches.

Mod development mode also enables live lua module reloading. Any time
a lua module is updated, coop will live reload the functions that changed
and do its best to maintain the previous variable states.

---------

Co-authored-by: MysterD <myster@d>
2025-06-22 19:07:15 +10:00
Isaac0-dev
9f5ec527d8 properly check if a model is permanent
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-06-18 17:18:27 +10:00
Isaac0-dev
d4ca501a5c fix graph node reset memory corruption
by only resetting permanent models (which is all that needs to be reset anyway).
2025-06-18 17:10:01 +10:00
djoslin0
24b92ecc2a
Add a safer version of Lua's require() (#847)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
I didn't add standard Lua require() because I've always been
afraid of it. I'm not sure we can guarantee which files it
will read (or not read).

Instead, here is a custom implementation. It should work more
or less the same and allow for more modular code.

For backwards compatibility reasons, all of the lua files in
the base mod folder will be loaded as in the past. Aka one at
a time and alphabetically.

However, now coop will look for Lua files in subdirectories
and will load them in when another Lua file calls require().

The file search order is more reasonable than normal Lua
require(). It will first look for files relative to the
currently running script. If there is no matching relative
file, it will pick from any Lua file that is in any of the
mod's subdirectories.

---------

Co-authored-by: MysterD <myster@d>
2025-06-14 19:49:07 +10:00
Isaac0-dev
8f1830b079 cleanup old gfx symbol management code 2025-06-14 14:58:55 +10:00
Isaac0-dev
27b7c3d823
mario object get optimizations (#840) 2025-06-09 20:04:24 +10:00
PeachyPeach
17c311ae7d
smlua event hooks refactor (#826)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-06-09 07:40:48 +10:00
Isaac0-dev
98ff007818 get_texture_average_color
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
pass in a texture, it returns the average color of the texture
2025-06-05 22:33:24 +10:00
Isaac0-dev
681ea52f4b fix crash during conflicting warps 2025-06-04 09:40:20 +10:00
Isaac0-dev
d6508def28 revise my latest changes
Some checks are pending
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
2025-06-04 07:58:02 +10:00
Isaac0-dev
f0d6e4331d reset modified graph nodes on network shutdown 2025-06-04 02:36:35 +10:00
Isaac0-dev
73e72e1b77 fix mirror mario with custom animations again [build]
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-06-03 17:17:19 +10:00
Agent X
318c8a4995 Fix macOS compile errors and warnings [build] 2025-05-22 08:48:05 -04:00
Prince Frizzy
02c9a4146b
More Optimizations (#792)
* Initial work on optimizations.

* Requested Changes Part 1

* Requested Changes Part 2

* Requested Changes Part 3

* Requested Changes Part 4

* Requested Changes Part 5

* Requested Changes Part 6

* Update deprecated.lua

---------

Co-authored-by: PeachyPeach <72323920+PeachyPeachSM64@users.noreply.github.com>
2025-05-16 20:27:49 -04:00
Agent X
7568a8564f The old dynos warp hook params worked fine
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-05-01 21:37:44 -04:00
Agent X
ee7d694940 Fix HOOK_ON_WARP and document more functions (87.18%) 2025-05-01 20:26:04 -04:00
Isaac0-dev
5c3ef3d419 fix mac compile
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-04-30 20:51:10 +10:00
ManIsCat2
29f9e7cfcb
Add G_PACKED_NORMALS Geo Mode from F3DEX3 (#768)
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* Add new geometry mode

* Fix lua vertex colors not working
2025-04-25 15:07:31 -04:00
PeachyPeach
0f351e11fb
Gfx/Vtx improvements (#756)
Some checks failed
Build coop / build-windows (push) Has been cancelled
Build coop / build-ubuntu (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
- Renamed the `new` and `realloc` functions to `create` and `resize`
- Added `delete_all`
- Made Mod Data a class:
  - Allocation is now limited to prevent out-of-memory crashes: 1024 display lists of max size 2048 and 1024 vertex buffers of max size 4096 per mod
  - Added error codes to identify the cause of a failure (name not found, pointer not found, max size exceeded, item pool is full, ...)
2025-04-24 14:03:17 +10:00
Isaac0-dev
dcaa7e725d
fix resetting display lists (#752)
Some checks failed
Build coop / build-ubuntu (push) Has been cancelled
Build coop / build-windows (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
2025-04-18 02:28:15 +02:00
Isaac0-dev
25ff0c93c4 fix scrolling textures again
now that only vanilla vertices are duplicated
2025-04-17 11:49:04 +10:00
Agent X
6527ee1b7a Fix HOOK_ON_WARP params
Some checks failed
Build coop / build-ubuntu (push) Has been cancelled
Build coop / build-windows (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
2025-04-15 14:13:58 -04:00
Agent X
0cb0b41c07 Add some level commands to make porting HackerSM64 levels easier
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-04-14 19:25:05 -04:00
PeachyPeach
467b22e939
Gfx set command: v2 + Gfx/Vtx dynamic alloc (#718)
Some checks failed
Build coop / build-ubuntu (push) Has been cancelled
Build coop / build-windows (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
* set_gfx_command part 2

* part 3

* get gfx/vtx from name; copy gfx/vtx

* gfx/vtx dynamic allocation lua

* gfx/vtx_new: don't take level/model/vanilla names

* Clean up gbi constants

* update example

* Isaac review; add gfx_get_next_command and vtx_get_next_vertex

* make all commands length 1; missing NULL checks
2025-04-12 18:19:14 -04:00
Blockyyy
43d2248727
HOOK_BEFORE_WARP, added params to HOOK_ON_LEVEL_INIT and HOOK_ON_WARP (#736) 2025-04-10 17:17:59 -04:00
Agent X
e1c0d87ea8 Add some missing gfx symbols to DynOS
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-04-08 17:30:00 -04:00
Isaac0-dev
a67c096ecb remove some double lookups in dynos
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-04-08 14:32:25 +10:00
Isaac0-dev
7dc31e3780 model pool fix
better fix than 1bfe9d509c
just checks the level pool for session models
2025-04-08 13:54:04 +10:00
PeachyPeach
b190ee09fb
Gfx Vtx vanilla only duplicates (#733)
Some changes for gfx vtx duplication:
- Only vanilla (read-only) stuff is duplicated
- Stuff is duplicated only once, and uses a map rom->ram for next iterations
- Stuff is restored to original values on network shutdown

also fixes incorrect types in some extern declarations
2025-04-08 10:20:50 +10:00
Agent X
3a751aac56 Revert "move models to higher priority pools if needed"
This reverts commit 1bfe9d509c.
2025-04-06 13:35:40 -04:00
Isaac0-dev
1bfe9d509c move models to higher priority pools if needed
Some checks failed
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-ubuntu (push) Has been cancelled
Build coop / build-windows (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
sometimes, a model may be loaded by the level, but then a mod loads it for the session, which causes issues so we move the model to the right pool.
2025-04-04 14:17:16 +10:00