mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-12-02 09:37:59 +00:00
Changing to use TextFormat() instead of ostringstream for ToString() func
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#ifndef RAYLIB_CPP_INCLUDE_COLOR_HPP_
|
||||
#define RAYLIB_CPP_INCLUDE_COLOR_HPP_
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "./raylib.hpp"
|
||||
@@ -67,9 +66,7 @@ class Color : public ::Color {
|
||||
}
|
||||
|
||||
inline std::string ToString() const {
|
||||
std::ostringstream oss;
|
||||
oss << "Color(" << r << ", " << g << ", " << b << ", " << a << ")";
|
||||
return oss.str();
|
||||
return TextFormat("Color(%d, %d, %d, %d)", r, g, b, a);
|
||||
}
|
||||
|
||||
inline operator std::string() const {
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include <cmath>
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "./raylib.hpp"
|
||||
#include "./raymath.hpp"
|
||||
#include "./raylib-cpp-utils.hpp"
|
||||
@@ -50,9 +48,7 @@ class Vector2 : public ::Vector2 {
|
||||
}
|
||||
|
||||
inline std::string ToString() const {
|
||||
std::ostringstream oss;
|
||||
oss << "Vector2(" << x << ", " << y << ")";
|
||||
return oss.str();
|
||||
return TextFormat("Vector2(%f, %f)", x, y);
|
||||
}
|
||||
|
||||
inline operator std::string() const {
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include <cmath>
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "./raylib.hpp"
|
||||
#include "./raymath.hpp"
|
||||
#include "./raylib-cpp-utils.hpp"
|
||||
@@ -48,9 +46,7 @@ class Vector3 : public ::Vector3 {
|
||||
}
|
||||
|
||||
inline std::string ToString() const {
|
||||
std::ostringstream oss;
|
||||
oss << "Vector3(" << x << ", " << y << ", " << z << ")";
|
||||
return oss.str();
|
||||
return TextFormat("Vector3(%f, %f, %f)", x, y, z);
|
||||
}
|
||||
|
||||
inline operator std::string() const {
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
#include <utility>
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "./raylib.hpp"
|
||||
#include "./raymath.hpp"
|
||||
#include "./raylib-cpp-utils.hpp"
|
||||
@@ -61,9 +59,7 @@ class Vector4 : public ::Vector4 {
|
||||
}
|
||||
|
||||
inline std::string ToString() const {
|
||||
std::ostringstream oss;
|
||||
oss << "Vector4(" << x << ", " << y << ", " << z << ", " << w << ")";
|
||||
return oss.str();
|
||||
return TextFormat("Vector4(%f, %f, %f, %f)", x, y, z, w);
|
||||
}
|
||||
|
||||
inline operator std::string() const {
|
||||
|
||||
Reference in New Issue
Block a user