display[mac]: add more setActive(false)
This commit is contained in:
@@ -57,7 +57,7 @@ bool cButton::isScrollable(){
|
|||||||
void cButton::draw(){
|
void cButton::draw(){
|
||||||
rectangle from_rect, to_rect;
|
rectangle from_rect, to_rect;
|
||||||
|
|
||||||
inWindow->setActive();
|
inWindow->setActive(false);
|
||||||
|
|
||||||
if(visible){
|
if(visible){
|
||||||
TextStyle style;
|
TextStyle style;
|
||||||
@@ -92,6 +92,7 @@ void cButton::draw(){
|
|||||||
// frame default button, to provide a visual cue that it's the default
|
// frame default button, to provide a visual cue that it's the default
|
||||||
if(key.spec && key.k == key_enter) drawFrame(2,frameStyle);
|
if(key.spec && key.k == key_enter) drawFrame(2,frameStyle);
|
||||||
}
|
}
|
||||||
|
inWindow->setActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cButton::manageFormat(eFormat prop, bool set, boost::any* val) {
|
bool cButton::manageFormat(eFormat prop, bool set, boost::any* val) {
|
||||||
@@ -324,8 +325,7 @@ bool cLed::manageFormat(eFormat prop, bool set, boost::any* val) {
|
|||||||
void cLed::draw(){
|
void cLed::draw(){
|
||||||
rectangle from_rect, to_rect;
|
rectangle from_rect, to_rect;
|
||||||
|
|
||||||
inWindow->setActive();
|
inWindow->setActive(false);
|
||||||
|
|
||||||
if(visible){
|
if(visible){
|
||||||
TextStyle style;
|
TextStyle style;
|
||||||
style.pointSize = textSize;
|
style.pointSize = textSize;
|
||||||
@@ -341,6 +341,7 @@ void cLed::draw(){
|
|||||||
to_rect.left = frame.left + 18; // Possibly could be 20
|
to_rect.left = frame.left + 18; // Possibly could be 20
|
||||||
win_draw_string(*inWindow,to_rect,lbl,wrapLabel ? eTextMode::WRAP : eTextMode::LEFT_TOP,style);
|
win_draw_string(*inWindow,to_rect,lbl,wrapLabel ? eTextMode::WRAP : eTextMode::LEFT_TOP,style);
|
||||||
}
|
}
|
||||||
|
inWindow->setActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
cControl::storage_t cLed::store() {
|
cControl::storage_t cLed::store() {
|
||||||
|
@@ -621,7 +621,7 @@ void draw_text_bar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void put_text_bar(std::string str) {
|
void put_text_bar(std::string str) {
|
||||||
text_bar_gworld.setActive();
|
text_bar_gworld.setActive(false);
|
||||||
auto& bar_gw = *ResMgr::graphics.get("textbar");
|
auto& bar_gw = *ResMgr::graphics.get("textbar");
|
||||||
rect_draw_some_item(bar_gw, rectangle(bar_gw), text_bar_gworld, rectangle(bar_gw));
|
rect_draw_some_item(bar_gw, rectangle(bar_gw), text_bar_gworld, rectangle(bar_gw));
|
||||||
TextStyle style;
|
TextStyle style;
|
||||||
@@ -658,12 +658,14 @@ void put_text_bar(std::string str) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
text_bar_gworld.setActive();
|
||||||
text_bar_gworld.display();
|
text_bar_gworld.display();
|
||||||
}
|
}
|
||||||
|
|
||||||
void refresh_text_bar() {
|
void refresh_text_bar() {
|
||||||
mainPtr.setActive();
|
mainPtr.setActive(false);
|
||||||
rect_draw_some_item(text_bar_gworld.getTexture(), rectangle(text_bar_gworld), mainPtr, win_to_rects[WINRECT_STATUS]);
|
rect_draw_some_item(text_bar_gworld.getTexture(), rectangle(text_bar_gworld), mainPtr, win_to_rects[WINRECT_STATUS]);
|
||||||
|
mainPtr.setActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is used for determinign whether to round off walkway corners
|
// this is used for determinign whether to round off walkway corners
|
||||||
@@ -1565,7 +1567,7 @@ void draw_targeting_line(location where_curs) {
|
|||||||
|
|
||||||
if((can_see_light(from_loc,which_space,sight_obscurity) < 5)
|
if((can_see_light(from_loc,which_space,sight_obscurity) < 5)
|
||||||
&& (dist(from_loc,which_space) <= current_spell_range)) {
|
&& (dist(from_loc,which_space) <= current_spell_range)) {
|
||||||
mainPtr.setActive();
|
mainPtr.setActive(false);
|
||||||
clip_rect(mainPtr, on_screen_terrain_area);
|
clip_rect(mainPtr, on_screen_terrain_area);
|
||||||
draw_line(mainPtr, where_curs, location(xBound, yBound), 2, {128,128,128}, sf::BlendAdd);
|
draw_line(mainPtr, where_curs, location(xBound, yBound), 2, {128,128,128}, sf::BlendAdd);
|
||||||
redraw_rect.left = min(where_curs.x,xBound) - 4;
|
redraw_rect.left = min(where_curs.x,xBound) - 4;
|
||||||
@@ -1606,6 +1608,7 @@ void draw_targeting_line(location where_curs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
redraw_rect2.inset(-5,-5);
|
redraw_rect2.inset(-5,-5);
|
||||||
|
mainPtr.setActive();
|
||||||
undo_clip(mainPtr);
|
undo_clip(mainPtr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -162,8 +162,9 @@ void apply_light_mask(bool onWindow) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(onWindow) {
|
if(onWindow) {
|
||||||
mainPtr.setActive();
|
mainPtr.setActive(false);
|
||||||
fill_region(mainPtr, dark_mask_region, sf::Color::Black);
|
fill_region(mainPtr, dark_mask_region, sf::Color::Black);
|
||||||
|
mainPtr.setActive();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +354,7 @@ void do_missile_anim(short num_steps,location missile_origin,short sound_num) {
|
|||||||
to_rect.offset(current_terrain_ul);
|
to_rect.offset(current_terrain_ul);
|
||||||
rect_draw_some_item(terrain_screen_gworld.getTexture(),oldBounds,mainPtr,to_rect);
|
rect_draw_some_item(terrain_screen_gworld.getTexture(),oldBounds,mainPtr,to_rect);
|
||||||
|
|
||||||
mainPtr.setActive();
|
mainPtr.setActive(false);
|
||||||
|
|
||||||
|
|
||||||
// init missile paths
|
// init missile paths
|
||||||
@@ -435,6 +436,7 @@ void do_missile_anim(short num_steps,location missile_origin,short sound_num) {
|
|||||||
rect_draw_some_item(*from_gw,from_rect, mainPtr,temp_rect,sf::BlendAlpha);
|
rect_draw_some_item(*from_gw,from_rect, mainPtr,temp_rect,sf::BlendAlpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mainPtr.setActive();
|
||||||
mainPtr.display();
|
mainPtr.display();
|
||||||
sf::sleep(sf::milliseconds(2 + 5 * get_int_pref("GameSpeed")));
|
sf::sleep(sf::milliseconds(2 + 5 * get_int_pref("GameSpeed")));
|
||||||
}
|
}
|
||||||
@@ -518,7 +520,7 @@ void do_explosion_anim(short /*sound_num*/,short special_draw, short snd) {
|
|||||||
style.font = FONT_BOLD;
|
style.font = FONT_BOLD;
|
||||||
style.pointSize = 10;
|
style.pointSize = 10;
|
||||||
style.lineHeight = 10;
|
style.lineHeight = 10;
|
||||||
mainPtr.setActive();
|
mainPtr.setActive(false);
|
||||||
|
|
||||||
// init missile paths
|
// init missile paths
|
||||||
screen_ul.x = center.x - 4; screen_ul.y = center.y - 4;
|
screen_ul.x = center.x - 4; screen_ul.y = center.y - 4;
|
||||||
@@ -583,6 +585,7 @@ void do_explosion_anim(short /*sound_num*/,short special_draw, short snd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if(((PSD[SDF_GAME_SPEED] == 1) && (t % 3 == 0)) || ((PSD[SDF_GAME_SPEED] == 2) && (t % 2 == 0)))
|
//if(((PSD[SDF_GAME_SPEED] == 1) && (t % 3 == 0)) || ((PSD[SDF_GAME_SPEED] == 2) && (t % 2 == 0)))
|
||||||
|
mainPtr.setActive();
|
||||||
mainPtr.display();
|
mainPtr.display();
|
||||||
sf::sleep(time_in_ticks(2 * (1 + get_int_pref("GameSpeed"))));
|
sf::sleep(time_in_ticks(2 * (1 + get_int_pref("GameSpeed"))));
|
||||||
}
|
}
|
||||||
@@ -637,12 +640,11 @@ void draw_shop_graphics(bool pressed,rectangle clip_area_rect) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
talk_gworld.setActive();
|
|
||||||
TextStyle style;
|
TextStyle style;
|
||||||
style.font = FONT_DUNGEON;
|
style.font = FONT_DUNGEON;
|
||||||
style.pointSize = 18;
|
style.pointSize = 18;
|
||||||
|
|
||||||
talk_gworld.setActive();
|
talk_gworld.setActive(false);
|
||||||
if(pressed) {
|
if(pressed) {
|
||||||
clip_rect(talk_gworld, clip_area_rect);
|
clip_rect(talk_gworld, clip_area_rect);
|
||||||
}
|
}
|
||||||
@@ -784,6 +786,7 @@ void draw_shop_graphics(bool pressed,rectangle clip_area_rect) {
|
|||||||
win_draw_string(talk_gworld,bottom_help_rects[3],"'I' button brings up description.",eTextMode::WRAP,style);
|
win_draw_string(talk_gworld,bottom_help_rects[3],"'I' button brings up description.",eTextMode::WRAP,style);
|
||||||
|
|
||||||
undo_clip(talk_gworld);
|
undo_clip(talk_gworld);
|
||||||
|
talk_gworld.setActive();
|
||||||
talk_gworld.display();
|
talk_gworld.display();
|
||||||
|
|
||||||
refresh_shopping();
|
refresh_shopping();
|
||||||
@@ -910,14 +913,14 @@ void place_talk_str(std::string str_to_place,std::string str_to_place2,short col
|
|||||||
rectangle dest_rect,help_from = {46,60,59,76};
|
rectangle dest_rect,help_from = {46,60,59,76};
|
||||||
sf::Text str_to_draw;
|
sf::Text str_to_draw;
|
||||||
|
|
||||||
talk_gworld.setActive();
|
talk_gworld.setActive(false);
|
||||||
|
|
||||||
TextStyle style;
|
TextStyle style;
|
||||||
style.font = FONT_DUNGEON;
|
style.font = FONT_DUNGEON;
|
||||||
style.pointSize = 18;
|
style.pointSize = 18;
|
||||||
|
|
||||||
if(c_rect.right > 0) {
|
if(c_rect.right > 0) {
|
||||||
mainPtr.setActive();
|
mainPtr.setActive(false);
|
||||||
c_rect.offset(talk_area_rect.topLeft());
|
c_rect.offset(talk_area_rect.topLeft());
|
||||||
clip_rect(mainPtr, c_rect);
|
clip_rect(mainPtr, c_rect);
|
||||||
}
|
}
|
||||||
@@ -1015,6 +1018,7 @@ void place_talk_str(std::string str_to_place,std::string str_to_place2,short col
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
talk_gworld.setActive();
|
||||||
rectangle oldRect(talk_gworld);
|
rectangle oldRect(talk_gworld);
|
||||||
undo_clip(talk_gworld);
|
undo_clip(talk_gworld);
|
||||||
talk_gworld.display();
|
talk_gworld.display();
|
||||||
|
@@ -214,7 +214,7 @@ void put_item_screen(eItemWinMode screen_num) {
|
|||||||
rectangle erase_rect = {17,2,122,255},dest_rect;
|
rectangle erase_rect = {17,2,122,255},dest_rect;
|
||||||
rectangle upper_frame_rect = {3,3,15,268};
|
rectangle upper_frame_rect = {3,3,15,268};
|
||||||
|
|
||||||
item_stats_gworld.setActive();
|
item_stats_gworld.setActive(false);
|
||||||
|
|
||||||
// First clean up gworld with pretty patterns
|
// First clean up gworld with pretty patterns
|
||||||
sf::Texture& orig = *ResMgr::graphics.get("inventory");
|
sf::Texture& orig = *ResMgr::graphics.get("inventory");
|
||||||
@@ -360,6 +360,7 @@ void put_item_screen(eItemWinMode screen_num) {
|
|||||||
undo_clip(item_stats_gworld);
|
undo_clip(item_stats_gworld);
|
||||||
|
|
||||||
place_item_bottom_buttons();
|
place_item_bottom_buttons();
|
||||||
|
item_stats_gworld.setActive();
|
||||||
item_stats_gworld.display();
|
item_stats_gworld.display();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1389,7 +1389,7 @@ void draw_map(bool need_refresh) {
|
|||||||
canMap = false;
|
canMap = false;
|
||||||
}
|
}
|
||||||
else if(need_refresh) {
|
else if(need_refresh) {
|
||||||
map_gworld.setActive();
|
map_gworld.setActive(false);
|
||||||
|
|
||||||
fill_rect(map_gworld, map_world_rect, sf::Color::Black);
|
fill_rect(map_gworld, map_world_rect, sf::Color::Black);
|
||||||
|
|
||||||
@@ -1472,6 +1472,7 @@ void draw_map(bool need_refresh) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
map_gworld.setActive();
|
||||||
map_gworld.display();
|
map_gworld.display();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user