UserEvent now usize size_t for UserData fields to avoid cutting number on some platforms.

Fix some warnings.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5417 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-04-12 16:22:35 +00:00
parent 4f56eecd61
commit 278dc39029
6 changed files with 11 additions and 13 deletions

View File

@ -1,6 +1,7 @@
--------------------------
Changes in 1.9 (not yet released)
- change SEvent::SUserEvent.UserData1 and SEvent::SUserEvent.UserData1 from s32 to size_t to avoid cutting numbers on some 64-bit platforms (SDL and Windows)
- Improve speed of draw3DBox (OpenGL and D3D9). Thanks @zerochen for patch (https://sourceforge.net/p/irrlicht/patches/256)
- Support more keys on OSX "[]\". Thanks @neoascetic for patch (#313).
- Fix IBillboardTextSceneNode::setTextColor which did nothing in the past. It now maps to setColor instead.

View File

@ -405,10 +405,10 @@ struct SEvent
struct SUserEvent
{
//! Some user specified data as int
s32 UserData1;
size_t UserData1;
//! Another user specified data as int
s32 UserData2;
size_t UserData2;
};
EEVENT_TYPE EventType;

View File

@ -1007,8 +1007,8 @@ bool CIrrDeviceLinux::run()
{
// we assume it's a user message
irrevent.EventType = irr::EET_USER_EVENT;
irrevent.UserEvent.UserData1 = (s32)event.xclient.data.l[0];
irrevent.UserEvent.UserData2 = (s32)event.xclient.data.l[1];
irrevent.UserEvent.UserData1 = static_cast<size_t>(event.xclient.data.l[0]);
irrevent.UserEvent.UserData2 = static_cast<size_t>(event.xclient.data.l[1]);
postEventFromUser(irrevent);
}
XFree(atom);

View File

@ -428,8 +428,8 @@ bool CIrrDeviceSDL::run()
case SDL_USEREVENT:
irrevent.EventType = irr::EET_USER_EVENT;
irrevent.UserEvent.UserData1 = *(reinterpret_cast<s32*>(&SDL_event.user.data1));
irrevent.UserEvent.UserData2 = *(reinterpret_cast<s32*>(&SDL_event.user.data2));
irrevent.UserEvent.UserData1 = reinterpret_cast<uintptr_t>(SDL_event.user.data1);
irrevent.UserEvent.UserData2 = reinterpret_cast<uintptr_t>(SDL_event.user.data2);
postEventFromUser(irrevent);
break;
@ -601,7 +601,7 @@ void CIrrDeviceSDL::setWindowCaption(const wchar_t* text)
bool CIrrDeviceSDL::present(video::IImage* surface, void* windowId, core::rect<s32>* srcClip)
{
SDL_Surface *sdlSurface = SDL_CreateRGBSurfaceFrom(
surface->lock(), surface->getDimension().Width, surface->getDimension().Height,
surface->getData(), surface->getDimension().Width, surface->getDimension().Height,
surface->getBitsPerPixel(), surface->getPitch(),
surface->getRedMask(), surface->getGreenMask(), surface->getBlueMask(), surface->getAlphaMask());
if (!sdlSurface)
@ -673,7 +673,6 @@ bool CIrrDeviceSDL::present(video::IImage* surface, void* windowId, core::rect<s
}
SDL_FreeSurface(sdlSurface);
surface->unlock();
return (scr != 0);
}

View File

@ -954,8 +954,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_USER:
event.EventType = irr::EET_USER_EVENT;
event.UserEvent.UserData1 = (irr::s32)wParam;
event.UserEvent.UserData2 = (irr::s32)lParam;
event.UserEvent.UserData1 = static_cast<size_t>(wParam);
event.UserEvent.UserData2 = static_cast<size_t>(lParam);
dev = getDeviceFromHWnd(hWnd);
if (dev)

View File

@ -190,10 +190,8 @@ REALINLINE void CTRTextureLightMap2_Add::scanline_bilinear ()
#endif
f32 inversew = FIX_POINT_F32_MUL;
#ifdef BURNINGVIDEO_RENDERER_FAST
f32 inversew = FIX_POINT_F32_MUL;
u32 dIndex = ( line.y & 3 ) << 2;