From 827dcfaf6fad3cc73881c3c8be32a9519e218884 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Tue, 10 May 2011 09:26:39 +0000 Subject: [PATCH] pcsx2: linux: take some margins for the height of font (avoid top/bottom cut) cmake: * disable fomit-frame-pointer which cause crash with gcc-4.6 (it was not enabled by default but now I'm sure people will not enable it ;) ) * Try harder to pick the 32bits configuration for wx in a 64bits environment (opensuse/fedora). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4641 96395faa-99c1-11dd-bbfe-3dabce05a288 --- cmake/SearchForStuff.cmake | 12 ++++++++++-- common/src/Utilities/wxHelpers.cpp | 6 ++++++ pcsx2/CMakeLists.txt | 4 ++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 57a87773e1..6b104f9f5d 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -168,8 +168,16 @@ if(wxWidgets_FOUND) # Force the use of 32 bit library configuration on # 64 bits machine with 32 bits library in /usr/lib32 if(CMAKE_SIZEOF_VOID_P MATCHES "8" AND EXISTS "/usr/lib32") - STRING(REGEX REPLACE "/usr/lib/wx" "/usr/lib32/wx" - wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") + if (EXISTS "/usr/lib32") + # Debian/ubuntu. 64b in /usr/lib and 32b in /usr/lib32 + STRING(REGEX REPLACE "/usr/lib/wx" "/usr/lib32/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") + # I'm sure someone did it! 64b in /usr/lib64 and 32b in /usr/lib32 + STRING(REGEX REPLACE "/usr/lib64/wx" "/usr/lib32/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") + endif (EXISTS "/usr/lib32") + if (EXISTS "/usr/lib") + # Fedora/Open suse. 64b in /usr/lib64 and 32b in /usr/lib + STRING(REGEX REPLACE "/usr/lib64/wx" "/usr/lib/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") + endif (EXISTS "/usr/lib") endif(CMAKE_SIZEOF_VOID_P MATCHES "8" AND EXISTS "/usr/lib32") endif(Linux) diff --git a/common/src/Utilities/wxHelpers.cpp b/common/src/Utilities/wxHelpers.cpp index cef80ffbb4..3d00dcadc7 100644 --- a/common/src/Utilities/wxHelpers.cpp +++ b/common/src/Utilities/wxHelpers.cpp @@ -474,7 +474,13 @@ int pxGetCharHeight( const wxWindow* wind, int rows ) if( !wind ) return 0; wxClientDC dc(wx_const_cast(wxWindow*, wind)); dc.SetFont( wind->GetFont() ); +#ifdef __LINUX__ + // It seems there is a bad detection of the size of the font (non standard dpi ???). Font are cut in top or bottom. + // Add a correction factor to leave enough room. Visualy 1.7 seems fine but feel free to tune it -- Gregory + return (dc.GetCharHeight() * 1.7 + 1 ) * rows; +#else return (dc.GetCharHeight() + 1 ) * rows; +#endif } int pxGetCharHeight( const wxWindow& wind, int rows ) diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index aba494727a..183c639221 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -8,6 +8,10 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) # set common flags set(CommonFlags + # GCC-4.6 crash pcsx2 during the binding of plugins at startup... + # Disable this optimization for the moment + -fno-omit-frame-pointer + # END GCC-4.6 -DLINUX_PRINT_SVN_NUMBER -pthread -fvisibility=hidden