mirror of
https://github.com/encounter/SDL.git
synced 2025-12-20 18:29:22 +00:00
N-Gage port: add changes from code reviews, overall cleanup (#5618)
* Add changes from code review by @ccawley2011, #5597, overall cleanup * Update N-Gage README, minor cleanup and rephrasing * Call SDL_SetMainReady() before calling SDL_main, return SDL_main instead of main
This commit is contained in:
committed by
GitHub
parent
2c2cbbe664
commit
9b75fa0165
@@ -113,7 +113,7 @@ static SDL_Scancode ConvertScancode(_THIS, int key)
|
||||
keycode = SDLK_ASTERISK;
|
||||
break;
|
||||
case EStdKeyHash: // Hash
|
||||
keycode = SDLK_SLASH;
|
||||
keycode = SDLK_HASH;
|
||||
break;
|
||||
case EStdKeyDevice0: // Left softkey
|
||||
keycode = SDLK_SOFTLEFT;
|
||||
@@ -121,14 +121,14 @@ static SDL_Scancode ConvertScancode(_THIS, int key)
|
||||
case EStdKeyDevice1: // Right softkey
|
||||
keycode = SDLK_SOFTRIGHT;
|
||||
break;
|
||||
case EStdKeyApplication0: // Green softkey
|
||||
case EStdKeyApplication0: // Call softkey
|
||||
keycode = SDLK_CALL;
|
||||
break;
|
||||
case EStdKeyApplication1: // Red softkey
|
||||
case EStdKeyApplication1: // End call softkey
|
||||
keycode = SDLK_ENDCALL;
|
||||
break;
|
||||
case EStdKeyDevice3: // Middle softkey
|
||||
keycode = SDLK_RETURN;
|
||||
keycode = SDLK_SELECT;
|
||||
break;
|
||||
case EStdKeyUpArrow: // Up arrow
|
||||
keycode = SDLK_UP;
|
||||
@@ -166,7 +166,7 @@ int HandleWsEvent(_THIS, const TWsEvent& aWsEvent)
|
||||
case EEventFocusGained: /* SDL window got focus */
|
||||
phdata->NGAGE_IsWindowFocused = ETrue;
|
||||
/* Draw window background and screen buffer */
|
||||
DisableKeyBlocking(_this); //Markus: guess why :-)
|
||||
DisableKeyBlocking(_this);
|
||||
RedrawWindowL(_this);
|
||||
break;
|
||||
case EEventFocusLost: /* SDL window lost focus */
|
||||
|
||||
@@ -106,11 +106,16 @@ int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * forma
|
||||
{
|
||||
phdata->NGAGE_FrameBuffer += 32;
|
||||
}
|
||||
/*if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 12)
|
||||
phdata->NGAGE_FrameBuffer += 16 * 2;
|
||||
if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 16)
|
||||
phdata->NGAGE_FrameBuffer += 16 * 2;
|
||||
*/
|
||||
#if 0
|
||||
if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 12)
|
||||
{
|
||||
phdata->NGAGE_FrameBuffer += 16 * 2;
|
||||
}
|
||||
if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 16)
|
||||
{
|
||||
phdata->NGAGE_FrameBuffer += 16 * 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Get draw device for updating the screen
|
||||
TScreenInfoV01 screenInfo2;
|
||||
@@ -367,11 +372,13 @@ void DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
|
||||
|
||||
TUint16* screenBuffer = (TUint16*)phdata->NGAGE_FrameBuffer;
|
||||
|
||||
/*if (phdata->NGAGE_ScreenOrientation == CFbsBitGc::EGraphicsOrientationRotated270)
|
||||
#if 0
|
||||
if (phdata->NGAGE_ScreenOrientation == CFbsBitGc::EGraphicsOrientationRotated270)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
else */
|
||||
else
|
||||
#endif
|
||||
{
|
||||
DirectDraw(_this, numrects, rects, screenBuffer);
|
||||
}
|
||||
@@ -385,7 +392,7 @@ void DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
|
||||
TInt aBy = rects[i].h;
|
||||
TRect rect2 = TRect(aAx, aAy, aBx, aBy);
|
||||
|
||||
phdata->NGAGE_DrawDevice->UpdateRegion(rect2); /* Should we update rects parameter area only?? */
|
||||
phdata->NGAGE_DrawDevice->UpdateRegion(rect2); /* Should we update rects parameter area only? */
|
||||
phdata->NGAGE_DrawDevice->Update();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user