void reload_fonts(void) { LandBuffer * b = land_buffer_new(); land_buffer_cat(b, main_data_path); //land_buffer_cat(b, "/data/Muli-Regular.ttf") land_buffer_cat(b, "/data/JosefinSans-Regular.ttf"); char * path = land_buffer_finish(b); #line 118 All * a = global_a; float w = land_display_width(); //float h = land_display_height() double s = w / 960; #line 123 if (a->font) { land_font_destroy(a->font); } #line 125 if (a->medium) { land_font_destroy(a->medium); } #line 127 if (a->big) { land_font_destroy(a->big); } a->font = land_font_load(path, 10 * s); land_font_scale(a->font, 1.0 / s); a->medium = land_font_load(path, 24 * s); land_font_scale(a->medium, 1.0 / s); a->big = land_font_load(path, 60 * s); land_font_scale(a->big, 1.0 / s); #line 137 land_font_set(a->medium); land_text_get_width("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); #line 140 land_free(path); }
void overview_destroy(Overview * self) { for (int i = 1; i < 50; i += 1) { land_image_destroy(self->screenshot [i]); } #line 106 land_free(self); }
int my_main(void) { All * a; land_alloc(a); #line 291 int w = 960; int h = 600; a->show_help = 1; #line 295 land_init(); #line 297 main_data_path = land_strdup("."); #line 299 if (land_argc > 1) { if (land_equals(land_argv [1], "test")) { return test(); } } //land_set_display_parameters(w, h, LAND_OPENGL) #line 304 #ifdef ANDROID #line 306 land_set_display_parameters(0, 0, LAND_FULLSCREEN | LAND_DEPTH | LAND_LANDSCAPE); #line 306 #else #line 308 land_set_display_parameters(w, h, LAND_DEPTH | LAND_RESIZE); #line 308 #endif #line 316 LandRunner * game_runner = land_runner_new("Yellow and Dangerous", runner_init, NULL, runner_update, runner_redraw, NULL, runner_done); a->w = w; a->h = h; #line 320 land_runner_register(game_runner); land_set_initial_runner(game_runner); land_mainloop(); #line 324 land_free(main_data_path); land_free(a); #line 327 return 0; }
void blocktype_destroy(BlockType * self) { if (self->bitmaps) { { #line 50 LandArrayIterator __iter0__ = LandArrayIterator_first(self->bitmaps); #line 50 for (LandImage * pic = LandArrayIterator_item(self->bitmaps, &__iter0__); LandArrayIterator_next(self->bitmaps, &__iter0__); pic = LandArrayIterator_item(self->bitmaps, &__iter0__)) { land_image_destroy(pic); } } #line 52 land_array_destroy(self->bitmaps); } #line 53 land_free(self); }
void scene_free(scene_t *scene) { int i; glDisable(GL_LIGHT0); glDisable(GL_LIGHT1); glDisable(GL_LIGHT2); glDisable(GL_LIGHT3); glDisable(GL_LIGHT4); glDisable(GL_LIGHT5); glDisable(GL_LIGHT6); glDisable(GL_LIGHT7); if(scene->land) land_free(scene->land); if(scene->camera) camera_free(scene->camera); if(scene->pathpos) spline_free(scene->pathpos); if(scene->pathdir) spline_free(scene->pathdir); if(scene->sky) sky_free(scene->sky); if(scene->sun) sky_sun_free(scene->sun); if(scene->pathsun) spline_free(scene->pathsun); for(i = 0; i < scene->num_mesh; i++) thing_mesh_free(scene->mesh[i]); if(scene->mesh) free(scene->mesh); for(i = 0; i < scene->num_thing; i++) thing_free(scene->thing[i]); if(scene->thing) free(scene->thing); for(i = 0; i < scene->num_animation; i++) { thing_free(scene->animation[i]->thing); if(scene->animation[i]->path) spline_free(scene->animation[i]->path); free(scene->animation[i]); } if(scene->animation) free(scene->animation); for(i = 0; i < scene->num_particle; i++) { particle_free(scene->particle[i]->particle); if(scene->particle[i]->path) spline_free(scene->particle[i]->path); free(scene->particle[i]); } if(scene->particle) free(scene->particle); for(i = 0; i < scene->num_dynamiclight; i++) { dynamiclight_free(scene->dynamiclight[i]->light); if(scene->dynamiclight[i]->path) spline_free(scene->dynamiclight[i]->path); free(scene->dynamiclight[i]); } if(scene->dynamiclight) free(scene->dynamiclight); free(scene); }
void actors_reset(Actors * self) { land_array_destroy(self->array); self->array = land_array_new(); land_free(self->tilemap); self->tilemap = land_calloc(self->w * self->h * sizeof * self->tilemap); }