X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fplat%2FWin32.cc;h=d6016d69b6a73193e0d3c73c7610f2f0ca4dd960;hp=fda911b60c55d0be4d1c2f5a7c88b6767f569efd;hb=297fdbde87e6db4732448a0950d1141c7265c169;hpb=3591b88b94a6bb378af3d4abe6eb5233ce583104 diff --git a/src/org/ibex/plat/Win32.cc b/src/org/ibex/plat/Win32.cc index fda911b..d6016d6 100644 --- a/src/org/ibex/plat/Win32.cc +++ b/src/org/ibex/plat/Win32.cc @@ -147,7 +147,8 @@ static unsigned char hand_cursor_and[32 * 4] = { }; void org::ibex::plat::Win32::natPreInit() { - if (org::ibex::util::Log::verbose) { + // Win32 throws stderr in the trash unless you designate your binary as a "console binary" + if (org::ibex::util::Log::logstream == java::lang::System::err) { AllocConsole(); freopen("CONOUT$", "w+t", stderr); } @@ -372,7 +373,7 @@ static jint scratch_h = 0; #define max(a,b) ((a)>(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b)) -void org::ibex::plat::Win32$Win32PixelBuffer::drawPicture(org::ibex::Picture* source0, +void org::ibex::plat::Win32$Win32PixelBuffer::drawPicture(org::ibex::graphics::Picture* source0, jint dx, jint dy, jint cx1, jint cy1, jint cx2, jint cy2, jint rgb, jboolean alphaOnly) { @@ -455,7 +456,7 @@ void org::ibex::plat::Win32$Win32PixelBuffer::fillRect(jint x, jint y, jint x2, DeleteObject(brush); } -void org::ibex::plat::Win32$Win32Surface::blit(org::ibex::PixelBuffer* s, jint sx, jint sy, jint dx, jint dy, jint dx2, jint dy2) { +void org::ibex::plat::Win32$Win32Surface::blit(org::ibex::graphics::PixelBuffer* s, jint sx, jint sy, jint dx, jint dy, jint dx2, jint dy2) { // we create the DC lazily to get around some strange race condition in WinXP if (hdc == 0) hdc = (jint)GetDC((HWND)hwnd); BitBlt((HDC)hdc, dx, dy, dx2 - dx, dy2 - dy, (HDC)(((org::ibex::plat::Win32$Win32PixelBuffer*)s)->hdc), sx, sy, SRCCOPY); @@ -578,7 +579,7 @@ void org::ibex::plat::Win32$Win32Surface::setTitleBarText(java::lang::String* ti SetWindowText((HWND)hwnd, buf); } -void org::ibex::plat::Win32$Win32Surface::setIcon(org::ibex::Picture* p0) { +void org::ibex::plat::Win32$Win32Surface::setIcon(org::ibex::graphics::Picture* p0) { org::ibex::plat::Win32$Win32Picture* p = (org::ibex::plat::Win32$Win32Picture*)p0; int icon_width = GetSystemMetrics(SM_CXSMICON); @@ -637,7 +638,9 @@ jint org::ibex::plat::Win32$Win32Surface::WndProc(jint _hwnd, jint _iMsg, jint _ switch(iMsg) { case WM_DEVMODECHANGE: break; // FEATURE: color depth changed case WM_DISPLAYCHANGE: break; // FEATURE: screen size changed - case WM_MOUSEWHEEL: break; // FEATURE: Mouse Wheel + case WM_MOUSEWHEEL: + VScroll(((jfloat)((wParam & 0xffff0000) >> 16)) / (jfloat)120); + break; case WM_SYSKEYDOWN: if (GetKeyState(VK_MENU) >> (sizeof(SHORT) * 8 - 1) == 0) return 0; case WM_KEYDOWN: