Compare commits
1 Commits
Pgta/Duck-
...
ph3nom/tex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
986921cc9c |
65
.gitignore
vendored
65
.gitignore
vendored
@@ -366,46 +366,27 @@ src/extras/GitSHA1.cpp
|
|||||||
*.d
|
*.d
|
||||||
*.sim.o
|
*.sim.o
|
||||||
*.sim.o3
|
*.sim.o3
|
||||||
|
dreamcast/1ST_READ.BIN
|
||||||
liberty/1ST_READ.BIN
|
dreamcast/IP.BIN
|
||||||
liberty/IP.BIN
|
dreamcast/re3.cdi
|
||||||
liberty/*.cdi
|
dreamcast/re3.iso
|
||||||
liberty/*.iso
|
dreamcast/re3.elf
|
||||||
liberty/dca-liberty.elf
|
dreamcast/re3.elf.bin
|
||||||
liberty/dca-liberty.elf.bin
|
dreamcast/re3-sim.elf
|
||||||
liberty/dca-liberty-sim.elf
|
dreamcast/dca3.cdi
|
||||||
liberty/animtool*
|
dreamcast/dca3.iso
|
||||||
liberty/texconv*
|
dreamcast/dca3.elf
|
||||||
liberty/imgtool*
|
dreamcast/dca3.elf.bin
|
||||||
liberty/coltool*
|
dreamcast/dca3-sim.elf
|
||||||
liberty/streamheaderpack*
|
dreamcast/texconv*
|
||||||
liberty/extract-sfx*
|
dreamcast/imgtool*
|
||||||
liberty/pack-sfx*
|
dreamcast/extract-sfx*
|
||||||
liberty/analyze-profile*
|
dreamcast/pack-sfx*
|
||||||
liberty/aud2adpcm*
|
dreamcast/analyze-profile*
|
||||||
liberty/repack-data
|
dreamcast/aud2adpcm*
|
||||||
liberty/output.map
|
dreamcast/repack-data
|
||||||
liberty/git-version
|
dreamcast/output.map
|
||||||
|
dreamcast/dca3.ds.iso
|
||||||
miami/1ST_READ.BIN
|
dreamcast/git-version.h
|
||||||
miami/IP.BIN
|
dreamcast/git-version.tmp
|
||||||
miami/*.cdi
|
|
||||||
miami/*.iso
|
|
||||||
miami/dca-miami.elf
|
|
||||||
miami/dca-miami.elf.bin
|
|
||||||
miami/dca-miami-sim.elf
|
|
||||||
miami/animtool*
|
|
||||||
miami/texconv*
|
|
||||||
miami/imgtool*
|
|
||||||
miami/coltool*
|
|
||||||
miami/streamheaderpack*
|
|
||||||
miami/extract-sfx*
|
|
||||||
miami/pack-sfx*
|
|
||||||
miami/analyze-profile*
|
|
||||||
miami/aud2adpcm*
|
|
||||||
miami/adf2mp3*
|
|
||||||
miami/repack-data
|
|
||||||
miami/output.map
|
|
||||||
miami/git-version
|
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
133
.gitlab-ci.yml
133
.gitlab-ci.yml
@@ -5,7 +5,7 @@ image:
|
|||||||
name: ghcr.io/kos-builds/kos-dc:latest-14.1.0
|
name: ghcr.io/kos-builds/kos-dc:latest-14.1.0
|
||||||
entrypoint: ["/bin/sh", "-c", 'echo gitlab command: "$@" && /bin/bash -c "$@"']
|
entrypoint: ["/bin/sh", "-c", 'echo gitlab command: "$@" && /bin/bash -c "$@"']
|
||||||
|
|
||||||
build-dreamcast-liberty:
|
build-dreamcast:
|
||||||
variables:
|
variables:
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
||||||
@@ -23,13 +23,13 @@ build-dreamcast-liberty:
|
|||||||
- make -C /opt/toolchains/dc/kos/kernel/arch/dreamcast/sound/arm
|
- make -C /opt/toolchains/dc/kos/kernel/arch/dreamcast/sound/arm
|
||||||
- make -C /opt/toolchains/dc/kos -j $(nproc)
|
- make -C /opt/toolchains/dc/kos -j $(nproc)
|
||||||
script:
|
script:
|
||||||
- cd liberty
|
- cd dreamcast
|
||||||
- make -j $(nproc)
|
- make -j $(nproc)
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- liberty/dca-liberty.elf
|
- dreamcast/dca3.elf
|
||||||
|
|
||||||
build-dreamcast-miami:
|
build-dreamcast-ide-32mb:
|
||||||
variables:
|
variables:
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
||||||
@@ -47,13 +47,13 @@ build-dreamcast-miami:
|
|||||||
- make -C /opt/toolchains/dc/kos/kernel/arch/dreamcast/sound/arm
|
- make -C /opt/toolchains/dc/kos/kernel/arch/dreamcast/sound/arm
|
||||||
- make -C /opt/toolchains/dc/kos -j $(nproc)
|
- make -C /opt/toolchains/dc/kos -j $(nproc)
|
||||||
script:
|
script:
|
||||||
- cd miami
|
- cd dreamcast
|
||||||
- make -j $(nproc)
|
- make -j $(nproc) WITH_IDE=1 WITH_32MB=1 TARGET=dca3-ide-32mb.elf
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- miami/dca-miami.elf
|
- dreamcast/dca3-ide-32mb.elf
|
||||||
|
|
||||||
build-texconv-liberty:
|
build-texconv:
|
||||||
variables:
|
variables:
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
||||||
@@ -68,13 +68,13 @@ build-texconv-liberty:
|
|||||||
- update-ccache-symlinks
|
- update-ccache-symlinks
|
||||||
script:
|
script:
|
||||||
- export PATH="/usr/lib/ccache:$PATH"
|
- export PATH="/usr/lib/ccache:$PATH"
|
||||||
- cd liberty
|
- cd dreamcast
|
||||||
- make texconv -j $(nproc)
|
- make texconv -j $(nproc)
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- liberty/texconv
|
- dreamcast/texconv
|
||||||
|
|
||||||
build-texconv-liberty-clang:
|
build-texconv-clang:
|
||||||
variables:
|
variables:
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
||||||
@@ -89,14 +89,14 @@ build-texconv-liberty-clang:
|
|||||||
- update-ccache-symlinks
|
- update-ccache-symlinks
|
||||||
script:
|
script:
|
||||||
- export PATH="/usr/lib/ccache:$PATH"
|
- export PATH="/usr/lib/ccache:$PATH"
|
||||||
- cd liberty
|
- cd dreamcast
|
||||||
- CC=clang CXX=clang++ make texconv -j $(nproc)
|
- CC=clang CXX=clang++ make texconv -j $(nproc)
|
||||||
- mv texconv texconv-clang
|
- mv texconv texconv-clang
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- liberty/texconv-clang
|
- dreamcast/texconv-clang
|
||||||
|
|
||||||
build-texconv-miami:
|
build-sim:
|
||||||
variables:
|
variables:
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
||||||
@@ -106,61 +106,19 @@ build-texconv-miami:
|
|||||||
- $CCACHE_DIR
|
- $CCACHE_DIR
|
||||||
stage: build
|
stage: build
|
||||||
before_script:
|
before_script:
|
||||||
|
- dpkg --add-architecture i386
|
||||||
- apt update
|
- apt update
|
||||||
- apt install -y build-essential gcc g++ ccache
|
- apt install -y build-essential gcc g++ gcc-multilib g++-multilib libx11-dev:i386 ccache
|
||||||
- update-ccache-symlinks
|
- update-ccache-symlinks
|
||||||
script:
|
script:
|
||||||
- export PATH="/usr/lib/ccache:$PATH"
|
- export PATH="/usr/lib/ccache:$PATH"
|
||||||
- cd miami
|
- cd dreamcast
|
||||||
- make texconv -j $(nproc)
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- miami/texconv
|
|
||||||
|
|
||||||
build-texconv-miami-clang:
|
|
||||||
variables:
|
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
|
||||||
cache:
|
|
||||||
- key: ccache-$CI_JOB_NAME
|
|
||||||
paths:
|
|
||||||
- $CCACHE_DIR
|
|
||||||
stage: build
|
|
||||||
before_script:
|
|
||||||
- apt update
|
|
||||||
- apt install -y build-essential gcc g++ clang ccache
|
|
||||||
- update-ccache-symlinks
|
|
||||||
script:
|
|
||||||
- export PATH="/usr/lib/ccache:$PATH"
|
|
||||||
- cd miami
|
|
||||||
- CC=clang CXX=clang++ make texconv -j $(nproc)
|
|
||||||
- mv texconv texconv-clang
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- miami/texconv-clang
|
|
||||||
|
|
||||||
build-sim-liberty:
|
|
||||||
variables:
|
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
|
||||||
cache:
|
|
||||||
- key: ccache-$CI_JOB_NAME
|
|
||||||
paths:
|
|
||||||
- $CCACHE_DIR
|
|
||||||
stage: build
|
|
||||||
before_script:
|
|
||||||
- apt update
|
|
||||||
- apt install -y build-essential gcc g++ libx11-dev ccache
|
|
||||||
- update-ccache-symlinks
|
|
||||||
script:
|
|
||||||
- export PATH="/usr/lib/ccache:$PATH"
|
|
||||||
- cd liberty
|
|
||||||
- make -f sim.mk -j $(nproc)
|
- make -f sim.mk -j $(nproc)
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- liberty/dca-liberty-sim.elf
|
- dreamcast/dca3-sim.elf
|
||||||
|
|
||||||
build-sim-liberty-clang:
|
build-sim-clang:
|
||||||
variables:
|
variables:
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
||||||
@@ -170,55 +128,24 @@ build-sim-liberty-clang:
|
|||||||
- $CCACHE_DIR
|
- $CCACHE_DIR
|
||||||
stage: build
|
stage: build
|
||||||
before_script:
|
before_script:
|
||||||
|
- dpkg --add-architecture i386
|
||||||
- apt update
|
- apt update
|
||||||
- apt install -y build-essential gcc g++ libx11-dev clang ccache
|
- apt install -y build-essential gcc g++ gcc-multilib g++-multilib libx11-dev:i386 clang ccache
|
||||||
- update-ccache-symlinks
|
- update-ccache-symlinks
|
||||||
script:
|
script:
|
||||||
- export PATH="/usr/lib/ccache:$PATH"
|
- export PATH="/usr/lib/ccache:$PATH"
|
||||||
- cd liberty
|
- cd dreamcast
|
||||||
- CC=clang CXX=clang++ make -f sim.mk -j $(nproc) TARGET=dca-liberty-sim-clang.elf
|
- CC=clang CXX=clang++ make -f sim.mk -j $(nproc) TARGET=dca3-sim-clang.elf
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- liberty/dca-liberty-sim-clang.elf
|
- dreamcast/dca3-sim-clang.elf
|
||||||
|
|
||||||
build-sim-miami:
|
pages:
|
||||||
variables:
|
stage: deploy
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
|
||||||
cache:
|
|
||||||
- key: ccache-$CI_JOB_NAME
|
|
||||||
paths:
|
|
||||||
- $CCACHE_DIR
|
|
||||||
stage: build
|
|
||||||
before_script:
|
|
||||||
- apt update
|
|
||||||
- apt install -y build-essential gcc g++ libx11-dev ccache
|
|
||||||
- update-ccache-symlinks
|
|
||||||
script:
|
script:
|
||||||
- export PATH="/usr/lib/ccache:$PATH"
|
- echo "The site will be deployed to $CI_PAGES_URL"
|
||||||
- cd miami
|
|
||||||
- make -f sim.mk -j $(nproc)
|
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- miami/dca-liberty-sim.elf
|
- public
|
||||||
|
rules:
|
||||||
build-sim-miami-clang:
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
variables:
|
|
||||||
CCACHE_BASEDIR: $CI_PROJECT_DIR
|
|
||||||
CCACHE_DIR: $CI_PROJECT_DIR/ccache
|
|
||||||
cache:
|
|
||||||
- key: ccache-$CI_JOB_NAME
|
|
||||||
paths:
|
|
||||||
- $CCACHE_DIR
|
|
||||||
stage: build
|
|
||||||
before_script:
|
|
||||||
- apt update
|
|
||||||
- apt install -y build-essential gcc g++ libx11-dev clang ccache
|
|
||||||
- update-ccache-symlinks
|
|
||||||
script:
|
|
||||||
- export PATH="/usr/lib/ccache:$PATH"
|
|
||||||
- cd miami
|
|
||||||
- CC=clang CXX=clang++ make -f sim.mk -j $(nproc) TARGET=dca-miami-sim-clang.elf
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- miami/dca-miami-sim-clang.elf
|
|
||||||
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@@ -140,12 +140,6 @@
|
|||||||
"svd": "cpp",
|
"svd": "cpp",
|
||||||
"print": "cpp",
|
"print": "cpp",
|
||||||
"strstream": "cpp",
|
"strstream": "cpp",
|
||||||
"regex": "cpp",
|
"regex": "cpp"
|
||||||
"cassert": "cpp",
|
|
||||||
"barrier": "cpp",
|
|
||||||
"coroutine": "cpp",
|
|
||||||
"future": "cpp",
|
|
||||||
"latch": "cpp",
|
|
||||||
"syncstream": "cpp"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
100
CMakeLists.txt
Normal file
100
CMakeLists.txt
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
|
set(EXECUTABLE re3)
|
||||||
|
set(PROJECT RE3)
|
||||||
|
|
||||||
|
project(${EXECUTABLE} C CXX)
|
||||||
|
set(${PROJECT}_AUTHOR "${PROJECT} Team")
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
|
include(GetGitRevisionDescription)
|
||||||
|
get_git_head_revision(GIT_REFSPEC GIT_SHA1 "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
|
||||||
|
message(STATUS "Building ${CMAKE_PROJECT_NAME} GIT SHA1: ${GIT_SHA1}")
|
||||||
|
|
||||||
|
if(NINTENDO_SWITCH)
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/nx")
|
||||||
|
include(NXFunctions)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT COMMAND re3_platform_target)
|
||||||
|
function(re3_platform_target)
|
||||||
|
endfunction()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(${PROJECT}_AUDIOS "OAL" "MSS")
|
||||||
|
else()
|
||||||
|
set(${PROJECT}_AUDIOS "OAL")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${PROJECT}_AUDIO "OAL" CACHE STRING "Audio")
|
||||||
|
|
||||||
|
option(${PROJECT}_INSTALL "Enable installation of ${EXECUTABLE} + gamefiles" OFF)
|
||||||
|
option(${PROJECT}_WITH_OPUS "Build ${EXECUTABLE} with opus support" OFF)
|
||||||
|
option(${PROJECT}_WITH_LIBSNDFILE "Build ${EXECUTABLE} with libsndfile (instead of internal decoder)" OFF)
|
||||||
|
|
||||||
|
set_property(CACHE ${PROJECT}_AUDIO PROPERTY STRINGS ${${PROJECT}_AUDIOS})
|
||||||
|
message(STATUS "${PROJECT}_AUDIO = ${${PROJECT}_AUDIO} (choices=${${PROJECT}_AUDIOS})")
|
||||||
|
set("${PROJECT}_AUDIO_${${PROJECT}_AUDIO}" ON)
|
||||||
|
if(NOT ${PROJECT}_AUDIO IN_LIST ${PROJECT}_AUDIOS)
|
||||||
|
message(FATAL_ERROR "Illegal ${PROJECT}_AUDIO=${${PROJECT}_AUDIO}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(${PROJECT}_VENDORED_LIBRW "Use vendored librw" ON)
|
||||||
|
if(${PROJECT}_VENDORED_LIBRW)
|
||||||
|
add_subdirectory(vendor/librw)
|
||||||
|
else()
|
||||||
|
find_package(librw REQUIRED)
|
||||||
|
endif()
|
||||||
|
add_subdirectory(src)
|
||||||
|
|
||||||
|
if(${PROJECT}_INSTALL)
|
||||||
|
install(DIRECTORY gamefiles/ DESTINATION ".")
|
||||||
|
if(LIBRW_PLATFORM_NULL)
|
||||||
|
set(platform "-null")
|
||||||
|
elseif(LIBRW_PLATFORM_PS2)
|
||||||
|
set(platform "-ps2")
|
||||||
|
elseif(LIBRW_PLATFORM_GL3)
|
||||||
|
if(LIBRW_GL3_GFXLIB STREQUAL "GLFW")
|
||||||
|
set(platform "-gl3-glfw")
|
||||||
|
else()
|
||||||
|
set(platform "-gl3-sdl2")
|
||||||
|
endif()
|
||||||
|
elseif(LIBRW_PLATFORM_D3D9)
|
||||||
|
set(platform "-d3d9")
|
||||||
|
endif()
|
||||||
|
if(${PROJECT}_AUDIO_OAL)
|
||||||
|
set(audio "-oal")
|
||||||
|
elseif(${PROJECT}_AUDIO_MSS)
|
||||||
|
set(audio "-mss")
|
||||||
|
endif()
|
||||||
|
if(${PROJECT}_WITH_OPUS)
|
||||||
|
set(audio "${audio}-opus")
|
||||||
|
endif()
|
||||||
|
if(NOT LIBRW_PLATFORM_PS2)
|
||||||
|
if(WIN32)
|
||||||
|
set(os "-win")
|
||||||
|
elseif(APPLE)
|
||||||
|
set(os "-apple")
|
||||||
|
elseif(UNIX)
|
||||||
|
set(os "-linux")
|
||||||
|
elseif(NINTENDO_SWITCH)
|
||||||
|
set(os "-switch")
|
||||||
|
else()
|
||||||
|
set(compiler "-UNK")
|
||||||
|
message(WARNING "Unknown os. Created cpack package will be wrong. (override using cpack -P)")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}${platform}${audio}${os}${compiler}")
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GTA III reversed")
|
||||||
|
set(CPACK_PACKAGE_VENDOR "GTAModding")
|
||||||
|
# FIXME: missing license (https://github.com/GTAmodding/re3/issues/794)
|
||||||
|
# set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||||
|
# set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||||
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
|
||||||
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
|
||||||
|
set(CPACK_GENERATOR "ZIP")
|
||||||
|
include(CPack)
|
||||||
|
endif()
|
||||||
107
CODING_STYLE.md
Normal file
107
CODING_STYLE.md
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
# Coding style
|
||||||
|
|
||||||
|
I started writing in [Plan 9 style](http://man.cat-v.org/plan_9/6/style),
|
||||||
|
but realize that this is not the most popular style, so I'm willing to compromise.
|
||||||
|
Try not to deviate too much so the code will look similar across the whole project.
|
||||||
|
|
||||||
|
To give examples, these two styles (or anything in between) are fine:
|
||||||
|
|
||||||
|
```
|
||||||
|
type
|
||||||
|
functionname(args)
|
||||||
|
{
|
||||||
|
if(a == b){
|
||||||
|
s1;
|
||||||
|
s2;
|
||||||
|
}else{
|
||||||
|
s3;
|
||||||
|
s4;
|
||||||
|
}
|
||||||
|
if(x != y)
|
||||||
|
s5;
|
||||||
|
}
|
||||||
|
|
||||||
|
type functionname(args)
|
||||||
|
{
|
||||||
|
if (a == b) {
|
||||||
|
s1;
|
||||||
|
s2;
|
||||||
|
} else {
|
||||||
|
s3;
|
||||||
|
s4;
|
||||||
|
}
|
||||||
|
if (x != y)
|
||||||
|
s5;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This one (or anything more extreme) is heavily discouraged:
|
||||||
|
|
||||||
|
```
|
||||||
|
type functionname ( args )
|
||||||
|
{
|
||||||
|
if ( a == b )
|
||||||
|
{
|
||||||
|
s1;
|
||||||
|
s2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s3;
|
||||||
|
s4;
|
||||||
|
}
|
||||||
|
if ( x != y )
|
||||||
|
{
|
||||||
|
s5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
i.e.
|
||||||
|
|
||||||
|
* Put the brace on the same line as control statements
|
||||||
|
|
||||||
|
* Put the brace on the next line after function definitions and structs/classes
|
||||||
|
|
||||||
|
* Put an `else` on the same line with the braces
|
||||||
|
|
||||||
|
* Don't put braces around single statements
|
||||||
|
|
||||||
|
* Put the function return type on a separate line
|
||||||
|
|
||||||
|
* Indent with TABS
|
||||||
|
|
||||||
|
As for the less cosmetic choices, here are some guidelines how the code should look:
|
||||||
|
|
||||||
|
* Don't use magic numbers where the original source code would have had an enum or similar.
|
||||||
|
Even if you don't know the exact meaning it's better to call something `FOOBAR_TYPE_4` than just `4`,
|
||||||
|
since `4` will be used in other places and you can't easily see where else the enum value is used.
|
||||||
|
|
||||||
|
* Don't just copy paste code from IDA, make it look nice
|
||||||
|
|
||||||
|
* Use the right types. In particular:
|
||||||
|
|
||||||
|
* don't use types like `__int16`, we have `int16` for that
|
||||||
|
|
||||||
|
* don't use `unsigned`, we have typedefs for that
|
||||||
|
|
||||||
|
* don't use `char` for anything but actual characters, use `int8`, `uint8` or `bool`
|
||||||
|
|
||||||
|
* don't even think about using win32 types (`BYTE`, `WORD`, &c.) unless you're writing win32 specific code
|
||||||
|
|
||||||
|
* declare pointers like `int *ptr;`, not `int* ptr;`
|
||||||
|
|
||||||
|
* As for variable names, the original gta source code was not written in a uniform style,
|
||||||
|
but here are some observations:
|
||||||
|
|
||||||
|
* many variables employ a form of hungarian notation, i.e.:
|
||||||
|
|
||||||
|
* `m_` may be used for class member variables (mostly those that are considered private)
|
||||||
|
|
||||||
|
* `ms_` for (mostly private) static members
|
||||||
|
|
||||||
|
* `f` is a float, `i` or `n` is an integer, `b` is a boolean, `a` is an array
|
||||||
|
|
||||||
|
* do *not* use `dw` for `DWORD` or so, we're not programming win32
|
||||||
|
|
||||||
|
* Generally, try to make the code look as if R* could have written it
|
||||||
@@ -33,7 +33,7 @@ You will also need the following tools installed
|
|||||||
- type `cd dca3-game/dreamcast` (and press enter)
|
- type `cd dca3-game/dreamcast` (and press enter)
|
||||||
- type `explorer .` (and press enter).
|
- type `explorer .` (and press enter).
|
||||||
- A folder named dreamcast with some files should be open. Keep it on the side.
|
- A folder named dreamcast with some files should be open. Keep it on the side.
|
||||||
- Download the Alpha Prebuilt Elf from https://gitlab.com/skmp/dca3-game/-/jobs/8725216645
|
- Download the Alpha Prebuilt Elf from https://gitlab.com/skmp/dca3-game/-/releases
|
||||||
- Open artifacts.zip and extract dca3.elf to the folder that was kept open before.
|
- Open artifacts.zip and extract dca3.elf to the folder that was kept open before.
|
||||||
- Close the folder and dreamsdk shell
|
- Close the folder and dreamsdk shell
|
||||||
|
|
||||||
|
|||||||
27
autoconf/LICENSE.txt
Normal file
27
autoconf/LICENSE.txt
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
Copyright (c) 2016 Blizzard Entertainment and individual contributors.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of Premake nor the names of its contributors may be
|
||||||
|
used to endorse or promote products derived from this software without
|
||||||
|
specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
305
autoconf/api.lua
Normal file
305
autoconf/api.lua
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
---
|
||||||
|
-- Autoconfiguration.
|
||||||
|
-- Copyright (c) 2016 Blizzard Entertainment
|
||||||
|
-- Enhanced by re3
|
||||||
|
---
|
||||||
|
local p = premake
|
||||||
|
local autoconf = p.modules.autoconf
|
||||||
|
autoconf.cache = {}
|
||||||
|
autoconf.parameters = ""
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- register autoconfigure api.
|
||||||
|
---
|
||||||
|
p.api.register {
|
||||||
|
name = "autoconfigure",
|
||||||
|
scope = "config",
|
||||||
|
kind = "table"
|
||||||
|
}
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Check for a particular include file.
|
||||||
|
--
|
||||||
|
-- @cfg : Current config.
|
||||||
|
-- @variable : The variable to store the result, such as 'HAVE_STDINT_H'.
|
||||||
|
-- @filename : The header file to check for.
|
||||||
|
---
|
||||||
|
function check_include(cfg, variable, filename)
|
||||||
|
local res = autoconf.cache_compile(cfg, variable, function ()
|
||||||
|
p.outln('#include <' .. filename .. '>')
|
||||||
|
p.outln('int main(void) { return 0; }')
|
||||||
|
end)
|
||||||
|
|
||||||
|
if res.value then
|
||||||
|
autoconf.set_value(cfg, variable, 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Check for size of a particular type.
|
||||||
|
--
|
||||||
|
-- @cfg : Current config.
|
||||||
|
-- @variable : The variable to use, such as 'SIZEOF_SIZE_T', this method will also add "'HAVE_' .. variable".
|
||||||
|
-- @type : The type to check.
|
||||||
|
-- @headers : An optional array of header files to include.
|
||||||
|
-- @defines : An optional array of defines to define.
|
||||||
|
---
|
||||||
|
function check_type_size(cfg, variable, type, headers, defines)
|
||||||
|
check_include(cfg, 'HAVE_SYS_TYPES_H', 'sys/types.h')
|
||||||
|
check_include(cfg, 'HAVE_STDINT_H', 'stdint.h')
|
||||||
|
check_include(cfg, 'HAVE_STDDEF_H', 'stddef.h')
|
||||||
|
|
||||||
|
local res = autoconf.cache_compile(cfg, variable .. cfg.platform,
|
||||||
|
function ()
|
||||||
|
if cfg.autoconf['HAVE_SYS_TYPES_H'] then
|
||||||
|
p.outln('#include <sys/types.h>')
|
||||||
|
end
|
||||||
|
|
||||||
|
if cfg.autoconf['HAVE_STDINT_H'] then
|
||||||
|
p.outln('#include <stdint.h>')
|
||||||
|
end
|
||||||
|
|
||||||
|
if cfg.autoconf['HAVE_STDDEF_H'] then
|
||||||
|
p.outln('#include <stddef.h>')
|
||||||
|
end
|
||||||
|
|
||||||
|
autoconf.include_defines(defines)
|
||||||
|
autoconf.include_headers(headers)
|
||||||
|
p.outln("")
|
||||||
|
p.outln("#define SIZE (sizeof(" .. type .. "))")
|
||||||
|
p.outln("char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',")
|
||||||
|
p.outln(" ('0' + ((SIZE / 10000)%10)),")
|
||||||
|
p.outln(" ('0' + ((SIZE / 1000)%10)),")
|
||||||
|
p.outln(" ('0' + ((SIZE / 100)%10)),")
|
||||||
|
p.outln(" ('0' + ((SIZE / 10)%10)),")
|
||||||
|
p.outln(" ('0' + (SIZE %10)),")
|
||||||
|
p.outln(" ']', '\\0'};")
|
||||||
|
p.outln("")
|
||||||
|
p.outln("int main(int argc, char *argv[]) {")
|
||||||
|
p.outln(" int require = 0;")
|
||||||
|
p.outln(" require += info_size[argc];")
|
||||||
|
p.outln(" (void)argv;")
|
||||||
|
p.outln(" return require;")
|
||||||
|
p.outln("}")
|
||||||
|
end,
|
||||||
|
function (e)
|
||||||
|
-- if the compile step succeeded, we should have a binary with 'INFO:size[*****]'
|
||||||
|
-- somewhere in there.
|
||||||
|
local content = io.readfile(e.binary)
|
||||||
|
if content then
|
||||||
|
local size = string.find(content, 'INFO:size')
|
||||||
|
if size then
|
||||||
|
e.size = tonumber(string.sub(content, size+10, size+14))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
if res.size then
|
||||||
|
autoconf.set_value(cfg, 'HAVE_' .. variable, 1)
|
||||||
|
autoconf.set_value(cfg, variable, res.size)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Check if the given struct or class has the specified member variable
|
||||||
|
--
|
||||||
|
-- @cfg : current config.
|
||||||
|
-- @variable : variable to store the result.
|
||||||
|
-- @type : the name of the struct or class you are interested in
|
||||||
|
-- @member : the member which existence you want to check
|
||||||
|
-- @headers : an optional array of header files to include.
|
||||||
|
-- @defines : An optional array of defines to define.
|
||||||
|
---
|
||||||
|
function check_struct_has_member(cfg, variable, type, member, headers, defines)
|
||||||
|
local res = autoconf.cache_compile(cfg, variable, function ()
|
||||||
|
autoconf.include_defines(defines)
|
||||||
|
autoconf.include_headers(headers)
|
||||||
|
p.outln('int main(void) {')
|
||||||
|
p.outln(' (void)sizeof(((' .. type .. '*)0)->' .. member ..');')
|
||||||
|
p.outln(' return 0;')
|
||||||
|
p.outln('}')
|
||||||
|
end)
|
||||||
|
|
||||||
|
if res.value then
|
||||||
|
autoconf.set_value(cfg, variable, 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Check if a symbol exists as a function, variable, or macro
|
||||||
|
--
|
||||||
|
-- @cfg : current config.
|
||||||
|
-- @variable : variable to store the result.
|
||||||
|
-- @symbol : The symbol to check for.
|
||||||
|
-- @headers : an optional array of header files to include.
|
||||||
|
-- @defines : An optional array of defines to define.
|
||||||
|
---
|
||||||
|
function check_symbol_exists(cfg, variable, symbol, headers, defines)
|
||||||
|
local h = headers
|
||||||
|
local res = autoconf.cache_compile(cfg, variable, function ()
|
||||||
|
autoconf.include_defines(defines)
|
||||||
|
autoconf.include_headers(headers)
|
||||||
|
p.outln('int main(int argc, char** argv) {')
|
||||||
|
p.outln(' (void)argv;')
|
||||||
|
p.outln('#ifndef ' .. symbol)
|
||||||
|
p.outln(' return ((int*)(&' .. symbol .. '))[argc];')
|
||||||
|
p.outln('#else')
|
||||||
|
p.outln(' (void)argc;')
|
||||||
|
p.outln(' return 0;')
|
||||||
|
p.outln('#endif')
|
||||||
|
p.outln('}')
|
||||||
|
end)
|
||||||
|
|
||||||
|
if res.value then
|
||||||
|
autoconf.set_value(cfg, variable, 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- try compiling a piece of c/c++
|
||||||
|
---
|
||||||
|
function autoconf.try_compile(cfg, cpp)
|
||||||
|
local ts = autoconf.toolset(cfg)
|
||||||
|
if ts then
|
||||||
|
return ts.try_compile(cfg, cpp, autoconf.parameters)
|
||||||
|
else
|
||||||
|
p.warnOnce('autoconf', 'no toolset found, autoconf always failing.')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function autoconf.cache_compile(cfg, entry, func, post)
|
||||||
|
if not autoconf.cache[entry] then
|
||||||
|
local cpp = p.capture(func)
|
||||||
|
local res = autoconf.try_compile(cfg, cpp)
|
||||||
|
if res then
|
||||||
|
local e = { binary = res, value = true }
|
||||||
|
if post then
|
||||||
|
post(e)
|
||||||
|
end
|
||||||
|
autoconf.cache[entry] = e
|
||||||
|
else
|
||||||
|
autoconf.cache[entry] = { }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return autoconf.cache[entry]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- get the current configured toolset, or the default.
|
||||||
|
---
|
||||||
|
function autoconf.toolset(cfg)
|
||||||
|
local ts = p.config.toolset(cfg)
|
||||||
|
if not ts then
|
||||||
|
local tools = {
|
||||||
|
-- Actually we always return nil on msc. see msc.lua
|
||||||
|
['vs2010'] = p.tools.msc,
|
||||||
|
['vs2012'] = p.tools.msc,
|
||||||
|
['vs2013'] = p.tools.msc,
|
||||||
|
['vs2015'] = p.tools.msc,
|
||||||
|
['vs2017'] = p.tools.msc,
|
||||||
|
['vs2019'] = p.tools.msc,
|
||||||
|
['gmake'] = premake.tools.gcc,
|
||||||
|
['gmake2'] = premake.tools.gcc,
|
||||||
|
['codelite'] = premake.tools.gcc,
|
||||||
|
['xcode4'] = premake.tools.clang,
|
||||||
|
}
|
||||||
|
ts = tools[_ACTION]
|
||||||
|
end
|
||||||
|
return ts
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- store the value of the variable in the configuration
|
||||||
|
---
|
||||||
|
function autoconf.set_value(cfg, variable, value)
|
||||||
|
cfg.autoconf[variable] = value
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- write the cfg.autoconf table to the file
|
||||||
|
---
|
||||||
|
function autoconf.writefile(cfg, filename)
|
||||||
|
if cfg.autoconf then
|
||||||
|
local file = io.open(filename, "w+")
|
||||||
|
for variable, value in pairs(cfg.autoconf) do
|
||||||
|
file:write('#define ' .. variable .. ' ' .. tostring(value) .. (_eol or '\n'))
|
||||||
|
end
|
||||||
|
file:close()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Utility method to add a table of headers.
|
||||||
|
---
|
||||||
|
function autoconf.include_headers(headers)
|
||||||
|
if headers ~= nil then
|
||||||
|
if type(headers) == "table" then
|
||||||
|
for _, v in ipairs(headers) do
|
||||||
|
p.outln('#include <' .. v .. '>')
|
||||||
|
end
|
||||||
|
else
|
||||||
|
p.outln('#include <' .. headers .. '>')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function autoconf.include_defines(defines)
|
||||||
|
if defines ~= nil then
|
||||||
|
if type(defines) == "table" then
|
||||||
|
for _, v in ipairs(defines) do
|
||||||
|
p.outln('#define ' .. v)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
p.outln('#define ' .. defines)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
---
|
||||||
|
-- attach ourselfs to the running action.
|
||||||
|
---
|
||||||
|
p.override(p.action, 'call', function (base, name)
|
||||||
|
local a = p.action.get(name)
|
||||||
|
|
||||||
|
-- store the old callback.
|
||||||
|
local onBaseProject = a.onProject or a.onproject
|
||||||
|
|
||||||
|
-- override it with our own.
|
||||||
|
a.onProject = function(prj)
|
||||||
|
-- go through each configuration, and call the setup configuration methods.
|
||||||
|
for cfg in p.project.eachconfig(prj) do
|
||||||
|
cfg.autoconf = {}
|
||||||
|
if cfg.autoconfigure then
|
||||||
|
verbosef('Running auto config steps for "%s/%s".', prj.name, cfg.name)
|
||||||
|
for file, func in pairs(cfg.autoconfigure) do
|
||||||
|
func(cfg)
|
||||||
|
|
||||||
|
if not (file ~= "dontWrite") then
|
||||||
|
os.mkdir(cfg.objdir)
|
||||||
|
local filename = path.join(cfg.objdir, file)
|
||||||
|
autoconf.writefile(cfg, filename)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- then call the old onProject.
|
||||||
|
if onBaseProject then
|
||||||
|
onBaseProject(prj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- now call the original action.call methods
|
||||||
|
base(name)
|
||||||
|
end)
|
||||||
18
autoconf/autoconf.lua
Normal file
18
autoconf/autoconf.lua
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
-- Autoconfiguration.
|
||||||
|
-- Copyright (c) 2016 Blizzard Entertainment
|
||||||
|
---
|
||||||
|
local p = premake
|
||||||
|
|
||||||
|
if not premake.modules.autoconf then
|
||||||
|
p.modules.autoconf = {}
|
||||||
|
p.modules.autoconf._VERSION = p._VERSION
|
||||||
|
|
||||||
|
verbosef('Loading autoconf module...')
|
||||||
|
include('api.lua')
|
||||||
|
include('msc.lua')
|
||||||
|
include('clang.lua')
|
||||||
|
include('gcc.lua')
|
||||||
|
end
|
||||||
|
|
||||||
|
return p.modules.autoconf
|
||||||
27
autoconf/clang.lua
Normal file
27
autoconf/clang.lua
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
-- Autoconfiguration.
|
||||||
|
-- Copyright (c) 2016 Blizzard Entertainment
|
||||||
|
---
|
||||||
|
local p = premake
|
||||||
|
local clang = p.tools.clang
|
||||||
|
|
||||||
|
function clang.try_compile(cfg, text, parameters)
|
||||||
|
-- write the text to a temporary file.
|
||||||
|
local cppFile = path.join(cfg.objdir, "temp.cpp")
|
||||||
|
if not io.writefile(cppFile, text) then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if parameters == nil then
|
||||||
|
parameters = ""
|
||||||
|
end
|
||||||
|
|
||||||
|
local outFile = path.join(cfg.objdir, "temp.out")
|
||||||
|
|
||||||
|
-- compile that text file.
|
||||||
|
if os.execute('clang "' .. cppFile .. '" ' .. parameters .. ' -o "' .. outFile ..'" &> /dev/null') then
|
||||||
|
return outFile
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
27
autoconf/gcc.lua
Normal file
27
autoconf/gcc.lua
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
-- Autoconfiguration.
|
||||||
|
-- Copyright (c) 2016 Blizzard Entertainment
|
||||||
|
---
|
||||||
|
local p = premake
|
||||||
|
local gcc = p.tools.gcc
|
||||||
|
|
||||||
|
function gcc.try_compile(cfg, text, parameters)
|
||||||
|
-- write the text to a temporary file.
|
||||||
|
local cppFile = path.join(cfg.objdir, "temp.cpp")
|
||||||
|
if not io.writefile(cppFile, text) then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if parameters == nil then
|
||||||
|
parameters = ""
|
||||||
|
end
|
||||||
|
|
||||||
|
local outFile = path.join(cfg.objdir, "temp.out")
|
||||||
|
|
||||||
|
-- compile that text file.
|
||||||
|
if os.execute('gcc "' .. cppFile .. '" ' .. parameters .. ' -o "' .. outFile ..'" &> /dev/null') then
|
||||||
|
return outFile
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
62
autoconf/msc.lua
Normal file
62
autoconf/msc.lua
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
-- Autoconfiguration.
|
||||||
|
-- Copyright (c) 2016 Blizzard Entertainment
|
||||||
|
---
|
||||||
|
local p = premake
|
||||||
|
local msc = p.tools.msc
|
||||||
|
|
||||||
|
-- "parameters" is unused, matter of fact this file is unused - re3
|
||||||
|
function msc.try_compile(cfg, text, parameters)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
--[[
|
||||||
|
-- write the text to a temporary file.
|
||||||
|
local cppFile = path.join(cfg.objdir, "temp.cpp")
|
||||||
|
if not io.writefile(cppFile, text) then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- write out a batch file.
|
||||||
|
local batch = p.capture(function ()
|
||||||
|
p.outln('@echo off')
|
||||||
|
p.outln('SET mypath=%~dp0')
|
||||||
|
p.outln('pushd %mypath%')
|
||||||
|
|
||||||
|
local map = {
|
||||||
|
vs2010 = 'VS100COMNTOOLS',
|
||||||
|
vs2012 = 'VS110COMNTOOLS',
|
||||||
|
vs2013 = 'VS120COMNTOOLS',
|
||||||
|
vs2015 = 'VS140COMNTOOLS',
|
||||||
|
vs2017 = 'VS141COMNTOOLS',
|
||||||
|
vs2019 = 'VS142COMNTOOLS',
|
||||||
|
}
|
||||||
|
|
||||||
|
local a = map[_ACTION]
|
||||||
|
if a then
|
||||||
|
a = path.translate(os.getenv(a), '/')
|
||||||
|
a = path.join(a, '../../VC/vcvarsall.bat')
|
||||||
|
|
||||||
|
if cfg.platform == 'x86' then
|
||||||
|
p.outln('call "' .. a .. '" > NUL')
|
||||||
|
else
|
||||||
|
p.outln('call "' .. a .. '" amd64 > NUL')
|
||||||
|
end
|
||||||
|
|
||||||
|
p.outln('cl.exe /nologo temp.cpp > NUL')
|
||||||
|
else
|
||||||
|
error('Unsupported Visual Studio version: ' .. _ACTION)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
local batchFile = path.join(cfg.objdir, "compile.bat")
|
||||||
|
if not io.writefile(batchFile, batch) then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if os.execute(batchFile) then
|
||||||
|
return path.join(cfg.objdir, "temp.exe")
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
--]]
|
||||||
|
end
|
||||||
34
cmake/FindMilesSDK.cmake
Normal file
34
cmake/FindMilesSDK.cmake
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# - Find Miles SDK
|
||||||
|
# Find the Miles SDK header + import library
|
||||||
|
#
|
||||||
|
# MilesSDK_INCLUDE_DIR - Where to find mss.h
|
||||||
|
# MilesSDK_LIBRARIES - List of libraries when using MilesSDK.
|
||||||
|
# MilesSDK_FOUND - True if Miles SDK found.
|
||||||
|
# MilesSDK::MilesSDK - Imported library of Miles SDK
|
||||||
|
|
||||||
|
find_path(MilesSDK_INCLUDE_DIR mss.h
|
||||||
|
PATHS "${MilesSDK_DIR}"
|
||||||
|
PATH_SUFFIXES include
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
set(_miles_sdk_libname mss64)
|
||||||
|
else()
|
||||||
|
set(_miles_sdk_libname mss32)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_library(MilesSDK_LIBRARIES NAMES ${_miles_sdk_libname}
|
||||||
|
PATHS "${MilesSDK_DIR}"
|
||||||
|
PATH_SUFFIXES lib
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(MilesSDK DEFAULT_MSG MilesSDK_LIBRARIES MilesSDK_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if(NOT TARGET MilesSDK::MilesSDK)
|
||||||
|
add_library(MilesSDK::MilesSDK UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(MilesSDK::MilesSDK PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${MilesSDK_LIBRARIES}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${MilesSDK_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
67
cmake/FindSndFile.cmake
Normal file
67
cmake/FindSndFile.cmake
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
# Found on http://hg.kvats.net
|
||||||
|
#
|
||||||
|
# - Try to find libsndfile
|
||||||
|
#
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# SNDFILE_FOUND - system has libsndfile
|
||||||
|
# SNDFILE_INCLUDE_DIRS - the libsndfile include directory
|
||||||
|
# SNDFILE_LIBRARIES - Link these to use libsndfile
|
||||||
|
# SNDFILE_CFLAGS - Compile options to use libsndfile
|
||||||
|
# SndFile::SndFile - Imported library of libsndfile
|
||||||
|
#
|
||||||
|
# Copyright (C) 2006 Wengo
|
||||||
|
#
|
||||||
|
# Redistribution and use is allowed according to the terms of the New
|
||||||
|
# BSD license.
|
||||||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
#
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
if(PKG_CONFIG_FOUND)
|
||||||
|
pkg_search_module(PKG_SNDFILE "sndfile")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(SNDFILE_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
sndfile.h
|
||||||
|
HINTS
|
||||||
|
${PKG_SNDFILE_INCLUDE_DIRS}
|
||||||
|
PATHS
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
/opt/local/include
|
||||||
|
/sw/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(SNDFILE_LIBRARY
|
||||||
|
NAMES
|
||||||
|
sndfile
|
||||||
|
HINTS
|
||||||
|
${PKG_SNDFILE_LIBRARIES}
|
||||||
|
PATHS
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
set(SNDFILE_CFLAGS "${PKG_SNDFILE_CFLAGS_OTHER}" CACHE STRING "CFLAGS of libsndfile")
|
||||||
|
|
||||||
|
set(SNDFILE_INCLUDE_DIRS "${SNDFILE_INCLUDE_DIR}")
|
||||||
|
set(SNDFILE_LIBRARIES "${SNDFILE_LIBRARY}")
|
||||||
|
|
||||||
|
if(SNDFILE_INCLUDE_DIRS AND SNDFILE_LIBRARIES)
|
||||||
|
set(SNDFILE_FOUND TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(SndFile DEFAULT_MSG SNDFILE_INCLUDE_DIRS SNDFILE_LIBRARIES)
|
||||||
|
|
||||||
|
if(NOT TARGET SndFile::SndFile)
|
||||||
|
add_library(__SndFile INTERFACE)
|
||||||
|
target_compile_options(__SndFile INTERFACE ${SNDFILE_CFLAGS})
|
||||||
|
target_include_directories(__SndFile INTERFACE ${SNDFILE_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(__SndFile INTERFACE ${SNDFILE_LIBRARIES})
|
||||||
|
add_library(SndFile::SndFile ALIAS __SndFile)
|
||||||
|
endif()
|
||||||
38
cmake/Findmpg123.cmake
Normal file
38
cmake/Findmpg123.cmake
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# - Find mpg123
|
||||||
|
# Find the native mpg123 includes and library
|
||||||
|
#
|
||||||
|
# mpg123_INCLUDE_DIR - Where to find mpg123.h
|
||||||
|
# mpg123_LIBRARIES - List of libraries when using mpg123.
|
||||||
|
# mpg123_CFLAGS - Compile options to use mpg123
|
||||||
|
# mpg123_FOUND - True if mpg123 found.
|
||||||
|
# MPG123::libmpg123 - Imported library of libmpg123
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
if(PKG_CONFIG_FOUND)
|
||||||
|
pkg_search_module(PKG_MPG123 mpg123)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(mpg123_INCLUDE_DIR mpg123.h
|
||||||
|
HINTS ${PKG_MPG123_INCLUDE_DIRS}
|
||||||
|
PATHS "${mpg123_DIR}"
|
||||||
|
PATH_SUFFIXES include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(mpg123_LIBRARIES NAMES mpg123 mpg123-0 libmpg123-0
|
||||||
|
HINTS ${PKG_MPG123_LIBRARIES}
|
||||||
|
PATHS "${mpg123_DIR}"
|
||||||
|
PATH_SUFFIXES lib
|
||||||
|
)
|
||||||
|
|
||||||
|
set(mpg123_CFLAGS "${PKG_MPG123_CFLAGS_OTHER}" CACHE STRING "CFLAGS of mpg123")
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(mpg123 DEFAULT_MSG mpg123_LIBRARIES mpg123_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if(NOT TARGET MPG123::libmpg123)
|
||||||
|
add_library(__libmpg123 INTERFACE)
|
||||||
|
target_compile_options(__libmpg123 INTERFACE ${mpg123_CFLAGS})
|
||||||
|
target_include_directories(__libmpg123 INTERFACE ${mpg123_INCLUDE_DIR})
|
||||||
|
target_link_libraries(__libmpg123 INTERFACE ${mpg123_LIBRARIES})
|
||||||
|
add_library(MPG123::libmpg123 ALIAS __libmpg123)
|
||||||
|
endif()
|
||||||
64
cmake/Findopusfile.cmake
Normal file
64
cmake/Findopusfile.cmake
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# - Try to find opusfile
|
||||||
|
#
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# OPUSFILE_FOUND - system has opusfile
|
||||||
|
# OPUSFILE_INCLUDE_DIRS - the opusfile include directories
|
||||||
|
# OPUSFILE_LIBRARIES - Link these to use opusfile
|
||||||
|
# OPUSFILE_CFLAGS - Compile options to use opusfile
|
||||||
|
# opusfile::opusfile - Imported library of opusfile
|
||||||
|
#
|
||||||
|
|
||||||
|
# FIXME: opusfile does not ship an official opusfile cmake script,
|
||||||
|
# rename this file/variables/target when/if it has.
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
if(PKG_CONFIG_FOUND)
|
||||||
|
pkg_search_module(PKG_OPUSFILE "opusfile")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(OPUSFILE_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
opusfile.h
|
||||||
|
PATH_SUFFIXES
|
||||||
|
opusfile
|
||||||
|
HINTS
|
||||||
|
${PKG_OPUSFILE_INCLUDE_DIRS}
|
||||||
|
PATHS
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
/opt/local/include
|
||||||
|
/sw/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(OPUSFILE_LIBRARY
|
||||||
|
NAMES
|
||||||
|
opusfile
|
||||||
|
HINTS
|
||||||
|
${PKG_OPUSFILE_LIBRARIES}
|
||||||
|
PATHS
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
set(OPUSFILE_CFLAGS "${PKG_OPUSFILE_CFLAGS_OTHER}" CACHE STRING "CFLAGS of opusfile")
|
||||||
|
|
||||||
|
set(OPUSFILE_INCLUDE_DIRS "${OPUSFILE_INCLUDE_DIR}")
|
||||||
|
set(OPUSFILE_LIBRARIES "${OPUSFILE_LIBRARY}")
|
||||||
|
|
||||||
|
if (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES)
|
||||||
|
set(OPUSFILE_FOUND TRUE)
|
||||||
|
endif (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(opusfile DEFAULT_MSG OPUSFILE_INCLUDE_DIRS OPUSFILE_LIBRARIES)
|
||||||
|
|
||||||
|
if(NOT TARGET opusfile::opusfile)
|
||||||
|
add_library(__opusfile INTERFACE)
|
||||||
|
target_compile_options(__opusfile INTERFACE ${OPUSFILE_CFLAGS})
|
||||||
|
target_include_directories(__opusfile INTERFACE ${OPUSFILE_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(__opusfile INTERFACE ${OPUSFILE_LIBRARIES})
|
||||||
|
add_library(opusfile::opusfile ALIAS __opusfile)
|
||||||
|
endif()
|
||||||
284
cmake/GetGitRevisionDescription.cmake
Normal file
284
cmake/GetGitRevisionDescription.cmake
Normal file
@@ -0,0 +1,284 @@
|
|||||||
|
# - Returns a version string from Git
|
||||||
|
#
|
||||||
|
# These functions force a re-configure on each git commit so that you can
|
||||||
|
# trust the values of the variables in your build system.
|
||||||
|
#
|
||||||
|
# get_git_head_revision(<refspecvar> <hashvar> [ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR])
|
||||||
|
#
|
||||||
|
# Returns the refspec and sha hash of the current head revision
|
||||||
|
#
|
||||||
|
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||||
|
#
|
||||||
|
# Returns the results of git describe on the source tree, and adjusting
|
||||||
|
# the output so that it tests false if an error occurs.
|
||||||
|
#
|
||||||
|
# git_describe_working_tree(<var> [<additional arguments to git describe> ...])
|
||||||
|
#
|
||||||
|
# Returns the results of git describe on the working tree (--dirty option),
|
||||||
|
# and adjusting the output so that it tests false if an error occurs.
|
||||||
|
#
|
||||||
|
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||||
|
#
|
||||||
|
# Returns the results of git describe --exact-match on the source tree,
|
||||||
|
# and adjusting the output so that it tests false if there was no exact
|
||||||
|
# matching tag.
|
||||||
|
#
|
||||||
|
# git_local_changes(<var>)
|
||||||
|
#
|
||||||
|
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
|
||||||
|
# Uses the return code of "git diff-index --quiet HEAD --".
|
||||||
|
# Does not regard untracked files.
|
||||||
|
#
|
||||||
|
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||||
|
#
|
||||||
|
# Original Author:
|
||||||
|
# 2009-2020 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
|
||||||
|
# http://academic.cleardefinition.com
|
||||||
|
#
|
||||||
|
# Copyright 2009-2013, Iowa State University.
|
||||||
|
# Copyright 2013-2020, Ryan Pavlik
|
||||||
|
# Copyright 2013-2020, Contributors
|
||||||
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
if(__get_git_revision_description)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(__get_git_revision_description YES)
|
||||||
|
|
||||||
|
# We must run the following at "include" time, not at function call time,
|
||||||
|
# to find the path to this module rather than the path to a calling list file
|
||||||
|
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
|
||||||
|
# Function _git_find_closest_git_dir finds the next closest .git directory
|
||||||
|
# that is part of any directory in the path defined by _start_dir.
|
||||||
|
# The result is returned in the parent scope variable whose name is passed
|
||||||
|
# as variable _git_dir_var. If no .git directory can be found, the
|
||||||
|
# function returns an empty string via _git_dir_var.
|
||||||
|
#
|
||||||
|
# Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and
|
||||||
|
# neither foo nor bar contain a file/directory .git. This wil return
|
||||||
|
# C:/bla/.git
|
||||||
|
#
|
||||||
|
function(_git_find_closest_git_dir _start_dir _git_dir_var)
|
||||||
|
set(cur_dir "${_start_dir}")
|
||||||
|
set(git_dir "${_start_dir}/.git")
|
||||||
|
while(NOT EXISTS "${git_dir}")
|
||||||
|
# .git dir not found, search parent directories
|
||||||
|
set(git_previous_parent "${cur_dir}")
|
||||||
|
get_filename_component(cur_dir ${cur_dir} DIRECTORY)
|
||||||
|
if(cur_dir STREQUAL git_previous_parent)
|
||||||
|
# We have reached the root directory, we are not in git
|
||||||
|
set(${_git_dir_var}
|
||||||
|
""
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(git_dir "${cur_dir}/.git")
|
||||||
|
endwhile()
|
||||||
|
set(${_git_dir_var}
|
||||||
|
"${git_dir}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(get_git_head_revision _refspecvar _hashvar)
|
||||||
|
_git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR)
|
||||||
|
|
||||||
|
if("${ARGN}" STREQUAL "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
|
||||||
|
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR TRUE)
|
||||||
|
else()
|
||||||
|
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR FALSE)
|
||||||
|
endif()
|
||||||
|
if(NOT "${GIT_DIR}" STREQUAL "")
|
||||||
|
file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}"
|
||||||
|
"${GIT_DIR}")
|
||||||
|
if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR)
|
||||||
|
# We've gone above the CMake root dir.
|
||||||
|
set(GIT_DIR "")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if("${GIT_DIR}" STREQUAL "")
|
||||||
|
set(${_refspecvar}
|
||||||
|
"GITDIR-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
set(${_hashvar}
|
||||||
|
"GITDIR-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Check if the current source dir is a git submodule or a worktree.
|
||||||
|
# In both cases .git is a file instead of a directory.
|
||||||
|
#
|
||||||
|
if(NOT IS_DIRECTORY ${GIT_DIR})
|
||||||
|
# The following git command will return a non empty string that
|
||||||
|
# points to the super project working tree if the current
|
||||||
|
# source dir is inside a git submodule.
|
||||||
|
# Otherwise the command will return an empty string.
|
||||||
|
#
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" rev-parse
|
||||||
|
--show-superproject-working-tree
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
OUTPUT_VARIABLE out
|
||||||
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(NOT "${out}" STREQUAL "")
|
||||||
|
# If out is empty, GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a submodule
|
||||||
|
file(READ ${GIT_DIR} submodule)
|
||||||
|
string(REGEX REPLACE "gitdir: (.*)$" "\\1" GIT_DIR_RELATIVE
|
||||||
|
${submodule})
|
||||||
|
string(STRIP ${GIT_DIR_RELATIVE} GIT_DIR_RELATIVE)
|
||||||
|
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
|
||||||
|
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE}
|
||||||
|
ABSOLUTE)
|
||||||
|
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
|
||||||
|
else()
|
||||||
|
# GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a worktree
|
||||||
|
file(READ ${GIT_DIR} worktree_ref)
|
||||||
|
# The .git directory contains a path to the worktree information directory
|
||||||
|
# inside the parent git repo of the worktree.
|
||||||
|
#
|
||||||
|
string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir
|
||||||
|
${worktree_ref})
|
||||||
|
string(STRIP ${git_worktree_dir} git_worktree_dir)
|
||||||
|
_git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR)
|
||||||
|
set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
|
||||||
|
endif()
|
||||||
|
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
||||||
|
if(NOT EXISTS "${GIT_DATA}")
|
||||||
|
file(MAKE_DIRECTORY "${GIT_DATA}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT EXISTS "${HEAD_SOURCE_FILE}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
||||||
|
configure_file("${HEAD_SOURCE_FILE}" "${HEAD_FILE}" COPYONLY)
|
||||||
|
|
||||||
|
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
|
||||||
|
"${GIT_DATA}/grabRef.cmake" @ONLY)
|
||||||
|
include("${GIT_DATA}/grabRef.cmake")
|
||||||
|
|
||||||
|
set(${_refspecvar}
|
||||||
|
"${HEAD_REF}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
set(${_hashvar}
|
||||||
|
"${HEAD_HASH}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_describe _var)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
find_package(Git QUIET)
|
||||||
|
endif()
|
||||||
|
get_git_head_revision(refspec hash)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
set(${_var}
|
||||||
|
"GIT-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
if(NOT hash)
|
||||||
|
set(${_var}
|
||||||
|
"HEAD-HASH-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# TODO sanitize
|
||||||
|
#if((${ARGN}" MATCHES "&&") OR
|
||||||
|
# (ARGN MATCHES "||") OR
|
||||||
|
# (ARGN MATCHES "\\;"))
|
||||||
|
# message("Please report the following error to the project!")
|
||||||
|
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
||||||
|
#endif()
|
||||||
|
|
||||||
|
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" describe --tags --always ${hash} ${ARGN}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
OUTPUT_VARIABLE out
|
||||||
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(NOT res EQUAL 0)
|
||||||
|
set(out "${out}-${res}-NOTFOUND")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${_var}
|
||||||
|
"${out}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_describe_working_tree _var)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
find_package(Git QUIET)
|
||||||
|
endif()
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
set(${_var}
|
||||||
|
"GIT-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" describe --dirty ${ARGN}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
OUTPUT_VARIABLE out
|
||||||
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(NOT res EQUAL 0)
|
||||||
|
set(out "${out}-${res}-NOTFOUND")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${_var}
|
||||||
|
"${out}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_get_exact_tag _var)
|
||||||
|
git_describe(out --exact-match ${ARGN})
|
||||||
|
set(${_var}
|
||||||
|
"${out}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_local_changes _var)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
find_package(Git QUIET)
|
||||||
|
endif()
|
||||||
|
get_git_head_revision(refspec hash)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
set(${_var}
|
||||||
|
"GIT-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
if(NOT hash)
|
||||||
|
set(${_var}
|
||||||
|
"HEAD-HASH-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
OUTPUT_VARIABLE out
|
||||||
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(res EQUAL 0)
|
||||||
|
set(${_var}
|
||||||
|
"CLEAN"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${_var}
|
||||||
|
"DIRTY"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
43
cmake/GetGitRevisionDescription.cmake.in
Normal file
43
cmake/GetGitRevisionDescription.cmake.in
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#
|
||||||
|
# Internal file for GetGitRevisionDescription.cmake
|
||||||
|
#
|
||||||
|
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||||
|
#
|
||||||
|
# Original Author:
|
||||||
|
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||||
|
# http://academic.cleardefinition.com
|
||||||
|
# Iowa State University HCI Graduate Program/VRAC
|
||||||
|
#
|
||||||
|
# Copyright 2009-2012, Iowa State University
|
||||||
|
# Copyright 2011-2015, Contributors
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
set(HEAD_HASH)
|
||||||
|
|
||||||
|
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
|
||||||
|
|
||||||
|
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
||||||
|
if(HEAD_CONTENTS MATCHES "ref")
|
||||||
|
# named branch
|
||||||
|
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||||
|
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||||
|
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||||
|
else()
|
||||||
|
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
|
||||||
|
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
|
||||||
|
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
|
||||||
|
set(HEAD_HASH "${CMAKE_MATCH_1}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# detached HEAD
|
||||||
|
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT HEAD_HASH)
|
||||||
|
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
||||||
|
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||||
|
endif()
|
||||||
38
cmake/nx/NXFunctions.cmake
Normal file
38
cmake/nx/NXFunctions.cmake
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
if(NOT COMMAND nx_generate_nacp)
|
||||||
|
message(FATAL_ERROR "The `nx_generate_nacp` cmake command is not available. Please use an appropriate Nintendo Switch toolchain.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT COMMAND nx_create_nro)
|
||||||
|
message(FATAL_ERROR "The `nx_create_nro` cmake command is not available. Please use an appropriate Nintendo Switch toolchain.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX ".elf")
|
||||||
|
|
||||||
|
function(re3_platform_target TARGET)
|
||||||
|
cmake_parse_arguments(RPT "INSTALL" "" "" ${ARGN})
|
||||||
|
|
||||||
|
get_target_property(TARGET_TYPE "${TARGET}" TYPE)
|
||||||
|
if(TARGET_TYPE STREQUAL "EXECUTABLE")
|
||||||
|
nx_generate_nacp(${TARGET}.nacp
|
||||||
|
NAME "${TARGET}"
|
||||||
|
AUTHOR "${${PROJECT}_AUTHOR}"
|
||||||
|
VERSION "1.0.0-${GIT_SHA1}"
|
||||||
|
)
|
||||||
|
|
||||||
|
nx_create_nro(${TARGET}
|
||||||
|
NACP ${TARGET}.nacp
|
||||||
|
ICON "${PROJECT_SOURCE_DIR}/res/images/logo_256.jpg"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(${PROJECT}_INSTALL AND RPT_INSTALL)
|
||||||
|
get_target_property(TARGET_OUTPUT_NAME ${TARGET} OUTPUT_NAME)
|
||||||
|
if(NOT TARGET_OUTPUT_NAME)
|
||||||
|
set(TARGET_OUTPUT_NAME "${TARGET}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_OUTPUT_NAME}.nro"
|
||||||
|
DESTINATION "."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
0
codewarrior/Release/gta3.txt
Normal file
0
codewarrior/Release/gta3.txt
Normal file
15378
codewarrior/re3.mcp.xml
Normal file
15378
codewarrior/re3.mcp.xml
Normal file
File diff suppressed because it is too large
Load Diff
135
conanfile.py
Normal file
135
conanfile.py
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
from conans import ConanFile, CMake, tools
|
||||||
|
from conans.errors import ConanException, ConanInvalidConfiguration
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import textwrap
|
||||||
|
|
||||||
|
|
||||||
|
class Re3Conan(ConanFile):
|
||||||
|
name = "re3"
|
||||||
|
version = "master"
|
||||||
|
license = "???" # FIXME: https://github.com/GTAmodding/re3/issues/794
|
||||||
|
settings = "os", "arch", "compiler", "build_type"
|
||||||
|
generators = "cmake", "cmake_find_package"
|
||||||
|
options = {
|
||||||
|
"audio": ["openal", "miles"],
|
||||||
|
"with_libsndfile": [True, False],
|
||||||
|
"with_opus": [True, False],
|
||||||
|
}
|
||||||
|
default_options = {
|
||||||
|
"audio": "openal",
|
||||||
|
"with_libsndfile": False,
|
||||||
|
"with_opus": False,
|
||||||
|
# "libsndfile:with_external_libs": False,
|
||||||
|
# "mpg123:flexible_resampling": False,
|
||||||
|
# "mpg123:network": False,
|
||||||
|
# "mpg123:icy": False,
|
||||||
|
# "mpg123:id3v2": False,
|
||||||
|
# "mpg123:ieeefloat": False,
|
||||||
|
# "mpg123:layer1": False,
|
||||||
|
# "mpg123:layer2": False,
|
||||||
|
# "mpg123:layer3": False,
|
||||||
|
# "mpg123:moreinfo": False,
|
||||||
|
# "sdl2:vulkan": False,
|
||||||
|
# "sdl2:opengl": True,
|
||||||
|
# "sdl2:sdl2main": True,
|
||||||
|
}
|
||||||
|
no_copy_source = True
|
||||||
|
|
||||||
|
@property
|
||||||
|
def _os_is_playstation2(self):
|
||||||
|
try:
|
||||||
|
return self.settings.os == "Playstation2"
|
||||||
|
except ConanException:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def configure(self):
|
||||||
|
if self.options.audio != "openal":
|
||||||
|
self.options.with_libsndfile = False
|
||||||
|
|
||||||
|
def requirements(self):
|
||||||
|
self.requires("librw/{}".format(self.version))
|
||||||
|
self.requires("mpg123/1.26.4")
|
||||||
|
if self.options.audio == "openal":
|
||||||
|
self.requires("openal/1.21.0")
|
||||||
|
elif self.options.audio == "miles":
|
||||||
|
self.requires("miles-sdk/{}".format(self.version))
|
||||||
|
if self.options.with_libsndfile:
|
||||||
|
self.requires("libsndfile/1.0.30")
|
||||||
|
if self.options.with_opus:
|
||||||
|
self.requires("opusfile/0.12")
|
||||||
|
|
||||||
|
def export_sources(self):
|
||||||
|
for d in ("cmake", "gamefiles", "src"):
|
||||||
|
shutil.copytree(src=d, dst=os.path.join(self.export_sources_folder, d))
|
||||||
|
self.copy("CMakeLists.txt")
|
||||||
|
|
||||||
|
def validate(self):
|
||||||
|
if self.options["librw"].platform == "gl3" and self.options["librw"].gl3_gfxlib != "glfw":
|
||||||
|
raise ConanInvalidConfiguration("Only `glfw` is supported as gl3_gfxlib.")
|
||||||
|
#if not self.options.with_opus:
|
||||||
|
# if not self.options["libsndfile"].with_external_libs:
|
||||||
|
# raise ConanInvalidConfiguration("re3 with opus support requires a libsndfile built with external libs (=ogg/flac/opus/vorbis)")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def _re3_audio(self):
|
||||||
|
return {
|
||||||
|
"miles": "MSS",
|
||||||
|
"openal": "OAL",
|
||||||
|
}[str(self.options.audio)]
|
||||||
|
|
||||||
|
def build(self):
|
||||||
|
if self.source_folder == self.build_folder:
|
||||||
|
raise Exception("cannot build with source_folder == build_folder")
|
||||||
|
try:
|
||||||
|
os.unlink(os.path.join(self.install_folder, "Findlibrw.cmake"))
|
||||||
|
tools.save("FindOpenAL.cmake",
|
||||||
|
textwrap.dedent(
|
||||||
|
"""
|
||||||
|
set(OPENAL_FOUND ON)
|
||||||
|
set(OPENAL_INCLUDE_DIR ${OpenAL_INCLUDE_DIRS})
|
||||||
|
set(OPENAL_LIBRARY ${OpenAL_LIBRARIES})
|
||||||
|
set(OPENAL_DEFINITIONS ${OpenAL_DEFINITIONS})
|
||||||
|
"""), append=True)
|
||||||
|
if self.options["librw"].platform == "gl3" and self.options["librw"].gl3_gfxlib == "glfw":
|
||||||
|
tools.save("Findglfw3.cmake",
|
||||||
|
textwrap.dedent(
|
||||||
|
"""
|
||||||
|
if(NOT TARGET glfw)
|
||||||
|
message(STATUS "Creating glfw TARGET")
|
||||||
|
add_library(glfw INTERFACE IMPORTED)
|
||||||
|
set_target_properties(glfw PROPERTIES
|
||||||
|
INTERFACE_LINK_LIBRARIES CONAN_PKG::glfw)
|
||||||
|
endif()
|
||||||
|
"""), append=True)
|
||||||
|
tools.save("CMakeLists.txt",
|
||||||
|
textwrap.dedent(
|
||||||
|
"""
|
||||||
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
project(cmake_wrapper)
|
||||||
|
|
||||||
|
include("{}/conanbuildinfo.cmake")
|
||||||
|
conan_basic_setup(TARGETS NO_OUTPUT_DIRS)
|
||||||
|
|
||||||
|
add_subdirectory("{}" re3)
|
||||||
|
""").format(self.install_folder.replace("\\", "/"),
|
||||||
|
self.source_folder.replace("\\", "/")))
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
cmake = CMake(self)
|
||||||
|
cmake.definitions["RE3_AUDIO"] = self._re3_audio
|
||||||
|
cmake.definitions["RE3_WITH_OPUS"] = self.options.with_opus
|
||||||
|
cmake.definitions["RE3_INSTALL"] = True
|
||||||
|
cmake.definitions["RE3_VENDORED_LIBRW"] = False
|
||||||
|
env = {}
|
||||||
|
if self._os_is_playstation2:
|
||||||
|
cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = self.deps_user_info["ps2dev-cmaketoolchain"].cmake_toolchain_file
|
||||||
|
env["PS2SDK"] = self.deps_cpp_info["ps2dev-ps2sdk"].rootpath
|
||||||
|
|
||||||
|
with tools.environment_append(env):
|
||||||
|
cmake.configure(source_folder=self.build_folder)
|
||||||
|
cmake.build()
|
||||||
|
|
||||||
|
def package(self):
|
||||||
|
cmake = CMake(self)
|
||||||
|
cmake.install()
|
||||||
@@ -4,35 +4,27 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Put the filename of the output binary here
|
# Put the filename of the output binary here
|
||||||
PROJECT_NAME = dca-liberty
|
PROJECT_NAME = dca3
|
||||||
TEAM_NAME ="the gang"
|
TARGET ?= dca3.elf
|
||||||
DISC_SERIAL = DCA-LBRT
|
|
||||||
RELEASE_DATE = 20250401
|
|
||||||
TARGET ?= dca-liberty.elf
|
|
||||||
|
|
||||||
HAVE_CDI4DC := $(shell which cdi4dc > /dev/null 2>&1 && echo "yes" || echo "no")
|
HAVE_CDI4DC := $(shell which cdi4dc > /dev/null 2>&1 && echo "yes" || echo "no")
|
||||||
IS_MAC := $(shell uname -s | grep -i "darwin" > /dev/null && echo "yes" || echo "no")
|
IS_MAC := $(shell uname -s | grep -i "darwin" > /dev/null && echo "yes" || echo "no")
|
||||||
|
|
||||||
MOD_NAME?=
|
MOD_NAME?=
|
||||||
|
|
||||||
GTA_DIR?=../../liberty
|
GTA_DIR?=../../gta3
|
||||||
GTA_GAMEFILES_LOOSE_DIR?=../gamefiles/liberty
|
GTA_MOD_DIR?=../../gta3_mod$(MOD_NAME)
|
||||||
GTA_MOD_DIR?=../../liberty_mod$(MOD_NAME)
|
|
||||||
GTA_MOD_IMG_DIR?=$(GTA_MOD_DIR)/img
|
GTA_MOD_IMG_DIR?=$(GTA_MOD_DIR)/img
|
||||||
GTA_MOD_CUTS_DIR=$(GTA_MOD_DIR)/cuts
|
|
||||||
GTA_MOD_SFX_DIR?=$(GTA_MOD_DIR)/sfx
|
GTA_MOD_SFX_DIR?=$(GTA_MOD_DIR)/sfx
|
||||||
GTA_MOD_LOOSE_DIR?=$(GTA_MOD_DIR)/loose
|
GTA_MOD_LOOSE_DIR?=$(GTA_MOD_DIR)/loose
|
||||||
|
|
||||||
REPACK_DIR?=repack-data
|
REPACK_DIR?=repack-data
|
||||||
REPACK_GTA_DIR?=$(REPACK_DIR)/liberty
|
REPACK_GTA_DIR?=$(REPACK_DIR)/gta3
|
||||||
REPACK_IMG_ORIG_DIR?=$(REPACK_DIR)/img-orig
|
REPACK_IMG_ORIG_DIR?=$(REPACK_DIR)/img-orig
|
||||||
REPACK_IMG_DC_DIR?=$(REPACK_DIR)/img-dc
|
REPACK_IMG_DC_DIR?=$(REPACK_DIR)/img-dc
|
||||||
REPACK_SFX_ORIG_DIR?=$(REPACK_DIR)/sfx-orig
|
REPACK_SFX_ORIG_DIR?=$(REPACK_DIR)/sfx-orig
|
||||||
REPACK_SFX_DC_DIR?=$(REPACK_DIR)/sfx-dc
|
REPACK_SFX_DC_DIR?=$(REPACK_DIR)/sfx-dc
|
||||||
REPACK_STREAM_DECODED_DIR?=$(REPACK_DIR)/stream-decoded
|
REPACK_STREAM_DECODED_DIR?=$(REPACK_DIR)/stream-decoded
|
||||||
REPACK_STREAM_DEST_DIR=$(REPACK_GTA_DIR)/stream
|
|
||||||
REPACK_CUTS_ORIG_DIR?=$(REPACK_DIR)/cuts-orig
|
|
||||||
REPACK_CUTS_DC_DIR?=$(REPACK_DIR)/cuts-dc
|
|
||||||
|
|
||||||
LIBS :=
|
LIBS :=
|
||||||
TEXCONV_FLAGS :=
|
TEXCONV_FLAGS :=
|
||||||
@@ -46,9 +38,6 @@ MKDCDISC_PAD_OPTION=-N
|
|||||||
ifeq ($(FOR_DISC),1)
|
ifeq ($(FOR_DISC),1)
|
||||||
AUDIO_STREAM_OPTION=-q
|
AUDIO_STREAM_OPTION=-q
|
||||||
MKDCDISC_PAD_OPTION=
|
MKDCDISC_PAD_OPTION=
|
||||||
else ifeq ($(FOR_DISC),2)
|
|
||||||
AUDIO_STREAM_OPTION=-m
|
|
||||||
MKDCDISC_PAD_OPTION=
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
@@ -56,8 +45,8 @@ all: $(TARGET)
|
|||||||
include common.mk
|
include common.mk
|
||||||
|
|
||||||
OBJS = $(RE3_OBJS) $(RW_OBJS) \
|
OBJS = $(RE3_OBJS) $(RW_OBJS) \
|
||||||
../src/liberty/audio/sampman_dc.o \
|
../src/audio/sampman_dc.o \
|
||||||
../src/common/prof/profiler.o
|
../src/prof/profiler.o
|
||||||
|
|
||||||
OBJS_TEXCONV = $(RW_OBJS:.o=.texconv.o)
|
OBJS_TEXCONV = $(RW_OBJS:.o=.texconv.o)
|
||||||
OBJS_TEXCONV += \
|
OBJS_TEXCONV += \
|
||||||
@@ -71,51 +60,44 @@ OBJS_TEXCONV += \
|
|||||||
../vendor/koshle/hlepvr_irq.texconv.o \
|
../vendor/koshle/hlepvr_irq.texconv.o \
|
||||||
../vendor/koshle/hlematrix3d.texconv.o \
|
../vendor/koshle/hlematrix3d.texconv.o \
|
||||||
../vendor/librw/src/dc/vq.texconv.o \
|
../vendor/librw/src/dc/vq.texconv.o \
|
||||||
../src/liberty/fakerw/fake.texconv.o \
|
../src/fakerw/fake.texconv.o \
|
||||||
../src/liberty/skel/crossplatform.texconv.o \
|
../src/skel/crossplatform.texconv.o \
|
||||||
../src/liberty/rw/TxdStore.texconv.o \
|
../src/rw/TxdStore.texconv.o \
|
||||||
../src/tools/texconv.texconv.o \
|
texconv.texconv.o \
|
||||||
../vendor/TriStripper/src/connectivity_graph.texconv.o \
|
../vendor/TriStripper/src/connectivity_graph.texconv.o \
|
||||||
../vendor/TriStripper/src/policy.texconv.o \
|
../vendor/TriStripper/src/policy.texconv.o \
|
||||||
../vendor/TriStripper/src/tri_stripper.texconv.o \
|
../vendor/TriStripper/src/tri_stripper.texconv.o \
|
||||||
../src/liberty/rw/VisibilityPlugins.texconv.o \
|
../src/rw/VisibilityPlugins.texconv.o \
|
||||||
../src/liberty/rw/NodeName.texconv.o \
|
../src/rw/NodeName.texconv.o \
|
||||||
../src/liberty/animation/RpAnimBlend.texconv.o \
|
../src/animation/RpAnimBlend.texconv.o \
|
||||||
../src/liberty/animation/Bones.texconv.o \
|
../src/animation/Bones.texconv.o \
|
||||||
../src/liberty/animation/AnimBlendAssociation.texconv.o \
|
../src/animation/AnimBlendAssociation.texconv.o \
|
||||||
../src/liberty/animation/AnimBlendNode.texconv.o \
|
../src/animation/AnimBlendNode.texconv.o \
|
||||||
../src/liberty/animation/AnimBlendClumpData.texconv.o \
|
../src/animation/AnimBlendClumpData.texconv.o \
|
||||||
../src/liberty/rw/MemoryMgr.texconv.o \
|
../src/rw/MemoryMgr.texconv.o \
|
||||||
../src/liberty/math/Quaternion.texconv.o \
|
../src/math/Quaternion.texconv.o \
|
||||||
../vendor/librw/src/ps2-x/ps2.texconv.o \
|
|
||||||
../vendor/librw/src/ps2-x/ps2device.texconv.o \
|
|
||||||
../vendor/librw/src/ps2-x/ps2raster.texconv.o \
|
|
||||||
../vendor/librw/src/ps2-x/ps2skin.texconv.o \
|
|
||||||
../vendor/librw/src/d3d-x/d3d.texconv.o \
|
../vendor/librw/src/d3d-x/d3d.texconv.o \
|
||||||
../vendor/librw/src/d3d-x/d3d8.texconv.o \
|
../vendor/librw/src/d3d-x/d3d8.texconv.o \
|
||||||
../vendor/librw/src/d3d-x/d3d8render.texconv.o \
|
../vendor/librw/src/d3d-x/d3d8render.texconv.o \
|
||||||
../vendor/librw/src/bmp.texconv.o \
|
|
||||||
../vendor/librw/src/png.texconv.o \
|
|
||||||
../vendor/librw/src/lodepng/lodepng.texconv.o
|
|
||||||
|
|
||||||
# Add compilation units to this list to explicity compile them with
|
# Add compilation units to this list to explicity compile them with
|
||||||
# -O3 optimizations, while the rest get the default (-Os) treatment
|
# -O3 optimizations, while the rest get the default (-Os) treatment
|
||||||
# to conserve RAM.
|
# to conserve RAM.
|
||||||
OBJS_O3 = \
|
OBJS_O3 = \
|
||||||
../vendor/librw/src/dc/rwdc.o \
|
../vendor/librw/src/dc/rwdc.o \
|
||||||
../src/liberty/core/World.o \
|
../src/core/World.o \
|
||||||
../src/liberty/collision/Collision.o \
|
../src/collision/Collision.o \
|
||||||
../src/liberty/math/math.o \
|
../src/math/math.o \
|
||||||
../src/liberty/math/Matrix.o \
|
../src/math/Matrix.o \
|
||||||
../src/liberty/math/Quaternion.o \
|
../src/math/Quaternion.o \
|
||||||
../src/liberty/math/Rect.o \
|
../src/math/Rect.o \
|
||||||
../src/liberty/math/Vector.o \
|
../src/math/Vector.o \
|
||||||
../vendor/librw/src/base.o \
|
../vendor/librw/src/base.o \
|
||||||
../src/liberty/renderer/Shadows.o
|
../src/renderer/Shadows.o
|
||||||
|
|
||||||
OBJS_NO_FAST_MATH = \
|
OBJS_NO_FAST_MATH = \
|
||||||
../src/liberty/core/Cam.o \
|
../src/core/Cam.o \
|
||||||
../src/liberty/core/Camera.o
|
../src/core/Camera.o
|
||||||
|
|
||||||
KOS_CPPFLAGS += -fbuiltin -ffast-math -ffp-contract=fast \
|
KOS_CPPFLAGS += -fbuiltin -ffast-math -ffp-contract=fast \
|
||||||
-mfsrra -mfsca
|
-mfsrra -mfsca
|
||||||
@@ -133,7 +115,7 @@ CXXFLAGS += $(if $(WITH_32MB),-O3,-Os) \
|
|||||||
$(if $(WITH_PROF),-DWITH_PROF=\"$(WITH_PROF)\") \
|
$(if $(WITH_PROF),-DWITH_PROF=\"$(WITH_PROF)\") \
|
||||||
-MMD -MP -ffunction-sections -fdata-sections -ffast-math \
|
-MMD -MP -ffunction-sections -fdata-sections -ffast-math \
|
||||||
-fmerge-all-constants -fomit-frame-pointer -ml -std=gnu++20 \
|
-fmerge-all-constants -fomit-frame-pointer -ml -std=gnu++20 \
|
||||||
-fno-exceptions -fno-rtti -flto=auto -fipa-pta -fno-PIC -Wno-write-strings \
|
-fno-exceptions -fno-rtti -flto=auto -fipa-pta -Wno-write-strings \
|
||||||
-Wno-deprecated-enum-enum-conversion -Wno-deprecated-enum-float-conversion \
|
-Wno-deprecated-enum-enum-conversion -Wno-deprecated-enum-float-conversion \
|
||||||
-Wno-multichar -Wno-unused-value -Wno-char-subscripts -Wno-reorder \
|
-Wno-multichar -Wno-unused-value -Wno-char-subscripts -Wno-reorder \
|
||||||
-Wno-unused-function -Wno-class-memaccess -fno-permissive \
|
-Wno-unused-function -Wno-class-memaccess -fno-permissive \
|
||||||
@@ -145,8 +127,8 @@ clean-texconv:
|
|||||||
-rm -f texconv
|
-rm -f texconv
|
||||||
|
|
||||||
clean-pvrtex:
|
clean-pvrtex:
|
||||||
$(MAKE) -C ../vendor/pvrtex clean
|
$(MAKE) -C ./pvrtex clean
|
||||||
-rm -f ../vendor/pvrtex/pvrtex
|
-rm -f ./pvrtex/pvrtex
|
||||||
|
|
||||||
clean-objs:
|
clean-objs:
|
||||||
-rm -f $(OBJS)
|
-rm -f $(OBJS)
|
||||||
@@ -174,20 +156,12 @@ $(OBJS_NO_FAST_MATH): %.o: %.cpp
|
|||||||
$(TARGET): $(OBJS)
|
$(TARGET): $(OBJS)
|
||||||
kos-c++ -o $(TARGET) $(OBJS) -Wl,--gc-sections -Wl,--as-needed -Wl,-Map,output.map \
|
kos-c++ -o $(TARGET) $(OBJS) -Wl,--gc-sections -Wl,--as-needed -Wl,-Map,output.map \
|
||||||
-flto=auto $(if $(WITH_IDE),-lkosfat) $(if $(WITH_SD),-lkosfat) -Wl,--build-id=sha1
|
-flto=auto $(if $(WITH_IDE),-lkosfat) $(if $(WITH_SD),-lkosfat) -Wl,--build-id=sha1
|
||||||
@echo && echo && echo "*** Build Completed Successfully ($(TARGET)) ***" && echo && echo
|
@echo && echo && echo "*** Build Completed Successfully ***" && echo && echo
|
||||||
|
|
||||||
run: $(TARGET)
|
run: $(TARGET)
|
||||||
$(KOS_LOADER) $(TARGET)
|
$(KOS_LOADER) $(TARGET)
|
||||||
|
|
||||||
$(REPACK_GTA_DIR)/GTA3SF8.b: assets/GTA3SF8.b
|
$(REPACK_GTA_DIR)/GTA3SF8.b: GTA3SF8.b
|
||||||
mkdir -p $(@D)
|
|
||||||
cp $< $@
|
|
||||||
|
|
||||||
$(REPACK_GTA_DIR)/0GDTEX.PVR: assets/0GDTEX.PVR
|
|
||||||
mkdir -p $(@D)
|
|
||||||
cp $< $@
|
|
||||||
|
|
||||||
$(REPACK_GTA_DIR)/%.ico: assets/%.ico
|
|
||||||
mkdir -p $(@D)
|
mkdir -p $(@D)
|
||||||
cp $< $@
|
cp $< $@
|
||||||
|
|
||||||
@@ -200,26 +174,26 @@ $(REPACK_GTA_DIR)/%.ico: assets/%.ico
|
|||||||
.PHONY: pvrtex
|
.PHONY: pvrtex
|
||||||
|
|
||||||
pvrtex:
|
pvrtex:
|
||||||
$(MAKE) -C ../vendor/pvrtex
|
$(MAKE) -C ./pvrtex
|
||||||
|
|
||||||
IP.BIN:
|
IP.BIN:
|
||||||
rm -f IP.BIN
|
rm -f IP.BIN
|
||||||
$(KOS_BASE)/utils/makeip/makeip ip.txt IP.BIN
|
$(KOS_BASE)/utils/makeip/makeip ip.txt IP.BIN
|
||||||
|
|
||||||
$(PROJECT_NAME).iso: IP.BIN 1ST_READ.BIN $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b $(REPACK_GTA_DIR)/0GDTEX.PVR $(REPACK_GTA_DIR)/settings.ico
|
$(PROJECT_NAME).iso: IP.BIN 1ST_READ.BIN $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||||
rm -f $(PROJECT_NAME).iso
|
rm -f $(PROJECT_NAME).iso
|
||||||
rm -f $(REPACK_GTA_DIR)/1ST_READ.BIN
|
rm -f $(REPACK_GTA_DIR)/1ST_READ.BIN
|
||||||
cp 1ST_READ.BIN $(REPACK_GTA_DIR)
|
cp 1ST_READ.BIN $(REPACK_GTA_DIR)
|
||||||
mkisofs -C 0,11702 -V $(PROJECT_NAME) -G IP.BIN -r -J -l -o $(PROJECT_NAME).iso $(REPACK_GTA_DIR)
|
mkisofs -C 0,11702 -V $(PROJECT_NAME) -G IP.BIN -r -J -l -o $(PROJECT_NAME).iso $(REPACK_GTA_DIR)
|
||||||
|
|
||||||
$(PROJECT_NAME)-no-repack.iso: IP.BIN 1ST_READ.BIN $(REPACK_GTA_DIR)/GTA3SF8.b $(REPACK_GTA_DIR)/0GDTEX.PVR $(REPACK_GTA_DIR)/settings.ico
|
$(PROJECT_NAME)-no-repack.iso: IP.BIN 1ST_READ.BIN $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||||
rm -f $(PROJECT_NAME)-no-repack.iso
|
rm -f $(PROJECT_NAME)-no-repack.iso
|
||||||
rm -f $(REPACK_GTA_DIR)/1ST_READ.BIN
|
rm -f $(REPACK_GTA_DIR)/1ST_READ.BIN
|
||||||
cp 1ST_READ.BIN $(REPACK_GTA_DIR)
|
cp 1ST_READ.BIN $(REPACK_GTA_DIR)
|
||||||
mkisofs -C 0,11702 -V $(PROJECT_NAME) -G IP.BIN -r -J -l -o $(PROJECT_NAME)-no-repack.iso $(REPACK_GTA_DIR)
|
mkisofs -C 0,11702 -V $(PROJECT_NAME) -G IP.BIN -r -J -l -o $(PROJECT_NAME)-no-repack.iso $(REPACK_GTA_DIR)
|
||||||
|
|
||||||
|
|
||||||
$(PROJECT_NAME).ds.iso: IP.BIN 1ST_READ.BIN $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b $(REPACK_GTA_DIR)/0GDTEX.PVR $(REPACK_GTA_DIR)/settings.ico
|
$(PROJECT_NAME).ds.iso: IP.BIN 1ST_READ.BIN $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||||
rm -f $(PROJECT_NAME).ds.iso
|
rm -f $(PROJECT_NAME).ds.iso
|
||||||
rm -f $(REPACK_GTA_DIR)/1ST_READ.BIN
|
rm -f $(REPACK_GTA_DIR)/1ST_READ.BIN
|
||||||
cp $(TARGET).bin $(REPACK_GTA_DIR)/1ST_READ.BIN
|
cp $(TARGET).bin $(REPACK_GTA_DIR)/1ST_READ.BIN
|
||||||
@@ -230,7 +204,7 @@ $(PROJECT_NAME).ds.iso: IP.BIN 1ST_READ.BIN $(REPACK_DIR)/repacked $(REPACK_GTA_
|
|||||||
$(KOS_BASE)/utils/scramble/scramble $(TARGET)-prebuilt.bin 1ST_READ_PREBUILT.BIN
|
$(KOS_BASE)/utils/scramble/scramble $(TARGET)-prebuilt.bin 1ST_READ_PREBUILT.BIN
|
||||||
mkdir -p $(REPACK_GTA_DIR)
|
mkdir -p $(REPACK_GTA_DIR)
|
||||||
|
|
||||||
$(PROJECT_NAME)-prebuilt.iso: IP.BIN 1ST_READ_PREBUILT.BIN $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b $(REPACK_GTA_DIR)/0GDTEX.PVR $(REPACK_GTA_DIR)/settings.ico
|
$(PROJECT_NAME)-prebuilt.iso: IP.BIN 1ST_READ_PREBUILT.BIN $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||||
rm -f $(REPACK_GTA_DIR)/1ST_READ.BIN
|
rm -f $(REPACK_GTA_DIR)/1ST_READ.BIN
|
||||||
cp 1ST_READ_PREBUILT.BIN $(REPACK_GTA_DIR)/1ST_READ.BIN
|
cp 1ST_READ_PREBUILT.BIN $(REPACK_GTA_DIR)/1ST_READ.BIN
|
||||||
mkisofs -C 0,11702 -V $(PROJECT_NAME) -G IP.BIN -r -J -l -o $(PROJECT_NAME).iso $(REPACK_GTA_DIR)
|
mkisofs -C 0,11702 -V $(PROJECT_NAME) -G IP.BIN -r -J -l -o $(PROJECT_NAME).iso $(REPACK_GTA_DIR)
|
||||||
@@ -238,28 +212,28 @@ $(PROJECT_NAME)-prebuilt.iso: IP.BIN 1ST_READ_PREBUILT.BIN $(REPACK_DIR)/repacke
|
|||||||
ifeq ($(HAVE_CDI4DC), yes)
|
ifeq ($(HAVE_CDI4DC), yes)
|
||||||
$(PROJECT_NAME).cdi: $(PROJECT_NAME).iso
|
$(PROJECT_NAME).cdi: $(PROJECT_NAME).iso
|
||||||
cdi4dc $(PROJECT_NAME).iso $(PROJECT_NAME).cdi > cdi.log
|
cdi4dc $(PROJECT_NAME).iso $(PROJECT_NAME).cdi > cdi.log
|
||||||
@echo && echo && echo "*** CDI Baked Successfully ($@) ***" && echo && echo
|
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||||
|
|
||||||
$(PROJECT_NAME)-no-repack.cdi: $(PROJECT_NAME)-no-repack.iso
|
$(PROJECT_NAME)-no-repack.cdi: $(PROJECT_NAME)-no-repack.iso
|
||||||
cdi4dc $(PROJECT_NAME)-no-repack.iso $(PROJECT_NAME)-no-repack.cdi > cdi.log
|
cdi4dc $(PROJECT_NAME)-no-repack.iso $(PROJECT_NAME)-no-repack.cdi > cdi.log
|
||||||
@echo && echo && echo "*** CDI Baked Successfully ($@) ***" && echo && echo
|
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||||
|
|
||||||
$(PROJECT_NAME)-prebuilt.cdi: $(PROJECT_NAME)-prebuilt.iso
|
$(PROJECT_NAME)-prebuilt.cdi: $(PROJECT_NAME)-prebuilt.iso
|
||||||
cdi4dc $(PROJECT_NAME).iso $(PROJECT_NAME).cdi > cdi.log
|
cdi4dc $(PROJECT_NAME).iso $(PROJECT_NAME).cdi > cdi.log
|
||||||
rm 1ST_READ_PREBUILT.BIN
|
rm 1ST_READ_PREBUILT.BIN
|
||||||
@echo && echo && echo "*** CDI Baked Successfully ($@) ***" && echo && echo
|
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||||
else
|
else
|
||||||
$(PROJECT_NAME).cdi: $(TARGET) $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b $(REPACK_GTA_DIR)/0GDTEX.PVR $(REPACK_GTA_DIR)/settings.ico
|
$(PROJECT_NAME).cdi: $(TARGET) $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||||
mkdcdisc -e $(TARGET) -o $(PROJECT_NAME).cdi -d $(REPACK_GTA_DIR)/ $(MKDCDISC_PAD_OPTION) -n $(PROJECT_NAME) -a $(TEAM_NAME) -s $(DISC_SERIAL) -r $(RELEASE_DATE)
|
mkdcdisc -e $(TARGET) -o $(PROJECT_NAME).cdi -d $(REPACK_GTA_DIR)/ $(MKDCDISC_PAD_OPTION) -n DCA3 -a "the gang"
|
||||||
@echo && echo && echo "*** CDI Baked Successfully ($@) ***" && echo && echo
|
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||||
|
|
||||||
$(PROJECT_NAME)-no-repack.cdi: $(TARGET) $(REPACK_GTA_DIR)/GTA3SF8.b $(REPACK_GTA_DIR)/0GDTEX.PVR $(REPACK_GTA_DIR)/settings.ico
|
$(PROJECT_NAME)-no-repack.cdi: $(TARGET) $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||||
mkdcdisc -e $(TARGET) -o $(PROJECT_NAME)-no-repack.cdi -d $(REPACK_GTA_DIR)/ $(MKDCDISC_PAD_OPTION) -n $(PROJECT_NAME) -a $(TEAM_NAME) -s $(DISC_SERIAL) -r $(RELEASE_DATE)
|
mkdcdisc -e $(TARGET) -o $(PROJECT_NAME)-no-repack.cdi -d $(REPACK_GTA_DIR)/ $(MKDCDISC_PAD_OPTION) -n DCA3 -a "the gang"
|
||||||
@echo && echo && echo "*** CDI Baked Successfully ($@) ***" && echo && echo
|
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||||
|
|
||||||
$(PROJECT_NAME)-prebuilt.cdi: $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b $(REPACK_GTA_DIR)/0GDTEX.PVR $(REPACK_GTA_DIR)/settings.ico
|
$(PROJECT_NAME)-prebuilt.cdi: $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||||
mkdcdisc -e $(TARGET) -o $(PROJECT_NAME).cdi -d $(REPACK_GTA_DIR)/ $(MKDCDISC_PAD_OPTION) -n $(PROJECT_NAME) -a $(TEAM_NAME) -s $(DISC_SERIAL) -r $(RELEASE_DATE)
|
mkdcdisc -e $(TARGET) -o $(PROJECT_NAME).cdi -d $(REPACK_GTA_DIR)/ $(MKDCDISC_PAD_OPTION) -n DCA3 -a "the gang"
|
||||||
@echo && echo && echo "*** CDI Baked Successfully ($@) ***" && echo && echo
|
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cdi: $(PROJECT_NAME).cdi
|
cdi: $(PROJECT_NAME).cdi
|
||||||
@@ -285,32 +259,23 @@ gprof:
|
|||||||
@echo "\033[42m Profiling data saved to $(TARGET)-kernel.png \033[0m"
|
@echo "\033[42m Profiling data saved to $(TARGET)-kernel.png \033[0m"
|
||||||
|
|
||||||
# tools
|
# tools
|
||||||
imgtool: ../src/tools/imgtool.cpp
|
imgtool: imgtool.cpp
|
||||||
$(CXX) -std=c++17 -o $@ -O0 -g $<
|
$(CXX) -std=c++17 -o $@ -Og $<
|
||||||
|
|
||||||
extract-sfx: ../src/tools/extract-sfx.cpp
|
extract-sfx: extract-sfx.cpp
|
||||||
$(CXX) -std=c++17 -o $@ -O0 -g $<
|
$(CXX) -std=c++17 -o $@ -Og $<
|
||||||
|
|
||||||
pack-sfx: ../src/tools/pack-sfx.cpp
|
pack-sfx: pack-sfx.cpp
|
||||||
$(CXX) -std=c++17 -o $@ -O0 -g $<
|
$(CXX) -std=c++17 -o $@ -Og $<
|
||||||
|
|
||||||
aud2adpcm: ../src/tools/aud2adpcm.c
|
aud2adpcm: aud2adpcm.c
|
||||||
$(CC) -o $@ -O3 -g $< -I../vendor/minimp3
|
$(CC) -o $@ -O3 -g $< -I../vendor/minimp3
|
||||||
|
|
||||||
texconv: $(OBJS_TEXCONV) | pvrtex # You'll have to rebuild pvrtex manually if you change it
|
texconv: $(OBJS_TEXCONV) | pvrtex # You'll have to rebuild pvrtex manually if you change it
|
||||||
$(CXX) -o $@ $(OBJS_TEXCONV)
|
$(CXX) -o $@ $(OBJS_TEXCONV)
|
||||||
|
|
||||||
%.texconv.o: %.cpp
|
%.texconv.o: %.cpp
|
||||||
$(CXX) -std=c++2a -c -O3 -g -MMD -MP -o $@ -I../vendor/koshle -I../vendor/librw/src $(INCLUDE) -I../vendor/emu -I../vendor/crypto -I../vendor/TriStripper/include $(DEFINES) -DDC_TEXCONV -DDC_SIM -D_INC_WINDOWS $(TEXCONV_FLAGS) $<
|
$(CXX) -std=c++2a -c -O3 -g -MMD -MP -o $@ -I../vendor/koshle $(INCLUDE) -I../vendor/emu -I../vendor/crypto -I../vendor/TriStripper/include $(DEFINES) -DDC_TEXCONV -DDC_SIM -D_INC_WINDOWS $(TEXCONV_FLAGS) $<
|
||||||
|
|
||||||
animtool: ../src/tools/animtool.cpp
|
|
||||||
$(CXX) -std=c++17 -o $@ -g -O0 $<
|
|
||||||
|
|
||||||
coltool: ../src/tools/coltool.cpp
|
|
||||||
$(CXX) -std=c++17 -o $@ -g -O0 $<
|
|
||||||
|
|
||||||
streamheaderpack: ../src/tools/streamheaderpack.cpp
|
|
||||||
$(CXX) -std=c++17 -o $@ -g -O0 $<
|
|
||||||
|
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|
||||||
@@ -318,10 +283,7 @@ streamheaderpack: ../src/tools/streamheaderpack.cpp
|
|||||||
|
|
||||||
TXD_OPTS_fonts = 256 256
|
TXD_OPTS_fonts = 256 256
|
||||||
TXD_OPTS_hud = 128 128
|
TXD_OPTS_hud = 128 128
|
||||||
TXD_OPTS_menu = 512 512 \
|
TXD_OPTS_menu = 512 512
|
||||||
--delete-tex mapTop03 --delete-tex mapTop02 --delete-tex mapTop01 \
|
|
||||||
--delete-tex mapMid03 --delete-tex mapMid02 --delete-tex mapMid01 \
|
|
||||||
--delete-tex mapBot03 --delete-tex mapBot02 --delete-tex mapBot01
|
|
||||||
TXD_OPTS_LOADSC0 = 512 512
|
TXD_OPTS_LOADSC0 = 512 512
|
||||||
TXD_OPTS_LOADSC1 = 512 512
|
TXD_OPTS_LOADSC1 = 512 512
|
||||||
TXD_OPTS_LOADSC10 = 512 512
|
TXD_OPTS_LOADSC10 = 512 512
|
||||||
@@ -354,22 +316,6 @@ TXD_OPTS_NEWS = 512 512
|
|||||||
TXD_OPTS_SPLASH1 = 512 512
|
TXD_OPTS_SPLASH1 = 512 512
|
||||||
TXD_OPTS_SPLASH2 = 512 512
|
TXD_OPTS_SPLASH2 = 512 512
|
||||||
TXD_OPTS_SPLASH3 = 512 512
|
TXD_OPTS_SPLASH3 = 512 512
|
||||||
TXD_OPTS_frontend = 512 512 \
|
|
||||||
--delete-tex "fe_arrows4" \
|
|
||||||
--delete-tex "fe_arrows2" \
|
|
||||||
--delete-tex "fe_arrows1" \
|
|
||||||
--delete-tex "fe_controllersh" \
|
|
||||||
--delete-tex "fe_controller" \
|
|
||||||
\
|
|
||||||
--include-tex assets/dc_ps2d.png dc_ps2d \
|
|
||||||
--include-tex assets/dc_ps2f.png dc_ps2f \
|
|
||||||
--include-tex assets/dc_xboxd.png dc_xboxd \
|
|
||||||
--include-tex assets/dc_xboxf.png dc_xboxf \
|
|
||||||
--include-tex assets/ps4_d.png ps4_d \
|
|
||||||
--include-tex assets/ps4_f.png ps4_f \
|
|
||||||
--include-tex assets/xbox_d.png xbox_d \
|
|
||||||
--include-tex assets/xbox_f.png xbox_f
|
|
||||||
|
|
||||||
DEFAULT_RES = 512
|
DEFAULT_RES = 512
|
||||||
|
|
||||||
PVR_ENCODER ?= PVRTEX
|
PVR_ENCODER ?= PVRTEX
|
||||||
@@ -383,28 +329,19 @@ TEXTURE_DOWNSAMPLE_IMG ?= HALF
|
|||||||
-include sfxlooplist.mk
|
-include sfxlooplist.mk
|
||||||
-include wavlist.mk
|
-include wavlist.mk
|
||||||
-include mp3list.mk
|
-include mp3list.mk
|
||||||
-include cuts.mk
|
|
||||||
|
|
||||||
IMG_TEXTURES_DC = $(addprefix $(REPACK_IMG_DC_DIR)/, $(IMG_TEXTURES))
|
IMG_TEXTURES_DC = $(addprefix $(REPACK_IMG_DC_DIR)/, $(IMG_TEXTURES))
|
||||||
IMG_MODELS_DC = $(addprefix $(REPACK_IMG_DC_DIR)/, $(IMG_MODELS))
|
IMG_MODELS_DC = $(addprefix $(REPACK_IMG_DC_DIR)/, $(IMG_MODELS))
|
||||||
|
|
||||||
CUTS_IFP_DC = $(addprefix $(REPACK_CUTS_DC_DIR)/, $(CUTS_IFP))
|
|
||||||
CUTS_MISC_DC = $(addprefix $(REPACK_CUTS_DC_DIR)/, $(CUTS_MISC))
|
|
||||||
|
|
||||||
LOOSE_FILES_DC = $(addprefix $(REPACK_GTA_DIR)/, $(MISC_FILES))
|
LOOSE_FILES_DC = $(addprefix $(REPACK_GTA_DIR)/, $(MISC_FILES))
|
||||||
|
|
||||||
SFX_DC_DIR = $(REPACK_GTA_DIR)/sfx
|
SFX_DC_DIR = $(REPACK_GTA_DIR)/sfx
|
||||||
SFX_DC_RAW = $(SFX_DC_DIR)/sfx_all.raw
|
SFX_DC_RAW = $(SFX_DC_DIR)/sfx_all.raw
|
||||||
SFX_DC_DSC = $(SFX_DC_DIR)/sfx_all.dsc
|
SFX_DC_DSC = $(SFX_DC_DIR)/sfx_all.dsc
|
||||||
STREAM_ADPCM_DC = $(addprefix $(REPACK_STREAM_DEST_DIR)/, $(STREAM_WAV:.wav=.APM)) \
|
STREAM_ADPCM_DC = $(addprefix $(REPACK_GTA_DIR)/stream/, $(STREAM_WAV:.wav=.APM)) \
|
||||||
$(addprefix $(REPACK_STREAM_DEST_DIR)/, $(STREAM_MP3:.mp3=.APM))
|
$(addprefix $(REPACK_GTA_DIR)/stream/, $(STREAM_MP3:.mp3=.APM))
|
||||||
|
|
||||||
IMG_TEXTURES_ORIG = $(addprefix $(REPACK_IMG_ORIG_DIR)/, $(IMG_TEXTURES))
|
IMG_TEXTURES_ORIG = $(addprefix $(REPACK_IMG_ORIG_DIR)/, $(IMG_TEXTURES))
|
||||||
IMG_MODELS_ORIG = $(addprefix $(REPACK_IMG_ORIG_DIR)/, $(IMG_MODELS))
|
IMG_MODELS_ORIG = $(addprefix $(REPACK_IMG_ORIG_DIR)/, $(IMG_MODELS))
|
||||||
|
|
||||||
CUTS_IFP_ORIG = $(addprefix $(REPACK_CUTS_ORIG_DIR)/, $(CUTS_IFP))
|
|
||||||
CUTS_MISC_ORIG = $(addprefix $(REPACK_CUTS_ORIG_DIR)/, $(CUTS_MISC))
|
|
||||||
|
|
||||||
SFX_ORIG = $(addprefix $(REPACK_SFX_ORIG_DIR)/, $(SFX_WAV))
|
SFX_ORIG = $(addprefix $(REPACK_SFX_ORIG_DIR)/, $(SFX_WAV))
|
||||||
SFX_ORIG_LOOP = $(addprefix $(REPACK_SFX_ORIG_DIR)/, $(SFX_LOOP_WAV))
|
SFX_ORIG_LOOP = $(addprefix $(REPACK_SFX_ORIG_DIR)/, $(SFX_LOOP_WAV))
|
||||||
SFX_REPACK_DC_WAV = $(addprefix $(REPACK_SFX_DC_DIR)/, $(SFX_WAV) $(SFX_LOOP_WAV))
|
SFX_REPACK_DC_WAV = $(addprefix $(REPACK_SFX_DC_DIR)/, $(SFX_WAV) $(SFX_LOOP_WAV))
|
||||||
@@ -414,13 +351,11 @@ STREAM_WAV_DECODED = $(addprefix $(REPACK_STREAM_DECODED_DIR)/, $(STREAM_WAV))
|
|||||||
|
|
||||||
.PRECIOUS: $(SFX_ORIG) $(SFX_REPACK_DC) $(STREAM_MP3_DECODED) $(STREAM_WAV_DECODED)
|
.PRECIOUS: $(SFX_ORIG) $(SFX_REPACK_DC) $(STREAM_MP3_DECODED) $(STREAM_WAV_DECODED)
|
||||||
|
|
||||||
$(REPACK_DIR)/repacked: $(REPACK_GTA_DIR)/models/gta3.img $(REPACK_GTA_DIR)/models/gta3.dir $(LOOSE_FILES_DC) $(STREAM_ADPCM_DC) $(SFX_DC_RAW) $(SFX_DC_DSC) streamheaderpack
|
$(REPACK_DIR)/repacked: $(REPACK_GTA_DIR)/models/gta3.img $(REPACK_GTA_DIR)/models/gta3.dir $(LOOSE_FILES_DC) $(STREAM_ADPCM_DC) $(SFX_DC_RAW) $(SFX_DC_DSC)
|
||||||
mkdir -p $(@D)
|
mkdir -p $(@D)
|
||||||
# $(REPACK_GTA_DIR) needed as first argument as paths in the game prefix with stream/
|
|
||||||
./streamheaderpack liberty $(REPACK_GTA_DIR) $(REPACK_STREAM_DEST_DIR)/hdr.bin
|
|
||||||
@git archive --format zip --output "$(REPACK_GTA_DIR)/DCA3-$(GIT_VERSION).zip" HEAD
|
@git archive --format zip --output "$(REPACK_GTA_DIR)/DCA3-$(GIT_VERSION).zip" HEAD
|
||||||
@touch $@
|
@touch $@
|
||||||
@echo && echo && echo "*** Repack Completed Successfully ($(PROJECT_NAME)) ***" && echo && echo
|
@echo && echo && echo "*** Repack Completed Successfully ***" && echo && echo
|
||||||
|
|
||||||
$(REPACK_DIR)/unpacked: imgtool $(GTA_DIR)/models/gta3.img $(GTA_DIR)/models/gta3.dir
|
$(REPACK_DIR)/unpacked: imgtool $(GTA_DIR)/models/gta3.img $(GTA_DIR)/models/gta3.dir
|
||||||
mkdir -p $(@D)
|
mkdir -p $(@D)
|
||||||
@@ -430,15 +365,6 @@ $(REPACK_DIR)/unpacked: imgtool $(GTA_DIR)/models/gta3.img $(GTA_DIR)/models/gta
|
|||||||
$(IMG_TEXTURES_ORIG) $(IMG_MODELS_ORIG): $(REPACK_DIR)/unpacked
|
$(IMG_TEXTURES_ORIG) $(IMG_MODELS_ORIG): $(REPACK_DIR)/unpacked
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
$(REPACK_DIR)/unpacked-cuts: imgtool $(GTA_DIR)/anim/cuts.img $(GTA_DIR)/anim/cuts.dir
|
|
||||||
mkdir -p $(@D)
|
|
||||||
./imgtool unpack "$(GTA_DIR)/anim/cuts" "$(REPACK_CUTS_ORIG_DIR)"
|
|
||||||
@touch $@
|
|
||||||
|
|
||||||
$(CUTS_IFP_ORIG) $(CUTS_MISC_ORIG): $(REPACK_DIR)/unpacked-cuts
|
|
||||||
@test -f $@
|
|
||||||
@touch $@
|
|
||||||
|
|
||||||
# First try the mods img directory
|
# First try the mods img directory
|
||||||
$(REPACK_IMG_DC_DIR)/%.dff: $(GTA_MOD_IMG_DIR)/%.dff texconv
|
$(REPACK_IMG_DC_DIR)/%.dff: $(GTA_MOD_IMG_DIR)/%.dff texconv
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
@@ -471,30 +397,6 @@ $(REPACK_IMG_DC_DIR)/%.TXD: $(REPACK_IMG_ORIG_DIR)/%.TXD texconv
|
|||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
./texconv $< $@ $(DEFAULT_RES) $(DEFAULT_RES) -e $(PVR_ENCODER) -d $(TEXTURE_DOWNSAMPLE_IMG)
|
./texconv $< $@ $(DEFAULT_RES) $(DEFAULT_RES) -e $(PVR_ENCODER) -d $(TEXTURE_DOWNSAMPLE_IMG)
|
||||||
|
|
||||||
|
|
||||||
### cuts
|
|
||||||
# First try the mods img directory
|
|
||||||
$(REPACK_CUTS_DC_DIR)/%.dat: $(GTA_MOD_CUTS_DIR)/%.dat
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
cp $< $@
|
|
||||||
$(REPACK_CUTS_DC_DIR)/%.anm: $(GTA_MOD_CUTS_DIR)/%.anm
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
cp $< $@
|
|
||||||
$(REPACK_CUTS_DC_DIR)/%.ifp: $(GTA_MOD_CUTS_DIR)/%.ifp animtool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./animtool $< $@
|
|
||||||
|
|
||||||
# if not, the extracted img directory
|
|
||||||
$(REPACK_CUTS_DC_DIR)/%.dat: $(REPACK_CUTS_ORIG_DIR)/%.dat
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
cp $< $@
|
|
||||||
$(REPACK_CUTS_DC_DIR)/%.anm: $(REPACK_CUTS_ORIG_DIR)/%.anm
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
cp $< $@
|
|
||||||
$(REPACK_CUTS_DC_DIR)/%.ifp: $(REPACK_CUTS_ORIG_DIR)/%.ifp animtool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./animtool $< $@
|
|
||||||
|
|
||||||
# first try the mods loose directory
|
# first try the mods loose directory
|
||||||
$(REPACK_GTA_DIR)/%.dff: $(GTA_MOD_LOOSE_DIR)/%.dff texconv
|
$(REPACK_GTA_DIR)/%.dff: $(GTA_MOD_LOOSE_DIR)/%.dff texconv
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
@@ -520,14 +422,6 @@ $(REPACK_GTA_DIR)/%.TXD: $(GTA_MOD_LOOSE_DIR)/%.TXD texconv
|
|||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
./texconv $< $@ 1024 1024 -e $(PVR_ENCODER) -d NONE
|
./texconv $< $@ 1024 1024 -e $(PVR_ENCODER) -d NONE
|
||||||
|
|
||||||
# then the gamefiles directory
|
|
||||||
$(REPACK_GTA_DIR)/%.txd: $(GTA_GAMEFILES_LOOSE_DIR)/%.txd texconv
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./texconv $< $@ $(TXD_OPTS_$(notdir $*)) -e $(PVR_ENCODER) -d $(TEXTURE_DOWNSAMPLE_TXD)
|
|
||||||
$(REPACK_GTA_DIR)/%.TXD: $(GTA_GAMEFILES_LOOSE_DIR)/%.TXD texconv
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./texconv $< $@ $(TXD_OPTS_$(notdir $*)) -e $(PVR_ENCODER) -d $(TEXTURE_DOWNSAMPLE_TXD)
|
|
||||||
|
|
||||||
# if not, the original files
|
# if not, the original files
|
||||||
$(REPACK_GTA_DIR)/%.txd: $(GTA_DIR)/%.txd texconv
|
$(REPACK_GTA_DIR)/%.txd: $(GTA_DIR)/%.txd texconv
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
@@ -536,38 +430,6 @@ $(REPACK_GTA_DIR)/%.TXD: $(GTA_DIR)/%.TXD texconv
|
|||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
./texconv $< $@ $(TXD_OPTS_$(notdir $*)) -e $(PVR_ENCODER) -d $(TEXTURE_DOWNSAMPLE_TXD)
|
./texconv $< $@ $(TXD_OPTS_$(notdir $*)) -e $(PVR_ENCODER) -d $(TEXTURE_DOWNSAMPLE_TXD)
|
||||||
|
|
||||||
# first try the mods loose directory
|
|
||||||
$(REPACK_GTA_DIR)/%.ifp: $(GTA_MOD_LOOSE_DIR)/%.ifp animtool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./animtool $< $@
|
|
||||||
$(REPACK_GTA_DIR)/%.IFP: $(GTA_MOD_LOOSE_DIR)/%.IFP animtool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./animtool $< $@
|
|
||||||
|
|
||||||
#if not, the original files
|
|
||||||
$(REPACK_GTA_DIR)/%.ifp: $(GTA_DIR)/%.ifp animtool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./animtool $< $@
|
|
||||||
$(REPACK_GTA_DIR)/%.IFP: $(GTA_DIR)/%.IFP animtool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./animtool $< $@
|
|
||||||
|
|
||||||
# first try the mods loose directory
|
|
||||||
$(REPACK_GTA_DIR)/%.col: $(GTA_MOD_LOOSE_DIR)/%.col coltool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./coltool $< $@
|
|
||||||
$(REPACK_GTA_DIR)/%.COL: $(GTA_MOD_LOOSE_DIR)/%.COL coltool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./coltool $< $@
|
|
||||||
|
|
||||||
#if not, the original files
|
|
||||||
$(REPACK_GTA_DIR)/%.col: $(GTA_DIR)/%.col coltool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./coltool $< $@
|
|
||||||
$(REPACK_GTA_DIR)/%.COL: $(GTA_DIR)/%.COL coltool
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
./coltool $< $@
|
|
||||||
|
|
||||||
$(REPACK_DIR)/packed: $(IMG_TEXTURES_DC) $(IMG_MODELS_DC)
|
$(REPACK_DIR)/packed: $(IMG_TEXTURES_DC) $(IMG_MODELS_DC)
|
||||||
mkdir -p $(@D)
|
mkdir -p $(@D)
|
||||||
mkdir -p "$(REPACK_GTA_DIR)/models/gta3"
|
mkdir -p "$(REPACK_GTA_DIR)/models/gta3"
|
||||||
@@ -577,15 +439,6 @@ $(REPACK_DIR)/packed: $(IMG_TEXTURES_DC) $(IMG_MODELS_DC)
|
|||||||
$(REPACK_GTA_DIR)/models/gta3.img $(REPACK_GTA_DIR)/models/gta3.dir: $(REPACK_DIR)/packed
|
$(REPACK_GTA_DIR)/models/gta3.img $(REPACK_GTA_DIR)/models/gta3.dir: $(REPACK_DIR)/packed
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
$(REPACK_DIR)/packed-cuts: $(CUTS_IFP_DC) $(CUTS_MISC_DC)
|
|
||||||
mkdir -p $(@D)
|
|
||||||
mkdir -p "$(REPACK_GTA_DIR)/anim/cuts"
|
|
||||||
./imgtool pack "$(REPACK_GTA_DIR)/anim/cuts" "$(REPACK_CUTS_DC_DIR)"
|
|
||||||
@touch $@
|
|
||||||
|
|
||||||
$(REPACK_GTA_DIR)/anim/cuts.img $(REPACK_GTA_DIR)/anim/cuts.dir: $(REPACK_DIR)/packed-cuts
|
|
||||||
@touch $@
|
|
||||||
|
|
||||||
# sfx processing
|
# sfx processing
|
||||||
$(REPACK_DIR)/unpacked-sfx: extract-sfx $(GTA_DIR)/audio/sfx.SDT $(GTA_DIR)/audio/sfx.RAW
|
$(REPACK_DIR)/unpacked-sfx: extract-sfx $(GTA_DIR)/audio/sfx.SDT $(GTA_DIR)/audio/sfx.RAW
|
||||||
mkdir -p $(@D)
|
mkdir -p $(@D)
|
||||||
@@ -612,36 +465,24 @@ $(REPACK_SFX_DC_DIR)/%.pcm: $(REPACK_SFX_ORIG_DIR)/%.wav aud2adpcm
|
|||||||
# stream processing
|
# stream processing
|
||||||
|
|
||||||
# first try the mods loose directory
|
# first try the mods loose directory
|
||||||
$(REPACK_STREAM_DEST_DIR)/%.APM: $(GTA_MOD_LOOSE_DIR)/audio/%.wav aud2adpcm
|
$(REPACK_GTA_DIR)/stream/%.APM: $(GTA_MOD_LOOSE_DIR)/audio/%.wav aud2adpcm
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
./aud2adpcm $(AUDIO_STREAM_OPTION) $< $@
|
./aud2adpcm $(AUDIO_STREAM_OPTION) $< $@
|
||||||
|
|
||||||
$(REPACK_STREAM_DEST_DIR)/%.APM: $(GTA_MOD_LOOSE_DIR)/audio/%.mp3 aud2adpcm
|
$(REPACK_GTA_DIR)/stream/%.APM: $(GTA_MOD_LOOSE_DIR)/audio/%.mp3 aud2adpcm
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
./aud2adpcm $(AUDIO_STREAM_OPTION) $< $@
|
./aud2adpcm $(AUDIO_STREAM_OPTION) $< $@
|
||||||
|
|
||||||
# then original folder
|
# then original folder
|
||||||
$(REPACK_STREAM_DEST_DIR)/%.APM: $(GTA_DIR)/audio/%.wav aud2adpcm
|
$(REPACK_GTA_DIR)/stream/%.APM: $(GTA_DIR)/audio/%.wav aud2adpcm
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
./aud2adpcm $(AUDIO_STREAM_OPTION) $< $@
|
./aud2adpcm $(AUDIO_STREAM_OPTION) $< $@
|
||||||
|
|
||||||
$(REPACK_STREAM_DEST_DIR)/%.APM: $(GTA_DIR)/audio/%.mp3 aud2adpcm
|
$(REPACK_GTA_DIR)/stream/%.APM: $(GTA_DIR)/audio/%.mp3 aud2adpcm
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
./aud2adpcm $(AUDIO_STREAM_OPTION) $< $@
|
./aud2adpcm $(AUDIO_STREAM_OPTION) $< $@
|
||||||
|
|
||||||
# Note: These are last so they have least priority, files should be processed if possible
|
# Note: This is last so it has least priority, files should be processed if possible
|
||||||
|
|
||||||
# first try mods dir
|
|
||||||
$(REPACK_GTA_DIR)/%: $(GTA_MOD_LOOSE_DIR)/%
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
cp $< $@
|
|
||||||
|
|
||||||
# then gamefiles
|
|
||||||
$(REPACK_GTA_DIR)/%: $(GTA_GAMEFILES_LOOSE_DIR)/%
|
|
||||||
@mkdir -p $(@D)
|
|
||||||
cp $< $@
|
|
||||||
|
|
||||||
# then original files
|
|
||||||
$(REPACK_GTA_DIR)/%: $(GTA_DIR)/%
|
$(REPACK_GTA_DIR)/%: $(GTA_DIR)/%
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
cp $< $@
|
cp $< $@
|
||||||
@@ -558,7 +558,6 @@ void usage() {
|
|||||||
printf("based on wav2adpcm: 16bit mono wav to aica adpcm and vice-versa (c)2002 BERO\n"
|
printf("based on wav2adpcm: 16bit mono wav to aica adpcm and vice-versa (c)2002 BERO\n"
|
||||||
" wav2adpcm -q <infile.wav/mp3/ima adpcm> <outfile.wav> (To adpcm long stream)\n"
|
" wav2adpcm -q <infile.wav/mp3/ima adpcm> <outfile.wav> (To adpcm long stream)\n"
|
||||||
" wav2adpcm -t <infile.wav/mp3/ima adpcm> <outfile.wav> (To adpcm long stream)\n"
|
" wav2adpcm -t <infile.wav/mp3/ima adpcm> <outfile.wav> (To adpcm long stream)\n"
|
||||||
" wav2adpcm -m <infile.wav/mp3/ima adpcm> <outfile.wav> (To adpcm MONO long stream)\n"
|
|
||||||
" wav2adpcm -raw <infile.wav/mp3/ima adpcm> <outfile.raw> (To adpcm sfx)\n"
|
" wav2adpcm -raw <infile.wav/mp3/ima adpcm> <outfile.raw> (To adpcm sfx)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"If you are having trouble with your input wav file you can run it"
|
"If you are having trouble with your input wav file you can run it"
|
||||||
@@ -572,10 +571,8 @@ int main(int argc, char **argv) {
|
|||||||
if (argc == 4) {
|
if (argc == 4) {
|
||||||
if (!strcmp(argv[1], "-t")) {
|
if (!strcmp(argv[1], "-t")) {
|
||||||
return aud2adpcm(argv[2], argv[3], 1, 0, 0);
|
return aud2adpcm(argv[2], argv[3], 1, 0, 0);
|
||||||
} else if (!strcmp(argv[1], "-m")) {
|
|
||||||
return aud2adpcm(argv[2], argv[3], 1, 1, 0);
|
|
||||||
} else if (!strcmp(argv[1], "-q")) {
|
} else if (!strcmp(argv[1], "-q")) {
|
||||||
return aud2adpcm(argv[2], argv[3], 1, 1, 1);
|
return aud2adpcm(argv[2], argv[3], 1, 1, 1);
|
||||||
} else if (!strcmp(argv[1], "-raw")) {
|
} else if (!strcmp(argv[1], "-raw")) {
|
||||||
return aud2adpcm(argv[2], argv[3], 0, 0, 0);
|
return aud2adpcm(argv[2], argv[3], 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
396
dreamcast/common.mk
Normal file
396
dreamcast/common.mk
Normal file
@@ -0,0 +1,396 @@
|
|||||||
|
GIT_VERSION := $(shell git describe --always --tags --long --dirty 2>/dev/null || echo "NO_GIT")
|
||||||
|
CI_JOB_ID ?= 00000000
|
||||||
|
|
||||||
|
|
||||||
|
git-version.tmp:
|
||||||
|
@echo "Generating git-version.tmp with GIT_VERSION = \"$(GIT_VERSION)\""
|
||||||
|
@echo "#pragma once" > git-version.tmp
|
||||||
|
@echo "#ifndef VERSION_H" >> git-version.tmp
|
||||||
|
@echo "#define VERSION_H" >> git-version.tmp
|
||||||
|
@echo "#define GIT_VERSION \"$(GIT_VERSION)\"" >> git-version.tmp
|
||||||
|
@echo "#define CI_JOB_ID \"$(CI_JOB_ID)\"" >> git-version.tmp
|
||||||
|
@echo "#endif // VERSION_H" >> git-version.tmp
|
||||||
|
|
||||||
|
git-version.h: git-version.tmp
|
||||||
|
@if [ ! -f git-version.h ] || ! cmp -s git-version.tmp git-version.h; then \
|
||||||
|
echo "Updating git-version.h"; \
|
||||||
|
cp git-version.tmp git-version.h; \
|
||||||
|
else \
|
||||||
|
echo "git-version.h is up to date. No change."; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
.PHONY: git-version.tmp
|
||||||
|
|
||||||
|
../src/skel/dc/dc.cpp: git-version.h
|
||||||
|
|
||||||
|
|
||||||
|
# List all of your C files here, but change the extension to ".o"
|
||||||
|
# Include "romdisk.o" if you want a rom disk.
|
||||||
|
RE3_OBJS = \
|
||||||
|
../src/animation/AnimBlendAssocGroup.o \
|
||||||
|
../src/animation/AnimBlendAssociation.o \
|
||||||
|
../src/animation/AnimBlendClumpData.o \
|
||||||
|
../src/animation/AnimBlendHierarchy.o \
|
||||||
|
../src/animation/AnimBlendNode.o \
|
||||||
|
../src/animation/AnimBlendSequence.o \
|
||||||
|
../src/animation/AnimManager.o \
|
||||||
|
../src/animation/Bones.o \
|
||||||
|
../src/animation/CutsceneMgr.o \
|
||||||
|
../src/animation/FrameUpdate.o \
|
||||||
|
../src/animation/RpAnimBlend.o \
|
||||||
|
\
|
||||||
|
../src/buildings/Building.o \
|
||||||
|
../src/buildings/Treadable.o \
|
||||||
|
\
|
||||||
|
../src/collision/ColBox.o \
|
||||||
|
../src/collision/ColLine.o \
|
||||||
|
../src/collision/Collision.o \
|
||||||
|
../src/collision/ColModel.o \
|
||||||
|
../src/collision/ColPoint.o \
|
||||||
|
../src/collision/ColSphere.o \
|
||||||
|
../src/collision/ColTriangle.o \
|
||||||
|
../src/collision/TempColModels.o \
|
||||||
|
../src/collision/VuCollision.o \
|
||||||
|
\
|
||||||
|
../src/control/AutoPilot.o \
|
||||||
|
../src/control/Bridge.o \
|
||||||
|
../src/control/CarAI.o \
|
||||||
|
../src/control/CarCtrl.o \
|
||||||
|
../src/control/Curves.o \
|
||||||
|
../src/control/Darkel.o \
|
||||||
|
../src/control/GameLogic.o \
|
||||||
|
../src/control/Garages.o \
|
||||||
|
../src/control/NameGrid.o \
|
||||||
|
../src/control/OnscreenTimer.o \
|
||||||
|
../src/control/PathFind.o \
|
||||||
|
../src/control/Phones.o \
|
||||||
|
../src/control/Pickups.o \
|
||||||
|
../src/control/PowerPoints.o \
|
||||||
|
../src/control/Record.o \
|
||||||
|
../src/control/Remote.o \
|
||||||
|
../src/control/Replay.o \
|
||||||
|
../src/control/Restart.o \
|
||||||
|
../src/control/RoadBlocks.o \
|
||||||
|
../src/control/SceneEdit.o \
|
||||||
|
../src/control/Script.o \
|
||||||
|
../src/control/Script2.o \
|
||||||
|
../src/control/Script3.o \
|
||||||
|
../src/control/Script4.o \
|
||||||
|
../src/control/Script5.o \
|
||||||
|
../src/control/Script6.o \
|
||||||
|
../src/control/ScriptDebug.o \
|
||||||
|
../src/control/TrafficLights.o \
|
||||||
|
\
|
||||||
|
../src/core/Accident.o \
|
||||||
|
../src/core/Cam.o \
|
||||||
|
../src/core/Camera.o \
|
||||||
|
../src/core/CdStreamDC.o \
|
||||||
|
../src/core/Clock.o \
|
||||||
|
../src/core/ControllerConfig.o \
|
||||||
|
../src/core/Debug.o \
|
||||||
|
../src/core/Directory.o \
|
||||||
|
../src/core/EventList.o \
|
||||||
|
../src/core/FileLoader.o \
|
||||||
|
../src/core/FileMgr.o \
|
||||||
|
../src/core/Fire.o \
|
||||||
|
../src/core/Frontend.o \
|
||||||
|
../src/core/FrontEndControls.o \
|
||||||
|
../src/core/Frontend_PS2.o \
|
||||||
|
../src/core/Game.o \
|
||||||
|
../src/core/IniFile.o \
|
||||||
|
../src/core/Lists.o \
|
||||||
|
../src/core/main.o \
|
||||||
|
../src/core/MenuScreens.o \
|
||||||
|
../src/core/MenuScreensCustom.o \
|
||||||
|
../src/core/obrstr.o \
|
||||||
|
../src/core/Pad.o \
|
||||||
|
../src/core/Placeable.o \
|
||||||
|
../src/core/PlayerInfo.o \
|
||||||
|
../src/core/Pools.o \
|
||||||
|
../src/core/Profile.o \
|
||||||
|
../src/core/Radar.o \
|
||||||
|
../src/core/Range2D.o \
|
||||||
|
../src/core/Range3D.o \
|
||||||
|
../src/core/re3.o \
|
||||||
|
../src/core/References.o \
|
||||||
|
../src/core/Stats.o \
|
||||||
|
../src/core/Streaming.o \
|
||||||
|
../src/core/SurfaceTable.o \
|
||||||
|
../src/core/timebars.o \
|
||||||
|
../src/core/Timer.o \
|
||||||
|
../src/core/TimeStep.o \
|
||||||
|
../src/core/User.o \
|
||||||
|
../src/core/Wanted.o \
|
||||||
|
../src/core/World.o \
|
||||||
|
../src/core/ZoneCull.o \
|
||||||
|
../src/core/Zones.o \
|
||||||
|
\
|
||||||
|
../src/entities/Dummy.o \
|
||||||
|
../src/entities/Entity.o \
|
||||||
|
../src/entities/Physical.o \
|
||||||
|
\
|
||||||
|
../src/fakerw/fake.o \
|
||||||
|
\
|
||||||
|
../src/math/math.o \
|
||||||
|
../src/math/Matrix.o \
|
||||||
|
../src/math/Quaternion.o \
|
||||||
|
../src/math/Rect.o \
|
||||||
|
../src/math/Vector.o \
|
||||||
|
\
|
||||||
|
../src/modelinfo/BaseModelInfo.o \
|
||||||
|
../src/modelinfo/ClumpModelInfo.o \
|
||||||
|
../src/modelinfo/MloModelInfo.o \
|
||||||
|
../src/modelinfo/ModelIndices.o \
|
||||||
|
../src/modelinfo/ModelInfo.o \
|
||||||
|
../src/modelinfo/PedModelInfo.o \
|
||||||
|
../src/modelinfo/SimpleModelInfo.o \
|
||||||
|
../src/modelinfo/TimeModelInfo.o \
|
||||||
|
../src/modelinfo/VehicleModelInfo.o \
|
||||||
|
\
|
||||||
|
../src/objects/CutsceneHead.o \
|
||||||
|
../src/objects/CutsceneObject.o \
|
||||||
|
../src/objects/DummyObject.o \
|
||||||
|
../src/objects/Object.o \
|
||||||
|
../src/objects/ObjectData.o \
|
||||||
|
../src/objects/ParticleObject.o \
|
||||||
|
../src/objects/Projectile.o \
|
||||||
|
\
|
||||||
|
../src/peds/CivilianPed.o \
|
||||||
|
../src/peds/CopPed.o \
|
||||||
|
../src/peds/EmergencyPed.o \
|
||||||
|
../src/peds/Gangs.o \
|
||||||
|
../src/peds/Ped.o \
|
||||||
|
../src/peds/PedAI.o \
|
||||||
|
../src/peds/PedChat.o \
|
||||||
|
../src/peds/PedDebug.o \
|
||||||
|
../src/peds/PedFight.o \
|
||||||
|
../src/peds/PedIK.o \
|
||||||
|
../src/peds/PedPlacement.o \
|
||||||
|
../src/peds/PedRoutes.o \
|
||||||
|
../src/peds/PedType.o \
|
||||||
|
../src/peds/PlayerPed.o \
|
||||||
|
../src/peds/Population.o \
|
||||||
|
\
|
||||||
|
../src/renderer/Antennas.o \
|
||||||
|
../src/renderer/Clouds.o \
|
||||||
|
../src/renderer/Console.o \
|
||||||
|
../src/renderer/Coronas.o \
|
||||||
|
../src/renderer/Credits.o \
|
||||||
|
../src/renderer/Draw.o \
|
||||||
|
../src/renderer/Fluff.o \
|
||||||
|
../src/renderer/Font.o \
|
||||||
|
../src/renderer/Glass.o \
|
||||||
|
../src/renderer/Hud.o \
|
||||||
|
../src/renderer/Instance.o \
|
||||||
|
../src/renderer/Lines.o \
|
||||||
|
../src/renderer/MBlur.o \
|
||||||
|
../src/renderer/Particle.o \
|
||||||
|
../src/renderer/ParticleMgr.o \
|
||||||
|
../src/renderer/PlayerSkin.o \
|
||||||
|
../src/renderer/PointLights.o \
|
||||||
|
../src/renderer/RenderBuffer.o \
|
||||||
|
../src/renderer/Renderer.o \
|
||||||
|
../src/renderer/Rubbish.o \
|
||||||
|
../src/renderer/Shadows.o \
|
||||||
|
../src/renderer/Skidmarks.o \
|
||||||
|
../src/renderer/SpecialFX.o \
|
||||||
|
../src/renderer/Sprite.o \
|
||||||
|
../src/renderer/Sprite2d.o \
|
||||||
|
../src/renderer/TexList.o \
|
||||||
|
../src/renderer/Timecycle.o \
|
||||||
|
../src/renderer/WaterCannon.o \
|
||||||
|
../src/renderer/WaterLevel.o \
|
||||||
|
../src/renderer/Weather.o \
|
||||||
|
\
|
||||||
|
../src/rw/ClumpRead.o \
|
||||||
|
../src/rw/Lights.o \
|
||||||
|
../src/rw/MemoryHeap.o \
|
||||||
|
../src/rw/MemoryMgr.o \
|
||||||
|
../src/rw/NodeName.o \
|
||||||
|
../src/rw/RwHelper.o \
|
||||||
|
../src/rw/RwMatFX.o \
|
||||||
|
../src/rw/RwPS2AlphaTest.o \
|
||||||
|
../src/rw/TexRead.o \
|
||||||
|
../src/rw/TexturePools.o \
|
||||||
|
../src/rw/TxdStore.o \
|
||||||
|
../src/rw/VisibilityPlugins.o \
|
||||||
|
\
|
||||||
|
../src/skel/crossplatform.o \
|
||||||
|
../src/skel/events.o \
|
||||||
|
../src/skel/skeleton.o \
|
||||||
|
../src/skel/dc/dc.o \
|
||||||
|
\
|
||||||
|
../src/text/Messages.o \
|
||||||
|
../src/text/Pager.o \
|
||||||
|
../src/text/Text.o \
|
||||||
|
\
|
||||||
|
../src/vehicles/Automobile.o \
|
||||||
|
../src/vehicles/Boat.o \
|
||||||
|
../src/vehicles/CarGen.o \
|
||||||
|
../src/vehicles/Cranes.o \
|
||||||
|
../src/vehicles/DamageManager.o \
|
||||||
|
../src/vehicles/Door.o \
|
||||||
|
../src/vehicles/Floater.o \
|
||||||
|
../src/vehicles/HandlingMgr.o \
|
||||||
|
../src/vehicles/Heli.o \
|
||||||
|
../src/vehicles/Plane.o \
|
||||||
|
../src/vehicles/Train.o \
|
||||||
|
../src/vehicles/Transmission.o \
|
||||||
|
../src/vehicles/Vehicle.o \
|
||||||
|
\
|
||||||
|
../src/weapons/BulletInfo.o \
|
||||||
|
../src/weapons/Explosion.o \
|
||||||
|
../src/weapons/ProjectileInfo.o \
|
||||||
|
../src/weapons/ShotInfo.o \
|
||||||
|
../src/weapons/Weapon.o \
|
||||||
|
../src/weapons/WeaponEffects.o \
|
||||||
|
../src/weapons/WeaponInfo.o \
|
||||||
|
\
|
||||||
|
../src/audio/AudioCollision.o \
|
||||||
|
../src/audio/AudioLogic.o \
|
||||||
|
../src/audio/AudioManager.o \
|
||||||
|
../src/audio/AudioScriptObject.o \
|
||||||
|
../src/audio/DMAudio.o \
|
||||||
|
../src/audio/MusicManager.o \
|
||||||
|
../src/audio/PolRadio.o \
|
||||||
|
../src/audio/sampman_miles.o \
|
||||||
|
../src/audio/sampman_oal.o \
|
||||||
|
\
|
||||||
|
../src/save/Date.o \
|
||||||
|
../src/save/GenericGameStorage.o \
|
||||||
|
../src/save/MemoryCard.o \
|
||||||
|
../src/save/PCSave.o \
|
||||||
|
\
|
||||||
|
../src/extras/debugmenu.o \
|
||||||
|
../src/extras/frontendoption.o \
|
||||||
|
../src/extras/postfx.o \
|
||||||
|
../src/extras/screendroplets.o \
|
||||||
|
\
|
||||||
|
../src/vmu/vmu.o \
|
||||||
|
../vendor/miniLZO/minilzo.o \
|
||||||
|
\
|
||||||
|
|
||||||
|
# Excluded \
|
||||||
|
../src/extras/custompipes.o \
|
||||||
|
../src/extras/custompipes_d3d9.o \
|
||||||
|
../src/extras/custompipes_gl.o \
|
||||||
|
../src/core/CdStream.o \
|
||||||
|
../src/core/CdStreamPosix.o \
|
||||||
|
../src/extras \
|
||||||
|
../src/extras/GitSHA1.cpp.in \
|
||||||
|
../src/core/AnimViewer.o \
|
||||||
|
|
||||||
|
RW_OBJS = \
|
||||||
|
../vendor/librw/src/anim.o \
|
||||||
|
../vendor/librw/src/base.o \
|
||||||
|
../vendor/librw/src/camera.o \
|
||||||
|
../vendor/librw/src/charset.o \
|
||||||
|
../vendor/librw/src/clump.o \
|
||||||
|
../vendor/librw/src/engine.o \
|
||||||
|
../vendor/librw/src/error.o \
|
||||||
|
../vendor/librw/src/frame.o \
|
||||||
|
../vendor/librw/src/geometry.o \
|
||||||
|
../vendor/librw/src/geoplg.o \
|
||||||
|
../vendor/librw/src/hanim.o \
|
||||||
|
../vendor/librw/src/image.o \
|
||||||
|
../vendor/librw/src/light.o \
|
||||||
|
../vendor/librw/src/matfx.o \
|
||||||
|
../vendor/librw/src/pipeline.o \
|
||||||
|
../vendor/librw/src/plg.o \
|
||||||
|
../vendor/librw/src/prim.o \
|
||||||
|
../vendor/librw/src/raster.o \
|
||||||
|
../vendor/librw/src/render.o \
|
||||||
|
../vendor/librw/src/skin.o \
|
||||||
|
../vendor/librw/src/texture.o \
|
||||||
|
../vendor/librw/src/tristrip.o \
|
||||||
|
../vendor/librw/src/userdata.o \
|
||||||
|
../vendor/librw/src/uvanim.o \
|
||||||
|
../vendor/librw/src/world.o \
|
||||||
|
\
|
||||||
|
../vendor/librw/src/dc/rwdc.o \
|
||||||
|
../vendor/librw/src/dc/alloc.o
|
||||||
|
|
||||||
|
# Excluded \
|
||||||
|
../vendor/librw/src/d3d-x/d3d.o \
|
||||||
|
../vendor/librw/src/d3d-x/d3d8.o \
|
||||||
|
../vendor/librw/src/d3d-x/d3d8render.o \
|
||||||
|
../vendor/librw/src/d3d/d3d8.o \
|
||||||
|
../vendor/librw/src/d3d/d3d8matfx.o \
|
||||||
|
../vendor/librw/src/d3d/d3d8render.o \
|
||||||
|
../vendor/librw/src/d3d/d3d8skin.o \
|
||||||
|
../vendor/librw/src/d3d/d3d9.o \
|
||||||
|
../vendor/librw/src/d3d/d3d9matfx.o \
|
||||||
|
../vendor/librw/src/d3d/d3d9render.o \
|
||||||
|
../vendor/librw/src/d3d/d3d9skin.o \
|
||||||
|
../vendor/librw/src/d3d/d3d.o \
|
||||||
|
../vendor/librw/src/d3d/d3ddevice.o \
|
||||||
|
../vendor/librw/src/d3d/d3dimmed.o \
|
||||||
|
../vendor/librw/src/d3d/d3drender.o \
|
||||||
|
../vendor/librw/src/d3d/xbox.o \
|
||||||
|
../vendor/librw/src/d3d/xboxmatfx.o \
|
||||||
|
../vendor/librw/src/d3d/xboxskin.o \
|
||||||
|
../vendor/librw/src/d3d/xboxvfmt.o \
|
||||||
|
\
|
||||||
|
../vendor/librw/src/gl/gl3.o \
|
||||||
|
../vendor/librw/src/gl/gl3device.o \
|
||||||
|
../vendor/librw/src/gl/gl3immed.o \
|
||||||
|
../vendor/librw/src/gl/gl3matfx.o \
|
||||||
|
../vendor/librw/src/gl/gl3pipe.o \
|
||||||
|
../vendor/librw/src/gl/gl3raster.o \
|
||||||
|
../vendor/librw/src/gl/gl3render.o \
|
||||||
|
../vendor/librw/src/gl/gl3shader.o \
|
||||||
|
../vendor/librw/src/gl/gl3skin.o \
|
||||||
|
../vendor/librw/src/gl/wdgl.o \
|
||||||
|
../vendor/librw/src/gl/glad/glad.cXXX \
|
||||||
|
\
|
||||||
|
../vendor/librw/src/ps2/pds.o \
|
||||||
|
../vendor/librw/src/ps2/ps2.o \
|
||||||
|
../vendor/librw/src/ps2/ps2device.o \
|
||||||
|
../vendor/librw/src/ps2/ps2matfx.o \
|
||||||
|
../vendor/librw/src/ps2/ps2raster.o \
|
||||||
|
../vendor/librw/src/ps2/ps2skin.o \
|
||||||
|
|
||||||
|
INCLUDE = \
|
||||||
|
-I../src/animation \
|
||||||
|
-I../src/audio \
|
||||||
|
-I../src/buildings \
|
||||||
|
-I../src/collision \
|
||||||
|
-I../src/control \
|
||||||
|
-I../src/core \
|
||||||
|
-I../src/entities \
|
||||||
|
-I../src/extras \
|
||||||
|
-I../src/fakerw \
|
||||||
|
-I../src/math \
|
||||||
|
-I../src/modelinfo \
|
||||||
|
-I../src/objects \
|
||||||
|
-I../src/peds \
|
||||||
|
-I../src/renderer \
|
||||||
|
-I../src/rw \
|
||||||
|
-I../src/save \
|
||||||
|
-I../src/skel \
|
||||||
|
-I../src/text \
|
||||||
|
-I../src/vehicles \
|
||||||
|
-I../src/weapons \
|
||||||
|
-I../src/audio/eax \
|
||||||
|
-I../src/audio/oal \
|
||||||
|
-I../src/extras/shaders \
|
||||||
|
-I../src/extras/shaders/obj \
|
||||||
|
-I../src/skel/glfw \
|
||||||
|
-I../src/skel/win \
|
||||||
|
\
|
||||||
|
-I../vendor/librw \
|
||||||
|
\
|
||||||
|
-I../vendor/miniLZO
|
||||||
|
|
||||||
|
DEFINES = -DRW_DC -DLIBRW $(if $(WITH_LOGGING),-DWITH_LOGGING) $(if $(WITH_DCLOAD),-DDC_CHDIR=/pc) \
|
||||||
|
$(if $(WITH_BEEPS),-DWITH_BEEPS)
|
||||||
|
FLAGS = -fpermissive -Wno-sign-compare -Wno-parentheses -Wno-maybe-uninitialized \
|
||||||
|
-Wno-format -Wno-strict-aliasing -Wno-unused-variable \
|
||||||
|
-Wno-unused-but-set-variable -Wno-write-strings \
|
||||||
|
-Wno-deprecated-enum-enum-conversion -Wno-deprecated-enum-float-conversion \
|
||||||
|
-Wno-multichar -Wno-unused-value -Wno-char-subscripts -Wno-reorder \
|
||||||
|
-Wno-unused-function -Wno-class-memaccess -fno-permissive
|
||||||
|
|
||||||
|
CPPFLAGS += $(INCLUDE) $(DEFINES) $(FLAGS)
|
||||||
|
CFLAGS += -std=gnu17 $(CPPFLAGS)
|
||||||
|
CXXFLAGS += -std=gnu++20 $(CPPFLAGS)
|
||||||
114
dreamcast/gen-mesh-variants.py
Normal file
114
dreamcast/gen-mesh-variants.py
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
|
||||||
|
def variant(small_xyz, pad_xyz, small_uv):
|
||||||
|
return f"""
|
||||||
|
&submitMesh<false,0, false, false, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, false, false, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<false,0, true, false, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, true, false, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<false,0, false, true, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, false, true, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<false,0, true, true, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, true, true, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
&submitMesh<false,0, false, true, true, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, false, true, true, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<false,0, true, true, true, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, true, true, true, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<false,0, false, false, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, false, false, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<false,0, true, false, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, true, false, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<false,0, false, true, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, false, true, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<false,0, true, true, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, true, true, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
&submitMesh<false,0, false, true, true, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, false, true, true, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<false,0, true, true, true, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
&submitMesh<true,0, true, true, true, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, false, false, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, true, false, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, false, true, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, true, true, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, false, true, true, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, true, true, true, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, false, false, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, true, false, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, false, true, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, true, true, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, false, true, true, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,1, true, true, true, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, false, false, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, true, false, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, false, true, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, true, true, false, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, false, true, true, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, true, true, true, false, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, false, false, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, true, false, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, false, true, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, true, true, false, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, false, true, true, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
0,
|
||||||
|
&submitMesh<true,2, true, true, true, true, {'true' if small_xyz else 'false'}, {'true' if small_xyz and pad_xyz else 'false'}, {'true' if small_uv else 'false'}>,
|
||||||
|
"""
|
||||||
|
|
||||||
|
str = ""
|
||||||
|
str += variant(False, False, False)
|
||||||
|
str += variant(False, False, True)
|
||||||
|
str += variant(False, True, False)
|
||||||
|
str += variant(False, True, True)
|
||||||
|
str += variant(True, False, False)
|
||||||
|
str += variant(True, False, True)
|
||||||
|
str += variant(True, True, False)
|
||||||
|
str += variant(True, True, True)
|
||||||
|
|
||||||
|
print(str)
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
# models/coll/peds.col # not actually used
|
|
||||||
|
|
||||||
MISC_FILES = \
|
MISC_FILES = \
|
||||||
anim/cuts.dir \
|
anim/cuts.dir \
|
||||||
anim/cuts.img \
|
anim/cuts.img \
|
||||||
@@ -112,6 +110,7 @@ MISC_FILES = \
|
|||||||
models/Coll/commer.col \
|
models/Coll/commer.col \
|
||||||
models/Coll/generic.col \
|
models/Coll/generic.col \
|
||||||
models/Coll/indust.col \
|
models/Coll/indust.col \
|
||||||
|
models/Coll/peds.col \
|
||||||
models/Coll/suburb.col \
|
models/Coll/suburb.col \
|
||||||
models/Coll/vehicles.col \
|
models/Coll/vehicles.col \
|
||||||
models/Coll/weapons.col \
|
models/Coll/weapons.col \
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
// Sector size constant
|
// Sector size constant
|
||||||
const size_t SECTOR_SIZE = 2048;
|
const size_t SECTOR_SIZE = 2048;
|
||||||
@@ -28,12 +27,7 @@ std::vector<DirRecord> readDirFile(const std::string& dirFilePath) {
|
|||||||
DirRecord record;
|
DirRecord record;
|
||||||
|
|
||||||
while (dirFile.read(reinterpret_cast<char*>(&record), sizeof(DirRecord))) {
|
while (dirFile.read(reinterpret_cast<char*>(&record), sizeof(DirRecord))) {
|
||||||
// assert(record.size != 0); // plaster.dff is size zero on liberty
|
records.push_back(record);
|
||||||
if (record.size > 0) {
|
|
||||||
records.push_back(record);
|
|
||||||
} else {
|
|
||||||
std::cerr << "Skipping record: " << record.name << " size is zero." << std::endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return records;
|
return records;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
Device Info : CD-ROM1/1
|
Device Info : CD-ROM1/1
|
||||||
Area Symbols : JUE
|
Area Symbols : JUE
|
||||||
Peripherals : E000F10
|
Peripherals : E000F10
|
||||||
Product No : DCA-MIAM
|
Product No : T0000
|
||||||
Version : V1.000
|
Version : V1.000
|
||||||
Release Date : 20250401
|
Release Date : 20000627
|
||||||
Boot Filename : 1ST_READ.BIN
|
Boot Filename : 1ST_READ.BIN
|
||||||
SW Maker Name : the gang
|
SW Maker Name : the gang
|
||||||
Game Title : dca-miami
|
Game Title : DCA3
|
||||||
0
dreamcast/pvrtex/config.h
Normal file
0
dreamcast/pvrtex/config.h
Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user