[saco] Implement/match ApplyVehicleColorPatches()

This commit is contained in:
RD42 2024-08-18 23:08:48 +08:00
parent ba9035bf44
commit a9dfe633d8
2 changed files with 95 additions and 0 deletions

View File

@ -21,6 +21,11 @@ typedef unsigned short PLAYERID;
#define PI 3.1415926f
#pragma pack(1)
typedef struct _RGBA {
unsigned char r,g,b,a;
} RGBA, *PRGBA;
typedef struct _VECTOR {
float X,Y,Z;
} VECTOR, *PVECTOR;

View File

@ -350,6 +350,96 @@ void FUNC_100AABE0()
//----------------------------------------------------------
RGBA NewVehicleColors[256] = {
{0x00,0x00,0x00,0xFF},{0xF5,0xF5,0xF5,0xFF},{0x2A,0x77,0xA1,0xFF},{0x84,0x04,0x10,0xFF},
{0x26,0x37,0x39,0xFF},{0x86,0x44,0x6E,0xFF},{0xD7,0x8E,0x10,0xFF},{0x4C,0x75,0xB7,0xFF},
{0xBD,0xBE,0xC6,0xFF},{0x5E,0x70,0x72,0xFF},{0x46,0x59,0x7A,0xFF},{0x65,0x6A,0x79,0xFF},
{0x5D,0x7E,0x8D,0xFF},{0x58,0x59,0x5A,0xFF},{0xD6,0xDA,0xD6,0xFF},{0x9C,0xA1,0xA3,0xFF},
{0x33,0x5F,0x3F,0xFF},{0x73,0x0E,0x1A,0xFF},{0x7B,0x0A,0x2A,0xFF},{0x9F,0x9D,0x94,0xFF},
{0x3B,0x4E,0x78,0xFF},{0x73,0x2E,0x3E,0xFF},{0x69,0x1E,0x3B,0xFF},{0x96,0x91,0x8C,0xFF},
{0x51,0x54,0x59,0xFF},{0x3F,0x3E,0x45,0xFF},{0xA5,0xA9,0xA7,0xFF},{0x63,0x5C,0x5A,0xFF},
{0x3D,0x4A,0x68,0xFF},{0x97,0x95,0x92,0xFF},{0x42,0x1F,0x21,0xFF},{0x5F,0x27,0x2B,0xFF},
{0x84,0x94,0xAB,0xFF},{0x76,0x7B,0x7C,0xFF},{0x64,0x64,0x64,0xFF},{0x5A,0x57,0x52,0xFF},
{0x25,0x25,0x27,0xFF},{0x2D,0x3A,0x35,0xFF},{0x93,0xA3,0x96,0xFF},{0x6D,0x7A,0x88,0xFF},
{0x22,0x19,0x18,0xFF},{0x6F,0x67,0x5F,0xFF},{0x7C,0x1C,0x2A,0xFF},{0x5F,0x0A,0x15,0xFF},
{0x19,0x38,0x26,0xFF},{0x5D,0x1B,0x20,0xFF},{0x9D,0x98,0x72,0xFF},{0x7A,0x75,0x60,0xFF},
{0x98,0x95,0x86,0xFF},{0xAD,0xB0,0xB0,0xFF},{0x84,0x89,0x88,0xFF},{0x30,0x4F,0x45,0xFF},
{0x4D,0x62,0x68,0xFF},{0x16,0x22,0x48,0xFF},{0x27,0x2F,0x4B,0xFF},{0x7D,0x62,0x56,0xFF},
{0x9E,0xA4,0xAB,0xFF},{0x9C,0x8D,0x71,0xFF},{0x6D,0x18,0x22,0xFF},{0x4E,0x68,0x81,0xFF},
{0x9C,0x9C,0x98,0xFF},{0x91,0x73,0x47,0xFF},{0x66,0x1C,0x26,0xFF},{0x94,0x9D,0x9F,0xFF},
{0xA4,0xA7,0xA5,0xFF},{0x8E,0x8C,0x46,0xFF},{0x34,0x1A,0x1E,0xFF},{0x6A,0x7A,0x8C,0xFF},
{0xAA,0xAD,0x8E,0xFF},{0xAB,0x98,0x8F,0xFF},{0x85,0x1F,0x2E,0xFF},{0x6F,0x82,0x97,0xFF},
{0x58,0x58,0x53,0xFF},{0x9A,0xA7,0x90,0xFF},{0x60,0x1A,0x23,0xFF},{0x20,0x20,0x2C,0xFF},
{0xA4,0xA0,0x96,0xFF},{0xAA,0x9D,0x84,0xFF},{0x78,0x22,0x2B,0xFF},{0x0E,0x31,0x6D,0xFF},
{0x72,0x2A,0x3F,0xFF},{0x7B,0x71,0x5E,0xFF},{0x74,0x1D,0x28,0xFF},{0x1E,0x2E,0x32,0xFF},
{0x4D,0x32,0x2F,0xFF},{0x7C,0x1B,0x44,0xFF},{0x2E,0x5B,0x20,0xFF},{0x39,0x5A,0x83,0xFF},
{0x6D,0x28,0x37,0xFF},{0xA7,0xA2,0x8F,0xFF},{0xAF,0xB1,0xB1,0xFF},{0x36,0x41,0x55,0xFF},
{0x6D,0x6C,0x6E,0xFF},{0x0F,0x6A,0x89,0xFF},{0x20,0x4B,0x6B,0xFF},{0x2B,0x3E,0x57,0xFF},
{0x9B,0x9F,0x9D,0xFF},{0x6C,0x84,0x95,0xFF},{0x4D,0x84,0x95,0xFF},{0xAE,0x9B,0x7F,0xFF},
{0x40,0x6C,0x8F,0xFF},{0x1F,0x25,0x3B,0xFF},{0xAB,0x92,0x76,0xFF},{0x13,0x45,0x73,0xFF},
{0x96,0x81,0x6C,0xFF},{0x64,0x68,0x6A,0xFF},{0x10,0x50,0x82,0xFF},{0xA1,0x99,0x83,0xFF},
{0x38,0x56,0x94,0xFF},{0x52,0x56,0x61,0xFF},{0x7F,0x69,0x56,0xFF},{0x8C,0x92,0x9A,0xFF},
{0x59,0x6E,0x87,0xFF},{0x47,0x35,0x32,0xFF},{0x44,0x62,0x4F,0xFF},{0x73,0x0A,0x27,0xFF},
{0x22,0x34,0x57,0xFF},{0x64,0x0D,0x1B,0xFF},{0xA3,0xAD,0xC6,0xFF},{0x69,0x58,0x53,0xFF},
{0x9B,0x8B,0x80,0xFF},{0x62,0x0B,0x1C,0xFF},{0x5B,0x5D,0x5E,0xFF},{0x62,0x44,0x28,0xFF},
{0x73,0x18,0x27,0xFF},{0x1B,0x37,0x6D,0xFF},{0xEC,0x6A,0xAE,0xFF},{0x00,0x00,0x00,0xFF},
{0x17,0x75,0x17,0xFF},{0x21,0x06,0x06,0xFF},{0x12,0x54,0x78,0xFF},{0x45,0x2A,0x0D,0xFF},
{0x57,0x1E,0x1E,0xFF},{0x01,0x07,0x01,0xFF},{0x25,0x22,0x5A,0xFF},{0x2C,0x89,0xAA,0xFF},
{0x8A,0x4D,0xBD,0xFF},{0x35,0x96,0x3A,0xFF},{0xB7,0xB7,0xB7,0xFF},{0x46,0x4C,0x8D,0xFF},
{0x84,0x88,0x8C,0xFF},{0x81,0x78,0x67,0xFF},{0x81,0x7A,0x26,0xFF},{0x6A,0x50,0x6F,0xFF},
{0x58,0x3E,0x6F,0xFF},{0x8C,0xB9,0x72,0xFF},{0x82,0x4F,0x78,0xFF},{0x6D,0x27,0x6A,0xFF},
{0x1E,0x1D,0x13,0xFF},{0x1E,0x13,0x06,0xFF},{0x1F,0x25,0x18,0xFF},{0x2C,0x45,0x31,0xFF},
{0x1E,0x4C,0x99,0xFF},{0x2E,0x5F,0x43,0xFF},{0x1E,0x99,0x48,0xFF},{0x1E,0x99,0x99,0xFF},
{0x99,0x99,0x76,0xFF},{0x7C,0x84,0x99,0xFF},{0x99,0x2E,0x1E,0xFF},{0x2C,0x1E,0x08,0xFF},
{0x14,0x24,0x07,0xFF},{0x99,0x3E,0x4D,0xFF},{0x1E,0x4C,0x99,0xFF},{0x19,0x81,0x81,0xFF},
{0x1A,0x29,0x2A,0xFF},{0x16,0x61,0x6F,0xFF},{0x1B,0x66,0x87,0xFF},{0x6C,0x3F,0x99,0xFF},
{0x48,0x1A,0x0E,0xFF},{0x7A,0x73,0x99,0xFF},{0x74,0x6D,0x99,0xFF},{0x53,0x38,0x7E,0xFF},
{0x22,0x24,0x07,0xFF},{0x3E,0x19,0x0C,0xFF},{0x46,0x21,0x0E,0xFF},{0x99,0x1E,0x1E,0xFF},
{0x8D,0x4C,0x8D,0xFF},{0x80,0x5B,0x80,0xFF},{0x7B,0x3E,0x7E,0xFF},{0x3C,0x17,0x37,0xFF},
{0x73,0x35,0x17,0xFF},{0x78,0x18,0x18,0xFF},{0x83,0x34,0x1A,0xFF},{0x8E,0x2F,0x1C,0xFF},
{0x7E,0x3E,0x53,0xFF},{0x7C,0x6D,0x7C,0xFF},{0x02,0x0C,0x02,0xFF},{0x07,0x24,0x07,0xFF},
{0x16,0x30,0x12,0xFF},{0x16,0x30,0x1B,0xFF},{0x64,0x2B,0x4F,0xFF},{0x36,0x84,0x52,0xFF},
{0x99,0x95,0x90,0xFF},{0x81,0x8D,0x96,0xFF},{0x99,0x99,0x1E,0xFF},{0x7F,0x99,0x4C,0xFF},
{0x83,0x92,0x92,0xFF},{0x78,0x82,0x22,0xFF},{0x2B,0x3C,0x99,0xFF},{0x3A,0x3A,0x0B,0xFF},
{0x8A,0x79,0x4E,0xFF},{0x0E,0x1F,0x49,0xFF},{0x15,0x37,0x1C,0xFF},{0x15,0x27,0x3A,0xFF},
{0x37,0x57,0x75,0xFF},{0x06,0x08,0x20,0xFF},{0x07,0x13,0x26,0xFF},{0x20,0x39,0x4B,0xFF},
{0x2C,0x50,0x89,0xFF},{0x15,0x42,0x6C,0xFF},{0x10,0x32,0x50,0xFF},{0x24,0x16,0x63,0xFF},
{0x69,0x20,0x15,0xFF},{0x8C,0x8D,0x94,0xFF},{0x51,0x60,0x13,0xFF},{0x09,0x0F,0x02,0xFF},
{0x8C,0x57,0x3A,0xFF},{0x52,0x88,0x8E,0xFF},{0x99,0x5C,0x52,0xFF},{0x99,0x58,0x1E,0xFF},
{0x99,0x3A,0x63,0xFF},{0x99,0x8F,0x4E,0xFF},{0x99,0x31,0x1E,0xFF},{0x0D,0x18,0x42,0xFF},
{0x52,0x1E,0x1E,0xFF},{0x42,0x42,0x0D,0xFF},{0x4C,0x99,0x1E,0xFF},{0x08,0x2A,0x1D,0xFF},
{0x96,0x82,0x1D,0xFF},{0x19,0x7F,0x19,0xFF},{0x3B,0x14,0x1F,0xFF},{0x74,0x52,0x17,0xFF},
{0x89,0x3F,0x8D,0xFF},{0x7E,0x1A,0x6C,0xFF},{0x0B,0x37,0x0B,0xFF},{0x27,0x45,0x0D,0xFF},
{0x07,0x1F,0x24,0xFF},{0x78,0x45,0x73,0xFF},{0x8A,0x65,0x3A,0xFF},{0x73,0x26,0x17,0xFF},
{0x31,0x94,0x90,0xFF},{0x56,0x94,0x1D,0xFF},{0x59,0x16,0x3D,0xFF},{0x1B,0x8A,0x2F,0xFF},
{0x38,0x16,0x0B,0xFF},{0x04,0x18,0x04,0xFF},{0x35,0x5D,0x8E,0xFF},{0x2E,0x3F,0x5B,0xFF},
{0x56,0x1A,0x28,0xFF},{0x4E,0x0E,0x27,0xFF},{0x70,0x6C,0x67,0xFF},{0x3B,0x3E,0x42,0xFF},
{0x2E,0x2D,0x33,0xFF},{0x7B,0x7E,0x7D,0xFF},{0x4A,0x44,0x42,0xFF},{0x28,0x34,0x4E,0xFF},
};
RGBA UseVehicleColors[256];
void ApplyVehicleColorPatches()
{
memcpy(UseVehicleColors,NewVehicleColors,sizeof(UseVehicleColors));
UnFuck(0x44B1C1,4);
*(DWORD*)0x44B1C1 = (DWORD)&UseVehicleColors[0];
UnFuck(0x4C8390,4);
*(DWORD*)0x4C8390 = (DWORD)&UseVehicleColors[0];
UnFuck(0x4C8399,4);
*(DWORD*)0x4C8399 = (DWORD)&UseVehicleColors[0].g;
UnFuck(0x4C83A3,4);
*(DWORD*)0x4C83A3 = (DWORD)&UseVehicleColors[0].b;
UnFuck(0x5817CC,4);
*(DWORD*)0x5817CC = (DWORD)&UseVehicleColors[0];
UnFuck(0x582176,4);
*(DWORD*)0x582176 = (DWORD)&UseVehicleColors[0];
UnFuck(0x6A6FFA,4);
*(DWORD*)0x6A6FFA = (DWORD)&UseVehicleColors[0];
}
//----------------------------------------------------------
extern DWORD dwFarClipHookAddr;
extern DWORD dwFarClipReturnAddr;