game_state *switch_state_new() { game_state *state = game_state_new(); set_function_pointers(state); allocate_state_data(state); create_physics_objects(state); return state; }
// Initializes subsystems (game state, GUI, PhysX, ...) void nov_modules_init() { // Initialize a new game state. game_state_new(); // ...and write an additional line if the game was started for the first time. if(game_is_first_time()) game_log_write("First time booting the game."); // Load resources. In the final, completed game, resources are loaded from add_resource(). game_resources_load(); // Continue to initialize the remaining subsystems. (PhysX engine, music player and the GUI state). game_physx_new(); game_gui_state_new(); game_mplayer_new("./sound/stream/", "*.ogg"); // Post-initialization. // gui_button_set_event(__GUIState_singleton->intro_lang_vn_button, EVENT_BUTTON_PUSH, NULL, __ui_flag_vn_event); // gui_button_set_event(__GUIState_singleton->intro_lang_en_button, EVENT_BUTTON_PUSH, NULL, __ui_flag_en_event); }