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
26 changed files with 448 additions and 157 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
+27 -25
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:
@@ -333,11 +335,11 @@ jobs:
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: 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
-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:
+5 -5
View File
@@ -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) {
@@ -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) {
+11 -3
View File
@@ -120,8 +120,6 @@ int _game_user_wants_to_quit = 0;
// 0x58E940
MessageList gMiscMessageList;
int gSplashScreenScaling = 0;
// CE: Sonora folks like to store objects in global variables.
static void** gGameGlobalPointers = nullptr;
@@ -1494,7 +1492,17 @@ static void showSplash()
}
}
int size = gSplashScreenScaling;
int size = 0;
// TODO: Move to settings.
Config config;
if (configInit(&config)) {
if (configRead(&config, "f2_res.ini", false)) {
configGetInt(&config, "STATIC_SCREENS", "SPLASH_SCRN_SIZE", &size);
}
configFree(&config);
}
int screenWidth = screenGetWidth();
int screenHeight = screenGetHeight();
-1
View File
@@ -20,7 +20,6 @@ extern int* gGameGlobalVars;
extern int gGameGlobalVarsLength;
extern const char* asc_5186C8;
extern int _game_user_wants_to_quit;
extern int gSplashScreenScaling;
extern MessageList gMiscMessageList;
-6
View File
@@ -917,12 +917,6 @@ void _gmouse_handle_event(int mouseX, int mouseY, int mouseState)
return;
}
// Check if we should block mouse button up events for inventoryOpenUseItemOn inventory window
if (gBlockMouseUpEvent && (mouseState & MOUSE_EVENT_LEFT_BUTTON_UP) != 0) {
gBlockMouseUpEvent = false;
return;
}
if ((mouseState & MOUSE_EVENT_RIGHT_BUTTON_DOWN) != 0) {
if ((mouseState & MOUSE_EVENT_RIGHT_BUTTON_REPEAT) == 0 && (gGameMouseHexCursor->flags & OBJECT_HIDDEN) == 0) {
gameMouseCycleMode();
-3
View File
@@ -99,9 +99,6 @@ static TickerListNode* gTickerListHead;
// 0x6AC788
static unsigned int gTickerLastTimestamp;
// global for inventoryOpenUseItemOn inventory to prevent click through bug
bool gBlockMouseUpEvent = false;
// 0x4C8A70
int inputInit(int a1)
{
-3
View File
@@ -7,9 +7,6 @@ typedef void(TickerProc)();
typedef int(ScreenshotHandler)(int width, int height, unsigned char* buffer, unsigned char* palette);
// global for blocking mouse event in inventoryOpenUseItemOn inventory screen
extern bool gBlockMouseUpEvent;
int inputInit(int a1);
void inputExit();
int inputGetInput();
+2 -3
View File
@@ -668,7 +668,7 @@ static void opDoCheck(Program* program)
programStackPushInteger(program, roll);
}
// is_success
// success
// 0x4549A8
static void opSuccess(Program* program)
{
@@ -690,7 +690,7 @@ static void opSuccess(Program* program)
programStackPushInteger(program, result);
}
// is_critical
// critical
// 0x454A44
static void opCritical(Program* program)
{
@@ -3079,7 +3079,6 @@ static void opSetObjectLightLevel(Program* program)
tileWindowRefreshRect(&rect, object->elevation);
}
// world_map
// 0x459170
static void opWorldmap(Program* program)
{
-2
View File
@@ -2736,8 +2736,6 @@ void inventoryOpenUseItemOn(Object* targetObj)
} else {
_action_use_an_item_on_object(gDude, targetObj, inventoryItem->item);
}
// fix for click through bug
gBlockMouseUpEvent = true;
keyCode = KEY_ESCAPE;
} else {
keyCode = -1;
-4
View File
@@ -1424,10 +1424,6 @@ void ammoSetQuantity(Object* ammoOrWeapon, int quantity)
quantity = capacity;
}
if (quantity < 0) {
quantity = 0;
}
Proto* proto;
protoGetProto(ammoOrWeapon->pid, &proto);
+2 -2
View File
@@ -623,8 +623,8 @@ void messageListFilterGenderWords(MessageList* messageList, int gender)
length = sep - start - 1;
}
memmove(start, src, length);
memmove(start + length, end + 1, strlen(end + 1) + 1);
strncpy(start, src, length);
strcpy(start + length, end + 1);
} else {
text = sep + 1;
}
+1 -1
View File
@@ -673,7 +673,7 @@ void _mouse_get_raw_state(int* out_x, int* out_y, int* out_buttons)
// 0x4CAC3C
void mouseSetSensitivity(double value)
{
if (value >= MOUSE_SENSITIVITY_MIN && value <= MOUSE_SENSITIVITY_MAX) {
if (value >= 1.0 && value <= 2.5) {
gMouseSensitivity = value;
}
}
-3
View File
@@ -28,9 +28,6 @@ namespace fallout {
#define BUTTON_REPEAT_TIME 250
#define MOUSE_SENSITIVITY_MIN 0.25
#define MOUSE_SENSITIVITY_MAX 2.5
extern WindowDrawingProc2* _mouse_blit_trans;
extern WINDOWDRAWINGPROC _mouse_blit;
-28
View File
@@ -3767,35 +3767,7 @@ static void objectDeallocate(Object** objectPtr)
return;
}
#if defined(__SANITIZE_ADDRESS__)
#warning "Address sanitizer detected. Delayed free is enabled."
{
// Sometimes game scripts are using object
// after it has been destroyed.
//
// Usually it does not bring any issues, but it
// causes crashes when address sanitizer is enabled.
//
// To mitigate this issue, a simple delayed free queue is implemented.
//
// If the game still access this memory then let's at least ensure
// that this memory is not reallocated for something else right away.
//
// Delay value of 10 objects has been chosen arbitrarily.
// Is seems that value of 3 was not sufficient to avoid all use-after-free issues.
//
constexpr int DELAY = 10;
static Object* deleteQueue[DELAY] = { nullptr };
static int deleteQueueIndex = 0;
if (deleteQueue[deleteQueueIndex] != nullptr) {
internal_free(deleteQueue[deleteQueueIndex]);
}
deleteQueue[deleteQueueIndex] = *objectPtr;
deleteQueueIndex = (deleteQueueIndex + 1) % DELAY;
}
#else
internal_free(*objectPtr);
#endif
*objectPtr = nullptr;
}
+3 -3
View File
@@ -386,7 +386,7 @@ static PreferenceDescription gPreferenceDescriptions[PREF_COUNT] = {
{ 4, 0, 374, 298, 0, 0, { 202, 221, 209, 222 }, 0, GAME_CONFIG_SNDFX_VOLUME_KEY, 0, 32767.0, &gPreferencesSoundEffectsVolume1 },
{ 4, 0, 374, 349, 0, 0, { 202, 221, 209, 222 }, 0, GAME_CONFIG_SPEECH_VOLUME_KEY, 0, 32767.0, &gPreferencesSpeechVolume1 },
{ 2, 0, 374, 400, 0, 0, { 207, 223, 0, 0 }, 0, GAME_CONFIG_BRIGHTNESS_KEY, 1.0, 1.17999267578125, nullptr },
{ 2, 0, 374, 451, 0, 0, { 207, 218, 0, 0 }, 0, GAME_CONFIG_MOUSE_SENSITIVITY_KEY, MOUSE_SENSITIVITY_MIN, MOUSE_SENSITIVITY_MAX, nullptr },
{ 2, 0, 374, 451, 0, 0, { 207, 218, 0, 0 }, 0, GAME_CONFIG_MOUSE_SENSITIVITY_KEY, 1.0, 2.5, nullptr },
};
static FrmImage _preferencesFrmImages[PREFERENCES_WINDOW_FRM_COUNT];
@@ -540,7 +540,7 @@ static void _JustUpdate_()
gPreferencesSoundEffectsVolume1 = std::clamp(gPreferencesSoundEffectsVolume1, 0, VOLUME_MAX);
gPreferencesSpeechVolume1 = std::clamp(gPreferencesSpeechVolume1, 0, VOLUME_MAX);
gPreferencesBrightness1 = std::clamp(gPreferencesBrightness1, 1.0, 1.17999267578125);
gPreferencesMouseSensitivity1 = std::clamp(gPreferencesMouseSensitivity1, MOUSE_SENSITIVITY_MIN, MOUSE_SENSITIVITY_MAX);
gPreferencesMouseSensitivity1 = std::clamp(gPreferencesMouseSensitivity1, 1.0, 2.5);
textObjectsSetBaseDelay(gPreferencesTextBaseDelay1);
gameMouseLoadItemHighlight();
@@ -711,7 +711,7 @@ static void _UpdateThing(int index)
break;
case PREF_MOUSE_SENSITIVIY:
if (1) {
gPreferencesMouseSensitivity1 = std::clamp(gPreferencesMouseSensitivity1, meta->minValue, meta->maxValue);
gPreferencesMouseSensitivity1 = std::clamp(gPreferencesMouseSensitivity1, 1.0, 2.5);
int x = (int)((gPreferencesMouseSensitivity1 - meta->minValue) * (219.0 / (meta->maxValue - meta->minValue)) + 384.0);
blitBufferToBufferTrans(_preferencesFrmImages[PREFERENCES_WINDOW_FRM_KNOB_OFF].getData(), 21, 12, 21, gPreferencesWindowBuffer + 640 * meta->knobY + x, 640);
-9
View File
@@ -1338,15 +1338,6 @@ int scriptExecProc(int sid, int proc)
_executeProcedure(program, v9);
#if defined(__SANITIZE_ADDRESS__)
#warning "Address sanitizer detected. Adding extra script existence check."
// Check if script still exists after procedure execution.
// The script may have been destroyed during execution (e.g., via destroy_object).
if (scriptGetScript(sid, &script) == -1) {
return 0;
}
#endif
script->source = nullptr;
return 0;
+3 -2
View File
@@ -7,6 +7,8 @@
namespace fallout {
#define SFALL_CONFIG_FILE_NAME "ddraw.ini"
bool gSfallConfigInitialized = false;
Config gSfallConfig;
@@ -59,7 +61,6 @@ bool sfallConfigInit(int argc, char** argv)
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_VERSION_STRING, "");
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_CONFIG_FILE, "");
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_PATCH_FILE, "");
configSetBool(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_CITIES_LIMIT_FIX, true);
configSetString(&gSfallConfig, SFALL_CONFIG_SCRIPTS_KEY, SFALL_CONFIG_INI_CONFIG_FOLDER, "");
configSetString(&gSfallConfig, SFALL_CONFIG_SCRIPTS_KEY, SFALL_CONFIG_GLOBAL_SCRIPT_PATHS, "");
@@ -86,7 +87,7 @@ bool sfallConfigInit(int argc, char** argv)
strcpy(path, SFALL_CONFIG_FILE_NAME);
}
auto configChecker = ConfigChecker(gSfallConfig, SFALL_CONFIG_FILE_NAME);
auto configChecker = ConfigChecker(gSfallConfig, "ddraw.ini");
configRead(&gSfallConfig, path, false);
-1
View File
@@ -76,7 +76,6 @@ namespace fallout {
#define SFALL_CONFIG_VERSION_STRING "VersionString"
#define SFALL_CONFIG_CONFIG_FILE "ConfigFile"
#define SFALL_CONFIG_PATCH_FILE "PatchFile"
#define SFALL_CONFIG_CITIES_LIMIT_FIX "CitiesLimitFix"
#define SFALL_CONFIG_HIRES_MODE "HiResMode"
#define SFALL_CONFIG_ENABLE_HIRES_STENCIL "EnableHighResolutionStencil"
#define SFALL_CONFIG_PIPBOY_AVAILABLE_AT_GAMESTART "PipBoyAvailableAtGameStart"

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