diff --git a/src/common/FBSurfaceSDL2.cxx b/src/common/FBSurfaceSDL2.cxx index 2e9c2965c..e7e79a2b5 100644 --- a/src/common/FBSurfaceSDL2.cxx +++ b/src/common/FBSurfaceSDL2.cxx @@ -122,8 +122,8 @@ void FBSurfaceSDL2::setVisible(bool visible) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FBSurfaceSDL2::translateCoords(Int32& x, Int32& y) const { - x -= myDstR.x; - y -= myDstR.y; + x -= myDstR.x; x /= myDstR.w / mySrcR.w; + y -= myDstR.y; y /= myDstR.h / mySrcR.h; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -210,9 +210,10 @@ void FBSurfaceSDL2::createSurface(uInt32 width, uInt32 height, // We start out with the src and dst rectangles containing the same // dimensions, indicating no scaling or re-positioning - mySrcR.x = mySrcR.y = myDstR.x = myDstR.y = 0; - mySrcR.w = myDstR.w = width; - mySrcR.h = myDstR.h = height; + setSrcPos(0, 0); + setDstPos(0, 0); + setSrcSize(width, height); + setDstSize(width, height); //////////////////////////////////////////////////// // These *must* be set for the parent class diff --git a/src/emucore/FBSurface.hxx b/src/emucore/FBSurface.hxx index 2f97a4bcc..fbb31d6d7 100644 --- a/src/emucore/FBSurface.hxx +++ b/src/emucore/FBSurface.hxx @@ -85,9 +85,9 @@ class FBSurface This method should be called to draw a line. @param x The first x coordinate - @param y The y coordinate + @param y The first y coordinate @param x2 The second x coordinate - @param xy The second y coordinate + @param y2 The second y coordinate @param color The color of the line */ virtual void line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, uInt32 color); @@ -149,14 +149,14 @@ class FBSurface uInt32 h = 8); /** - This method should be called to draw the bitmap image. + This method should be called to draw the bitmap image. - @param bitmap The data to draw - @param x The x coordinate - @param y The y coordinate - @param color The color of the bitmap - @param w The width of the data image - @param h The height of the data image + @param bitmap The data to draw + @param x The x coordinate + @param y The y coordinate + @param color The color of the bitmap + @param w The width of the data image + @param h The height of the data image */ virtual void drawBitmap(uInt32* bitmap, uInt32 x, uInt32 y, uInt32 color, uInt32 w, uInt32 h); diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index 811f5615a..f9042b5f5 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -116,7 +116,7 @@ void DialogContainer::draw(bool full) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DialogContainer::addDialog(Dialog* d) { - GUI::Rect r = myOSystem.frameBuffer().imageRect(); + const GUI::Rect& r = myOSystem.frameBuffer().imageRect(); if(uInt32(d->getWidth()) > r.width() || uInt32(d->getHeight()) > r.height()) myOSystem.frameBuffer().showMessage( "Unable to show dialog box; resize current window");