Commit 2e30bc5d authored by mercury233's avatar mercury233

Merge branch 'master' into patch-clipboard

parents d24a1e02 368b43c8
...@@ -325,9 +325,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShader(LPCSTR pSrcData, ...@@ -325,9 +325,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShader(LPCSTR pSrcData,
if (!pFn && !LoadFailed) if (!pFn && !LoadFailed)
{ {
// try to load dll // try to load dll
irr::core::string<TCHAR> strDllName = "d3dx9_"; irr::core::string<TCHAR> strDllName = __TEXT("d3dx9_");
strDllName += (int)D3DX_SDK_VERSION; strDllName += (int)D3DX_SDK_VERSION;
strDllName += ".dll"; strDllName += __TEXT(".dll");
HMODULE hMod = LoadLibrary(strDllName.c_str()); HMODULE hMod = LoadLibrary(strDllName.c_str());
if (hMod) if (hMod)
...@@ -385,9 +385,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShaderFromFile(LPCSTR pSrcF ...@@ -385,9 +385,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShaderFromFile(LPCSTR pSrcF
if (!pFn && !LoadFailed) if (!pFn && !LoadFailed)
{ {
// try to load dll // try to load dll
irr::core::string<TCHAR> strDllName = "d3dx9_"; irr::core::string<TCHAR> strDllName = __TEXT("d3dx9_");
strDllName += (int)D3DX_SDK_VERSION; strDllName += (int)D3DX_SDK_VERSION;
strDllName += ".dll"; strDllName += __TEXT(".dll");
HMODULE hMod = LoadLibrary(strDllName.c_str()); HMODULE hMod = LoadLibrary(strDllName.c_str());
if (hMod) if (hMod)
...@@ -446,9 +446,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShader(LPCSTR pSrcData, UINT ...@@ -446,9 +446,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShader(LPCSTR pSrcData, UINT
if (!pFn && !LoadFailed) if (!pFn && !LoadFailed)
{ {
// try to load dll // try to load dll
irr::core::string<TCHAR> strDllName = "d3dx9_"; irr::core::string<TCHAR> strDllName = __TEXT("d3dx9_");
strDllName += (int)D3DX_SDK_VERSION; strDllName += (int)D3DX_SDK_VERSION;
strDllName += ".dll"; strDllName += __TEXT(".dll");
HMODULE hMod = LoadLibrary(strDllName.c_str()); HMODULE hMod = LoadLibrary(strDllName.c_str());
if (hMod) if (hMod)
...@@ -506,9 +506,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShaderFromFile(LPCSTR pSrcFi ...@@ -506,9 +506,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShaderFromFile(LPCSTR pSrcFi
if (!pFn && !LoadFailed) if (!pFn && !LoadFailed)
{ {
// try to load dll // try to load dll
irr::core::string<TCHAR> strDllName = "d3dx9_"; irr::core::string<TCHAR> strDllName = __TEXT("d3dx9_");
strDllName += (int)D3DX_SDK_VERSION; strDllName += (int)D3DX_SDK_VERSION;
strDllName += ".dll"; strDllName += __TEXT(".dll");
HMODULE hMod = LoadLibrary(strDllName.c_str()); HMODULE hMod = LoadLibrary(strDllName.c_str());
if (hMod) if (hMod)
......
...@@ -325,7 +325,7 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -325,7 +325,7 @@ bool CGUIListBox::OnEvent(const SEvent& event)
LastKeyTime = now; LastKeyTime = now;
// find the selected item, starting at the current selection // find the selected item, starting at the current selection
s32 start = Selected; const s32 start = Selected;
// dont change selection if the key buffer matches the current item // dont change selection if the key buffer matches the current item
if (Selected > -1 && KeyBuffer.size() > 1) if (Selected > -1 && KeyBuffer.size() > 1)
{ {
...@@ -341,7 +341,8 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -341,7 +341,8 @@ bool CGUIListBox::OnEvent(const SEvent& event)
{ {
if (KeyBuffer.equals_ignore_case(Items[current].text.subString(0,KeyBuffer.size()))) if (KeyBuffer.equals_ignore_case(Items[current].text.subString(0,KeyBuffer.size())))
{ {
if (Parent && Selected != current && !Selecting && !MoveOverSelect) setSelected(current);
if (Parent && start != current && !Selecting && !MoveOverSelect)
{ {
SEvent e; SEvent e;
e.EventType = EET_GUI_EVENT; e.EventType = EET_GUI_EVENT;
...@@ -350,7 +351,6 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -350,7 +351,6 @@ bool CGUIListBox::OnEvent(const SEvent& event)
e.GUIEvent.EventType = EGET_LISTBOX_CHANGED; e.GUIEvent.EventType = EGET_LISTBOX_CHANGED;
Parent->OnEvent(e); Parent->OnEvent(e);
} }
setSelected(current);
return true; return true;
} }
} }
...@@ -361,9 +361,9 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -361,9 +361,9 @@ bool CGUIListBox::OnEvent(const SEvent& event)
{ {
if (KeyBuffer.equals_ignore_case(Items[current].text.subString(0,KeyBuffer.size()))) if (KeyBuffer.equals_ignore_case(Items[current].text.subString(0,KeyBuffer.size())))
{ {
if (Parent && Selected != current && !Selecting && !MoveOverSelect) setSelected(current);
if (Parent && start != current && !Selecting && !MoveOverSelect)
{ {
Selected = current;
SEvent e; SEvent e;
e.EventType = EET_GUI_EVENT; e.EventType = EET_GUI_EVENT;
e.GUIEvent.Caller = this; e.GUIEvent.Caller = this;
...@@ -371,7 +371,6 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -371,7 +371,6 @@ bool CGUIListBox::OnEvent(const SEvent& event)
e.GUIEvent.EventType = EGET_LISTBOX_CHANGED; e.GUIEvent.EventType = EGET_LISTBOX_CHANGED;
Parent->OnEvent(e); Parent->OnEvent(e);
} }
setSelected(current);
return true; return true;
} }
} }
......
...@@ -521,7 +521,6 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -521,7 +521,6 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
//99 - AES encryption, WinZip 9 //99 - AES encryption, WinZip 9
const SZipFileEntry &e = FileInfo[Files[index].ID]; const SZipFileEntry &e = FileInfo[Files[index].ID];
wchar_t buf[64];
s16 actualCompressionMethod=e.header.CompressionMethod; s16 actualCompressionMethod=e.header.CompressionMethod;
IReadFile* decrypted=0; IReadFile* decrypted=0;
u8* decryptedBuf=0; u8* decryptedBuf=0;
...@@ -620,8 +619,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -620,8 +619,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
c8* pBuf = new c8[ uncompressedSize ]; c8* pBuf = new c8[ uncompressedSize ];
if (!pBuf) if (!pBuf)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
if (decrypted) if (decrypted)
decrypted->drop(); decrypted->drop();
return 0; return 0;
...@@ -633,8 +631,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -633,8 +631,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
pcData = new u8[decryptedSize]; pcData = new u8[decryptedSize];
if (!pcData) if (!pcData)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -674,8 +671,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -674,8 +671,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
if (err != Z_OK) if (err != Z_OK)
{ {
swprintf ( buf, 64, L"Error decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Error decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -694,8 +690,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -694,8 +690,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
c8* pBuf = new c8[ uncompressedSize ]; c8* pBuf = new c8[ uncompressedSize ];
if (!pBuf) if (!pBuf)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
if (decrypted) if (decrypted)
decrypted->drop(); decrypted->drop();
return 0; return 0;
...@@ -707,8 +702,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -707,8 +702,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
pcData = new u8[decryptedSize]; pcData = new u8[decryptedSize];
if (!pcData) if (!pcData)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -745,8 +739,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -745,8 +739,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
if (err != BZ_OK) if (err != BZ_OK)
{ {
swprintf ( buf, 64, L"Error decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Error decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -766,8 +759,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -766,8 +759,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
c8* pBuf = new c8[ uncompressedSize ]; c8* pBuf = new c8[ uncompressedSize ];
if (!pBuf) if (!pBuf)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
if (decrypted) if (decrypted)
decrypted->drop(); decrypted->drop();
return 0; return 0;
...@@ -779,8 +771,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -779,8 +771,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
pcData = new u8[decryptedSize]; pcData = new u8[decryptedSize];
if (!pcData) if (!pcData)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -826,8 +817,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -826,8 +817,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
os::Printer::log("Decryption support not enabled. File cannot be read.", ELL_ERROR); os::Printer::log("Decryption support not enabled. File cannot be read.", ELL_ERROR);
return 0; return 0;
default: default:
swprintf ( buf, 64, L"file has unsupported compression method. %s", Files[index].FullName.c_str() ); os::Printer::log("file has unsupported compression method.", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
return 0; return 0;
}; };
......
...@@ -494,6 +494,7 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param) ...@@ -494,6 +494,7 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
if(!CreationParams.WindowId) //load menus if standalone application if(!CreationParams.WindowId) //load menus if standalone application
{ {
[[NSAutoreleasePool alloc] init]; [[NSAutoreleasePool alloc] init];
[[NSApplication sharedApplication] setActivationPolicy:NSApplicationActivationPolicyRegular];
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; [[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
[NSApp setDelegate:(id<NSApplicationDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]]; [NSApp setDelegate:(id<NSApplicationDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]];
[NSBundle loadNibNamed:@"MainMenu" owner:[NSApp delegate]]; [NSBundle loadNibNamed:@"MainMenu" owner:[NSApp delegate]];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment