Compilation targets of WIN, WEB, and LINUX; ftw to nftw for emscripten [2deca9ddb9]
This commit is contained in:
@@ -568,7 +568,7 @@ JSValue dukext2paths(char *ext) {
|
||||
dukext = ext;
|
||||
dukarr = JS_NewArray(js);
|
||||
dukidx = 0;
|
||||
ftw(".", duk2path, 10);
|
||||
nftw(".", duk2path, 10,0);
|
||||
return dukarr;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "stb_ds.h"
|
||||
#include "time.h"
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "stb_ds.h"
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "model.h"
|
||||
#include "stb_ds.h"
|
||||
|
||||
#include "sokol/sokol_app.h"
|
||||
|
||||
#include "HandmadeMath.h"
|
||||
|
||||
int renderMode = LIT;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
char *DATA_PATH = NULL;
|
||||
char *PREF_PATH = NULL;
|
||||
|
||||
char *prefabs;
|
||||
char **prefabs;
|
||||
|
||||
const char *EXT_PREFAB = ".prefab";
|
||||
const char *EXT_LEVEL = ".level";
|
||||
@@ -89,7 +89,7 @@ static int ext_check(const char *path, const struct stat *sb, int typeflag) {
|
||||
void fill_extensions(char *paths, const char *path, const char *ext) {
|
||||
cur_ext = ext;
|
||||
arrfree(paths);
|
||||
ftw(".", ext_check, 10);
|
||||
nftw(".", ext_check, 10, 0);
|
||||
}
|
||||
|
||||
void findPrefabs() {
|
||||
|
||||
@@ -13,7 +13,7 @@ extern int stemlen;
|
||||
|
||||
void resources_init();
|
||||
|
||||
extern char *prefabs;
|
||||
extern char **prefabs;
|
||||
void findPrefabs();
|
||||
void fill_extensions(char *paths, const char *path, const char *ext);
|
||||
char *get_filename_from_path(char *path, int extension);
|
||||
|
||||
@@ -87,7 +87,7 @@ struct sprite *id2sprite(int id) {
|
||||
return &sprites[id];
|
||||
}
|
||||
|
||||
static sprite_count = 0;
|
||||
static int sprite_count = 0;
|
||||
|
||||
void sprite_flush() {
|
||||
sprite_count = 0;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "input.h"
|
||||
#include "openglrender.h"
|
||||
#include "window.h"
|
||||
#include "sound.h"
|
||||
#include "resources.h"
|
||||
|
||||
#include "datastream.h"
|
||||
|
||||
@@ -33,7 +35,15 @@
|
||||
|
||||
#define SOKOL_TRACE_HOOKS
|
||||
#define SOKOL_IMPL
|
||||
#define SOKOL_GLCORE33
|
||||
|
||||
#if defined __linux__
|
||||
#define SOKOL_GLCORE33
|
||||
#elif __EMSCRIPTEN__
|
||||
#define SOKOL_GLES3
|
||||
#elif __WIN32
|
||||
#define SOKOL_D3D11
|
||||
#endif
|
||||
|
||||
#include "sokol/sokol_gfx.h"
|
||||
#include "sokol/sokol_app.h"
|
||||
#include "sokol/sokol_audio.h"
|
||||
@@ -140,6 +150,7 @@ static char **args;
|
||||
void c_init() {
|
||||
int logout = 0;
|
||||
#if DBG
|
||||
#if __linux
|
||||
if (logout) {
|
||||
time_t now = time(NULL);
|
||||
char fname[100];
|
||||
@@ -161,8 +172,9 @@ void c_init() {
|
||||
signal(SIGABRT, seghandle);
|
||||
signal(SIGFPE, seghandle);
|
||||
signal(SIGBUS, seghandle);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
resources_init();
|
||||
phys2d_init();
|
||||
sound_init();
|
||||
@@ -196,8 +208,6 @@ void c_frame()
|
||||
double elapsed = sapp_frame_duration();
|
||||
appTime += elapsed;
|
||||
|
||||
nuke_input_begin();
|
||||
|
||||
// if (sim_playing())
|
||||
input_poll(fmax(0, renderMS-elapsed));
|
||||
// else
|
||||
|
||||
@@ -14,6 +14,7 @@ void print_stacktrace();
|
||||
const char *engine_info();
|
||||
|
||||
int frame_fps();
|
||||
double get_timescale();
|
||||
|
||||
extern double appTime;
|
||||
extern double renderMS;
|
||||
|
||||
Reference in New Issue
Block a user