home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 October
/
VPR9710A.ISO
/
Ffilly
/
GOMAC006
/
4KOMA.TFY
< prev
next >
Wrap
Text File
|
1997-07-29
|
3KB
|
158 lines
int sClick;
int pic[],basePic;
int zoomPic;
int mainWin,zoomWin;
int picW,picH,picH0;
int sc,zoom;
int koma,title;
str file[];
int bgms;
str bgm;
main(){
int backPic;
int cast,i;
loadIni();
sc=1;
sClick=LoadRsc("101.wav");
if(WinInfo(1)<768)sc=2;
loadPic();
picW=PicWidth(pic[1]);
picH=PicHeight(pic[1]);
if(title!=0)makeTitle();
picH0=PicHeight(pic[0]);
backPic=CreatePic(pic[0],picW,picH0+picH);
MoveSPic(pic[0],0,0,picW,picH0,backPic,0,0,picW,picH0);
basePic=CreatePic(backPic);
PutCast(backPic,basePic);
cast=PutCast(pic[1],basePic,0,picH0);
playBGM();
mainWin=OpenWin(basePic);
i=1;
mes(KEY_DOWN){
step{
zoom=1;
zoomin();
,
zoom=0;
zoomin();
}
}
mes(RBDBLCLK){
exit();
}
mes(LBDOWN){
i=i+1;
if(i==koma+2){
exit();
i=i-1;
}
if(i==koma+1)lastMes();
else MoveCast(cast,pic[i],0,picH0);
PlayRsc(sClick);
}
mes(RBDOWN){
i=i-1;
if(i==0){
exit();
i=i+1;
}
else MoveCast(cast,pic[i],0,picH0);
PlayRsc(sClick);
}
}
int loadPic(){
int i,pic_;
int picW_,picH_;
for(i=title;i<=koma;i=i+1){
pic_=LoadPic(file[i]);
picW_=PicWidth(pic_);
picH_=PicHeight(pic_);
pic[i]=CreatePic(pic_,picW_/sc,picH_/sc);
MoveSPic(pic_,0,0,picW_,picH_,pic[i],0,0,picW_/sc,picH_/sc);
DelPic(pic_);
}
}
int lastMes(){
SetFont(144/sc,"MS ゴシック",128,0,0,0,700);
BackMode(1);
TextColor(0,0,0);
TextWrite("おしまい",basePic,20/sc+2,500/sc+2);
TextColor(255,0,0);
TextWrite("おしまい",basePic,20/sc,500/sc);
}
int playBGM(){
if(bgms==1){
mes(MIDI_END){
PlayMIDI(bgm);
}
PlayMIDI(bgm);
}
}
int exit(){
int ans;
ans=MsgBox("終了しますか?",0x24);
if(ans==7)return;
CloseWinAll();
ExitTitle();
del_all;
del_me;
}
int playSE(){
}
int zoomin(){
if(zoom==1){
int scz;
int i,j;
scz=2;
zoomPic=CreatePic(basePic,picW+10,(picH0+picH*2)/scz);
SetPaintColor( 0xffffff );
SetLineSize(1);
DrawRect(zoomPic,0,0,picW+10,(picH0+picH*2)/scz);
MoveSPic(pic[0],0,0,picW,picH0,zoomPic,picW/4+5,0,picW/scz,picH0/scz);
for(i=0;i<4;i=i+1){
j=1-i/2;
MoveSPic(pic[i+1],0,0,picW,picH,zoomPic,j*(picW/2+10),((i%2)*picH+picH0)/scz,picW/scz,picH/scz);
}
zoomWin=OpenWin(zoomPic);
CloseWin(mainWin);
}
else if(zoom==0){
mainWin=OpenWin(basePic);
CloseWin(zoomWin);
DelPic(zoomPic);
}
}
int loadIni(){
int i;
title=GetIniInt("4koma","title",1,"4koma.ini");
koma=GetIniInt("4koma","koma",4,"4koma.ini");
for(i=title;i<=koma;i=i+1){
file[i]=GetIniStr("4koma",StrPrint("koma%ld",i),"","4koma.ini");
}
bgm=GetIniStr("4koma","bgm","NO_BGM","4koma.ini");
if(IsExist(bgm)==0)bgms=0;
else bgms=1;
}
int makeTitle(){
pic[0]=CreatePic(pic[1],picW/sc,200/sc);
SetPaintColor(0xffffff);
SetLineSize(1);
DrawRect(pic[0],0,0,picW/sc,200/sc);
SetFont(100/sc,"MS ゴシック",128,0,0,0,500);
BackMode(1);
BgColor(255,255,255);
TextColor(0,0,255);
TextWrite("4コママンガ",pic[0],10/sc,50/sc);
}