sync depot

main
Dominik Madarász 2023-10-10 10:52:29 +02:00
parent 15b3063733
commit b2d7bcc8b2
22 changed files with 136 additions and 202 deletions

@ -1 +1 @@
Subproject commit 5daf19e6b5579dfba7d5bc83d4b2c7db02e4c3a0
Subproject commit be43196a3d33412a5dbad92983af7e149b1b066d

Binary file not shown.

Binary file not shown.

View File

@ -1,38 +0,0 @@
SIERRA ON-LINE, INC.
3-D Animated Adventure Game Soundtrack Series
===============================================
LEISURE SUIT LARRY III: PASSIONATE PATTI-
IN PURSUIT OF THE PULSATING PECTORALS
"TAWNI AT THE BEACH"
Mike Dana
===============================================
Copyright (c)1989 Sierra On-Line, Inc.
===============================================
GENERAL MIDI VERSION
System Requirements:
- MIDI Playback Software capable of reading Type 1 Standard
MIDI File format
- General MIDI sound device (Wave Table or better recommended)
This Standard MIDI File was recorded directly from Sierra's "Leisure Suit
Larry 3" adventure game. It has been converted from the MT-32 version for
playback on General MIDI sound cards. A Wave Table or better sound card is
highly recommended for optimal playback.
Recorded/converted for General MIDI by Tom Lewandowski.
Address questions or comments to:
QUEST STUDIOS
Tom Lewandowski
tom@queststudios.com
www.QuestStudios.com

Binary file not shown.

View File

@ -1,43 +0,0 @@
QUEST STUDIOS
SOFTWARE SOUNDTRACK SERIES
====================================================
THE SECRET OF MONKEY ISLAND
"INTRODUCTION/OPENING THEMES"
Michael Z. Land
====================================================
Copyright (c)1989 LucasArts Entertainment Co.
====================================================
G E N E R A L M I D I V E R S I O N
System Requirements:
- MIDI Playback Software capable of reading Type 1 Standard
MIDI File format
- General MIDI sound device (Wave Table recommended.)
This Standard MIDI File was recorded directly from LucasFilm Game's
"The Secret of Monkey Island" adventure game. It has been converted
from the MT-32 version for playback on General MIDI sound cards. A
Wave Table sound card is highly recommended for optimal playback.
Recorded/Converted to Standard MIDI File format by Tom Lewandowski.
Address questions or comments to:
QUEST STUDIOS
Tom Lewandowski
tom+di@netnet.net
THE ROLAND MT-32 SOUND MODULE RESOURCE CENTER
THE SIERRA SOUNDTRACK SERIES/SOFTWARE SOUNDTRACK SERIES
http://bayland.net/~tom+di/sierra/roland.html

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +0,0 @@
Licensed under the Public Domain license
Registered Artist(s):
Drozerix

View File

