Crossfire Server, Trunk
assets.h File Reference
#include "global.h"
#include "image.h"
#include "quest.h"
+ Include dependency graph for assets.h:

Go to the source code of this file.

Macros

#define ASSETS_ALL   0xFFFF
 
#define ASSETS_ANIMATIONS   0x0004
 
#define ASSETS_ARCHETYPES   0x0001
 
#define ASSETS_ARTIFACTS   0x0080
 
#define ASSETS_ATTACK_MESSAGES   0x0200
 
#define ASSETS_FACES   0x0002
 
#define ASSETS_FACESETS   0x0008
 
#define ASSETS_FORMULAE   0x0100
 
#define ASSETS_MESSAGES   0x0040
 
#define ASSETS_PNG   0x0020
 
#define ASSETS_QUESTS   0x0400
 
#define ASSETS_REGIONS   0x0800
 
#define ASSETS_TREASURES   0x0010
 

Typedefs

typedef void(* anim_op) (const Animations *)
 
typedef void(* arch_op) (archetype *)
 
typedef void(* face_op) (const Face *)
 
typedef void(* faceset_op) (const face_sets *)
 

Functions

void archetypes_for_each (arch_op op)
 
void assets_collect (const char *datadir, int what)
 
void assets_end_load ()
 
void assets_finish_archetypes_for_play ()
 
void assets_free ()
 
void assets_init ()
 
size_t assets_number_of_treasurelists ()
 
size_t assets_number_of_treasures ()
 
void assets_pack (const char *type, const char *filename)
 
class AssetsManagergetManager ()
 
void load_assets (void)
 
quest_definitionquest_find_by_code (sstring code)
 
void quest_for_each (quest_op op, void *user)
 
quest_definitionquest_get_by_code (sstring code)
 
size_t quests_count (bool includeSystem)
 

Detailed Description

C function wrappers to interact with assets. Should not be used by C++ code, except for getManager() to get the AssetsManager.

Definition in file assets.h.

Macro Definition Documentation

◆ ASSETS_ALL

#define ASSETS_ALL   0xFFFF

Definition at line 32 of file assets.h.

◆ ASSETS_ANIMATIONS

#define ASSETS_ANIMATIONS   0x0004

Definition at line 22 of file assets.h.

◆ ASSETS_ARCHETYPES

#define ASSETS_ARCHETYPES   0x0001

Definition at line 20 of file assets.h.

◆ ASSETS_ARTIFACTS

#define ASSETS_ARTIFACTS   0x0080

Definition at line 27 of file assets.h.

◆ ASSETS_ATTACK_MESSAGES

#define ASSETS_ATTACK_MESSAGES   0x0200

Definition at line 29 of file assets.h.

◆ ASSETS_FACES

#define ASSETS_FACES   0x0002

Definition at line 21 of file assets.h.

◆ ASSETS_FACESETS

#define ASSETS_FACESETS   0x0008

Definition at line 23 of file assets.h.

◆ ASSETS_FORMULAE

#define ASSETS_FORMULAE   0x0100

Definition at line 28 of file assets.h.

◆ ASSETS_MESSAGES

#define ASSETS_MESSAGES   0x0040

Definition at line 26 of file assets.h.

◆ ASSETS_PNG

#define ASSETS_PNG   0x0020

Definition at line 25 of file assets.h.

◆ ASSETS_QUESTS

#define ASSETS_QUESTS   0x0400

Definition at line 30 of file assets.h.

◆ ASSETS_REGIONS

#define ASSETS_REGIONS   0x0800

Definition at line 31 of file assets.h.

◆ ASSETS_TREASURES

#define ASSETS_TREASURES   0x0010

Definition at line 24 of file assets.h.

Typedef Documentation

◆ anim_op

typedef void(* anim_op) (const Animations *)

Definition at line 44 of file assets.h.

◆ arch_op

typedef void(* arch_op) (archetype *)

Definition at line 42 of file assets.h.

◆ face_op

typedef void(* face_op) (const Face *)

Definition at line 43 of file assets.h.

◆ faceset_op

typedef void(* faceset_op) (const face_sets *)

Definition at line 45 of file assets.h.

Function Documentation

◆ archetypes_for_each()

void archetypes_for_each ( arch_op  op)

Definition at line 301 of file assets.cpp.

References AssetsManager::archetypes(), AssetsCollection< T, Key >::each(), manager, and give::op.

Referenced by cast_create_food(), init_gods(), init_mon_info(), init_skills(), and spellpath_msg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assets_collect()

void assets_collect ( const char *  datadir,
int  what 
)

◆ assets_end_load()

void assets_end_load ( )

Called after collect is complete, to check various things.

Definition at line 227 of file assets.cpp.

References check_formulae(), check_generators(), check_recipes(), check_spells(), check_summoned(), AssetsCollection< T, Key >::each(), guildoracle::list, manager, and AssetsManager::treasures().

Referenced by load_assets().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assets_finish_archetypes_for_play()

void assets_finish_archetypes_for_play ( )

Definition at line 509 of file assets.cpp.

References archininventory::arch, AssetsManager::archetypes(), AssetsCollection< T, Key >::each(), manager, and give::op.

Referenced by command_recollect(), and init_beforeplay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assets_free()

void assets_free ( )

Free all assets-related memory.

Definition at line 72 of file assets.cpp.

References manager.

Referenced by free_globals(), and teardown().

+ Here is the caller graph for this function:

◆ assets_init()

void assets_init ( )

Init assets-related variables.

Definition at line 65 of file assets.cpp.

References manager.

Referenced by cctk_init_std_archetypes(), init_library(), and setup().

+ Here is the caller graph for this function:

◆ assets_number_of_treasurelists()

size_t assets_number_of_treasurelists ( )

Definition at line 258 of file assets.cpp.

References AssetsCollection< T, Key >::count(), manager, and AssetsManager::treasures().

Referenced by malloc_info().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assets_number_of_treasures()

size_t assets_number_of_treasures ( )

Definition at line 255 of file assets.cpp.

References nroftreasures.

Referenced by malloc_info().

+ Here is the caller graph for this function:

◆ assets_pack()

◆ getManager()

class AssetsManager* getManager ( )

Definition at line 305 of file assets.cpp.

References manager.

Referenced by ArchetypesWrapper::addArchetype(), addArchetypes(), QuestsWrapper::addQuest(), CREResourcesWindow::addQuest(), AllAssets::AllAssets(), ArchetypeWrapper::appearsOnTreasureList(), ArchetypeComboBox::ArchetypeComboBox(), ArchetypesModel::ArchetypesModel(), ResourcesManager::archetypeUse(), ArtifactPanel::artifactChanged(), CREMapInformationManager::browseMaps(), build_class_list_reply(), build_race_list_reply(), MonsterResistances::buildGraph(), cfapi_system_get_archetype_vector(), create_archetype_by_object_name(), CRESubItemQuest::CRESubItemQuest(), TreasureWrapper::displayIcon(), TreasureListWrapper::drop(), TreasureWrapper::drop(), TreasurePanel::dropEvent(), dump_abilities(), dump_all_archetypes(), dump_animations(), dump_faces(), dump_monster_treasure(), dump_spells(), FaceComboBox::FaceComboBox(), fillEvents(), CREMainWindow::fillFacesets(), find_archetype_by_object_name(), find_archetype_by_object_type_name(), finish_races(), get_archetype_by_skill_name(), get_archetype_by_type_subtype(), get_player_archetype(), get_spell_by_name(), CREPixmap::init(), init_library(), isValidArchFlesh(), FaceMakerDialog::makeFaces(), malloc_info(), msgfile_msg(), CREMainWindow::onReportAlchemy(), CREMainWindow::onReportAlchemyGraph(), CREMainWindow::onReportArchetypes(), CREMainWindow::onReportDuplicate(), CREMainWindow::onReportLicenses(), CREMainWindow::onReportPlayer(), CREMainWindow::onReportQuests(), CREMainWindow::onReportSpellDamage(), CREMainWindow::onReportSpells(), CREMainWindow::onReportSummon(), polymorph_item(), polymorph_living(), print_monsters(), QuestComboBox::QuestComboBox(), recipe_find_ingredient_cost(), CRESubItemQuest::selectedQuestChanged(), send_image_info(), send_map_info(), CREPixmap::setFaceset(), ArchetypeWrapper::setRaw(), SoundsDialog::soundType(), spellsTable(), START_TEST(), treasureContains(), TreasureListComboBox::TreasureListComboBox(), RecipePanel::updateItem(), FacesetsPanel::updateItem(), and ArchetypeWrapper::uses().

◆ load_assets()

void load_assets ( void  )

Definition at line 312 of file init.cpp.

References ASSETS_ALL, assets_collect(), assets_end_load(), Settings::datadir, and settings.

Referenced by command_recollect(), and init_library().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_find_by_code()

quest_definition* quest_find_by_code ( sstring  code)

Find a quest from its code, logging if no matching quest.

Parameters
codequest to search.
Returns
quest, or NULL if no such quest.

Definition at line 519 of file assets.cpp.

References llevError, LOG(), and quest_get_by_code().

Referenced by get_quest_by_number(), quest_display(), quest_get_player_state(), quest_info(), quest_set_state(), and quest_start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_for_each()

void quest_for_each ( quest_op  op,
void *  user 
)

Iterate over all quests.

Parameters
opfunction to call for each quest.
userextra parameter to give the function.

Definition at line 539 of file assets.cpp.

◆ quest_get_by_code()

quest_definition* quest_get_by_code ( sstring  code)

Find a quest from its code if it exists.

Returns
quest, or NULL if no such quest.

Definition at line 530 of file assets.cpp.

References AssetsCollection< T, Key >::find(), manager, and AssetsManager::quests().

Referenced by command_quest(), quest_find_by_code(), quest_read_player_data(), and quest_send_initial_states().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quests_count()

size_t quests_count ( bool  includeSystem)

Definition at line 543 of file assets.cpp.

References AssetsCollection< T, Key >::count(), manager, AssetsManager::quests(), and Quests::visibleCount().

+ Here is the call graph for this function: