[Scummvm-cvs-logs] SF.net SVN: scummvm:[47880] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Thu Feb 4 18:57:44 CET 2010
Revision: 47880
http://scummvm.svn.sourceforge.net/scummvm/?rev=47880&view=rev
Author: m_kiewitz
Date: 2010-02-04 17:57:44 +0000 (Thu, 04 Feb 2010)
Log Message:
-----------
SCI: adding GfxPaint32 class, adding back support for planes, minor change in GfxPaint16 (using #def instead of fixed value)
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/frameout.cpp
scummvm/trunk/engines/sci/graphics/frameout.h
scummvm/trunk/engines/sci/graphics/gui32.cpp
scummvm/trunk/engines/sci/graphics/gui32.h
scummvm/trunk/engines/sci/graphics/paint16.cpp
scummvm/trunk/engines/sci/module.mk
Added Paths:
-----------
scummvm/trunk/engines/sci/graphics/paint32.cpp
scummvm/trunk/engines/sci/graphics/paint32.h
Modified: scummvm/trunk/engines/sci/graphics/frameout.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.cpp 2010-02-04 17:55:23 UTC (rev 47879)
+++ scummvm/trunk/engines/sci/graphics/frameout.cpp 2010-02-04 17:57:44 UTC (rev 47880)
@@ -35,13 +35,14 @@
#include "sci/graphics/font.h"
#include "sci/graphics/view.h"
#include "sci/graphics/screen.h"
+#include "sci/graphics/paint32.h"
#include "sci/graphics/picture.h"
#include "sci/graphics/frameout.h"
namespace Sci {
-GfxFrameout::GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCache *cache, GfxScreen *screen, GfxPalette *palette)
- : _segMan(segMan), _resMan(resMan), _cache(cache), _screen(screen), _palette(palette) {
+GfxFrameout::GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCache *cache, GfxScreen *screen, GfxPalette *palette, GfxPaint32 *paint32)
+ : _segMan(segMan), _resMan(resMan), _cache(cache), _screen(screen), _palette(palette), _paint32(paint32) {
}
GfxFrameout::~GfxFrameout() {
@@ -107,6 +108,7 @@
int16 planePriority;
Common::Rect planeRect;
int16 planeResY, planeResX;
+ byte planeBack;
reg_t itemObject;
reg_t itemPlane;
@@ -125,12 +127,6 @@
if (planePriority == -1) // Plane currently not meant to be shown
continue;
- planePictureNr = GET_SEL32V(_segMan, planeObject, picture);
- if ((planePictureNr != 0xFFFF) && (planePictureNr != 0xFFFE)) {
- planePicture = new SciGuiPicture(_resMan, 0, _screen, _palette, planePictureNr, false);
- planePictureCels = planePicture->getSci32celCount();
- }
-
planeRect.top = GET_SEL32V(_segMan, planeObject, top);
planeRect.left = GET_SEL32V(_segMan, planeObject, left);
planeRect.bottom = GET_SEL32V(_segMan, planeObject, bottom);
@@ -143,6 +139,17 @@
planeRect.bottom = (planeRect.bottom * _screen->getHeight()) / planeResY;
planeRect.right = (planeRect.right * _screen->getWidth()) / planeResX;
+ planeBack = GET_SEL32V(_segMan, planeObject, back);
+ if (planeBack) {
+ _paint32->fillRect(planeRect, planeBack);
+ }
+
+ planePictureNr = GET_SEL32V(_segMan, planeObject, picture);
+ if ((planePictureNr != 0xFFFF) && (planePictureNr != 0xFFFE)) {
+ planePicture = new SciGuiPicture(_resMan, 0, _screen, _palette, planePictureNr, false);
+ planePictureCels = planePicture->getSci32celCount();
+ }
+
// Fill our itemlist for this plane
itemCount = 0;
itemEntry = itemData;
Modified: scummvm/trunk/engines/sci/graphics/frameout.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.h 2010-02-04 17:55:23 UTC (rev 47879)
+++ scummvm/trunk/engines/sci/graphics/frameout.h 2010-02-04 17:57:44 UTC (rev 47880)
@@ -44,11 +44,10 @@
typedef Common::List<FrameoutEntry *> FrameoutList;
class GfxCache;
-class Screen;
-class SciPalette;
+class GfxPaint32;
class GfxFrameout {
public:
- GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCache *cache, GfxScreen *screen, GfxPalette *palette);
+ GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCache *cache, GfxScreen *screen, GfxPalette *palette, GfxPaint32 *paint32);
~GfxFrameout();
void kernelAddPlane(reg_t object);
@@ -65,6 +64,7 @@
GfxCache *_cache;
GfxPalette *_palette;
GfxScreen *_screen;
+ GfxPaint32 *_paint32;
Common::Array<reg_t> _screenItems;
Common::Array<reg_t> _planes;
Modified: scummvm/trunk/engines/sci/graphics/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.cpp 2010-02-04 17:55:23 UTC (rev 47879)
+++ scummvm/trunk/engines/sci/graphics/gui32.cpp 2010-02-04 17:57:44 UTC (rev 47880)
@@ -38,6 +38,7 @@
#include "sci/graphics/cache.h"
#include "sci/graphics/compare.h"
#include "sci/graphics/frameout.h"
+#include "sci/graphics/paint32.h"
#include "sci/graphics/picture.h"
#include "sci/graphics/robot.h"
#include "sci/graphics/view.h"
@@ -48,7 +49,8 @@
: _s(state), _screen(screen), _palette(palette), _cache(cache), _cursor(cursor) {
_compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen);
- _frameout = new GfxFrameout(_s->_segMan, _s->resMan, _cache, _screen, _palette);
+ _paint32 = new GfxPaint32(_s->resMan, _s->_segMan, _s->_kernel, _cache, _screen, _palette);
+ _frameout = new GfxFrameout(_s->_segMan, _s->resMan, _cache, _screen, _palette, _paint32);
}
SciGui32::~SciGui32() {
Modified: scummvm/trunk/engines/sci/graphics/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.h 2010-02-04 17:55:23 UTC (rev 47879)
+++ scummvm/trunk/engines/sci/graphics/gui32.h 2010-02-04 17:57:44 UTC (rev 47880)
@@ -36,6 +36,7 @@
class GfxCache;
class GfxCompare;
class GfxFrameout;
+class GfxPaint32;
class SciGui32 {
public:
@@ -89,6 +90,7 @@
GfxCache *_cache;
GfxCompare *_compare;
GfxFrameout *_frameout;
+ GfxPaint32 *_paint32;
private:
};
Modified: scummvm/trunk/engines/sci/graphics/paint16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.cpp 2010-02-04 17:55:23 UTC (rev 47879)
+++ scummvm/trunk/engines/sci/graphics/paint16.cpp 2010-02-04 17:57:44 UTC (rev 47880)
@@ -204,16 +204,16 @@
for (x = r.left; x < r.right; x++) {
curVisual = _screen->getVisual(x, y);
if (curVisual == clrPen) {
- _screen->putPixel(x, y, 1, clrBack, 0, 0);
+ _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, clrBack, 0, 0);
} else if (curVisual == clrBack) {
- _screen->putPixel(x, y, 1, clrPen, 0, 0);
+ _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, clrPen, 0, 0);
}
}
}
} else { // just fill rect with ClrPen
for (y = r.top; y < r.bottom; y++) {
for (x = r.left; x < r.right; x++) {
- _screen->putPixel(x, y, 1, clrPen, 0, 0);
+ _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, clrPen, 0, 0);
}
}
}
Copied: scummvm/trunk/engines/sci/graphics/paint32.cpp (from rev 47870, scummvm/trunk/engines/sci/graphics/paint16.cpp)
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint32.cpp (rev 0)
+++ scummvm/trunk/engines/sci/graphics/paint32.cpp 2010-02-04 17:57:44 UTC (rev 47880)
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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
+ * 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$
+ *
+ */
+
+#include "common/util.h"
+#include "common/stack.h"
+#include "graphics/primitives.h"
+
+#include "sci/sci.h"
+#include "sci/engine/state.h"
+#include "sci/engine/selector.h"
+#include "sci/graphics/cache.h"
+#include "sci/graphics/paint32.h"
+#include "sci/graphics/font.h"
+#include "sci/graphics/picture.h"
+#include "sci/graphics/view.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/palette.h"
+
+namespace Sci {
+
+GfxPaint32::GfxPaint32(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen, GfxPalette *palette)
+ : _resMan(resMan), _segMan(segMan), _kernel(kernel), _cache(cache), _screen(screen), _palette(palette) {
+}
+
+GfxPaint32::~GfxPaint32() {
+}
+
+void GfxPaint32::fillRect(Common::Rect rect, byte color) {
+ int16 y, x;
+ for (y = rect.top; y < rect.bottom; y++) {
+ for (x = rect.left; x < rect.right; x++) {
+ _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, color, 0, 0);
+ }
+ }
+}
+
+} // End of namespace Sci
Copied: scummvm/trunk/engines/sci/graphics/paint32.h (from rev 47870, scummvm/trunk/engines/sci/graphics/paint16.h)
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint32.h (rev 0)
+++ scummvm/trunk/engines/sci/graphics/paint32.h 2010-02-04 17:57:44 UTC (rev 47880)
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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
+ * 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$
+ *
+ */
+
+#ifndef SCI_GRAPHICS_PAINT16_H
+#define SCI_GRAPHICS_PAINT16_H
+
+#include "sci/graphics/gui.h"
+
+#include "common/hashmap.h"
+
+namespace Sci {
+
+class GfxPorts;
+
+class GfxPaint32 {
+public:
+ GfxPaint32(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen, GfxPalette *palette);
+ ~GfxPaint32();
+
+ void fillRect(Common::Rect rect, byte color);
+
+private:
+ ResourceManager *_resMan;
+ SegManager *_segMan;
+ Kernel *_kernel;
+ GfxCache *_cache;
+ GfxScreen *_screen;
+ GfxPalette *_palette;
+};
+
+} // End of namespace Sci
+
+#endif
Modified: scummvm/trunk/engines/sci/module.mk
===================================================================
--- scummvm/trunk/engines/sci/module.mk 2010-02-04 17:55:23 UTC (rev 47879)
+++ scummvm/trunk/engines/sci/module.mk 2010-02-04 17:57:44 UTC (rev 47880)
@@ -43,6 +43,7 @@
graphics/gui.o \
graphics/menu.o \
graphics/paint16.o \
+ graphics/paint32.o \
graphics/palette.o \
graphics/picture.o \
graphics/portrait.o \
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