Compare commits

..
Author SHA1 Message Date
Vasilii Rogin b55fb81f2d Remove conditions 2025-09-08 22:18:54 +03:00
Vasilii Rogin 9d4405d955 Add artifacts as deployment 2025-09-08 22:16:35 +03:00
26 changed files with 77 additions and 158 deletions
-26
View File
@@ -86,10 +86,6 @@ jobs:
SITE_BASE: ${{ steps.set-path.outputs.SITE_BASE }}
F2_GAME_VERSION: Game=${{github.event.pull_request.head.sha || github.sha }}
- name: Place hash file
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
run: echo "$GITHUB_SHA" > fallout2-ce-ems/dist/site_hash.txt
- name: Install rsync (required for the next step)
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
run: |
@@ -105,28 +101,6 @@ jobs:
clean: false
single-commit: true
- name: Check that site is deployed
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
run: |
URL="$SITE_ORIGIN""$SITE_BASE""site_hash.txt"
echo "Expecting $GITHUB_SHA from $URL"
for i in `seq 1 80`; do
got="$(curl -fsSL --max-time 10 "$URL" | tr -d '\r\n' || true)"
if [ "$got" = "$GITHUB_SHA" ]; then
echo "âś… Match on attempt $i: ${got}"
exit 0
fi
echo "Received $got, waiting"
sleep 5
done
exit 1
env:
SITE_ORIGIN: https://${{ github.repository_owner }}.github.io
SITE_BASE: ${{ steps.set-path.outputs.SITE_BASE }}
- name: Update deployment status
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: bobheadxi/deployments@v1
+40
View File
@@ -14,6 +14,27 @@ defaults:
shell: bash
jobs:
mark_deployment_as_started:
name: Mark deployment as started
runs-on: ubuntu-latest
permissions:
deployments: write
contents: read
outputs:
deployment_id: ${{ steps.start.outputs.deployment_id }}
env: ${{ steps.start.outputs.env }}
steps:
- name: start deployment
id: start
uses: bobheadxi/deployments@v1
with:
ref: ${{ github.event.pull_request.head.sha }}
step: start
debug: true
env: artifacts-${{ github.event.pull_request.number }}
static-analysis:
name: Static analysis
@@ -362,6 +383,25 @@ jobs:
path: out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce-${{ matrix.arch }}.exe
retention-days: 7
mark_deployment_as_completed:
name: Mark deployment as completed
runs-on: ubuntu-latest
permissions:
deployments: write
contents: read
needs: [mark_deployment_as_started, android, ios, linux, linux-armhf, linux-arm64, macos, windows]
steps:
- name: Update deployment status
uses: bobheadxi/deployments@v1
with:
step: finish
status: success
debug: true
ref: ${{ github.event.pull_request.head.sha }}
env: ${{ needs.mark_deployment_as_started.outputs.env }}
deployment_id: ${{ needs.mark_deployment_as_started.outputs.deployment_id }}
env_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
release:
name: Release 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