More-accurate TextScr.cpp variable arrangement
This commit is contained in:
parent
8a860c57f3
commit
098647f7fd
2 changed files with 27 additions and 27 deletions
|
@ -41,7 +41,6 @@
|
||||||
|
|
||||||
TEXT_SCRIPT gTS;
|
TEXT_SCRIPT gTS;
|
||||||
|
|
||||||
int gNumberTextScript[4];
|
|
||||||
char text[4][0x40];
|
char text[4][0x40];
|
||||||
|
|
||||||
RECT gRect_line = {0, 0, 216, 16};
|
RECT gRect_line = {0, 0, 216, 16};
|
||||||
|
@ -88,6 +87,7 @@ void EndTextScript(void)
|
||||||
|
|
||||||
// Release buffers
|
// Release buffers
|
||||||
ReleaseSurface(SURFACE_ID_TEXT_BOX);
|
ReleaseSurface(SURFACE_ID_TEXT_BOX);
|
||||||
|
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
ReleaseSurface((SurfaceID)(SURFACE_ID_TEXT_LINE1 + i));
|
ReleaseSurface((SurfaceID)(SURFACE_ID_TEXT_LINE1 + i));
|
||||||
}
|
}
|
||||||
|
@ -95,12 +95,14 @@ void EndTextScript(void)
|
||||||
// Decrypt .tsc
|
// Decrypt .tsc
|
||||||
void EncryptionBinaryData2(unsigned char *pData, long size)
|
void EncryptionBinaryData2(unsigned char *pData, long size)
|
||||||
{
|
{
|
||||||
int val1;
|
|
||||||
int work;
|
|
||||||
int i;
|
int i;
|
||||||
|
int work;
|
||||||
|
|
||||||
int half;
|
int half;
|
||||||
|
int val1;
|
||||||
|
|
||||||
half = size / 2;
|
half = size / 2;
|
||||||
|
|
||||||
if (pData[half] == 0)
|
if (pData[half] == 0)
|
||||||
val1 = -7;
|
val1 = -7;
|
||||||
else
|
else
|
||||||
|
@ -119,8 +121,8 @@ void EncryptionBinaryData2(unsigned char *pData, long size)
|
||||||
// Load generic .tsc
|
// Load generic .tsc
|
||||||
BOOL LoadTextScript2(const char *name)
|
BOOL LoadTextScript2(const char *name)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
char path[MAX_PATH];
|
||||||
|
|
||||||
// Get path
|
// Get path
|
||||||
sprintf(path, "%s\\%s", gDataPath, name);
|
sprintf(path, "%s\\%s", gDataPath, name);
|
||||||
|
@ -151,8 +153,8 @@ BOOL LoadTextScript2(const char *name)
|
||||||
// Load stage .tsc
|
// Load stage .tsc
|
||||||
BOOL LoadTextScript_Stage(const char *name)
|
BOOL LoadTextScript_Stage(const char *name)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
char path[MAX_PATH];
|
||||||
long head_size;
|
long head_size;
|
||||||
long body_size;
|
long body_size;
|
||||||
|
|
||||||
|
@ -300,6 +302,7 @@ BOOL JumpTextScript(int no)
|
||||||
|
|
||||||
// Find where event starts
|
// Find where event starts
|
||||||
gTS.p_read = 0;
|
gTS.p_read = 0;
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
// Check if we are still in the proper range
|
// Check if we are still in the proper range
|
||||||
|
@ -324,6 +327,7 @@ BOOL JumpTextScript(int no)
|
||||||
// Advance until new-line
|
// Advance until new-line
|
||||||
while (gTS.data[gTS.p_read] != '\n')
|
while (gTS.data[gTS.p_read] != '\n')
|
||||||
++gTS.p_read;
|
++gTS.p_read;
|
||||||
|
|
||||||
++gTS.p_read;
|
++gTS.p_read;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -351,15 +355,17 @@ void CheckNewLine(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int gNumberTextScript[4];
|
||||||
|
|
||||||
// Type a number into the text buffer
|
// Type a number into the text buffer
|
||||||
void SetNumberTextScript(int index)
|
void SetNumberTextScript(int index)
|
||||||
{
|
{
|
||||||
|
char str[5];
|
||||||
|
BOOL bZero;
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
int i;
|
|
||||||
BOOL bZero;
|
|
||||||
int offset;
|
int offset;
|
||||||
char str[5];
|
int i;
|
||||||
|
|
||||||
// Get digit table
|
// Get digit table
|
||||||
int table[3];
|
int table[3];
|
||||||
|
@ -429,15 +435,7 @@ void ClearTextLine(void)
|
||||||
// Draw textbox and whatever else
|
// Draw textbox and whatever else
|
||||||
void PutTextScript(void)
|
void PutTextScript(void)
|
||||||
{
|
{
|
||||||
RECT rcFace;
|
|
||||||
RECT rcItemBox1;
|
|
||||||
RECT rcItemBox2;
|
|
||||||
RECT rcItemBox3;
|
|
||||||
RECT rcItemBox4;
|
|
||||||
RECT rcItemBox5;
|
|
||||||
int i;
|
int i;
|
||||||
RECT rect_yesno;
|
|
||||||
RECT rect_cur;
|
|
||||||
RECT rect;
|
RECT rect;
|
||||||
int text_offset;
|
int text_offset;
|
||||||
|
|
||||||
|
@ -473,6 +471,7 @@ void PutTextScript(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw face picture
|
// Draw face picture
|
||||||
|
RECT rcFace;
|
||||||
rcFace.left = (gTS.face % 6) * 48;
|
rcFace.left = (gTS.face % 6) * 48;
|
||||||
rcFace.top = (gTS.face / 6) * 48;
|
rcFace.top = (gTS.face / 6) * 48;
|
||||||
rcFace.right = rcFace.left + 48;
|
rcFace.right = rcFace.left + 48;
|
||||||
|
@ -522,11 +521,11 @@ void PutTextScript(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw GIT
|
// Draw GIT
|
||||||
SET_RECT(rcItemBox1, 0, 0, 72, 16)
|
RECT rcItemBox1 = {0, 0, 72, 16};
|
||||||
SET_RECT(rcItemBox2, 0, 8, 72, 24)
|
RECT rcItemBox2 = {0, 8, 72, 24};
|
||||||
SET_RECT(rcItemBox3, 240, 0, 244, 8)
|
RECT rcItemBox3 = {240, 0, 244, 8};
|
||||||
SET_RECT(rcItemBox4, 240, 8, 244, 16)
|
RECT rcItemBox4 = {240, 8, 244, 16};
|
||||||
SET_RECT(rcItemBox5, 240, 16, 244, 24)
|
RECT rcItemBox5 = {240, 16, 244, 24};
|
||||||
|
|
||||||
if (gTS.item != 0)
|
if (gTS.item != 0)
|
||||||
{
|
{
|
||||||
|
@ -559,8 +558,8 @@ void PutTextScript(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw Yes / No selection
|
// Draw Yes / No selection
|
||||||
SET_RECT(rect_yesno, 152, 48, 244, 80)
|
RECT rect_yesno = {152, 48, 244, 80};
|
||||||
SET_RECT(rect_cur, 112, 88, 128, 104)
|
RECT rect_cur = {112, 88, 128, 104};
|
||||||
|
|
||||||
if (gTS.mode == 6)
|
if (gTS.mode == 6)
|
||||||
{
|
{
|
||||||
|
@ -578,11 +577,12 @@ void PutTextScript(void)
|
||||||
// Parse TSC
|
// Parse TSC
|
||||||
int TextScriptProc(void)
|
int TextScriptProc(void)
|
||||||
{
|
{
|
||||||
BOOL bExit;
|
|
||||||
char c[3];
|
|
||||||
int w, x, y, z;
|
|
||||||
int i;
|
int i;
|
||||||
|
char c[3];
|
||||||
char str[72];
|
char str[72];
|
||||||
|
int w, x, y, z;
|
||||||
|
|
||||||
|
BOOL bExit;
|
||||||
|
|
||||||
RECT rcSymbol = {64, 48, 72, 56};
|
RECT rcSymbol = {64, 48, 72, 56};
|
||||||
|
|
||||||
|
|
|
@ -349,7 +349,7 @@
|
||||||
Name="Release|Win32">
|
Name="Release|Win32">
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
CompileAs="1"/>
|
CompileAs="0"/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
|
Loading…
Add table
Reference in a new issue