Skip to content

Commit

Permalink
Refactor: Merged render/r_sky.c/h render/rend_sky.c/h and switched to…
Browse files Browse the repository at this point in the history
… C++
  • Loading branch information
danij-deng committed Nov 26, 2012
1 parent cbef5cf commit d0504ba
Show file tree
Hide file tree
Showing 16 changed files with 1,195 additions and 1,308 deletions.
6 changes: 2 additions & 4 deletions doomsday/engine/engine.pro
Expand Up @@ -272,7 +272,6 @@ DENG_HEADERS += \
include/render/r_lgrid.h \
include/render/r_lumobjs.h \
include/render/r_shadow.h \
include/render/r_sky.h \
include/render/r_things.h \
include/render/rend_bias.h \
include/render/rend_clip.h \
Expand All @@ -287,9 +286,9 @@ DENG_HEADERS += \
include/render/rend_model.h \
include/render/rend_particle.h \
include/render/rend_shadow.h \
include/render/rend_sky.h \
include/render/rend_sprite.h \
include/render/rendpoly.h \
include/render/sky.h \
include/render/vignette.h \
include/render/vlight.h \
include/resource/animgroups.h \
Expand Down Expand Up @@ -559,7 +558,6 @@ SOURCES += \
src/render/r_lgrid.c \
src/render/r_lumobjs.c \
src/render/r_shadow.c \
src/render/r_sky.c \
src/render/r_things.c \
src/render/rend_bias.c \
src/render/rend_clip.cpp \
Expand All @@ -574,9 +572,9 @@ SOURCES += \
src/render/rend_model.c \
src/render/rend_particle.c \
src/render/rend_shadow.c \
src/render/rend_sky.c \
src/render/rend_sprite.c \
src/render/rendpoly.cpp \
src/render/sky.cpp \
src/render/vignette.c \
src/render/vlight.cpp \
src/resource/animgroups.cpp \
Expand Down
3 changes: 1 addition & 2 deletions doomsday/engine/include/de_render.h
Expand Up @@ -27,14 +27,12 @@
#include "render/r_lgrid.h"
#include "render/r_lumobjs.h"
#include "render/r_shadow.h"
#include "render/r_sky.h"
#include "render/r_things.h"
#include "render/rend_main.h"
#include "render/rend_clip.h"
#include "render/rend_halo.h"
#include "render/rend_list.h"
#include "render/rend_particle.h"
#include "render/rend_sky.h"
#include "render/rend_sprite.h"
#include "render/rend_model.h"
#include "render/rend_shadow.h"
Expand All @@ -45,6 +43,7 @@
#include "render/rend_console.h"
#include "render/rend_dynlight.h"
#include "render/rendpoly.h"
#include "render/sky.h"
#include "render/vignette.h"
#include "render/vlight.h"

Expand Down
145 changes: 0 additions & 145 deletions doomsday/engine/include/render/r_sky.h

This file was deleted.

47 changes: 0 additions & 47 deletions doomsday/engine/include/render/rend_sky.h

This file was deleted.

136 changes: 136 additions & 0 deletions doomsday/engine/include/render/sky.h
@@ -0,0 +1,136 @@
/**
* @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-2012 Jaakko Keränen <jaakko.keranen@iki.fi>
* @author Copyright &copy; 2007-2012 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, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/

#ifndef LIBDENG_RENDER_SKY_H
#define LIBDENG_RENDER_SKY_H

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

#define MAX_SKY_LAYERS ( 2 )
#define MAX_SKY_MODELS ( 32 )

#define DEFAULT_SKY_HEIGHT ( .666667f )
#define DEFAULT_SKY_HORIZON_OFFSET ( 0 )
#define DEFAULT_SKY_SPHERE_XOFFSET ( 0 )
#define DEFAULT_SKY_SPHERE_MATERIAL ( "Textures:SKY1" )
#define DEFAULT_SKY_SPHERE_FADEOUT_LIMIT ( .3f )

#ifdef __cplusplus
extern "C" {
#endif

/// Register the console commands, variables, etc..., of this module.
void Sky_Register(void);

/// Initialize this module.
void Sky_Init(void);

/// Shutdown this module.
void Sky_Shutdown(void);

/**
* Cache all resources necessary for rendering the current sky.
*/
void Sky_Cache(void);

/**
* Animate the sky.
*/
void Sky_Ticker(void);

/**
* Configure the sky based on the specified definition if not @c NULL,
* otherwise, setup using suitable defaults.
*/
void Sky_Configure(ded_sky_t *sky);

/// @return Unique identifier of the current Sky's first active layer.
int Sky_FirstActiveLayer(void);

/// @return Current ambient sky color.
ColorRawf const* Sky_AmbientColor(void);

/// @return Horizon offset for the current Sky.
float Sky_HorizonOffset(void);

/// @return Height of the current Sky as a factor [0...1] where @c 1 covers the entire view.
float Sky_Height(void);

/// @return @c true if the identified @a layerId of the current Sky is active.
boolean Sky_LayerActive(int layerId);

/// @return Fadeout limit for the identified @a layerId of the current Sky.
float Sky_LayerFadeoutLimit(int layerId);

/// @return @c true if the identified @a layerId for the current Sky is masked.
boolean Sky_LayerMasked(int layerId);

/// @return Material assigned to the identified @a layerId of the current Sky.
material_t *Sky_LayerMaterial(int layerId);

/// @return Horizontal offset for the identified @a layerId of the current Sky.
float Sky_LayerOffset(int layerId);

/**
* Change the 'active' state for the identified @a layerId of the current Sky.
* @post Sky light color is marked for update (deferred).
*/
void Sky_LayerSetActive(int layerId, boolean yes);

/**
* Change the 'masked' state for the identified @a layerId of the current Sky.
* @post Sky light color and layer Material are marked for update (deferred).
*/
void Sky_LayerSetMasked(int layerId, boolean yes);

/**
* Change the fadeout limit for the identified @a layerId of the current Sky.
* @post Sky light color is marked for update (deferred).
*/
void Sky_LayerSetFadeoutLimit(int layerId, float limit);

/**
* Change the Material assigned to the identified @a layerId of the current Sky.
* @post Sky light color and layer Material are marked for update (deferred).
*/
void Sky_LayerSetMaterial(int layerId, material_t *material);

/**
* Change the horizontal offset for the identified @a layerId of the current Sky.
*/
void Sky_LayerSetOffset(int layerId, float offset);

/// Render the current sky.
void Sky_Render(void);

/**
* Alternative interface for manipulating Sky (layer) properties by name/id.
*/
void R_SkyParams(int layer, int param, void *data);

#ifdef __cplusplus
} // extern "C"
#endif

#endif /* LIBDENG_RENDER_SKY_H */

0 comments on commit d0504ba

Please sign in to comment.