[saco] Add font functions

This commit is contained in:
RD42 2023-11-12 23:36:02 +08:00
parent c1ad67cc4a
commit 3e501c13ac
5 changed files with 174 additions and 0 deletions

150
saco/game/font.cpp Normal file
View File

@ -0,0 +1,150 @@
#include <windows.h>
#include "font.h"
#define NUDE void _declspec(naked)
//----------------------------------------------------------
void Font_PrintString(float X, float Y, char *sz)
{
_asm push sz
_asm push Y
_asm push X
_asm mov eax, 0x71A700
_asm call eax
_asm pop eax
_asm pop eax
_asm pop eax
}
//----------------------------------------------------------
NUDE Font_SetColor(DWORD dwColor)
{
_asm mov eax, 0x719430
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_SetDropColor(DWORD dwColor)
{
_asm mov eax, 0x719510
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_SetOutline(int pos)
{
_asm mov eax, 0x719590
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_Unk12(int unk)
{
_asm mov eax, 0x719600
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_SetScale(float X, float Y)
{
_asm mov eax, 0x719380
_asm jmp eax
}
//-----------------------------------------------------------
// 0 center 1 left 2 right
NUDE Font_SetJustify(int just)
{
_asm mov eax, 0x719610
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_SetFontStyle(int style)
{
_asm mov eax, 0x719490
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_SetProportional(int prop)
{
_asm mov eax, 0x7195B0
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_SetRightJustifyWrap(float wrap)
{
_asm mov eax, 0x7194F0
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_UseBox(int use, int unk)
{
_asm mov eax, 0x7195C0
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_UseBoxColor(DWORD color)
{
_asm mov eax, 0x7195E0
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_SetLineWidth(float width)
{
_asm mov eax, 0x7194D0
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_SetLineHeight(float height)
{
_asm mov eax, 0x7194E0
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_SetShadow(int shadow)
{
_asm mov eax, 0x719570
_asm jmp eax
}
//-----------------------------------------------------------
NUDE Font_UnkConv(char *sz, int param1, int param2, int param3, int param4, int param5, int param6, char * buf)
{
_asm mov eax, 0x69DE90
_asm ret
}
//-----------------------------------------------------------
NUDE Font_UnkConv2(char *sz)
{
_asm mov eax, 0x69E160
_asm jmp eax
}
//-----------------------------------------------------------

18
saco/game/font.h Normal file
View File

@ -0,0 +1,18 @@
void Font_PrintString(float X, float Y, char *sz);
void Font_SetColor(DWORD dwColor);
void Font_SetDropColor(DWORD dwColor);
void Font_SetOutline(int pos);
void Font_Unk12(int unk);
void Font_SetScale(float X, float Y);
void Font_SetJustify(int just);
void Font_SetFontStyle(int style);
void Font_SetProportional(int prop);
void Font_SetRightJustifyWrap(float wrap);
void Font_UseBox(int use, int unk);
void Font_UseBoxColor(DWORD color);
void Font_SetLineWidth(float width);
void Font_SetLineHeight(float height);
void Font_SetShadow(int shadow);
void Font_UnkConv(char *sz, int param1, int param2, int param3, int param4, int param5, int param6, char * buf);
void Font_UnkConv2(char *sz);

Binary file not shown.

Binary file not shown.

View File

@ -141,6 +141,12 @@
<File <File
RelativePath=".\game\common.h"> RelativePath=".\game\common.h">
</File> </File>
<File
RelativePath=".\game\font.cpp">
</File>
<File
RelativePath=".\game\font.h">
</File>
<File <File
RelativePath=".\game\game.cpp"> RelativePath=".\game\game.cpp">
</File> </File>