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 "engines/wintermute/math/rect32.h"
33 #include "graphics/surface.h"
34 #include "graphics/transform_struct.h"
35 
36 namespace Wintermute {
37 
38 class BaseSurface: public BaseClass {
39 public:
40  virtual bool invalidate();
41  virtual bool prepareToDraw();
42  uint32 _lastUsedTime;
43  bool _valid;
44  int32 _lifeTime;
45 
46  bool _pixelOpReady;
47  BaseSurface(BaseGame *inGame);
48  ~BaseSurface() override;
49 
50  virtual bool displayHalfTrans(int x, int y, Rect32 rect);
51  virtual bool isTransparentAt(int x, int y);
52  virtual bool displayTransRotate(int x, int y, uint32 angle, int32 hotspotX, int32 hotspotY, Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
53  virtual bool displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
54  virtual bool displayTrans(int x, int y, Rect32 rect, uint32 alpha = 0xFFFFFFFF, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false, int offsetX = 0, int offsetY = 0) = 0;
55  virtual bool display(int x, int y, Rect32 rect, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
56  virtual bool displayTiled(int x, int y, Rect32 rect, int numTimesX, int numTimesY) = 0;
57  virtual bool restore();
58  virtual bool create(const Common::String &filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime = -1, bool keepLoaded = false) = 0;
59  virtual bool create(int width, int height);
60  virtual bool putSurface(const Graphics::Surface &surface, bool hasAlpha = false) {
61  return STATUS_FAILED;
62  }
63  virtual bool putPixel(int x, int y, byte r, byte g, byte b, int a = -1);
64  virtual bool getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a = nullptr);
65  virtual bool comparePixel(int x, int y, byte r, byte g, byte b, int a = -1);
66  virtual bool startPixelOp();
67  virtual bool endPixelOp();
68  virtual bool isTransparentAtLite(int x, int y);
69  void setSize(int width, int height);
70 
71  int _referenceCount;
72 
73  virtual int getWidth() {
74  return _width;
75  }
76  virtual int getHeight() {
77  return _height;
78  }
79  Common::String getFileNameStr() { return _filename; }
80  const char* getFileName() { return _filename.c_str(); }
81  //void SetWidth(int Width) { _width = Width; }
82  //void SetHeight(int Height){ _height = Height; }
83 protected:
84  bool _ckDefault;
85  byte _ckRed;
86  byte _ckGreen;
87  byte _ckBlue;
88 
89  bool _keepLoaded;
90  Common::String _filename;
91  int32 _height;
92  int32 _width;
93 
94 };
95 
96 } // End of namespace Wintermute
97 
98 #endif
Definition: base_game.h:76
Definition: str.h:59
Definition: surface.h:67
Definition: rect32.h:60
Definition: base_surface.h:38
Definition: base.h:43
Definition: achievements_tables.h:27