1.12 1.12
authorGwyn Ciesla <limburgher@gmail.com>
Tue, 31 Jan 2017 23:49:15 +0000 (17:49 -0600)
committerGwyn Ciesla <limburgher@gmail.com>
Tue, 31 Jan 2017 23:49:15 +0000 (17:49 -0600)
cppcheck

Makefile
enemy_shoot.cpp
main.cpp
mishaps.cpp
powerup.cpp
powerup.h

index 84def90..f3965a2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,10 @@ remove:
        rm $(INST)/curblaster
 uninstall: remove
 
+check:
+       cppcheck --enable=warning,style,unusedFunction .
+test: check
+
 clean:
        rm *.o
        rm curblaster
index 1db529c..300c72e 100644 (file)
@@ -7,7 +7,7 @@
 game_object enemy_shoot(game_object enemy, game_object player, game_object shot, int enshotchannel, Mix_Chunk *enshotsound){
 
   int multiplier = 1;
-  enshotchannel = play_sound_effect(enshotsound, enshotchannel);
+  play_sound_effect(enshotsound, enshotchannel);
   shot.active=1;
   //set direction
   if(player.y<enemy.y){ 
index e2edc6d..bf2e18e 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -48,7 +48,7 @@ const int landershotmax = 10;
 const int landermax = 12;
 const int crawlermax = 6;
 const int missilemax = 3;
-const float version = 1.11;
+const float version = 1.12;
 
 int score;
 int lives;
@@ -110,6 +110,8 @@ int main(int argc, char *argv[]){
   strcpy (gate.line0, " ^ ");
   strcpy (gate.line1, "/|\\");
   strcpy (gate.radar, "|");
+  gate.chase = -1;
+  gate.phase = 0;
  
   game_object gatebeam1;
   gatebeam1.number = 11;
@@ -433,6 +435,7 @@ int main(int argc, char *argv[]){
   boomstuff.vspeed = 0;
   boomstuff.vtime = 0;
   boomstuff.phase = 0; 
+  boomstuff.chase = -1;
   strcpy (boomstuff.line0, "\\");
   strcpy (boomstuff.line1, "/");
 
index efbb5db..3b2fd45 100644 (file)
@@ -9,7 +9,7 @@
 #include "play_sound_effect.h"
 
 game_object encrazify(game_object lander, game_object crazy, Mix_Chunk *sound, int channel){
-  channel = play_sound_effect(sound, channel);
+  play_sound_effect(sound, channel);
   crazy.active=1;
   crazy.x = lander.x;
   crazy.y = lander.y;  
index 77b4b4f..aa5ef70 100644 (file)
@@ -45,7 +45,7 @@ game_object powerup_init(game_object powerup, game_object object){
   return powerup;
 };
 
-void determine_powerup(game_object powerups[], game_object object, int odds, Mix_Chunk *sound, int channel){
+void determine_powerup(game_object powerups[], game_object& object, int odds, Mix_Chunk *sound, int channel){
   if(rand()%1000>odds){
     for(int puploop = 0; puploop<4; puploop++){
       if(powerups[puploop].active==0){
index 7f569df..653d59d 100644 (file)
--- a/powerup.h
+++ b/powerup.h
@@ -1,2 +1,2 @@
 game_object powerup_init(game_object, game_object);
-void determine_powerup(game_object[], game_object, int, Mix_Chunk*, int);
+void determine_powerup(game_object[], game_object&, int, Mix_Chunk*, int);