main
Dominik Madarász 2023-12-01 23:12:02 +01:00
parent 36309b841c
commit f61b4c6653
16 changed files with 120 additions and 110 deletions

View File

@ -322,6 +322,7 @@ if "%1"=="fwk" (
git fetch
git reset --hard origin/main
popd
call make.bat split
call MAKE.bat fwk_prep
start "" fwk_diff.WinMerge
exit /b
@ -338,12 +339,12 @@ if "%1"=="gwk" (
copy/y ..\fwk-mirror\engine\fwk _fwk\engine\fwk
copy/y ..\fwk-mirror\engine\split\*.inl _fwk\engine\split\
rem copy/y ..\fwk-mirror\engine\split\3rd_*.c _fwk\engine\split\
make back
exit /b
)
if "%1"=="fwk_prep" (
call make.bat split
if not exist "_fwk" mkdir "_fwk"
if not exist "_fwk\demos" mkdir "_fwk\demos"
if not exist "_fwk\tools" mkdir "_fwk\tools"
@ -453,8 +454,8 @@ if "%1"=="back" (
rem tools\fwkren.exe tools\cook.ini to
call make.bat join
call make.bat amalgamation
rem call make.bat join
rem call make.bat amalgamation
echo All done.
endlocal

View File

@ -3222,7 +3222,7 @@ int u_coefficients_sh;
size_t strlcpy(char *dst, const char *src, size_t dstcap);
char** strsplit(const char *string, const char *delimiters);
char* strjoin(char** list, const char *separator);
char * string8(const wchar_t *str);
char* string8(const wchar_t *str);
uint32_t* string32( const char *utf8 );
const char* codepoint_to_utf8(unsigned cp);
unsigned intern( const char *string );
@ -3341,7 +3341,7 @@ unsigned play;
bool paused;
struct atlas_t *a;
} sprite_t;
enum { OBJTYPE_sprite_t = 10 }; typedef struct { unsigned static_assert_on_L__LINE__ : !!(10 <= 255); } static_assert_on_Lconcat(_L,3959)___COUNTER__; typedef struct { unsigned static_assert_on_L__LINE__ : !!(sizeof(sprite_t)); } static_assert_on_Lconcat(_L,3959)___COUNTER__;;
enum { OBJTYPE_sprite_t = 10 }; typedef struct { unsigned static_assert_on_L__LINE__ : !!(10 <= 255); } static_assert_on_Lconcat(_L,3962)___COUNTER__; typedef struct { unsigned static_assert_on_L__LINE__ : !!(sizeof(sprite_t)); } static_assert_on_Lconcat(_L,3962)___COUNTER__;;
void sprite_ctor(sprite_t *s);
void sprite_dtor(sprite_t *s);
void sprite_tick(sprite_t *s);

View File

@ -14068,6 +14068,10 @@ extern "C" {
#define COOK_DISABLED 0 // ifdef(nocook, 1, 0) ///+
#endif
#ifndef ENABLE_RPMALLOC
#define ENABLE_RPMALLOC 0 // ifdef(tcc, 0, 1) // forbidden on tcc because of lacking TLS support
#endif
// -----------------------------------------------------------------------------
// if/n/def hell
@ -15368,7 +15372,6 @@ API extern int (*obj_init[256])(); ///-
API extern int (*obj_quit[256])(); ///-
API extern int (*obj_tick[256])(); ///-
API extern int (*obj_draw[256])(); ///-
API extern int (*obj_lerp[256])(); ///-
API extern int (*obj_aabb[256])(); ///-
@ -15376,7 +15379,7 @@ API extern int (*obj_edit[256])(); ///-
API extern int (*obj_menu[256])(); ///-
API extern char* (*obj_icon[256])(); ///-
API extern const char*OBJTYPES[256]; /// -
API extern const char*OBJTYPES[256]; ///-
// ----------------------------------------------------------------------------
// core
@ -17735,7 +17738,7 @@ typedef struct camera_t {
vec2 last_look; vec3 last_move; // used for friction and damping
bool damping;
bool orthographic; // 0 perspective, 1 orthographic; when ortho: dimetric[if pitch == -30o], isometric[if pitch == 35.264o]
bool orthographic; // 0 perspective, 1 orthographic; when ortho: dimetric[if pitch == -30º], isometric[if pitch == 35.264º]
float distance; // distance to pivot, when orbiting
// vec2 polarity = { +1,-1 }; // @todo
// vec2 sensitivity = { 2,2 }; // @todo
@ -17935,7 +17938,7 @@ API array(char*) strsplit(const char *string, const char *delimiters);
/// > char *joint = strjoin(tokens, "+"); // joint="hello+world"
API char* strjoin(array(char*) list, const char *separator);
API char * string8(const wchar_t *str); /// convert from wchar16(win) to utf8/ascii
API char* string8(const wchar_t *str); /// convert from wchar16(win) to utf8/ascii
API array(uint32_t) string32( const char *utf8 ); /// convert from utf8 to utf32
API const char* codepoint_to_utf8(unsigned cp);
@ -241313,7 +241316,7 @@ static char *ui_filter = 0;
// - rlyeh, public domain
//
// changelog:
// - ported to FWK api
// - ported to V4K api
// - namespaced symbols
// - diverse win32 fixes
// - adaptive cols/rows
@ -241490,7 +241493,7 @@ static void browser_reload_directory_content(struct browser *browser, const char
// remove last '/' if present. ok to overwrite absolute var, file_*() API returns writeable strings.
char *dir = absolute; if( dir[ strlen(dir) - 1 ] == '/' ) dir[ strlen(dir) - 1 ] = '\0';
dir = file_name(dir); // /home/rlyeh/prj/fwk/art -> art
dir = file_name(dir); // /home/rlyeh/prj/v4k/art -> art
BROWSER_PRINTF("%s\n", dir);
if( dir[0] != '.' ) // skip special files, folders and internal files like .git or .art.zip
@ -378856,10 +378859,10 @@ void v4k_init() {
// - network replication can be done by external tools by comparing the filesystems and by sending the resulting diff zipped
//
// ## Editor roadmap
// - Gizmos?, scene tree, property editor?, load/save?, undo/redo?, copy/paste, on/off (vis,tick,ddraw,log), vcs.
// - Scenenode pass: node singleton display, node console, node labels, node outlines?.<!-- node == gameobj ? -->
// - Render pass: billboards?, materials, un/lit, cast shadows, wireframe, skybox?/mie?, fog/atmosphere
// - Level pass: volumes, triggers, platforms, level streaming, collide?, physics
// - Gizmos✱, scene tree, property editor✱, load/save✱, undo/redo✱, copy/paste, on/off (vis,tick,ddraw,log), vcs.
// - Scenenode pass: node singleton display, node console, node labels, node outlines.<!-- node == gameobj ? -->
// - Render pass: billboards✱, materials, un/lit, cast shadows, wireframe, skybox✱/mie✱, fog/atmosphere
// - Level pass: volumes, triggers, platforms, level streaming, collide, physics
// - Edit pass: Procedural content, brushes, noise and CSG.
// - GUI pass: timeline and data tracks, node graphs. <!-- worthy: will be reused into materials, animgraphs and blueprints -->
@ -379057,7 +379060,7 @@ int editor_filter() {
}
return editor.filter;
}
}
static
int editor_select_(void *o, const char *mask) {
@ -379081,7 +379084,7 @@ void editor_unselect() { // same than editor_select("!**");
for each_map_ptr(*editor_selected_map(), void*,o, int, k) {
if( *k ) *k = 0;
}
}
}
void editor_select_aabb(aabb box) {
int is_inv = input_held(KEY_CTRL);
@ -379122,7 +379125,7 @@ void editor_selectgroup(obj *first, obj *last) {
}
}
}
}
}
static obj *find_any_selected_(obj *o) {
if( editor_selected(o) ) return o;
@ -379138,7 +379141,7 @@ void* editor_first_selected() {
obj *oo = find_any_selected_(o);
// if( oo ) printf("1st found: %s\n", obj_name(oo));
if( oo ) return oo;
}
}
return 0;
}
@ -379149,7 +379152,7 @@ static obj *find_last_selected_(obj *o) {
obj *ooo = find_last_selected_(oo);
if( ooo )
last = ooo;
}
}
return last;
}
void* editor_last_selected() {
@ -379158,7 +379161,7 @@ void* editor_last_selected() {
obj *oo = find_last_selected_(o);
// if( oo ) printf("last found: %s\n", obj_name(oo));
if( oo ) last = oo;
}
}
return last;
}
@ -379168,7 +379171,7 @@ void editor_addtoworld(obj *o) {
set_find_or_add(editor.world, o);
for each_objchild(o, obj*, oo) {
editor_addtoworld(oo);
}
}
}
void editor_watch(const void *o) {
@ -379501,7 +379504,7 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
if( obj_hasmethod(*o,edit) ) {
obj_edit(*o);
}
}
}
// draw silhouettes
sprite_flush();
@ -379513,8 +379516,8 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
}
if( obj_hasmethod(*o,edit) ) {
obj_edit(*o);
}
}
}
}
sprite_flush();
fx_end();
@ -379574,7 +379577,7 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
editor_setpopup(o, 0);
}
}
}
}
// draw subeditors

