diff options
author | David Corrales | 2007-05-31 23:44:43 +0000 |
---|---|---|
committer | David Corrales | 2007-05-31 23:44:43 +0000 |
commit | 0cab5b7791e56b32455748bf20c21f0d6b42f654 (patch) | |
tree | 9e6580328542f1db230e019ba77e3db1be8fa50b /engines/cruise/font.cpp | |
parent | 6c69d531d262e14fa02b6e1adb42baaa5c74dbe6 (diff) | |
parent | 22c0403e0dfec16badf156afa842c6c37e850263 (diff) | |
download | scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.tar.gz scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.tar.bz2 scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.zip |
Merged the fs branch with trunk. r26949:27031
svn-id: r27032
Diffstat (limited to 'engines/cruise/font.cpp')
-rw-r--r-- | engines/cruise/font.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp index 22f358033e..92064acc53 100644 --- a/engines/cruise/font.cpp +++ b/engines/cruise/font.cpp @@ -1,7 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2006 The ScummVM project +/* ScummVM - Graphic Adventure Engine * - * cinE Engine is (C) 2004-2005 by CinE Team + * 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. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -17,8 +18,8 @@ * 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$ + * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/font.cpp $ + * $Id:font.cpp 26949 2007-05-26 20:23:24Z david_corrales $ * */ @@ -50,15 +51,15 @@ int32 getLineHeight(int16 charCount, uint8 * fontPtr, uint8 * fontPrt_Desc) { // this function determins how many lines the text will have (old: fontProc2(int32 param1, int32 param2, uint8* ptr, uint8* string)) int32 getTextLineCount(int32 rightBorder_X, int32 wordSpacingWidth, - uint8 *ptr, uint8 *textString) { - uint8 *localString = textString; - uint8 *currentStringPtr; + uint8 *ptr, const uint8 *textString) { + const uint8 *localString = textString; + const uint8 *currentStringPtr; uint8 character; int32 var_6 = 0; int32 lineLength = 0; - uint8 *tempPtr = 0; + const uint8 *tempPtr = 0; if (!*localString) { return (0); @@ -111,16 +112,16 @@ void loadFNT(const void *fileNameChar) { int32 fontSize; int32 data2; uint8 data3[6]; - uint8 *fileName = (uint8 *) fileNameChar; + const uint8 *fileName = (const uint8 *)fileNameChar; _systemFNT = NULL; Common::File fontFileHandle; - if (!fontFileHandle.exists((char *)fileName)) { + if (!fontFileHandle.exists((const char *)fileName)) { return; } - fontFileHandle.open((char *)fileName); + fontFileHandle.open((const char *)fileName); fontFileHandle.read(header, 4); @@ -134,7 +135,7 @@ void loadFNT(const void *fileNameChar) { fontFileHandle.read(data3, 6); // may need an endian flip ? flipGen(&data3, 6); - _systemFNT = (uint8 *) mallocAndZero(fontSize); + _systemFNT = (uint8 *)mallocAndZero(fontSize); if (_systemFNT != NULL) { int32 i; @@ -151,8 +152,8 @@ void loadFNT(const void *fileNameChar) { currentPtr = _systemFNT + 14; - for (i = 0; i < *(int16 *) (_systemFNT + 8); i++) { - flipLong((int32 *) currentPtr); + for (i = 0; i < *(int16 *)(_systemFNT + 8); i++) { + flipLong((int32 *)currentPtr); currentPtr += 4; flipGen(currentPtr, 8); @@ -277,8 +278,8 @@ void renderWord(uint8 * fontPtr_Data, uint8 * outBufferPtr, // 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)) int32 prepareWordRender(int32 inRightBorder_X, int32 wordSpacingWidth, - int16 * strPixelLength, uint8 * ptr3, uint8 * textString) { - uint8 *localString = textString; + int16 * strPixelLength, uint8 * ptr3, const uint8 * textString) { + const uint8 *localString = textString; int32 counter = 0; int32 finish = 0; @@ -518,7 +519,7 @@ void drawString(int32 x, int32 y, uint8 *string, uint8 *buffer, uint8 color, } // calculates all necessary datas and renders text -gfxEntryStruct *renderText(int inRightBorder_X, uint8 *string) { +gfxEntryStruct *renderText(int inRightBorder_X, const uint8 *string) { uint8 *fontPtr; uint8 *fontPtr_Data; // pt2 uint8 *fontPtr_Desc; // ptr3 @@ -600,7 +601,7 @@ gfxEntryStruct *renderText(int inRightBorder_X, uint8 *string) { int spacesCount = 0; // si unsigned char character = *string; short int strPixelLength; // var_16 - uint8 *ptrStringEnd; // var_4 //ok + const uint8 *ptrStringEnd; // var_4 //ok int drawPosPixel_X; // di // find first letter in string, skip all spaces |