author | zecke <zecke> | 2004-02-06 14:32:10 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-06 14:32:10 (UTC) |
commit | b033733924e5d3454bb0a810c6a70d4ff0531d2b (patch) (unidiff) | |
tree | cafe130296468840db062af4a3335572804ee1f3 /noncore/games/parashoot/cannon.cpp | |
parent | f60cbb888e72b3eaf49af6f72fa183e6d44ae389 (diff) | |
download | opie-b033733924e5d3454bb0a810c6a70d4ff0531d2b.zip opie-b033733924e5d3454bb0a810c6a70d4ff0531d2b.tar.gz opie-b033733924e5d3454bb0a810c6a70d4ff0531d2b.tar.bz2 |
Funny how much bugs one can introduce when importing Qtopia stuff.
Fixed a couple of possible sigsegv, uninitialized variables
Diffstat (limited to 'noncore/games/parashoot/cannon.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/parashoot/cannon.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/noncore/games/parashoot/cannon.cpp b/noncore/games/parashoot/cannon.cpp index 3c0a5fe..5671351 100644 --- a/noncore/games/parashoot/cannon.cpp +++ b/noncore/games/parashoot/cannon.cpp | |||
@@ -1,7 +1,7 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the 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 |
@@ -18,7 +18,7 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qpe/resource.h> | 21 | #include <qtopia/resource.h> |
22 | 22 | ||
23 | #include <qregexp.h> | 23 | #include <qregexp.h> |
24 | 24 | ||
@@ -38,10 +38,9 @@ shotsfired=0; | |||
38 | cannonarray->readPixmaps(c0,17); | 38 | cannonarray->readPixmaps(c0,17); |
39 | setSequence(cannonarray); | 39 | setSequence(cannonarray); |
40 | setFrame(index); | 40 | setFrame(index); |
41 | move(canvas->width()/2-20, canvas->height()-32); | 41 | |
42 | // co ords for barrel of cannon when upright | 42 | reposition(); |
43 | barrelypos = canvas->height()-32; | 43 | |
44 | barrelxpos = canvas->width()/2; | ||
45 | movedir = NoDir; | 44 | movedir = NoDir; |
46 | moveDelay = 0; | 45 | moveDelay = 0; |
47 | setAnimated(TRUE); | 46 | setAnimated(TRUE); |
@@ -138,3 +137,14 @@ int Cannon::rtti() const | |||
138 | { | 137 | { |
139 | return cannon_rtti; | 138 | return cannon_rtti; |
140 | } | 139 | } |
140 | |||
141 | void Cannon::reposition(void) | ||
142 | { | ||
143 | move(canvas()->width()/2-20, canvas()->height()-32); | ||
144 | // co ords for barrel of cannon when upright | ||
145 | barrelypos = canvas()->height()-32; | ||
146 | barrelxpos = canvas()->width()/2; | ||
147 | |||
148 | setFrame(index); | ||
149 | setCoords(); | ||
150 | } | ||