function for debugging internal textures
this would have been nice for checking the textures of sf::Fonts
This commit is contained in:
@@ -1749,3 +1749,14 @@ void redraw_partial_terrain(rectangle redraw_rect) {
|
|||||||
rect_draw_some_item(terrain_screen_gworld().getTexture(),from_rect,mainPtr(),redraw_rect);
|
rect_draw_some_item(terrain_screen_gworld().getTexture(),from_rect,mainPtr(),redraw_rect);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void debug_show_texture(const sf::Texture& texture, float seconds, std::string label) {
|
||||||
|
sf::RenderWindow debug_window;
|
||||||
|
debug_window.create(sf::VideoMode(texture.getSize().x, texture.getSize().y, 32), label);
|
||||||
|
debug_window.setVisible(true);
|
||||||
|
makeFrontWindow(debug_window);
|
||||||
|
rect_draw_some_item(texture, rectangle(texture), debug_window, rectangle(texture));
|
||||||
|
debug_window.display();
|
||||||
|
sf::sleep(sf::seconds(seconds));
|
||||||
|
debug_window.setVisible(false);
|
||||||
|
}
|
||||||
@@ -63,8 +63,8 @@ void draw_startup_stats();
|
|||||||
void draw_trim(short q,short r,short which_trim,ter_num_t ground_ter);
|
void draw_trim(short q,short r,short which_trim,ter_num_t ground_ter);
|
||||||
sf::FloatRect compute_viewport(const sf::RenderWindow&, int mode, float ui_scale, float width, float height);
|
sf::FloatRect compute_viewport(const sf::RenderWindow&, int mode, float ui_scale, float width, float height);
|
||||||
|
|
||||||
|
|
||||||
void draw_startup_anim(bool advance);
|
void draw_startup_anim(bool advance);
|
||||||
|
|
||||||
|
void debug_show_texture(const sf::Texture& texture, float seconds = 2, std::string label = "");
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ size_t cCustomGraphics::count(bool party) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern void debug_show_texture(const sf::Texture& texture, float seconds = 2, std::string label = "");
|
||||||
|
|
||||||
void cCustomGraphics::copy_graphic(pic_num_t dest, pic_num_t src, size_t numSlots) {
|
void cCustomGraphics::copy_graphic(pic_num_t dest, pic_num_t src, size_t numSlots) {
|
||||||
if(numSlots < 1) return;
|
if(numSlots < 1) return;
|
||||||
// If the party doesn't have an export sheet, create one.
|
// If the party doesn't have an export sheet, create one.
|
||||||
|
|||||||
Reference in New Issue
Block a user