home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 January / VPR9801A.ISO / Ffilly / GOMAC009 / 4KOMA.TFY < prev    next >
Text File  |  1997-09-26  |  3KB  |  160 lines

  1. #info INAM "それゆけ!フィリーちゃん 第8話"
  2.  
  3. int sClick;
  4. int pic[],basePic;
  5. int zoomPic;
  6. int mainWin,zoomWin;
  7. int picW,picH,picH0;
  8. int sc,zoom;
  9. int koma,title;
  10. str file[];
  11. int bgms;
  12. str bgm;
  13.  
  14. main(){
  15.     int backPic;
  16.     int cast,i;
  17.  
  18.     loadIni();
  19.     sc=1;
  20.     sClick=LoadRsc("101.wav");
  21.     if(WinInfo(1)<768)sc=2;
  22.     loadPic();
  23.     picW=PicWidth(pic[1]);
  24.     picH=PicHeight(pic[1]);
  25.     if(title!=0)makeTitle();
  26.     picH0=PicHeight(pic[0]);
  27.     backPic=CreatePic(pic[0],picW,picH0+picH);
  28.     MoveSPic(pic[0],0,0,picW,picH0,backPic,0,0,picW,picH0);
  29.     basePic=CreatePic(backPic);
  30.     PutCast(backPic,basePic);
  31.     cast=PutCast(pic[1],basePic,0,picH0);
  32.     playBGM();
  33.     mainWin=OpenWin(basePic);
  34.     i=1;
  35.     mes(KEY_DOWN){
  36.         step{
  37.             zoom=1;
  38.             zoomin();
  39.             ,
  40.             zoom=0;
  41.             zoomin();
  42.         }
  43.     }
  44.     mes(RBDBLCLK){
  45.         exit();
  46.     }
  47.     mes(LBDOWN){
  48.         i=i+1;
  49.         if(i==koma+2){
  50.             exit();
  51.             i=i-1;
  52.         }
  53.         if(i==koma+1)lastMes();
  54.         else MoveCast(cast,pic[i],0,picH0);
  55.         PlayRsc(sClick);
  56.     }
  57.     mes(RBDOWN){
  58.         i=i-1;
  59.         if(i==0){
  60.             exit();
  61.             i=i+1;
  62.         }
  63.         else MoveCast(cast,pic[i],0,picH0);
  64.         PlayRsc(sClick);
  65.     }
  66. }
  67.  
  68. int loadPic(){
  69.     int i,pic_;
  70.     int picW_,picH_;
  71.     for(i=title;i<=koma;i=i+1){
  72.         pic_=LoadPic(file[i]);
  73.         picW_=PicWidth(pic_);
  74.         picH_=PicHeight(pic_);
  75.         pic[i]=CreatePic(pic_,picW_/sc,picH_/sc);
  76.         MoveSPic(pic_,0,0,picW_,picH_,pic[i],0,0,picW_/sc,picH_/sc);
  77.         DelPic(pic_);
  78.     }
  79. }
  80.  
  81. int lastMes(){
  82.     SetFont(144/sc,"MS ゴシック",128,0,0,0,700);
  83.     BackMode(1);
  84.     TextColor(0,0,0);
  85.     TextWrite("おしまい",basePic,20/sc+2,500/sc+2);
  86.     TextColor(255,0,0);
  87.     TextWrite("おしまい",basePic,20/sc,500/sc);
  88. }
  89.  
  90. int playBGM(){
  91.     if(bgms==1){
  92.         mes(MIDI_END){
  93.             PlayMIDI(bgm);
  94.         }
  95.         PlayMIDI(bgm);
  96.     }
  97. }
  98.  
  99. int exit(){
  100.     int ans;
  101.     ans=MsgBox("終了しますか?",0x24);
  102.     if(ans==7)return;
  103.     CloseWinAll();
  104.     ExitTitle();
  105.     del_all;
  106.     del_me;
  107. }
  108.  
  109. int playSE(){
  110.     
  111. }
  112.  
  113. int zoomin(){
  114.     if(zoom==1){
  115.         int scz;
  116.         int i,j;
  117.         scz=2;
  118.         zoomPic=CreatePic(basePic,picW+10,(picH0+picH*2)/scz);
  119.         SetPaintColor( 0xffffff );
  120.         SetLineSize(1);
  121.         DrawRect(zoomPic,0,0,picW+10,(picH0+picH*2)/scz);
  122.         MoveSPic(pic[0],0,0,picW,picH0,zoomPic,picW/4+5,0,picW/scz,picH0/scz);
  123.         for(i=0;i<4;i=i+1){
  124.             j=1-i/2;
  125.             MoveSPic(pic[i+1],0,0,picW,picH,zoomPic,j*(picW/2+10),((i%2)*picH+picH0)/scz,picW/scz,picH/scz);
  126.         }
  127.         zoomWin=OpenWin(zoomPic);
  128.         CloseWin(mainWin);
  129.     }
  130.     else if(zoom==0){
  131.         mainWin=OpenWin(basePic);
  132.         CloseWin(zoomWin);
  133.         DelPic(zoomPic);
  134.     }
  135. }
  136.  
  137. int loadIni(){
  138.     int i;
  139.     title=GetIniInt("4koma","title",1,"4koma.ini");
  140.     koma=GetIniInt("4koma","koma",4,"4koma.ini");
  141.     for(i=title;i<=koma;i=i+1){
  142.         file[i]=GetIniStr("4koma",StrPrint("koma%ld",i),"","4koma.ini");
  143.     }
  144.     bgm=GetIniStr("4koma","bgm","NO_BGM","4koma.ini");
  145.     if(IsExist(bgm)==0)bgms=0;
  146.     else bgms=1;
  147. }
  148.  
  149. int makeTitle(){
  150.     pic[0]=CreatePic(pic[1],picW/sc,200/sc);
  151.     SetPaintColor(0xffffff);
  152.     SetLineSize(1);
  153.     DrawRect(pic[0],0,0,picW/sc,200/sc);
  154.     SetFont(100/sc,"MS ゴシック",128,0,0,0,500);
  155.     BackMode(1);
  156.     BgColor(255,255,255);
  157.     TextColor(0,0,255);
  158.     TextWrite("4コママンガ",pic[0],10/sc,50/sc);
  159. }
  160.