Commit be42db9d authored by Johannes Bergmeier's avatar Johannes Bergmeier

- Changed a bit the naming in code for optional opengl support

- OpenGL-support can now be disable with commenting 2 lines
(can be used when qt-opengl is utterly broken like it was on my 
system)

svn path=/trunk/KDE/kdegames/ksudoku/; revision=813895
parent 15e24c1f
...@@ -15,8 +15,9 @@ ENDIF(DEBUG) ...@@ -15,8 +15,9 @@ ENDIF(DEBUG)
# enable OPENGL-support # enable OPENGL-support
if(OPENGL_FOUND AND QT_QTOPENGL_FOUND) if(OPENGL_FOUND AND QT_QTOPENGL_FOUND)
add_definitions(-DQT_OPENGL_SUPPORT) # commenting those two lines will remove OpenGL-based variants completely
set(KS_OBENGL_LIBS ${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES}) set(OPENGL_SUPPORT true)
add_definitions(-DOPENGL_SUPPORT)
endif(OPENGL_FOUND AND QT_QTOPENGL_FOUND) endif(OPENGL_FOUND AND QT_QTOPENGL_FOUND)
add_subdirectory( src ) add_subdirectory( src )
......
...@@ -23,10 +23,15 @@ kde4_add_executable(ksudoku ${ksudoku_SRCS}) ...@@ -23,10 +23,15 @@ kde4_add_executable(ksudoku ${ksudoku_SRCS})
target_link_libraries(ksudoku target_link_libraries(ksudoku
ksudoku_gui ksudoku_views ksudoku_logic ksudoku_gui ksudoku_views ksudoku_logic
kdegames kdegames
${KS_OBENGL_LIBS}
${KDE4_KIO_LIBS} ${KDE4_KNEWSTUFF2_LIBRARY} ${KDE4_KIO_LIBS} ${KDE4_KNEWSTUFF2_LIBRARY}
) )
if(OPENGL_SUPPORT)
target_link_libraries(ksudoku
${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES}
)
endif(OPENGL_SUPPORT)
install(TARGETS ksudoku ${INSTALL_TARGETS_DEFAULT_ARGS} ) install(TARGETS ksudoku ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### next target ############### ########### next target ###############
......
...@@ -165,7 +165,7 @@ void KSudoku::updateShapesList() ...@@ -165,7 +165,7 @@ void KSudoku::updateShapesList()
variant = new SudokuGame(i18n("Sudoku 25x25"), 25, m_gameVariants); variant = new SudokuGame(i18n("Sudoku 25x25"), 25, m_gameVariants);
variant->setDescription(i18n("Sudoku with 25 symbols")); variant->setDescription(i18n("Sudoku with 25 symbols"));
variant->setIcon("ksudoku-ksudoku_25x25"); variant->setIcon("ksudoku-ksudoku_25x25");
#ifdef QT_OPENGL_SUPPORT #ifdef OPENGL_SUPPORT
variant = new RoxdokuGame(i18n("Roxdoku 9 (3x3x3)"), 9, m_gameVariants); variant = new RoxdokuGame(i18n("Roxdoku 9 (3x3x3)"), 9, m_gameVariants);
variant->setDescription(i18n("The Rox 3D sudoku")); variant->setDescription(i18n("The Rox 3D sudoku"));
variant->setIcon("ksudoku-roxdoku_3x3x3"); variant->setIcon("ksudoku-roxdoku_3x3x3");
......
...@@ -8,14 +8,15 @@ set(ksudoku_views_SRCS ...@@ -8,14 +8,15 @@ set(ksudoku_views_SRCS
view2d.cpp view2d.cpp
) )
if(QT_QTOPENGL_FOUND) if(OPENGL_SUPPORT)
set(ksudoku_views_SRCS set(ksudoku_views_SRCS
${ksudoku_views_SRCS} ${ksudoku_views_SRCS}
roxdokuview.cpp roxdokuview.cpp
) )
endif(QT_QTOPENGL_FOUND) endif(OPENGL_SUPPORT)
kde4_add_library(ksudoku_views ${ksudoku_views_SRCS}) kde4_add_library(ksudoku_views ${ksudoku_views_SRCS})
# make sure settings.h is available (created in ksudoku_gui) # make sure settings.h is available (created in ksudoku_gui)
add_dependencies(ksudoku_views ksudoku_gui) add_dependencies(ksudoku_views ksudoku_gui)
...@@ -32,8 +32,10 @@ ...@@ -32,8 +32,10 @@
#include "sudoku_solver.h" #include "sudoku_solver.h"
#include "puzzle.h" #include "puzzle.h"
#ifdef OPENGL_SUPPORT
#include "roxdokuview.h" #include "roxdokuview.h"
#endif
#include "view2d.h" #include "view2d.h"
namespace ksudoku{ namespace ksudoku{
...@@ -64,7 +66,7 @@ void KsView::createView() { ...@@ -64,7 +66,7 @@ void KsView::createView() {
setWidget(new View2D(0, m_game, m_gameActions)); setWidget(new View2D(0, m_game, m_gameActions));
break; break;
} }
#ifdef QT_OPENGL_SUPPORT #ifdef OPENGL_SUPPORT
case roxdoku: { case roxdoku: {
setWidget(new RoxdokuView(m_game, 0, 0)); setWidget(new RoxdokuView(m_game, 0, 0));
break; break;
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#ifdef QT_OPENGL_SUPPORT
#include "roxdokuview.h" #include "roxdokuview.h"
#include "puzzle.h" #include "puzzle.h"
...@@ -261,13 +259,6 @@ void RoxdokuView::selectValue(int value) { ...@@ -261,13 +259,6 @@ void RoxdokuView::selectValue(int value) {
selected_number = value; selected_number = value;
} }
void RoxdokuView::enterValue(int value) {
if(selection < 0) return;
if(isDragging) releaseMouse();
m_game.setValue(selection, value);
}
void RoxdokuView::loadSettings() { void RoxdokuView::loadSettings() {
m_guidedMode = Settings::showErrors(); m_guidedMode = Settings::showErrors();
} }
...@@ -418,8 +409,5 @@ void RoxdokuView::paintGL() ...@@ -418,8 +409,5 @@ void RoxdokuView::paintGL()
} }
} }
#warning I AM A PUNK
#include "roxdokuview.moc" #include "roxdokuview.moc"
#else
#warning "Qt OpenGL support not found"
#endif
...@@ -99,7 +99,6 @@ public: ...@@ -99,7 +99,6 @@ public:
public slots: public slots:
void selectValue(int value); void selectValue(int value);
void enterValue(int value);
void settingsChanged(); void settingsChanged();
signals: signals:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment