Crossfire Server  1.75.0
assets.h
Go to the documentation of this file.
1 #ifndef ASSETS_H
2 #define ASSETS_H
3 
10 #include "global.h"
11 #include "image.h"
12 #include "quest.h"
13 
20 #define ASSETS_ARCHETYPES 0x0001
21 #define ASSETS_FACES 0x0002
22 #define ASSETS_ANIMATIONS 0x0004
23 #define ASSETS_FACESETS 0x0008
24 #define ASSETS_TREASURES 0x0010
25 #define ASSETS_PNG 0x0020
26 #define ASSETS_MESSAGES 0x0040
27 #define ASSETS_ARTIFACTS 0x0080
28 #define ASSETS_FORMULAE 0x0100
29 #define ASSETS_ATTACK_MESSAGES 0x0200
30 #define ASSETS_QUESTS 0x0400
31 #define ASSETS_REGIONS 0x0800
32 #define ASSETS_ALL 0xFFFF
33 
35 typedef std::function<void(BufferReader *, const char *)> collectorHook;
36 
37 void load_assets(void);
38 
39 void assets_init();
40 void assets_free();
41 void assets_add_collector_hook(const char *name, collectorHook hook);
42 void assets_collect(const char* datadir, int what);
43 void assets_end_load();
44 
45 typedef void(*arch_op)(archetype *);
46 typedef void(*face_op)(const Face *);
47 typedef void(*anim_op)(const Animations *);
48 typedef void(*faceset_op)(const face_sets *);
49 
51 
54 
60 void assets_pack(const char *type, const char *filename);
61 
63 
69 
76 
82 void quest_for_each(quest_op op, void *user);
83 
84 size_t quests_count(bool includeSystem);
85 
86 class AssetsManager *getManager();
87 
88 #endif /* ASSETS_H */
This represents one animation.
Definition: face.h:25
void(* face_op)(const Face *)
Definition: assets.h:46
Definition of an in-game quest.
Definition: quest.h:37
class AssetsManager * getManager()
Definition: assets.cpp:309
void(* faceset_op)(const face_sets *)
Definition: assets.h:48
New face structure - this enforces the notion that data is face by face only - you can not change the...
Definition: face.h:14
Represents all assets of the game.
Definition: AssetsManager.h:28
Global type definitions and header inclusions.
void assets_end_load()
Called after collect is complete, to check various things.
Definition: assets.cpp:231
void load_assets(void)
Definition: assets.cpp:551
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
Definition: object.h:483
Image-related structures.
size_t assets_number_of_treasurelists()
Definition: assets.cpp:262
void(* quest_op)(const quest_definition *, void *)
Definition: quest.h:50
size_t assets_number_of_treasures()
Definition: assets.cpp:259
void(* anim_op)(const Animations *)
Definition: assets.h:47
void assets_add_collector_hook(const char *name, collectorHook hook)
Definition: assets.cpp:556
void(* arch_op)(archetype *)
Definition: assets.h:45
void quest_for_each(quest_op op, void *user)
Iterate over all quests.
Definition: assets.cpp:543
quest_definition * quest_find_by_code(sstring code)
Find a quest from its code, logging if no matching quest.
Definition: assets.cpp:523
quest_definition * quest_get_by_code(sstring code)
Find a quest from its code if it exists.
Definition: assets.cpp:534
void assets_init()
Init assets-related variables.
Definition: assets.cpp:65
void assets_pack(const char *type, const char *filename)
Pack the specified assets in a file.
Definition: assets.cpp:422
size_t quests_count(bool includeSystem)
Definition: assets.cpp:547
void assets_finish_archetypes_for_play()
Definition: assets.cpp:513
std::function< void(BufferReader *, const char *)> collectorHook
Definition: assets.h:35
const char * sstring
Definition: sstring.h:2
void archetypes_for_each(arch_op op)
Definition: assets.cpp:305
Information about one face set.
Definition: image.h:17
void assets_free()
Free all assets-related memory.
Definition: assets.cpp:72
void assets_collect(const char *datadir, int what)
Collect all assets from the specified directory and all its subdirectories.
Definition: assets.cpp:113