//---
void xmain(int argc, char *argv[])
{
	vc_initBuiltins();
	vc_initLibrary();

	InitGarlick();
	Handle::init();

	strcpy(mapname,"");

	LoadConfig();
	if (argc == 2)
	{
		if (strlen(argv[1]) > 254)
			err("Mapname argument too long!");
		strcpy(mapname, argv[1]);
	}

	InitVideo();

	mouse_Init();
	InitKeyboard();
	joy_Init();
	InitScriptEngine();

	gameWindow->setTitle(APPNAME);

	if (sound) snd_Init(soundengine);

	win_movie_init();
	ResetSprites();
	timer_Init(gamerate);

	LUA *lua;
	se = lua = new LUA();
	
	#ifdef ALLOW_SCRIPT_COMPILATION
	DisplayCompileImage();
	lua->compileSystem();
	CompileMaps("lua", lua);
	#endif
	
	se->ExecAutoexec();

	while (true && strlen(mapname))
		Engine_Start(mapname);
	err("");
}
Exemple #2
0
void LevelIntro(){
#ifdef FASTDEBUG
FadeIn(2,true);
return;
#endif
	FadeIn(2,false);
	ResetSprites();
	uint8_t xpos = 48-16;
	uint8_t soff;
	for(uint8_t i=0;i<8;i++){//"LEVEL XX"
		xpos += 16;
		if(i == 5)//space between level and numbers
			continue;
		soff = 0;
		while(soff < sizeof(sine_table)){
			WaitVsync(1);
			sprite_count = 4*i;
			if(i > 5)
				sprite_count -= 4;//don't lose sprite indices because of space

			uint8_t t0 = pgm_read_byte(&sine_table[soff++]);
			uint8_t t1;
			if(i < 5)
				t1 = pgm_read_byte(&lvl_sprite_string[i]);
			else if(i == 6)//tens
				t1 = FIRST_NUMERAL_SPRITE_FRAME+(p.level/10);
			else//ones
				t1 = FIRST_NUMERAL_SPRITE_FRAME+(p.level%10);

			DrawMetaSprite(xpos,t0,t1);
			WaitVsync(1);
		}
	}
	WaitVsync(80);

}