39 Commits
Author SHA1 Message Date
Agent X 9bc820791e Default object light ID to -1 2026-05-23 11:47:05 -04:00
djoslin0andMysterD 7d02d52dcc Refactor collision surface systems and add the ability to add/remove/move surfaces (#1143)
- Add `smlua_collision_add_surface`, `_move_surface`, `_delete_surface` Lua APIs
- Add `remove_static_object_collision` to fully free a SOC and its surfaces
- Split surface pools into separate static, SOC, and dynamic pools
- Replace index-based SOC tracking with unique ID counter (`sSOCIdCounter`)
- Invalidate Lua CObjects for recycled surfaces on pool clear
- Expose `SURFACE_POOL_STATIC/DYNAMIC/SOC` constants to Lua
- Add `growing_array_swap_and_pop` and `growing_array_swap_and_pop_index` to memory utils

Co-authored-by: MysterD <myster@d>
2026-05-02 14:58:46 -04:00
EmeraldLockdown 81ba80fb11 Add in C documentation (#1176)
* Add in C documentation

* update readme

* Remove unecessary spacing
2026-04-21 21:35:01 -04:00
PeachyPeachSM64 d54c01b236 Fix gfx_set_command bug if symbol is a substring of another symbol 2025-11-08 16:46:59 +01:00
PeachyPeach 3cd756bc0b G_CULL_INVERT_EXT; Vec2 functions; bug fixes (#985) 2025-10-21 18:56:35 +02:00
djoslin0andMysterD c5f9431e7b Add bytestring packets for mods to use (#866)
Adds network_send_bytestring(), network_send_bytestring_to(), and
HOOK_ON_PACKET_BYTESTRING_RECEIVE

This is as close to raw bytes as you can get in lua. It allows you
to efficiently pack as much data as possible into each packet.

The existing network_send() was built for ease of use, but is quite
inefficient when you want to send a lot of data. Each number or int
field in the table amounts to 9 bytes for the key and 9 bytes for the
value. (amounting to 18 bytes per value). Whereas with the new method
you can pack that information into 1, 2, 4, or 8 bytes depending on
your type's size.

---------

Co-authored-by: MysterD <myster@d>
2025-06-30 11:24:39 +10:00
Agent X 4f5c69cf53 Lighting Engine: Awesome Edition
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
PeachyPeach 0b04b2588b Gfx/Vtx improvements (#756)
- 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
PeachyPeach 20c5c29d6e Gfx set command: v2 + Gfx/Vtx dynamic alloc (#718)
* 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
Agent X 0ebb1ce21b Basic Vertex Point Lighting Engine (#716)
* CONCEPT: Basic vertex lighting engine

Set the geometry mode on your model to G_LIGHTING_ENGINE_EXT, spawn a `bhvAmbientLight`, spawn some `bhvPointLight`s, and then you got yourself a mighty interesting scene.

* Fixes

* How did I miss this

* Make light set home pos
2025-03-27 16:36:02 -04:00
ThePlayerRolo 7604e1adb6 Add files via upload (#286) 2024-09-01 13:43:08 -04:00
Mechstreme e1b8d9299d Update & fix issues with #184 and #205 (#215)
* Update improved Portuguese translation

* Update hud.lua (optimizations, updated comments, +2 examples)
2024-07-16 11:58:02 -04:00
Mechstreme 2d9e461a5c Update 4 example mods (#205)
* Update 4 example mods

* localize functions in water-level.lua
2024-07-13 14:46:41 -04:00
Agent X 7892b279f4 Shorten include paths by removing unnecessary "src/" 2024-04-17 17:28:38 -04:00
4abf358959 extract assets from rom at runtime (#4)
* Proof of concept for loading rom assets at runtime

* Added skybox textures

* Adjusted format

* Load all texture assets from rom

* Adjusted rom asset loading

* Load all Vtx lists from rom

* clean up toad, wario and his cap conflicts

* Load sound samples from rom

* fix toad sounds

* Loaded sequences from rom

* Load collisions from rom

* Object animations are now loaded from the rom

* Load player animations from rom

* Load goddard anims from rom

* whoops

* fix some compile errors

* drag and drop rom checker, everything works now.

* fix errors due to merge conflicts

* fix compile errors on windows, switch to md5

* fix vertex colors during load

Co-Authored-By: Agent X <44549182+agent-11@users.noreply.github.com>

* Load dialogs from rom

* Loaded course/act names from rom

* Loaded ingame text from rom

* rerun autogen & blacklist smlua_text_utils_init

* fix ttc_seg7_vertex_0700B238 colors

---------

Co-authored-by: MysterD <myster@d>
Co-authored-by: Agent X <44549182+agent-11@users.noreply.github.com>
2024-03-23 16:11:30 -04:00
Agent X dd4b9b0045 Fix texture override example
The tex files were corrupted it seems, probably a remnant from the chaos of the CRLF and LF file ending days.
2024-02-21 14:57:28 -05:00
Agent X 7b68eb5928 Fix texture override example 2023-12-14 21:21:49 -05:00
Agent X 03ce19296a Add texture overriding example 2023-11-13 09:30:20 -05:00
b1300ef210 sm64coopdx
Co-Authored-By: Yuyake <140215214+AngelicMiracles@users.noreply.github.com>
Co-Authored-By: FluffaMario <50761036+FluffaMario@users.noreply.github.com>
Co-Authored-By: Gregory Heskett <gheskett@gmail.com>
Co-Authored-By: iZePlayzYT <69536095+iZePlayzYT@users.noreply.github.com>
Co-Authored-By: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com>
Co-Authored-By: eros71 <16540103+eros71-dev@users.noreply.github.com>
2023-10-30 01:03:36 -04:00
PeachyPeach 304d7baa8c Custom animation examples (#392) 2023-05-14 19:16:03 -07:00
Emerald Lockdown 28ef1e73b6 Doc stuff (#182) 2022-09-12 20:01:45 -07:00
MysterD d2a5111178 Various audio fixes, updated audio example 2022-05-08 04:32:18 -07:00
MysterD 2fa54286bf Move audio test example 2022-05-08 00:28:02 -07:00
MysterD 93b3c04c06 Add custom hud texture example 2022-05-06 22:06:35 -07:00
MysterD 8491178816 Custom level example 2022-04-15 22:01:19 -07:00
MysterD 908f791acb Moved low gravity and mario run to examples 2022-04-13 01:38:32 -07:00
Agent-11 / Agent X f744487c3c Add get/set_environment_region (#56)
Set the water height with a function. Also added an example for it in the documentation.
2022-04-05 15:53:16 -07:00
MysterD f05dbf7117 Fixed up DynOS collision files 2022-04-01 17:59:40 -07:00
MysterD 327495e5c7 Added big paddle example 2022-03-30 21:36:47 -07:00
MysterD eff9313e3e Merge branch 'unstable' of github.com:sm64ex-coop-dev/sm64ex-coop into unstable 2022-03-19 00:59:06 -07:00
mjcox244 71ec4e84c5 Add more Example Lua mods (#35) 2022-03-18 21:30:53 -07:00
MysterD 1b975c7f5a Added custom player model example 2022-03-17 21:41:46 -07:00
MysterD d144af4d59 Add custom box model example 2022-03-16 22:55:16 -07:00
MysterD e991132935 Added the ability to set surface collisions on custom behaviors 2022-03-09 23:02:20 -08:00
MysterD 5ce7184247 Made adding to behaviors possible in Lua 2022-03-05 01:29:24 -08:00
MysterD 3cfe7f8185 Add custom behavior Lua examples 2022-03-04 23:14:01 -08:00
MysterD 241119cae1 Add spawn-stuff lua example 2022-02-26 00:03:21 -08:00
MysterD 7f6fb57797 Added HOOK_ON_INTERACT to Lua API 2022-02-15 22:21:31 -08:00
MysterD 1738ed136f Added rect rendering to Lua API 2022-02-15 22:15:49 -08:00