move bind out of engine folder

main
Dominik Madarász 2023-10-09 08:43:21 +02:00
parent d5443512f4
commit b9ceb42817
22 changed files with 34 additions and 185 deletions

View File

@ -75,14 +75,14 @@ rem generate bindings
if "%1"=="bind" (
rem luajit
tools\luajit tools\luajit_make_bindings.lua > v4k.lua
move /y v4k.lua engine\bind
move /y v4k.lua bind
exit /b
)
if "%1"=="lua" (
pushd engine\bind
luajit "..\..\%2"
pushd bind
luajit "..\%2"
popd
exit /b
)
@ -259,7 +259,7 @@ if "%1"=="fwk" (
xcopy /y "engine\split\3rd_*" "_fwk\engine\split"
xcopy /y "engine\art\shaders\*" "_fwk\engine\art\shaders"
xcopy /y "demos" "_fwk\demos"
xcopy /y/E "tools "_fwk\tools"
rem xcopy /y/E "tools "_fwk\tools"
for %%f in ("engine\split\v4k*") do (
set "filename=%%~nf"
set "newname=fwk!filename:v4k=!%%~xf"
@ -285,13 +285,13 @@ if "%1"=="fwk" (
rem echo Processing: %%f
rem tools\fwkren.exe %%f from
rem )
for %%f in (_fwk\tools\editor\*.c) do (
set "filename=%%~nxf"
echo Processing: %%f
tools\fwkren.exe %%f from
)
rem for %%f in (_fwk\tools\editor\*.c) do (
rem set "filename=%%~nxf"
rem echo Processing: %%f
rem tools\fwkren.exe %%f from
rem )
tools\fwkren.exe tools\cook.ini from
rem tools\fwkren.exe tools\cook.ini from
echo All done.
endlocal
@ -306,7 +306,7 @@ if "%1"=="back" (
xcopy /y "_fwk\engine\split\3rd_*" "engine\split"
xcopy /y "_fwk\engine\art\shaders\*" "engine\art\shaders"
xcopy /y "_fwk\demos" "demos"
xcopy /y/E "_fwk\tools "tools"
rem xcopy /y/E "_fwk\tools "tools"
for %%f in ("_fwk\engine\split\fwk*") do (
set "filename=%%~nf"
set "newname=v4k!filename:fwk=!%%~xf"
@ -332,13 +332,13 @@ if "%1"=="back" (
rem echo Processing: %%f
rem tools\fwkren.exe %%f to
rem )
for %%f in (tools\editor\*.c) do (
set "filename=%%~nxf"
echo Processing: %%f
tools\fwkren.exe %%f to
)
rem for %%f in (tools\editor\*.c) do (
rem set "filename=%%~nxf"
rem echo Processing: %%f
rem tools\fwkren.exe %%f to
rem )
tools\fwkren.exe tools\cook.ini to
rem tools\fwkren.exe tools\cook.ini to
echo All done.
endlocal
@ -352,7 +352,7 @@ rem tidy environment
if "%1"=="tidy" (
move /y ??-*.png demos > nul 2> nul
move /y ??-*.c demos > nul 2> nul
del engine\bind\v4k.dll > nul 2> nul
del bind\v4k.dll > nul 2> nul
del .temp*.* > nul 2> nul
del *.zip > nul 2> nul
del *.mem > nul 2> nul
@ -651,7 +651,7 @@ if "!v4k!"=="yes" (
if exist !cache!.pdb copy /y !cache!.pdb v4k.pdb 2>nul >nul
if not exist "!cache!" (
!echo! v4k && !cc! engine\v4k.c !export! !args! && if "!dll!"=="dll" copy /y v4k.dll engine\bind\lua > nul || set rc=1
!echo! v4k && !cc! engine\v4k.c !export! !args! && if "!dll!"=="dll" copy /y v4k.dll bind\lua > nul || set rc=1
echo. > !cache!
if exist v4k.o copy /y v4k.o !cache!.o 2>nul >nul
if exist v4k.obj copy /y v4k.obj !cache!.obj 2>nul >nul
@ -662,7 +662,7 @@ if "!v4k!"=="yes" (
) else (
rem cached. do not compile...
echo v4k.c ^(cached^)
if "!dll!"=="dll" copy /y !cache!.dll engine\bind\v4k.dll > nul || set rc=1
if "!dll!"=="dll" copy /y !cache!.dll bind\v4k.dll > nul || set rc=1
)
)

7
bind/MAKE.bat 100644
View File

@ -0,0 +1,7 @@
cd /d %~dp0
call ..\make.bat dll
call ..\make.bat bind
luajit hello.lua
python hello.py
cd ..

View File

@ -3,7 +3,7 @@
local v4k=require('v4k')
-- specify location of cookbook
v4k.cook_config("../../tools/cook.ini");
v4k.cook_config("../tools/cook.ini");
-- create 75% sized + MSAAx2 anti-aliased window
v4k.window_create(75.0, v4k.WINDOW_MSAA2)
@ -26,7 +26,7 @@ v4k.audio_play(music, 0);
local cam = v4k.camera()
-- main loop
while v4k.window_swap() == 1 do
while v4k.window_swap() == 1 and v4k.input(v4k.KEY_ESC) == 0 do
-- fps camera
local grabbed = v4k.input(v4k.MOUSE_L) == 1 or v4k.input(v4k.MOUSE_R) == 1
v4k.window_cursor( v4k.ui_active() == 1 or v4k.ui_hover() == 1 and 1 or (not grabbed) )
@ -34,7 +34,7 @@ while v4k.window_swap() == 1 do
local wasdec3 = v4k.vec3(v4k.input(v4k.KEY_D)-v4k.input(v4k.KEY_A),v4k.input(v4k.KEY_E)-(v4k.input(v4k.KEY_C)),v4k.input(v4k.KEY_W)-v4k.input(v4k.KEY_S))
local look2 = v4k.scale2(v4k.vec2(v4k.input_diff(v4k.MOUSE_X), -v4k.input_diff(v4k.MOUSE_Y)), 0.2)
local move3 = v4k.scale3(wasdec3, cam.speed)
v4k.camera_move(cam, wasdec3.x,wasdec3.y,wasdec3.z)
v4k.camera_moveby(cam, wasdec3)
v4k.camera_fps(cam, look2.x,look2.y)
end

View File

@ -1,6 +1,7 @@
import os
from v4k import v4k
v4k.cook_config(b'../tools/cook.ini')
v4k.window_create(75.0, v4k.WINDOW_MSAA2)
v4k.window_title(b'hello Python')
cam = v4k.camera()

Binary file not shown.

View File

@ -3058,26 +3058,6 @@ typedef vec3i guid;
void trap_on_quit(int signal);
void trap_on_abort(int signal);
void trap_on_debug(int signal);
uint16_t lil16(uint16_t n);
uint32_t lil32(uint32_t n);
float lil32f(float n);
uint64_t lil64(uint64_t n);
double lil64f(double n);
uint16_t big16(uint16_t n);
uint32_t big32(uint32_t n);
float big32f(float n);
uint64_t big64(uint64_t n);
double big64f(double n);
uint16_t* lil16p(void *n, int sz);
uint32_t* lil32p(void *n, int sz);
float* lil32pf(void *n, int sz);
uint64_t* lil64p(void *n, int sz);
double* lil64pf(void *n, int sz);
uint16_t* big16p(void *n, int sz);
uint32_t* big32p(void *n, int sz);
float* big32pf(void *n, int sz);
uint64_t* big64p(void *n, int sz);
double* big64pf(void *n, int sz);
int (PANIC)(const char *error, const char *file, int line);
int (PRINTF)(const char *text, const char *stack, const char *file, int line, const char *function);
int (test)(const char *file, int line, const char *expr, bool result);

View File

@ -1,56 +0,0 @@
-- this will run on vanilla luajit.exe, provided that v4k.dll and this file are all present in same folder
local v4k=require('v4k')
-- specify location of cookbook
v4k.cook_config("../../tools/cook.ini");
-- create 75% sized + MSAAx2 anti-aliased window
v4k.window_create(75.0, v4k.WINDOW_MSAA2)
-- set window title
v4k.window_title("hello luajit")
-- config girl
local girl = v4k.model('kgirl/kgirls01.fbx', 0)
local girl_frame = 0
local girl_pivot = v4k.mat44()
v4k.rotationq44(girl_pivot, v4k.eulerq(v4k.vec3(0,0,0)))
v4k.scale44(girl_pivot, 2,2,2)
-- config & play music
local music = v4k.audio_stream('larry.mid') -- 'wrath_of_the_djinn.xm'
v4k.audio_play(music, 0);
-- config camera
local cam = v4k.camera()
-- main loop
while v4k.window_swap() == 1 do
-- fps camera
local grabbed = v4k.input(v4k.MOUSE_L) == 1 or v4k.input(v4k.MOUSE_R) == 1
v4k.window_cursor( v4k.ui_active() == 1 or v4k.ui_hover() == 1 and 1 or (not grabbed) )
if( v4k.window_has_cursor() ~= 1 ) then
local wasdec3 = v4k.vec3(v4k.input(v4k.KEY_D)-v4k.input(v4k.KEY_A),v4k.input(v4k.KEY_E)-(v4k.input(v4k.KEY_C)),v4k.input(v4k.KEY_W)-v4k.input(v4k.KEY_S))
local look2 = v4k.scale2(v4k.vec2(v4k.input_diff(v4k.MOUSE_X), -v4k.input_diff(v4k.MOUSE_Y)), 0.2)
local move3 = v4k.scale3(wasdec3, cam.speed)
v4k.camera_move(cam, wasdec3.x,wasdec3.y,wasdec3.z)
v4k.camera_fps(cam, look2.x,look2.y)
end
-- draw grid/axis
v4k.ddraw_grid(0)
v4k.ddraw_flush()
-- animate girl
local delta = v4k.window_delta() * 30 -- 30fps anim
girl_frame = v4k.model_animate(girl, girl_frame + delta)
-- draw girl
v4k.model_render(girl, cam.proj, cam.view, girl_pivot, 0)
-- showcase ui
if v4k.ui_panel("luajit", 0) == 1 then
v4k.ui_panel_end()
end
end

View File

@ -1,17 +0,0 @@
#!/bin/bash 2>nul || goto :windows
sh ../../MAKE.bat dll
sh ../../MAKE.bat bind
./luajit.osx hello.lua
./luajit.linux hello.lua
python hello.py
exit
:windows
call ..\..\make.bat dll
call ..\..\make.bat bind
luajit hello.lua
python hello.py

View File

@ -17792,28 +17792,6 @@ API void trap_on_quit(int signal); // helper util
API void trap_on_abort(int signal); // helper util
API void trap_on_debug(int signal); // helper util
API uint16_t lil16(uint16_t n); // swap16 as lil
API uint32_t lil32(uint32_t n); // swap32 as lil
API float lil32f(float n); // swap32 as lil
API uint64_t lil64(uint64_t n); // swap64 as lil
API double lil64f(double n); // swap64 as lil
API uint16_t big16(uint16_t n); // swap16 as big
API uint32_t big32(uint32_t n); // swap32 as big
API float big32f(float n); // swap32 as big
API uint64_t big64(uint64_t n); // swap64 as big
API double big64f(double n); // swap64 as big
API uint16_t* lil16p(void *n, int sz);
API uint32_t* lil32p(void *n, int sz);
API float* lil32pf(void *n, int sz);
API uint64_t* lil64p(void *n, int sz);
API double* lil64pf(void *n, int sz);
API uint16_t* big16p(void *n, int sz);
API uint32_t* big32p(void *n, int sz);
API float* big32pf(void *n, int sz);
API uint64_t* big64p(void *n, int sz);
API double* big64pf(void *n, int sz);
#define hton16 big16
#define ntoh16 big16
#define hton32 big32
@ -77581,7 +77559,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#line 0
#undef error
#undef DEBUG
#define MA_DEBUG_OUTPUT
// #define MA_DEBUG_OUTPUT
// #define MA_USE_AUDIO_WORKLETS
#line 1 "3rd_sts_mixer.h"
///////////////////////////////////////////////////////////////////////////////

View File

@ -112,7 +112,7 @@ errno_t fopen_s(
{{FILE:3rd_stb_vorbis.h}}
#undef error
#undef DEBUG
#define MA_DEBUG_OUTPUT
// #define MA_DEBUG_OUTPUT
// #define MA_USE_AUDIO_WORKLETS
{{FILE:3rd_sts_mixer.h}}
{{FILE:3rd_miniaudio.h}}

View File

@ -55,28 +55,6 @@ API void trap_on_quit(int signal); // helper util
API void trap_on_abort(int signal); // helper util
API void trap_on_debug(int signal); // helper util
API uint16_t lil16(uint16_t n); // swap16 as lil
API uint32_t lil32(uint32_t n); // swap32 as lil
API float lil32f(float n); // swap32 as lil
API uint64_t lil64(uint64_t n); // swap64 as lil
API double lil64f(double n); // swap64 as lil
API uint16_t big16(uint16_t n); // swap16 as big
API uint32_t big32(uint32_t n); // swap32 as big
API float big32f(float n); // swap32 as big
API uint64_t big64(uint64_t n); // swap64 as big
API double big64f(double n); // swap64 as big
API uint16_t* lil16p(void *n, int sz);
API uint32_t* lil32p(void *n, int sz);
API float* lil32pf(void *n, int sz);
API uint64_t* lil64p(void *n, int sz);
API double* lil64pf(void *n, int sz);
API uint16_t* big16p(void *n, int sz);
API uint32_t* big32p(void *n, int sz);
API float* big32pf(void *n, int sz);
API uint64_t* big64p(void *n, int sz);
API double* big64pf(void *n, int sz);
#define hton16 big16
#define ntoh16 big16
#define hton32 big32

View File

@ -59491,7 +59491,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#line 0
#undef error
#undef DEBUG
#define MA_DEBUG_OUTPUT
// #define MA_DEBUG_OUTPUT
// #define MA_USE_AUDIO_WORKLETS
#line 1 "3rd_sts_mixer.h"
///////////////////////////////////////////////////////////////////////////////

View File

@ -3859,28 +3859,6 @@ API void trap_on_quit(int signal); // helper util
API void trap_on_abort(int signal); // helper util
API void trap_on_debug(int signal); // helper util
API uint16_t lil16(uint16_t n); // swap16 as lil
API uint32_t lil32(uint32_t n); // swap32 as lil
API float lil32f(float n); // swap32 as lil
API uint64_t lil64(uint64_t n); // swap64 as lil
API double lil64f(double n); // swap64 as lil
API uint16_t big16(uint16_t n); // swap16 as big
API uint32_t big32(uint32_t n); // swap32 as big
API float big32f(float n); // swap32 as big
API uint64_t big64(uint64_t n); // swap64 as big
API double big64f(double n); // swap64 as big
API uint16_t* lil16p(void *n, int sz);
API uint32_t* lil32p(void *n, int sz);
API float* lil32pf(void *n, int sz);
API uint64_t* lil64p(void *n, int sz);
API double* lil64pf(void *n, int sz);
API uint16_t* big16p(void *n, int sz);
API uint32_t* big32p(void *n, int sz);
API float* big32pf(void *n, int sz);
API uint64_t* big64p(void *n, int sz);
API double* big64pf(void *n, int sz);
#define hton16 big16
#define ntoh16 big16
#define hton32 big32