diff --git a/doomsday/engine/api/api_resource.h b/doomsday/engine/api/api_resource.h new file mode 100644 index 0000000000..6ca3f74a6a --- /dev/null +++ b/doomsday/engine/api/api_resource.h @@ -0,0 +1,129 @@ +#ifndef DOOMSDAY_API_RESOURCE_H +#define DOOMSDAY_API_RESOURCE_H + +#include "apis.h" +#include "api_uri.h" +#include "dd_share.h" + +DENG_API_TYPEDEF(R) +{ + de_api_t api; + + patchid_t (*DeclarePatch)(const char* name); + + /** + * Retrieve extended info for the patch associated with @a id. + * + * @param id Unique identifier of the patch to lookup. + * @param info Extend info will be written here if found. + * @return @c true: Extended info for this patch was found. + */ + boolean (*GetPatchInfo)(patchid_t id, patchinfo_t* info); + + /// @return Uri for the patch associated with @a id. Should be released with Uri_Delete() + Uri* (*ComposePatchUri)(patchid_t id); + + /// @return Path for the patch associated with @a id. A zero-length string is + /// returned if the id is invalid/unknown. + AutoStr* (*ComposePatchPath)(patchid_t id); + + /** + * Create a new animation group. + * @return Logical (unique) identifier reference associated with the new group. + */ + int (*CreateAnimGroup)(int flags); + + /** + * Append a new @a texture frame to the identified @a animGroupNum. + * + * @param animGroupNum Logical identifier reference to the group being modified. + * @param texture Texture frame to be inserted into the group. + * @param tics Base duration of the new frame in tics. + * @param randomTics Extra frame duration in tics (randomized on each cycle). + */ + void (*AddAnimGroupFrame)(int groupNum, const Uri* texture, int tics, int randomTics); + + /** + * Add a new (named) color palette. + * + * The idea with the two-teered implementation is to allow maximum flexibility. + * Within the engine we can create new palettes and manipulate them directly + * via the DGL interface. The underlying implementation is wrapped in a similar + * way to the materials so that publically, there is a set of (eternal) names + * and unique identifiers that survive game and GL resets. + * + * @param fmt Format string describes the format of @p data. + * Expected form: "C#C#C" + * C = color component, one of R, G, B. + * # = bits per component. + * + * @param name Unique name by which the palette will be known. + * @param colorData Color component triplets (at least @a colorCount * 3 values). + * @param colorCount Number of colors. + * + * @return Color palette id. + */ + colorpaletteid_t (*CreateColorPalette)(const char* fmt, const char* name, const uint8_t* colorData, int colorCount); + + /** + * Given a color palette name, look up the associated identifier. + * + * @param name Unique name of the palette to locate. + * @return Identifier of the palette associated with this name, else @c 0 + */ + colorpaletteid_t (*GetColorPaletteNumForName)(const char* name); + + /** + * Given a color palette id, look up the specified unique name. + * + * @param id Id of the color palette to locate. + * @return Pointer to the unique name associated with the specified id else @c NULL + */ + const char* (*GetColorPaletteNameForNum)(colorpaletteid_t id); + + /** + * Given a color palette index, calculate the equivalent RGB color. + * + * @param id Id of the ColorPalette to use. + * @param colorIdx ColorPalette color index. + * @param rgb Final color will be written back here. + * @param applyTexGamma @c true: the texture gamma ramp should be applied. + */ + void (*GetColorPaletteRGBf)(colorpaletteid_t id, int colorIdx, float rgb[3], boolean applyTexGamma); + + /** + * Given a color palette index, calculate the equivalent RGB color. + * + * @param id Id of the ColorPalette to use. + * @param colorIdx ColorPalette color index. + * @param rgb Final color will be written back here. + * @param applyTexGamma @c true= the texture gamma ramp should be applied. + */ + void (*GetColorPaletteRGBubv)(colorpaletteid_t id, int colorIdx, uint8_t rgb[3], boolean applyTexGamma); + + int (*TextureUniqueId)(const Uri* uri); /*quiet=false*/ + int (*TextureUniqueId2)(const Uri* uri, boolean quiet); +} +DENG_API_T(R); + +#ifndef DENG_NO_API_MACROS_RESOURCE +#define R_DeclarePatch _api_R.DeclarePatch +#define R_GetPatchInfo _api_R.GetPatchInfo +#define R_ComposePatchUri _api_R.ComposePatchUri +#define R_ComposePatchPath _api_R.ComposePatchPath +#define R_CreateAnimGroup _api_R.CreateAnimGroup +#define R_AddAnimGroupFrame _api_R.AddAnimGroupFrame +#define R_CreateColorPalette _api_R.CreateColorPalette +#define R_GetColorPaletteNumForName _api_R.GetColorPaletteNumForName +#define R_GetColorPaletteNameForNum _api_R.GetColorPaletteNameForNum +#define R_GetColorPaletteRGBf _api_R.GetColorPaletteRGBf +#define R_GetColorPaletteRGBubv _api_R.GetColorPaletteRGBubv +#define Textures_UniqueId _api_R.TextureUniqueId +#define Textures_UniqueId2 _api_R.TextureUniqueId2 +#endif + +#ifdef __DOOMSDAY__ +DENG_USING_API(R); +#endif + +#endif // DOOMSDAY_API_RESOURCE_H diff --git a/doomsday/engine/api/doomsday.h b/doomsday/engine/api/doomsday.h index 413527256d..b5451fa523 100644 --- a/doomsday/engine/api/doomsday.h +++ b/doomsday/engine/api/doomsday.h @@ -75,6 +75,7 @@ struct font_s; #include "api_svg.h" #include "api_sound.h" #include "api_render.h" +#include "api_resource.h" #include "api_map.h" #include "api_mapedit.h" #include "api_client.h" @@ -149,27 +150,6 @@ extern "C" { * @defgroup render Renderer */ -// R (Resource) - -patchid_t R_DeclarePatch(const char* name); -boolean R_GetPatchInfo(patchid_t id, patchinfo_t* info); -Uri* R_ComposePatchUri(patchid_t id); -AutoStr* R_ComposePatchPath(patchid_t id); - -int Textures_UniqueId2(const Uri* uri, boolean quiet); -int Textures_UniqueId(const Uri* uri); /*quiet=false*/ - -int R_CreateAnimGroup(int flags); -void R_AddAnimGroupFrame(int groupNum, const Uri* texture, int tics, int randomTics); - -colorpaletteid_t R_CreateColorPalette(const char* fmt, const char* name, const uint8_t* colorData, int colorCount); -colorpaletteid_t R_GetColorPaletteNumForName(const char* name); -const char* R_GetColorPaletteNameForNum(colorpaletteid_t id); - -void R_GetColorPaletteRGBubv(colorpaletteid_t id, int colorIdx, uint8_t rgb[3], boolean applyTexGamma); -void R_GetColorPaletteRGBf(colorpaletteid_t id, int colorIdx, float rgb[3], boolean applyTexGamma); - - #ifdef __cplusplus } // extern "C" #endif diff --git a/doomsday/engine/engine.pro b/doomsday/engine/engine.pro index 7d85ba97bc..870e909a06 100644 --- a/doomsday/engine/engine.pro +++ b/doomsday/engine/engine.pro @@ -97,6 +97,7 @@ DENG_API_HEADERS = \ api/api_player.h \ api/api_plugin.h \ api/api_render.h \ + api/api_resource.h \ api/api_resourceclass.h \ api/api_sound.h \ api/api_svg.h \ @@ -426,7 +427,7 @@ deng_nodisplaymode { # Platform-independent sources. SOURCES += \ src/api_material.cpp \ - src/render/api_render.c \ + src/api_uri.cpp \ src/audio/audiodriver.cpp \ src/audio/audiodriver_music.c \ src/audio/m_mus2midi.c \ @@ -544,6 +545,7 @@ SOURCES += \ src/network/sys_network.c \ src/network/ui_mpi.c \ src/r_util.c \ + src/render/api_render.c \ src/render/lumobj.cpp \ src/render/r_draw.cpp \ src/render/r_fakeradio.c \ @@ -570,6 +572,7 @@ SOURCES += \ src/render/vignette.c \ src/render/vlight.cpp \ src/resource/animgroups.cpp \ + src/resource/api_resource.c \ src/resource/bitmapfont.cpp \ src/resource/colorpalette.c \ src/resource/colorpalettes.cpp \ @@ -634,8 +637,7 @@ SOURCES += \ src/updater/updaterdialog.cpp \ src/updater/updatersettings.cpp \ src/updater/updatersettingsdialog.cpp \ - src/uri.cpp \ - src/uri_wrapper.cpp + src/uri.cpp !deng_nosdlmixer:!deng_nosdl { HEADERS += include/audio/sys_audiod_sdlmixer.h diff --git a/doomsday/engine/include/de_resource.h b/doomsday/engine/include/de_resource.h index 287c525297..78f2b88f7a 100644 --- a/doomsday/engine/include/de_resource.h +++ b/doomsday/engine/include/de_resource.h @@ -46,4 +46,6 @@ # include "resource/zip.h" #endif +#include "api_resource.h" + #endif /* LIBDENG_RESOURCE_SUBSYSTEM_H */ diff --git a/doomsday/engine/include/resource/animgroups.h b/doomsday/engine/include/resource/animgroups.h index f330b6b0d9..8adb798b0d 100644 --- a/doomsday/engine/include/resource/animgroups.h +++ b/doomsday/engine/include/resource/animgroups.h @@ -60,22 +60,6 @@ void R_ClearAnimGroups(void); /// @return AnimGroup associated with @a animGroupNum else @c NULL animgroup_t const *R_ToAnimGroup(int animGroupNum); -/** - * Create a new animation group. - * @return Logical (unique) identifier reference associated with the new group. - */ -int R_CreateAnimGroup(int flags); - -/** - * Append a new @a texture frame to the identified @a animGroupNum. - * - * @param animGroupNum Logical identifier reference to the group being modified. - * @param texture Texture frame to be inserted into the group. - * @param tics Base duration of the new frame in tics. - * @param randomTics Extra frame duration in tics (randomized on each cycle). - */ -void R_AddAnimGroupFrame(int animGroupNum, Uri const *texture, int tics, int randomTics); - /// @return @c true iff @a texture is linked to the identified @a animGroupNum. boolean R_IsTextureInAnimGroup(Uri const *texture, int animGroupNum); diff --git a/doomsday/engine/include/resource/colorpalettes.h b/doomsday/engine/include/resource/colorpalettes.h index ac46fecd1d..92117fd8fb 100644 --- a/doomsday/engine/include/resource/colorpalettes.h +++ b/doomsday/engine/include/resource/colorpalettes.h @@ -59,70 +59,6 @@ colorpalette_t *R_ToColorPalette(colorpaletteid_t id); */ colorpalette_t *R_GetColorPaletteByIndex(int paletteIdx); -/** - * Add a new (named) color palette. - * @note Part of the Doomsday public API. - * - * The idea with the two-teered implementation is to allow maximum flexibility. - * Within the engine we can create new palettes and manipulate them directly - * via the DGL interface. The underlying implementation is wrapped in a similar - * way to the materials so that publically, there is a set of (eternal) names - * and unique identifiers that survive game and GL resets. - * - * @param fmt Format string describes the format of @p data. - * Expected form: "C#C#C" - * C = color component, one of R, G, B. - * # = bits per component. - * - * @param name Unique name by which the palette will be known. - * @param colorData Color component triplets (at least @a colorCount * 3 values). - * @param colorCount Number of colors. - * - * @return Color palette id. - */ -colorpaletteid_t R_CreateColorPalette(char const *fmt, char const *name, - uint8_t const *colorData, int colorCount); - -/** - * Given a color palette id, look up the specified unique name. - * @note Part of the Doomsday public API. - * - * @param id Id of the color palette to locate. - * @return Pointer to the unique name associated with the specified id else @c NULL - */ -char const *R_GetColorPaletteNameForNum(colorpaletteid_t id); - -/** - * Given a color palette name, look up the associated identifier. - * @note Part of the Doomsday public API. - * - * @param name Unique name of the palette to locate. - * @return Identifier of the palette associated with this name, else @c 0 - */ -colorpaletteid_t R_GetColorPaletteNumForName(char const *name); - -/** - * Given a color palette index, calculate the equivalent RGB color. - * @note Part of the Doomsday public API. - * - * @param id Id of the ColorPalette to use. - * @param colorIdx ColorPalette color index. - * @param rgb Final color will be written back here. - * @param correctGamma @c true= the texture gamma ramp should be applied. - */ -void R_GetColorPaletteRGBubv(colorpaletteid_t id, int colorIdx, uint8_t rgb[3], boolean correctGamma); - -/** - * Given a color palette index, calculate the equivalent RGB color. - * @note Part of the Doomsday public API. - * - * @param id Id of the ColorPalette to use. - * @param colorIdx ColorPalette color index. - * @param rgb Final color will be written back here. - * @param correctGamma @c true= the texture gamma ramp should be applied. - */ -void R_GetColorPaletteRGBf(colorpaletteid_t id, int colorIdx, float rgb[3], boolean correctGamma); - /** * Change the default color palette. * diff --git a/doomsday/engine/include/resource/r_data.h b/doomsday/engine/include/resource/r_data.h index e9db9b7eaf..d1015cd675 100644 --- a/doomsday/engine/include/resource/r_data.h +++ b/doomsday/engine/include/resource/r_data.h @@ -67,22 +67,6 @@ void R_InitCompositeTextures(void); void R_InitFlatTextures(void); void R_InitSpriteTextures(void); -patchid_t R_DeclarePatch(char const *name); - -/** - * Retrieve extended info for the patch associated with @a id. - * @param id Unique identifier of the patch to lookup. - * @param info Extend info will be written here if found. - * @return @c true= Extended info for this patch was found. - */ -boolean R_GetPatchInfo(patchid_t id, patchinfo_t *info); - -/// @return Uri for the patch associated with @a id. Should be released with Uri_Delete() -Uri *R_ComposePatchUri(patchid_t id); - -/// @return Path for the patch associated with @a id. A zero-length string is -/// returned if the id is invalid/unknown. -AutoStr *R_ComposePatchPath(patchid_t id); #ifdef __cplusplus } // extern "C" #endif diff --git a/doomsday/engine/include/resource/textures.h b/doomsday/engine/include/resource/textures.h index b9b0ceba63..4013222952 100644 --- a/doomsday/engine/include/resource/textures.h +++ b/doomsday/engine/include/resource/textures.h @@ -277,9 +277,6 @@ void Textures_Init(void); /// Shutdown this module. void Textures_Shutdown(void); -int Textures_UniqueId2(Uri const *uri, boolean quiet); -int Textures_UniqueId(Uri const *uri/*, quiet = false */); - #ifdef __cplusplus } // extern "C" #endif diff --git a/doomsday/engine/src/uri_wrapper.cpp b/doomsday/engine/src/api_uri.cpp similarity index 98% rename from doomsday/engine/src/uri_wrapper.cpp rename to doomsday/engine/src/api_uri.cpp index 848ca736c6..4d271d5384 100644 --- a/doomsday/engine/src/uri_wrapper.cpp +++ b/doomsday/engine/src/api_uri.cpp @@ -1,6 +1,6 @@ /** - * @file uri_wrapper.cpp - * Universal Resource Identifier (C wrapper). @ingroup base + * @file api_uri.cpp + * Universal Resource Identifier (public C wrapper). @ingroup base * * @author Copyright © 2010-2012 Daniel Swanson * @author Copyright © 2010-2012 Jaakko Keränen diff --git a/doomsday/engine/src/library.cpp b/doomsday/engine/src/library.cpp index 410b0be832..51016df124 100644 --- a/doomsday/engine/src/library.cpp +++ b/doomsday/engine/src/library.cpp @@ -35,6 +35,7 @@ #include "api_materialarchive.h" #include "api_map.h" #include "api_mapedit.h" +#include "api_resource.h" #include "api_sound.h" #include "api_fontrender.h" #include "api_svg.h" @@ -198,6 +199,7 @@ void Library_PublishAPIs(Library *lib) PUBLISH(_api_MaterialArchive); PUBLISH(_api_Player); PUBLISH(_api_Plug); + PUBLISH(_api_R); PUBLISH(_api_S); PUBLISH(_api_Thinker); PUBLISH(_api_Uri); diff --git a/doomsday/engine/src/resource/animgroups.cpp b/doomsday/engine/src/resource/animgroups.cpp index b208fb07b9..53768fb405 100644 --- a/doomsday/engine/src/resource/animgroups.cpp +++ b/doomsday/engine/src/resource/animgroups.cpp @@ -73,8 +73,8 @@ int R_AnimGroupCount() return numgroups; } -/// @note Part of the Doomsday public API. -int R_CreateAnimGroup(int flags) +#undef R_CreateAnimGroup +DENG_EXTERN_C int R_CreateAnimGroup(int flags) { // Allocating one by one is inefficient but it doesn't really matter. groups = (animgroup_t *) Z_Realloc(groups, sizeof(*groups) * ++numgroups, PU_APPSTATIC); @@ -90,8 +90,8 @@ int R_CreateAnimGroup(int flags) return group->id; } -/// @note Part of the Doomsday public API. -void R_AddAnimGroupFrame(int groupNum, uri_s const *textureUri, int tics, int randomTics) +#undef R_AddAnimGroupFrame +DENG_EXTERN_C void R_AddAnimGroupFrame(int groupNum, uri_s const *textureUri, int tics, int randomTics) { LOG_AS("R_AddAnimGroupFrame"); diff --git a/doomsday/engine/src/resource/api_resource.c b/doomsday/engine/src/resource/api_resource.c new file mode 100644 index 0000000000..fcb88e276f --- /dev/null +++ b/doomsday/engine/src/resource/api_resource.c @@ -0,0 +1,42 @@ +#define DENG_NO_API_MACROS_RESOURCE +#include "api_resource.h" + +// animgroups.cpp +DENG_EXTERN_C int R_CreateAnimGroup(int flags); +DENG_EXTERN_C void R_AddAnimGroupFrame(int animGroupNum, Uri const *texture, int tics, int randomTics); + +// colorpalettes.cpp +DENG_EXTERN_C colorpaletteid_t R_CreateColorPalette(char const *fmt, char const *name, uint8_t const *colorData, int colorCount); +DENG_EXTERN_C char const *R_GetColorPaletteNameForNum(colorpaletteid_t id); +DENG_EXTERN_C colorpaletteid_t R_GetColorPaletteNumForName(char const *name); +DENG_EXTERN_C void R_GetColorPaletteRGBubv(colorpaletteid_t id, int colorIdx, uint8_t rgb[3], boolean correctGamma); +DENG_EXTERN_C void R_GetColorPaletteRGBf(colorpaletteid_t id, int colorIdx, float rgb[3], boolean correctGamma); + +// r_data.cpp +DENG_EXTERN_C patchid_t R_DeclarePatch(char const *name); +DENG_EXTERN_C boolean R_GetPatchInfo(patchid_t id, patchinfo_t *info); +DENG_EXTERN_C struct uri_s *R_ComposePatchUri(patchid_t id); +DENG_EXTERN_C AutoStr *R_ComposePatchPath(patchid_t id); + +// textures.cpp +DENG_EXTERN_C int Textures_UniqueId2(Uri const *uri, boolean quiet); +DENG_EXTERN_C int Textures_UniqueId(Uri const *uri/*, quiet = false */); + +DENG_DECLARE_API(R) = +{ + { DE_API_RESOURCE }, + R_DeclarePatch, + R_GetPatchInfo, + R_ComposePatchUri, + R_ComposePatchPath, + R_CreateAnimGroup, + R_AddAnimGroupFrame, + R_CreateColorPalette, + R_GetColorPaletteNumForName, + R_GetColorPaletteNameForNum, + R_GetColorPaletteRGBf, + R_GetColorPaletteRGBubv, + Textures_UniqueId, + Textures_UniqueId2, +}; + diff --git a/doomsday/engine/src/resource/colorpalettes.cpp b/doomsday/engine/src/resource/colorpalettes.cpp index d2b5da8fed..9c6460e3b0 100644 --- a/doomsday/engine/src/resource/colorpalettes.cpp +++ b/doomsday/engine/src/resource/colorpalettes.cpp @@ -184,7 +184,8 @@ boolean R_SetDefaultColorPalette(colorpaletteid_t id) return false; } -colorpaletteid_t R_CreateColorPalette(char const* fmt, char const* name, +#undef R_CreateColorPalette +DENG_EXTERN_C colorpaletteid_t R_CreateColorPalette(char const* fmt, char const* name, uint8_t const* colorData, int colorCount) { static char const* compNames[] = { "red", "green", "blue" }; @@ -306,7 +307,8 @@ colorpaletteid_t R_CreateColorPalette(char const* fmt, char const* name, return id; // 1-based index. } -colorpaletteid_t R_GetColorPaletteNumForName(char const* name) +#undef R_GetColorPaletteNumForName +DENG_EXTERN_C colorpaletteid_t R_GetColorPaletteNumForName(char const* name) { if(!initedColorPalettes) Con_Error("R_GetColorPaletteNumForName: Color palettes not yet initialized."); @@ -317,7 +319,8 @@ colorpaletteid_t R_GetColorPaletteNumForName(char const* name) return 0; } -char const* R_GetColorPaletteNameForNum(colorpaletteid_t id) +#undef R_GetColorPaletteNameForNum +DENG_EXTERN_C char const* R_GetColorPaletteNameForNum(colorpaletteid_t id) { if(!initedColorPalettes) Con_Error("R_GetColorPaletteNameForNum: Color palettes not yet initialized."); @@ -328,7 +331,8 @@ char const* R_GetColorPaletteNameForNum(colorpaletteid_t id) return NULL; } -void R_GetColorPaletteRGBubv(colorpaletteid_t paletteId, int colorIdx, uint8_t rgb[3], +#undef R_GetColorPaletteRGBubv +DENG_EXTERN_C void R_GetColorPaletteRGBubv(colorpaletteid_t paletteId, int colorIdx, uint8_t rgb[3], boolean applyTexGamma) { if(!initedColorPalettes) @@ -358,7 +362,8 @@ void R_GetColorPaletteRGBubv(colorpaletteid_t paletteId, int colorIdx, uint8_t r Con_Message("Warning:R_GetColorPaletteRGBubv: Failed to locate ColorPalette for id %i.\n", paletteId); } -void R_GetColorPaletteRGBf(colorpaletteid_t paletteId, int colorIdx, float rgb[3], +#undef R_GetColorPaletteRGBf +DENG_EXTERN_C void R_GetColorPaletteRGBf(colorpaletteid_t paletteId, int colorIdx, float rgb[3], boolean applyTexGamma) { if(!initedColorPalettes) diff --git a/doomsday/engine/src/resource/r_data.cpp b/doomsday/engine/src/resource/r_data.cpp index b8a8a44a3e..ecbe45a14b 100644 --- a/doomsday/engine/src/resource/r_data.cpp +++ b/doomsday/engine/src/resource/r_data.cpp @@ -102,8 +102,8 @@ void R_InitSystemTextures() App_Textures()->iterateDeclared("System", defineTextureWorker); } -/// @note Part of the Doomsday public API. -AutoStr *R_ComposePatchPath(patchid_t id) +#undef R_ComposePatchPath +DENG_EXTERN_C AutoStr *R_ComposePatchPath(patchid_t id) { try { @@ -118,8 +118,8 @@ AutoStr *R_ComposePatchPath(patchid_t id) return AutoStr_NewStd(); } -/// @note Part of the Doomsday public API. -uri_s *R_ComposePatchUri(patchid_t id) +#undef R_ComposePatchUri +DENG_EXTERN_C uri_s *R_ComposePatchUri(patchid_t id) { try { @@ -134,8 +134,8 @@ uri_s *R_ComposePatchUri(patchid_t id) return reinterpret_cast(new de::Uri()); } -/// @note Part of the Doomsday public API. -patchid_t R_DeclarePatch(char const *name) +#undef R_DeclarePatch +DENG_EXTERN_C patchid_t R_DeclarePatch(char const *name) { LOG_AS("R_DeclarePatch"); @@ -215,7 +215,8 @@ patchid_t R_DeclarePatch(char const *name) return uniqueId; } -boolean R_GetPatchInfo(patchid_t id, patchinfo_t *info) +#undef R_GetPatchInfo +DENG_EXTERN_C boolean R_GetPatchInfo(patchid_t id, patchinfo_t *info) { LOG_AS("R_GetPatchInfo"); if(!info) LegacyCore_FatalError("R_GetPatchInfo: Argument 'info' cannot be NULL."); diff --git a/doomsday/engine/src/resource/textures.cpp b/doomsday/engine/src/resource/textures.cpp index 19c15460b4..419c83781e 100644 --- a/doomsday/engine/src/resource/textures.cpp +++ b/doomsday/engine/src/resource/textures.cpp @@ -713,8 +713,8 @@ void Textures_Shutdown(void) delete textures; textures = 0; } -/// @note Part of the Doomsday public API. -int Textures_UniqueId2(Uri const *_uri, boolean quiet) +#undef Textures_UniqueId2 +DENG_EXTERN_C int Textures_UniqueId2(Uri const *_uri, boolean quiet) { LOG_AS("Textures_UniqueId"); if(!_uri) return -1; @@ -736,8 +736,8 @@ int Textures_UniqueId2(Uri const *_uri, boolean quiet) return -1; } -/// @note Part of the Doomsday public API. -int Textures_UniqueId(Uri const *uri) +#undef Textures_UniqueId +DENG_EXTERN_C int Textures_UniqueId(Uri const *uri) { return Textures_UniqueId2(uri, false); } diff --git a/doomsday/plugins/jdoom/include/d_api.h b/doomsday/plugins/jdoom/include/d_api.h index a7b5be6e4b..278e264359 100644 --- a/doomsday/plugins/jdoom/include/d_api.h +++ b/doomsday/plugins/jdoom/include/d_api.h @@ -59,6 +59,7 @@ DENG_USING_API(MaterialArchive); DENG_USING_API(MPE); DENG_USING_API(Player); DENG_USING_API(Plug); +DENG_USING_API(R); DENG_USING_API(Rend); DENG_USING_API(S); DENG_USING_API(Server); diff --git a/doomsday/plugins/jdoom/src/d_api.c b/doomsday/plugins/jdoom/src/d_api.c index 0a0893a9ca..366efcca6b 100644 --- a/doomsday/plugins/jdoom/src/d_api.c +++ b/doomsday/plugins/jdoom/src/d_api.c @@ -295,6 +295,7 @@ DENG_DECLARE_API(Map); DENG_DECLARE_API(MPE); DENG_DECLARE_API(Player); DENG_DECLARE_API(Plug); +DENG_DECLARE_API(R); DENG_DECLARE_API(Rend); DENG_DECLARE_API(S); DENG_DECLARE_API(Server); @@ -320,6 +321,7 @@ DENG_API_EXCHANGE( DENG_GET_API(DE_API_MAP_EDIT, MPE); DENG_GET_API(DE_API_PLAYER, Player); DENG_GET_API(DE_API_PLUGIN, Plug); + DENG_GET_API(DE_API_RESOURCE, R); DENG_GET_API(DE_API_RENDER, Rend); DENG_GET_API(DE_API_SOUND, S); DENG_GET_API(DE_API_SERVER, Server); diff --git a/doomsday/server/server.pro b/doomsday/server/server.pro index d80e5feb76..836717987c 100644 --- a/doomsday/server/server.pro +++ b/doomsday/server/server.pro @@ -90,6 +90,7 @@ DENG_API_HEADERS = \ $$SRC/api/api_player.h \ $$SRC/api/api_plugin.h \ $$SRC/api/api_render.h \ + $$SRC/api/api_resource.h \ $$SRC/api/api_resourceclass.h \ $$SRC/api/api_server.h \ $$SRC/api/api_sound.h \ @@ -335,6 +336,7 @@ SOURCES += $$SRC/src/ui/displaymode_dummy.c SOURCES += \ src/server_dummies.c \ $$SRC/src/api_material.cpp \ + $$SRC/src/api_uri.cpp \ $$SRC/src/audio/s_cache.c \ $$SRC/src/audio/s_environ.cpp \ $$SRC/src/audio/s_logic.c \ @@ -428,6 +430,7 @@ SOURCES += \ $$SRC/src/render/r_things.cpp \ $$SRC/src/render/rend_main.cpp \ $$SRC/src/resource/animgroups.cpp \ + $$SRC/src/resource/api_resource.c \ $$SRC/src/resource/colorpalette.c \ $$SRC/src/resource/colorpalettes.cpp \ $$SRC/src/resource/compositetexture.cpp \ @@ -476,8 +479,7 @@ SOURCES += \ $$SRC/src/ui/sys_input.c \ $$SRC/src/ui/ui2_main.cpp \ $$SRC/src/ui/window.cpp \ - $$SRC/src/uri.cpp \ - $$SRC/src/uri_wrapper.cpp + $$SRC/src/uri.cpp OTHER_FILES += \ data/cphelp.txt \