Ejemplo n.º 1
0
int view_images_load_single(char *path,bool simple)
{
	int					n,idx;
	view_image_type		*image;

		// already loaded?

	image=view.images;

	for (n=0;n!=view.count.image;n++) {
		if (strcmp(image->path,path)==0) return(n);
		image++;
	}

		// load it

	idx=view.count.image;
	view.count.image++;

	image=&view.images[idx];

	if (simple) {
		bitmap_open(&image->bitmap,path,anisotropic_mode_none,mipmap_mode_none,FALSE,FALSE,FALSE);
	}
	else {
		bitmap_open(&image->bitmap,path,setup.anisotropic_mode,setup.mipmap_mode,setup.texture_compression,FALSE,FALSE);
	}

	strcpy(image->path,path);

	return(idx);
}
Ejemplo n.º 2
0
void map_textures_read_texture(map_type *map,int txt_idx)
{
	int					n;
	char				path[1024],name[256];
	texture_type		*texture;
	texture_frame_type	*frame;
						
		// if in engine, then only load textures
		// directly hooked up to elements

#ifdef D3_ENGINE
	if (!map_textures_read_texture_ok(map,txt_idx)) return;
#endif

		// load textures
	
	texture=&map->textures[txt_idx];
			
		// load texture

	frame=texture->frames;
	
	for (n=0;n!=max_texture_frame;n++) {
	
		if (frame->name[0]!=0x0) {
				
				// bitmap
			
			file_paths_data(&file_path_setup,path,"Bitmaps/Textures",frame->name,"png");
			bitmap_open(&frame->bitmap,path,TRUE,texture->compress,texture->pixelated,FALSE,FALSE,FALSE);

				// bumpmap
				
			sprintf(name,"%s_n",frame->name);
			file_paths_data(&file_path_setup,path,"Bitmaps/Textures",name,"png");		// compresses messes up normals
			bitmap_open(&frame->bumpmap,path,TRUE,FALSE,texture->pixelated,FALSE,FALSE,texture->flip_normal);
							
				// specular map
				
			sprintf(name,"%s_s",frame->name);
			file_paths_data(&file_path_setup,path,"Bitmaps/Textures",name,"png");
			bitmap_open(&frame->specularmap,path,TRUE,texture->compress,texture->pixelated,FALSE,FALSE,FALSE);

				// glow map
				
			sprintf(name,"%s_g",frame->name);
			file_paths_data(&file_path_setup,path,"Bitmaps/Textures",name,"png");
			bitmap_open(&frame->glowmap,path,TRUE,texture->compress,texture->pixelated,FALSE,TRUE,FALSE);
		}
		
		frame++;
	}
}
Ejemplo n.º 3
0
void cursor_initialize(void)
{
	char		path[1024];
	
	file_paths_data(&setup.file_path_setup,path,"Bitmaps/UI_Elements","cursor","png");
	bitmap_open(&cursor_bitmap,path,anisotropic_mode_none,mipmap_mode_none,FALSE,FALSE,FALSE);
}
Ejemplo n.º 4
0
bool walk_view_initialize(void)
{
    char			path[1024];

    // interface textures

    file_paths_app(&file_path_setup,path,"Contents/Resources/Icons","spot","png");
    bitmap_open(&spot_bitmap,path,anisotropic_mode_none,mipmap_mode_none,FALSE,FALSE,FALSE);

    file_paths_app(&file_path_setup,path,"Contents/Resources/Icons","scenery","png");
    bitmap_open(&scenery_bitmap,path,anisotropic_mode_none,mipmap_mode_none,FALSE,FALSE,FALSE);

    file_paths_app(&file_path_setup,path,"Contents/Resources/Icons","node","png");
    bitmap_open(&node_bitmap,path,anisotropic_mode_none,mipmap_mode_none,FALSE,FALSE,FALSE);

    file_paths_app(&file_path_setup,path,"Contents/Resources/Icons","node_defined","png");
    bitmap_open(&node_defined_bitmap,path,anisotropic_mode_none,mipmap_mode_none,FALSE,FALSE,FALSE);

    file_paths_app(&file_path_setup,path,"Contents/Resources/Icons","light","png");
    bitmap_open(&light_bitmap,path,anisotropic_mode_none,mipmap_mode_none,FALSE,FALSE,FALSE);

    file_paths_app(&file_path_setup,path,"Contents/Resources/Icons","sound","png");
    bitmap_open(&sound_bitmap,path,anisotropic_mode_none,mipmap_mode_none,FALSE,FALSE,FALSE);

    file_paths_app(&file_path_setup,path,"Contents/Resources/Icons","particle","png");
    bitmap_open(&particle_bitmap,path,anisotropic_mode_none,mipmap_mode_none,FALSE,FALSE,FALSE);

    return(TRUE);
}
Ejemplo n.º 5
0
Archivo: map_view.c Proyecto: rzel/dim3
bool view_initialize(void)
{
	char			sub_path[1024],path[1024];

		// interface textures
		
	os_get_support_file_path(sub_path);
	strcat(sub_path,"/Items");
		
	file_paths_app(&file_path_setup,path,sub_path,"spot","png");
	bitmap_open(&spot_bitmap,path,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE);

	file_paths_app(&file_path_setup,path,sub_path,"scenery","png");
	bitmap_open(&scenery_bitmap,path,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE);
	
	file_paths_app(&file_path_setup,path,sub_path,"node","png");
	bitmap_open(&node_bitmap,path,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE);
	
	file_paths_app(&file_path_setup,path,sub_path,"node_defined","png");
	bitmap_open(&node_defined_bitmap,path,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE);
	
	file_paths_app(&file_path_setup,path,sub_path,"light","png");
	bitmap_open(&light_bitmap,path,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE);

	file_paths_app(&file_path_setup,path,sub_path,"sound","png");
	bitmap_open(&sound_bitmap,path,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE);

	file_paths_app(&file_path_setup,path,sub_path,"particle","png");
	bitmap_open(&particle_bitmap,path,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE);
	
		// view mesh sorting

	view_mesh_sort.meshes=(view_mesh_sort_mesh_type*)malloc(view_mesh_sort_max_mesh*sizeof(view_mesh_sort_mesh_type));
	if (view_mesh_sort.meshes==NULL) return(FALSE);

		// view transparent poly sorting

	view_poly_trans_sort.polys=(map_poly_sort_poly_type*)malloc(max_sort_poly*sizeof(map_poly_sort_poly_type));
	if (view_poly_trans_sort.polys==NULL) return(FALSE);

		// some defaults
		
	state.map.view_select_idx=0;
	state.map.select_box_on=FALSE;

	return(TRUE);
}