ScummVM API documentation
static_object.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 //
24 // A stub class for "managing" static global objects exported to script.
25 // This may be temporary solution (oh no, not again :P) that could be
26 // replaced by the use of dynamic objects in the future.
27 //
28 //=============================================================================
29 
30 #ifndef AGS_ENGINE_AC_STATOBJ_STATICOBJECT_H
31 #define AGS_ENGINE_AC_STATOBJ_STATICOBJECT_H
32 
33 #include "ags/shared/core/types.h"
34 
35 namespace AGS3 {
36 
38  virtual ~ICCStaticObject() {}
39 
40  // Legacy support for reading and writing object values by their relative offset
41  virtual const char *GetFieldPtr(const char *address, intptr_t offset) = 0;
42  virtual void Read(const char *address, intptr_t offset, void *dest, int size) = 0;
43  virtual uint8_t ReadInt8(const char *address, intptr_t offset) = 0;
44  virtual int16_t ReadInt16(const char *address, intptr_t offset) = 0;
45  virtual int32_t ReadInt32(const char *address, intptr_t offset) = 0;
46  virtual float ReadFloat(const char *address, intptr_t offset) = 0;
47  virtual void Write(const char *address, intptr_t offset, void *src, int size) = 0;
48  virtual void WriteInt8(const char *address, intptr_t offset, uint8_t val) = 0;
49  virtual void WriteInt16(const char *address, intptr_t offset, int16_t val) = 0;
50  virtual void WriteInt32(const char *address, intptr_t offset, int32_t val) = 0;
51  virtual void WriteFloat(const char *address, intptr_t offset, float val) = 0;
52 };
53 
54 } // namespace AGS3
55 
56 #endif
Definition: static_object.h:37
Definition: ags.h:40