mirror of https://github.com/stella-emu/stella.git
Checks are now performed when attempting to open a window smaller than
320x240 (the minimum that Stella supports). On 'small' systems using 1x video mode, this means most NTSC games will open in a window of size of 320x240, even though the native size is normally 320x210 (or so). In these cases, the image will be centered vertically. Added FrameBuffer::invalidate(), used to signal that the complete framebuffer can be trashed and entirely written over. This is only active in software mode for now, where it fixes 'overdraw' problems with 320x240 dialogs drawn underneath 320x210 TIA images. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1937 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
7ecd5ceac2
commit
c12a2e6043
|
@ -450,6 +450,12 @@ cerr << "dimensions: " << (fullScreen() ? "(full)" : "") << endl
|
|||
return true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FrameBufferGL::invalidate()
|
||||
{
|
||||
// TODO - add code for this
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FrameBufferGL::drawTIA(bool fullRedraw)
|
||||
{
|
||||
|
|
|
@ -145,6 +145,13 @@ class FrameBufferGL : public FrameBuffer
|
|||
*/
|
||||
bool setVidMode(VideoMode& mode);
|
||||
|
||||
/**
|
||||
This method is called to invalidate the contents of the entire
|
||||
framebuffer (ie, mark the current content as invalid, and erase it on
|
||||
the next drawing pass).
|
||||
*/
|
||||
void invalidate();
|
||||
|
||||
/**
|
||||
This method is called to create a surface compatible with the one
|
||||
currently in use, but having the given dimensions.
|
||||
|
|
|
@ -138,6 +138,13 @@ bool FrameBufferSoft::setVidMode(VideoMode& mode)
|
|||
return true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FrameBufferSoft::invalidate()
|
||||
{
|
||||
if(myScreen)
|
||||
SDL_FillRect(myScreen, NULL, 0);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FrameBufferSoft::drawTIA(bool fullRedraw)
|
||||
{
|
||||
|
@ -330,7 +337,7 @@ void FrameBufferSoft::drawTIA(bool fullRedraw)
|
|||
uInt8 v = currentFrame[bufofs];
|
||||
uInt8 w = previousFrame[bufofs];
|
||||
uInt8 a, b, c;
|
||||
uInt32 pixel = myAvgPalette[v][w];
|
||||
uInt32 pixel = myAvgPalette[v][w];
|
||||
if(SDL_BYTEORDER == SDL_LIL_ENDIAN)
|
||||
{
|
||||
a = (pixel & myFormat->Bmask) >> myFormat->Bshift;
|
||||
|
|
|
@ -115,6 +115,13 @@ class FrameBufferSoft : public FrameBuffer
|
|||
*/
|
||||
bool setVidMode(VideoMode& mode);
|
||||
|
||||
/**
|
||||
This method is called to invalidate the contents of the entire
|
||||
framebuffer (ie, mark the current content as invalid, and erase it on
|
||||
the next drawing pass).
|
||||
*/
|
||||
void invalidate();
|
||||
|
||||
/**
|
||||
This method is called to create a surface compatible with the one
|
||||
currently in use, but having the given dimensions.
|
||||
|
|
|
@ -417,6 +417,7 @@ void FrameBuffer::refresh()
|
|||
// This method is in essence a FULL refresh, putting all rendering
|
||||
// buffers in a known, fully redrawn state
|
||||
|
||||
invalidate();
|
||||
bool doubleBuffered = (type() == kGLBuffer);
|
||||
switch(myOSystem->eventHandler().state())
|
||||
{
|
||||
|
@ -913,8 +914,17 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FrameBuffer::addVidMode(VideoMode& mode)
|
||||
{
|
||||
// The are minimum size requirements on a screen, no matter is in fullscreen
|
||||
// or windowed mode
|
||||
// Various part of the UI system depend on having at least 320x240 pixels
|
||||
// available, so we must enforce it here
|
||||
|
||||
// Windowed modes can be sized exactly as required, since there's normally
|
||||
// no restriction on window size (up the maximum size)
|
||||
// no restriction on window size (between the minimum and maximum size)
|
||||
mode.screen_w = BSPF_max(mode.screen_w, 320u);
|
||||
mode.screen_h = BSPF_max(mode.screen_h, 240u);
|
||||
mode.image_x = (mode.screen_w - mode.image_w) >> 1;
|
||||
mode.image_y = (mode.screen_h - mode.image_h) >> 1;
|
||||
myWindowedModeList.add(mode);
|
||||
|
||||
// There are often stricter requirements on fullscreen modes, and they're
|
||||
|
@ -928,8 +938,8 @@ void FrameBuffer::addVidMode(VideoMode& mode)
|
|||
{
|
||||
// Auto-calculate 'smart' centering; platform-specific framebuffers are
|
||||
// free to ignore or augment it
|
||||
mode.screen_w = res[i].width;
|
||||
mode.screen_h = res[i].height;
|
||||
mode.screen_w = BSPF_max(res[i].width, 320u);
|
||||
mode.screen_h = BSPF_max(res[i].height, 240u);
|
||||
mode.image_x = (mode.screen_w - mode.image_w) >> 1;
|
||||
mode.image_y = (mode.screen_h - mode.image_h) >> 1;
|
||||
break;
|
||||
|
|
|
@ -380,6 +380,13 @@ class FrameBuffer
|
|||
*/
|
||||
virtual bool setVidMode(VideoMode& mode) = 0;
|
||||
|
||||
/**
|
||||
This method is called to invalidate the contents of the entire
|
||||
framebuffer (ie, mark the current content as invalid, and erase it on
|
||||
the next drawing pass).
|
||||
*/
|
||||
virtual void invalidate() = 0;
|
||||
|
||||
/**
|
||||
This method is called to create a surface compatible with the one
|
||||
currently in use, but having the given dimensions.
|
||||
|
|
Loading…
Reference in New Issue