better lighting
This commit is contained in:
parent
805a2713a3
commit
6ed4e17065
75 changed files with 6417 additions and 3667 deletions
35
pxl8.sh
35
pxl8.sh
|
|
@ -39,6 +39,7 @@ BOLD='\033[1m'
|
|||
GREEN='\033[38;2;184;187;38m'
|
||||
NC='\033[0m'
|
||||
RED='\033[38;2;251;73;52m'
|
||||
YELLOW='\033[38;2;250;189;47m'
|
||||
|
||||
if [[ "$(uname)" == "Linux" ]]; then
|
||||
CFLAGS="$CFLAGS -D_GNU_SOURCE"
|
||||
|
|
@ -126,13 +127,29 @@ build_sdl() {
|
|||
fi
|
||||
}
|
||||
|
||||
prefix_output() {
|
||||
while IFS= read -r line; do
|
||||
if [[ "$line" == *": warning:"* ]] || [[ "$line" == *": note:"* ]]; then
|
||||
echo -e "${YELLOW}${BOLD}[$(timestamp) WARN]${NC} $line" >&2
|
||||
else
|
||||
echo -e "${RED}${BOLD}[$(timestamp) ERROR]${NC} $line" >&2
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
compile_source_file() {
|
||||
local src_file="$1"
|
||||
local obj_file="$2"
|
||||
local compile_flags="$3"
|
||||
|
||||
print_info "Compiling: $src_file"
|
||||
if ! $CC -c $compile_flags "$src_file" -o "$obj_file"; then
|
||||
local output
|
||||
local exit_code
|
||||
output=$($CC -c $compile_flags "$src_file" -o "$obj_file" 2>&1) || exit_code=$?
|
||||
if [[ -n "$output" ]]; then
|
||||
echo "$output" | prefix_output
|
||||
fi
|
||||
if [[ -n "$exit_code" ]]; then
|
||||
print_error "Compilation failed for $src_file"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -382,7 +399,7 @@ case "$COMMAND" in
|
|||
print_info "Compiler cache: ccache enabled"
|
||||
fi
|
||||
|
||||
INCLUDES="-Isrc/asset -Isrc/core -Isrc/gfx -Isrc/gui -Isrc/hal -Isrc/math -Isrc/net -Isrc/procgen -Isrc/script -Isrc/sfx -Isrc/world -Ilib/linenoise -Ilib/luajit/src -Ilib/miniz"
|
||||
INCLUDES="-Isrc/asset -Isrc/bsp -Isrc/core -Isrc/gfx -Isrc/gui -Isrc/hal -Isrc/math -Isrc/net -Isrc/procgen -Isrc/script -Isrc/sfx -Isrc/sim -Isrc/vxl -Isrc/world -Ilib/linenoise -Ilib/luajit/src -Ilib/miniz"
|
||||
COMPILE_FLAGS="$CFLAGS $INCLUDES"
|
||||
DEP_COMPILE_FLAGS="$DEP_CFLAGS $INCLUDES"
|
||||
|
||||
|
|
@ -394,6 +411,8 @@ case "$COMMAND" in
|
|||
src/asset/pxl8_ase.c
|
||||
src/asset/pxl8_cart.c
|
||||
src/asset/pxl8_save.c
|
||||
src/bsp/pxl8_bsp.c
|
||||
src/bsp/pxl8_bsp_render.c
|
||||
src/core/pxl8.c
|
||||
src/core/pxl8_bytes.c
|
||||
src/core/pxl8_io.c
|
||||
|
|
@ -421,20 +440,22 @@ case "$COMMAND" in
|
|||
src/gui/pxl8_gui.c
|
||||
src/hal/pxl8_hal_sdl3.c
|
||||
src/hal/pxl8_mem_sdl3.c
|
||||
src/hal/pxl8_thread_sdl3.c
|
||||
src/math/pxl8_math.c
|
||||
src/math/pxl8_noise.c
|
||||
src/net/pxl8_net.c
|
||||
src/net/pxl8_protocol.c
|
||||
src/procgen/pxl8_graph.c
|
||||
src/script/pxl8_repl.c
|
||||
src/script/pxl8_script.c
|
||||
src/sfx/pxl8_sfx.c
|
||||
src/world/pxl8_bsp.c
|
||||
src/world/pxl8_chunk.c
|
||||
src/world/pxl8_chunk_cache.c
|
||||
src/sim/pxl8_sim.c
|
||||
src/vxl/pxl8_vxl.c
|
||||
src/vxl/pxl8_vxl_render.c
|
||||
src/world/pxl8_entity.c
|
||||
src/world/pxl8_gen.c
|
||||
src/world/pxl8_voxel.c
|
||||
src/world/pxl8_world.c
|
||||
src/world/pxl8_world_chunk.c
|
||||
src/world/pxl8_world_chunk_cache.c
|
||||
"
|
||||
|
||||
LUAJIT_LIB="lib/luajit/src/libluajit.a"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue