local instructions

This commit is contained in:
vrd
2023-11-02 21:25:56 +02:00
parent 6a71d7e13c
commit bc5e5d1deb
11 changed files with 210 additions and 166 deletions
+2 -4
View File
@@ -60,7 +60,7 @@ bool Person::operator==(const Person &other)const
void Person::displayInfo()const
{
WINDOW* info_tab = newwin(LINES, COLS, 0, 0);
AutoWin info_tab( newwin(LINES, COLS, 0, 0) );
waddstr(info_tab, name.data());
waddch(info_tab,'\n');
@@ -78,7 +78,6 @@ void Person::displayInfo()const
werase(info_tab);
wrefresh(info_tab); /* todo: dont update */
delwin(info_tab);
}
@@ -118,7 +117,7 @@ U16 Person::draw(const I16 drawY, const I16 drawX, bool selected, bool hasSpouse
if(willBeVisible(drawY, drawX, BOX_HEIGHT, width))
{
WINDOW* pad = newpad(BOX_HEIGHT, width);
AutoWin pad( newpad(BOX_HEIGHT, width) );
auto color_pair = COLOR_PAIR( selected ? COLOR_SELECTED
: (sex==M ? COLOR_MALE : COLOR_FEMALE) );
@@ -138,7 +137,6 @@ U16 Person::draw(const I16 drawY, const I16 drawX, bool selected, bool hasSpouse
/* wattroff(pad, color_pair); */
drawpad(pad, drawY, drawX);
delwin(pad);
}
return width;
}