浏览代码

Update rtext.c

pull/3777/head
Ray 1年前
父节点
当前提交
868d515fbc
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      src/rtext.c

+ 3
- 2
src/rtext.c 查看文件

@ -1471,13 +1471,14 @@ float TextToFloat(const char *text)
text++;
}
for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); i++) value = value*10.0f + (float)(text[i] - '0');
int i = 0;
for (; ((text[i] >= '0') && (text[i] <= '9')); i++) value = value*10.0f + (float)(text[i] - '0');
if (text[i++] != '.') value *= sign;
else
{
float divisor = 10.0f;
for (kt">int i = 0; ((text[i] >= '0') && (text[i] <= '9')); i++)
for (; ((text[i] >= '0') && (text[i] <= '9')); i++)
{
value += ((float)(text[i] - '0'))/divisor;
divisor = divisor*10.0f;

正在加载...
取消
保存