Skip to content

Commit

Permalink
Renderer|Client: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Dec 3, 2013
1 parent 789816a commit 7375ae7
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 28 deletions.
2 changes: 1 addition & 1 deletion doomsday/api/api_render.h
@@ -1,4 +1,4 @@
/** @file api_render.h Public API of the renderer.
/** @file api_render.h Public API of the renderer.
* @ingroup render
*
* @authors Copyright © 2013 Jaakko Keränen <jaakko.keranen@iki.fi>
Expand Down
1 change: 0 additions & 1 deletion doomsday/client/include/de_resource.h
Expand Up @@ -25,7 +25,6 @@

#include "resource/colorpalettes.h"
#include "resource/abstractfont.h"
#include "resource/models.h"
#include "resource/compositetexture.h"
#include "resource/rawtexture.h"
#include "resource/sprite.h"
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/include/render/rend_model.h
Expand Up @@ -23,7 +23,7 @@
#ifndef DENG_CLIENT_RENDER_MODEL_H
#define DENG_CLIENT_RENDER_MODEL_H

#include "resource/models.h"
#include "ModelDef"

class TextureVariantSpec;

Expand Down
14 changes: 6 additions & 8 deletions doomsday/client/include/render/sky.h
@@ -1,10 +1,9 @@
/**
* @file sky.h Sky Sphere and 3D Models
/** @file sky.h Sky Sphere and 3D Models
*
* This version supports only two sky layers. (More would be a waste of resources?)
*
* @author Copyright &copy; 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @author Copyright &copy; 2007-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2007-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand All @@ -21,11 +20,10 @@
* 02110-1301 USA</small>
*/

#ifndef LIBDENG_RENDER_SKY_H
#define LIBDENG_RENDER_SKY_H
#ifndef DENG_CLIENT_RENDER_SKY_H
#define DENG_CLIENT_RENDER_SKY_H

#include "color.h"
#include "resource/models.h"
#include "Material"

#define MAX_SKY_LAYERS ( 2 )
Expand Down Expand Up @@ -129,4 +127,4 @@ void Sky_Render(void);
} // extern "C"
#endif

#endif /* LIBDENG_RENDER_SKY_H */
#endif // DENG_CLIENT_RENDER_SKY_H
33 changes: 27 additions & 6 deletions doomsday/client/src/render/api_render.cpp
@@ -1,16 +1,37 @@
#define DENG_NO_API_MACROS_RENDER
/** @file api_render.cpp Public API of the renderer.
*
* @authors Copyright © 2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
*/

#include "de_base.h"
#include "de_console.h"
#include "de_defs.h"
#define DENG_NO_API_MACROS_RENDER

#include "de_platform.h"
#include "api_render.h"

#include "dd_main.h" // App_ResourceSystem
#include "con_main.h"
#include "def_main.h"
#include "sys_system.h" // novideo

#include "render/r_main.h"
#include "render/billboard.h" // Rend_SpriteMaterialSpec
#include "render/rend_model.h"

#include "resource/models.h"
#include "resource/sprite.h"
#include "resource/resourcesystem.h"
#ifdef __CLIENT__
# include "MaterialSnapshot"
# include "MaterialVariantSpec"
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/render/rend_model.cpp
Expand Up @@ -465,7 +465,7 @@ static ModelFrame &visibleModelFrame(ModelDef &modef, int subnumber, int mobjId)
QString("Model has %1 submodels, but submodel #%2 was requested")
.arg(modef.subCount()).arg(subnumber));
}
submodeldef_t const &sub = modef.subModelDef(subnumber);
SubmodelDef const &sub = modef.subModelDef(subnumber);

int curFrame = sub.frame;
if(modef.flags & MFF_IDFRAME)
Expand Down Expand Up @@ -732,7 +732,7 @@ static int chooseSkin(ModelDef &mf, int submodel, int id, int selector, int tmap
return 0;
}

submodeldef_t &smf = mf.subModelDef(submodel);
SubmodelDef &smf = mf.subModelDef(submodel);
Model *mdl = App_ResourceSystem().model(smf.modelId);
int skin = smf.skin;

Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/resource/model.cpp
Expand Up @@ -189,7 +189,7 @@ DENG2_PIMPL(Model)
// Determine whether this appears to be a MD2 model.
md2_header_t hdr;
if(!readMd2Header(file, hdr)) return 0;
if(LONG(hdr.magic) != MD2_MAGIC) return 0;
if(hdr.magic != MD2_MAGIC) return 0;

Model *mdl = new Model;

Expand Down Expand Up @@ -355,7 +355,7 @@ DENG2_PIMPL(Model)
// Determine whether this appears to be a DMD model.
dmd_header_t hdr;
if(!readHeaderDmd(file, hdr)) return 0;
if(LONG(hdr.magic) != DMD_MAGIC) return 0;
if(hdr.magic != DMD_MAGIC) return 0;

// Read the chunks.
dmd_chunk_t chunk;
Expand Down
10 changes: 5 additions & 5 deletions doomsday/client/src/resource/resourcesystem.cpp
@@ -1,5 +1,6 @@
/** @file resourcesystem.cpp Resource subsystem.
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2006-2007 Jamie Jones <jamie_jones_au@yahoo.com.au>
*
Expand Down Expand Up @@ -32,7 +33,6 @@
#include "resource/compositetexture.h"
#include "resource/patch.h"
#include "resource/patchname.h"
#include "resource/models.h"
#ifdef __CLIENT__
# include "BitmapFont"
# include "CompositeBitmapFont"
Expand Down Expand Up @@ -1220,7 +1220,7 @@ DENG2_PIMPL(ResourceSystem)
{
if(!mf.subCount()) return;

submodeldef_t &smf = mf.subModelDef(0);
SubmodelDef &smf = mf.subModelDef(0);

// No model to scale?
if(!smf.modelId) return;
Expand Down Expand Up @@ -1319,7 +1319,7 @@ DENG2_PIMPL(ResourceSystem)
for(uint i = 0; i < def.subCount(); ++i)
{
ded_submodel_t const *subdef = &def.sub(i);
submodeldef_t *sub = modef->addSub();
SubmodelDef *sub = modef->addSub();

sub->modelId = 0;

Expand Down Expand Up @@ -3219,7 +3219,7 @@ void ResourceSystem::setModelDefFrame(ModelDef &modef, int frame)
{
for(uint i = 0; i < modef.subCount(); ++i)
{
submodeldef_t &subdef = modef.subModelDef(i);
SubmodelDef &subdef = modef.subModelDef(i);
if(subdef.modelId == NOMODELID) continue;

// Modify the modeldef itself: set the current frame.
Expand All @@ -3236,7 +3236,7 @@ void ResourceSystem::cache(ModelDef *modelDef)

for(uint sub = 0; sub < modelDef->subCount(); ++sub)
{
submodeldef_t &subdef = modelDef->subModelDef(sub);
SubmodelDef &subdef = modelDef->subModelDef(sub);
Model *mdl = model(subdef.modelId);
if(!mdl) continue;

Expand Down
2 changes: 0 additions & 2 deletions doomsday/client/src/world/p_particle.cpp
Expand Up @@ -40,8 +40,6 @@
#include "render/r_main.h" // validCount
#include "render/rend_model.h"

#include "resource/models.h"

#include <de/String>
#include <de/Time>
#include <de/fixedpoint.h>
Expand Down

0 comments on commit 7375ae7

Please sign in to comment.