ScummVM API documentation
base_sub_frame.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_SUBFRAME_H
29#define WINTERMUTE_BASE_SUBFRAME_H
30
31
32#include "engines/wintermute/base/base.h"
33#include "engines/wintermute/base/base_scriptable.h"
34#include "graphics/transform_struct.h"
35
36namespace Wintermute {
37class BaseObject;
38class BaseSurface;
40public:
41 bool _mirrorX;
42 bool _mirrorY;
43 bool _decoration;
44 bool setSurface(const char *filename, bool defaultCK = true, byte ckRed = 0, byte ckGreen = 0, byte ckBlue = 0, int lifeTime = -1, bool keepLoaded = false);
45 bool setSurfaceSimple();
46 DECLARE_PERSISTENT(BaseSubFrame, BaseScriptable)
47 void setDefaultRect();
48 uint32 _transparent;
49 bool saveAsText(BaseDynamicBuffer *buffer, int indent) override { return saveAsText(buffer, indent, true); }
50 bool saveAsText(BaseDynamicBuffer *buffer, int indent, bool complete);
51 bool _editorSelected;
52 BaseSubFrame(BaseGame *inGame);
53 ~BaseSubFrame() override;
54 bool loadBuffer(char *buffer, int lifeTime, bool keepLoaded);
55 bool draw(int x, int y, BaseObject *registerOwner = nullptr, float zoomX = 100, float zoomY = 100, bool precise = true, uint32 alpha = 0xFFFFFFFF, float rotate = 0.0f, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL);
56 bool getBoundingRect(Common::Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
57
58 int32 _hotspotX;
59 int32 _hotspotY;
60 uint32 _alpha;
61 Common::Rect32 _rect;
62
63 bool _ckDefault;
64 byte _ckRed;
65 byte _ckGreen;
66 byte _ckBlue;
67 int32 _lifeTime;
68 bool _keepLoaded;
69 char *_surfaceFilename;
70
71 bool _2DOnly;
72 bool _3DOnly;
73
74 BaseSurface *_surface;
75
76 // scripting interface
77 ScValue *scGetProperty(const char *name) override;
78 bool scSetProperty(const char *name, ScValue *value) override;
79 bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
80 const char *scToString() override;
81
82 Common::String debuggerToString() const override;
83
84 bool startPixelOperations();
85 bool endPixelOperations();
86 uint32 getPixel(int32 x, int32 y);
87 bool putPixel(int32 x, int32 y, uint32 pixel);
88 int32 getWidth();
89 int32 getHeight();
90
91};
92
93} // End of namespace Wintermute
94
95#endif
Definition: str.h:59
Definition: base_dynamic_buffer.h:35
Definition: base_game.h:79
Definition: base_object.h:49
Definition: base_scriptable.h:41
Definition: base_sub_frame.h:39
Definition: base_surface.h:37
Definition: script.h:44
Definition: script_stack.h:41
Definition: script_value.h:42
Definition: rect.h:538