You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
msdfgen: Update to 1.12
This commit is contained in:
23
thirdparty/msdfgen/core/shape-description.cpp
vendored
23
thirdparty/msdfgen/core/shape-description.cpp
vendored
@@ -2,6 +2,8 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#include "shape-description.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace msdfgen {
|
||||
|
||||
int readCharF(FILE *input) {
|
||||
@@ -25,14 +27,25 @@ int readCharS(const char **input) {
|
||||
}
|
||||
|
||||
int readCoordF(FILE *input, Point2 &coord) {
|
||||
return fscanf(input, "%lf,%lf", &coord.x, &coord.y);
|
||||
return fscanf(input, "%lf , %lf", &coord.x, &coord.y);
|
||||
}
|
||||
|
||||
int readCoordS(const char **input, Point2 &coord) {
|
||||
int read = 0;
|
||||
int result = sscanf(*input, "%lf,%lf%n", &coord.x, &coord.y, &read);
|
||||
*input += read;
|
||||
return result;
|
||||
char *end = NULL;
|
||||
coord.x = strtod(*input, &end);
|
||||
if (end <= *input)
|
||||
return 0;
|
||||
*input = end;
|
||||
while (**input == ' ' || **input == '\t' || **input == '\n' || **input == '\r')
|
||||
++*input;
|
||||
if (**input != ',')
|
||||
return 1;
|
||||
++*input;
|
||||
coord.y = strtod(*input, &end);
|
||||
if (end <= *input)
|
||||
return 1;
|
||||
*input = end;
|
||||
return 2;
|
||||
}
|
||||
|
||||
static bool writeCoord(FILE *output, Point2 coord) {
|
||||
|
||||
Reference in New Issue
Block a user