refactor: rename DDGameWrapper loading progress fields
Browse files- _field_4d8 β loading_progress (counter, incremented per tick)
- _field_4dc β loading_total (base 0x2AD + 0x38/team + 0x7E overhead)
- _field_4e0 β loading_last_pct (init -100 to force first update)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
crates/openwa-core/src/engine/ddgame.rs
CHANGED
|
@@ -850,15 +850,14 @@ unsafe fn init_graphics_and_resources(
|
|
| 850 |
}
|
| 851 |
|
| 852 |
// ββ DDGameWrapper field inits ββ
|
| 853 |
-
(*wrapper).
|
| 854 |
-
// Loading progress total: speech_team_count controls team count scaling.
|
| 855 |
if is_headless {
|
| 856 |
-
(*wrapper).
|
| 857 |
} else {
|
| 858 |
let team_count = (*game_info).speech_team_count as u32;
|
| 859 |
-
(*wrapper).
|
| 860 |
}
|
| 861 |
-
(*wrapper).
|
| 862 |
(*wrapper).speech_name_count = 0;
|
| 863 |
|
| 864 |
// ββ Audio init (non-headless + sound available) ββ
|
|
|
|
| 850 |
}
|
| 851 |
|
| 852 |
// ββ DDGameWrapper field inits ββ
|
| 853 |
+
(*wrapper).loading_progress = 0;
|
|
|
|
| 854 |
if is_headless {
|
| 855 |
+
(*wrapper).loading_total = 0x2AD;
|
| 856 |
} else {
|
| 857 |
let team_count = (*game_info).speech_team_count as u32;
|
| 858 |
+
(*wrapper).loading_total = team_count * 0x38 + 0x7E + 0x2AD;
|
| 859 |
}
|
| 860 |
+
(*wrapper).loading_last_pct = 0xFFFFFF9C; // -100: forces first progress bar update
|
| 861 |
(*wrapper).speech_name_count = 0;
|
| 862 |
|
| 863 |
// ββ Audio init (non-headless + sound available) ββ
|
crates/openwa-core/src/engine/ddgame_wrapper.rs
CHANGED
|
@@ -43,12 +43,12 @@ pub struct DDGameWrapper {
|
|
| 43 |
pub display: *mut DDDisplay,
|
| 44 |
/// 0x4D4: DSSound pointer (param3 of constructor)
|
| 45 |
pub sound: *mut DSSound,
|
| 46 |
-
/// 0x4D8:
|
| 47 |
-
pub
|
| 48 |
-
/// 0x4DC:
|
| 49 |
-
pub
|
| 50 |
-
/// 0x4E0:
|
| 51 |
-
pub
|
| 52 |
/// 0x4E4-0x14E7: Unknown fields
|
| 53 |
pub _unknown_4e4: [u8; 0x14E8 - 0x4E4],
|
| 54 |
/// 0x14E8: Speech name table β 360 entries of 0x40-byte C strings.
|
|
|
|
| 43 |
pub display: *mut DDDisplay,
|
| 44 |
/// 0x4D4: DSSound pointer (param3 of constructor)
|
| 45 |
pub sound: *mut DSSound,
|
| 46 |
+
/// 0x4D8: Loading progress counter (incremented per loading tick).
|
| 47 |
+
pub loading_progress: u32,
|
| 48 |
+
/// 0x4DC: Loading progress total (base 0x2AD + 0x38 per team + 0x7E overhead).
|
| 49 |
+
pub loading_total: u32,
|
| 50 |
+
/// 0x4E0: Last displayed loading percentage (init -100 to force first update).
|
| 51 |
+
pub loading_last_pct: u32,
|
| 52 |
/// 0x4E4-0x14E7: Unknown fields
|
| 53 |
pub _unknown_4e4: [u8; 0x14E8 - 0x4E4],
|
| 54 |
/// 0x14E8: Speech name table β 360 entries of 0x40-byte C strings.
|