mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Compare commits
111
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
133f346cdb | ||
|
|
f46e3f1004 | ||
|
|
bba7528c76 | ||
|
|
eed4156d48 | ||
|
|
23bf32e4ad | ||
|
|
3bfebf6c8d | ||
|
|
ce02a488f0 | ||
|
|
caa02cd6b7 | ||
|
|
3391c6d777 | ||
|
|
2307508a85 | ||
|
|
a26845b608 | ||
|
|
f7f214f347 | ||
|
|
c32d09b88e | ||
|
|
3bab6ef3b7 | ||
|
|
b13bcaac71 | ||
|
|
71667aba27 | ||
|
|
e386a66f03 | ||
|
|
c03bd3ff3a | ||
|
|
6650f70c93 | ||
|
|
cdb267ea17 | ||
|
|
72f01b5379 | ||
|
|
dee2415d4a | ||
|
|
049ec47219 | ||
|
|
d670383f3a | ||
|
|
fad3a27059 | ||
|
|
682dbaa8fc | ||
|
|
42cbf3fdbb | ||
|
|
236eb08b68 | ||
|
|
e6c5f95d73 | ||
|
|
bf01f87cb4 | ||
|
|
9dfbc7d394 | ||
|
|
0616507282 | ||
|
|
65698284c3 | ||
|
|
4338b5b909 | ||
|
|
ef69f9b2e6 | ||
|
|
28a4db0355 | ||
|
|
6ef6303eb1 | ||
|
|
32cae66229 | ||
|
|
b081f2af88 | ||
|
|
8b02dfe66a | ||
|
|
c1e72eaab2 | ||
|
|
ec1f6e651b | ||
|
|
082b42ef73 | ||
|
|
352459910c | ||
|
|
d296789929 | ||
|
|
0910dba472 | ||
|
|
bb63cb9aa3 | ||
|
|
a80fea00e2 | ||
|
|
e93dc3fb6d | ||
|
|
51c3967c42 | ||
|
|
2697a17010 | ||
|
|
5a74323d1f | ||
|
|
7546a23d0d | ||
|
|
c7bd75b60d | ||
|
|
6840394610 | ||
|
|
57bf3d9fa7 | ||
|
|
fd4b531d53 | ||
|
|
4d09bea13e | ||
|
|
62dd0914fc | ||
|
|
3d5294003a | ||
|
|
668a4e96ad | ||
|
|
f11393728c | ||
|
|
ae55496e39 | ||
|
|
5d3118ea75 | ||
|
|
381ab936eb | ||
|
|
f88b07b99b | ||
|
|
3f7b35c1a1 | ||
|
|
153eb5fb10 | ||
|
|
f5f3bb94de | ||
|
|
58a682db89 | ||
|
|
2849590ef2 | ||
|
|
5b635784cd | ||
|
|
d43a597423 | ||
|
|
5a7ef1930f | ||
|
|
1483f15832 | ||
|
|
db0787b5a3 | ||
|
|
b7f974f41b | ||
|
|
c07f3f460b | ||
|
|
eff1ccfe63 | ||
|
|
62b8d272e6 | ||
|
|
6c0b62cb42 | ||
|
|
02f733ce2f | ||
|
|
8f454e2aab | ||
|
|
a47ed9ed55 | ||
|
|
8080b06be4 | ||
|
|
e6f1f40aea | ||
|
|
5ec08231a3 | ||
|
|
7483829c65 | ||
|
|
d6a3a27b58 | ||
|
|
f00214d00d | ||
|
|
029af63eb8 | ||
|
|
d3b4874af0 | ||
|
|
8525d3f869 | ||
|
|
48722f26d6 | ||
|
|
5a922e3a42 | ||
|
|
f11534e792 | ||
|
|
f5e0d0bbd8 | ||
|
|
74a25a2069 | ||
|
|
0b5f14a3ad | ||
|
|
4b1de56b01 | ||
|
|
56a55f1bc4 | ||
|
|
eca4086d30 | ||
|
|
b8a870df02 | ||
|
|
b68f206969 | ||
|
|
8d49e74df4 | ||
|
|
14ec138fc7 | ||
|
|
a3be3ecd7e | ||
|
|
9033e1097a | ||
|
|
3fa6a4bd45 | ||
|
|
1c11c88598 | ||
|
|
0962319a43 |
+23
-59
@@ -154,7 +154,7 @@ jobs:
|
|||||||
cat dist/versions.env
|
cat dist/versions.env
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: versions.env
|
name: versions.env
|
||||||
path: dist/
|
path: dist/
|
||||||
@@ -179,77 +179,41 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: dist
|
||||||
|
pattern: '*_release'
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Move release archives to dist/
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
mkdir dist/
|
|
||||||
mv artifacts/*_release/* dist/
|
|
||||||
|
|
||||||
- name: Delete Latest Release and Tag
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
uses: dev-drprasad/delete-tag-and-release@v1.0
|
|
||||||
with:
|
|
||||||
delete_release: true
|
|
||||||
tag_name: "latest"
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: source
|
path: source
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
sparse-checkout: 'README.md'
|
sparse-checkout: 'README.md'
|
||||||
- name: Create Latest Tag
|
- name: Create latest pre-release
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
working-directory: source
|
working-directory: source
|
||||||
run: |
|
run: |
|
||||||
|
gh release delete latest --cleanup-tag || true
|
||||||
git tag -d latest || true
|
git tag -d latest || true
|
||||||
|
git push --delete origin refs/tags/latest || true
|
||||||
git tag latest
|
git tag latest
|
||||||
git push origin latest
|
git push --force origin refs/tags/latest
|
||||||
- id: release_latest
|
gh release create latest ../dist/* \
|
||||||
name: Release Latest
|
--generate-notes \
|
||||||
if: github.ref == 'refs/heads/master'
|
--title "Latest (unstable)" \
|
||||||
uses: ncipollo/release-action@v1
|
--verify-tag \
|
||||||
with:
|
--prerelease
|
||||||
artifactErrorsFailBuild: true
|
env:
|
||||||
artifacts: dist/*
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
generateReleaseNotes: true
|
|
||||||
makeLatest: true
|
|
||||||
name: "Latest (unstable)"
|
|
||||||
prerelease: true
|
|
||||||
tag: "latest"
|
|
||||||
|
|
||||||
- id: release_tag
|
- name: Upload to tagged release
|
||||||
name: Release Tag
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
with:
|
working-directory: source
|
||||||
allowUpdates: true
|
|
||||||
artifactErrorsFailBuild: true
|
|
||||||
artifacts: dist/*
|
|
||||||
draft: false
|
|
||||||
generateReleaseNotes: true
|
|
||||||
makeLatest: true
|
|
||||||
omitBodyDuringUpdate: true
|
|
||||||
omitDraftDuringUpdate: true
|
|
||||||
omitNameDuringUpdate: true
|
|
||||||
omitPrereleaseDuringUpdate: true
|
|
||||||
|
|
||||||
- name: Show release outputs
|
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
echo 'id: '
|
exit 0
|
||||||
echo -n '${{ steps.release_tag.outputs.id }}'
|
gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber
|
||||||
echo -n '${{ steps.release_latest.outputs.id }}'
|
env:
|
||||||
echo ''
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
echo ''
|
|
||||||
echo 'url:'
|
|
||||||
echo -n '${{ steps.release_tag.outputs.html_url }}'
|
|
||||||
echo -n '${{ steps.release_latest.outputs.html_url }}'
|
|
||||||
echo ''
|
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source
|
- name: Checkout source
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Download versions.env
|
- name: Download versions.env
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: versions.env
|
name: versions.env
|
||||||
path: artifacts
|
path: artifacts
|
||||||
@@ -41,6 +41,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: cat artifacts/versions.env >> $GITHUB_ENV
|
run: cat artifacts/versions.env >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# TODO: Move this into CMake, just taking the GitHub Actions parameters as -D variables
|
||||||
- name: Update GameVersion.cpp
|
- name: Update GameVersion.cpp
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -49,9 +50,9 @@ jobs:
|
|||||||
GAME_VERSION=$(echo "$GAME_VERSION" | tr -cd '[:print:]' | tr -d '"\\')
|
GAME_VERSION=$(echo "$GAME_VERSION" | tr -cd '[:print:]' | tr -d '"\\')
|
||||||
GAME_BUILD="${INPUTS_LANGUAGE:0:2} $GAME_BUILD_INFORMATION"
|
GAME_BUILD="${INPUTS_LANGUAGE:0:2} $GAME_BUILD_INFORMATION"
|
||||||
GAME_BUILD=$(echo "$GAME_BUILD" | tr -cd '[:print:]' | tr -d '"\\')
|
GAME_BUILD=$(echo "$GAME_BUILD" | tr -cd '[:print:]' | tr -d '"\\')
|
||||||
sed -i "s|@Version@|${GAME_VERSION:0:15}|" GameVersion.cpp
|
sed -i "s|@Version@|${GAME_VERSION:0:15}|" Ja2/GameVersion.cpp
|
||||||
sed -i "s|@Build@|${GAME_BUILD:0:255}|" GameVersion.cpp
|
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp
|
||||||
cat GameVersion.cpp
|
cat Ja2/GameVersion.cpp
|
||||||
|
|
||||||
- name: Prepare build properties
|
- name: Prepare build properties
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -68,7 +69,7 @@ jobs:
|
|||||||
JA2Application=$JA2Application
|
JA2Application=$JA2Application
|
||||||
" >> $GITHUB_ENV
|
" >> $GITHUB_ENV
|
||||||
|
|
||||||
- uses: microsoft/setup-msbuild@v1.1
|
- uses: microsoft/setup-msbuild@v2
|
||||||
with:
|
with:
|
||||||
msbuild-architecture: x86
|
msbuild-architecture: x86
|
||||||
- uses: ilammy/msvc-dev-cmd@v1
|
- uses: ilammy/msvc-dev-cmd@v1
|
||||||
@@ -86,7 +87,7 @@ jobs:
|
|||||||
find build/
|
find build/
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.language }}_${{ matrix.application }}
|
name: ${{ inputs.language }}_${{ matrix.application }}
|
||||||
path: build/*.exe
|
path: build/*.exe
|
||||||
@@ -99,7 +100,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download versions.env
|
- name: Download versions.env
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: versions.env
|
name: versions.env
|
||||||
path: artifacts
|
path: artifacts
|
||||||
@@ -108,7 +109,7 @@ jobs:
|
|||||||
run: cat artifacts/versions.env >> $GITHUB_ENV
|
run: cat artifacts/versions.env >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Checkout gamedir
|
- name: Checkout gamedir
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ env.GAMEDIR_REPOSITORY }}
|
repository: ${{ env.GAMEDIR_REPOSITORY }}
|
||||||
ref: ${{ env.GAMEDIR_COMMIT_SHA }}
|
ref: ${{ env.GAMEDIR_COMMIT_SHA }}
|
||||||
@@ -116,7 +117,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout gamedir-languages
|
- name: Checkout gamedir-languages
|
||||||
if: inputs.language != 'English'
|
if: inputs.language != 'English'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ env.GAMEDIR_LANGUAGES_REPOSITORY }}
|
repository: ${{ env.GAMEDIR_LANGUAGES_REPOSITORY }}
|
||||||
ref: ${{ env.GAMEDIR_LANGUAGES_COMMIT_SHA }}
|
ref: ${{ env.GAMEDIR_LANGUAGES_COMMIT_SHA }}
|
||||||
@@ -130,25 +131,25 @@ jobs:
|
|||||||
cp -a gamedir-languages/${{ inputs.language }}_Version/* gamedir/
|
cp -a gamedir-languages/${{ inputs.language }}_Version/* gamedir/
|
||||||
|
|
||||||
- name: Download ja2
|
- name: Download ja2
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.language }}_ja2
|
name: ${{ inputs.language }}_ja2
|
||||||
path: artifacts/ja2
|
path: artifacts/ja2
|
||||||
|
|
||||||
- name: Download ja2mapeditor
|
- name: Download ja2mapeditor
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.language }}_ja2mapeditor
|
name: ${{ inputs.language }}_ja2mapeditor
|
||||||
path: artifacts/ja2mapeditor
|
path: artifacts/ja2mapeditor
|
||||||
|
|
||||||
- name: Download ja2ub
|
- name: Download ja2ub
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.language }}_ja2ub
|
name: ${{ inputs.language }}_ja2ub
|
||||||
path: artifacts/ja2ub
|
path: artifacts/ja2ub
|
||||||
|
|
||||||
- name: Download ja2ubmapeditor
|
- name: Download ja2ubmapeditor
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.language }}_ja2ubmapeditor
|
name: ${{ inputs.language }}_ja2ubmapeditor
|
||||||
path: artifacts/ja2ubmapeditor
|
path: artifacts/ja2ubmapeditor
|
||||||
@@ -198,7 +199,8 @@ jobs:
|
|||||||
7z a -bb -xr'!.*' "../dist/${DIST_NAME}.7z" .
|
7z a -bb -xr'!.*' "../dist/${DIST_NAME}.7z" .
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.language }}_release
|
name: ${{ inputs.language }}_release
|
||||||
path: dist/
|
path: dist/
|
||||||
|
compression-level: 0
|
||||||
|
|||||||
+13
-75
@@ -22,8 +22,8 @@ set(usingMsBuild $<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>)
|
|||||||
# TODO: build our own Lua 5.1.2 from source so we can use whichever
|
# TODO: build our own Lua 5.1.2 from source so we can use whichever
|
||||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
|
||||||
add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP USE_VFS _CRT_SECURE_NO_DEPRECATE)
|
add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP _CRT_SECURE_NO_DEPRECATE)
|
||||||
include_directories(${CMAKE_SOURCE_DIR} "ext/VFS/include" Utils TileEngine TacticalAI ModularizedTacticalAI Tactical Strategic "Standard Gaming Platform" Res Lua Laptop Multiplayer "Multiplayer/raknet" Editor Console)
|
include_directories(Ja2 "ext/VFS/include" Utils TileEngine TacticalAI "ModularizedTacticalAI/include" Tactical Strategic sgp "Ja2/Res" Lua Laptop Multiplayer Editor Console)
|
||||||
|
|
||||||
# external libraries
|
# external libraries
|
||||||
add_subdirectory("ext/libpng")
|
add_subdirectory("ext/libpng")
|
||||||
@@ -38,90 +38,28 @@ add_subdirectory("ext/export/src")
|
|||||||
# by header files do not rely on Applications or Languages preprocessor definitions,
|
# by header files do not rely on Applications or Languages preprocessor definitions,
|
||||||
# and therefore only need to be compiled once. Good.
|
# and therefore only need to be compiled once. Good.
|
||||||
add_subdirectory(Lua)
|
add_subdirectory(Lua)
|
||||||
|
add_subdirectory(Multiplayer)
|
||||||
|
|
||||||
# static libraries whose source files, header files or header files included
|
# static libraries whose source files, header files or header files included
|
||||||
# by header files rely on Application and Language preprocessor definitions, and
|
# by header files rely on Application and Language preprocessor definitions, and
|
||||||
# therefore need to be compiled multiple times. Very Bad.
|
# therefore need to be compiled multiple times. Very Bad.
|
||||||
add_subdirectory(TileEngine)
|
|
||||||
add_subdirectory(TacticalAI)
|
|
||||||
add_subdirectory(Utils)
|
|
||||||
add_subdirectory(Strategic)
|
|
||||||
add_subdirectory("Standard Gaming Platform")
|
|
||||||
add_subdirectory(Laptop)
|
|
||||||
add_subdirectory(Editor)
|
|
||||||
add_subdirectory(Console)
|
|
||||||
add_subdirectory(Tactical)
|
|
||||||
add_subdirectory(ModularizedTacticalAI)
|
|
||||||
# TODO: Rename 'Standard Gaming Platform' directory to 'SGP' so this can be refactored away
|
|
||||||
set(Ja2_Libs
|
set(Ja2_Libs
|
||||||
TileEngine
|
TileEngine
|
||||||
TacticalAI
|
TacticalAI
|
||||||
Utils
|
Utils
|
||||||
Strategic
|
Strategic
|
||||||
SGP
|
sgp
|
||||||
Laptop
|
Laptop
|
||||||
Editor
|
Editor
|
||||||
Console
|
Console
|
||||||
Tactical
|
Tactical
|
||||||
ModularizedTacticalAI
|
ModularizedTacticalAI
|
||||||
)
|
)
|
||||||
|
foreach(lib IN LISTS Ja2_Libs)
|
||||||
|
add_subdirectory(${lib})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# TODO: Move these units into their own directory to declutter the root dir and CMakeLists.txt file
|
add_subdirectory(Ja2)
|
||||||
set(Ja2Src
|
|
||||||
"aniviewscreen.cpp"
|
|
||||||
"Credits.cpp"
|
|
||||||
"Fade Screen.cpp"
|
|
||||||
"FeaturesScreen.cpp"
|
|
||||||
"GameInitOptionsScreen.cpp"
|
|
||||||
"gameloop.cpp"
|
|
||||||
"gamescreen.cpp"
|
|
||||||
"GameSettings.cpp"
|
|
||||||
"GameVersion.cpp"
|
|
||||||
"HelpScreen.cpp"
|
|
||||||
"Init.cpp"
|
|
||||||
"Intro.cpp"
|
|
||||||
"JA2 Splash.cpp"
|
|
||||||
"Ja25Update.cpp"
|
|
||||||
"jascreens.cpp"
|
|
||||||
"Language Defines.cpp"
|
|
||||||
"Loading Screen.cpp"
|
|
||||||
"MainMenuScreen.cpp"
|
|
||||||
"MessageBoxScreen.cpp"
|
|
||||||
"MPChatScreen.cpp"
|
|
||||||
"MPConnectScreen.cpp"
|
|
||||||
"MPHostScreen.cpp"
|
|
||||||
"MPJoinScreen.cpp"
|
|
||||||
"MPScoreScreen.cpp"
|
|
||||||
"MPXmlTeams.cpp"
|
|
||||||
"Multiplayer/client.cpp"
|
|
||||||
"Multiplayer/server.cpp"
|
|
||||||
"Multiplayer/transfer_rules.cpp"
|
|
||||||
"Options Screen.cpp"
|
|
||||||
"profiler.cpp"
|
|
||||||
"SaveLoadGame.cpp"
|
|
||||||
"SaveLoadScreen.cpp"
|
|
||||||
"SCREENS.cpp"
|
|
||||||
"Sys Globals.cpp"
|
|
||||||
"ub_config.cpp"
|
|
||||||
"XML_DifficultySettings.cpp"
|
|
||||||
"XML_IntroFiles.cpp"
|
|
||||||
"XML_Layout_MainMenu.cpp"
|
|
||||||
Res/ja2.rc
|
|
||||||
)
|
|
||||||
|
|
||||||
set(Ja2_Libraries
|
|
||||||
"${PROJECT_SOURCE_DIR}/libexpatMT.lib"
|
|
||||||
"Dbghelp.lib"
|
|
||||||
Lua
|
|
||||||
"${PROJECT_SOURCE_DIR}/lua51.lib"
|
|
||||||
"${PROJECT_SOURCE_DIR}/lua51.vc9.lib"
|
|
||||||
"Winmm.lib"
|
|
||||||
"${PROJECT_SOURCE_DIR}/SMACKW32.LIB"
|
|
||||||
"${PROJECT_SOURCE_DIR}/binkw32.lib"
|
|
||||||
bfVFS
|
|
||||||
"${PROJECT_SOURCE_DIR}/Multiplayer/raknet/RakNetLibStatic.lib"
|
|
||||||
"ws2_32.lib"
|
|
||||||
)
|
|
||||||
|
|
||||||
# simple function to validate Languages and Application choices
|
# simple function to validate Languages and Application choices
|
||||||
include(cmake/ValidateOptions.cmake)
|
include(cmake/ValidateOptions.cmake)
|
||||||
@@ -160,7 +98,7 @@ foreach(lang IN LISTS LangTargets)
|
|||||||
set(isUb $<STREQUAL:${exe},JA2UB>)
|
set(isUb $<STREQUAL:${exe},JA2UB>)
|
||||||
set(isUbEditor $<STREQUAL:${exe},JA2UBMAPEDITOR>)
|
set(isUbEditor $<STREQUAL:${exe},JA2UBMAPEDITOR>)
|
||||||
|
|
||||||
# static library for an app/lang combination, e.g. JA2_ENGLISH_SGP.lib
|
# static library for an app/lang combination, e.g. JA2_ENGLISH_sgp.lib
|
||||||
add_library(${VeryBadLib})
|
add_library(${VeryBadLib})
|
||||||
target_sources(${VeryBadLib} PRIVATE ${${lib}Src})
|
target_sources(${VeryBadLib} PRIVATE ${${lib}Src})
|
||||||
|
|
||||||
@@ -174,9 +112,9 @@ foreach(lang IN LISTS LangTargets)
|
|||||||
target_link_libraries(${Executable} PUBLIC ${VeryBadLib})
|
target_link_libraries(${Executable} PUBLIC ${VeryBadLib})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# for SGP only
|
# for sgp only
|
||||||
target_link_libraries(${Executable}_SGP PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
|
target_link_libraries(${Executable}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
|
||||||
target_link_libraries(${Executable}_SGP PUBLIC libpng)
|
target_link_libraries(${Executable}_sgp PUBLIC libpng)
|
||||||
target_compile_definitions(${Executable}_SGP PRIVATE NO_ZLIB_COMPRESSION)
|
target_compile_definitions(${Executable}_sgp PRIVATE NO_ZLIB_COMPRESSION)
|
||||||
endforeach()
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|||||||
+2
-41
@@ -83,9 +83,7 @@ INT32 iCurrFileShown;
|
|||||||
INT32 iLastFileClicked;
|
INT32 iLastFileClicked;
|
||||||
INT32 iLastClickTime;
|
INT32 iLastClickTime;
|
||||||
|
|
||||||
#ifdef USE_VFS
|
|
||||||
CHAR8 gzProfileName[FILENAME_BUFLEN];//dnl ch81 021213
|
CHAR8 gzProfileName[FILENAME_BUFLEN];//dnl ch81 021213
|
||||||
#endif
|
|
||||||
CHAR16 gzFilename[FILENAME_BUFLEN];//dnl ch39 190909
|
CHAR16 gzFilename[FILENAME_BUFLEN];//dnl ch39 190909
|
||||||
extern INT16 gsSelSectorX;
|
extern INT16 gsSelSectorX;
|
||||||
extern INT16 gsSelSectorY;
|
extern INT16 gsSelSectorY;
|
||||||
@@ -165,7 +163,6 @@ void LoadSaveScreenEntry()
|
|||||||
}
|
}
|
||||||
|
|
||||||
iTopFileShown = iTotalFiles = 0;
|
iTopFileShown = iTotalFiles = 0;
|
||||||
#ifdef USE_VFS//dnl ch37 300909
|
|
||||||
gzProfileName[0] = 0;//dnl ch81 021213
|
gzProfileName[0] = 0;//dnl ch81 021213
|
||||||
FDLG_LIST* TempFileList = NULL;
|
FDLG_LIST* TempFileList = NULL;
|
||||||
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
||||||
@@ -220,25 +217,6 @@ void LoadSaveScreenEntry()
|
|||||||
}
|
}
|
||||||
while(FileList->pPrev)
|
while(FileList->pPrev)
|
||||||
FileList = FileList->pPrev;
|
FileList = FileList->pPrev;
|
||||||
#else
|
|
||||||
if(GetFileFirst("MAPS\\*.dat", &FileInfo))
|
|
||||||
{
|
|
||||||
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
|
|
||||||
{
|
|
||||||
FileList = AddToFDlgList(FileList, &FileInfo);
|
|
||||||
iTotalFiles++;
|
|
||||||
}
|
|
||||||
while(GetFileNext(&FileInfo))
|
|
||||||
{
|
|
||||||
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
|
|
||||||
{
|
|
||||||
FileList = AddToFDlgList(FileList, &FileInfo);
|
|
||||||
iTotalFiles++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GetFileClose(&FileInfo);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
swprintf( zOrigName, L"%s Map (*.dat)", iCurrentAction == ACTION_SAVE_MAP ? L"Save" : L"Load" );
|
swprintf( zOrigName, L"%s Map (*.dat)", iCurrentAction == ACTION_SAVE_MAP ? L"Save" : L"Load" );
|
||||||
|
|
||||||
swprintf( gzFilename, L"%S", gubFilename );
|
swprintf( gzFilename, L"%S", gubFilename );
|
||||||
@@ -283,7 +261,8 @@ UINT32 ProcessLoadSaveScreenMessageBoxResult()
|
|||||||
{
|
{
|
||||||
if( gfReadOnly )
|
if( gfReadOnly )
|
||||||
{
|
{
|
||||||
FileClearAttributes( gszCurrFilename );
|
// Other call sites have replaced this with FileDelete(); for VFS, should we do the same here?
|
||||||
|
//FileClearAttributes( gszCurrFilename );
|
||||||
gfReadOnly = FALSE;
|
gfReadOnly = FALSE;
|
||||||
}
|
}
|
||||||
FileDelete( gszCurrFilename );
|
FileDelete( gszCurrFilename );
|
||||||
@@ -468,19 +447,6 @@ UINT32 LoadSaveScreenHandle(void)
|
|||||||
}
|
}
|
||||||
sprintf(gszCurrFilename, "MAPS\\%S", gzFilename);
|
sprintf(gszCurrFilename, "MAPS\\%S", gzFilename);
|
||||||
gfFileExists = FALSE;
|
gfFileExists = FALSE;
|
||||||
#ifndef USE_VFS
|
|
||||||
gfReadOnly = FALSE;
|
|
||||||
if(FileExists(gszCurrFilename))
|
|
||||||
{
|
|
||||||
gfFileExists = TRUE;
|
|
||||||
if(GetFileFirst(gszCurrFilename, &FileInfo))
|
|
||||||
{
|
|
||||||
if(FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_DIRECTORY|FILE_IS_HIDDEN|FILE_IS_SYSTEM|FILE_IS_OFFLINE|FILE_IS_TEMPORARY))
|
|
||||||
gfReadOnly = TRUE;
|
|
||||||
GetFileClose(&FileInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
gfReadOnly = TRUE;
|
gfReadOnly = TRUE;
|
||||||
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
||||||
vfs::CProfileStack::Iterator it = st->begin();
|
vfs::CProfileStack::Iterator it = st->begin();
|
||||||
@@ -502,7 +468,6 @@ UINT32 LoadSaveScreenHandle(void)
|
|||||||
}
|
}
|
||||||
it.next();
|
it.next();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if(gfReadOnly)
|
if(gfReadOnly)
|
||||||
{
|
{
|
||||||
CreateMessageBox(L" File is read only! Choose a different name? ");
|
CreateMessageBox(L" File is read only! Choose a different name? ");
|
||||||
@@ -726,7 +691,6 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos )
|
|||||||
iLastClickTime = iCurrClickTime;
|
iLastClickTime = iCurrClickTime;
|
||||||
iLastFileClicked = x;
|
iLastFileClicked = x;
|
||||||
//dnl ch81 021213
|
//dnl ch81 021213
|
||||||
#ifdef USE_VFS
|
|
||||||
gzProfileName[0] = 0;
|
gzProfileName[0] = 0;
|
||||||
while(FListNode = FListNode->pPrev)
|
while(FListNode = FListNode->pPrev)
|
||||||
{
|
{
|
||||||
@@ -737,7 +701,6 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
FListNode = FListNode->pNext;
|
FListNode = FListNode->pNext;
|
||||||
@@ -950,7 +913,6 @@ void HandleMainKeyEvents( InputAtom *pEvent )
|
|||||||
SetInputFieldStringWith16BitString(0, L"");
|
SetInputFieldStringWith16BitString(0, L"");
|
||||||
wcscpy(gzFilename, L"");
|
wcscpy(gzFilename, L"");
|
||||||
}
|
}
|
||||||
#ifdef USE_VFS
|
|
||||||
gzProfileName[0] = 0;
|
gzProfileName[0] = 0;
|
||||||
while(curr = curr->pPrev)
|
while(curr = curr->pPrev)
|
||||||
{
|
{
|
||||||
@@ -961,7 +923,6 @@ void HandleMainKeyEvents( InputAtom *pEvent )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,7 @@ extern CHAR16 gzErrorCatchString[ 256 ];
|
|||||||
|
|
||||||
//dnl ch81 031213
|
//dnl ch81 031213
|
||||||
extern CHAR16 gzFilename[FILENAME_BUFLEN];
|
extern CHAR16 gzFilename[FILENAME_BUFLEN];
|
||||||
#ifdef USE_VFS
|
|
||||||
extern CHAR8 gzProfileName[FILENAME_BUFLEN];
|
extern CHAR8 gzProfileName[FILENAME_BUFLEN];
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-177
@@ -1923,40 +1923,14 @@ BOOLEAN HandleSummaryInput( InputAtom *pEvent )
|
|||||||
|
|
||||||
void CreateGlobalSummary()
|
void CreateGlobalSummary()
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
FILE *fp;
|
|
||||||
STRING512 Dir;
|
|
||||||
STRING512 ExecDir;
|
|
||||||
#endif
|
|
||||||
OutputDebugString( "Generating GlobalSummary Information...\n" );
|
OutputDebugString( "Generating GlobalSummary Information...\n" );
|
||||||
|
|
||||||
gfGlobalSummaryExists = FALSE;
|
gfGlobalSummaryExists = FALSE;
|
||||||
//Set current directory to JA2\DevInfo which contains all of the summary data
|
//Set current directory to JA2\DevInfo which contains all of the summary data
|
||||||
#ifndef USE_VFS
|
|
||||||
GetExecutableDirectory( ExecDir );
|
|
||||||
sprintf( Dir, "%s\\DevInfo", ExecDir );
|
|
||||||
|
|
||||||
// Snap: save current directory
|
|
||||||
//GetFileManCurrentDirectory( DataDir );
|
|
||||||
|
|
||||||
//Directory doesn't exist, so create it, and continue.
|
|
||||||
if( !MakeFileManDirectory( Dir ) )
|
|
||||||
AssertMsg( 0, "Can't create new directory, JA2\\DevInfo for summary information." );
|
|
||||||
if( !SetFileManCurrentDirectory( Dir ) )
|
|
||||||
AssertMsg( 0, "Can't set to new directory, JA2\\DevInfo for summary information." );
|
|
||||||
|
|
||||||
//Generate a simple readme file.
|
|
||||||
fp = fopen( "readme.txt", "w" );
|
|
||||||
Assert( fp );
|
|
||||||
fprintf( fp, "%s\n%s\n", "This information is used in conjunction with the editor.",
|
|
||||||
"This directory or it's contents shouldn't be included with final release." );
|
|
||||||
fclose( fp );
|
|
||||||
#else
|
|
||||||
vfs::COpenWriteFile wfile(L"DevInfo\\readme.txt",true,true);
|
vfs::COpenWriteFile wfile(L"DevInfo\\readme.txt",true,true);
|
||||||
std::string str = "This information is used in conjunction with the editor.\n";
|
std::string str = "This information is used in conjunction with the editor.\n";
|
||||||
str += "This directory or it's contents shouldn't be included with final release.\n";
|
str += "This directory or it's contents shouldn't be included with final release.\n";
|
||||||
SGP_TRYCATCH_RETHROW( wfile->write(str.c_str(), str.length()), L"" );
|
SGP_TRYCATCH_RETHROW( wfile->write(str.c_str(), str.length()), L"" );
|
||||||
#endif
|
|
||||||
|
|
||||||
// Snap: Restore the data directory once we are finished.
|
// Snap: Restore the data directory once we are finished.
|
||||||
//SetFileManCurrentDirectory( DataDir );
|
//SetFileManCurrentDirectory( DataDir );
|
||||||
@@ -2203,7 +2177,8 @@ void SummarySaveMapCallback( GUI_BUTTON *btn, INT32 reason )
|
|||||||
{
|
{
|
||||||
CHAR8 filename[40];
|
CHAR8 filename[40];
|
||||||
sprintf( filename, "MAPS\\%S", gszDisplayName );
|
sprintf( filename, "MAPS\\%S", gszDisplayName );
|
||||||
FileClearAttributes( filename );
|
// Other call sites have replaced this with FileDelete(); for VFS, should we do the same here?
|
||||||
|
//FileClearAttributes( filename );
|
||||||
}
|
}
|
||||||
if( ExternalSaveMap( gszDisplayName ) )
|
if( ExternalSaveMap( gszDisplayName ) )
|
||||||
{
|
{
|
||||||
@@ -2281,12 +2256,6 @@ void CalculateOverrideStatus()
|
|||||||
void LoadGlobalSummary()
|
void LoadGlobalSummary()
|
||||||
{
|
{
|
||||||
HWFILE hfile;
|
HWFILE hfile;
|
||||||
#ifndef USE_VFS
|
|
||||||
STRING512 DataDir;
|
|
||||||
STRING512 ExecDir;
|
|
||||||
STRING512 DevInfoDir;
|
|
||||||
STRING512 MapsDir;
|
|
||||||
#endif
|
|
||||||
UINT32 uiNumBytesRead;
|
UINT32 uiNumBytesRead;
|
||||||
FLOAT dMajorVersion;
|
FLOAT dMajorVersion;
|
||||||
INT32 x,y;
|
INT32 x,y;
|
||||||
@@ -2295,34 +2264,16 @@ void LoadGlobalSummary()
|
|||||||
|
|
||||||
OutputDebugString( "Executing LoadGlobalSummary()...\n" );
|
OutputDebugString( "Executing LoadGlobalSummary()...\n" );
|
||||||
// Snap: save current directory
|
// Snap: save current directory
|
||||||
#ifndef USE_VFS
|
|
||||||
GetFileManCurrentDirectory( DataDir );
|
|
||||||
#endif
|
|
||||||
gfMustForceUpdateAllMaps = FALSE;
|
gfMustForceUpdateAllMaps = FALSE;
|
||||||
gusNumberOfMapsToBeForceUpdated = 0;
|
gusNumberOfMapsToBeForceUpdated = 0;
|
||||||
gfGlobalSummaryExists = FALSE;
|
gfGlobalSummaryExists = FALSE;
|
||||||
|
|
||||||
//Set current directory to JA2\DevInfo which contains all of the summary data
|
//Set current directory to JA2\DevInfo which contains all of the summary data
|
||||||
#ifndef USE_VFS
|
|
||||||
GetExecutableDirectory( ExecDir );
|
|
||||||
sprintf( DevInfoDir, "%s\\DevInfo", ExecDir );
|
|
||||||
sprintf( MapsDir, "%s\\Maps", DataDir );
|
|
||||||
//Check to make sure we have a DevInfo directory. If we don't create one!
|
|
||||||
if( !SetFileManCurrentDirectory( DevInfoDir ) )
|
|
||||||
{
|
|
||||||
OutputDebugString( "LoadGlobalSummary() aborted -- doesn't exist on this local computer.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
//TEMP
|
//TEMP
|
||||||
#ifndef USE_VFS
|
|
||||||
FileDelete( "_global.sum" );
|
|
||||||
#else
|
|
||||||
if(FileExists("DevInfo\\_global.sum"))
|
if(FileExists("DevInfo\\_global.sum"))
|
||||||
{
|
{
|
||||||
FileDelete( "DevInfo\\_global.sum" );
|
FileDelete( "DevInfo\\_global.sum" );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
gfGlobalSummaryExists = TRUE;
|
gfGlobalSummaryExists = TRUE;
|
||||||
|
|
||||||
//Analyse all sectors to see if matching maps exist. For any maps found, the information
|
//Analyse all sectors to see if matching maps exist. For any maps found, the information
|
||||||
@@ -2337,19 +2288,12 @@ void LoadGlobalSummary()
|
|||||||
sprintf( szSector, "%c%d", 'A' + y, x + 1 );
|
sprintf( szSector, "%c%d", 'A' + y, x + 1 );
|
||||||
|
|
||||||
//main ground level
|
//main ground level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= GROUND_LEVEL_MASK;
|
gbSectorLevels[x][y] |= GROUND_LEVEL_MASK;
|
||||||
@@ -2359,27 +2303,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//main B1 level
|
//main B1 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b1.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b1.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b1.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= BASEMENT1_LEVEL_MASK;
|
gbSectorLevels[x][y] |= BASEMENT1_LEVEL_MASK;
|
||||||
@@ -2389,27 +2322,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b1.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b1.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b1.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//main B2 level
|
//main B2 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b2.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b2.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b2.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= BASEMENT2_LEVEL_MASK;
|
gbSectorLevels[x][y] |= BASEMENT2_LEVEL_MASK;
|
||||||
@@ -2419,27 +2341,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b2.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b2.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b2.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//main B3 level
|
//main B3 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b3.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b3.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b3.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= BASEMENT3_LEVEL_MASK;
|
gbSectorLevels[x][y] |= BASEMENT3_LEVEL_MASK;
|
||||||
@@ -2449,27 +2360,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b3.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b3.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b3.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//alternate ground level
|
//alternate ground level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_a.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_a.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_a.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= ALTERNATE_GROUND_MASK;
|
gbSectorLevels[x][y] |= ALTERNATE_GROUND_MASK;
|
||||||
@@ -2479,27 +2379,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_a.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_a.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_a.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//alternate B1 level
|
//alternate B1 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b1_a.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b1_a.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b1_a.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;
|
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;
|
||||||
@@ -2509,27 +2398,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b1_a.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b1_a.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b1_a.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//alternate B2 level
|
//alternate B2 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b2_a.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b2_a.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b2_a.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= ALTERNATE_B2_MASK;
|
gbSectorLevels[x][y] |= ALTERNATE_B2_MASK;
|
||||||
@@ -2539,27 +2417,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b2_a.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b2_a.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b2_a.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//alternate B3 level
|
//alternate B3 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b3_a.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b3_a.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b3_a.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;;
|
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;;
|
||||||
@@ -2569,20 +2436,12 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b3_a.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b3_a.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b3_a.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OutputDebugString( (LPCSTR)String("Sector Row %c complete... \n", y + 'A') );
|
OutputDebugString( (LPCSTR)String("Sector Row %c complete... \n", y + 'A') );
|
||||||
}
|
}
|
||||||
#ifndef USE_VFS
|
|
||||||
// Snap: Restore the data directory once we are finished.
|
|
||||||
SetFileManCurrentDirectory( DataDir );
|
|
||||||
#endif
|
|
||||||
//sprintf( MapsDir, "%s\\Data", ExecDir );
|
//sprintf( MapsDir, "%s\\Data", ExecDir );
|
||||||
//SetFileManCurrentDirectory( MapsDir );
|
//SetFileManCurrentDirectory( MapsDir );
|
||||||
|
|
||||||
@@ -2599,39 +2458,6 @@ void LoadGlobalSummary()
|
|||||||
|
|
||||||
void GenerateSummaryList()
|
void GenerateSummaryList()
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
FILE *fp;
|
|
||||||
STRING512 DataDir;
|
|
||||||
STRING512 ExecDir;
|
|
||||||
STRING512 Dir;
|
|
||||||
|
|
||||||
// Snap: save current directory
|
|
||||||
GetFileManCurrentDirectory( DataDir );
|
|
||||||
|
|
||||||
//Set current directory to JA2\DevInfo which contains all of the summary data
|
|
||||||
GetExecutableDirectory( ExecDir );
|
|
||||||
sprintf( Dir, "%s\\DevInfo", ExecDir );
|
|
||||||
if( !SetFileManCurrentDirectory( Dir ) )
|
|
||||||
{
|
|
||||||
//Directory doesn't exist, so create it, and continue.
|
|
||||||
if( !MakeFileManDirectory( Dir ) )
|
|
||||||
AssertMsg( 0, "Can't create new directory, JA2\\DevInfo for summary information." );
|
|
||||||
if( !SetFileManCurrentDirectory( Dir ) )
|
|
||||||
AssertMsg( 0, "Can't set to new directory, JA2\\DevInfo for summary information." );
|
|
||||||
//Generate a simple readme file.
|
|
||||||
fp = fopen( "readme.txt", "w" );
|
|
||||||
Assert( fp );
|
|
||||||
fprintf( fp, "%s\n%s\n", "This information is used in conjunction with the editor.",
|
|
||||||
"This directory or it's contents shouldn't be included with final release." );
|
|
||||||
fclose( fp );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Snap: Restore the data directory once we are finished.
|
|
||||||
SetFileManCurrentDirectory( DataDir );
|
|
||||||
//Set current directory back to data directory!
|
|
||||||
//sprintf( Dir, "%s\\Data", ExecDir );
|
|
||||||
//SetFileManCurrentDirectory( Dir );
|
|
||||||
#else
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
vfs::COpenWriteFile wfile(L"DevInfo/readme.txt",true,true);
|
vfs::COpenWriteFile wfile(L"DevInfo/readme.txt",true,true);
|
||||||
@@ -2643,7 +2469,6 @@ void GenerateSummaryList()
|
|||||||
{
|
{
|
||||||
SGP_RETHROW(L"Could not create readme.txt", ex);
|
SGP_RETHROW(L"Could not create readme.txt", ex);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//dnl ch28 260909
|
//dnl ch28 260909
|
||||||
|
|||||||
+19
-9
@@ -79,8 +79,6 @@
|
|||||||
class OBJECTTYPE;
|
class OBJECTTYPE;
|
||||||
class SOLDIERTYPE;
|
class SOLDIERTYPE;
|
||||||
|
|
||||||
extern CHAR8 *szMusicList[NUM_MUSIC];
|
|
||||||
|
|
||||||
BOOLEAN gfCorruptMap = FALSE;
|
BOOLEAN gfCorruptMap = FALSE;
|
||||||
BOOLEAN gfCorruptSchedules = FALSE;
|
BOOLEAN gfCorruptSchedules = FALSE;
|
||||||
BOOLEAN gfProfileDataLoaded = FALSE;
|
BOOLEAN gfProfileDataLoaded = FALSE;
|
||||||
@@ -169,6 +167,7 @@ LEVELNODE *gCursorNode = NULL;
|
|||||||
INT32 gsCursorGridNo;
|
INT32 gsCursorGridNo;
|
||||||
|
|
||||||
INT32 giMusicID = 0;
|
INT32 giMusicID = 0;
|
||||||
|
NewMusicList gMusicMode = MUSICLIST_MAIN_MENU;
|
||||||
|
|
||||||
void EraseWorldData( );
|
void EraseWorldData( );
|
||||||
|
|
||||||
@@ -1616,16 +1615,27 @@ void HandleKeyboardShortcuts( )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case F4:
|
case F4:
|
||||||
#ifdef NEWMUSIC
|
MusicPlay(gMusicMode, giMusicID);
|
||||||
MusicPlay( giMusicID, MUSIC_OLD_TYPE, FALSE );
|
ScreenMsg( FONT_YELLOW, MSG_INTERFACE, L"%S", MusicLists[gMusicMode][giMusicID] );
|
||||||
#else
|
|
||||||
MusicPlay( giMusicID );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ScreenMsg( FONT_YELLOW, MSG_DEBUG, L"%S", szMusicList[giMusicID] );
|
// Select next track
|
||||||
giMusicID++;
|
giMusicID++;
|
||||||
if( giMusicID >= NUM_MUSIC )
|
if (giMusicID >= MusicLists[gMusicMode].size())
|
||||||
|
{
|
||||||
giMusicID = 0;
|
giMusicID = 0;
|
||||||
|
for (size_t i = 0; i < MAX_MUSIC; i++)
|
||||||
|
{
|
||||||
|
if (gMusicMode == i)
|
||||||
|
{
|
||||||
|
gMusicMode = static_cast<NewMusicList>(i + 1);
|
||||||
|
if (gMusicMode == MAX_MUSIC)
|
||||||
|
{
|
||||||
|
gMusicMode = MUSICLIST_MAIN_MENU;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case F5:
|
case F5:
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#ifndef _JA2_DEMO_ADS_H
|
|
||||||
#define _JA2_DEMO_ADS_H
|
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#ifndef _JA2PROTOTYPES_H
|
|
||||||
#define _JA2PROTOTYPES_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This header does not define any structures. It simply provides a way for all code that only needs a pointer
|
|
||||||
* reference to structures, to have it without getting locked into mutual includes and other
|
|
||||||
* hard-to-trace-and-fix behavior. More class and struct defs can be added as necessary.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class SOLDIERTYPE;
|
|
||||||
struct AnimationSurfaceType;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
set(Ja2Src
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/aniviewscreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Credits.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Fade Screen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/FeaturesScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/GameInitOptionsScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/gameloop.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/gamescreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/GameSettings.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/GameVersion.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/HelpScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Init.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Intro.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/jascreens.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Language Defines.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Loading Screen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPChatScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPConnectScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPHostScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPJoinScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPScoreScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPXmlTeams.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Options Screen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/SCREENS.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Sys Globals.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.cpp"
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/Res/ja2.rc
|
||||||
|
PARENT_SCOPE)
|
||||||
|
|
||||||
|
set(Ja2_Libraries
|
||||||
|
"${CMAKE_SOURCE_DIR}/libexpatMT.lib"
|
||||||
|
"Dbghelp.lib"
|
||||||
|
Lua
|
||||||
|
"${CMAKE_SOURCE_DIR}/lua51.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
|
||||||
|
"Winmm.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
|
||||||
|
"${CMAKE_SOURCE_DIR}/binkw32.lib"
|
||||||
|
bfVFS
|
||||||
|
"ws2_32.lib"
|
||||||
|
Multiplayer
|
||||||
|
PARENT_SCOPE)
|
||||||
@@ -992,9 +992,17 @@ void LoadGameExternalOptions()
|
|||||||
//Madd: set number of pItem files to be used
|
//Madd: set number of pItem files to be used
|
||||||
gGameExternalOptions.ubNumPItems = iniReader.ReadInteger("Data File Settings","NUM_P_ITEMS", 3, 3, MAX_PITEMS);
|
gGameExternalOptions.ubNumPItems = iniReader.ReadInteger("Data File Settings","NUM_P_ITEMS", 3, 3, MAX_PITEMS);
|
||||||
|
|
||||||
|
//################# Backgrounds #################
|
||||||
|
|
||||||
// Flugente: backgrounds
|
// Flugente: backgrounds
|
||||||
gGameExternalOptions.fBackGround = iniReader.ReadBoolean("Data File Settings", "BACKGROUNDS", TRUE );
|
gGameExternalOptions.fBackGround = iniReader.ReadBoolean("Backgrounds", "ENABLE_BACKGROUNDS", TRUE );
|
||||||
|
|
||||||
|
// Kitty: show additional IMP backgrounds and determine which IMP backgrounds are available at selection based on choices for skills, chararcter traits and disabilities
|
||||||
|
gGameExternalOptions.fAltIMPCreation = iniReader.ReadBoolean("Backgrounds", "ALTERNATIVE_IMP_CREATION", FALSE);
|
||||||
|
|
||||||
|
// Kitty: only show additional IMP backgrounds enabled by AlternativeImpCreation (same rules which are shown as with AlternativeImpCreation)
|
||||||
|
gGameExternalOptions.fReducedIMPCreation = iniReader.ReadBoolean("Backgrounds", "REDUCED_IMP_CREATION", FALSE);
|
||||||
|
|
||||||
//################# Merc Recruitment Settings #################
|
//################# Merc Recruitment Settings #################
|
||||||
|
|
||||||
// silversurfer: read early recruitment options 1=immediately (control Omerta), 2=early (control 1, 2, 3 towns including Omerta)
|
// silversurfer: read early recruitment options 1=immediately (control Omerta), 2=early (control 1, 2, 3 towns including Omerta)
|
||||||
@@ -1185,6 +1193,12 @@ void LoadGameExternalOptions()
|
|||||||
// Flugente: additional decals on objects (cracked walls, blood spatters etc.)
|
// Flugente: additional decals on objects (cracked walls, blood spatters etc.)
|
||||||
gGameExternalOptions.fAdditionalDecals = iniReader.ReadBoolean( "Graphics Settings", "ADDITIONAL_DECALS", FALSE );
|
gGameExternalOptions.fAdditionalDecals = iniReader.ReadBoolean( "Graphics Settings", "ADDITIONAL_DECALS", FALSE );
|
||||||
|
|
||||||
|
// anv: map color variants
|
||||||
|
gGameExternalOptions.ubRadarMapModeDay = iniReader.ReadInteger("Graphics Settings", "RADAR_MAP_MODE_DAY", 0, 0, 2);
|
||||||
|
gGameExternalOptions.ubRadarMapModeNight = iniReader.ReadInteger("Graphics Settings", "RADAR_MAP_MODE_NIGHT", 3, 0, 3);
|
||||||
|
gGameExternalOptions.ubOverheadMapModeDay = iniReader.ReadInteger("Graphics Settings", "OVERHEAD_MAP_MODE_DAY", 0, 0, 2);
|
||||||
|
gGameExternalOptions.ubOverheadMapModeNight = iniReader.ReadInteger("Graphics Settings", "OVERHEAD_MAP_MODE_NIGHT", 0, 0, 3);
|
||||||
|
|
||||||
//################# Sound Settings #################
|
//################# Sound Settings #################
|
||||||
|
|
||||||
gGameExternalOptions.guiWeaponSoundEffectsVolume = iniReader.ReadInteger("Sound Settings","WEAPON_SOUND_EFFECTS_VOLUME", 0, 0, 1000 /*1000 = 10x?*/);
|
gGameExternalOptions.guiWeaponSoundEffectsVolume = iniReader.ReadInteger("Sound Settings","WEAPON_SOUND_EFFECTS_VOLUME", 0, 0, 1000 /*1000 = 10x?*/);
|
||||||
@@ -337,6 +337,7 @@ BOOLEAN UsingBackGroundSystem();
|
|||||||
BOOLEAN UsingImprovedInterruptSystem();
|
BOOLEAN UsingImprovedInterruptSystem();
|
||||||
BOOLEAN UsingInventoryCostsAPSystem();
|
BOOLEAN UsingInventoryCostsAPSystem();
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN IsNIVModeValid(bool checkRes = true);
|
BOOLEAN IsNIVModeValid(bool checkRes = true);
|
||||||
|
|
||||||
// Snap: Options read from an INI file in the default of custom Data directory
|
// Snap: Options read from an INI file in the default of custom Data directory
|
||||||
@@ -952,6 +953,12 @@ typedef struct
|
|||||||
|
|
||||||
BOOLEAN fAdditionalDecals; // Flugente: show additional decals on objects (cracked walls, blood spatters etc.)
|
BOOLEAN fAdditionalDecals; // Flugente: show additional decals on objects (cracked walls, blood spatters etc.)
|
||||||
|
|
||||||
|
// anv: map color variants
|
||||||
|
UINT8 ubRadarMapModeDay;
|
||||||
|
UINT8 ubRadarMapModeNight;
|
||||||
|
UINT8 ubOverheadMapModeDay;
|
||||||
|
UINT8 ubOverheadMapModeNight;
|
||||||
|
|
||||||
//enable ext mouse key
|
//enable ext mouse key
|
||||||
BOOLEAN bAltAimEnabled;
|
BOOLEAN bAltAimEnabled;
|
||||||
BOOLEAN bAimedBurstEnabled;
|
BOOLEAN bAimedBurstEnabled;
|
||||||
@@ -1552,6 +1559,12 @@ typedef struct
|
|||||||
|
|
||||||
// Flugente: backgrounds
|
// Flugente: backgrounds
|
||||||
BOOLEAN fBackGround;
|
BOOLEAN fBackGround;
|
||||||
|
|
||||||
|
// Kitty: Alternative IMP Creation (choices in skills/char-traits/disabilities determine available backgrounds, plus additional available backgrounds)
|
||||||
|
BOOLEAN fAltIMPCreation;
|
||||||
|
|
||||||
|
// Kitty: Reduced IMP Backgrounds (same as fAltIMPCreation, but for this only the additional backgrounds)
|
||||||
|
BOOLEAN fReducedIMPCreation;
|
||||||
|
|
||||||
// Sandro: Alternative weapon holding (rifles fired from hip / pistols fired one-handed)
|
// Sandro: Alternative weapon holding (rifles fired from hip / pistols fired one-handed)
|
||||||
UINT8 ubAllowAlternativeWeaponHolding;
|
UINT8 ubAllowAlternativeWeaponHolding;
|
||||||
@@ -1442,7 +1442,6 @@ UINT32 InitializeJA2(void)
|
|||||||
HandleLaserLockResult( PrepareLaserLockSystem() );
|
HandleLaserLockResult( PrepareLaserLockSystem() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HandleJA2CDCheck( );
|
|
||||||
|
|
||||||
gfWorldLoaded = FALSE;
|
gfWorldLoaded = FALSE;
|
||||||
|
|
||||||
@@ -1472,9 +1471,6 @@ UINT32 InitializeJA2(void)
|
|||||||
//gsRenderCenterX = 805;
|
//gsRenderCenterX = 805;
|
||||||
//gsRenderCenterY = 805;
|
//gsRenderCenterY = 805;
|
||||||
|
|
||||||
// Init data
|
|
||||||
InitializeSystemVideoObjects( );
|
|
||||||
|
|
||||||
// Init animation system
|
// Init animation system
|
||||||
if ( !InitAnimationSystem( ) )
|
if ( !InitAnimationSystem( ) )
|
||||||
{
|
{
|
||||||
@@ -1514,12 +1510,6 @@ UINT32 InitializeJA2(void)
|
|||||||
// INit intensity tables
|
// INit intensity tables
|
||||||
BuildIntensityTable( );
|
BuildIntensityTable( );
|
||||||
|
|
||||||
// Init Event Manager
|
|
||||||
if ( !InitializeEventManager( ) )
|
|
||||||
{
|
|
||||||
return( ERROR_SCREEN );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initailize World
|
// Initailize World
|
||||||
if ( !InitializeWorld( ) )
|
if ( !InitializeWorld( ) )
|
||||||
{
|
{
|
||||||
@@ -1698,8 +1688,6 @@ void ShutdownJA2(void)
|
|||||||
|
|
||||||
ShutdownJA2Sound( );
|
ShutdownJA2Sound( );
|
||||||
|
|
||||||
ShutdownEventManager( );
|
|
||||||
|
|
||||||
ShutdownBaseDirtyRectQueue( );
|
ShutdownBaseDirtyRectQueue( );
|
||||||
|
|
||||||
// Unload any text box images!
|
// Unload any text box images!
|
||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "Animation Cache.h"
|
#include "Animation Cache.h"
|
||||||
#include "Animation Data.h"
|
#include "Animation Data.h"
|
||||||
#include "Animation Control.h"
|
#include "Animation Control.h"
|
||||||
#include "container.h"
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "pathai.h"
|
#include "pathai.h"
|
||||||
#include "Random.h"
|
#include "Random.h"
|
||||||
@@ -248,7 +248,6 @@ BOOLEAN InitMainMenu( )
|
|||||||
{
|
{
|
||||||
is_networked = FALSE;
|
is_networked = FALSE;
|
||||||
|
|
||||||
#ifdef USE_VFS
|
|
||||||
// remove Multiplayer profile if it exists
|
// remove Multiplayer profile if it exists
|
||||||
vfs::CProfileStack *PS = getVFS()->getProfileStack();
|
vfs::CProfileStack *PS = getVFS()->getProfileStack();
|
||||||
vfs::CVirtualProfile *pProf = PS->getProfile("_MULTIPLAYER");
|
vfs::CVirtualProfile *pProf = PS->getProfile("_MULTIPLAYER");
|
||||||
@@ -256,7 +255,6 @@ BOOLEAN InitMainMenu( )
|
|||||||
{
|
{
|
||||||
SGP_THROW_IFFALSE(PS->popProfile(), "Leaving Multiplayer mode : Could not remove \"_MULTIPLAYER\" profile");
|
SGP_THROW_IFFALSE(PS->popProfile(), "Leaving Multiplayer mode : Could not remove \"_MULTIPLAYER\" profile");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Snap: UN-Init MP save game directory
|
// Snap: UN-Init MP save game directory
|
||||||
if ( !InitSaveDir() )
|
if ( !InitSaveDir() )
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -3553,33 +3553,6 @@ BOOLEAN Inventory::Save( HWFILE hFile, bool fSavingMap )
|
|||||||
// The save directory now resides in the data directory (default or custom)
|
// The save directory now resides in the data directory (default or custom)
|
||||||
BOOLEAN InitSaveDir()
|
BOOLEAN InitSaveDir()
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
// Look for a custom data dir first
|
|
||||||
std::string dataDir = gCustomDataCat.GetRootDir();
|
|
||||||
if( dataDir.empty() || FileGetAttributes( (STR) dataDir.c_str() ) == 0xFFFFFFFF ) {
|
|
||||||
dataDir = gDefaultDataCat.GetRootDir();
|
|
||||||
}
|
|
||||||
|
|
||||||
// The locale-specific save dir location is of the form L"..\\SavedGames"
|
|
||||||
// This has not changed; instead, we strip the ".." at the beginning
|
|
||||||
if(is_networked)
|
|
||||||
{
|
|
||||||
sprintf( gSaveDir, "%s%S", dataDir.c_str(), pMessageStrings[ MSG_MPSAVEDIRECTORY ] + 2 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
sprintf( gSaveDir, "%s%S", dataDir.c_str(), pMessageStrings[ MSG_SAVEDIRECTORY ] + 2 );
|
|
||||||
|
|
||||||
// This was moved here from SaveGame
|
|
||||||
//Check to see if the save directory exists
|
|
||||||
if( FileGetAttributes( (STR) gSaveDir ) == 0xFFFFFFFF )
|
|
||||||
{
|
|
||||||
//ok the direcotry doesnt exist, create it
|
|
||||||
if( !MakeFileManDirectory( (CHAR8 *)gSaveDir ) )
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if(is_networked)
|
if(is_networked)
|
||||||
{
|
{
|
||||||
sprintf( gSaveDir, "%s", vfs::String::as_utf8(pMessageStrings[ MSG_MPSAVEDIRECTORY ] + 3).c_str() );
|
sprintf( gSaveDir, "%s", vfs::String::as_utf8(pMessageStrings[ MSG_MPSAVEDIRECTORY ] + 3).c_str() );
|
||||||
@@ -3588,7 +3561,6 @@ BOOLEAN InitSaveDir()
|
|||||||
{
|
{
|
||||||
sprintf( gSaveDir, "%s", vfs::String::as_utf8(pMessageStrings[ MSG_SAVEDIRECTORY ] + 3).c_str() );
|
sprintf( gSaveDir, "%s", vfs::String::as_utf8(pMessageStrings[ MSG_SAVEDIRECTORY ] + 3).c_str() );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9711,21 +9683,6 @@ BOOLEAN SaveMeanwhileDefsFromSaveGameFile( HWFILE hFile )
|
|||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN DoesUserHaveEnoughHardDriveSpace()
|
|
||||||
{
|
|
||||||
UINT32 uiBytesFree=0;
|
|
||||||
|
|
||||||
uiBytesFree = GetFreeSpaceOnHardDriveWhereGameIsRunningFrom( );
|
|
||||||
|
|
||||||
//check to see if there is enough hard drive space
|
|
||||||
if( uiBytesFree < REQUIRED_FREE_SPACE )
|
|
||||||
{
|
|
||||||
return( FALSE );
|
|
||||||
}
|
|
||||||
|
|
||||||
return( TRUE );
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
|
|
||||||
void InitShutDownMapTempFileTest( BOOLEAN fInit, STR pNameOfFile, UINT8 ubSaveGameID )
|
void InitShutDownMapTempFileTest( BOOLEAN fInit, STR pNameOfFile, UINT8 ubSaveGameID )
|
||||||
@@ -9989,69 +9946,6 @@ void UpdateMercMercContractInfo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INT8 GetNumberForAutoSave( BOOLEAN fLatestAutoSave )
|
|
||||||
{
|
|
||||||
CHAR zFileName1[MAX_PATH];
|
|
||||||
CHAR zFileName2[MAX_PATH];
|
|
||||||
HWFILE hFile;
|
|
||||||
BOOLEAN fFile1Exist, fFile2Exist;
|
|
||||||
SGP_FILETIME CreationTime1, LastAccessedTime1, LastWriteTime1;
|
|
||||||
SGP_FILETIME CreationTime2, LastAccessedTime2, LastWriteTime2;
|
|
||||||
|
|
||||||
fFile1Exist = FALSE;
|
|
||||||
fFile2Exist = FALSE;
|
|
||||||
|
|
||||||
|
|
||||||
//The name of the file
|
|
||||||
sprintf( zFileName1, "%s\\Auto%02d.%S", gSaveDir, 0, pMessageStrings[ MSG_SAVEEXTENSION ] );
|
|
||||||
sprintf( zFileName2, "%s\\Auto%02d.%S", gSaveDir, 1, pMessageStrings[ MSG_SAVEEXTENSION ] );
|
|
||||||
|
|
||||||
if( FileExists( zFileName1 ) )
|
|
||||||
{
|
|
||||||
hFile = FileOpen( zFileName1, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
|
|
||||||
GetFileManFileTime( hFile, &CreationTime1, &LastAccessedTime1, &LastWriteTime1 );
|
|
||||||
|
|
||||||
FileClose( hFile );
|
|
||||||
|
|
||||||
fFile1Exist = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( FileExists( zFileName2 ) )
|
|
||||||
{
|
|
||||||
hFile = FileOpen( zFileName2, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
|
|
||||||
GetFileManFileTime( hFile, &CreationTime2, &LastAccessedTime2, &LastWriteTime2 );
|
|
||||||
|
|
||||||
FileClose( hFile );
|
|
||||||
|
|
||||||
fFile2Exist = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !fFile1Exist && !fFile2Exist )
|
|
||||||
return( -1 );
|
|
||||||
else if( fFile1Exist && !fFile2Exist )
|
|
||||||
{
|
|
||||||
if( fLatestAutoSave )
|
|
||||||
return( 0 );
|
|
||||||
else
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
else if( !fFile1Exist && fFile2Exist )
|
|
||||||
{
|
|
||||||
if( fLatestAutoSave )
|
|
||||||
return( 1 );
|
|
||||||
else
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( CompareSGPFileTimes( &LastWriteTime1, &LastWriteTime2 ) > 0 )
|
|
||||||
return( 0 );
|
|
||||||
else
|
|
||||||
return( 1 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleOldBobbyRMailOrders()
|
void HandleOldBobbyRMailOrders()
|
||||||
{
|
{
|
||||||
@@ -93,13 +93,10 @@ BOOLEAN CopySavedSoldierInfoToNewSoldier( SOLDIERTYPE *pDestSourceInfo, SOLDIERT
|
|||||||
BOOLEAN SaveFilesToSavedGame( STR pSrcFileName, HWFILE hFile );
|
BOOLEAN SaveFilesToSavedGame( STR pSrcFileName, HWFILE hFile );
|
||||||
BOOLEAN LoadFilesFromSavedGame( STR pSrcFileName, HWFILE hFile );
|
BOOLEAN LoadFilesFromSavedGame( STR pSrcFileName, HWFILE hFile );
|
||||||
|
|
||||||
BOOLEAN DoesUserHaveEnoughHardDriveSpace();
|
|
||||||
|
|
||||||
void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ );
|
void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ );
|
||||||
|
|
||||||
|
|
||||||
extern UINT32 guiLastSaveGameNum; // The end turn auto save number (0 = Auto00.sav, 1 = Auto01.sav)
|
extern UINT32 guiLastSaveGameNum; // The end turn auto save number (0 = Auto00.sav, 1 = Auto01.sav)
|
||||||
INT8 GetNumberForAutoSave( BOOLEAN fLatestAutoSave );
|
|
||||||
|
|
||||||
/*CHRISL: This function is designed to allow reading the save game file one field at a time. We currently save structures by saving a block of memory,
|
/*CHRISL: This function is designed to allow reading the save game file one field at a time. We currently save structures by saving a block of memory,
|
||||||
but variables are stored in memory so that they fit neatly into a WORD resulting in the program automatically adding some padding. This padding is saved
|
but variables are stored in memory so that they fit neatly into a WORD resulting in the program automatically adding some padding. This padding is saved
|
||||||
@@ -1350,7 +1350,6 @@ BOOLEAN InitSaveGameArray()
|
|||||||
gbSaveGameArray[VAL_SLOT_START + cnt] = TRUE;
|
gbSaveGameArray[VAL_SLOT_START + cnt] = TRUE;
|
||||||
|
|
||||||
// anv: read last modified date property of save file
|
// anv: read last modified date property of save file
|
||||||
#ifdef USE_VFS
|
|
||||||
// get full path to save file
|
// get full path to save file
|
||||||
vfs::Path vfsPath;
|
vfs::Path vfsPath;
|
||||||
vfs::COpenReadFile rfile(zSaveGameName);
|
vfs::COpenReadFile rfile(zSaveGameName);
|
||||||
@@ -1369,7 +1368,6 @@ BOOLEAN InitSaveGameArray()
|
|||||||
// close
|
// close
|
||||||
CloseHandle( hFile );
|
CloseHandle( hFile );
|
||||||
rfile->close();
|
rfile->close();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "screenids.h"
|
#include "screenids.h"
|
||||||
#include "container.h"
|
|
||||||
#include "overhead.h"
|
#include "overhead.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
@@ -628,7 +628,14 @@ UINT32 MainGameScreenHandle(void)
|
|||||||
InternalLocateGridNo( gGameUBOptions.LOCATEGRIDNO, TRUE );
|
InternalLocateGridNo( gGameUBOptions.LOCATEGRIDNO, TRUE );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
if (gfFirstHeliRun)
|
||||||
|
{
|
||||||
InternalLocateGridNo( gGameExternalOptions.iInitialMercArrivalLocation, TRUE );
|
InternalLocateGridNo( gGameExternalOptions.iInitialMercArrivalLocation, TRUE );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InternalLocateGridNo(gMapInformation.sCenterGridNo, TRUE);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
// Flugente: we might have reloaded the game, so we are currently not dropping mercs out of a helicopter
|
// Flugente: we might have reloaded the game, so we are currently not dropping mercs out of a helicopter
|
||||||
gfIngagedInDrop = FALSE;
|
gfIngagedInDrop = FALSE;
|
||||||
@@ -396,44 +396,25 @@ UINT32 InitScreenHandle(void)
|
|||||||
|
|
||||||
// Handle queued .ini file error messages
|
// Handle queued .ini file error messages
|
||||||
int y = 40;
|
int y = 40;
|
||||||
#ifdef USE_VFS
|
|
||||||
sgp::Logger_ID ini_id = sgp::Logger::instance().createLogger();
|
sgp::Logger_ID ini_id = sgp::Logger::instance().createLogger();
|
||||||
sgp::Logger::instance().connectFile(ini_id, L"iniErrorReport.txt", false, sgp::Logger::FLUSH_ON_DELETE);
|
sgp::Logger::instance().connectFile(ini_id, L"iniErrorReport.txt", false, sgp::Logger::FLUSH_ON_DELETE);
|
||||||
sgp::Logger::LogInstance logger = sgp::Logger::instance().logger(ini_id);
|
sgp::Logger::LogInstance logger = sgp::Logger::instance().logger(ini_id);
|
||||||
#endif
|
|
||||||
while (! iniErrorMessages.empty()) {
|
while (! iniErrorMessages.empty()) {
|
||||||
#ifndef USE_VFS
|
|
||||||
FILE *file_pointer;
|
|
||||||
#endif
|
|
||||||
static BOOL iniErrorMessage_create_out_file = TRUE;
|
static BOOL iniErrorMessage_create_out_file = TRUE;
|
||||||
std::string iniErrorMessage = iniErrorMessages.top();
|
std::string iniErrorMessage = iniErrorMessages.top();
|
||||||
CHAR16 str[256];
|
CHAR16 str[256];
|
||||||
|
|
||||||
if (iniErrorMessage_create_out_file)
|
if (iniErrorMessage_create_out_file)
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
fopen_s( &file_pointer, "..\\iniErrorReport.txt", "w" );
|
|
||||||
#endif
|
|
||||||
y += 25;
|
y += 25;
|
||||||
swprintf( str, L"%S", "Warning: found the following ini errors. iniErrorReport.txt has been created." );
|
swprintf( str, L"%S", "Warning: found the following ini errors. iniErrorReport.txt has been created." );
|
||||||
DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED );
|
DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED );
|
||||||
iniErrorMessage_create_out_file = FALSE;
|
iniErrorMessage_create_out_file = FALSE;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifndef USE_VFS
|
|
||||||
fopen_s( &file_pointer, "..\\iniErrorReport.txt", "a+" );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
y += 25;
|
y += 25;
|
||||||
swprintf( str, L"%S", iniErrorMessage.c_str() );
|
swprintf( str, L"%S", iniErrorMessage.c_str() );
|
||||||
#ifndef USE_VFS
|
|
||||||
fprintf_s (file_pointer , "%S\n" , str );
|
|
||||||
fclose( file_pointer );
|
|
||||||
#else
|
|
||||||
logger << iniErrorMessage << sgp::endl;
|
logger << iniErrorMessage << sgp::endl;
|
||||||
#endif
|
|
||||||
DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED );
|
DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED );
|
||||||
|
|
||||||
iniErrorMessages.pop();
|
iniErrorMessages.pop();
|
||||||
+4
-17
@@ -5633,28 +5633,15 @@ void EnableWeaponKitSelectionButtons()
|
|||||||
{
|
{
|
||||||
if ( !(gMercProfiles[gbCurrentSoldier].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) || gGameExternalOptions.fGearKitsAlwaysAvailable )
|
if ( !(gMercProfiles[gbCurrentSoldier].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) || gGameExternalOptions.fGearKitsAlwaysAvailable )
|
||||||
{
|
{
|
||||||
bool bShow;
|
|
||||||
INT16 usItem;
|
|
||||||
for(int i=0; i<NUM_MERCSTARTINGGEAR_KITS; ++i)
|
for(int i=0; i<NUM_MERCSTARTINGGEAR_KITS; ++i)
|
||||||
{
|
{
|
||||||
bShow = false;
|
|
||||||
for(int j=INV_START_POS; j<NUM_INV_SLOTS; ++j)
|
for(int j=INV_START_POS; j<NUM_INV_SLOTS; ++j)
|
||||||
{
|
{
|
||||||
usItem = gMercProfileGear[gbCurrentSoldier][i].inv[j];
|
if(gMercProfileGear[gbCurrentSoldier][i].inv[j] != NONE)
|
||||||
if(usItem != NONE)
|
|
||||||
{
|
{
|
||||||
bShow = true;
|
ShowButton( giWeaponboxSelectionButton[i] );
|
||||||
//shadooow: if any of the item in kit is limited to specific system and this system isn't enabled then disable the whole kit from selection
|
break;
|
||||||
if (((Item[usItem].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[usItem].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease))
|
}
|
||||||
{
|
|
||||||
bShow = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bShow)
|
|
||||||
{
|
|
||||||
ShowButton(giWeaponboxSelectionButton[i]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include "QuestText.h" //quest: name
|
#include "QuestText.h" //quest: name
|
||||||
#include "laptop.h" //ui positions
|
#include "laptop.h" //ui positions
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include "Utils/Cursors.h"
|
#include "Cursors.h"
|
||||||
#include "sysutil.h" //extra Buffer for scaling image
|
#include "sysutil.h" //extra Buffer for scaling image
|
||||||
#include "vsurface.h" //fill extra buffer with black color
|
#include "vsurface.h" //fill extra buffer with black color
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#include "laptop.h"//UI dimensions, mouse regions
|
#include "laptop.h"//UI dimensions, mouse regions
|
||||||
#include "Utilities.h"//file names
|
#include "Utilities.h"//file names
|
||||||
#include "vobject.h"//video objects
|
#include "vobject.h"//video objects
|
||||||
#include "Utils/Cursors.h"
|
#include "Cursors.h"
|
||||||
#include "Text.h"//button text
|
#include "Text.h"//button text
|
||||||
#include "Button System.h"
|
#include "Button System.h"
|
||||||
#include "Encyclopedia_new.h"
|
#include "Encyclopedia_new.h"
|
||||||
|
|||||||
+226
-45
@@ -17,6 +17,7 @@
|
|||||||
#include "IMP Compile Character.h"
|
#include "IMP Compile Character.h"
|
||||||
#include "IMP Disability Trait.h"
|
#include "IMP Disability Trait.h"
|
||||||
#include "IMP Character Trait.h"
|
#include "IMP Character Trait.h"
|
||||||
|
#include "IMP Minor Trait.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
|
|
||||||
@@ -602,81 +603,187 @@ void ResetDisplaySkills()
|
|||||||
|
|
||||||
extern INT32 SkillsList[ ATTITUDE_LIST_SIZE ];
|
extern INT32 SkillsList[ ATTITUDE_LIST_SIZE ];
|
||||||
|
|
||||||
BOOLEAN IsBackGroundAllowed( UINT16 ubNumber )
|
extern BOOLEAN gfSkillTraitQuestions[20];
|
||||||
|
extern BOOLEAN gfSkillTraitQuestions2[20];
|
||||||
|
|
||||||
|
extern BOOLEAN gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS];
|
||||||
|
|
||||||
|
BOOLEAN IsBackGroundAllowed(UINT16 ubNumber)
|
||||||
{
|
{
|
||||||
if ( !ubNumber )
|
if (!ubNumber)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// some backgrounds are only allowed to specific genders. Set both to forbid a background from ever showing up in IMP creation (for merc-specific backgrounds)
|
// some backgrounds are only allowed to specific genders. Set both to forbid a background from ever showing up in IMP creation (for merc-specific backgrounds)
|
||||||
if ( fCharacterIsMale && zBackground[ ubNumber ].uiFlags & BACKGROUND_NO_MALE )
|
if (fCharacterIsMale && zBackground[ubNumber].uiFlags & BACKGROUND_NO_MALE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else if ( !fCharacterIsMale && zBackground[ ubNumber ].uiFlags & BACKGROUND_NO_FEMALE )
|
else if (!fCharacterIsMale && zBackground[ubNumber].uiFlags & BACKGROUND_NO_FEMALE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ( SkillsList[0] == HEAVY_WEAPONS_NT || SkillsList[1] == HEAVY_WEAPONS_NT || SkillsList[2] == HEAVY_WEAPONS_NT )
|
// added new ini-options and accompanying background-tag
|
||||||
|
// choices in skills/character-traits/disabilities determine available backgrounds if true in ja2options.ini
|
||||||
|
// new tag <alt_impcreation> has been added to backgrounds.xml
|
||||||
|
|
||||||
|
if (!gGameExternalOptions.fAltIMPCreation)
|
||||||
|
|
||||||
{
|
{
|
||||||
if ( zBackground[ ubNumber ].value[BG_ARTILLERY] > 0 )
|
if (zBackground[ubNumber].uiFlags & BACKGROUND_ALT_IMP_CREATION) // don't show BG with tag <alt_impcreation> if Alt_Imp_Creation isn't true in ja2options.ini
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// show BG with tag <alt_impcreation>,
|
||||||
|
// but don't show BG whose tags would contradict with a main bonus/penalty gained by skill/char-trait/disability
|
||||||
|
|
||||||
|
if (gGameExternalOptions.fAltIMPCreation)
|
||||||
|
|
||||||
|
// define which tags are considered contradicting for major traits, minor traits, disablities and character traits
|
||||||
|
|
||||||
|
// major traits (single-trait and dual-trait)
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_HEAVY_WEAPONS] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_HEAVY_WEAPONS])
|
||||||
|
{
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_HEAVY_WEAPONS] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_HEAVY_WEAPONS])
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_ARTILLERY] > 0) //dual trait (expert)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_ARTILLERY] > 10) //single trait
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_PROF_SNIPER] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_PROF_SNIPER])
|
||||||
|
{
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_PROF_SNIPER] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_PROF_SNIPER])
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_PERC_CTH_MAX] < 0 || zBackground[ubNumber].value[BG_MARKSMANSHIP] < 0 )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_PERC_CTH_MAX] < 0 )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_MARTIAL_ARTS] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_MARTIAL_ARTS])
|
||||||
|
{
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_MARTIAL_ARTS] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_MARTIAL_ARTS])
|
||||||
|
{
|
||||||
|
|
||||||
|
if (zBackground[ubNumber].value[BG_RESI_PHYSICAL] < 0 )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_RESI_PHYSICAL] < 0 )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_TECHNICIAN] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_TECHNICIAN])
|
||||||
|
{
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_TECHNICIAN] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_TECHNICIAN])
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_MECHANICAL] < 0)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_MECHANICAL] < 0)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_DOCTOR] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_DOCTOR])
|
||||||
|
{
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_DOCTOR] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_DOCTOR])
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_PERC_BANDAGING] < 0 || zBackground[ubNumber].value[BG_MEDICAL] < 0 )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_PERC_BANDAGING] < 0)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_SQUADLEADER] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_SQUADLEADER])
|
||||||
|
{
|
||||||
|
|
||||||
|
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_SQUADLEADER] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_SQUADLEADER])
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_RESI_SUPPRESSION] < 0 || zBackground[ubNumber].value[BG_RESI_FEAR] < 0 )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_RESI_SUPPRESSION] < 0)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor Traits (single trait only)
|
||||||
|
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_MELEE])
|
||||||
|
{
|
||||||
|
if (zBackground[ubNumber].value[BG_PERC_CTH_BLADE] < 0 || zBackground[ubNumber].value[BG_PERC_DAMAGE_MELEE] < 0 )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SkillsList[0] == SNIPER_NT || SkillsList[1] == SNIPER_NT || SkillsList[2] == SNIPER_NT )
|
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_STEALTHY])
|
||||||
{
|
{
|
||||||
if ( zBackground[ ubNumber ].value[BG_PERC_CTH_MAX] < 0 )
|
if (zBackground[ubNumber].value[BG_PERC_STEALTH] < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SkillsList[0] == SURVIVAL_NT || SkillsList[1] == SURVIVAL_NT || SkillsList[2] == SURVIVAL_NT )
|
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_DEMOLITIONS])
|
||||||
{
|
{
|
||||||
if ( zBackground[ ubNumber ].value[BG_PERC_CAMO] < 0 )
|
if (zBackground[ubNumber].value[BG_BONUS_BREACHINGCHARGE] < 0 || zBackground[ubNumber].value[BG_EXPLOSIVE_ASSIGN] < 0 )
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( SkillsList[0] == MARTIAL_ARTS_NT || SkillsList[1] == MARTIAL_ARTS_NT || SkillsList[2] == MARTIAL_ARTS_NT )
|
|
||||||
{
|
|
||||||
if ( zBackground[ ubNumber ].value[BG_PERC_DAMAGE_MELEE] < 0 )
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SkillsList[0] == TECHNICIAN_NT || SkillsList[1] == TECHNICIAN_NT || SkillsList[2] == TECHNICIAN_NT )
|
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_SURVIVAL])
|
||||||
{
|
{
|
||||||
if ( zBackground[ ubNumber ].value[BG_MECHANICAL] < 0 )
|
if (zBackground[ubNumber].value[BG_TRAVEL_FOOT] < 0 || zBackground[ubNumber].value[BG_TRAVEL_CAR] <0 || zBackground[ubNumber].value[BG_TRAVEL_AIR] <0 ||
|
||||||
|
zBackground[ubNumber].value[BG_RESI_DISEASE] < 0 || zBackground[ubNumber].value[BG_SNAKEDEFENSE] < 0 )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SkillsList[0] == DOCTOR_NT || SkillsList[1] == DOCTOR_NT || SkillsList[2] == DOCTOR_NT )
|
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_BODYBUILDING])
|
||||||
{
|
{
|
||||||
if ( zBackground[ ubNumber ].value[BG_MEDICAL] < 0 )
|
if (zBackground[ubNumber].value[BG_PERC_CARRYSTRENGTH] < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SkillsList[0] == MELEE_NT || SkillsList[1] == MELEE_NT || SkillsList[2] == MELEE_NT )
|
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_AMBIDEXTROUS])
|
||||||
{
|
{
|
||||||
if ( zBackground[ ubNumber ].value[BG_PERC_CTH_BLADE] < 0 )
|
if (zBackground[ubNumber].value[BG_INVENTORY] > 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SkillsList[0] == STEALTHY_NT || SkillsList[1] == STEALTHY_NT || SkillsList[2] == STEALTHY_NT )
|
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_NIGHT_OPS])
|
||||||
{
|
{
|
||||||
if ( zBackground[ ubNumber ].value[BG_PERC_STEALTH] < 0 )
|
if (zBackground[ubNumber].value[BG_PERC_SLEEP] > 0 || zBackground[ubNumber].value[BG_PERC_HEARING_NIGHT] < 0 )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SkillsList[0] == ATHLETICS_NT || SkillsList[1] == ATHLETICS_NT || SkillsList[2] == ATHLETICS_NT )
|
// Disabiliies
|
||||||
{
|
switch (iChosenDisabilityTrait())
|
||||||
if ( zBackground[ ubNumber ].value[BG_PERC_SPEED_RUNNING] < 0 )
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( SkillsList[0] == DEMOLITIONS_NT || SkillsList[1] == DEMOLITIONS_NT || SkillsList[2] == DEMOLITIONS_NT )
|
|
||||||
{
|
|
||||||
if ( zBackground[ ubNumber ].value[BG_EXPLOSIVE_ASSIGN] < 0 )
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ( iChosenDisabilityTrait() )
|
|
||||||
{
|
{
|
||||||
case HEAT_INTOLERANT:
|
case HEAT_INTOLERANT:
|
||||||
if ( zBackground[ ubNumber ].value[BG_DESERT] > 0 )
|
if (zBackground[ubNumber].value[BG_DESERT] > 0 || zBackground[ubNumber].value[BG_TROPICAL] > 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
case NERVOUS:
|
case NERVOUS:
|
||||||
@@ -686,7 +793,7 @@ BOOLEAN IsBackGroundAllowed( UINT16 ubNumber )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
case NONSWIMMER:
|
case NONSWIMMER:
|
||||||
if ( zBackground[ ubNumber ].value[BG_RIVER] > 0 || zBackground[ ubNumber ].value[BG_COASTAL] > 0 || zBackground[ ubNumber ].value[BG_SWIMMING] > 0 )
|
if ( zBackground[ ubNumber ].value[BG_RIVER] > 0 || zBackground[ ubNumber ].value[BG_COASTAL] > 0 )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
case FEAR_OF_INSECTS:
|
case FEAR_OF_INSECTS:
|
||||||
@@ -694,35 +801,109 @@ BOOLEAN IsBackGroundAllowed( UINT16 ubNumber )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
case FORGETFUL:
|
case FORGETFUL:
|
||||||
if ( zBackground[ ubNumber ].value[BG_LEADERSHIP] > 0 )
|
if (zBackground[ubNumber].value[BG_INVENTORY] < 0 || zBackground[ubNumber].value[BG_ASSAULT] < 0 )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
case PSYCHO:
|
case PSYCHO:
|
||||||
if ( zBackground[ ubNumber ].value[BG_LEADERSHIP] > 0 )
|
if (zBackground[ubNumber].value[BG_LEADERSHIP] > 5)
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case DEAF:
|
||||||
|
if (zBackground[ ubNumber ].value[BG_PERC_HEARING_NIGHT] > 0 || zBackground[ ubNumber ].value[BG_PERC_HEARING_DAY] > 0)
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case SHORTSIGHTED:
|
||||||
|
if (zBackground[ ubNumber ].value[BG_PERC_CTH_MAX] > 0 || zBackground[ubNumber].value[BG_PERC_SPOTTER] > 0 )
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case HEMOPHILIAC:
|
||||||
|
if (zBackground[ubNumber].value[BG_RESI_DISEASE] > 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
case AFRAID_OF_HEIGHTS:
|
case AFRAID_OF_HEIGHTS:
|
||||||
if ( zBackground[ubNumber].value[BG_HEIGHT] > 0 )
|
if ( zBackground[ ubNumber ].value[BG_HEIGHT] > 0 || zBackground[ubNumber].value[BG_AIRDROP] > 0 )
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case SELF_HARM:
|
||||||
|
if (zBackground[ubNumber].value[BG_RESI_DISEASE] > 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ( iChosenCharacterTrait() )
|
// Character Traits
|
||||||
|
switch (iChosenCharacterTrait())
|
||||||
{
|
{
|
||||||
case CHAR_TRAIT_SOCIABLE:
|
case CHAR_TRAIT_SOCIABLE:
|
||||||
if ( zBackground[ ubNumber ].uiFlags & BACKGROUND_XENOPHOBIC )
|
if (zBackground[ubNumber].uiFlags & BACKGROUND_XENOPHOBIC || zBackground[ubNumber].value[BG_PERC_SPOTTER] < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
case CHAR_TRAIT_LONER:
|
case CHAR_TRAIT_LONER:
|
||||||
if ( zBackground[ ubNumber ].value[BG_LEADERSHIP] > 0 )
|
if (zBackground[ubNumber].value[BG_LEADERSHIP] > 0 || zBackground[ubNumber].value[BG_PERC_SPOTTER] > 0)
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_OPTIMIST:
|
||||||
|
if (zBackground[ubNumber].uiFlags & BACKGROUND_TRAPLEVEL)
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_ASSERTIVE:
|
||||||
|
if (zBackground[ubNumber].value[BG_PERC_INTERROGATION] < 0 || zBackground[ubNumber].value[BG_PERC_APPROACH_THREATEN] < 0)
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_INTELLECTUAL:
|
||||||
|
if (zBackground[ubNumber].value[BG_ADMINISTRATION_ASSIGNMENT] < 0)
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_PRIMITIVE:
|
||||||
|
if (zBackground[ubNumber].value[BG_ADMINISTRATION_ASSIGNMENT] > 0)
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_AGGRESSIVE:
|
||||||
|
if (zBackground[ubNumber].uiFlags & BACKGROUND_TRAPLEVEL || zBackground[ubNumber].value[BG_PERC_DISARM] > 0 )
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_PHLEGMATIC:
|
||||||
|
if (zBackground[ubNumber].value[BG_ASSAULT] > 0 )
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_DAUNTLESS:
|
||||||
|
if (zBackground[ubNumber].value[BG_CROUCHEDDEFENSE] < 0 )
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_PACIFIST:
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_MALICIOUS:
|
||||||
|
if (zBackground[ubNumber].value[BG_PERC_APPROACH_FRIENDLY] > 0)
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_SHOWOFF:
|
||||||
|
break;
|
||||||
|
case CHAR_TRAIT_COWARD:
|
||||||
|
if (zBackground[ubNumber].value[BG_PERC_CAPITULATION] > 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// show exclusivly the BG's with tag <alt_impcreation> if Reduced_Imp_Creation is true in ja2options.ini
|
||||||
|
// requires Alt_Imp_Creation to be true in ja2options.ini (otherwise BG's with tag <alt_impcreation> won't be shown)
|
||||||
|
|
||||||
|
if (gGameExternalOptions.fReducedIMPCreation)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
if (zBackground[ubNumber].uiFlags & BACKGROUND_ALT_IMP_CREATION)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1336,16 +1336,6 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId )
|
|||||||
|
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: Nickname.dat"));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: Nickname.dat"));
|
||||||
|
|
||||||
#ifndef USE_VFS
|
|
||||||
char zFileName[13];
|
|
||||||
char temp;
|
|
||||||
|
|
||||||
for(int i=0;i < 9;i++) // Madd: I couldn't get strcpy or anything to work here... weird... if s/o wants to fix it, go ahead
|
|
||||||
{
|
|
||||||
temp = (char) gMercProfiles[iProfileId].zNickname[i];
|
|
||||||
zFileName[i] = temp;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
char zFileName[32];
|
char zFileName[32];
|
||||||
if(vfs::Settings::getUseUnicode())
|
if(vfs::Settings::getUseUnicode())
|
||||||
{
|
{
|
||||||
@@ -1355,7 +1345,6 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId )
|
|||||||
{
|
{
|
||||||
vfs::String::narrow(gMercProfiles[iProfileId].zNickname, 10, zFileName, 32);
|
vfs::String::narrow(gMercProfiles[iProfileId].zNickname, 10, zFileName, 32);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Changed by ADB, rev 1513
|
// Changed by ADB, rev 1513
|
||||||
//strcat(zFileName,IMP_FILENAME_SUFFIX);
|
//strcat(zFileName,IMP_FILENAME_SUFFIX);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ void RenderIMPDisabilityTrait( void );
|
|||||||
void ExitIMPDisabilityTrait( void );
|
void ExitIMPDisabilityTrait( void );
|
||||||
void HandleIMPDisabilityTrait( void );
|
void HandleIMPDisabilityTrait( void );
|
||||||
|
|
||||||
INT8 iChosenDisabilityTrait();
|
INT8 iChosenDisabilityTrait();
|
||||||
INT8 iPlayersAttributePointsBonusForDisabilitySelected();
|
INT8 iPlayersAttributePointsBonusForDisabilitySelected();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ UINT8 gusNewMinorTraitRemap[IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS] =
|
|||||||
|
|
||||||
BOOLEAN gfIMT_Redraw=FALSE;
|
BOOLEAN gfIMT_Redraw=FALSE;
|
||||||
|
|
||||||
BOOLEAN gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS ];
|
BOOLEAN gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS ];
|
||||||
|
|
||||||
// these are the buttons for the questions
|
// these are the buttons for the questions
|
||||||
INT32 giIMPMinorTraitAnswerButton[ IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS ];
|
INT32 giIMPMinorTraitAnswerButton[ IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS ];
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ UINT8 gusOldMajorTraitRemap[IMP_SKILL_TRAITS__NUMBER_SKILLS] =
|
|||||||
// Global Variables
|
// Global Variables
|
||||||
//
|
//
|
||||||
//*******************************************************************
|
//*******************************************************************
|
||||||
BOOLEAN gfSkillTraitQuestions[ 20 ];
|
BOOLEAN gfSkillTraitQuestions[ 20 ];
|
||||||
BOOLEAN gfSkillTraitQuestions2[ 20 ];
|
BOOLEAN gfSkillTraitQuestions2[ 20 ];
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN gfIST_Redraw=FALSE;
|
BOOLEAN gfIST_Redraw=FALSE;
|
||||||
|
|||||||
@@ -670,13 +670,6 @@ void AddCustomEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender,
|
|||||||
// add message to list
|
// add message to list
|
||||||
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_E_NONE );
|
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_E_NONE );
|
||||||
|
|
||||||
// if we are in fact int he laptop, redraw icons, might be change in mail status
|
|
||||||
|
|
||||||
if( fCurrentlyInLaptop )
|
|
||||||
{
|
|
||||||
// redraw icons, might be new mail
|
|
||||||
DrawLapTopIcons();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--
|
//--
|
||||||
@@ -721,14 +714,6 @@ void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 u
|
|||||||
// add message to list
|
// add message to list
|
||||||
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, iFirstData, uiSecondData, -1 , -1, EmailType, EmailAIM );
|
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, iFirstData, uiSecondData, -1 , -1, EmailType, EmailAIM );
|
||||||
|
|
||||||
// if we are in fact int he laptop, redraw icons, might be change in mail status
|
|
||||||
|
|
||||||
if( fCurrentlyInLaptop == TRUE )
|
|
||||||
{
|
|
||||||
// redraw icons, might be new mail
|
|
||||||
DrawLapTopIcons();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -761,14 +746,6 @@ void AddEmailWithSpecialDataXML(INT32 iMessageOffset, INT32 iMessageLength, UINT
|
|||||||
// add message to list
|
// add message to list
|
||||||
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, iFirstData, uiSecondData, -1 , -1, EmailType, EmailAIM);
|
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, iFirstData, uiSecondData, -1 , -1, EmailType, EmailAIM);
|
||||||
|
|
||||||
// if we are in fact int he laptop, redraw icons, might be change in mail status
|
|
||||||
|
|
||||||
if( fCurrentlyInLaptop == TRUE )
|
|
||||||
{
|
|
||||||
// redraw icons, might be new mail
|
|
||||||
DrawLapTopIcons();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -792,13 +769,6 @@ void AddPreReadEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 u
|
|||||||
// add message to list
|
// add message to list
|
||||||
AddEmailMessage( iMessageOffset,iMessageLength, pSubject, iDate, ubSender, TRUE, 0, 0, -1, -1 , EmailType, TYPE_E_NONE );
|
AddEmailMessage( iMessageOffset,iMessageLength, pSubject, iDate, ubSender, TRUE, 0, 0, -1, -1 , EmailType, TYPE_E_NONE );
|
||||||
|
|
||||||
// if we are in fact int he laptop, redraw icons, might be change in mail status
|
|
||||||
|
|
||||||
if( fCurrentlyInLaptop )
|
|
||||||
{
|
|
||||||
// redraw icons, might be new mail
|
|
||||||
DrawLapTopIcons();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType )
|
void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType )
|
||||||
@@ -830,13 +800,6 @@ void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender
|
|||||||
}
|
}
|
||||||
|
|
||||||
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, -1, EmailType, TYPE_E_NONE);
|
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, -1, EmailType, TYPE_E_NONE);
|
||||||
|
|
||||||
// if we are in fact int he laptop, redraw icons, might be change in mail status
|
|
||||||
if( fCurrentlyInLaptop )
|
|
||||||
{
|
|
||||||
// redraw icons, might be new mail
|
|
||||||
DrawLapTopIcons();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
@@ -853,14 +816,6 @@ void AddBobbyREmailJA2(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSende
|
|||||||
// add message to list
|
// add message to list
|
||||||
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_EMAIL_BOBBY_R_L1);
|
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_EMAIL_BOBBY_R_L1);
|
||||||
|
|
||||||
// if we are in fact int he laptop, redraw icons, might be change in mail status
|
|
||||||
|
|
||||||
if( fCurrentlyInLaptop == TRUE )
|
|
||||||
{
|
|
||||||
// redraw icons, might be new mail
|
|
||||||
DrawLapTopIcons();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -884,14 +839,6 @@ void AddEmailWFMercAvailable(INT32 iMessageOffset, INT32 iMessageLength, UINT8 u
|
|||||||
|
|
||||||
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, -1 , EmailType, TYPE_E_NONE);
|
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, -1 , EmailType, TYPE_E_NONE);
|
||||||
|
|
||||||
// if we are in fact int he laptop, redraw icons, might be change in mail status
|
|
||||||
|
|
||||||
if( fCurrentlyInLaptop == TRUE )
|
|
||||||
{
|
|
||||||
// redraw icons, might be new mail
|
|
||||||
DrawLapTopIcons();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -931,14 +878,6 @@ void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32
|
|||||||
// add message to list
|
// add message to list
|
||||||
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_E_NONE);
|
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_E_NONE);
|
||||||
|
|
||||||
// if we are in fact int he laptop, redraw icons, might be change in mail status
|
|
||||||
|
|
||||||
if( fCurrentlyInLaptop == TRUE )
|
|
||||||
{
|
|
||||||
// redraw icons, might be new mail
|
|
||||||
DrawLapTopIcons();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -968,13 +907,6 @@ void AddPreReadEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender,
|
|||||||
// add message to list
|
// add message to list
|
||||||
AddEmailMessage( iMessageOffset,iMessageLength, pSubject, iDate, ubSender, TRUE, 0, 0, -1, -1 , EmailType, TYPE_E_NONE );
|
AddEmailMessage( iMessageOffset,iMessageLength, pSubject, iDate, ubSender, TRUE, 0, 0, -1, -1 , EmailType, TYPE_E_NONE );
|
||||||
|
|
||||||
// if we are in fact int he laptop, redraw icons, might be change in mail status
|
|
||||||
|
|
||||||
if( fCurrentlyInLaptop == TRUE )
|
|
||||||
{
|
|
||||||
// redraw icons, might be new mail
|
|
||||||
DrawLapTopIcons();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1956,9 +1888,6 @@ void BtnMessageXCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
// reset page being displayed
|
// reset page being displayed
|
||||||
giMessagePage = 0;
|
giMessagePage = 0;
|
||||||
|
|
||||||
// redraw icons
|
|
||||||
DrawLapTopIcons();
|
|
||||||
|
|
||||||
// force update of entire screen
|
// force update of entire screen
|
||||||
fPausedReDrawScreenFlag=TRUE;
|
fPausedReDrawScreenFlag=TRUE;
|
||||||
|
|
||||||
@@ -2421,7 +2350,6 @@ BOOLEAN DisplayNewMailBox( void )
|
|||||||
|
|
||||||
// printf warning string
|
// printf warning string
|
||||||
mprintf(EMAIL_WARNING_X + 60, EMAIL_WARNING_Y + 63, pNewMailStrings[0] );
|
mprintf(EMAIL_WARNING_X + 60, EMAIL_WARNING_Y + 63, pNewMailStrings[0] );
|
||||||
DrawLapTopIcons( );
|
|
||||||
|
|
||||||
// invalidate region
|
// invalidate region
|
||||||
InvalidateRegion( EMAIL_WARNING_X, EMAIL_WARNING_Y, EMAIL_WARNING_X + 270, EMAIL_WARNING_Y + 200 );
|
InvalidateRegion( EMAIL_WARNING_X, EMAIL_WARNING_Y, EMAIL_WARNING_X + 270, EMAIL_WARNING_Y + 200 );
|
||||||
@@ -2883,9 +2811,6 @@ void DeleteEmail()
|
|||||||
// upadte list
|
// upadte list
|
||||||
PlaceMessagesinPages();
|
PlaceMessagesinPages();
|
||||||
|
|
||||||
// redraw icons (if deleted message was last unread, remove checkmark)
|
|
||||||
DrawLapTopIcons();
|
|
||||||
|
|
||||||
// if all of a sudden we are beyond last page, move back one
|
// if all of a sudden we are beyond last page, move back one
|
||||||
if(iCurrentPage > iLastPage)
|
if(iCurrentPage > iLastPage)
|
||||||
iCurrentPage=iLastPage;
|
iCurrentPage=iLastPage;
|
||||||
@@ -3037,9 +2962,6 @@ void ViewMessageRegionCallBack( MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
// reset page being displayed
|
// reset page being displayed
|
||||||
giMessagePage = 0;
|
giMessagePage = 0;
|
||||||
|
|
||||||
// redraw icons
|
|
||||||
DrawLapTopIcons();
|
|
||||||
|
|
||||||
// force update of entire screen
|
// force update of entire screen
|
||||||
fPausedReDrawScreenFlag=TRUE;
|
fPausedReDrawScreenFlag=TRUE;
|
||||||
|
|
||||||
|
|||||||
@@ -476,7 +476,6 @@ void GameInitFiles( )
|
|||||||
{
|
{
|
||||||
if ( FileExists( FILES_DAT_FILE ) == TRUE )
|
if ( FileExists( FILES_DAT_FILE ) == TRUE )
|
||||||
{
|
{
|
||||||
FileClearAttributes( FILES_DAT_FILE );
|
|
||||||
FileDelete( FILES_DAT_FILE );
|
FileDelete( FILES_DAT_FILE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -460,7 +460,6 @@ void GameInitFinances()
|
|||||||
// unlink Finances data file
|
// unlink Finances data file
|
||||||
if( (FileExists( FINANCES_DATA_FILE ) ) )
|
if( (FileExists( FINANCES_DATA_FILE ) ) )
|
||||||
{
|
{
|
||||||
FileClearAttributes( FINANCES_DATA_FILE );
|
|
||||||
FileDelete( FINANCES_DATA_FILE );
|
FileDelete( FINANCES_DATA_FILE );
|
||||||
}
|
}
|
||||||
GetBalanceFromDisk( );
|
GetBalanceFromDisk( );
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user