GLModelManager
: Replace GLRenderer *
with GLRenderer &
This commit is contained in:
parent
8101f85d6c
commit
16a2785cba
@ -30,11 +30,7 @@
|
||||
|
||||
namespace spades {
|
||||
namespace draw {
|
||||
GLModelManager::GLModelManager(GLRenderer *r) {
|
||||
SPADES_MARK_FUNCTION();
|
||||
|
||||
renderer = r;
|
||||
}
|
||||
GLModelManager::GLModelManager(GLRenderer &r) : renderer{r} { SPADES_MARK_FUNCTION(); }
|
||||
GLModelManager::~GLModelManager() {
|
||||
SPADES_MARK_FUNCTION();
|
||||
|
||||
@ -64,7 +60,7 @@ namespace spades {
|
||||
|
||||
auto voxelModel = VoxelModelLoader::Load(name);
|
||||
|
||||
return renderer->CreateModelOptimized(*voxelModel).Cast<GLModel>().Unmanage();
|
||||
return renderer.CreateModelOptimized(*voxelModel).Cast<GLModel>().Unmanage();
|
||||
}
|
||||
|
||||
void GLModelManager::ClearCache() { models.clear(); }
|
||||
|
@ -30,12 +30,12 @@ namespace spades {
|
||||
class GLModel;
|
||||
class GLRenderer;
|
||||
class GLModelManager {
|
||||
GLRenderer *renderer;
|
||||
GLRenderer &renderer;
|
||||
std::map<std::string, GLModel *> models;
|
||||
GLModel *CreateModel(const char *);
|
||||
|
||||
public:
|
||||
GLModelManager(GLRenderer *);
|
||||
GLModelManager(GLRenderer &);
|
||||
~GLModelManager();
|
||||
GLModel *RegisterModel(const char *);
|
||||
|
||||
|
@ -135,7 +135,7 @@ namespace spades {
|
||||
|
||||
SPLog("GLRenderer initializing for 3D rendering");
|
||||
shadowMapRenderer = GLShadowMapShader::CreateShadowMapRenderer(*this);
|
||||
modelManager = new GLModelManager(this);
|
||||
modelManager = new GLModelManager(*this);
|
||||
if ((int)settings.r_softParticles >= 2)
|
||||
spriteRenderer = new GLSoftLitSpriteRenderer(this);
|
||||
else if (settings.r_softParticles)
|
||||
|
Loading…
x
Reference in New Issue
Block a user