@ -14757,7 +14757,7 @@ API void (map_clear)(map* m);
API char *cc4str(unsigned cc);
API char *cc8str(uint64_t cc);
enum { ///-
enum {
# define _(a,b,c,d,e) cc__##a, cc__##b, cc__##c, cc__##d, cc__##e
cc__1 = '1', _(2,3,4,5,6),_(7,8,9,0,_), cc__ = ' ',
cc__A = 'A', _(B,C,D,E,F),_(G,H,I,J,K),_(L,M,N,O,P),_(Q,R,S,T,U),_(V,W,X,Y,Z),
@ -253747,8 +253747,9 @@ int dir_yield(dir *d, const char *pathfile, char *name, int namelen) {
snprintf(name, namelen, "%s/*", pathfile);
for( HANDLE h = FindFirstFileA(name, &fdata ); h != INVALID_HANDLE_VALUE; ok = (FindClose( h ), h = INVALID_HANDLE_VALUE, 1)) {
for( int next = 1; next; next = FindNextFileA(h, &fdata) != 0 ) {
if( fdata.cFileName[0] == '.' ) continue;
int is_dir = (fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) > 0;
if( is_dir && fdata.cFileName[0] == '.' ) continue;
snprintf(name, namelen, "%s/%s%s", pathfile, fdata.cFileName, is_dir ? "/" : "");
struct stat st; if( !is_dir ) if(stat(name, &st) < 0) continue;
// add
@ -253763,10 +253764,11 @@ int dir_yield(dir *d, const char *pathfile, char *name, int namelen) {
snprintf(name, namelen, "%s/", pathfile);
for( DIR *dir = opendir(name); dir; ok = (closedir(dir), dir = 0, 1)) {
for( struct dirent *ep; (ep = readdir(dir)) != NULL; ) {
if( ep->d_name[0] == '.' ) continue;
snprintf(name, namelen, "%s/%s", pathfile, ep->d_name);
struct stat st; if( stat(name, &st) < 0 ) continue;
DIR *tmp = opendir(/*ep->d_*/name); int is_dir = !!tmp; if(tmp) closedir(tmp);
DIR *tmp = opendir(/*ep->d_*/name); int is_dir = !!tmp; if(tmp) closedir(tmp); // @todo:optimizeme (maybe use stat instead)
if( is_dir && ep->d_name[0] == '.' ) continue;
// add
dir_entry de = { STRDUP(name), is_dir ? 0 : st.st_size, is_dir };
d->entry = (dir_entry*)REALLOC(d->entry, ++d->count * sizeof(dir_entry));
@ -586455,7 +586457,6 @@ int cook_jobs() {
return clampi(num_jobs, 0, cook_disabled?0:max_jobs);
}
void cook_config( const char *pathfile_to_cook_ini ) { // @todo: test run-from-"bin/" case on Linux.
COOK_INI = pathfile_to_cook_ini;
ASSERT( file_exist(COOK_INI) );
@ -587012,36 +587013,30 @@ const char** file_list(const char *cwd, const char *masks) {
}
array_resize(list, 0);//array_free(list);
for each_substring(masks,";",it) {
int recurse = !!strstr(it, "**");
#if is(win32)
char *glob = va("dir %s/b/o:n \"%s\\%s\" 2> NUL", recurse ? "/s":"", cwd, it);
#else // linux, osx
char *glob = va("find %s %s -name \"%s\" | sort", cwd, !recurse ? "-maxdepth 1":"-type f", it);
#endif
for( FILE *in = popen(glob, "r"); in; pclose(in), in = 0) {
char buf[1024], *line = buf;
while( fgets(buf, sizeof(buf), in) ) {
// clean up
if( strstr(line, arg0) ) line = buf + larg0;
if( !memcmp(line, "./", 2) ) line += 2;
int len = strlen(line); while( len > 0 && line[len-1] < 32 ) line[--len] = 0;
if( line[0] == '\0' ) continue;
// do not insert system folders/files
for(int i = 0; i < len; ++i ) if(line[i] == '\\') line[i] = '/';
if( line[0] == '.' ) if( !strcmp(line,".git") || !strcmp(line,".vs") || !strcmp(line,".") || !strcmp(line,"..") ) continue;
if( strstr(line, "/.") ) continue;
dir *d = dir_open(cwd, "rb");
if( d ) {
for( int i = 0; i < dir_count(d); ++i ) {
if( dir_file(d,i) ) {
// dir_name() should return full normalized paths "C:/prj/v4k/demos/art/fx/fxBloom.fs". should exclude system dirs as well
char *entry = dir_name(d,i);
char *fname = file_name(entry);
int allowed = 0;
for each_substring(masks,";",mask) {
allowed |= strmatch(fname, mask);
}
if( !allowed ) continue;
// if( strstr(fname, "/.") ) continue; // @fixme: still needed? useful?
// insert copy
#if is(win32)
char *copy = STRDUP(line); // full path already provided
#else
// while(line[0] == '/') ++line;
char *copy = STRDUP(va("%s%s", cwd, line)); // need to prepend path
#endif
char *copy = STRDUP(entry);
array_push(list, copy);
}
}
dir_close(d);
}
array_push(list, 0); // terminator
return (const char**)list;
}
@ -587578,12 +587573,14 @@ if( found && *found == 0 ) {
base = file_name(pathfile);
if(base[0] == '\0') return 0; // it's a dir
folder = file_path(pathfile);
// make folder variable easier to read in logs: /home/rlyeh/prj/v4k/art/demos/audio/coin.wav -> demos/audio/coin.wav
// static int ART_LEN = 0; do_once ART_LEN = strlen(ART);
// if( !strncmp(folder, ART, ART_LEN) ) {
// folder += ART_LEN;
// }
char* pretty_folder = folder && strlen(folder) >= ART_LEN ? folder + ART_LEN : "";
// ease folders reading by shortening them: /home/rlyeh/prj/v4k/art/demos/audio/coin.wav -> demos/audio/coin.wav
// or C:/prj/v4k/engine/art/fonts/B612-BoldItalic.ttf -> fonts/B612-BoldItalic.ttf
static array(char*) art_paths = 0;
do_once for each_substring(ART,",",stem) array_push(art_paths, STRDUP(stem));
char* pretty_folder = "";
if( folder ) for( int i = 0; i < array_count(art_paths); ++i ) {
if( strbeg(folder, art_paths[i]) ) { pretty_folder = folder + strlen(art_paths[i]); break; }
}
//}
int size = 0;
@ -591809,7 +591806,7 @@ bool invert44(mat44 T, const mat44 M) { // !!! ok, i guess
}
vec4 transform444(const mat44, const vec4);
bool unproject44(vec3 *out, vec3 xyd, vec4 viewport, mat44 mvp) {
bool unproject44(vec3 *out, vec3 xyd, vec4 viewport, mat44 mvp) { // @fixme: this function is broken (verified by @zpl-zak)
// xyd: usually x:mouse_x,y:window_height()-mouse_y,d:0=znear/1=zfar
// src: https://www.khronos.org/opengl/wiki/GluProject_and_gluUnProject_code
mat44 inv_mvp;
@ -600273,7 +600270,7 @@ void camera_fov(camera_t *cam, float fov) {
float DIMETRIC = 30.000f;
float ISOMETRIC = 35.264f;
float aspect = window_width() / ((float)window_height()+!!window_height());
float aspect = window_width() / ((float)window_height()+!window_height());
orthogonal(cam->proj, 45, aspect, -1000, 1000); // why -1000?
// cam->yaw = 45;
cam->pitch = -ISOMETRIC;
@ -601991,7 +601988,7 @@ bool app_open_folder(const char *file) {
#ifdef _WIN32
snprintf(buf, sizeof(buf), "start \"\" \"%s\"", file);
#elif __APPLE__
snprintf(buf, sizeof(buf), "%s \"%s\"", is_directory(file) ? "open" : "open --reveal", file);
snprintf(buf, sizeof(buf), "%s \"%s\"", file_directory(file) ? "open" : "open --reveal", file);
#else
snprintf(buf, sizeof(buf), "xdg-open \"%s\"", file);
#endif
@ -606805,6 +606802,14 @@ char *editor_path(const char *path) {
}
vec3 editor_pick(float mouse_x, float mouse_y) {
#if 0
// unproject 2d coord as 3d coord
camera_t *camera = camera_get_active();
vec3 out, xyd = vec3(mouse_x,window_height()-mouse_y,1); // usually x:mouse_x,y:window_height()-mouse_y,d:0=znear/1=zfar
mat44 mvp, model; identity44(model); multiply44x3(mvp, camera->proj, camera->view, model);
bool ok = unproject44(&out, xyd, vec4(0,0,window_width(),window_height()), mvp);
return out;
#else
// unproject 2d coord as 3d coord
camera_t *camera = camera_get_active();
float x = (2.0f * mouse_x) / window_width() - 1.0f;
@ -606818,6 +606823,7 @@ vec3 editor_pick(float mouse_x, float mouse_y) {
vec4 eye = vec4(p.x, p.y, -1.0, 0.0);
vec4 wld = norm4(transform444(inv_view, eye));
return vec3(wld.x, wld.y, wld.z);
#endif
}
int editor_ui_bits8(const char *label, uint8_t *enabled) { // @to deprecate

View File

@ -1471,8 +1471,9 @@ int dir_yield(dir *d, const char *pathfile, char *name, int namelen) {
snprintf(name, namelen, "%s/*", pathfile);
for( HANDLE h = FindFirstFileA(name, &fdata ); h != INVALID_HANDLE_VALUE; ok = (FindClose( h ), h = INVALID_HANDLE_VALUE, 1)) {
for( int next = 1; next; next = FindNextFileA(h, &fdata) != 0 ) {
if( fdata.cFileName[0] == '.' ) continue;
int is_dir = (fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) > 0;
if( is_dir && fdata.cFileName[0] == '.' ) continue;
snprintf(name, namelen, "%s/%s%s", pathfile, fdata.cFileName, is_dir ? "/" : "");
struct stat st; if( !is_dir ) if(stat(name, &st) < 0) continue;
// add
@ -1487,10 +1488,11 @@ int dir_yield(dir *d, const char *pathfile, char *name, int namelen) {
snprintf(name, namelen, "%s/", pathfile);
for( DIR *dir = opendir(name); dir; ok = (closedir(dir), dir = 0, 1)) {
for( struct dirent *ep; (ep = readdir(dir)) != NULL; ) {
if( ep->d_name[0] == '.' ) continue;
snprintf(name, namelen, "%s/%s", pathfile, ep->d_name);
struct stat st; if( stat(name, &st) < 0 ) continue;
DIR *tmp = opendir(/*ep->d_*/name); int is_dir = !!tmp; if(tmp) closedir(tmp);
DIR *tmp = opendir(/*ep->d_*/name); int is_dir = !!tmp; if(tmp) closedir(tmp); // @todo:optimizeme (maybe use stat instead)
if( is_dir && ep->d_name[0] == '.' ) continue;
// add
dir_entry de = { STRDUP(name), is_dir ? 0 : st.st_size, is_dir };
d->entry = (dir_entry*)REALLOC(d->entry, ++d->count * sizeof(dir_entry));

View File

@ -817,7 +817,6 @@ int cook_jobs() {
return clampi(num_jobs, 0, cook_disabled?0:max_jobs);
}
void cook_config( const char *pathfile_to_cook_ini ) { // @todo: test run-from-"bin/" case on Linux.
COOK_INI = pathfile_to_cook_ini;
ASSERT( file_exist(COOK_INI) );

View File

@ -433,7 +433,7 @@ API void (map_clear)(map* m);
API char *cc4str(unsigned cc);
API char *cc8str(uint64_t cc);
enum { ///-
enum {
# define _(a,b,c,d,e) cc__##a, cc__##b, cc__##c, cc__##d, cc__##e
cc__1 = '1', _(2,3,4,5,6),_(7,8,9,0,_), cc__ = ' ',
cc__A = 'A', _(B,C,D,E,F),_(G,H,I,J,K),_(L,M,N,O,P),_(Q,R,S,T,U),_(V,W,X,Y,Z),

View File

@ -6,6 +6,14 @@ char *editor_path(const char *path) {
}
vec3 editor_pick(float mouse_x, float mouse_y) {
#if 0
// unproject 2d coord as 3d coord
camera_t *camera = camera_get_active();
vec3 out, xyd = vec3(mouse_x,window_height()-mouse_y,1); // usually x:mouse_x,y:window_height()-mouse_y,d:0=znear/1=zfar
mat44 mvp, model; identity44(model); multiply44x3(mvp, camera->proj, camera->view, model);
bool ok = unproject44(&out, xyd, vec4(0,0,window_width(),window_height()), mvp);
return out;
#else
// unproject 2d coord as 3d coord
camera_t *camera = camera_get_active();
float x = (2.0f * mouse_x) / window_width() - 1.0f;
@ -19,6 +27,7 @@ vec3 editor_pick(float mouse_x, float mouse_y) {
vec4 eye = vec4(p.x, p.y, -1.0, 0.0);
vec4 wld = norm4(transform444(inv_view, eye));
return vec3(wld.x, wld.y, wld.z);
#endif
}
int editor_ui_bits8(const char *label, uint8_t *enabled) { // @to deprecate

View File

@ -212,36 +212,30 @@ const char** file_list(const char *cwd, const char *masks) {
}
array_resize(list, 0);//array_free(list);
for each_substring(masks,";",it) {
int recurse = !!strstr(it, "**");
#if is(win32)
char *glob = va("dir %s/b/o:n \"%s\\%s\" 2> NUL", recurse ? "/s":"", cwd, it);
#else // linux, osx
char *glob = va("find %s %s -name \"%s\" | sort", cwd, !recurse ? "-maxdepth 1":"-type f", it);
#endif
for( FILE *in = popen(glob, "r"); in; pclose(in), in = 0) {
char buf[1024], *line = buf;
while( fgets(buf, sizeof(buf), in) ) {
// clean up
if( strstr(line, arg0) ) line = buf + larg0;
if( !memcmp(line, "./", 2) ) line += 2;
int len = strlen(line); while( len > 0 && line[len-1] < 32 ) line[--len] = 0;
if( line[0] == '\0' ) continue;
// do not insert system folders/files
for(int i = 0; i < len; ++i ) if(line[i] == '\\') line[i] = '/';
if( line[0] == '.' ) if( !strcmp(line,".git") || !strcmp(line,".vs") || !strcmp(line,".") || !strcmp(line,"..") ) continue;
if( strstr(line, "/.") ) continue;
dir *d = dir_open(cwd, "rb");
if( d ) {
for( int i = 0; i < dir_count(d); ++i ) {
if( dir_file(d,i) ) {
// dir_name() should return full normalized paths "C:/prj/v4k/demos/art/fx/fxBloom.fs". should exclude system dirs as well
char *entry = dir_name(d,i);
char *fname = file_name(entry);
int allowed = 0;
for each_substring(masks,";",mask) {
allowed |= strmatch(fname, mask);
}
if( !allowed ) continue;
// if( strstr(fname, "/.") ) continue; // @fixme: still needed? useful?
// insert copy
#if is(win32)
char *copy = STRDUP(line); // full path already provided
#else
// while(line[0] == '/') ++line;
char *copy = STRDUP(va("%s%s", cwd, line)); // need to prepend path
#endif
char *copy = STRDUP(entry);
array_push(list, copy);
}
}
dir_close(d);
}
array_push(list, 0); // terminator
return (const char**)list;
}
@ -778,12 +772,14 @@ if( found && *found == 0 ) {
base = file_name(pathfile);
if(base[0] == '\0') return 0; // it's a dir
folder = file_path(pathfile);
// make folder variable easier to read in logs: /home/rlyeh/prj/v4k/art/demos/audio/coin.wav -> demos/audio/coin.wav
// static int ART_LEN = 0; do_once ART_LEN = strlen(ART);
// if( !strncmp(folder, ART, ART_LEN) ) {
// folder += ART_LEN;
// }
char* pretty_folder = folder && strlen(folder) >= ART_LEN ? folder + ART_LEN : "";
// ease folders reading by shortening them: /home/rlyeh/prj/v4k/art/demos/audio/coin.wav -> demos/audio/coin.wav
// or C:/prj/v4k/engine/art/fonts/B612-BoldItalic.ttf -> fonts/B612-BoldItalic.ttf
static array(char*) art_paths = 0;
do_once for each_substring(ART,",",stem) array_push(art_paths, STRDUP(stem));
char* pretty_folder = "";
if( folder ) for( int i = 0; i < array_count(art_paths); ++i ) {
if( strbeg(folder, art_paths[i]) ) { pretty_folder = folder + strlen(art_paths[i]); break; }
}
//}
int size = 0;

View File

@ -821,7 +821,7 @@ bool invert44(mat44 T, const mat44 M) { // !!! ok, i guess
}
vec4 transform444(const mat44, const vec4);
bool unproject44(vec3 *out, vec3 xyd, vec4 viewport, mat44 mvp) {
bool unproject44(vec3 *out, vec3 xyd, vec4 viewport, mat44 mvp) { // @fixme: this function is broken (verified by @zpl-zak)
// xyd: usually x:mouse_x,y:window_height()-mouse_y,d:0=znear/1=zfar
// src: https://www.khronos.org/opengl/wiki/GluProject_and_gluUnProject_code
mat44 inv_mvp;

View File

@ -109,7 +109,7 @@ void camera_fov(camera_t *cam, float fov) {
float DIMETRIC = 30.000f;
float ISOMETRIC = 35.264f;
float aspect = window_width() / ((float)window_height()+!!window_height());
float aspect = window_width() / ((float)window_height()+!window_height());
orthogonal(cam->proj, 45, aspect, -1000, 1000); // why -1000?
// cam->yaw = 45;
cam->pitch = -ISOMETRIC;

View File

@ -823,7 +823,7 @@ bool app_open_folder(const char *file) {
#ifdef _WIN32
snprintf(buf, sizeof(buf), "start \"\" \"%s\"", file);
#elif __APPLE__
snprintf(buf, sizeof(buf), "%s \"%s\"", is_directory(file) ? "open" : "open --reveal", file);
snprintf(buf, sizeof(buf), "%s \"%s\"", file_directory(file) ? "open" : "open --reveal", file);
#else
snprintf(buf, sizeof(buf), "xdg-open \"%s\"", file);
#endif

View File

@ -235686,8 +235686,9 @@ int dir_yield(dir *d, const char *pathfile, char *name, int namelen) {
snprintf(name, namelen, "%s/*", pathfile);
for( HANDLE h = FindFirstFileA(name, &fdata ); h != INVALID_HANDLE_VALUE; ok = (FindClose( h ), h = INVALID_HANDLE_VALUE, 1)) {
for( int next = 1; next; next = FindNextFileA(h, &fdata) != 0 ) {
if( fdata.cFileName[0] == '.' ) continue;
int is_dir = (fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) > 0;
if( is_dir && fdata.cFileName[0] == '.' ) continue;
snprintf(name, namelen, "%s/%s%s", pathfile, fdata.cFileName, is_dir ? "/" : "");
struct stat st; if( !is_dir ) if(stat(name, &st) < 0) continue;
// add
@ -235702,10 +235703,11 @@ int dir_yield(dir *d, const char *pathfile, char *name, int namelen) {
snprintf(name, namelen, "%s/", pathfile);
for( DIR *dir = opendir(name); dir; ok = (closedir(dir), dir = 0, 1)) {
for( struct dirent *ep; (ep = readdir(dir)) != NULL; ) {
if( ep->d_name[0] == '.' ) continue;
snprintf(name, namelen, "%s/%s", pathfile, ep->d_name);
struct stat st; if( stat(name, &st) < 0 ) continue;
DIR *tmp = opendir(/*ep->d_*/name); int is_dir = !!tmp; if(tmp) closedir(tmp);
DIR *tmp = opendir(/*ep->d_*/name); int is_dir = !!tmp; if(tmp) closedir(tmp); // @todo:optimizeme (maybe use stat instead)
if( is_dir && ep->d_name[0] == '.' ) continue;
// add
dir_entry de = { STRDUP(name), is_dir ? 0 : st.st_size, is_dir };
d->entry = (dir_entry*)REALLOC(d->entry, ++d->count * sizeof(dir_entry));

View File

@ -4631,7 +4631,6 @@ int cook_jobs() {
return clampi(num_jobs, 0, cook_disabled?0:max_jobs);
}
void cook_config( const char *pathfile_to_cook_ini ) { // @todo: test run-from-"bin/" case on Linux.
COOK_INI = pathfile_to_cook_ini;
ASSERT( file_exist(COOK_INI) );
@ -5188,36 +5187,30 @@ const char** file_list(const char *cwd, const char *masks) {
}
array_resize(list, 0);//array_free(list);
for each_substring(masks,";",it) {
int recurse = !!strstr(it, "**");
#if is(win32)
char *glob = va("dir %s/b/o:n \"%s\\%s\" 2> NUL", recurse ? "/s":"", cwd, it);
#else // linux, osx
char *glob = va("find %s %s -name \"%s\" | sort", cwd, !recurse ? "-maxdepth 1":"-type f", it);
#endif
for( FILE *in = popen(glob, "r"); in; pclose(in), in = 0) {
char buf[1024], *line = buf;
while( fgets(buf, sizeof(buf), in) ) {
// clean up
if( strstr(line, arg0) ) line = buf + larg0;
if( !memcmp(line, "./", 2) ) line += 2;
int len = strlen(line); while( len > 0 && line[len-1] < 32 ) line[--len] = 0;
if( line[0] == '\0' ) continue;
// do not insert system folders/files
for(int i = 0; i < len; ++i ) if(line[i] == '\\') line[i] = '/';
if( line[0] == '.' ) if( !strcmp(line,".git") || !strcmp(line,".vs") || !strcmp(line,".") || !strcmp(line,"..") ) continue;
if( strstr(line, "/.") ) continue;
dir *d = dir_open(cwd, "rb");
if( d ) {
for( int i = 0; i < dir_count(d); ++i ) {
if( dir_file(d,i) ) {
// dir_name() should return full normalized paths "C:/prj/v4k/demos/art/fx/fxBloom.fs". should exclude system dirs as well
char *entry = dir_name(d,i);
char *fname = file_name(entry);
int allowed = 0;
for each_substring(masks,";",mask) {
allowed |= strmatch(fname, mask);
}
if( !allowed ) continue;
// if( strstr(fname, "/.") ) continue; // @fixme: still needed? useful?
// insert copy
#if is(win32)
char *copy = STRDUP(line); // full path already provided
#else
// while(line[0] == '/') ++line;
char *copy = STRDUP(va("%s%s", cwd, line)); // need to prepend path
#endif
char *copy = STRDUP(entry);
array_push(list, copy);
}
}
dir_close(d);
}
array_push(list, 0); // terminator
return (const char**)list;
}
@ -5754,12 +5747,14 @@ if( found && *found == 0 ) {
base = file_name(pathfile);
if(base[0] == '\0') return 0; // it's a dir
folder = file_path(pathfile);
// make folder variable easier to read in logs: /home/rlyeh/prj/v4k/art/demos/audio/coin.wav -> demos/audio/coin.wav
// static int ART_LEN = 0; do_once ART_LEN = strlen(ART);
// if( !strncmp(folder, ART, ART_LEN) ) {
// folder += ART_LEN;
// }
char* pretty_folder = folder && strlen(folder) >= ART_LEN ? folder + ART_LEN : "";
// ease folders reading by shortening them: /home/rlyeh/prj/v4k/art/demos/audio/coin.wav -> demos/audio/coin.wav
// or C:/prj/v4k/engine/art/fonts/B612-BoldItalic.ttf -> fonts/B612-BoldItalic.ttf
static array(char*) art_paths = 0;
do_once for each_substring(ART,",",stem) array_push(art_paths, STRDUP(stem));
char* pretty_folder = "";
if( folder ) for( int i = 0; i < array_count(art_paths); ++i ) {
if( strbeg(folder, art_paths[i]) ) { pretty_folder = folder + strlen(art_paths[i]); break; }
}
//}
int size = 0;
@ -9985,7 +9980,7 @@ bool invert44(mat44 T, const mat44 M) { // !!! ok, i guess
}
vec4 transform444(const mat44, const vec4);
bool unproject44(vec3 *out, vec3 xyd, vec4 viewport, mat44 mvp) {
bool unproject44(vec3 *out, vec3 xyd, vec4 viewport, mat44 mvp) { // @fixme: this function is broken (verified by @zpl-zak)
// xyd: usually x:mouse_x,y:window_height()-mouse_y,d:0=znear/1=zfar
// src: https://www.khronos.org/opengl/wiki/GluProject_and_gluUnProject_code
mat44 inv_mvp;
@ -18449,7 +18444,7 @@ void camera_fov(camera_t *cam, float fov) {
float DIMETRIC = 30.000f;
float ISOMETRIC = 35.264f;
float aspect = window_width() / ((float)window_height()+!!window_height());
float aspect = window_width() / ((float)window_height()+!window_height());
orthogonal(cam->proj, 45, aspect, -1000, 1000); // why -1000?
// cam->yaw = 45;
cam->pitch = -ISOMETRIC;
@ -20167,7 +20162,7 @@ bool app_open_folder(const char *file) {
#ifdef _WIN32
snprintf(buf, sizeof(buf), "start \"\" \"%s\"", file);
#elif __APPLE__
snprintf(buf, sizeof(buf), "%s \"%s\"", is_directory(file) ? "open" : "open --reveal", file);
snprintf(buf, sizeof(buf), "%s \"%s\"", file_directory(file) ? "open" : "open --reveal", file);
#else
snprintf(buf, sizeof(buf), "xdg-open \"%s\"", file);
#endif
@ -24981,6 +24976,14 @@ char *editor_path(const char *path) {
}
vec3 editor_pick(float mouse_x, float mouse_y) {
#if 0
// unproject 2d coord as 3d coord
camera_t *camera = camera_get_active();
vec3 out, xyd = vec3(mouse_x,window_height()-mouse_y,1); // usually x:mouse_x,y:window_height()-mouse_y,d:0=znear/1=zfar
mat44 mvp, model; identity44(model); multiply44x3(mvp, camera->proj, camera->view, model);
bool ok = unproject44(&out, xyd, vec4(0,0,window_width(),window_height()), mvp);
return out;
#else
// unproject 2d coord as 3d coord
camera_t *camera = camera_get_active();
float x = (2.0f * mouse_x) / window_width() - 1.0f;
@ -24994,6 +24997,7 @@ vec3 editor_pick(float mouse_x, float mouse_y) {
vec4 eye = vec4(p.x, p.y, -1.0, 0.0);
vec4 wld = norm4(transform444(inv_view, eye));
return vec3(wld.x, wld.y, wld.z);
#endif
}
int editor_ui_bits8(const char *label, uint8_t *enabled) { // @to deprecate

View File

@ -824,7 +824,7 @@ API void (map_clear)(map* m);
API char *cc4str(unsigned cc);
API char *cc8str(uint64_t cc);
enum { ///-
enum {
# define _(a,b,c,d,e) cc__##a, cc__##b, cc__##c, cc__##d, cc__##e
cc__1 = '1', _(2,3,4,5,6),_(7,8,9,0,_), cc__ = ' ',
cc__A = 'A', _(B,C,D,E,F),_(G,H,I,J,K),_(L,M,N,O,P),_(Q,R,S,T,U),_(V,W,X,Y,Z),