author | simon <simon> | 2002-04-30 14:49:30 (UTC) |
---|---|---|
committer | simon <simon> | 2002-04-30 14:49:30 (UTC) |
commit | c959b0c2170d2c12f93f5fa04ff02ca4c7c0ef4a (patch) (unidiff) | |
tree | e85e8136aeb87c582e958a48f8428765ef7b99be | |
parent | a0cdb6f85e270e20bd5383e980df9dcf862a93ce (diff) | |
download | opie-c959b0c2170d2c12f93f5fa04ff02ca4c7c0ef4a.zip opie-c959b0c2170d2c12f93f5fa04ff02ca4c7c0ef4a.tar.gz opie-c959b0c2170d2c12f93f5fa04ff02ca4c7c0ef4a.tar.bz2 |
- resolved clash between const char *name and struct utsname name
-rw-r--r-- | noncore/games/qasteroids/toplevel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/games/qasteroids/toplevel.cpp b/noncore/games/qasteroids/toplevel.cpp index 090099f..71daf60 100644 --- a/noncore/games/qasteroids/toplevel.cpp +++ b/noncore/games/qasteroids/toplevel.cpp | |||
@@ -1,184 +1,184 @@ | |||
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 | * KAsteroids - Copyright (c) Martin R. Jones 1997 | 20 | * KAsteroids - Copyright (c) Martin R. Jones 1997 |
21 | * | 21 | * |
22 | * Part of the KDE project | 22 | * Part of the KDE project |
23 | */ | 23 | */ |
24 | //--- toplevel.cpp --- | 24 | //--- toplevel.cpp --- |
25 | 25 | ||
26 | #include "toplevel.h" | 26 | #include "toplevel.h" |
27 | #include "ledmeter.h" | 27 | #include "ledmeter.h" |
28 | 28 | ||
29 | #include <qpe/qpeapplication.h> | 29 | #include <qpe/qpeapplication.h> |
30 | #include <qpe/resource.h> | 30 | #include <qpe/resource.h> |
31 | 31 | ||
32 | #include <qaccel.h> | 32 | #include <qaccel.h> |
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qlcdnumber.h> | 35 | #include <qlcdnumber.h> |
36 | #include <qpushbutton.h> | 36 | #include <qpushbutton.h> |
37 | 37 | ||
38 | #include <sys/utsname.h> | 38 | #include <sys/utsname.h> |
39 | 39 | ||
40 | 40 | ||
41 | #define SB_SCORE1 | 41 | #define SB_SCORE1 |
42 | #define SB_LEVEL2 | 42 | #define SB_LEVEL2 |
43 | #define SB_SHIPS3 | 43 | #define SB_SHIPS3 |
44 | 44 | ||
45 | struct SLevel | 45 | struct SLevel |
46 | { | 46 | { |
47 | int nrocks; | 47 | int nrocks; |
48 | double rockSpeed; | 48 | double rockSpeed; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #define MAX_LEVELS16 | 51 | #define MAX_LEVELS16 |
52 | 52 | ||
53 | SLevel levels[MAX_LEVELS] = | 53 | SLevel levels[MAX_LEVELS] = |
54 | { | 54 | { |
55 | { 1, 0.4 }, | 55 | { 1, 0.4 }, |
56 | { 1, 0.6 }, | 56 | { 1, 0.6 }, |
57 | { 2, 0.5 }, | 57 | { 2, 0.5 }, |
58 | { 2, 0.7 }, | 58 | { 2, 0.7 }, |
59 | { 2, 0.8 }, | 59 | { 2, 0.8 }, |
60 | { 3, 0.6 }, | 60 | { 3, 0.6 }, |
61 | { 3, 0.7 }, | 61 | { 3, 0.7 }, |
62 | { 3, 0.8 }, | 62 | { 3, 0.8 }, |
63 | { 4, 0.6 }, | 63 | { 4, 0.6 }, |
64 | { 4, 0.7 }, | 64 | { 4, 0.7 }, |
65 | { 4, 0.8 }, | 65 | { 4, 0.8 }, |
66 | { 5, 0.7 }, | 66 | { 5, 0.7 }, |
67 | { 5, 0.8 }, | 67 | { 5, 0.8 }, |
68 | { 5, 0.9 }, | 68 | { 5, 0.9 }, |
69 | { 5, 1.0 } | 69 | { 5, 1.0 } |
70 | }; | 70 | }; |
71 | 71 | ||
72 | const char *soundEvents[] = | 72 | const char *soundEvents[] = |
73 | { | 73 | { |
74 | "ShipDestroyed", | 74 | "ShipDestroyed", |
75 | "RockDestroyed", | 75 | "RockDestroyed", |
76 | 0 | 76 | 0 |
77 | }; | 77 | }; |
78 | 78 | ||
79 | const char *soundDefaults[] = | 79 | const char *soundDefaults[] = |
80 | { | 80 | { |
81 | "Explosion.wav", | 81 | "Explosion.wav", |
82 | "ploop.wav", | 82 | "ploop.wav", |
83 | 0 | 83 | 0 |
84 | }; | 84 | }; |
85 | 85 | ||
86 | 86 | ||
87 | KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name ) | 87 | KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name ) |
88 | : QMainWindow( parent, name ) | 88 | : QMainWindow( parent, _name ) |
89 | { | 89 | { |
90 | setCaption( tr("Asteroids") ); | 90 | setCaption( tr("Asteroids") ); |
91 | QWidget *border = new QWidget( this ); | 91 | QWidget *border = new QWidget( this ); |
92 | border->setBackgroundColor( black ); | 92 | border->setBackgroundColor( black ); |
93 | setCentralWidget( border ); | 93 | setCentralWidget( border ); |
94 | 94 | ||
95 | QVBoxLayout *borderLayout = new QVBoxLayout( border ); | 95 | QVBoxLayout *borderLayout = new QVBoxLayout( border ); |
96 | 96 | ||
97 | QWidget *mainWin = new QWidget( border ); | 97 | QWidget *mainWin = new QWidget( border ); |
98 | borderLayout->addWidget( mainWin, 2, AlignHCenter ); | 98 | borderLayout->addWidget( mainWin, 2, AlignHCenter ); |
99 | 99 | ||
100 | view = new KAsteroidsView( mainWin ); | 100 | view = new KAsteroidsView( mainWin ); |
101 | connect( view, SIGNAL( shipKilled() ), SLOT( slotShipKilled() ) ); | 101 | connect( view, SIGNAL( shipKilled() ), SLOT( slotShipKilled() ) ); |
102 | connect( view, SIGNAL( rockHit(int) ), SLOT( slotRockHit(int) ) ); | 102 | connect( view, SIGNAL( rockHit(int) ), SLOT( slotRockHit(int) ) ); |
103 | connect( view, SIGNAL( rocksRemoved() ), SLOT( slotRocksRemoved() ) ); | 103 | connect( view, SIGNAL( rocksRemoved() ), SLOT( slotRocksRemoved() ) ); |
104 | connect( view, SIGNAL( updateVitals() ), SLOT( slotUpdateVitals() ) ); | 104 | connect( view, SIGNAL( updateVitals() ), SLOT( slotUpdateVitals() ) ); |
105 | 105 | ||
106 | QVBoxLayout *vb = new QVBoxLayout( mainWin ); | 106 | QVBoxLayout *vb = new QVBoxLayout( mainWin ); |
107 | QHBoxLayout *hb = new QHBoxLayout; | 107 | QHBoxLayout *hb = new QHBoxLayout; |
108 | QHBoxLayout *hbd = new QHBoxLayout; | 108 | QHBoxLayout *hbd = new QHBoxLayout; |
109 | vb->addLayout( hb ); | 109 | vb->addLayout( hb ); |
110 | 110 | ||
111 | QFont labelFont( "helvetica", 12 ); | 111 | QFont labelFont( "helvetica", 12 ); |
112 | QColorGroup grp( darkGreen, black, QColor( 128, 128, 128 ), | 112 | QColorGroup grp( darkGreen, black, QColor( 128, 128, 128 ), |
113 | QColor( 64, 64, 64 ), black, darkGreen, black ); | 113 | QColor( 64, 64, 64 ), black, darkGreen, black ); |
114 | QPalette pal( grp, grp, grp ); | 114 | QPalette pal( grp, grp, grp ); |
115 | 115 | ||
116 | mainWin->setPalette( pal ); | 116 | mainWin->setPalette( pal ); |
117 | 117 | ||
118 | QLabel *label; | 118 | QLabel *label; |
119 | label = new QLabel( tr("Score"), mainWin ); | 119 | label = new QLabel( tr("Score"), mainWin ); |
120 | label->setFont( labelFont ); | 120 | label->setFont( labelFont ); |
121 | label->setPalette( pal ); | 121 | label->setPalette( pal ); |
122 | // label->setFixedWidth( label->sizeHint().width() ); | 122 | // label->setFixedWidth( label->sizeHint().width() ); |
123 | hb->addWidget( label ); | 123 | hb->addWidget( label ); |
124 | 124 | ||
125 | scoreLCD = new QLCDNumber( 5, mainWin ); | 125 | scoreLCD = new QLCDNumber( 5, mainWin ); |
126 | scoreLCD->setFrameStyle( QFrame::NoFrame ); | 126 | scoreLCD->setFrameStyle( QFrame::NoFrame ); |
127 | scoreLCD->setSegmentStyle( QLCDNumber::Flat ); | 127 | scoreLCD->setSegmentStyle( QLCDNumber::Flat ); |
128 | scoreLCD->setFixedHeight( 16 ); | 128 | scoreLCD->setFixedHeight( 16 ); |
129 | scoreLCD->setPalette( pal ); | 129 | scoreLCD->setPalette( pal ); |
130 | hb->addWidget( scoreLCD ); | 130 | hb->addWidget( scoreLCD ); |
131 | hb->addStretch( 1 ); | 131 | hb->addStretch( 1 ); |
132 | 132 | ||
133 | label = new QLabel( tr("Level"), mainWin ); | 133 | label = new QLabel( tr("Level"), mainWin ); |
134 | label->setFont( labelFont ); | 134 | label->setFont( labelFont ); |
135 | label->setPalette( pal ); | 135 | label->setPalette( pal ); |
136 | // label->setFixedWidth( label->sizeHint().width() ); | 136 | // label->setFixedWidth( label->sizeHint().width() ); |
137 | hb->addWidget( label ); | 137 | hb->addWidget( label ); |
138 | 138 | ||
139 | levelLCD = new QLCDNumber( 2, mainWin ); | 139 | levelLCD = new QLCDNumber( 2, mainWin ); |
140 | levelLCD->setFrameStyle( QFrame::NoFrame ); | 140 | levelLCD->setFrameStyle( QFrame::NoFrame ); |
141 | levelLCD->setSegmentStyle( QLCDNumber::Flat ); | 141 | levelLCD->setSegmentStyle( QLCDNumber::Flat ); |
142 | levelLCD->setFixedHeight( 16 ); | 142 | levelLCD->setFixedHeight( 16 ); |
143 | levelLCD->setPalette( pal ); | 143 | levelLCD->setPalette( pal ); |
144 | hb->addWidget( levelLCD ); | 144 | hb->addWidget( levelLCD ); |
145 | hb->addStretch( 1 ); | 145 | hb->addStretch( 1 ); |
146 | 146 | ||
147 | label = new QLabel( tr("Ships"), mainWin ); | 147 | label = new QLabel( tr("Ships"), mainWin ); |
148 | label->setFont( labelFont ); | 148 | label->setFont( labelFont ); |
149 | // label->setFixedWidth( label->sizeHint().width() ); | 149 | // label->setFixedWidth( label->sizeHint().width() ); |
150 | label->setPalette( pal ); | 150 | label->setPalette( pal ); |
151 | hb->addWidget( label ); | 151 | hb->addWidget( label ); |
152 | 152 | ||
153 | shipsLCD = new QLCDNumber( 1, mainWin ); | 153 | shipsLCD = new QLCDNumber( 1, mainWin ); |
154 | shipsLCD->setFrameStyle( QFrame::NoFrame ); | 154 | shipsLCD->setFrameStyle( QFrame::NoFrame ); |
155 | shipsLCD->setSegmentStyle( QLCDNumber::Flat ); | 155 | shipsLCD->setSegmentStyle( QLCDNumber::Flat ); |
156 | shipsLCD->setFixedHeight( 16 ); | 156 | shipsLCD->setFixedHeight( 16 ); |
157 | shipsLCD->setPalette( pal ); | 157 | shipsLCD->setPalette( pal ); |
158 | hb->addWidget( shipsLCD ); | 158 | hb->addWidget( shipsLCD ); |
159 | 159 | ||
160 | // hb->addStrut( 14 ); | 160 | // hb->addStrut( 14 ); |
161 | 161 | ||
162 | vb->addWidget( view, 10 ); | 162 | vb->addWidget( view, 10 ); |
163 | 163 | ||
164 | // -- bottom layout: | 164 | // -- bottom layout: |
165 | vb->addLayout( hbd ); | 165 | vb->addLayout( hbd ); |
166 | 166 | ||
167 | QFont smallFont( "helvetica", 12 ); | 167 | QFont smallFont( "helvetica", 12 ); |
168 | hbd->addSpacing( 5 ); | 168 | hbd->addSpacing( 5 ); |
169 | 169 | ||
170 | /* | 170 | /* |
171 | label = new QLabel( tr( "T" ), mainWin ); | 171 | label = new QLabel( tr( "T" ), mainWin ); |
172 | label->setFont( smallFont ); | 172 | label->setFont( smallFont ); |
173 | label->setFixedWidth( label->sizeHint().width() ); | 173 | label->setFixedWidth( label->sizeHint().width() ); |
174 | label->setPalette( pal ); | 174 | label->setPalette( pal ); |
175 | hbd->addWidget( label ); | 175 | hbd->addWidget( label ); |
176 | 176 | ||
177 | teleportsLCD = new QLCDNumber( 1, mainWin ); | 177 | teleportsLCD = new QLCDNumber( 1, mainWin ); |
178 | teleportsLCD->setFrameStyle( QFrame::NoFrame ); | 178 | teleportsLCD->setFrameStyle( QFrame::NoFrame ); |
179 | teleportsLCD->setSegmentStyle( QLCDNumber::Flat ); | 179 | teleportsLCD->setSegmentStyle( QLCDNumber::Flat ); |
180 | teleportsLCD->setPalette( pal ); | 180 | teleportsLCD->setPalette( pal ); |
181 | teleportsLCD->setFixedHeight( 18 ); | 181 | teleportsLCD->setFixedHeight( 18 ); |
182 | hbd->addWidget( teleportsLCD ); | 182 | hbd->addWidget( teleportsLCD ); |
183 | 183 | ||
184 | hbd->addSpacing( 10 ); | 184 | hbd->addSpacing( 10 ); |