paavohtl Claude Opus 4.6 (1M context) commited on
Commit
bee20b7
Β·
1 Parent(s): 9984c5c

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)._field_4d8 = 0;
854
- // Loading progress total: speech_team_count controls team count scaling.
855
  if is_headless {
856
- (*wrapper)._field_4dc = 0x2AD;
857
  } else {
858
  let team_count = (*game_info).speech_team_count as u32;
859
- (*wrapper)._field_4dc = team_count * 0x38 + 0x7E + 0x2AD;
860
  }
861
- (*wrapper)._field_4e0 = 0xFFFFFF9C; // -100
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: Init 0 (DWORD index 0x136)
47
- pub _field_4d8: u32,
48
- /// 0x4DC: Calculated value (DWORD index 0x137)
49
- pub _field_4dc: u32,
50
- /// 0x4E0: Init -100 / 0xFFFFFF9C (DWORD index 0x138)
51
- pub _field_4e0: 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.
 
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.