Free Hero Mesh

Diff
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Differences From Artifact [fed1a85264]:

To Artifact [71afcff0a8]:


593
594
595
596
597
598
599

600
601
602
603
604
605
606

static void test_mode(void) {
  Uint32 n=0;
  SDLKey k;
  SDL_Event ev;
  char buf[32];
  const UserCommand*uc;

  set_cursor(XC_tcross);
  SDL_LockSurface(screen);
  draw_text(0,0,"Hello, World!",0xF0,0xFF);
  SDL_UnlockSurface(screen);
  SDL_Flip(screen);
  while(SDL_WaitEvent(&ev)) switch(ev.type) {
    case SDL_KEYDOWN:







>







593
594
595
596
597
598
599
600
601
602
603
604
605
606
607

static void test_mode(void) {
  Uint32 n=0;
  SDLKey k;
  SDL_Event ev;
  char buf[32];
  const UserCommand*uc;
  int i;
  set_cursor(XC_tcross);
  SDL_LockSurface(screen);
  draw_text(0,0,"Hello, World!",0xF0,0xFF);
  SDL_UnlockSurface(screen);
  SDL_Flip(screen);
  while(SDL_WaitEvent(&ev)) switch(ev.type) {
    case SDL_KEYDOWN:
631
632
633
634
635
636
637


638
639
640
641
642
643
644
          goto keytest;
        case SDLK_p:
          sqlite3_exec(userdb,"SELECT * FROM `PICTURES`;",test_sql_callback,0,0);
          break;
        case SDLK_q:
          exit(0);
          break;


        case SDLK_t:
          puts(screen_prompt("Testing screen_prompt()")?:"No output.");
          break;
      }
      break;
    case SDL_MOUSEBUTTONDOWN:
      draw_picture(ev.button.x,ev.button.y,n);







>
>







632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
          goto keytest;
        case SDLK_p:
          sqlite3_exec(userdb,"SELECT * FROM `PICTURES`;",test_sql_callback,0,0);
          break;
        case SDLK_q:
          exit(0);
          break;
        case SDLK_s:
          goto scrolltest;
        case SDLK_t:
          puts(screen_prompt("Testing screen_prompt()")?:"No output.");
          break;
      }
      break;
    case SDL_MOUSEBUTTONDOWN:
      draw_picture(ev.button.x,ev.button.y,n);
677
678
679
680
681
682
683



































684
685
686
687
688
689
690
        default: printf("<Unknown>\n");
      }
      break;
    case SDL_QUIT:
      exit(0);
      break;
  }



































}

static void do_sql_mode(void) {
  int m=sqlite3_limit(userdb,SQLITE_LIMIT_SQL_LENGTH,-1);
  char*txt;
  int n=0;
  int c;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
        default: printf("<Unknown>\n");
      }
      break;
    case SDL_QUIT:
      exit(0);
      break;
  }
  fatal("An error occurred waiting for events.\n");
scrolltest:
  SDL_FillRect(screen,0,0xF2);
  i=0;
  scrollbar(&i,10,n,0,0);
  draw_picture(16,screen->h/10,1);
  draw_picture(16,(2*screen->h)/10,2);
  draw_picture(16,(3*screen->h)/10,3);
  SDL_Flip(screen);
  set_cursor(XC_arrow);
  while(SDL_WaitEvent(&ev)) switch(ev.type) {
    case SDL_KEYDOWN:
      if(ev.key.keysym.sym==SDLK_SPACE) exit(0);
      break;
    case SDL_MOUSEBUTTONDOWN:
    case SDL_MOUSEBUTTONUP:
      scrollbar(&i,10,n,&ev,0);
      printf("scroll %d %d\n",i,n);
      break;
    case SDL_MOUSEMOTION:
      if(!scrollbar(&i,10,n,&ev,0)) set_cursor(XC_arrow);
      break;
    case SDL_VIDEOEXPOSE:
      SDL_FillRect(screen,0,0xF2);
      scrollbar(&i,10,n,&ev,0);
      draw_picture(16,screen->h/10,1);
      draw_picture(16,(2*screen->h)/10,2);
      draw_picture(16,(3*screen->h)/10,3);
      SDL_Flip(screen);
      break;
    case SDL_QUIT:
      exit(0);
      break;
  }
  fatal("An error occurred waiting for events.\n");
}

static void do_sql_mode(void) {
  int m=sqlite3_limit(userdb,SQLITE_LIMIT_SQL_LENGTH,-1);
  char*txt;
  int n=0;
  int c;