Commit 1a8fbda3 authored by hybrid's avatar hybrid

Minor reorganization.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1658 dfc29bdd-3216-0410-991c-e03cc46cb475
parent c232d8de
...@@ -757,11 +757,13 @@ bool CD3D9Driver::setRenderTarget(video::ITexture* texture, ...@@ -757,11 +757,13 @@ bool CD3D9Driver::setRenderTarget(video::ITexture* texture,
// store previous target // store previous target
if (!PrevRenderTarget) if (!PrevRenderTarget)
{
if (FAILED(pID3DDevice->GetRenderTarget(0, &PrevRenderTarget))) if (FAILED(pID3DDevice->GetRenderTarget(0, &PrevRenderTarget)))
{ {
os::Printer::log("Could not get previous render target.", ELL_ERROR); os::Printer::log("Could not get previous render target.", ELL_ERROR);
return false; return false;
} }
}
// set new render target // set new render target
......
...@@ -136,7 +136,7 @@ void CD3D9Texture::createRenderTarget() ...@@ -136,7 +136,7 @@ void CD3D9Texture::createRenderTarget()
} }
else else
{ {
os::Printer::log("Could not create RenderTarget texture: could not get BackBuffer.", os::Printer::log("Could not create RenderTarget texture", "could not get BackBuffer.",
ELL_WARNING); ELL_WARNING);
return; return;
} }
......
...@@ -44,7 +44,6 @@ namespace irr ...@@ -44,7 +44,6 @@ namespace irr
} // end namespace irr } // end namespace irr
struct SEnvMapper struct SEnvMapper
{ {
HWND hWnd; HWND hWnd;
...@@ -63,6 +62,7 @@ SEnvMapper* getEnvMapperFromHWnd(HWND hWnd) ...@@ -63,6 +62,7 @@ SEnvMapper* getEnvMapperFromHWnd(HWND hWnd)
return 0; return 0;
} }
irr::CIrrDeviceWin32* getDeviceFromHWnd(HWND hWnd) irr::CIrrDeviceWin32* getDeviceFromHWnd(HWND hWnd)
{ {
irr::core::list<SEnvMapper>::Iterator it = EnvMap.begin(); irr::core::list<SEnvMapper>::Iterator it = EnvMap.begin();
...@@ -85,9 +85,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -85,9 +85,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
irr::CIrrDeviceWin32* dev = 0; irr::CIrrDeviceWin32* dev = 0;
irr::SEvent event; irr::SEvent event;
SEnvMapper* envm = 0;
BYTE allKeys[256];
static irr::s32 ClickCount=0; static irr::s32 ClickCount=0;
if (GetCapture() != hWnd && ClickCount > 0) if (GetCapture() != hWnd && ClickCount > 0)
...@@ -107,12 +104,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -107,12 +104,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case WM_SETCURSOR: case WM_SETCURSOR:
envm = getEnvMapperFromHWnd(hWnd); {
SEnvMapper* envm = getEnvMapperFromHWnd(hWnd);
if (envm && !envm->irrDev->getWin32CursorControl()->isVisible()) if (envm && !envm->irrDev->getWin32CursorControl()->isVisible())
{ {
SetCursor(NULL); SetCursor(NULL);
return 0; return 0;
} }
}
break; break;
case WM_MOUSEWHEEL: case WM_MOUSEWHEEL:
...@@ -230,6 +229,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -230,6 +229,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_KEYDOWN: case WM_KEYDOWN:
case WM_KEYUP: case WM_KEYUP:
{ {
BYTE allKeys[256];
event.EventType = irr::EET_KEY_INPUT_EVENT; event.EventType = irr::EET_KEY_INPUT_EVENT;
event.KeyInput.Key = (irr::EKEY_CODE)wParam; event.KeyInput.Key = (irr::EKEY_CODE)wParam;
event.KeyInput.PressedDown = (message==WM_KEYDOWN); event.KeyInput.PressedDown = (message==WM_KEYDOWN);
...@@ -283,6 +284,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -283,6 +284,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
return DefWindowProc(hWnd, message, wParam, lParam); return DefWindowProc(hWnd, message, wParam, lParam);
} }
namespace irr namespace irr
{ {
...@@ -407,7 +409,6 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params) ...@@ -407,7 +409,6 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
} }
//! destructor //! destructor
CIrrDeviceWin32::~CIrrDeviceWin32() CIrrDeviceWin32::~CIrrDeviceWin32()
{ {
...@@ -415,18 +416,19 @@ CIrrDeviceWin32::~CIrrDeviceWin32() ...@@ -415,18 +416,19 @@ CIrrDeviceWin32::~CIrrDeviceWin32()
irr::core::list<SEnvMapper>::Iterator it = EnvMap.begin(); irr::core::list<SEnvMapper>::Iterator it = EnvMap.begin();
for (; it!= EnvMap.end(); ++it) for (; it!= EnvMap.end(); ++it)
{
if ((*it).hWnd == HWnd) if ((*it).hWnd == HWnd)
{ {
EnvMap.erase(it); EnvMap.erase(it);
break; break;
} }
}
if (ChangedToFullScreen) if (ChangedToFullScreen)
ChangeDisplaySettings(NULL,0); ChangeDisplaySettings(NULL,0);
} }
//! create the driver //! create the driver
void CIrrDeviceWin32::createDriver() void CIrrDeviceWin32::createDriver()
{ {
...@@ -523,7 +525,6 @@ void CIrrDeviceWin32::createDriver() ...@@ -523,7 +525,6 @@ void CIrrDeviceWin32::createDriver()
} }
//! runs the device. Returns false if device wants to be deleted //! runs the device. Returns false if device wants to be deleted
bool CIrrDeviceWin32::run() bool CIrrDeviceWin32::run()
{ {
......
...@@ -227,7 +227,6 @@ namespace irr ...@@ -227,7 +227,6 @@ namespace irr
core::rect<s32> ReferenceRect; core::rect<s32> ReferenceRect;
}; };
//! returns the win32 cursor control //! returns the win32 cursor control
CCursorControl* getWin32CursorControl(); CCursorControl* getWin32CursorControl();
...@@ -252,7 +251,6 @@ namespace irr ...@@ -252,7 +251,6 @@ namespace irr
CCursorControl* Win32CursorControl; CCursorControl* Win32CursorControl;
}; };
} // end namespace irr } // end namespace irr
#endif #endif
......
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