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