You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
added separator character to be able to separate parameters and numbers without a space
This commit is contained in:
@@ -70,8 +70,11 @@ void s2d_snprint(int x, int y, const char *str, uObjMtx *buf, int len) {
|
||||
x += TAB_WIDTH_V;
|
||||
y += TEX_HEIGHT;
|
||||
break;
|
||||
// case CH_SEPARATOR:
|
||||
// CH_SKIP(p);
|
||||
// break;
|
||||
default:
|
||||
if (current_char != '\0') {
|
||||
if (current_char != '\0' && current_char != CH_SEPARATOR) {
|
||||
draw_s2d_glyph(current_char, x, y, (buf++));
|
||||
(x += (s2d_kerning_table[current_char] * myScale));
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#define COLOR "\x83" // COLOR (r) (g) (b) (a)
|
||||
#define DROPSHADOW "\x84" // DROPSHADOW (no params)
|
||||
#define BACKGROUND "\x85" // BACKGROUND (w) (h) (alpha)
|
||||
#define SEPARATOR "\x86"
|
||||
|
||||
#define CH_SCALE '\x80'
|
||||
#define CH_ROT '\x81'
|
||||
@@ -14,6 +15,7 @@
|
||||
#define CH_COLOR '\x83'
|
||||
#define CH_DROPSHADOW '\x84'
|
||||
#define CH_BACKGROUND '\x85'
|
||||
#define CH_SEPARATOR '\x86'
|
||||
|
||||
// ASCII standard escape codes
|
||||
#define CH_NEWLINE '\n'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ustdlib means un-standard library
|
||||
// i'm going to abuse so much of my power here lol
|
||||
|
||||
#include "s2d_print.h"
|
||||
// int s2d_atoi(char *s, char **s2) {
|
||||
// int ret = 0;
|
||||
// int isNegative = (*s == '-');
|
||||
@@ -25,12 +25,12 @@ int s2d_atoi(char *s, char **s2) {
|
||||
s++;
|
||||
(*s2)++;
|
||||
}
|
||||
for (; *s != '\0' && *s != ' ' && *s >= '0' && *s <= '9'; s++) {
|
||||
for (; *s != '\0' && *s != ' ' && *s != CH_SEPARATOR && *s >= '0' && *s <= '9'; s++) {
|
||||
ret *= 10;
|
||||
if (*s >= '0' && *s <= '9')
|
||||
ret += *s - '0';
|
||||
else break;
|
||||
if (!(*(s+1) != '\0' && *(s+1) != ' ' && *(s+1) >= '0' && *(s+1) <= '9')) break;
|
||||
if (!(*(s+1) != '\0' && *(s+1) != CH_SEPARATOR && *(s+1) != ' ' && *(s+1) >= '0' && *(s+1) <= '9')) break;
|
||||
(*s2)++;
|
||||
}
|
||||
if (isNegative) ret *= -1;
|
||||
@@ -40,7 +40,7 @@ int s2d_atoi(char *s, char **s2) {
|
||||
int s2d_ilen(char *s) {
|
||||
int ret = 0;
|
||||
char *p = s;
|
||||
while (*p >= '0' && *p <= '9') {
|
||||
while (*p >= '0' && *p <= '9' && *p != CH_SEPARATOR) {
|
||||
ret++;
|
||||
p++;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -195,10 +195,33 @@ int main(void) {
|
||||
// printf("%d\n", s2d_atoi(s, &s));
|
||||
// printf("%s\n", s);
|
||||
// s2d_print(0,0, t);
|
||||
while (pos != strlen(my2)) {
|
||||
char laStrBuf[0x100];
|
||||
char ff[0x100];
|
||||
sprintf(ff,
|
||||
"%s %d:"
|
||||
TRANSLATE "134 93" "%s:"
|
||||
, "Floor", 213, "Seed");
|
||||
sprintf(
|
||||
laStrBuf,
|
||||
"%s"
|
||||
TRANSLATE "138 93" "%s"
|
||||
TRANSLATE "138 110" "%s"
|
||||
TRANSLATE "138 130" "%s"
|
||||
, "The Basement", "LLRRABAB", "Continue", "End Run");
|
||||
|
||||
while (pos != strlen(laStrBuf)) {
|
||||
// s2d_type_print(0, 0, myS, &pos);
|
||||
printf("%d %s\n",s2d_ilen(my2 + pos), my2 + pos);
|
||||
printf("%d %s\n",s2d_ilen(laStrBuf + pos), laStrBuf + pos);
|
||||
pos++;
|
||||
}
|
||||
pos = 0;
|
||||
while (pos != strlen(ff)) {
|
||||
// s2d_type_print(0, 0, myS, &pos);
|
||||
printf("%d %s\n",s2d_ilen(ff + pos), ff + pos);
|
||||
pos++;
|
||||
}
|
||||
// laStrBuf[strlen(laStrBuf)] = "\x1";
|
||||
// laStrBuf[strlen(laStrBuf)+1] = "\x1";
|
||||
// printf("%s\n", laStrBuf);
|
||||
// printf("%d\n", s2d_ilen(sss + 1));
|
||||
}
|
||||
Reference in New Issue
Block a user