Skip to content

Commit

Permalink
Refactor: Renamed filesystem "namespace" as "scheme"
Browse files Browse the repository at this point in the history
The term "namespace" is no longer descriptive enough to describe the
purpose and functionality of the filesystem subspaces. As URIs are
now used as the universal method of addressing resources within the
filesystem it is only right that we should borrow this term to also
describe the subspaces.
  • Loading branch information
danij-deng committed Nov 22, 2012
1 parent 1b76b69 commit fc0ae34
Show file tree
Hide file tree
Showing 56 changed files with 1,152 additions and 1,151 deletions.
158 changes: 79 additions & 79 deletions doomsday/engine/api/dd_share.h
Expand Up @@ -1275,121 +1275,121 @@ typedef struct {
/**@}*/

/**
* @defgroup namespace Namespaces
* @defgroup scheme Schemes
* @ingroup resource
*/

/**
* Material Namespaces
* Material Schemes
*/

/**
* @defgroup materialNamespaceNames Material Namespace Names
* @ingroup namespace
* @{
* @defgroup materialSchemeNames Material Scheme Names
* @ingroup scheme
*/
#define MN_SYSTEM_NAME "System"
#define MN_FLATS_NAME "Flats"
#define MN_TEXTURES_NAME "Textures"
#define MN_SPRITES_NAME "Sprites"
/**@}*/
///@{
#define MS_SYSTEM_NAME "System"
#define MS_FLATS_NAME "Flats"
#define MS_TEXTURES_NAME "Textures"
#define MS_SPRITES_NAME "Sprites"
///@}

typedef enum materialnamespaceid_e {
MN_ANY = -1,
MATERIALNAMESPACE_FIRST = 1000,
MN_SYSTEM = MATERIALNAMESPACE_FIRST,
MN_FLATS,
MN_TEXTURES,
MN_SPRITES,
MATERIALNAMESPACE_LAST = MN_SPRITES,
MN_INVALID /// Special value used to signify an invalid namespace identifier.
} materialnamespaceid_t;
typedef enum materialschemeid_e {
MS_ANY = -1,
MATERIALSCHEME_FIRST = 1000,
MS_SYSTEM = MATERIALSCHEME_FIRST,
MS_FLATS,
MS_TEXTURES,
MS_SPRITES,
MATERIALSCHEME_LAST = MS_SPRITES,
MS_INVALID /// Special value used to signify an invalid scheme identifier.
} materialschemeid_t;

#define MATERIALNAMESPACE_COUNT (MATERIALNAMESPACE_LAST - MATERIALNAMESPACE_FIRST + 1)
#define MATERIALSCHEME_COUNT (MATERIALSCHEME_LAST - MATERIALSCHEME_FIRST + 1)

/// @c true= val can be interpreted as a valid material namespace identifier.
#define VALID_MATERIALNAMESPACEID(val) ((val) >= MATERIALNAMESPACE_FIRST && (val) <= MATERIALNAMESPACE_LAST)
/// @c true= val can be interpreted as a valid material scheme identifier.
#define VALID_MATERIALSCHEMEID(val) ((val) >= MATERIALSCHEME_FIRST && (val) <= MATERIALSCHEME_LAST)

/**
* Texture Namespaces
* Texture Schemes
*/

/**
* @defgroup textureNamespaceNames Texture Namespace Names
* @ingroup namespace
* @defgroup textureSchemeNames Texture Scheme Names
* @ingroup scheme
*/
///@{
#define TN_SYSTEM_NAME "System"
#define TN_FLATS_NAME "Flats"
#define TN_TEXTURES_NAME "Textures"
#define TN_SPRITES_NAME "Sprites"
#define TN_PATCHES_NAME "Patches"
#define TN_DETAILS_NAME "Details"
#define TN_REFLECTIONS_NAME "Reflections"
#define TN_MASKS_NAME "Masks"
#define TN_MODELSKINS_NAME "ModelSkins"
#define TN_MODELREFLECTIONSKINS_NAME "ModelReflectionSkins"
#define TN_LIGHTMAPS_NAME "Lightmaps"
#define TN_FLAREMAPS_NAME "Flaremaps"
#define TS_SYSTEM_NAME "System"
#define TS_FLATS_NAME "Flats"
#define TS_TEXTURES_NAME "Textures"
#define TS_SPRITES_NAME "Sprites"
#define TS_PATCHES_NAME "Patches"
#define TS_DETAILS_NAME "Details"
#define TS_REFLECTIONS_NAME "Reflections"
#define TS_MASKS_NAME "Masks"
#define TS_MODELSKINS_NAME "ModelSkins"
#define TS_MODELREFLECTIONSKINS_NAME "ModelReflectionSkins"
#define TS_LIGHTMAPS_NAME "Lightmaps"
#define TS_FLAREMAPS_NAME "Flaremaps"
///@}

/// Texture namespace identifiers. @ingroup namespace
typedef enum texturenamespaceid_e {
TN_ANY = -1,
TEXTURENAMESPACE_FIRST = 2000,
TN_SYSTEM = TEXTURENAMESPACE_FIRST,
TN_FLATS,
TN_TEXTURES,
TN_SPRITES,
TN_PATCHES,
TN_DETAILS,
TN_REFLECTIONS,
TN_MASKS,
TN_MODELSKINS,
TN_MODELREFLECTIONSKINS,
TN_LIGHTMAPS,
TN_FLAREMAPS,
TEXTURENAMESPACE_LAST = TN_FLAREMAPS,
TN_INVALID /// Special value used to signify an invalid namespace identifier.
} texturenamespaceid_t;

#define TEXTURENAMESPACE_COUNT (TEXTURENAMESPACE_LAST - TEXTURENAMESPACE_FIRST + 1)

/// @c true= val can be interpreted as a valid texture namespace identifier.
#define VALID_TEXTURENAMESPACEID(val) ((val) >= TEXTURENAMESPACE_FIRST && (val) <= TEXTURENAMESPACE_LAST)
/// Texture scheme identifiers. @ingroup scheme
typedef enum textureschemeid_e {
TS_ANY = -1,
TEXTURESCHEME_FIRST = 2000,
TS_SYSTEM = TEXTURESCHEME_FIRST,
TS_FLATS,
TS_TEXTURES,
TS_SPRITES,
TS_PATCHES,
TS_DETAILS,
TS_REFLECTIONS,
TS_MASKS,
TS_MODELSKINS,
TS_MODELREFLECTIONSKINS,
TS_LIGHTMAPS,
TS_FLAREMAPS,
TEXTURESCHEME_LAST = TS_FLAREMAPS,
TS_INVALID /// Special value used to signify an invalid scheme identifier.
} textureschemeid_t;

#define TEXTURESCHEME_COUNT (TEXTURESCHEME_LAST - TEXTURESCHEME_FIRST + 1)

/// @c true= val can be interpreted as a valid texture scheme identifier.
#define VALID_TEXTURESCHEMEID(val) ((val) >= TEXTURESCHEME_FIRST && (val) <= TEXTURESCHEME_LAST)

/**
* Font Namespaces
* Font Schemes
*/

/**
* @defgroup fontNamespaceNames Font Namespace Names
* @ingroup namespace
* @{
* @defgroup fontSchemeNames Font Scheme Names
* @ingroup scheme
*/
///@{
#define FN_SYSTEM_NAME "System"
#define FN_GAME_NAME "Game"
///@}

/// Font namespace identifier. @ingroup namespace
typedef enum fontnamespaceid_e {
FN_ANY = -1,
FONTNAMESPACE_FIRST = 3000,
FN_SYSTEM = FONTNAMESPACE_FIRST,
FN_GAME,
FONTNAMESPACE_LAST = FN_GAME,
FN_INVALID ///< Special value used to signify an invalid namespace identifier.
} fontnamespaceid_t;
/// Font scheme identifier. @ingroup scheme
typedef enum fontschemeid_e {
FS_ANY = -1,
FONTSCHEME_FIRST = 3000,
FS_SYSTEM = FONTSCHEME_FIRST,
FS_GAME,
FONTSCHEME_LAST = FS_GAME,
FS_INVALID ///< Special value used to signify an invalid scheme identifier.
} fontschemeid_t;

#define FONTNAMESPACE_COUNT (FONTNAMESPACE_LAST - FONTNAMESPACE_FIRST + 1)
#define FONTSCHEME_COUNT (FONTSCHEME_LAST - FONTSCHEME_FIRST + 1)

/**
* Determines whether @a val can be interpreted as a valid font namespace
* identifier. @ingroup namespace
* Determines whether @a val can be interpreted as a valid font scheme
* identifier. @ingroup scheme
* @param val Integer value.
* @return @c true or @c false.
*/
#define VALID_FONTNAMESPACEID(val) ((val) >= FONTNAMESPACE_FIRST && (val) <= FONTNAMESPACE_LAST)
#define VALID_FONTSCHEMEID(val) ((val) >= FONTSCHEME_FIRST && (val) <= FONTSCHEME_LAST)

/// Patch Info
typedef struct {
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/api/doomsday.def
Expand Up @@ -21,8 +21,8 @@ EXPORTS
DD_GetVariable @43 NONAME
DD_GetPlayer @44 NONAME
DD_MaterialForTextureUniqueId @234 NONAME
DD_ParseTextureNamespace @502 NONAME
DD_ParseMaterialNamespace @503 NONAME
DD_ParseTextureSchemeName @502 NONAME
DD_ParseMaterialSchemeName @503 NONAME

; Base: Types.
; Animator.
Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/api/doomsday.h
Expand Up @@ -192,18 +192,18 @@ boolean DD_GameInfo(GameInfo* info);
ddplayer_t* DD_GetPlayer(int number);
///@}

/// @addtogroup namespace
/// @addtogroup scheme
///@{
texturenamespaceid_t DD_ParseTextureNamespace(const char* str);
materialnamespaceid_t DD_ParseMaterialNamespace(const char* str);
textureschemeid_t DD_ParseTextureSchemeName(const char* str);
materialschemeid_t DD_ParseMaterialSchemeName(const char* str);
///@}

/**
* @defgroup material Materials
* @ingroup resource
*/
///@{
materialid_t DD_MaterialForTextureUniqueId(texturenamespaceid_t texNamespaceId, int uniqueId);
materialid_t DD_MaterialForTextureUniqueId(textureschemeid_t texSchemeId, int uniqueId);
///@}

/// @addtogroup defs
Expand Down
15 changes: 8 additions & 7 deletions doomsday/engine/api/resourceclass.h
Expand Up @@ -76,8 +76,8 @@ namespace de
typedef QList<FileType*> FileTypes;

public:
ResourceClass(String _name, String _defaultNamespace)
: name_(_name), defaultNamespace_(_defaultNamespace)
ResourceClass(String _name, String _defaultScheme)
: name_(_name), defaultScheme_(_defaultScheme)
{}

virtual ~ResourceClass() {
Expand All @@ -93,10 +93,11 @@ namespace de
return name_;
}

/// Return the symbolic name of the default namespace for this class of resource.
String const& defaultNamespace() const
/// Return the symbolic name of the default filesystem subspace scheme
/// for this class of resource.
String const& defaultScheme() const
{
return defaultNamespace_;
return defaultScheme_;
}

/// Return the number of file types for this class of resource.
Expand Down Expand Up @@ -132,8 +133,8 @@ namespace de
/// Symbolic name for this class.
String name_;

/// Symbolic name of the default namespace.
String defaultNamespace_;
/// Symbolic name of the default filesystem subspace scheme.
String defaultScheme_;

/// Recognized file types (in order of importance, left to right).
FileTypes fileTypes_;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/engine.pro
Expand Up @@ -470,7 +470,7 @@ SOURCES += \
src/filesys/filehandle.cpp \
src/filesys/fileid.cpp \
src/filesys/fs_main.cpp \
src/filesys/fs_namespace.cpp \
src/filesys/fs_scheme.cpp \
src/filesys/fs_util.cpp \
src/filesys/lumpindex.cpp \
src/filesys/metafile.cpp \
Expand Down
12 changes: 6 additions & 6 deletions doomsday/engine/include/dd_main.h
Expand Up @@ -199,17 +199,17 @@ de::ResourceClass& DD_ResourceClassByName(de::String name);

#endif // __cplusplus

texturenamespaceid_t DD_ParseTextureNamespace(const char* str);
textureschemeid_t DD_ParseTextureSchemeName(const char* str);

materialnamespaceid_t DD_ParseMaterialNamespace(const char* str);
materialschemeid_t DD_ParseMaterialSchemeName(const char* str);

fontnamespaceid_t DD_ParseFontNamespace(const char* str);
fontschemeid_t DD_ParseFontSchemeName(const char* str);

/// @return Symbolic name of the material namespace associated with @a namespaceId.
const ddstring_t* DD_MaterialNamespaceNameForTextureNamespace(texturenamespaceid_t texNamespaceId);
/// @return Symbolic name of the material scheme associated with @a schemeId.
const ddstring_t* DD_MaterialSchemeNameForTextureScheme(textureschemeid_t schemeId);

/// @return Unique identifier of the material associated with the identified @a uniqueId texture.
materialid_t DD_MaterialForTextureUniqueId(texturenamespaceid_t texNamespaceId, int uniqueId);
materialid_t DD_MaterialForTextureUniqueId(textureschemeid_t schemeId, int uniqueId);

const char* value_Str(int val);

Expand Down

0 comments on commit fc0ae34

Please sign in to comment.