Commit graph

113 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
PeachyPeachSM64
a2b4ac8f08 Fix palette editor cap on/off invulnerability 2025-08-13 21:01:39 +02:00
djoslin0
82ca45eeb6
Lighting engine improvements (#870)
* Lighting engine improvements

Now objects will be affected by the lighting engine. This is
accomplished by passing the renderer the object's model matrix
(uncombined with the view or projection). You can now setup the
lighting engine mode to affect all shaded surfaces, lighting can
be affected by surface normals, and you can control what type of
tone mapping is applied.

added le_set_mode(mode)
    By default we retain the previous behavior.

    When set to LE_MODE_AFFECT_ALL_SHADED the lighting engine will
    affect every shaded material.

    This way we don't have to recompile every object and level that
    we want shaded with special coop-specific commands

added le_get_mode()

added le_set_tone_mapping(toneMapping)
    Tone mapping is what happens when a color value exceeds its 0-255
    range.

    By default we retain the current tone mapping (called
    LE_TONE_MAPPING_TOTAL_WEIGHTED).

    LE_TONE_MAPPING_WEIGHTED is now accessible, it was the tone
    mapping that was previously left out of the compile through ifdefs.

    LE_TONE_MAPPING_CLAMP is just simple additive with a clamp at a
    color value of 255.

    LE_TONE_MAPPING_REINHARD is reinhard tone mapping
    (vout = (vin + 1) / vin).

added le_set_light_use_surface_normals(id, useSurfaceNormals)
    By default lights retain their previous behavior (of ignoring
    surface normals).

    When enabled lights cast on one side of the object will not
    appear on the other side of the object.

    It is kind of like backface culling, but for lights.

added le_calculate_lighting_color_with_normal(pos, normal, outColor, lightIntensityScalar)
    It's just like le_calculate_lighting_color(), but you can pass
    in normals now.

* Removed normal calculation from vertex colored surfaces - they don't have normals

* Use packed normals correctly

* made LE_MODE_AFFECT_ALL_SHADED the default

* made useSurfaceNormals the default for lights

* Set ambient color, performed le_is_enabled() checks

The ambient color was black, which is why everything was dark by default.
If we set ambient to white then people will never see the effects of their
lights unless they set ambient to a lower value. So I added checks for
if a light has ever been added. The alternative would be to have something
like le_set_enabled()

* Rewrite how we obtain the model matrix - invert the camera

* run autogen

* Change default tonemapper to weighted, make setting ambient enable LE, fix null deref

* Address Peachy's comments

---------

Co-authored-by: MysterD <myster@d>
2025-06-29 17:46:35 +02:00
PeachyPeach
c79d59d8ec
Fix vec3f bugs (#837) 2025-06-05 19:44:09 +10: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
PeachyPeach
8db6356754
Improving math functions (#813)
* Improving math functions

* Isaac review
2025-05-21 23:50:49 +02:00
Sunk
047adf35bf
Expose and create some useful functions (#819) 2025-05-21 09:40:30 +10: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
PeachyPeach
0d4fd39a00
Fix interactions again (#795) 2025-05-08 08:51:44 +10:00
Agent X
ee7d694940 Fix HOOK_ON_WARP and document more functions (87.18%) 2025-05-01 20:26:04 -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
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
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
02bd7917cb Fix lighting engine merge header mistake 2025-03-27 17:24:49 -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
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
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
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
Agent X
fe316a9a08 Document some more files (69.61%) 2024-12-22 21:53:54 -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
faceaa684a Document sound functions 2024-12-16 20:18:28 -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
f9d560aa78 Document some more functions (55.03%) 2024-12-08 18:38:23 -05:00
Agent X
79ef7e8e12 Document about **800** functions (53.33%) 2024-12-08 17:55:23 -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
e9df872213 Move documented description above Lua example 2024-12-07 13:13:00 -05:00
Agent X
64659afd82 Small consistency changes. Functions are now 8.85% documented 2024-12-07 12:58:26 -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
856a828229 Add mod_storage_exists 2024-12-05 18:28:57 -05: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
Cooliokid956
6badf67a33
Add location label override (#390) 2024-10-27 15:52:17 +10:00
John S
3dd9226bc9
Update math_util.c and math_util.h to support autodoc with trig functions (inline instead of macros) and add new functions to smlua_math_utils (#359)
* Update math_util.c and math_util.h to move toward inlining functions instead of macros for autodoc. Expose some misc functions useful to lua

* Fix formatting

* Fix math_util.c formatting

* Fix formatting for smlua_math_utils.c

* Fix formatting smlua_functions.c

* Fix type redundancy in _Generic macros

* Add checks for including the highly optimized builtin compiler functions for GCC/Clang

* Add compiler checking for absx() to add in the highly optimized GCC/Clang builtins

* Fix repeated use of float built-ins for non floating point numbers

* Fix grammar mistake

* Fix functions to use camelCase as requested.

* Fixed the use of a custom sqrt approximation as modern procs have a built in FSQRT instruction that is faster.

---------

Co-authored-by: js <js@cartbara.columbus.rr.com>
2024-10-18 12:20:36 +10:00
Blockyyy
1ac9ce8e4c
sequence_player_set_tempo, sequence_player_set_transposition (#224)
* Made Sequence function

* snake case
2024-07-21 18:56:18 -04:00
Agent X
e953fb3bf3 Hide player palette color channel functions to minimize confusion 2024-07-09 15:39:02 -04:00
Agent X
2601d4cc4f Undeprecate and restore network_discord_id_from_local_index 2024-07-07 20:06:33 -04:00
Agent X
971ddc00cd Remove legacy struct fields, fix a function name 2024-06-26 18:51:11 -04:00
Agent X
bcdb6be53a Improve mod storage & hopefully fix Cookie mod 2024-06-15 13:39:16 -04:00
Agent X
7026a2862f Add save_file_erase because it's already possible at this point 2024-06-13 20:33:47 -04:00
Agent X
2b2dceb333
Add a mod menu where mods can put DJUI elements (#56)
* Add a menu where mods can put their options at

* Document mod menu hook functions

* Add HOOK_ON_LANGUAGE_CHANGED

* Add new Cheats mod

* Make player menu disable singleplayer pause

* fix some git merge conflicts that weren't resolved (#55)

and added -latomic to build flags to fix compile warnings while compiling miniaudio

* Remove legacy 'deluxe' field from built-in mods

* Lots of improvements to memory safety

* Abbreviated hex color parsing

Co-Authored-By: Mechstreme <84944335+mechstreme@users.noreply.github.com>

---------

Co-authored-by: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com>
Co-authored-by: Mechstreme <84944335+mechstreme@users.noreply.github.com>
2024-06-01 20:52:43 -04:00
Agent X
ceb7aa4649 Palette system overhaul and preset rewrite 2024-05-21 17:09:59 -04:00
Isaac0-dev
90b071acc0
exposed a bunch of interaction functions to Lua (#22)
Renamed the function interact_unknown_08 to interact_spiny_walking
and added the constant INTERACT_SPINY_WALKING, which has the same value of INTERACT_UNKNOWN_08
INTERACT_UNKNOWN_08 is kept for compatibility with smlua, and behavior dynos bins
2024-05-03 18:38:21 +10:00
Agent X
b8c42f308f Disallow function that shouldn't be in Lua 2024-04-09 17:40:52 -04:00
Isaac0-dev
4473bfffe9
removed bass, replaced with miniaudio (#8) 2024-03-23 16:14:53 -04:00
Agent X
7dd02b5c4d Massively improve "Global Player Models" option 2024-03-17 20:58:38 -04:00
Agent X
58a3ed49f7 Revert "Add ability to set global note frequency scale"
This reverts commit de9c3c35b2.
2024-03-13 17:24:46 -04:00
Agent X
89e9bcdcec Add "-- pausable" field for mods and function so mods can make themselves pausable in singleplayer 2024-03-04 19:25:09 -05:00