|
1 | 1 | #include "obscurevantage0x58.h" |
2 | 2 |
|
3 | 3 | DECOMP_SIZE_ASSERT(ObscureVantage0x58, 0x58) |
4 | | -DECOMP_SIZE_ASSERT(ObscureVantage0x58::Struct0x34, 0x10) |
5 | 4 |
|
6 | 5 | // GLOBAL: LEGORACERS 0x004c7650 |
7 | 6 | SilverDune0x30::Rect g_unk0x4c7650; |
@@ -37,10 +36,10 @@ void ObscureVantage0x58::VTable0x00() |
37 | 36 | m_unk0x44 = 1.0; |
38 | 37 | m_unk0x50 = 0; |
39 | 38 | m_unk0x4c = 0; |
40 | | - m_unk0x34.m_unk0x00 = 0; |
41 | | - m_unk0x34.m_unk0x04 = 0; |
42 | | - m_unk0x34.m_unk0x08 = 0; |
43 | | - m_unk0x34.m_unk0x0c = 0; |
| 39 | + m_unk0x34.m_left = 0; |
| 40 | + m_unk0x34.m_top = 0; |
| 41 | + m_unk0x34.m_right = 0; |
| 42 | + m_unk0x34.m_bottom = 0; |
44 | 43 | } |
45 | 44 |
|
46 | 45 | // FUNCTION: LEGORACERS 0x00472ad0 |
@@ -128,6 +127,13 @@ void ObscureVantage0x58::FUN_00472b50() |
128 | 127 | m_unk0x1c &= 0xfb; |
129 | 128 | } |
130 | 129 |
|
| 130 | +// FUNCTION: LEGORACERS 0x00472c40 |
| 131 | +undefined4 ObscureVantage0x58::FUN_00472c40(LegoS32 p_x, LegoS32 p_y) |
| 132 | +{ |
| 133 | + return p_x >= 0 && p_x <= (m_unk0x34.m_right - m_unk0x34.m_left) && p_y >= 0 && |
| 134 | + p_y <= (m_unk0x34.m_bottom - m_unk0x34.m_top); |
| 135 | +} |
| 136 | + |
131 | 137 | // FUNCTION: LEGORACERS 0x00472e40 |
132 | 138 | ObscureVantage0x58* ObscureVantage0x58::FUN_00472e40() |
133 | 139 | { |
@@ -167,36 +173,46 @@ SilverDune0x30::Rect* ObscureVantage0x58::FUN_00472e90() |
167 | 173 | g_unk0x4c7650.m_left = 0; |
168 | 174 |
|
169 | 175 | while (node) { |
170 | | - g_unk0x4c7650.m_left += node->m_unk0x34.m_unk0x00; |
171 | | - g_unk0x4c7650.m_top += node->m_unk0x34.m_unk0x04; |
| 176 | + g_unk0x4c7650.m_left += node->m_unk0x34.m_left; |
| 177 | + g_unk0x4c7650.m_top += node->m_unk0x34.m_top; |
172 | 178 | node = node->m_unk0x04; |
173 | 179 | } |
174 | 180 |
|
175 | | - g_unk0x4c7650.m_right = (m_unk0x34.m_unk0x08 - m_unk0x34.m_unk0x00) + g_unk0x4c7650.m_left; |
176 | | - g_unk0x4c7650.m_bottom = (m_unk0x34.m_unk0x0c - m_unk0x34.m_unk0x04) + g_unk0x4c7650.m_top; |
| 181 | + g_unk0x4c7650.m_right = (m_unk0x34.m_right - m_unk0x34.m_left) + g_unk0x4c7650.m_left; |
| 182 | + g_unk0x4c7650.m_bottom = (m_unk0x34.m_bottom - m_unk0x34.m_top) + g_unk0x4c7650.m_top; |
177 | 183 |
|
178 | 184 | return &g_unk0x4c7650; |
179 | 185 | } |
180 | 186 |
|
181 | | -// STUB: LEGORACERS 0x00472f40 |
182 | | -void ObscureVantage0x58::VTable0x10(undefined4) |
| 187 | +// FUNCTION: LEGORACERS 0x00472f40 |
| 188 | +void ObscureVantage0x58::VTable0x10(IntRectangle0x10* p_rect) |
183 | 189 | { |
184 | | - // TODO |
185 | | - STUB(0x00472f40); |
| 190 | + if (m_unk0x28) { |
| 191 | + if ((((m_unk0x34.m_right - p_rect->m_right) - m_unk0x34.m_left) + p_rect->m_left != 0) || |
| 192 | + (((m_unk0x34.m_bottom - m_unk0x34.m_top) - p_rect->m_bottom) + p_rect->m_top != 0)) { |
| 193 | + m_unk0x28->VTable0x0c(this); |
| 194 | + } |
| 195 | + |
| 196 | + if ((m_unk0x34.m_left - p_rect->m_left) || (m_unk0x34.m_top - p_rect->m_top)) { |
| 197 | + m_unk0x28->VTable0x08(this); |
| 198 | + } |
| 199 | + } |
| 200 | + |
| 201 | + m_unk0x34 = *p_rect; |
| 202 | + return; |
186 | 203 | } |
187 | 204 |
|
188 | | -// STUB: LEGORACERS 0x00472fc0 |
189 | | -void ObscureVantage0x58::VTable0x14(undefined4) |
| 205 | +// FUNCTION: LEGORACERS 0x00472fc0 |
| 206 | +void ObscureVantage0x58::VTable0x14(undefined4* p_param) |
190 | 207 | { |
191 | | - // TODO |
192 | | - STUB(0x00472fc0); |
| 208 | + m_unk0x2c = *p_param; |
193 | 209 | } |
194 | 210 |
|
195 | 211 | // FUNCTION: LEGORACERS 0x004731b0 |
196 | | -void ObscureVantage0x58::FUN_004731b0(undefined4& p_param1, undefined4& p_param2) |
| 212 | +void ObscureVantage0x58::FUN_004731b0(undefined4& p_x, undefined4& p_y) |
197 | 213 | { |
198 | | - p_param1 -= m_unk0x34.m_unk0x00; |
199 | | - p_param2 -= m_unk0x34.m_unk0x04; |
| 214 | + p_x -= m_unk0x34.m_left; |
| 215 | + p_y -= m_unk0x34.m_top; |
200 | 216 | } |
201 | 217 |
|
202 | 218 | // FUNCTION: LEGORACERS 0x004731d0 |
@@ -226,20 +242,54 @@ undefined4 ObscureVantage0x58::VTable0x1c(SilverDune0x30::Rect*, SilverDune0x30: |
226 | 242 | return 0; |
227 | 243 | } |
228 | 244 |
|
229 | | -// STUB: LEGORACERS 0x004732d0 |
230 | | -undefined4 ObscureVantage0x58::VTable0x20(void*, undefined4, undefined4) |
| 245 | +// FUNCTION: LEGORACERS 0x004732d0 |
| 246 | +undefined4 ObscureVantage0x58::VTable0x20(CopperCrest0x40::Helper0x44* p_param1, undefined4 p_x, undefined4 p_y) |
231 | 247 | { |
232 | | - // TODO |
233 | | - STUB(0x004732d0); |
234 | | - return 0; |
| 248 | + ObscureVantage0x58* child = m_unk0x08; |
| 249 | + undefined4 x = p_x; |
| 250 | + undefined4 y = p_y; |
| 251 | + |
| 252 | + FUN_004731b0(x, y); |
| 253 | + |
| 254 | + if ((m_unk0x1c & 2) && FUN_00472c40(x, y)) { |
| 255 | + while (child) { |
| 256 | + if (child->VTable0x20(p_param1, x, y)) { |
| 257 | + return TRUE; |
| 258 | + } |
| 259 | + |
| 260 | + child = child->m_unk0x14; |
| 261 | + } |
| 262 | + |
| 263 | + if (VTable0x2c(p_param1, x, y)) { |
| 264 | + return TRUE; |
| 265 | + } |
| 266 | + } |
| 267 | + |
| 268 | + return FALSE; |
235 | 269 | } |
236 | 270 |
|
237 | | -// STUB: LEGORACERS 0x00473370 |
238 | | -undefined4 ObscureVantage0x58::VTable0x24(OnyxCircularBuffer0x1c::Item*, undefined4, undefined4) |
| 271 | +// FUNCTION: LEGORACERS 0x00473370 |
| 272 | +undefined4 ObscureVantage0x58::VTable0x24(OnyxCircularBuffer0x1c::Item* p_param1, undefined4 p_x, undefined4 p_y) |
239 | 273 | { |
240 | | - // TODO |
241 | | - STUB(0x00473370); |
242 | | - return 0; |
| 274 | + ObscureVantage0x58* child = m_unk0x08; |
| 275 | + undefined4 x = p_x; |
| 276 | + undefined4 y = p_y; |
| 277 | + |
| 278 | + if (!(m_unk0x1c & 2)) { |
| 279 | + return FALSE; |
| 280 | + } |
| 281 | + |
| 282 | + FUN_004731b0(x, y); |
| 283 | + |
| 284 | + while (child) { |
| 285 | + if (child->VTable0x24(p_param1, x, y)) { |
| 286 | + return TRUE; |
| 287 | + } |
| 288 | + |
| 289 | + child = child->m_unk0x14; |
| 290 | + } |
| 291 | + |
| 292 | + return VTable0x30(p_param1, x, y); |
243 | 293 | } |
244 | 294 |
|
245 | 295 | // STUB: LEGORACERS 0x00473400 |
|
0 commit comments