diff options
author | Oxore <oxore@protonmail.com> | 2018-07-12 04:13:15 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2018-07-12 04:13:15 +0300 |
commit | 9a9711945c2add826e5887aabe2330bee9042b4b (patch) | |
tree | fe67952f6cd8a020ec0b1cf1fabf91167e785c23 /src/text.c | |
parent | 2b265ea0eb5825eccd3b9b072b5014bacf0d16d7 (diff) |
Introduce pause mechanics, refactor a little
Introduce Pause mechanics and mention it in README.md.
Makefile: replace unnecessary "-MMD -MP" with just "-MD" flag, so it
allows to compile with tcc too.
Refactor: Rename game.isStarted field to game.started field. Move
arrKeys container to engine.c and remove it from main.c. Refactor char
iterator in utf8to32_strcpy function.
Diffstat (limited to 'src/text.c')
-rw-r--r-- | src/text.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -43,20 +43,17 @@ void utf8to32_strcpy(wchar_t *dest, char *src) int clen = utf8_char_len(*c); if (clen == 1) { dc[len] = c[0] & 0x7f; - c += 1; } else if (clen == 2) { dc[len] = ((c[0] & 0x1f) << 6) | ((c[1] & 0x3f) << 0); - c += 2; } else if (clen == 3) { dc[len] = ((c[0] & 0x0f) << 12) | ((c[1] & 0x3f) << 6) | ((c[2] & 0x3f) << 0); - c += 3; } else if (clen == 4) { dc[len] = ((c[0] & 0x07) << 18) | ((c[1] & 0x3f) << 12) | ((c[2] & 0x3f) << 6) | ((c[3] & 0x3f) << 0); - c += 4; } else { dc[len] = 0; return; } + c += clen; ++len; } dc[len] = 0; |