Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void draw_surface(int id, gs_scalar x, gs_scalar y, int color, gs_scalar alpha)
- {
- int w=surface_get_width(id);
- int h=surface_get_height(id);
- draw_primitive_begin_texture(pr_trianglestrip, surface_get_texture(id));
- draw_vertex_texture_color(x,y,0,1,color,alpha);
- draw_vertex_texture_color(x+w,y,1,1,color,alpha);
- draw_vertex_texture_color(x,y+h,0,0,color,alpha);
- draw_vertex_texture_color(x+w,y+h,1,0,color,alpha);
- draw_primitive_end();
- }
- void draw_surface_ext(int id,gs_scalar x, gs_scalar y,gs_scalar xscale, gs_scalar yscale,double rot,int color,gs_scalar alpha)
- {
- const gs_scalar w=surface_get_width(id)*xscale, h=surface_get_height(id)*yscale;
- rot *= M_PI/180;
- gs_scalar ulcx = x + xscale * cos(M_PI+rot) + yscale * cos(M_PI/2+rot),
- ulcy = y - yscale * sin(M_PI+rot) - yscale * sin(M_PI/2+rot);
- draw_primitive_begin_texture(pr_trianglestrip, surface_get_texture(id));
- draw_vertex_texture_color(ulcx,ulcy,0,1,color,alpha);
- draw_vertex_texture_color(ulcx + w*cos(rot), ulcy - w*sin(rot),1,1,color,alpha);
- ulcx += h * cos(3*M_PI/2 + rot);
- ulcy -= h * sin(3*M_PI/2 + rot);
- draw_vertex_texture_color(ulcx,ulcy,0,0,color,alpha);
- draw_vertex_texture_color(ulcx + w*cos(rot), ulcy - w*sin(rot),1,0,color,alpha);
- draw_primitive_end();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement