* Unify renderers into one build, no more segregation
* Fix Linux compilation error
* How does one miss this
* Rename this
* Fix silly naming error that I missed
* Update Russian translation
* use hashmaps in mod cache
* use templates, suggested by peachy
an attempt to do what peachy is talking about
* that looks unusual
* change data to key parameter
Loading the scroll targets was probably the slowest parts to loading a romhack.
The reason for this is that many romhacks can have thousands of calls to `add_scroll_target`.
So, for 4,107 calls to `add_scroll_target`, the time went from ~4.5759 seconds to ~0.0173 seconds in total.
Changes made:
- Previously, simply finding the material data to scroll was rather slow due to using a linear sub string search across all vertices in all levels. To speed this up, I added a cache.
The cache bypasses checking every level by storing the exact string (rather than the substring) in a hashmap, so lookups become a simple case of a string lookup as a key in the map. It falls back to the full lookup if the cache doesn't hit.
- Changed the vertex buffer management in `scroll_targets.c` to behave closer to a modern dynamic array, where buffer size is doubled each time a new vertex buffer is added, to reduce the number of allocations performed.
* Fix erroneous sync valid packets
When the server received a sync valid packet from another player, it would also set the server player's level. This simple fix makes this no longer happen.
* Fix sync valid packets with host
Okay, so it turns out that the host was unable to differentiate between packets meant to validate other players, and packets meant to validate itself (sent when entering a level another player is already in). I changed so that the packet also includes who the sync packet is validating. Requires an additional byte, as well as adding an argument to network_send_sync_valid.
* Don't have server inform itself
Fixes HOOK_ON_SYNC_VALID being called twice
Add a way to save and load a gfx state in display lists.
Its primary purpose is to save the gfx state before rendering a held object, then restore it later.
It fixes the issue where Mario had opaque legs with the vanish and metal caps when holding an object.
* Scale bone anim support
Code changes provided by ExcellentGamer. Supports model anims which modify scale.
* Peachy code changes by ExcellentGamer
* Autogen constants
* changed vc3f_set to vec3f_copy
Allows modders to play audio streams on channels other than level background music.
4 constants have been added for this purpose:
- `MOD_AUDIO_CHANNEL_MASTER` - sound is only affected by master volume
- `MOD_AUDIO_CHANNEL_MUSIC` - sound is affected by music volume, same as previous behaviour
- `MOD_AUDIO_CHANNEL_SFX` - sound is affected by sfx volume, same as sample behaviour
- `MOD_AUDIO_CHANNEL_ENV` - sound is affected by env volume
This was done instead of using the existing `SEQ_PLAYER_*` constants to avoid confusion and because there isn't a `NONE`/`MASTER` option.
Additionally, sets the default to `MOD_AUDIO_CHANNEL_MUSIC` as to not break compatibility.
```lua
audio_stream_set_volume_channel(stream, MOD_AUDIO_CHANNEL_SFX) -- wow its just like a sample
audio_stream_get_volume_channel(stream) -- returns MOD_AUDIO_CHANNEL_SFX (its actually 2)
```
## Low hanging fruit optimisations for the memory data structures in `memory.c`
Mostly generic performance improvements:
- Swapping `calloc` calls for `malloc` calls where it's safe
- Combined allocations into one large allocation for `node + buffer`
- Using `realloc` instead of full `calloc` + `memcpy` + `free`.
- 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>
Applied a compatibility band-aid for `ModAudio.file.relativePath` using unions and properties. The only real thing here is the new hidden `return_self` function I had to make for this to work
unction
* This is an awful workflow. Probably still need to update dx11 program ver
* Yea, going to despise this workflow
* Whoops
* Weewoo
* Fix comp error
* Bump dx11 ver due to it having an extremely limited number of inputs
* CObject Properties
- Added property members to CObjects via `PROPERTY` macro
`PROPERTY(name, get, set)`
- `name`: property name
- `get`: `fun(self): value`
- `set`: `fun(self, value)`
- Prettified `LuaObjectField` struct with unions for function/property value types
- Added properties to `struct ModAudio`
- `position`
- `looping`
- `frequency`
- `volume`
- NOTE: only work with streams- the audio reform will come later
* Define array size only when necessary
- new `__pairs` metamethod for `CObject`s, cycles through all of an object's fields, in alphabetical order
- stray semicolon!
* Add version info (Windows) + Smart update checker
* patch autogen, remove prints
* Fix special case (min=0,fix=!0)
* Not that obvious!!
* Still too obvious... last one
* the djoslin0 review
* Nuked
* Control the Lighting Engine with le_disable and le_enable in real time
(FORK REDO FOR PR)
* I hate it when I typo
* Control the Lighting Engine in real time with le_set_active (new change)
* Changed to le_set_enabled to be better in line with functions
- Custom geo asm and custom behaviors were meant to use any non-local
function from any active mod, but the condition for it was always
false (gSmLuaConvertSuccess is never set to false and funcRef is not
checked)
- By default, they should NOT be able to retrieve anything from other mods
- Even without this condition, they are still allowed to use any
function exposed to _G
Approved by Isaac.
cyrillic letters in font_normal adjusted by @idiotforge, in font_hud adjusted by @xLuigiGamerx
in the recolorable hud font, i fixed some things i missed last time
* Introduce this new pack in a more proper reviewable manner
Ideally I should have made a PR for my new pack and I understand the new geo function may have come out of no where. I've been thinking about adding it for a while and was going to utilize it in a new project I'm working on but I should have explained it first before pushing anything for sure
* Address suggestions
* Restore these, whoops
* Mark all unused variables as unused, resolve some unsafe code, some things still need to be looked at
* Remove a lot of unused variables that didn't need to exisat
* Remove UNUSED keyword from appartion values
---------
Co-authored-by: Agent X <44549182+AgentXLP@users.noreply.github.com>