diff options
Diffstat (limited to '')
-rw-r--r-- | src/newer.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/newer.cpp b/src/newer.cpp index d1894ba..dd0d99c 100644 --- a/src/newer.cpp +++ b/src/newer.cpp @@ -1,6 +1,19 @@ #include <newer.h> #include <game.h> +void WriteAsciiToTextBox(nw4r::lyt::TextBox *tb, const char *source) { + int i = 0; + wchar_t buffer[1024]; + while (i < 1023 && source[i]) { + buffer[i] = source[i]; + i++; + } + buffer[i] = 0; + + tb->SetString(buffer); +} + + void getNewerLevelNumberString(int world, int level, wchar_t *dest) { static const wchar_t *numberKinds[] = { // 0-19 are handled by code @@ -46,9 +59,8 @@ void getNewerLevelNumberString(int world, int level, wchar_t *dest) { } } -int getStarCoinCount() { +int getUnspentStarCoinCount() { SaveBlock *save = GetSaveFile()->GetBlock(-1); - int coinsSpent = save->credits_hiscore; int coinsEarned = 0; for (int w = 0; w < 10; w++) { @@ -61,6 +73,11 @@ int getStarCoinCount() { } } - int coinsLeft = coinsEarned - coinsSpent; - return coinsLeft; + return coinsEarned; +} + +int getStarCoinCount() { + SaveBlock *save = GetSaveFile()->GetBlock(-1); + int coinsSpent = save->credits_hiscore; + return getUnspentStarCoinCount() - coinsSpent; } |