ScummVM API documentation
texture.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 #ifndef WATCHMAKER_TEXTURE_H
23 #define WATCHMAKER_TEXTURE_H
24 
25 #include "common/array.h"
26 #include "common/str.h"
27 #include "common/textconsole.h"
28 #include "watchmaker/3d/dds_header.h"
29 #include "graphics/surface.h"
30 #include "watchmaker/rect.h"
31 
32 namespace Watchmaker {
33 
34 class WGame;
35 // Texture structs
36 struct gTexture {
37  Common::String name;
38  Texture *_texture = nullptr;
39  int RealDimX = 0; // original dimensions
40  int RealDimY = 0; // original dimensions
41  int DimX = 0; // current dimensions
42  int DimY = 0; // current dimensions
43  int ID = 0; // id
44  int Flags = 0; // Flags
45 
46  bool isEmpty() {
47  return _texture == nullptr;
48  }
49  void clear() {
50  // TODO: This will only work for the back-surface
51  warning("Clearing %d", _blitsOnTop.size());
52  _blitsOnTop.clear();
53  }
54  void render(WGame &game, Common::Rect src, Common::Rect dst);
55  void blitInto(gTexture *texture, Common::Rect src, Common::Rect dst) {
56  _blitsOnTop.push_back({texture, src, dst});
57  }
58 private:
59  struct Blit {
60  gTexture *texture;
61  Common::Rect src;
62  Common::Rect dst;
63  };
64  Common::Array<Blit> _blitsOnTop;
65 };
66 
67 } // End of namespace Watchmaker
68 
69 #endif // WATCHMAKER_TEXTURE_H
Definition: 2d_stuff.h:30
Definition: str.h:59
void warning(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
void clear()
Definition: array.h:320
Definition: rect.h:144
void push_back(const T &element)
Definition: array.h:180
Definition: texture.h:36
size_type size() const
Definition: array.h:315
Definition: game.h:55
Definition: dds_header.h:50