summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-05-15 19:40:08 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-05-15 19:40:08 (GMT)
commit1ddff1ad3be164da64f578d8fb27294e9926dba3 (patch)
treeaa21ef720c1092da82a2c853069d30d88455a98b /src/interface.c
parentd8e7c82f1ca367ba05bc5ddd7af5d097a5f073e8 (diff)
downloadpowder-1ddff1ad3be164da64f578d8fb27294e9926dba3.zip
powder-1ddff1ad3be164da64f578d8fb27294e9926dba3.tar.gz
Runtime fullscreen toggle TODO: Fix bug that prevents from closing the window after a fullscreen toggle
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/interface.c b/src/interface.c
index 8021763..3bef348 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -4559,12 +4559,13 @@ void decorations_ui(pixel *vid_buf,pixel *decorations,int *bsx,int *bsy)
void simulation_ui(pixel * vid_buf)
{
int xsize = 300;
- int ysize = 114;
+ int ysize = 140;
int x0=(XRES-xsize)/2,y0=(YRES-MENUSIZE-ysize)/2,b=1,bq,mx,my;
- int new_scale;
+ int new_scale, new_kiosk;
ui_checkbox cb;
ui_checkbox cb2;
ui_checkbox cb3;
+ ui_checkbox cb4;
cb.x = x0+xsize-16;
cb.y = y0+23;
@@ -4580,6 +4581,11 @@ void simulation_ui(pixel * vid_buf)
cb3.y = y0+77;
cb3.focus = 0;
cb3.checked = (sdl_scale==2)?1:0;
+
+ cb4.x = x0+xsize-16;
+ cb4.y = y0+103;
+ cb4.focus = 0;
+ cb4.checked = (kiosk_enable==1)?1:0;
while (!sdl_poll())
{
@@ -4610,6 +4616,9 @@ void simulation_ui(pixel * vid_buf)
drawtext(vid_buf, x0+8, y0+80, "Large window", 255, 255, 255, 255);
drawtext(vid_buf, x0+12+textwidth("Large window"), y0+80, "Double window size for small screens", 255, 255, 255, 180);
//drawtext(vid_buf, x0+12, y0+68, "May also cause slow performance on older computers", 255, 255, 255, 180);
+
+ drawtext(vid_buf, x0+8, y0+106, "Fullscreen", 255, 255, 255, 255);
+ drawtext(vid_buf, x0+12+textwidth("Fullscreen"), y0+106, "Fill the entire screen", 255, 255, 255, 180);
//TODO: Options for Air and Normal gravity
//Maybe save/load defaults too.
@@ -4620,10 +4629,12 @@ void simulation_ui(pixel * vid_buf)
ui_checkbox_draw(vid_buf, &cb);
ui_checkbox_draw(vid_buf, &cb2);
ui_checkbox_draw(vid_buf, &cb3);
+ ui_checkbox_draw(vid_buf, &cb4);
sdl_blit(0, 0, (XRES+BARSIZE), YRES+MENUSIZE, vid_buf, (XRES+BARSIZE));
ui_checkbox_process(mx, my, b, bq, &cb);
ui_checkbox_process(mx, my, b, bq, &cb2);
ui_checkbox_process(mx, my, b, bq, &cb3);
+ ui_checkbox_process(mx, my, b, bq, &cb4);
if (b && !bq && mx>=x0 && mx<x0+xsize && my>=y0+ysize-16 && my<=y0+ysize)
break;
@@ -4636,8 +4647,9 @@ void simulation_ui(pixel * vid_buf)
legacy_enable = !cb.checked;
new_scale = (cb3.checked)?2:1;
- if(new_scale!=sdl_scale)
- set_scale(new_scale);
+ new_kiosk = (cb4.checked)?1:0;
+ if(new_scale!=sdl_scale || new_kiosk!=kiosk_enable)
+ set_scale(new_scale, new_kiosk);
if(ngrav_enable != cb2.checked)
{
if(cb2.checked)