diff options
author | Treeki <treeki@gmail.com> | 2012-10-18 07:23:19 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-10-18 07:23:19 +0200 |
commit | 035bfe6144a9baa8c03f10e92a9689506068f47f (patch) | |
tree | d29b46b279de4462123513d5eea21fc5cef180f7 /src/newer.cpp | |
parent | edf303f6ba8e30e04e828cb0b9b268d534f194c4 (diff) | |
download | kamek-035bfe6144a9baa8c03f10e92a9689506068f47f.tar.gz kamek-035bfe6144a9baa8c03f10e92a9689506068f47f.zip |
I don't even know. I'll try to fix this tomorrow
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; } |