Added missing GraphicOptions help text, re-added F4 fullscreen and F5 detail toggles, fixed texel-pixel alignment in Sprite, BitmapText
This commit is contained in:
@@ -194,10 +194,13 @@ void BitmapText::DrawPrimitives()
|
||||
// Offset so that pixels are aligned to texels
|
||||
// Offset by -0.5, -0.5 if 640x480
|
||||
// Offset by -1.0, -1.0 if 320x240
|
||||
DISPLAY->TranslateLocal(
|
||||
-0.5f*SCREEN_WIDTH/(float)PREFSMAN->m_iDisplayWidth,
|
||||
-0.5f*SCREEN_HEIGHT/(float)PREFSMAN->m_iDisplayHeight,
|
||||
0 );
|
||||
// 11/12/2002: Why in the world is this not needed with the OpenGL renderer?
|
||||
// We're using the exact same orthographic projection transform. Anyway, things
|
||||
// are perfectly aligned without this TranslateLocal
|
||||
// DISPLAY->TranslateLocal(
|
||||
// -0.5f*SCREEN_WIDTH/(float)PREFSMAN->m_iDisplayWidth,
|
||||
// -0.5f*SCREEN_HEIGHT/(float)PREFSMAN->m_iDisplayHeight,
|
||||
// 0 );
|
||||
|
||||
if( m_iNumLines == 0 )
|
||||
return;
|
||||
|
||||
@@ -200,10 +200,13 @@ void Sprite::DrawPrimitives()
|
||||
// Offset so that pixels are aligned to texels
|
||||
// Offset by -0.5, -0.5 if 640x480
|
||||
// Offset by -1.0, -1.0 if 320x240
|
||||
DISPLAY->TranslateLocal(
|
||||
-0.5f*SCREEN_WIDTH/(float)PREFSMAN->m_iDisplayWidth,
|
||||
-0.5f*SCREEN_HEIGHT/(float)PREFSMAN->m_iDisplayHeight,
|
||||
0 );
|
||||
// 11/12/2002: Why in the world is this not needed with the OpenGL renderer?
|
||||
// We're using the exact same orthographic projection transform. Anyway, things
|
||||
// are perfectly aligned without this TranslateLocal
|
||||
// DISPLAY->TranslateLocal(
|
||||
// -0.5f*SCREEN_WIDTH/(float)PREFSMAN->m_iDisplayWidth,
|
||||
// -0.5f*SCREEN_HEIGHT/(float)PREFSMAN->m_iDisplayHeight,
|
||||
// 0 );
|
||||
|
||||
// use m_temp_* variables to draw the object
|
||||
RectF quadVerticies;
|
||||
|
||||
@@ -460,17 +460,45 @@ int main(int argc, char* argv[])
|
||||
InputEventType type = ieArray[i].type;
|
||||
|
||||
/* ALT-F4 -> quit (better place for this? in ScreenManager perhaps?) */
|
||||
if(type == IET_FIRST_PRESS &&
|
||||
DeviceI == DeviceInput(DEVICE_KEYBOARD, DIK_F4) &&
|
||||
(INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, DIK_RMENU)) ||
|
||||
INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, DIK_LMENU)) ) )
|
||||
/* Nah. this is fine. -Chris */
|
||||
if(type == IET_FIRST_PRESS && DeviceI == DeviceInput(DEVICE_KEYBOARD, DIK_F4))
|
||||
{
|
||||
SDL_Event *event;
|
||||
event = (SDL_Event *) malloc(sizeof(event));
|
||||
event->type = SDL_QUIT;
|
||||
SDL_PushEvent(event);
|
||||
continue;
|
||||
if( INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, DIK_RMENU)) ||
|
||||
INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, DIK_LMENU)) )
|
||||
{
|
||||
// pressed Alt+F4
|
||||
SDL_Event *event;
|
||||
event = (SDL_Event *) malloc(sizeof(event));
|
||||
event->type = SDL_QUIT;
|
||||
SDL_PushEvent(event);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// pressed just F4
|
||||
PREFSMAN->m_bWindowed = !PREFSMAN->m_bWindowed;
|
||||
ApplyGraphicOptions();
|
||||
// fall through
|
||||
}
|
||||
}
|
||||
else if( type == IET_FIRST_PRESS && DeviceI == DeviceInput(DEVICE_KEYBOARD, DIK_F5))
|
||||
{
|
||||
// pressed F5. Toggle detail.
|
||||
if(PREFSMAN->m_iDisplayWidth != 640)
|
||||
{
|
||||
PREFSMAN->m_iDisplayWidth = 640;
|
||||
PREFSMAN->m_iDisplayHeight = 480;
|
||||
ApplyGraphicOptions();
|
||||
}
|
||||
else
|
||||
{
|
||||
PREFSMAN->m_iDisplayWidth = 320;
|
||||
PREFSMAN->m_iDisplayHeight = 240;
|
||||
ApplyGraphicOptions();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
GameInput GameI;
|
||||
MenuInput MenuI;
|
||||
|
||||
Reference in New Issue
Block a user