#include "plugin_vc.h"
#include "game_vc\CSprite2d.h"
using namespace plugin;
class SkyPatch {
public:
static CRGBA ColorHooked;
static void MySpriteDrawAnyRect(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, CRGBA& color1, CRGBA& color2, CRGBA& color3, CRGBA& color4) {
ColorHooked = color4;
CSprite2d::DrawAnyRect(x1, y1, x2, y2, x3, y3, x4, y4, color1, color2, color3, color4);
}
static void MySpriteDrawAnyRectHooked(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, CRGBA& color1, CRGBA& color2, CRGBA& color3, CRGBA& color4) {
if (*(int*)0x978810) //nCurrentInterior
CSprite2d::DrawAnyRect(x1, y1, x2, y2, x3, y3, x4, y4, color1, color2, color3, color4);
else
CSprite2d::DrawAnyRect(x1, y1, x2, y2, x3, y3, x4, y4, ColorHooked, ColorHooked, ColorHooked, ColorHooked);
}
SkyPatch() {
patch::RedirectCall(0x53F949, MySpriteDrawAnyRect);
patch::RedirectCall(0x53F437, MySpriteDrawAnyRectHooked);
patch::RedirectCall(0x53F590, MySpriteDrawAnyRectHooked);
patch::RedirectCall(0x53F63B, MySpriteDrawAnyRectHooked);
}
} skyPatch;
CRGBA SkyPatch::ColorHooked = { 0, 0, 0, 0 };