22 #ifndef WATCHMAKER_STRUCT_H 23 #define WATCHMAKER_STRUCT_H 25 #include "watchmaker/t3d.h" 26 #include "watchmaker/types.h" 27 #include "watchmaker/sysdef.h" 28 #include "common/stream.h" 29 #include "watchmaker/message.h" 39 template<u
int32 strSize>
41 char str[strSize] = {};
47 stream.
read(str, strSize);
53 for (uint32 i = 0; i < size; i++) {
54 array[i].loadFromStream(stream);
60 for (uint32 i = 0; i < size; i++) {
67 for (uint32 i = 0; i < size; i++) {
74 for (uint32 i = 0; i < size; i++) {
79 template<
typename T, u
int32 arraySize>
84 T &operator[](
int index) {
94 loadArrayFromStream(stream, _array, arraySize);
105 _array =
new T[size] {};
110 uint32 size()
const {
113 T &operator[](
int index) {
114 return _array[index];
117 loadArrayFromStream(stream, _array, _size);
122 uint8 name[T3D_NAMELEN];
133 stream.
read(name, T3D_NAMELEN);
134 stream.
read(desc, 64);
138 objects.loadFromStream(stream);
139 sounds.loadFromStream(stream);
140 anims.loadFromStream(stream);
141 actions.loadFromStream(stream);
158 uint8 *meshlink[MAX_OBJ_MESHLINKS];
162 examine.loadFromStream(stream);
163 action.loadFromStream(stream);
164 text.loadFromStream(stream);
165 anim.loadFromStream(stream);
166 anim2.loadFromStream(stream);
172 meshlink_int.loadFromStream(stream);
174 for (
int i = 0; i < MAX_OBJ_MESHLINKS; i++) {
175 meshlink[i] = meshlink_int.rawArray()[i].rawArray();
193 examine.loadFromStream(stream);
194 action.loadFromStream(stream);
196 text.loadFromStream(stream);
198 anim.loadFromStream(stream);
199 anim2.loadFromStream(stream);
200 meshlink.loadFromStream(stream);
230 meshlink.loadFromStream(stream);
231 name.loadFromStream(stream);
232 RoomName.loadFromStream(stream);
233 atframe.loadFromStream(stream);
243 char name[T3D_NAMELEN];
246 uint32 ConeInside, ConeOutside;
247 int32 ConeOutsideVolume;
248 t3dF32 MinDist, MaxDist;
252 stream.
read(name, T3D_NAMELEN);
254 meshlink.loadFromStream(stream);
265 char name[MAX_SUB_MUSICS][T3D_NAMELEN];
269 for (
int i = 0; i < MAX_SUB_MUSICS; i++) {
270 stream.
read(name[i], T3D_NAMELEN);
272 vol.loadFromStream(stream);
303 item.loadFromStream(stream);
318 AltPosSco.loadFromStream(stream);
319 AltCamSco.loadFromStream(stream);
320 AltAnims.loadFromStream(stream);
321 ItemIndex.loadFromStream(stream);
329 uint16 bnd, saved_bnd;
342 anim.loadFromStream(stream);
361 item.loadFromStream(stream);
385 int32 menu_appartenenza = 0, menu_creato = 0;
388 int32 dx = 0, dy = 0;
392 info.loadFromStream(stream);
393 text.loadFromStream(stream);
394 formatted.loadFromStream(stream);
405 char text[MAX_STRING_LEN] = {};
406 uint16 x = 0, y = 0, dx = 0;
409 SString(
const char *_text, uint16 _x = 0, uint16 _y = 0, uint16 _dx = 0) : x(_x), y(_y), dx(_dx) {
410 if (_text !=
nullptr) {
411 memcpy(this->text, _text, strlen(_text));
417 int32 x1 = 0, y1 = 0, x2 = 0, y2 = 0;
418 constexpr
SRect() =
default;
419 constexpr
SRect(int32 _x1, int32 _y1, int32 _x2, int32 _y2): x1(_x1), y1(_y1), x2(_x2), y2(_y2) {}
430 int32 px = 0, py = 0, dx = 0, dy = 0;
431 uint8 r = 0, g = 0, b = 0, a = 0;
434 int32 x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0;
435 uint8 r = 0, g = 0, b = 0, a = 0;
439 int32 px = 0, py = 0, dx = 0, dy = 0;
444 int32 px, py, ox, oy, dx, dy;
466 SDDText(
const char *_text, FontKind _font, FontColor _color, int32 _tnum) : font(_font),
473 for(uint i = 0; i <
ARRAYSIZE(text); i++) text[i] =
'\0';
474 font = FontKind::Standard;
475 color = FontColor::WHITE_FONT;
479 char text[MAX_STRING_LEN];
486 uint16 firstframe = 0;
492 uint8 sound_volume = 0;
494 uint8 music_volume = 0;
496 uint8 speech_volume = 0;
497 uint8 subtitles_on = 0;
511 int32 lparam[3] = {};
516 message(EventClass _classe, uint8 _event, uint16 _flags) : classe(_classe), event(_event), flags(_flags) {}
525 for (uint i = 0; i <
ARRAYSIZE(lparam); i++) lparam[i] = 0;
531 uint8 head = 0, tail = 0, len = 0;
532 message *
event[MAX_MESSAGES] = {};
543 stream.
read(name, 64);
554 stream.
read(role, 48);
561 int32 px = 0, py = 0;
562 int32 dx = 0, dy = 0;
570 char fullstring[64 + 16 + 1] = {};
571 int32 px = 0, py = 0;
572 int32 dx = 0, dy = 0;
573 int32 _dx = 0, _dy = 0;
575 char *letter_ptr =
nullptr;
576 int16 t_next_letter = 0;
582 #endif // WATCHMAKER_STRUCT_H #define ARRAYSIZE(x)
Definition: util.h:91
Definition: 2d_stuff.h:30
uint16 readUint16LE()
Definition: stream.h:459
FORCEINLINE int32 readSint32LE()
Definition: stream.h:555
size_t strlcpy(char *dst, const char *src, size_t size)
uint32 readUint32LE()
Definition: stream.h:473
byte readByte()
Definition: stream.h:434
FORCEINLINE float readFloatLE()
Definition: stream.h:615
FORCEINLINE int16 readSint16LE()
Definition: stream.h:543
virtual uint32 read(void *dataPtr, uint32 dataSize)=0