aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-10-04 11:59:29 +0000
committerMax Horn2009-10-04 11:59:29 +0000
commita1e2ba1ba5c0c80b826522bdd4555508ad442b51 (patch)
tree010ec24b04ee996a3eef97d451cca36db7ce390f /engines
parent696fd7af203e28c1f3821ceea56b48d83d28fdd5 (diff)
downloadscummvm-rg350-a1e2ba1ba5c0c80b826522bdd4555508ad442b51.tar.gz
scummvm-rg350-a1e2ba1ba5c0c80b826522bdd4555508ad442b51.tar.bz2
scummvm-rg350-a1e2ba1ba5c0c80b826522bdd4555508ad442b51.zip
SCI: Fixing a bunch of warnings; change 'intencity' -> 'intensity';
properly init a sciPalette via memset svn-id: r44604
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kgraphics.cpp1
-rw-r--r--engines/sci/gui/gui.cpp5
-rw-r--r--engines/sci/gui/gui_font.cpp1
-rw-r--r--engines/sci/gui/gui_gfx.cpp28
-rw-r--r--engines/sci/gui/gui_helpers.h2
-rw-r--r--engines/sci/gui/gui_picture.cpp11
-rw-r--r--engines/sci/gui/gui_view.cpp8
-rw-r--r--engines/sci/gui32/gui32.h2
8 files changed, 21 insertions, 37 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index ba376f393e..edf84ea317 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -424,7 +424,6 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
}
// old code, may be removed later after class migration
- GfxPort *port = s->port;
int redraw_port = 0;
rect_t area;
area = gfx_rect(argv[2].toSint16(), argv[1].toSint16() , argv[4].toSint16(), argv[3].toSint16());
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 8fe0243f41..f9660462eb 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -327,12 +327,11 @@ int16 SciGUI::onControl(byte screenMask, Common::Rect rect) {
void SciGUI::moveCursor(int16 x, int16 y) {
Common::Point newPos;
- sciPort *curPort = _gfx->GetPort();
x += _windowMgr->_picWind->rect.left;
y += _windowMgr->_picWind->rect.top;
- newPos.x = CLIP<int16> (x, _windowMgr->_picWind->rect.left, _windowMgr->_picWind->rect.right - 1);
- newPos.y = CLIP<int16> (y, _windowMgr->_picWind->rect.top, _windowMgr->_picWind->rect.bottom - 1);
+ newPos.x = CLIP<int16>(x, _windowMgr->_picWind->rect.left, _windowMgr->_picWind->rect.right - 1);
+ newPos.y = CLIP<int16>(y, _windowMgr->_picWind->rect.top, _windowMgr->_picWind->rect.bottom - 1);
gfxop_set_pointer_position(_s->gfx_state, newPos);
}
diff --git a/engines/sci/gui/gui_font.cpp b/engines/sci/gui/gui_font.cpp
index 2540848c9c..8246aaa749 100644
--- a/engines/sci/gui/gui_font.cpp
+++ b/engines/sci/gui/gui_font.cpp
@@ -83,7 +83,6 @@ void SciGUIfont::draw(int16 chr, int16 top, int16 left, byte color, byte textfac
int charWidth = MIN<int>(getCharWidth(chr), _screen->_width - left);
int charHeight = MIN<int>(getCharHeight(chr), 200 - top);
byte b = 0, mask = 0xFF;
- int pitch = _screen->_width;
int y = top;
byte *pIn = getCharData(chr);
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index fcac407a91..b417eb4fe8 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -37,8 +37,6 @@
namespace Sci {
-static uint32 _sysTicks;
-
SciGUIgfx::SciGUIgfx(OSystem *system, EngineState *state, SciGUIscreen *screen)
: _system(system), _s(state), _screen(screen) {
init();
@@ -51,8 +49,6 @@ SciGUIgfx::~SciGUIgfx() {
}
void SciGUIgfx::init() {
- uint16 a = 0;
-
_font = NULL;
_textFonts = NULL; _textFontsCount = 0;
_textColors = NULL; _textColorsCount = 0;
@@ -81,7 +77,7 @@ void SciGUIgfx::initPalette() {
_sysPalette.colors[i].r = 0;
_sysPalette.colors[i].g = 0;
_sysPalette.colors[i].b = 0;
- _sysPalette.intencity[i] = 100;
+ _sysPalette.intensity[i] = 100;
_sysPalette.mapping[i] = i;
}
_sysPalette.colors[0].used = 1;
@@ -100,7 +96,7 @@ void SciGUIgfx::initPalette() {
};
// Init _clrPowers used in MatchColor
- for(int16 i = 0; i < 256; i++)
+ for(i = 0; i < 256; i++)
_clrPowers[i] = i*i;
}
@@ -115,7 +111,7 @@ void SciGUIgfx::timerHandler(void *ref) {
((SciGUIgfx *)ref)->_sysTicks++;
}
-sciPort *SciGUIgfx::mallocPort () {
+sciPort *SciGUIgfx::mallocPort() {
sciPort *newPort = (sciPort *)malloc(sizeof(sciPort));
assert(newPort);
memset(newPort, 0, sizeof(sciPort));
@@ -198,11 +194,6 @@ void SciGUIgfx::CreatePaletteFromData(byte *data, sciPalette *paletteOut) {
bool SciGUIgfx::SetResPalette(int16 resourceNo, int16 flag) {
Resource *palResource = _s->resMan->findResource(ResourceId(kResourceTypePalette, resourceNo), 0);
- int palFormat = 0;
- int palOffset = 0;
- int palColorStart = 0;
- int palColorCount = 0;
- int colorNo = 0;
sciPalette palette;
if (palResource) {
@@ -299,9 +290,9 @@ void SciGUIgfx::SetCLUT(sciPalette*pal) {
for (int16 i = 0; i < 256; i++) {
if (!pal->colors[i].used)
continue;
- bpal[i * 4] = pal->colors[i].r * pal->intencity[i] / 100;
- bpal[i * 4 + 1] = pal->colors[i].g * pal->intencity[i] / 100;
- bpal[i * 4 + 2] = pal->colors[i].b * pal->intencity[i] / 100;
+ bpal[i * 4] = pal->colors[i].r * pal->intensity[i] / 100;
+ bpal[i * 4 + 1] = pal->colors[i].g * pal->intensity[i] / 100;
+ bpal[i * 4 + 2] = pal->colors[i].b * pal->intensity[i] / 100;
bpal[i * 4 + 3] = 100;
}
_system->setPalette(bpal, 0, 256);
@@ -418,8 +409,6 @@ void SciGUIgfx::FillRect(const Common::Rect &rect, int16 drawFlags, byte clrPen,
int16 oldPenMode = _curPort->penMode;
OffsetRect(r);
- int16 w = r.width();
- int16 h = r.height();
int16 x, y;
byte curVisual;
@@ -780,7 +769,6 @@ void SciGUIgfx::TextBox(const char *text, int16 bshow, const Common::Rect &rect,
int16 hline = 0;
sciResourceId orgFontId = GetFontId();
int16 orgPenColor = _curPort->penClr;
- int16 rectWidth = rect.width();
if (fontId != -1)
SetFont(fontId);
@@ -827,11 +815,9 @@ void SciGUIgfx::ShowBits(const Common::Rect &r, uint16 flags) {
return;
OffsetRect(rect);
- uint16 w = rect.width();
- uint16 h = rect.height();
assert((flags&0x8000) == 0);
_screen->UpdateWhole();
-// _system->copyRectToScreen(GetSegment(flags) + _baseTable[rect.top] + rect.left, 320, rect.left, rect.top, w, h);
+// _system->copyRectToScreen(GetSegment(flags) + _baseTable[rect.top] + rect.left, 320, rect.left, rect.top, rect.width(), rect.height());
// _system->updateScreen();
}
diff --git a/engines/sci/gui/gui_helpers.h b/engines/sci/gui/gui_helpers.h
index a198ba9f30..92008c9cfb 100644
--- a/engines/sci/gui/gui_helpers.h
+++ b/engines/sci/gui/gui_helpers.h
@@ -95,7 +95,7 @@ struct sciPalette {
byte mapping[256];
uint32 timestamp;
sciColor colors[256];
- byte intencity[256];
+ byte intensity[256];
};
struct sciPalSched {
diff --git a/engines/sci/gui/gui_picture.cpp b/engines/sci/gui/gui_picture.cpp
index c3c5916a0a..f839a41024 100644
--- a/engines/sci/gui/gui_picture.cpp
+++ b/engines/sci/gui/gui_picture.cpp
@@ -159,7 +159,7 @@ void SciGUIpicture::drawCel(int16 x, int16 y, byte *pdata, int size) {
y += _curPort->top;
- uint16 j = 0, lasty = MIN<int16>(height + y, _curPort->rect.bottom) + _curPort->top;
+ uint16 lasty = MIN<int16>(height + y, _curPort->rect.bottom) + _curPort->top;
byte b, brun;
while (y < lasty && ptr < pend) {
@@ -213,7 +213,7 @@ void SciGUIpicture::drawCelAmiga(int16 x, int16 y, byte *pdata, int size) {
y += _curPort->top;
- uint16 j = 0, lasty = MIN<int16>(height + y, _curPort->rect.bottom) + _curPort->top;
+ uint16 lasty = MIN<int16>(height + y, _curPort->rect.bottom) + _curPort->top;
byte op, col, bytes;
while (y < lasty && ptr < pend) {
op = *ptr++;
@@ -283,7 +283,7 @@ enum {
#define PIC_EGAPALETTE_SIZE 40
#define PIC_EGAPALETTE_TOTALSIZE PIC_EGAPALETTE_COUNT*PIC_EGAPALETTE_SIZE
-const byte vector_defaultEGApalette[PIC_EGAPALETTE_SIZE] = {
+static const byte vector_defaultEGApalette[PIC_EGAPALETTE_SIZE] = {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0x88,
0x88, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x88,
@@ -296,17 +296,18 @@ void SciGUIpicture::drawVectorData(byte *data, int dataSize) {
byte pic_color = 0, pic_priority = 0x0F, pic_control = 0x0F;
int16 x = 0, y = 0, oldx, oldy;
byte EGApalette = 0;
- byte EGAindex = 0;
byte EGApalettes[PIC_EGAPALETTE_TOTALSIZE] = {0};
bool EGAmapping = false;
int curPos = 0;
uint16 size;
byte byte;
int i;
- sciPalette palette = {0};
+ sciPalette palette;
int16 pattern_Code = 0, pattern_Texture = 0;
bool sci1 = false;
+ memset(&palette, 0, sizeof(palette));
+
if (_EGApaletteNo >= PIC_EGAPALETTE_COUNT)
_EGApaletteNo = 0;
diff --git a/engines/sci/gui/gui_view.cpp b/engines/sci/gui/gui_view.cpp
index caa884b83c..f190d5245a 100644
--- a/engines/sci/gui/gui_view.cpp
+++ b/engines/sci/gui/gui_view.cpp
@@ -168,21 +168,21 @@ sciResourceId SciGUIview::getResourceId() {
int16 SciGUIview::getWidth(uint16 loopNo, uint16 cellNo) {
loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
- if (cellNo < 0 || cellNo >= _loop[loopNo].cellCount)
+ if (cellNo >= _loop[loopNo].cellCount)
cellNo = 0;
return _loopCount ? _loop[loopNo].cell[cellNo].width : 0;
}
int16 SciGUIview::getHeight(uint16 loopNo, uint16 cellNo) {
loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
- if (cellNo < 0 || cellNo >= _loop[loopNo].cellCount)
+ if (cellNo >= _loop[loopNo].cellCount)
cellNo = 0;
return _loopCount ? _loop[loopNo].cell[cellNo].height : 0;
}
sciViewCellInfo *SciGUIview::getCellInfo(uint16 loopNo, uint16 cellNo) {
loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
- if (cellNo < 0 || cellNo >= _loop[loopNo].cellCount)
+ if (cellNo >= _loop[loopNo].cellCount)
cellNo = 0;
return _loopCount ? &_loop[loopNo].cell[cellNo] : NULL;
}
@@ -234,7 +234,7 @@ void SciGUIview::unpackView(uint16 loopNo, uint16 cellNo, byte *outPtr, uint16 p
byte *SciGUIview::getBitmap(uint16 loopNo, uint16 cellNo) {
loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
- if (cellNo < 0 || cellNo >= _loop[loopNo].cellCount)
+ if (cellNo >= _loop[loopNo].cellCount)
cellNo = 0;
if (_loop[loopNo].cell[cellNo].rawBitmap)
return _loop[loopNo].cell[cellNo].rawBitmap;
diff --git a/engines/sci/gui32/gui32.h b/engines/sci/gui32/gui32.h
index 1971e26917..5a50b3dd3e 100644
--- a/engines/sci/gui32/gui32.h
+++ b/engines/sci/gui32/gui32.h
@@ -31,7 +31,7 @@ public:
~SciGUI32();
// FIXME: Don't store EngineState
- virtual void resetEngineState(EngineState *s) { this->s = s; }
+ virtual void resetEngineState(EngineState *newState) { s = newState; }
void init(bool oldGfxFunctions);