TETRIS: Use FontConfiguration
This commit is contained in:
+10
-4
@@ -61,16 +61,18 @@ int main() {
|
||||
|
||||
g_font = std::make_shared< SDLPP::Font >( "testfont.ttf", 36 );
|
||||
|
||||
g_main_scene = prepareMainScene( renderer, g_font );
|
||||
g_font_config = std::make_shared< SDLPP::FontConfiguration >(
|
||||
g_font, colors["text"], colors["text_out"], 0.1 );
|
||||
g_main_scene = prepareMainScene( renderer );
|
||||
line_coliders = g_main_scene->getObjects( { COLIDER_ID } );
|
||||
g_score_texture = std::dynamic_pointer_cast< SDLPP::TextRenderer >(
|
||||
g_main_scene->getObjects( { SCORE_TEXTURE_ID } )[0] );
|
||||
g_active_scenes.push_back( g_main_scene );
|
||||
g_main_scene->saveScene();
|
||||
|
||||
g_menu_scene = prepareMenuScene( renderer, g_font );
|
||||
g_game_over_scene = prepareGameOverScene( renderer, g_font );
|
||||
g_options_scene = prepareOptionsScene( renderer, g_font );
|
||||
g_menu_scene = prepareMenuScene( renderer );
|
||||
g_game_over_scene = prepareGameOverScene( renderer );
|
||||
g_options_scene = prepareOptionsScene( renderer );
|
||||
|
||||
auto base = SDL_GetTicks();
|
||||
int frames = 0;
|
||||
@@ -137,6 +139,10 @@ int main() {
|
||||
updateColors();
|
||||
g_update_colors = false;
|
||||
}
|
||||
if ( g_update_3d ) {
|
||||
updateBlocks();
|
||||
g_update_3d = false;
|
||||
}
|
||||
if ( g_update_size ) {
|
||||
updateSize();
|
||||
g_update_size = false;
|
||||
|
||||
Reference in New Issue
Block a user