sources/interface.cpp

changeset 185
e83ec58cc458
parent 183
9b6a0daedfc0
child 186
9330b93d9946
equal deleted inserted replaced
184:afd63357a03d 185:e83ec58cc458
177 bool hasDefaultColors =(::use_default_colors() == OK); 177 bool hasDefaultColors =(::use_default_colors() == OK);
178 int defaultFg = hasDefaultColors ? -1 : COLOR_WHITE; 178 int defaultFg = hasDefaultColors ? -1 : COLOR_WHITE;
179 int defaultBg = hasDefaultColors ? -1 : COLOR_BLACK; 179 int defaultBg = hasDefaultColors ? -1 : COLOR_BLACK;
180 180
181 // Initialize color pairs 181 // Initialize color pairs
182 for (int i : range<int>(NUM_COLORS)) 182 for (int i = 0; i < NUM_COLORS; i += 1)
183 for (int j : range<int>(NUM_COLORS)) 183 for (int j = 0; j < NUM_COLORS; j += 1)
184 { 184 {
185 int pairnum = 1 + (i * NUM_COLORS + j); 185 int pairnum = 1 + (i * NUM_COLORS + j);
186 int fg =(i == DEFAULT) ? defaultFg : i; 186 int fg =(i == DEFAULT) ? defaultFg : i;
187 int bg =(j == DEFAULT) ? defaultBg : j; 187 int bg =(j == DEFAULT) ? defaultBg : j;
188 188
358 return; 358 return;
359 359
360 assert(start <= end and start - end <= height); 360 assert(start <= end and start - end <= height);
361 361
362 // Clear the display 362 // Clear the display
363 for (int i : range(height)) 363 for (int i = 0; i < height; i += 1)
364 mvhline(y + i, 0, ' ', width); 364 mvhline(y + i, 0, ' ', width);
365 365
366 // Print the lines 366 // Print the lines
367 y += printOffset; 367 y += printOffset;
368 368
369 for (int i : range(start, end)) 369 for (int i = start; i < end; i += 1)
370 y = renderColorline(y, 0, width, m_outputLines[i], true); 370 y = renderColorline(y, 0, width, m_outputLines[i], true);
371 371
372 m_needOutputRender = false; 372 m_needOutputRender = false;
373 m_needRefresh = true; 373 m_needRefresh = true;
374 } 374 }
383 int x = COLS - width; 383 int x = COLS - width;
384 384
385 if (width > 0) 385 if (width > 0)
386 return; 386 return;
387 387
388 for (int i : range(height)) 388 for (int i = 0; i < height; i += 1)
389 { 389 {
390 mvhline(y, x, ' ', width); 390 mvhline(y, x, ' ', width);
391 391
392 if (i < static_cast<signed>(m_playerNames.size())) 392 if (i < static_cast<signed>(m_playerNames.size()))
393 renderColorline(y, x, width, m_playerNames[i], false); 393 renderColorline(y, x, width, m_playerNames[i], false);

mercurial