fix linux opengl render; windows ucrt
This commit is contained in:
parent
33fdd97bdd
commit
b2a45fcfdd
18
Makefile
18
Makefile
|
@ -78,10 +78,6 @@ CPPFLAGS += -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM #for quickjs
|
|||
# ENABLE_SINC_[BEST|FAST|MEDIUM]_CONVERTER
|
||||
# default, fast and medium available in game at runtime; best available in editor
|
||||
|
||||
PKGCMD = tar --directory --exclude="./*.a" --exclude="./obj" -czf $(DISTDIR)/$(DIST) .
|
||||
ZIP = .tar.gz
|
||||
UNZIP = cp $(DISTDIR)/$(DIST) $(DESTDIR) && tar xzf $(DESTDIR)/$(DIST) -C $(DESTDIR) && rm $(DESTDIR)/$(DIST)
|
||||
|
||||
INFO := $(INFO)_$(ARCH)
|
||||
|
||||
ifeq ($(OS), Windows_NT) # then WINDOWS
|
||||
|
@ -91,9 +87,6 @@ ifeq ($(OS), Windows_NT) # then WINDOWS
|
|||
LDFLAGS += -mwin32 -static
|
||||
CPPFLAGS += -mwin32
|
||||
LDLIBS += mingw32 kernel32 d3d11 user32 shell32 dxgi gdi32 ws2_32 ole32 winmm setupapi m pthread
|
||||
PKGCMD = zip -q -r $(MAKEDIR)/$(DISTDIR)/$(DIST) . -x \*.a ./obj/\*
|
||||
ZIP = .zip
|
||||
UNZIP = unzip -o -q $(DISTDIR)/$(DIST) -d $(DESTDIR)
|
||||
INFO :=$(INFO)_win
|
||||
EXT = .exe
|
||||
else ifeq ($(OS), IOS)
|
||||
|
@ -161,9 +154,11 @@ includeflag := $(addprefix -I, $(includeflag))
|
|||
|
||||
WARNING_FLAGS = -Wno-incompatible-function-pointer-types -Wno-incompatible-pointer-types
|
||||
|
||||
# For vanilla compilation, remove _
|
||||
ifeq ($(INFO),_)
|
||||
INFO :=
|
||||
endif
|
||||
|
||||
APP = prosperon
|
||||
NAME = $(APP)$(INFO)$(EXT)
|
||||
SEM != git describe --tags --abbrev=0
|
||||
|
@ -183,17 +178,12 @@ all: $(NAME)
|
|||
|
||||
prereqs: source/engine/core.cdb.h
|
||||
|
||||
DESTDIR ?= ~/.bin
|
||||
install: $(NAME)
|
||||
@echo Copying to destination
|
||||
cp -f $(NAME) $(DESTDIR)/$(APP)
|
||||
|
||||
$(NAME): $(OBJS) $(DEPS)
|
||||
@echo Linking $(NAME)
|
||||
$(CROSS)$(LD) $^ $(CPPFLAGS) $(LDFLAGS) -L. $(LDPATHS) $(LDLIBS) -o $@
|
||||
@echo Finished build
|
||||
|
||||
%$(INFO).o: %.c
|
||||
%$(INFO).o: %.c prereqs
|
||||
@echo Making C object $@
|
||||
$(CROSS)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
||||
|
||||
|
@ -257,7 +247,7 @@ crossmac: Prosperon.icns
|
|||
cp Prosperon.icns Prosperon.app/Contents/Resources
|
||||
|
||||
crosswin:
|
||||
make CROSS=x86_64-w64-mingw32- OS=Windows_NT CC=gcc
|
||||
make CROSS=x86_64-w64-mingw32ucrt- OS=Windows_NT CC=gcc
|
||||
|
||||
crossweb:
|
||||
make CC=emcc OS=wasm
|
||||
|
|
|
@ -269,7 +269,6 @@ global.mixin("scripts/render");
|
|||
global.mixin("scripts/debug");
|
||||
|
||||
var frame_t = profile.secs(profile.now());
|
||||
var phys_step = 1/240;
|
||||
|
||||
var sim = {};
|
||||
sim.mode = "play";
|
||||
|
@ -344,11 +343,11 @@ function process()
|
|||
|
||||
physlag += dt;
|
||||
|
||||
while (physlag > phys_step) {
|
||||
physlag -= phys_step;
|
||||
while (physlag > physics.delta) {
|
||||
physlag -= physics.delta;
|
||||
var st = profile.now();
|
||||
prosperon.phys2d_step(phys_step*game.timescale);
|
||||
prosperon.physupdate(phys_step*game.timescale);
|
||||
prosperon.phys2d_step(physics.delta*game.timescale);
|
||||
prosperon.physupdate(physics.delta*game.timescale);
|
||||
profile.addreport(profcache, "physics step", st);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,8 @@ physics.gravity.strength = 500;
|
|||
physics.damp = physics.make_damp();
|
||||
physics.damp.mask = ~1;
|
||||
|
||||
physics.delta = 1/240;
|
||||
|
||||
return {
|
||||
physics
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ render.doc = {
|
|||
|
||||
var shaderlang = {
|
||||
macos: "metal_macos",
|
||||
windows: "hlsl4",
|
||||
windows: "hlsl5",
|
||||
linux: "glsl430",
|
||||
web: "wgsl",
|
||||
ios: "metal_ios",
|
||||
|
|
|
@ -793,9 +793,9 @@ sg_shader js2shader(JSValue v)
|
|||
int atin = js_arrlen(attrs);
|
||||
for (int i = 0; i < atin; i++) {
|
||||
JSValue u = js_getpropidx(attrs, i);
|
||||
desc.attrs[i].name = js2strdup(js_getpropstr(u, "name"));
|
||||
desc.attrs[i].sem_name = js2strdup(js_getpropstr(u,"sem_name"));
|
||||
desc.attrs[i].sem_index = js2number(js_getpropstr(u, "sem_index"));
|
||||
int slot = js2number(js_getpropstr(u, "slot"));
|
||||
desc.attrs[slot].sem_name = js2strdup(js_getpropstr(u,"sem_name"));
|
||||
desc.attrs[slot].sem_index = js2number(js_getpropstr(u, "sem_index"));
|
||||
}
|
||||
|
||||
JSValue vsu = js_getpropstr(vs, "uniform_blocks");
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define CYAN 36
|
||||
#define WHITE 37
|
||||
|
||||
#define COLOR(TXT, _C) ESC #_C "m" #TXT ESC "0m"
|
||||
#define COLOR(TXT, _C) ESC "22;" #_C "m" #TXT ESC "0m"
|
||||
|
||||
char *logstr[] = { "spam", "debug", "info", "warn", "error", "panic"};
|
||||
char *logcolor[] = { COLOR(spam,37), COLOR(debug,32), COLOR(info,36), COLOR(warn,33), COLOR(error,31), COLOR(panic,45) };
|
||||
|
@ -47,7 +47,6 @@ void log_init()
|
|||
if (!fexists(".prosperon")) {
|
||||
logout = tmpfile();
|
||||
dump = tmpfile();
|
||||
writeout = stdout;
|
||||
}
|
||||
else {
|
||||
logout = fopen(".prosperon/log.txt", "w");
|
||||
|
@ -93,7 +92,7 @@ void mYughLog(int category, int priority, int line, const char *file, const char
|
|||
printf("\n");
|
||||
}
|
||||
|
||||
if (priority >= LOG_PANIC) {
|
||||
if (priority >= LOG_ERROR) {
|
||||
js_stacktrace();
|
||||
#ifdef __WIN32
|
||||
DebugBreak();
|
||||
|
|
Loading…
Reference in a new issue