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 
35 namespace Wintermute {
36 
37 class BaseSurface: public BaseClass {
38 public:
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 Common::String &filename, 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 Common::String &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 setSize(int width, int height);
76 
77  int _referenceCount;
78 
79  virtual int getWidth() {
80  return _width;
81  }
82  virtual int getHeight() {
83  return _height;
84  }
85  Common::String getFileNameStr() { return _filename; }
86  const char* getFileName() { return _filename.c_str(); }
87  //void SetWidth(int Width) { _width = Width; }
88  //void SetHeight(int Height){ _height = Height; }
89 protected:
90 
91  Common::String _filename;
92  int32 _height;
93  int32 _width;
94 
95 };
96 
97 } // End of namespace Wintermute
98 
99 #endif
Definition: base_game.h:75
Definition: rect.h:526
Definition: str.h:59
Definition: surface.h:67
Definition: base_surface.h:37
Definition: base.h:43
Definition: achievements_tables.h:27