MADS: Standardised on passing depth surfaces as DepthSurface

This commit is contained in:
Paul Gilbert 2014-05-25 13:23:05 -04:00
parent ce5c2f3e28
commit ea19581ae3
8 changed files with 12 additions and 11 deletions

View File

@ -172,7 +172,7 @@ Animation::~Animation() {
} }
} }
void Animation::load(UserInterface &interfaceSurface, MSurface &depthSurface, void Animation::load(UserInterface &interfaceSurface, DepthSurface &depthSurface,
const Common::String &resName, int flags, Common::Array<PaletteCycle> *palCycles, const Common::String &resName, int flags, Common::Array<PaletteCycle> *palCycles,
SceneInfo *sceneInfo) { SceneInfo *sceneInfo) {
Common::String resourceName = resName; Common::String resourceName = resName;
@ -366,7 +366,7 @@ bool Animation::drawFrame(SpriteAsset &spriteSet, const Common::Point &pt, int f
return 0; return 0;
} }
void Animation::loadInterface(UserInterface &interfaceSurface, MSurface &depthSurface, void Animation::loadInterface(UserInterface &interfaceSurface, DepthSurface &depthSurface,
AAHeader &header, int flags, Common::Array<PaletteCycle> *palCycles, SceneInfo *sceneInfo) { AAHeader &header, int flags, Common::Array<PaletteCycle> *palCycles, SceneInfo *sceneInfo) {
_scene->_depthStyle = 0; _scene->_depthStyle = 0;
if (header._bgType <= ANIMBG_FULL_SIZE) { if (header._bgType <= ANIMBG_FULL_SIZE) {

View File

@ -168,7 +168,7 @@ private:
/** /**
* Load the user interface display for an animation * Load the user interface display for an animation
*/ */
void loadInterface(UserInterface &interfaceSurface, MSurface &depthSurface, void loadInterface(UserInterface &interfaceSurface, DepthSurface &depthSurface,
AAHeader &header, int flags, Common::Array<PaletteCycle> *palCycles, SceneInfo *sceneInfo); AAHeader &header, int flags, Common::Array<PaletteCycle> *palCycles, SceneInfo *sceneInfo);
/** /**
@ -196,7 +196,7 @@ public:
/** /**
* Loads animation data * Loads animation data
*/ */
void load(UserInterface &interfaceSurface, MSurface &depthSurface, const Common::String &resName, void load(UserInterface &interfaceSurface, DepthSurface &depthSurface, const Common::String &resName,
int flags, Common::Array<PaletteCycle> *palCycles, SceneInfo *sceneInfo); int flags, Common::Array<PaletteCycle> *palCycles, SceneInfo *sceneInfo);
/** /**

View File

@ -258,7 +258,7 @@ void MSurface::copyFrom(MSurface *src, const Common::Rect &srcBounds,
} }
void MSurface::copyFrom(MSurface *src, const Common::Point &destPos, int depth, void MSurface::copyFrom(MSurface *src, const Common::Point &destPos, int depth,
MSurface *depthsSurface, int scale, int transparentColor) { DepthSurface *depthsSurface, int scale, int transparentColor) {
int destX = destPos.x, destY = destPos.y; int destX = destPos.x, destY = destPos.y;
if (scale == 100) { if (scale == 100) {

View File

@ -32,6 +32,7 @@ namespace MADS {
class MADSEngine; class MADSEngine;
class MSprite; class MSprite;
class DepthSurface;
/** /**
* Basic sprite information * Basic sprite information
@ -162,7 +163,7 @@ public:
* @param depthSurface Depth surface to use with sprite depth * @param depthSurface Depth surface to use with sprite depth
* @param transparentColor Transparency palette index * @param transparentColor Transparency palette index
*/ */
void copyFrom(MSurface *src, const Common::Point &destPos, int depth, MSurface *depthSurface, void copyFrom(MSurface *src, const Common::Point &destPos, int depth, DepthSurface *depthSurface,
int scale, int transparentColor = -1); int scale, int transparentColor = -1);
/** /**

View File

@ -176,7 +176,7 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) {
flags |= ANIMFLAG_LOAD_BACKGROUND_ONLY; flags |= ANIMFLAG_LOAD_BACKGROUND_ONLY;
_animationData = Animation::init(_vm, this); _animationData = Animation::init(_vm, this);
MSurface depthSurface; DepthSurface depthSurface(_vm);
_animationData->load(_userInterface, depthSurface, prefix, flags, nullptr, nullptr); _animationData->load(_userInterface, depthSurface, prefix, flags, nullptr, nullptr);
_vm->_palette->_paletteUsage.load(&_scenePaletteUsage); _vm->_palette->_paletteUsage.load(&_scenePaletteUsage);
@ -592,7 +592,7 @@ void Scene::checkKeyboard() {
void Scene::loadAnimation(const Common::String &resName, int trigger) { void Scene::loadAnimation(const Common::String &resName, int trigger) {
assert(_activeAnimation == nullptr); assert(_activeAnimation == nullptr);
MSurface depthSurface; DepthSurface depthSurface(_vm);
UserInterface interfaceSurface(_vm); UserInterface interfaceSurface(_vm);
_activeAnimation = Animation::init(_vm, this); _activeAnimation = Animation::init(_vm, this);

View File

@ -110,7 +110,7 @@ SceneInfo *SceneInfo::init(MADSEngine *vm) {
} }
void SceneInfo::load(int sceneId, int variant, const Common::String &resName, void SceneInfo::load(int sceneId, int variant, const Common::String &resName,
int flags, MSurface &depthSurface, MSurface &bgSurface) { int flags, DepthSurface &depthSurface, MSurface &bgSurface) {
bool sceneFlag = sceneId >= 0; bool sceneFlag = sceneId >= 0;
// Figure out the resource to use // Figure out the resource to use

View File

@ -186,7 +186,7 @@ public:
* loads the data * loads the data
*/ */
void load(int sceneId, int variant, const Common::String &resName, int flags, void load(int sceneId, int variant, const Common::String &resName, int flags,
MSurface &depthSurface, MSurface &bgSurface); DepthSurface &depthSurface, MSurface &bgSurface);
/** /**
* Loads the palette for a scene * Loads the palette for a scene

View File

@ -258,7 +258,7 @@ void SpriteSlots::drawBackground() {
if (spriteSlot._depth <= 1) { if (spriteSlot._depth <= 1) {
frame->copyTo(&scene._backgroundSurface, frame->getTransparencyIndex()); frame->copyTo(&scene._backgroundSurface, frame->getTransparencyIndex());
} else if (scene._depthStyle == 0) { } else if (scene._depthStyle == 0) {
scene._backgroundSurface.copyFrom(frame, pt, spriteSlot._depth, &scene._backgroundSurface, scene._backgroundSurface.copyFrom(frame, pt, spriteSlot._depth, &scene._depthSurface,
100, frame->getTransparencyIndex()); 100, frame->getTransparencyIndex());
} else { } else {
error("Unsupported depth style"); error("Unsupported depth style");