View File

@ -2,7 +2,7 @@
// - rlyeh, public domain
//
// changelog:
// - ported to FWK api
// - ported to V4K api
// - namespaced symbols
// - diverse win32 fixes
// - adaptive cols/rows
@ -179,7 +179,7 @@ static void browser_reload_directory_content(struct browser *browser, const char
// remove last '/' if present. ok to overwrite absolute var, file_*() API returns writeable strings.
char *dir = absolute; if( dir[ strlen(dir) - 1 ] == '/' ) dir[ strlen(dir) - 1 ] = '\0';
dir = file_name(dir); // /home/rlyeh/prj/fwk/art -> art
dir = file_name(dir); // /home/rlyeh/prj/v4k/art -> art
BROWSER_PRINTF("%s\n", dir);
if( dir[0] != '.' ) // skip special files, folders and internal files like .git or .art.zip

View File

@ -37,6 +37,10 @@
#define COOK_DISABLED 0 // ifdef(nocook, 1, 0) ///+
#endif
#ifndef ENABLE_RPMALLOC
#define ENABLE_RPMALLOC 0 // ifdef(tcc, 0, 1) // forbidden on tcc because of lacking TLS support
#endif
// -----------------------------------------------------------------------------
// if/n/def hell

View File

@ -6,10 +6,10 @@
// - network replication can be done by external tools by comparing the filesystems and by sending the resulting diff zipped
//
// ## Editor roadmap
// - Gizmos?, scene tree, property editor?, load/save?, undo/redo?, copy/paste, on/off (vis,tick,ddraw,log), vcs.
// - Scenenode pass: node singleton display, node console, node labels, node outlines?.<!-- node == gameobj ? -->
// - Render pass: billboards?, materials, un/lit, cast shadows, wireframe, skybox?/mie?, fog/atmosphere
// - Level pass: volumes, triggers, platforms, level streaming, collide?, physics
// - Gizmos✱, scene tree, property editor✱, load/save✱, undo/redo✱, copy/paste, on/off (vis,tick,ddraw,log), vcs.
// - Scenenode pass: node singleton display, node console, node labels, node outlines.<!-- node == gameobj ? -->
// - Render pass: billboards✱, materials, un/lit, cast shadows, wireframe, skybox✱/mie✱, fog/atmosphere
// - Level pass: volumes, triggers, platforms, level streaming, collide, physics
// - Edit pass: Procedural content, brushes, noise and CSG.
// - GUI pass: timeline and data tracks, node graphs. <!-- worthy: will be reused into materials, animgraphs and blueprints -->
@ -207,7 +207,7 @@ int editor_filter() {
}
return editor.filter;
}
}
static
int editor_select_(void *o, const char *mask) {
@ -231,7 +231,7 @@ void editor_unselect() { // same than editor_select("!**");
for each_map_ptr(*editor_selected_map(), void*,o, int, k) {
if( *k ) *k = 0;
}
}
}
void editor_select_aabb(aabb box) {
int is_inv = input_held(KEY_CTRL);
@ -272,7 +272,7 @@ void editor_selectgroup(obj *first, obj *last) {
}
}
}
}
}
static obj *find_any_selected_(obj *o) {
if( editor_selected(o) ) return o;
@ -288,7 +288,7 @@ void* editor_first_selected() {
obj *oo = find_any_selected_(o);
// if( oo ) printf("1st found: %s\n", obj_name(oo));
if( oo ) return oo;
}
}
return 0;
}
@ -299,7 +299,7 @@ static obj *find_last_selected_(obj *o) {
obj *ooo = find_last_selected_(oo);
if( ooo )
last = ooo;
}
}
return last;
}
void* editor_last_selected() {
@ -308,7 +308,7 @@ void* editor_last_selected() {
obj *oo = find_last_selected_(o);
// if( oo ) printf("last found: %s\n", obj_name(oo));
if( oo ) last = oo;
}
}
return last;
}
@ -318,7 +318,7 @@ void editor_addtoworld(obj *o) {
set_find_or_add(editor.world, o);
for each_objchild(o, obj*, oo) {
editor_addtoworld(oo);
}
}
}
void editor_watch(const void *o) {
@ -651,7 +651,7 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
if( obj_hasmethod(*o,edit) ) {
obj_edit(*o);
}
}
}
// draw silhouettes
sprite_flush();
@ -663,8 +663,8 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
}
if( obj_hasmethod(*o,edit) ) {
obj_edit(*o);
}
}
}
}
sprite_flush();
fx_end();
@ -724,7 +724,7 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
editor_setpopup(o, 0);
}
}
}
}
// draw subeditors

