#include "classes.h" // 00a10760 void Quad::rotate(Vector *pivot, float angle) { float fVar1; float sinAngle; float sinAngle; float fVar3; float fVar4; float corner2Y; float corner2RelX; float fVar5; float corner3RelX; float corner1X; float corner1Y; if (angle != 0.0) { fVar1 = cos(angle); sinAngle = sin(angle); sinAngle = -pivot->y; fVar5 = -pivot->x; fVar4 = sinAngle + *GHIDRA_CAST((GHIDRA_CAST(this) + 4)); *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) = sinAngle + *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)); fVar3 = fVar5 + *GHIDRA_CAST((GHIDRA_CAST(this) + 8)); corner3RelX = fVar5 + *GHIDRA_CAST((GHIDRA_CAST(this) + 0x18)); corner2RelX = fVar5 + *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)) = sinAngle + *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)) = sinAngle + *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)); sinAngle = (fVar5 + *GHIDRA_CAST(this)) * fVar1 - fVar4 * sinAngle; fVar5 = fVar4 * fVar1 + (fVar5 + *GHIDRA_CAST(this)) * sinAngle; *GHIDRA_CAST(this) = sinAngle; *GHIDRA_CAST((GHIDRA_CAST(this) + 4)) = fVar5; corner1X = fVar3 * fVar1 - *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) * sinAngle; corner1Y = *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) * fVar1 + fVar3 * sinAngle; *GHIDRA_CAST((GHIDRA_CAST(this) + 8)) = corner1X; *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) = corner1Y; corner2Y = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)) * fVar1 + corner2RelX * sinAngle; fVar4 = corner2RelX * fVar1 - *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)) * sinAngle; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)) = corner2Y; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)) = fVar4; fVar3 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)) * fVar1 + corner3RelX * sinAngle; fVar1 = corner3RelX * fVar1 - *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)) * sinAngle; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)) = fVar3; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x18)) = fVar1; *GHIDRA_CAST(this) = sinAngle + pivot->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 4)) = fVar5 + pivot->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 8)) = corner1X + pivot->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) = corner1Y + pivot->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)) = fVar4 + pivot->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)) = corner2Y + pivot->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x18)) = fVar1 + pivot->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)) = fVar3 + pivot->y; } return; } // 00a10950 void Quad::scale(Vector *pivot, Vector *scale) { float fVar1; float fVar2; float fVar3; float fVar4; float fVar5; float fVar6; float negPivotY; float negPivotX; float fVar7; if ((scale->x != 1.0) || (scale->y != 1.0)) { negPivotX = -pivot->x; negPivotY = -pivot->y; fVar6 = *GHIDRA_CAST(this); fVar5 = negPivotY + *GHIDRA_CAST((GHIDRA_CAST(this) + 4)); fVar4 = negPivotX + *GHIDRA_CAST((GHIDRA_CAST(this) + 8)); fVar3 = negPivotY + *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)); fVar2 = negPivotX + *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)); fVar7 = negPivotX + *GHIDRA_CAST((GHIDRA_CAST(this) + 0x18)); *GHIDRA_CAST(this) = negPivotX + fVar6; fVar1 = negPivotY + *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)); negPivotY = negPivotY + *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)); *GHIDRA_CAST((GHIDRA_CAST(this) + 4)) = fVar5; *GHIDRA_CAST((GHIDRA_CAST(this) + 8)) = fVar4; *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) = fVar3; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)) = fVar2; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)) = fVar1; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x18)) = fVar7; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)) = negPivotY; fVar6 = (negPivotX + fVar6) * scale->x; *GHIDRA_CAST(this) = fVar6; fVar5 = fVar5 * scale->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 4)) = fVar5; fVar4 = fVar4 * scale->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 8)) = fVar4; fVar3 = fVar3 * scale->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) = fVar3; fVar2 = fVar2 * scale->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)) = fVar2; fVar1 = fVar1 * scale->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)) = fVar1; fVar7 = fVar7 * scale->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x18)) = fVar7; negPivotY = negPivotY * scale->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)) = negPivotY; *GHIDRA_CAST(this) = fVar6 + pivot->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 4)) = fVar5 + pivot->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 8)) = fVar4 + pivot->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) = fVar3 + pivot->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)) = fVar2 + pivot->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)) = fVar1 + pivot->y; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x18)) = fVar7 + pivot->x; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)) = negPivotY + pivot->y; } return; } // 00a10ab0 uint8_t Quad::is_on_screen() { float fVar1; float screenHeight; float screenWidth; float local_XMM1_Da_199; float local_XMM1_Da_295; float local_XMM2_Da_166; float local_XMM2_Da_283; float local_XMM4_Da_276; float local_XMM6_Da_291; float local_XMM7_Da_287; if ((g_graphicsManager_renderTarget == (void *)0x0) || ((g_graphicsManager_flags & 0x20) != 0)) { screenWidth = DAT_00c7997c; } else { screenWidth = (float)((double)*GHIDRA_CAST((GHIDRA_CAST(g_graphicsManager_renderTarget) + 0x10)) + __uint_to_double_fixup [-(*GHIDRA_CAST((GHIDRA_CAST(g_graphicsManager_renderTarget) + 0x10)) >> 0x1f)]); } if ((g_graphicsManager_renderTarget == (void *)0x0) || ((g_graphicsManager_flags & 0x20) != 0)) { screenHeight = DAT_00c79980; } else { screenHeight = (float)((double)*GHIDRA_CAST((GHIDRA_CAST(g_graphicsManager_renderTarget) + 0x14)) + __uint_to_double_fixup [-(*GHIDRA_CAST((GHIDRA_CAST(g_graphicsManager_renderTarget) + 0x14)) >> 0x1f)]); } local_XMM1_Da_295 = *GHIDRA_CAST(this); local_XMM1_Da_199 = *GHIDRA_CAST((GHIDRA_CAST(this) + 8)); fVar1 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)); local_XMM2_Da_283 = *GHIDRA_CAST((GHIDRA_CAST(this) + 4)); local_XMM7_Da_287 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)); local_XMM6_Da_291 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)); local_XMM2_Da_166 = local_XMM1_Da_295; if (local_XMM1_Da_295 <= 0.0) { local_XMM2_Da_166 = 0.0; } if (screenWidth <= local_XMM1_Da_295) { local_XMM1_Da_295 = screenWidth; } local_XMM4_Da_276 = local_XMM1_Da_199; if (local_XMM1_Da_199 <= local_XMM2_Da_166) { local_XMM4_Da_276 = local_XMM2_Da_166; } if (local_XMM1_Da_295 <= local_XMM1_Da_199) { local_XMM1_Da_199 = local_XMM1_Da_295; } local_XMM1_Da_295 = fVar1; if (fVar1 <= local_XMM4_Da_276) { local_XMM1_Da_295 = local_XMM4_Da_276; } if (local_XMM1_Da_199 <= fVar1) { fVar1 = local_XMM1_Da_199; } local_XMM1_Da_199 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x18)); local_XMM2_Da_166 = local_XMM1_Da_199; if (local_XMM1_Da_199 <= local_XMM1_Da_295) { local_XMM2_Da_166 = local_XMM1_Da_295; } if (fVar1 <= local_XMM1_Da_199) { local_XMM1_Da_199 = fVar1; } fVar1 = local_XMM2_Da_283; if (screenHeight <= local_XMM2_Da_283) { fVar1 = screenHeight; } local_XMM1_Da_295 = local_XMM7_Da_287; if (fVar1 <= local_XMM7_Da_287) { local_XMM1_Da_295 = fVar1; } fVar1 = local_XMM6_Da_291; if (local_XMM1_Da_295 <= local_XMM6_Da_291) { fVar1 = local_XMM1_Da_295; } local_XMM1_Da_295 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)); local_XMM4_Da_276 = local_XMM1_Da_295; if (fVar1 <= local_XMM1_Da_295) { local_XMM4_Da_276 = fVar1; } if (local_XMM2_Da_283 <= 0.0) { local_XMM2_Da_283 = 0.0; } if (local_XMM7_Da_287 <= local_XMM2_Da_283) { local_XMM7_Da_287 = local_XMM2_Da_283; } if (local_XMM6_Da_291 <= local_XMM7_Da_287) { local_XMM6_Da_291 = local_XMM7_Da_287; } if (local_XMM1_Da_295 <= local_XMM6_Da_291) { local_XMM1_Da_295 = local_XMM6_Da_291; } if ((((local_XMM1_Da_199 < screenWidth) && (0.0 < local_XMM2_Da_166)) && (local_XMM4_Da_276 < screenHeight)) && (0.0 < local_XMM1_Da_295)) { return 1; } return 0; }