Compare commits

..
Author SHA1 Message Date
Vasilii Rogin 0ee6c264c2 Comment cpack for macos 2025-09-09 21:45:50 +03:00
Vasilii Rogin 462063ca85 Temporarely disable cmake cache on Windows 2025-09-09 21:39:06 +03:00
Vasilii Rogin f17c61efa6 Expect signed apk 2025-09-09 21:38:50 +03:00
Vasilii Rogin e996107403 Change secrets for android signing 2025-09-09 21:38:28 +03:00
Vasilii Rogin 933e5bf822 Use unsigned version 2025-09-09 21:30:10 +03:00
Vasilii Rogin e084300713 Comment cpack 2025-09-09 21:28:02 +03:00
Vasilii Rogin 325c86ddfc Remove prerelease 2025-09-09 21:21:34 +03:00
Vasilii Rogin 324957526f Add more ls -laR 2025-09-09 21:20:41 +03:00
Vasilii Rogin acd5d979c9 Bump windows cache 2025-09-09 21:19:10 +03:00
Vasilii Rogin c2cd174516 Add ls -laR to debug 2025-09-09 21:17:29 +03:00
Vasilii Rogin 4cb451de51 Fix cpack 2025-09-09 21:15:40 +03:00
Vasilii Rogin 33c2cf268d Rename steps 2025-09-09 21:10:01 +03:00
Vasilii Rogin b47af8de8d Adding release 2025-09-09 21:05:16 +03:00
Vasilii Rogin efd4f9e434 Add debug suffixes 2025-09-09 21:00:38 +03:00
Vasilii Rogin 2d0a2047ba Add debug prefixes 2025-09-09 20:58:23 +03:00
123 changed files with 2841 additions and 2871 deletions
+384
View File
@@ -0,0 +1,384 @@
name: Build
on:
push:
branches:
- main
pull_request: # TODO: Remove this after debugging
types:
- opened
- synchronize
defaults:
run:
shell: bash
jobs:
android:
name: Android Release
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: gradle
- name: Cache cmake build
uses: actions/cache@v4
with:
path: os/android/app/.cxx
key: android-cmake-v101
- name: Setup signing config
if: env.KEYSTORE_FILE_BASE64 != '' && env.KEYSTORE_PROPERTIES_FILE_BASE64 != ''
run: |
cd os/android
echo "$KEYSTORE_FILE_BASE64" | base64 --decode > release.keystore
echo "$KEYSTORE_PROPERTIES_FILE_BASE64" | base64 --decode > release-keystore.properties
env:
KEYSTORE_FILE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_FILE_BASE64 }}
KEYSTORE_PROPERTIES_FILE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_PROPERTIES_FILE_BASE64 }}
- name: Build
run: |
cd os/android
./gradlew assembleRelease
- name: Change apk file name
run: |
ls -laR .
mv os/android/app/build/outputs/apk/release/app-release.apk os/android/app/build/outputs/apk/release/fallout2-ce.apk
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce.apk
path: os/android/app/build/outputs/apk/release/fallout2-ce.apk
retention-days: 7
ios:
name: iOS Release
runs-on: macos-14
steps:
- name: Clone
uses: actions/checkout@v4
- name: Cache cmake build
uses: actions/cache@v4
with:
path: out
key: ios-cmake-v101
- name: Configure
run: |
cmake --preset ios
- name: Build
run: |
cmake --build --preset ios-release
- name: Pack
run: |
ls -laR .
cd out/build/ios
# cpack -C Release # No need, we already have .ipa
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce.ipa
path: out/build/ios/fallout2-ce.ipa
retention-days: 7
linux:
name: Linux ${{ matrix.arch }} Release
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arch:
- x86
- x64
steps:
- name: Clone
uses: actions/checkout@v4
- name: Dependencies (x86)
if: matrix.arch == 'x86'
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install g++-multilib libsdl2-dev:i386 zlib1g-dev:i386
- name: Dependencies (x64)
if: matrix.arch == 'x64'
run: |
sudo apt update
sudo apt install libsdl2-dev zlib1g-dev
- name: Cache cmake build
uses: actions/cache@v4
with:
path: out
key: linux-${{ matrix.arch }}-cmake-v101
- name: Configure
run: |
cmake --preset linux-${{ matrix.arch }}-release
- name: Build
run: |
cmake --build --preset linux-${{ matrix.arch }}-release
- name: Change executable file name
run: |
mv out/build/linux-${{ matrix.arch }}-release/fallout2-ce out/build/linux-${{ matrix.arch }}-release/fallout2-ce-linux-${{ matrix.arch }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-linux-${{ matrix.arch }}
path: out/build/linux-${{ matrix.arch }}-release/fallout2-ce-linux-${{ matrix.arch }}
retention-days: 7
linux-armhf:
name: Linux armhf Release
runs-on: ubuntu-22.04-arm
steps:
- name: Clone
uses: actions/checkout@v4
- name: Dependencies
run: |
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libsdl2-dev:armhf zlib1g-dev:armhf
- name: Configure
run: |
cmake \
-B build \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D FALLOUT_VENDORED=OFF \
-D CMAKE_SYSTEM_PROCESSOR=arm \
-D CMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \
-D CMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
# EOL
- name: Build
run: cmake --build build
- name: Change executable file name
run: |
mv build/fallout2-ce build/fallout2-ce-linux-armhf
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-linux-armhf
path: build/fallout2-ce-linux-armhf
retention-days: 7
linux-arm64:
name: Linux arm64 Release
runs-on: ubuntu-22.04-arm
steps:
- name: Clone
uses: actions/checkout@v4
- name: Dependencies
run: |
sudo apt update
sudo apt install libsdl2-dev zlib1g-dev
- name: Configure
run: cmake -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo -D FALLOUT_VENDORED=OFF
- name: Build
run: cmake --build build
- name: Change executable file name
run: |
mv build/fallout2-ce build/fallout2-ce-linux-arm64
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-linux-arm64
path: build/fallout2-ce-linux-arm64
retention-days: 7
macos:
name: macOS Release
runs-on: macos-14
steps:
- name: Clone
uses: actions/checkout@v4
- name: Cache cmake build
uses: actions/cache@v4
with:
path: out
key: macos-cmake-v101
- name: Configure
run: |
cmake --preset macos
- name: Build
run: |
cmake --build --preset macos-release
- name: Pack
run: |
ls -laR .
cd out/build/macos
# cpack -C Release # There is already .dmg in the folder
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-macos.dmg
path: out/build/macos/Fallout II Community Edition.dmg
retention-days: 7
windows:
name: Windows ${{ matrix.arch }} Release
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
include:
- arch: x86
generator-platform: Win32
- arch: x64
generator-platform: x64
steps:
- name: Clone
uses: actions/checkout@v4
- name: Install Visual Studio 2019 Build Tools with v141_xp
shell: cmd
run: |
choco install visualstudio2019buildtools -y --package-parameters="'--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.xp --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.10240 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP --add Microsoft.VisualStudio.Component.WinXP'"
# - name: Cache cmake build
# uses: actions/cache@v4
# with:
# path: out
# key: windows-${{ matrix.arch }}-cmake-v101
- name: Configure
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
&& cmake --preset windows-${{ matrix.arch }}
- name: Build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
&& cmake --build --preset windows-${{ matrix.arch }}-release
- name: Change executable file name
run: |
mv out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce.exe out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce-${{ matrix.arch }}.exe
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-windows-${{ matrix.arch }}
path: out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce-${{ matrix.arch }}.exe
retention-days: 7
release:
name: Release Continuous build
runs-on: ubuntu-latest
needs: [android, ios, linux, linux-armhf, linux-arm64, macos, windows]
permissions: write-all
steps:
- name: Fetch artifacts
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
uses: actions/download-artifact@v4.1.7
with:
path: artifacts/
- name: Remove old release
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
uses: dev-drprasad/delete-tag-and-release@v0.2.1
with:
delete_release: true
tag_name: continious
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Move unpacked artifacts to root folder
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
run: |
ls -Rlah .
find .
cd artifacts/
for folder in *; do
if [[ -d "$folder" && "$folder" != "." ]]; then
echo "Processing $folder"
mv "$folder" "$folder.dir"
cd "$folder.dir"
for file in *; do
if [ -f "$file" ]; then
if [ -f "../$file" ]; then
echo "ERROR: Duplicate artifact file name $file"
exit 1
fi
if [ -d "../$file" ]; then
echo "ERROR: Duplicate artifact folder $file"
exit 1
fi
echo "Moving $file"
mv "$file" "../$file"
fi
done
cd ..
rm -rf "$folder.dir"
fi
done
ls -Rlah .
find .
cd ../
- name: Allow GitHub to process removed release for few seconds
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
run: |
sleep 20s
- name: Upload new release
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
uses: softprops/action-gh-release@v0.1.15
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: artifacts/*
tag_name: continious
draft: false
prerelease: false
name: Fallout2-CE Continuous Build
+30 -28
View File
@@ -106,13 +106,13 @@ jobs:
- name: Change apk file name
run: |
mv os/android/app/build/outputs/apk/debug/app-debug.apk os/android/app/build/outputs/apk/debug/fallout2-ce.apk
mv os/android/app/build/outputs/apk/debug/app-debug.apk os/android/app/build/outputs/apk/debug/fallout2-ce-debug.apk
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-debug.apk
path: os/android/app/build/outputs/apk/debug/fallout2-ce.apk
path: os/android/app/build/outputs/apk/debug/fallout2-ce-debug.apk
retention-days: 7
ios:
@@ -142,12 +142,13 @@ jobs:
run: |
cd out/build/ios
cpack -C Debug
mv fallout2-ce.ipa fallout2-ce-debug.ipa
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce.ipa
path: out/build/ios/fallout2-ce.ipa
name: fallout2-ce-debug.ipa
path: out/build/ios/fallout2-ce-debug.ipa
retention-days: 7
linux:
@@ -200,7 +201,7 @@ jobs:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-linux-${{ matrix.arch }}
name: fallout2-ce-linux-${{ matrix.arch }}-debug
path: out/build/linux-${{ matrix.arch }}-debug/fallout2-ce-linux-${{ matrix.arch }}
retention-days: 7
@@ -235,13 +236,13 @@ jobs:
- name: Change executable file name
run: |
mv build/fallout2-ce build/fallout2-ce-linux-armhf
mv build/fallout2-ce build/fallout2-ce-linux-armhf-debug
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-linux-armhf
path: build/fallout2-ce-linux-armhf
name: fallout2-ce-linux-armhf-debug
path: build/fallout2-ce-linux-armhf-debug
retention-days: 7
linux-arm64:
@@ -266,13 +267,13 @@ jobs:
- name: Change executable file name
run: |
mv build/fallout2-ce build/fallout2-ce-linux-arm64
mv build/fallout2-ce build/fallout2-ce-linux-arm64-debug
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-linux-arm64
path: build/fallout2-ce-linux-arm64
name: fallout2-ce-linux-arm64-debug
path: build/fallout2-ce-linux-arm64-debug
retention-days: 7
macos:
@@ -302,12 +303,13 @@ jobs:
run: |
cd out/build/macos
cpack -C Debug
mv "Fallout II Community Edition.dmg" "Fallout II Community Edition Debug.dmg"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-macos.dmg
path: out/build/macos/Fallout II Community Edition.dmg
name: fallout2-ce-macos-debug.dmg
path: out/build/macos/Fallout II Community Edition Debug.dmg
retention-days: 7
windows:
@@ -328,16 +330,16 @@ jobs:
- name: Clone
uses: actions/checkout@v4
- name: Install Visual Studio 2022 Build Tools with v141_xp
- name: Install Visual Studio 2019 Build Tools with v141_xp
shell: cmd
run: |
choco install visualstudio2022buildtools -y --package-parameters="'--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.xp --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.10240 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP --add Microsoft.VisualStudio.Component.WinXP'"
choco install visualstudio2019buildtools -y --package-parameters="'--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.xp --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.10240 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP --add Microsoft.VisualStudio.Component.WinXP'"
- name: Cache cmake build
uses: actions/cache@v4
with:
path: out
key: windows-${{ matrix.arch }}-cmake-v102
# - name: Cache cmake build
# uses: actions/cache@v4
# with:
# path: out
# key: windows-${{ matrix.arch }}-cmake-v102
- name: Configure
shell: cmd
@@ -349,22 +351,22 @@ jobs:
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
&& cmake --build --preset windows-${{ matrix.arch }}-release
&& cmake --build --preset windows-${{ matrix.arch }}-debug
- name: Change executable file name
run: |
mv out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce.exe out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce-${{ matrix.arch }}.exe
mv out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce.exe out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce-${{ matrix.arch }}-debug.exe
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-windows-${{ matrix.arch }}
path: out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce-${{ matrix.arch }}.exe
name: fallout2-ce-windows-${{ matrix.arch }}-debug
path: out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce-${{ matrix.arch }}-debug.exe
retention-days: 7
release:
name: Release Continuous build
name: Debug Release Continuous build
runs-on: ubuntu-latest
needs: [android, ios, linux, linux-armhf, linux-arm64, macos, windows]
permissions: write-all
@@ -380,7 +382,7 @@ jobs:
uses: dev-drprasad/delete-tag-and-release@v0.2.1
with:
delete_release: true
tag_name: continious
tag_name: continious-debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -429,7 +431,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: artifacts/*
tag_name: continious
tag_name: continious-debug
draft: false
prerelease: true
name: Fallout2-CE Continuous Build
name: Fallout2-CE Continuous Build
+1 -2
View File
@@ -318,8 +318,7 @@ endif()
if(WIN32)
target_link_libraries(${EXECUTABLE_NAME}
winmm
debug libcpmtd
optimized libcpmt
libcpmt
)
endif()
+2 -2
View File
@@ -28,7 +28,7 @@
"inherits": [
"windows-base"
],
"generator": "Visual Studio 17 2022",
"generator": "Visual Studio 16 2019",
"architecture": "Win32",
"cacheVariables": {
"CMAKE_GENERATOR_TOOLSET": "v141_xp",
@@ -42,7 +42,7 @@
"inherits": [
"windows-base"
],
"generator": "Visual Studio 17 2022",
"generator": "Visual Studio 16 2019",
"architecture": "x64",
"cacheVariables": {
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>"
-11
View File
@@ -126,17 +126,6 @@ IFACE_BAR_SIDES_ORI=0
;if IFACE_BAR_WIDTH=640 - Interface bar will remain at it's original width.
;if IFACE_BAR_WIDTH=800 - Interface bar will use 800pix wide asset from f2_res.dat.
;IFACE_BAR_WIDTH=640
[STATIC_SCREENS]
;if SPLASH_SCRN_SIZE=0 - Splash screen shows at original size if it fits, otherwise scales down while preserving aspect ratio.
;if SPLASH_SCRN_SIZE=1 - Splash screen scales to fit the screen while preserving aspect ratio.
;if SPLASH_SCRN_SIZE=2 - Splash screen stretches to fill the entire screen.
SPLASH_SCRN_SIZE=0
[MAPS]
;if IGNORE_MAP_EDGES=0 - Hi-Res map scroll edges are enabled.
;if IGNORE_MAP_EDGES=1 - Hi-Res map scroll edges are ignored.
IGNORE_MAP_EDGES=0
```
Recommendations:
+27 -27
View File
@@ -103,7 +103,7 @@ static int hideProjectile(void* _, void* projectile);
// 0x410468
int actionKnockdown(Object* obj, int* anim, int maxDistance, int rotation, int delay)
{
if (critterFlagCheck(obj->pid, CRITTER_NO_KNOCKBACK)) {
if (_critter_flag_check(obj->pid, CRITTER_NO_KNOCKBACK)) {
return -1;
}
@@ -208,7 +208,7 @@ int _pick_death(Object* attacker, Object* defender, Object* weapon, int damage,
int violenceLevel = settings.preferences.violence_level;
if (critterFlagCheck(defender->pid, CRITTER_SPECIAL_DEATH)) {
if (_critter_flag_check(defender->pid, CRITTER_SPECIAL_DEATH)) {
return _check_death(defender, ANIM_EXPLODED_TO_NOTHING, VIOLENCE_LEVEL_NORMAL, hitFromFront);
}
@@ -285,7 +285,7 @@ int _check_death(Object* obj, int anim, int minViolenceLevel, bool hitFromFront)
// 0x4108C8
int _internal_destroy(Object* _, Object* toDestroy)
{
return objectDestroy(toDestroy);
return _obj_destroy(toDestroy);
}
// TODO: Check very carefully, lots of conditions and jumps.
@@ -297,12 +297,12 @@ void _show_damage_to_object(Object* defender, int damage, int flags, Object* wea
int fid;
const char* sfx_name;
if (critterFlagCheck(defender->pid, CRITTER_NO_KNOCKBACK)) {
if (_critter_flag_check(defender->pid, CRITTER_NO_KNOCKBACK)) {
knockbackDistance = 0;
}
anim = FID_ANIM_TYPE(defender->fid);
if (!critterIsProne(defender)) {
if (!_critter_is_prone(defender)) {
if ((flags & DAM_DEAD) != 0) {
fid = buildFid(OBJ_TYPE_MISC, 10, 0, 0, 0);
if (fid == attacker->fid) {
@@ -447,7 +447,7 @@ void _show_damage_to_object(Object* defender, int damage, int flags, Object* wea
if (weapon != nullptr) {
if ((flags & DAM_EXPLODE) != 0) {
animationRegisterCallbackForced(defender, weapon, (AnimationCallback*)objectDrop, -1);
animationRegisterCallbackForced(defender, weapon, (AnimationCallback*)_obj_drop, -1);
fid = buildFid(OBJ_TYPE_MISC, 10, 0, 0, 0);
animationRegisterSetFid(weapon, fid, 0);
animationRegisterAnimateAndHide(weapon, ANIM_STAND, 0);
@@ -459,7 +459,7 @@ void _show_damage_to_object(Object* defender, int damage, int flags, Object* wea
} else if ((flags & DAM_DESTROY) != 0) {
animationRegisterCallbackForced(defender, weapon, (AnimationCallback*)_internal_destroy, -1);
} else if ((flags & DAM_DROP) != 0) {
animationRegisterCallbackForced(defender, weapon, (AnimationCallback*)objectDrop, -1);
animationRegisterCallbackForced(defender, weapon, (AnimationCallback*)_obj_drop, -1);
}
}
@@ -488,7 +488,7 @@ int _show_death(Object* obj, int anim)
}
}
if (!critterFlagCheck(obj->pid, CRITTER_FLAT)) {
if (!_critter_flag_check(obj->pid, CRITTER_FLAT)) {
obj->flags |= OBJECT_NO_BLOCK;
if (_obj_toggle_flat(obj, &tempRect) == 0) {
rectUnion(&dirtyRect, &tempRect, &dirtyRect);
@@ -499,7 +499,7 @@ int _show_death(Object* obj, int anim)
rectUnion(&dirtyRect, &tempRect, &dirtyRect);
}
if (anim >= 30 && anim <= 31 && !critterFlagCheck(obj->pid, CRITTER_SPECIAL_DEATH) && !critterFlagCheck(obj->pid, CRITTER_NO_DROP)) {
if (anim >= 30 && anim <= 31 && !_critter_flag_check(obj->pid, CRITTER_SPECIAL_DEATH) && !_critter_flag_check(obj->pid, CRITTER_NO_DROP)) {
itemDropAll(obj, obj->tile);
}
@@ -1040,7 +1040,7 @@ int _action_climb_ladder(Object* critter, Object* ladder)
animationRegisterCallbackForced(critter, ladder, (AnimationCallback*)_is_next_to, -1);
animationRegisterRotateToTile(critter, ladder->tile);
animationRegisterCallbackForced(critter, ladder, (AnimationCallback*)checkSceneryUseActionPointCost, -1);
animationRegisterCallbackForced(critter, ladder, (AnimationCallback*)_check_scenery_ap_cost, -1);
int weaponAnimationCode = (critter->fid & 0xF000) >> 12;
if (weaponAnimationCode != 0) {
@@ -1052,7 +1052,7 @@ int _action_climb_ladder(Object* critter, Object* ladder)
const char* climbingSfx = sfxBuildCharName(critter, ANIM_CLIMB_LADDER, CHARACTER_SOUND_EFFECT_UNUSED);
animationRegisterPlaySoundEffect(critter, climbingSfx, -1);
animationRegisterAnimate(critter, ANIM_CLIMB_LADDER, 0);
animationRegisterCallback(critter, ladder, (AnimationCallback*)objectUse, -1);
animationRegisterCallback(critter, ladder, (AnimationCallback*)_obj_use, -1);
if (weaponAnimationCode != 0) {
animationRegisterTakeOutWeapon(critter, weaponAnimationCode, -1);
@@ -1108,7 +1108,7 @@ int _action_use_an_item_on_object(Object* user, Object* targetObj, Object* item)
animationRegisterCallbackForced(user, targetObj, (AnimationCallback*)_is_next_to, -1);
if (item == nullptr) {
animationRegisterCallback(user, targetObj, (AnimationCallback*)checkSceneryUseActionPointCost, -1);
animationRegisterCallback(user, targetObj, (AnimationCallback*)_check_scenery_ap_cost, -1);
}
int weaponAnimCode = (user->fid & 0xF000) >> 12;
@@ -1120,9 +1120,9 @@ int _action_use_an_item_on_object(Object* user, Object* targetObj, Object* item)
int anim;
int objectType = FID_TYPE(targetObj->fid);
if (objectType == OBJ_TYPE_CRITTER && critterIsProne(targetObj)) {
if (objectType == OBJ_TYPE_CRITTER && _critter_is_prone(targetObj)) {
anim = ANIM_MAGIC_HANDS_GROUND;
} else if (objectType == OBJ_TYPE_SCENERY && (proto->scenery.extendedFlags & PROTO_EXT_FLAG_MAGIC_HANDS_GROUND) != 0) {
} else if (objectType == OBJ_TYPE_SCENERY && (proto->scenery.extendedFlags & 0x01) != 0) {
anim = ANIM_MAGIC_HANDS_GROUND;
} else {
anim = ANIM_MAGIC_HANDS_MIDDLE;
@@ -1134,9 +1134,9 @@ int _action_use_an_item_on_object(Object* user, Object* targetObj, Object* item)
if (item != nullptr) {
// TODO: Get rid of cast.
animationRegisterCallback3(user, targetObj, item, (AnimationCallback3*)objectUseItemOn, -1);
animationRegisterCallback3(user, targetObj, item, (AnimationCallback3*)_obj_use_item_on, -1);
} else {
animationRegisterCallback(user, targetObj, (AnimationCallback*)objectUse, -1);
animationRegisterCallback(user, targetObj, (AnimationCallback*)_obj_use, -1);
}
if (weaponAnimCode != 0) {
@@ -1182,7 +1182,7 @@ int actionPickUp(Object* critter, Object* item)
}
animationRegisterCallbackForced(critter, item, (AnimationCallback*)_is_next_to, -1);
animationRegisterCallback(critter, item, (AnimationCallback*)checkSceneryUseActionPointCost, -1);
animationRegisterCallback(critter, item, (AnimationCallback*)_check_scenery_ap_cost, -1);
Proto* itemProto;
protoGetProto(item->pid, &itemProto);
@@ -1207,7 +1207,7 @@ int actionPickUp(Object* critter, Object* item)
animationRegisterPlaySoundEffect(item, sfx, actionFrame);
}
animationRegisterCallback(critter, item, (AnimationCallback*)objectPickup, actionFrame);
animationRegisterCallback(critter, item, (AnimationCallback*)_obj_pickup, actionFrame);
} else {
int weaponAnimationCode = (critter->fid & 0xF000) >> 12;
if (weaponAnimationCode != 0) {
@@ -1235,7 +1235,7 @@ int actionPickUp(Object* critter, Object* item)
}
if (item->frame != 1) {
animationRegisterCallback(critter, item, (AnimationCallback*)objectUseContainer, actionFrame);
animationRegisterCallback(critter, item, (AnimationCallback*)_obj_use_container, actionFrame);
}
if (weaponAnimationCode != 0) {
@@ -1263,7 +1263,7 @@ int _action_loot_container(Object* critter, Object* container)
}
// SFALL: Fix for trying to loot corpses with the "NoSteal" flag.
if (critterFlagCheck(container->pid, CRITTER_NO_STEAL)) {
if (_critter_flag_check(container->pid, CRITTER_NO_STEAL)) {
return -1;
}
@@ -1288,7 +1288,7 @@ int _action_loot_container(Object* critter, Object* container)
}
animationRegisterCallbackForced(critter, container, (AnimationCallback*)_is_next_to, -1);
animationRegisterCallback(critter, container, (AnimationCallback*)checkSceneryUseActionPointCost, -1);
animationRegisterCallback(critter, container, (AnimationCallback*)_check_scenery_ap_cost, -1);
animationRegisterCallback(critter, container, (AnimationCallback*)scriptsRequestLooting, -1);
return reg_anim_end();
}
@@ -1494,7 +1494,7 @@ int actionUseSkill(Object* user, Object* target, int skill)
animationRegisterCallbackForced(performer, target, (AnimationCallback*)_is_next_to, -1);
int anim = (FID_TYPE(target->fid) == OBJ_TYPE_CRITTER && critterIsProne(target)) ? ANIM_MAGIC_HANDS_GROUND : ANIM_MAGIC_HANDS_MIDDLE;
int anim = (FID_TYPE(target->fid) == OBJ_TYPE_CRITTER && _critter_is_prone(target)) ? ANIM_MAGIC_HANDS_GROUND : ANIM_MAGIC_HANDS_MIDDLE;
int fid = buildFid(OBJ_TYPE_CRITTER, performer->fid & 0xFFF, anim, 0, performer->rotation + 1);
CacheEntry* artHandle;
@@ -1506,7 +1506,7 @@ int actionUseSkill(Object* user, Object* target, int skill)
animationRegisterAnimate(performer, anim, -1);
// TODO: Get rid of casts.
animationRegisterCallback3(performer, target, (void*)(uintptr_t)skill, (AnimationCallback3*)objectUseSkillOn, -1);
animationRegisterCallback3(performer, target, (void*)(uintptr_t)skill, (AnimationCallback3*)_obj_use_skill_on, -1);
return reg_anim_end();
}
@@ -1753,7 +1753,7 @@ int _report_explosion(Attack* attack, Object* sourceObj)
xp += critterGetExp(attack->defender);
}
} else {
critterSetWhoHitMe(attack->defender, sourceObj);
_critter_set_who_hit_me(attack->defender, sourceObj);
anyDefender = attack->defender;
}
}
@@ -1766,7 +1766,7 @@ int _report_explosion(Attack* attack, Object* sourceObj)
xp += critterGetExp(critter);
}
} else {
critterSetWhoHitMe(critter, sourceObj);
_critter_set_who_hit_me(critter, sourceObj);
if (anyDefender == nullptr) {
anyDefender = critter;
@@ -1972,7 +1972,7 @@ int _report_dmg(Attack* attack, Object* _)
// 0x413660
int _compute_dmg_damage(int min, int max, Object* obj, int* knockbackDistancePtr, int damageType)
{
if (!critterFlagCheck(obj->pid, CRITTER_NO_KNOCKBACK)) {
if (!_critter_flag_check(obj->pid, CRITTER_NO_KNOCKBACK)) {
knockbackDistancePtr = nullptr;
}
@@ -2046,7 +2046,7 @@ int actionPush(Object* obj, Object* target)
}
int sid;
if (objectGetSid(target, &sid) == 0) {
if (_obj_sid(target, &sid) == 0) {
scriptSetObjects(sid, obj, target);
scriptExecProc(sid, SCRIPT_PROC_PUSH);
+24 -24
View File
@@ -1418,7 +1418,7 @@ static int animationRunSequence(int animationSequenceIndex)
rc = _anim_animate(animationDescription->owner, animationDescription->anim, animationSequenceIndex, ANIM_SAD_FOREVER);
break;
case ANIM_KIND_ROTATE_TO_TILE:
if (!critterIsProne(animationDescription->owner)) {
if (!_critter_is_prone(animationDescription->owner)) {
int rotation = tileGetRotationTo(animationDescription->owner->tile, animationDescription->tile);
_dude_stand(animationDescription->owner, rotation, -1);
}
@@ -1637,7 +1637,7 @@ static int _anim_set_end(int animationSequenceIndex)
}
}
if ((animationSequence->flags & ANIM_SEQ_NO_STAND) == 0 && !critterIsProne(owner)) {
if ((animationSequence->flags & ANIM_SEQ_NO_STAND) == 0 && !_critter_is_prone(owner)) {
_dude_stand(owner, owner->rotation, -1);
}
}
@@ -1755,7 +1755,7 @@ int pathfinderFindPath(Object* object, int from, int to, unsigned char* rotation
int toScreenX;
int toScreenY;
tileToScreenXY(to, &toScreenX, &toScreenY);
tileToScreenXY(to, &toScreenX, &toScreenY, object->elevation);
int closedPathNodeListLength = 0;
int openPathNodeListLength = 1;
@@ -1840,7 +1840,7 @@ int pathfinderFindPath(Object* object, int from, int to, unsigned char* rotation
int newX;
int newY;
tileToScreenXY(tile, &newX, &newY);
tileToScreenXY(tile, &newX, &newY, object->elevation);
v27->estimate = _idist(newX, newY, toScreenX, toScreenY);
v27->cost = temp.cost + 50;
@@ -1940,11 +1940,11 @@ static int _tile_idistance(int tile1, int tile2)
{
int x1;
int y1;
tileToScreenXY(tile1, &x1, &y1);
tileToScreenXY(tile1, &x1, &y1, gElevation);
int x2;
int y2;
tileToScreenXY(tile2, &x2, &y2);
tileToScreenXY(tile2, &x2, &y2, gElevation);
return _idist(x1, y1, x2, y2);
}
@@ -1977,13 +1977,13 @@ int _make_straight_path_func(Object* obj, int from, int to, StraightPathNode* st
int fromX;
int fromY;
tileToScreenXY(from, &fromX, &fromY);
tileToScreenXY(from, &fromX, &fromY, obj->elevation);
fromX += 16;
fromY += 8;
int toX;
int toY;
tileToScreenXY(to, &toX, &toY);
tileToScreenXY(to, &toX, &toY, obj->elevation);
toX += 16;
toY += 8;
@@ -2021,7 +2021,7 @@ int _make_straight_path_func(Object* obj, int from, int to, StraightPathNode* st
if (ddx <= ddy) {
int middle = ddx - ddy / 2;
while (true) {
tile = tileFromScreenXY(tileX, tileY);
tile = tileFromScreenXY(tileX, tileY, obj->elevation);
v22 += 1;
if (v22 == a6) {
@@ -2034,7 +2034,7 @@ int _make_straight_path_func(Object* obj, int from, int to, StraightPathNode* st
pathNode->tile = tile;
pathNode->elevation = obj->elevation;
tileToScreenXY(tile, &fromX, &fromY);
tileToScreenXY(tile, &fromX, &fromY, obj->elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
@@ -2074,7 +2074,7 @@ int _make_straight_path_func(Object* obj, int from, int to, StraightPathNode* st
} else {
int middle = ddy - ddx / 2;
while (true) {
tile = tileFromScreenXY(tileX, tileY);
tile = tileFromScreenXY(tileX, tileY, obj->elevation);
v22 += 1;
if (v22 == a6) {
@@ -2087,7 +2087,7 @@ int _make_straight_path_func(Object* obj, int from, int to, StraightPathNode* st
pathNode->tile = tile;
pathNode->elevation = obj->elevation;
tileToScreenXY(tile, &fromX, &fromY);
tileToScreenXY(tile, &fromX, &fromY, obj->elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
@@ -2136,7 +2136,7 @@ int _make_straight_path_func(Object* obj, int from, int to, StraightPathNode* st
pathNode->tile = tile;
pathNode->elevation = obj->elevation;
tileToScreenXY(tile, &fromX, &fromY);
tileToScreenXY(tile, &fromX, &fromY, obj->elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
@@ -2201,13 +2201,13 @@ int _make_stair_path(Object* object, int from, int fromElevation, int to, int to
int fromX;
int fromY;
tileToScreenXY(from, &fromX, &fromY);
tileToScreenXY(from, &fromX, &fromY, fromElevation);
fromX += 16;
fromY += 8;
int toX;
int toY;
tileToScreenXY(to, &toX, &toY);
tileToScreenXY(to, &toX, &toY, toElevation);
toX += 16;
toY += 8;
@@ -2250,7 +2250,7 @@ int _make_stair_path(Object* object, int from, int fromElevation, int to, int to
if (ddx > ddy) {
int middle = ddy - ddx / 2;
while (true) {
tile = tileFromScreenXY(tileX, tileY);
tile = tileFromScreenXY(tileX, tileY, elevation);
iteration += 1;
if (iteration == 16) {
@@ -2263,7 +2263,7 @@ int _make_stair_path(Object* object, int from, int fromElevation, int to, int to
pathNode->tile = tile;
pathNode->elevation = elevation;
tileToScreenXY(tile, &fromX, &fromY);
tileToScreenXY(tile, &fromX, &fromY, elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
@@ -2297,7 +2297,7 @@ int _make_stair_path(Object* object, int from, int fromElevation, int to, int to
} else {
int middle = ddx - ddy / 2;
while (true) {
tile = tileFromScreenXY(tileX, tileY);
tile = tileFromScreenXY(tileX, tileY, elevation);
iteration += 1;
if (iteration == 16) {
@@ -2310,7 +2310,7 @@ int _make_stair_path(Object* object, int from, int fromElevation, int to, int to
pathNode->tile = tile;
pathNode->elevation = elevation;
tileToScreenXY(tile, &fromX, &fromY);
tileToScreenXY(tile, &fromX, &fromY, elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
@@ -2353,7 +2353,7 @@ int _make_stair_path(Object* object, int from, int fromElevation, int to, int to
pathNode->tile = tile;
pathNode->elevation = elevation;
tileToScreenXY(tile, &fromX, &fromY);
tileToScreenXY(tile, &fromX, &fromY, elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
@@ -2613,7 +2613,7 @@ static void _object_move(int index)
}
nextTile = -1;
} else {
objectUseDoor(object, obstacle, 0);
_obj_use_door(object, obstacle, 0);
}
}
@@ -2962,7 +2962,7 @@ int _check_move(int* actionPointsPtr)
int y;
mouseGetPosition(&x, &y);
int tile = tileFromScreenXY(x, y);
int tile = tileFromScreenXY(x, y, gElevation);
if (tile == -1) {
return -1;
}
@@ -3219,7 +3219,7 @@ void _dude_standup(Object* a1)
// 0x4185EC
static int actionRotate(Object* obj, int delta, int animationSequenceIndex)
{
if (!critterIsProne(obj)) {
if (!_critter_is_prone(obj)) {
int rotation = obj->rotation + delta;
if (rotation >= ROTATION_COUNT) {
rotation = ROTATION_NE;
@@ -3293,7 +3293,7 @@ static int _check_gravity(int tile, int elevation)
for (; elevation > 0; elevation--) {
int x;
int y;
tileToScreenXY(tile, &x, &y);
tileToScreenXY(tile, &x, &y, elevation);
int squareTile = squareTileFromScreenXY(x + 2, y + 8, elevation);
int fid = buildFid(OBJ_TYPE_TILE, _square[elevation]->field_0[squareTile] & 0xFFF, 0, 0, 0);
+53 -51
View File
@@ -542,72 +542,72 @@ int artCopyFileName(int objectType, int id, char* dest)
}
// 0x419314
int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* animationCodePtr)
int _art_get_code(int animation, int weaponType, char* a3, char* a4)
{
if (weaponType < 0 || weaponType >= WEAPON_ANIMATION_COUNT) {
return -1;
}
if (animation >= ANIM_TAKE_OUT && animation <= ANIM_FIRE_CONTINUOUS) {
*animationCodePtr = 'c' + (animation - ANIM_TAKE_OUT);
*a4 = 'c' + (animation - ANIM_TAKE_OUT);
if (weaponType == WEAPON_ANIMATION_NONE) {
return -1;
}
*weaponCodePtr = 'd' + (weaponType - 1);
*a3 = 'd' + (weaponType - 1);
return 0;
} else if (animation == ANIM_PRONE_TO_STANDING) {
*animationCodePtr = 'h';
*weaponCodePtr = 'c';
*a4 = 'h';
*a3 = 'c';
return 0;
} else if (animation == ANIM_BACK_TO_STANDING) {
*animationCodePtr = 'j';
*weaponCodePtr = 'c';
*a4 = 'j';
*a3 = 'c';
return 0;
} else if (animation == ANIM_CALLED_SHOT_PIC) {
*animationCodePtr = 'a';
*weaponCodePtr = 'n';
*a4 = 'a';
*a3 = 'n';
return 0;
} else if (animation >= FIRST_SF_DEATH_ANIM) {
*animationCodePtr = 'a' + (animation - FIRST_SF_DEATH_ANIM);
*weaponCodePtr = 'r';
*a4 = 'a' + (animation - FIRST_SF_DEATH_ANIM);
*a3 = 'r';
return 0;
} else if (animation >= FIRST_KNOCKDOWN_AND_DEATH_ANIM) {
*animationCodePtr = 'a' + (animation - FIRST_KNOCKDOWN_AND_DEATH_ANIM);
*weaponCodePtr = 'b';
*a4 = 'a' + (animation - FIRST_KNOCKDOWN_AND_DEATH_ANIM);
*a3 = 'b';
return 0;
} else if (animation == ANIM_THROW_ANIM) {
if (weaponType == WEAPON_ANIMATION_KNIFE) {
// knife
*weaponCodePtr = 'd';
*animationCodePtr = 'm';
*a3 = 'd';
*a4 = 'm';
} else if (weaponType == WEAPON_ANIMATION_SPEAR) {
// spear
*weaponCodePtr = 'g';
*animationCodePtr = 'm';
*a3 = 'g';
*a4 = 'm';
} else {
// other -> probably rock or grenade
*weaponCodePtr = 'a';
*animationCodePtr = 's';
*a3 = 'a';
*a4 = 's';
}
return 0;
} else if (animation == ANIM_DODGE_ANIM) {
if (weaponType <= 0) {
*weaponCodePtr = 'a';
*animationCodePtr = 'n';
*a3 = 'a';
*a4 = 'n';
} else {
*weaponCodePtr = 'd' + (weaponType - 1);
*animationCodePtr = 'e';
*a3 = 'd' + (weaponType - 1);
*a4 = 'e';
}
return 0;
}
*animationCodePtr = 'a' + animation;
*a4 = 'a' + animation;
if (animation <= ANIM_WALK && weaponType > 0) {
*weaponCodePtr = 'd' + (weaponType - 1);
*a3 = 'd' + (weaponType - 1);
return 0;
}
*weaponCodePtr = 'a';
*a3 = 'a';
return 0;
}
@@ -615,51 +615,53 @@ int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* anim
// 0x419428
char* artBuildFilePath(int fid)
{
int baseFid = fid;
int rotation = FID_ROTATION(fid);
int v1, v2, v3, v4, v5, type, v8, v10;
char v9, v11, v12;
int aliasFid = artAliasFid(fid);
if (aliasFid != -1) {
baseFid = aliasFid;
v2 = fid;
v10 = FID_ROTATION(fid);
v1 = artAliasFid(fid);
if (v1 != -1) {
v2 = v1;
}
*_art_name = '\0';
int frmId = baseFid & 0xFFF;
int animType = FID_ANIM_TYPE(baseFid);
int weaponCode = (baseFid & 0xF000) >> 12;
int objectType = FID_TYPE(baseFid);
v3 = v2 & 0xFFF;
v4 = FID_ANIM_TYPE(v2);
v5 = (v2 & 0xF000) >> 12;
type = FID_TYPE(v2);
if (objectType < OBJ_TYPE_ITEM || objectType >= OBJ_TYPE_COUNT) {
if (type < OBJ_TYPE_ITEM || type >= OBJ_TYPE_COUNT) {
return nullptr;
}
if (frmId >= gArtListDescriptions[objectType].fileNamesLength) {
if (v3 >= gArtListDescriptions[type].fileNamesLength) {
return nullptr;
}
int fileNameOffset = frmId * 13;
v8 = v3 * 13;
if (objectType == OBJ_TYPE_CRITTER) {
char critterWeaponCode;
char critterAnimationCode;
if (_art_get_code(animType, weaponCode, &critterWeaponCode, &critterAnimationCode) == -1) {
if (type == 1) {
if (_art_get_code(v4, v5, &v11, &v12) == -1) {
return nullptr;
}
if (rotation != 0) {
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s%c%c.fr%c", _cd_path_base, "art\\", gArtListDescriptions[OBJ_TYPE_CRITTER].name, gArtListDescriptions[OBJ_TYPE_CRITTER].fileNames + fileNameOffset, critterWeaponCode, critterAnimationCode, rotation + 47);
if (v10) {
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s%c%c.fr%c", _cd_path_base, "art\\", gArtListDescriptions[1].name, gArtListDescriptions[1].fileNames + v8, v11, v12, v10 + 47);
} else {
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s%c%c.frm", _cd_path_base, "art\\", gArtListDescriptions[OBJ_TYPE_CRITTER].name, gArtListDescriptions[OBJ_TYPE_CRITTER].fileNames + fileNameOffset, critterWeaponCode, critterAnimationCode);
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s%c%c.frm", _cd_path_base, "art\\", gArtListDescriptions[1].name, gArtListDescriptions[1].fileNames + v8, v11, v12);
}
} else if (objectType == OBJ_TYPE_HEAD) {
char headSuffix = _head2[animType];
if (headSuffix == 'f') {
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s%c%c%d.frm", _cd_path_base, "art\\", gArtListDescriptions[OBJ_TYPE_HEAD].name, gArtListDescriptions[OBJ_TYPE_HEAD].fileNames + fileNameOffset, _head1[animType], 102, weaponCode);
} else if (type == 8) {
v9 = _head2[v4];
if (v9 == 'f') {
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s%c%c%d.frm", _cd_path_base, "art\\", gArtListDescriptions[8].name, gArtListDescriptions[8].fileNames + v8, _head1[v4], 102, v5);
} else {
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s%c%c.frm", _cd_path_base, "art\\", gArtListDescriptions[OBJ_TYPE_HEAD].name, gArtListDescriptions[OBJ_TYPE_HEAD].fileNames + fileNameOffset, _head1[animType], headSuffix);
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s%c%c.frm", _cd_path_base, "art\\", gArtListDescriptions[8].name, gArtListDescriptions[8].fileNames + v8, _head1[v4], v9);
}
} else {
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s", _cd_path_base, "art\\", gArtListDescriptions[objectType].name, gArtListDescriptions[objectType].fileNames + fileNameOffset);
snprintf(_art_name, sizeof(_art_name), "%s%s%s\\%s", _cd_path_base, "art\\", gArtListDescriptions[type].name, gArtListDescriptions[type].fileNames + v8);
}
return _art_name;
+3 -3
View File
@@ -129,8 +129,8 @@ unsigned char* artLockFrameData(int fid, int frame, int direction, CacheEntry**
unsigned char* artLockFrameDataReturningSize(int fid, CacheEntry** out_cache_entry, int* widthPtr, int* heightPtr);
int artUnlock(CacheEntry* cache_entry);
int artCacheFlush();
int artCopyFileName(int objectType, int id, char* dest);
int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* animationCodePtr);
int artCopyFileName(int objectType, int id, char* a3);
int _art_get_code(int animation, int weaponType, char* a3, char* a4);
char* artBuildFilePath(int fid);
int artGetFramesPerSecond(Art* art);
int artGetActionFrame(Art* art);
@@ -138,7 +138,7 @@ int artGetFrameCount(Art* art);
int artGetWidth(Art* art, int frame, int direction);
int artGetHeight(Art* art, int frame, int direction);
int artGetSize(Art* art, int frame, int direction, int* out_width, int* out_height);
int artGetFrameOffsets(Art* art, int frame, int direction, int* xPtr, int* yPtr);
int artGetFrameOffsets(Art* art, int frame, int direction, int* a4, int* a5);
int artGetRotationOffsets(Art* art, int rotation, int* out_offset_x, int* out_offset_y);
unsigned char* artGetFrameData(Art* art, int frame, int direction);
ArtFrame* artGetFrame(Art* art, int frame, int direction);
+6 -6
View File
@@ -148,7 +148,7 @@ long audioSeek(int handle, long offset, int origin)
{
int pos;
unsigned char* buf;
int remainingBytesToSkip;
int v10;
Audio* audioFile = &(gAudioList[handle - 1]);
@@ -189,14 +189,14 @@ long audioSeek(int handle, long offset, int origin)
}
} else {
buf = (unsigned char*)internal_malloc_safe(1024, __FILE__, __LINE__); // "..\int\audio.c", 321
remainingBytesToSkip = audioFile->position - pos;
while (remainingBytesToSkip > 1024) {
remainingBytesToSkip -= 1024;
v10 = audioFile->position - pos;
while (v10 > 1024) {
v10 -= 1024;
audioRead(handle, buf, 1024);
}
if (remainingBytesToSkip != 0) {
audioRead(handle, buf, remainingBytesToSkip);
if (v10 != 0) {
audioRead(handle, buf, v10);
}
// TODO: Probably leaks memory.
+11 -11
View File
@@ -148,26 +148,26 @@ long audioFileSeek(int handle, long offset, int origin)
{
void* buf;
int remaining;
int targetPosition;
int a4;
AudioFile* audioFile = &(gAudioFileList[handle - 1]);
switch (origin) {
case SEEK_SET:
targetPosition = offset;
a4 = offset;
break;
case SEEK_CUR:
targetPosition = audioFile->fileSize + offset;
a4 = audioFile->fileSize + offset;
break;
case SEEK_END:
targetPosition = audioFile->position + offset;
a4 = audioFile->position + offset;
break;
default:
assert(false && "Should be unreachable");
}
if ((audioFile->flags & AUDIO_FILE_COMPRESSED) != 0) {
if (targetPosition <= audioFile->position) {
if (a4 <= audioFile->position) {
soundDecoderFree(audioFile->soundDecoder);
fseek(audioFile->stream, 0, 0);
@@ -176,20 +176,20 @@ long audioFileSeek(int handle, long offset, int origin)
audioFile->fileSize *= 2;
audioFile->position = 0;
if (targetPosition != 0) {
if (a4) {
buf = internal_malloc_safe(4096, __FILE__, __LINE__); // "..\int\audiof.c", 364
while (targetPosition > 4096) {
while (a4 > 4096) {
audioFileRead(handle, buf, 4096);
targetPosition -= 4096;
a4 -= 4096;
}
if (targetPosition != 0) {
audioFileRead(handle, buf, targetPosition);
if (a4 != 0) {
audioFileRead(handle, buf, a4);
}
internal_free_safe(buf, __FILE__, __LINE__); // "..\int\audiof.c", 370
}
} else {
buf = internal_malloc_safe(0x400, __FILE__, __LINE__); // "..\int\audiof.c", 316
remaining = audioFile->position - targetPosition;
remaining = audioFile->position - a4;
while (remaining > 1024) {
audioFileRead(handle, buf, 1024);
remaining -= 1024;
+25 -25
View File
@@ -373,7 +373,7 @@ void automapShow(bool isInGame, bool isUsingScanner)
frmImages[AUTOMAP_FRM_SWITCH_UP].getData(),
frmImages[AUTOMAP_FRM_SWITCH_DOWN].getData(),
nullptr,
BUTTON_FLAG_TRANSPARENT | BUTTON_FLAG_CHECKABLE);
BUTTON_FLAG_TRANSPARENT | BUTTON_FLAG_0x01);
if (switchBtn != -1) {
buttonSetCallbacks(switchBtn, _gsound_toggle_butt_press_, _gsound_toggle_butt_press_);
}
@@ -550,7 +550,7 @@ static void automapRenderInMapWindow(int window, int elevation, unsigned char* b
}
}
int pixelOffset = -2 * (object->tile % 200) - 10 + AUTOMAP_WINDOW_WIDTH * (2 * (object->tile / 200) + 9) - 60;
int v10 = -2 * (object->tile % 200) - 10 + AUTOMAP_WINDOW_WIDTH * (2 * (object->tile / 200) + 9) - 60;
if ((flags & AUTOMAP_IN_GAME) == 0) {
switch (objectType) {
case OBJ_TYPE_ITEM:
@@ -574,28 +574,28 @@ static void automapRenderInMapWindow(int window, int elevation, unsigned char* b
}
if (objectColor != _colorTable[0]) {
unsigned char* pixel = windowBuffer + pixelOffset;
unsigned char* v12 = windowBuffer + v10;
if ((flags & AUTOMAP_IN_GAME) != 0) {
if (*pixel != _colorTable[992] || objectColor != _colorTable[480]) {
pixel[0] = objectColor;
pixel[1] = objectColor;
if (*v12 != _colorTable[992] || objectColor != _colorTable[480]) {
v12[0] = objectColor;
v12[1] = objectColor;
}
if (object == gDude) {
pixel[-1] = objectColor;
pixel[-AUTOMAP_WINDOW_WIDTH] = objectColor;
pixel[AUTOMAP_WINDOW_WIDTH] = objectColor;
v12[-1] = objectColor;
v12[-AUTOMAP_WINDOW_WIDTH] = objectColor;
v12[AUTOMAP_WINDOW_WIDTH] = objectColor;
}
} else {
pixel[0] = objectColor;
pixel[1] = objectColor;
pixel[AUTOMAP_WINDOW_WIDTH] = objectColor;
pixel[AUTOMAP_WINDOW_WIDTH + 1] = objectColor;
v12[0] = objectColor;
v12[1] = objectColor;
v12[AUTOMAP_WINDOW_WIDTH] = objectColor;
v12[AUTOMAP_WINDOW_WIDTH + 1] = objectColor;
pixel[AUTOMAP_WINDOW_WIDTH - 1] = objectColor;
pixel[AUTOMAP_WINDOW_WIDTH + 2] = objectColor;
pixel[AUTOMAP_WINDOW_WIDTH * 2] = objectColor;
pixel[AUTOMAP_WINDOW_WIDTH * 2 + 1] = objectColor;
v12[AUTOMAP_WINDOW_WIDTH - 1] = objectColor;
v12[AUTOMAP_WINDOW_WIDTH + 2] = objectColor;
v12[AUTOMAP_WINDOW_WIDTH * 2] = objectColor;
v12[AUTOMAP_WINDOW_WIDTH * 2 + 1] = objectColor;
}
}
}
@@ -639,8 +639,8 @@ int automapRenderInPipboyWindow(int window, int map, int elevation)
return -1;
}
int bitsRemaining = 0; // Number of 2-bit tile entries left in `byte`.
unsigned char byte = 0;
int v1 = 0;
unsigned char v2 = 0;
unsigned char* ptr = gAutomapEntry.data;
// FIXME: This loop is implemented incorrectly. Automap requires 400x400 px,
@@ -650,13 +650,13 @@ int automapRenderInPipboyWindow(int window, int map, int elevation)
// crash.
for (int y = 0; y < HEX_GRID_HEIGHT; y++) {
for (int x = 0; x < HEX_GRID_WIDTH; x++) {
bitsRemaining -= 1;
if (bitsRemaining <= 0) {
bitsRemaining = 4;
byte = *ptr++;
v1 -= 1;
if (v1 <= 0) {
v1 = 4;
v2 = *ptr++;
}
switch ((byte & 0xC0) >> 6) {
switch ((v2 & 0xC0) >> 6) {
case 1:
*windowBuffer++ = wallColor;
*windowBuffer++ = wallColor;
@@ -670,7 +670,7 @@ int automapRenderInPipboyWindow(int window, int map, int elevation)
break;
}
byte <<= 2;
v2 <<= 2;
}
windowBuffer += 640 + 240;
+12 -12
View File
@@ -575,26 +575,26 @@ static bool cacheSetCapacity(Cache* cache, int newCapacity)
// 0x420A74
static int cacheEntriesCompareByUsage(const void* a1, const void* a2)
{
CacheEntry* lhs = *(CacheEntry**)a1;
CacheEntry* rhs = *(CacheEntry**)a2;
CacheEntry* v1 = *(CacheEntry**)a1;
CacheEntry* v2 = *(CacheEntry**)a2;
if (lhs->referenceCount != 0 && rhs->referenceCount == 0) {
if (v1->referenceCount != 0 && v2->referenceCount == 0) {
return 1;
}
if (rhs->referenceCount != 0 && lhs->referenceCount == 0) {
if (v2->referenceCount != 0 && v1->referenceCount == 0) {
return -1;
}
if (lhs->hits < rhs->hits) {
if (v1->hits < v2->hits) {
return -1;
} else if (lhs->hits > rhs->hits) {
} else if (v1->hits > v2->hits) {
return 1;
}
if (lhs->mru < rhs->mru) {
if (v1->mru < v2->mru) {
return -1;
} else if (lhs->mru > rhs->mru) {
} else if (v1->mru > v2->mru) {
return 1;
}
@@ -604,12 +604,12 @@ static int cacheEntriesCompareByUsage(const void* a1, const void* a2)
// 0x420AE8
static int cacheEntriesCompareByMostRecentHit(const void* a1, const void* a2)
{
CacheEntry* lhs = *(CacheEntry**)a1;
CacheEntry* rhs = *(CacheEntry**)a2;
CacheEntry* v1 = *(CacheEntry**)a1;
CacheEntry* v2 = *(CacheEntry**)a2;
if (lhs->mru < rhs->mru) {
if (v1->mru < v2->mru) {
return 1;
} else if (lhs->mru > rhs->mru) {
} else if (v1->mru > v2->mru) {
return -1;
} else {
return 0;
+6 -6
View File
@@ -3627,7 +3627,7 @@ static void characterEditorEditGender()
_editorFrmImages[EDITOR_GRAPHIC_MALE_OFF].getData(),
_editorFrmImages[EDITOR_GRAPHIC_MALE_ON].getData(),
nullptr,
BUTTON_FLAG_TRANSPARENT | BUTTON_FLAG_NO_TOGGLE_OFF | BUTTON_FLAG_CHECK_ON_DOWN | BUTTON_FLAG_CHECKABLE);
BUTTON_FLAG_TRANSPARENT | BUTTON_FLAG_0x04 | BUTTON_FLAG_0x02 | BUTTON_FLAG_0x01);
if (btns[0] != -1) {
buttonSetCallbacks(doneBtn, _gsound_red_butt_press, nullptr);
}
@@ -3644,7 +3644,7 @@ static void characterEditorEditGender()
_editorFrmImages[EDITOR_GRAPHIC_FEMALE_OFF].getData(),
_editorFrmImages[EDITOR_GRAPHIC_FEMALE_ON].getData(),
nullptr,
BUTTON_FLAG_TRANSPARENT | BUTTON_FLAG_NO_TOGGLE_OFF | BUTTON_FLAG_CHECK_ON_DOWN | BUTTON_FLAG_CHECKABLE);
BUTTON_FLAG_TRANSPARENT | BUTTON_FLAG_0x04 | BUTTON_FLAG_0x02 | BUTTON_FLAG_0x01);
if (btns[1] != -1) {
_win_group_radio_buttons(2, btns);
buttonSetCallbacks(doneBtn, _gsound_red_butt_press, nullptr);
@@ -3946,7 +3946,7 @@ static int characterEditorShowOptions()
strcat(string4, "TXT");
char** fileList;
int fileListLength = fileNameListInit(string4, &fileList);
int fileListLength = fileNameListInit(string4, &fileList, 0, 0);
if (fileListLength != -1) {
// PRINT
strcpy(string1, getmsg(&gCharacterEditorMessageList, &gCharacterEditorMessageListItem, 616));
@@ -4018,7 +4018,7 @@ static int characterEditorShowOptions()
strcat(string4, "GCD");
char** fileNameList;
int fileNameListLength = fileNameListInit(string4, &fileNameList);
int fileNameListLength = fileNameListInit(string4, &fileNameList, 0, 0);
if (fileNameListLength != -1) {
// NOTE: This value is not copied as in save dialog.
char* title = getmsg(&gCharacterEditorMessageList, &gCharacterEditorMessageListItem, 601);
@@ -4111,7 +4111,7 @@ static int characterEditorShowOptions()
strcat(string4, "GCD");
char** fileNameList;
int fileNameListLength = fileNameListInit(string4, &fileNameList);
int fileNameListLength = fileNameListInit(string4, &fileNameList, 0, 0);
if (fileNameListLength != -1) {
strcpy(string1, getmsg(&gCharacterEditorMessageList, &gCharacterEditorMessageListItem, 617));
strcpy(string4, getmsg(&gCharacterEditorMessageList, &gCharacterEditorMessageListItem, 600));
@@ -4198,7 +4198,7 @@ static int characterEditorShowOptions()
strcpy(pattern, "*.TXT");
char** fileNames;
int filesCount = fileNameListInit(pattern, &fileNames);
int filesCount = fileNameListInit(pattern, &fileNames, 0, 0);
if (filesCount == -1) {
soundPlayFile("iisxxxx1");
+3 -3
View File
@@ -77,7 +77,7 @@ typedef enum PremadeCharacter {
typedef struct PremadeCharacterDescription {
char fileName[20];
int face;
char vid[20];
char field_18[20];
} PremadeCharacterDescription;
static bool characterSelectorWindowInit();
@@ -959,7 +959,7 @@ void premadeCharactersInit()
faceFidsString = pch + 1;
gCustomPremadeCharacterDescriptions[index].vid[0] = '\0';
gCustomPremadeCharacterDescriptions[index].field_18[0] = '\0';
}
}
@@ -969,7 +969,7 @@ void premadeCharactersInit()
for (int index = 0; index < PREMADE_CHARACTER_COUNT; index++) {
strcpy(gCustomPremadeCharacterDescriptions[index].fileName, gPremadeCharacterDescriptions[index].fileName);
gCustomPremadeCharacterDescriptions[index].face = gPremadeCharacterDescriptions[index].face;
strcpy(gCustomPremadeCharacterDescriptions[index].vid, gPremadeCharacterDescriptions[index].vid);
strcpy(gCustomPremadeCharacterDescriptions[index].field_18, gPremadeCharacterDescriptions[index].field_18);
}
}
+83 -71
View File
@@ -11,9 +11,9 @@
namespace fallout {
static void _setIntensityTableColor(int color);
static void _setIntensityTableColor(int a1);
static void _setIntensityTables();
static void _setMixTableColor(int color);
static void _setMixTableColor(int a1);
static void _buildBlendTable(unsigned char* ptr, unsigned char ch);
static void _rebuildColorBlendTables();
@@ -203,76 +203,88 @@ static void _setIntensityTables()
}
// 0x4C769C
static void _setMixTableColor(int color)
static void _setMixTableColor(int a1)
{
for (int otherColor = 0; otherColor < 256; otherColor++) {
if (_mappedColor[color] && _mappedColor[otherColor]) {
int colorRgb = Color2RGB(color);
int otherColorRgb = Color2RGB(otherColor);
int i;
int v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19;
int v20, v21, v22, v23, v24, v25, v26, v27, v28, v29;
int colorR = (colorRgb & 0x7C00) >> 10;
int colorG = (colorRgb & 0x3E0) >> 5;
int colorB = colorRgb & 0x1F;
for (i = 0; i < 256; i++) {
if (_mappedColor[a1] && _mappedColor[i]) {
v2 = (Color2RGB(a1) & 0x7C00) >> 10;
v3 = (Color2RGB(a1) & 0x3E0) >> 5;
v4 = (Color2RGB(a1) & 0x1F);
int otherColorR = (otherColorRgb & 0x7C00) >> 10;
int otherColorG = (otherColorRgb & 0x3E0) >> 5;
int otherColorB = otherColorRgb & 0x1F;
v5 = (Color2RGB(i) & 0x7C00) >> 10;
v6 = (Color2RGB(i) & 0x3E0) >> 5;
v7 = (Color2RGB(i) & 0x1F);
int addedR = colorR + otherColorR;
int addedG = colorG + otherColorG;
int addedB = colorB + otherColorB;
v8 = v2 + v5;
v9 = v3 + v6;
v10 = v4 + v7;
int maxAddedChannel = addedR;
if (addedG > maxAddedChannel) {
maxAddedChannel = addedG;
}
if (addedB > maxAddedChannel) {
maxAddedChannel = addedB;
v11 = v8;
if (v9 > v11) {
v11 = v9;
}
int additiveColor;
if (maxAddedChannel <= 0x1F) {
int paletteIndex = (addedR << 10) | (addedG << 5) | addedB;
additiveColor = _colorTable[paletteIndex];
if (v10 > v11) {
v11 = v10;
}
if (v11 <= 0x1F) {
int paletteIndex = (v8 << 10) | (v9 << 5) | v10;
v12 = _colorTable[paletteIndex];
} else {
int overflow = maxAddedChannel - 0x1F;
v13 = v11 - 0x1F;
int normalizedR = addedR - overflow;
int normalizedG = addedG - overflow;
int normalizedB = addedB - overflow;
v14 = v8 - v13;
v15 = v9 - v13;
v16 = v10 - v13;
if (normalizedR < 0) {
normalizedR = 0;
}
if (normalizedG < 0) {
normalizedG = 0;
}
if (normalizedB < 0) {
normalizedB = 0;
if (v14 < 0) {
v14 = 0;
}
int saturatedPaletteIndex = (normalizedR << 10) | (normalizedG << 5) | normalizedB;
int saturatedColor = _colorTable[saturatedPaletteIndex];
if (v15 < 0) {
v15 = 0;
}
int intensity = (int)((((double)maxAddedChannel + (-31.0)) * 0.0078125 + 1.0) * 65536.0);
additiveColor = _calculateColor(intensity, saturatedColor);
if (v16 < 0) {
v16 = 0;
}
v17 = (v14 << 10) | (v15 << 5) | v16;
v18 = _colorTable[v17];
v19 = (int)((((double)v11 + (-31.0)) * 0.0078125 + 1.0) * 65536.0);
v12 = _calculateColor(v19, v18);
}
colorMixAddTable[color][otherColor] = additiveColor;
colorMixAddTable[a1][i] = v12;
int multipliedR = (colorR * otherColorR) >> 5;
int multipliedG = (colorG * otherColorG) >> 5;
int multipliedB = (colorB * otherColorB) >> 5;
v20 = (Color2RGB(a1) & 0x7C00) >> 10;
v21 = (Color2RGB(a1) & 0x3E0) >> 5;
v22 = (Color2RGB(a1) & 0x1F);
int multiplyPaletteIndex = (multipliedR << 10) | (multipliedG << 5) | multipliedB;
colorMixMulTable[color][otherColor] = _colorTable[multiplyPaletteIndex];
v23 = (Color2RGB(i) & 0x7C00) >> 10;
v24 = (Color2RGB(i) & 0x3E0) >> 5;
v25 = (Color2RGB(i) & 0x1F);
v26 = (v20 * v23) >> 5;
v27 = (v21 * v24) >> 5;
v28 = (v22 * v25) >> 5;
v29 = (v26 << 10) | (v27 << 5) | v28;
colorMixMulTable[a1][i] = _colorTable[v29];
} else {
if (_mappedColor[otherColor]) {
colorMixAddTable[color][otherColor] = otherColor;
colorMixMulTable[color][otherColor] = otherColor;
if (_mappedColor[i]) {
colorMixAddTable[a1][i] = i;
colorMixMulTable[a1][i] = i;
} else {
colorMixAddTable[color][otherColor] = color;
colorMixMulTable[color][otherColor] = color;
colorMixAddTable[a1][i] = a1;
colorMixMulTable[a1][i] = a1;
}
}
}
@@ -364,7 +376,7 @@ static void _buildBlendTable(unsigned char* ptr, unsigned char ch)
{
int r, g, b;
int i, j;
int mixedR, mixedG, mixedB;
int v12, v14, v16;
unsigned char* beg;
beg = ptr;
@@ -380,7 +392,7 @@ static void _buildBlendTable(unsigned char* ptr, unsigned char ch)
ptr += 256;
int b_1 = b;
int blendWeight = 6;
int v31 = 6;
int g_1 = g;
int r_1 = r;
@@ -390,31 +402,31 @@ static void _buildBlendTable(unsigned char* ptr, unsigned char ch)
for (j = 0; j < 7; j++) {
for (i = 0; i < 256; i++) {
mixedR = (Color2RGB(i) & 0x7C00) >> 10;
mixedG = (Color2RGB(i) & 0x3E0) >> 5;
mixedB = (Color2RGB(i) & 0x1F);
v12 = (Color2RGB(i) & 0x7C00) >> 10;
v14 = (Color2RGB(i) & 0x3E0) >> 5;
v16 = (Color2RGB(i) & 0x1F);
int index = 0;
index |= (r_2 + mixedR * blendWeight) / 7 << 10;
index |= (g_2 + mixedG * blendWeight) / 7 << 5;
index |= (b_2 + mixedB * blendWeight) / 7;
index |= (r_2 + v12 * v31) / 7 << 10;
index |= (g_2 + v14 * v31) / 7 << 5;
index |= (b_2 + v16 * v31) / 7;
ptr[i] = _colorTable[index];
}
blendWeight--;
v31--;
ptr += 256;
r_2 += r_1;
g_2 += g_1;
b_2 += b_1;
}
int shadeStep = 0;
int v18 = 0;
for (j = 0; j < 6; j++) {
int shadeIntensity = shadeStep / 7 + 0xFFFF;
int v20 = v18 / 7 + 0xFFFF;
for (i = 0; i < 256; i++) {
ptr[i] = _calculateColor(shadeIntensity, ch);
ptr[i] = _calculateColor(v20, ch);
}
shadeStep += 0x10000;
v18 += 0x10000;
ptr += 256;
}
}
@@ -450,15 +462,15 @@ unsigned char* _getColorBlendTable(int ch)
}
// 0x4C7E20
void _freeColorBlendTable(int color)
void _freeColorBlendTable(int a1)
{
unsigned char* blendTable = _blendTable[color];
if (blendTable != nullptr) {
int* count = (int*)(blendTable - sizeof(int));
unsigned char* v2 = _blendTable[a1];
if (v2 != nullptr) {
int* count = (int*)(v2 - sizeof(int));
*count -= 1;
if (*count == 0) {
internal_free(count);
_blendTable[color] = nullptr;
_blendTable[a1] = nullptr;
}
}
}
+2 -2
View File
@@ -24,11 +24,11 @@ void colorPaletteFadeBetween(unsigned char* oldPalette, unsigned char* newPalett
void colorPaletteSetTransitionCallback(ColorTransitionCallback* callback);
void _setSystemPalette(unsigned char* palette);
unsigned char* _getSystemPalette();
void _setSystemPaletteEntries(unsigned char* palette, int start, int end);
void _setSystemPaletteEntries(unsigned char* a1, int a2, int a3);
bool colorPaletteLoad(const char* path);
char* _colorError();
unsigned char* _getColorBlendTable(int ch);
void _freeColorBlendTable(int color);
void _freeColorBlendTable(int a1);
void colorSetBrightness(double value);
bool _initColors();
void _colorsClose();
+20 -20
View File
@@ -2839,7 +2839,7 @@ static void _combat_over()
gameMouseSetMode(GAME_MOUSE_MODE_MOVE);
interfaceRenderArmorClass(true);
if (critterIsProne(gDude) && !critterIsDead(gDude) && _combat_ending_guy == nullptr) {
if (_critter_is_prone(gDude) && !critterIsDead(gDude) && _combat_ending_guy == nullptr) {
queueRemoveEventsByType(gDude, EVENT_TYPE_KNOCKOUT);
knockoutEventProcess(gDude, nullptr);
}
@@ -3013,11 +3013,11 @@ static void _combat_sequence_init(Object* attacker, Object* defender)
_list_noncom -= next;
if (attacker != nullptr) {
critterSetWhoHitMe(attacker, defender);
_critter_set_who_hit_me(attacker, defender);
}
if (defender != nullptr) {
critterSetWhoHitMe(defender, attacker);
_critter_set_who_hit_me(defender, attacker);
}
}
@@ -3262,7 +3262,7 @@ static int _combat_turn(Object* obj, bool a2)
}
if (!scriptOverrides) {
if (!a2 && critterIsProne(obj)) {
if (!a2 && _critter_is_prone(obj)) {
_combat_standup(obj);
}
@@ -3552,7 +3552,7 @@ int _combat_attack(Object* attacker, Object* defender, int hitMode, int hitLocat
if (attacker == gDude) {
interfaceRenderActionPoints(attacker->data.critter.combat.ap, _combat_free_move);
critterSetWhoHitMe(attacker, defender);
_critter_set_who_hit_me(attacker, defender);
}
// SFALL
@@ -3845,14 +3845,14 @@ static int attackCompute(Attack* attack)
}
int attackType = weaponGetAttackTypeForHitMode(attack->weapon, attack->hitMode);
int roundsHitMainTarget = 1;
int ammoQuantity = 1;
int damageMultiplier = 2;
int roundsSpent = 1;
int v26 = 1;
int roll;
if (anim == ANIM_FIRE_BURST || anim == ANIM_FIRE_CONTINUOUS) {
roll = _compute_spray(attack, accuracy, &roundsHitMainTarget, &roundsSpent, anim);
roll = _compute_spray(attack, accuracy, &ammoQuantity, &v26, anim);
} else {
int chance = critterGetStat(attack->attacker, STAT_CRITICAL_CHANCE);
roll = randomRoll(accuracy, chance - hit_location_penalty[attack->defenderHitLocation], nullptr);
@@ -3890,7 +3890,7 @@ static int attackCompute(Attack* attack)
}
if (attackType == ATTACK_TYPE_RANGED) {
attack->ammoQuantity = roundsSpent;
attack->ammoQuantity = v26;
if (roll == ROLL_SUCCESS && attack->attacker == gDude) {
if (perkGetRank(gDude, PERK_SNIPER) != 0) {
@@ -3907,7 +3907,7 @@ static int attackCompute(Attack* attack)
}
}
if (weaponComputeAmmoCost(attack->weapon, &(attack->ammoQuantity)) == -1) {
if (_item_w_compute_ammo_cost(attack->weapon, &(attack->ammoQuantity)) == -1) {
return -1;
}
@@ -3928,7 +3928,7 @@ static int attackCompute(Attack* attack)
case ROLL_SUCCESS:
attack->attackerFlags |= DAM_HIT;
attackComputeEnhancedKnockout(attack);
attackComputeDamage(attack, roundsHitMainTarget, damageMultiplier);
attackComputeDamage(attack, ammoQuantity, damageMultiplier);
break;
case ROLL_FAILURE:
if (attackType == ATTACK_TYPE_RANGED || attackType == ATTACK_TYPE_THROW) {
@@ -4094,7 +4094,7 @@ void _compute_explosion_on_extras(Attack* attack, bool isFromAttacker, bool isGr
static int attackComputeCriticalHit(Attack* attack)
{
Object* defender = attack->defender;
if (defender != nullptr && critterFlagCheck(defender->pid, CRITTER_INVULNERABLE)) {
if (defender != nullptr && _critter_flag_check(defender->pid, CRITTER_INVULNERABLE)) {
return 2;
}
@@ -4168,7 +4168,7 @@ static int _attackFindInvalidFlags(Object* critter, Object* item)
{
int flags = 0;
if (critter != nullptr && PID_TYPE(critter->pid) == OBJ_TYPE_CRITTER && critterFlagCheck(critter->pid, CRITTER_NO_DROP)) {
if (critter != nullptr && PID_TYPE(critter->pid) == OBJ_TYPE_CRITTER && _critter_flag_check(critter->pid, CRITTER_NO_DROP)) {
flags |= DAM_DROP;
}
@@ -4184,7 +4184,7 @@ static int attackComputeCriticalFailure(Attack* attack)
{
attack->attackerFlags &= ~DAM_HIT;
if (attack->attacker != nullptr && critterFlagCheck(attack->attacker->pid, CRITTER_INVULNERABLE)) {
if (attack->attacker != nullptr && _critter_flag_check(attack->attacker->pid, CRITTER_INVULNERABLE)) {
return 0;
}
@@ -4639,7 +4639,7 @@ static void attackComputeDamage(Attack* attack, int ammoQuantity, int bonusDamag
&& (critter->flags & OBJECT_MULTIHEX) == 0
&& (damageType == DAMAGE_TYPE_EXPLOSION || attack->weapon == nullptr || weaponGetAttackTypeForHitMode(attack->weapon, attack->hitMode) == ATTACK_TYPE_MELEE)
&& PID_TYPE(critter->pid) == OBJ_TYPE_CRITTER
&& !critterFlagCheck(critter->pid, CRITTER_NO_KNOCKBACK)) {
&& !_critter_flag_check(critter->pid, CRITTER_NO_KNOCKBACK)) {
bool shouldKnockback = true;
bool hasStonewall = false;
if (critter == gDude) {
@@ -4716,7 +4716,7 @@ void _apply_damage(Attack* attack, bool animated)
if (defenderIsCritter) {
if ((defender->data.critter.combat.results & (DAM_DEAD | DAM_KNOCKED_OUT)) != 0) {
if (!v5 || defender != gDude) {
critterSetWhoHitMe(defender, attack->attacker);
_critter_set_who_hit_me(defender, attack->attacker);
}
} else if (defender == attack->oops || defender->data.critter.combat.team != attack->attacker->data.critter.combat.team) {
_combatai_check_retaliation(defender, attack->attacker);
@@ -4745,7 +4745,7 @@ void _apply_damage(Attack* attack, bool animated)
if (defenderIsCritter) {
if ((obj->data.critter.combat.results & (DAM_DEAD | DAM_KNOCKED_OUT)) != 0) {
critterSetWhoHitMe(obj, attack->attacker);
_critter_set_who_hit_me(obj, attack->attacker);
} else if (obj->data.critter.combat.team != attack->attacker->data.critter.combat.team) {
_combatai_check_retaliation(obj, attack->attacker);
}
@@ -4770,7 +4770,7 @@ void _apply_damage(Attack* attack, bool animated)
// 0x424EE8
static void _check_for_death(Object* object, int damage, int* flags)
{
if (object == nullptr || !critterFlagCheck(object->pid, CRITTER_INVULNERABLE)) {
if (object == nullptr || !_critter_flag_check(object->pid, CRITTER_INVULNERABLE)) {
if (object == nullptr || PID_TYPE(object->pid) == OBJ_TYPE_CRITTER) {
if (damage > 0) {
if (critterGetHitPoints(object) - damage <= 0) {
@@ -4792,7 +4792,7 @@ static void _set_new_results(Object* critter, int flags)
return;
}
if (critterFlagCheck(critter->pid, CRITTER_INVULNERABLE)) {
if (_critter_flag_check(critter->pid, CRITTER_INVULNERABLE)) {
return;
}
@@ -4833,7 +4833,7 @@ static void _damage_object(Object* a1, int damage, bool animated, int a4, Object
return;
}
if (critterFlagCheck(a1->pid, CRITTER_INVULNERABLE)) {
if (_critter_flag_check(a1->pid, CRITTER_INVULNERABLE)) {
return;
}
+25 -25
View File
@@ -997,7 +997,7 @@ static int _ai_check_drugs(Object* critter)
int minHp = critterGetStat(critter, STAT_MAXIMUM_HIT_POINTS) * hpRatio / 100;
int inventoryItemIndex = -1;
while (critterGetStat(critter, STAT_CURRENT_HIT_POINTS) < minHp && critter->data.critter.combat.ap >= 2) {
Object* drug = inventoryFindByType(critter, ITEM_TYPE_DRUG, &inventoryItemIndex);
Object* drug = _inven_find_type(critter, ITEM_TYPE_DRUG, &inventoryItemIndex);
if (drug == nullptr) {
searchCompleted = true;
break;
@@ -1006,12 +1006,12 @@ static int _ai_check_drugs(Object* critter)
int drugPid = drug->pid;
if (itemIsHealing(drugPid)) {
if (itemRemove(critter, drug, 1) == 0) {
if (drugItemTakeDrug(critter, drug) == -1) {
if (_item_d_take_drug(critter, drug) == -1) {
itemAdd(critter, drug, 1);
} else {
_ai_magic_hands(critter, drug, 5000);
_obj_connect(drug, critter->tile, critter->elevation, nullptr);
objectDestroy(drug);
_obj_destroy(drug);
drugUsed = true;
}
@@ -1054,7 +1054,7 @@ static int _ai_check_drugs(Object* critter)
// The alternative is to use a pair of `std::vector`s and let
// them manage the memory.
while (true) {
Object* drug = inventoryFindByType(critter, ITEM_TYPE_DRUG, &inventoryItemIndex);
Object* drug = _inven_find_type(critter, ITEM_TYPE_DRUG, &inventoryItemIndex);
if (drug == nullptr) {
searchCompleted = true;
break;
@@ -1103,12 +1103,12 @@ static int _ai_check_drugs(Object* critter)
*availableDrugsCountPtr -= 1;
if (itemRemove(critter, drug, 1) == 0) {
if (drugItemTakeDrug(critter, drug) == -1) {
if (_item_d_take_drug(critter, drug) == -1) {
itemAdd(critter, drug, 1);
} else {
_ai_magic_hands(critter, drug, 5000);
_obj_connect(drug, critter->tile, critter->elevation, nullptr);
objectDestroy(drug);
_obj_destroy(drug);
drugUsed = true;
drugCount += 1;
}
@@ -1148,12 +1148,12 @@ static int _ai_check_drugs(Object* critter)
}
if (itemRemove(critter, lastItem, 1) == 0) {
if (drugItemTakeDrug(critter, lastItem) == -1) {
if (_item_d_take_drug(critter, lastItem) == -1) {
itemAdd(critter, lastItem, 1);
} else {
_ai_magic_hands(critter, lastItem, 5000);
_obj_connect(lastItem, critter->tile, critter->elevation, nullptr);
objectDestroy(lastItem);
_obj_destroy(lastItem);
lastItem = nullptr;
}
@@ -1775,7 +1775,7 @@ static bool aiHaveAmmo(Object* critter, Object* weapon, Object** ammoPtr)
int inventoryItemIndex = -1;
while (1) {
Object* ammo = inventoryFindByType(critter, ITEM_TYPE_AMMO, &inventoryItemIndex);
Object* ammo = _inven_find_type(critter, ITEM_TYPE_AMMO, &inventoryItemIndex);
if (ammo == nullptr) {
break;
}
@@ -1789,10 +1789,10 @@ static bool aiHaveAmmo(Object* critter, Object* weapon, Object** ammoPtr)
if (weaponGetAnimationCode(weapon)) {
if (weaponGetRange(critter, HIT_MODE_RIGHT_WEAPON_PRIMARY) < 3) {
inventoryUnequip(critter, HAND_RIGHT);
_inven_unwield(critter, HAND_RIGHT);
}
} else {
inventoryUnequip(critter, HAND_RIGHT);
_inven_unwield(critter, HAND_RIGHT);
}
}
@@ -2012,7 +2012,7 @@ Object* _ai_search_inven_weap(Object* critter, bool checkRequiredActionPoints, O
Object* bestWeapon = nullptr;
Object* rightHandWeapon = critterGetItem2(critter);
while (true) {
Object* weapon = inventoryFindByType(critter, ITEM_TYPE_WEAPON, &token);
Object* weapon = _inven_find_type(critter, ITEM_TYPE_WEAPON, &token);
if (weapon == nullptr) {
break;
}
@@ -2073,7 +2073,7 @@ Object* _ai_search_inven_armor(Object* critter)
int inventoryItemIndex = -1;
while (true) {
Object* candidate = inventoryFindByType(critter, ITEM_TYPE_ARMOR, &inventoryItemIndex);
Object* candidate = _inven_find_type(critter, ITEM_TYPE_ARMOR, &inventoryItemIndex);
if (candidate == nullptr) {
break;
}
@@ -2245,7 +2245,7 @@ static Object* _ai_retrieve_object(Object* critter, Object* item)
// Find the item in NPC's inventory. This step is needed because NPC could
// not get the item on this turn.
Object* retrievedItem = inventoryFindById(critter, item->id);
Object* retrievedItem = _inven_find_id(critter, item->id);
if (retrievedItem != nullptr || item->owner != nullptr) {
// Either NPC have the item, or someone else have picked it up.
@@ -2620,7 +2620,7 @@ static int _ai_switch_weapons(Object* attacker, int* hitMode, Object** weapon, O
}
if (*weapon != nullptr) {
inventoryEquip(attacker, *weapon, HAND_RIGHT);
_inven_wield(attacker, *weapon, HAND_RIGHT);
_combat_turn_run();
if (weaponGetActionPointCost(attacker, *hitMode, 0) <= attacker->data.critter.combat.ap) {
return 0;
@@ -2691,7 +2691,7 @@ static int _ai_attack(Object* attacker, Object* defender, int hitMode)
// 0x42A7D8
static int _ai_try_attack(Object* attacker, Object* defender)
{
critterSetWhoHitMe(attacker, defender);
_critter_set_who_hit_me(attacker, defender);
CritterCombatData* combatData = &(attacker->data.critter.combat);
bool taunt = true;
@@ -2736,7 +2736,7 @@ static int _ai_try_attack(Object* attacker, Object* defender)
while (aiHaveAmmo(attacker, weapon, &ammo)) {
int remainingAmmoQuantity = weaponReload(weapon, ammo);
if (remainingAmmoQuantity == 0 && ammo != nullptr) {
objectDestroy(ammo);
_obj_destroy(ammo);
++roundsLoaded;
} else {
break;
@@ -2768,7 +2768,7 @@ static int _ai_try_attack(Object* attacker, Object* defender)
if (ammo != nullptr) {
int remainingAmmoQuantity = weaponReload(weapon, ammo);
if (remainingAmmoQuantity == 0) {
objectDestroy(ammo);
_obj_destroy(ammo);
}
if (remainingAmmoQuantity != -1) {
@@ -2796,7 +2796,7 @@ static int _ai_try_attack(Object* attacker, Object* defender)
_gsound_play_sfx_file_volume(sfx, volume);
_ai_magic_hands(attacker, weapon, 5001);
if (inventoryUnequip(attacker, 1) == 0) {
if (_inven_unwield(attacker, 1) == 0) {
_combat_turn_run();
}
@@ -2911,7 +2911,7 @@ static int _ai_try_attack(Object* attacker, Object* defender)
int _cAIPrepWeaponItem(Object* critter, Object* item)
{
if (item != nullptr && critterGetStat(critter, STAT_INTELLIGENCE) >= 3 && item->pid == PROTO_ID_FLARE && lightGetAmbientIntensity() < LIGHT_INTENSITY_MAX * 0.85) {
objectUseItem(critter, item);
_protinst_use_item(critter, item);
}
return 0;
}
@@ -2933,7 +2933,7 @@ void aiAttemptWeaponReload(Object* critter, int animate)
if (aiHaveAmmo(critter, weapon, &ammo)) {
int rc = weaponReload(weapon, ammo);
if (rc == 0) {
objectDestroy(ammo);
_obj_destroy(ammo);
++loadedRounds;
} else {
break;
@@ -3252,7 +3252,7 @@ int critterSetTeam(Object* obj, int team)
obj->data.critter.combat.team = team;
if (obj->data.critter.combat.whoHitMeCid == -1) {
critterSetWhoHitMe(obj, nullptr);
_critter_set_who_hit_me(obj, nullptr);
debugPrint("\nError: CombatData found with invalid who_hit_me!");
return -1;
}
@@ -3260,7 +3260,7 @@ int critterSetTeam(Object* obj, int team)
Object* whoHitMe = obj->data.critter.combat.whoHitMe;
if (whoHitMe != nullptr) {
if (whoHitMe->data.critter.combat.team == team) {
critterSetWhoHitMe(obj, nullptr);
_critter_set_who_hit_me(obj, nullptr);
}
}
@@ -3502,10 +3502,10 @@ void _combatai_check_retaliation(Object* a1, Object* a2)
int candidateRating = _combatai_rating(a2);
int whoHitMeRating = _combatai_rating(whoHitMe);
if (candidateRating > whoHitMeRating) {
critterSetWhoHitMe(a1, a2);
_critter_set_who_hit_me(a1, a2);
}
} else {
critterSetWhoHitMe(a1, a2);
_critter_set_who_hit_me(a1, a2);
}
}
+28 -30
View File
@@ -154,7 +154,7 @@ static int gKillsByType[KILL_TYPE_COUNT];
// Something with radiation.
//
// 0x56D7CC
static int oldRadLevel;
static int _old_rad_level;
// scrname_init
// 0x42CF50
@@ -347,7 +347,7 @@ int critterAdjustPoison(Object* critter, int amount)
if (newPoison > 0) {
critter->data.critter.poison = newPoison;
queueClearByEventType(EVENT_TYPE_POISON, nullptr);
_queue_clear_type(EVENT_TYPE_POISON, nullptr);
queueAddEvent(10 * (505 - 5 * newPoison), gDude, nullptr, EVENT_TYPE_POISON);
// You have been poisoned!
@@ -484,8 +484,7 @@ int critterAdjustRadiation(Object* obj, int amount)
}
// 0x42D4F4
// note: original ASM always returned 0
int critterCheckRadiationEvent(Object* obj)
int _critter_check_rads(Object* obj)
{
if (obj != gDude) {
return 0;
@@ -497,9 +496,9 @@ int critterCheckRadiationEvent(Object* obj)
return 0;
}
oldRadLevel = 0;
_old_rad_level = 0;
queueClearByEventType(EVENT_TYPE_RADIATION, _get_rad_damage_level);
_queue_clear_type(EVENT_TYPE_RADIATION, _get_rad_damage_level);
// NOTE: Uninline
int radiation = critterGetRadiation(obj);
@@ -522,7 +521,7 @@ int critterCheckRadiationEvent(Object* obj)
radiationLevel++;
}
if (radiationLevel > oldRadLevel) {
if (radiationLevel > _old_rad_level) {
// Create timer event for applying radiation damage.
RadiationEvent* radiationEvent = (RadiationEvent*)internal_malloc(sizeof(*radiationEvent));
if (radiationEvent == nullptr) {
@@ -544,18 +543,18 @@ static int _get_rad_damage_level(Object* obj, void* data)
{
RadiationEvent* radiationEvent = (RadiationEvent*)data;
oldRadLevel = radiationEvent->radiationLevel;
_old_rad_level = radiationEvent->radiationLevel;
return 0;
}
// 0x42D624
int radiationClearDamage(Object* obj, void* data)
int _clear_rad_damage(Object* obj, void* data)
{
RadiationEvent* radiationEvent = (RadiationEvent*)data;
if (radiationEvent->isHealing) {
radiationProcess(obj, radiationEvent->radiationLevel, true);
_process_rads(obj, radiationEvent->radiationLevel, true);
}
return 1;
@@ -564,7 +563,7 @@ int radiationClearDamage(Object* obj, void* data)
// Applies radiation.
//
// 0x42D63C
void radiationProcess(Object* obj, int radiationLevel, bool isHealing)
void _process_rads(Object* obj, int radiationLevel, bool isHealing)
{
MessageListItem messageListItem;
@@ -632,14 +631,14 @@ int radiationEventProcess(Object* obj, void* data)
// Schedule healing stats event in 7 days.
RadiationEvent* newRadiationEvent = (RadiationEvent*)internal_malloc(sizeof(*newRadiationEvent));
if (newRadiationEvent != nullptr) {
queueClearByEventType(EVENT_TYPE_RADIATION, radiationClearDamage);
_queue_clear_type(EVENT_TYPE_RADIATION, _clear_rad_damage);
newRadiationEvent->radiationLevel = radiationEvent->radiationLevel;
newRadiationEvent->isHealing = 1;
queueAddEvent(GAME_TIME_TICKS_PER_DAY * 7, obj, newRadiationEvent, EVENT_TYPE_RADIATION);
}
}
radiationProcess(obj, radiationEvent->radiationLevel, radiationEvent->isHealing);
_process_rads(obj, radiationEvent->radiationLevel, radiationEvent->isHealing);
return 1;
}
@@ -793,9 +792,8 @@ char* killTypeGetDescription(int killType)
}
}
// 0x42D9F4
// heals critters based on the number of elapsed hours
int critterHealByHours(Object* critter, int hours)
// 0x42D9F4 _critter_heal_hours heals critters based on the number of elapsed hours
int _critter_heal_hours(Object* critter, int hours)
{
if (PID_TYPE(critter->pid) != OBJ_TYPE_CRITTER) {
return -1;
@@ -830,7 +828,7 @@ void critterKill(Object* critter, int anim, bool refreshRect)
// NOTE: Original code uses goto to jump out from nested conditions below.
bool shouldChangeFid = false;
int fid;
if (critterIsProne(critter)) {
if (_critter_is_prone(critter)) {
int current = FID_ANIM_TYPE(critter->fid);
if (current == ANIM_FALL_BACK || current == ANIM_FALL_FRONT) {
bool back = false;
@@ -881,7 +879,7 @@ void critterKill(Object* critter, int anim, bool refreshRect)
rectUnion(&updatedRect, &tempRect, &updatedRect);
}
if (!critterFlagCheck(critter->pid, CRITTER_FLAT)) {
if (!_critter_flag_check(critter->pid, CRITTER_FLAT)) {
critter->flags |= OBJECT_NO_BLOCK;
_obj_toggle_flat(critter, &tempRect);
}
@@ -902,7 +900,7 @@ void critterKill(Object* critter, int anim, bool refreshRect)
}
_critterClearObj = critter;
queueClearByEventType(EVENT_TYPE_DRUG, _critterClearObjDrugs);
_queue_clear_type(EVENT_TYPE_DRUG, _critterClearObjDrugs);
itemDestroyAllHidden(critter);
@@ -985,7 +983,7 @@ bool critterIsCrippled(Object* critter)
}
// 0x42DD80
bool critterIsProne(Object* critter)
bool _critter_is_prone(Object* critter)
{
if (critter == nullptr) {
return false;
@@ -1226,7 +1224,7 @@ int sneakEventProcess(Object* obj, void* data)
}
// 0x42E3E4
int critterDisableSneak(Object* obj, void* data)
int _critter_sneak_clear(Object* obj, void* data)
{
dudeDisableState(DUDE_STATE_SNEAKING);
return 1;
@@ -1265,7 +1263,7 @@ int knockoutEventProcess(Object* obj, void* data)
}
// 0x42E460
int knockoutClear(Object* obj, void* data)
int _critter_wake_clear(Object* obj, void* data)
{
if (PID_TYPE(obj->pid) != OBJ_TYPE_CRITTER) {
return 0;
@@ -1286,7 +1284,7 @@ int knockoutClear(Object* obj, void* data)
// 0x42E4C0
// note: this is sometimes called with (attacker, defender) and sometimes with (defender, attacker).
// `hitMe` may be nullptr
int critterSetWhoHitMe(Object* critter, Object* hitMe)
int _critter_set_who_hit_me(Object* critter, Object* hitMe)
{
if (critter == nullptr) {
return -1;
@@ -1309,11 +1307,11 @@ int critterSetWhoHitMe(Object* critter, Object* hitMe)
}
// 0x42E564
bool critterCanDudeRest()
bool _critter_can_obj_dude_rest()
{
bool mapDisallowsRest = false;
bool v1 = false;
if (!wmMapCanRestHere(gElevation)) {
mapDisallowsRest = true;
v1 = true;
}
bool result = true;
@@ -1333,7 +1331,7 @@ bool critterCanDudeRest()
}
if (critter->data.critter.combat.whoHitMe != gDude) {
if (!mapDisallowsRest || critter->data.critter.combat.team == gDude->data.critter.combat.team) {
if (!v1 || critter->data.critter.combat.team == gDude->data.critter.combat.team) {
continue;
}
}
@@ -1385,7 +1383,7 @@ bool critterIsFleeing(Object* critter)
// Checks proto critter flag.
//
// 0x42E6AC
bool critterFlagCheck(int pid, int flag)
bool _critter_flag_check(int pid, int flag)
{
if (pid == -1) {
return false;
@@ -1401,7 +1399,7 @@ bool critterFlagCheck(int pid, int flag)
}
// 0x42E6F0
void critterFlagSet(int pid, int flag)
void critter_flag_set(int pid, int flag)
{
Proto* proto;
@@ -1419,7 +1417,7 @@ void critterFlagSet(int pid, int flag)
}
// 0x42E71C
void critterFlagUnset(int pid, int flag)
void critter_flag_unset(int pid, int flag)
{
Proto* proto;

Some files were not shown because too many files have changed in this diff Show More