home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 November / VPR9811A.BIN / FFILLY / Gomac19 / 4koma.tfy < prev    next >
Text File  |  1998-08-26  |  5KB  |  187 lines

  1. #info INAM "それゆけ!フィリーちゃん・びゅーわー"
  2. #info IART "POCOPEN,GGB02243@niftyserve.or.jp;poco@yun.co.jp"
  3. #info ICOP "POCOPEN,GGB02243@niftyserve.or.jp;poco@yun.co.jp"
  4.  
  5. int sClick;
  6. int pic[],basePic;
  7. int zoomPic;
  8. int mainWin,zoomWin;
  9. int picW,picH,picH0;
  10. int sc,zoom;
  11. int koma,title;
  12. str file[];
  13. int bgms;
  14. str bgm;
  15. str LF;
  16. str name;
  17.  
  18. main(){
  19.     int backPic;
  20.     int cast,i;
  21.     LF=StrCode(0x0a);
  22.  
  23.     loadIni();
  24.     sc=1;
  25.     sClick=LoadRsc("101.wav");
  26.     if(WinInfo(1)<768)sc=2;
  27.     loadPic();
  28.     playBGM();
  29.     picW=PicWidth(pic[1]);
  30.     picH=PicHeight(pic[1]);
  31.     if(title!=0)makeTitle();
  32.     picH0=PicHeight(pic[0]);
  33.     backPic=CreatePic(pic[0],picW,picH0+picH);
  34.     MoveSPic(pic[0],0,0,picW,picH0,backPic,0,0,picW,picH0);
  35.     basePic=CreatePic(backPic);
  36.     PutCast(backPic,basePic);
  37.     cast=PutCast(pic[1],basePic,0,picH0);
  38.     CapTitle(name);
  39.     mainWin=OpenWin(basePic);
  40.     showHelp(); 
  41.    i=1;
  42.     mes(KEY_DOWN){
  43.         if(StrCode(MesP2)=="H"){
  44.             showHelp();
  45.         }
  46.         else{
  47.             step{
  48.                 zoom=1;
  49.                 zoomin();
  50.                 ,
  51.                 zoom=0;
  52.                 zoomin();
  53.             }
  54.         }
  55.     }
  56.     mes(RBDBLCLK){
  57.         exit();
  58.     }
  59.     mes(LBDOWN){
  60.         i=i+1;
  61.         if(i==koma+2){
  62.             exit();
  63.             i=i-1;
  64.         }
  65.         if(i==koma+1)lastMes();
  66.         else MoveCast(cast,pic[i],0,picH0);
  67.         PlayRsc(sClick);
  68.     }
  69.     mes(RBDOWN){
  70.         i=i-1;
  71.         if(i==0){
  72.             exit();
  73.             i=i+1;
  74.         }
  75.         else MoveCast(cast,pic[i],0,picH0);
  76.         PlayRsc(sClick);
  77.     }
  78. }
  79.  
  80. int loadPic(){
  81.     int i,pic_;
  82.     int picW_,picH_;
  83.     for(i=title;i<=koma;i=i+1){
  84.         pic_=LoadPic(file[i]);
  85.         picW_=PicWidth(pic_);
  86.         picH_=PicHeight(pic_);
  87.         pic[i]=CreatePic(pic_,picW_/sc,picH_/sc);
  88.         MoveSPic(pic_,0,0,picW_,picH_,pic[i],0,0,picW_/sc,picH_/sc);
  89.         DelPic(pic_);
  90.     }
  91. }
  92.  
  93. int lastMes(){
  94.     SetFont(144/sc,"MS ゴシック",128,0,0,0,700);
  95.     BackMode(1);
  96.     TextColor(0,0,0);
  97.     TextWrite("おしまい",basePic,20/sc+2,500/sc+2);
  98.     TextColor(255,0,0);
  99.     TextWrite("おしまい",basePic,20/sc,500/sc);
  100. }
  101.  
  102. int playBGM(){
  103.     if(bgms==1){
  104.         mes(MIDI_END){
  105.             PlayMIDI(bgm);
  106.         }
  107.         PlayMIDI(bgm);
  108.     }
  109. }
  110.  
  111. int exit(){
  112.     int ans;
  113.     ans=MsgBox("終了しますか?",0x24);
  114.     if(ans==7)return;
  115.     CloseWinAll();
  116.     ExitTitle();
  117.     del_all;
  118.     del_me;
  119. }
  120.  
  121. int playSE(){
  122.     
  123. }
  124.  
  125. int zoomin(){
  126.     if(zoom==1){
  127.         int scz;
  128.         int i,j;
  129.         scz=2;
  130.         zoomPic=CreatePic(basePic,picW+10,(picH0+picH*2)/scz);
  131.         SetPaintColor( 0xffffff );
  132.         SetLineSize(1);
  133.         DrawRect(zoomPic,0,0,picW+10,(picH0+picH*2)/scz);
  134.         MoveSPic(pic[0],0,0,picW,picH0,zoomPic,picW/4+5,0,picW/scz,picH0/scz);
  135.         for(i=0;i<4;i=i+1){
  136.             j=1-i/2;
  137.             MoveSPic(pic[i+1],0,0,picW,picH,zoomPic,j*(picW/2+10),((i%2)*picH+picH0)/scz,picW/scz,picH/scz);
  138.         }
  139.         zoomWin=OpenWin(zoomPic);
  140.         CloseWin(mainWin);
  141.     }
  142.     else if(zoom==0){
  143.         mainWin=OpenWin(basePic);
  144.         CloseWin(zoomWin);
  145.         DelPic(zoomPic);
  146.     }
  147. }
  148.  
  149. int loadIni(){
  150.     int i;
  151.     title=GetIniInt("4koma","title",1,"4koma.ini");
  152.     name=GetIniStr("4koma","name","4コマまんが","4koma.ini");
  153.     koma=GetIniInt("4koma","koma",4,"4koma.ini");
  154.     for(i=title;i<=koma;i=i+1){
  155.         file[i]=GetIniStr("4koma",StrPrint("koma%ld",i),"","4koma.ini");
  156.     }
  157.     bgm=GetIniStr("4koma","bgm","NO_BGM","4koma.ini");
  158.     if(IsExist(bgm)==0)bgms=0;
  159.     else bgms=1;
  160. }
  161.  
  162. int makeTitle(){
  163.     pic[0]=CreatePic(pic[1],picW/sc,200/sc);
  164.     SetPaintColor(0xffffff);
  165.     SetLineSize(1);
  166.     DrawRect(pic[0],0,0,picW/sc,200/sc);
  167.     SetFont(100/sc,"MS ゴシック",128,0,0,0,500);
  168.     BackMode(1);
  169.     BgColor(255,255,255);
  170.     TextColor(0,0,255);
  171.     TextWrite("4コママンガ",pic[0],10/sc,50/sc);
  172. }
  173.  
  174. int showHelp(){
  175.     MsgBox("それゆけ!フィリーちゃん・びゅーわー"+LF+
  176.            "------------------------------"+LF+
  177.            "・左クリックで次のコマへ進みます。  "+LF+
  178.            "・右クリックで前のコマに戻ります。  "+LF+
  179.            "・最後までいくと、終了するかどうか  "+LF+
  180.            "  を聴いてきます。「はい」で終了。  "+LF+
  181.            "・何かキーを押すと、全部のコマを    "+LF+
  182.            "  一緒に表示します。もう一度押すと  "+LF+
  183.            "  元に戻ります。                    "+LF+
  184.            "・[H]キーでこのヘルプを表示します。 "+LF+
  185.            "------------------------------"+LF+
  186.            "では、お楽しみください(^_^)         ");
  187. }