ScummVM API documentation
xmaterial.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.
24  * http://dead-code.org/redir.php?target=wme
25  * Copyright (c) 2003-2013 Jan Nedoma and contributors
26  */
27 
28 #ifndef WINTERMUTE_XMATERIAL_H
29 #define WINTERMUTE_XMATERIAL_H
30 
31 #include "engines/wintermute/base/base_named_object.h"
32 #include "engines/wintermute/base/gfx/xskinmesh.h"
33 
34 namespace Wintermute {
35 
36 class Effect3D;
37 class Effect3DParams;
38 class BaseSprite;
39 class BaseSurface;
40 class VideoTheoraPlayer;
41 class XFileData;
42 
43 class Material : public BaseNamedObject {
44 public:
45  Material(BaseGame *inGame);
46  virtual ~Material();
47 
48  DXMaterial _material;
49 
50  bool setTexture(const Common::String &filename, bool adoptName = false);
51  bool setSprite(BaseSprite *sprite, bool adoptName = false);
52  bool setTheora(VideoTheoraPlayer *theora, bool adoptName = false);
53  bool setEffect(Effect3D *effect, Effect3DParams *params, bool adoptName = false);
54 
55  BaseSurface *getSurface();
56  Effect3D *getEffect() { return _effect; }
57  Effect3DParams *getEffectParams() { return _params; }
58 
59  bool invalidateDeviceObjects();
60  bool restoreDeviceObjects();
61 
62 private:
63  Common::String _textureFilename;
64  BaseSurface *_surface;
65  bool _ownedSurface;
66  BaseSprite *_sprite;
67  VideoTheoraPlayer *_theora;
68  Effect3D *_effect;
69  Effect3DParams *_params;
70 };
71 
72 } // namespace Wintermute
73 
74 #endif
Definition: base_game.h:76
Definition: str.h:59
Definition: video_theora_player.h:41
Definition: xskinmesh.h:86
Definition: base_surface.h:38
Definition: 3deffect_params.h:36
Definition: base_named_object.h:36
Definition: xmaterial.h:43
Definition: base_sprite.h:40
Definition: 3deffect.h:36
Definition: achievements_tables.h:27