Skip to content

Commit

Permalink
WIP: zip support
Browse files Browse the repository at this point in the history
  • Loading branch information
carstene1ns committed Apr 15, 2024
1 parent cf7489c commit dff59c0
Show file tree
Hide file tree
Showing 9 changed files with 3,180 additions and 99 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ set_property(SOURCE src/main.cpp PROPERTY COMPILE_DEFINITIONS
OJ_URL="${PROJECT_HOMEPAGE_URL}"; OJ_BUGREPORT="${OJ_BUGREPORT}")

target_link_libraries(OpenJazz
argparse psmplug stb lodepng miniz
argparse psmplug stb lodepng mg miniz
${OJ_LIBS_SCALE} ${OJ_LIBS_SDL} ${OJ_LIBS_NET} ${OJ_LIBS_HOST})

# platform stuff
Expand Down
17 changes: 16 additions & 1 deletion ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ target_include_directories(stb INTERFACE stb)
# miniz

add_library(miniz STATIC miniz/miniz.h miniz/miniz.cpp)
target_compile_definitions(miniz INTERFACE MINIZ_NO_ARCHIVE_APIS)
#target_compile_definitions(miniz PRIVATE _LARGEFILE64_SOURCE)
target_include_directories(miniz INTERFACE miniz)

Expand All @@ -51,6 +50,22 @@ target_compile_definitions(lodepng INTERFACE
target_include_directories(lodepng INTERFACE lodepng)
target_link_libraries(lodepng PRIVATE miniz)

# mg

add_library(mg STATIC
mg/assetsys.cpp
mg/assetsys.h
mg/strpool.cpp
mg/strpool.h
)
#target_compile_definitions(mg INTERFACE
# ASSETSYS_U64 uint64_t
# STRPOOL_U32 uint32_t
# STRPOOL_U64 uint64_t
#)
target_include_directories(mg INTERFACE mg)
target_link_libraries(mg PRIVATE miniz)

if(ANDROID)
include(FetchContent)

Expand Down
2 changes: 2 additions & 0 deletions ext/mg/assetsys.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define ASSETSYS_IMPLEMENTATION
#include "assetsys.h"
1,660 changes: 1,660 additions & 0 deletions ext/mg/assetsys.h

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions ext/mg/strpool.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define STRPOOL_IMPLEMENTATION
#include "strpool.h"
1,313 changes: 1,313 additions & 0 deletions ext/mg/strpool.h

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions ext/miniz/miniz.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@
*/
#pragma once

// OpenJazz modification
#ifndef MINIZ_NO_ARCHIVE_APIS
#define MINIZ_NO_ARCHIVE_APIS
#endif

/* Defines to completely disable specific portions of miniz.c:
If all macros here are defined the only functionality remaining will be CRC-32 and adler-32. */

Expand Down
Loading

0 comments on commit dff59c0

Please sign in to comment.