Refactored water rasterizer

This commit is contained in:
Michaël Lemaire 2013-12-08 18:05:18 +01:00
parent 6bb03c5957
commit 50d499d10f
6 changed files with 41 additions and 13 deletions

View file

@ -8,6 +8,7 @@
#include "CloudsRenderer.h"
#include "SkyRasterizer.h"
#include "TerrainRasterizer.h"
#include "WaterRasterizer.h"
// Legacy compatibility
@ -137,7 +138,8 @@ void SoftwareRenderer::rasterize()
TerrainRasterizer terrain(this);
terrain.renderSurface();
waterRenderSurface(this);
WaterRasterizer water(this);
water.renderSurface();
SkyRasterizer sky(this);
sky.rasterize();

View file

@ -1,9 +1,13 @@
#include "public.h"
#include "private.h"
#include "WaterRasterizer.h"
#include <cmath>
#include "../renderer.h"
#include "../tools/parallel.h"
#include "SoftwareRenderer.h"
#include "water/public.h"
#include "tools/parallel.h"
WaterRasterizer::WaterRasterizer(SoftwareRenderer* renderer):
renderer(renderer)
{
}
static Color _postProcessFragment(Renderer* renderer, Vector3 location, void*)
{
@ -35,7 +39,7 @@ static void _renderQuad(Renderer* renderer, double x, double z, double size)
typedef struct
{
Renderer* renderer;
SoftwareRenderer* renderer;
int i;
double cx;
double cz;
@ -60,7 +64,7 @@ static int _parallelJobCallback(ParallelQueue*, int, void* data, int stopping)
return 0;
}
void waterRenderSurface(Renderer* renderer)
void WaterRasterizer::renderSurface()
{
ParallelRasterInfo* info;
ParallelQueue* queue;

View file

@ -0,0 +1,23 @@
#ifndef WATERRASTERIZER_H
#define WATERRASTERIZER_H
#include "software_global.h"
namespace paysages {
namespace software {
class WaterRasterizer
{
public:
WaterRasterizer(SoftwareRenderer* renderer);
void renderSurface();
private:
SoftwareRenderer* renderer;
};
}
}
#endif // WATERRASTERIZER_H

View file

@ -23,7 +23,8 @@ SOURCES += SoftwareRenderer.cpp \
CloudBasicLayerRenderer.cpp \
clouds/BaseCloudsModel.cpp \
clouds/CloudModelStratoCumulus.cpp \
TerrainRasterizer.cpp
TerrainRasterizer.cpp \
WaterRasterizer.cpp
HEADERS += SoftwareRenderer.h\
software_global.h \
@ -36,7 +37,8 @@ HEADERS += SoftwareRenderer.h\
CloudBasicLayerRenderer.h \
clouds/BaseCloudsModel.h \
clouds/CloudModelStratoCumulus.h \
TerrainRasterizer.h
TerrainRasterizer.h \
WaterRasterizer.h
unix:!symbian {
maemo5 {

View file

@ -24,7 +24,6 @@ SOURCES += main.cpp \
tools/data.cpp \
tools/cache.cpp \
water/wat_render.cpp \
water/wat_raster.cpp \
RenderingScenery.cpp
HEADERS += \

View file

@ -33,8 +33,6 @@ public:
RENDERINGSHARED_EXPORT extern StandardRenderer WaterRendererClass;
RENDERINGSHARED_EXPORT void waterRenderSurface(Renderer* renderer);
RENDERINGSHARED_EXPORT void waterAlterPreviewCoverageRenderer(Renderer* renderer);
RENDERINGSHARED_EXPORT Color waterGetPreviewCoverage(Renderer* renderer, double x, double y, double scaling, int highlight_enabled);