[Scummvm-cvs-logs] SF.net SVN: scummvm: [26203] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun Mar 18 11:38:32 CET 2007
Revision: 26203
http://scummvm.svn.sourceforge.net/scummvm/?rev=26203&view=rev
Author: peres001
Date: 2007-03-18 03:38:31 -0700 (Sun, 18 Mar 2007)
Log Message:
-----------
Made loadFont return a new Cnv instead of accepting a parameter.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/disk.cpp
scummvm/trunk/engines/parallaction/disk.h
scummvm/trunk/engines/parallaction/graphics.cpp
scummvm/trunk/engines/parallaction/graphics.h
Modified: scummvm/trunk/engines/parallaction/disk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk.cpp 2007-03-18 10:34:41 UTC (rev 26202)
+++ scummvm/trunk/engines/parallaction/disk.cpp 2007-03-18 10:38:31 UTC (rev 26203)
@@ -313,11 +313,14 @@
return cnv;
}
-void Disk::loadFont(const char* name, Cnv* cnv) {
+Cnv* Disk::loadFont(const char* name) {
char path[PATH_LEN];
sprintf(path, "%scnv", name);
+
+ Cnv* cnv = new Cnv;
loadExternalCnv(path, cnv);
+ return cnv;
}
// loads character's icons set
Modified: scummvm/trunk/engines/parallaction/disk.h
===================================================================
--- scummvm/trunk/engines/parallaction/disk.h 2007-03-18 10:34:41 UTC (rev 26202)
+++ scummvm/trunk/engines/parallaction/disk.h 2007-03-18 10:38:31 UTC (rev 26203)
@@ -109,7 +109,7 @@
Cnv* loadObjects(const char *name);
StaticCnv* loadPointer();
StaticCnv* loadHead(const char* name);
- void loadFont(const char* name, Cnv* cnv);
+ Cnv* loadFont(const char* name);
void loadStatic(const char* name, StaticCnv* cnv);
void loadFrames(const char* name, Cnv* cnv);
void loadSlide(const char *filename);
Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp 2007-03-18 10:34:41 UTC (rev 26202)
+++ scummvm/trunk/engines/parallaction/graphics.cpp 2007-03-18 10:38:31 UTC (rev 26203)
@@ -587,9 +587,9 @@
for (uint16 i = 0; i < len; i++) {
byte c = mapChar(text[i]);
- tmp._width = _font._width;
- tmp._height = _font._height;
- tmp._data0 = _font._array[c];
+ tmp._width = _font->_width;
+ tmp._height = _font->_height;
+ tmp._data0 = _font->_array[c];
flatBlitCnv(&tmp, x, y, kBitFront);
@@ -609,12 +609,12 @@
byte c = mapChar(text[i]);
uint16 w = _proportionalFont ? _glyphWidths[(int)c] : 8;
- byte *s = _font._array[c];
+ byte *s = _font->_array[c];
byte *d = _buffers[kBitFront] + x + y*SCREEN_WIDTH;
// printf("%i\n", text[i]);
- for (uint16 j = 0; j < _font._height; j++) {
+ for (uint16 j = 0; j < _font->_height; j++) {
for (uint16 k = 0; k < w; k++) {
*d = (*s) ? 1 : color;
d++;
@@ -742,8 +742,10 @@
void Gfx::setFont(const char* name) {
- freeCnv(&_font);
- _vm->_disk->loadFont(name, &_font);
+ freeCnv(_font);
+ if (_font) delete _font;
+
+ _font = _vm->_disk->loadFont(name);
}
@@ -782,8 +784,8 @@
uint16 len = strlen(text);
- cnv->_width = _font._width * len;
- cnv->_height = _font._height;
+ cnv->_width = _font->_width * len;
+ cnv->_height = _font->_height;
// printf("%i x %i\n", cnv->_width, cnv->_height);
@@ -792,10 +794,10 @@
for (uint16 i = 0; i < len; i++) {
byte c = mapChar(text[i]);
- byte *s = _font._array[c];
- byte *d = cnv->_data0 + _font._width * i;
+ byte *s = _font->_array[c];
+ byte *d = cnv->_data0 + _font->_width * i;
- for (uint16 j = 0; j < _font._height; j++) {
+ for (uint16 j = 0; j < _font->_height; j++) {
memcpy(d, s, 8);
s += 8;
@@ -970,8 +972,9 @@
initMouse( 0 );
- _font._count = 0;
- _font._array = NULL;
+ _font = NULL;
+// _font._count = 0;
+// _font._array = NULL;
return;
}
@@ -984,7 +987,8 @@
free(_buffers[kBitBack]);
free(_buffers[kBit2]);
- freeCnv(&_font);
+ freeCnv(_font);
+ if (_font) delete _font;
return;
}
Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h 2007-03-18 10:34:41 UTC (rev 26202)
+++ scummvm/trunk/engines/parallaction/graphics.h 2007-03-18 10:38:31 UTC (rev 26203)
@@ -151,7 +151,7 @@
static byte _mouseArrow[256];
StaticCnv *_mouseComposedArrow;
- Cnv _font;
+ Cnv *_font;
protected:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list