-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
921 additions
and
769 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "cmake"] | ||
path = cmake | ||
url = https://github.com/dnasdw/libsundaowen_cmake.git | ||
[submodule "dep/libsundaowen"] | ||
path = dep/libsundaowen | ||
url = https://github.com/dnasdw/libsundaowen_src.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,73 @@ | ||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) | ||
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) | ||
project(sarctool) | ||
if(MSVC11) | ||
if(MSVC_VERSION EQUAL 1700 AND MSVC_IDE) | ||
set(CMAKE_GENERATOR_TOOLSET "v110_xp" CACHE STRING "Name of generator toolset." FORCE) | ||
endif() | ||
if(MSVC12) | ||
if(MSVC_VERSION EQUAL 1800 AND MSVC_IDE) | ||
set(CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "Name of generator toolset." FORCE) | ||
endif() | ||
if(MSVC_VERSION EQUAL 1900 AND MSVC_IDE) | ||
set(CMAKE_GENERATOR_TOOLSET "v140_xp" CACHE STRING "Name of generator toolset." FORCE) | ||
endif() | ||
if(MSVC_VERSION EQUAL 1910 AND MSVC_IDE) | ||
set(CMAKE_GENERATOR_TOOLSET "v141_xp" CACHE STRING "Name of generator toolset." FORCE) | ||
endif() | ||
if(MSVC_VERSION GREATER 1600 AND NOT MSVC_IDE) | ||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE,5.02") | ||
else() | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE,5.01") | ||
endif() | ||
endif() | ||
if(APPLE) | ||
set(CMAKE_MACOSX_RPATH 1) | ||
endif() | ||
set(SARCTOOL_MAJOR 1) | ||
set(SARCTOOL_MINOR 0) | ||
set(SARCTOOL_PATCHLEVEL 0) | ||
if(UNIX) | ||
set(SARCTOOL_PATCHLEVEL 1) | ||
if(NOT MSVC_IDE AND NOT XCODE_VERSION AND NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE) | ||
endif() | ||
option(BUILD64 "Build x86_64(unix only)" ON) | ||
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}") | ||
set(ROOT_SOURCE_DIR "${PROJECT_SOURCE_DIR}") | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ROOT_SOURCE_DIR}/cmake") | ||
include(AddDep) | ||
include(AddTarget) | ||
include(AutoFiles) | ||
if(UNIX) | ||
ADD_DEP_INCLUDE_DIR("${ROOT_SOURCE_DIR}/dep/libsundaowen") | ||
if(UNIX OR MINGW) | ||
if(CYGWIN) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") | ||
else() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
if(NOT APPLE) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") | ||
endif() | ||
endif() | ||
if((UNIX AND BUILD64) OR (MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 8)) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") | ||
else() | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") | ||
endif() | ||
endif() | ||
if(WIN32) | ||
if(MSVC_IDE OR XCODE_VERSION) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin") | ||
else() | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}") | ||
endif() | ||
add_definitions(-DSARCTOOL_VERSION="${SARCTOOL_MAJOR}.${SARCTOOL_MINOR}.${SARCTOOL_PATCHLEVEL}") | ||
if(WIN32) | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
else() | ||
endif() | ||
if(UNIX OR MINGW) | ||
add_definitions(-D_FILE_OFFSET_BITS=64) | ||
if(APPLE) | ||
add_definitions(-DSARCTOOL_APPLE) | ||
else() | ||
if(NOT APPLE) | ||
add_definitions(-Wno-multichar -Wno-unused-result) | ||
endif() | ||
set(CMAKE_INSTALL_RPATH .) | ||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) | ||
endif() | ||
add_subdirectory(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,55 @@ | ||
# sarctool | ||
|
||
A tool for exporting/importing sarc file. | ||
A tool for extracting/creating sarc file. | ||
|
||
## History | ||
|
||
- v1.0.0 @ 2015.03.02 - First release | ||
- v1.0.1 @ 2017.06.16 - Refactoring | ||
|
||
## Platforms | ||
|
||
- Cygwin *1.7.34* | ||
- Linux *(Ubuntu 14.04, CentOS 7.0)* | ||
- Mac OS X *10.10* | ||
- Windows *XP+* | ||
- Windows | ||
- Linux | ||
- macOS | ||
|
||
## Building | ||
|
||
### Dependencies | ||
|
||
- cmake | ||
- libiconv **(linux only)** | ||
- libiconv | ||
|
||
### Compiling | ||
|
||
- make 64-bit version | ||
~~~ | ||
mkdir project | ||
cd project | ||
cmake .. | ||
cmake .. | ||
make | ||
~~~ | ||
|
||
### Installing | ||
|
||
- make 32-bit version | ||
~~~ | ||
make install | ||
mkdir project | ||
cd project | ||
cmake -DBUILD64=OFF .. | ||
make | ||
~~~ | ||
|
||
## Usage | ||
|
||
### Windows | ||
### Installing | ||
|
||
~~~ | ||
sarctool.exe [option...] [option]... | ||
make install | ||
~~~ | ||
|
||
### Other | ||
## Usage | ||
|
||
~~~ | ||
sarctool [option...] [option]... | ||
~~~ | ||
|
||
> Remember to do `chmod +x sarctool` first | ||
## Options | ||
|
||
See `sarctool --help` messages. | ||
|
||
## FAQ | ||
|
||
Nothing here for now. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
// regex: ECMAScript grammar and case insensitive | ||
//\.bch | ||
//\.bffnt | ||
//\.bflim | ||
.* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Submodule libsundaowen
added at
49f3ad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#ifndef BFLIM_H_ | ||
#define BFLIM_H_ | ||
|
||
#include <sdw.h> | ||
|
||
#include SDW_MSC_PUSH_PACKED | ||
struct SBflimHeader | ||
{ | ||
u32 Signature; | ||
u16 ByteOrder; | ||
u16 HeaderSize; | ||
u32 Version; | ||
u32 FileSize; | ||
u16 DataBlocks; | ||
u16 Reserved; | ||
} SDW_GNUC_PACKED; | ||
|
||
union UTextureConfig | ||
{ | ||
u8 Flag; | ||
struct | ||
{ | ||
u8 Unknown0 : 2; | ||
u8 Rotation : 2; | ||
u8 Unknown4 : 4; | ||
}; | ||
struct | ||
{ | ||
u8 TileMode : 5; | ||
u8 SwizzlePattern : 3; | ||
}; | ||
}; | ||
|
||
struct SImageBlock | ||
{ | ||
u32 Signature; | ||
u32 HeaderSize; | ||
u16 Width; | ||
u16 Height; | ||
u16 Alignment; | ||
u8 Format; | ||
UTextureConfig TextureConfig; | ||
u32 ImageSize; | ||
} GNUC_PACKED; | ||
#include SDW_MSC_POP_PACKED | ||
|
||
#endif // BFLIM_H_ |
Oops, something went wrong.