Пример #1
0
 public static void draw_tile( ClassTexture texture, CompoundCorners uv, 
     CompoundVector2 pos, CompoundVector2 size, int render_flags)
 {
     Bard.log("TODO: NativeTexture::draw_tile()");
 }
Пример #2
0
 public static void draw_tile( ClassTexture texture, CompoundCorners uv, 
     CompoundVector2 pos, CompoundVector2 size, CompoundRender render_flags)
 {
     draw_tile( texture, uv, pos, size, render_flags.property_flags );
 }
Пример #3
0
        public static void draw( ClassTexture texture, CompoundCorners uv, CompoundQuad vertices,
            CompoundColorGradient colors, CompoundRender render_flags, CompoundBlend blend_fn)
        {
            DrawBuffer.set_render_flags( render_flags.property_flags,
            blend_fn.property_src_blend, blend_fn.property_dest_blend );
              DrawBuffer.set_textured_triangle_mode( texture, null );

              Vector3 pt1 = Plasmacore.v3( vertices.property_top_left );
              Vector3 pt2 = Plasmacore.v3( vertices.property_top_right );
              Vector3 pt3 = Plasmacore.v3( vertices.property_bottom_right );
              Vector3 pt4 = Plasmacore.v3( vertices.property_bottom_left );

              NativeTransformManager.update();
              pt1 = NativeTransformManager.transform.transform( pt1 );
              pt2 = NativeTransformManager.transform.transform( pt2 );
              pt3 = NativeTransformManager.transform.transform( pt3 );
              pt4 = NativeTransformManager.transform.transform( pt4 );

              int argb = colors.property_top_left.property_argb;
              Color c1 = new Color((argb>>16)&255,(argb>>8)&255,argb&255,(argb>>24)&255);
              argb = colors.property_top_right.property_argb;
              Color c2 = new Color((argb>>16)&255,(argb>>8)&255,argb&255,(argb>>24)&255);
              argb = colors.property_bottom_right.property_argb;
              Color c3 = new Color((argb>>16)&255,(argb>>8)&255,argb&255,(argb>>24)&255);
              argb = colors.property_bottom_left.property_argb;
              Color c4 = new Color((argb>>16)&255,(argb>>8)&255,argb&255,(argb>>24)&255);

              float uv_a_x = (float) uv.property_top_left.property_x;
              float uv_a_y = (float) uv.property_top_left.property_y;
              float uv_b_x = (float) uv.property_bottom_right.property_x;
              float uv_b_y = (float) uv.property_bottom_right.property_y;

              VertexPositionColorTexture v1, v2, v3, v4;
              v1 = new VertexPositionColorTexture( pt1, c1, new Vector2( uv_a_x, uv_a_y ) );
              v2 = new VertexPositionColorTexture( pt2, c2, new Vector2( uv_b_x, uv_a_y ) );
              v3 = new VertexPositionColorTexture( pt3, c3, new Vector2( uv_b_x, uv_b_y ) );
              v4 = new VertexPositionColorTexture( pt4, c4, new Vector2( uv_a_x, uv_b_y ) );

              DrawBuffer.add( v1, v2, v4 );
              DrawBuffer.add( v4, v2, v3 );
        }
Пример #4
0
 public static void draw( ClassTexture texture, CompoundCorners uv, CompoundVector2 size,
     CompoundColor color, CompoundRender render_flags, CompoundBlend blend_fn,
     ClassTexture alpha_texture, CompoundCorners alpha_uv)
 {
     Bard.log("TODO: NativeTexture::draw()");
 }
Пример #5
0
        public static void draw( ClassTexture texture, CompoundCorners uv, CompoundVector2 size,
            CompoundColor color, CompoundRender render_flags, CompoundBlend blend_fn)
        {
            DrawBuffer.set_render_flags( render_flags.property_flags,
            blend_fn.property_src_blend, blend_fn.property_dest_blend );
              DrawBuffer.set_textured_triangle_mode( texture, null );

              Vector3 pt1 = new Vector3(                       0, 0, 0 );
              Vector3 pt2 = new Vector3( (float) size.property_x, 0, 0 );
              Vector3 pt3 = new Vector3( (float) size.property_x, (float) size.property_y, 0 );
              Vector3 pt4 = new Vector3(                       0, (float) size.property_y, 0 );

              NativeTransformManager.update();
              pt1 = NativeTransformManager.transform.transform( pt1 );
              pt2 = NativeTransformManager.transform.transform( pt2 );
              pt3 = NativeTransformManager.transform.transform( pt3 );
              pt4 = NativeTransformManager.transform.transform( pt4 );

              Color c;
              //if ((render_flags.property_flags & DrawBuffer.RENDER_FLAG_FIXED_COLOR) != 0)
              //{
            //c = Color.White;
              //}
              //else
              //{
              int argb = color.property_argb;
              c = new Color((argb>>16)&255,(argb>>8)&255,argb&255,(argb>>24)&255);
              //}

              float uv_a_x = (float) uv.property_top_left.property_x;
              float uv_a_y = (float) uv.property_top_left.property_y;
              float uv_b_x = (float) uv.property_bottom_right.property_x;
              float uv_b_y = (float) uv.property_bottom_right.property_y;

              VertexPositionColorTexture v1, v2, v3, v4;
              v1 = new VertexPositionColorTexture( pt1, c, new Vector2( uv_a_x, uv_a_y ) );
              v2 = new VertexPositionColorTexture( pt2, c, new Vector2( uv_b_x, uv_a_y ) );
              v3 = new VertexPositionColorTexture( pt3, c, new Vector2( uv_b_x, uv_b_y ) );
              v4 = new VertexPositionColorTexture( pt4, c, new Vector2( uv_a_x, uv_b_y ) );

              DrawBuffer.add( v1, v2, v4 );
              DrawBuffer.add( v4, v2, v3 );
        }