View File

@ -208,7 +208,6 @@ API extern int (*obj_init[256])(); ///-
API extern int (*obj_quit[256])(); ///-
API extern int (*obj_tick[256])(); ///-
API extern int (*obj_draw[256])(); ///-
API extern int (*obj_lerp[256])(); ///-
API extern int (*obj_aabb[256])(); ///-
@ -216,7 +215,7 @@ API extern int (*obj_edit[256])(); ///-
API extern int (*obj_menu[256])(); ///-
API extern char* (*obj_icon[256])(); ///-
API extern const char*OBJTYPES[256]; /// -
API extern const char*OBJTYPES[256]; ///-
// ----------------------------------------------------------------------------
// core

View File

@ -15,7 +15,7 @@ typedef struct camera_t {
vec2 last_look; vec3 last_move; // used for friction and damping
bool damping;
bool orthographic; // 0 perspective, 1 orthographic; when ortho: dimetric[if pitch == -30o], isometric[if pitch == 35.264o]
bool orthographic; // 0 perspective, 1 orthographic; when ortho: dimetric[if pitch == -30º], isometric[if pitch == 35.264º]
float distance; // distance to pivot, when orbiting
// vec2 polarity = { +1,-1 }; // @todo
// vec2 sensitivity = { 2,2 }; // @todo

View File

@ -73,7 +73,7 @@ API array(char*) strsplit(const char *string, const char *delimiters);
/// > char *joint = strjoin(tokens, "+"); // joint="hello+world"
API char* strjoin(array(char*) list, const char *separator);
API char * string8(const wchar_t *str); /// convert from wchar16(win) to utf8/ascii
API char* string8(const wchar_t *str); /// convert from wchar16(win) to utf8/ascii
API array(uint32_t) string32( const char *utf8 ); /// convert from utf8 to utf32
API const char* codepoint_to_utf8(unsigned cp);

View File

@ -222477,7 +222477,7 @@ static char *ui_filter = 0;
// - rlyeh, public domain
//
// changelog:
// - ported to FWK api
// - ported to V4K api
// - namespaced symbols
// - diverse win32 fixes
// - adaptive cols/rows
@ -222654,7 +222654,7 @@ static void browser_reload_directory_content(struct browser *browser, const char
// remove last '/' if present. ok to overwrite absolute var, file_*() API returns writeable strings.
char *dir = absolute; if( dir[ strlen(dir) - 1 ] == '/' ) dir[ strlen(dir) - 1 ] = '\0';
dir = file_name(dir); // /home/rlyeh/prj/fwk/art -> art
dir = file_name(dir); // /home/rlyeh/prj/v4k/art -> art
BROWSER_PRINTF("%s\n", dir);
if( dir[0] != '.' ) // skip special files, folders and internal files like .git or .art.zip

View File

@ -29188,10 +29188,10 @@ void v4k_init() {
// - network replication can be done by external tools by comparing the filesystems and by sending the resulting diff zipped
//
// ## Editor roadmap
// - Gizmos?, scene tree, property editor?, load/save?, undo/redo?, copy/paste, on/off (vis,tick,ddraw,log), vcs.
// - Scenenode pass: node singleton display, node console, node labels, node outlines?.<!-- node == gameobj ? -->
// - Render pass: billboards?, materials, un/lit, cast shadows, wireframe, skybox?/mie?, fog/atmosphere
// - Level pass: volumes, triggers, platforms, level streaming, collide?, physics
// - Gizmos✱, scene tree, property editor✱, load/save✱, undo/redo✱, copy/paste, on/off (vis,tick,ddraw,log), vcs.
// - Scenenode pass: node singleton display, node console, node labels, node outlines.<!-- node == gameobj ? -->
// - Render pass: billboards✱, materials, un/lit, cast shadows, wireframe, skybox✱/mie✱, fog/atmosphere
// - Level pass: volumes, triggers, platforms, level streaming, collide, physics
// - Edit pass: Procedural content, brushes, noise and CSG.
// - GUI pass: timeline and data tracks, node graphs. <!-- worthy: will be reused into materials, animgraphs and blueprints -->
@ -29389,7 +29389,7 @@ int editor_filter() {
}
return editor.filter;
}
}
static
int editor_select_(void *o, const char *mask) {
@ -29413,7 +29413,7 @@ void editor_unselect() { // same than editor_select("!**");
for each_map_ptr(*editor_selected_map(), void*,o, int, k) {
if( *k ) *k = 0;
}
}
}
void editor_select_aabb(aabb box) {
int is_inv = input_held(KEY_CTRL);
@ -29454,7 +29454,7 @@ void editor_selectgroup(obj *first, obj *last) {
}
}
}
}
}
static obj *find_any_selected_(obj *o) {
if( editor_selected(o) ) return o;
@ -29470,7 +29470,7 @@ void* editor_first_selected() {
obj *oo = find_any_selected_(o);
// if( oo ) printf("1st found: %s\n", obj_name(oo));
if( oo ) return oo;
}
}
return 0;
}
@ -29481,7 +29481,7 @@ static obj *find_last_selected_(obj *o) {
obj *ooo = find_last_selected_(oo);
if( ooo )
last = ooo;
}
}
return last;
}
void* editor_last_selected() {
@ -29490,7 +29490,7 @@ void* editor_last_selected() {
obj *oo = find_last_selected_(o);
// if( oo ) printf("last found: %s\n", obj_name(oo));
if( oo ) last = oo;
}
}
return last;
}
@ -29500,7 +29500,7 @@ void editor_addtoworld(obj *o) {
set_find_or_add(editor.world, o);
for each_objchild(o, obj*, oo) {
editor_addtoworld(oo);
}
}
}
void editor_watch(const void *o) {
@ -29833,7 +29833,7 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
if( obj_hasmethod(*o,edit) ) {
obj_edit(*o);
}
}
}
// draw silhouettes
sprite_flush();
@ -29845,8 +29845,8 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
}
if( obj_hasmethod(*o,edit) ) {
obj_edit(*o);
}
}
}
}
sprite_flush();
fx_end();
@ -29906,7 +29906,7 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
editor_setpopup(o, 0);
}
}
}
}
// draw subeditors

View File

@ -135,6 +135,10 @@ extern "C" {
#define COOK_DISABLED 0 // ifdef(nocook, 1, 0) ///+
#endif
#ifndef ENABLE_RPMALLOC
#define ENABLE_RPMALLOC 0 // ifdef(tcc, 0, 1) // forbidden on tcc because of lacking TLS support
#endif
// -----------------------------------------------------------------------------
// if/n/def hell
@ -1435,7 +1439,6 @@ API extern int (*obj_init[256])(); ///-
API extern int (*obj_quit[256])(); ///-
API extern int (*obj_tick[256])(); ///-
API extern int (*obj_draw[256])(); ///-
API extern int (*obj_lerp[256])(); ///-
API extern int (*obj_aabb[256])(); ///-
@ -1443,7 +1446,7 @@ API extern int (*obj_edit[256])(); ///-
API extern int (*obj_menu[256])(); ///-
API extern char* (*obj_icon[256])(); ///-
API extern const char*OBJTYPES[256]; /// -
API extern const char*OBJTYPES[256]; ///-
// ----------------------------------------------------------------------------
// core
@ -3802,7 +3805,7 @@ typedef struct camera_t {
vec2 last_look; vec3 last_move; // used for friction and damping
bool damping;
bool orthographic; // 0 perspective, 1 orthographic; when ortho: dimetric[if pitch == -30o], isometric[if pitch == 35.264o]
bool orthographic; // 0 perspective, 1 orthographic; when ortho: dimetric[if pitch == -30º], isometric[if pitch == 35.264º]
float distance; // distance to pivot, when orbiting
// vec2 polarity = { +1,-1 }; // @todo
// vec2 sensitivity = { 2,2 }; // @todo
@ -4002,7 +4005,7 @@ API array(char*) strsplit(const char *string, const char *delimiters);
/// > char *joint = strjoin(tokens, "+"); // joint="hello+world"
API char* strjoin(array(char*) list, const char *separator);
API char * string8(const wchar_t *str); /// convert from wchar16(win) to utf8/ascii
API char* string8(const wchar_t *str); /// convert from wchar16(win) to utf8/ascii
API array(uint32_t) string32( const char *utf8 ); /// convert from utf8 to utf32
API const char* codepoint_to_utf8(unsigned cp);