22 #ifndef ULTIMA_SHARED_ENGINE_RESOURCES_H 23 #define ULTIMA_SHARED_ENGINE_RESOURCES_H 25 #include "common/algorithm.h" 26 #include "common/archive.h" 27 #include "common/array.h" 28 #include "common/memstream.h" 29 #include "common/str.h" 30 #include "common/serializer.h" 31 #include "ultima/shared/core/file.h" 33 #define STRING_BUFFER_SIZE 32768 46 char _buffer[STRING_BUFFER_SIZE];
67 virtual void syncString(
const char *&str);
68 virtual void syncStrings(
const char **str,
size_t count);
69 virtual void syncStrings2D(
const char **str,
size_t count1,
size_t count2);
70 virtual void syncNumber(
int &val);
71 virtual void syncNumbers(
int *vals,
size_t count);
72 virtual void syncNumbers2D(
int *vals,
size_t count1,
size_t count2);
73 virtual void syncNumbers3D(
int *vals,
size_t count1,
size_t count2,
size_t count3);
74 virtual void syncBytes(byte *vals,
size_t count);
75 virtual void syncBytes2D(byte *vals,
size_t count1,
size_t count2);
107 bool isSaving()
const {
return _owner !=
nullptr; }
109 void syncString(
const char *&str)
override;
110 void syncStrings(
const char **str,
size_t count)
override;
111 void syncStrings2D(
const char **str,
size_t count1,
size_t count2)
override;
112 void syncNumber(
int &val)
override;
113 void syncNumbers(
int *vals,
size_t count)
override;
114 void syncNumbers2D(
int *vals,
size_t count1,
size_t count2)
override;
115 void syncNumbers3D(
int *vals,
size_t count1,
size_t count2,
size_t count3)
override;
116 void syncBytes(byte *vals,
size_t count)
override;
117 void syncBytes2D(byte *vals,
size_t count1,
size_t count2)
override;
129 struct LocalResource {
133 struct FileResource {
135 size_t _offset, _size;
162 void addResource(
const Common::Path &name,
const byte *data,
size_t size);
Definition: resources.h:88
Definition: resources.h:128
Definition: memstream.h:194
virtual ~ResourceFile()
Definition: resources.h:59
Definition: archive.h:141
Definition: detection.h:27
LocalResourceFile(Resources *owner, const Common::Path &filename)
Definition: resources.h:101
virtual void synchronize()=0
bool isSaving() const
Definition: resources.h:107
Definition: resources.h:43
LocalResourceFile(const Common::Path &filename)
Definition: resources.h:96
ResourceFile(const Common::Path &filename)
Resources()
Definition: resources.h:148