char fonts_name[] = "fonts";
char fonts_path[] = "MODELS/FONTS.TXD";
char aFont2m[] = "font2m";
char aFont2[] = "font2";
char aFont1m[] = "font1m";
char aFont1[] = "font1";
void CFont__SetColor(RwRGBA * fontRGBA) {
auto __CFont_setColor = (void (__cdecl*)(RwRGBA * fontRGBA))0x0550170;
__CFont_setColor(fontRGBA);
};
void SetTextBackgroundColor(RwRGBA * bgRGBA) {
auto _SetTextBackgroundColor = (void (__cdecl*)(RwRGBA * fontRGBA))0x05500A0;
_SetTextBackgroundColor(bgRGBA);
}
void restoreTexDictionary(){
auto _restoreTexDictionar = (void (__cdecl*)())0x0580AA0;
_restoreTexDictionar();
}
void SetFontStyle(int fontIndex) {
auto _SetFontStyle = (void (__cdecl*)(int fontIndex))0x054FFE0;
_SetFontStyle(fontIndex);
}
//00552530
auto _texFont2 = (CSprite2D*)0x0A108B4;
auto _texFont1 = (CSprite2D*)0x0A108B8;
auto rsGlobal = (RsGlobalType*)0x09B48D8;
auto letterWidth = (float*)0x097F824;
auto letterHeight = (float*)0x097F828;
auto flt_97F830 = (float*)0x097F830;
auto flt_97F834 = (float*)0x097F834;
auto flt_97F82C = (float*)0x097F82C;
auto textWidthAdjustment = (char*)0x097F838;
auto textCentered = (char*)0x097F839;
auto textAlignment = (char*)0x097F83A;
auto textDrawBox = (char*)0x097F83B;
auto textBackgroundEnabled = (char*)0x097F83C;
auto textProportional = (char*)0x097F83D;
auto _textLineWidth = (float*)0x097F84C;
auto fontStyle = (WORD*)0x097F858;
auto baseCharset = (BYTE*)0x097F85A;
auto fTextHTab = (DWORD*)0x097F854;
auto flt_97F844 = (float*)0x097F844;
auto word_97F860 = (WORD*)0x097F860;
auto textCenteredWidth = (float*)0x097F850;
void EnableTextProportional() {
*textProportional = 1;
};
void DisableTextProportional(){
*textProportional = 0;
};
void SetTextDrawLeftAlignment(){
*textAlignment = 0;
*textWidthAdjustment = 0;
*textCentered = 0;
};
void SetTextDrawRightAlignment() {
*textAlignment = 1;
*textWidthAdjustment = 0;
*textCentered = 0;
};
void DisableTextBackground(){
*textBackgroundEnabled = 0;
};
void EnableTextBackground() {
*textBackgroundEnabled = 1;
};
void DisableTextDrawInBox(){
*textDrawBox = 0;
};
void EnableTextDrawInBox(){
*textDrawBox = 1;
};
void SetTextCenteredWidth(float textWidth){
*textCenteredWidth = textWidth;
};
void SetTextLineWidth(float textWidth){
*_textLineWidth = textWidth;
};
void DisableTextDrawCentered(){
*textCentered = 0;
};
void EnableTextDrawCentered(){
*textCentered = 1;
*textWidthAdjustment = 0;
*textAlignment = 0;
};
void DisableTextWidthAdjustment(){
*textWidthAdjustment = 0;
*textAlignment = 0;
};
void EnableTextWidthAdjustment(){
*textWidthAdjustment = 1;
*textCentered = 0;
*textAlignment = 0;
};
void SetLetterSize(float width, float height){
*letterWidth = width;
*letterHeight = height;
};
void loadFontsTextures() {
RwRGBA rgbaFont;
RwRGBA rgbaFont2;
DWORD refTex = txdAdd(fonts_name);
txdLoad(refTex, fonts_path);
txdAddRef(refTex);
saveTexDictionary();
txdSetCurrent(refTex);
_texFont2->readTexture(aFont2, aFont2m);
_texFont1->readTexture(aFont1, aFont1m);
*letterWidth = 1.0f;
*letterHeight = 1.0f;
*flt_97F830 = rsGlobal->w;
*flt_97F834 = 0;
*flt_97F82C = 0;
rgbaFont.alpha = 0;
rgbaFont.red = 255;
rgbaFont.green = 255;
rgbaFont.blue = 255;
CFont__SetColor(&rgbaFont);
*textWidthAdjustment = 0; //
*textAlignment = 0; //
*textCentered = 0; //
*_textLineWidth = rsGlobal->w;
rgbaFont2.alpha = 128;
rgbaFont2.blue = 128;
rgbaFont2.green = 128;
rgbaFont2.red = 128;
SetTextBackgroundColor(&rgbaFont2);
*textBackgroundEnabled = 0;
*textProportional = 1;
*fontStyle = 0;
*baseCharset = 0;
*fTextHTab = 0;
*flt_97F844 = 255.0;
*word_97F860 = 0;
restoreTexDictionary();
}