- implement PrintStringBoxed

This commit is contained in:
Ilya Shurumov 2020-05-17 13:46:58 +06:00
parent 3392b10e16
commit 5dcadac032

View File

@ -794,88 +794,99 @@ int PrintStringFeature(char *string, int x, int y, int w, int h, int transparent
/* end block 4 */ /* end block 4 */
// End Line: 1388 // End Line: 1388
// [D]
void PrintStringBoxed(char *string, int ix, int iy) void PrintStringBoxed(char *string, int ix, int iy)
{ {
UNIMPLEMENTED(); char bVar1;
/* char *pbVar2;
byte bVar1; unsigned char uVar3;
uchar uVar2; short sVar4;
short sVar3; DB *pDVar5;
DB *pDVar4; int iVar6;
int iVar5;
ulong *puVar6;
uint uVar7; uint uVar7;
byte *pbVar8; ulong *puVar8;
uint *puVar9; SPRT *font;
int iVar9;
int iVar10; int iVar10;
int iVar11; char word[32];
byte local_40;
byte local_3f[31];
puVar9 = (uint *)current->primptr; font = (SPRT *)current->primptr;
if (*string != '\0') {
iVar11 = 1; if (*string != 0)
iVar10 = ix; {
iVar10 = 1;
iVar9 = ix;
do { do {
string = GetNextWord(string, (char *)&local_40); string = GetNextWord(string, word);
iVar5 = StringWidth((char *)&local_40); iVar6 = StringWidth(word);
if ((0x134 < iVar10 + iVar5) && ((iVar11 != 1 || (*string != '\0')))) {
if (0x134 < iVar9 + iVar6 && (iVar10 != 1 || (*string != 0)))
{
iy = iy + 0xe; iy = iy + 0xe;
iVar10 = ix; iVar9 = ix;
} }
pbVar8 = local_3f;
bVar1 = local_40; pbVar2 = word;
while (bVar1 != 0) { bVar1 = word[0];
if (bVar1 == 0x20) {
iVar10 = iVar10 + 4; while (pbVar2 = pbVar2 + 1, bVar1 != 0)
{
if (bVar1 == 32)
{
iVar9 = iVar9 + 4;
} }
else { else
uVar7 = (uint)(byte)AsciiTable[bVar1]; {
if (uVar7 != 0xffffffff) { uVar7 = AsciiTable[bVar1];
*(char *)((int)puVar9 + 3) = '\x04';
*(char *)((int)puVar9 + 7) = 'd'; if (uVar7 != 0xffffffff)
*(uchar *)(puVar9 + 1) = gFontColour.r; {
*(uchar *)((int)puVar9 + 5) = gFontColour.g; setSprt(font);
uVar2 = gFontColour.b;
*(short *)(puVar9 + 2) = (short)iVar10; font->r0 = gFontColour.r;
*(uchar *)((int)puVar9 + 6) = uVar2; font->g0 = gFontColour.g;
*(short *)((int)puVar9 + 10) = (short)fontinfo[uVar7].offy + (short)iy; font->b0 = gFontColour.b;
*(uchar *)(puVar9 + 3) = fontinfo[uVar7].x;
*(char *)((int)puVar9 + 0xd) = fontinfo[uVar7].y + -0x2e; font->x0 = iVar9;
pDVar4 = current; font->y0 = fontinfo[uVar7].offy + iy;
sVar3 = fontclutid; font->u0 = fontinfo[uVar7].x;
*(ushort *)(puVar9 + 4) = (ushort)fontinfo[uVar7].width; font->v0 = fontinfo[uVar7].y - 46;
bVar1 = fontinfo[uVar7].height;
*(short *)((int)puVar9 + 0xe) = sVar3; font->w = fontinfo[uVar7].width;
*(ushort *)((int)puVar9 + 0x12) = (ushort)bVar1; font->clut = fontclutid;
*puVar9 = *puVar9 & 0xff000000 | *pDVar4->ot & 0xffffff; font->h = fontinfo[uVar7].height;;
puVar6 = pDVar4->ot;
*puVar6 = *puVar6 & 0xff000000 | (uint)puVar9 & 0xffffff; addPrim(current->ot, font);
puVar9 = puVar9 + 5;
iVar10 = iVar10 + (uint)fontinfo[uVar7].width; font++;
iVar9 = iVar9 + (uint)fontinfo[uVar7].width;
} }
} }
bVar1 = *pbVar8;
pbVar8 = pbVar8 + 1; bVar1 = *pbVar2;
} }
iVar11 = iVar11 + 1; iVar10++;
} while (*string != '\0'); } while (*string != 0);
} }
*(char *)((int)puVar9 + 3) = '\a';
*(char *)((int)puVar9 + 7) = '&'; POLY_FT3* null = (POLY_FT3*)font;
pDVar4 = current;
sVar3 = fonttpage; setPolyFT3(null);
*(undefined2 *)(puVar9 + 2) = 0xffff; #ifdef PSX
*(undefined2 *)((int)puVar9 + 10) = 0xffff; setSemiTrans(null, 1);
*(undefined2 *)(puVar9 + 4) = 0xffff; #endif
*(undefined2 *)((int)puVar9 + 0x12) = 0xffff;
*(undefined2 *)(puVar9 + 6) = 0xffff; null->x0 = -1;
*(undefined2 *)((int)puVar9 + 0x1a) = 0xffff; null->y0 = -1;
*(short *)((int)puVar9 + 0x16) = sVar3; null->x1 = -1;
*puVar9 = *puVar9 & 0xff000000 | *pDVar4->ot & 0xffffff; null->y1 = -1;
*pDVar4->ot = *pDVar4->ot & 0xff000000 | (uint)puVar9 & 0xffffff; null->x2 = -1;
*(uint **)&pDVar4->primptr = puVar9 + 8; null->y2 = -1;
return;*/ null->tpage = fonttpage;
addPrim(current->ot, null);
pDVar5->primptr = (char)(null+1);
} }