diff options
author | aap <aap@papnet.eu> | 2020-04-09 20:50:24 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-04-09 20:50:24 +0200 |
commit | 34349c4df2683fca35be37ec626aaa8eef2ddaee (patch) | |
tree | 6a86b547819f30ab784d00891ee99b8924580093 /src/core/obrstr.cpp | |
parent | Merge remote-tracking branch 'Fire-Head/master' (diff) | |
download | re3-34349c4df2683fca35be37ec626aaa8eef2ddaee.tar re3-34349c4df2683fca35be37ec626aaa8eef2ddaee.tar.gz re3-34349c4df2683fca35be37ec626aaa8eef2ddaee.tar.bz2 re3-34349c4df2683fca35be37ec626aaa8eef2ddaee.tar.lz re3-34349c4df2683fca35be37ec626aaa8eef2ddaee.tar.xz re3-34349c4df2683fca35be37ec626aaa8eef2ddaee.tar.zst re3-34349c4df2683fca35be37ec626aaa8eef2ddaee.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/obrstr.cpp | 236 |
1 files changed, 118 insertions, 118 deletions
diff --git a/src/core/obrstr.cpp b/src/core/obrstr.cpp index 3663d134..d9f7e9b4 100644 --- a/src/core/obrstr.cpp +++ b/src/core/obrstr.cpp @@ -1,119 +1,119 @@ -#include "common.h"
-#include "Debug.h"
-#include "obrstr.h"
-
-char obrstr[128];
-char obrstr2[128];
-
-void ObrInt(int32 n1)
-{
- IntToStr(n1, obrstr);
- CDebug::DebugAddText(obrstr);
-}
-
-void ObrInt2(int32 n1, int32 n2)
-{
- IntToStr(n1, obrstr);
- strcat(obrstr, " ");
- IntToStr(n2, obrstr2);
- strcat(obrstr, obrstr2);
- CDebug::DebugAddText(obrstr);
-}
-
-void ObrInt3(int32 n1, int32 n2, int32 n3)
-{
- IntToStr(n1, obrstr);
- strcat(obrstr, " ");
- IntToStr(n2, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n3, obrstr2);
- strcat(obrstr, obrstr2);
- CDebug::DebugAddText(obrstr);
-}
-
-void ObrInt4(int32 n1, int32 n2, int32 n3, int32 n4)
-{
- IntToStr(n1, obrstr);
- strcat(obrstr, " ");
- IntToStr(n2, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n3, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n4, obrstr2);
- strcat(obrstr, obrstr2);
- CDebug::DebugAddText(obrstr);
-}
-
-void ObrInt5(int32 n1, int32 n2, int32 n3, int32 n4, int32 n5)
-{
- IntToStr(n1, obrstr);
- strcat(obrstr, " ");
- IntToStr(n2, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n3, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n4, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n5, obrstr2);
- strcat(obrstr, obrstr2);
- CDebug::DebugAddText(obrstr);
-}
-
-void ObrInt6(int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6)
-{
- IntToStr(n1, obrstr);
- strcat(obrstr, " ");
- IntToStr(n2, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n3, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n4, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n5, obrstr2);
- strcat(obrstr, obrstr2);
- strcat(obrstr, " ");
- IntToStr(n6, obrstr2);
- strcat(obrstr, obrstr2);
- CDebug::DebugAddText(obrstr);
-}
-
-void IntToStr(int32 inNum, char *outStr)
-{
- bool isNeg = inNum < 0;
-
- if (isNeg) {
- inNum = -inNum;
- *outStr = '-';
- }
-
- int16 digits = 1;
-
- if (inNum > 9) {
- int32 _inNum = inNum;
- do {
- digits++;
- _inNum /= 10;
- } while (_inNum > 9);
- }
-
- int32 strSize = digits;
- if (isNeg)
- strSize++;
-
- char *pStr = &outStr[strSize];
- int32 i = 0;
- do {
- *(pStr-- - 1) = (inNum % 10) + '0';
- inNum /= 10;
- } while (++i < strSize);
- outStr[strSize] = '\0';
+#include "common.h" +#include "Debug.h" +#include "obrstr.h" + +char obrstr[128]; +char obrstr2[128]; + +void ObrInt(int32 n1) +{ + IntToStr(n1, obrstr); + CDebug::DebugAddText(obrstr); +} + +void ObrInt2(int32 n1, int32 n2) +{ + IntToStr(n1, obrstr); + strcat(obrstr, " "); + IntToStr(n2, obrstr2); + strcat(obrstr, obrstr2); + CDebug::DebugAddText(obrstr); +} + +void ObrInt3(int32 n1, int32 n2, int32 n3) +{ + IntToStr(n1, obrstr); + strcat(obrstr, " "); + IntToStr(n2, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n3, obrstr2); + strcat(obrstr, obrstr2); + CDebug::DebugAddText(obrstr); +} + +void ObrInt4(int32 n1, int32 n2, int32 n3, int32 n4) +{ + IntToStr(n1, obrstr); + strcat(obrstr, " "); + IntToStr(n2, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n3, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n4, obrstr2); + strcat(obrstr, obrstr2); + CDebug::DebugAddText(obrstr); +} + +void ObrInt5(int32 n1, int32 n2, int32 n3, int32 n4, int32 n5) +{ + IntToStr(n1, obrstr); + strcat(obrstr, " "); + IntToStr(n2, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n3, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n4, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n5, obrstr2); + strcat(obrstr, obrstr2); + CDebug::DebugAddText(obrstr); +} + +void ObrInt6(int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6) +{ + IntToStr(n1, obrstr); + strcat(obrstr, " "); + IntToStr(n2, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n3, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n4, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n5, obrstr2); + strcat(obrstr, obrstr2); + strcat(obrstr, " "); + IntToStr(n6, obrstr2); + strcat(obrstr, obrstr2); + CDebug::DebugAddText(obrstr); +} + +void IntToStr(int32 inNum, char *outStr) +{ + bool isNeg = inNum < 0; + + if (isNeg) { + inNum = -inNum; + *outStr = '-'; + } + + int16 digits = 1; + + if (inNum > 9) { + int32 _inNum = inNum; + do { + digits++; + _inNum /= 10; + } while (_inNum > 9); + } + + int32 strSize = digits; + if (isNeg) + strSize++; + + char *pStr = &outStr[strSize]; + int32 i = 0; + do { + *(pStr-- - 1) = (inNum % 10) + '0'; + inNum /= 10; + } while (++i < strSize); + outStr[strSize] = '\0'; }
\ No newline at end of file |