Working on web version
This commit is contained in:
1 parent
3d3c3b2a36
commit
e310822462
20 files changed
+432
-328
No files matched your search
+10
-1
@@ -9,7 +9,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include <cfloat>
|
||||
#include "GameConstants.h"
|
||||
|
||||
|
||||
@@ -449,19 +449,23 @@ namespace ZL
|
||||
renderer.RenderUniform3fv("uLightDir", lightDirCamera.data());
|
||||
#endif
|
||||
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
glBindTexture(GL_TEXTURE_2D, roomTexture->getTexID());
|
||||
renderer.DrawVertexRenderStruct(roomMesh);
|
||||
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
for (auto& [name, gameObj] : gameObjects) {
|
||||
glBindTexture(GL_TEXTURE_2D, gameObj.texture->getTexID());
|
||||
renderer.DrawVertexRenderStruct(gameObj.mesh);
|
||||
}
|
||||
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
for (auto& intObj : interactiveObjects) {
|
||||
if (intObj.isActive) {
|
||||
intObj.draw(renderer);
|
||||
}
|
||||
}
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
|
||||
#ifdef DEBUG_LIGHT
|
||||
// In debug-light mode characters use the plain shaders (draw normally
|
||||
@@ -470,9 +474,14 @@ namespace ZL
|
||||
for (auto& npc : npcs) npc->draw(renderer);
|
||||
#else
|
||||
// Characters use their own shadow-aware shaders
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
|
||||
if (player) player->drawWithShadow(renderer, lightFromCamera, shadowMap->getDepthTexture(), lightDirCamera);
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
|
||||
for (auto& npc : npcs) npc->drawWithShadow(renderer, lightFromCamera, shadowMap->getDepthTexture(), lightDirCamera);
|
||||
#endif
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
|
||||
renderer.PopMatrix();
|
||||
renderer.PopProjectionMatrix();
|
||||
|
||||
Reference in new issue
Block a user