Compare commits

...

4 Commits

Author SHA1 Message Date
veclavtalica
20394eed6c disable elf texture lookup hack 2025-01-26 23:26:48 +03:00
veclavtalica
a54657e7be twn_loop.c: limit minimum amount of delay 2025-01-26 18:34:34 +03:00
veclavtalica
3bdee30e7b /docs/interop.md: add a line about parameter keywords 2025-01-26 18:08:49 +03:00
veclavtalica
0e4abaae3c twn_api.c: change repeat parameter to loops, as to prevent name collisions 2025-01-26 17:53:01 +03:00
4 changed files with 5 additions and 4 deletions

View File

@ -14,3 +14,4 @@ for that certain considerations are taken:
* symbols should not contain numerics at the start nor after the namespace prefix
* 32 bit floating point is the only numeric type
* [/include/twn_api.json](../share/twn_api.json) file is hand-kept with a schema to aid automatic binding generation and tooling
* parameter names should not collide with keywords of any language that is targetted; if so happens, parameter alias could be added

View File

@ -221,7 +221,7 @@
"params": [
{ "name": "audio", "type": "char *" },
{ "name": "channel", "type": "char *", "default": {} },
{ "name": "repeat", "type": "bool", "default": false },
{ "name": "loops", "type": "bool", "default": false },
{ "name": "volume", "type": "float", "default": 1.0 },
{ "name": "panning", "type": "float", "default": 0.0 }
]

View File

@ -252,7 +252,7 @@ static void main_loop(void) {
/* which for now is broken as glBufferData with NULL is used all over right after render */
if (frames != 0)
render();
else
else if (ctx.desired_frametime - ctx.frame_accumulator > 1000000)
/* don't waste clock cycles on useless work */
/* TODO: make it adjustable from config */
SDL_Delay((uint32_t)(ctx.desired_frametime - ctx.frame_accumulator) / 1250000);

View File

@ -462,7 +462,7 @@ void textures_update_atlas(TextureCache *cache) {
}
/* EXPERIMANTAL: LIKELY TO BE REMOVED! */
#if defined(__linux__) /* use rodata elf section for fast lookups of repeating textures */
#if defined(__linux_x_) /* use rodata elf section for fast lookups of repeating textures */
#include "system/linux/twn_elf.h"
@ -628,7 +628,7 @@ size_t textures_get_num_atlases(const TextureCache *cache) {
}
void textures_reset_state(void) {
#if defined(__linux__) && !defined(HOT_RELOAD_SUPPORT)
#if defined(__linux__x) && !defined(HOT_RELOAD_SUPPORT)
last_path = NULL;
last_texture = (TextureKey){0};
shfree(ptr_to_texture);