491
492
493
494
495
496
497
498
499
500
501
502
503
504
|
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
|
+
+
|
int scrollbar(int*cur,int page,int max,SDL_Event*ev,SDL_Rect*re) {
int x0=re?re->x:0;
int y0=re?re->y:0;
int x1=re?re->x+12:12;
int y1=re?re->y+re->h:screen->h;
int y;
double f;
max-=page;
if(max<0) max=0;
switch(ev?ev->type:SDL_VIDEOEXPOSE) {
case SDL_MOUSEMOTION:
if(ev->motion.x<x0 || ev->motion.x>x1 || ev->motion.y<y0 || ev->motion.y>=y1) return 0;
if(ev->motion.state&SDL_BUTTON(2)) {
y=ev->motion.y;
goto move;
} else if(ev->motion.state&SDL_BUTTON(1)) {
|