Exemple #1
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
Exemple #2
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;
}
Exemple #3
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();
}
Exemple #4
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);
}
Exemple #5
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;
}
Exemple #6
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);
}
Exemple #7
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
Exemple #8
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;
}
Exemple #9
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
Exemple #10
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