Commit graph

289 commits

Author SHA1 Message Date
Agent X
bf85d9f9d5 Lay some groundwork for more documentation, fix compilation error, put backgrounds into enum 2025-04-26 23:29:21 -04:00
Agent X
5d5147cb0e Document more functions! (83%)
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-25 17:03:41 -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
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
PeachyPeach
26d64ee79d
fix apply_platform_displacement (#740)
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-12 23:03:12 +10:00
Cooliokid956
f22855d21e
Platform DIsplacement on demand (#739)
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
+ two other functions that pipocalio asked for
2025-04-11 23:37:57 -04:00
Cooliokid956
3bfa75e32b
Miscellaneous Additions: Addendum (#723)
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
* More autogen work

- made the `Pointer_` classes into aliases instead so that they're actually associated with their true type
- "Total constants" metric is now accurate

* High Quality Master Volume

* Audio work

it's 12:55am and there are some bright flashes outside (lightning)

- cracked the code (interpreted the "Acc" in `tempoAcc`)
- added several functions that will help greatly in the Streamed Music department (you can now match sequenced music fading (transitions, eepy, etc.))
- introducing `gMasterVolume`! a variable that is only updated when it needs to be, theoretically improving performance (by some amount). this variable is used in many places in place of recalculations of the same number
- made it so that muting the game skips some audio processing (not the main process since that would linger after unmuting (not good))
- fixed an oversight where lua volumes were not taken into account when `audio_stream_set_volume`
- it's its 😁
- removed additional `#include "audio/external.h"`

it is 1:06am
gn

* Add mouse status functions

you can now check if mouse buttons were held, clicked, or released

* Sorting was a bad idea

disabled sorting for constants so that they are represented more closely to their original defines

* Expose playerlist page index

also noticed that sorting still sucks

* Minor (very important) detail

lalette

* Addressing the PeachyPeachSM64 reviews

* Return of the Forced 4:3 Mode

shoutouts to DISPLAY.FORCE_4BY3 for sticking through the toughest of times, waiting for this day to come

* Added scroll support

- Scrolling added to chat box (hold ctrl to scroll fewer lines, shift to scroll faster)
- Scrolling functions added to smlua

* Addressing the Isaac0-dev review + fixes

- mouse scroll is now accumulated
- djui_gfx_get_dimensions
- forced 4:3 won't kick in if the window isn't wide enough
- game now recognizes horizontal resizing when in 4:3 mode

* Run autogen

* gfx_get_dimensions

works just as well
2025-04-05 13:52:14 -04:00
Agent X
0ee8d5f81e Fix/optimize/improve lighting engine 2025-03-28 23:06:48 -04:00
Agent X
3e540790a3
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
Isaac0-dev
f2b4f4aaad add herobrine
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
Co-Authored-By: Agent X <44549182+AgentXLP@users.noreply.github.com>
2025-03-26 14:21:02 +10:00
Cooliokid956
efcfff210d
Miscellaneous additions (#711)
- Fixed script file path shortening for Windows in console errors (what I could at least, the one left unfixed is preprocessed and I can't mess with that)
- Adjusted audio sanity check messages to sound more natural
- 9 new functions added:

## `audio_stream_set_loop_points(audio, start, end)`
Sets an audio stream's loop points in samples, no longer requiring a hacky method to loop streams in mods

## `get_active_mod()`
Returns the mod currently being processed, can be used by mods with APIs to determine what they're being used by and react accordingly

## `get_area_update_counter()`
Returns `gAreaUpdateCounter`, can be used to determine various in-game statistics, as well as if the game is being updated

## Exposed several object pointers
`get_current_object()` to retrieve `gCurrentObject`
`get_dialog_object()` to retrieve `gContinueDialogFunctionObject`
`(get|set)_cutscene_focus()` to retrieve/assign `gCutsceneFocus`
`(get|set)_secondary_camera_focus()` to retrieve/assign `gSecondCameraFocus`
2025-03-24 07:31:06 +10:00
Agent X
2479eaabfb This new camera code is NOT up to pollos standards. 2025-03-18 23:06:36 -04:00
Agent X
ab49c33d86 Expose some cool math functions
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-03-14 22:25:56 -04:00
Sunk
edacdcc7e4
More settings to the Camera settings menu (#555)
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
Sherbie's suggestions from #497 and #538, as well as suggestions from others on discord.
Add 2 new camera settings to free camera, being camera collision and dpad usage.
Add an entire new camera submenu for romhack camera, which are now no longer exclusive to romhacks.
2025-03-14 13:01:51 +10:00
ManIsCat2
334aac7cf1 add lua texture image 2025-03-11 00:52:38 +03:30
Isaac0-dev
f98571c458 add documentation to some missing manual functions 2025-03-10 23:22:20 +10:00
Isaac0-dev
d6e243c4a7 add obj_get_model_id_extended, remember regular model ids 2025-03-04 15:09:09 +10:00
Isaac0-dev
f238b3d0f5
allow Lua to manipulate displaylists and vertices (#675)
Co-authored-by: ManIsCat2 <137772623+ManIsCat2@users.noreply.github.com>
2025-02-27 14:27:55 +10:00
Isaac0-dev
2ec4b5e53c set_find_wall_direction 2025-02-22 11:54:07 +10:00
Isaac0-dev
b1b5b93dcc remove some dangerous functions 2025-02-13 22:33:34 +10:00
Isaac0-dev
9a13c298ad added HOOK_ON_INTERACTIONS
this is called after mario's interactions are processed
2025-02-11 17:58:57 +10:00
Isaac0-dev
d53d20c11c HOOK_ON_DIALOG fixes, expose set_dialog_box_state 2025-02-10 18:31:59 +10:00
Agent X
fefb222198 Re-expose function 2025-01-10 19:04:55 -05:00
John S
be0e47a4c2
Documentation of mario.h, mario_actions_airborne.c, mario_actions_automatic.c, mario_actions_cutscene.c, and mario_actions_moving.c (#601)
* WIP mario.h - mario_actions_moving.c

* Fix improper list formatting

bulleted lists are broken due to whitespace stripping, i may fix this later.

* Fix some issues in formatting and missing descriptions

* Accidental struct syntax fix

* Fix repeating descriptions

* Fix repeating descriptions final
2024-12-31 21:00:54 -05:00
Agent X
f880e6c569 Document level_update.h and add new instant warp function (70.1%) 2024-12-31 19:39:36 -05:00
PeachyPeach
96932f5bf1
Custom geo function and switch nodes with Lua callback (#593) 2024-12-31 10:23:13 +10:00
jayden
68b9f2c556
Autogen correctly handle pointers (#584)
* correctly handle pointers in autogen

* autogen with correct pointers

* fix typo in lvt autogen
2024-12-27 17:51:47 -05:00
jayden
2a19745137
Expose types of GraphNode to Lua (#580)
* expose graph_node.h

* cast_graph_node lua function

* document cast_graph_node

* graph node immutables
2024-12-22 19:15:04 -05:00
John S
8da73663aa
Document Interaction.h (68.23%) (#577)
* Document Interaction.h (68.23%)

* Fix caps

* Fix missing bracket

* Make descriptions a little more clear and concise
2024-12-19 22:30:07 -05:00
Agent X
e3c1b20f6b Document rumble_init.h (65.46%) 2024-12-16 20:42:20 -05:00
Agent X
faceaa684a Document sound functions 2024-12-16 20:18:28 -05:00
xLuigiGamerx
66fb28500b
Added djui_menu_get_rainbow_string_color() (#536)
* Removed unintentionally exposed function and disallowed it in autogen

* Exposed djui_language_get to lua

* Added djui_menu_get_rainbow_string_color()
2024-12-16 16:51:27 -05:00
John S
af1e7be9ac
Document Camera.h (#569)
* Document functions in Camera.h

This is the complete documentation for Camera.h

* Fix some grammar and formatting mistakes.
2024-12-16 16:43:39 -05:00
Agent X
79ef7e8e12 Document about **800** functions (53.33%) 2024-12-08 17:55:23 -05:00
Agent X
9b6e891b1c Document 8 more files (19.45%)
Special thanks to zam_boni on Discord as well

Co-Authored-By: PeachyPeach <72323920+PeachyPeachSM64@users.noreply.github.com>
Co-Authored-By: xLuigiGamerx <88401287+xLuigiGamerx@users.noreply.github.com>
2024-12-07 22:23:19 -05:00
Agent X
e9039df03e Document smlua_*_utils.h files (16.94%) 2024-12-07 21:53:08 -05:00
John S
58de87d1c1
Documentation of area.h and characters.h (#548)
* Documentation of characters.h

Documenting characters.h

* Add documentation to Area.h

* Redo autogen for new descriptions
2024-12-07 16:06:27 -05:00
Agent X
1aa7524380 Improve auto documentation system 2024-12-07 11:39:29 -05:00
John S
c3539cfb58
Add descriptions to the auto-doc (#545)
Cleaned up math_util.h a little bit and added a description system for use with the autodoc.
2024-12-07 11:31:11 -05:00
Agent X
69241bd3d9 Add mod_file_exists 2024-12-05 18:40:42 -05:00
Agent X
856a828229 Add mod_storage_exists 2024-12-05 18:28:57 -05:00
Agent X
bff0cda663 Disallow another dangerous function 2024-12-01 16:58:45 -05:00
Agent X
eac580e04a Expose more lag compensation things to Lua 2024-12-01 16:46:05 -05:00
Isaac0-dev
97439fa557 fix a buffer overflow in smlua_text_utils 2024-11-30 07:30:57 +10:00
Blockyyy
fa2ec0957b
add set_room_override (#522)
lets you override the displayed room, do set_room_override(-1) in order to get back to normal
2024-11-29 07:48:19 +10:00
John S
a47bc97011
Additional Fix for sqr, max, and min Functions Focusing on Improved Performance and Documentation Support (#529)
Co-authored-by: js <js@archlinux.local>
2024-11-28 08:56:16 +10:00
xLuigiGamerx
59aada62d7
Exposed djui_language_get() (#524)
* Removed unintentionally exposed function and disallowed it in autogen

* Exposed djui_language_get to lua
2024-11-28 08:11:27 +10:00
xLuigiGamerx
e4fd83bec7
Fixed the playerlist and modlist not updating their themes and added djui_menu_get_theme() (#519)
* Fixed the playerlist and modlist not updating their theme instantly

* Added djui_menu_get_theme()

* Removed text

* Fixed syntax error
2024-11-26 16:50:47 +10:00
Sunk
5965b55eb6
Custom exclamation boxes (again) (#360)
* Unhardcode exclamation boxes

Part 1 of creating custom exclamation boxes

* Add `set_exclamation_box` and `get_exclamation_box`

Part 2 of creating custom exclamation boxes

* Exclamation box docs

Part 3 of creating exclamation boxes, although this was entirely optional

* Safety check

* Add a warning

* Remake component check

* Update warnings

* Check for subtables not being tables

* Reduce exclamation box size

This matches how many contents could exist in vanilla due to its hardcoded id 99 check. This check allows me to reasonably assume that no romhacks have more than 99 custom contents. Other mods that may use this function really shouldn't need more than 99 contents either.
2024-11-25 19:26:37 +10:00
Isaac0-dev
39826deadd add a way to find surface types in collision 2024-11-22 08:57:37 +10:00