2012-01-10 19:41:51 +00:00
|
|
|
/* ResidualVM - A 3D game interpreter
|
2009-09-15 15:53:36 +00:00
|
|
|
*
|
2012-01-10 19:41:51 +00:00
|
|
|
* ResidualVM is the legal property of its developers, whose names
|
2009-09-15 15:53:36 +00:00
|
|
|
* are too numerous to list here. Please refer to the AUTHORS
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2012-01-05 09:07:48 +00:00
|
|
|
* 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.
|
2009-09-15 15:53:36 +00:00
|
|
|
|
2012-01-05 09:07:48 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2009-09-15 15:53:36 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-01-05 09:07:48 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2009-09-15 15:53:36 +00:00
|
|
|
|
2012-01-05 09:07:48 +00:00
|
|
|
* 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.
|
2009-09-15 15:53:36 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MYST3_ROOM_H
|
|
|
|
#define MYST3_ROOM_H
|
|
|
|
|
2012-02-11 13:40:16 +00:00
|
|
|
#include "engines/myst3/gfx.h"
|
|
|
|
|
2012-01-05 12:38:31 +00:00
|
|
|
#include "common/array.h"
|
2012-01-05 16:19:15 +00:00
|
|
|
#include "common/rect.h"
|
2009-09-15 16:45:55 +00:00
|
|
|
|
2009-09-15 15:53:36 +00:00
|
|
|
#include "graphics/surface.h"
|
|
|
|
|
|
|
|
namespace Myst3 {
|
|
|
|
|
2012-01-10 17:32:03 +00:00
|
|
|
class Texture;
|
2011-12-29 10:38:49 +00:00
|
|
|
class Myst3Engine;
|
2012-02-11 13:40:16 +00:00
|
|
|
class Subtitles;
|
2012-12-12 15:33:24 +00:00
|
|
|
class DirectorySubEntry;
|
2011-12-29 10:38:49 +00:00
|
|
|
|
2011-12-26 20:39:26 +00:00
|
|
|
class Face {
|
|
|
|
public:
|
|
|
|
Graphics::Surface *_bitmap;
|
2012-01-10 17:32:03 +00:00
|
|
|
Texture *_texture;
|
2011-12-26 20:39:26 +00:00
|
|
|
|
2012-01-10 17:32:03 +00:00
|
|
|
Face(Myst3Engine *vm);
|
2011-12-29 19:04:14 +00:00
|
|
|
~Face();
|
|
|
|
|
2012-12-12 15:33:24 +00:00
|
|
|
void setTextureFromJPEG(const DirectorySubEntry *jpegDesc);
|
2012-01-06 15:07:33 +00:00
|
|
|
|
|
|
|
void markTextureDirty() { _textureDirty = true; }
|
2011-12-26 20:39:26 +00:00
|
|
|
void uploadTexture();
|
2012-01-06 15:07:33 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool _textureDirty;
|
2012-01-10 17:32:03 +00:00
|
|
|
Myst3Engine *_vm;
|
2011-12-26 20:39:26 +00:00
|
|
|
};
|
|
|
|
|
2011-12-27 14:15:17 +00:00
|
|
|
class SpotItemFace {
|
|
|
|
public:
|
2011-12-29 10:38:49 +00:00
|
|
|
SpotItemFace(Face *face, uint16 posX, uint16 posY);
|
2011-12-27 14:15:17 +00:00
|
|
|
~SpotItemFace();
|
|
|
|
|
2012-01-12 12:59:21 +00:00
|
|
|
void initBlack(uint16 width, uint16 height);
|
2012-12-12 15:33:24 +00:00
|
|
|
void loadData(const DirectorySubEntry *jpegDesc);
|
2012-12-03 13:27:56 +00:00
|
|
|
void updateData(const Graphics::Surface *surface);
|
2012-01-13 15:31:43 +00:00
|
|
|
void clear();
|
2011-12-29 13:39:36 +00:00
|
|
|
|
|
|
|
void draw();
|
|
|
|
void undraw();
|
|
|
|
void fadeDraw();
|
|
|
|
|
|
|
|
bool isDrawn() { return _drawn; }
|
|
|
|
void setDrawn(bool drawn) { _drawn = drawn; }
|
|
|
|
uint16 getFadeValue() { return _fadeValue; }
|
|
|
|
void setFadeValue(uint16 value) { _fadeValue = value; }
|
|
|
|
|
2011-12-27 14:15:17 +00:00
|
|
|
private:
|
2011-12-29 10:38:49 +00:00
|
|
|
Face *_face;
|
2011-12-27 14:15:17 +00:00
|
|
|
bool _drawn;
|
|
|
|
uint16 _fadeValue;
|
|
|
|
uint16 _posX;
|
|
|
|
uint16 _posY;
|
|
|
|
|
|
|
|
Graphics::Surface *_bitmap;
|
|
|
|
Graphics::Surface *_notDrawnBitmap;
|
2012-01-12 12:59:21 +00:00
|
|
|
|
|
|
|
void initNotDrawn(uint16 width, uint16 height);
|
2011-12-27 14:15:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpotItem {
|
|
|
|
public:
|
2011-12-29 10:38:49 +00:00
|
|
|
SpotItem(Myst3Engine *vm);
|
|
|
|
~SpotItem();
|
|
|
|
|
2011-12-27 14:15:17 +00:00
|
|
|
void setCondition(uint16 condition) { _condition = condition; }
|
|
|
|
void setFade(bool fade) { _enableFade = fade; }
|
|
|
|
void setFadeVar(uint16 var) { _fadeVar = var; }
|
|
|
|
void addFace(SpotItemFace *face) { _faces.push_back(face); }
|
|
|
|
|
2012-01-06 12:38:22 +00:00
|
|
|
void updateUndraw();
|
|
|
|
void updateDraw();
|
2011-12-27 14:15:17 +00:00
|
|
|
private:
|
2011-12-29 10:38:49 +00:00
|
|
|
Myst3Engine *_vm;
|
|
|
|
|
2011-12-27 14:15:17 +00:00
|
|
|
uint16 _condition;
|
|
|
|
uint16 _fadeVar;
|
|
|
|
bool _enableFade;
|
|
|
|
|
|
|
|
Common::Array<SpotItemFace *> _faces;
|
|
|
|
};
|
2011-12-26 20:39:26 +00:00
|
|
|
|
2012-01-05 16:19:15 +00:00
|
|
|
class SunSpot {
|
|
|
|
public:
|
|
|
|
uint16 pitch;
|
|
|
|
uint16 heading;
|
|
|
|
float intensity;
|
|
|
|
uint32 color;
|
|
|
|
uint16 var;
|
|
|
|
bool variableIntensity;
|
|
|
|
float radius;
|
|
|
|
};
|
|
|
|
|
2012-02-11 13:40:16 +00:00
|
|
|
class Node : Drawable {
|
2011-09-05 18:13:48 +00:00
|
|
|
protected:
|
2011-12-29 10:38:49 +00:00
|
|
|
Myst3Engine *_vm;
|
2011-12-29 19:04:14 +00:00
|
|
|
Face *_faces[6];
|
2011-12-27 14:15:17 +00:00
|
|
|
Common::Array<SpotItem *> _spotItems;
|
2012-02-11 13:40:16 +00:00
|
|
|
Subtitles *_subtitles;
|
2011-09-03 13:39:16 +00:00
|
|
|
|
2009-09-15 15:53:36 +00:00
|
|
|
public:
|
2012-01-05 12:38:31 +00:00
|
|
|
Node(Myst3Engine *vm, uint16 id);
|
2011-12-29 10:38:49 +00:00
|
|
|
virtual ~Node();
|
|
|
|
|
2011-12-29 13:39:36 +00:00
|
|
|
void update();
|
2011-09-05 18:13:48 +00:00
|
|
|
virtual void draw() = 0;
|
2012-02-11 13:40:16 +00:00
|
|
|
void drawOverlay();
|
2012-01-05 16:19:15 +00:00
|
|
|
|
2012-01-05 12:38:31 +00:00
|
|
|
void loadSpotItem(uint16 id, uint16 condition, bool fade);
|
2012-12-12 15:33:24 +00:00
|
|
|
SpotItemFace *loadMenuSpotItem(uint16 condition, const Common::Rect &rect);
|
2012-01-12 12:59:21 +00:00
|
|
|
|
2012-02-11 13:40:16 +00:00
|
|
|
void loadSubtitles(uint32 id);
|
|
|
|
bool hasSubtitlesToDraw();
|
|
|
|
|
2012-01-05 12:38:31 +00:00
|
|
|
void dumpFaceMask(uint16 index, int face);
|
2009-09-15 15:53:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end of namespace Myst3
|
|
|
|
|
|
|
|
#endif
|