Fixed many incompatible pointer warnings; add tcc specific debugging flags to makefile

This commit is contained in:
John Alanbrook 2022-12-15 23:30:17 +00:00
parent 0b64d0872b
commit 688d816bce
3 changed files with 26 additions and 35 deletions

View file

@ -11,6 +11,8 @@ PTYPE != uname -m
# DBG=0,1 --- build with debugging symbols and logging
# ED=0,1 --- build with or without editor
NAME = yugine
ifeq ($(DBG), 1)
QFLAGS = -O0 -g -DDBG=1 -DED=1
@ -25,8 +27,8 @@ ifeq ($(ED), 0)
INFO = ed
endif
BIN = bin/$(CC)/
objprefix = $(BIN)obj/$(INFO)
BIN = bin/$(CC)/$(INFO)/
objprefix = $(BIN)obj
define prefix
echo $(1) | tr " " "\n" | sed 's/.*/$(2)&$(3)/'
@ -63,12 +65,10 @@ ifeq ($(OS), WIN32)
LINKER_FLAGS = $(QFLAGS)
ELIBS = engine ucrt pthread yughc portaudio glfw3 opengl32 gdi32 ws2_32 ole32 winmm setupapi m
CLIBS =
EXT = .exe
else
LINKER_FLAGS = $(QFLAGS) -L/usr/local/lib
ELIBS = engine pthread yughc portaudio asound glfw3 c m dl
CLIBS =
EXT =
endif
ELIBS != $(call prefix, $(ELIBS), -l)
@ -79,8 +79,6 @@ objects = $(eobjects)
DEPENDS = $(objects:.o=.d)
-include $(DEPENDS)
yuginec = source/engine/yugine.c
ENGINE = $(BIN)libengine.a
INCLUDE = $(BIN)include
@ -88,21 +86,21 @@ LINK = $(LIBPATH) $(LINKER_FLAGS) $(ELIBS)
MYTAG = $(VER)_$(PTYPE)_$(INFO)
DIST = yugine-$(MYTAG).tar.gz
DIST = $(NAME)-$(MYTAG).tar.gz
.PHONY: yugine
.PHONY: $(NAME)
yugine: $(BIN)yugine
$(NAME): $(BIN)$(NAME)
$(BIN)yugine: $(objprefix)/source/engine/yugine.o $(ENGINE)
@echo Linking yugine
$(CC) $< $(LINK) -o $(BIN)yugine
$(BIN)$(NAME): $(objprefix)/source/engine/yugine.o $(ENGINE)
@echo Linking $(NAME)
$(CC) $< $(LINK) -o $(BIN)$(NAME)
@echo Finished build
$(BIN)$(DIST): $(BIN)yugine
@echo Creating distribution zip
$(BIN)$(DIST): $(BIN)$(NAME)
@echo Creating distribution $(DIST)
@mkdir -p $(BIN)dist
@cp $(BIN)yugine $(BIN)dist
@cp $(BIN)$(NAME) $(BIN)dist
@cp -rf assets/fonts $(BIN)dist
@cp -rf source/scripts $(BIN)dist
@cp -rf source/shaders $(BIN)dist
@ -113,7 +111,7 @@ $(BIN)$(DIST): $(BIN)yugine
dist: $(BIN)$(DIST)
install: $(BIN)$(DIST)
@echo Unpacking distribution in $(DESTDIR)
@echo Unpacking $(DIST) in $(DESTDIR)
@cp $(BIN)$(DIST) $(DESTDIR)
@tar xzf $(DESTDIR)/$(DIST) -C $(DESTDIR)
@rm $(DESTDIR)/$(DIST)

View file

@ -5,8 +5,6 @@
#define MAXPATH 256 /* 255 chars + null */
#define MAXNAME 50
#define SCREEN_WIDTH 1280
#define SCREEN_HEIGHT 720
#define PI 3.14159265358979323846264338327950288f

View file

@ -583,17 +583,6 @@ void editor_project_gui() {
NK_MENU_END()
NK_MENU_START(debug)
if (nk_tree_push(ctx, NK_TREE_NODE, "Debug Draws", NK_MINIMIZED)) {
nuke_checkbox("Gizmos", &renderGizmos);
nuke_checkbox("Grid", &showGrid);
nuke_checkbox("Physics", &debugDrawPhysics);
nk_tree_pop(ctx);
}
NK_MENU_END()
NK_MENU_START(hierarchy)
nk_layout_row_dynamic(ctx, 25, 1);
@ -625,14 +614,12 @@ void editor_project_gui() {
nk_layout_row_dynamic(ctx, 25, 1);
vec_walk(prefabs, editor_prefab_btn);
NK_FORCE_END()
NK_FORCE_END()
NK_MENU_START(assets)
nuke_nel(1);
editor.asset_srch = nk_edit_string_zero_terminated(ctx, NK_EDIT_SIMPLE, asset_search_buffer, 100, nk_filter_ascii);
if (nk_button_label(ctx, "Reload all files"))
get_all_files();
@ -641,9 +628,9 @@ void editor_project_gui() {
if (!assets[i].value->searched)
continue;
if (nk_button_label(ctx, assets[i].key)) {
if (nk_button_label(ctx, assets[i].key))
editor_selectasset_str(assets[i].key);
}
}
NK_MENU_END()
@ -651,7 +638,15 @@ void editor_project_gui() {
if (selected_asset)
editor_asset_gui(selected_asset);
NK_MENU_START(debug)
nuke_nel(1);
if (nk_tree_push(ctx, NK_TREE_NODE, "Debug Draws", NK_MINIMIZED)) {
nuke_checkbox("Gizmos", &renderGizmos);
nuke_checkbox("Grid", &showGrid);
nuke_checkbox("Physics", &debugDrawPhysics);
nk_tree_pop(ctx);
}
if (nk_button_label(ctx, "Reload Shaders")) {
shader_compile_all();
@ -675,7 +670,7 @@ void editor_project_gui() {
nk_color_pick(ctx, &smgrd, NK_RGBA);
nk_color_pick(ctx, &lgrd, NK_RGBA);
NK_MENU_END()
NK_MENU_END()
startobjectgui: