Skip to content

Commit

Permalink
Renderer: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jan 13, 2014
1 parent e5074bf commit 6523743
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
4 changes: 2 additions & 2 deletions doomsday/client/include/world/p_particle.h
Expand Up @@ -71,7 +71,7 @@ struct Generator
{
/**
* Particle animation is defined as a sequence of (perhaps interpolated)
* property value stages->
* property value stages.
*/
struct ParticleStage
{
Expand Down Expand Up @@ -171,7 +171,7 @@ struct Generator
void configureFromDef(ded_ptcgen_t const *def);

/**
* Spawn and move the generated particles.
* Generate and/or move the particles.
*/
void runTick();

Expand Down
10 changes: 2 additions & 8 deletions doomsday/client/src/render/rend_main.cpp
Expand Up @@ -54,7 +54,6 @@
#include "Hand"
#include "Surface"
#include "world/map.h"
#include "world/generators.h"
#include "world/lineowner.h"
#include "world/p_object.h"
#include "Contact"
Expand Down Expand Up @@ -4818,19 +4817,14 @@ static void drawSoundEmitters(Map &map)
}
}

// Currently active Generators collection.
static Generators *gens;

static String labelForGenerator(Generator const *gen)
{
DENG_ASSERT(gen != 0);
DENG2_ASSERT(gen != 0);
return String("%1").arg(gen->id());
}

static int drawGenerator(Generator *gen, void *context)
static int drawGenerator(Generator *gen, void * /*context*/)
{
DENG2_UNUSED(context);

#define MAX_GENERATOR_DIST 2048

if(gen->source || gen->flags.testFlag(Generator::Untriggered))
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/render/rend_particle.cpp
Expand Up @@ -35,7 +35,7 @@
#include "BspLeaf"
#include "Line"
#include "Plane"
#include "world/generators.h"
#include "world/generators.h" // Generators::GENERATORS_MAX
#include "world/map.h"

#include "render/rend_main.h"
Expand Down
12 changes: 4 additions & 8 deletions doomsday/client/src/world/p_particle.cpp
@@ -1,8 +1,8 @@
/** @file p_particle.cpp World map generator management (particles).
/** @file p_particle.cpp World map generator management (particles).
*
* @authors Copyright &copy; 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright &copy; 2006-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright &copy; 2006-2007 Jamie Jones <jamie_jones_au@yahoo.com.au>
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2006-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2006-2007 Jamie Jones <jamie_jones_au@yahoo.com.au>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -31,7 +31,6 @@

#include "Face"

#include "world/generators.h"
#include "world/thinkers.h"
#include "BspLeaf"
#include "api_map.h"
Expand Down Expand Up @@ -355,9 +354,6 @@ static void P_ParticleSound(fixed_t pos[3], ded_embsound_t *sound)
S_LocalSoundAtVolumeFrom(sound->id, NULL, orig, sound->volume);
}

/**
* Spawns a new particle.
*/
ParticleInfo *Generator::newParticle()
{
#ifdef __CLIENT__
Expand Down
9 changes: 3 additions & 6 deletions doomsday/client/src/world/plane.cpp
Expand Up @@ -26,9 +26,6 @@
#include "world/worldsystem.h" /// ddMapSetup
#include "Surface"
#include "Sector"
#ifdef __CLIENT__
# include "world/generators.h"
#endif
#include <de/Log>

using namespace de;
Expand Down Expand Up @@ -128,15 +125,15 @@ DENG2_PIMPL(Plane)
}

#ifdef __CLIENT__
struct generatorbyplaneiterator_params_t
struct findgeneratorworker_params_t
{
Plane *plane;
Generator *found;
};

static int findGeneratorWorker(Generator *gen, void *context)
{
generatorbyplaneiterator_params_t *p = (generatorbyplaneiterator_params_t *)context;
findgeneratorworker_params_t *p = (findgeneratorworker_params_t *)context;
if(gen->plane == p->plane)
{
p->found = gen;
Expand All @@ -148,7 +145,7 @@ DENG2_PIMPL(Plane)
/// @todo Cache this result.
Generator *findGenerator()
{
generatorbyplaneiterator_params_t parm;
findgeneratorworker_params_t parm;
parm.plane = thisPublic;
parm.found = 0;
self.map().generatorIterator(findGeneratorWorker, &parm);
Expand Down

0 comments on commit 6523743

Please sign in to comment.