|
|
@@ -184,21 +184,22 @@ package body core is |
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure draw (data : in sprite; |
|
|
|
x : in integer := 0; |
|
|
|
y : in integer := 0; |
|
|
|
u : in integer := 0; |
|
|
|
v : in integer := 0; |
|
|
|
width : in integer := 0; |
|
|
|
height : in integer := 0; |
|
|
|
state : in integer := 0) is |
|
|
|
resize : vector := (0, 0); |
|
|
|
x : in integer := 0; |
|
|
|
y : in integer := 0; |
|
|
|
u : in integer := 0; |
|
|
|
v : in integer := 0; |
|
|
|
width : in integer := 0; |
|
|
|
height : in integer := 0; |
|
|
|
state : in integer := 0; |
|
|
|
factor : in integer := zoom; |
|
|
|
tint : in ray.colour := (others => 255)) is |
|
|
|
new_width : constant float := float ((if width = 0 then data.width else width)); |
|
|
|
new_height : constant float := float ((if height = 0 then data.height else height)); |
|
|
|
begin |
|
|
|
resize.x := (if width = 0 then data.width else width); |
|
|
|
resize.y := (if height = 0 then data.height else height); |
|
|
|
-- |
|
|
|
ray.draw_texture (data => texture_array (data.index), |
|
|
|
uv => (float (if u = 0 then (animation_time mod data.frames) * data.width else u), float (v), float (resize.x), float (resize.y)), |
|
|
|
view => (float (x), float (y), float (resize.x) * float (zoom), float (resize.y) * float (zoom))); |
|
|
|
uv => (float (if u = 0 then (animation_time mod data.frames) * data.width else u), float (v), new_width, new_height), |
|
|
|
view => (float (x), float (y), new_width * float (factor), new_height * float (factor)), |
|
|
|
tint => tint); |
|
|
|
end draw; |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|