Revised some Core and Ray code...
This commit is contained in:
parent
394ee1f98e
commit
2f09cb9216
@ -183,23 +183,25 @@ package body core is
|
|||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure draw (data : in sprite;
|
procedure draw (data : in sprite := (others => 0);
|
||||||
x : in integer := 0;
|
x : in integer := 0;
|
||||||
y : in integer := 0;
|
y : in integer := 0;
|
||||||
u : in integer := 0;
|
u : in integer := 0;
|
||||||
v : in integer := 0;
|
v : in integer := 0;
|
||||||
width : in integer := 0;
|
width : in integer := 0;
|
||||||
height : in integer := 0;
|
height : in integer := 0;
|
||||||
state : in integer := 0;
|
state : in integer := 0;
|
||||||
factor : in integer := zoom;
|
factor : in integer := zoom;
|
||||||
tint : in ray.colour := (others => 255)) is
|
tint : in colour := (others => 255)) is
|
||||||
new_width : constant float := float ((if width = 0 then data.width else width));
|
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));
|
new_height : constant float := float ((if height = 0 then data.height else height));
|
||||||
|
--
|
||||||
|
new_tint : ray.colour := (ray.colour_range (tint.r), ray.colour_range (tint.g), ray.colour_range (tint.b), ray.colour_range (tint.a));
|
||||||
begin
|
begin
|
||||||
ray.draw_texture (data => texture_array (data.index),
|
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), new_width, new_height),
|
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)),
|
view => (float (x), float (y), new_width * float (factor), new_height * float (factor)),
|
||||||
tint => tint);
|
tint => new_tint);
|
||||||
end draw;
|
end draw;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
@ -207,13 +209,17 @@ package body core is
|
|||||||
procedure write (text : in string := "";
|
procedure write (text : in string := "";
|
||||||
x : in integer := 0;
|
x : in integer := 0;
|
||||||
y : in integer := 0;
|
y : in integer := 0;
|
||||||
data : in font) is
|
tint : in colour := (others => 255);
|
||||||
|
size : in integer := 0;
|
||||||
|
data : in font := (others => 0)) is
|
||||||
|
new_tint : ray.colour := (ray.colour_range (tint.r), ray.colour_range (tint.g), ray.colour_range (tint.b), ray.colour_range (tint.a));
|
||||||
begin
|
begin
|
||||||
ray.draw_text (data => font_array (data.index),
|
ray.draw_text (data => font_array (data.index),
|
||||||
text => c_string (text),
|
text => c_string (text),
|
||||||
view => (float ((icon - data.scale) / 2 + x), float ((icon - data.scale) / 2 + y)),
|
view => (float (x), float (y)),
|
||||||
scale => float (data.scale),
|
scale => float ((if size = 0 then data.scale else size)),
|
||||||
space => float (data.space));
|
space => float (data.space),
|
||||||
|
tint => new_tint);
|
||||||
end write;
|
end write;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
@ -27,6 +27,12 @@ package core is
|
|||||||
signal_left_control
|
signal_left_control
|
||||||
);
|
);
|
||||||
|
|
||||||
|
type colour_range is range 0 .. 2 ** 8 - 1;
|
||||||
|
|
||||||
|
for colour_range'size use 8;
|
||||||
|
|
||||||
|
type colour is record r, g, b, a : colour_range; end record;
|
||||||
|
|
||||||
subtype short_string is string (1 .. 24);
|
subtype short_string is string (1 .. 24);
|
||||||
subtype long_string is string (1 .. 72);
|
subtype long_string is string (1 .. 72);
|
||||||
|
|
||||||
@ -108,21 +114,23 @@ package core is
|
|||||||
function import_font (file_path : in string; scale, space : in integer) return font;
|
function import_font (file_path : in string; scale, space : in integer) return font;
|
||||||
function import_song (file_path : in string) return song;
|
function import_song (file_path : in string) return song;
|
||||||
|
|
||||||
procedure draw (data : in sprite;
|
procedure draw (data : in sprite := (others => 0);
|
||||||
x : in integer := 0;
|
x : in integer := 0;
|
||||||
y : in integer := 0;
|
y : in integer := 0;
|
||||||
u : in integer := 0;
|
u : in integer := 0;
|
||||||
v : in integer := 0;
|
v : in integer := 0;
|
||||||
width : in integer := 0;
|
width : in integer := 0;
|
||||||
height : in integer := 0;
|
height : in integer := 0;
|
||||||
state : in integer := 0;
|
state : in integer := 0;
|
||||||
factor : in integer := zoom;
|
factor : in integer := zoom;
|
||||||
tint : in ray.colour := (others => 255));
|
tint : in colour := (others => 255));
|
||||||
|
|
||||||
procedure write (text : in string := "";
|
procedure write (text : in string := "";
|
||||||
x : in integer := 0;
|
x : in integer := 0;
|
||||||
y : in integer := 0;
|
y : in integer := 0;
|
||||||
data : in font);
|
tint : in colour := (others => 255);
|
||||||
|
size : in integer := 0;
|
||||||
|
data : in font := (others => 0));
|
||||||
|
|
||||||
procedure play (index : in integer);
|
procedure play (index : in integer);
|
||||||
procedure stop (index : in integer);
|
procedure stop (index : in integer);
|
||||||
|
@ -105,7 +105,7 @@ procedure main is
|
|||||||
|
|
||||||
procedure introduction is
|
procedure introduction is
|
||||||
begin
|
begin
|
||||||
ui.write ("[-- Please press Spacebar to continue]", 0, 0);
|
ui.write ("[-- Please press Spacebar to continue]", 0, 0, 14, (102, 102, 102, 255));
|
||||||
end introduction;
|
end introduction;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
@ -230,9 +230,9 @@ package body ui is
|
|||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure write (text : in string; x, y : in integer) is
|
procedure write (text : in string; x, y : in integer; size : in natural := 0; tint : in core.colour := (others => 255)) is
|
||||||
begin
|
begin
|
||||||
core.write (text, x, y, font (active));
|
core.write (text, x, y, tint, font (active).scale, font (active));
|
||||||
end write;
|
end write;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
@ -311,7 +311,7 @@ package body ui is
|
|||||||
draw (text_lower_left, x, y + height - offset);
|
draw (text_lower_left, x, y + height - offset);
|
||||||
draw (text_lower_right, x + width - offset, y + height - offset);
|
draw (text_lower_right, x + width - offset, y + height - offset);
|
||||||
--
|
--
|
||||||
core.write (core.read_text_box, x, y, font (active));
|
write (core.read_text_box, x, y);
|
||||||
end draw_help_box;
|
end draw_help_box;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
@ -54,7 +54,7 @@ package ui is
|
|||||||
procedure configure;
|
procedure configure;
|
||||||
procedure synchronize;
|
procedure synchronize;
|
||||||
|
|
||||||
procedure write (text : in string; x, y : in integer);
|
procedure write (text : in string; x, y : in integer; size : in natural := 0; tint : in core.colour := (others => 255));
|
||||||
|
|
||||||
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer; action : core.pointer := core.idle'access);
|
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer; action : core.pointer := core.idle'access);
|
||||||
procedure draw_overicon (data : in core.sprite; description : in string; x, y : in integer; action : core.pointer := core.idle'access);
|
procedure draw_overicon (data : in core.sprite; description : in string; x, y : in integer; action : core.pointer := core.idle'access);
|
||||||
|
Loading…
Reference in New Issue
Block a user