diff --git a/doomsday/client/include/map/r_world.h b/doomsday/client/include/map/r_world.h index 1efe2e6679..3f341129a2 100644 --- a/doomsday/client/include/map/r_world.h +++ b/doomsday/client/include/map/r_world.h @@ -132,6 +132,7 @@ coord_t R_OpenRange(Sector const* frontSec, Sector const* backSec, coord_t* retB /// height coordinates rather than the "sharp" coordinates. coord_t R_VisOpenRange(Sector const* frontSec, Sector const* backSec, coord_t* retBottom, coord_t* retTop); +#ifdef __CLIENT__ /** * @param lineFlags @ref ldefFlags. * @param frontSec Sector in front of the wall. @@ -154,6 +155,7 @@ boolean R_MiddleMaterialCoversOpening(int lineFlags, Sector* frontSec, Sector* b * hedges instead). */ boolean R_MiddleMaterialCoversLineOpening(LineDef* line, int side, boolean ignoreOpacity); +#endif // __CLIENT__ Plane* R_NewPlaneForSector(Sector* sec); void R_DestroyPlaneOfSector(uint id, Sector* sec); @@ -189,6 +191,7 @@ float R_GlowStrength(const Plane* pln); lineowner_t* R_GetVtxLineOwner(const Vertex* vtx, const LineDef* line); +#ifdef __CLIENT__ /** * A neighbour is a line that shares a vertex with 'line', and faces the * specified sector. @@ -214,6 +217,7 @@ LineDef* R_FindLineAlignNeighbor(const Sector* sec, const LineDef* line, */ LineDef* R_FindLineBackNeighbor(const Sector* sector, const LineDef* line, const lineowner_t* own, boolean antiClockwise, binangle_t* diff); +#endif // __CLIENT__ /** * @defgroup skyCapFlags Sky Cap Flags diff --git a/doomsday/client/include/render/rend_main.h b/doomsday/client/include/render/rend_main.h index b0d22555ab..6d493acf44 100644 --- a/doomsday/client/include/render/rend_main.h +++ b/doomsday/client/include/render/rend_main.h @@ -104,7 +104,10 @@ void R_DrawLightRange(void); #ifdef __cplusplus } // extern "C" +#ifdef __CLIENT__ de::MaterialVariantSpec const &Rend_MapSurfaceMaterialSpec(); #endif -#endif /* LIBDENG_REND_MAIN_H */ +#endif // __cplusplus + +#endif // LIBDENG_REND_MAIN_H diff --git a/doomsday/client/include/resource/materials.h b/doomsday/client/include/resource/materials.h index 5e50ecff54..9fc4b9f38a 100644 --- a/doomsday/client/include/resource/materials.h +++ b/doomsday/client/include/resource/materials.h @@ -337,6 +337,7 @@ class Materials /// Empty the Material cache queue, cancelling all outstanding tasks. void purgeCacheQueue(); +#ifdef __CLIENT__ /** * Prepare a material variant specification in accordance to the specified * usage context. If incomplete context information is supplied, suitable @@ -363,6 +364,7 @@ class Materials int flags, byte border, int tClass, int tMap, int wrapS, int wrapT, int minFilter, int magFilter, int anisoFilter, bool mipmapped, bool gammaCorrection, bool noStretch, bool toAlpha); +#endif private: struct Instance; diff --git a/doomsday/client/include/resource/texture.h b/doomsday/client/include/resource/texture.h index 75c5d9a284..b84293319f 100644 --- a/doomsday/client/include/resource/texture.h +++ b/doomsday/client/include/resource/texture.h @@ -150,11 +150,13 @@ class Texture /// Returns @c true if the variant is flagged as "masked". inline bool isMasked() const { return flags().testFlag(Masked); } +#ifdef __CLIENT__ /// Returns @c true if the variant is flagged as "uploaded". inline bool isUploaded() const { return flags().testFlag(Uploaded); } /// Returns @c true if the variant is "prepared". inline bool isPrepared() const { return isUploaded() && glName() != 0; } +#endif /** * Returns the flags for the variant. @@ -169,9 +171,21 @@ class Texture */ void setFlags(Flags flagsToChange, bool set = true); +#ifdef __CLIENT__ + /** + * Returns the GL-name of the uploaded texture content for the variant; + * otherwise @c 0 (not uploaded). + */ uint glName() const; - void setGLName(uint glName); + /** + * Change the GL-name of the uploaded texture content associated with + * the variant. + * + * @param newGLName New GL-name. Can be @c 0. + */ + void setGLName(uint newGLName); +#endif friend class Texture; friend struct Texture::Instance; diff --git a/doomsday/client/src/dd_main.cpp b/doomsday/client/src/dd_main.cpp index c0d7064589..4fed361a19 100644 --- a/doomsday/client/src/dd_main.cpp +++ b/doomsday/client/src/dd_main.cpp @@ -575,7 +575,9 @@ void DD_ClearRuntimeTextureSchemes() textures.scheme("Lightmaps").clear(); textures.scheme("Flaremaps").clear(); +#ifdef __CLIENT__ GL_PruneTextureVariantSpecifications(); +#endif } void DD_ClearSystemTextureSchemes() @@ -583,7 +585,10 @@ void DD_ClearSystemTextureSchemes() Textures &textures = App_Textures(); textures.scheme("System").clear(); + +#ifdef __CLIENT__ GL_PruneTextureVariantSpecifications(); +#endif } Materials &App_Materials() @@ -2377,6 +2382,7 @@ ddvalue_t ddValues[DD_LAST_VALUE - DD_FIRST_VALUE - 1] = { /** * Get a 32-bit signed integer value. */ +#undef DD_GetInteger int DD_GetInteger(int ddvalue) { switch(ddvalue) @@ -2393,26 +2399,24 @@ int DD_GetInteger(int ddvalue) case DD_CURRENT_CLIENT_FINALE_ID: return Cl_CurrentFinale(); -#endif case DD_DYNLIGHT_TEXTURE: return (int) GL_PrepareLSTexture(LST_DYNAMIC); +#endif case DD_NUMLUMPS: return F_LumpCount(); case DD_MAP_MUSIC: { - GameMap* map = theMap; - if(map) + if(GameMap *map = theMap) { - ded_mapinfo_t* mapInfo = Def_GetMapInfo(GameMap_Uri(map)); - if(mapInfo) + if(ded_mapinfo_t *mapInfo = Def_GetMapInfo(GameMap_Uri(map))) { return Def_GetMusicNum(mapInfo->music); } } - return -1; - } + return -1; } + default: break; } @@ -2426,6 +2430,7 @@ int DD_GetInteger(int ddvalue) /** * Set a 32-bit signed integer value. */ +#undef DD_SetInteger void DD_SetInteger(int ddvalue, int parm) { if(ddvalue <= DD_FIRST_VALUE || ddvalue >= DD_LAST_VALUE) diff --git a/doomsday/client/src/map/linedef.cpp b/doomsday/client/src/map/linedef.cpp index 0f94691bc4..f7aaea3bad 100644 --- a/doomsday/client/src/map/linedef.cpp +++ b/doomsday/client/src/map/linedef.cpp @@ -32,6 +32,7 @@ #include #include +#ifdef __CLIENT__ static void calcNormal(const LineDef* l, byte side, pvec2f_t normal) { V2f_Set(normal, (l->L_vorigin(side^1)[VY] - l->L_vorigin(side) [VY]) / l->length, @@ -74,16 +75,17 @@ static boolean backClosedForBlendNeighbor(LineDef* lineDef, int side, boolean ig return R_MiddleMaterialCoversLineOpening(lineDef, side, ignoreOpacity); } -static LineDef* findBlendNeighbor(LineDef* l, byte side, byte right, - binangle_t* diff) +static LineDef *findBlendNeighbor(LineDef *l, byte side, byte right, + binangle_t *diff) { - const lineowner_t* farVertOwner = l->L_vo(right^side); + lineowner_t const *farVertOwner = l->L_vo(right^side); if(backClosedForBlendNeighbor(l, side, true/*ignore opacity*/)) { return R_FindSolidLineNeighbor(l->L_sector(side), l, farVertOwner, right, diff); } return R_FindLineNeighbor(l->L_sector(side), l, farVertOwner, right, diff); } +#endif // __CLIENT__ #undef LineDef_PointDistance DENG_EXTERN_C coord_t LineDef_PointDistance(LineDef* line, coord_t const point[2], coord_t* offset) @@ -255,16 +257,9 @@ void LineDef_UpdateAABox(LineDef* line) line->aaBox.maxY = MAX_OF(line->L_v2origin[VY], line->L_v1origin[VY]); } -/** - * @todo Now that we store surface tangent space normals use those rather than angles. - */ -void LineDef_LightLevelDelta(LineDef* l, int side, float* deltaL, float* deltaR) +void LineDef_LightLevelDelta(LineDef *l, int side, float* deltaL, float* deltaR) { - binangle_t diff; - LineDef* other; - vec2f_t normal; - float delta; - +#ifdef __CLIENT__ // Disabled? if(!(rendLightWallAngle > 0)) { @@ -272,8 +267,9 @@ void LineDef_LightLevelDelta(LineDef* l, int side, float* deltaL, float* deltaR) return; } + vec2f_t normal; calcNormal(l, side, normal); - delta = lightLevelDelta(normal); + float delta = lightLevelDelta(normal); // If smoothing is disabled use this delta for left and right edges. // Must forcibly disable smoothing for polyobj linedefs as they have @@ -288,8 +284,8 @@ void LineDef_LightLevelDelta(LineDef* l, int side, float* deltaL, float* deltaR) // lightlevel delta and then blend with this to produce the value for // the left edge. Blend iff the angle between the two linedefs is less // than 45 degrees. - diff = 0; - other = findBlendNeighbor(l, side, 0, &diff); + binangle_t diff = 0; + LineDef *other = findBlendNeighbor(l, side, 0, &diff); if(other && INRANGE_OF(diff, BANG_180, BANG_45)) { vec2f_t otherNormal; @@ -324,6 +320,12 @@ void LineDef_LightLevelDelta(LineDef* l, int side, float* deltaL, float* deltaR) { *deltaR = delta; } +#else // !__CLIENT__ + DENG2_UNUSED2(l, side); + + if(deltaL) *deltaL = 0; + if(deltaR) *deltaR = 0; +#endif } int LineDef_SetProperty(LineDef* lin, const setargs_t* args) diff --git a/doomsday/client/src/map/r_world.cpp b/doomsday/client/src/map/r_world.cpp index e6d79a6156..db1a5a2ef1 100644 --- a/doomsday/client/src/map/r_world.cpp +++ b/doomsday/client/src/map/r_world.cpp @@ -789,6 +789,7 @@ coord_t R_VisOpenRange(Sector const *frontSec, Sector const *backSec, coord_t *r return top - bottom; } +#ifdef __CLIENT__ boolean R_MiddleMaterialCoversOpening(int lineFlags, Sector *frontSec, Sector *backSec, SideDef *frontDef, SideDef *backDef, boolean ignoreOpacity) { @@ -978,6 +979,7 @@ LineDef *R_FindLineAlignNeighbor(Sector const *sec, LineDef const *line, // Not suitable, try the next. return R_FindLineAlignNeighbor(sec, line, cown, antiClockwise, alignment); } +#endif // __CLIENT__ static inline void initSurfaceMaterialOffset(Surface *suf) { @@ -1255,6 +1257,8 @@ boolean R_SectorContainsSkySurfaces(Sector const *sec) return sectorContainsSkySurfaces; } +#ifdef __CLIENT__ + /** * Given a sidedef section, look at the neighbouring surfaces and pick the * best choice of material used on those surfaces to be applied to "this" @@ -1377,9 +1381,11 @@ static void addMissingMaterial(SideDef *s, SideDefSection section) << path; } } +#endif // __CLIENT__ static void R_UpdateLinedefsOfSector(Sector *sec) { +#ifdef __CLIENT__ if(!sec) return; for(uint i = 0; i < sec->lineDefCount; ++i) @@ -1400,7 +1406,6 @@ static void R_UpdateLinedefsOfSector(Sector *sec) * extend the floor/ceiling to fill the space (unless it is skymasked), * or if there is a midtexture use that instead. */ - if(backSec) { // Bottom section. @@ -1421,6 +1426,9 @@ static void R_UpdateLinedefsOfSector(Sector *sec) addMissingMaterial(front, SS_MIDDLE); } } +#else // !__CLIENT__ + DENG2_UNUSED(sec); +#endif } boolean R_UpdatePlane(Plane *pln, boolean forceUpdate) diff --git a/doomsday/client/src/render/r_things.cpp b/doomsday/client/src/render/r_things.cpp index 49e838557e..580a0d00d1 100644 --- a/doomsday/client/src/render/r_things.cpp +++ b/doomsday/client/src/render/r_things.cpp @@ -438,7 +438,7 @@ DENG_EXTERN_C boolean R_GetSpriteInfo(int sprite, int frame, spriteinfo_t *info) { // We have no information to return. LOG_WARNING("Invalid sprite frame %i.") << frame; - memset(info, 0, sizeof(*info)); + std::memset(info, 0, sizeof(*info)); return false; } spriteframe_t *sprFrame = &sprDef->spriteFrames[frame]; @@ -446,33 +446,41 @@ DENG_EXTERN_C boolean R_GetSpriteInfo(int sprite, int frame, spriteinfo_t *info) if(novideo) { // We can't prepare the material. - memset(info, 0, sizeof(*info)); + std::memset(info, 0, sizeof(*info)); info->numFrames = sprDef->numFrames; info->flip = sprFrame->flip[0]; return true; } - Material *mat = sprFrame->mats[0]; + info->material = sprFrame->mats[0]; + info->numFrames = sprDef->numFrames; + info->flip = sprFrame->flip[0]; +#ifdef __CLIENT__ /// @todo fixme: We should not be using the PSprite spec here. -ds MaterialVariantSpec const &spec = App_Materials().variantSpecForContext(MC_PSPRITE, 0, 1, 0, 0, - GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE, 0, 1, -1, - false, true, true, false); - MaterialSnapshot const &ms = mat->prepare(spec); + GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE, 0, 1, -1, + false, true, true, false); + MaterialSnapshot const &ms = info->material->prepare(spec); Texture &tex = ms.texture(MTU_PRIMARY).generalCase(); - variantspecification_t const *texSpec = TS_GENERAL(ms.texture(MTU_PRIMARY).spec()); - DENG_ASSERT(texSpec); + variantspecification_t const &texSpec = TS_GENERAL(ms.texture(MTU_PRIMARY).spec()); + + info->geometry.origin.x = -tex.origin().x() + -texSpec.border; + info->geometry.origin.y = -tex.origin().y() + texSpec.border; + info->geometry.size.width = ms.dimensions().width() + texSpec.border * 2; + info->geometry.size.height = ms.dimensions().height() + texSpec.border * 2; - info->numFrames = sprDef->numFrames; - info->material = mat; - info->flip = sprFrame->flip[0]; - info->geometry.origin.x = -tex.origin().x() + -texSpec->border; - info->geometry.origin.y = -tex.origin().y() + texSpec->border; - info->geometry.size.width = ms.dimensions().width() + texSpec->border*2; - info->geometry.size.height = ms.dimensions().height() + texSpec->border*2; ms.texture(MTU_PRIMARY).coords(&info->texCoord[0], &info->texCoord[1]); +#else + Texture &tex = *info->material->layers()[0]->stages()[0]->texture; + + info->geometry.origin.x = -tex.origin().x(); + info->geometry.origin.y = -tex.origin().y(); + info->geometry.size.width = info->material->dimensions().width(); + info->geometry.size.height = info->material->dimensions().height(); +#endif return true; } @@ -1373,8 +1381,6 @@ void R_ProjectSprite(mobj_t *mo) } } -#endif // __CLIENT__ - typedef struct { BspLeaf *bspLeaf; } addspriteparams_t; @@ -1485,6 +1491,8 @@ void R_SortVisSprites() } } +#endif // __CLIENT__ + coord_t R_GetBobOffset(mobj_t* mo) { if(mo->ddFlags & DDMF_BOB) @@ -1493,4 +1501,3 @@ coord_t R_GetBobOffset(mobj_t* mo) } return 0; } - diff --git a/doomsday/client/src/render/rend_main.cpp b/doomsday/client/src/render/rend_main.cpp index 4bbf82da97..044cb9d725 100644 --- a/doomsday/client/src/render/rend_main.cpp +++ b/doomsday/client/src/render/rend_main.cpp @@ -3960,10 +3960,10 @@ static void Rend_RenderBoundingBoxes() glEnable(GL_DEPTH_TEST); } -#endif // __CLIENT__ - MaterialVariantSpec const &Rend_MapSurfaceMaterialSpec() { return App_Materials().variantSpecForContext(MC_MAPSURFACE, 0, 0, 0, 0, GL_REPEAT, GL_REPEAT, -1, -1, -1, true, true, false, false); } + +#endif // __CLIENT__ diff --git a/doomsday/client/src/resource/colorpalettes.cpp b/doomsday/client/src/resource/colorpalettes.cpp index 11907b3d13..dca45619d9 100644 --- a/doomsday/client/src/resource/colorpalettes.cpp +++ b/doomsday/client/src/resource/colorpalettes.cpp @@ -275,28 +275,28 @@ DENG_EXTERN_C colorpaletteid_t R_CreateColorPalette(char const* fmt, char const* if(0 != (id = colorPaletteNumForName(name))) { // Replacing an existing palette. - colorpalette_t* palette; - - bind = &colorPaletteBinds[id-1]; - palette = R_GetColorPaletteByIndex(bind->idx); + bind = &colorPaletteBinds[id - 1]; + colorpalette_t *palette = R_GetColorPaletteByIndex(bind->idx); ColorPalette_ReplaceColorTable(palette, compOrder, compSize, colorData, colorCount); + +#ifdef __CLIENT__ GL_ReleaseTexturesByColorPalette(id); +#endif } else { // A new palette. - colorPaletteBinds = (ColorPaletteBind*) M_Realloc(colorPaletteBinds, (numColorPaletteBinds + 1) * sizeof(ColorPaletteBind)); - if(!colorPaletteBinds) Con_Error("R_CreateColorPalette: Failed on (re)allocation of %lu bytes for color palette bind list.", (unsigned long) ((numColorPaletteBinds + 1) * sizeof(ColorPaletteBind))); + colorPaletteBinds = (ColorPaletteBind *) M_Realloc(colorPaletteBinds, (numColorPaletteBinds + 1) * sizeof(ColorPaletteBind)); bind = &colorPaletteBinds[numColorPaletteBinds]; - memset(bind, 0, sizeof(*bind)); + std::memset(bind, 0, sizeof(*bind)); strncpy(bind->name, name, COLORPALETTENAME_MAXLEN); id = (colorpaletteid_t) ++numColorPaletteBinds; // 1-based index. - if(1 == numColorPaletteBinds) + if(numColorPaletteBinds == 1) { - defaultColorPalette = (colorpaletteid_t) numColorPaletteBinds; + defaultColorPalette = colorpaletteid_t(numColorPaletteBinds); } } diff --git a/doomsday/client/src/resource/fonts.cpp b/doomsday/client/src/resource/fonts.cpp index ec0a61b510..46f486b7b2 100644 --- a/doomsday/client/src/resource/fonts.cpp +++ b/doomsday/client/src/resource/fonts.cpp @@ -484,7 +484,9 @@ void Fonts_Clear(void) if(!Fonts_Size()) return; Fonts_ClearScheme(FS_ANY); +#ifdef __CLIENT__ GL_PruneTextureVariantSpecifications(); +#endif } void Fonts_ClearRuntime(void) @@ -492,7 +494,9 @@ void Fonts_ClearRuntime(void) if(!Fonts_Size()) return; Fonts_ClearScheme(FS_GAME); +#ifdef __CLIENT__ GL_PruneTextureVariantSpecifications(); +#endif } void Fonts_ClearSystem(void) @@ -500,7 +504,9 @@ void Fonts_ClearSystem(void) if(!Fonts_Size()) return; Fonts_ClearScheme(FS_SYSTEM); +#ifdef __CLIENT__ GL_PruneTextureVariantSpecifications(); +#endif } static int destroyFontAndRecordWorker(FontRepository::Node& node, void* /*parameters*/) diff --git a/doomsday/client/src/resource/materials.cpp b/doomsday/client/src/resource/materials.cpp index 3ca74dc1e9..a0b51b73f0 100644 --- a/doomsday/client/src/resource/materials.cpp +++ b/doomsday/client/src/resource/materials.cpp @@ -138,11 +138,13 @@ DENG2_PIMPL(Materials) Materials::Schemes schemes; QList schemeCreationOrder; +#ifdef __CLIENT__ /// Material variant specifications. VariantSpecs variantSpecs; /// Queue of variant cache tasks. VariantCacheQueue variantCacheQueue; +#endif /// All material instances in the system (from all schemes). Materials::All materials; @@ -169,14 +171,19 @@ DENG2_PIMPL(Materials) clearGroups(); clearManifests(); clearMaterials(); + +#ifdef __CLIENT__ clearVariantSpecs(); +#endif } +#ifdef __CLIENT__ void clearVariantSpecs() { qDeleteAll(variantSpecs); variantSpecs.clear(); } +#endif void clearMaterials() { @@ -205,6 +212,7 @@ DENG2_PIMPL(Materials) groups.clear(); } +#ifdef __CLIENT__ Materials::VariantSpec *findVariantSpec(Materials::VariantSpec const &tpl, bool canCreate) { @@ -250,6 +258,7 @@ DENG2_PIMPL(Materials) applyVariantSpec(tpl, mc, primarySpec); return *findVariantSpec(tpl, true); } +#endif }; void Materials::consoleRegister() @@ -317,12 +326,15 @@ Materials::Schemes const& Materials::allSchemes() const void Materials::purgeCacheQueue() { +#ifdef __CLIENT__ qDeleteAll(d->variantCacheQueue); d->variantCacheQueue.clear(); +#endif } void Materials::processCacheQueue() { +#ifdef __CLIENT__ while(!d->variantCacheQueue.isEmpty()) { QScopedPointer task(d->variantCacheQueue.takeFirst()); @@ -330,6 +342,7 @@ void Materials::processCacheQueue() /// @todo $revise-texture-animation: prepare all textures in the animation (if animated). task->material->prepare(*task->spec); } +#endif } Materials::Manifest &Materials::toManifest(materialid_t id) const @@ -567,6 +580,7 @@ Material *Materials::newFromDef(ded_material_t &def) void Materials::cache(Material &material, MaterialVariantSpec const &spec, bool cacheGroups) { +#ifdef __CLIENT__ // Already in the queue? DENG2_FOR_EACH_CONST(VariantCacheQueue, i, d->variantCacheQueue) { @@ -594,8 +608,12 @@ void Materials::cache(Material &material, MaterialVariantSpec const &spec, cache(manifest->material(), spec, false /* do not cache groups */); } } +#else + DENG2_UNUSED3(material, spec, cacheGroups); +#endif } +#ifdef __CLIENT__ MaterialVariantSpec const &Materials::variantSpecForContext( materialcontext_t mc, int flags, byte border, int tClass, int tMap, int wrapS, int wrapT, int minFilter, int magFilter, int anisoFilter, @@ -605,6 +623,7 @@ MaterialVariantSpec const &Materials::variantSpecForContext( minFilter, magFilter, anisoFilter, mipmapped, gammaCorrection, noStretch, toAlpha); } +#endif Materials::ManifestGroup &Materials::createGroup() { diff --git a/doomsday/client/src/resource/texture.cpp b/doomsday/client/src/resource/texture.cpp index 6990d8e3b9..b152bae122 100644 --- a/doomsday/client/src/resource/texture.cpp +++ b/doomsday/client/src/resource/texture.cpp @@ -72,7 +72,9 @@ Texture::Texture(TextureManifest &manifest) : d(new Instance(*this, manifest)) Texture::~Texture() { - GL_ReleaseGLTexturesByTexture(reinterpret_cast(this)); +#ifdef __CLIENT__ + GL_ReleaseGLTexturesByTexture(*this); +#endif if(!manifest().schemeName().compareWithoutCase("Textures")) { @@ -192,14 +194,14 @@ void Texture::clearVariants() while(!d->variants.isEmpty()) { Texture::Variant *variant = d->variants.takeFirst(); -#if _DEBUG - uint glName = variant->glName(); - if(glName) +#if defined(__CLIENT__) && defined(_DEBUG) + if(variant->glName()) { LOG_AS("Texture::clearVariants") LOG_WARNING("GLName (%i) still set for a variant of \"%s\" [%p]. Perhaps it wasn't released?") - << glName << d->manifest.composeUri() << de::dintptr(this); - GL_PrintTextureVariantSpecification(&variant->spec()); + << variant->glName() << d->manifest.composeUri() << de::dintptr(this); + + GL_PrintTextureVariantSpecification(variant->spec()); } #endif delete variant; diff --git a/doomsday/client/src/resource/textures.cpp b/doomsday/client/src/resource/textures.cpp index 24c4c4b9cc..0add023e3c 100644 --- a/doomsday/client/src/resource/textures.cpp +++ b/doomsday/client/src/resource/textures.cpp @@ -319,8 +319,10 @@ TextureManifest *Textures::declare(Uri const &uri, de::Texture::Flags flags, if(mustRelease && manifest->hasTexture()) { +#ifdef __CLIENT__ /// @todo Update any Materials (and thus Surfaces) which reference this. - GL_ReleaseGLTexturesByTexture(reinterpret_cast(&manifest->texture())); + GL_ReleaseGLTexturesByTexture(manifest->texture()); +#endif } return manifest; @@ -392,19 +394,22 @@ int Textures::iterateDeclared(String nameOfScheme, return 0; } -static void printVariantInfo(Texture::Variant &variant) +#ifdef __CLIENT__ +static void printVariantInfo(TextureVariant &variant) { float s, t; variant.coords(&s, &t); - Con_Printf(" Source:%s Masked:%s Prepared:%s Uploaded:%s\n Coords:(s:%g t:%g)\n", + Con_Printf(" Source:%s GLName:%u Masked:%s Prepared:%s Uploaded:%s\n Coords:(s:%g t:%g)\n", TexSource_Name(variant.source()), + variant.glName(), variant.isMasked() ? "yes":"no", variant.isPrepared()? "yes":"no", variant.isUploaded()? "yes":"no", s, t); Con_Printf(" Specification: "); - GL_PrintTextureVariantSpecification(&variant.spec()); + GL_PrintTextureVariantSpecification(variant.spec()); } +#endif static void printTextureInfo(Texture &tex) { @@ -420,14 +425,16 @@ static void printTextureInfo(Texture &tex) else Con_Printf("Dimensions: %d x %d\n", tex.width(), tex.height()); +#ifdef __CLIENT__ uint variantIdx = 0; - foreach(Texture::Variant *variant, tex.variants()) + foreach(TextureVariant *variant, tex.variants()) { - Con_Printf("Variant #%i: GLName:%u\n", variantIdx, variant->glName()); + Con_Printf("Variant #%i:\n", variantIdx); printVariantInfo(*variant); ++variantIdx; } +#endif } static void printTextureSummary(TextureManifest &manifest, bool printSchemeName = true) diff --git a/doomsday/client/src/resource/texturevariant.cpp b/doomsday/client/src/resource/texturevariant.cpp index 08b5f645b4..e1a23c2522 100644 --- a/doomsday/client/src/resource/texturevariant.cpp +++ b/doomsday/client/src/resource/texturevariant.cpp @@ -162,6 +162,7 @@ void Texture::Variant::setCoords(float newS, float newT) d->t = newT; } +#ifdef __CLIENT__ uint Texture::Variant::glName() const { return d->glTexName; @@ -171,5 +172,6 @@ void Texture::Variant::setGLName(uint newGLName) { d->glTexName = newGLName; } +#endif } // namespace de diff --git a/doomsday/server/include/server_dummies.h b/doomsday/server/include/server_dummies.h index 4ee78d3b57..c64822c646 100644 --- a/doomsday/server/include/server_dummies.h +++ b/doomsday/server/include/server_dummies.h @@ -36,36 +36,14 @@ # error "Attempted to include server's header in a non-server build" #endif -/* -DENG_EXTERN_C void ClMobj_EnableLocalActions(struct mobj_s *mo, boolean enable); -DENG_EXTERN_C boolean ClMobj_LocalActionsEnabled(struct mobj_s *mo); -DENG_EXTERN_C struct mobj_s* ClMobj_Find(thid_t id); -DENG_EXTERN_C boolean ClMobj_IsValid(struct mobj_s* mo); -DENG_EXTERN_C struct mobj_s* ClPlayer_ClMobj(int plrNum); -*/ - void GameMap_ClMobjReset(GameMap* map); DENG_EXTERN_C void Con_TransitionRegister(); DENG_EXTERN_C void Con_TransitionTicker(timespan_t t); DENG_EXTERN_C void GL_Shutdown(); -DENG_EXTERN_C void GL_ReleaseGLTexturesByTexture(struct texture_s *tex); DENG_EXTERN_C void GL_EarlyInitTextureManager(); -DENG_EXTERN_C void GL_PruneTextureVariantSpecifications(); -/*DENG_EXTERN_C struct texturevariant_s* GL_PreparePatchTexture(struct texture_s* tex); -DENG_EXTERN_C void GL_SetFilter(int f); -DENG_EXTERN_C void GL_SetFilterColor(float r, float g, float b, float a); -DENG_EXTERN_C void GL_UseFog(int yes); -DENG_EXTERN_C void GL_ConfigureBorderedProjection(dgl_borderedprojectionstate_t* bp, int flags, int width, int height, int availWidth, int availHeight, scalemode_t overrideMode); -DENG_EXTERN_C void GL_ConfigureBorderedProjection2(dgl_borderedprojectionstate_t* bp, int flags, - int width, int height, int availWidth, int availHeight, scalemode_t overrideMode, - float stretchEpsilon); -DENG_EXTERN_C void GL_BeginBorderedProjection(dgl_borderedprojectionstate_t* bp); -DENG_EXTERN_C void GL_EndBorderedProjection(dgl_borderedprojectionstate_t* bp); - -DENG_EXTERN_C void R_InitViewWindow(void); -*/ + DENG_EXTERN_C void R_RenderPlayerView(int num); DENG_EXTERN_C void R_SetBorderGfx(Uri const *const *paths); DENG_EXTERN_C void R_SkyParams(int layer, int param, void *data); @@ -74,56 +52,6 @@ DENG_EXTERN_C void R_ShutdownSvgs(void); DENG_EXTERN_C struct font_s* R_CreateFontFromDef(ded_compositefont_t* def); DENG_EXTERN_C void FR_Init(void); -/* -DENG_EXTERN_C void FR_SetFont(fontid_t font); -DENG_EXTERN_C void FR_PushAttrib(void); -DENG_EXTERN_C void FR_PopAttrib(void); -DENG_EXTERN_C void FR_LoadDefaultAttrib(void); -DENG_EXTERN_C float FR_Alpha(); -DENG_EXTERN_C float FR_ColorRed(void); -DENG_EXTERN_C float FR_ColorGreen(void); -DENG_EXTERN_C float FR_ColorBlue(void); -DENG_EXTERN_C float FR_Leading(void); -DENG_EXTERN_C int FR_Tracking(void); -DENG_EXTERN_C void FR_ShadowOffset(int* offsetX, int* offsetY); -DENG_EXTERN_C float FR_ShadowStrength(void); -DENG_EXTERN_C float FR_GlitterStrength(void); -DENG_EXTERN_C boolean FR_CaseScale(void); -DENG_EXTERN_C void FR_CharSize(Size2Raw* size, unsigned char ch); -DENG_EXTERN_C fontid_t FR_Font(void); -DENG_EXTERN_C void FR_ColorAndAlpha(float rgba[4]); -DENG_EXTERN_C void FR_SetLeading(float value); -DENG_EXTERN_C void FR_SetTracking(int value); -DENG_EXTERN_C void FR_SetColor(float red, float green, float blue); -DENG_EXTERN_C void FR_SetColorv(const float rgb[3]); -DENG_EXTERN_C void FR_SetColorAndAlpha(float red, float green, float blue, float alpha); -DENG_EXTERN_C void FR_SetColorAndAlphav(const float rgba[4]); -DENG_EXTERN_C void FR_SetColorRed(float value); -DENG_EXTERN_C void FR_SetColorGreen(float value); -DENG_EXTERN_C void FR_SetColorBlue(float value); -DENG_EXTERN_C void FR_SetAlpha(float value); -DENG_EXTERN_C void FR_SetShadowOffset(int offsetX, int offsetY); -DENG_EXTERN_C void FR_SetShadowStrength(float value); -DENG_EXTERN_C void FR_SetGlitterStrength(float value); -DENG_EXTERN_C void FR_SetCaseScale(boolean value); -DENG_EXTERN_C void FR_DrawText(const char* text, const Point2Raw* origin); -DENG_EXTERN_C void FR_DrawText2(const char* text, const Point2Raw* origin, int alignFlags); -DENG_EXTERN_C void FR_DrawText3(const char* text, const Point2Raw* _origin, int alignFlags, short _textFlags); -DENG_EXTERN_C void FR_DrawTextXY3(const char* text, int x, int y, int alignFlags, short flags); -DENG_EXTERN_C void FR_DrawTextXY2(const char* text, int x, int y, int alignFlags); -DENG_EXTERN_C void FR_DrawTextXY(const char* text, int x, int y);DENG_EXTERN_C int FR_CharWidth(unsigned char ch); -DENG_EXTERN_C int FR_CharHeight(unsigned char ch); -DENG_EXTERN_C void FR_DrawChar3(unsigned char ch, const Point2Raw* origin, int alignFlags, short textFlags); -DENG_EXTERN_C void FR_DrawChar2(unsigned char ch, const Point2Raw* origin, int alignFlags); -DENG_EXTERN_C void FR_DrawChar(unsigned char ch, const Point2Raw* origin); -DENG_EXTERN_C void FR_DrawCharXY3(unsigned char ch, int x, int y, int alignFlags, short textFlags); -DENG_EXTERN_C void FR_DrawCharXY2(unsigned char ch, int x, int y, int alignFlags); -DENG_EXTERN_C void FR_DrawCharXY(unsigned char ch, int x, int y); -DENG_EXTERN_C void FR_ResetTypeinTimer(void); -DENG_EXTERN_C void FR_TextSize(Size2Raw* size, const char* text); -DENG_EXTERN_C int FR_TextWidth(const char* text); -DENG_EXTERN_C int FR_TextHeight(const char* text); -*/ DENG_EXTERN_C void Fonts_Init(void); DENG_EXTERN_C fontschemeid_t Fonts_ParseScheme(const char* str); diff --git a/doomsday/server/src/server_dummies.cpp b/doomsday/server/src/server_dummies.cpp index 286e018076..0069d64574 100644 --- a/doomsday/server/src/server_dummies.cpp +++ b/doomsday/server/src/server_dummies.cpp @@ -73,116 +73,9 @@ void Con_TransitionTicker(timespan_t t) void GL_Shutdown() {} -void GL_ReleaseGLTexturesByTexture(struct texture_s *tex) -{ - DENG_UNUSED(tex); -} - void GL_EarlyInitTextureManager() {} -void GL_PruneTextureVariantSpecifications() -{} - -/* -void GL_SetFilter(int f) -{ - DENG_UNUSED(f); -} - -void GL_SetFilterColor(float r, float g, float b, float a) -{ - DENG_UNUSED(r); - DENG_UNUSED(g); - DENG_UNUSED(b); - DENG_UNUSED(a); -} - -void GL_UseFog(int yes) -{ - DENG_UNUSED(yes); -} - -void GL_ConfigureBorderedProjection(dgl_borderedprojectionstate_t* bp, int flags, int width, int height, int availWidth, int availHeight, scalemode_t overrideMode) -{ - DENG_UNUSED(bp); - DENG_UNUSED(flags); - DENG_UNUSED(width); - DENG_UNUSED(height); - DENG_UNUSED(bp); - DENG_UNUSED(availWidth); - DENG_UNUSED(availHeight); - DENG_UNUSED(overrideMode); -} - -void GL_ConfigureBorderedProjection2(dgl_borderedprojectionstate_t* bp, int flags, - int width, int height, int availWidth, int availHeight, scalemode_t overrideMode, - float stretchEpsilon) -{ - DENG_UNUSED(bp); - DENG_UNUSED(flags); - DENG_UNUSED(width); - DENG_UNUSED(height); - DENG_UNUSED(bp); - DENG_UNUSED(availWidth); - DENG_UNUSED(availHeight); - DENG_UNUSED(overrideMode); - DENG_UNUSED(stretchEpsilon); -} - -void GL_BeginBorderedProjection(dgl_borderedprojectionstate_t* bp) -{ - DENG_UNUSED(bp); -} - -void GL_EndBorderedProjection(dgl_borderedprojectionstate_t* bp) -{ - DENG_UNUSED(bp); -} - -void GL_DrawSvg3(svgid_t svgId, const Point2Rawf* origin, float scale, float angle) -{ - DENG_UNUSED(svgId); - DENG_UNUSED(origin); - DENG_UNUSED(scale); - DENG_UNUSED(angle); -} - -void GL_DrawSvg2(svgid_t id, const Point2Rawf* origin, float scale) -{} - -void GL_DrawSvg(svgid_t id, const Point2Rawf* origin) -{} -*/ - -DENG_EXTERN_C void GL_PrepareLSTexture(lightingtexid_t /*which*/) -{} - - -DENG_EXTERN_C void GL_PrintTextureVariantSpecification(texturevariantspecification_t const *) -{} - -DENG_EXTERN_C void GL_ReleaseTexturesByColorPalette(colorpaletteid_t paletteId) -{ - DENG_UNUSED(paletteId); -} - -/* -struct texturevariant_s* GL_PreparePatchTexture(struct texture_s *tex) -{ - DENG2_UNUSED(tex); - return 0; -} -*/ - -DENG_EXTERN_C texturevariantspecification_t *GL_TextureVariantSpecificationForContext( - texturevariantusagecontext_t /*tc*/, int /*flags*/, byte /*border*/, int /*tClass*/, int /*tMap*/, - int /*wrapS*/, int /*wrapT*/, int /*minFilter*/, int /*magFilter*/, int /*anisoFilter*/, - boolean /*mipmapped*/, boolean /*gammaCorrection*/, boolean /*noStretch*/, boolean /*toAlpha*/) -{ - return 0; -} - void FR_Init(void) {}