Ejemplo n.º 1
0
void level_load_ext(STRING* _lvl) {
	if (_lvl != NULL) {
		if (panLoad == NULL) {
			on_level = on_level_event;
			on_level_load = on_level_loaded_event;
			panLoad = pan_create("", 100);
			vec_set(panLoad.blue, vector(8,8,8));
			pan_setdigits(panLoad, 0, 10, 10, "Loading...", font_create("Arial#30b"), 1, vDummy2);
			pan_setcolor(panLoad, 1, 1, vector(255,255,255));
			
			panLoadBar = pan_create("", 101);
			vec_set(panLoadBar.blue, vector(0,0,255));
		}
		
		panLoad.size_x = screen_size.x;
		panLoad.size_y = screen_size.y;
		panLoadBar.size_x = 0;
		panLoadBar.size_y = 40;
		panLoadBar.pos_x = 0;
		panLoadBar.pos_y = screen_size.y - 100;		
		set(panLoad, LIGHT | SHOW);
		set(panLoadBar, LIGHT | SHOW);
		
		wait(1);
		level_load(_lvl);
	}
}
Ejemplo n.º 2
0
void def_debug() 
{
	if(key_alt) 
	{ 
		diag_status(); 
		return; 
	}
	if(key_shift) 
	{
		diag_status();
		freeze_mode = !freeze_mode;
		if (freeze_mode)
		{
			def_oldmouse = mouse_mode;
			mouse_mode = 4;
			mouse_pointer = 2;
		}
		else
			mouse_mode = def_oldmouse;
			
		while (freeze_mode)
		{
			if(mouse_left)
			watched = mouse_ent;
			wait(1);
		}
		return;
	}

	if (key_ctrl) {
		toggle(viewMap,SHOW);
		while is(viewMap,SHOW) {
			vec_set(&viewMap->x,&camera->x);
			viewMap->z += 10000;
			wait(1);
		}
		return;
	}

	if(d3d_lines) {
		reset(def_debug_pan,SHOW);
		d3d_lines = 0;
		diag_mode &= ~1;
		} else {
		if is(def_debug_pan,SHOW) {
			d3d_lines = 3;
			} else {
			set(def_debug_pan,SHOW);
			diag_mode |= 1;
			while is(def_debug_pan,SHOW) {
				def_dfps = 0.9*def_dfps+0.1/time_frame;
				def_dtlv = time_level+time_sky;
				def_dtcs = time_client+time_server;
				def_dtrf = time_update+time_idle;
				def_dtac = time_actions+time_pfuncs;
				def_cang.pan = cycle(camera->pan,0,360); 
				def_cang.tilt = cycle(camera->tilt,-180,180); 
				def_cang.roll = cycle(camera->roll,-180,180); 
				
				pan_setcolor(def_debug_pan, 1, 3, vector(0, 255, 0));
				
				wait(1);
			}
		}
	}
}
Ejemplo n.º 3
0
void game_start()
{
	#ifndef SKIP_INTRO
	
		
		resetPpSwirl ();
		level_load("menu2.wmb");
		wait(3);
		
		setHdr(LVL_INTRO_HDR_STRENGTH, LVL_INTRO_HDR_THRESHOLD, LVL_INTRO_HDR_EXPOSURE);
		
		camera->arc = 60;
		camera->ambient = 0;
		fog_color = 0;
		
		camera_path("path1");
		PANEL* panBlack = pan_create(" ", 100);
		vec_set(panBlack.blue, vector(8,8,8));
		pan_setdigits(panBlack, 0, 5, 5, "Press [Space] to skip", font_create("Arial#24b"), 1, vDummy);
		pan_setcolor(panBlack, 1, 1, vector(255,255,255));
		set(panBlack, SHOW | LIGHT | OVERLAY);
		
		var vMediaHandle = snd_play(g_musicIntro, 100, 0);
		
		while (key_esc || key_space || key_enter)
			wait(1);
		
		while (snd_playing(vMediaHandle) && !key_esc && !key_space && !key_enter)
			wait(1);
		
		proc_kill((void*)camera_path);
		ptr_remove(panBlack);
		
		snd_stop(vMediaHandle);
		vMediaHandle = 0;
	
	#endif
	
	nPlayerLifes = 3;
	flying_man = 0;
	gui_start();
	
	// standard start level = temple
	#ifndef SKIP_TO
		lvlTempleInit();
	#else
		
		#ifdef SKIP_TO_LOTTIFANTLEVEL
			lvlLfInit();
		#endif
	
		#ifdef SKIP_TO_BOSSLEVEL
			lvlBossInit();
		#endif
		
		#ifdef SKIP_TO_LAVASTAGE
			lvlLavastageInit();
		#endif
		
		#ifdef SKIP_TO_CREDITS
			creditsInit();
		#endif
		
	#endif
}