From c097af08e02282b97e8e5522537ae7126618a78a Mon Sep 17 00:00:00 2001 From: Martin Fouilleul Date: Wed, 9 Aug 2023 19:04:59 +0200 Subject: [PATCH] Moving sketches resources into their own shared folder separate from the runtime's resource folder --- sketches/atlas/main.c | 4 ++-- sketches/canvas/build.sh | 6 +++--- sketches/image/main.c | 4 ++-- sketches/perf_text/build.sh | 6 +++--- sketches/perf_text/main.c | 6 +++--- .../resources}/CMUSerif-Roman.ttf | Bin {resources => sketches/resources}/Courier.ttf | Bin {resources => sketches/resources}/Top512.png | Bin {resources => sketches/resources}/triceratops.png | Bin sketches/tiger/build.sh | 6 +++--- 10 files changed, 16 insertions(+), 16 deletions(-) rename {resources => sketches/resources}/CMUSerif-Roman.ttf (100%) rename {resources => sketches/resources}/Courier.ttf (100%) rename {resources => sketches/resources}/Top512.png (100%) rename {resources => sketches/resources}/triceratops.png (100%) diff --git a/sketches/atlas/main.c b/sketches/atlas/main.c index e1e0925..1aa04cb 100644 --- a/sketches/atlas/main.c +++ b/sketches/atlas/main.c @@ -49,8 +49,8 @@ int main() mg_rect_atlas* atlas = mg_rect_atlas_create(&permanentArena, 16000, 16000); mg_image atlasImage = mg_image_create(surface, 16000, 16000); - str8 path1 = path_executable_relative(mem_scratch(), STR8("../resources/triceratops.png")); - str8 path2 = path_executable_relative(mem_scratch(), STR8("../resources/Top512.png")); + str8 path1 = path_executable_relative(mem_scratch(), STR8("../../sketches/resources/triceratops.png")); + str8 path2 = path_executable_relative(mem_scratch(), STR8("../../sketches/resources/Top512.png")); mg_image_region image1 = mg_image_atlas_alloc_from_file(atlas, atlasImage, path1, false); mg_image_region image2 = mg_image_atlas_alloc_from_file(atlas, atlasImage, path2, false); diff --git a/sketches/canvas/build.sh b/sketches/canvas/build.sh index ee7e2ad..7092b38 100755 --- a/sketches/canvas/build.sh +++ b/sketches/canvas/build.sh @@ -1,10 +1,10 @@ #!/bin/bash -BINDIR=../../bin -RESDIR=../../resources +BINDIR=../../build/bin SRCDIR=../../src +EXTDIR=../../ext -INCLUDES="-I$SRCDIR -I$SRCDIR/util -I$SRCDIR/platform -I$SRCDIR/app" +INCLUDES="-I$SRCDIR -I$EXTDIR" LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" diff --git a/sketches/image/main.c b/sketches/image/main.c index 4d7450a..f342298 100644 --- a/sketches/image/main.c +++ b/sketches/image/main.c @@ -44,11 +44,11 @@ int main() } //NOTE: create image - str8 imagePath = path_executable_relative(mem_scratch(), STR8("../resources/triceratops.png")); + str8 imagePath = path_executable_relative(mem_scratch(), STR8("../../sketches/resources/triceratops.png")); mg_image image = mg_image_create_from_file(surface, imagePath, false); vec2 imageSize = mg_image_size(image); - str8 imagePath2 = path_executable_relative(mem_scratch(), STR8("../resources/Top512.png")); + str8 imagePath2 = path_executable_relative(mem_scratch(), STR8("../../sketches/resources/Top512.png")); mg_image image2 = mg_image_create_from_file(surface, imagePath2, false); vec2 imageSize2 = mg_image_size(image2); diff --git a/sketches/perf_text/build.sh b/sketches/perf_text/build.sh index 3f176c1..eeee90e 100755 --- a/sketches/perf_text/build.sh +++ b/sketches/perf_text/build.sh @@ -1,10 +1,10 @@ #!/bin/bash -BINDIR=../../bin -RESDIR=../../resources +BINDIR=../../build/bin SRCDIR=../../src +EXTDIR=../../ext -INCLUDES="-I$SRCDIR -I$SRCDIR/util -I$SRCDIR/platform -I$SRCDIR/app -I$SRCDIR/graphics" +INCLUDES="-I$SRCDIR -I$EXTDIR" LIBS="-L$BINDIR -lmilepost" FLAGS="-O2 -mmacos-version-min=10.15.4" diff --git a/sketches/perf_text/main.c b/sketches/perf_text/main.c index 208bb96..d1e9c58 100644 --- a/sketches/perf_text/main.c +++ b/sketches/perf_text/main.c @@ -117,9 +117,9 @@ int main() mg_canvas canvas = mg_canvas_create(); int fontIndex = 0; - mg_font fonts[FONT_COUNT] = {create_font("../resources/OpenSansLatinSubset.ttf"), - create_font("../resources/CMUSerif-Roman.ttf"), - create_font("../resources/Courier.ttf")}; + mg_font fonts[FONT_COUNT] = {create_font("../../resources/OpenSansLatinSubset.ttf"), + create_font("../../sketches/resources/CMUSerif-Roman.ttf"), + create_font("../../sketches/resources/Courier.ttf")}; mg_font_extents extents[FONT_COUNT]; f32 fontScales[FONT_COUNT]; diff --git a/resources/CMUSerif-Roman.ttf b/sketches/resources/CMUSerif-Roman.ttf similarity index 100% rename from resources/CMUSerif-Roman.ttf rename to sketches/resources/CMUSerif-Roman.ttf diff --git a/resources/Courier.ttf b/sketches/resources/Courier.ttf similarity index 100% rename from resources/Courier.ttf rename to sketches/resources/Courier.ttf diff --git a/resources/Top512.png b/sketches/resources/Top512.png similarity index 100% rename from resources/Top512.png rename to sketches/resources/Top512.png diff --git a/resources/triceratops.png b/sketches/resources/triceratops.png similarity index 100% rename from resources/triceratops.png rename to sketches/resources/triceratops.png diff --git a/sketches/tiger/build.sh b/sketches/tiger/build.sh index 99b54e1..00bb31a 100755 --- a/sketches/tiger/build.sh +++ b/sketches/tiger/build.sh @@ -1,10 +1,10 @@ #!/bin/bash -BINDIR=../../bin -RESDIR=../../resources +BINDIR=../../build/bin SRCDIR=../../src +EXTDIR=../../ext -INCLUDES="-I$SRCDIR -I$SRCDIR/util -I$SRCDIR/platform -I$SRCDIR/app" +INCLUDES="-I$SRCDIR -I$EXTDIR" LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG"