diff --git a/src/render/software/SoftwareRenderer.cpp b/src/render/software/SoftwareRenderer.cpp index 6389667..742971e 100644 --- a/src/render/software/SoftwareRenderer.cpp +++ b/src/render/software/SoftwareRenderer.cpp @@ -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(); diff --git a/src/rendering/water/wat_raster.cpp b/src/render/software/WaterRasterizer.cpp similarity index 92% rename from src/rendering/water/wat_raster.cpp rename to src/render/software/WaterRasterizer.cpp index efe0a86..ae271a5 100644 --- a/src/rendering/water/wat_raster.cpp +++ b/src/render/software/WaterRasterizer.cpp @@ -1,9 +1,13 @@ -#include "public.h" -#include "private.h" +#include "WaterRasterizer.h" -#include -#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; diff --git a/src/render/software/WaterRasterizer.h b/src/render/software/WaterRasterizer.h new file mode 100644 index 0000000..7d08798 --- /dev/null +++ b/src/render/software/WaterRasterizer.h @@ -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 diff --git a/src/render/software/software.pro b/src/render/software/software.pro index b6ddab7..cfbdb55 100644 --- a/src/render/software/software.pro +++ b/src/render/software/software.pro @@ -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 { diff --git a/src/rendering/rendering.pro b/src/rendering/rendering.pro index c1eeca9..b1c661f 100644 --- a/src/rendering/rendering.pro +++ b/src/rendering/rendering.pro @@ -24,7 +24,6 @@ SOURCES += main.cpp \ tools/data.cpp \ tools/cache.cpp \ water/wat_render.cpp \ - water/wat_raster.cpp \ RenderingScenery.cpp HEADERS += \ diff --git a/src/rendering/water/public.h b/src/rendering/water/public.h index 3aed28c..26ec700 100644 --- a/src/rendering/water/public.h +++ b/src/rendering/water/public.h @@ -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);