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); }
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); }
bool create_course_script(char *file_name) { int sz; char *data,path[1024]; FILE *file; struct stat sb; // read the file file_paths_app(&file_path_setup,path,"Contents/Resources/Defaults","Course","js"); if (stat(path,&sb)!=0) return(FALSE); sz=sb.st_size; file=fopen(path,"r"); if (file==NULL) return(FALSE); data=(char*)malloc(sz); if (data==NULL) { fclose(file); return(FALSE); } fread(data,1,sz,file); fclose(file); // write the file file_paths_data_default(&file_path_setup,path,"Scripts/Courses",file_name,"js"); file=fopen(path,"w"); if (file==NULL) { free(data); return(FALSE); } fwrite(data,1,sz,file); fclose(file); return(TRUE); }