replaced embed.h style embedding with skip
This commit is contained in:
parent
cd13750858
commit
8d6775a480
35
build.c
35
build.c
|
@ -11,12 +11,9 @@ void sys(char *cmd);
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
printf("SkunkWorks build system v0.0\n");
|
printf("SkunkWorks build system v0.0\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
sys("if not exist build md build");
|
||||||
chdir("build");
|
chdir("build");
|
||||||
sys("if not exist deps md deps");
|
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("glfw-3.3.8", "src\\Release\\glfw3.lib", "glfw3.lib", "", "");
|
||||||
cmake("zlib-1.2.13", "Release\\zlibstatic.lib", "zlib.lib", "", "");
|
cmake("zlib-1.2.13", "Release\\zlibstatic.lib", "zlib.lib", "", "");
|
||||||
cmake(
|
cmake(
|
||||||
|
@ -49,34 +46,22 @@ int main(int argc, char *argv[]) {
|
||||||
"*.obj "
|
"*.obj "
|
||||||
"deps/*.lib "
|
"deps/*.lib "
|
||||||
"/OUT:skunkworks.lib");
|
"/OUT:skunkworks.lib");
|
||||||
|
|
||||||
sys("cl /MD /O2 "
|
sys("cl /MD /O2 "
|
||||||
"../tools/skip.c "
|
"../tools/skip.c "
|
||||||
"skunkworks.lib "
|
"skunkworks.lib "
|
||||||
"/I../include ");
|
"/I../include ");
|
||||||
|
|
||||||
|
/* gsa example */
|
||||||
sys("cl /MD /O2 "
|
sys("cl /MD /O2 "
|
||||||
"../examples/gsa_simple.c "
|
"../examples/gsa_simple.c "
|
||||||
"skunkworks.lib "
|
"skunkworks.lib "
|
||||||
"/I../include "
|
"/I../include "
|
||||||
"/I. ");
|
"/I. ");
|
||||||
|
sys("skip ca1 ../example_data gsa_simple.exe");
|
||||||
|
|
||||||
sys("del *.obj");
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,13 +76,7 @@ void cmake(char *dep, char *libpath, char *lib, char *cmake_dir, char *params) {
|
||||||
sys(sw_concat("md ", dep));
|
sys(sw_concat("md ", dep));
|
||||||
chdir(dep);
|
chdir(dep);
|
||||||
sys(sw_concat4(
|
sys(sw_concat4(
|
||||||
"cmake ",
|
"cmake ", params, " ../../subprojects/", sw_concat3(dep, "/", cmake_dir)
|
||||||
params,
|
|
||||||
// "
|
|
||||||
//-DCMAKE_MSVC_RUNTIME_LIBRARY=\"MultiThreaded$<$<CONFIG:Debug>:Debug>"
|
|
||||||
// "\" "
|
|
||||||
" ../../subprojects/",
|
|
||||||
sw_concat3(dep, "/", cmake_dir)
|
|
||||||
));
|
));
|
||||||
sys("cmake --build . --config Release");
|
sys("cmake --build . --config Release");
|
||||||
chdir("..");
|
chdir("..");
|
||||||
|
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
@ -16,14 +16,10 @@
|
||||||
#ifndef GUARD_73FF49EF137A66E6AAD3A8A1BCF2F2DE
|
#ifndef GUARD_73FF49EF137A66E6AAD3A8A1BCF2F2DE
|
||||||
#define GUARD_73FF49EF137A66E6AAD3A8A1BCF2F2DE
|
#define GUARD_73FF49EF137A66E6AAD3A8A1BCF2F2DE
|
||||||
|
|
||||||
#include "image8.h"
|
|
||||||
#ifndef GSA_NOMAIN
|
|
||||||
#include "embed_gfx.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gsa_input.h"
|
#include "gsa_input.h"
|
||||||
#include "gsa_map.h"
|
#include "gsa_map.h"
|
||||||
#include "gsa_text.h"
|
#include "gsa_text.h"
|
||||||
|
#include "image8.h"
|
||||||
#include "msvc.h"
|
#include "msvc.h"
|
||||||
#include "skunkworks.h"
|
#include "skunkworks.h"
|
||||||
#include "vec2i.h"
|
#include "vec2i.h"
|
||||||
|
@ -53,7 +49,6 @@ void tick();
|
||||||
|
|
||||||
#ifndef GSA_NOMAIN
|
#ifndef GSA_NOMAIN
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
_gfx = sw_image8_load_png_data(___gfx_png, ___gfx_png_len);
|
|
||||||
gsa_main(argc, argv);
|
gsa_main(argc, argv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "gl.h"
|
#include "gl.h"
|
||||||
#include "image8.h"
|
#include "image8.h"
|
||||||
#include "shader.h"
|
#include "shader.h"
|
||||||
|
#include "skip.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include <gl/gl.h>
|
#include <gl/gl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -61,13 +62,21 @@ static u32 tex;
|
||||||
static bool (*loop_stack[GSA_LOOP_STACK_SIZE])();
|
static bool (*loop_stack[GSA_LOOP_STACK_SIZE])();
|
||||||
static i8 loop_stack_i;
|
static i8 loop_stack_i;
|
||||||
|
|
||||||
|
static struct sw_skip *skip;
|
||||||
|
|
||||||
int gsa_main(int argc, char *argv[]) {
|
int gsa_main(int argc, char *argv[]) {
|
||||||
(void)argc;
|
(void)argc;
|
||||||
(void)argv;
|
(void)argv;
|
||||||
i32 max_components;
|
i32 max_components;
|
||||||
|
u32 size;
|
||||||
|
u8 *data;
|
||||||
|
|
||||||
sw_log("Initialising GameSkunkAdvance v0.0");
|
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));
|
memset(loop_stack, 0, sizeof(loop_stack));
|
||||||
loop_stack_i = -1;
|
loop_stack_i = -1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue