741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
|
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
|
+
-
-
+
+
|
i=strtol(v,0,10);
j=(screen->w-16)/070;
if(i<1) i=j;
if(i>j) i=j;
if(i>255) i=255;
columns=i;
}
if(!ll_head) ll_head="\xB3W \xB3H \xB3 TITLE";
// ID, ORD, CODE, WIDTH, HEIGHT, TITLE, SOLVED, SOLVABLE, ...
if(sqlite3_prepare_v2(userdb,"SELECT * FROM `LEVELS` WHERE `ORD` NOT NULL AND `ORD` >= ?1 ORDER BY `ORD`;",-1,&st,0)) {
screen_message(sqlite3_errmsg(userdb));
return 0;
}
set_cursor(XC_arrow);
redraw:
if(sel<0) sel=0;
if(sel>=level_nindex) sel=level_nindex-1;
SDL_FillRect(screen,0,0x02);
r.x=r.y=0;
r.w=screen->w;
r.h=24;
SDL_FillRect(screen,&r,0xF7);
SDL_LockSurface(screen);
draw_text(0,0,"<LMB/\x18\x19\x1A\x1B> Select <MMB/SP> Title <RMB/RET> Play <0-9> Find <ESC> Cancel",0xF7,0xF0);
draw_text(0,8,"<F1> Wide/Tall <F2> ID/Ord",0xF7,0xF0);
sqlite3_reset(st);
if(mo&1) {
scrmax=level_nindex;
draw_text(16,16,"\xB3 ORD \xB3W \xB3H \xB3 TITLE",0xF7,0xF1);
if(mo&2) draw_text(24,16," ID ",0xF7,0xF1);
draw_text(16+060,16,ll_head,0xF7,0xF1);
draw_text(16,16,mo&2?"\xB3 ID ":"\xB3 ORD ",0xF7,0xF1);
if(rescroll) {
if(sel<scroll) scroll=sel;
if(sel>=scroll+screen->h/8-3) scroll=sel+4-screen->h/8;
rescroll=0;
}
sqlite3_bind_int(st,1,scroll+1);
for(y=24;y<screen->h-7;y+=8) {
|