GLRadiosityRenderer: Replace GLRenderer * with GLRenderer &

This commit is contained in:
yvt 2019-08-08 00:34:00 +09:00
parent d99f202c92
commit 027f6ef357
No known key found for this signature in database
GPG Key ID: 48F2768FA8D07C92
3 changed files with 8 additions and 8 deletions

View File

@ -51,8 +51,8 @@ namespace spades {
}
};
GLRadiosityRenderer::GLRadiosityRenderer(GLRenderer *r, client::GameMap *m)
: renderer(r), device(r->GetGLDevice()), settings(r->GetSettings()), map(m) {
GLRadiosityRenderer::GLRadiosityRenderer(GLRenderer &r, client::GameMap *m)
: renderer(r), device(r.GetGLDevice()), settings(r.GetSettings()), map(m) {
SPADES_MARK_FUNCTION();
w = map->Width();
@ -166,7 +166,7 @@ namespace spades {
Vector3 pos = {ipos.x + .5f, ipos.y + .5f, ipos.z + .5f};
GLMapShadowRenderer *shadowmap = renderer->mapShadowRenderer;
GLMapShadowRenderer *shadowmap = renderer.mapShadowRenderer;
uint32_t *bitmap = shadowmap->bitmap.data();
int centerX = ipos.x;
int centerY = ipos.y - ipos.z;
@ -355,7 +355,7 @@ namespace spades {
if (!chunks[i].transferDone.load())
cnt++;
}
GLProfiler::Context profiler(renderer->GetGLProfiler(), "Radiosity [>= %d chunk(s)]",
GLProfiler::Context profiler(renderer.GetGLProfiler(), "Radiosity [>= %d chunk(s)]",
cnt);
for (size_t i = 0; i < chunks.size(); i++) {
Chunk &c = chunks[i];
@ -393,7 +393,7 @@ namespace spades {
int nearDirtyChunks = 0;
// first, check only chunks in near range
Vector3 eyePos = renderer->GetSceneDef().viewOrigin;
Vector3 eyePos = renderer.GetSceneDef().viewOrigin;
int eyeX = (int)(eyePos.x) >> ChunkSizeBits;
int eyeY = (int)(eyePos.y) >> ChunkSizeBits;
int eyeZ = (int)(eyePos.z) >> ChunkSizeBits;

View File

@ -42,7 +42,7 @@ namespace spades {
class UpdateDispatch;
enum { ChunkSize = 16, ChunkSizeBits = 4, Envelope = 6 };
GLRenderer *renderer;
GLRenderer &renderer;
IGLDevice &device;
GLSettings &settings;
client::GameMap *map;
@ -102,7 +102,7 @@ namespace spades {
Vector3 base, x, y, z;
};
GLRadiosityRenderer(GLRenderer *renderer, client::GameMap *map);
GLRadiosityRenderer(GLRenderer &renderer, client::GameMap *map);
~GLRadiosityRenderer();
Result Evaluate(IntVector3);

View File

@ -322,7 +322,7 @@ namespace spades {
SPLog("Creating Ray-traced Ambient Occlusion Renderer");
ambientShadowRenderer = new GLAmbientShadowRenderer(*this, *newMap);
SPLog("Creating Relective Shadow Maps Renderer");
radiosityRenderer = new GLRadiosityRenderer(this, newMap.get_pointer());
radiosityRenderer = new GLRadiosityRenderer(*this, newMap.get_pointer());
} else {
SPLog("Radiosity is disabled");
}