summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/backgammon/backgammon.pro38
-rw-r--r--noncore/games/backgammon/backgammonview.h3
-rw-r--r--noncore/games/backgammon/moveengine.cpp2
3 files changed, 22 insertions, 21 deletions
diff --git a/noncore/games/backgammon/backgammon.pro b/noncore/games/backgammon/backgammon.pro
index 6f77a14..4be9491 100644
--- a/noncore/games/backgammon/backgammon.pro
+++ b/noncore/games/backgammon/backgammon.pro
@@ -1,34 +1,34 @@
1 TEMPLATE = app 1 TEMPLATE = app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 3
4HEADERS = backgammon.h \ 4HEADERS = backgammon.h \
5 canvasimageitem.h \ 5 backgammonview.h \
6 themedialog.h \ 6 canvasimageitem.h \
7 moveengine.h \ 7 themedialog.h \
8 filedialog.h \ 8 moveengine.h \
9 playerdialog.h \ 9 filedialog.h \
10 aidialog.h \ 10 playerdialog.h \
11 rulesdialog.h \ 11 aidialog.h \
12 displaydialog.h \ 12 rulesdialog.h \
13 definition.h 13 definition.h
14 14
15SOURCES = main.cpp \ 15SOURCES = main.cpp \
16 backgammon.cpp \ 16 backgammon.cpp \
17 canvasimageitem.cpp \ 17 backgammonview.cpp \
18 themedialog.cpp \ 18 canvasimageitem.cpp \
19 moveengine.cpp \ 19 themedialog.cpp \
20 filedialog.cpp \ 20 moveengine.cpp \
21 playerdialog.cpp \ 21 filedialog.cpp \
22 aidialog.cpp \ 22 playerdialog.cpp \
23 rulesdialog.cpp \ 23 aidialog.cpp \
24 displaydialog.cpp \ 24 rulesdialog.cpp \
25 definition.cpp 25 definition.cpp
26 26
27 TARGET = backgammon 27 TARGET = backgammon
28 INCLUDEPATH+= $(OPIEDIR)/include 28 INCLUDEPATH+= $(OPIEDIR)/include
29 DEPENDPATH+= $(OPIEDIR)/include 29 DEPENDPATH+= $(OPIEDIR)/include
30 LIBS += -lqpe -lstdc++ 30 LIBS += -lqpe -lstdc++
31 DESTDIR = $(OPIEDIR)/bin 31 DESTDIR = $(OPIEDIR)/bin
32 32
33 33
34include ( $(OPIEDIR)/include.pro ) 34include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/backgammon/backgammonview.h b/noncore/games/backgammon/backgammonview.h
index 52508e2..81f1973 100644
--- a/noncore/games/backgammon/backgammonview.h
+++ b/noncore/games/backgammon/backgammonview.h
@@ -1,18 +1,19 @@
1#ifndef BACKGAMMON_VIEW_H 1#ifndef BACKGAMMON_VIEW_H
2#define BACKGAMMON_VIEW_H 2#define BACKGAMMON_VIEW_H
3 3
4#include <qcanvas.h> 4#include <qcanvas.h>
5 5
6class BackGammonView : public QCanvasView 6class BackGammonView : public QCanvasView
7{ 7{
8 Q_OBJECT 8 Q_OBJECT
9public: 9public:
10 BackGammonView(QCanvas* canvas,QWidget* parent); 10 BackGammonView(QCanvas* canvas,QWidget* parent);
11 ~BackGammonView(); 11 ~BackGammonView();
12signals: 12signals:
13 void mouse(int,int); 13 void mouse(int,int);
14private: 14private:
15 void contentsMousePressEvent(QMouseEvent* e); 15 void contentsMousePressEvent(QMouseEvent* e);
16}; 16};
17 17
18#endif //BACKGAMMON_VIEW_H \ No newline at end of file 18#endif //BACKGAMMON_VIEW_H
19
diff --git a/noncore/games/backgammon/moveengine.cpp b/noncore/games/backgammon/moveengine.cpp
index 009c449..37b73a6 100644
--- a/noncore/games/backgammon/moveengine.cpp
+++ b/noncore/games/backgammon/moveengine.cpp
@@ -1,29 +1,29 @@
1#include "moveengine.h" 1#include "moveengine.h"
2 2
3#include <qmessagebox.h> 3#include <qmessagebox.h>
4
5#include <qtimer.h> 4#include <qtimer.h>
5#include <stdlib.h>
6 6
7MoveEngine::MoveEngine() 7MoveEngine::MoveEngine()
8 : QObject() 8 : QObject()
9{ 9{
10 int offset=7; 10 int offset=7;
11 int a=0; //counter variable 11 int a=0; //counter variable
12 int xfill[]={210,185,170,155,140,125,110,85,70,55,40,25,10,10,25,40,55,70,85,110,125,140,155,170,185,210}; 12 int xfill[]={210,185,170,155,140,125,110,85,70,55,40,25,10,10,25,40,55,70,85,110,125,140,155,170,185,210};
13 for(a=0;a<26;a++) 13 for(a=0;a<26;a++)
14 { 14 {
15 x_coord[a]=xfill[a]; 15 x_coord[a]=xfill[a];
16 } 16 }
17 17
18 int yfill[]={10,25,40,55,70,10+offset,25+offset,40+offset,55+offset,25,40,55, 25+offset,40+offset,40}; 18 int yfill[]={10,25,40,55,70,10+offset,25+offset,40+offset,55+offset,25,40,55, 25+offset,40+offset,40};
19 int zfill[]={1,1,1,1,1,2,2,2,2,3,3,3,4,4,5}; 19 int zfill[]={1,1,1,1,1,2,2,2,2,3,3,3,4,4,5};
20 for(a=0;a<15;a++) 20 for(a=0;a<15;a++)
21 { 21 {
22 yup_coord[a]=yfill[a]; 22 yup_coord[a]=yfill[a];
23 ylow_coord[a]=185-(yfill[a]); 23 ylow_coord[a]=185-(yfill[a]);
24 z_coord[a]=zfill[a]; 24 z_coord[a]=zfill[a];
25 } 25 }
26 for(a=0;a<5;a++) 26 for(a=0;a<5;a++)
27 { 27 {
28 if(a<3) 28 if(a<3)
29 { 29 {