/*
xMemoria System OpenSource License
禁止商业用途,禁止修改运行汉化补丁。
Copyright (c) 2014-??? X'moe. All rights reserved.
xmoe.project@gmail.com
xMemoria System is powered by SDL2 SDL_mixer libvlc zlib
*/
#include "SystemFunction.h"
struct ColorTableInfo
{
u8 r;
u8 g;
u8 b;
u8 a;
ColorTableInfo()
{
r = g = b =a =0x00;
}
ColorTableInfo(){}
};
//一共5个args
//类似于gameexe的ColorTable
int Exec::ColorSet(VarInfo &a, VarInfo &b, VarInfo &g, VarInfo &r, VarInfo &table)
{
hcbStackMain::ColorTablePointer = hcbStackMain::ColorTable.find((u8)table.value);
if(hcbStackMain::ColorTablePointer == hcbStackMain::ColorTable.end())
{
hcbStackMain::ColorTableInfo info;
info.r = (u8)r.value;
info.g = (u8)g.value;
info.b = (u8)b.value;
info.a = (u8)a.value;
hcbStackMain::ColorTable.insert((hcbStackMain::ColorTableInsert)((u8)table.value,info));
}
else
{
hcbStackMain::ColorTablePointer->second.r = (u8)r.value;
hcbStackMain::ColorTablePointer->second.g = (u8)g.value;
hcbStackMain::ColorTablePointer->second.b = (u8)b.value;
hcbStackMain::ColorTablePointer->second.a = (u8)a.value;
}
return 0;
}
↧
【xMemoria System】开源【Color部分】
↧