summaryrefslogtreecommitdiff
path: root/noncore/games/go
Unidiff
Diffstat (limited to 'noncore/games/go') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/go/go.pro15
-rw-r--r--noncore/games/go/gowidget.cpp9
2 files changed, 12 insertions, 12 deletions
diff --git a/noncore/games/go/go.pro b/noncore/games/go/go.pro
index b73bbb0..72425a5 100644
--- a/noncore/games/go/go.pro
+++ b/noncore/games/go/go.pro
@@ -1,19 +1,18 @@
1 CONFIG = qt warn_on quick-app 1 CONFIG = qt warn_on quick-app
2 HEADERS = amigo.h \ 2 HEADERS = amigo.h \
3 go.h \ 3 go.h \
4 goplayutils.h \ 4 goplayutils.h \
5 gowidget.h 5 gowidget.h
6 SOURCES = amigo.c \ 6 SOURCES = amigo.c \
7 goplayer.c \ 7 goplayer.c \
8 goplayutils.c \ 8 goplayutils.c \
9 killable.c \ 9 killable.c \
10 gowidget.cpp \ 10 gowidget.cpp \
11 main.cpp 11 main.cpp
12INCLUDEPATH += $(OPIEDIR)/include 12INCLUDEPATH += $(OPIEDIR)/include
13 DEPENDPATH+= $(OPIEDIR)/include 13 DEPENDPATH+= $(OPIEDIR)/include
14LIBS += -lqpe -lopiecore2 14LIBS += -lqpe -lopiecore2
15 TARGET = go 15 TARGET = go
16 16
17 17
18
19include ( $(OPIEDIR)/include.pro ) 18include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp
index d134540..ec03c1d 100644
--- a/noncore/games/go/gowidget.cpp
+++ b/noncore/games/go/gowidget.cpp
@@ -1,59 +1,60 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "gowidget.h" 21#include "gowidget.h"
22 22
23/* OPIE */
24#include <opie2/odebug.h>
23#include <qpe/config.h> 25#include <qpe/config.h>
24#include <qpe/resource.h> 26#include <qpe/resource.h>
27using namespace Opie::Core;
25 28
29/* QT */
26#include <qpainter.h> 30#include <qpainter.h>
27#include <qtoolbar.h> 31#include <qtoolbar.h>
28#include <qmenubar.h> 32#include <qmenubar.h>
29#include <qaction.h> 33#include <qaction.h>
30#include <qapplication.h> //processEvents() 34#include <qapplication.h> //processEvents()
31#include <qlabel.h> 35#include <qlabel.h>
32 36
33//#include <stdio.h>
34
35
36static const enum bVal computer_color = BLACK; 37static const enum bVal computer_color = BLACK;
37 38
38static int current_handicap = 1; 39static int current_handicap = 1;
39 40
40static QBrush *goBrush; 41static QBrush *goBrush;
41//static QImage *newBlackStone; 42//static QImage *newBlackStone;
42//static QImage *blackStone; 43//static QImage *blackStone;
43//static QImage *whiteStone; 44//static QImage *whiteStone;
44static QPixmap *newBlackStone; 45static QPixmap *newBlackStone;
45static QPixmap *blackStone; 46static QPixmap *blackStone;
46static QPixmap *whiteStone; 47static QPixmap *whiteStone;
47 48
48static bool smallStones = FALSE; 49static bool smallStones = FALSE;
49 50
50GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) : 51GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) :
51 QMainWindow( parent, name, fl ) 52 QMainWindow( parent, name, fl )
52{ 53{
53 setToolBarsMovable( FALSE ); 54 setToolBarsMovable( FALSE );
54 GoWidget *go = new GoWidget(this); 55 GoWidget *go = new GoWidget(this);
55 56
56 setCentralWidget(go); 57 setCentralWidget(go);
57 toolbar = new QToolBar(this); 58 toolbar = new QToolBar(this);
58 toolbar->setHorizontalStretchable( TRUE ); 59 toolbar->setHorizontalStretchable( TRUE );
59 addToolBar(toolbar); 60 addToolBar(toolbar);
@@ -427,34 +428,34 @@ void GoWidget::setTwoplayer( bool b )
427{ 428{
428 twoplayer = b; 429 twoplayer = b;
429} 430}
430 431
431void GoWidget::setHandicap( int h ) 432void GoWidget::setHandicap( int h )
432{ 433{
433 current_handicap = h; 434 current_handicap = h;
434} 435}
435 436
436 437
437extern "C" { 438extern "C" {
438 439
439 voidremovestone(short x, short y) 440 voidremovestone(short x, short y)
440{ 441{
441 GoWidget::self->removeStone(x,y); 442 GoWidget::self->removeStone(x,y);
442} 443}
443 444
444 voidplacestone (enum bVal c, short x, short y ) 445 voidplacestone (enum bVal c, short x, short y )
445{ 446{
446 GoWidget::self->placeStone(c,x,y); 447 GoWidget::self->placeStone(c,x,y);
447} 448}
448 449
449 voidintrMoveReport(enum bVal c ,char *coord ,char *reason ) 450 voidintrMoveReport(enum bVal c ,char *coord ,char *reason )
450{ 451{
451 qDebug( "intrMoveReport colour %d, %s %s", c, coord, reason ); 452 odebug << "intrMoveReport colour " << c << ", " << coord << " " << reason << "" << oendl;
452} 453}
453 454
454 voidintrPrisonerReport( short blackcnt, short whitecnt ) 455 voidintrPrisonerReport( short blackcnt, short whitecnt )
455{ 456{
456 GoWidget::self->reportPrisoners(blackcnt,whitecnt); 457 GoWidget::self->reportPrisoners(blackcnt,whitecnt);
457} 458}
458 459
459} 460}
460 461