[Scummvm-git-logs] scummvm master -> 2f5995482eb58fe66a835e2675c1a3b9e645f898
aquadran
noreply at scummvm.org
Sun Dec 19 18:18:26 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
2f5995482e STARK: Formatting
Commit: 2f5995482eb58fe66a835e2675c1a3b9e645f898
https://github.com/scummvm/scummvm/commit/2f5995482eb58fe66a835e2675c1a3b9e645f898
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2021-12-19T19:18:19+01:00
Commit Message:
STARK: Formatting
Changed paths:
engines/stark/gfx/openglactor.cpp
engines/stark/gfx/openglsactor.cpp
engines/stark/gfx/tinygl.cpp
engines/stark/gfx/tinyglactor.cpp
diff --git a/engines/stark/gfx/openglactor.cpp b/engines/stark/gfx/openglactor.cpp
index 37d4e667ca..2220e5728c 100644
--- a/engines/stark/gfx/openglactor.cpp
+++ b/engines/stark/gfx/openglactor.cpp
@@ -58,9 +58,9 @@ void OpenGLActorRenderer::render(const Math::Vector3d &position, float direction
_model->updateBoundingBox();
bool drawShadow = false;
- if (_castsShadow
- && StarkScene->shouldRenderShadows()
- && StarkSettings->getBoolSetting(Settings::kShadow)) {
+ if (_castsShadow &&
+ StarkScene->shouldRenderShadows() &&
+ StarkSettings->getBoolSetting(Settings::kShadow)) {
drawShadow = true;
}
Math::Vector3d lightDirection;
@@ -142,19 +142,19 @@ void OpenGLActorRenderer::render(const Math::Vector3d &position, float direction
Math::Vector3d position1 = Math::Vector3d(vertex.pos1x, vertex.pos1y, vertex.pos1z);
Math::Vector3d position2 = Math::Vector3d(vertex.pos2x, vertex.pos2y, vertex.pos2z);
Math::Vector3d bone1Position = Math::Vector3d(bones[bone1]->_animPos.x(),
- bones[bone1]->_animPos.y(),
- bones[bone1]->_animPos.z());
+ bones[bone1]->_animPos.y(),
+ bones[bone1]->_animPos.z());
Math::Vector3d bone2Position = Math::Vector3d(bones[bone2]->_animPos.x(),
- bones[bone2]->_animPos.y(),
- bones[bone2]->_animPos.z());
+ bones[bone2]->_animPos.y(),
+ bones[bone2]->_animPos.z());
Math::Quaternion bone1Rotation = Math::Quaternion(bones[bone1]->_animRot.x(),
- bones[bone1]->_animRot.y(),
- bones[bone1]->_animRot.z(),
- bones[bone1]->_animRot.w());
+ bones[bone1]->_animRot.y(),
+ bones[bone1]->_animRot.z(),
+ bones[bone1]->_animRot.w());
Math::Quaternion bone2Rotation = Math::Quaternion(bones[bone2]->_animRot.x(),
- bones[bone2]->_animRot.y(),
- bones[bone2]->_animRot.z(),
- bones[bone2]->_animRot.w());
+ bones[bone2]->_animRot.y(),
+ bones[bone2]->_animRot.z(),
+ bones[bone2]->_animRot.w());
float boneWeight = vertex.boneWeight;
Math::Vector3d normal = Math::Vector3d(vertex.normalx, vertex.normaly, vertex.normalz);
@@ -170,9 +170,9 @@ void OpenGLActorRenderer::render(const Math::Vector3d &position, float direction
Math::Vector4d modelEyePosition;
if (_gfx->computeLightsEnabled()) {
modelEyePosition = modelViewMatrix * Math::Vector4d(modelPosition.x(),
- modelPosition.y(),
- modelPosition.z(),
- 1.0);
+ modelPosition.y(),
+ modelPosition.z(),
+ 1.0);
}
// Compute the vertex normal in eye-space
Math::Vector3d n1 = normal;
@@ -365,8 +365,8 @@ uint32 *OpenGLActorRenderer::createFaceEBO(const Face *face) {
return indices;
}
-Math::Vector3d OpenGLActorRenderer::getShadowLightDirection(const LightEntryArray &lights,
- const Math::Vector3d &actorPosition, Math::Matrix3 worldToModelRot) {
+Math::Vector3d OpenGLActorRenderer::getShadowLightDirection(const LightEntryArray &lights, const Math::Vector3d &actorPosition,
+ Math::Matrix3 worldToModelRot) {
Math::Vector3d sumDirection;
bool hasLight = false;
@@ -420,8 +420,8 @@ Math::Vector3d OpenGLActorRenderer::getShadowLightDirection(const LightEntryArra
return worldToModelRot * sumDirection;
}
-bool OpenGLActorRenderer::getPointLightContribution(LightEntry *light,
- const Math::Vector3d &actorPosition, Math::Vector3d &direction, float weight) {
+bool OpenGLActorRenderer::getPointLightContribution(LightEntry *light, const Math::Vector3d &actorPosition,
+ Math::Vector3d &direction, float weight) {
float distance = light->position.getDistanceTo(actorPosition);
if (distance > light->falloffFar) {
@@ -466,14 +466,14 @@ bool OpenGLActorRenderer::getDirectionalLightContribution(LightEntry *light, Mat
return true;
}
-bool OpenGLActorRenderer::getSpotLightContribution(LightEntry *light,
- const Math::Vector3d &actorPosition, Math::Vector3d &direction) {
+bool OpenGLActorRenderer::getSpotLightContribution(LightEntry *light, const Math::Vector3d &actorPosition,
+ Math::Vector3d &direction) {
Math::Vector3d lightToActor = actorPosition - light->position;
lightToActor.normalize();
float cosAngle = MAX(0.0f, lightToActor.dotProduct(light->direction));
float cone = (cosAngle - light->innerConeAngle.getCosine()) /
- MAX(0.001f, light->outerConeAngle.getCosine() - light->innerConeAngle.getCosine());
+ MAX(0.001f, light->outerConeAngle.getCosine() - light->innerConeAngle.getCosine());
cone = CLIP(cone, 0.0f, 1.0f);
if (cone <= 0) {
diff --git a/engines/stark/gfx/openglsactor.cpp b/engines/stark/gfx/openglsactor.cpp
index de794c68c7..8649af85dc 100644
--- a/engines/stark/gfx/openglsactor.cpp
+++ b/engines/stark/gfx/openglsactor.cpp
@@ -118,9 +118,9 @@ void OpenGLSActorRenderer::render(const Math::Vector3d &position, float directio
_shader->unbind();
- if (_castsShadow
- && StarkScene->shouldRenderShadows()
- && StarkSettings->getBoolSetting(Settings::kShadow)) {
+ if (_castsShadow &&
+ StarkScene->shouldRenderShadows() &&
+ StarkSettings->getBoolSetting(Settings::kShadow)) {
glEnable(GL_BLEND);
glEnable(GL_STENCIL_TEST);
@@ -307,8 +307,8 @@ void OpenGLSActorRenderer::setLightArrayUniform(const LightEntryArray &lights) {
}
}
-void OpenGLSActorRenderer::setShadowUniform(const LightEntryArray &lights,
- const Math::Vector3d &actorPosition, Math::Matrix3 worldToModelRot) {
+void OpenGLSActorRenderer::setShadowUniform(const LightEntryArray &lights, const Math::Vector3d &actorPosition,
+ Math::Matrix3 worldToModelRot) {
Math::Vector3d sumDirection;
bool hasLight = false;
@@ -363,8 +363,8 @@ void OpenGLSActorRenderer::setShadowUniform(const LightEntryArray &lights,
_shadowShader->setUniform("lightDirection", sumDirection);
}
-bool OpenGLSActorRenderer::getPointLightContribution(LightEntry *light,
- const Math::Vector3d &actorPosition, Math::Vector3d &direction, float weight) {
+bool OpenGLSActorRenderer::getPointLightContribution(LightEntry *light, const Math::Vector3d &actorPosition,
+ Math::Vector3d &direction, float weight) {
float distance = light->position.getDistanceTo(actorPosition);
if (distance > light->falloffFar) {
@@ -409,14 +409,14 @@ bool OpenGLSActorRenderer::getDirectionalLightContribution(LightEntry *light, Ma
return true;
}
-bool OpenGLSActorRenderer::getSpotLightContribution(LightEntry *light,
- const Math::Vector3d &actorPosition, Math::Vector3d &direction) {
+bool OpenGLSActorRenderer::getSpotLightContribution(LightEntry *light, const Math::Vector3d &actorPosition,
+ Math::Vector3d &direction) {
Math::Vector3d lightToActor = actorPosition - light->position;
lightToActor.normalize();
float cosAngle = MAX(0.0f, lightToActor.dotProduct(light->direction));
float cone = (cosAngle - light->innerConeAngle.getCosine()) /
- MAX(0.001f, light->outerConeAngle.getCosine() - light->innerConeAngle.getCosine());
+ MAX(0.001f, light->outerConeAngle.getCosine() - light->innerConeAngle.getCosine());
cone = CLIP(cone, 0.0f, 1.0f);
if (cone <= 0) {
diff --git a/engines/stark/gfx/tinygl.cpp b/engines/stark/gfx/tinygl.cpp
index 39f3bd9a68..16bc9c01eb 100644
--- a/engines/stark/gfx/tinygl.cpp
+++ b/engines/stark/gfx/tinygl.cpp
@@ -73,15 +73,11 @@ void TinyGLDriver::setScreenViewport(bool noScaling) {
}
void TinyGLDriver::setViewport(const Common::Rect &rect) {
- _viewport = Common::Rect(
- _screenViewport.width() * rect.width() / kOriginalWidth,
- _screenViewport.height() * rect.height() / kOriginalHeight
- );
-
- _viewport.translate(
- _screenViewport.left + _screenViewport.width() * rect.left / kOriginalWidth,
- _screenViewport.top + _screenViewport.height() * rect.top / kOriginalHeight
- );
+ _viewport = Common::Rect(_screenViewport.width() * rect.width() / kOriginalWidth,
+ _screenViewport.height() * rect.height() / kOriginalHeight);
+
+ _viewport.translate(_screenViewport.left + _screenViewport.width() * rect.left / kOriginalWidth,
+ _screenViewport.top + _screenViewport.height() * rect.top / kOriginalHeight);
_unscaledViewport = rect;
diff --git a/engines/stark/gfx/tinyglactor.cpp b/engines/stark/gfx/tinyglactor.cpp
index 82763035b2..fddbac80aa 100644
--- a/engines/stark/gfx/tinyglactor.cpp
+++ b/engines/stark/gfx/tinyglactor.cpp
@@ -55,9 +55,9 @@ void TinyGLActorRenderer::render(const Math::Vector3d &position, float direction
_model->updateBoundingBox();
bool drawShadow = false;
- if (_castsShadow
- && StarkScene->shouldRenderShadows()
- && StarkSettings->getBoolSetting(Settings::kShadow)) {
+ if (_castsShadow &&
+ StarkScene->shouldRenderShadows() &&
+ StarkSettings->getBoolSetting(Settings::kShadow)) {
drawShadow = true;
}
@@ -125,19 +125,19 @@ void TinyGLActorRenderer::render(const Math::Vector3d &position, float direction
Math::Vector3d position1 = Math::Vector3d(vertex.pos1x, vertex.pos1y, vertex.pos1z);
Math::Vector3d position2 = Math::Vector3d(vertex.pos2x, vertex.pos2y, vertex.pos2z);
Math::Vector3d bone1Position = Math::Vector3d(bones[bone1]->_animPos.x(),
- bones[bone1]->_animPos.y(),
- bones[bone1]->_animPos.z());
+ bones[bone1]->_animPos.y(),
+ bones[bone1]->_animPos.z());
Math::Vector3d bone2Position = Math::Vector3d(bones[bone2]->_animPos.x(),
- bones[bone2]->_animPos.y(),
- bones[bone2]->_animPos.z());
+ bones[bone2]->_animPos.y(),
+ bones[bone2]->_animPos.z());
Math::Quaternion bone1Rotation = Math::Quaternion(bones[bone1]->_animRot.x(),
- bones[bone1]->_animRot.y(),
- bones[bone1]->_animRot.z(),
- bones[bone1]->_animRot.w());
+ bones[bone1]->_animRot.y(),
+ bones[bone1]->_animRot.z(),
+ bones[bone1]->_animRot.w());
Math::Quaternion bone2Rotation = Math::Quaternion(bones[bone2]->_animRot.x(),
- bones[bone2]->_animRot.y(),
- bones[bone2]->_animRot.z(),
- bones[bone2]->_animRot.w());
+ bones[bone2]->_animRot.y(),
+ bones[bone2]->_animRot.z(),
+ bones[bone2]->_animRot.w());
float boneWeight = vertex.boneWeight;
Math::Vector3d normal = Math::Vector3d(vertex.normalx, vertex.normaly, vertex.normalz);
@@ -152,9 +152,9 @@ void TinyGLActorRenderer::render(const Math::Vector3d &position, float direction
vertex.z = modelPosition.z();
Math::Vector4d modelEyePosition;
modelEyePosition = modelViewMatrix * Math::Vector4d(modelPosition.x(),
- modelPosition.y(),
- modelPosition.z(),
- 1.0);
+ modelPosition.y(),
+ modelPosition.z(),
+ 1.0);
// Compute the vertex normal in eye-space
Math::Vector3d n1 = normal;
bone1Rotation.transform(n1);
@@ -433,14 +433,14 @@ bool TinyGLActorRenderer::getDirectionalLightContribution(LightEntry *light, Mat
return true;
}
-bool TinyGLActorRenderer::getSpotLightContribution(LightEntry *light,
- const Math::Vector3d &actorPosition, Math::Vector3d &direction) {
+bool TinyGLActorRenderer::getSpotLightContribution(LightEntry *light, const Math::Vector3d &actorPosition,
+ Math::Vector3d &direction) {
Math::Vector3d lightToActor = actorPosition - light->position;
lightToActor.normalize();
float cosAngle = MAX(0.0f, lightToActor.dotProduct(light->direction));
float cone = (cosAngle - light->innerConeAngle.getCosine()) /
- MAX(0.001f, light->outerConeAngle.getCosine() - light->innerConeAngle.getCosine());
+ MAX(0.001f, light->outerConeAngle.getCosine() - light->innerConeAngle.getCosine());
cone = CLIP(cone, 0.0f, 1.0f);
if (cone <= 0) {
More information about the Scummvm-git-logs
mailing list