graphics: begin to rewrite code to be more simple: - add
a struct Texture to store a sf::Texture and the application's texture sizes, - add a texture resources manager and retrieve codes to allow - if needed, rescaling startsplash and spidlogo at startup - loading some graphics with different resolutions: buttons, inventory, pcedbuttons, statarea, startanim, startbut, startup, terscreen, textbar, transcript can be used to load high resolution pictures. Note: currently, render_image and res_image are a mess as Texture and sf:Texture classes cohabit :-~
This commit is contained in:
@@ -193,7 +193,7 @@ void Set_up_win () {
|
||||
ResMgr::graphics.get("invenbtns");
|
||||
ResMgr::graphics.get("staticons");
|
||||
ResMgr::graphics.get("dlogpics");
|
||||
ResMgr::graphics.get("pcedbuttons");
|
||||
ResMgr::textures.get("pcedbuttons");
|
||||
ResMgr::graphics.get("pcs");
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ void display_party() {
|
||||
win_draw_string(mainPtr,no_party_rect,"No party loaded.",eTextMode::WRAP,style);
|
||||
}
|
||||
else {
|
||||
sf::Texture& buttons_gworld = *ResMgr::graphics.get("pcedbuttons");
|
||||
auto const &buttons_gworld = *ResMgr::textures.get("pcedbuttons");
|
||||
from_rect = pc_info_rect;
|
||||
from_rect.top = from_rect.bottom - 11;
|
||||
if(!party_in_scen)
|
||||
@@ -397,7 +397,6 @@ void display_party() {
|
||||
else fill_rect(mainPtr, pc_area_buttons[i][0], sf::Color::Black);
|
||||
|
||||
from_rect = (current_pressed_button == i) ? ed_buttons_from[1] : ed_buttons_from[0];
|
||||
|
||||
rect_draw_some_item(buttons_gworld,from_rect,mainPtr,pc_area_buttons[i][0], sf::BlendAdd);
|
||||
|
||||
if(univ.party[i].main_status != eMainStatus::ABSENT) { // PC exists?
|
||||
|
Reference in New Issue
Block a user