TETRIS: static_cast might be faster than dynamic cast
This commit is contained in:
@@ -393,7 +393,7 @@ tetrisZLeft( std::shared_ptr< SDLPP::Renderer > renderer,
|
||||
void updateTextSizeInternal(std::shared_ptr<SDLPP::RenderObject> input) {
|
||||
if(input->getKilled())
|
||||
return;
|
||||
std::dynamic_pointer_cast< SDLPP::TextRenderer >( input )->setTextColor(
|
||||
static_cast< SDLPP::TextRenderer* >( input.get() )->setTextColor(
|
||||
*g_font, colors["text"], colors["text_out"], 0.1 );
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ void updateColors() {
|
||||
x->setColor( colors["line"] );
|
||||
}
|
||||
for ( auto &x : g_main_scene->getObjects( { TEXT_ID } ) ) {
|
||||
std::dynamic_pointer_cast< SDLPP::TextRenderer >( x )->setTextColor(
|
||||
static_cast< SDLPP::TextRenderer* >( x.get() )->setTextColor(
|
||||
*g_font, colors["text"], colors["text_out"], 0.1 );
|
||||
}
|
||||
g_menu_options[g_menu_select]->setColor( colors["menu_item_background"] );
|
||||
|
||||
Reference in New Issue
Block a user