示例#1
0
DreamsIntro::DreamsIntro()
{
    mStep = 1;
    mTimer = TickBase * 4;

    VW_SetScreenMode (GRMODE);
    VW_ClearVideo (BLACK);

    US_SetLoadSaveHooks(LoadGame,SaveGame,ResetGame);
    restartgame = gd_Continue;

    //while (true)
    //{

        loadedgame = false;

        mFileName1 = "TITLESCR.LBM";
        if (LoadLIBShape("KDREAMS.CMP", mFileName1.c_str(), &mFileShape1))
        {
            //Quit("Can't load TITLE SCREEN");
        }

        //while (!restartgame && !loadedgame)


    VW_InitDoubleBuffer();
    IN_ClearKeysDown();

    VW_SetScreen(0, 0);
    MoveGfxDst(0, 200);
    UnpackEGAShapeToScreen(&mFileShape1, 0, 0);
    mTimer = TickBase * 4;

}
示例#2
0
void DreamsIntro::ponder(const float deltaT)
{
    // Ticking until input happens or user presses something
    if(mTimer > 0)
    {
        mTimer--;

        if(gInput.getPressedAnyCommand())
        {
            gEventManager.add( new LaunchControlPanel );
            mTimer = 0;
        }

        return;
    }

    if(mStep == 1)
    {
        VW_SetScreen(0, 0);
        MoveGfxDst(0, 200);
        UnpackEGAShapeToScreen(&mFileShape1, 0, 0);
        mTimer = TickBase * 4;
        mStep++;
    }
    else if(mStep == 2)
    {
        MoveGfxDst(0, 200);
        UnpackEGAShapeToScreen(&mFileShape1, 0, 0);
        mTimer = TickBase * 3;
        mStep++;
    }
    else
    {
        displayofs = 0;
        mTimer = TickBase * 6;
        mStep = 1;
    }
}
示例#3
0
void
DemoLoop (void)
{
	//id0_char_t		*s;
	//id0_word_t		move;
	//id0_longword_t	lasttime;
	const id0_char_t *FileName1;
	struct Shape FileShape1;
#if CREDITS
	const id0_char_t *FileName2;
	struct Shape FileShape2;
#endif
	//struct ffblk ffblk;
	//WindowRec	mywin;
	id0_int_t bufsave	= bufferofs;
	id0_int_t dissave	= displayofs;


#if FRILLS
//
// check for launch from ted
//
	if (tedlevel)
	{
		NewGame();
		gamestate.mapon = tedlevelnum;
		GameLoop();
		TEDDeath();
	}
#endif

//
// demo loop
//
	US_SetLoadSaveHooks(LoadGame,SaveGame,ResetGame);
	restartgame = gd_Continue;

	BE_FILE_T handle = BE_Cross_open_for_reading("KDREAMS.CMP");
	//int handle = open("KDREAMS.CMP" ,O_BINARY | O_RDONLY);
	if (!BE_Cross_IsFileValid(handle))
	//if (handle == -1)
		Quit("Couldn't find KDREAMS.CMP");
	BE_Cross_close(handle);
#if 0
	if (findfirst("KDREAMS.CMP", &ffblk, 0) == -1)
		Quit("Couldn't find KDREAMS.CMP");
#endif

	while (true)
	{

		loadedgame = false;

		FileName1 = "TITLESCR.LBM";
		if (LoadLIBShape("KDREAMS.CMP", FileName1, &FileShape1))
			Quit("Can't load TITLE SCREEN");
#if CREDITS
		FileName2 = "CREDITS.LBM";
		if (LoadLIBShape("KDREAMS.CMP", FileName2, &FileShape2))
			Quit("Can't load CREDITS SCREEN");
#endif

		while (!restartgame && !loadedgame)
		{

			VW_InitDoubleBuffer();
			IN_ClearKeysDown();

			while (true)
			{

				VW_SetScreen(0, 0);
				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(&FileShape1, 0, 0);
				VW_ScreenToScreen (64*200,0,40,200);

#if CREDITS
				if (IN_UserInput(TickBase * 8, false))
					break;
#else
				if (IN_UserInput(TickBase * 4, false))
					break;
#endif

#if CREDITS
				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(&FileShape2, 0, 0);
				VW_ScreenToScreen (64*200,0,40,200);

				if (IN_UserInput(TickBase * 7, false))
					break;
#else
				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(&FileShape1, 0, 0);
				VW_ScreenToScreen (64*200,0,40,200);

				if (IN_UserInput(TickBase * 3, false))
					break;
#endif

				displayofs = 0;
				VWB_Bar(0,0,320,200,FIRSTCOLOR);
				US_DisplayHighScores(-1);

				if (IN_UserInput(TickBase * 6, false))
					break;

			}

			bufferofs = bufsave;
			displayofs = dissave;

			VW_FixRefreshBuffer();
			US_ControlPanel ();
		}

		if (!loadedgame)
			NewGame();

		FreeShape(&FileShape1);
#if CREDITS
		FreeShape(&FileShape2);
#endif
		GameLoop();
	}
}
示例#4
0
文件: kd_demo.c 项目: NY00123/refkeen
void
DemoLoop_New (void)
{
	//id0_char_t		*s;
	//id0_word_t		move;
	//id0_longword_t	lasttime;
	// REFKEEN - Add FakeCGA shape for 2015 port
	const id0_char_t *FileName0;
	struct Shape FileShape0;
	const id0_char_t *FileName1;
	struct Shape FileShape1;
	// REFKEEN - CREDITS is now a variable, set based on version
//#if CREDITS
	const id0_char_t *FileName2;
	struct Shape FileShape2;
	// REFKEEN - Add second credits shape for 2015 port
	const id0_char_t *FileName3;
	struct Shape FileShape3;
//#endif
	//struct ffblk ffblk;
	//WindowRec	mywin;
	id0_int_t bufsave	= bufferofs;
	id0_int_t dissave	= displayofs;


#if FRILLS
//
// check for launch from ted
//
	if (tedlevel)
	{
		NewGame();
		gamestate.mapon = tedlevelnum;
		GameLoop();
		TEDDeath();
	}
#endif

//
// demo loop
//
	// REFKEEN - Alternative controllers support
	BE_ST_AltControlScheme_Push();
	BE_ST_AltControlScheme_PrepareControllerMapping(&g_ingame_altcontrol_mapping_demoloop);

	US_SetLoadSaveHooks(LoadGame,SaveGame,ResetGame);
	restartgame = gd_Continue;

	BE_FILE_T handle = BE_Cross_open_readonly_for_reading("KDREAMS.CMP");
	//int handle = open("KDREAMS.CMP" ,O_BINARY | O_RDONLY);
	if (!BE_Cross_IsFileValid(handle))
	//if (handle == -1)
		Quit("Couldn't find KDREAMS.CMP");
	BE_Cross_close(handle);
#if 0
	if (findfirst("KDREAMS.CMP", &ffblk, 0) == -1)
		Quit("Couldn't find KDREAMS.CMP");
#endif

	while (true)
	{

		loadedgame = false;

		if (refkeen_current_gamever == BE_GAMEVER_KDREAMS2015)
		{
			FileName0 = "TITLECGA.LBM";
			if (LoadLIBShape("KDREAMS.CMP", FileName0, &FileShape0))
				Quit("Can't load TITLE SCREEN");
		}
		FileName1 = "TITLESCR.LBM";
		if (LoadLIBShape("KDREAMS.CMP", FileName1, &FileShape1))
			Quit("Can't load TITLE SCREEN");
		if (CREDITS)
		{
			// REFKEEN - Instead of loading just "CREDITS.LBM"
			// (which never happened with the original EXEs in practice),
			// load "CREDITS1.LBM" and "CREDITS2.LBM", as available
			// in the 2015 release
			FileName2 = "CREDITS1.LBM";
			if (LoadLIBShape("KDREAMS.CMP", FileName2, &FileShape2))
				Quit("Can't load CREDITS SCREEN 1");
			if (refkeen_current_gamever == BE_GAMEVER_KDREAMS2015)
			FileName3 = "CREDITS2.LBM";
			if (LoadLIBShape("KDREAMS.CMP", FileName3, &FileShape3))
				Quit("Can't load CREDITS SCREEN 3");
		}

		while (!restartgame && !loadedgame)
		{

			VW_InitDoubleBuffer();
			IN_ClearKeysDown();

			while (true)
			{

				// REFKEEN - We're in an EGA-only function anyway,
				// so use EGA versions of VW functions...
				VW_SetScreen_EGA(0, 0);
				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(fakecgamode ? &FileShape0 : &FileShape1, 0, 0);
				VW_ScreenToScreen_EGA (64*200,0,40,200);

				if (IN_UserInput(CREDITS ? (TickBase * 8) : (TickBase * 4), false))
					break;

		// REFKEEN - Patch for 2015 port
		if (!fakecgamode)
		{
			if (CREDITS)
			{
				// REFKEEN - Show two credits screens
				// as present in the 2015 release
				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(&FileShape2, 0, 0);
				VW_ScreenToScreen_EGA (64*200,0,40,200);

				if (IN_UserInput(TickBase * 7, false))
					break;

				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(&FileShape3, 0, 0);
				VW_ScreenToScreen_EGA (64*200,0,40,200);

				if (IN_UserInput(TickBase * 7, false))
					break;
			}
			else
			{
				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(&FileShape1, 0, 0);
				VW_ScreenToScreen_EGA (64*200,0,40,200);

				if (IN_UserInput(TickBase * 3, false))
					break;
			}
		}

				displayofs = 0;
				VWB_Bar(0,0,320,200,FIRSTCOLOR);
				US_DisplayHighScores(-1);

				if (IN_UserInput(TickBase * 6, false))
					break;

			}

			bufferofs = bufsave;
			displayofs = dissave;

			VW_FixRefreshBuffer();
			US_ControlPanel ();
		}

		if (!loadedgame)
			NewGame();

		if (refkeen_current_gamever == BE_GAMEVER_KDREAMS2015)
			FreeShape(&FileShape0);
		FreeShape(&FileShape1);
		if (CREDITS)
		{
			// REFKEEN - Free two credits screens as present in the 2015 release
			FreeShape(&FileShape2);
			FreeShape(&FileShape3);
		}
		GameLoop();
	}
	// REFKEEN - Alternative controllers support
	BE_ST_AltControlScheme_Pop();
}
示例#5
0
文件: loadscn.c 项目: BSzili/refkeen
void loadscn_exe_main (void)
{
	id0_int_t step;
	id0_boolean_t pressedkey = false;
	if (!BE_Cross_strcasecmp(id0_argv[1], "/?"))
	{
		BE_ST_clrscr();
		BE_ST_textcolor(15);
		BE_ST_textbackground(1);
		BE_ST_cprintf("\xD5\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xB8\r\n");
		BE_ST_cprintf("\xB3 LOADSCN                              \xB3\r\n");
		BE_ST_cprintf("\xB3 by Nolan Martin                      \xB3\r\n");
		BE_ST_cprintf("\xB3 Copyright 1992 - Softdisk Publishing \xB3\r\n");
		BE_ST_cprintf("\xD4\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBE\r\n");
		BE_ST_printf("\n");
		BE_ST_printf("/VER  - version number\n");
		BE_ST_printf("/?    - this help\n");
		BE_ST_HandleExit(0);
	}
	if (!BE_Cross_strcasecmp(id0_argv[1], "/VER"))
	{
		BE_ST_clrscr();
		BE_ST_textcolor(15);
		BE_ST_textbackground(1);
		BE_ST_cprintf("\xD5\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xB8\r\n");
		BE_ST_cprintf("\xB3 LOADSCN                              \xB3\r\n");
		BE_ST_cprintf("\xB3 by Nolan Martin                      \xB3\r\n");
		BE_ST_cprintf("\xB3 Copyright 1992 - Softdisk Publishing \xB3\r\n");
		BE_ST_cprintf("\xD4\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBE\r\n");
		BE_ST_printf("\n");
		BE_ST_printf("%s %s\n", "LOADSCN  ", " VERSION 1.10s   QA[0]");
		BE_ST_printf("\n");
		BE_ST_printf("This program requires an EGA monitor or better,\n");
		BE_ST_printf("                640K, and MS-DOS 3.0 or better.\n");
		BE_ST_HandleExit(0);
	}
	if (BE_Cross_strcasecmp(id0_argv[1], "LAST.SHL"))
		TrashProg("You must type START [ENTER] to run this program.\n");
	videocard = VideoID();
	if ((videocard != 3) && (videocard != 5))
		TrashProg("You need an EGA or VGA monitor to run this program.");
	screenmode = 3;
	SetScreenMode(screenmode);
	SetScreen(0,0);
	if (ext_LoadShape("ARMAPC.ABS", &imagetoshow))
		TrashProg("ERROR : Can't load image.");
	ext_MoveGfxDst(0, 200);
	UnpackEGAShapeToScreen(&imagetoshow, 0, 0);
	// REFKEEN - Alternative controllers support
	extern BE_ST_ControllerMapping g_ingame_altcontrol_mapping_inackback;
	BE_ST_AltControlScheme_PrepareControllerMapping(&g_ingame_altcontrol_mapping_inackback);
	// (REFKEEN) Add an artificial delay (screen not shown immediately on older machines)
	BE_ST_Delay(250);
	ScreenToScreen(8000, 0, 40, 200);
	for (step = 0; step < 10; ++step)
	{
		BE_ST_Delay(500);
		if (IsKeyPressed())
		{
			pressedkey = true;
			WaitForKeyRelease();
		}
	}
	if (!pressedkey)
		BE_ST_BiosScanCode(0);
	if (!ext_BLoad("LAST.ABS", &endscreen))
		TrashProg("Can't load Compressed Text - Possibly corrupt file!");
	screenmode = 1;
	SetScreenMode(screenmode);

	memcpy(BE_ST_GetTextModeMemoryPtr(), (id0_byte_t *)endscreen+7, 4000);
	BE_ST_MarkGfxForUpdate();
	//_fmemcpy(MK_FP(0xB800,0), (byte far *)endscreen+7, 4000);
	BE_ST_MoveTextCursorTo(0, 23); // gotoxy(1, 24)
	BE_ST_HandleExit(0);
}