mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Replace hardcoded temp buffer sizes with a named constant
Constants.h will house constants like the screen size and others. But basically only the screen size for now. Now we don't have to type that "4 bytes per 40 chars (whole screen)" comment everywhere...
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <string.h>
|
||||
#include <tinyxml2.h>
|
||||
|
||||
#include "Constants.h"
|
||||
#include "CustomLevels.h"
|
||||
#include "DeferCallbacks.h"
|
||||
#include "Editor.h"
|
||||
@@ -658,7 +659,7 @@ void Game::remaining_textbox(void)
|
||||
{
|
||||
const int remaining = 6 - crewrescued();
|
||||
const char* string;
|
||||
char buffer[161]; /* 4 bytes per 40 chars (whole screen) plus 1 for null terminator */
|
||||
char buffer[SCREEN_WIDTH_CHARS + 1];
|
||||
if (remaining == 1)
|
||||
{
|
||||
string = " One remains ";
|
||||
|
||||
Reference in New Issue
Block a user