Merge pull request #7513 from djrm/compilation_fix

Matrix32 -> Transform2D
This commit is contained in:
Rémi Verschelde 2017-01-15 00:27:05 +01:00 committed by GitHub
commit a540e15cd1
4 changed files with 15 additions and 15 deletions

View file

@ -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); modelview.translate(p_rect.pos.x, p_rect.pos.y);
canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX, modelview); canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX, modelview);
glBindTexture(GL_TEXTURE_2D,tex); 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_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::PROJECTION_MATRIX,canvas_transform);
canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX,Matrix32()); canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX,Transform2D());
canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Matrix32()); canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Transform2D());
canvas_opacity=1.0; canvas_opacity=1.0;
canvas_blend_mode=VS::MATERIAL_BLEND_MODE_MIX; 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::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); 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); 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); CanvasLightShadow *cls = canvas_light_shadow_owner.get(p_buffer);
ERR_FAIL_COND(!cls); 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::MODELVIEW_MATRIX,ci->final_transform);
canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Matrix32()); canvas_shader.set_uniform(CanvasShaderGLES2::EXTRA_MATRIX,Transform2D());
bool reclip=false; 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::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); canvas_shader.set_uniform(CanvasShaderGLES2::PROJECTION_MATRIX,canvas_transform);
if (canvas_use_modulate) if (canvas_use_modulate)
canvas_shader.set_uniform(CanvasShaderGLES2::MODULATE,canvas_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::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) if (canvas_use_modulate)
canvas_shader.set_uniform(CanvasShaderGLES2::MODULATE,canvas_modulate); canvas_shader.set_uniform(CanvasShaderGLES2::MODULATE,canvas_modulate);

View file

@ -1630,7 +1630,7 @@ public:
virtual void canvas_set_opacity(float p_opacity); virtual void canvas_set_opacity(float p_opacity);
virtual void canvas_set_blend_mode(VS::MaterialBlendMode p_mode); 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_set_clip(bool p_clip, const Rect2& p_rect);
virtual void canvas_end_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); 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_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<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture,float p_width); virtual void canvas_draw_primitive(const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& 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_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_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); virtual void canvas_debug_viewport_shadows(CanvasLight* p_lights_with_shadow);
@ -1647,7 +1647,7 @@ public:
//buffer //buffer
virtual RID canvas_light_shadow_buffer_create(int p_width); 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 //occluder
virtual RID canvas_light_occluder_create(); virtual RID canvas_light_occluder_create();

View file

@ -213,7 +213,7 @@ private:
case Variant::MATRIX32: { case Variant::MATRIX32: {
Matrix32 tr=p_value; Transform2D tr=p_value;
GLfloat matrix[16]={ /* build a 16x16 matrix */ GLfloat matrix[16]={ /* build a 16x16 matrix */
tr.elements[0][0], tr.elements[0][0],
tr.elements[0][1], tr.elements[0][1],

View file

@ -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::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); state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE,state.canvas_item_modulate);
glBlendEquation(GL_FUNC_ADD); glBlendEquation(GL_FUNC_ADD);