replaced embed.h style embedding with skip

This commit is contained in:
DaniTheSkunk 2023-02-24 23:39:42 +00:00
parent cd13750858
commit 8d6775a480
4 changed files with 17 additions and 34 deletions

35
build.c
View File

@ -11,12 +11,9 @@ void sys(char *cmd);
int main(int argc, char *argv[]) {
printf("SkunkWorks build system v0.0\n");
fflush(stdout);
sys("if not exist build md build");
chdir("build");
sys("if not exist deps md deps");
// system("cl ../src/*.c /I../include");
// system("copy ..\\subprojects\\zlib-1.2.13\\zconf.h.in zconf.h");
// putenv("CC=clang");
cmake("glfw-3.3.8", "src\\Release\\glfw3.lib", "glfw3.lib", "", "");
cmake("zlib-1.2.13", "Release\\zlibstatic.lib", "zlib.lib", "", "");
cmake(
@ -49,34 +46,22 @@ int main(int argc, char *argv[]) {
"*.obj "
"deps/*.lib "
"/OUT:skunkworks.lib");
sys("cl /MD /O2 "
"../tools/skip.c "
"skunkworks.lib "
"/I../include ");
/* gsa example */
sys("cl /MD /O2 "
"../examples/gsa_simple.c "
"skunkworks.lib "
"/I../include "
"/I. ");
sys("skip ca1 ../example_data gsa_simple.exe");
sys("del *.obj");
/*
system("clang "
"-static "
"-Wl,-nodefaultlib:msvcrt "
"../src/*.c "
"-D_CRT_SECURE_NO_WARNINGS "
"-oskunkworks.lib "
"-I../include "
"-I../subprojects/glew-2.1.0/include "
"-I../subprojects/glfw-3.3.8/include "
"-I../subprojects/lpng1639 "
"-I../subprojects/zlib-1.2.13 "
"-Ilpng1639 "
"-L. -lpng -lzlib -lglew -lglfw3 -lopengl32 -luser32 -lkernel32 "
"-lgdi32 -lshell32 "
"-llibcmt -llibvcruntime -llibucrt");
*/
return 0;
}
@ -91,13 +76,7 @@ void cmake(char *dep, char *libpath, char *lib, char *cmake_dir, char *params) {
sys(sw_concat("md ", dep));
chdir(dep);
sys(sw_concat4(
"cmake ",
params,
// "
//-DCMAKE_MSVC_RUNTIME_LIBRARY=\"MultiThreaded$<$<CONFIG:Debug>:Debug>"
// "\" "
" ../../subprojects/",
sw_concat3(dep, "/", cmake_dir)
"cmake ", params, " ../../subprojects/", sw_concat3(dep, "/", cmake_dir)
));
sys("cmake --build . --config Release");
chdir("..");

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -16,14 +16,10 @@
#ifndef GUARD_73FF49EF137A66E6AAD3A8A1BCF2F2DE
#define GUARD_73FF49EF137A66E6AAD3A8A1BCF2F2DE
#include "image8.h"
#ifndef GSA_NOMAIN
#include "embed_gfx.h"
#endif
#include "gsa_input.h"
#include "gsa_map.h"
#include "gsa_text.h"
#include "image8.h"
#include "msvc.h"
#include "skunkworks.h"
#include "vec2i.h"
@ -53,7 +49,6 @@ void tick();
#ifndef GSA_NOMAIN
int main(int argc, char *argv[]) {
_gfx = sw_image8_load_png_data(___gfx_png, ___gfx_png_len);
gsa_main(argc, argv);
return 0;

View File

@ -3,6 +3,7 @@
#include "gl.h"
#include "image8.h"
#include "shader.h"
#include "skip.h"
#include "types.h"
#include <gl/gl.h>
#include <string.h>
@ -61,13 +62,21 @@ static u32 tex;
static bool (*loop_stack[GSA_LOOP_STACK_SIZE])();
static i8 loop_stack_i;
static struct sw_skip *skip;
int gsa_main(int argc, char *argv[]) {
(void)argc;
(void)argv;
i32 max_components;
u32 size;
u8 *data;
sw_log("Initialising GameSkunkAdvance v0.0");
skip = sw_skip_load(argv[0]);
data = sw_skip_get(skip, "gfx.png", &size);
_gfx = sw_image8_load_png_data(data, size);
memset(loop_stack, 0, sizeof(loop_stack));
loop_stack_i = -1;