summaryrefslogtreecommitdiffstats
path: root/klickety/main.cpp
blob: 03aa22fdf5cbb47980db958694c3ec9b53105585 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "main.h"
#include "main.moc"

#include <tdelocale.h>
#include <tdeapplication.h>
#include <highscore/khighscore.h>
#include <tdeaboutdata.h>

#include "base/settings.h"
#include "piece.h"
#include "highscores.h"

//-----------------------------------------------------------------------------
const MainData MAIN_DATA = {
    "klickety",
    I18N_NOOP("Klickety"),
    I18N_NOOP("Klickety is an adaptation of the \"clickomania\" game"),
    "http://klickety.sourceforge.net/",
    I18N_NOOP("Removed blocks"),
    "1.0.3",
    "1.0.3 (5 August 2004)"
};

const uint HISTOGRAM_SIZE = 16;
const uint HISTOGRAM[HISTOGRAM_SIZE] = {
    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 20, 160
};

const BaseBoardInfo BASE_BOARD_INFO = {
    10, 16, false, // width, height, with pieces

    50,  // before remove time
    10,  // after removed time
    3,   // nb toggles
    7,   // nb partial fall stages

    0,   // nb arcade stages

    HISTOGRAM, HISTOGRAM_SIZE, true, // score is bound
};

KLFactory::KLFactory()
    : BaseFactory(MAIN_DATA, BASE_BOARD_INFO)
{
  _aboutData->addCredit("Dan Hill", I18N_NOOP("Icons"));
}


//-----------------------------------------------------------------------------
KLMainWindow::KLMainWindow()
{
    Field *field = static_cast<Field *>(_inter);
    buildGUI(field);
}

//-----------------------------------------------------------------------------
int main(int argc, char **argv)
{
    KHighscore::init(MAIN_DATA.appName);
    KLFactory flf;
    flf.init(argc, argv);

    KLPieceInfo pieceInfo;
    KLHighscores highscores;

    if ( kapp->isRestored() ) RESTORE(KLMainWindow)
    else {
        KLMainWindow *mw = new KLMainWindow;
        kapp->setMainWidget(mw);
        mw->show();
    }
	return kapp->exec();
}