mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9df885a264 | ||
|
|
5ed70befb4 | ||
|
|
f21cb38647 | ||
|
|
4823ef4929 | ||
|
|
586a46bb78 | ||
|
|
fffb3a45fb | ||
|
|
9c951adfea | ||
|
|
e3a542bf5d | ||
|
|
222daead0e | ||
|
|
ebd2e25e0f | ||
|
|
ff8376d625 | ||
|
|
7aa0e18352 | ||
|
|
1976dee738 | ||
|
|
552951795c | ||
|
|
8897769f0d | ||
|
|
dcf202990f | ||
|
|
db40cd433e | ||
|
|
ac6a1504df | ||
|
|
22e67f66fa | ||
|
|
fd6ffd8d69 | ||
|
|
f471b74f5b | ||
|
|
4a16698cdb | ||
|
|
846abf5f1c | ||
|
|
ed73bd07ae | ||
|
|
b908bcecb9 | ||
|
|
a7b0091a27 | ||
|
|
7aafa7aada | ||
|
|
3e76e9525e | ||
|
|
959c29434e | ||
|
|
e9686c0dca | ||
|
|
10037291f3 | ||
|
|
9ed713f952 | ||
|
|
cccec0ef11 | ||
|
|
4a7625cef0 | ||
|
|
70f09471c2 | ||
|
|
b15c4ef96c | ||
|
|
ecdc8916f2 | ||
|
|
4b563fefc8 | ||
|
|
cf0b4dfc40 | ||
|
|
5fb989a1fc | ||
|
|
33e8c1dc39 | ||
|
|
73f7812165 | ||
|
|
d008d10b31 | ||
|
|
cd69f5f3ae | ||
|
|
bf6de9f342 | ||
|
|
5d19c1fe25 | ||
|
|
4624fe92f0 | ||
|
|
3acd2cea97 | ||
|
|
4d4e039da7 | ||
|
|
3cfde817ba | ||
|
|
dd5cabc6ba | ||
|
|
a83dfbefb0 | ||
|
|
dc72a43a19 | ||
|
|
897f684705 | ||
|
|
0993789430 | ||
|
|
6b9997b9c5 | ||
|
|
4ed7b1fb98 | ||
|
|
5499d1fba2 | ||
|
|
22af6e8ec8 | ||
|
|
a9ab60e5e5 | ||
|
|
c30b1c1b25 | ||
|
|
f4f48f23c7 | ||
|
|
5b966b4df9 | ||
|
|
eb7837bc3e | ||
|
|
c88fbbe749 | ||
|
|
a580052e40 | ||
|
|
7fa8ff930b | ||
|
|
c7d021f5f3 | ||
|
|
bfc78e2ef8 | ||
|
|
0bd932f20f | ||
|
|
28a51e0e7b | ||
|
|
2fcba8b9f7 | ||
|
|
184b44c386 | ||
|
|
86ad401186 | ||
|
|
1d58bda82d | ||
|
|
87f51f0f6e | ||
|
|
98cdffe5fd | ||
|
|
2424066aab | ||
|
|
b89c63058f | ||
|
|
0b21d1d798 | ||
|
|
dcde413b7b | ||
|
|
febb283c3a | ||
|
|
678ef822ca | ||
|
|
1eff9f6aaa | ||
|
|
11bb0f741f | ||
|
|
1cd94cda23 | ||
|
|
f48fadb802 | ||
|
|
6497a35af9 | ||
|
|
85ad2e5e72 | ||
|
|
8040c5d826 | ||
|
|
93e89798ec | ||
|
|
49a119e6b9 | ||
|
|
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 | ||
|
|
4ebae982dd | ||
|
|
8a241d277d | ||
|
|
5bfd19e5a8 | ||
|
|
07591e50f5 | ||
|
|
556641377c | ||
|
|
985dace82e | ||
|
|
bb73a458ee | ||
|
|
f8637e5972 | ||
|
|
4c861e441a | ||
|
|
3fa6a4bd45 | ||
|
|
fc5573f73d | ||
|
|
23ceb0fa4c | ||
|
|
1c11c88598 | ||
|
|
28aa73a859 | ||
|
|
cd186a2b1c | ||
|
|
019b9c4907 | ||
|
|
0962319a43 | ||
|
|
5740a0af08 | ||
|
|
9a46abe394 | ||
|
|
7910be0ab7 | ||
|
|
ee3d2472e7 | ||
|
|
7edecd6849 | ||
|
|
d56288e313 | ||
|
|
3ddacf1a44 | ||
|
|
8ec02b2d40 | ||
|
|
6bae48658e | ||
|
|
28a5c76775 | ||
|
|
1289c399ce | ||
|
|
1e1d456fd2 | ||
|
|
2060022e94 | ||
|
|
8f08eb15d2 | ||
|
|
5400fb019d | ||
|
|
b91871b518 | ||
|
|
aaeea9aac8 | ||
|
|
43c6943399 | ||
|
|
52ccc7cc3c | ||
|
|
200ac73f7a | ||
|
|
1bb8a214c9 | ||
|
|
f78d91f3a3 | ||
|
|
32e49784a0 | ||
|
|
8824d32da9 | ||
|
|
2345dd0ae6 | ||
|
|
cc6adb70f6 | ||
|
|
f16f137f2b | ||
|
|
7383d6b3f6 | ||
|
|
2e5aabe615 | ||
|
|
0ac6c3eb2d | ||
|
|
700734db10 | ||
|
|
7a198acdec | ||
|
|
62029a8ea9 |
+29
-54
@@ -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,64 +179,39 @@ 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/
|
- name: Checkout Repo
|
||||||
shell: bash
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: source
|
||||||
|
fetch-depth: 1
|
||||||
|
sparse-checkout: 'README.md'
|
||||||
|
- name: Create latest pre-release
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
working-directory: source
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
gh release delete latest --cleanup-tag || true
|
||||||
mkdir dist/
|
git tag -d latest || true
|
||||||
mv artifacts/*_release/* dist/
|
git push --delete origin refs/tags/latest || true
|
||||||
|
git tag latest
|
||||||
- name: Delete Latest
|
git push --force origin refs/tags/latest
|
||||||
if: startsWith(github.ref, 'refs/tags/v') == false
|
gh release create latest ../dist/* \
|
||||||
uses: dev-drprasad/delete-tag-and-release@v1.0
|
--generate-notes \
|
||||||
with:
|
--title "Latest (unstable)" \
|
||||||
tag_name: "latest"
|
--verify-tag \
|
||||||
|
--prerelease
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- id: release_latest
|
|
||||||
name: Release Latest
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v') == false
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
with:
|
|
||||||
allowUpdates: false
|
|
||||||
artifactErrorsFailBuild: true
|
|
||||||
artifacts: dist/*
|
|
||||||
draft: false
|
|
||||||
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: '
|
gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber
|
||||||
echo -n '${{ steps.release_tag.outputs.id }}'
|
env:
|
||||||
echo -n '${{ steps.release_latest.outputs.id }}'
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
echo ''
|
|
||||||
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,16 +50,26 @@ 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: Turn on link-time optimization?
|
||||||
|
if: fromJSON(inputs.assemble)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
echo "
|
||||||
|
LTO=ON
|
||||||
|
" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Prepare build properties
|
- name: Prepare build properties
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
touch CMakeUserPresets.json
|
touch CMakePresets.json
|
||||||
|
|
||||||
JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]')
|
JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]')
|
||||||
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
|
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
|
||||||
@@ -68,7 +79,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
|
||||||
@@ -76,7 +87,7 @@ jobs:
|
|||||||
arch: x86
|
arch: x86
|
||||||
- name: Prepare build
|
- name: Prepare build
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application"
|
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application" -DLTO_OPTION="$Env:LTO"
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cmake --build build/ -- -v
|
cmake --build build/ -- -v
|
||||||
@@ -86,7 +97,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 +110,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 +119,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 +127,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 +141,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 +209,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
|
||||||
|
|||||||
+1
-1
@@ -6,6 +6,6 @@
|
|||||||
/.vs/
|
/.vs/
|
||||||
/build/
|
/build/
|
||||||
/out/
|
/out/
|
||||||
|
/CMakePresets.json
|
||||||
/CMakeSettings.json
|
/CMakeSettings.json
|
||||||
/CMakeUserPresets.json
|
|
||||||
/lib/
|
/lib/
|
||||||
|
|||||||
+110
-124
@@ -9,10 +9,25 @@ set(CMAKE_CXX_STANDARD 17)
|
|||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
option(LTO_OPTION "Enable link-time optimization if supported by compiler" OFF)
|
||||||
|
|
||||||
|
include(CheckIPOSupported)
|
||||||
|
check_ipo_supported(RESULT LinkTimeOptimization OUTPUT IpoError LANGUAGES C CXX)
|
||||||
|
if(LinkTimeOptimization AND LTO_OPTION)
|
||||||
|
message(STATUS "Configuring WITH link-time optimization")
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||||
|
else()
|
||||||
|
message(STATUS "Configuring WITHOUT link-time optimization ${IpoError}")
|
||||||
|
endif()
|
||||||
|
|
||||||
option(ADDRESS_SANITIZER OFF)
|
option(ADDRESS_SANITIZER OFF)
|
||||||
if(ADDRESS_SANITIZER)
|
if(ADDRESS_SANITIZER)
|
||||||
message(STATUS "AddressSanitizer ENABLED for non-Release builds")
|
message(STATUS "AddressSanitizer ENABLED for non-Release builds")
|
||||||
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
|
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
add_compile_options("/wd4838")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# whether we are using MSBuild as a generator
|
# whether we are using MSBuild as a generator
|
||||||
@@ -22,8 +37,25 @@ 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(
|
||||||
|
"${CMAKE_SOURCE_DIR}/Ja2"
|
||||||
|
"${CMAKE_SOURCE_DIR}/ext/VFS/include"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Utils"
|
||||||
|
"${CMAKE_SOURCE_DIR}/TileEngine"
|
||||||
|
"${CMAKE_SOURCE_DIR}/TacticalAI"
|
||||||
|
"${CMAKE_SOURCE_DIR}/ModularizedTacticalAI/include"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Tactical"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Strategic"
|
||||||
|
"${CMAKE_SOURCE_DIR}/sgp"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Ja2/Res"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Lua"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Laptop"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Multiplayer"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Editor"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Console"
|
||||||
|
"${CMAKE_SOURCE_DIR}/i18n/include"
|
||||||
|
)
|
||||||
|
|
||||||
# external libraries
|
# external libraries
|
||||||
add_subdirectory("ext/libpng")
|
add_subdirectory("ext/libpng")
|
||||||
@@ -34,95 +66,47 @@ target_link_libraries(bfVFS PRIVATE 7z)
|
|||||||
# ja2export utility
|
# ja2export utility
|
||||||
add_subdirectory("ext/export/src")
|
add_subdirectory("ext/export/src")
|
||||||
|
|
||||||
# static libraries whose source files, header files or header files included
|
# static libraries whose translation units don't rely on Application preprocessor definitions.
|
||||||
# by header files do not rely on Applications or Languages preprocessor definitions,
|
add_subdirectory(lua)
|
||||||
# and therefore only need to be compiled once. Good.
|
add_subdirectory(Multiplayer)
|
||||||
add_subdirectory(Lua)
|
add_subdirectory(wine)
|
||||||
|
|
||||||
# static libraries whose source files, header files or header files included
|
|
||||||
# by header files rely on Application and Language preprocessor definitions, and
|
|
||||||
# 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
|
|
||||||
TileEngine
|
|
||||||
TacticalAI
|
|
||||||
Utils
|
|
||||||
Strategic
|
|
||||||
SGP
|
|
||||||
Laptop
|
|
||||||
Editor
|
|
||||||
Console
|
|
||||||
Tactical
|
|
||||||
ModularizedTacticalAI
|
|
||||||
)
|
|
||||||
|
|
||||||
# TODO: Move these units into their own directory to declutter the root dir and CMakeLists.txt file
|
|
||||||
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
|
set(Ja2_Libraries
|
||||||
"${PROJECT_SOURCE_DIR}/libexpatMT.lib"
|
"${CMAKE_SOURCE_DIR}/binkw32.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/libexpatMT.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/lua51.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
|
||||||
"Dbghelp.lib"
|
"Dbghelp.lib"
|
||||||
Lua
|
|
||||||
"${PROJECT_SOURCE_DIR}/lua51.lib"
|
|
||||||
"${PROJECT_SOURCE_DIR}/lua51.vc9.lib"
|
|
||||||
"Winmm.lib"
|
"Winmm.lib"
|
||||||
"${PROJECT_SOURCE_DIR}/SMACKW32.LIB"
|
|
||||||
"${PROJECT_SOURCE_DIR}/binkw32.lib"
|
|
||||||
bfVFS
|
|
||||||
"${PROJECT_SOURCE_DIR}/Multiplayer/raknet/RakNetLibStatic.lib"
|
|
||||||
"ws2_32.lib"
|
"ws2_32.lib"
|
||||||
|
bfVFS
|
||||||
|
Lua
|
||||||
|
Multiplayer
|
||||||
|
wine
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# static libraries whose translation units rely on Application preprocessor definitions.
|
||||||
|
set(Ja2_Libs
|
||||||
|
Console
|
||||||
|
Editor
|
||||||
|
Ja2
|
||||||
|
Laptop
|
||||||
|
ModularizedTacticalAI
|
||||||
|
sgp
|
||||||
|
Strategic
|
||||||
|
Tactical
|
||||||
|
TacticalAI
|
||||||
|
TileEngine
|
||||||
|
Utils
|
||||||
|
)
|
||||||
|
foreach(lib IN LISTS Ja2_Libs)
|
||||||
|
add_subdirectory(${lib})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# language library relies on Application _and_ Language preprocessor definition. very bad.
|
||||||
|
add_subdirectory(i18n)
|
||||||
|
|
||||||
# simple function to validate Languages and Application choices
|
# simple function to validate Languages and Application choices
|
||||||
include(cmake/ValidateOptions.cmake)
|
include(cmake/ValidateOptions.cmake)
|
||||||
|
|
||||||
@@ -136,47 +120,49 @@ ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "Applica
|
|||||||
# preprocessor definitions for Debug build, per the legacy MSBuild
|
# preprocessor definitions for Debug build, per the legacy MSBuild
|
||||||
set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>)
|
set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>)
|
||||||
|
|
||||||
# Due to widespread preprocessor definition abuse in the codebase, practically
|
foreach(app IN LISTS ApplicationTargets)
|
||||||
# every library-language-executable combination is its own compilation target
|
set(isEditor $<STREQUAL:${app},JA2MAPEDITOR>)
|
||||||
# TODO: refactor preprocessor usage onto, ideally, a single translation unit
|
set(isUb $<STREQUAL:${app},JA2UB>)
|
||||||
foreach(lang IN LISTS LangTargets)
|
set(isUbEditor $<STREQUAL:${app},JA2UBMAPEDITOR>)
|
||||||
foreach(exe IN LISTS ApplicationTargets)
|
set(compilationFlags
|
||||||
set(Executable ${exe}_${lang})
|
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,>
|
||||||
|
$<IF:${isUb},JA2UB;JA2UBMAPS,>
|
||||||
|
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
|
||||||
|
)
|
||||||
|
|
||||||
# executable for an application/language combination, e.g. JA2_ENGLISH.exe
|
foreach(lib IN LISTS Ja2_Libs)
|
||||||
add_executable(${Executable} WIN32)
|
# library for an application, e.g. JA2UB_sgp
|
||||||
target_sources(${Executable} PRIVATE ${Ja2Src})
|
set(game_library ${app}_${lib})
|
||||||
|
add_library(${game_library})
|
||||||
|
target_sources(${game_library} PRIVATE ${${lib}Src})
|
||||||
|
target_compile_definitions(${game_library} PRIVATE ${compilationFlags} ${debugFlags})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# Good libraries have already been built, can be simply linked here
|
foreach(lang IN LISTS LangTargets)
|
||||||
target_link_libraries(${Executable} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
|
# executable for an application/language combination, e.g. JA2_ENGLISH.exe
|
||||||
target_link_options(${Executable} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
|
set(exe ${app}_${lang})
|
||||||
|
add_executable(${exe} WIN32
|
||||||
|
sgp/sgp.cpp
|
||||||
|
Ja2/Res/ja2.rc
|
||||||
|
)
|
||||||
|
target_link_libraries(${exe} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
|
||||||
|
target_link_options(${exe} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
|
||||||
|
|
||||||
# for each app/lang combination, the Very Bad libraries need to be built,
|
# language library for an application, e.g. JA2MAPEDITOR_ENGLISH_i18n
|
||||||
# with the appropriate preprocessor definitions
|
set(language_library ${exe}_i18n)
|
||||||
foreach(lib IN LISTS Ja2_Libs)
|
add_library(${language_library})
|
||||||
# syntactic sugar to hopefully make this more readable
|
target_sources(${language_library} PRIVATE ${i18nSrc})
|
||||||
set(VeryBadLib ${Executable}_${lib})
|
target_compile_definitions(${language_library} PRIVATE ${compilationFlags} ${debugFlags} ${lang})
|
||||||
set(isEditor $<STREQUAL:${exe},JA2MAPEDITOR>)
|
target_link_libraries(${exe} PRIVATE ${language_library})
|
||||||
set(isUb $<STREQUAL:${exe},JA2UB>)
|
|
||||||
set(isUbEditor $<STREQUAL:${exe},JA2UBMAPEDITOR>)
|
|
||||||
|
|
||||||
# static library for an app/lang combination, e.g. JA2_ENGLISH_SGP.lib
|
# go through all game libraries again and link them to the app/language executable
|
||||||
add_library(${VeryBadLib})
|
foreach(lib IN LISTS Ja2_Libs)
|
||||||
target_sources(${VeryBadLib} PRIVATE ${${lib}Src})
|
target_link_libraries(${exe} PRIVATE ${app}_${lib})
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
target_compile_definitions(${VeryBadLib} PUBLIC
|
# for SGP only
|
||||||
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,>
|
target_link_libraries(${app}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
|
||||||
$<IF:${isUb},JA2UB;JA2UBMAPS,>
|
target_link_libraries(${app}_sgp PRIVATE libpng)
|
||||||
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
|
target_compile_definitions(${app}_sgp PRIVATE NO_ZLIB_COMPRESSION)
|
||||||
${debugFlags}
|
|
||||||
${lang}
|
|
||||||
)
|
|
||||||
target_link_libraries(${Executable} PUBLIC ${VeryBadLib})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# for SGP only
|
|
||||||
target_link_libraries(${Executable}_SGP PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
|
|
||||||
target_link_libraries(${Executable}_SGP PUBLIC libpng)
|
|
||||||
target_compile_definitions(${Executable}_SGP PRIVATE NO_ZLIB_COMPRESSION)
|
|
||||||
endforeach()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ void EntryInitEditorItemsInfo()
|
|||||||
item = &Item[i];
|
item = &Item[i];
|
||||||
//if( Item[i].fFlags & ITEM_NOT_EDITOR )
|
//if( Item[i].fFlags & ITEM_NOT_EDITOR )
|
||||||
// continue;
|
// continue;
|
||||||
if(item->notineditor)
|
if(ItemIsNotInEditor(i))
|
||||||
continue;
|
continue;
|
||||||
if( i == SWITCH || i == ACTION_ITEM )
|
if( i == SWITCH || i == ACTION_ITEM )
|
||||||
{
|
{
|
||||||
@@ -331,7 +331,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
item = &Item[usCounter];
|
item = &Item[usCounter];
|
||||||
if(item->notineditor)
|
if(ItemIsNotInEditor(usCounter))
|
||||||
{
|
{
|
||||||
usCounter++;
|
usCounter++;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
+11
-42
@@ -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();
|
||||||
@@ -176,7 +173,15 @@ void LoadSaveScreenEntry()
|
|||||||
vfs::CVirtualProfile* prof = it.value();
|
vfs::CVirtualProfile* prof = it.value();
|
||||||
memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
|
memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
|
||||||
strcpy(FileInfo.zFileName, "< ");
|
strcpy(FileInfo.zFileName, "< ");
|
||||||
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
|
// Cut filename off if it's too long for the buffer
|
||||||
|
if (strlen(prof->cName.utf8().c_str()) > FILENAME_BUFLEN-4)
|
||||||
|
{
|
||||||
|
strncpy(FileInfo.zFileName+1, prof->cName.utf8().c_str(), FILENAME_BUFLEN-4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
|
||||||
|
}
|
||||||
strcat(FileInfo.zFileName, " >");
|
strcat(FileInfo.zFileName, " >");
|
||||||
FileInfo.zFileName[FILENAME_BUFLEN] = 0;
|
FileInfo.zFileName[FILENAME_BUFLEN] = 0;
|
||||||
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
|
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
|
||||||
@@ -220,25 +225,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 +269,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 +455,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 +476,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 +699,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 +709,6 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
FListNode = FListNode->pNext;
|
FListNode = FListNode->pNext;
|
||||||
@@ -950,7 +921,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 +931,6 @@ void HandleMainKeyEvents( InputAtom *pEvent )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -1,7 +1,7 @@
|
|||||||
#include "BuildDefines.h"
|
#include "BuildDefines.h"
|
||||||
#include "Fileman.h"
|
#include "Fileman.h"
|
||||||
|
|
||||||
#define FILENAME_BUFLEN (20 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213
|
#define FILENAME_BUFLEN (30 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -403,14 +403,42 @@ void PlaceRoadMacroAtGridNo( INT32 iMapIndex, INT32 iMacroID )
|
|||||||
while( gRoadMacros[ i ].sMacroID == iMacroID )
|
while( gRoadMacros[ i ].sMacroID == iMacroID )
|
||||||
{
|
{
|
||||||
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size
|
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size
|
||||||
INT32 sdX = gRoadMacros[ i ].sOffset % OLD_WORLD_COLS;
|
INT32 sdY = gRoadMacros[ i ].sOffset / (OLD_WORLD_COLS);
|
||||||
INT32 sdY = gRoadMacros[ i ].sOffset / OLD_WORLD_COLS;
|
INT32 sdX = gRoadMacros[ i ].sOffset - (sdY*OLD_WORLD_COLS);
|
||||||
INT32 sOffset = sdY*WORLD_COLS + sdX;
|
|
||||||
|
// Take into account the dfference between old and new row size for tiles that are shifted
|
||||||
|
// by one row due to X offset
|
||||||
|
// For example:
|
||||||
|
// {RBR, 159},
|
||||||
|
//{ RBR, -159 },
|
||||||
//
|
//
|
||||||
AddToUndoList( iMapIndex + sOffset );
|
// Offsets for 160x160 map
|
||||||
RemoveAllObjectsOfTypeRange( iMapIndex + sOffset, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
|
// [] [] [-159]
|
||||||
|
// [] [0] []
|
||||||
|
// [159] [] []
|
||||||
|
//
|
||||||
|
// Converted to 200x200 map
|
||||||
|
// [] [] [-199]
|
||||||
|
// [] [0] []
|
||||||
|
// [199] [] []
|
||||||
|
//
|
||||||
|
// Without this the original conversion would output 159 and -159 for X coordinate
|
||||||
|
if (sdX < -OLD_WORLD_COLS/2)
|
||||||
|
{
|
||||||
|
sdX -= WORLD_COLS - OLD_WORLD_COLS;
|
||||||
|
}
|
||||||
|
else if (sdX > OLD_WORLD_COLS / 2)
|
||||||
|
{
|
||||||
|
sdX += WORLD_COLS - OLD_WORLD_COLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT32 sOffset = sdY*WORLD_COLS + sdX;
|
||||||
|
INT32 newGridNo = iMapIndex + sOffset;
|
||||||
|
|
||||||
|
AddToUndoList( newGridNo );
|
||||||
|
RemoveAllObjectsOfTypeRange( newGridNo, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
|
||||||
GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
|
GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
|
||||||
AddObjectToHead( iMapIndex + sOffset, usTileIndex );
|
AddObjectToHead( newGridNo, usTileIndex );
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+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
|
||||||
|
|||||||
+38
-14
@@ -1,4 +1,4 @@
|
|||||||
#include "builddefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
|
|
||||||
@@ -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( );
|
||||||
|
|
||||||
@@ -1070,10 +1069,7 @@ void ShowCurrentDrawingMode( void )
|
|||||||
// Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on
|
// Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on
|
||||||
usFillColor = GenericButtonFillColors[0];
|
usFillColor = GenericButtonFillColors[0];
|
||||||
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
||||||
if(gbPixelDepth==16)
|
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
|
||||||
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
|
|
||||||
else if(gbPixelDepth==8)
|
|
||||||
RectangleDraw8( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
|
|
||||||
|
|
||||||
UnLockVideoSurface( FRAME_BUFFER );
|
UnLockVideoSurface( FRAME_BUFFER );
|
||||||
|
|
||||||
@@ -1616,16 +1612,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:
|
||||||
@@ -2944,6 +2951,23 @@ UINT32 WaitForSelectionWindowResponse( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mousewheel scroll
|
||||||
|
if (_WheelValue > 0)
|
||||||
|
{
|
||||||
|
while (_WheelValue--)
|
||||||
|
{
|
||||||
|
ScrollSelWinUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (_WheelValue++)
|
||||||
|
{
|
||||||
|
ScrollSelWinDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_WheelValue = 0;
|
||||||
|
|
||||||
if ( DoWindowSelection( ) )
|
if ( DoWindowSelection( ) )
|
||||||
{
|
{
|
||||||
fSelectionWindow = FALSE;
|
fSelectionWindow = FALSE;
|
||||||
|
|||||||
+60
-36
@@ -29,6 +29,16 @@ extern BOOLEAN fDontUseRandom;
|
|||||||
|
|
||||||
extern UINT16 GenericButtonFillColors[40];
|
extern UINT16 GenericButtonFillColors[40];
|
||||||
|
|
||||||
|
struct SelectionWindow
|
||||||
|
{
|
||||||
|
SGPRect window;
|
||||||
|
SGPPoint displayAreaStart; // Area where selectable items are drawn
|
||||||
|
SGPPoint displayAreaEnd;
|
||||||
|
SGPPoint spacing; // For displayed items
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectionWindow gSelection;
|
||||||
|
|
||||||
BOOLEAN gfRenderSquareArea = FALSE;
|
BOOLEAN gfRenderSquareArea = FALSE;
|
||||||
INT16 iStartClickX,iStartClickY;
|
INT16 iStartClickX,iStartClickY;
|
||||||
INT16 iEndClickX,iEndClickY;
|
INT16 iEndClickX,iEndClickY;
|
||||||
@@ -40,7 +50,6 @@ INT32 iSelectWin,iCancelWin,iScrollUp,iScrollDown,iOkWin;
|
|||||||
BOOLEAN fAllDone=FALSE;
|
BOOLEAN fAllDone=FALSE;
|
||||||
BOOLEAN fButtonsPresent=FALSE;
|
BOOLEAN fButtonsPresent=FALSE;
|
||||||
|
|
||||||
SGPPoint SelWinSpacing, SelWinStartPoint, SelWinEndPoint;
|
|
||||||
|
|
||||||
//These definitions help define the start and end of the various wall indices.
|
//These definitions help define the start and end of the various wall indices.
|
||||||
//This needs to be maintained if the walls change.
|
//This needs to be maintained if the walls change.
|
||||||
@@ -172,6 +181,30 @@ UINT16 SelWinHilightFillColor = 0x23BA; //blue, formerly 0x000d a kind of mediu
|
|||||||
//
|
//
|
||||||
void CreateJA2SelectionWindow( INT16 sWhat )
|
void CreateJA2SelectionWindow( INT16 sWhat )
|
||||||
{
|
{
|
||||||
|
auto selectWinWidth = 600;
|
||||||
|
const auto selectWinHeight = SCREEN_HEIGHT - 120; // From top edge to taskbar
|
||||||
|
if (iResolution > _800x600)
|
||||||
|
{
|
||||||
|
selectWinWidth = 900;
|
||||||
|
}
|
||||||
|
auto tlX = 0;
|
||||||
|
auto tlY = 0;
|
||||||
|
auto brX = tlX + selectWinWidth;
|
||||||
|
auto brY = tlY + selectWinHeight;
|
||||||
|
gSelection.window.iLeft = tlX;
|
||||||
|
gSelection.window.iTop = tlY;
|
||||||
|
gSelection.window.iRight = brX;
|
||||||
|
gSelection.window.iBottom = brY;
|
||||||
|
gSelection.displayAreaStart.iX = tlX + 1;
|
||||||
|
gSelection.displayAreaStart.iY = tlY + 15;
|
||||||
|
gSelection.displayAreaEnd.iX = brX - 1;
|
||||||
|
gSelection.displayAreaEnd.iY= brY - 1;
|
||||||
|
gSelection.spacing.iX = 2;
|
||||||
|
gSelection.spacing.iY = 2;
|
||||||
|
|
||||||
|
iTopWinCutOff = gSelection.displayAreaStart.iY;
|
||||||
|
iBotWinCutOff = gSelection.displayAreaEnd.iY;
|
||||||
|
|
||||||
DisplaySpec *pDSpec;
|
DisplaySpec *pDSpec;
|
||||||
UINT16 usNSpecs;
|
UINT16 usNSpecs;
|
||||||
|
|
||||||
@@ -185,32 +218,33 @@ void CreateJA2SelectionWindow( INT16 sWhat )
|
|||||||
iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" );
|
iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" );
|
||||||
iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" );
|
iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" );
|
||||||
|
|
||||||
iSelectWin = CreateHotSpot(0, 0, 600, 360, MSYS_PRIORITY_HIGH,
|
|
||||||
|
iSelectWin = CreateHotSpot(0, 0, selectWinWidth, selectWinHeight, MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, SelWinClkCallback);
|
DEFAULT_MOVE_CALLBACK, SelWinClkCallback);
|
||||||
|
|
||||||
iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0,
|
iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0,
|
||||||
BUTTON_USE_DEFAULT, 600, 0,
|
BUTTON_USE_DEFAULT, selectWinWidth, 0,
|
||||||
40, 40, BUTTON_TOGGLE,
|
40, 40, BUTTON_TOGGLE,
|
||||||
MSYS_PRIORITY_HIGH,
|
MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, OkClkCallback);
|
DEFAULT_MOVE_CALLBACK, OkClkCallback);
|
||||||
SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]);
|
SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]);
|
||||||
|
|
||||||
iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0,
|
iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0,
|
||||||
BUTTON_USE_DEFAULT, 600, 40,
|
BUTTON_USE_DEFAULT, selectWinWidth, 40,
|
||||||
40, 40, BUTTON_TOGGLE,
|
40, 40, BUTTON_TOGGLE,
|
||||||
MSYS_PRIORITY_HIGH,
|
MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, CnclClkCallback);
|
DEFAULT_MOVE_CALLBACK, CnclClkCallback);
|
||||||
SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]);
|
SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]);
|
||||||
|
|
||||||
iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0,
|
iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0,
|
||||||
BUTTON_USE_DEFAULT, 600, 80,
|
BUTTON_USE_DEFAULT, selectWinWidth, 80,
|
||||||
40, 160, BUTTON_NO_TOGGLE,
|
40, 160, BUTTON_NO_TOGGLE,
|
||||||
MSYS_PRIORITY_HIGH,
|
MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, UpClkCallback);
|
DEFAULT_MOVE_CALLBACK, UpClkCallback);
|
||||||
SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]);
|
SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]);
|
||||||
|
|
||||||
iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0,
|
iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0,
|
||||||
BUTTON_USE_DEFAULT, 600, 240,
|
BUTTON_USE_DEFAULT, selectWinWidth, 240,
|
||||||
40, 160, BUTTON_NO_TOGGLE,
|
40, 160, BUTTON_NO_TOGGLE,
|
||||||
MSYS_PRIORITY_HIGH,
|
MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, DwnClkCallback);
|
DEFAULT_MOVE_CALLBACK, DwnClkCallback);
|
||||||
@@ -218,18 +252,6 @@ void CreateJA2SelectionWindow( INT16 sWhat )
|
|||||||
|
|
||||||
fButtonsPresent = TRUE;
|
fButtonsPresent = TRUE;
|
||||||
|
|
||||||
SelWinSpacing.iX = 2;
|
|
||||||
SelWinSpacing.iY = 2;
|
|
||||||
|
|
||||||
SelWinStartPoint.iX = 1;
|
|
||||||
SelWinStartPoint.iY = 15;
|
|
||||||
|
|
||||||
iTopWinCutOff = 15;
|
|
||||||
|
|
||||||
SelWinEndPoint.iX = 599;
|
|
||||||
SelWinEndPoint.iY = 359;
|
|
||||||
|
|
||||||
iBotWinCutOff = 359;
|
|
||||||
|
|
||||||
switch( sWhat )
|
switch( sWhat )
|
||||||
{
|
{
|
||||||
@@ -347,8 +369,8 @@ void CreateJA2SelectionWindow( INT16 sWhat )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &SelWinStartPoint, &SelWinEndPoint,
|
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &gSelection.displayAreaStart , &gSelection.displayAreaEnd,
|
||||||
&SelWinSpacing, CLEAR_BACKGROUND);
|
&gSelection.spacing, CLEAR_BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -849,12 +871,14 @@ void RenderSelectionWindow( void )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ColorFillVideoSurfaceArea(FRAME_BUFFER,
|
ColorFillVideoSurfaceArea(FRAME_BUFFER,
|
||||||
0, 0, 600, 400,
|
gSelection.window.iLeft, gSelection.window.iTop, gSelection.window.iRight, gSelection.window.iBottom,
|
||||||
GenericButtonFillColors[0]);
|
GenericButtonFillColors[0]
|
||||||
|
);
|
||||||
DrawSelections( );
|
DrawSelections( );
|
||||||
MarkButtonsDirty();
|
MarkButtonsDirty();
|
||||||
RenderButtons( );
|
RenderButtons( );
|
||||||
|
|
||||||
|
// Draw selection rectangle
|
||||||
if ( gfRenderSquareArea )
|
if ( gfRenderSquareArea )
|
||||||
{
|
{
|
||||||
button = ButtonList[iSelectWin];
|
button = ButtonList[iSelectWin];
|
||||||
@@ -862,7 +886,7 @@ void RenderSelectionWindow( void )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) ||
|
if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) ||
|
||||||
(abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY)) > 9) )
|
(abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY)) > 9) )
|
||||||
{
|
{
|
||||||
// iSX = (INT32)iStartClickX;
|
// iSX = (INT32)iStartClickX;
|
||||||
// iEX = (INT32)button->Area.MouseXPos;
|
// iEX = (INT32)button->Area.MouseXPos;
|
||||||
@@ -870,7 +894,7 @@ void RenderSelectionWindow( void )
|
|||||||
// iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY);
|
// iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY);
|
||||||
|
|
||||||
iSX = iStartClickX;
|
iSX = iStartClickX;
|
||||||
iSY = iStartClickY - iTopWinCutOff + SelWinStartPoint.iY;
|
iSY = iStartClickY - iTopWinCutOff + gSelection.displayAreaStart.iY;
|
||||||
iEX = gusMouseXPos;
|
iEX = gusMouseXPos;
|
||||||
iEY = gusMouseYPos;
|
iEY = gusMouseYPos;
|
||||||
|
|
||||||
@@ -889,10 +913,10 @@ void RenderSelectionWindow( void )
|
|||||||
iEY ^= iSY;
|
iEY ^= iSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
iEX = min( iEX, 600 );
|
iEX = min( gSelection.displayAreaEnd.iX, iEX);
|
||||||
iSY = max( SelWinStartPoint.iY, iSY );
|
iSY = max( gSelection.displayAreaStart.iY, iSY );
|
||||||
iEY = min( 359, iEY );
|
iEY = min( gSelection.displayAreaEnd.iY, iEY );
|
||||||
iEY = max( SelWinStartPoint.iY, iEY );
|
iEY = max( gSelection.displayAreaStart.iY, iEY );
|
||||||
|
|
||||||
usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0));
|
usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0));
|
||||||
usFillGreen += usDir;
|
usFillGreen += usDir;
|
||||||
@@ -928,7 +952,7 @@ void SelWinClkCallback( GUI_BUTTON *button, INT32 reason )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
iClickX = button->Area.MouseXPos;
|
iClickX = button->Area.MouseXPos;
|
||||||
iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
|
iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY;
|
||||||
|
|
||||||
if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
|
if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
|
||||||
{
|
{
|
||||||
@@ -1035,9 +1059,9 @@ void DisplaySelectionWindowGraphicalInformation()
|
|||||||
UINT16 y;
|
UINT16 y;
|
||||||
//Determine if there is a valid picture at cursor position.
|
//Determine if there is a valid picture at cursor position.
|
||||||
//iRelX = gusMouseXPos;
|
//iRelX = gusMouseXPos;
|
||||||
//iRelY = gusMouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
|
//iRelY = gusMouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY;
|
||||||
|
|
||||||
y = gusMouseYPos + iTopWinCutOff - (UINT16)SelWinStartPoint.iY;
|
y = gusMouseYPos + iTopWinCutOff - (UINT16)gSelection.displayAreaStart.iY;
|
||||||
pNode = pDispList;
|
pNode = pDispList;
|
||||||
fDone = FALSE;
|
fDone = FALSE;
|
||||||
while( (pNode != NULL) && !fDone )
|
while( (pNode != NULL) && !fDone )
|
||||||
@@ -1470,10 +1494,10 @@ void DrawSelections( void )
|
|||||||
{
|
{
|
||||||
SGPRect ClipRect, NewRect;
|
SGPRect ClipRect, NewRect;
|
||||||
|
|
||||||
NewRect.iLeft = SelWinStartPoint.iX;
|
NewRect.iLeft = gSelection.displayAreaStart.iX;
|
||||||
NewRect.iTop = SelWinStartPoint.iY;
|
NewRect.iTop = gSelection.displayAreaStart.iY;
|
||||||
NewRect.iRight = SelWinEndPoint.iX;
|
NewRect.iRight = gSelection.displayAreaEnd.iX;
|
||||||
NewRect.iBottom = SelWinEndPoint.iY;
|
NewRect.iBottom = gSelection.displayAreaEnd.iY;
|
||||||
|
|
||||||
GetClippingRect(&ClipRect);
|
GetClippingRect(&ClipRect);
|
||||||
SetClippingRect(&NewRect);
|
SetClippingRect(&NewRect);
|
||||||
@@ -1483,7 +1507,7 @@ void DrawSelections( void )
|
|||||||
SetObjectShade( gvoLargeFontType1, 0 );
|
SetObjectShade( gvoLargeFontType1, 0 );
|
||||||
// SetObjectShade( gvoLargeFont, 0 );
|
// SetObjectShade( gvoLargeFont, 0 );
|
||||||
|
|
||||||
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &SelWinStartPoint, CLEAR_BACKGROUND );
|
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &gSelection.displayAreaStart, CLEAR_BACKGROUND );
|
||||||
|
|
||||||
SetObjectShade( gvoLargeFontType1, 4 );
|
SetObjectShade( gvoLargeFontType1, 4 );
|
||||||
|
|
||||||
|
|||||||
@@ -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,37 @@
|
|||||||
|
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}/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}/TimeLogging.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"
|
||||||
|
PARENT_SCOPE)
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#ifndef _CHEATS__H_
|
#ifndef _CHEATS__H_
|
||||||
#define _CHEATS__H_
|
#define _CHEATS__H_
|
||||||
|
|
||||||
#include "Language Defines.h"
|
|
||||||
|
|
||||||
extern UINT8 gubCheatLevel;
|
extern UINT8 gubCheatLevel;
|
||||||
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
#include "Credits.h"
|
#include "Credits.h"
|
||||||
#include "Language Defines.h"
|
|
||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
@@ -681,13 +681,9 @@ BOOLEAN UpdateSaveBufferWithBackbuffer(void)
|
|||||||
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
|
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
|
||||||
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
|
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
|
||||||
|
|
||||||
if(gbPixelDepth==16)
|
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||||
{
|
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||||
// BLIT HERE
|
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
|
||||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
|
||||||
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
|
||||||
}
|
|
||||||
|
|
||||||
UnLockVideoSurface(FRAME_BUFFER);
|
UnLockVideoSurface(FRAME_BUFFER);
|
||||||
UnLockVideoSurface(guiSAVEBUFFER);
|
UnLockVideoSurface(guiSAVEBUFFER);
|
||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Interface Control.h"
|
#include "Interface Control.h"
|
||||||
#include "Message.h"
|
#include "Message.h"
|
||||||
#include "Language Defines.h"
|
|
||||||
#include "Multi Language Graphic Utils.h"
|
#include "Multi Language Graphic Utils.h"
|
||||||
#include "Map Information.h"
|
#include "Map Information.h"
|
||||||
#include "Sys Globals.h"
|
#include "Sys Globals.h"
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
#include "GameVersion.h"
|
#include "GameVersion.h"
|
||||||
#include "LibraryDataBase.h"
|
#include "LibraryDataBase.h"
|
||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
#include "Language Defines.h"
|
|
||||||
#include "HelpScreen.h"
|
#include "HelpScreen.h"
|
||||||
#include "INIReader.h"
|
#include "INIReader.h"
|
||||||
#include "Shade Table Util.h"
|
#include "Shade Table Util.h"
|
||||||
@@ -45,7 +44,7 @@
|
|||||||
#include <vfs/Core/vfs_file_raii.h>
|
#include <vfs/Core/vfs_file_raii.h>
|
||||||
#include <vfs/Core/File/vfs_file.h>
|
#include <vfs/Core/File/vfs_file.h>
|
||||||
|
|
||||||
#define GAME_SETTINGS_FILE "Ja2_Settings.INI"
|
#define GAME_SETTINGS_FILE "Ja2_Settings.ini"
|
||||||
|
|
||||||
#define FEATURE_FLAGS_FILE "Ja2_Features.ini"
|
#define FEATURE_FLAGS_FILE "Ja2_Features.ini"
|
||||||
|
|
||||||
@@ -992,8 +991,16 @@ 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 #################
|
||||||
|
|
||||||
@@ -1079,6 +1086,9 @@ void LoadGameExternalOptions()
|
|||||||
gGameExternalOptions.ubMercRandomExpRange = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_EXP_RANGE", 1, 0, 4);
|
gGameExternalOptions.ubMercRandomExpRange = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_EXP_RANGE", 1, 0, 4);
|
||||||
gGameExternalOptions.fMercRandomStartSalary = iniReader.ReadBoolean("Recruitment Settings", "MERCS_RANDOM_START_SALARY", FALSE);
|
gGameExternalOptions.fMercRandomStartSalary = iniReader.ReadBoolean("Recruitment Settings", "MERCS_RANDOM_START_SALARY", FALSE);
|
||||||
gGameExternalOptions.ubMercRandomStartSalaryPercentMod = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_START_SALARY_PERCENTAGE_MAX_MODIFIER", 30, 0, 100);
|
gGameExternalOptions.ubMercRandomStartSalaryPercentMod = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_START_SALARY_PERCENTAGE_MAX_MODIFIER", 30, 0, 100);
|
||||||
|
gGameExternalOptions.fMercGrowthModifiersEnabled = iniReader.ReadBoolean("Recruitment Settings", "MERCS_GROWTH_MODIFIERS_ENABLED", FALSE);
|
||||||
|
gGameExternalOptions.fMercRandomGrowthModifiers = iniReader.ReadBoolean("Recruitment Settings", "MERCS_RANDOM_GROWTH_MODIFIERS", FALSE);
|
||||||
|
gGameExternalOptions.iMercRandomGrowthModifiersRange = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_GROWTH_MODIFIERS_RANGE", 5, -50, 50);
|
||||||
|
|
||||||
//################# Financial Settings #################
|
//################# Financial Settings #################
|
||||||
|
|
||||||
@@ -1148,6 +1158,8 @@ void LoadGameExternalOptions()
|
|||||||
|
|
||||||
gGameExternalOptions.gfUseExternalLoadscreens = iniReader.ReadBoolean("Graphics Settings","USE_EXTERNALIZED_LOADSCREENS", FALSE);
|
gGameExternalOptions.gfUseExternalLoadscreens = iniReader.ReadBoolean("Graphics Settings","USE_EXTERNALIZED_LOADSCREENS", FALSE);
|
||||||
|
|
||||||
|
gGameExternalOptions.ubLoadscreenStretchMode = iniReader.ReadInteger("Graphics Settings", "LOADSCREEN_STRETCH_MODE", 0, 0, 2);
|
||||||
|
|
||||||
if (!is_networked)
|
if (!is_networked)
|
||||||
gGameExternalOptions.gfUseLoadScreenHints = iniReader.ReadBoolean("Graphics Settings","USE_LOADSCREENHINTS", TRUE);
|
gGameExternalOptions.gfUseLoadScreenHints = iniReader.ReadBoolean("Graphics Settings","USE_LOADSCREENHINTS", TRUE);
|
||||||
else
|
else
|
||||||
@@ -1180,6 +1192,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?*/);
|
||||||
@@ -2480,8 +2498,6 @@ void LoadGameExternalOptions()
|
|||||||
gGameExternalOptions.ubTeachBonusToTrain = iniReader.ReadInteger("Strategic Assignment Settings","TEACHER_TRAIT_BONUS_TO_TRAINING_EFFICIENCY",30, 0, 100);
|
gGameExternalOptions.ubTeachBonusToTrain = iniReader.ReadInteger("Strategic Assignment Settings","TEACHER_TRAIT_BONUS_TO_TRAINING_EFFICIENCY",30, 0, 100);
|
||||||
gGameExternalOptions.ubMinSkillToTeach = iniReader.ReadInteger("Strategic Assignment Settings","MIN_SKILL_REQUIRED_TO_TEACH_OTHER",25, 0, 100);
|
gGameExternalOptions.ubMinSkillToTeach = iniReader.ReadInteger("Strategic Assignment Settings","MIN_SKILL_REQUIRED_TO_TEACH_OTHER",25, 0, 100);
|
||||||
|
|
||||||
gGameExternalOptions.bDisableEvolution = iniReader.ReadBoolean("Strategic Assignment Settings", "DISABLE_EVOLUTION", TRUE );
|
|
||||||
|
|
||||||
// HEADROCK HAM B2.8: New Trainer Relations: 2 = Trainees will go to sleep when their trainer goes to sleep. 3 = Trainer will go to sleep if all trainees are asleep. 1 = Both. 0 = Neither.
|
// HEADROCK HAM B2.8: New Trainer Relations: 2 = Trainees will go to sleep when their trainer goes to sleep. 3 = Trainer will go to sleep if all trainees are asleep. 1 = Both. 0 = Neither.
|
||||||
gGameExternalOptions.ubSmartTrainingSleep = iniReader.ReadInteger("Strategic Assignment Settings","SYNCHRONIZED_SLEEPING_HOURS_WHEN_TRAINING_TOGETHER", 0, 0, 3);
|
gGameExternalOptions.ubSmartTrainingSleep = iniReader.ReadInteger("Strategic Assignment Settings","SYNCHRONIZED_SLEEPING_HOURS_WHEN_TRAINING_TOGETHER", 0, 0, 3);
|
||||||
|
|
||||||
@@ -2784,6 +2800,9 @@ void LoadSkillTraitsExternalSettings()
|
|||||||
gSkillTraitValues.ubTHBladesSilentCriticalHitChance = iniReader.ReadInteger("Throwing","TH_BLADES_SILENT_CRITICAL_HIT_CHANCE", 20, 0, 100);
|
gSkillTraitValues.ubTHBladesSilentCriticalHitChance = iniReader.ReadInteger("Throwing","TH_BLADES_SILENT_CRITICAL_HIT_CHANCE", 20, 0, 100);
|
||||||
gSkillTraitValues.ubTHBladesCriticalHitMultiplierBonus = iniReader.ReadInteger("Throwing","SILENT_CRITICAL_HIT_MULTIPLIER_BONUS", 1, 0, 50);
|
gSkillTraitValues.ubTHBladesCriticalHitMultiplierBonus = iniReader.ReadInteger("Throwing","SILENT_CRITICAL_HIT_MULTIPLIER_BONUS", 1, 0, 50);
|
||||||
gSkillTraitValues.ubTHBladesAimClicksAdded = iniReader.ReadInteger("Throwing","POSSIBLE_AIM_CLICK_ADDED_TH_KNIVES", 1, 0, 5);
|
gSkillTraitValues.ubTHBladesAimClicksAdded = iniReader.ReadInteger("Throwing","POSSIBLE_AIM_CLICK_ADDED_TH_KNIVES", 1, 0, 5);
|
||||||
|
gSkillTraitValues.ubTHAPsNeededToThrowGrenadesReduction = iniReader.ReadInteger("Throwing","APS_NEEDED_TO_THROW_GRENADES_REDUCTION", 25, 0, 90);
|
||||||
|
gSkillTraitValues.ubTHMaxRangeToThrowGrenades = iniReader.ReadInteger("Throwing","MAX_RANGE_TO_THROW_GRENADES", 20, 0, 250);
|
||||||
|
gSkillTraitValues.ubTHCtHWhenThrowingGrenades = iniReader.ReadInteger("Throwing","CTH_WHEN_THROWING_GRENADES", 30, 0, 100);
|
||||||
|
|
||||||
// NIGHT OPS
|
// NIGHT OPS
|
||||||
gSkillTraitValues.ubNOeSightRangeBonusInDark = iniReader.ReadInteger("Night Ops","SIGHT_RANGE_BONUS_IN_DARK", 1, 0, 100);
|
gSkillTraitValues.ubNOeSightRangeBonusInDark = iniReader.ReadInteger("Night Ops","SIGHT_RANGE_BONUS_IN_DARK", 1, 0, 100);
|
||||||
@@ -2810,9 +2829,6 @@ void LoadSkillTraitsExternalSettings()
|
|||||||
gSkillTraitValues.usBBIncreasedNeededDamageToFallDown = iniReader.ReadInteger("Bodybuilding","INCREASE_DAMAGE_NEEDED_TO_FALL_DOWN_IF_HIT_TO_LEGS", 100, 0, 500);
|
gSkillTraitValues.usBBIncreasedNeededDamageToFallDown = iniReader.ReadInteger("Bodybuilding","INCREASE_DAMAGE_NEEDED_TO_FALL_DOWN_IF_HIT_TO_LEGS", 100, 0, 500);
|
||||||
|
|
||||||
// DEMOLITIONS
|
// DEMOLITIONS
|
||||||
gSkillTraitValues.ubDEAPsNeededToThrowGrenadesReduction = iniReader.ReadInteger("Demolitions","APS_NEEDED_TO_THROW_GRENADES_REDUCTION", 25, 0, 90);
|
|
||||||
gSkillTraitValues.ubDEMaxRangeToThrowGrenades = iniReader.ReadInteger("Demolitions","MAX_RANGE_TO_THROW_GRENADES", 20, 0, 250);
|
|
||||||
gSkillTraitValues.ubDECtHWhenThrowingGrenades = iniReader.ReadInteger("Demolitions","CTH_WHEN_THROWING_GRENADES", 30, 0, 100);
|
|
||||||
gSkillTraitValues.ubDEDamageOfBombsAndMines = iniReader.ReadInteger("Demolitions","DAMAGE_OF_PLACED_BOMBS_AND_MINES", 25, 0, 250);
|
gSkillTraitValues.ubDEDamageOfBombsAndMines = iniReader.ReadInteger("Demolitions","DAMAGE_OF_PLACED_BOMBS_AND_MINES", 25, 0, 250);
|
||||||
gSkillTraitValues.ubDEAttachDetonatorCheckBonus = iniReader.ReadInteger("Demolitions","ATTACH_DETONATOR_CHECK_BONUS", 50, 0, 250);
|
gSkillTraitValues.ubDEAttachDetonatorCheckBonus = iniReader.ReadInteger("Demolitions","ATTACH_DETONATOR_CHECK_BONUS", 50, 0, 250);
|
||||||
gSkillTraitValues.ubDEPlantAndRemoveBombCheckBonus = iniReader.ReadInteger("Demolitions","PLANT_AND_REMOVE_BOMBS_AND_MINES_BONUS", 50, 0, 250);
|
gSkillTraitValues.ubDEPlantAndRemoveBombCheckBonus = iniReader.ReadInteger("Demolitions","PLANT_AND_REMOVE_BOMBS_AND_MINES_BONUS", 50, 0, 250);
|
||||||
@@ -3777,7 +3793,7 @@ void LoadCTHConstants()
|
|||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0);
|
||||||
@@ -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
|
||||||
@@ -781,6 +782,7 @@ typedef struct
|
|||||||
INT32 ubEnemiesItemDrop;
|
INT32 ubEnemiesItemDrop;
|
||||||
|
|
||||||
BOOLEAN gfUseExternalLoadscreens;
|
BOOLEAN gfUseExternalLoadscreens;
|
||||||
|
UINT32 ubLoadscreenStretchMode; // added by anv
|
||||||
BOOLEAN gfUseLoadScreenHints; // added by Flugente
|
BOOLEAN gfUseLoadScreenHints; // added by Flugente
|
||||||
UINT32 ubAdditionalDelayUntilLoadScreenDisposal; // added by WANNE to have time to read the load screen hints
|
UINT32 ubAdditionalDelayUntilLoadScreenDisposal; // added by WANNE to have time to read the load screen hints
|
||||||
|
|
||||||
@@ -816,9 +818,6 @@ typedef struct
|
|||||||
INT32 ubRpcBonusToTrainMilitia;
|
INT32 ubRpcBonusToTrainMilitia;
|
||||||
INT32 ubMinSkillToTeach;
|
INT32 ubMinSkillToTeach;
|
||||||
|
|
||||||
// Flugente: disable evolution setting in MercProfiles.xml
|
|
||||||
BOOLEAN bDisableEvolution;
|
|
||||||
|
|
||||||
INT32 ubLowActivityLevel;
|
INT32 ubLowActivityLevel;
|
||||||
INT32 ubMediumActivityLevel;
|
INT32 ubMediumActivityLevel;
|
||||||
INT32 ubHighActivityLevel;
|
INT32 ubHighActivityLevel;
|
||||||
@@ -954,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;
|
||||||
@@ -1440,6 +1445,10 @@ typedef struct
|
|||||||
|
|
||||||
UINT8 ubMercRandomStartSalaryPercentMod;
|
UINT8 ubMercRandomStartSalaryPercentMod;
|
||||||
|
|
||||||
|
BOOLEAN fMercGrowthModifiersEnabled;
|
||||||
|
BOOLEAN fMercRandomGrowthModifiers;
|
||||||
|
INT16 iMercRandomGrowthModifiersRange;
|
||||||
|
|
||||||
BOOLEAN fBobbyRayFastShipments;
|
BOOLEAN fBobbyRayFastShipments;
|
||||||
|
|
||||||
BOOLEAN fGridExitInTurnBased;
|
BOOLEAN fGridExitInTurnBased;
|
||||||
@@ -1551,6 +1560,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;
|
||||||
UINT8 ubToAltWeaponHoldReadyAPsPerc;
|
UINT8 ubToAltWeaponHoldReadyAPsPerc;
|
||||||
@@ -2176,6 +2191,9 @@ typedef struct
|
|||||||
UINT8 ubTHBladesSilentCriticalHitChance;
|
UINT8 ubTHBladesSilentCriticalHitChance;
|
||||||
UINT8 ubTHBladesCriticalHitMultiplierBonus;
|
UINT8 ubTHBladesCriticalHitMultiplierBonus;
|
||||||
UINT8 ubTHBladesAimClicksAdded;
|
UINT8 ubTHBladesAimClicksAdded;
|
||||||
|
UINT8 ubTHAPsNeededToThrowGrenadesReduction;
|
||||||
|
UINT8 ubTHMaxRangeToThrowGrenades;
|
||||||
|
UINT8 ubTHCtHWhenThrowingGrenades;
|
||||||
|
|
||||||
// NIGHT OPS
|
// NIGHT OPS
|
||||||
UINT8 ubNOeSightRangeBonusInDark;
|
UINT8 ubNOeSightRangeBonusInDark;
|
||||||
@@ -2202,9 +2220,6 @@ typedef struct
|
|||||||
UINT16 usBBIncreasedNeededDamageToFallDown;
|
UINT16 usBBIncreasedNeededDamageToFallDown;
|
||||||
|
|
||||||
// DEMOLITIONS
|
// DEMOLITIONS
|
||||||
UINT8 ubDEAPsNeededToThrowGrenadesReduction;
|
|
||||||
UINT8 ubDEMaxRangeToThrowGrenades;
|
|
||||||
UINT8 ubDECtHWhenThrowingGrenades;
|
|
||||||
UINT8 ubDEDamageOfBombsAndMines;
|
UINT8 ubDEDamageOfBombsAndMines;
|
||||||
UINT8 ubDEAttachDetonatorCheckBonus;
|
UINT8 ubDEAttachDetonatorCheckBonus;
|
||||||
UINT8 ubDEPlantAndRemoveBombCheckBonus;
|
UINT8 ubDEPlantAndRemoveBombCheckBonus;
|
||||||
@@ -23,6 +23,7 @@ extern CHAR16 zBuildInformation[256];
|
|||||||
// Keeps track of the saved game version. Increment the saved game version whenever
|
// Keeps track of the saved game version. Increment the saved game version whenever
|
||||||
// you will invalidate the saved game file
|
// you will invalidate the saved game file
|
||||||
|
|
||||||
|
#define GROWTH_MODIFIERS 184
|
||||||
#define REBELCOMMAND 183
|
#define REBELCOMMAND 183
|
||||||
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
|
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
|
||||||
#define DISABILITYFLAGMASK 181 // Flugente: disabilities get a flagmask
|
#define DISABILITYFLAGMASK 181 // Flugente: disabilities get a flagmask
|
||||||
@@ -104,7 +105,7 @@ extern CHAR16 zBuildInformation[256];
|
|||||||
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
|
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
|
||||||
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
|
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
|
||||||
|
|
||||||
#define SAVE_GAME_VERSION REBELCOMMAND
|
#define SAVE_GAME_VERSION GROWTH_MODIFIERS
|
||||||
|
|
||||||
//#define RUSSIANGOLD
|
//#define RUSSIANGOLD
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
+88
-117
@@ -35,7 +35,6 @@
|
|||||||
#include "tile cache.h"
|
#include "tile cache.h"
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "Map Information.h"
|
#include "Map Information.h"
|
||||||
#include "laptop.h"
|
|
||||||
#include "Shade Table Util.h"
|
#include "Shade Table Util.h"
|
||||||
#include "Exit Grids.h"
|
#include "Exit Grids.h"
|
||||||
#include "Summary Info.h"
|
#include "Summary Info.h"
|
||||||
@@ -51,6 +50,7 @@
|
|||||||
#include "Multilingual Text Code Generator.h"
|
#include "Multilingual Text Code Generator.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "Arms Dealer Init.h"
|
#include "Arms Dealer Init.h"
|
||||||
|
#include "Map Screen Interface Bottom.h"
|
||||||
#include "MPXmlTeams.hpp"
|
#include "MPXmlTeams.hpp"
|
||||||
#include "Strategic Mines LUA.h"
|
#include "Strategic Mines LUA.h"
|
||||||
#include "UndergroundInit.h"
|
#include "UndergroundInit.h"
|
||||||
@@ -76,7 +76,8 @@
|
|||||||
#include "AimArchives.h"
|
#include "AimArchives.h"
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes()
|
#include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes()
|
||||||
#include "Animation Data.h" // added by Flugente
|
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
|
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
|
||||||
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
|
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
|
||||||
@@ -134,34 +135,6 @@ static void AddLanguagePrefix(STR fileName, const STR language)
|
|||||||
memmove( fileComponent, language, strlen( language) );
|
memmove( fileComponent, language, strlen( language) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static const STR GetLanguagePrefix()
|
|
||||||
{
|
|
||||||
#ifdef ENGLISH
|
|
||||||
return "";
|
|
||||||
#endif
|
|
||||||
#ifdef GERMAN
|
|
||||||
return GERMAN_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef RUSSIAN
|
|
||||||
return RUSSIAN_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef DUTCH
|
|
||||||
return DUTCH_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef POLISH
|
|
||||||
return POLISH_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef FRENCH
|
|
||||||
return FRENCH_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef ITALIAN
|
|
||||||
return ITALIAN_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef CHINESE
|
|
||||||
return CHINESE_PREFIX;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void AddLanguagePrefix(STR fileName)
|
static void AddLanguagePrefix(STR fileName)
|
||||||
{
|
{
|
||||||
AddLanguagePrefix( fileName, GetLanguagePrefix());
|
AddLanguagePrefix( fileName, GetLanguagePrefix());
|
||||||
@@ -254,7 +227,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, AMMOFILENAME);
|
strcat(fileName, AMMOFILENAME);
|
||||||
|
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
|
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
@@ -268,9 +241,9 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, AMMOFILENAME);
|
strcat(fileName, AMMOFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
|
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
|
||||||
}
|
}
|
||||||
#else
|
} else {
|
||||||
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
|
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Lesh: added this, begin
|
// Lesh: added this, begin
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -294,14 +267,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
// the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags
|
// the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags
|
||||||
|
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
//if(!WriteItemStats())
|
//if(!WriteItemStats())
|
||||||
// return FALSE;
|
// return FALSE;
|
||||||
@@ -366,14 +339,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat( fileName, DISEASEFILENAME );
|
strcat( fileName, DISEASEFILENAME );
|
||||||
SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME );
|
SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME );
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME);
|
SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, STRUCTUREDECONSTRUCTFILENAME);
|
strcat(fileName, STRUCTUREDECONSTRUCTFILENAME);
|
||||||
@@ -411,14 +384,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, LOADSCREENHINTSFILENAME);
|
strcat(fileName, LOADSCREENHINTSFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
|
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, ARMOURSFILENAME);
|
strcat(fileName, ARMOURSFILENAME);
|
||||||
@@ -438,22 +411,24 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
if (isMultiplayer == false)
|
if (isMultiplayer == false)
|
||||||
{
|
{
|
||||||
using namespace LogicalBodyTypes;
|
using namespace LogicalBodyTypes;
|
||||||
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME), LBT_LAYERSFILENAME);
|
CHAR8 errorBuf[512]{"Failed loading LogicalBodyTypes external data!"};
|
||||||
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME), LBT_PALETTESFILENAME);
|
|
||||||
SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME), LBT_ANIMSURFACESFILENAME);
|
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME, errorBuf), errorBuf);
|
||||||
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME), LBT_FILTERSFILENAME);
|
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME, errorBuf), errorBuf);
|
||||||
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME), LBT_BODYTYPESFILENAME);
|
SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME, errorBuf), errorBuf);
|
||||||
|
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME, errorBuf), errorBuf);
|
||||||
|
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME, errorBuf), errorBuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// THE_BOB : added for pocket popup definitions
|
// THE_BOB : added for pocket popup definitions
|
||||||
LBEPocketPopup.clear();
|
LBEPocketPopup.clear();
|
||||||
@@ -461,7 +436,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, LBEPOCKETPOPUPFILENAME);
|
strcat(fileName, LBEPOCKETPOPUPFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
|
|
||||||
if (FileExists(fileName))
|
if (FileExists(fileName))
|
||||||
@@ -476,10 +451,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, LBEPOCKETPOPUPFILENAME);
|
strcat(fileName, LBEPOCKETPOPUPFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
||||||
}
|
}
|
||||||
#else
|
} else {
|
||||||
// WANNE: Load english file
|
// WANNE: Load english file
|
||||||
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
@@ -495,14 +470,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, MERCSTARTINGGEARFILENAME);
|
strcat(fileName, MERCSTARTINGGEARFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME);
|
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -519,14 +494,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, ATTACHMENTSLOTSFILENAME);
|
strcat(fileName, ATTACHMENTSLOTSFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME);
|
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls
|
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -700,14 +675,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, CITYTABLEFILENAME);
|
strcat(fileName, CITYTABLEFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
|
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp,
|
// Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp,
|
||||||
// function BOOLEAN InitStrategicMovementCosts();
|
// function BOOLEAN InitStrategicMovementCosts();
|
||||||
@@ -758,14 +733,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME);
|
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName);
|
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, DELIVERYMETHODSFILENAME);
|
strcat(fileName, DELIVERYMETHODSFILENAME);
|
||||||
@@ -778,14 +753,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME);
|
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// HEADROCK HAM 3.4: Read in facility locations
|
// HEADROCK HAM 3.4: Read in facility locations
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -799,14 +774,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME);
|
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName);
|
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// HEADROCK HAM 5: Read in Coolness by Sector
|
// HEADROCK HAM 5: Read in Coolness by Sector
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -828,7 +803,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
|
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -836,7 +811,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
if(!ReadInMercProfiles(fileName,TRUE))
|
if(!ReadInMercProfiles(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -854,14 +829,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME);
|
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data
|
// HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -924,14 +899,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME);
|
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -943,14 +918,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME);
|
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -960,14 +935,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
|
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
if (gGameExternalOptions.fEnemyRank == TRUE)
|
if (gGameExternalOptions.fEnemyRank == TRUE)
|
||||||
{
|
{
|
||||||
@@ -977,14 +952,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME);
|
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flugente: backgrounds
|
// Flugente: backgrounds
|
||||||
@@ -993,14 +968,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME);
|
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME);
|
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Flugente: individual militia
|
// Flugente: individual militia
|
||||||
strcpy( fileName, directoryName );
|
strcpy( fileName, directoryName );
|
||||||
@@ -1014,14 +989,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME);
|
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME);
|
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// WANNE: Only in a singleplayer game...
|
// WANNE: Only in a singleplayer game...
|
||||||
// Externalised taunts
|
// Externalised taunts
|
||||||
@@ -1042,14 +1017,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, FileInfo.zFileName);
|
strcat(fileName, FileInfo.zFileName);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
while( GetFileNext(&FileInfo) )
|
while( GetFileNext(&FileInfo) )
|
||||||
{
|
{
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1057,14 +1032,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, FileInfo.zFileName);
|
strcat(fileName, FileInfo.zFileName);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
GetFileClose(&FileInfo);
|
GetFileClose(&FileInfo);
|
||||||
}
|
}
|
||||||
@@ -1076,14 +1051,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
|
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// IMP Portraits List by Jazz
|
// IMP Portraits List by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1091,14 +1066,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS);
|
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
LoadIMPPortraitsTEMP( );
|
LoadIMPPortraitsTEMP( );
|
||||||
|
|
||||||
@@ -1183,14 +1158,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME);
|
SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME);
|
||||||
//WriteFaceGear();
|
//WriteFaceGear();
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
for(i=0; i<NUM_PROFILES; i++)
|
for(i=0; i<NUM_PROFILES; i++)
|
||||||
{
|
{
|
||||||
@@ -1204,14 +1179,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY);
|
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
//Main Menu by Jazz
|
//Main Menu by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1224,7 +1199,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
|
SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -1232,7 +1207,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
if(!ReadInActionItems(fileName,TRUE))
|
if(!ReadInActionItems(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
if ( ReadXMLEmail == TRUE )
|
if ( ReadXMLEmail == TRUE )
|
||||||
{
|
{
|
||||||
@@ -1242,7 +1217,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
|
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -1250,7 +1225,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
if(!ReadInEmailMercAvailable(fileName,TRUE))
|
if(!ReadInEmailMercAvailable(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// EMAIL MERC LEVEL UP by Jazz
|
// EMAIL MERC LEVEL UP by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1258,7 +1233,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
|
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -1266,7 +1241,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
if(!ReadInEmailMercLevelUp(fileName,TRUE))
|
if(!ReadInEmailMercLevelUp(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
// EMAIL OTHER by Jazz
|
// EMAIL OTHER by Jazz
|
||||||
@@ -1275,7 +1250,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
|
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -1283,7 +1258,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
if(!ReadInEmailOther(fileName,TRUE))
|
if(!ReadInEmailOther(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
*/
|
*/
|
||||||
//new vehicles by Jazz
|
//new vehicles by Jazz
|
||||||
|
|
||||||
@@ -1294,7 +1269,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
|
SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -1302,9 +1277,9 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
if(!ReadInNewVehicles(fileName,TRUE))
|
if(!ReadInNewVehicles(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -1312,7 +1287,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
|
if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_BRIEFINGROOM
|
#ifdef ENABLE_BRIEFINGROOM
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1320,14 +1295,14 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
|
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName);
|
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
||||||
|
|
||||||
@@ -1339,14 +1314,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME);
|
SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Old AIM Archive
|
// Old AIM Archive
|
||||||
UINT8 p;
|
UINT8 p;
|
||||||
@@ -1360,14 +1335,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME);
|
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
UINT8 emptyslotsinarchives = 0;
|
UINT8 emptyslotsinarchives = 0;
|
||||||
for (p=0;p<NUM_PROFILES;p++)
|
for (p=0;p<NUM_PROFILES;p++)
|
||||||
{
|
{
|
||||||
@@ -1417,14 +1392,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME);
|
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
|
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
|
||||||
g_luaUnderground.LoadScript(GetLanguagePrefix());
|
g_luaUnderground.LoadScript(GetLanguagePrefix());
|
||||||
@@ -1498,6 +1473,10 @@ UINT32 InitializeJA2(void)
|
|||||||
return( ERROR_SCREEN );
|
return( ERROR_SCREEN );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// InitRadarScreenCoords() depend on Mapscreen Interface Bottom coordinates -> need to initiate them first
|
||||||
|
// before calling InitTacticalEngine()
|
||||||
|
InitMapScreenInterfaceBottomCoords();
|
||||||
|
|
||||||
// Init tactical engine
|
// Init tactical engine
|
||||||
if ( !InitTacticalEngine( ) )
|
if ( !InitTacticalEngine( ) )
|
||||||
{
|
{
|
||||||
@@ -1514,12 +1493,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 +1671,6 @@ void ShutdownJA2(void)
|
|||||||
|
|
||||||
ShutdownJA2Sound( );
|
ShutdownJA2Sound( );
|
||||||
|
|
||||||
ShutdownEventManager( );
|
|
||||||
|
|
||||||
ShutdownBaseDirtyRectQueue( );
|
ShutdownBaseDirtyRectQueue( );
|
||||||
|
|
||||||
// Unload any text box images!
|
// Unload any text box images!
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#include "LuaInitNPCs.h"
|
#include "LuaInitNPCs.h"
|
||||||
#include "XML.h"
|
#include "XML.h"
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
BOOLEAN Style_JA = TRUE;
|
BOOLEAN Style_JA = TRUE;
|
||||||
extern INT8 Test = 0;
|
extern INT8 Test = 0;
|
||||||
@@ -726,11 +727,11 @@ void DisplaySirtechSplashScreen()
|
|||||||
* (2006-10-10, Sergeant_Kolja)
|
* (2006-10-10, Sergeant_Kolja)
|
||||||
*/
|
*/
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
# if defined(ENGLISH)
|
if( g_lang == i18n::Lang::en ) {
|
||||||
AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) );
|
AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) );
|
||||||
# elif defined(GERMAN)
|
} else if( g_lang == i18n::Lang::de ) {
|
||||||
AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) );
|
AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) );
|
||||||
# endif
|
}
|
||||||
#endif
|
#endif
|
||||||
AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) );
|
AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) );
|
||||||
return;
|
return;
|
||||||
@@ -12,13 +12,11 @@ void StopIntroVideo();
|
|||||||
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
|
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
|
||||||
enum EIntroType
|
enum EIntroType
|
||||||
{
|
{
|
||||||
#ifdef JA2UB
|
|
||||||
INTRO_HELI_CRASH,
|
|
||||||
#endif
|
|
||||||
INTRO_BEGINNING, //set when viewing the intro at the begining of the game
|
INTRO_BEGINNING, //set when viewing the intro at the begining of the game
|
||||||
INTRO_ENDING, //set when viewing the end game video.
|
INTRO_ENDING, //set when viewing the end game video.
|
||||||
|
|
||||||
INTRO_SPLASH,
|
INTRO_SPLASH,
|
||||||
|
// Unfinished Business
|
||||||
|
INTRO_HELI_CRASH
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "Timer Control.h"
|
#include "Timer Control.h"
|
||||||
#include "Multi Language Graphic Utils.h"
|
#include "Multi Language Graphic Utils.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
UINT32 guiSplashFrameFade = 10;
|
UINT32 guiSplashFrameFade = 10;
|
||||||
UINT32 guiSplashStartTime = 0;
|
UINT32 guiSplashStartTime = 0;
|
||||||
@@ -13,10 +14,10 @@ extern HVSURFACE ghFrameBuffer;
|
|||||||
//Simply create videosurface, load image, and draw it to the screen.
|
//Simply create videosurface, load image, and draw it to the screen.
|
||||||
void InitJA2SplashScreen()
|
void InitJA2SplashScreen()
|
||||||
{
|
{
|
||||||
#ifdef ENGLISH
|
if( g_lang == i18n::Lang::en ) {
|
||||||
ClearMainMenu();
|
ClearMainMenu();
|
||||||
|
|
||||||
#else
|
} else {
|
||||||
UINT32 uiLogoID = 0;
|
UINT32 uiLogoID = 0;
|
||||||
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
|
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
|
||||||
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
|
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
|
||||||
@@ -69,7 +70,7 @@ void InitJA2SplashScreen()
|
|||||||
GetVideoSurface( &hVSurface, uiLogoID );
|
GetVideoSurface( &hVSurface, uiLogoID );
|
||||||
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
|
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
|
||||||
DeleteVideoSurfaceFromIndex( uiLogoID );
|
DeleteVideoSurfaceFromIndex( uiLogoID );
|
||||||
#endif // ENGLISH
|
} // ENGLISH
|
||||||
|
|
||||||
InvalidateScreen();
|
InvalidateScreen();
|
||||||
RefreshScreen( NULL );
|
RefreshScreen( NULL );
|
||||||
@@ -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"
|
||||||
@@ -23,6 +23,7 @@ extern BOOLEAN gfSchedulesHosed;
|
|||||||
#include "Ja25 Strategic Ai.h"
|
#include "Ja25 Strategic Ai.h"
|
||||||
#endif
|
#endif
|
||||||
UINT8 gubLastLoadingScreenID = LOADINGSCREEN_NOTHING;
|
UINT8 gubLastLoadingScreenID = LOADINGSCREEN_NOTHING;
|
||||||
|
FLOAT fLoadingScreenAspectRatio;
|
||||||
//BOOLEAN bShowSmallImage = FALSE;
|
//BOOLEAN bShowSmallImage = FALSE;
|
||||||
SECTOR_LOADSCREENS gSectorLoadscreens[MAX_SECTOR_LOADSCREENS];
|
SECTOR_LOADSCREENS gSectorLoadscreens[MAX_SECTOR_LOADSCREENS];
|
||||||
|
|
||||||
@@ -343,6 +344,62 @@ static void BuildLoadscreenFilename(std::string& dst, const char* path, int reso
|
|||||||
dst.append(".sti");
|
dst.append(".sti");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetResolutionSuffix(SCREEN_RESOLUTION resolution)
|
||||||
|
{
|
||||||
|
switch (resolution)
|
||||||
|
{
|
||||||
|
case _960x540: return "_960x540";
|
||||||
|
case _800x600: return "_800x600";
|
||||||
|
case _1024x600: return "_1024x600";
|
||||||
|
case _1280x720: return "_1280x720";
|
||||||
|
case _1024x768: return "_1024x768";
|
||||||
|
case _1280x768: return "_1280x768";
|
||||||
|
case _1360x768: return "_1360x768";
|
||||||
|
case _1366x768: return "_1366x768";
|
||||||
|
case _1280x800: return "_1280x800";
|
||||||
|
case _1440x900: return "_1440x900";
|
||||||
|
case _1600x900: return "_1600x900";
|
||||||
|
case _1280x960: return "_1280x960";
|
||||||
|
case _1440x960: return "_1440x960";
|
||||||
|
case _1770x1000: return "_1770x1000";
|
||||||
|
case _1280x1024: return "_1280x1024";
|
||||||
|
case _1360x1024: return "_1360x1024";
|
||||||
|
case _1600x1024: return "_1600x1024";
|
||||||
|
case _1440x1050: return "_1440x1050";
|
||||||
|
case _1680x1050: return "_1680x1050";
|
||||||
|
case _1920x1080: return "_1920x1080";
|
||||||
|
case _1600x1200: return "_1600x1200";
|
||||||
|
case _1920x1200: return "_1920x1200";
|
||||||
|
case _2560x1440: return "_2560x1440";
|
||||||
|
case _2560x1600: return "_2560x1600";
|
||||||
|
default: return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string FindBestFittingLoadscreenFilename(const std::string& baseName, SCREEN_RESOLUTION resolution)
|
||||||
|
{
|
||||||
|
for (SCREEN_RESOLUTION res = resolution; res <= _2560x1600; res = (SCREEN_RESOLUTION)(res + 1))
|
||||||
|
{
|
||||||
|
std::string fileName = baseName + GetResolutionSuffix(res);
|
||||||
|
if (FileExists((CHAR8*)((fileName + ".png").c_str())))
|
||||||
|
{
|
||||||
|
return fileName + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FileExists((CHAR8*)((fileName + ".sti").c_str())))
|
||||||
|
{
|
||||||
|
return fileName + ".sti";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FileExists((CHAR8*)((baseName + ".png").c_str())))
|
||||||
|
{
|
||||||
|
return baseName + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
return baseName + ".sti";
|
||||||
|
}
|
||||||
|
|
||||||
//sets up the loadscreen with specified ID, and draws it to the FRAME_BUFFER,
|
//sets up the loadscreen with specified ID, and draws it to the FRAME_BUFFER,
|
||||||
//and refreshing the screen with it.
|
//and refreshing the screen with it.
|
||||||
void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
||||||
@@ -420,27 +477,8 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string strImage;
|
std::string strImage = FindBestFittingLoadscreenFilename(imagePath, (SCREEN_RESOLUTION)iResolution);
|
||||||
|
strImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile) - 1);
|
||||||
BuildLoadscreenFilename(strImage, imagePath.c_str(), 0, imageFormat.c_str());
|
|
||||||
strImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile)-1);
|
|
||||||
|
|
||||||
|
|
||||||
if ( !FileExists(vs_desc.ImageFile) )
|
|
||||||
{
|
|
||||||
std::string strImage;
|
|
||||||
BuildLoadscreenFilename(strImage, imagePath.c_str(), 0, "png");
|
|
||||||
strImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile) - 1);
|
|
||||||
|
|
||||||
if (!FileExists(vs_desc.ImageFile))
|
|
||||||
{
|
|
||||||
std::string strImage("LOADSCREENS\\");
|
|
||||||
|
|
||||||
BuildLoadscreenFilename(strImage, LoadScreenNames[1], 0, imageFormat.c_str());
|
|
||||||
|
|
||||||
strImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile) - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -476,16 +514,39 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
|||||||
//Blit the background image
|
//Blit the background image
|
||||||
GetVideoSurface(&hVSurface, uiLoadScreen);
|
GetVideoSurface(&hVSurface, uiLoadScreen);
|
||||||
|
|
||||||
// Stretch the background image
|
fLoadingScreenAspectRatio = (FLOAT)hVSurface->usWidth / (FLOAT)hVSurface->usHeight;
|
||||||
SrcRect.iLeft = 0;
|
FLOAT fScreenAspectRatio = (FLOAT)SCREEN_WIDTH / (FLOAT)SCREEN_HEIGHT;
|
||||||
SrcRect.iTop = 0;
|
|
||||||
SrcRect.iRight = hVSurface->usWidth;
|
|
||||||
SrcRect.iBottom = hVSurface->usHeight;
|
|
||||||
|
|
||||||
DstRect.iLeft = 0;
|
if (gGameExternalOptions.ubLoadscreenStretchMode == 1 ||
|
||||||
DstRect.iTop = 0;
|
(gGameExternalOptions.ubLoadscreenStretchMode == 2 && fLoadingScreenAspectRatio > fScreenAspectRatio))
|
||||||
DstRect.iRight = SCREEN_WIDTH;
|
{
|
||||||
DstRect.iBottom = SCREEN_HEIGHT;
|
// match height, preserve aspect ratio
|
||||||
|
INT32 iCalculatedWidth = (INT32)(SCREEN_HEIGHT * fLoadingScreenAspectRatio + 0.5f);
|
||||||
|
|
||||||
|
SrcRect.iLeft = 0;
|
||||||
|
SrcRect.iTop = 0;
|
||||||
|
SrcRect.iRight = hVSurface->usWidth;
|
||||||
|
SrcRect.iBottom = hVSurface->usHeight;
|
||||||
|
|
||||||
|
DstRect.iLeft = (SCREEN_WIDTH - iCalculatedWidth) / 2;
|
||||||
|
DstRect.iTop = 0;
|
||||||
|
DstRect.iRight = SCREEN_WIDTH - ((SCREEN_WIDTH - iCalculatedWidth) / 2);
|
||||||
|
DstRect.iBottom = SCREEN_HEIGHT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// vanilla (stretch to fit)
|
||||||
|
// Stretch the background image
|
||||||
|
SrcRect.iLeft = 0;
|
||||||
|
SrcRect.iTop = 0;
|
||||||
|
SrcRect.iRight = hVSurface->usWidth;
|
||||||
|
SrcRect.iBottom = hVSurface->usHeight;
|
||||||
|
|
||||||
|
DstRect.iLeft = 0;
|
||||||
|
DstRect.iTop = 0;
|
||||||
|
DstRect.iRight = SCREEN_WIDTH;
|
||||||
|
DstRect.iBottom = SCREEN_HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
BltStretchVideoSurface( FRAME_BUFFER, uiLoadScreen, 0, 0, 0, &SrcRect, &DstRect );
|
BltStretchVideoSurface( FRAME_BUFFER, uiLoadScreen, 0, 0, 0, &SrcRect, &DstRect );
|
||||||
|
|
||||||
@@ -84,6 +84,8 @@ enum
|
|||||||
//For use by the game loader, before it can possibly know the situation.
|
//For use by the game loader, before it can possibly know the situation.
|
||||||
extern UINT8 gubLastLoadingScreenID;
|
extern UINT8 gubLastLoadingScreenID;
|
||||||
|
|
||||||
|
extern FLOAT fLoadingScreenAspectRatio;
|
||||||
|
|
||||||
//returns the UINT8 ID for the specified sector.
|
//returns the UINT8 ID for the specified sector.
|
||||||
UINT8 GetLoadScreenID( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
|
UINT8 GetLoadScreenID( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
|
||||||
|
|
||||||
@@ -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() )
|
||||||
@@ -855,6 +853,9 @@ void RenderMainMenu()
|
|||||||
DrawTextToScreen( L"BLOCKFONTNARROW: ÄÀÁÂÇËÈÉÊÏÖÒÓÔÜÙÚÛäàáâçëèéêïöòóôüùúûÌÎìî"/*gzCopyrightText[ 0 ]*/, 0, 445, 640, BLOCKFONTNARROW, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen( L"BLOCKFONTNARROW: ÄÀÁÂÇËÈÉÊÏÖÒÓÔÜÙÚÛäàáâçëèéêïöòóôüùúûÌÎìî"/*gzCopyrightText[ 0 ]*/, 0, 445, 640, BLOCKFONTNARROW, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
DrawTextToScreen( L"FONT14HUMANIST: ÄÀÁÂÇËÈÉÊÏÖÒÓÔÜÙÚÛäàáâçëèéêïöòóôüùúûÌÎìî"/*gzCopyrightText[ 0 ]*/, 0, 465, 640, FONT14HUMANIST, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen( L"FONT14HUMANIST: ÄÀÁÂÇËÈÉÊÏÖÒÓÔÜÙÚÛäàáâçëèéêïöòóôüùúûÌÎìî"/*gzCopyrightText[ 0 ]*/, 0, 465, 640, FONT14HUMANIST, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
#else
|
#else
|
||||||
|
CHAR16 text[128];
|
||||||
|
swprintf(text, L"%s: %s %S %s", pMessageStrings[ MSG_VERSION ], zProductLabel, czVersionString, zBuildInformation );
|
||||||
|
DrawTextToScreen( text, 10, 10, SCREEN_WIDTH, TINYFONT1, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
DrawTextToScreen( gzCopyrightText[ 0 ], 0, SCREEN_HEIGHT - 20, SCREEN_WIDTH, FONT10ARIAL, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
DrawTextToScreen( gzCopyrightText[ 0 ], 0, SCREEN_HEIGHT - 20, SCREEN_WIDTH, FONT10ARIAL, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Interface Control.h"
|
#include "Interface Control.h"
|
||||||
#include "Message.h"
|
#include "Message.h"
|
||||||
#include "Language Defines.h"
|
|
||||||
#include "Multi Language Graphic Utils.h"
|
#include "Multi Language Graphic Utils.h"
|
||||||
#include "Map Information.h"
|
#include "Map Information.h"
|
||||||
#include "SmokeEffects.h"
|
#include "SmokeEffects.h"
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -138,7 +138,6 @@
|
|||||||
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
|
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
|
||||||
#include "Sys Globals.h"//dnl ch74 201013
|
#include "Sys Globals.h"//dnl ch74 201013
|
||||||
#include "Ambient Control.h" // added by Flugente for HandleNewSectorAmbience(...)
|
#include "Ambient Control.h" // added by Flugente for HandleNewSectorAmbience(...)
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Local Defines
|
// Local Defines
|
||||||
@@ -153,6 +152,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "LuaInitNPCs.h"
|
#include "LuaInitNPCs.h"
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
@@ -177,7 +177,11 @@ extern void initMapViewAndBorderCoordinates(void);
|
|||||||
UINT32 guiNumberOfMapTempFiles; //Test purposes
|
UINT32 guiNumberOfMapTempFiles; //Test purposes
|
||||||
UINT32 guiSizeOfTempFiles;
|
UINT32 guiSizeOfTempFiles;
|
||||||
CHAR gzNameOfMapTempFile[128];
|
CHAR gzNameOfMapTempFile[128];
|
||||||
|
#endif
|
||||||
|
|
||||||
//#define LOADSAVEGAME_LOGTIME 1
|
//#define LOADSAVEGAME_LOGTIME 1
|
||||||
|
#ifdef LOADSAVEGAME_LOGTIME
|
||||||
|
#include "TimeLogging.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern SOLDIERTYPE *gpSMCurrentMerc;
|
extern SOLDIERTYPE *gpSMCurrentMerc;
|
||||||
@@ -1294,7 +1298,16 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
|
|||||||
numBytesRead = ReadFieldByField( hFile, &this->bSex, sizeof(this->bSex), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField( hFile, &this->bSex, sizeof(this->bSex), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->bArmourAttractiveness, sizeof(this->bArmourAttractiveness), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField( hFile, &this->bArmourAttractiveness, sizeof(this->bArmourAttractiveness), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->ubMiscFlags2, sizeof(this->ubMiscFlags2), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField( hFile, &this->ubMiscFlags2, sizeof(this->ubMiscFlags2), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->bEvolution, sizeof(this->bEvolution), sizeof(INT8), numBytesRead);
|
if (guiCurrentSaveGameVersion < GROWTH_MODIFIERS)
|
||||||
|
{
|
||||||
|
numBytesRead = ReadFieldByField( hFile, &this->fRegresses, sizeof(this->fRegresses), sizeof(INT8), numBytesRead);
|
||||||
|
// convert old evolution to regresses boolean
|
||||||
|
this->fRegresses = this->fRegresses == 2 ? TRUE : FALSE; // 2 == CharacterEvolution::DEVOLVES
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
numBytesRead = ReadFieldByField( hFile, &this->fRegresses, sizeof(this->fRegresses), sizeof(INT8), numBytesRead);
|
||||||
|
}
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->ubMiscFlags, sizeof(this->ubMiscFlags), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField( hFile, &this->ubMiscFlags, sizeof(this->ubMiscFlags), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->bSexist, sizeof(this->bSexist), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField( hFile, &this->bSexist, sizeof(this->bSexist), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->bLearnToHate, sizeof(this->bLearnToHate), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField( hFile, &this->bLearnToHate, sizeof(this->bLearnToHate), sizeof(UINT8), numBytesRead);
|
||||||
@@ -1637,6 +1650,70 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rftr: growth modifiers
|
||||||
|
if (guiCurrentSaveGameVersion >= GROWTH_MODIFIERS)
|
||||||
|
{
|
||||||
|
if (!FileRead(hFile, &this->bGrowthModifierLife, sizeof(INT8), &uiNumBytesRead))
|
||||||
|
{
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierStrength, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierAgility, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierDexterity, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierWisdom, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierMarksmanship, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierExplosive, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierLeadership, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierMedical, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierMechanical, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileRead( hFile, &this->bGrowthModifierExpLevel, sizeof(INT8), &uiNumBytesRead) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// zero out growth modifiers for upgrading savegames
|
||||||
|
this->bGrowthModifierLife = 0;
|
||||||
|
this->bGrowthModifierStrength = 0;
|
||||||
|
this->bGrowthModifierAgility = 0;
|
||||||
|
this->bGrowthModifierDexterity = 0;
|
||||||
|
this->bGrowthModifierWisdom = 0;
|
||||||
|
this->bGrowthModifierMarksmanship = 0;
|
||||||
|
this->bGrowthModifierExplosive = 0;
|
||||||
|
this->bGrowthModifierLeadership = 0;
|
||||||
|
this->bGrowthModifierMedical = 0;
|
||||||
|
this->bGrowthModifierMechanical = 0;
|
||||||
|
this->bGrowthModifierExpLevel = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this->uiProfileChecksum != this->GetChecksum() )
|
if ( this->uiProfileChecksum != this->GetChecksum() )
|
||||||
@@ -1754,6 +1831,52 @@ BOOLEAN MERCPROFILESTRUCT::Save(HWFILE hFile)
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rftr: growth modifiers
|
||||||
|
if (!FileWrite(hFile, &this->bGrowthModifierLife, sizeof(INT8), &uiNumBytesWritten))
|
||||||
|
{
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierStrength, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierAgility, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierDexterity, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierWisdom, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierMarksmanship, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierExplosive, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierLeadership, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierMedical, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierMechanical, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
if ( !FileWrite( hFile, &this->bGrowthModifierExpLevel, sizeof(INT8), &uiNumBytesWritten) )
|
||||||
|
{
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3434,33 +3557,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() );
|
||||||
@@ -3469,7 +3565,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3497,14 +3592,8 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
alreadySaving = true;
|
alreadySaving = true;
|
||||||
|
|
||||||
#ifdef LOADSAVEGAME_LOGTIME
|
#ifdef LOADSAVEGAME_LOGTIME
|
||||||
// Flugente: log how long this takes
|
TimingLogInitialize("TimeLog_LoadSavedGame.txt");
|
||||||
clock_t starttime = clock();
|
|
||||||
clock_t t0;
|
|
||||||
clock_t t1 = starttime;
|
|
||||||
|
|
||||||
FILE* fp_timelog = fopen("LoadSavedGame_TimeLog.txt", "a");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//clear out the save game header
|
//clear out the save game header
|
||||||
memset( &SaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) );
|
memset( &SaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) );
|
||||||
|
|
||||||
@@ -3684,14 +3773,9 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
//Create the name of the file
|
//Create the name of the file
|
||||||
CreateSavedGameFileNameFromNumber( ubSaveGameID, zSaveGameName );
|
CreateSavedGameFileNameFromNumber( ubSaveGameID, zSaveGameName );
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLogWrite("Save ");
|
||||||
{
|
TimingLogWrite(zSaveGameName);
|
||||||
fprintf(fp_timelog, "Save savegame: %s\n", zSaveGameName);
|
TimingLog("\nShutdown stuff", 10);
|
||||||
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "Shutdown stuff\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//if the file already exists, delete it
|
//if the file already exists, delete it
|
||||||
@@ -3828,12 +3912,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
SaveGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
|
SaveGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
|
||||||
#endif
|
#endif
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("SaveTacticalStatusToSavedGame", 6);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "SaveTacticalStatusFromSavedGame done\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -3875,12 +3954,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
SaveGameFilePosition( FileGetPos( hFile ), "Laptop Info" );
|
SaveGameFilePosition( FileGetPos( hFile ), "Laptop Info" );
|
||||||
#endif
|
#endif
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("SaveLaptopInfoToSavedGame", 7);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "SaveLaptopInfoFromSavedGame done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -3912,12 +3986,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
SaveGameFilePosition( FileGetPos( hFile ), "Soldier Structure" );
|
SaveGameFilePosition( FileGetPos( hFile ), "Soldier Structure" );
|
||||||
#endif
|
#endif
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("SaveSoldierStructure", 8);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "SaveSoldierStructure done\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -3980,12 +4049,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Information" );
|
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Information" );
|
||||||
#endif
|
#endif
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("SaveStrategicInfoToSavedFile", 6);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "SaveStrategicInfoFromSavedFile done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*// Flugente: Save the strategic supply
|
/*// Flugente: Save the strategic supply
|
||||||
@@ -4035,12 +4099,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Movement Groups" );
|
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Movement Groups" );
|
||||||
#endif
|
#endif
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("SaveStrategicMovementGroupsToSaveGameFile", 3);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "SaveStrategicMovementGroupsFromSavedGameFile done\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -4057,12 +4116,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
SaveGameFilePosition( FileGetPos( hFile ), "All the Map Temp files" );
|
SaveGameFilePosition( FileGetPos( hFile ), "All the Map Temp files" );
|
||||||
#endif
|
#endif
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("SaveMapTempFilesToSavedGameFile", 6);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "SaveMapTempFilesFromSavedGameFile done\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( !SaveQuestInfoToSavedGameFile( hFile ) )
|
if( !SaveQuestInfoToSavedGameFile( hFile ) )
|
||||||
@@ -4228,12 +4282,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
SaveGameFilePosition( FileGetPos( hFile ), "Militia Movement" );
|
SaveGameFilePosition( FileGetPos( hFile ), "Militia Movement" );
|
||||||
#endif
|
#endif
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("SaveMilitiaMovementInformationToSaveGameFile", 2);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "SaveMilitiaMovementInformationFromSavedGameFile done\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( !SaveBulletStructureToSaveGameFile( hFile ) )
|
if( !SaveBulletStructureToSaveGameFile( hFile ) )
|
||||||
@@ -4473,12 +4522,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
SaveGameFilePosition( FileGetPos( hFile ), "Lua global" );
|
SaveGameFilePosition( FileGetPos( hFile ), "Lua global" );
|
||||||
#endif
|
#endif
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("SaveLuaGlobalToSaveGameFile", 7);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "SaveLuaGlobalFromLoadGameFile done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( !SaveDataSaveToSaveGameFile( hFile ) )
|
if( !SaveDataSaveToSaveGameFile( hFile ) )
|
||||||
@@ -4578,12 +4622,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
goto FAILED_TO_SAVE;
|
goto FAILED_TO_SAVE;
|
||||||
}
|
}
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("File read done", 10);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "File read done\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Close the saved game file
|
//Close the saved game file
|
||||||
@@ -4664,22 +4703,9 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
alreadySaving = false;
|
alreadySaving = false;
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if (fp_timelog)
|
TimingLog("Update functions", 9);
|
||||||
{
|
TimingLogTotalTime("SaveSavedGame total", 9);
|
||||||
t0 = t1;
|
TimingLogStop();
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "Update functions\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fp_timelog)
|
|
||||||
{
|
|
||||||
t0 = starttime;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf(fp_timelog, "SaveSavedGame total\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fp_timelog)
|
|
||||||
fclose(fp_timelog);
|
|
||||||
#endif
|
#endif
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
|
|
||||||
@@ -4689,6 +4715,9 @@ FAILED_TO_SAVE:
|
|||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
SaveGameFilePosition( FileGetPos( hFile ), "Failed to Save!!!" );
|
SaveGameFilePosition( FileGetPos( hFile ), "Failed to Save!!!" );
|
||||||
#endif
|
#endif
|
||||||
|
#if LOADSAVEGAME_LOGTIME
|
||||||
|
TimingLogStop();
|
||||||
|
#endif
|
||||||
|
|
||||||
FileClose( hFile );
|
FileClose( hFile );
|
||||||
|
|
||||||
@@ -4734,8 +4763,6 @@ extern int gEnemyPreservedTempFileVersion[256];
|
|||||||
extern int gCivPreservedTempFileVersion[256];
|
extern int gCivPreservedTempFileVersion[256];
|
||||||
|
|
||||||
|
|
||||||
#include "time.h"
|
|
||||||
|
|
||||||
BOOLEAN LoadSavedGame( int ubSavedGameID )
|
BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||||
{
|
{
|
||||||
HWFILE hFile;
|
HWFILE hFile;
|
||||||
@@ -4754,12 +4781,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LOADSAVEGAME_LOGTIME
|
#ifdef LOADSAVEGAME_LOGTIME
|
||||||
// Flugente: log how long this takes
|
TimingLogInitialize("TimeLog_LoadSavedGame.txt");
|
||||||
clock_t starttime = clock();
|
|
||||||
clock_t t0;
|
|
||||||
clock_t t1 = starttime;
|
|
||||||
|
|
||||||
FILE *fp_timelog = fopen( "LoadSavedGame_TimeLog.txt", "a" );
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uiRelStartPerc = uiRelEndPerc =0;
|
uiRelStartPerc = uiRelEndPerc =0;
|
||||||
@@ -4842,14 +4864,9 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
CreateSavedGameFileNameFromNumber( ubSavedGameID, zSaveGameName );
|
CreateSavedGameFileNameFromNumber( ubSavedGameID, zSaveGameName );
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLogWrite("Load ");
|
||||||
{
|
TimingLogWrite(zSaveGameName);
|
||||||
fprintf( fp_timelog, "Load savegame: %s\n", zSaveGameName );
|
TimingLog("\nShutdown stuff", 10);
|
||||||
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "Shutdown stuff\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// open the save game file
|
// open the save game file
|
||||||
@@ -4970,19 +4987,14 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
LoadGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
|
LoadGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
|
||||||
#endif
|
#endif
|
||||||
|
#if LOADSAVEGAME_LOGTIME
|
||||||
|
TimingLog("LoadTacticalStatusFromSavedGame", 6);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//This gets reset by the above function
|
//This gets reset by the above function
|
||||||
gTacticalStatus.uiFlags |= LOADING_SAVED_GAME;
|
gTacticalStatus.uiFlags |= LOADING_SAVED_GAME;
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
|
||||||
if ( fp_timelog )
|
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "LoadTacticalStatusFromSavedGame done\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//Load the game clock ingo
|
//Load the game clock ingo
|
||||||
if( !LoadGameClock( hFile ) )
|
if( !LoadGameClock( hFile ) )
|
||||||
@@ -5103,12 +5115,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLog("LoadLaptopInfoFromSavedGame", 7);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "LoadLaptopInfoFromSavedGame done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uiRelEndPerc += 0;
|
uiRelEndPerc += 0;
|
||||||
@@ -5151,12 +5158,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLog("LoadSoldierStructure", 8);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "LoadSoldierStructure done\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uiRelEndPerc += 1;
|
uiRelEndPerc += 1;
|
||||||
@@ -5285,12 +5287,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLog("LoadStrategicInfoFromSavedFile", 6);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "LoadStrategicInfoFromSavedFile done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uiRelEndPerc += 1;
|
uiRelEndPerc += 1;
|
||||||
@@ -5351,12 +5348,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
ValidateStrategicGroups();
|
ValidateStrategicGroups();
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLog("LoadStrategicMovementGroupsFromSavedGameFile", 2);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "LoadStrategicMovementGroupsFromSavedGameFile done\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uiRelEndPerc += 30;
|
uiRelEndPerc += 30;
|
||||||
@@ -5376,12 +5368,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLog("LoadMapTempFilesFromSavedGameFile", 5);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "LoadMapTempFilesFromSavedGameFile done\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uiRelEndPerc += 1;
|
uiRelEndPerc += 1;
|
||||||
@@ -5680,12 +5667,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLog("LoadMilitiaMovementInformationFromSavedGameFile", 2);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "LoadMilitiaMovementInformationFromSavedGameFile done\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uiRelEndPerc += 1;
|
uiRelEndPerc += 1;
|
||||||
@@ -6245,12 +6227,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLog("LoadLuaGlobalFromLoadGameFile", 6);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "LoadLuaGlobalFromLoadGameFile done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE)
|
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE)
|
||||||
@@ -6482,12 +6459,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLog("File read done", 10);
|
||||||
{
|
|
||||||
t0 = t1;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "File read done\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -6694,15 +6666,6 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
//Reset the Ai Timer clock
|
//Reset the Ai Timer clock
|
||||||
giRTAILastUpdateTime = 0;
|
giRTAILastUpdateTime = 0;
|
||||||
|
|
||||||
//if we are in tactical
|
|
||||||
if( guiScreenToGotoAfterLoadingSavedGame == GAME_SCREEN )
|
|
||||||
{
|
|
||||||
//Initialize the current panel
|
|
||||||
InitializeCurrentPanel( );
|
|
||||||
|
|
||||||
SelectSoldier( gusSelectedSoldier, FALSE, TRUE );
|
|
||||||
}
|
|
||||||
|
|
||||||
uiRelEndPerc += 1;
|
uiRelEndPerc += 1;
|
||||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Final Checks..." );
|
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Final Checks..." );
|
||||||
RenderProgressBar( 0, 100 );
|
RenderProgressBar( 0, 100 );
|
||||||
@@ -6831,6 +6794,15 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
|
|
||||||
RemoveLoadingScreenProgressBar();
|
RemoveLoadingScreenProgressBar();
|
||||||
|
|
||||||
|
//if we are in tactical
|
||||||
|
if (guiScreenToGotoAfterLoadingSavedGame == GAME_SCREEN)
|
||||||
|
{
|
||||||
|
//Initialize the current panel
|
||||||
|
InitializeCurrentPanel();
|
||||||
|
|
||||||
|
SelectSoldier(gusSelectedSoldier, FALSE, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
// sevenfm: reset sound map
|
// sevenfm: reset sound map
|
||||||
ResetSoundMap();
|
ResetSoundMap();
|
||||||
|
|
||||||
@@ -6932,22 +6904,9 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
gGameExternalOptions.gfAllowReinforcements = zDiffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements;
|
gGameExternalOptions.gfAllowReinforcements = zDiffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements;
|
||||||
|
|
||||||
#if LOADSAVEGAME_LOGTIME
|
#if LOADSAVEGAME_LOGTIME
|
||||||
if ( fp_timelog )
|
TimingLog("Update functions", 9);
|
||||||
{
|
TimingLogTotalTime("LoadSavedGame total", 9);
|
||||||
t0 = t1;
|
TimingLogStop();
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "Update functions\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( fp_timelog )
|
|
||||||
{
|
|
||||||
t0 = starttime;
|
|
||||||
t1 = clock();
|
|
||||||
fprintf( fp_timelog, "LoadSavedGame total\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( fp_timelog )
|
|
||||||
fclose( fp_timelog );
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DebugQuestInfo("\n--------- Game loaded ---------");
|
DebugQuestInfo("\n--------- Game loaded ---------");
|
||||||
@@ -7247,7 +7206,7 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GERMAN
|
if( g_lang == i18n::Lang::de ) {
|
||||||
// Fix neutral flags
|
// Fix neutral flags
|
||||||
if ( guiCurrentSaveGameVersion < 94 )
|
if ( guiCurrentSaveGameVersion < 94 )
|
||||||
{
|
{
|
||||||
@@ -7257,7 +7216,7 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile )
|
|||||||
Menptr[ cnt].aiData.bNeutral = FALSE;
|
Menptr[ cnt].aiData.bNeutral = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
//#ifdef JA2UB
|
//#ifdef JA2UB
|
||||||
//if the soldier has the NON weapon version of the merc knofe or merc umbrella
|
//if the soldier has the NON weapon version of the merc knofe or merc umbrella
|
||||||
//ConvertWeapons( &Menptr[ cnt ] );
|
//ConvertWeapons( &Menptr[ cnt ] );
|
||||||
@@ -9592,21 +9551,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 )
|
||||||
@@ -9870,69 +9814,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()
|
||||||
{
|
{
|
||||||
@@ -10016,9 +9897,9 @@ UINT32 CalcJA2EncryptionSet( SAVED_GAME_HEADER * pSaveGameHeader )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GERMAN
|
if( g_lang == i18n::Lang::de ) {
|
||||||
uiEncryptionSet *= 11;
|
uiEncryptionSet *= 11;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
uiEncryptionSet = uiEncryptionSet % 10;
|
uiEncryptionSet = uiEncryptionSet % 10;
|
||||||
|
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
#include "TimeLogging.h"
|
||||||
|
#include "time.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
clock_t starttime;
|
||||||
|
clock_t t0;
|
||||||
|
clock_t t1;
|
||||||
|
FILE* fp_timelog = nullptr;
|
||||||
|
|
||||||
|
|
||||||
|
static void indent(int n)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < n; i++)
|
||||||
|
fputc('\t', fp_timelog);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TimingLogInitialize(const CHAR8* filename)
|
||||||
|
{
|
||||||
|
starttime = clock();
|
||||||
|
t1 = starttime;
|
||||||
|
|
||||||
|
if (!fp_timelog)
|
||||||
|
{
|
||||||
|
fp_timelog = fopen(filename, "a");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TimingLog(const CHAR8* logEvent, int n)
|
||||||
|
{
|
||||||
|
if (fp_timelog)
|
||||||
|
{
|
||||||
|
t0 = t1;
|
||||||
|
t1 = clock();
|
||||||
|
fprintf(fp_timelog, "%s", logEvent);
|
||||||
|
indent(n);
|
||||||
|
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TimingLogTotalTime(const CHAR8* logEvent, int n)
|
||||||
|
{
|
||||||
|
if (fp_timelog)
|
||||||
|
{
|
||||||
|
t1 = clock();
|
||||||
|
fprintf(fp_timelog, "%s", logEvent);
|
||||||
|
indent(n);
|
||||||
|
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - starttime) / CLOCKS_PER_SEC));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TimingLogWrite(const CHAR8* text)
|
||||||
|
{
|
||||||
|
if (fp_timelog)
|
||||||
|
{
|
||||||
|
fprintf(fp_timelog, text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TimingLogStop()
|
||||||
|
{
|
||||||
|
if (fp_timelog)
|
||||||
|
{
|
||||||
|
fprintf(fp_timelog, "\n");
|
||||||
|
fclose(fp_timelog);
|
||||||
|
fp_timelog = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Types.h"
|
||||||
|
|
||||||
|
void TimingLogInitialize(const CHAR8* filename);
|
||||||
|
void TimingLog(const CHAR8* logEvent, int n);
|
||||||
|
void TimingLogTotalTime(const CHAR8* logEvent, int n);
|
||||||
|
void TimingLogWrite(const CHAR8* text);
|
||||||
|
void TimingLogStop();
|
||||||
@@ -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"
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
#ifndef _BUILDDEFINES_H
|
#ifndef _BUILDDEFINES_H
|
||||||
#define _BUILDDEFINES_H
|
#define _BUILDDEFINES_H
|
||||||
|
|
||||||
#include "Language Defines.h"
|
|
||||||
|
|
||||||
//----- Briefing Room (Mission based JA2 like in JA/DG) - by Jazz -----
|
//----- Briefing Room (Mission based JA2 like in JA/DG) - by Jazz -----
|
||||||
// Once enabled here and also enabled in the ja2_options.ini (BRIEFING_ROOM),
|
// Once enabled here and also enabled in the ja2_options.ini (BRIEFING_ROOM),
|
||||||
// you can access the briefing room feature from the laptop
|
// you can access the briefing room feature from the laptop
|
||||||
@@ -166,6 +166,7 @@ UINT32 MainGameScreenInit(void)
|
|||||||
UnLockVideoSurface( FRAME_BUFFER);
|
UnLockVideoSurface( FRAME_BUFFER);
|
||||||
|
|
||||||
InitializeBackgroundRects();
|
InitializeBackgroundRects();
|
||||||
|
InitializeBaseDirtyRectQueue();
|
||||||
|
|
||||||
//EnvSetTimeInHours(ENV_TIME_12);
|
//EnvSetTimeInHours(ENV_TIME_12);
|
||||||
|
|
||||||
@@ -188,8 +189,8 @@ UINT32 MainGameScreenInit(void)
|
|||||||
giFPSOverlay = RegisterVideoOverlay( ( VOVERLAY_STARTDISABLED | VOVERLAY_DIRTYBYTEXT ), &VideoOverlayDesc );
|
giFPSOverlay = RegisterVideoOverlay( ( VOVERLAY_STARTDISABLED | VOVERLAY_DIRTYBYTEXT ), &VideoOverlayDesc );
|
||||||
|
|
||||||
// SECOND, PERIOD COUNTER
|
// SECOND, PERIOD COUNTER
|
||||||
VideoOverlayDesc.sLeft = 30;
|
VideoOverlayDesc.sLeft = 0;
|
||||||
VideoOverlayDesc.sTop = 0;
|
VideoOverlayDesc.sTop = 12;
|
||||||
VideoOverlayDesc.sX = VideoOverlayDesc.sLeft;
|
VideoOverlayDesc.sX = VideoOverlayDesc.sLeft;
|
||||||
VideoOverlayDesc.sY = VideoOverlayDesc.sTop;
|
VideoOverlayDesc.sY = VideoOverlayDesc.sTop;
|
||||||
swprintf( VideoOverlayDesc.pzText, L"Levelnodes: 100000" );
|
swprintf( VideoOverlayDesc.pzText, L"Levelnodes: 100000" );
|
||||||
@@ -627,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;
|
||||||
@@ -45,10 +45,10 @@
|
|||||||
#include "Sound Control.h"
|
#include "Sound Control.h"
|
||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "text.h"
|
#include "text.h"
|
||||||
#include "Language Defines.h"
|
|
||||||
#include "IniReader.h"
|
#include "IniReader.h"
|
||||||
|
|
||||||
#include "sgp_logger.h"
|
#include "sgp_logger.h"
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
#define _UNICODE
|
#define _UNICODE
|
||||||
// Networking Stuff
|
// Networking Stuff
|
||||||
@@ -122,46 +122,33 @@ void DisplayFrameRate( )
|
|||||||
uiFrameCount = 0;
|
uiFrameCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create string
|
|
||||||
SetFont( SMALLFONT1 );
|
|
||||||
|
|
||||||
//DebugMsg(TOPIC_JA2, DBG_LEVEL_0, String( "FPS: %d ", __min( uiFPS, 1000 ) ) );
|
|
||||||
|
|
||||||
if ( uiFPS < 20 )
|
|
||||||
{
|
|
||||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
|
||||||
SetFontForeground( FONT_MCOLOR_LTRED );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
|
||||||
SetFontForeground( FONT_MCOLOR_DKGRAY );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( gbFPSDisplay == SHOW_FULL_FPS )
|
if ( gbFPSDisplay == SHOW_FULL_FPS )
|
||||||
{
|
{
|
||||||
|
memset(&VideoOverlayDesc, 0, sizeof(VideoOverlayDesc));
|
||||||
|
|
||||||
// FRAME RATE
|
// FRAME RATE
|
||||||
memset( &VideoOverlayDesc, 0, sizeof( VideoOverlayDesc ) );
|
VideoOverlayDesc.uiFontID = SMALLFONT1;
|
||||||
swprintf( VideoOverlayDesc.pzText, L"%ld", __min( uiFPS, 1000 ) );
|
VideoOverlayDesc.ubFontBack = FONT_MCOLOR_BLACK;
|
||||||
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_TEXT;
|
VideoOverlayDesc.ubFontFore = uiFPS < 20 ? FONT_MCOLOR_LTRED : FONT_MCOLOR_DKGRAY;
|
||||||
|
swprintf( VideoOverlayDesc.pzText, L"FPS: %ld", __min( uiFPS, 1000 ) );
|
||||||
|
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_TEXT | VOVERLAY_DESC_FONT | VOVERLAY_DESC_DISABLED;
|
||||||
UpdateVideoOverlay( &VideoOverlayDesc, giFPSOverlay, FALSE );
|
UpdateVideoOverlay( &VideoOverlayDesc, giFPSOverlay, FALSE );
|
||||||
|
|
||||||
// TIMER COUNTER
|
// TIMER COUNTER
|
||||||
swprintf( VideoOverlayDesc.pzText, L"%ld", __min( giTimerDiag, 1000 ) );
|
swprintf( VideoOverlayDesc.pzText, L"Frame: %04ld ms", __min( giTimerDiag, 10000 ) );
|
||||||
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_TEXT;
|
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_TEXT | VOVERLAY_DESC_DISABLED;
|
||||||
UpdateVideoOverlay( &VideoOverlayDesc, giCounterPeriodOverlay, FALSE );
|
UpdateVideoOverlay( &VideoOverlayDesc, giCounterPeriodOverlay, FALSE );
|
||||||
|
|
||||||
|
//if( GetMouseMapPos( &usMapPos) )
|
||||||
if( GetMouseMapPos( &usMapPos) )
|
//{
|
||||||
{
|
|
||||||
//gprintfdirty( 0, 315, L"(%d)",sMapPos);
|
//gprintfdirty( 0, 315, L"(%d)",sMapPos);
|
||||||
//mprintf( 0,315,L"(%d)",sMapPos);
|
//mprintf( 0,315,L"(%d)",sMapPos);
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
//gprintfdirty( 0, 315, L"(%d %d)",gusMouseXPos, gusMouseYPos - INTERFACE_START_Y );
|
//gprintfdirty( 0, 315, L"(%d %d)",gusMouseXPos, gusMouseYPos - INTERFACE_START_Y );
|
||||||
//mprintf( 0,315,L"(%d %d)",gusMouseXPos, gusMouseYPos - INTERFACE_START_Y );
|
//mprintf( 0,315,L"(%d %d)",gusMouseXPos, gusMouseYPos - INTERFACE_START_Y );
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ( gTacticalStatus.uiFlags & GODMODE ) )
|
if ( ( gTacticalStatus.uiFlags & GODMODE ) )
|
||||||
@@ -345,7 +332,7 @@ UINT32 InitScreenHandle(void)
|
|||||||
|
|
||||||
if ( ubCurrentScreen == 255 )
|
if ( ubCurrentScreen == 255 )
|
||||||
{
|
{
|
||||||
#ifdef ENGLISH
|
if( g_lang == i18n::Lang::en ) {
|
||||||
if( gfDoneWithSplashScreen )
|
if( gfDoneWithSplashScreen )
|
||||||
{
|
{
|
||||||
ubCurrentScreen = 0;
|
ubCurrentScreen = 0;
|
||||||
@@ -355,9 +342,9 @@ UINT32 InitScreenHandle(void)
|
|||||||
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
|
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
|
||||||
return( INTRO_SCREEN );
|
return( INTRO_SCREEN );
|
||||||
}
|
}
|
||||||
#else
|
} else {
|
||||||
ubCurrentScreen = 0;
|
ubCurrentScreen = 0;
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ubCurrentScreen == 0 )
|
if ( ubCurrentScreen == 0 )
|
||||||
@@ -409,48 +396,28 @@ 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"ERROR_REPORT.iniErrorMessages.txt", false, sgp::Logger::FLUSH_ON_DELETE);
|
sgp::Logger::instance().connectFile(ini_id, L"iniErrorReport.log", 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, "..\\ERROR_REPORT.iniErrorMessages.txt", "w" );
|
|
||||||
#endif
|
|
||||||
y += 25;
|
y += 25;
|
||||||
swprintf( str, L"%S", "ERROR_REPORT.iniErrorMessages.txt has been created. Please review its content." );
|
swprintf( str, L"%S", "Warning: found the following ini errors. iniErrorReport.log has been created." );
|
||||||
DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_RED, 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, "..\\ERROR_REPORT.iniErrorMessages.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_RED, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED );
|
|
||||||
iniErrorMessages.pop();
|
|
||||||
|
|
||||||
if (iniErrorMessages.empty()) {for(int x=0 ; x <= 65535*2 ; x++);}
|
iniErrorMessages.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
InvalidateScreen( );
|
InvalidateScreen( );
|
||||||
@@ -992,7 +959,6 @@ void DoneFadeOutForDemoExitScreen( void )
|
|||||||
// unused
|
// unused
|
||||||
//extern INT8 gbFadeSpeed;
|
//extern INT8 gbFadeSpeed;
|
||||||
|
|
||||||
#ifdef GERMAN
|
|
||||||
void DisplayTopwareGermanyAddress()
|
void DisplayTopwareGermanyAddress()
|
||||||
{
|
{
|
||||||
VOBJECT_DESC vo_desc;
|
VOBJECT_DESC vo_desc;
|
||||||
@@ -1027,7 +993,6 @@ void DisplayTopwareGermanyAddress()
|
|||||||
ExecuteBaseDirtyRectQueue();
|
ExecuteBaseDirtyRectQueue();
|
||||||
EndFrameBufferRender();
|
EndFrameBufferRender();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
UINT32 DemoExitScreenHandle(void)
|
UINT32 DemoExitScreenHandle(void)
|
||||||
{
|
{
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#include "Language Defines.h"
|
|
||||||
|
|
||||||
#if defined(ENGLISH)
|
|
||||||
# pragma message(" (Language set to ENGLISH, You'll need english CDs)")
|
|
||||||
#elif defined(GERMAN)
|
|
||||||
# pragma message(" (Language set to GERMAN, You'll need Topware/german CDs)")
|
|
||||||
#elif defined(RUSSIAN)
|
|
||||||
# pragma message(" (Language set to RUSSIAN, You'll need russian CDs)")
|
|
||||||
#elif defined(DUTCH)
|
|
||||||
# pragma message(" (Language set to DUTCH, You'll need dutch CDs)")
|
|
||||||
#elif defined(POLISH)
|
|
||||||
# pragma message(" (Language set to POLISH, You'll need polish CDs)")
|
|
||||||
#elif defined(FRENCH)
|
|
||||||
# pragma message(" (Language set to FRENCH, You'll need french CDs)")
|
|
||||||
#elif defined(ITALIAN)
|
|
||||||
# pragma message(" (Language set to ITALIAN, You'll need italian CDs)")
|
|
||||||
#elif defined(CHINESE)
|
|
||||||
# pragma message(" (Language set to CHINESE, You'll need chinese CDs)")
|
|
||||||
#else
|
|
||||||
# error "At least You have to specify a Language somewhere. See comments above."
|
|
||||||
#endif
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
#ifndef __LANGUAGE_DEFINES_H
|
|
||||||
#define __LANGUAGE_DEFINES_H
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
/* ============================================================================
|
|
||||||
* ONLY ONE OF THESE LANGUAGES CAN BE DEFINED AT A TIME!
|
|
||||||
* BUT now You can define it _here_ by uncommenting one _or_ (better):
|
|
||||||
* You can comment them all out and then set it _global_ in "Preprocessor
|
|
||||||
* options" (do it for ALL projects in the workspace and both debug & release)
|
|
||||||
* _or_
|
|
||||||
* give it do Your MAKEFILE, f.i. make ENGLISH, but keep in mind that some
|
|
||||||
* weird make tools will require 'make ENGLISH=1' instead
|
|
||||||
*
|
|
||||||
* using one of the two later methods will keep this SVN file unchanged for the
|
|
||||||
* future, only Your private project files (workspace/solution) will differ
|
|
||||||
* from the SVN stuff.
|
|
||||||
* (2006-10-10, Sergeant_Kolja)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* The recommend approach for VS2010 multi-language builds is to use the command line or the ja2.props file.
|
|
||||||
|
|
||||||
By default the language is ENGLISH and the Language Prefix is EN.
|
|
||||||
|
|
||||||
There are 3 ways you can build the JA2 1.13 executable file:
|
|
||||||
|
|
||||||
// -------------------------------------------------------
|
|
||||||
// 1. Using the command line
|
|
||||||
// -------------------------------------------------------
|
|
||||||
|
|
||||||
For example, where msbuild is located in %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ if not on your path
|
|
||||||
msbuild.exe /p:Configuration=Release ja2_VS2010.sln
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=PL /p:JA2Language=POLISH ja2_VS2010.sln
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN ja2_VS2010.sln
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=RU /p:JA2Language=RUSSIAN ja2_VS2010.sln
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=NL /p:JA2Language=DUTCH ja2_VS2010.sln
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=FR /p:JA2Language=FRENCH ja2_VS2010.sln
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=IT /p:JA2Language=ITALIAN ja2_VS2010.sln
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=CN /p:JA2Language=CHINESE ja2_VS2010.sln
|
|
||||||
|
|
||||||
Note: If you want to build "Unfinished Business" version, just append the /p:JA2Config=JA2UB in the command line
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2Config=JA2UB ja2_VS2010.sln
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB ja2_VS2010.sln
|
|
||||||
|
|
||||||
Note2: You can also specify the target output name with the parameter /p:TargetName
|
|
||||||
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB /p:TargetName="JA2UB_113" ja2_VS2010.sln
|
|
||||||
|
|
||||||
// --------------------------------------------------------
|
|
||||||
// 2. Editing the ja2.props file and then build in VS 2010
|
|
||||||
// -------------------------------------------------------
|
|
||||||
|
|
||||||
1. Open the "ja2.props" file in a text editor and set the <BuildMacro> tags to your likeing.
|
|
||||||
|
|
||||||
For example: If you want to build Russian Version (normal JA2, not UB) then set the following:
|
|
||||||
|
|
||||||
<BuildMacro Include="JA2Config">
|
|
||||||
<Value></Value>
|
|
||||||
</BuildMacro>
|
|
||||||
<BuildMacro Include="JA2LangPrefix">
|
|
||||||
<Value>RU</Value>
|
|
||||||
</BuildMacro>
|
|
||||||
<BuildMacro Include="JA2Language">
|
|
||||||
<Value>RUSSIAN</Value>
|
|
||||||
</BuildMacro>
|
|
||||||
|
|
||||||
2. Save the file
|
|
||||||
3. Build the project in Visual Studio 2010
|
|
||||||
|
|
||||||
// --------------------------------------------------------
|
|
||||||
// 3. The "old" way for building the executable
|
|
||||||
// -------------------------------------------------------
|
|
||||||
|
|
||||||
1. Enable the "#undef ENGLISH" define below, so English will not be used anymore
|
|
||||||
2. Set the desired language below
|
|
||||||
3. If you want to build "Unfinished Business" version, enable "#define JA2UB" and "#define JA2UBMAPS" in builddefines.h"
|
|
||||||
4. Build the executable in VS 2005 / 2008 / 2010
|
|
||||||
5. The output will be placed in the "Build\bin\" folder
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Only enable this "undef", if you use the 3. way of building the executable!
|
|
||||||
#undef ENGLISH
|
|
||||||
|
|
||||||
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
|
|
||||||
/* please set one manually here (by uncommenting) if not willingly to set Workspace wide */
|
|
||||||
|
|
||||||
#define ENGLISH
|
|
||||||
//#define GERMAN
|
|
||||||
//#define RUSSIAN
|
|
||||||
//#define DUTCH
|
|
||||||
//#define FRENCH
|
|
||||||
//#define ITALIAN
|
|
||||||
//#define POLISH
|
|
||||||
|
|
||||||
// INFO: For Chinese 1.13 version, you also have to set USE_WINFONTS = 1 in ja2.ini inside your JA2 installation directory!
|
|
||||||
//#define CHINESE
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//**ddd direct link libraries
|
|
||||||
#pragma comment (lib, "user32.lib")
|
|
||||||
#pragma comment (lib, "gdi32.lib")
|
|
||||||
#pragma comment (lib, "advapi32.lib")
|
|
||||||
#pragma comment (lib, "shell32.lib")
|
|
||||||
|
|
||||||
/* ====================================================================
|
|
||||||
* Regardless of if we did it Workspace wide or by uncommenting above,
|
|
||||||
* HERE we must see, what language was selected. If one, we
|
|
||||||
*/
|
|
||||||
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
|
|
||||||
# error "At least You have to specify a Language somewhere. See comments above."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//if the language represents words as single chars
|
|
||||||
/*#ifdef TAIWAN
|
|
||||||
#define SINGLE_CHAR_WORDS
|
|
||||||
#endif*/
|
|
||||||
|
|
||||||
#endif
|
|
||||||
+101
-38
@@ -36,7 +36,6 @@
|
|||||||
#include "Strategic Status.h"
|
#include "Strategic Status.h"
|
||||||
#include "Merc Contract.h"
|
#include "Merc Contract.h"
|
||||||
#include "Strategic Merc Handler.h"
|
#include "Strategic Merc Handler.h"
|
||||||
#include "Language Defines.h"
|
|
||||||
#include "Assignments.h"
|
#include "Assignments.h"
|
||||||
#include "Sound Control.h"
|
#include "Sound Control.h"
|
||||||
#include "Quests.h"
|
#include "Quests.h"
|
||||||
@@ -50,6 +49,7 @@
|
|||||||
#include "Encrypted File.h"
|
#include "Encrypted File.h"
|
||||||
#include "InterfaceItemImages.h"
|
#include "InterfaceItemImages.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
//
|
//
|
||||||
//****** Defines ******
|
//****** Defines ******
|
||||||
@@ -148,10 +148,16 @@
|
|||||||
#define FEE_X PRICE_X + 7
|
#define FEE_X PRICE_X + 7
|
||||||
#define FEE_Y NAME_Y
|
#define FEE_Y NAME_Y
|
||||||
#define FEE_WIDTH 37
|
#define FEE_WIDTH 37
|
||||||
|
#define FEE_X_UB PRICE_X + 40
|
||||||
|
#define FEE_Y_UB STATS_Y + 28
|
||||||
|
#define FEE_Y_UB_NSGI STATS_Y
|
||||||
|
|
||||||
#define AIM_CONTRACT_X PRICE_X + 51
|
#define AIM_CONTRACT_X PRICE_X + 51
|
||||||
#define AIM_CONTRACT_Y FEE_Y
|
#define AIM_CONTRACT_Y FEE_Y
|
||||||
#define AIM_CONTRACT_WIDTH 59
|
#define AIM_CONTRACT_WIDTH 59
|
||||||
|
#define AIM_CONTRACT_X_UB PRICE_X + 19
|
||||||
|
#define AIM_OFFER_X PRICE_X + 3
|
||||||
|
#define AIM_OFFER_WIDTH 110
|
||||||
|
|
||||||
#define ONEDAY_X AIM_CONTRACT_X
|
#define ONEDAY_X AIM_CONTRACT_X
|
||||||
#define ONEWEEK_X AIM_CONTRACT_X
|
#define ONEWEEK_X AIM_CONTRACT_X
|
||||||
@@ -1120,7 +1126,13 @@ BOOLEAN RenderAIMMembers()
|
|||||||
|
|
||||||
UpdateMercInfo();
|
UpdateMercInfo();
|
||||||
|
|
||||||
|
//Display AIM Member text
|
||||||
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||||
|
|
||||||
//Draw fee & contract
|
//Draw fee & contract
|
||||||
|
#ifdef JA2UB
|
||||||
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
|
#else
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
|
|
||||||
@@ -1129,9 +1141,6 @@ BOOLEAN RenderAIMMembers()
|
|||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
|
|
||||||
//Display AIM Member text
|
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
|
||||||
|
|
||||||
//Display Option Gear Cost text
|
//Display Option Gear Cost text
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
|
|
||||||
@@ -1140,6 +1149,7 @@ BOOLEAN RenderAIMMembers()
|
|||||||
InsertDollarSignInToString( wTemp );
|
InsertDollarSignInToString( wTemp );
|
||||||
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5;
|
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5;
|
||||||
DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
|
#endif // JA2UB
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1163,6 +1173,12 @@ BOOLEAN RenderAIMMembers()
|
|||||||
|
|
||||||
UpdateMercInfo();
|
UpdateMercInfo();
|
||||||
|
|
||||||
|
//Display AIM Member text
|
||||||
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||||
|
|
||||||
|
#ifdef JA2UB
|
||||||
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
|
#else
|
||||||
//Draw fee & contract
|
//Draw fee & contract
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
@@ -1172,9 +1188,6 @@ BOOLEAN RenderAIMMembers()
|
|||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
|
|
||||||
//Display AIM Member text
|
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
|
||||||
|
|
||||||
//Display Option Gear Cost text
|
//Display Option Gear Cost text
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
|
|
||||||
@@ -1183,6 +1196,7 @@ BOOLEAN RenderAIMMembers()
|
|||||||
InsertDollarSignInToString( wTemp );
|
InsertDollarSignInToString( wTemp );
|
||||||
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5;
|
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5;
|
||||||
DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
DisableAimButton();
|
DisableAimButton();
|
||||||
@@ -1309,6 +1323,10 @@ BOOLEAN UpdateMercInfo(void)
|
|||||||
|
|
||||||
if(gGameExternalOptions.gfUseNewStartingGearInterface)
|
if(gGameExternalOptions.gfUseNewStartingGearInterface)
|
||||||
{
|
{
|
||||||
|
#ifdef JA2UB
|
||||||
|
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
|
||||||
|
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y_NSGI, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||||
|
#else
|
||||||
//Display the salaries
|
//Display the salaries
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
||||||
@@ -1335,6 +1353,8 @@ BOOLEAN UpdateMercInfo(void)
|
|||||||
else
|
else
|
||||||
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||||
}
|
}
|
||||||
|
#endif // JA2UB
|
||||||
|
|
||||||
if(!g_bUseXML_Strings)
|
if(!g_bUseXML_Strings)
|
||||||
{
|
{
|
||||||
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
|
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
|
||||||
@@ -1363,6 +1383,10 @@ BOOLEAN UpdateMercInfo(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef JA2UB
|
||||||
|
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
|
||||||
|
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||||
|
#else
|
||||||
//Display the salaries
|
//Display the salaries
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
||||||
@@ -1389,6 +1413,7 @@ BOOLEAN UpdateMercInfo(void)
|
|||||||
else
|
else
|
||||||
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if(!g_bUseXML_Strings)
|
if(!g_bUseXML_Strings)
|
||||||
{
|
{
|
||||||
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
|
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
|
||||||
@@ -2528,6 +2553,21 @@ BOOLEAN DisplayVideoConferencingDisplay()
|
|||||||
|
|
||||||
DisplayMercChargeAmount();
|
DisplayMercChargeAmount();
|
||||||
|
|
||||||
|
#ifdef JA2UB
|
||||||
|
if (gubVideoConferencingMode == AIM_VIDEO_HIRE_MERC_MODE)
|
||||||
|
{
|
||||||
|
CHAR16 offerText[190];
|
||||||
|
swprintf(offerText, zNewTacticalMessages[TACT_MSG__AIMMEMBER_ONE_TIME_FEE], gMercProfiles[gbCurrentSoldier].zNickname);
|
||||||
|
const auto xCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_X + 115;
|
||||||
|
const auto yCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_Y + 45;
|
||||||
|
const auto textAreaWidth = 245;
|
||||||
|
SetFontShadow(AIM_M_VIDEO_NAME_SHADOWCOLOR);
|
||||||
|
DisplayWrappedString(xCoord, yCoord, textAreaWidth, 2, AIM_M_FONT_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, offerText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
|
SetFontShadow(DEFAULT_SHADOW);
|
||||||
|
}
|
||||||
|
#endif // JA2UB
|
||||||
|
|
||||||
|
|
||||||
// if( gfMercIsTalking && !gfIsAnsweringMachineActive)
|
// if( gfMercIsTalking && !gfIsAnsweringMachineActive)
|
||||||
if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] )
|
if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] )
|
||||||
{
|
{
|
||||||
@@ -2577,6 +2617,9 @@ BOOLEAN DisplayMercsVideoFace()
|
|||||||
|
|
||||||
void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
|
void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
|
||||||
{
|
{
|
||||||
|
#ifdef JA2UB
|
||||||
|
return;
|
||||||
|
#else
|
||||||
UINT16 i, usPosY, usPosX;
|
UINT16 i, usPosY, usPosX;
|
||||||
|
|
||||||
//First draw the select light for the contract length buttons
|
//First draw the select light for the contract length buttons
|
||||||
@@ -2630,6 +2673,8 @@ void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
|
|||||||
usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP;
|
usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP;
|
||||||
}
|
}
|
||||||
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
|
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
|
||||||
|
|
||||||
|
#endif // JA2UB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2653,7 +2698,10 @@ UINT32 DisplayMercChargeAmount()
|
|||||||
giContractAmount = 0;
|
giContractAmount = 0;
|
||||||
|
|
||||||
//the contract charge amount
|
//the contract charge amount
|
||||||
|
#ifdef JA2UB
|
||||||
|
// Special offer for a limited time! Act fast!
|
||||||
|
giContractAmount = gMercProfiles[gbCurrentSoldier].uiWeeklySalary;
|
||||||
|
#else
|
||||||
// Get the salary rate
|
// Get the salary rate
|
||||||
if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY)
|
if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY)
|
||||||
giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary;
|
giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary;
|
||||||
@@ -2675,6 +2723,7 @@ UINT32 DisplayMercChargeAmount()
|
|||||||
{
|
{
|
||||||
giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost;
|
giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2685,10 +2734,15 @@ UINT32 DisplayMercChargeAmount()
|
|||||||
//if the merc hasnt just been hired
|
//if the merc hasnt just been hired
|
||||||
// if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
|
// if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
|
||||||
{
|
{
|
||||||
|
#ifdef JA2UB
|
||||||
|
// Don't even have to pay for medical insurance! What a DEAL!
|
||||||
|
swprintf(wTemp, L"%s", wDollarTemp);
|
||||||
|
#else
|
||||||
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit )
|
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit )
|
||||||
swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] );
|
swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] );
|
||||||
else
|
else
|
||||||
swprintf(wTemp, L"%s", wDollarTemp );
|
swprintf(wTemp, L"%s", wDollarTemp );
|
||||||
|
#endif // JA2UB
|
||||||
|
|
||||||
DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
}
|
}
|
||||||
@@ -3887,14 +3941,14 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
|
|||||||
MSYS_DisableRegion(&gSelectedShutUpMercRegion);
|
MSYS_DisableRegion(&gSelectedShutUpMercRegion);
|
||||||
|
|
||||||
//Enable the ability to click on the BIG face to go to different screen
|
//Enable the ability to click on the BIG face to go to different screen
|
||||||
MSYS_EnableRegion(&gSelectedFaceRegion);
|
MSYS_EnableRegion(&gSelectedFaceRegion);
|
||||||
|
|
||||||
// EnableDisableCurrentVideoConferenceButtons(FALSE);
|
// EnableDisableCurrentVideoConferenceButtons(FALSE);
|
||||||
if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE )
|
if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE )
|
||||||
{
|
{
|
||||||
// Enable the current video conference buttons
|
// Enable the current video conference buttons
|
||||||
EnableDisableCurrentVideoConferenceButtons(FALSE);
|
EnableDisableCurrentVideoConferenceButtons(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fVideoConferenceCreated = FALSE;
|
fVideoConferenceCreated = FALSE;
|
||||||
@@ -4085,6 +4139,22 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
|
|||||||
|
|
||||||
// InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT);
|
// InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT);
|
||||||
DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE );
|
DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE );
|
||||||
|
|
||||||
|
#ifdef JA2UB
|
||||||
|
// Disable and hide contract length & gear purchase buttons
|
||||||
|
gfBuyEquipment = TRUE;
|
||||||
|
for (size_t i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
DisableButton(giContractLengthButton[i]);
|
||||||
|
HideButton(giContractLengthButton[i]);
|
||||||
|
|
||||||
|
if (i < 2)
|
||||||
|
{
|
||||||
|
DisableButton(giBuyEquipmentButton[i]);
|
||||||
|
HideButton(giBuyEquipmentButton[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // JA2UB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -5297,11 +5367,17 @@ BOOLEAN DisplayShadedStretchedMercFace( UINT8 ubMercID, UINT16 usPosX, UINT16 us
|
|||||||
void DemoHiringOfMercs( )
|
void DemoHiringOfMercs( )
|
||||||
{
|
{
|
||||||
INT16 i;
|
INT16 i;
|
||||||
#ifdef GERMAN
|
UINT8 MercID[5];
|
||||||
UINT8 MercID[]={ 7, 10, 4, 14, 50 };
|
MercID[0] = 7;
|
||||||
#else
|
MercID[1] = 10;
|
||||||
UINT8 MercID[]={ 7, 10, 4, 42, 33 };
|
MercID[2] = 4;
|
||||||
#endif
|
if( g_lang == i18n::Lang::de ) {
|
||||||
|
MercID[3] = 14;
|
||||||
|
MercID[4] = 50;
|
||||||
|
} else {
|
||||||
|
MercID[3] = 42;
|
||||||
|
MercID[4] = 33;
|
||||||
|
}
|
||||||
MERC_HIRE_STRUCT HireMercStruct;
|
MERC_HIRE_STRUCT HireMercStruct;
|
||||||
static BOOLEAN fHaveCalledBefore=FALSE;
|
static BOOLEAN fHaveCalledBefore=FALSE;
|
||||||
|
|
||||||
@@ -5392,20 +5468,20 @@ void DisplayPopUpBoxExplainingMercArrivalLocationAndTime( )
|
|||||||
//create the string to display to the user, looks like....
|
//create the string to display to the user, looks like....
|
||||||
// L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival
|
// L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival
|
||||||
|
|
||||||
#ifdef GERMAN
|
if( g_lang == i18n::Lang::de ) {
|
||||||
//Germans version has a different argument order
|
//Germans version has a different argument order
|
||||||
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
|
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
|
||||||
gMercProfiles[ pSoldier->ubProfile ].zNickname,
|
gMercProfiles[ pSoldier->ubProfile ].zNickname,
|
||||||
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
|
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
|
||||||
zTimeString,
|
zTimeString,
|
||||||
zSectorIDString );
|
zSectorIDString );
|
||||||
#else
|
} else {
|
||||||
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
|
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
|
||||||
gMercProfiles[ pSoldier->ubProfile ].zNickname,
|
gMercProfiles[ pSoldier->ubProfile ].zNickname,
|
||||||
zSectorIDString,
|
zSectorIDString,
|
||||||
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
|
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
|
||||||
zTimeString );
|
zTimeString );
|
||||||
#endif
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -5633,29 +5709,16 @@ 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]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ TestTable::Display( )
|
|||||||
{
|
{
|
||||||
MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown],
|
MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown],
|
||||||
usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow,
|
usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow,
|
||||||
MSYS_PRIORITY_HIGHEST, CURSOR_WWW,
|
MSYS_PRIORITY_HIGHEST-3, CURSOR_WWW,
|
||||||
MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack );
|
MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack );
|
||||||
MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] );
|
MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] );
|
||||||
|
|
||||||
|
|||||||
+86
-104
@@ -20,6 +20,7 @@
|
|||||||
// HEADROCK HAM 4
|
// HEADROCK HAM 4
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item
|
#include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
|
|
||||||
#define BOBBYR_DEFAULT_MENU_COLOR 255
|
#define BOBBYR_DEFAULT_MENU_COLOR 255
|
||||||
@@ -115,11 +116,7 @@
|
|||||||
#define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1
|
#define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1
|
||||||
#define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40
|
#define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40
|
||||||
|
|
||||||
#ifdef CHINESE
|
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X
|
||||||
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH - 10 //BOBBYR_ITEM_QTY_NUM_X
|
|
||||||
#else
|
|
||||||
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define BOBBY_RAY_NOT_PURCHASED 255
|
#define BOBBY_RAY_NOT_PURCHASED 255
|
||||||
#define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200
|
#define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200
|
||||||
@@ -362,6 +359,29 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber );
|
|||||||
void HandleBobbyRGunsKeyBoardInput();
|
void HandleBobbyRGunsKeyBoardInput();
|
||||||
void HandleBobbyRayMouseWheel(void);
|
void HandleBobbyRayMouseWheel(void);
|
||||||
|
|
||||||
|
// Appends source STR16 to target STR16 using decorators ("\n" and "...").
|
||||||
|
// Returns TRUE if everything fits target, FALSE otherwise.
|
||||||
|
static BOOLEAN DecorateAppendString(STR16 target, size_t targetCapacity, STR16 source, UINT32 frontDecoratorsCnt = 1)
|
||||||
|
{
|
||||||
|
const CHAR16 DECORATOR0[] = L"\n";
|
||||||
|
const CHAR16 DECORATOR1[] = L"\n...";
|
||||||
|
BOOLEAN result = FALSE;
|
||||||
|
size_t decoratorLen = wcslen(DECORATOR0) * frontDecoratorsCnt;
|
||||||
|
|
||||||
|
if (wcslen(target) + decoratorLen + wcslen(source) + 1 < targetCapacity)
|
||||||
|
{
|
||||||
|
for (UINT32 i = 0; i < frontDecoratorsCnt; i++)
|
||||||
|
wcscat(target, DECORATOR0);
|
||||||
|
wcscat(target, source);
|
||||||
|
result = TRUE;
|
||||||
|
}
|
||||||
|
else if (wcslen(target) + wcslen(DECORATOR1) + 1 < targetCapacity)
|
||||||
|
{
|
||||||
|
wcscat(target, DECORATOR1);
|
||||||
|
} // otherwise don't even touch the target
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void GameInitBobbyRGuns()
|
void GameInitBobbyRGuns()
|
||||||
{
|
{
|
||||||
guiTempCurrentMode=0;
|
guiTempCurrentMode=0;
|
||||||
@@ -1742,11 +1762,11 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
|
|||||||
{
|
{
|
||||||
if ( iSubFilter > -1 ) // Madd: new BR filters
|
if ( iSubFilter > -1 ) // Madd: new BR filters
|
||||||
{
|
{
|
||||||
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter )
|
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter )
|
||||||
bAddItem = TRUE;
|
bAddItem = TRUE;
|
||||||
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
|
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
|
||||||
bAddItem = TRUE;
|
bAddItem = TRUE;
|
||||||
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
|
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
|
||||||
bAddItem = TRUE;
|
bAddItem = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2483,7 +2503,11 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
|
|||||||
if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED)
|
if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED)
|
||||||
{
|
{
|
||||||
swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased);
|
swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased);
|
||||||
DrawTextToScreen(sTemp, BOBBYR_ITEMS_BOUGHT_X, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
auto bobbyRItemsBoughtX{ BOBBYR_ITEMS_BOUGHT_X };
|
||||||
|
if (g_lang == i18n::Lang::zh) {
|
||||||
|
bobbyRItemsBoughtX -= 10;
|
||||||
|
}
|
||||||
|
DrawTextToScreen(sTemp, bobbyRItemsBoughtX, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2493,11 +2517,11 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
|
|||||||
//if it's a used item, display how damaged the item is
|
//if it's a used item, display how damaged the item is
|
||||||
if( fUsed )
|
if( fUsed )
|
||||||
{
|
{
|
||||||
#ifdef CHINESE
|
if ( g_lang == i18n::Lang::zh ) {
|
||||||
swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww
|
swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww
|
||||||
#else
|
} else {
|
||||||
swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );
|
swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );
|
||||||
#endif
|
}
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
}
|
}
|
||||||
@@ -2630,11 +2654,11 @@ void SetFirstLastPagesForNew( UINT32 uiClassMask, INT32 iFilter, INT32 iSubFilte
|
|||||||
{
|
{
|
||||||
if (iSubFilter > -1 )
|
if (iSubFilter > -1 )
|
||||||
{
|
{
|
||||||
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter)
|
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter)
|
||||||
bCntNumItems = TRUE;
|
bCntNumItems = TRUE;
|
||||||
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
|
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
|
||||||
bCntNumItems = TRUE;
|
bCntNumItems = TRUE;
|
||||||
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment )
|
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
|
||||||
bCntNumItems = TRUE;
|
bCntNumItems = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -3618,11 +3642,11 @@ void CalcFirstIndexForPage( STORE_INVENTORY *pInv, UINT32 uiItemClass )
|
|||||||
{
|
{
|
||||||
if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options
|
if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options
|
||||||
{
|
{
|
||||||
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
|
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
|
||||||
bCntItem = TRUE;
|
bCntItem = TRUE;
|
||||||
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
|
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
|
||||||
bCntItem = TRUE;
|
bCntItem = TRUE;
|
||||||
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
|
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
|
||||||
bCntItem = TRUE;
|
bCntItem = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -4089,6 +4113,7 @@ void HandleBobbyRayMouseWheel(void)
|
|||||||
|
|
||||||
void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
|
void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
|
||||||
{
|
{
|
||||||
|
const size_t ATTACHMENTS_STRBUF_SIZE = 3800;
|
||||||
CHAR16 zItemName[ SIZE_ITEM_NAME ];
|
CHAR16 zItemName[ SIZE_ITEM_NAME ];
|
||||||
UINT8 ubItemCount=0;
|
UINT8 ubItemCount=0;
|
||||||
|
|
||||||
@@ -4115,12 +4140,9 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
|
|||||||
// HEADROCK HAM 3: Variables for "Possible Attachment List"
|
// HEADROCK HAM 3: Variables for "Possible Attachment List"
|
||||||
BOOLEAN fAttachmentsFound = FALSE;
|
BOOLEAN fAttachmentsFound = FALSE;
|
||||||
// Contains entire string of attachment names
|
// Contains entire string of attachment names
|
||||||
CHAR16 attachStr[3900];
|
CHAR16 attachStr[ATTACHMENTS_STRBUF_SIZE];
|
||||||
// Contains current attachment string
|
|
||||||
CHAR16 attachStr2[100];
|
|
||||||
// Contains temporary attachment list before added to string constant from text.h
|
// Contains temporary attachment list before added to string constant from text.h
|
||||||
CHAR16 attachStr3[3900];
|
CHAR16 attachStr3[ATTACHMENTS_STRBUF_SIZE];
|
||||||
UINT16 usAttachment;
|
|
||||||
|
|
||||||
CreateItem(usItemNumber, 100, &pObject);
|
CreateItem(usItemNumber, 100, &pObject);
|
||||||
INT16 ubAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], &pObject, NULL );
|
INT16 ubAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], &pObject, NULL );
|
||||||
@@ -4146,109 +4168,69 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
|
|||||||
else
|
else
|
||||||
wcscat( apStr, L" / -" );
|
wcscat( apStr, L" / -" );
|
||||||
|
|
||||||
// HEADROCK HAM 3: Empty these strings first, to avoid crashes. Please keep this here.
|
attachStr[0] = 0;
|
||||||
swprintf( attachStr, L"" );
|
attachStr3[0] = 0;
|
||||||
swprintf( attachStr2, L"" );
|
|
||||||
swprintf( attachStr3, L"" );
|
|
||||||
|
|
||||||
// HEADROCK HAM 3: Generate list of possible attachments to a gun (Guns only!)
|
// HEADROCK HAM 3: Generate list of possible attachments to a gun (Guns only!)
|
||||||
if (gGameExternalOptions.fBobbyRayTooltipsShowAttachments)
|
if (gGameExternalOptions.fBobbyRayTooltipsShowAttachments)
|
||||||
{
|
{
|
||||||
UINT16 iLoop = 0;
|
if (UsingNewAttachmentSystem())
|
||||||
// Check entire attachment list
|
|
||||||
while( 1 )
|
|
||||||
{
|
{
|
||||||
//Madd: Common Attachment Framework
|
std::pair<std::multimap<UINT16, AttachmentStruct>::iterator, std::multimap<UINT16, AttachmentStruct>::iterator> range;
|
||||||
//TODO: Note that the items in this list will be duplicated if they are present in both the CAF and the old attachment method
|
std::multimap<UINT16, AttachmentStruct>::iterator it;
|
||||||
//need to refactor this to work more like the NAS attachment slots method
|
range = AttachmentBackmap.equal_range(Item[usItemNumber].uiIndex);
|
||||||
usAttachment = 0;
|
for (it = range.first; it != range.second; it++)
|
||||||
if ( IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, iLoop) )
|
|
||||||
{
|
{
|
||||||
usAttachment = iLoop;
|
UINT16 attachmentId = it->second.attachmentIndex;
|
||||||
// If the attachment is not hidden
|
if (!ItemIsHiddenAddon(attachmentId) && !ItemIsHiddenAttachment(attachmentId) && ItemIsLegal(attachmentId, TRUE))
|
||||||
if (usAttachment > 0 && !Item[ usAttachment ].hiddenaddon && !Item[ usAttachment ].hiddenattachment)
|
|
||||||
{
|
{
|
||||||
if (wcslen( attachStr3 ) + wcslen(Item[usAttachment].szItemName) > 3800)
|
|
||||||
{
|
|
||||||
// End list early to avoid stack overflow
|
|
||||||
wcscat( attachStr3, L"\n..." );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{// Add the attachment's name to the list.
|
|
||||||
fAttachmentsFound = TRUE;
|
|
||||||
swprintf( attachStr2, L"\n%s", Item[ usAttachment ].szItemName );
|
|
||||||
wcscat( attachStr3, attachStr2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Is the weapon we're checking the same as the one we're tooltipping?
|
|
||||||
usAttachment = 0;
|
|
||||||
if (Attachment[iLoop][1] == Item[usItemNumber].uiIndex)
|
|
||||||
{
|
|
||||||
usAttachment = Attachment[iLoop][0];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the attachment is not hidden
|
|
||||||
if (usAttachment > 0 && !Item[ usAttachment ].hiddenaddon && !Item[ usAttachment ].hiddenattachment)
|
|
||||||
{
|
|
||||||
if (wcslen( attachStr3 ) + wcslen(Item[usAttachment].szItemName) > 3800)
|
|
||||||
{
|
|
||||||
// End list early to avoid stack overflow
|
|
||||||
wcscat( attachStr3, L"\n..." );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{// Add the attachment's name to the list.
|
|
||||||
fAttachmentsFound = TRUE;
|
fAttachmentsFound = TRUE;
|
||||||
swprintf( attachStr2, L"\n%s", Item[ usAttachment ].szItemName );
|
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE)
|
||||||
wcscat( attachStr3, attachStr2);
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
iLoop++;
|
|
||||||
if (Attachment[iLoop][0] == 0 && Item[iLoop].usItemClass == 0)
|
|
||||||
{
|
|
||||||
// Reached end of list
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else // old attachment system
|
||||||
|
{
|
||||||
|
for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++)
|
||||||
|
{
|
||||||
|
// If the attachment is not hidden and attachable to the gun (usItemNumber)
|
||||||
|
if (!ItemIsHiddenAddon(itemId) && !ItemIsHiddenAttachment(itemId) &&
|
||||||
|
ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId))
|
||||||
|
{
|
||||||
|
fAttachmentsFound = TRUE;
|
||||||
|
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[itemId].szItemName) == FALSE)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (fAttachmentsFound)
|
if (fAttachmentsFound)
|
||||||
{
|
{
|
||||||
// Add extra empty line and attachment list title
|
DecorateAppendString(attachStr, ATTACHMENTS_STRBUF_SIZE, gWeaponStatsDesc[14], 2); // 2 new lines and "Attachments:" title
|
||||||
swprintf( attachStr, L"\n \n%s", gWeaponStatsDesc[ 14 ] );
|
DecorateAppendString(attachStr, ATTACHMENTS_STRBUF_SIZE, attachStr3, 0); // no new line, list of attachments (starts with new line)
|
||||||
wcscat( attachStr, attachStr3 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Sum up default attachments.
|
//Sum up default attachments.
|
||||||
BOOLEAN fFoundDefault = FALSE;
|
BOOLEAN fFoundDefault = FALSE;
|
||||||
swprintf( attachStr2, L"" );
|
attachStr3[0] = 0;
|
||||||
swprintf( attachStr3, L"" );
|
for (UINT8 cnt = 0; cnt < MAX_DEFAULT_ATTACHMENTS; cnt++)
|
||||||
for(UINT8 cnt = 0; cnt < MAX_DEFAULT_ATTACHMENTS; cnt++){
|
{
|
||||||
if(Item[usItemNumber].defaultattachments[cnt] != 0){
|
if (Item[usItemNumber].defaultattachments[cnt] != 0)
|
||||||
if (wcslen( attachStr ) + wcslen(attachStr3) + wcslen(Item[ Item[usItemNumber].defaultattachments[cnt] ].szItemName) > 3800)
|
{
|
||||||
{
|
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[Item[usItemNumber].defaultattachments[cnt]].szItemName) == FALSE)
|
||||||
// End list early to avoid stack overflow
|
|
||||||
wcscat( attachStr3, L"\n..." );
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
fFoundDefault = TRUE;
|
fFoundDefault = TRUE;
|
||||||
swprintf( attachStr2, L"\n%s", Item[ Item[usItemNumber].defaultattachments[cnt] ].szItemName );
|
|
||||||
wcscat( attachStr3, attachStr2 );
|
|
||||||
} else {
|
|
||||||
//If we found an empty entry, we can assume the rest will be empty too.
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else // If we found an empty entry, we can assume the rest will be empty too.
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(fFoundDefault){
|
|
||||||
//Found at least one default attachment, write it to the attachment string.
|
if (fFoundDefault)
|
||||||
CHAR16 defaultStr[50];
|
{
|
||||||
swprintf( defaultStr, L"\n \n%s", gWeaponStatsDesc[ 17 ] );
|
DecorateAppendString(attachStr, ATTACHMENTS_STRBUF_SIZE, gWeaponStatsDesc[17], 2); // 2 new lines and "Default:" title
|
||||||
wcscat( attachStr, defaultStr );
|
DecorateAppendString(attachStr, ATTACHMENTS_STRBUF_SIZE, attachStr3, 0); // no new line, list of attachments (starts with new line)
|
||||||
wcscat( attachStr, attachStr3 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HEADROCK HAM 3: Added last string (attachStr), for display of the possible attachment list.
|
// HEADROCK HAM 3: Added last string (attachStr), for display of the possible attachment list.
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include <vfs/Core/vfs.h>
|
#include <vfs/Core/vfs.h>
|
||||||
#include <vfs/Core/File/vfs_file.h>
|
#include <vfs/Core/File/vfs_file.h>
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -488,11 +489,11 @@ BOOLEAN EnterBobbyRMailOrder()
|
|||||||
SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN);
|
SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN);
|
||||||
SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE );
|
SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE );
|
||||||
//inshy: fix position of text for buttons
|
//inshy: fix position of text for buttons
|
||||||
#ifdef FRENCH
|
if(g_lang == i18n::Lang::fr) {
|
||||||
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE );
|
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE );
|
||||||
#else
|
} else {
|
||||||
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE );
|
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE );
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Accept Order button
|
// Accept Order button
|
||||||
guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 );
|
guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 );
|
||||||
@@ -504,11 +505,11 @@ BOOLEAN EnterBobbyRMailOrder()
|
|||||||
DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback);
|
DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback);
|
||||||
SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN);
|
SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN);
|
||||||
//inshy: fix position of text for buttons
|
//inshy: fix position of text for buttons
|
||||||
#ifdef FRENCH
|
if(g_lang == i18n::Lang::fr) {
|
||||||
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE );
|
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE );
|
||||||
#else
|
} else {
|
||||||
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE );
|
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE );
|
||||||
#endif
|
}
|
||||||
SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED );
|
SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED );
|
||||||
|
|
||||||
if( gbSelectedCity == -1 )
|
if( gbSelectedCity == -1 )
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user