summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-11-11 20:55:20 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-11-12 12:46:47 (GMT)
commit5b9faa39c0ff68bd25bae160cb3cad8d6efc672f (patch)
tree240fbdd6df37f06f5eccdb2d89213cd8fa4e15e6 /src/interface.c
parent05fbb924204e48188b3f5f5f6cdce60816472417 (diff)
downloadpowder-5b9faa39c0ff68bd25bae160cb3cad8d6efc672f.zip
powder-5b9faa39c0ff68bd25bae160cb3cad8d6efc672f.tar.gz
Fix a few things in stamps browser
Incorrect number of stamps per page, pause button visible, and one page too many when stamp_count is an integer multiple of per_page. Using GRID_X/Y since those are the values used in the rest of stamp_ui
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/interface.c b/src/interface.c
index 8311dd9..3b89c2a 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -1429,9 +1429,10 @@ fail:
int stamp_ui(pixel *vid_buf)
{
- int b=1,bq,mx,my,d=-1,i,j,k,x,gx,gy,y,w,h,r=-1,stamp_page=0,per_page=STAMP_X*STAMP_Y,page_count;
+ int b=1,bq,mx,my,d=-1,i,j,k,x,gx,gy,y,w,h,r=-1,stamp_page=0,per_page=GRID_X*GRID_Y,page_count;
char page_info[64];
- page_count = ceil((float)stamp_count/(float)per_page);
+ // stamp_count-1 to avoid an extra page when there are per_page stamps on each page
+ page_count = (stamp_count-1)/per_page+1;
while (!sdl_poll())
{
@@ -1447,7 +1448,7 @@ int stamp_ui(pixel *vid_buf)
mx /= sdl_scale;
my /= sdl_scale;
- clearrect(vid_buf, -1, -1, XRES+1, YRES+MENUSIZE+1);
+ clearrect(vid_buf, -1, -1, XRES+BARSIZE+1, YRES+MENUSIZE+1);
k = stamp_page*per_page;//0;
r = -1;
d = -1;