aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorFilippos Karapetis2011-09-23 18:53:52 +0300
committerFilippos Karapetis2011-09-23 18:55:30 +0300
commit75fb3b4ef89f531f8d5b95036a38351d3731f577 (patch)
treeb888fd89ccc5ebefab1159de17669c75a470c0ae /engines/sci/graphics
parent632df097612c927caeb763b43772aa33e618dab2 (diff)
downloadscummvm-rg350-75fb3b4ef89f531f8d5b95036a38351d3731f577.tar.gz
scummvm-rg350-75fb3b4ef89f531f8d5b95036a38351d3731f577.tar.bz2
scummvm-rg350-75fb3b4ef89f531f8d5b95036a38351d3731f577.zip
SCI21: Added some skeleton code for offsetting pictures vertically (not working yet). Some cleanup
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/frameout.cpp16
-rw-r--r--engines/sci/graphics/frameout.h6
2 files changed, 15 insertions, 7 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 5499a2d192..6bd310f1a0 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -198,12 +198,13 @@ void GfxFrameout::kernelDeletePlane(reg_t object) {
}
}
-void GfxFrameout::addPlanePicture(reg_t object, GuiResourceId pictureId, uint16 startX) {
+void GfxFrameout::addPlanePicture(reg_t object, GuiResourceId pictureId, uint16 startX, uint16 startY) {
PlanePictureEntry newPicture;
newPicture.object = object;
newPicture.pictureId = pictureId;
newPicture.picture = new GfxPicture(_resMan, _coordAdjuster, 0, _screen, _palette, pictureId, false);
newPicture.startX = startX;
+ newPicture.startY = startY;
newPicture.pictureCels = 0;
_planePictures.push_back(newPicture);
}
@@ -275,9 +276,8 @@ int16 GfxFrameout::kernelGetHighPlanePri() {
return readSelectorValue(g_sci->getEngineState()->_segMan, _planes.back().object, SELECTOR(priority));
}
-// TODO: No idea yet how to implement this
-void GfxFrameout::kernelAddPicAt(reg_t planeObj, int16 forWidth, GuiResourceId pictureId) {
- addPlanePicture(planeObj, pictureId, forWidth);
+void GfxFrameout::kernelAddPicAt(reg_t planeObj, GuiResourceId pictureId, int16 pictureX, int16 pictureY) {
+ addPlanePicture(planeObj, pictureId, pictureX, pictureY);
}
bool sortHelper(const FrameoutEntry* entry1, const FrameoutEntry* entry2) {
@@ -403,6 +403,7 @@ void GfxFrameout::kernelFrameout() {
picEntry->y = planePicture->getSci32celY(pictureCelNr);
picEntry->x = planePicture->getSci32celX(pictureCelNr);
picEntry->picStartX = pictureIt->startX;
+ picEntry->picStartY = pictureIt->startY;
picEntry->priority = planePicture->getSci32celPriority(pictureCelNr);
@@ -425,8 +426,9 @@ void GfxFrameout::kernelFrameout() {
itemEntry->y = ((itemEntry->y * _screen->getHeight()) / scriptsRunningHeight);
itemEntry->x = ((itemEntry->x * _screen->getWidth()) / scriptsRunningWidth);
itemEntry->picStartX = ((itemEntry->picStartX * _screen->getWidth()) / scriptsRunningWidth);
+ itemEntry->picStartY = ((itemEntry->picStartY * _screen->getHeight()) / scriptsRunningHeight);
- // Out of view
+ // Out of view horizontally (sanity checks)
int16 pictureCelStartX = itemEntry->picStartX + itemEntry->x;
int16 pictureCelEndX = pictureCelStartX + itemEntry->picture->getSci32celWidth(itemEntry->celNo);
int16 planeStartX = it->planeOffsetX;
@@ -436,6 +438,9 @@ void GfxFrameout::kernelFrameout() {
if (pictureCelStartX > planeEndX)
continue;
+ // Out of view vertically (sanity checks)
+ // TODO
+
int16 pictureOffsetX = it->planeOffsetX;
int16 pictureX = itemEntry->x;
if ((it->planeOffsetX) || (itemEntry->picStartX)) {
@@ -447,6 +452,7 @@ void GfxFrameout::kernelFrameout() {
}
}
+ // TODO: pictureOffsetY
itemEntry->picture->drawSci32Vga(itemEntry->celNo, pictureX, itemEntry->y, pictureOffsetX, it->planePictureMirrored);
// warning("picture cel %d %d", itemEntry->celNo, itemEntry->priority);
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 7e5b1a5006..d2c8086f5f 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -58,6 +58,7 @@ struct FrameoutEntry {
Common::Rect celRect;
GfxPicture *picture;
int16 picStartX;
+ int16 picStartY;
};
typedef Common::List<FrameoutEntry *> FrameoutList;
@@ -65,6 +66,7 @@ typedef Common::List<FrameoutEntry *> FrameoutList;
struct PlanePictureEntry {
reg_t object;
int16 startX;
+ int16 startY;
GuiResourceId pictureId;
GfxPicture *picture;
FrameoutEntry *pictureCels; // temporary
@@ -93,10 +95,10 @@ public:
void kernelUpdateScreenItem(reg_t object);
void kernelDeleteScreenItem(reg_t object);
int16 kernelGetHighPlanePri();
- void kernelAddPicAt(reg_t planeObj, int16 forWidth, GuiResourceId pictureId);
+ void kernelAddPicAt(reg_t planeObj, GuiResourceId pictureId, int16 pictureX, int16 pictureY);
void kernelFrameout();
- void addPlanePicture(reg_t object, GuiResourceId pictureId, uint16 startX);
+ void addPlanePicture(reg_t object, GuiResourceId pictureId, uint16 startX, uint16 startY = 0);
void deletePlanePictures(reg_t object);
void clear();