Exemplo n.º 1
0
void main ()
{
	video_mode = 8;
	fps_max = 60;
	wait(2);
	bmap_zbuffer ( bmap_createblack(2048,2048,32) );
	mouse_mode = 4;
	mouse_map = bmap_create ( "arrow_yellow.pcx" );
	vec_fill ( &screen_color, 128 );
	
	level_load ( "" );
	camera->pan = -40;
	camera->tilt = -30;
	evnCameraLocate ();
	vec_set ( &colCameraBG, vector(150,150,150) );
	camera->bg = pixel_for_vec ( &colCameraBG, 100, 8888 );
	
	ENTITY *ent = ent_create ( CUBE_MDL, nullvector, NULL );
	
	// Create style for the menues
	// CMMEMBER *myMenuStyle = cmstyle_create ( FONT *font, COLOR *colText, COLOR *colBack, COLOR *colOver )
	FONT *fntTTF = font_create("Arial#16");
	CMStyle *myMenuStyle01 = cmstyle_create ( fntTTF, vector(40,40,40), vector(250,250,250), vector(210,210,210) );
	FONT *fntBitmap = font_create("ackfont.pcx");
	CMStyle *myMenuStyle02 = cmstyle_create ( fntBitmap, vector(170,170,255), vector(30,20,0), vector(0,0,185) );
	
	// Create a compact menu panel
	// PANEL *cmenu_create ( char *chrMember, var pos_x, var pos_y, var size_x, var layer, var flags, CMStyle *style )
	PANEL *myMenu01 = cmenu_create ( "menu name.submenu=txtMain", 110, 20, 200, 1, SHOW, myMenuStyle01 );
	PANEL *myMenu02 = cmenu_create ( "debug & statics.submenu=txtCMDebug", 500, 20, 200, 1, SHOW, myMenuStyle01 );
	
	cmenu_modify ( myMenu02, 120, myMenuStyle02 );
	
	bmpSky = bmap_create ( "sky_fu_256+6.tga" );
	
	while ( !key_esc && !nExit )
	{
		str_setchr ( strString, 1, random(32)+32 );
		wait(1);
	}
	
	bmap_remove ( bmpSky );
	bmpSky = NULL;
	bmap_remove ( mouse_map );
	mouse_map = NULL;
	
	cmenu_remove ( myMenu01 );
	sys_free ( myMenuStyle01 ); 
	font_remove ( fntTTF );
	
	cmenu_remove ( myMenu02 );
	sys_free ( myMenuStyle02 );
	font_remove ( fntBitmap ); 
	
	sys_exit ( NULL );

}
Exemplo n.º 2
0
void
_bmap_op_done(const struct pfl_callerinfo *pci, struct bmap *b,
    const char *fmt, ...)
{
	va_list ap;

	BMAP_LOCK_ENSURE(b);

	psc_assert(!(b->bcm_flags & BMAPF_TOFREE));

	va_start(ap, fmt);
	_psclogv_pci(pci, SLSS_BMAP, 0, fmt, ap);
	va_end(ap);

	if (!psc_atomic32_read(&b->bcm_opcnt)) {
		b->bcm_flags |= BMAPF_TOFREE;
		DEBUG_BMAP(PLL_DIAG, b, "free bmap now");
		BMAP_ULOCK(b);

		/*
		 * Invoke service specific bmap cleanup callbacks:
		 * mds_bmap_destroy(), iod_bmap_finalcleanup(), and
		 * msl_bmap_final_cleanup().
		 */
		if (sl_bmap_ops.bmo_final_cleanupf)
			sl_bmap_ops.bmo_final_cleanupf(b);

		bmap_remove(b);
	} else {
		bmap_wake_locked(b);
		BMAP_ULOCK(b);
	}
}
Exemplo n.º 3
0
void ChapterDataFree(ChapterData *data)
{
	sys_free(data->chapter_name);
	sys_free(data->chapter_iname);
	sys_free(data->pad);

	if(data->thumbnail)
		bmap_remove(data->thumbnail);

	if(data->fog_color)
	{
		if(data->fog_range)
			sys_free(data->fog_range);

		sys_free(data->fog_color);
	}

	if(data->sun_color)
		sys_free(data->sun_color);

	sys_free(data);
}