Fixed camera movement and zooming tiny bug, added zoom in/out on keypad.
This commit is contained in:
parent
d14d5f719f
commit
2c21fb6b55
@ -297,7 +297,7 @@ package body core is
|
|||||||
cursor.x := ray.get_mouse_x;
|
cursor.x := ray.get_mouse_x;
|
||||||
cursor.y := ray.get_mouse_y;
|
cursor.y := ray.get_mouse_y;
|
||||||
--
|
--
|
||||||
--~ray.draw_fps (0, 0);
|
ray.draw_fps (0, 0);
|
||||||
--
|
--
|
||||||
ray.end_drawing;
|
ray.end_drawing;
|
||||||
--
|
--
|
||||||
|
@ -83,22 +83,26 @@ procedure main is
|
|||||||
procedure ui_default_style is begin ui.active := ui.default; end ui_default_style;
|
procedure ui_default_style is begin ui.active := ui.default; end ui_default_style;
|
||||||
procedure ui_steam_style is begin ui.active := ui.steam; end ui_steam_style;
|
procedure ui_steam_style is begin ui.active := ui.steam; end ui_steam_style;
|
||||||
procedure hide_top_menu is begin menu_remove; end hide_top_menu;
|
procedure hide_top_menu is begin menu_remove; end hide_top_menu;
|
||||||
|
procedure zoom_in is begin core.zoom := 2; end zoom_in;
|
||||||
|
procedure zoom_out is begin core.zoom := 1; end zoom_out;
|
||||||
|
|
||||||
signal_list : constant array (core.signal_code) of access procedure := (
|
signal_list : constant array (core.signal_code) of access procedure := (
|
||||||
core.signal_up => move_camera_up'access,
|
core.signal_up => move_camera_up'access,
|
||||||
core.signal_down => move_camera_down'access,
|
core.signal_down => move_camera_down'access,
|
||||||
core.signal_left => move_camera_left'access,
|
core.signal_left => move_camera_left'access,
|
||||||
core.signal_right => move_camera_right'access,
|
core.signal_right => move_camera_right'access,
|
||||||
core.signal_a => show_attribute_menu'access,
|
core.signal_a => show_attribute_menu'access,
|
||||||
core.signal_s => show_skill_menu'access,
|
core.signal_s => show_skill_menu'access,
|
||||||
core.signal_r => show_resource_menu'access,
|
core.signal_r => show_resource_menu'access,
|
||||||
core.signal_u => show_unit_menu'access,
|
core.signal_u => show_unit_menu'access,
|
||||||
core.signal_m => show_might_menu'access,
|
core.signal_m => show_might_menu'access,
|
||||||
core.signal_n => show_magic_menu'access,
|
core.signal_n => show_magic_menu'access,
|
||||||
core.signal_d => ui_default_style'access,
|
core.signal_d => ui_default_style'access,
|
||||||
core.signal_f => ui_steam_style'access,
|
core.signal_f => ui_steam_style'access,
|
||||||
core.signal_grave => hide_top_menu'access,
|
core.signal_grave => hide_top_menu'access,
|
||||||
others => idle'access
|
core.signal_kp_add => zoom_in'access,
|
||||||
|
core.signal_kp_subtract => zoom_out'access,
|
||||||
|
others => idle'access
|
||||||
);
|
);
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -113,14 +113,14 @@ package body world is
|
|||||||
u := core.base * biome'pos (map.kind) * 4;
|
u := core.base * biome'pos (map.kind) * 4;
|
||||||
v := core.base * map.tiles (core.camera.x + move_x, core.camera.y + move_y);
|
v := core.base * map.tiles (core.camera.x + move_x, core.camera.y + move_y);
|
||||||
--
|
--
|
||||||
core.draw (tiles, (move_x - 1) * core.base * core.zoom, (move_y - 1) * core.base * core.zoom, u, v, core.base, core.base);
|
core.draw (tiles, move_x * core.base * core.zoom, move_y * core.base * core.zoom, u, v, core.base, core.base);
|
||||||
end loop;
|
end loop;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
for index in 1 .. landmark_limit loop
|
for index in 1 .. landmark_limit loop
|
||||||
core.draw (data => landmarks (map.landmarks (index).index),
|
core.draw (data => landmarks (map.landmarks (index).index),
|
||||||
x => map.landmarks (index).x - core.camera.x * core.base,
|
x => (map.landmarks (index).x - core.camera.x * core.base) * core.zoom,
|
||||||
y => map.landmarks (index).y - core.camera.y * core.base);
|
y => (map.landmarks (index).y - core.camera.y * core.base) * core.zoom);
|
||||||
end loop;
|
end loop;
|
||||||
end draw;
|
end draw;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user