From d0733b01e2a37bb227e3f6cb3036e66c76fe2b2b Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Wed, 28 Feb 2018 19:17:15 +0800 Subject: [PATCH] ANSI String support --- core/Base/Game.cpp | 4 +- core/Base/Window.cpp | 2 +- core/Common/Image.cpp | 4 +- core/Common/String.cpp | 202 ++++++++++++++++++++++++++++++++++------- core/Node/Sprite.cpp | 6 +- core/Tool/File.cpp | 2 +- core/Tool/Music.cpp | 30 +++--- core/ebase.h | 12 +-- core/ecommon.h | 140 +++++++++++++++++----------- core/enodes.h | 26 +++--- core/etools.h | 12 +-- core/etransitions.h | 2 +- 12 files changed, 304 insertions(+), 138 deletions(-) diff --git a/core/Base/Game.cpp b/core/Base/Game.cpp index a91805de..b2cd9025 100644 --- a/core/Base/Game.cpp +++ b/core/Base/Game.cpp @@ -12,7 +12,7 @@ static bool s_bInitialized = false; static e2d::String s_sAppName; -bool e2d::Game::init(LPCTSTR sTitle, UINT32 nWidth, UINT32 nHeight, LPCTSTR pIconID, LPCTSTR sAppname) +bool e2d::Game::init(const String & sTitle, UINT32 nWidth, UINT32 nHeight, LPCTSTR pIconID, const String & sAppname) { if (s_bInitialized) { @@ -63,7 +63,7 @@ bool e2d::Game::init(LPCTSTR sTitle, UINT32 nWidth, UINT32 nHeight, LPCTSTR pIco // 重设 Client 大小 Window::setSize(nWidth, nHeight); // 设置 AppName - s_sAppName = (sAppname != nullptr) ? sAppname : Window::getTitle(); + s_sAppName = sAppname.isEmpty() ? Window::getTitle() : sAppname; // 标志初始化成功 s_bInitialized = true; diff --git a/core/Base/Window.cpp b/core/Base/Window.cpp index 3e2dabed..8c10be50 100644 --- a/core/Base/Window.cpp +++ b/core/Base/Window.cpp @@ -9,7 +9,7 @@ static HWND s_HWnd = nullptr; static bool s_bShowConsole = false; -bool e2d::Window::__init(LPCTSTR sTitle, UINT32 nWidth, UINT32 nHeight, LPCTSTR pIconID /*= nullptr*/) +bool e2d::Window::__init(const String & sTitle, UINT32 nWidth, UINT32 nHeight, LPCTSTR pIconID /*= nullptr*/) { // 注册窗口类 WNDCLASSEX wcex = { sizeof(WNDCLASSEX) }; diff --git a/core/Common/Image.cpp b/core/Common/Image.cpp index 474b1f60..52ba91a5 100644 --- a/core/Common/Image.cpp +++ b/core/Common/Image.cpp @@ -13,12 +13,12 @@ e2d::Image::Image() { } -e2d::Image::Image(LPCTSTR strFileName) +e2d::Image::Image(const String & strFileName) { this->loadFrom(strFileName); } -e2d::Image::Image(LPCTSTR strFileName, double nClipX, double nClipY, double nClipWidth, double nClipHeight) +e2d::Image::Image(const String & strFileName, double nClipX, double nClipY, double nClipWidth, double nClipHeight) { this->loadFrom(strFileName); this->clip(nClipX, nClipY, nClipWidth, nClipHeight); diff --git a/core/Common/String.cpp b/core/Common/String.cpp index 50c1aef4..05e58a05 100644 --- a/core/Common/String.cpp +++ b/core/Common/String.cpp @@ -1,5 +1,22 @@ #include "..\ecommon.h" #include +#include +#pragma comment(lib, "comsuppw.lib") + + +// 将 Unicode 字符串转化为 ANSI 字符串 +static std::string ConvertWide2Ansi(const wchar_t* wstr) +{ + std::string str = static_cast(_bstr_t(wstr)); + return std::move(str); +} + +// 将 ANSI 字符串转化为 Unicode 字符串 +static std::wstring ConvertAnsi2Wide(const char* cstr) +{ + std::wstring str = static_cast(_bstr_t(cstr)); + return std::move(str); +} e2d::String::String() @@ -12,6 +29,16 @@ e2d::String::String(const wchar_t *str) { } +e2d::String::String(const char *cstr) + : m_str(ConvertAnsi2Wide(cstr)) +{ +} + +e2d::String::String(const std::string &str) + : m_str(ConvertAnsi2Wide(str.c_str())) +{ +} + e2d::String::String(e2d::String && str) { m_str = std::move(str.m_str); @@ -38,6 +65,12 @@ e2d::String &e2d::String::operator=(const wchar_t *str) return *this; } +e2d::String & e2d::String::operator=(const char *cstr) +{ + m_str = ConvertAnsi2Wide(cstr); + return *this; +} + e2d::String & e2d::String::operator=(const String &str) { m_str = str.m_str; @@ -50,6 +83,12 @@ e2d::String & e2d::String::operator=(const std::wstring &str) return *this; } +e2d::String & e2d::String::operator=(const std::string &str) +{ + m_str = ConvertAnsi2Wide(str.c_str()); + return *this; +} + bool e2d::String::operator==(const wchar_t *str) { if (str) @@ -62,6 +101,19 @@ bool e2d::String::operator==(const wchar_t *str) } } +bool e2d::String::operator==(const char *str) +{ + if (str) + { + String temp(str); + return (m_str == temp.m_str); + } + else + { + return false; + } +} + bool e2d::String::operator ==(const e2d::String &str) { return m_str == str.m_str; @@ -84,6 +136,19 @@ bool e2d::String::operator!=(const wchar_t *str) } } +bool e2d::String::operator!=(const char *str) +{ + if (str) + { + String temp(str); + return (m_str != temp.m_str); + } + else + { + return true; + } +} + bool e2d::String::operator!=(const e2d::String &str) { return m_str != str.m_str; @@ -106,10 +171,10 @@ e2d::String e2d::String::operator+(const wchar_t *str) return std::move(temp); } -e2d::String e2d::String::operator+(const wchar_t x) +e2d::String e2d::String::operator+(const char *str) { - String temp; - temp.m_str = m_str + x; + String temp(str); + temp.m_str += m_str; return std::move(temp); } @@ -127,13 +192,6 @@ e2d::String e2d::String::operator+(const std::wstring &str) return std::move(temp); } -e2d::String e2d::operator+(const wchar_t ch, const e2d::String &str) -{ - String temp; - temp.m_str = ch + str.m_str; - return std::move(temp); -} - e2d::String e2d::operator+(const wchar_t *str1, const e2d::String &str2) { String temp; @@ -141,6 +199,13 @@ e2d::String e2d::operator+(const wchar_t *str1, const e2d::String &str2) return std::move(temp); } +e2d::String e2d::operator+(const char *str1, const String &str2) +{ + String temp(str1); + temp.m_str += str2.m_str; + return std::move(temp); +} + e2d::String e2d::operator+(const std::wstring &str1, const e2d::String &str2) { String temp; @@ -148,28 +213,58 @@ e2d::String e2d::operator+(const std::wstring &str1, const e2d::String &str2) return std::move(temp); } -e2d::String &e2d::String::operator+=(const wchar_t x) -{ - m_str += x; - return *this; -} - -e2d::String &e2d::String::operator+=(const wchar_t *str) +e2d::String & e2d::String::operator+=(const wchar_t *str) { m_str += str; - return *this; + return (*this); } -e2d::String &e2d::String::operator+=(const e2d::String &str) +e2d::String & e2d::String::operator+=(const char *str) +{ + m_str += ::ConvertAnsi2Wide(str); + return (*this); +} + +e2d::String & e2d::String::operator+=(const String &str) { m_str += str.m_str; - return *this; + return (*this); } e2d::String & e2d::String::operator+=(const std::wstring &str) { m_str += str; - return *this; + return (*this); +} + +bool e2d::String::operator>(const String &str) const +{ + return m_str > str.m_str; +} + +bool e2d::String::operator>=(const String &str) const +{ + return m_str >= str.m_str; +} + +bool e2d::String::operator<(const String &str) const +{ + return m_str < str.m_str; +} + +bool e2d::String::operator<=(const String &str) const +{ + return m_str <= str.m_str; +} + +e2d::String & e2d::String::operator<<(const char * value) +{ + return this->append(value); +} + +e2d::String & e2d::String::operator<<(char * value) +{ + return this->append(value); } e2d::String::operator const wchar_t*() const @@ -177,6 +272,16 @@ e2d::String::operator const wchar_t*() const return m_str.c_str(); } +e2d::String::operator wchar_t*() const +{ + return const_cast(m_str.c_str()); +} + +e2d::String::operator const char*() const +{ + return ::ConvertWide2Ansi(m_str.c_str()).c_str(); +} + e2d::String::operator bool() const { return getLength() != 0; @@ -204,12 +309,6 @@ unsigned int e2d::String::getHash() const return hash; } -std::wistream & e2d::operator>>(std::wistream &cin, e2d::String &str) -{ - cin >> str.m_str; - return cin; -} - e2d::String e2d::String::toUpper() const { String str(*this); @@ -299,17 +398,52 @@ int e2d::String::findLastOf(const wchar_t ch) const return index; } -e2d::String & e2d::String::append(const wchar_t ch) -{ - return (*this) += ch; -} - e2d::String & e2d::String::append(const wchar_t * str) { - return (*this) += str; + m_str += str; + return *this; +} + +e2d::String & e2d::String::append(const char * str) +{ + m_str += ::ConvertAnsi2Wide(str); + return *this; +} + +e2d::String & e2d::String::append(char * str) +{ + m_str += ::ConvertAnsi2Wide(str); + return *this; } e2d::String & e2d::String::append(const e2d::String & str) { - return (*this) += str; + m_str += str.m_str; + return (*this); } + +std::wostream & e2d::operator<<(std::wostream &cout, String &str) +{ + cout << str.m_str; + return cout; +} + +std::wistream & e2d::operator>>(std::wistream &cin, e2d::String &str) +{ + cin >> str.m_str; + return cin; +} + +std::ostream & e2d::operator<<(std::ostream &cout, String &str) +{ + cout << ::ConvertWide2Ansi(str.m_str.c_str()); + return cout; +} + +std::istream & e2d::operator>>(std::istream &cin, e2d::String &str) +{ + std::string temp; + cin >> temp; + str.m_str = ::ConvertAnsi2Wide(temp.c_str()); + return cin; +} \ No newline at end of file diff --git a/core/Node/Sprite.cpp b/core/Node/Sprite.cpp index 233d145b..8a8c999e 100644 --- a/core/Node/Sprite.cpp +++ b/core/Node/Sprite.cpp @@ -12,13 +12,13 @@ e2d::Sprite::Sprite(Image * image) loadFrom(image); } -e2d::Sprite::Sprite(LPCTSTR imageFileName) +e2d::Sprite::Sprite(const String & imageFileName) : m_pImage(nullptr) { loadFrom(imageFileName); } -e2d::Sprite::Sprite(LPCTSTR imageFileName, double x, double y, double width, double height) +e2d::Sprite::Sprite(const String & imageFileName, double x, double y, double width, double height) : m_pImage(nullptr) { loadFrom(imageFileName); @@ -42,7 +42,7 @@ void e2d::Sprite::loadFrom(Image * image) } } -void e2d::Sprite::loadFrom(LPCTSTR imageFileName) +void e2d::Sprite::loadFrom(const String & imageFileName) { loadFrom(new Image(imageFileName)); } diff --git a/core/Tool/File.cpp b/core/Tool/File.cpp index d5d576b7..53b7650d 100644 --- a/core/Tool/File.cpp +++ b/core/Tool/File.cpp @@ -81,7 +81,7 @@ e2d::String e2d::File::getSaveFilePath(const String & title, const String & defE { // 弹出保存对话框 OPENFILENAME ofn = { 0 }; - TCHAR strFilename[MAX_PATH] = { 0 }; // 用于接收文件名 + wchar_t strFilename[MAX_PATH] = { 0 }; // 用于接收文件名 ofn.lStructSize = sizeof(OPENFILENAME); // 结构体大小 ofn.hwndOwner = Window::getHWnd(); // 窗口句柄 ofn.lpstrFilter = L"所有文件\0*.*\0\0"; // 设置过滤 diff --git a/core/Tool/Music.cpp b/core/Tool/Music.cpp index 4e49b557..71b77a1f 100644 --- a/core/Tool/Music.cpp +++ b/core/Tool/Music.cpp @@ -10,13 +10,13 @@ using namespace e2d; #define SAFE_DELETE_ARRAY(p) { if (p) { delete[] (p); (p)=nullptr; } } #endif -inline bool TraceError(LPCTSTR sPrompt) +inline bool TraceError(wchar_t* sPrompt) { WARN_IF(true, "Music error: %s failed!", sPrompt); return false; } -inline bool TraceError(LPCTSTR sPrompt, HRESULT hr) +inline bool TraceError(wchar_t* sPrompt, HRESULT hr) { WARN_IF(true, "Music error: %s (%#X)", sPrompt, hr); return false; @@ -40,7 +40,7 @@ Music::~Music() _close(); } -bool Music::_open(LPCWSTR strFileName) +bool Music::_open(const String & strFileName) { if (m_bOpened) { @@ -48,7 +48,7 @@ bool Music::_open(LPCWSTR strFileName) return false; } - if (strFileName == nullptr) + if (strFileName.isEmpty()) { WARN_IF(true, L"Music::_open Invalid file name."); return false; @@ -65,7 +65,7 @@ bool Music::_open(LPCWSTR strFileName) wchar_t strFilePath[MAX_PATH]; if (!_findMediaFileCch(strFilePath, MAX_PATH, strFileName)) { - WARN_IF(true, L"Failed to find media file: %s", strFileName); + WARN_IF(true, L"Failed to find media file: %s", (const wchar_t*)strFileName); return false; } @@ -399,17 +399,17 @@ bool Music::_read(BYTE* pBuffer, DWORD dwSizeToRead) return true; } -bool Music::_findMediaFileCch(WCHAR* strDestPath, int cchDest, LPCWSTR strFilename) +bool Music::_findMediaFileCch(wchar_t* strDestPath, int cchDest, const String & strFilename) { bool bFound = false; - if (nullptr == strFilename || strFilename[0] == 0 || nullptr == strDestPath || cchDest < 10) + if (strFilename.isEmpty() || nullptr == strDestPath || cchDest < 10) return false; // Get the exe name, and exe path - WCHAR strExePath[MAX_PATH] = { 0 }; - WCHAR strExeName[MAX_PATH] = { 0 }; - WCHAR* strLastSlash = nullptr; + wchar_t strExePath[MAX_PATH] = { 0 }; + wchar_t strExeName[MAX_PATH] = { 0 }; + wchar_t* strLastSlash = nullptr; GetModuleFileName(HINST_THISCOMPONENT, strExePath, MAX_PATH); strExePath[MAX_PATH - 1] = 0; strLastSlash = wcsrchr(strExePath, TEXT('\\')); @@ -431,13 +431,13 @@ bool Music::_findMediaFileCch(WCHAR* strDestPath, int cchDest, LPCWSTR strFilena return true; // Search all parent directories starting at .\ and using strFilename as the leaf name - WCHAR strLeafName[MAX_PATH] = { 0 }; + wchar_t strLeafName[MAX_PATH] = { 0 }; wcscpy_s(strLeafName, MAX_PATH, strFilename); - WCHAR strFullPath[MAX_PATH] = { 0 }; - WCHAR strFullFileName[MAX_PATH] = { 0 }; - WCHAR strSearch[MAX_PATH] = { 0 }; - WCHAR* strFilePart = nullptr; + wchar_t strFullPath[MAX_PATH] = { 0 }; + wchar_t strFullFileName[MAX_PATH] = { 0 }; + wchar_t strSearch[MAX_PATH] = { 0 }; + wchar_t* strFilePart = nullptr; GetFullPathName(L".", MAX_PATH, strFullPath, &strFilePart); if (strFilePart == nullptr) diff --git a/core/ebase.h b/core/ebase.h index d7626f1f..24b2ba63 100644 --- a/core/ebase.h +++ b/core/ebase.h @@ -14,11 +14,11 @@ class Game public: // 初始化游戏 static bool init( - LPCTSTR sTitle, /* 窗口标题 */ - UINT32 nWidth, /* 窗口宽度 */ - UINT32 nHeight, /* 窗口高度 */ - LPCTSTR pIconID = nullptr, /* 窗口图标 */ - LPCTSTR sAppname = nullptr /* AppName */ + const String & sTitle, /* 窗口标题 */ + UINT32 nWidth, /* 窗口宽度 */ + UINT32 nHeight, /* 窗口高度 */ + LPCTSTR pIconID = L"", /* 窗口图标 */ + const String & sAppname = L"" /* AppName */ ); // 启动游戏 @@ -89,7 +89,7 @@ public: private: // 初始化窗口 static bool __init( - LPCTSTR sTitle, + const String & sTitle, UINT32 nWidth, UINT32 nHeight, LPCTSTR pIconID diff --git a/core/ecommon.h b/core/ecommon.h index edd28867..0c2abf2a 100644 --- a/core/ecommon.h +++ b/core/ecommon.h @@ -99,47 +99,6 @@ public: ~String(); - String& operator= (const wchar_t *); - String& operator= (const String &); - String& operator= (const std::wstring &); - - bool operator== (const wchar_t *); - bool operator== (const String &); - bool operator== (const std::wstring &); - - bool operator!= (const wchar_t *); - bool operator!= (const String &); - bool operator!= (const std::wstring &); - - wchar_t &operator[] (int); - - String operator+ (const wchar_t); - String operator+ (const wchar_t *); - String operator+ (const String &); - String operator+ (const std::wstring &); - - friend String operator+ (const wchar_t, const String &); - friend String operator+ (const wchar_t*, const String &); - friend String operator+ (const std::wstring &, const String &); - - String& operator+= (const wchar_t); - String& operator+= (const wchar_t *); - String& operator+= (const String &); - String& operator+= (const std::wstring &); - - template - String& operator<< (const T value) - { - std::wostringstream ss; - ss << value; - return (*this) += ss.str(); - } - - operator const wchar_t* () const; - operator bool () const; - - friend std::wistream& operator>> (std::wistream &, String &); - // 判断字符串是否为空 bool isEmpty() const; @@ -149,30 +108,41 @@ public: // 获取该字符串的散列值 unsigned int getHash() const; - // 后接字符 - String &append(const wchar_t ch); + // 后接字符串 + String& append( + const wchar_t *str + ); // 后接字符串 - String &append(const wchar_t *str); - - // 后接字符串 - String &append(const String &str); + String& append( + const String &str + ); // 后接字符串 template - String &append(const T &value) + String& append(const T &value) { - return (*this) += value; + std::wostringstream ss; + ss << value; + m_str += ss.str(); + return (*this); } // 获取裁剪字符串 - String subtract(int offset, int count = -1) const; + String subtract( + int offset, /* 偏移量 */ + int count = -1 /* 截取字符数量 */ + ) const; // 获取字符串中第一个特定字符的下标 - int findFirstOf(const wchar_t ch) const; + int findFirstOf( + const wchar_t ch + ) const; // 获取字符串中最后一个特定字符的下标 - int findLastOf(const wchar_t ch) const; + int findLastOf( + const wchar_t ch + ) const; // 获取大写字符串 String toUpper() const; @@ -198,6 +168,68 @@ public: return ss.str(); } + static String toString(const wchar_t * str) { return std::move(String(str)); } + static String toString(const char * str) { return std::move(String(str)); } + + String& operator= (const wchar_t *); + String& operator= (const String &); + String& operator= (const std::wstring &); + + bool operator== (const wchar_t *); + bool operator== (const String &); + bool operator== (const std::wstring &); + + bool operator!= (const wchar_t *); + bool operator!= (const String &); + bool operator!= (const std::wstring &); + + wchar_t &operator[] (int); + + String operator+ (const wchar_t *); + String operator+ (const String &); + String operator+ (const std::wstring &); + + friend String operator+ (const wchar_t*, const String &); + friend String operator+ (const std::wstring &, const String &); + + String& operator+= (const wchar_t *); + String& operator+= (const String &); + String& operator+= (const std::wstring &); + + bool operator> (const String &) const; + bool operator>= (const String &) const; + bool operator< (const String &) const; + bool operator<= (const String &) const; + + template + String& operator<< (const T value) { return this->append<>(value); } + + operator const wchar_t* () const; + operator wchar_t* () const; + operator bool () const; + + friend std::wostream& operator<< (std::wostream &, String &); + friend std::wistream& operator>> (std::wistream &, String &); + + // 为 ANSI 作出的适应 + String(const char *); + String(const std::string &); + operator const char* () const; + String& operator= (const char *); + String& operator= (const std::string &); + bool operator== (const char *); + bool operator!= (const char *); + String operator+ (const char *); + friend String operator+ (const char *, const String &); + String& operator+= (const char *); + String& operator<< (const char *); + String& operator<< (char *); + String& append(const char *); + String& append(char *); + + friend std::ostream& operator<< (std::ostream &, String &); + friend std::istream& operator>> (std::istream &, String &); + private: std::wstring m_str; }; @@ -501,12 +533,12 @@ public: // 从本地文件中读取资源 Image( - LPCTSTR strFilePath /* 图片文件路径 */ + const String & strFilePath /* 图片文件路径 */ ); // 从本地文件中读取资源 Image( - LPCTSTR strFilePath,/* 图片文件路径 */ + const String & strFilePath,/* 图片文件路径 */ double nClipX, /* 裁剪位置 X 坐标 */ double nClipY, /* 裁剪位置 Y 坐标 */ double nClipWidth, /* 裁剪宽度 */ diff --git a/core/enodes.h b/core/enodes.h index c5f04be3..08a13305 100644 --- a/core/enodes.h +++ b/core/enodes.h @@ -422,12 +422,12 @@ public: // 从文件图片创建精灵 Sprite( - LPCTSTR imageFileName + const String & imageFileName ); // 从文件图片创建精灵并裁剪 Sprite( - LPCTSTR imageFileName, + const String & imageFileName, double x, double y, double width, @@ -443,7 +443,7 @@ public: // 从本地文件加载图片 virtual void loadFrom( - LPCTSTR imageFileName + const String & imageFileName ); // 裁剪图片 @@ -472,25 +472,25 @@ public: Text(); Text( - const String & text + const String & text /* 文字内容 */ ); Text( - Font * font + Font * font /* 字体样式 */ ); Text( - const String & text, - Font * font + const String & text,/* 文字内容 */ + Font * font /* 字体样式 */ ); Text( - const String & text, - String fontFamily, - double fontSize = 22, - UINT32 color = Color::WHITE, - UINT32 fontWeight = FontWeight::REGULAR, - bool italic = false + const String & text, /* 文字内容*/ + String fontFamily, /* 字体 */ + double fontSize = 22, /* 字号 */ + UINT32 color = Color::WHITE, /* 颜色 */ + UINT32 fontWeight = FontWeight::REGULAR,/* 粗细值 */ + bool italic = false /* 斜体 */ ); virtual ~Text(); diff --git a/core/etools.h b/core/etools.h index d9a77eb7..6f030313 100644 --- a/core/etools.h +++ b/core/etools.h @@ -51,15 +51,15 @@ public: Timer( const TimerCallback &callback, /* 定时器回调函数 */ - double interval = 0, /* 时间间隔(秒) */ + double interval = 0, /* 时间间隔(秒) */ int repeatTimes = -1, /* 定时器执行次数 */ bool atOnce = false /* 是否立即执行 */ ); Timer( - const String &name, /* 定时器名称 */ + const String &name, /* 定时器名称 */ const TimerCallback &callback, /* 定时器回调函数 */ - double interval = 0, /* 时间间隔(秒) */ + double interval = 0, /* 时间间隔(秒) */ int repeatTimes = -1, /* 定时器执行次数 */ bool atOnce = false /* 是否立即执行 */ ); @@ -190,7 +190,7 @@ public: // 打开保存文件对话框 static String getSaveFilePath( const String & title = L"保存到", /* 对话框标题 */ - const String & defExt = L"" /* 默认扩展名 */ + const String & defExt = L"" /* 默认扩展名 */ ); }; @@ -242,7 +242,7 @@ protected: virtual ~Music(); - bool _open(LPCWSTR strFileName); + bool _open(const String & strFileName); void _close(); @@ -252,7 +252,7 @@ protected: bool _read(BYTE* pBuffer, DWORD dwSizeToRead); - bool _findMediaFileCch(WCHAR* strDestPath, int cchDest, LPCWSTR strFilename); + bool _findMediaFileCch(wchar_t* strDestPath, int cchDest, const String & strFilename); protected: bool m_bOpened; diff --git a/core/etransitions.h b/core/etransitions.h index 9395cee6..c27a26fc 100644 --- a/core/etransitions.h +++ b/core/etransitions.h @@ -108,7 +108,7 @@ public: // 创建移动式的场景切换动画 TransitionMove( - double moveDuration, /* 场景移动动画持续时长 */ + double moveDuration, /* 场景移动动画持续时长 */ MOVE_DIRECT direct = LEFT /* 场景移动方向 */ );