diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index fd3e5e508e6..760af5100ce 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -7855,7 +7855,7 @@ void RasterizerGLES2::_debug_draw_shadow(GLuint tex, const Rect2& p_rect) { - Matrix32 modelview; + Transform2D modelview; modelview.translate(p_rect.pos.x, p_rect.pos.y); canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX, modelview); glBindTexture(GL_TEXTURE_2D,tex); @@ -8073,8 +8073,8 @@ void RasterizerGLES2::canvas_begin() { canvas_transform.scale( Vector3( 2.0f / viewport.width, csy * -2.0f / viewport.height, 1.0f ) ); canvas_shader.set_uniform(CanvasShaderGLES2::PROJECTION_MATRIX,canvas_transform); - canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX,Matrix32()); - canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Matrix32()); + canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX,Transform2D()); + canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Transform2D()); canvas_opacity=1.0; canvas_blend_mode=VS::MATERIAL_BLEND_MODE_MIX; @@ -8138,11 +8138,11 @@ void RasterizerGLES2::canvas_set_blend_mode(VS::MaterialBlendMode p_mode) { } -void RasterizerGLES2::canvas_begin_rect(const Matrix32& p_transform) { +void RasterizerGLES2::canvas_begin_rect(const Transform2D& p_transform) { canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX,p_transform); - canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Matrix32()); + canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Transform2D()); } @@ -8670,7 +8670,7 @@ void RasterizerGLES2::canvas_draw_polygon(int p_vertex_count, const int* p_indic }; -void RasterizerGLES2::canvas_set_transform(const Matrix32& p_transform) { +void RasterizerGLES2::canvas_set_transform(const Transform2D& p_transform) { canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,p_transform); @@ -8880,7 +8880,7 @@ RID RasterizerGLES2::canvas_light_shadow_buffer_create(int p_width) { return canvas_light_shadow_owner.make_rid(cls); } -void RasterizerGLES2::canvas_light_shadow_buffer_update(RID p_buffer, const Matrix32& p_light_xform, int p_light_mask,float p_near, float p_far, CanvasLightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache) { +void RasterizerGLES2::canvas_light_shadow_buffer_update(RID p_buffer, const Transform2D& p_light_xform, int p_light_mask,float p_near, float p_far, CanvasLightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache) { CanvasLightShadow *cls = canvas_light_shadow_owner.get(p_buffer); ERR_FAIL_COND(!cls); @@ -9602,7 +9602,7 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX,ci->final_transform); - canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Matrix32()); + canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Transform2D()); bool reclip=false; @@ -9715,7 +9715,7 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const } canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX,ci->final_transform); - canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Matrix32()); + canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Transform2D()); canvas_shader.set_uniform(CanvasShaderGLES2::PROJECTION_MATRIX,canvas_transform); if (canvas_use_modulate) canvas_shader.set_uniform(CanvasShaderGLES2::MODULATE,canvas_modulate); @@ -9782,7 +9782,7 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const } canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX,ci->final_transform); - canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Matrix32()); + canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Transform2D()); if (canvas_use_modulate) canvas_shader.set_uniform(CanvasShaderGLES2::MODULATE,canvas_modulate); diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index c6057bfd889..f04b0355609 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -1630,7 +1630,7 @@ public: virtual void canvas_set_opacity(float p_opacity); virtual void canvas_set_blend_mode(VS::MaterialBlendMode p_mode); - virtual void canvas_begin_rect(const Matrix32& p_transform); + virtual void canvas_begin_rect(const Transform2D& p_transform); virtual void canvas_set_clip(bool p_clip, const Rect2& p_rect); virtual void canvas_end_rect(); virtual void canvas_draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width,bool p_antialiased); @@ -1638,7 +1638,7 @@ public: virtual void canvas_draw_style_box(const Rect2& p_rect, const Rect2& p_src_region, RID p_texture,const float *p_margins, bool p_draw_center=true,const Color& p_modulate=Color(1,1,1)); virtual void canvas_draw_primitive(const Vector& p_points, const Vector& p_colors,const Vector& p_uvs, RID p_texture,float p_width); virtual void canvas_draw_polygon(int p_vertex_count, const int* p_indices, const Vector2* p_vertices, const Vector2* p_uvs, const Color* p_colors,const RID& p_texture,bool p_singlecolor); - virtual void canvas_set_transform(const Matrix32& p_transform); + virtual void canvas_set_transform(const Transform2D& p_transform); virtual void canvas_render_items(CanvasItem *p_item_list,int p_z,const Color& p_modulate,CanvasLight *p_light); virtual void canvas_debug_viewport_shadows(CanvasLight* p_lights_with_shadow); @@ -1647,7 +1647,7 @@ public: //buffer virtual RID canvas_light_shadow_buffer_create(int p_width); - virtual void canvas_light_shadow_buffer_update(RID p_buffer, const Matrix32& p_light_xform, int p_light_mask,float p_near, float p_far, CanvasLightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache); + virtual void canvas_light_shadow_buffer_update(RID p_buffer, const Transform2D& p_light_xform, int p_light_mask,float p_near, float p_far, CanvasLightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache); //occluder virtual RID canvas_light_occluder_create(); diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h index ea9958741ae..509f9a82b4d 100644 --- a/drivers/gles2/shader_gles2.h +++ b/drivers/gles2/shader_gles2.h @@ -213,7 +213,7 @@ private: case Variant::MATRIX32: { - Matrix32 tr=p_value; + Transform2D tr=p_value; GLfloat matrix[16]={ /* build a 16x16 matrix */ tr.elements[0][0], tr.elements[0][1], diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index e658fbbe88d..c10611c9619 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1138,7 +1138,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list,int p_z,const state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX,state.final_transform); - state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,Matrix32()); + state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,Transform2D()); state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE,state.canvas_item_modulate); glBlendEquation(GL_FUNC_ADD);