A fix, some documentation, and cleanup
This commit is contained in:
parent
24d104e2e8
commit
a3278a60b5
2 changed files with 13 additions and 2 deletions
|
@ -181,7 +181,7 @@ static BOOL LoadBitmap(SDL_RWops *fp, Surface_Ids surf_no, BOOL create_surface)
|
||||||
|
|
||||||
if (surf_no >= SURFACE_ID_MAX)
|
if (surf_no >= SURFACE_ID_MAX)
|
||||||
{
|
{
|
||||||
printf("Tried to load bitmap at invalid slot (%d - maximum is %d\n", surf_no, SURFACE_ID_MAX);
|
printf("Tried to load bitmap at invalid slot (%d - maximum is %d)\n", surf_no, SURFACE_ID_MAX);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
TEXT_SCRIPT gTS;
|
TEXT_SCRIPT gTS;
|
||||||
|
|
||||||
int gNumberTextScript[4];
|
int gNumberTextScript[4]; // Seems to be for debugging
|
||||||
char text[0x100];
|
char text[0x100];
|
||||||
|
|
||||||
RECT gRect_line = {0, 0, 216, 16};
|
RECT gRect_line = {0, 0, 216, 16};
|
||||||
|
@ -637,8 +637,14 @@ int TextScriptProc()
|
||||||
{
|
{
|
||||||
w = GetTextScriptNo(gTS.p_read + 4);
|
w = GetTextScriptNo(gTS.p_read + 4);
|
||||||
x = GetTextScriptNo(gTS.p_read + 9);
|
x = GetTextScriptNo(gTS.p_read + 9);
|
||||||
|
|
||||||
|
// Looks like Pixel left some debug code in. Oops.
|
||||||
gNumberTextScript[0] = x;
|
gNumberTextScript[0] = x;
|
||||||
|
#ifndef FIX_BUGS
|
||||||
|
// z is uninitialised. Probably a leftover from copypasting.
|
||||||
gNumberTextScript[1] = z;
|
gNumberTextScript[1] = z;
|
||||||
|
#endif
|
||||||
|
|
||||||
PlaySoundObject(38, 1);
|
PlaySoundObject(38, 1);
|
||||||
AddArmsData(w, x);
|
AddArmsData(w, x);
|
||||||
gTS.p_read += 13;
|
gTS.p_read += 13;
|
||||||
|
@ -1211,6 +1217,11 @@ int TextScriptProc()
|
||||||
}
|
}
|
||||||
else if (IS_COMMAND('N','U','M'))
|
else if (IS_COMMAND('N','U','M'))
|
||||||
{
|
{
|
||||||
|
// This seems to be a command used for debugging TSC scripts:
|
||||||
|
// It prints a selected char in the gNumberTextScript array.
|
||||||
|
// gNumberTextScript is only used by the '<AM+' command, and
|
||||||
|
// even then, part of it's assigned to an uninitialised
|
||||||
|
// variable, while the other half of it is completely unused.
|
||||||
z = GetTextScriptNo(gTS.p_read + 4);
|
z = GetTextScriptNo(gTS.p_read + 4);
|
||||||
SetNumberTextScript(z);
|
SetNumberTextScript(z);
|
||||||
gTS.p_read += 8;
|
gTS.p_read += 8;
|
||||||
|
|
Loading…
Add table
Reference in a new issue