Fix windows build

This commit is contained in:
Martin Natano
2023-03-17 23:33:16 +01:00
parent d68cefb4fe
commit 79674c15fe
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -403,7 +403,7 @@ CubicSplineN* ActorMultiVertex::GetSpline(size_t i)
void ActorMultiVertex::SetState(int i) void ActorMultiVertex::SetState(int i)
{ {
ASSERT(i >= 0 and static_cast<size_t>(i) < _states.size()); ASSERT(i >= 0 && static_cast<size_t>(i) < _states.size());
_cur_state= i; _cur_state= i;
_secs_into_state= 0.0f; _secs_into_state= 0.0f;
} }
+2 -2
View File
@@ -192,8 +192,8 @@ namespace Endian
inline constexpr bool little = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__; inline constexpr bool little = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__;
inline constexpr bool big = __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__; inline constexpr bool big = __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__;
#elif defined(_WIN32) #elif defined(_WIN32)
inline constexpr bool little = false; inline constexpr bool little = true;
inline constexpr bool big = true; inline constexpr bool big = false;
#else #else
#error "unknown byte order" #error "unknown byte order"
#endif #endif
+5 -5
View File
@@ -347,7 +347,7 @@ void TextureFont::FormatFontPage( int iPage, HDC hDC )
} }
/* UTF-8 encode ch and append to out. */ /* UTF-8 encode ch and append to out. */
void wchar_to_utf8( wchar_t ch, string &out ) void wchar_to_utf8( wchar_t ch, std::string &out )
{ {
if( ch < 0x80 ) { out.append( 1, (char) ch ); return; } if( ch < 0x80 ) { out.append( 1, (char) ch ); return; }
@@ -385,7 +385,7 @@ void TextureFont::Save( CString sBasePath, CString sBitmapAppendBeforeExtension,
const CString inipath = sBasePath + ".ini"; const CString inipath = sBasePath + ".ini";
ofstream f; std::ofstream f;
if( bSaveMetrics ) if( bSaveMetrics )
{ {
@@ -421,12 +421,12 @@ void TextureFont::Save( CString sBasePath, CString sBitmapAppendBeforeExtension,
unsigned iLine = 0; unsigned iLine = 0;
while( iChar < desc.chars.size() ) while( iChar < desc.chars.size() )
{ {
f << "Line " << setw(iWidth) << iLine << "="; f << "Line " << std::setw(iWidth) << iLine << "=";
f << setw(1); f << std::setw(1);
for( int iX = 0; iX < page.m_iNumFramesX && iChar < desc.chars.size(); ++iX, ++iChar ) for( int iX = 0; iX < page.m_iNumFramesX && iChar < desc.chars.size(); ++iX, ++iChar )
{ {
const wchar_t c = desc.chars[iChar]; const wchar_t c = desc.chars[iChar];
string sUTF8; std::string sUTF8;
wchar_to_utf8( c, sUTF8 ); wchar_to_utf8( c, sUTF8 );
f << sUTF8.c_str(); f << sUTF8.c_str();
} }