Compare commits
No commits in common. "cb30231c2f42927f328292a2764d115d9084a90f" and "1ff46c397552fecd55556b1d679ed3ca0b10a2b2" have entirely different histories.
cb30231c2f
...
1ff46c3975
38
Makefile
38
Makefile
|
@ -1,5 +1,4 @@
|
||||||
PROCS != nproc --all
|
MAKEFLAGS = --jobs=8
|
||||||
MAKEFLAGS = -j $(PROCS)
|
|
||||||
UNAME != uname
|
UNAME != uname
|
||||||
MAKEDIR != pwd
|
MAKEDIR != pwd
|
||||||
# Options
|
# Options
|
||||||
|
@ -73,7 +72,7 @@ else
|
||||||
CPPFLAGS += -O2
|
CPPFLAGS += -O2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CPPFLAGS += -DHAVE_CEIL -DCP_USE_CGTYPES=0 -DCP_USE_DOUBLES=0 -DHAVE_FLOOR -DHAVE_FMOD -DHAVE_LRINT -DHAVE_LRINTF $(includeflag) $(WARNING_FLAGS) -I. -DVER=\"$(SEM)\" -DCOM=\"$(COM)\" -DINFO=\"$(INFO)\" #-DENABLE_SINC_MEDIUM_CONVERTER -DENABLE_SINC_FAST_CONVERTER -DCP_COLLISION_TYPE_TYPE=uintptr_t -DCP_BITMASK_TYPE=uintptr_t
|
CPPFLAGS += -DHAVE_CEIL -DCP_USE_CGTYPES=0 -DCP_USE_DOUBLES=0 -DHAVE_FLOOR -DHAVE_FMOD -DHAVE_LRINT -DHAVE_LRINTF $(includeflag) -MD $(WARNING_FLAGS) -I. -DVER=\"$(SEM)\" -DCOM=\"$(COM)\" -DINFO=\"$(INFO)\" #-DENABLE_SINC_MEDIUM_CONVERTER -DENABLE_SINC_FAST_CONVERTER -DCP_COLLISION_TYPE_TYPE=uintptr_t -DCP_BITMASK_TYPE=uintptr_t
|
||||||
CPPFLAGS += -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM #for quickjs
|
CPPFLAGS += -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM #for quickjs
|
||||||
|
|
||||||
# ENABLE_SINC_[BEST|FAST|MEDIUM]_CONVERTER
|
# ENABLE_SINC_[BEST|FAST|MEDIUM]_CONVERTER
|
||||||
|
@ -171,39 +170,20 @@ LDPATHS := $(STEAM)/redistributable_bin/$(PLATFORM)
|
||||||
LDPATHS := $(addprefix -L, $(LDPATHS))
|
LDPATHS := $(addprefix -L, $(LDPATHS))
|
||||||
|
|
||||||
DEPENDS = $(OBJS:.o=.d)
|
DEPENDS = $(OBJS:.o=.d)
|
||||||
|
-include $(DEPENDS)
|
||||||
ifndef VERBOSE
|
|
||||||
.SILENT:
|
|
||||||
endif
|
|
||||||
|
|
||||||
DEPFLAGS = -MT $(@:.d=.o) -MM -MG $< -o $@
|
|
||||||
|
|
||||||
%$(INFO).d: %.c
|
|
||||||
@echo Making deps $@
|
|
||||||
$(CROSS)$(CC) $(CPPFLAGS) $(DEPFLAGS)
|
|
||||||
|
|
||||||
%$(INFO).d: %.cpp
|
|
||||||
@echo Making deps $@
|
|
||||||
$(CROSS)$(CXX) $(CPPFLAGS) $(DEPFLAGS)
|
|
||||||
|
|
||||||
%$(INFO).d: %.m
|
|
||||||
@echo Making deps $@
|
|
||||||
$(CROSS)$(CC) $(CPPFLAGS) $(DEPFLAGS)
|
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS), clean)
|
|
||||||
include $(DEPENDS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
.DEFAULT_GOAL := all
|
.DEFAULT_GOAL := all
|
||||||
all: $(NAME)
|
all: $(NAME)
|
||||||
cp -f $(NAME) $(APP)$(EXT)
|
cp -f $(NAME) $(APP)$(EXT)
|
||||||
|
|
||||||
|
prereqs: source/engine/core.cdb.h
|
||||||
|
|
||||||
$(NAME): $(OBJS) $(DEPS)
|
$(NAME): $(OBJS) $(DEPS)
|
||||||
@echo Linking $(NAME)
|
@echo Linking $(NAME)
|
||||||
$(CROSS)$(LD) $^ $(CPPFLAGS) $(LDFLAGS) -L. $(LDPATHS) $(LDLIBS) -o $@
|
$(CROSS)$(LD) $^ $(CPPFLAGS) $(LDFLAGS) -L. $(LDPATHS) $(LDLIBS) -o $@
|
||||||
@echo Finished build
|
@echo Finished build
|
||||||
|
|
||||||
%$(INFO).o: %.c
|
%$(INFO).o: %.c prereqs
|
||||||
@echo Making C object $@
|
@echo Making C object $@
|
||||||
$(CROSS)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
$(CROSS)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
@ -215,7 +195,9 @@ $(NAME): $(OBJS) $(DEPS)
|
||||||
@echo Making Objective-C object $@
|
@echo Making Objective-C object $@
|
||||||
$(CROSS)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
$(CROSS)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
CORE != (ls icons/* fonts/* shaders/*.cg scripts/*.js*)
|
SCRIPTS := $(shell ls scripts/*.js*)
|
||||||
|
CORE != (ls icons/* fonts/*)
|
||||||
|
CORE := $(CORE) $(SCRIPTS)
|
||||||
|
|
||||||
packer: tools/packer.c source/engine/miniz.c
|
packer: tools/packer.c source/engine/miniz.c
|
||||||
@echo Making packer
|
@echo Making packer
|
||||||
|
@ -225,7 +207,7 @@ core.cdb: packer $(CORE)
|
||||||
@echo Packing core.cdb
|
@echo Packing core.cdb
|
||||||
./packer $@ $(CORE)
|
./packer $@ $(CORE)
|
||||||
|
|
||||||
core.cdb.h: core.cdb
|
source/engine/core.cdb.h: core.cdb
|
||||||
@echo Making $@
|
@echo Making $@
|
||||||
xxd -i $< > $@
|
xxd -i $< > $@
|
||||||
|
|
||||||
|
|
|
@ -1556,9 +1556,8 @@ Math.sortpointsccw = function(points)
|
||||||
var yaml = {};
|
var yaml = {};
|
||||||
yaml.tojson = function(yaml)
|
yaml.tojson = function(yaml)
|
||||||
{
|
{
|
||||||
// Replace key value pairs that are strings with quotation marks around them
|
|
||||||
yaml = yaml.replace(/(\w+):/g, '"$1":');
|
yaml = yaml.replace(/(\w+):/g, '"$1":');
|
||||||
yaml = yaml.replace(/: ([\w\.\/]+)/g, ': "$1"'); // TODO: make this more general
|
yaml = yaml.replace(/: ([\w\.]+)/g, ': "$1"');
|
||||||
|
|
||||||
yaml = yaml.split("\n");
|
yaml = yaml.split("\n");
|
||||||
var cont = {};
|
var cont = {};
|
||||||
|
|
|
@ -115,12 +115,7 @@ render.make_shader = function(shader)
|
||||||
{
|
{
|
||||||
var file = shader;
|
var file = shader;
|
||||||
shader = io.slurp(shader);
|
shader = io.slurp(shader);
|
||||||
console.info(shader);
|
var writejson = `${file.name()}_c.json`;
|
||||||
if (!shader) {
|
|
||||||
console.info(`not found! slurping shaders/${file}`);
|
|
||||||
shader = io.slurp(`shaders/${file}`);
|
|
||||||
}
|
|
||||||
var writejson = `.prosperon/${file.name()}.shader.json`;
|
|
||||||
var st = profile.now();
|
var st = profile.now();
|
||||||
|
|
||||||
breakme: if (io.exists(writejson)) {
|
breakme: if (io.exists(writejson)) {
|
||||||
|
@ -138,7 +133,7 @@ render.make_shader = function(shader)
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
var out = `.prosperon/${file.name()}.shader`;
|
var out = `${file.name()}.shader`;
|
||||||
|
|
||||||
var files = [file];
|
var files = [file];
|
||||||
|
|
||||||
|
@ -147,9 +142,6 @@ render.make_shader = function(shader)
|
||||||
for (var inc of incs) {
|
for (var inc of incs) {
|
||||||
var filez = inc.match(/#include <(.*)>/)[1];
|
var filez = inc.match(/#include <(.*)>/)[1];
|
||||||
var macro = io.slurp(filez);
|
var macro = io.slurp(filez);
|
||||||
if (!macro)
|
|
||||||
macro = io.slurp(`shaders/${filez}`);
|
|
||||||
|
|
||||||
shader = shader.replace(inc, macro);
|
shader = shader.replace(inc, macro);
|
||||||
files.push(filez);
|
files.push(filez);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1219,10 +1219,6 @@ JSValue js_io_slurpbytes(JSContext *js, JSValue self, int argc, JSValue *argv)
|
||||||
char *f = js2str(argv[0]);
|
char *f = js2str(argv[0]);
|
||||||
size_t len;
|
size_t len;
|
||||||
unsigned char *d = slurp_file(f,&len);
|
unsigned char *d = slurp_file(f,&len);
|
||||||
if (!d) {
|
|
||||||
JS_FreeCString(js,f);
|
|
||||||
return JS_UNDEFINED;
|
|
||||||
}
|
|
||||||
JSValue ret = JS_NewArrayBufferCopy(js,d,len);
|
JSValue ret = JS_NewArrayBufferCopy(js,d,len);
|
||||||
JS_FreeCString(js,f);
|
JS_FreeCString(js,f);
|
||||||
free(d);
|
free(d);
|
||||||
|
|
Loading…
Reference in a new issue