WINTERMUTE: Remove Model-View transformation reset function from 3d renderer interface
This commit is contained in:
parent
1ea679f90a
commit
874965f454
5 changed files with 4 additions and 16 deletions
|
@ -85,7 +85,6 @@ public:
|
||||||
void initLoop() override;
|
void initLoop() override;
|
||||||
|
|
||||||
virtual bool setProjection2D() = 0;
|
virtual bool setProjection2D() = 0;
|
||||||
virtual void resetModelViewTransform() = 0;
|
|
||||||
virtual void setWorldTransform(const Math::Matrix4 &transform) = 0;
|
virtual void setWorldTransform(const Math::Matrix4 &transform) = 0;
|
||||||
|
|
||||||
void project(const Math::Matrix4 &worldMatrix, const Math::Vector3d &point, int32 &x, int32 &y);
|
void project(const Math::Matrix4 &worldMatrix, const Math::Vector3d &point, int32 &x, int32 &y);
|
||||||
|
|
|
@ -365,11 +365,6 @@ bool BaseRenderOpenGL3D::setProjection2D() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseRenderOpenGL3D::resetModelViewTransform() {
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glLoadIdentity();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseRenderOpenGL3D::setWorldTransform(const Math::Matrix4 &transform) {
|
void BaseRenderOpenGL3D::setWorldTransform(const Math::Matrix4 &transform) {
|
||||||
Math::Matrix4 tmp = transform;
|
Math::Matrix4 tmp = transform;
|
||||||
tmp.transpose();
|
tmp.transpose();
|
||||||
|
@ -742,7 +737,8 @@ bool BaseRenderOpenGL3D::drawSpriteEx(BaseSurfaceOpenGL3D &tex, const Wintermute
|
||||||
|
|
||||||
void BaseRenderOpenGL3D::renderSceneGeometry(const BaseArray<AdWalkplane *> &planes, const BaseArray<AdBlock *> &blocks,
|
void BaseRenderOpenGL3D::renderSceneGeometry(const BaseArray<AdWalkplane *> &planes, const BaseArray<AdBlock *> &blocks,
|
||||||
const BaseArray<AdGeneric *> &generics, const BaseArray<Light3D *> &lights, Camera3D *camera) {
|
const BaseArray<AdGeneric *> &generics, const BaseArray<Light3D *> &lights, Camera3D *camera) {
|
||||||
_gameRef->_renderer3D->resetModelViewTransform();
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glLoadIdentity();
|
||||||
_gameRef->_renderer3D->setup3D(camera, true);
|
_gameRef->_renderer3D->setup3D(camera, true);
|
||||||
|
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
|
@ -808,7 +804,8 @@ void BaseRenderOpenGL3D::renderSceneGeometry(const BaseArray<AdWalkplane *> &pla
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseRenderOpenGL3D::renderShadowGeometry(const BaseArray<AdWalkplane *> &planes, const BaseArray<AdBlock *> &blocks, const BaseArray<AdGeneric *> &generics, Camera3D *camera) {
|
void BaseRenderOpenGL3D::renderShadowGeometry(const BaseArray<AdWalkplane *> &planes, const BaseArray<AdBlock *> &blocks, const BaseArray<AdGeneric *> &generics, Camera3D *camera) {
|
||||||
resetModelViewTransform();
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glLoadIdentity();
|
||||||
setup3D(camera, true);
|
setup3D(camera, true);
|
||||||
|
|
||||||
// disable color write
|
// disable color write
|
||||||
|
|
|
@ -91,7 +91,6 @@ public:
|
||||||
|
|
||||||
bool setProjection() override;
|
bool setProjection() override;
|
||||||
bool setProjection2D() override;
|
bool setProjection2D() override;
|
||||||
void resetModelViewTransform() override;
|
|
||||||
void setWorldTransform(const Math::Matrix4 &transform) override;
|
void setWorldTransform(const Math::Matrix4 &transform) override;
|
||||||
|
|
||||||
bool windowedBlt() override;
|
bool windowedBlt() override;
|
||||||
|
|
|
@ -308,11 +308,6 @@ bool BaseRenderOpenGL3DShader::setProjection2D() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseRenderOpenGL3DShader::resetModelViewTransform() {
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glLoadIdentity();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseRenderOpenGL3DShader::setWorldTransform(const Math::Matrix4 &transform) {
|
void BaseRenderOpenGL3DShader::setWorldTransform(const Math::Matrix4 &transform) {
|
||||||
Math::Matrix4 tmp = transform;
|
Math::Matrix4 tmp = transform;
|
||||||
tmp.transpose();
|
tmp.transpose();
|
||||||
|
@ -648,7 +643,6 @@ void BaseRenderOpenGL3DShader::renderSceneGeometry(const BaseArray<AdWalkplane *
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseRenderOpenGL3DShader::renderShadowGeometry(const BaseArray<AdWalkplane *> &planes, const BaseArray<AdBlock *> &blocks, const BaseArray<AdGeneric *> &generics, Camera3D *camera) {
|
void BaseRenderOpenGL3DShader::renderShadowGeometry(const BaseArray<AdWalkplane *> &planes, const BaseArray<AdBlock *> &blocks, const BaseArray<AdGeneric *> &generics, Camera3D *camera) {
|
||||||
resetModelViewTransform();
|
|
||||||
setup3D(camera, true);
|
setup3D(camera, true);
|
||||||
|
|
||||||
// disable color write
|
// disable color write
|
||||||
|
|
|
@ -76,7 +76,6 @@ public:
|
||||||
|
|
||||||
bool setProjection() override;
|
bool setProjection() override;
|
||||||
bool setProjection2D() override;
|
bool setProjection2D() override;
|
||||||
void resetModelViewTransform() override;
|
|
||||||
void setWorldTransform(const Math::Matrix4 &transform) override;
|
void setWorldTransform(const Math::Matrix4 &transform) override;
|
||||||
|
|
||||||
bool windowedBlt() override;
|
bool windowedBlt() override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue