ScummVM API documentation
base_surface.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * This file is based on WME Lite.
24 * http://dead-code.org/redir.php?target=wmelite
25 * Copyright (c) 2011 Jan Nedoma
26 */
27
28#ifndef WINTERMUTE_BASE_SURFACE_H
29#define WINTERMUTE_BASE_SURFACE_H
30
31#include "engines/wintermute/base/base.h"
32#include "graphics/surface.h"
33#include "graphics/transform_struct.h"
34
35namespace Wintermute {
36
37class BaseSurface : public BaseClass {
38public:
39 virtual bool invalidate();
40 virtual bool prepareToDraw();
41 bool _ckDefault;
42 byte _ckRed;
43 byte _ckGreen;
44 byte _ckBlue;
45
46 uint32 _lastUsedTime;
47 bool _valid;
48 int32 _lifeTime;
49 bool _keepLoaded;
50
51 BaseSurface(BaseGame *inGame);
52 ~BaseSurface() override;
53
54 virtual bool displayHalfTrans(int x, int y, Common::Rect32 rect);
55 virtual bool isTransparentAt(int x, int y);
56 virtual bool displayTransRotate(int x, int y, float rotate, int32 hotspotX, int32 hotspotY, Common::Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
57 virtual bool displayTransZoom(int x, int y, Common::Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
58 virtual bool displayTrans(int x, int y, Common::Rect32 rect, uint32 alpha = 0xFFFFFFFF, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false, int offsetX = 0, int offsetY = 0) = 0;
59 virtual bool display(int x, int y, Common::Rect32 rect, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
60 virtual bool displayTiled(int x, int y, Common::Rect32 rect, int numTimesX, int numTimesY) = 0;
61 virtual bool restore();
62 virtual bool create(const char *filename, bool texture2D, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime = -1, bool keepLoaded = false) = 0;
63 virtual bool create(int width, int height);
64 virtual bool setAlphaImage(const char *filename) {
65 return STATUS_FAILED;
66 }
67 virtual bool putSurface(const Graphics::Surface &surface, bool hasAlpha = false) {
68 return STATUS_FAILED;
69 }
70 virtual bool startPixelOp() = 0;
71 virtual bool endPixelOp() = 0;
72 virtual bool putPixel(int x, int y, byte r, byte g, byte b, byte a) = 0;
73 virtual bool getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a = nullptr) const = 0;
74 virtual bool isTransparentAtLite(int x, int y) const = 0;
75 void setFilename(const char *filename);
76 void setSize(int width, int height);
77
78 int _referenceCount;
79 char *_filename;
80
81 virtual int getWidth() {
82 return _width;
83 }
84 virtual int getHeight() {
85 return _height;
86 }
87 //void SetWidth(int Width) { _width = Width; }
88 //void SetHeight(int Height){ _height = Height; }
89protected:
90
91 int32 _height;
92 int32 _width;
93
94};
95
96} // End of namespace Wintermute
97
98#endif
Definition: base.h:43
Definition: base_game.h:79
Definition: base_surface.h:37
Definition: rect.h:538
Definition: surface.h:67