Commit graph

54 commits

Author SHA1 Message Date
Cooliokid956
5fd55ffac1
djui_hud_is_mouse_locked() (#986)
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
* djui_hud_get_mouse_locked()

Adds a total of 1 function:
# `bool djui_hud_get_mouse_locked()`
Returns the DJUI mouse lock status

Tip: This won't return the true state of mouse lock, so make sure to use `get_first_person_enabled()` and `camera_config_is_mouse_look_enabled()` as well

---
This also fills in some descriptions left out by Isaac in his viewport/scissor functions

* djui_hud_is_mouse_locked()

Same as before but is

* this is better imo
2025-10-29 18:41:27 +01:00
PeachyPeach
32f395fb0c
ModFs improvements (#907)
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
* zip + json properties; check existing file in create file

* smlua_audio_utils_replace_sequence

* audio_stream_load, audio_sample_load, smlua_model_util_get_id

* get_texture_info + can also load PNG files

* smlua_collision_util_get

* add wildcard in properties files + set text mode

* filepath restrictions

* Some mod_storage improvements

- Cache mod storage files into a map to reduce file I/O
- Fix a bug in mod_storage_save
- Add mod_storage_load_all that returns all keys/values as a table

* shutdown; fix buffer overflow; fix warnings; lua table

* reject binary files starting with MZ or ELF

* function members

* better doc

* adding file rewind

* ModFS guide; replace yaml by ini; read string buffer changes
2025-10-21 19:42:06 +02:00
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
PeachyPeachSM64
a2b4ac8f08 Fix palette editor cap on/off invulnerability 2025-08-13 21:01:39 +02:00
Beckowl
03b29489b1
Add `smlua_text_utils_allocate_dialog` (#896)
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
* wip

* get rid of seg2_dialog_table and fix crashes

* remove unused include

* change more types to s32

* remove dialog tables from eu_translation.h

* fix dialog_table_get signature

* Change `oToadMessageDialogId` to s32

* remove exit from dialog_table_add

* warning

* calloc allocated dialogs

* avoid memcpy on allocation fail

* Move dialog entry text field init to dialog_table_init

* Free original dialog entries' text field

* Put all reset logic in one place

* Run autogen

* Remove ``get_dialog_text_ascii`` from autogen

* minor fix

* free dialog->str if replaced

* nevermind

* remove get_dialog_unmodified from autogen

* Change -1 to DIALOG_NONE

* update stuff to s32

* use growing array functions

* Change limit to something more reasonable

* add null check

* remove explicit cast

* Minor fixes

* more type fix

* peachy review

* Fix weird enums in autogen

* remove extra newline :p

* add dialog restore

* bump max dialogs just a lil bit 🥺

* add lua behavior params

* all OBJECT fields are now Lua variables

* Revert lua behavior params changes

* isaac review

* fix segfault

---------

Co-authored-by: PeachyPeachSM64 <72323920+PeachyPeachSM64@users.noreply.github.com>
2025-08-03 17:49:45 +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
Baconator2558
c9db7006a3
Add Ability to Hide HUD on Act Select Screen (#880) 2025-07-29 11:42:55 +10: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
PeachyPeach
4c3ee14f55
Mod file system (#850)
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
* modfs; optional function parameters in autogen

* errors and stuff

* script to turn a directory into a modfs file and vice versa

* bug fixes

* read: raise error on eof

* properly check eof on read_string

* fill; reload; check pointer validity; skip private files when loading non-active modfs

* added bytestrings

* move ByteString to smlua_utils.h
2025-07-01 01:53:47 +02:00
Beckowl
7fdded5a8e
Add smlua_text_utils_dialog_get_text and some other dialog functions (#860)
* Add new dialog functions

* Add missing symbols to charmap

* Fix the crashing

* Add braces to if statement

* Implement Isaac's suggestion

* Add override return type to autogen

* Update comment

* Add text field to `DialogEntry`

* wtf??

* Peachy requests
2025-06-28 14:28:28 +02:00
PeachyPeach
075e76b71a
fix custom course and act names (#869)
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-27 19:00:58 +02:00
Sunk
9acb632b8e
Fix HOOK_ALLOW_HAZARD_SURFACE and expose SURFACE_IS_* macros (#865)
* Fix HOOK_ALLOW_HAZARD_SURFACE

* Peachy's suggestions

* Exposed `surface_is_*` macros
2025-06-24 22:15:27 +02:00
Isaac0-dev
f587dc38be removed get_game_tick_counter
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
use get_global_timer instead
2025-06-15 21:01:32 +10:00
djoslin0
2f573d17f9
Change get_game_tick_counter() to use gGlobalTimer (#853)
The old version was incrementing at the start of the code iteration, but it makes
more sense to increment after the frame is built. That way every event within one
visible game tick will get the same tick identifier

Co-authored-by: MysterD <myster@d>
2025-06-15 20:15:23 +10:00
djoslin0
f42e4ad55b
Add get_game_tick_counter() (#852)
Coop now maintains a counter that increments at the start of each game tick,
And another counter that increments at the start of each frame render.

This is to be able to identify specific frames regardless of mod load, hook,
and execution order.

---------

Co-authored-by: MysterD <myster@d>
2025-06-15 17:26:53 +10:00
Isaac0-dev
7b1dabfb43 more copy paste errors
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-13 22:18:51 +10:00
Isaac0-dev
b7edf71499 replace get_texture_average_color with texture_to_lua_table 2025-06-09 14:39:07 +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
PeachyPeach
c79d59d8ec
Fix vec3f bugs (#837) 2025-06-05 19:44:09 +10:00
Isaac0-dev
e1aab9c479 gfx_get_texture
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
returns a pointer to the texture in the gfx command
2025-06-05 17:07:53 +10:00
Agent X
feba35b010 Expose sync_object_get_object
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-05-29 11:31:31 -04:00
PeachyPeach
69e129805e
More math improvements (#820)
* More math improvements

* more math functions

* stack check

* added error message when trying to modify read-only table; fix gSmluaConstants printed to console
2025-05-29 02:52:31 +02:00
Agent X
3795e5afbc Add some sync object functions [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-05-26 14:51:57 -04:00
PeachyPeach
bbabaa3c79
Fix hand/foot pos and get any Mario part position (#816)
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
* Fix hand/foot pos and get any Mario part position
2025-05-21 23:52:04 +02:00
PeachyPeach
8db6356754
Improving math functions (#813)
* Improving math functions

* Isaac review
2025-05-21 23:50:49 +02:00
Isaac0-dev
ecac2afd07 fix some issues with smlua
get_temp_s32_pointer and deref_s32_pointer: these are actually safe and mods use them
fixed a nil script error with smlua_to_cpointer
2025-05-21 21:50:13 +10:00
Sunk
047adf35bf
Expose and create some useful functions (#819) 2025-05-21 09:40:30 +10:00
Beckowl
7472aa9b0a
Expose useful global graphnodes (#789)
* Add global node getters

* move pointer asterisk thing for consistency

* Run autogen

* Add geo prefix to new functions

* Run regen

* Rename functions

* run autogen

* Make viewport fields mutable

* Address code review comments
2025-05-07 17:09:08 -04:00
Agent X
6b5263d60e Whoops
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-27 00:35:55 -04:00
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
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
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
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
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
Isaac0-dev
04ea4d6ad4 smlua use lot and lvt names rather than an index 2025-03-10 12:21:48 +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
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
faceaa684a Document sound functions 2024-12-16 20:18:28 -05:00
Agent X
bd09ed0298 Small code comment changes 2024-12-13 20:13:55 -05:00
John S
7d0b184fa5
Document surface_collision.h (#549)
* Document surface_collision.h

Add documentation to the functions of surface_collision.h

* Make descriptions a little more clear

* Fix random space
2024-12-12 00:02:07 -05:00
Agent X
f9d560aa78 Document some more functions (55.03%) 2024-12-08 18:38:23 -05:00
Agent X
e9039df03e Document smlua_*_utils.h files (16.94%) 2024-12-07 21:53:08 -05:00