Exemplo n.º 1
0
void StaffRoll::Exec()
{
	DWORD		time = timeGetTime();
	if(ScenarioFlag[SCRIPT_MAX-3][type]){
		if(keyState.push_action || keyState.push_cancel || step==100){
			if(step<100){
				primary = !primary;
				baseCBuf[primary].loadLGF(pack_eventcg,"ed08");
				baseCBuf[primary].alpha = 0;
				nextTime = timeGetTime() +3000;
				lpSoundDS->FadeOut(bgmHandle,90);
				step = 100;
			}else if(time < nextTime){
				baseCBuf[primary].alpha = 1.0f -(float(nextTime -time) / 3000);
			}else{
				backColorBuf.BltFast(40, 30,&baseCBuf[primary],NULL,FALSE);
				changeExecMode(event_exec_mode);
			}
			return;
		}
	}
	if(time > nextTime){
		if(step==16){
			DWORD	fSize;
			ScenarioFlag[SCRIPT_MAX-3][type] = 1;
			SetFilePointer(sysInf.configHF, (SCRIPT_MAX-3)*BLOCK_MAX/8, NULL, FILE_BEGIN);
			WriteFile(sysInf.configHF,ScenarioFlag[SCRIPT_MAX-3],2,&fSize,NULL);
			changeExecMode(event_exec_mode);
			return;
		}
		baseCBuf[primary].alpha = 1.0f;
		primary = !primary;
		baseCBuf[primary].loadLGF(pack_eventcg,staffRollName[type][step++]);
		baseCBuf[primary].alpha = 0;
		nextTime = (step/2) *14000 +(step&1)*10000 +startTime;
		if(step==16){
			nextTime += 5000;
			sysInf.bgFlag = FALSE;
			backColorBuf.BltFast(40, 30,&baseCBuf[primary],NULL,FALSE);
			lpSoundDS->FadeOut(bgmHandle,150);
		}
		fadeTime = timeGetTime() +2000;
		bShift = TRUE;
	}else if(bShift){
		if(time >= fadeTime){
			baseCBuf[primary].alpha = 1.0f;
			bShift = FALSE;
		}else{
			baseCBuf[primary].alpha = float(2000-(fadeTime -time)) / 2000;
		}
	}
}
Exemplo n.º 2
0
MyMenuWnd::MyMenuWnd(){
	int		i;
	char	str[32];
	ZeroMemory(this,sizeof(MyMenuWnd));
	menuCBuf.loadLGF(pack_eventcg,"s20100");
	backColorBuf.BltFast(40, 30, &menuCBuf, NULL, FALSE);
	saveInf.btRect.left = saveInf.btRect.top = 0;
	saveInf.btRect.right = 800;	saveInf.btRect.bottom = 600;
	saveInf.btPoint.x = 40; saveInf.btPoint.y = 30;

	menuCBuf.alpha = 1.0f;
	for(int i=0;i<9;i++){
		wsprintf(str,"icon%02d",i+1);
		menuIcon[i][0].loadLGF(pack_gparts,str);
		wsprintf(str,"name%02d",i+1);
		menuIcon[i][1].loadLGF(pack_gparts,str);
		menuIcon[i][0].alpha = menuIcon[i][1].alpha = 0;
	}
	msgWnd.MsgCLS();
	msgWnd.ForceHide();
	changeExecMode( menu_mode );

	bgInf.look_max = 900;
	bgInf.look_cnt = timeGetTime() +bgInf.look_max;
	sysInf.bOPMessage = 1;
}
Exemplo n.º 3
0
void SelectWnd::selectEnd()
{
    bSelect = off;
    Release();
    ESC_SelectEnd();
    changeExecMode(back_mode);
} // SelectWnd::selectEnd
Exemplo n.º 4
0
void TitleWnd::Exec()
{
	int		i;
	BOOL	bMoveCur = FALSE;

	switch(state){
	  case 0:
		titleCBuf.alpha += 0.02f;
		if(titleCBuf.alpha >= 1.0f){
			backColorBuf.clearColorBuf();
			titleCBuf.alpha = 1.0f;
			state = 1;
		}
		return;
	}
	int selectNum = -1;
	if(btn.CheckState(&sysInf.msPoint)){
		selectNum = 0;
	}
	switch(selectNum){
		case 0:
		EXEC_ReadLang( "0000.sdt", &LangData );
		AVG_SetScenarioNo(0);
		EXEC_StartLang( &LangData, MAIN_SCRIPT );
		c_cls_all();
		msgWnd.MsgCLS();
		lpSoundDS->FadeOut(bgmHandle);
		saveInf.musicNum = -1;
		changeExecMode( event_exec_mode );
		break;
		case 5:
		sysInf.bGameEnd = on;
		break;
	}
} // TitleWnd::Exec
Exemplo n.º 5
0
StaffRoll::StaffRoll()
{
	ZeroMemory(this,sizeof(StaffRoll));

	c_cls_all();
	msgWnd.MsgCLS();
	msgWnd.ForceHide();

	baseCBuf[primary].createColorBuf(WIN_SIZEX,WIN_SIZEY,24,FALSE);
	baseCBuf[primary].BltFast(0,0,&g_DibInf.colorBuf,NULL,FALSE);
	primary = !primary;
	baseCBuf[primary].loadLGF(pack_gparts,"ed_000");
	baseCBuf[primary].alpha = 0;
	baseCBuf[primary].offset.x = baseCBuf[primary].offset.y = 0;
	partsCBuf.loadLGF(pack_gparts,"ed_004");
	partsCBuf.alpha = 0;
	partsCBuf.offset.x = partsCBuf.offset.y = 168;
	pictCBuf[0].alpha = pictCBuf[1].alpha = 0;

	nammeCBuf[0].loadLGF(pack_gparts,"ed_name00");
	nammeCBuf[0].offset.x = 50;
	nammeCBuf[1].alpha = 0;

	startTime = timeGetTime();
	nextTime = StaffTime[step+1];
	fadeTime = StaffTime[step+1] -StaffTime[step];
	lpSoundDS->FadeOut(bgmHandle);
	changeExecMode(staffRoll_mode);
}
Exemplo n.º 6
0
CGmodeWnd::CGmodeWnd()
{
	int		i;
	ZeroMemory(this,sizeof(CGmodeWnd));
	baseWnd.loadLGF(pack_gparts,"CGmodeBase");
	panel[0].loadLGF(pack_gparts,"cgSelect");
	panel[1].loadLGF(pack_gparts,"cgNoSelect");
	button.loadLGF(pack_gparts,"CGmodeBtn");
	backWnd.createColorBuf(WIN_SIZEX,WIN_SIZEY,24,FALSE);
	backWnd.BltFast(0,0,&g_DibInf.colorBuf,NULL,FALSE);

	RECT	ptRect[4];
	rect.left = kabeWndLEFT +611;	rect.right = rect.left +100;
	rect.top = kabeWndTOP +455;	rect.bottom = rect.top +20;
	for(i=0;i<3;i++){
		ptRect[i].left = 0;		ptRect[i].right = ptRect[i].left +100;
		ptRect[i].top = i*20;	ptRect[i].bottom = ptRect[i].top +20;
	}
	btn.Create(1,&button,&rect,ptRect,&g_DibInf.colorBuf);

	c_cls_all();
	msgWnd.MsgCLS();
	msgWnd.ForceHide();	
	changeExecMode( cgview_mode );	
	bgInf.look_max = 900;
	bgInf.look_cnt = timeGetTime() +bgInf.look_max;
	panel[0].alpha = panel[1].alpha = button.alpha = baseWnd.alpha = 0;
	selectNum = -1;
}
Exemplo n.º 7
0
StaffmodeWnd::StaffmodeWnd()
{
	int		i,j;
	ZeroMemory(this,sizeof(StaffmodeWnd));
	InitMaze();
	baseWnd.loadLGF(pack_gparts,"staffBase");
	logo.loadLGF(pack_gparts,"staffLogo");
	nameList.createColorBuf(800,22,32);

	dest.buf = (RGB24 *)g_DibInf.colorBuf.pBuf;
	dest.sx = 800; dest.sy = 600;
	selectNum = rndSelect(43);
	for(i=0;i<4;i++){
		j = selectNum +i;
		if(i==3) j = selectNum -1;
		if( j <  0) j += 44;
		if( j > 43) j -= 44;
		wsprintf(str,"stt%03d",j);
		panel[i].loadLGF(pack_eventcg,str);
		src[i].buf = (BYTE *)panel[i].pBuf;
		src[i].pal = (RGB32 *)panel[i].palColor;
		src[i].alp = NULL;
		src[i].sx = 400; src[i].sy = 300;
	}
	button.loadLGF(pack_gparts,"staffBtn");
	RECT	ptRect[3];
	rect.left = 20;	rect.right = rect.left +188;
	rect.top = 268;		rect.bottom = rect.top +172;
	for(i=0;i<3;i++){
		ptRect[i].left = 0;		ptRect[i].right = ptRect[i].left +188;
		ptRect[i].top = i*172;	ptRect[i].bottom = ptRect[i].top +172;
	}
	btn[0].Create(1,&button,&rect,ptRect,&g_DibInf.colorBuf);
	rect.left = 592;	rect.right = rect.left +188;
	rect.top = 268;		rect.bottom = rect.top +172;
	for(i=0;i<3;i++){
		ptRect[i].left = 188;	ptRect[i].right = ptRect[i].left +188;
		ptRect[i].top = i*172;	ptRect[i].bottom = ptRect[i].top +172;
	}
	btn[1].Create(1,&button,&rect,ptRect,&g_DibInf.colorBuf);
	rect.left = 400-216/2;	rect.right = rect.left +216;
	rect.top = 340;	rect.bottom = rect.top +156;
	for(i=0;i<3;i++){
		ptRect[i].left = 376;		ptRect[i].right = ptRect[i].left +216;
		ptRect[i].top = i*156;	ptRect[i].bottom = ptRect[i].top +156;
	}
	btn[2].Create(1,&button,&rect,ptRect,&g_DibInf.colorBuf);

	c_cls_all();
	msgWnd.MsgCLS();
	msgWnd.ForceHide();
	changeExecMode( staffmode_mode );
	bgInf.look_max = 900;
	bgInf.look_cnt = timeGetTime() +bgInf.look_max;
	panel[0].alpha = panel[1].alpha = button.alpha = baseWnd.alpha = logo.alpha = 0;


	DrawMaze(&baseWnd);
	writeName();
}
Exemplo n.º 8
0
BOOL CMovie::OpenMovie(char *fname,int music,BOOL loop)
{
	int			size;
	Chunk		aviFileHead;
	Chunk		aviInfo;
	AVIMAINHEADER aviMainHead;

	WaitThreadEnd();
	stream = readFile->StreamOpenFile(pack_sound,fname,size);
	if((-1)==stream) return FALSE;
	readFile->StreamReadFile(pack_sound,stream,(char *)&aviFileHead,sizeof(Chunk));
	if(MAKEFOURCC('R','I','F','F')!=aviFileHead.ckID){
		readFile->StreamCloseFile(pack_sound,stream);
		stream = -1;
		return FALSE;
	}
	readFile->StreamReadFile(pack_sound,stream,(char *)&aviInfo,sizeof(Chunk));
	readFile->StreamReadFile(pack_sound,stream,(char *)&aviMainHead,sizeof(AVIMAINHEADER));
	readFile->StreamSeekFile(pack_sound,stream,0,FILE_BEGIN);
	fpms = aviMainHead.dwMicroSecPerFrame;

	srcWidth = aviMainHead.dwWidth;
	srcHeight = aviMainHead.dwHeight;

	HDC hDC = ::GetDC(sysInf.hWnd);
	HBRUSH brush = CreateSolidBrush(RGB(0, 0, 8));
	HBRUSH old_brush = (HBRUSH)SelectObject(hDC,brush);
	PatBlt(hDC,0,0,wWidth,wHeight,PATCOPY);
	SelectObject(hDC,old_brush);
	DeleteObject(brush);
	::ReleaseDC(sysInf.hWnd,hDC);

	if(FALSE == CreateSurface() ){
	}
	buffer_size = srcWidth*srcHeight*2;
	readBuf = (LPBYTE)malloc(buffer_size);

	xvidDec.Start_XviD(srcWidth,srcHeight,overlay_forcc[forccNum]);

	read_size = readFile->StreamReadFile(pack_sound,stream,(char *)readBuf,buffer_size);
	frame_cnt = 0;
	old_frame = 0;
	start_time = 0;
	old_time = 0;
	skip_cnt = 0;
	total_skip_cnt = 0;
	bPause = FALSE;
	if(NULL==lpSoundDS)lpSoundDS = new ClSoundDS(sysInf.hWnd,readFile,FALSE);
	bPlay = TRUE;
	bLoop = loop;
	changeExecMode( movie_mode );
	musicNum = music;

	DWORD	dwThreadID;
	hMovieThread = CreateThread(NULL,0,movieThread,this,0,&dwThreadID);
	bExitMovieThread = FALSE;

	return TRUE;
} // CMovie::OpenMovie
Exemplo n.º 9
0
void ReturnTitile(BOOL bForce)
{
	ESC_InitEOprFlag();
	ESC_InitFlag();
	InitRestartData();
	if(cgmodeWnd && scene_play_mode==cgmodeWnd->GetMode() && FALSE==bForce){
		changeExecMode(scene_play_mode);
	}else{
		my_delete(cgmodeWnd);
		my_delete(titleWnd);
		titleWnd = new TitleWnd;
	}
}
Exemplo n.º 10
0
void StartMainLoop()
{
	EXEC_ReadLang( "0000.sdt", &LangData );
	AVG_SetScenarioNo(0);
	EXEC_StartLang( &LangData, MAIN_SCRIPT );
	c_cls_all();
	msgWnd.MsgCLS();
	changeExecMode( event_exec_mode );
	SYSTEMTIME	sysTime;
	GetLocalTime(&sysTime);
	srand( sysTime.wMilliseconds );
	for(int i=0;i<sysTime.wMilliseconds;i++)rand();

	if(sysInf.bOPMessage) LangData.reg[3] = 1;
}
Exemplo n.º 11
0
StaffRoll::StaffRoll(int r_type)
{
	ZeroMemory(this,sizeof(StaffRoll));

	c_cls_all();
	msgWnd.MsgCLS();
	msgWnd.ForceHide();	

	type = r_type;
	baseCBuf[primary].createColorBuf(WIN_SIZEX,WIN_SIZEY,24,FALSE);
	baseCBuf[primary].BltFast(0,0,&g_DibInf.colorBuf,NULL,FALSE);
	primary = !primary;
	baseCBuf[primary].loadLGF(pack_eventcg,staffRollName[type][step++]);
	baseCBuf[primary].alpha = 0;
	startTime = timeGetTime();
	nextTime = (step/2) *14000 +(step&1)*10000 +startTime;
	fadeTime = timeGetTime() +2000;
	bShift = TRUE;
	lpSoundDS->ChangeMusic(bgmHandle,pack_bgmfile,51,TRUE,0);
	changeExecMode(staffRoll_mode);
}
Exemplo n.º 12
0
void SelectWnd::SelectStart(BOOL cancel)
{
    int		i,j,offsetX,offsetY;

    bSelect = on;
    bCancel = cancel;
    selectNum = -1;
    width = 640;
    height = 60*slctCnt;
    offsetX = (WIN_SIZEX -width -(slctCnt-1)*10) /2;
    offsetX += (slctCnt-1)*10;
    offsetY = (WIN_SIZEY -62*slctCnt)/2;
    selectBuf.loadLGF(pack_gparts,"SELECTWND");
    selectBase.loadLGF(pack_gparts,"SELECTWNDBase");
    selectMsg.createColorBuf(width,height,32);
    for(j=0; j<slctCnt; j++) {
        selectMsg.BltFast(0,60*j,&selectBuf,NULL,FALSE);
        int offset = (616 -lstrlen((char *)slctMsg[j])*(mainFontSize/2)) /2;
        for(i=0; i<(int)lstrlen((char *)slctMsg[j]); i+=2) {
            OutputOutlineFont(&selectMsg,(BYTE *)&slctMsg[j][i] ,i*(mainFontSize/2)+offset,60*j +14,mainFontSize);
            if(slctMsg[j][i]<0x80) i--;
        }
        selectRect[j].left = offsetX;
        selectRect[j].right = offsetX +width;
        selectRect[j].top = offsetY +62*j;
        selectRect[j].bottom = selectRect[j].top +60;
        offsetX -= 10;
    }
    point.x = selectRect[0].left + 30;
    point.y = selectRect[0].top - 20;
    SetWindowCursorPos(sysInf.hWnd, point.x, point.y);
    if(sysInf.bReadSkip) {
        sysInf.bReadSkip = off;
        sysInf.bAlreadyRead = off;
        CheckMenuItem( sysInf.hMenu, ID_READSKIP,   MF_UNCHECKED );
    }
    back_mode = sysInf.execMode;
    changeExecMode(select_exec_mode);
} // SelectWnd::SelectStart
Exemplo n.º 13
0
TitleWnd::TitleWnd()
{
	int		i;
	RECT	ptRect[4];

	ZeroMemory(this,sizeof(TitleWnd));
	ZeroMemory(&backSelectInf,sizeof(BackSelectInf));
	ESC_InitEOprFlag();
	lpSoundDS->ChangeMusic(bgmHandle,pack_bgmfile,2,TRUE,0);
	titleCBuf.loadLGF(pack_gparts,"title_op");
	titleBtnCBuf.loadLGF( pack_gparts,"TitleButton");
	rect.left = 200;	rect.right = rect.left +400;
	rect.top = 460;		rect.bottom = rect.top +70;
	for(i=0;i<4;i++){
		ptRect[i].left = 0;
		ptRect[i].right = ptRect[i].left +400;
		ptRect[i].top = 70*i;
		ptRect[i].bottom = ptRect[i].top +70;
	}
	btn.Create(1,&titleBtnCBuf,&rect,ptRect,&g_DibInf.colorBuf);
	SetWindowCursorPos(sysInf.hWnd,rect.left+10, rect.top+10);
	titleCBuf.alpha = 0;
	changeExecMode( opening_mode );
} // TitleWnd::TitleWnd
Exemplo n.º 14
0
BOOL SAV_Load( int load_no )
{
	char		fname[256];
	DWORD		rsize;
	int			i;
	char		*msgBuf;
	MySaveHead	saveHead;

	if(load_no>=0) { wsprintf( fname, "save_%02d.sav", load_no ); }
	else		   { wsprintf( fname, "save___.sav" );			  }
	exec_mode tmp_back_mode = sysInf.execMode;
	InitRestartData();
	if(sysInf.execMode!=tmp_back_mode)changeExecMode(tmp_back_mode);
	if(load_no!=98){
		HANDLE hFile = CreateFile(fname, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0L ,NULL);
		if(INVALID_HANDLE_VALUE==hFile){
			return FALSE;
		}
		ReadFile(hFile,saveWnd->saveBmp.pBuf,thumbnailW*thumbnailH*3,&rsize,NULL);
		ReadFile(hFile,&saveHead,sizeof(MySaveHead),&rsize,NULL);

		if(saveHead.ver!=MAKEWORD(SaveVerMajor,SaveVerMinor) || 0!=strnicmp(saveHead.head,"LSAV",4)){
			MessageBox(sysInf.hWnd,"セーブデータ形式が異常です。このセーブデータは使用できません","データエラー",MB_OK|MB_ICONWARNING);
			return FALSE;
		}
		ReadFile(hFile,&SaveStruct, sizeof(SaveStruct), &rsize,NULL);
		ReadFile(hFile,&saveInf,sizeof(SaveInfo),&rsize,NULL);
		ReadFile(hFile,setBmpInf,sizeof(SetBmpInf)*STBMP_MAX,&rsize,NULL);
		ReadFile(hFile,&backSelectStruct, sizeof(SaveStruct), &rsize,NULL);
		ReadFile(hFile,&backSelectInf,sizeof(BackSelectInf),&rsize,NULL);
		CloseHandle(hFile);
	}else{
		CopyMemory(&SaveStruct,&backSelectStruct,sizeof(SaveStruct));
		CopyMemory(&saveInf,&backSelectInf.saveInf,sizeof(SaveInfo));
		CopyMemory(&setBmpInf,&bak_setBmpInf,sizeof(SetBmpInf)*STBMP_MAX);
	}
	SAV_LoadScript();
	memcpy( ESC_FlagBuf, SaveStruct.ESC_FlagBuf, sizeof(int)*ESC_FLAG_MAX ); 
	toneConvert.ChangeTable( saveInf.tone_type[0], saveInf.tone_type[1], saveInf.tone_backOnly);
	SHORT	tmp_shakeSize = saveInf.shakeSize;
	g_disp(saveInf.bak_no, _BAK_DIRECT, saveInf.cg_type, 0, saveInf.btRect.left, saveInf.btRect.top);
	saveInf.shakeSize = tmp_shakeSize; 
	if(saveInf.shakeSize){
		backColorBuf.RollBlt(&bgInf.colorBuf, saveInf.shakeSize*180.0f);
		bgInf.colorBuf.BltFast(0,0,&backColorBuf,NULL,FALSE);
	}
	for(i=0;i<STCHAR_MAX;i++){
		if(saveInf.charSave[i].char_no){
			c_disp(saveInf.charSave[i].char_no-1, saveInf.charSave[i].pose, saveInf.charSave[i].locate, _CHR_DIRECT, saveInf.charSave[i].layer,saveInf.charSave[i].alpha,0,saveInf.charSave[i].bright);
		}
	}
	for(i=0;i<STBMP_MAX;i++){
		setBmpInf[i].Reload();
	}
	if(saveInf.selectNum){
		for(i=0;i<saveInf.selectNum;i++){
			selectWnd.addSelect(&backSelectInf.selectMsg[i*60]);
		}
		sysInf.bMsgAtOnce = on;
		msgWnd.DisplayMessage((BYTE *)backSelectInf.msgBuf);
		backLog.SetBackLog(backSelectInf.msgBuf,backSelectInf.msgLine);
		sysInf.bMsgCLS = on;
	}
	if(saveInf.musicNum>=0){
		lpSoundDS->ChangeMusic(bgmHandle, saveInf.musicNum,TRUE,0, 30,saveInf.musicVol);
	}else{
		lpSoundDS->FadeOut( bgmHandle );
	}
	for(i=0;i<hEvtSndMax;i++){
		if(saveInf.loopSeNum[i]==0)continue;
		CreateEffect(evtHandle[i],saveInf.loopSeNum[i]-1);
		PlayEffect(evtHandle[i],saveInf.loopSeVol[i],TRUE);
	}
	if(backSelectInf.saveInf.selectNum){
		EnableMenuItem( sysInf.hMenu, ID_BACKSELECT, MF_ENABLED );
	}else{
		EnableMenuItem( sysInf.hMenu, ID_BACKSELECT, MF_GRAYED );
	}
	sysInf.FontSize = mainFontSize;	
	lpSoundDS->voiceCnt = saveInf.voiceCnt;
	lpSoundDS->scriptNo = saveInf.voiceScriptNo;
	BOOL bPlayVoice = FALSE;
	if(saveInf.RestartVoice[0]>0){
		char	voicefile[32];
		saveInf.RestartVoice[0] --;
		int charNo = checkPlayVoice(saveInf.RestartVoice[0]);
		if(charNo >= 0){
			wsprintf(voicefile,"%05d_%03d_%03d",saveInf.RestartVoice[2], saveInf.RestartVoice[1], charNo);
			if(!keyState.data_skip && !sysInf.bReadSkip){
				bPlayVoice = TRUE;
			}
		}else{
			wsprintf(voicefile,"%05d_%03d_%03d",saveInf.RestartVoice[2], saveInf.RestartVoice[1], saveInf.RestartVoice[0]);
		}
		backLog.SetVoice(voicefile);
		saveInf.RestartVoice[0] = 0;

		if(saveWnd){
			strcpy(saveWnd->voicefile,voicefile);
		}
	}
	if(FALSE==bPlayVoice){
		if(saveWnd)saveWnd->voicefile[0] = '\0';
	}
	return TRUE;
} // SAV_Load
Exemplo n.º 15
0
void StaffRoll::Exec()
{
	char		p_name[32];
	float		alpha;
	DWORD		read_time,time = timeGetTime();

	if(keyState.push_action || keyState.push_cancel || step==100){
		if(step<100){
			primary = !primary;
			baseCBuf[primary].loadLGF(pack_gparts,"ed_000");
			baseCBuf[primary].alpha = 0;
			baseCBuf[primary].offset.x = baseCBuf[primary].offset.y = 0;
			nextTime = timeGetTime() +2500;
			lpSoundDS->FadeOut(bgmHandle);
			step = 100;
		}else if(time < nextTime){
			baseCBuf[primary].alpha = 1.0f -(float(nextTime -time) / 2500);
		}else{
			backColorBuf.BltFast(40, 30,&baseCBuf[primary],NULL,FALSE);
			changeExecMode(event_exec_mode);
		}
		return;
	}
	bDrawName = FALSE;
	if(time>=StaffStart+startTime && time<=StaffEnd+startTime){
		staffNameY = 16800 * (time-(StaffStart+startTime)) / (StaffEnd -StaffStart);
		int nowNum = staffNameY / 600;
		if( nameNum < nowNum){
			nameNum = nowNum;
			primary_n = !primary_n;
			if(nameNum <= 26){
				sprintf(p_name,"ed_name%02d",nameNum);
				nammeCBuf[primary_n].loadLGF(pack_gparts,p_name);
				read_time = timeGetTime();
				startTime += (read_time -time);
				time = read_time;
			}else{
				nammeCBuf[primary_n].alpha = 0;
			}
			nammeCBuf[primary_n].offset.x = 50;
		}
		nammeCBuf[primary_n].offset.y = 600 -(staffNameY -600*nowNum);
		nammeCBuf[!primary_n].offset.y = nammeCBuf[primary_n].offset.y -600;
		bDrawName = TRUE;
	}
	if(step & 1){
		if(time >= (nextTime+startTime)){
			step ++;
			switch(step){
			  case 4:
				primary = !primary;
				baseCBuf[primary].loadLGF(pack_gparts,"ed_001");
				baseCBuf[primary].alpha = 0;
				baseCBuf[primary].offset.x = baseCBuf[primary].offset.y = 0;
				break;
			  case  8: case 10: case 12: case 14: case 16:
			  case 18: case 20: case 22: case 24: case 26:
			  case 28: case 30: case 32: case 34: case 36:
			  case 38: case 40: case 42:
				sprintf(p_name,"ed_pic%02d",picNum++);
				primary_p = !primary_p;
				pictCBuf[primary_p].loadLGF(pack_gparts,p_name);
				pictCBuf[primary_p].alpha = 0;
				pictCBuf[primary_p].offset.x = 416;
				pictCBuf[primary_p].offset.y = 314;
				break;
			  case 46:
				partsCBuf.loadLGF(pack_gparts,"ed_003");
				partsCBuf.alpha = 0;
				partsCBuf.offset.x = 200;
				partsCBuf.offset.y = 216;
				break;
			  case 48:
			  case 54:
				primary = !primary;
				baseCBuf[primary].loadLGF(pack_gparts,"ed_000");
				baseCBuf[primary].alpha = 0;
				baseCBuf[primary].offset.x = baseCBuf[primary].offset.y = 0;
				break;
			  case 52:
				primary = !primary;
				baseCBuf[primary].loadLGF(pack_gparts,"ed_002");
				baseCBuf[primary].alpha = 0;
				baseCBuf[primary].offset.x = baseCBuf[primary].offset.y = 0;
				break;
			}
			read_time = timeGetTime();
			startTime += (read_time -time);
			time = read_time;
			nextTime = StaffTime[step+1];
			fadeTime = StaffTime[step+1] -StaffTime[step];
		}else{
			return;
		}
	}
	if(time < (nextTime+startTime)){
		alpha = float(nextTime+startTime -time) / fadeTime;
		switch(step){
		  case 0:
		  case 4:
		  case 48:
		  case 52:
		  case 54:
			baseCBuf[primary].alpha = 1.0f -alpha;
			break;
		  case 2:
		  case 46:
			partsCBuf.alpha = 1.0f -alpha;
			break;
		  case 6:
		  case 50: 
			partsCBuf.alpha = alpha;
			break;
		  case  8: case 10: case 12: case 14: case 16:
		  case 18: case 20: case 22: case 24: case 26:
		  case 28: case 30: case 32: case 34: case 36:
		  case 38: case 40: case 42:
			pictCBuf[primary_p].alpha = 1.0f -alpha;
			break;
		  case 44:
			pictCBuf[primary_p].alpha = alpha;
			break;
		}
	}else{
		baseCBuf[primary].alpha = 1.0f;
		baseCBuf[!primary].alpha = 0;
		step ++;
		switch(step){
		  case 1:
			lpSoundDS->ChangeMusic(bgmHandle,pack_bgmfile,3,TRUE,1);
			break;
		  case 3:
		  case 47:
			partsCBuf.alpha = 1.0f;
			break;
		  case 7:
		  case 51:
			partsCBuf.alpha = 0;
			break;
		  case 45:
			pictCBuf[primary_p].alpha = 0;
			break;
		}
		if(step>=9 && step<=43){
			pictCBuf[primary_p].alpha = 1.0f;
			pictCBuf[!primary_p].alpha = 0;
		}
		if(55<=step){
			backColorBuf.BltFast(40, 30,&baseCBuf[primary],NULL,FALSE);
			changeExecMode(event_exec_mode);
			return;
		}
		nextTime = StaffTime[step+1];
		fadeTime = StaffTime[step+1] -StaffTime[step];
	}
}
Exemplo n.º 16
0
void MyMenuWnd::Exec()
{
	int			i;
	BOOL		bPush = FALSE;
	POINT		icPt;
	float		alpha;
	char		oldSelect = selectNum;
	BOOL bStaffRoll = ScenarioFlag[SCRIPT_MAX-1][0];

	if(menu_mode!=sysInf.execMode)return;
	switch(state){
	case 0:
		time = bgInf.look_cnt-timeGetTime();
		alpha = 1.0f -float(time) / bgInf.look_max;
		if(time<=0){
			alpha = 1.0f;
			bgInf.look_cnt = 0;
			state = 1;
		}
		for(i=0;i<9;i++){
			menuIcon[i][0].alpha = alpha;
			menuIcon[i][1].alpha = alpha/2;
		}
		return;
	}
	if(keyState.push_action && state==1 && selectNum>=0){
		PlayEffectNum(evtHandle[1],SelectSnd);
		EXEC_LangInfo->reg[ 0 ] = selectNum;
		state = 2;
		c_cls_all();
		changeExecMode( event_exec_mode );
	}else if(keyState.push_left || keyState.push_up){
		bPush = TRUE;
		if(selectNum<=0)selectNum = 8;
		else selectNum --;
		if(!bStaffRoll && selectNum==3) selectNum = 2;
	}else if(keyState.push_right || keyState.push_down){
		bPush = TRUE;
		selectNum ++;
		if(selectNum > 8)selectNum = 0;
		if(!bStaffRoll && selectNum==3) selectNum = 4;
	}
	if(bPush){
		icPt.x = menuRect[selectNum].left +50;
		icPt.y = menuRect[selectNum].top +50;
		ClientToScreen(sysInf.hWnd,&icPt);
		SetCursorPos(icPt.x, icPt.y);
	}
	selectNum = -1;
	for(i=0;i<9;i++){
		if(PtInRect(&menuRect[i],sysInf.msPoint)){
			if(!bStaffRoll && i==3)break;
			selectNum = i;
			break;
		}
	}
	if(selectNum>=0 && selectNum!=oldSelect){
		PlayEffectNum(evtHandle[1],CurMoveSnd);
	}
	for(i=0;i<9;i++){
		if(selectNum!=i){
			if(menuIcon[i][1].alpha > 0.5f){
				menuIcon[i][1].alpha -= 0.05f;
				if(menuIcon[i][1].alpha < 0.5f) menuIcon[i][1].alpha = 0.5f;
			}
		}else{
			if(menuIcon[i][1].alpha < 1.0f){
				menuIcon[i][1].alpha += 0.05f;
				if(menuIcon[i][1].alpha > 1.0f) menuIcon[i][1].alpha = 1.0f;
			}
		}
	}
}// MyMenuWnd::Exec
Exemplo n.º 17
0
KabeSetWnd::KabeSetWnd()
{
	int		i;
	ZeroMemory(this,sizeof(KabeSetWnd));
	baseWnd.loadLGF(pack_gparts,"kabeBase");
	kabeIcon.loadLGF(pack_gparts,"kabeIcon");
	kabeButton.loadLGF(pack_gparts,"kabeBtn");

	RECT	ptRect[3];
	rect.left = 319;			rect.right = rect.left +72;
	rect.top = kabeWndTOP +25;	rect.bottom = rect.top +20;
	for(i=0;i<3;i++){
		ptRect[i].left = 319;		ptRect[i].right = ptRect[i].left +72;
		ptRect[i].top = 25 +i*68;	ptRect[i].bottom = ptRect[i].top +21;
	}
	btn[0].Create(1,&kabeButton,&rect,ptRect,&g_DibInf.colorBuf);
	rect.left = 415;			rect.right = rect.left +72;
	rect.top = kabeWndTOP +25;	rect.bottom = rect.top +20;
	for(i=0;i<3;i++){
		ptRect[i].left = 415;		ptRect[i].right = ptRect[i].left +72;
		ptRect[i].top = 25+i*68;	ptRect[i].bottom = ptRect[i].top +21;
	}
	btn[1].Create(1,&kabeButton,&rect,ptRect,&g_DibInf.colorBuf);
	rect.left = 567;	rect.right = rect.left +58;
	rect.top = kabeWndTOP +5;	rect.bottom = rect.top +58;
	for(i=0;i<3;i++){
		ptRect[i].left = 567;	ptRect[i].right = ptRect[i].left +58;
		ptRect[i].top = 5+i*68;	ptRect[i].bottom = ptRect[i].top +58;
	}
	btn[2].Create(1,&kabeButton,&rect,ptRect,&g_DibInf.colorBuf);

	rect.left = 667;			rect.right = rect.left +58;
	rect.top = kabeWndTOP +5;	rect.bottom = rect.top +58;
	for(i=0;i<3;i++){
		ptRect[i].left = 667;	ptRect[i].right = ptRect[i].left +58;
		ptRect[i].top = 5+i*68;	ptRect[i].bottom = ptRect[i].top +58;
	}
	btn[3].Create(1,&kabeButton,&rect,ptRect,&g_DibInf.colorBuf);
	rect.left = 567;			rect.right = rect.left +58;
	rect.top = kabeWndTOP +5;	rect.bottom = rect.top +58;
	for(i=0;i<3;i++){
		ptRect[i].left = 567;		ptRect[i].right = ptRect[i].left +58;
		ptRect[i].top = 5+(i+3)*68;	ptRect[i].bottom = ptRect[i].top +58;
	}
	set_btn[0].Create(1,&kabeButton,&rect,ptRect,&g_DibInf.colorBuf);
	rect.left = 667;			rect.right = rect.left +58;
	rect.top = kabeWndTOP +5;	rect.bottom = rect.top +58;
	for(i=0;i<3;i++){
		ptRect[i].left = 667;		ptRect[i].right = ptRect[i].left +58;
		ptRect[i].top = 5+(i+3)*68;	ptRect[i].bottom = ptRect[i].top +58;
	}
	set_btn[1].Create(1,&kabeButton,&rect,ptRect,&g_DibInf.colorBuf);

	for(i=0;i<4;i++)ct_height[i] = 399;
	c_cls_all();
	msgWnd.MsgCLS();
	msgWnd.ForceHide();
	changeExecMode( kabegami_mode );
	bgInf.look_max = 900;
	bgInf.look_cnt = timeGetTime() +bgInf.look_max;
	baseWnd.alpha = 0;
	selectNum = -1;
	selectBtn = -1;
}
Exemplo n.º 18
0
BOOL CGmodeWnd::Exec()
{
	int			i;
	BOOL		bPush = FALSE;
	POINT		icPt;
	char		str[MAX_PATH];

	if(cgview_mode!=sysInf.execMode)return FALSE;
	switch(state){
	  case 0:
	  case 2:
	  case 4:
	  case 5:
		time = bgInf.look_cnt-timeGetTime();
		baseWnd.alpha = float(bgInf.look_max-time)/bgInf.look_max;
		if(time<=0){
			baseWnd.alpha = 1.0f;
			bgInf.look_cnt = 0;
			if(state==4)state = 1;
			else state ++;
		}
		if(state==3 && (selectNum==5 || selectNum==6 || selectNum==7)){
			bgInf.look_max = 2100;
			bgInf.look_cnt = timeGetTime() +bgInf.look_max;
		}else if(state==5){
			baseWnd.alpha = 1.0f -baseWnd.alpha;
		}else if(state==6){
			changeExecMode( opening_mode );	
		}
		panel[0].alpha = panel[1].alpha = button.alpha = baseWnd.alpha;
		return TRUE;
	  case 1:
		if(keyState.push_action && selectNum>=0){
			if(AVG_GetCgFlag(selectNum+1)==FALSE)break;
			PlayEffectNum(evtHandle[1],SelectSnd);
			wsprintf(str,"v00%02d0",selectNum);
			baseWnd.loadLGF(pack_eventcg,str);
			state = 2;
			bgInf.look_max = 900;
			bgInf.look_cnt = timeGetTime() +bgInf.look_max;
			panel[0].alpha = panel[1].alpha = button.alpha = baseWnd.alpha = 0;
			switch(selectNum){
			  case 5:
				scrollOffset.x = 680;
				scrollOffset.y = 0;
				break;
			  case 6:
				scrollOffset.x = 0;
				scrollOffset.y = 600;
				break;
			  case 7:
				scrollOffset.x = 0;
				scrollOffset.y = 0;
				break;
			}
			break;
		}else if(keyState.push_left || keyState.push_up){
			bPush = TRUE;
			if(selectNum==0)selectNum = 11;
			else selectNum --;
		}else if(keyState.push_right || keyState.push_down){
			bPush = TRUE;
			selectNum ++;
			if(selectNum > 11)selectNum = 0;
		}
		if(bPush){
			icPt.x = 54  +(selectNum%4)*177 +50;
			icPt.y = 104 +(selectNum/4)*136 +50;
			ClientToScreen(sysInf.hWnd,&icPt);
			SetCursorPos(icPt.x, icPt.y);
		}else{
			selectNum = -1;
		}
		for(i=0;i<12;i++){
			rect.left = 54+ 177*(i%4);	rect.right = rect.left +160;
			rect.top = 104+136*(i/4);	rect.bottom = rect.top +120;
			if(PtInRect(&rect,sysInf.msPoint)){
				selectNum = i;
				break;
			}
		}
		if(btn.CheckState(&sysInf.msPoint) || keyState.push_cancel){
			PlayEffectNum(evtHandle[1],CancelSnd);
			baseWnd.BltFast(0,0,&g_DibInf.colorBuf,NULL,FALSE);
			state = 5;
			bgInf.look_max = 900;
			bgInf.look_cnt = timeGetTime() +bgInf.look_max;
			return TRUE;
		}
		break;
	  case 3:
		switch(selectNum){
		  case 5:
			time = bgInf.look_cnt-timeGetTime();
			if(time<=0){
				scrollOffset.x = 0;
				scrollOffset.y = 680;
			}else{
				scrollOffset.x = 680 -(bgInf.look_max-time)*680/bgInf.look_max;
				scrollOffset.y = (bgInf.look_max-time)*680/bgInf.look_max;
			}
			break;
		  case 6:
			time = bgInf.look_cnt-timeGetTime();
			scrollOffset.x = 0;
			if(time<=0){
				scrollOffset.y = 0;
			}else{
				scrollOffset.y = 600-(bgInf.look_max-time)*600/bgInf.look_max;
			}
			break;
		  case 7:
			time = bgInf.look_cnt-timeGetTime();
			scrollOffset.x = 0;
			if(time<=0){
				scrollOffset.y = 600;
			}else{
				scrollOffset.y = (bgInf.look_max-time)*600/bgInf.look_max;
			}
			break;
		}
		if(keyState.push_action || keyState.push_cancel){
			PlayEffectNum(evtHandle[1],CancelSnd);
			baseWnd.loadLGF(pack_gparts,"CGmodeBase");
			state = 4;
			bgInf.look_max = 900;
			bgInf.look_cnt = timeGetTime() +bgInf.look_max;
			panel[0].alpha = panel[1].alpha = button.alpha = baseWnd.alpha = 0;
		}
		break;
	}
	return TRUE;
} // CGmodeWnd::Exec
Exemplo n.º 19
0
void TitleWnd::Exec()
{
	int		i;
	BOOL	bMoveCur = FALSE;
	short	oldSelect = selectNum;

	switch(state){
	  case 0:	
		baseCBuf.alpha += 0.02f;
		if(baseCBuf.alpha >= 1.0f){
			backColorBuf.clearColorBuf();
			baseCBuf.alpha = 1.0f;
			state = 1;
		}
		return;
	}
	if(keyState.push_up){
		selectNum --;
		while(1){
			if(selectNum<0){
				selectNum = 4;
				break;
			}
			if(btn[selectNum].GetState()!=btn_disable)break;
			selectNum --;
		}
		bMoveCur = TRUE;
	}else if(keyState.push_down){
		selectNum ++;
		while(1){
			if(selectNum>4){
				selectNum = 0;
				break;
			}
			if(btn[selectNum].GetState()!=btn_disable)break;
			selectNum ++;
		}
		bMoveCur = TRUE;
	}else if(keyState.push_left){
		selectNum = 0;
		bMoveCur = TRUE;
	}else if(keyState.push_right){
		selectNum = 4;
		bMoveCur = TRUE;
	}
	if(bMoveCur){
		SetWindowCursorPos(sysInf.hWnd,btn[selectNum].selectRect.left+10, btn[selectNum].selectRect.top+10);
	}else{
		selectNum = -1;
	}
	for(i=0;i<5;i++){
		if(FALSE==btn[i].CheckState(&sysInf.msPoint)){
			if(btn[i].GetState()==btn_onCursor)selectNum = i;
			continue;
		}
		selectNum = i;
		if(selectNum != 4) PlayEffectNum(evtHandle[1],SelectSnd);
		switch(i){
		  case 0:	
			EXEC_ReadLang( "0500.sdt", &LangData );
			AVG_SetScenarioNo(500);
			EXEC_StartLang( &LangData, MAIN_SCRIPT );
			c_cls_all();
			msgWnd.MsgCLS();
			lpSoundDS->FadeOut(bgmHandle);
			saveInf.musicNum = -1;
			changeExecMode( event_exec_mode );	
			break;
		  case 1:	
			EXEC_ReadLang( "0000.sdt", &LangData );
			AVG_SetScenarioNo(0);
			EXEC_StartLang( &LangData, MAIN_SCRIPT );
			c_cls_all();
			msgWnd.MsgCLS();
			lpSoundDS->FadeOut(bgmHandle);
			saveInf.musicNum = -1;
			changeExecMode( event_exec_mode );
			break;
		  case 2:
			EXEC_LangBuf  = (char *)&LangData.LangBuf;
			EXEC_LangInfo = &LangData;
			saveWnd = new SaveWnd(load_mode);
			break;
		  case 3:
			lpCGmodeWnd = new CGmodeWnd;
			break;
		  case 4:	
			sysInf.bGameEnd = on;
			break;
		}
	}
} // TitleWnd::Exec
Exemplo n.º 20
0
TitleWnd::TitleWnd()
{
	int		i;
	RECT	ptRect[4];

	ZeroMemory(this,sizeof(TitleWnd));
	ZeroMemory(&backSelectInf,sizeof(BackSelectInf));
	EnableMenuItem( sysInf.hMenu, ID_BACKSELECT, MF_GRAYED );
	ESC_InitEOprFlag();
	lpSoundDS->ChangeMusic(bgmHandle,pack_bgmfile,2,TRUE,0);
	baseCBuf.loadLGF(pack_gparts,"TitleBase");
	btnCBuf.loadLGF( pack_gparts,"TitleButton");
	rect.left = 484;	rect.right = rect.left +272;
	rect.top = 216;		rect.bottom = rect.top +40;
	for(i=0;i<4;i++){
		ptRect[i].left = 272*i;
		ptRect[i].right = ptRect[i].left +272;
		ptRect[i].top = 0;	ptRect[i].bottom = 40;
	}
	btn[0].Create(1,&btnCBuf,&rect,ptRect,&baseCBuf);
	btn[0].Draw();
	btn[0].Create(1,&btnCBuf,&rect,ptRect,&g_DibInf.colorBuf);
	SetWindowCursorPos(sysInf.hWnd,rect.left+10, rect.top+10);
	rect.left = 484;	rect.right = rect.left +272;
	rect.top = 256;		rect.bottom = rect.top +40;
	for(i=0;i<4;i++){
		ptRect[i].left = 272*i;
		ptRect[i].right = ptRect[i].left +272;
		ptRect[i].top = 40;	ptRect[i].bottom = ptRect[i].top +40;
	}
	btn[1].Create(1,&btnCBuf,&rect,ptRect,&baseCBuf);
	btn[1].Draw();
	btn[1].Create(1,&btnCBuf,&rect,ptRect,&g_DibInf.colorBuf);
	rect.left = 484;	rect.right = rect.left +272;
	rect.top = 296;		rect.bottom = rect.top +40;
	for(i=0;i<4;i++){
		ptRect[i].left = 272*i;
		ptRect[i].right = ptRect[i].left +272;
		ptRect[i].top = 80;	ptRect[i].bottom = ptRect[i].top +40;
	}
	btn[2].Create(1,&btnCBuf,&rect,ptRect,&baseCBuf);
	btn[2].Draw();
	btn[2].Create(1,&btnCBuf,&rect,ptRect,&g_DibInf.colorBuf);
	rect.left = 484;	rect.right = rect.left +272;
	rect.top = 336;		rect.bottom = rect.top +40;
	for(i=0;i<4;i++){
		ptRect[i].left = 272*i;
		ptRect[i].right = ptRect[i].left +272;
		ptRect[i].top = 120;	ptRect[i].bottom = ptRect[i].top +40;
	}
	if(AVG_GetCgFlag(0)){
		btn[3].Create(1,&btnCBuf,&rect,ptRect,&baseCBuf);
		btn[3].Draw();
		btn[3].Create(1,&btnCBuf,&rect,ptRect,&g_DibInf.colorBuf);
	}else{
		btn[3].Create(1,&btnCBuf,&rect,ptRect,&g_DibInf.colorBuf);
		btn[3].SetState(btn_disable);
	}
	rect.left = 484;	rect.right = rect.left +272;
	rect.top = 416;		rect.bottom = rect.top +40;
	for(i=0;i<4;i++){
		ptRect[i].left = 272*i;
		ptRect[i].right = ptRect[i].left +272;
		ptRect[i].top = 200;	ptRect[i].bottom = ptRect[i].top +40;
	}
	btn[4].Create(1,&btnCBuf,&rect,ptRect,&baseCBuf);
	btn[4].Draw();
	btn[4].Create(1,&btnCBuf,&rect,ptRect,&g_DibInf.colorBuf);
	baseCBuf.alpha = 0;
	changeExecMode( opening_mode );	
} // TitleWnd::TitleWnd
Exemplo n.º 21
0
void SystemInit(LPSTR lpCmdLine)
{
	CreateAlphaTable();
	createInitColorBuf();
	msgWnd.InitMessageParts();
	MessageMenuSet( off, TRUE );
	InitDirectInput(sysInf.hInstance);
	lpSoundDS = new ClSoundDS(
		sysInf.hWnd, readFile,
		pack_bgmfile, pack_sound, pack_voice,
		sysInf.bgmVolume, sysInf.seVolume, sysInf.voiceVolume,
		FALSE);

	if(sysInf.bAutoRead){
		CheckMenuItem( sysInf.hMenu, ID_AUTOREAD,   MF_CHECKED );
		msgWnd.msgBtn[3].SetState(btn_lock);	
	}
	if(sysInf.bInfo){
		sysInf.hDebugWnd = CreateDialog(
			sysInf.hInstance, MAKEINTRESOURCE(IDD_DEBUGWND), sysInf.hWnd, (DLGPROC)DebugDlgProc);
	}
	if(3==sysInf.movieQuality){
		GetCpuID();
		DWORD clock = GetCpuClock();
		if(clock >= 1800){
			sysInf.movieQuality = 2;
		}else if(clock>=1000){
			sysInf.movieQuality = 1;
		}else{
			sysInf.movieQuality = 0;
		}
	}
	if(2==sysInf.movieQuality){
		CheckMenuItem( sysInf.hMenu, ID_MOVIEHI,   MF_CHECKED );
	}else if(1==sysInf.movieQuality){
		CheckMenuItem( sysInf.hMenu, ID_MOVIEMID,  MF_CHECKED );
	}else{
		CheckMenuItem( sysInf.hMenu, ID_MOVIELOW,  MF_CHECKED );
	}
	if(2==sysInf.setFPS){
		CheckMenuItem( sysInf.hMenu, ID_FPS60,  MF_CHECKED );
	}else if(1==sysInf.setFPS){
		CheckMenuItem( sysInf.hMenu, ID_FPS30,  MF_CHECKED );
	}else{
		CheckMenuItem( sysInf.hMenu, ID_FPS20,  MF_CHECKED );
	}
	if(2==sysInf.nouseOverlay){
		char	buf[1024];
		int		i,j,device;
		device = EnumGraphicsDevice(  );
		for(i=0 ; i<device ; i++ ){
			strcpy( buf,GetGraphicsDeviceName(i) );
			for(j=0;j<strlen(buf);j++){
				buf[j] = tolower( buf[j] );
			}
			if( strstr(buf,"matrox") ){
				break;
			}
		}
		if(i<device){
			sysInf.nouseOverlay = 1;
		}else{
			sysInf.nouseOverlay = 0;
		}
	}
	if(sysInf.nouseOverlay==1){
		CheckMenuItem( sysInf.hMenu, ID_NOUSEOVERLAY,  MF_CHECKED );
	}
	toneConvert.ClearTable();
	InitReadFlag();
	rudderWnd = new RudderWnd;
	if(lpCmdLine[0]=='\0'){
		lpMovie = new CMovie(sysInf.nouseOverlay);
		lpMovie->OpenMovie("leaflogo.avi",-1,TRUE);
	}else{
		sysInf.bLookTitle = 1;	
		sysInf.bLookOpening = 1;
		int index = EXEC_ReadLang( lpCmdLine, &LangData );
		AVG_SetScenarioNo(index);
		EXEC_StartLang( &LangData, MAIN_SCRIPT );
		c_cls_all();
		msgWnd.MsgCLS();
		lpSoundDS->FadeOut(bgmHandle);
		changeExecMode( event_exec_mode );
	}
} // SystemInit
Exemplo n.º 22
0
SaveWnd::SaveWnd(exec_mode s_mode)
{
	int			i,j;
	ColorBuf	wallWnd;

	ZeroMemory(this,sizeof(SaveWnd));
	mode = s_mode;
	EnableMenuItem( sysInf.hMenu,ID_SAVEEXEC,   MF_GRAYED  );
	EnableMenuItem( sysInf.hMenu,ID_LOADEXEC,   MF_GRAYED  );
	bak_mode = sysInf.execMode;
	panel[0].loadLGF(pack_gparts,"database00");
	panel[1].loadLGF(pack_gparts,"database01");
	panel[2].loadLGF(pack_gparts,"database02");
	button.loadLGF(pack_gparts,"SavePageBtn");
	numParts.loadLGF(pack_gparts,"saveFont");
	newParts.loadLGF(pack_gparts,"saveNew");
	if(mode==save_mode){
		pagebutton.loadLGF(pack_gparts,"SavePageNoBtn1");
		wallWnd.loadLGF(pack_gparts,"savebg");
	}else{
		pagebutton.loadLGF(pack_gparts,"SavePageNoBtn2");
		wallWnd.loadLGF(pack_gparts,"loadbg");
	}
	retBtnPrt.loadLGF(pack_gparts,"returnBtn");
	confirmWnd.loadLGF(pack_gparts,"saveConfirm");
	yesNoWnd.loadLGF(pack_gparts,"saveYesNo");
	backupWnd.createColorBuf(WIN_SIZEX,WIN_SIZEY,24,FALSE);
	backupWnd.BltFast(0,0,&g_DibInf.colorBuf,NULL,FALSE);
	backWnd.createColorBuf(WIN_SIZEX,WIN_SIZEY,24,FALSE);
	infoWnd.createColorBuf(686,496,32,FALSE);
	saveBmp.createColorBuf(thumbnailW,thumbnailH,24,FALSE);
	backWnd.BltFast(0,0,&backColorBuf,NULL,FALSE);
	backWnd.BltFast(0,0,&wallWnd,NULL,TRUE);

	maskWnd.createColorBuf(WIN_SIZEX,WIN_SIZEY,24,TRUE);
	maskWnd.alpha = 0.5f;
	for(i=0;i<5;i++){
		backWnd.BltFast(20,18+100*i,&panel[0],NULL,TRUE);
	}
	saveBmp.Blt(NULL,&g_DibInf.colorBuf,NULL,FALSE);
	RECT	selectRect = {709,565,709+86,565+25};
	RECT	btnRect[7];
	for(i=0;i<5;i++){
		btnRect[i].left = 0; btnRect[i].right = 86;
		btnRect[i].top = 25*i; btnRect[i].bottom = btnRect[i].top +25;
	}
	btn[2].Create(3,&retBtnPrt,&selectRect,btnRect,&g_DibInf.colorBuf);
	selectRect.left = 22;	selectRect.right = selectRect.left +40;
	selectRect.top = 528;	selectRect.bottom = selectRect.top +40;
	for(i=0;i<5;i++){
		btnRect[i].left = 0;		btnRect[i].right = btnRect[i].left +40;
		btnRect[i].top = i*40;	btnRect[i].bottom = btnRect[i].top +40;
	}
	btn[0].Create(3,&button,&selectRect,btnRect,&g_DibInf.colorBuf);
	selectRect.left = 190;	selectRect.right = selectRect.left +40;
	selectRect.top = 528;	selectRect.bottom = selectRect.top +40;
	for(i=0;i<5;i++){
		btnRect[i].left = 40;	btnRect[i].right = btnRect[i].left +40;
		btnRect[i].top = i*40;	btnRect[i].bottom = btnRect[i].top +40;
	}
	btn[1].Create(3,&button,&selectRect,btnRect,&g_DibInf.colorBuf);
	selectRect.top = 528;	selectRect.bottom = selectRect.top +40;
	for(j=0;j<10;j++){
		selectRect.left = 286 +j*42;	selectRect.right = selectRect.left +40;
		for(i=0;i<7;i++){
			btnRect[i].left = j*40;		btnRect[i].right = btnRect[i].left +40;
			btnRect[i].top = i*40;	btnRect[i].bottom = btnRect[i].top +40;
		}
		pageBtn[j].Create(5,&pagebutton,&selectRect,btnRect,&g_DibInf.colorBuf);
	}
	selectRect.top = 18+128; selectRect.bottom = selectRect.top +25;
	for(j=0;j<2;j++){
		if(j==0){
			selectRect.left = 20+289; selectRect.right = selectRect.left +86;
		}else{
			selectRect.left = 20+385; selectRect.right = selectRect.left +86;
		}
		for(i=0;i<5;i++){
			btnRect[i].left = j*86;	btnRect[i].right = btnRect[i].left +86;
			btnRect[i].top = i*25;	btnRect[i].bottom = btnRect[i].top +25;
		}
		yesnoBtn[j].Create(3,&yesNoWnd,&selectRect,btnRect,&g_DibInf.colorBuf);
	}
	time_t		tmp_time = 0;
	for(i=0;i<50;i++){
		char	fname[32];
		struct _stat	fstatus;
		wsprintf( fname, "save_%02d.sav", i+1 );
		if(0==_access(fname,0)){
			useTable[i] = TRUE;
			_stat(fname,&fstatus);
			file_time[i] = fstatus.st_mtime;
			if(tmp_time < file_time[i]){
				tmp_time = file_time[i];
				new_time = i+1;
			}
		}
	}
	selectNum = btnSelect = 0xff;
	if(new_time){
		offsetNum = ((new_time-1) /5)*5;
		SetWindowCursorPos(sysInf.hWnd, 100, 18+45+ 100* (new_time-1-offsetNum));
		selectNum = (new_time-1-offsetNum);
	}
	CreateInfo();
	wallWnd.Release();
	changeExecMode(mode);
	startTime = timeGetTime() +500;
	state = save_fadein;
} // SaveWnd::SaveWnd
Exemplo n.º 23
0
BOOL KabeSetWnd::Exec()
{
	int			i,j,oldSelect = selectBtn,btnNo;
	BOOL		bPush = FALSE;
	POINT		icPt;
	char		str[MAX_PATH];

	if(kabegami_mode!=sysInf.execMode)return FALSE;
	switch(state){
	  case 0:
	  case 2:
	  case 5:
	  case 8:
		time = bgInf.look_cnt-timeGetTime();
		baseWnd.alpha = float(bgInf.look_max-time)/bgInf.look_max;
		if(time<=0){
			baseWnd.alpha = 1.0f;
			bgInf.look_cnt = 0;
			if(state==5)state = 1;
			else state ++;
		}
		if(9==state){
			changeExecMode( event_exec_mode );
		}
		return TRUE;
	  case 1:
		if(kabeIcon.alpha < 1.0f){
			kabeIcon.alpha += 0.033334f;
			if(kabeIcon.alpha > 1.0f) kabeIcon.alpha = 1.0f;
			break;
		}else if(keyState.push_action && selectNum>=0){
			PlayEffectNum(evtHandle[1],SelectSnd);
			wsprintf(str,"v01%02d0",ct_info[selectNum].num);
			baseWnd.loadLGF(pack_eventcg,str);
			state = 2;
			bgInf.look_max = 900;
			bgInf.look_cnt = timeGetTime() +bgInf.look_max;
			kabeButton.alpha = baseWnd.alpha = 0;
		}else if(keyState.push_left || keyState.push_up){
			bPush = TRUE;
			if(selectNum<=0)selectNum = dropStart -1;
			else selectNum --;
		}else if(keyState.push_right || keyState.push_down){
			bPush = TRUE;
			selectNum ++;
			if(selectNum >= dropStart)selectNum = 0;
		}
		if(dropStart==0)bPush = FALSE;
		if(bPush){
			icPt.x = (selectNum%4)*200 +100;
			icPt.y = 399-(selectNum/4)*133 +50;
			ClientToScreen(sysInf.hWnd,&icPt);
			SetCursorPos(icPt.x, icPt.y);
		}else{
			selectNum = -1;
		}
		for(i=0;i<dropStart;i++){
			rect.left = 200*(i%4);	rect.right = rect.left +200;
			rect.top = 399 -133*(i/4);	rect.bottom = rect.top +133;
			if(PtInRect(&rect,sysInf.msPoint)){
				selectNum = i;
				break;
			}
		}
		for(btnNo=0;btnNo<4;btnNo++){
			if(btn[btnNo].CheckState(&sysInf.msPoint))break;
		}
		if(keyState.push_fairyAttack || btnNo<=1){
			PlayEffectNum(evtHandle[1],CancelSnd);
			state = 7;
			for(i=0;i<dropStart;i++) ct_info[i].speed = 1.0f;
			break;
		}
		if(keyState.push_cancel || 3==btnNo){
			PlayEffectNum(evtHandle[1],CancelSnd);
			baseWnd.loadLGF(pack_eventcg,"s20100");
			bgInf.colorBuf.loadLGF(pack_eventcg,"s20100",Type_back);
			backColorBuf.BltFast(40, 30, &bgInf.colorBuf, NULL, FALSE);
			saveInf.btRect.left = saveInf.btRect.top = 0;
			saveInf.btRect.right = 800;	saveInf.btRect.bottom = 600;
			saveInf.btPoint.x = 40; saveInf.btPoint.y = 30;

			state = 8;
			bgInf.look_max = 900;
			bgInf.look_cnt = timeGetTime() +bgInf.look_max;
			return TRUE;
		}
		if(keyState.push_camp || 2==btnNo){
			if(dropStart>=KABE_NUM){
				PlayEffectNum(evtHandle[1],9007);
				break;
			}
			PlayEffectNum(evtHandle[1],SelectSnd);
			dropNum = rndSelect(4)+1;
			if((dropStart+dropNum)>KABE_NUM){
				dropNum = KABE_NUM -dropStart;
			}
			for(i=0;i<dropNum;i++){
				ct_info[i+dropStart].bDrop = TRUE;
				ct_info[i+dropStart].point.x = 200*( (i+dropStart)%4 );
				ct_info[i+dropStart].point.y = -133 -rndSelect(100);
				while(1){
					ct_info[i+dropStart].num = rndSelect(KABE_TYPE);
					for(j=0;j<i+dropStart;j++){
						if( ct_info[i+dropStart].num == ct_info[j].num )break;
					}
					if(j == (i+dropStart))break;
				}
				ct_info[i+dropStart].speed = 1.0f;
				ct_info[i+dropStart].rect.left = 0;
				ct_info[i+dropStart].rect.right = 200;
				ct_info[i+dropStart].rect.top = 133*(ct_info[i+dropStart].num);
				ct_info[i+dropStart].rect.bottom = ct_info[i+dropStart].rect.top +133;
			}
			state = 6;
		}
		break;
	  case 3:
		if(kabeButton.alpha > 0){
			kabeButton.alpha += 0.033334f;
			if(kabeButton.alpha >= 1.0f){
				kabeButton.alpha = 1.0f;
				state = 4;
			}
		}else if(keyState.push_action){
			kabeButton.alpha = 0.033334f;
		}
		break;
	  case 4:
		for(btnNo=0;btnNo<2;btnNo++){
			if(set_btn[btnNo].CheckState(&sysInf.msPoint)){
				break;
			}
		}
		if(btnNo==2){
			if(keyState.push_cancel) btnNo = 1;
			if(keyState.push_camp) btnNo = 0;
		}
		if(btnNo < 2){
			if(btnNo==0){
				PlayEffectNum(evtHandle[1],SelectSnd);
				char newfile[MAX_PATH];
				wsprintf(str,"\\LeafFanDisc%02d.bmp",ct_info[selectNum].num);
				GetWindowsDirectory(newfile,MAX_PATH);
				strcat(newfile,str);
				wsprintf(str,".\\壁紙\\LeafFanDisc%02d.bmp",ct_info[selectNum].num);

				CopyFile(str,newfile,FALSE);

				SetWallPaper(newfile);
			}else{
				PlayEffectNum(evtHandle[1],CancelSnd);
			}
			baseWnd.loadLGF(pack_gparts,"kabeBase");
			bgInf.look_max = 900;
			bgInf.look_cnt = timeGetTime() +bgInf.look_max;
			kabeIcon.alpha = baseWnd.alpha = 0;
			state = 5;
		}
		break;
	  case 6:
		j = 0;
		for(i=0;i<dropNum;i++){
			if(!ct_info[i+dropStart].bDrop)continue;
			j ++;
			ct_info[i+dropStart].point.y += int(ct_info[i+dropStart].speed);
			ct_info[i+dropStart].speed += 0.5f;
			if(ct_height[(i+dropStart)%4] <= ct_info[i+dropStart].point.y){
				ct_info[i+dropStart].point.y = ct_height[(i+dropStart)%4];
				ct_info[i+dropStart].bDrop = FALSE;
				ct_height[(i+dropStart)%4] -= 133;
				PlayEffectNum(evtHandle[i],1012);
			}
		}
		if(j==0){
			dropStart += dropNum;
			dropNum = 0;
			state = 1;
		}
		break;
	  case 7:
		j = 0;
		for(i=0;i<dropStart;i++){
			ct_info[i].point.y += int(ct_info[i].speed);
			ct_info[i].speed += 0.5f;
			if(ct_info[i].point.y < 600) j++;
		}
		if(j==0){
			dropStart = dropNum = 0;
			for(i=0;i<4;i++)ct_height[i] = 399;
			state = 1;
		}
		break;
	}
	return TRUE;
} // KabeSetWnd::Exec
Exemplo n.º 24
0
BOOL SaveWnd::selectExec()
{
	int		i;
	BOOL	bSetCur = FALSE;
	int		oldSelect = selectNum, oldBtn = btnSelect;
	switch(state){
	  case save_fadein:
		if(timeGetTime() >= startTime){
			alpha = 1.0f;
			state = save_exec;
		}else{
			alpha = 1.0f - (startTime -timeGetTime()) /500.0f;
		}
		SetAlpha();
		btn[2].selectRect.top = 565; btn[2].selectRect.bottom = btn[2].selectRect.top+25;
		btn[2].selectRect.left = LONG(709 +(1.0f- alpha)*(47+40*4));
		btn[2].selectRect.right = btn[2].selectRect.left +86;
		return TRUE;
	  case save_fadeout:
		if(timeGetTime() >= startTime){
			alpha = 0;
			changeExecMode(bak_mode);	
			return FALSE;
		}
		alpha = (startTime -timeGetTime()) /500.0f;
		SetAlpha();
		btn[2].selectRect.top = 457+4*27;
		btn[2].selectRect.top += LONG((1.0f-alpha)*40);
		btn[2].selectRect.bottom = btn[2].selectRect.top +25;
		return TRUE;
	  case save_writeSure:
		if(keyState.push_left || keyState.push_right || keyState.push_up || keyState.push_down){
			bYesNo = !bYesNo;
			SetWindowCursorPos(sysInf.hWnd,yesnoBtn[bYesNo].selectRect.left+43, yesnoBtn[bYesNo].selectRect.top+12);
		}
		for(i=0;i<2;i++){
			if(yesnoBtn[i].CheckState(&sysInf.msPoint)){
				if(i==0){
					PlayEffectNum(evtHandle[11],SE_PUSH);
					state = save_writeExec;
					return TRUE;
				}else{
					PlayEffectNum(evtHandle[11],SE_CANCEL);
					state = save_exec;
				}
			}
		}
		if(keyState.push_cancel){
			PlayEffectNum(evtHandle[11],SE_CANCEL);
			state = save_exec;
		}
		return TRUE;
	  case save_loadSure:
		if(keyState.push_left || keyState.push_right || keyState.push_up || keyState.push_down){
			bYesNo = !bYesNo;
			SetWindowCursorPos(sysInf.hWnd,yesnoBtn[bYesNo].selectRect.left+43, yesnoBtn[bYesNo].selectRect.top+12);
		}
		for(i=0;i<2;i++){
			if(yesnoBtn[i].CheckState(&sysInf.msPoint)){
				if(i==0){
					if(SAV_Load( selectNum+offsetNum+1 )){
						PlayEffectNum(evtHandle[11],SE_PUSH);
						startTime = timeGetTime();
						state = save_loadEnd;
						return TRUE;
					}
					startTime = timeGetTime() +500;
					state = save_fadeout;
					return TRUE;
				}else{
					PlayEffectNum(evtHandle[11],SE_CANCEL);
					state = save_exec;
				}
			}
		}
		if(keyState.push_cancel){
			PlayEffectNum(evtHandle[11],SE_CANCEL);
			state = save_exec;
		}
		return TRUE;
	  case save_writeExec:
		new_time = selectNum+offsetNum+1;
		SAV_Save( new_time );
		useTable[selectNum+offsetNum] = TRUE;

		struct _stat	fstatus;
		char fname[32];
		wsprintf( fname, "save_%02d.sav", new_time );
		_stat(fname,&fstatus);
		file_time[selectNum+offsetNum] = fstatus.st_mtime;

		CreateInfo();
		startTime = timeGetTime();
		state = save_writeEnd;
	  case save_loadEnd:
	  case save_writeEnd:
		i = timeGetTime() -startTime;
		if(i>1000){
			if(state==save_writeEnd){
				changeExecMode(bak_mode);
			}else{
				changeExecMode(event_exec_mode);
			}
			startTime = timeGetTime();
			if(voicefile[0])PlayVoice(voicefile, FALSE, 255);
			voicefile[0] = '\0';
			bFadeOut = TRUE;
		}
		return TRUE;
	}
	btnSelect = 0xff;
	for(i=0;i<3;i++){
		if(btn[i].CheckState(&sysInf.msPoint)){
			btnSelect = i;
			switch(i){
			  case 0:	
				PlayEffectNum(evtHandle[11],SE_PUSH);		
				if(0==offsetNum)offsetNum = 45;
				else offsetNum -= 5;
				CreateInfo();
				return TRUE;
			  case 1:	
				PlayEffectNum(evtHandle[11],SE_PUSH);		
				offsetNum += 5;
				if(offsetNum>45)offsetNum = 0;
				CreateInfo();
				return TRUE;
			  default:	
				PlayEffectNum(evtHandle[11],SE_CANCEL);		
				startTime = timeGetTime() +500;
				state = save_fadeout;
				return TRUE;
			}
		}else if(btn_onCursor==btn[i].GetState()){
			btnSelect = i;
			if(oldBtn != btnSelect){
				PlayEffectNum(evtHandle[11],SE_SELECT);		
			}
		}
	}
	for(i=0;i<10;i++){
		if(pageBtn[i].CheckState(&sysInf.msPoint)){
			PlayEffectNum(evtHandle[11],SE_PUSH);
			btnSelect = i+3;
			offsetNum = i*5;
			CreateInfo();
			return TRUE;
		}else if(btn_onCursor==pageBtn[i].GetState()){
			btnSelect = i+3;
			if(oldBtn != btnSelect){
				PlayEffectNum(evtHandle[11],SE_SELECT);
			}
		}
	}
	if(keyState.push_action){
		if(selectNum<5){
			if(useTable[selectNum+offsetNum]){
				PlayEffectNum(evtHandle[11],SE_PUSH);
				SetWindowCursorPos(sysInf.hWnd,yesnoBtn[0].selectRect.left +43, yesnoBtn[0].selectRect.top +12);
				if(mode==save_mode) state = save_writeSure;
				else state = save_loadSure;
				return TRUE;
			}else if(mode==save_mode){
				PlayEffectNum(evtHandle[11],SE_PUSH);
				state = save_writeExec;
				return TRUE;
			}
		}
	}else if(keyState.push_cancel){
		PlayEffectNum(evtHandle[11],SE_CANCEL);		
		startTime = timeGetTime() +500;
		state = save_fadeout;
		return TRUE;
	}else if(keyState.push_up){
		for(i=0;i<5;i++){
			if(selectNum==0xff){
				selectNum = 0;
			}else if(selectNum==0){
				selectNum = 4;
				if(0==offsetNum)offsetNum = 45;
				else offsetNum -= 5;
				CreateInfo();
			}else{
				selectNum --;
			}
			if(mode==save_mode || useTable[selectNum+offsetNum])break;
		}
		if(i==5){
			selectNum = 0xff;
		}else{
			bSetCur = TRUE;
		}
	}else if(keyState.push_down){
		for(i=0;i<5;i++){
			if(selectNum>=4){
				selectNum = 0;
				offsetNum += 5;
				if(offsetNum>45)offsetNum = 0;
				CreateInfo();
			}else{
				selectNum ++;
			}
			if(mode==save_mode || useTable[selectNum+offsetNum])break;
		}
		if(i==5){
			selectNum = 0xff;
		}else{
			bSetCur = TRUE;
		}
	}else if(keyState.push_left){
		if(0==offsetNum)offsetNum = 45;
		else offsetNum -= 5;
		CreateInfo();
		return TRUE;
	}else if(keyState.push_right){
		offsetNum += 5;
		if(offsetNum>45)offsetNum = 0;
		CreateInfo();
		return TRUE;
	}
	if(bSetCur){
		if(sysInf.msPoint.x>=20 && sysInf.msPoint.x<706){
			point.x = sysInf.msPoint.x;
		}else{
			point.x = 20 +40;
		}
		point.y = 18 +40 +selectNum*100;
		SetWindowCursorPos(sysInf.hWnd, point.x, point.y);
	}else{
		selectNum = 0xff;
		for(i=0;i<5;i++){
			rect.left = 20;
			rect.right = rect.left +686;
			rect.top = 18 +100*i;
			rect.bottom = rect.top +96;
			if(myPtInRect(&rect, &sysInf.msPoint)){
				if(mode==save_mode || useTable[i+offsetNum]){
					selectNum = i;
					break;
				}
			}
		}
	}
	if(0xff != selectNum){
		yesnoBtn[0].selectRect.top = yesnoBtn[1].selectRect.top = 18+128+100*selectNum;
		yesnoBtn[0].selectRect.bottom = yesnoBtn[1].selectRect.bottom = yesnoBtn[0].selectRect.top +25;
		if(selectNum!=oldSelect){
			PlayEffectNum(evtHandle[11],SE_SELECT);
		}
	}
	return TRUE;
} // SaveWnd::selectExec
Exemplo n.º 25
0
BOOL StaffmodeWnd::Exec()
{
	int			i,loadTex,nextStaff;
	BOOL		bPush = FALSE;
	POINT		icPt;

	if(staffmode_mode!=sysInf.execMode)return FALSE;
	switch(state){
	  case 0:
	  case 6:
		time = bgInf.look_cnt-timeGetTime();
		baseWnd.alpha = float(bgInf.look_max-time)/bgInf.look_max;
		if(time<=0){
			baseWnd.alpha = 1.0f;
			bgInf.look_cnt = 0;
			state ++;
		}
		if(1==state)baseWnd.loadLGF(pack_gparts,"staffBase");
		if(7==state)changeExecMode( event_exec_mode );
		panel[0].alpha = panel[1].alpha = button.alpha = logo.alpha = baseWnd.alpha;
		return TRUE;
	  case 1:
		if(keyState.push_cancel || keyState.push_down){
			PlayEffectNum(evtHandle[1],CancelSnd);
			baseWnd.loadLGF(pack_eventcg,"s20100");
			bgInf.colorBuf.loadLGF(pack_eventcg,"s20100",Type_back);
			backColorBuf.BltFast(40, 30, &bgInf.colorBuf, NULL, FALSE);
			saveInf.btRect.left = saveInf.btRect.top = 0;
			saveInf.btRect.right = 800;	saveInf.btRect.bottom = 600;
			saveInf.btPoint.x = 40; saveInf.btPoint.y = 30;

			state = 6;
			bgInf.look_max = 900;
			bgInf.look_cnt = timeGetTime() +bgInf.look_max;
			panel[0].alpha = panel[1].alpha = button.alpha = logo.alpha = baseWnd.alpha = 0;
		}else if(keyState.push_left){
			bTurn = 1;
		}else if(keyState.push_right){
			bTurn = 2;
		}else if(keyState.push_up){
			bTurn = 3;
		}
		for(i=0;i<3;i++){
			if(btn[i].CheckState(&sysInf.msPoint)){
				bTurn = i+1;
			}
		}
		if(bTurn==1){
			selectNum --;
			if(selectNum < 0) selectNum = 43;
			nextStaff = selectNum -1;
			if(nextStaff < 0)nextStaff += 44;
			frontNum --;
			if(frontNum < 0)frontNum = 3;
			loadTex = frontNum -1;
			if(loadTex < 0) loadTex = 3;
			wsprintf(str,"stt%03d",nextStaff);
			panel[loadTex].loadLGF(pack_eventcg,str);
			src[loadTex].buf = (BYTE *)panel[loadTex].pBuf;
			src[loadTex].pal = (RGB32 *)panel[loadTex].palColor;
			state = 2;
			writeName();
			PlayEffectNum(evtHandle[1],CurMoveSnd);
		}else if(bTurn==2){
			selectNum ++;
			if(selectNum > 43) selectNum = 0;
			nextStaff = selectNum+1;
			if(nextStaff > 43)nextStaff -= 44;
			frontNum ++;
			if(frontNum > 3)frontNum = 0;
			loadTex = frontNum +1;
			if(loadTex > 3) loadTex = 0;
			wsprintf(str,"stt%03d",nextStaff);
			panel[loadTex].loadLGF(pack_eventcg,str);
			src[loadTex].buf = (BYTE *)panel[loadTex].pBuf;
			src[loadTex].pal = (RGB32 *)panel[loadTex].palColor;
			state = 2;
			writeName();
			PlayEffectNum(evtHandle[1],CurMoveSnd);
		}else if(bTurn==3){
			state = 2;
			moveStep = 0;
			PlayEffectNum(evtHandle[1],SelectSnd);
		}
		break;
	  case 2:
		if(3==bTurn){
			moveStep ++;
			button.alpha = logo.alpha = float(19-moveStep)/19;
			if(moveStep==19){
				bTurn = 0;
				wsprintf(str,"st%03d",selectNum);
				baseWnd.loadLGF(pack_eventcg,str);
				clearPadState();
				state = 3;
			}
			break;
		}
		if(1==bTurn){
			deg += 5;
			if(deg >= 360) deg -= 360;
		}else if(2==bTurn){
			deg -= 5;
			if(deg < 0)deg += 360;
		}
		if(deg % 90 == 0){
			bTurn = 0;
			state = 1;
		}
		break;
	  case 3:
		if(keyState.push_action || keyState.push_down || keyState.push_cancel){
			PlayEffectNum(evtHandle[1],CancelSnd);
			baseWnd.loadLGF(pack_gparts,"staffBase");
			bTurn = 3;
			moveStep = 18;
			state = 4;
		}
		break;
	  case 4:
		moveStep --;
		button.alpha = logo.alpha = float(19-moveStep)/19;
		if(moveStep==0){
			bTurn = 0;
			state = 1;
		}
		break;
	}
	return TRUE;
} // StaffmodeWnd::Exec