2007-05-30 21:56:52 +00:00
/* ScummVM - Graphic Adventure Engine
2007-04-27 12:58:35 +00:00
*
2007-05-30 21:56:52 +00:00
* ScummVM is the legal property of its developers , whose names
* are too numerous to list here . Please refer to the COPYRIGHT
* file distributed with this source distribution .
2007-04-27 12:58:35 +00:00
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 , USA .
*
* $ URL $
* $ Id $
*
*/
2009-02-19 11:08:11 +00:00
# include "common/endian.h"
2007-04-27 12:58:35 +00:00
# include "common/file.h"
2007-12-11 23:06:12 +00:00
# include "common/util.h"
2007-04-27 12:58:35 +00:00
# include "cruise/cruise_main.h"
2009-03-01 02:19:06 +00:00
# include "cruise/mouse.h"
2009-02-19 11:08:11 +00:00
# include "cruise/staticres.h"
2007-04-27 12:58:35 +00:00
namespace Cruise {
2009-02-19 09:57:39 +00:00
/**
* Determines the line size by finding the highest character in the given font set
*/
int32 getLineHeight ( int16 charCount , const FontEntry * fontPtr ) {
2007-04-27 12:58:35 +00:00
int32 highestChar = 0 ;
2009-02-19 09:57:39 +00:00
if ( ! charCount )
2007-04-27 22:33:45 +00:00
return ( 0 ) ;
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
for ( int i = 0 ; i < charCount ; + + i ) {
int charHeight = FROM_LE_16 ( fontPtr [ i ] . charHeight ) ;
if ( charHeight > highestChar ) highestChar = charHeight ;
2007-04-27 12:58:35 +00:00
}
2009-02-19 09:57:39 +00:00
2007-04-27 12:58:35 +00:00
return highestChar ;
}
2009-02-19 09:57:39 +00:00
/**
* This function determins how many lines the text will have
*/
int32 getTextLineCount ( int32 rightBorder_X , int16 wordSpacingWidth ,
const FontEntry * fontData , const char * textString ) {
const char * localString = textString ;
const char * tempPtr = textString ;
uint8 ch ;
int32 total = 0 , lineLength = 0 ;
if ( ! * textString )
2007-04-27 22:33:45 +00:00
return ( 0 ) ;
2009-02-19 09:57:39 +00:00
ch = * localString ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
do {
2009-02-19 09:57:39 +00:00
int32 charData = fontCharacterTable [ ch ] ;
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
if ( ch = = ' | ' ) {
2007-04-27 22:33:45 +00:00
lineLength = rightBorder_X ;
2007-04-27 12:58:35 +00:00
localString = tempPtr ;
2009-02-19 09:57:39 +00:00
} else if ( charData > = 0 ) {
lineLength + = wordSpacingWidth + FROM_LE_16 ( fontData [ charData ] . charWidth ) ;
} else if ( ch = = ' ' ) {
lineLength + = wordSpacingWidth + 5 ;
localString = tempPtr ;
2007-04-27 12:58:35 +00:00
}
2009-02-19 09:57:39 +00:00
if ( lineLength > = rightBorder_X ) {
total + = rightBorder_X ;
2007-04-27 22:33:45 +00:00
tempPtr = localString ;
lineLength = 0 ;
}
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
ch = * + + tempPtr ;
} while ( ch ) ;
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
if ( lineLength > 0 )
total + = rightBorder_X ;
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
return ( total / rightBorder_X ) ;
2007-04-27 12:58:35 +00:00
}
2007-11-10 17:15:48 +00:00
void loadFNT ( const char * fileName ) {
2009-02-19 09:57:39 +00:00
uint8 header [ 4 ] ;
2007-11-10 17:15:48 +00:00
2007-04-27 22:33:45 +00:00
_systemFNT = NULL ;
2007-04-27 12:58:35 +00:00
Common : : File fontFileHandle ;
2007-04-27 22:33:45 +00:00
2009-02-19 09:57:39 +00:00
if ( ! fontFileHandle . exists ( fileName ) )
2007-04-27 12:58:35 +00:00
return ;
2007-05-30 14:38:17 +00:00
fontFileHandle . open ( ( const char * ) fileName ) ;
2007-04-27 12:58:35 +00:00
fontFileHandle . read ( header , 4 ) ;
2007-11-10 17:15:48 +00:00
if ( strcmp ( ( char * ) header , " FNT " ) = = 0 ) {
2009-02-19 09:57:39 +00:00
uint32 fontSize = fontFileHandle . readUint32BE ( ) ;
2007-04-27 12:58:35 +00:00
2007-05-30 14:38:17 +00:00
_systemFNT = ( uint8 * ) mallocAndZero ( fontSize ) ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
if ( _systemFNT ! = NULL ) {
2009-02-19 09:57:39 +00:00
fontFileHandle . seek ( 4 ) ;
2007-04-27 12:58:35 +00:00
fontFileHandle . read ( _systemFNT , fontSize ) ;
2009-02-19 09:57:39 +00:00
// Flip structure values from BE to LE for font files - this is for consistency
// with font resources, which are in LE formatt
FontInfo * f = ( FontInfo * ) _systemFNT ;
flipLong ( & f - > offset ) ;
flipLong ( & f - > size ) ;
flipGen ( & f - > numChars , 6 ) ; // numChars, hSpacing, and vSpacing
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
FontEntry * fe = ( FontEntry * ) ( _systemFNT + sizeof ( FontInfo ) ) ;
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
for ( int i = 0 ; i < FROM_LE_16 ( f - > numChars ) ; + + i , + + fe ) {
flipLong ( & fe - > offset ) ; // Flip 32-bit offset field
flipGen ( & fe - > v1 , 8 ) ; // Flip remaining 16-bit fields
2007-04-27 12:58:35 +00:00
}
}
}
fontFileHandle . close ( ) ;
}
2007-12-18 20:12:42 +00:00
void initSystem ( void ) {
2007-04-27 12:58:35 +00:00
int32 i ;
2007-12-18 20:12:42 +00:00
itemColor = 15 ;
titleColor = 9 ;
selectColor = 13 ;
subColor = 10 ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
for ( i = 0 ; i < 64 ; i + + ) {
2007-12-18 20:12:42 +00:00
strcpy ( preloadData [ i ] . name , " " ) ;
preloadData [ i ] . ptr = NULL ;
preloadData [ i ] . nofree = 0 ;
2007-04-27 12:58:35 +00:00
}
2007-12-18 20:12:42 +00:00
lowMemory = 0 ;
doFade = 0 ;
fadeFlag = 0 ;
scroll = 0 ;
2007-11-10 17:15:48 +00:00
switchPal = 0 ;
2007-12-24 16:57:14 +00:00
masterScreen = 0 ;
2007-04-27 12:58:35 +00:00
2007-12-18 20:12:42 +00:00
changeCursor ( CURSOR_NORMAL ) ;
2007-04-27 12:58:35 +00:00
2007-12-18 20:12:42 +00:00
strcpy ( cmdLine , " " ) ;
2007-04-27 12:58:35 +00:00
loadFNT ( " system.fnt " ) ;
}
2009-02-19 09:57:39 +00:00
void freeSystem ( void ) {
free ( _systemFNT ) ;
}
2007-04-27 22:33:45 +00:00
void flipShort ( int16 * var ) {
uint8 * varPtr = ( uint8 * ) var ;
2007-12-11 23:06:12 +00:00
SWAP ( varPtr [ 0 ] , varPtr [ 1 ] ) ;
2007-04-27 12:58:35 +00:00
}
2007-04-27 22:33:45 +00:00
void flipShort ( uint16 * var ) {
uint8 * varPtr = ( uint8 * ) var ;
2007-12-11 23:06:12 +00:00
SWAP ( varPtr [ 0 ] , varPtr [ 1 ] ) ;
2007-04-27 12:58:35 +00:00
}
2007-04-27 22:33:45 +00:00
void flipLong ( int32 * var ) {
2009-02-19 09:57:39 +00:00
uint8 * varPtr = ( uint8 * ) var ;
2007-04-27 12:58:35 +00:00
2007-12-11 23:06:12 +00:00
SWAP ( varPtr [ 0 ] , varPtr [ 3 ] ) ;
SWAP ( varPtr [ 1 ] , varPtr [ 2 ] ) ;
2007-04-27 12:58:35 +00:00
}
2007-04-27 22:33:45 +00:00
void flipLong ( uint32 * var ) {
2009-02-19 09:57:39 +00:00
uint8 * varPtr = ( uint8 * ) var ;
2007-04-27 12:58:35 +00:00
2007-12-11 23:06:12 +00:00
SWAP ( varPtr [ 0 ] , varPtr [ 3 ] ) ;
SWAP ( varPtr [ 1 ] , varPtr [ 2 ] ) ;
2007-04-27 12:58:35 +00:00
}
2007-04-27 22:33:45 +00:00
void flipGen ( void * var , int32 length ) {
2007-04-27 12:58:35 +00:00
int i ;
2007-04-27 22:33:45 +00:00
short int * varPtr = ( int16 * ) var ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
for ( i = 0 ; i < ( length / 2 ) ; i + + ) {
2007-04-27 12:58:35 +00:00
flipShort ( & varPtr [ i ] ) ;
}
}
2009-03-01 02:19:06 +00:00
void renderWord ( const uint8 * fontPtr_Data , uint8 * outBufferPtr , int xOffset , int yOffset ,
int32 height , int32 param4 , int32 stringRenderBufferSize , int32 width , int32 charWidth ) {
2007-04-27 12:58:35 +00:00
int i ;
int j ;
2009-02-19 09:57:39 +00:00
const uint8 * fontPtr_Data2 = fontPtr_Data + height * 2 ;
2007-04-27 12:58:35 +00:00
2009-03-01 02:19:06 +00:00
outBufferPtr + = yOffset * width * 2 + xOffset ;
2007-04-27 12:58:35 +00:00
2007-09-10 13:17:20 +00:00
for ( i = 0 ; i < height ; i + + ) { // y++
2009-02-19 09:57:39 +00:00
uint16 bitSet1 = READ_BE_UINT16 ( fontPtr_Data ) ;
uint16 bitSet2 = READ_BE_UINT16 ( fontPtr_Data2 ) ;
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
fontPtr_Data + = sizeof ( uint16 ) ;
fontPtr_Data2 + = sizeof ( uint16 ) ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
for ( j = 0 ; j < charWidth ; j + + ) {
2009-03-01 02:19:06 +00:00
* outBufferPtr = ( ( bitSet1 > > 15 ) & 1 ) | ( ( bitSet2 > > 14 ) & 2 ) ;
2007-04-27 12:58:35 +00:00
outBufferPtr + + ;
2007-04-27 22:33:45 +00:00
2009-02-19 09:57:39 +00:00
bitSet1 < < = 1 ;
bitSet2 < < = 1 ;
2007-04-27 12:58:35 +00:00
}
outBufferPtr + = ( width * 2 ) - charWidth ;
}
}
// returns character count and pixel size (via pointer) per line of the string (old: prepareWordRender(int32 param, int32 var1, int16* out2, uint8* ptr3, uint8* string))
2009-02-19 09:57:39 +00:00
int32 prepareWordRender ( int32 inRightBorder_X , int16 wordSpacingWidth ,
int16 * strPixelLength , const FontEntry * fontData , const char * textString ) {
const char * localString = textString ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
int32 counter = 0 ;
int32 finish = 0 ;
int32 temp_pc = 0 ; // var_A // temporary pixel count save
int32 temp_cc = 0 ; // var_C // temporary char count save
int32 pixelCount = 0 ; // si
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
do {
2007-04-27 12:58:35 +00:00
uint8 character = * ( localString + + ) ;
int16 charData = fontCharacterTable [ character ] ;
2007-04-27 22:33:45 +00:00
if ( character = = ' ' ) {
2007-04-27 12:58:35 +00:00
temp_cc = counter ;
temp_pc = pixelCount ;
2007-04-27 22:33:45 +00:00
if ( pixelCount + wordSpacingWidth + 5 > =
2009-01-16 02:43:41 +00:00
inRightBorder_X ) {
2007-04-27 12:58:35 +00:00
finish = 1 ;
2007-04-27 22:33:45 +00:00
} else {
pixelCount + = wordSpacingWidth + 5 ;
2007-04-27 12:58:35 +00:00
}
2007-04-27 22:33:45 +00:00
} else {
if ( character = = ' | ' | | ! character ) {
2007-04-27 12:58:35 +00:00
finish = 1 ;
2007-04-27 22:33:45 +00:00
} else {
if ( charData ) {
if ( pixelCount + wordSpacingWidth +
2009-02-19 09:57:39 +00:00
FROM_LE_16 ( fontData [ charData ] . charWidth ) > = inRightBorder_X ) {
2007-04-27 12:58:35 +00:00
finish = 1 ;
2007-04-27 22:33:45 +00:00
if ( temp_pc ) {
2007-04-27 12:58:35 +00:00
pixelCount = temp_pc ;
2007-04-27 22:33:45 +00:00
counter = temp_cc ;
2007-04-27 12:58:35 +00:00
}
2007-04-27 22:33:45 +00:00
} else {
2009-02-19 09:57:39 +00:00
pixelCount + = wordSpacingWidth +
FROM_LE_16 ( fontData [ charData ] . charWidth ) ;
2007-04-27 12:58:35 +00:00
}
}
}
}
counter + + ;
2007-04-27 22:33:45 +00:00
} while ( ! finish ) ;
2007-04-27 12:58:35 +00:00
* strPixelLength = ( int16 ) pixelCount ;
return counter ;
}
2009-03-01 02:19:06 +00:00
void drawString ( int32 x , int32 y , const char * string , uint8 * buffer , uint8 fontColour , int32 rightBorder_X ) {
2007-04-27 12:58:35 +00:00
2009-03-01 02:19:06 +00:00
// Get the rendered text to display
gfxEntryStruct * s = renderText ( rightBorder_X , string ) ;
2007-04-27 12:58:35 +00:00
2009-03-01 02:19:06 +00:00
// Draw the message
drawMessage ( s , x , y , rightBorder_X - x , fontColour , buffer ) ;
2007-04-27 12:58:35 +00:00
2009-03-01 02:19:06 +00:00
// Free the data
delete s - > imagePtr ;
delete s ;
2007-04-27 12:58:35 +00:00
}
// calculates all necessary datas and renders text
2009-02-19 09:57:39 +00:00
gfxEntryStruct * renderText ( int inRightBorder_X , const char * string ) {
const FontInfo * fontPtr ;
const FontEntry * fontPtr_Desc ;
const uint8 * fontPtr_Data ;
int16 wordSpacingWidth ; // 0 or -1
int16 wordSpacingHeight ; // 0 or -1
2007-04-27 12:58:35 +00:00
int32 rightBorder_X ;
2009-02-19 09:57:39 +00:00
int32 lineHeight ;
2007-04-27 12:58:35 +00:00
int32 numLines ;
int32 stringHeight ;
int32 stringFinished ;
2007-04-27 22:33:45 +00:00
int32 stringWidth ; // var_1C
2007-04-27 12:58:35 +00:00
int32 stringRenderBufferSize ;
// int32 useDynamicBuffer;
2007-04-27 22:33:45 +00:00
uint8 * currentStrRenderBuffer ;
// int32 var_8; // don't need that one
int32 heightOffset ; // var_12 // how much pixel-lines have already been drawn
2007-04-27 12:58:35 +00:00
// int32 var_1E;
2007-04-27 22:33:45 +00:00
gfxEntryStruct * generatedGfxEntry ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
// check if string is empty
if ( ! string ) {
2007-04-27 12:58:35 +00:00
return NULL ;
}
2007-04-27 22:33:45 +00:00
// check if font has been loaded, else get system font
if ( fontFileIndex ! = - 1 ) {
2009-02-19 09:57:39 +00:00
fontPtr = ( const FontInfo * ) filesDatabase [ fontFileIndex ] . subData . ptr ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
if ( ! fontPtr ) {
2009-02-19 09:57:39 +00:00
fontPtr = ( const FontInfo * ) _systemFNT ;
2007-04-27 12:58:35 +00:00
}
2007-04-27 22:33:45 +00:00
} else {
2009-02-19 09:57:39 +00:00
fontPtr = ( const FontInfo * ) _systemFNT ;
2007-04-27 12:58:35 +00:00
}
2007-04-27 22:33:45 +00:00
if ( ! fontPtr ) {
2007-04-27 12:58:35 +00:00
return NULL ;
2007-04-27 22:33:45 +00:00
}
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
fontPtr_Desc = ( const FontEntry * ) ( ( const uint8 * ) fontPtr + sizeof ( FontInfo ) ) ;
fontPtr_Data = ( const uint8 * ) fontPtr + FROM_LE_32 ( fontPtr - > offset ) ;
lineHeight = getLineHeight ( FROM_LE_16 ( fontPtr - > numChars ) , fontPtr_Desc ) ;
2007-04-27 12:58:35 +00:00
2009-02-19 09:57:39 +00:00
wordSpacingWidth = FROM_LE_16 ( fontPtr - > hSpacing ) ;
wordSpacingHeight = FROM_LE_16 ( fontPtr - > vSpacing ) ;
2007-04-27 12:58:35 +00:00
// if right border is higher then screenwidth (+ spacing), adjust border
2007-04-27 22:33:45 +00:00
if ( inRightBorder_X > 310 ) {
2007-04-27 12:58:35 +00:00
rightBorder_X = 310 ;
2007-04-27 22:33:45 +00:00
} else {
2007-04-27 12:58:35 +00:00
rightBorder_X = inRightBorder_X ;
2007-04-27 22:33:45 +00:00
}
numLines = getTextLineCount ( rightBorder_X , wordSpacingWidth , fontPtr_Desc , string ) ; // ok
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
if ( ! numLines ) {
2007-04-27 12:58:35 +00:00
return NULL ;
2007-04-27 22:33:45 +00:00
}
stringHeight = ( ( wordSpacingHeight + lineHeight + 2 ) * numLines ) + 1 ;
stringFinished = 0 ;
stringWidth = rightBorder_X + 2 ; // max render width to the right
2007-04-27 12:58:35 +00:00
stringRenderBufferSize = stringWidth * stringHeight * 4 ;
2007-04-27 22:33:45 +00:00
inRightBorder_X = rightBorder_X ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
currentStrRenderBuffer =
( uint8 * ) mallocAndZero ( stringRenderBufferSize ) ;
2009-03-01 02:19:06 +00:00
resetBitmap ( currentStrRenderBuffer , stringRenderBufferSize ) ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
generatedGfxEntry = ( gfxEntryStruct * ) malloc ( sizeof ( gfxEntryStruct ) ) ;
generatedGfxEntry - > imagePtr = currentStrRenderBuffer ;
2007-04-27 12:58:35 +00:00
generatedGfxEntry - > imageSize = stringRenderBufferSize / 2 ;
generatedGfxEntry - > fontIndex = fontFileIndex ;
2007-04-27 22:33:45 +00:00
generatedGfxEntry - > height = stringHeight ;
generatedGfxEntry - > width = stringWidth ; // maximum render width to the right
2007-04-27 12:58:35 +00:00
// var_8 = 0;
heightOffset = 0 ;
2007-04-27 22:33:45 +00:00
do {
int spacesCount = 0 ; // si
2007-04-28 00:26:57 +00:00
unsigned char character = * string ;
2007-04-27 22:33:45 +00:00
short int strPixelLength ; // var_16
2009-02-19 09:57:39 +00:00
const char * ptrStringEnd ; // var_4 //ok
2007-04-27 22:33:45 +00:00
int drawPosPixel_X ; // di
// find first letter in string, skip all spaces
while ( character = = ' ' ) {
2007-04-27 12:58:35 +00:00
spacesCount + + ;
character = * ( string + spacesCount ) ;
}
string + = spacesCount ;
2007-04-27 22:33:45 +00:00
// returns character count and pixel length (via pointer) per line of the text string
ptrStringEnd = string + prepareWordRender ( inRightBorder_X , wordSpacingWidth , & strPixelLength , fontPtr_Desc , string ) ; //ok
// determine how much space is left to the right and left (center text)
if ( inRightBorder_X > strPixelLength ) {
2007-04-27 12:58:35 +00:00
//var_8 = (inRightBorder_X - strPixelLength) / 2;
2007-04-27 22:33:45 +00:00
drawPosPixel_X =
( inRightBorder_X - strPixelLength ) / 2 ;
} else {
2007-04-27 12:58:35 +00:00
drawPosPixel_X = 0 ;
}
//drawPosPixel_X = var_8;
// draw textline, character wise
2007-04-27 22:33:45 +00:00
do {
2007-04-27 18:54:33 +00:00
character = * ( string + + ) ;
2007-04-27 12:58:35 +00:00
2007-04-28 00:26:57 +00:00
short int charData = fontCharacterTable [ character ] ; // get character position
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
if ( character ) {
if ( character = = ' ' | | character = = 0x7C ) {
drawPosPixel_X + = wordSpacingWidth + 5 ; // if char = "space" adjust word starting postion (don't render space though);
} else {
if ( charData > = 0 ) {
2009-02-19 09:57:39 +00:00
const FontEntry & fe = fontPtr_Desc [ charData ] ;
2007-04-27 12:58:35 +00:00
2007-04-27 22:33:45 +00:00
// should ist be stringRenderBufferSize/2 for the second last param?
2009-02-19 09:57:39 +00:00
renderWord ( ( const uint8 * ) fontPtr_Data + FROM_LE_32 ( fe . offset ) ,
2009-01-16 02:43:41 +00:00
currentStrRenderBuffer ,
drawPosPixel_X ,
2009-02-19 09:57:39 +00:00
FROM_LE_16 ( fe . height2 ) - FROM_LE_16 ( fe . charHeight ) +
2009-01-16 02:43:41 +00:00
lineHeight + heightOffset ,
2009-02-19 09:57:39 +00:00
FROM_LE_16 ( fe . charHeight ) ,
FROM_LE_16 ( fe . v1 ) ,
2009-01-16 02:43:41 +00:00
stringRenderBufferSize ,
2009-02-19 09:57:39 +00:00
stringWidth / 2 ,
FROM_LE_16 ( fe . charWidth ) ) ;
2007-04-27 22:33:45 +00:00
drawPosPixel_X + =
2009-02-19 09:57:39 +00:00
wordSpacingWidth + FROM_LE_16 ( fe . charWidth ) ;
2007-04-27 12:58:35 +00:00
}
}
2007-04-27 22:33:45 +00:00
} else {
stringFinished = 1 ; // character = 0x00
2007-04-27 12:58:35 +00:00
}
2007-04-27 22:33:45 +00:00
// check if string already reached the end
if ( ptrStringEnd < = string ) {
2007-04-27 12:58:35 +00:00
break ;
2007-04-27 22:33:45 +00:00
}
} while ( ! stringFinished ) ;
2007-04-27 12:58:35 +00:00
// var_8 = 0;
heightOffset + = wordSpacingHeight + lineHeight ;
2007-04-27 22:33:45 +00:00
} while ( ! stringFinished ) ;
2007-04-27 12:58:35 +00:00
return generatedGfxEntry ;
}
2009-03-03 09:00:49 +00:00
void freeGfx ( gfxEntryStruct * pGfx ) {
if ( pGfx - > imagePtr ) {
free ( pGfx - > imagePtr ) ;
}
free ( pGfx ) ;
}
2007-04-27 12:58:35 +00:00
} // End of namespace Cruise