author | sandman <sandman> | 2002-10-03 13:01:51 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-03 13:01:51 (UTC) |
commit | ee864e9e055fd23778a8e5dd3c35e3a29cded368 (patch) (unidiff) | |
tree | 4362efd44484c1f9f56104b46fab06e1e51af125 | |
parent | f254ef08b354327d70d80690eff84dda15e592fc (diff) | |
download | opie-ee864e9e055fd23778a8e5dd3c35e3a29cded368.zip opie-ee864e9e055fd23778a8e5dd3c35e3a29cded368.tar.gz opie-ee864e9e055fd23778a8e5dd3c35e3a29cded368.tar.bz2 |
TT fixed a bug in QCanvasPixmapArray in 2.3.4 and qasteroids relied on the
buggy behaviour
-rw-r--r-- | noncore/games/qasteroids/view.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/games/qasteroids/view.cpp b/noncore/games/qasteroids/view.cpp index ef08343..448a54a 100644 --- a/noncore/games/qasteroids/view.cpp +++ b/noncore/games/qasteroids/view.cpp | |||
@@ -41,72 +41,72 @@ | |||
41 | #define SHIP_STEPS 64 | 41 | #define SHIP_STEPS 64 |
42 | #define ROTATE_RATE 2 | 42 | #define ROTATE_RATE 2 |
43 | #define SHIELD_ON_COST 1 | 43 | #define SHIELD_ON_COST 1 |
44 | #define SHIELD_HIT_COST 30 | 44 | #define SHIELD_HIT_COST 30 |
45 | #define BRAKE_ON_COST 4 | 45 | #define BRAKE_ON_COST 4 |
46 | 46 | ||
47 | #define MAX_ROCK_SPEED 2.5 | 47 | #define MAX_ROCK_SPEED 2.5 |
48 | #define MAX_POWERUP_SPEED 1.5 | 48 | #define MAX_POWERUP_SPEED 1.5 |
49 | #define MAX_SHIP_SPEED 8 | 49 | #define MAX_SHIP_SPEED 8 |
50 | #define MAX_BRAKES 5 | 50 | #define MAX_BRAKES 5 |
51 | #define MAX_SHIELDS 5 | 51 | #define MAX_SHIELDS 5 |
52 | #define MAX_FIREPOWER 5 | 52 | #define MAX_FIREPOWER 5 |
53 | 53 | ||
54 | #define TEXT_SPEED 4 | 54 | #define TEXT_SPEED 4 |
55 | 55 | ||
56 | #define PI_X_2 6.283185307 | 56 | #define PI_X_2 6.283185307 |
57 | #ifndef M_PI | 57 | #ifndef M_PI |
58 | #define M_PI 3.141592654 | 58 | #define M_PI 3.141592654 |
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | struct | 61 | struct |
62 | { | 62 | { |
63 | int id; | 63 | int id; |
64 | const char *path; | 64 | const char *path; |
65 | int frames; | 65 | int frames; |
66 | } | 66 | } |
67 | kas_animations [] = | 67 | kas_animations [] = |
68 | { | 68 | { |
69 | // { ID_ROCK_LARGE, "rock1/rock1\%1.png", 32 }, | 69 | // { ID_ROCK_LARGE, "rock1/rock1\%1.png", 32 }, |
70 | { ID_ROCK_MEDIUM, "rock2/rock2\%1.png", 32 }, | 70 | { ID_ROCK_MEDIUM, "rock2/rock2\%1.png", 32 }, |
71 | { ID_ROCK_SMALL, "rock3/rock3\%1.png", 32 }, | 71 | { ID_ROCK_SMALL, "rock3/rock3\%1.png", 32 }, |
72 | { ID_SHIP, "ship/ship\%1.png", 32 }, | 72 | { ID_SHIP, "ship/ship\%1.png", 32 }, |
73 | { ID_MISSILE, "missile/missile.png", 1 }, | 73 | { ID_MISSILE, "missile/missile.png", 0 }, |
74 | { ID_BIT, "bits/bits\%1.png", 16 }, | 74 | { ID_BIT, "bits/bits\%1.png", 16 }, |
75 | { ID_EXHAUST, "exhaust/exhaust.png", 1 }, | 75 | { ID_EXHAUST, "exhaust/exhaust.png", 0 }, |
76 | { ID_ENERGY_POWERUP, "powerups/energy.png", 1 }, | 76 | { ID_ENERGY_POWERUP, "powerups/energy.png", 0 }, |
77 | // { ID_TELEPORT_POWERUP, "powerups/teleport%1.png", 12 }, | 77 | // { ID_TELEPORT_POWERUP, "powerups/teleport%1.png", 12 }, |
78 | { ID_BRAKE_POWERUP, "powerups/brake.png", 1 }, | 78 | { ID_BRAKE_POWERUP, "powerups/brake.png", 0 }, |
79 | { ID_SHIELD_POWERUP, "powerups/shield.png", 1 }, | 79 | { ID_SHIELD_POWERUP, "powerups/shield.png", 0 }, |
80 | { ID_SHOOT_POWERUP, "powerups/shoot.png", 1 }, | 80 | { ID_SHOOT_POWERUP, "powerups/shoot.png", 0 }, |
81 | { ID_SHIELD, "shield/shield\%1.png", 6 }, | 81 | { ID_SHIELD, "shield/shield\%1.png", 6 }, |
82 | { 0, 0, 0 } | 82 | { 0, 0, 0 } |
83 | }; | 83 | }; |
84 | 84 | ||
85 | 85 | ||
86 | 86 | ||
87 | KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name ) | 87 | KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name ) |
88 | : QWidget( parent, name ), | 88 | : QWidget( parent, name ), |
89 | field(200, 200), | 89 | field(200, 200), |
90 | view(&field,this) | 90 | view(&field,this) |
91 | { | 91 | { |
92 | view.setVScrollBarMode( QScrollView::AlwaysOff ); | 92 | view.setVScrollBarMode( QScrollView::AlwaysOff ); |
93 | view.setHScrollBarMode( QScrollView::AlwaysOff ); | 93 | view.setHScrollBarMode( QScrollView::AlwaysOff ); |
94 | rocks.setAutoDelete( TRUE ); | 94 | rocks.setAutoDelete( TRUE ); |
95 | missiles.setAutoDelete( TRUE ); | 95 | missiles.setAutoDelete( TRUE ); |
96 | bits.setAutoDelete( TRUE ); | 96 | bits.setAutoDelete( TRUE ); |
97 | powerups.setAutoDelete( TRUE ); | 97 | powerups.setAutoDelete( TRUE ); |
98 | exhaust.setAutoDelete( TRUE ); | 98 | exhaust.setAutoDelete( TRUE ); |
99 | 99 | ||
100 | QPixmap pm( Resource::loadPixmap(IMG_BACKGROUND) ); | 100 | QPixmap pm( Resource::loadPixmap(IMG_BACKGROUND) ); |
101 | field.setBackgroundPixmap( pm ); | 101 | field.setBackgroundPixmap( pm ); |
102 | 102 | ||
103 | textSprite = new QCanvasText( &field ); | 103 | textSprite = new QCanvasText( &field ); |
104 | QFont font( "helvetica", 14 ); | 104 | QFont font( "helvetica", 14 ); |
105 | textSprite->setFont( font ); | 105 | textSprite->setFont( font ); |
106 | 106 | ||
107 | shield = 0; | 107 | shield = 0; |
108 | shieldOn = FALSE; | 108 | shieldOn = FALSE; |
109 | refreshRate = REFRESH_DELAY; | 109 | refreshRate = REFRESH_DELAY; |
110 | 110 | ||
111 | readSprites(); | 111 | readSprites(); |
112 | 112 | ||