summaryrefslogtreecommitdiff
path: root/indra/newview/llterrainpaintmap.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2024-10-07 14:30:29 -0700
committerCosmic Linden <cosmic@lindenlab.com>2024-10-11 10:39:22 -0700
commit81cc4fa7d61e838413b912a4ed2d957cc65bcb46 (patch)
tree2be1a5e635a58667d784715ad8218ecdf5bcc1cf /indra/newview/llterrainpaintmap.cpp
parent642ace3c75d08cc55370374f5a091f0c8ff41a4c (diff)
secondlife/viewer#1883: (WIP/Alpha/WOMM) Fix some compiler and runtime errors
Diffstat (limited to 'indra/newview/llterrainpaintmap.cpp')
-rw-r--r--indra/newview/llterrainpaintmap.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/indra/newview/llterrainpaintmap.cpp b/indra/newview/llterrainpaintmap.cpp
index 6a57605325..d36e4ea657 100644
--- a/indra/newview/llterrainpaintmap.cpp
+++ b/indra/newview/llterrainpaintmap.cpp
@@ -447,7 +447,7 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertPaintQueueRGBAToRGB(LLViewerTextur
// View matrix
// Coordinates should be in pixels. 1.0f = 1 pixel on the framebuffer.
// Camera is centered in the middle of the framebuffer.
- glh::matrix4f view((GLfloat *) OGL_TO_CFR_ROTATION);
+ glm::mat4 view(glm::make_mat4((GLfloat*) OGL_TO_CFR_ROTATION));
{
LLViewerCamera camera;
const LLVector3 camera_origin(target_half_width, target_half_height, 0.5f);
@@ -456,7 +456,7 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertPaintQueueRGBAToRGB(LLViewerTextur
camera.setAspect(F32(scratch_target.getHeight()) / F32(scratch_target.getWidth()));
GLfloat ogl_matrix[16];
camera.getOpenGLTransform(ogl_matrix);
- view *= glh::matrix4f(ogl_matrix);
+ view *= glm::make_mat4(ogl_matrix);
}
LLGLDisable stencil(GL_STENCIL_TEST);
@@ -471,14 +471,14 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertPaintQueueRGBAToRGB(LLViewerTextur
// First, apply the paint map as the background
{
- glh::matrix4f model;
+ glm::mat4 model;
{
- model.set_scale(glh::vec3f((F32)tex.getWidth(), (F32)tex.getHeight(), 1.0f));
- model.set_translate(glh::vec3f(0.0f, 0.0f, 0.0f));
+ model = glm::scale(model, glm::vec3((F32)tex.getWidth(), (F32)tex.getHeight(), 1.0f));
+ model = glm::translate(model, glm::vec3(0.0f, 0.0f, 0.0f));
}
- glh::matrix4f modelview = view * model;
+ glm::mat4 modelview = view * model;
gGL.matrixMode(LLRender::MM_MODELVIEW);
- gGL.loadMatrix(modelview.m);
+ gGL.loadMatrix(glm::value_ptr(modelview));
shader.bindTexture(LLShaderMgr::DIFFUSE_MAP, &tex);
// We care about the whole paintmap, which is already a power of two.
@@ -505,14 +505,14 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertPaintQueueRGBAToRGB(LLViewerTextur
// Modelview matrix for the current paint
// View matrix is already computed. Just need the model matrix.
// Orthographic projection matrix is already updated
- glh::matrix4f model;
+ glm::mat4 model;
{
- model.set_scale(glh::vec3f(paint_in->mWidthX, paint_in->mWidthY, 1.0f));
- model.set_translate(glh::vec3f(paint_in->mStartX, paint_in->mStartY, 0.0f));
+ model = glm::scale(model, glm::vec3(paint_in->mWidthX, paint_in->mWidthY, 1.0f));
+ model = glm::translate(model, glm::vec3(paint_in->mStartX, paint_in->mStartY, 0.0f));
}
- glh::matrix4f modelview = view * model;
+ glm::mat4 modelview = view * model;
gGL.matrixMode(LLRender::MM_MODELVIEW);
- gGL.loadMatrix(modelview.m);
+ gGL.loadMatrix(glm::value_ptr(modelview));
// Generate temporary stamp texture from paint contents.
// Our stamp image needs to be a power of two.
@@ -663,7 +663,7 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertBrushQueueToPaintRGB(const LLViewe
// View matrix
// Coordinates should be in pixels. 1.0f = 1 pixel on the framebuffer.
// Camera is centered in the middle of the framebuffer.
- glh::matrix4f view((GLfloat *) OGL_TO_CFR_ROTATION);
+ glm::mat4 view(glm::make_mat4((GLfloat*)OGL_TO_CFR_ROTATION));
{
LLViewerCamera camera;
const LLVector3 camera_origin(target_half_width, target_half_height, 0.5f);
@@ -672,7 +672,7 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertBrushQueueToPaintRGB(const LLViewe
camera.setAspect(F32(scratch_target.getHeight()) / F32(scratch_target.getWidth()));
GLfloat ogl_matrix[16];
camera.getOpenGLTransform(ogl_matrix);
- view *= glh::matrix4f(ogl_matrix);
+ view *= glm::make_mat4(ogl_matrix);
}
LLGLDisable stencil(GL_STENCIL_TEST);
@@ -687,14 +687,14 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertBrushQueueToPaintRGB(const LLViewe
// First, apply the paint map as the background
{
- glh::matrix4f model;
+ glm::mat4 model;
{
- model.set_scale(glh::vec3f((F32)tex.getWidth(), (F32)tex.getHeight(), 1.0f));
- model.set_translate(glh::vec3f(0.0f, 0.0f, 0.0f));
+ model = glm::scale(model, glm::vec3((F32)tex.getWidth(), (F32)tex.getHeight(), 1.0f));
+ model = glm::translate(model, glm::vec3(0.0f, 0.0f, 0.0f));
}
- glh::matrix4f modelview = view * model;
+ glm::mat4 modelview = view * model;
gGL.matrixMode(LLRender::MM_MODELVIEW);
- gGL.loadMatrix(modelview.m);
+ gGL.loadMatrix(glm::value_ptr(modelview));
shader.bindTexture(LLShaderMgr::DIFFUSE_MAP, &tex);
// We care about the whole paintmap, which is already a power of two.
@@ -748,14 +748,14 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertBrushQueueToPaintRGB(const LLViewe
brush_start_x *= tex.getWidth() / region.getWidth();
brush_start_y *= tex.getHeight() / region.getWidth();
}
- glh::matrix4f model;
+ glm::mat4 model;
{
- model.set_scale(glh::vec3f(brush_width_x, brush_width_y, 1.0f));
- model.set_translate(glh::vec3f(brush_start_x, brush_start_y, 0.0f));
+ model = glm::scale(model, glm::vec3(brush_width_x, brush_width_y, 1.0f));
+ model = glm::translate(model, glm::vec3(brush_start_x, brush_start_y, 0.0f));
}
- glh::matrix4f modelview = view * model;
+ glm::mat4 modelview = view * model;
gGL.matrixMode(LLRender::MM_MODELVIEW);
- gGL.loadMatrix(modelview.m);
+ gGL.loadMatrix(glm::value_ptr(modelview));
// Apply the "brush" to the render target
{
@@ -842,11 +842,11 @@ template<typename T>
bool LLTerrainQueue<T>::enqueue(std::vector<std::shared_ptr<T>>& list)
{
constexpr bool dry_run = true;
- for (T::ptr_t& t : list)
+ for (auto& t : list)
{
if (!enqueue(t), dry_run) { return false; }
}
- for (T::ptr_t& t : list)
+ for (auto& t : list)
{
enqueue(t);
}