summaryrefslogtreecommitdiff
path: root/System.c
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2017-11-10 00:04:35 +0100
committerXaviDCR92 <xavi.dcr@gmail.com>2017-11-10 00:04:35 +0100
commitd85464781580796bbcc744ae732e56d1920e3b0f (patch)
treeac0939ebae1e1fe9afb8060ad2329c52bcab00ad /System.c
parent7b05778e3ef8ef01a4bb15a6ed6fde5b329a8c9b (diff)
downloadpocketempires-d85464781580796bbcc744ae732e56d1920e3b0f.tar.gz
Kinda improved pathfinding algorithm. Still some work TODO.
Fixed some errors in DEBUG_VAR macro. Shadows are now drawn before any other object. Different strings are now shown depending on the number of selected units. Some work on calculating actions mask when different types of units are selected. Still some work TODO.
Diffstat (limited to 'System.c')
-rw-r--r--System.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/System.c b/System.c
index be3bbc7..91ddea8 100644
--- a/System.c
+++ b/System.c
@@ -277,13 +277,13 @@ bool SystemCollisionCheck(TYPE_COLLISION_BLOCK* c1, TYPE_COLLISION_BLOCK* c2)
c2->x, c2->y, c2->w, c2->h );
}
-bool Systemitoa(char* str, size_t sz, int16_t value)
+size_t Systemitoa(char* str, size_t sz, int16_t value)
{
if (sz != 0)
{
bool first_digit_found = false;
uint16_t i;
- uint8_t j = 0;
+ uint8_t bytes_written = 0;
/* Example: 65535 */
/* Another example: -32767 */
@@ -291,7 +291,7 @@ bool Systemitoa(char* str, size_t sz, int16_t value)
if (value & 0x8000)
{
/* Sign bit */
- str[j++] = '-';
+ str[bytes_written++] = '-';
}
for (i = 10000; i >= 1; i /= 10)
@@ -311,20 +311,20 @@ bool Systemitoa(char* str, size_t sz, int16_t value)
continue;
}
- str[j++] = digit + '0';
+ str[bytes_written++] = digit + '0';
- if (j >= (sz - 1))
+ if (bytes_written >= (sz - 1))
{
- return false;
+ return 0;
}
}
- str[j] = '\0';
+ str[bytes_written] = '\0';
- return true;
+ return bytes_written;
}
- return false;
+ return 0;
}
uint32_t SystemGetHyp(uint16_t x, uint16_t y)