more clang asan checks (and getting it to compile on MSYS2/clang)
This commit is contained in:
parent
044839bb81
commit
9f23e22eb3
10
Makefile
10
Makefile
@ -54,8 +54,8 @@ endif
|
||||
INC_DIR += $(ENGINE_INC_DIR)
|
||||
LIB_DIR += $(ENGINE_LIB_DIR)
|
||||
|
||||
INCS += -I$(ENGINE_INC_DIR) -I./dep/include/ #-I/mingw64/include/
|
||||
LIBS += -L$(ENGINE_LIB_DIR) -L$(LIB_DIR)/$(PREFIX_PATH) -L$(LIB_DIR)/$(ARCH)/$(CC) -L$(LIB_DIR)/$(ARCH) #-L/mingw64/lib/
|
||||
INCS += -I$(ENGINE_INC_DIR) -I./dep/include/
|
||||
LIBS += -L$(ENGINE_LIB_DIR) -L$(LIB_DIR)/$(PREFIX_PATH)/ -L$(LIB_DIR)/$(ARCH)/$(CC)/ -L$(LIB_DIR)/$(ARCH)/
|
||||
|
||||
LINKS += $(UF_LIBS) $(EXT_LIBS) $(DEPS)
|
||||
DEPS +=
|
||||
@ -63,7 +63,7 @@ FLAGS += -DUF_DEV_ENV
|
||||
|
||||
ifneq (,$(findstring win64,$(ARCH)))
|
||||
ifneq (,$(findstring -DUF_DEV_ENV,$(FLAGS)))
|
||||
REQ_DEPS += meshoptimizer toml xatlas curl ffx:fsr cpptrace vall_e dc:texconv # ncurses openvr draco discord bullet ultralight-ux
|
||||
REQ_DEPS += meshoptimizer toml xatlas curl ffx:fsr dc:texconv # vall_e cpptrace # openvr # ncurses draco discord bullet ultralight-ux
|
||||
FLAGS += -march=native -g # -flto # -g
|
||||
endif
|
||||
REQ_DEPS += $(RENDERER) json:nlohmann zlib luajit reactphysics simd ctti gltf imgui fmt freetype openal ogg wav
|
||||
@ -380,7 +380,7 @@ $(EX_DLL): $(OBJS_DLL)
|
||||
@echo "Setting defaults: $(ARCH).$(CC).$(RENDERER)"
|
||||
$(EXT_EX_DLL): FLAGS += -DEXT_EXPORTS
|
||||
$(EXT_EX_DLL): $(OBJS_EXT_DLL)
|
||||
$(CXX) -shared -Wl,-soname,$(BASE_EXT_DLL).$(LIB_EXTENSION) $(OBJS_EXT_DLL) $(EXT_LIBS) $(EXT_INCS) $(EXT_LINKS) -o $(EXT_EX_DLL)
|
||||
$(CXX) $(FLAGS) -shared -Wl,-soname,$(BASE_EXT_DLL).$(LIB_EXTENSION) $(OBJS_EXT_DLL) $(EXT_LIBS) $(EXT_INCS) $(EXT_LINKS) -o $(EXT_EX_DLL)
|
||||
cp $(EXT_EX_DLL) $(EXT_IM_DLL)
|
||||
|
||||
else
|
||||
@ -398,7 +398,7 @@ $(EX_DLL): $(OBJS_DLL)
|
||||
|
||||
$(EXT_EX_DLL): FLAGS += -DEXT_EXPORTS
|
||||
$(EXT_EX_DLL): $(OBJS_EXT_DLL)
|
||||
$(CXX) -shared -o $(EXT_EX_DLL) -Wl,--out-implib=$(EXT_IM_DLL) $(OBJS_EXT_DLL) $(EXT_LIBS) $(EXT_INCS) $(EXT_LINKS)
|
||||
$(CXX) $(FLAGS) -shared -o $(EXT_EX_DLL) -Wl,--out-implib=$(EXT_IM_DLL) $(OBJS_EXT_DLL) $(EXT_LIBS) $(EXT_INCS) $(EXT_LINKS)
|
||||
cp $(ENGINE_LIB_DIR)/$(PREFIX_PATH)/$(BASE_EXT_DLL).$(LIB_EXTENSION).a $(ENGINE_LIB_DIR)/$(PREFIX_PATH)/$(BASE_EXT_DLL).a
|
||||
endif
|
||||
|
||||
|
@ -33,7 +33,7 @@ void client::initialize() {
|
||||
client::config["window"]["size"][1] = (size.y = resolution.y);
|
||||
}
|
||||
// Window title
|
||||
uf::String title; {
|
||||
uf::stl::string title; {
|
||||
title = client::config["window"]["title"].as<std::string>();
|
||||
}
|
||||
// Terminal window;
|
||||
@ -93,7 +93,7 @@ void client::initialize() {
|
||||
uf::hooks.addHook( "window:Title.Changed", [&]( ext::json::Value& json ){
|
||||
if ( json["invoker"] != "os" ) {
|
||||
if ( !ext::json::isObject( json["window"] ) ) return;
|
||||
uf::String title = json["window"]["title"].as<std::string>();
|
||||
uf::stl::string title = json["window"]["title"].as<std::string>();
|
||||
client::window.setTitle(title);
|
||||
}
|
||||
} );
|
||||
|
@ -38,7 +38,7 @@ namespace ext {
|
||||
UF_API void setRenderMode( ext::freetype::Glyph&, decltype(FT_RENDER_MODE_NORMAL) = FT_RENDER_MODE_NORMAL );
|
||||
|
||||
UF_API bool load( ext::freetype::Glyph&, unsigned long );
|
||||
UF_API bool load( ext::freetype::Glyph&, const uf::String& );
|
||||
UF_API bool load( ext::freetype::Glyph&, const uf::stl::string& );
|
||||
|
||||
UF_API uf::stl::string getError( int );
|
||||
}
|
||||
|
@ -8,3 +8,4 @@
|
||||
// defines which implementation to use
|
||||
// #include UF_ENV_HEADER
|
||||
//
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace spec {
|
||||
public:
|
||||
typedef void* handle_t;
|
||||
typedef void* context_t;
|
||||
typedef uf::String title_t;
|
||||
typedef uf::stl::string title_t;
|
||||
typedef pod::Vector2i vector_t;
|
||||
|
||||
struct Event {
|
||||
|
@ -39,8 +39,8 @@ namespace spec {
|
||||
// C-tors
|
||||
UF_API_CALL Window();
|
||||
UF_API_CALL Window( spec::win32::Window::handle_t );
|
||||
UF_API_CALL Window( const spec::win32::Window::vector_t& size, const spec::win32::Window::title_t& title = L"Window" );
|
||||
/*virtual*/ void UF_API_CALL create( const spec::win32::Window::vector_t& size, const spec::win32::Window::title_t& title = L"Window" );
|
||||
UF_API_CALL Window( const spec::win32::Window::vector_t& size, const spec::win32::Window::title_t& title = "Window" );
|
||||
/*virtual*/ void UF_API_CALL create( const spec::win32::Window::vector_t& size, const spec::win32::Window::title_t& title = "Window" );
|
||||
// D-tors
|
||||
/*virtual*/ ~Window();
|
||||
void UF_API_CALL terminate();
|
||||
|
@ -64,7 +64,9 @@ namespace uf {
|
||||
|
||||
char UF_API_CALL readChar(const bool& = true);
|
||||
uf::stl::string UF_API_CALL readString(const bool& = true);
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
uf::String UF_API_CALL readUString(const bool& = true);
|
||||
#endif
|
||||
void UF_API_CALL operator>> (bool&);
|
||||
void UF_API_CALL operator>> (short&);
|
||||
void UF_API_CALL operator>> (unsigned short&);
|
||||
@ -79,13 +81,17 @@ namespace uf {
|
||||
void UF_API_CALL operator>> (double&);
|
||||
void UF_API_CALL operator>> (long double&);
|
||||
void UF_API_CALL operator>> (uf::stl::string&);
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
void UF_API_CALL operator>> (uf::String&);
|
||||
#endif
|
||||
std::istream& UF_API_CALL operator>> ( std::istream& );
|
||||
friend std::istream& UF_API_CALL operator>> ( std::istream&, uf::IoStream& );
|
||||
|
||||
char UF_API_CALL writeChar(char);
|
||||
const uf::stl::string& UF_API_CALL writeString(const uf::stl::string&);
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
const uf::String& UF_API_CALL writeUString(const uf::String&);
|
||||
#endif
|
||||
uf::IoStream& UF_API_CALL operator<< (const bool&);
|
||||
uf::IoStream& UF_API_CALL operator<< (const short&);
|
||||
uf::IoStream& UF_API_CALL operator<< (const unsigned short&);
|
||||
@ -100,7 +106,9 @@ namespace uf {
|
||||
uf::IoStream& UF_API_CALL operator<< (const double&);
|
||||
uf::IoStream& UF_API_CALL operator<< (const long double&);
|
||||
uf::IoStream& UF_API_CALL operator<< (const uf::stl::string&);
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
uf::IoStream& UF_API_CALL operator<< (const uf::String&);
|
||||
#endif
|
||||
uf::IoStream& UF_API_CALL operator<< (const char*);
|
||||
uf::IoStream& UF_API_CALL operator<< (const uf::Serializer& val);
|
||||
uf::IoStream& UF_API_CALL operator<< ( void* );
|
||||
|
@ -7,12 +7,17 @@
|
||||
#include <locale>
|
||||
#include <cstring>
|
||||
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
namespace uf {
|
||||
class UF_API String {
|
||||
public:
|
||||
typedef uf::locale::Utf8 encoding_t;
|
||||
typedef uf::String::encoding_t::literal_t literal_t;
|
||||
#if __clang__
|
||||
typedef std::basic_string<char> string_t;
|
||||
#else
|
||||
typedef std::basic_string<literal_t> string_t;
|
||||
#endif
|
||||
|
||||
typedef uf::String::string_t::iterator iterator_t;
|
||||
typedef uf::String::string_t::const_iterator const_iterator_t;
|
||||
@ -111,4 +116,5 @@ namespace uf {
|
||||
return os << str;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
@ -25,8 +25,8 @@ namespace uf {
|
||||
bool generated();
|
||||
uint8_t* generate( const uf::stl::string&, unsigned long, uint = 48 );
|
||||
uint8_t* generate( ext::freetype::Glyph&, unsigned long, uint = 48 );
|
||||
uint8_t* generate( const uf::stl::string&, const uf::String&, uint = 48 );
|
||||
uint8_t* generate( ext::freetype::Glyph&, const uf::String&, uint = 48 );
|
||||
uint8_t* generate( const uf::stl::string&, const uf::stl::string&, uint = 48 );
|
||||
uint8_t* generate( ext::freetype::Glyph&, const uf::stl::string&, uint = 48 );
|
||||
|
||||
void generateSdf( uint8_t* );
|
||||
// Get
|
||||
|
@ -53,7 +53,7 @@ uf::Serializer uf::config;
|
||||
|
||||
namespace {
|
||||
struct {
|
||||
uf::String input;
|
||||
uf::stl::string input;
|
||||
std::ofstream output;
|
||||
|
||||
struct {
|
||||
|
@ -196,9 +196,12 @@ namespace {
|
||||
if ( maxTries == 0 ) text += "\n(error formatting)";
|
||||
string = text;
|
||||
}
|
||||
|
||||
#if 0
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> convert;
|
||||
std::wstring str = convert.from_bytes(string);
|
||||
#else
|
||||
std::u8string str(string.begin(), string.end());
|
||||
#endif
|
||||
if ( str.size() == 0 ) return gs;
|
||||
|
||||
// Calculate statistics
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <uf/utils/io/inputs.h>
|
||||
|
||||
#include <sstream>
|
||||
#include <stdfloat>
|
||||
|
||||
#include "../scene/behavior.h"
|
||||
// #include "../../gui/manager/behavior.h"
|
||||
|
@ -1509,7 +1509,7 @@ void uf::graph::render( pod::Graph::Storage& storage ) {
|
||||
storage.buffers.camera.update( (const void*) &viewport, sizeof(pod::Camera::Viewports) );
|
||||
|
||||
#if UF_USE_VULKAN
|
||||
if ( !renderMode || !renderMode->hasBuffer("camera") ) return;
|
||||
if ( !renderMode || !renderMode->hasBuffer("camera") || renderMode->getType() == "Swapchain" ) return; // for some reason causes clang ASAN to cry
|
||||
auto& buffer = renderMode->getBuffer("camera");
|
||||
buffer.update( (const void*) &viewport, sizeof(pod::Camera::Viewports) );
|
||||
#endif
|
||||
|
@ -2,6 +2,40 @@
|
||||
#if UF_USE_FREETYPE
|
||||
#include <uf/ext/freetype/freetype.h>
|
||||
|
||||
namespace {
|
||||
unsigned long first_codepoint(const std::u8string& str) {
|
||||
if (str.empty()) throw std::runtime_error("Empty string");
|
||||
|
||||
const unsigned char* bytes = reinterpret_cast<const unsigned char*>(str.data());
|
||||
unsigned char b0 = bytes[0];
|
||||
unsigned long codepoint = 0;
|
||||
int extra_bytes = 0;
|
||||
|
||||
if (b0 < 0x80) {
|
||||
return b0;
|
||||
} else if ((b0 >> 5) == 0x6) {
|
||||
codepoint = b0 & 0x1F;
|
||||
extra_bytes = 1;
|
||||
} else if ((b0 >> 4) == 0xE) {
|
||||
codepoint = b0 & 0x0F;
|
||||
extra_bytes = 2;
|
||||
} else if ((b0 >> 3) == 0x1E) {
|
||||
codepoint = b0 & 0x07;
|
||||
extra_bytes = 3;
|
||||
} else {
|
||||
UF_EXCEPTION("Invalid UTF-8 start byte");
|
||||
}
|
||||
|
||||
for (int i = 0; i < extra_bytes; ++i) {
|
||||
unsigned char bx = bytes[i+1];
|
||||
if ((bx >> 6) != 0x2) UF_EXCEPTION("Invalid continuation byte");
|
||||
codepoint = (codepoint << 6) | (bx & 0x3F);
|
||||
}
|
||||
|
||||
return codepoint;
|
||||
}
|
||||
}
|
||||
|
||||
ext::freetype::Library ext::freetype::library;
|
||||
|
||||
ext::freetype::Library::Library() : loaded(false) {
|
||||
@ -81,8 +115,12 @@ bool ext::freetype::load( ext::freetype::Glyph& glyph, unsigned long c ) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool ext::freetype::load( ext::freetype::Glyph& glyph, const uf::String& string ) {
|
||||
bool ext::freetype::load( ext::freetype::Glyph& glyph, const uf::stl::string& string ) {
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
unsigned long c = string.translate<uf::locale::Utf32>().at(0);
|
||||
#else
|
||||
unsigned long c = first_codepoint( std::u8string( string.begin(), string.end() ) );
|
||||
#endif
|
||||
int error = 0;
|
||||
if ( (error = FT_Load_Char(glyph.face, FT_Get_Char_Index(glyph.face, c), FT_LOAD_RENDER) )) {
|
||||
std::cout << "Error #" << ext::freetype::getError(error) << ": FreeType failed to load glyph `" << c << "`" << std::endl;
|
||||
@ -94,8 +132,8 @@ bool ext::freetype::load( ext::freetype::Glyph& glyph, const uf::String& string
|
||||
uf::stl::string ext::freetype::getError( int error ) {
|
||||
#undef FTERRORS_H_
|
||||
#define FT_ERRORDEF( e, v, s ) { e, s },
|
||||
#define FT_ERROR_START_LIST {
|
||||
#define FT_ERROR_END_LIST { 0, NULL } };
|
||||
#define FT_ERROR_START_LIST {
|
||||
#define FT_ERROR_END_LIST { 0, NULL } };
|
||||
|
||||
const struct FTErrors {
|
||||
int err_code;
|
||||
|
@ -43,7 +43,7 @@ namespace {
|
||||
case ULMessageSource::kMessageSource_ContentBlocker: source = "ContentBlocker"; break;
|
||||
case ULMessageSource::kMessageSource_Other: source = "Other"; break;
|
||||
}
|
||||
uf::String message; {
|
||||
uf::stl::string message; {
|
||||
size_t len = ulStringGetLength(_message);
|
||||
const ULChar16* data = ulStringGetData(_message);
|
||||
for ( size_t i = 0; i < len; ++i ) message += data[i];
|
||||
|
@ -519,7 +519,7 @@ void spec::win32::Window::create( const spec::win32::Window::vector_t& _size, co
|
||||
|
||||
this->m_handle = CreateWindowW(
|
||||
className.c_str(),
|
||||
std::wstring(title).c_str(),
|
||||
std::wstring(title.begin(), title.end()).c_str(),
|
||||
winStyle,
|
||||
position.x,
|
||||
position.y,
|
||||
@ -636,8 +636,8 @@ void spec::win32::Window::setSize( const spec::win32::Window::vector_t& size ) {
|
||||
}
|
||||
|
||||
void spec::win32::Window::setTitle( const spec::win32::Window::title_t& title ) {
|
||||
SetWindowTextW(this->m_handle, std::wstring(title).c_str());
|
||||
// SetWindowTextW(this->m_handle, (wchar_t*) std::wstring(title).c_str());
|
||||
SetWindowTextW(this->m_handle, std::wstring(title.begin(), title.end()).c_str());
|
||||
// SetWindowTextW(this->m_handle, (wchar_t*) std::wstring(title.begin(), title.end()).c_str());
|
||||
}
|
||||
void spec::win32::Window::setIcon( const spec::win32::Window::vector_t& size, uint8_t* pixels ) {
|
||||
// First destroy the previous one
|
||||
@ -1067,6 +1067,7 @@ void spec::win32::Window::processEvent(UINT message, WPARAM wParam, LPARAM lPara
|
||||
} break;
|
||||
// Text event
|
||||
case WM_CHAR: if ( /*true ||*/ this->m_syncParse ) {
|
||||
#if 0
|
||||
if (this->m_keyRepeatEnabled || ((lParam & (1 << 30)) == 0)) {
|
||||
// Get the code of the typed character
|
||||
uint32_t character = static_cast<uint32_t>(wParam);
|
||||
@ -1084,7 +1085,7 @@ void spec::win32::Window::processEvent(UINT message, WPARAM wParam, LPARAM lPara
|
||||
this->m_surrogate = 0;
|
||||
}
|
||||
std::basic_string<uint32_t> utf32; utf32+=character;
|
||||
std::basic_string<uint8_t> utf8; utf8.reserve(utf32.length());
|
||||
std::basic_string<char> utf8; utf8.reserve(utf32.length());
|
||||
uf::Utf32::toUtf8(utf32.begin(), utf32.end(), std::back_inserter(utf8));
|
||||
|
||||
pod::payloads::windowTextEntered event{
|
||||
@ -1110,6 +1111,7 @@ void spec::win32::Window::processEvent(UINT message, WPARAM wParam, LPARAM lPara
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} break;
|
||||
case WM_KEYDOWN:
|
||||
case WM_SYSKEYDOWN:
|
||||
|
@ -48,9 +48,11 @@ namespace {
|
||||
void addStr( const uf::stl::string& str ) {
|
||||
for ( auto x : str ) addCh(x);
|
||||
}
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
void addUStr( const uf::String& str ) {
|
||||
for ( auto x : str.getString() ) addCh(x);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
bool uf::IoStream::ncurses = false;
|
||||
uf::IoStream uf::iostream;
|
||||
@ -94,14 +96,16 @@ uf::stl::string uf::IoStream::readString(const bool& loop) {
|
||||
// ::info.input.history.push_back( str );
|
||||
return str;
|
||||
}
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
uf::String uf::IoStream::readUString(const bool& loop) {
|
||||
uf::stl::string str;
|
||||
std::getline(std::cin, str);
|
||||
|
||||
addUStr(str);
|
||||
addStr(str);
|
||||
// ::info.input.history.push_back( str );
|
||||
return str;
|
||||
}
|
||||
#endif
|
||||
char uf::IoStream::writeChar( char ch ) {
|
||||
addCh(ch);
|
||||
|
||||
@ -118,6 +122,7 @@ const uf::stl::string& uf::IoStream::writeString( const uf::stl::string& str ) {
|
||||
// ::info.input.history.push_back( str );
|
||||
return str;
|
||||
}
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
const uf::String& uf::IoStream::writeUString( const uf::String& str ) {
|
||||
addUStr(str);
|
||||
|
||||
@ -125,6 +130,7 @@ const uf::String& uf::IoStream::writeUString( const uf::String& str ) {
|
||||
// ::info.input.history.push_back( str );
|
||||
return str;
|
||||
}
|
||||
#endif
|
||||
|
||||
void uf::IoStream::operator>> (bool& val) {
|
||||
uf::stl::stringstream ss;
|
||||
@ -195,9 +201,11 @@ void uf::IoStream::operator>> (long double& val) {
|
||||
void uf::IoStream::operator>> (uf::stl::string& val) {
|
||||
val = this->readString();
|
||||
}
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
void uf::IoStream::operator>> (uf::String& val) {
|
||||
val = this->readUString();
|
||||
}
|
||||
#endif
|
||||
std::istream& uf::IoStream::operator>> ( std::istream& is ) {
|
||||
uf::stl::string input;
|
||||
is >> input;
|
||||
@ -295,10 +303,12 @@ uf::IoStream& uf::IoStream::operator<< (const uf::stl::string& val) {
|
||||
this->writeString(val);
|
||||
return *this;
|
||||
}
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
uf::IoStream& uf::IoStream::operator<< (const uf::String& val) {
|
||||
this->writeUString(val);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
uf::IoStream& uf::IoStream::operator<< (const char* cstr) {
|
||||
this->writeString(uf::stl::string(cstr));
|
||||
return *this;
|
||||
|
@ -154,8 +154,10 @@ pod::Allocation uf::memoryPool::allocate( pod::MemoryPool& pool, size_t size, si
|
||||
{
|
||||
// find any availble spots in-between existing allocations
|
||||
auto next = pool.allocations.begin();
|
||||
// no allocations;
|
||||
if ( pool.allocations.empty() ) {
|
||||
// beginning is big enough to fit
|
||||
if ( pointer + size < next->pointer ) {
|
||||
} else if ( pointer + size < next->pointer ) {
|
||||
} else {
|
||||
for ( auto it = next; it != pool.allocations.end(); ++it ) {
|
||||
// ignore invalid indexes
|
||||
|
@ -1,7 +1,9 @@
|
||||
#include <uf/utils/string/string.h>
|
||||
#include <uf/utils/string/encoding.h>
|
||||
//uf::String uf::locale::current;
|
||||
|
||||
uf::stl::string uf::locale::current;
|
||||
|
||||
#if UF_USE_DEPRECATED_STRING
|
||||
uf::String::String() {
|
||||
}
|
||||
// ANSI literals/strings
|
||||
@ -222,4 +224,5 @@ uf::String::operator std::wstring() const {
|
||||
std::wstring w_str;
|
||||
for ( auto c : this->m_string ) w_str += c;
|
||||
return w_str;
|
||||
}
|
||||
}
|
||||
#endif
|
@ -59,11 +59,11 @@ uint8_t* uf::Glyph::generate( ext::freetype::Glyph& glyph, unsigned long c, uint
|
||||
if ( this->isSdf() ) this->generateSdf(this->m_buffer);
|
||||
return this->m_buffer;
|
||||
}
|
||||
uint8_t* uf::Glyph::generate( const uf::stl::string& font, const uf::String& c, uint size ) {
|
||||
uint8_t* uf::Glyph::generate( const uf::stl::string& font, const uf::stl::string& c, uint size ) {
|
||||
ext::freetype::Glyph glyph = ext::freetype::initialize(font);
|
||||
return this->generate( glyph, c );
|
||||
}
|
||||
uint8_t* uf::Glyph::generate( ext::freetype::Glyph& glyph, const uf::String& c, uint size ) {
|
||||
uint8_t* uf::Glyph::generate( ext::freetype::Glyph& glyph, const uf::stl::string& c, uint size ) {
|
||||
ext::freetype::setPixelSizes( glyph, size );
|
||||
if ( !ext::freetype::load( glyph, c ) ) return NULL;
|
||||
if ( this->m_buffer ) {
|
||||
|
@ -3,6 +3,6 @@ CDIR =
|
||||
CC = clang
|
||||
CXX = clang++
|
||||
OPTIMIZATIONS = -O3 -fstrict-aliasing -DUF_NO_EXCEPTIONS # -flto # -march=native
|
||||
WARNINGS = -Wall -Wno-pointer-arith -Wno-unused-function -Wno-unused-variable -Wno-switch -Wno-reorder-ctor -Wno-ignored-attributes -Wno-c++11-narrowing -Wno-unknown-pragmas -Wno-nullability-completeness -Wno-defaulted-function-deleted -Wno-mismatched-tags
|
||||
WARNINGS = -Wall -Wno-deprecated-literal-operator -Wno-pointer-arith -Wno-unused-function -Wno-unused-variable -Wno-switch -Wno-reorder-ctor -Wno-ignored-attributes -Wno-c++11-narrowing -Wno-unknown-pragmas -Wno-nullability-completeness -Wno-defaulted-function-deleted -Wno-mismatched-tags
|
||||
SANITIZE = -fsanitize=address # -fuse-ld=lld -fno-omit-frame-pointer
|
||||
FLAGS += -std=c++2b $(OPTIMIZATIONS) $(WARNINGS) $(SANITIZE) -fcolor-diagnostics -fansi-escape-codes
|
Loading…
Reference in New Issue
Block a user