add luaffi

main
Dominik Madarász 2024-04-12 21:17:01 +02:00
parent 0cf879297e
commit 05f23f2ca6
12 changed files with 37577 additions and 17 deletions

View File

@ -2079,8 +2079,6 @@ enum WINDOW_FLAGS {
void window_loop_exit();
void window_title(const char *title);
void window_color(unsigned color);
void window_gamma(float gamma);
float window_get_gamma();
vec2 window_canvas();
void* window_handle();
char* window_stats();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -127,6 +127,9 @@ errno_t fopen_s(
#undef cast
#undef G
//---
#define LUAFFI_C
{{FILE:3rd_luaffi.h}}
//---
{{FILE:3rd_stb_image.h}}
{{FILE:3rd_stb_image_write.h}}
//---

View File

@ -366,7 +366,7 @@
// @fixme workarounds on `tcc0.9.27 -m64` (win) for all functions with ending bool argument. test: 00-anims crashes otherwise
#undef bool
typedef char bool;
typedef char bool; ///-
// missing libm symbols on tinycc HEAD repo (tcc-x64 pre-0.9.28)
//#define fabsf fabs

View File

@ -204,6 +204,9 @@ void script_init() {
luaopen_string(L);
luaopen_math(L);
// enable ffi (via luaffi)
luaopen_ffi(L);
// @fixme: workaround that prevents script binding on lua 5.4.3 on top of luajit 2.1.0-beta3 on linux. lua_setglobal() crashing when accessing null L->l_G
if(L->l_G) {
XMACRO(BIND_ALL);

View File

@ -30,7 +30,7 @@ API void* forget( void *ptr );
#define REALLOC(p,n) REALLOC_((p),(n))
#define CALLOC(m,n) CALLOC_((m),(n))
#define STRDUP(s) STRDUP_(s)
#define ALLOCA(n) ifdef(gcc, __builtin_alloca(n), _alloca(n))
#define ALLOCA(n) ifdef(gcc, __builtin_alloca(n), ifdef(win32, _alloca(n), __builtin_alloca(n)))
static FORCE_INLINE void *(REALLOC_)(void *p, size_t n) { return n ? WATCH(xrealloc(p,n),n) : xrealloc(FORGET(p),0); } ///-
static FORCE_INLINE void *(CALLOC_)(size_t m, size_t n) { return n *= m, memset(REALLOC(0,n),0,n); } ///-

View File

@ -2790,7 +2790,7 @@ static void brdf_load() {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
brdf.id = tex;
brdf.w = 512;

View File

@ -38,8 +38,6 @@ API void window_loop_exit(); // exit from main loop function (emscripten onl
API void window_title(const char *title);
API void window_color(unsigned color);
API void window_gamma(float gamma); // 2.2 - standard, 0.0 - disables postfx pass
API float window_get_gamma();
API vec2 window_canvas();
API void* window_handle();
API char* window_stats();

12520
engine/v4k

File diff suppressed because it is too large Load Diff

View File

@ -7446,6 +7446,9 @@ void script_init() {
luaopen_string(L);
luaopen_math(L);
// enable ffi (via luaffi)
luaopen_ffi(L);
// @fixme: workaround that prevents script binding on lua 5.4.3 on top of luajit 2.1.0-beta3 on linux. lua_setglobal() crashing when accessing null L->l_G
if(L->l_G) {
XMACRO(BIND_ALL);
@ -19961,7 +19964,7 @@ static void brdf_load() {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
brdf.id = tex;
brdf.w = 512;

View File

@ -464,7 +464,7 @@ extern "C" {
// @fixme workarounds on `tcc0.9.27 -m64` (win) for all functions with ending bool argument. test: 00-anims crashes otherwise
#undef bool
typedef char bool;
typedef char bool; ///-
// missing libm symbols on tinycc HEAD repo (tcc-x64 pre-0.9.28)
//#define fabsf fabs
@ -2389,7 +2389,7 @@ API void* forget( void *ptr );
#define REALLOC(p,n) REALLOC_((p),(n))
#define CALLOC(m,n) CALLOC_((m),(n))
#define STRDUP(s) STRDUP_(s)
#define ALLOCA(n) ifdef(gcc, __builtin_alloca(n), _alloca(n))
#define ALLOCA(n) ifdef(gcc, __builtin_alloca(n), ifdef(win32, _alloca(n), __builtin_alloca(n)))
static FORCE_INLINE void *(REALLOC_)(void *p, size_t n) { return n ? WATCH(xrealloc(p,n),n) : xrealloc(FORGET(p),0); } ///-
static FORCE_INLINE void *(CALLOC_)(size_t m, size_t n) { return n *= m, memset(REALLOC(0,n),0,n); } ///-
@ -4823,8 +4823,6 @@ API void window_loop_exit(); // exit from main loop function (emscripten onl
API void window_title(const char *title);
API void window_color(unsigned color);
API void window_gamma(float gamma); // 2.2 - standard, 0.0 - disables postfx pass
API float window_get_gamma();
API vec2 window_canvas();
API void* window_handle();
API char* window_stats();