SDL2
authorGwyn Ciesla <limburgher@gmail.com>
Wed, 24 Sep 2014 17:27:21 +0000 (12:27 -0500)
committerGwyn Ciesla <limburgher@gmail.com>
Wed, 24 Sep 2014 17:27:21 +0000 (12:27 -0500)
AppData

CHANGELOG
Makefile
curblaster.appdata.xml [new file with mode: 0644]
enemy_shoot.cpp
main.cpp
mishaps.cpp
motion.cpp
play_sound_effect.cpp
powerup.cpp

index 8baec20..7adf2c2 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+Migrated to SDL2.
+Added AppData.
 Additional points for high altitude pod grabs, and lander snatches.
 Shields defanged, super shield powerup gives killer shields.
 Landers/crazies and crawlers are scaled as levels increase.
index 3001fdd..84def90 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ INST = /usr/local/bin
 
 
 main: main.o check_collision.o age_bullet.o gravitize.o radar_plot.o object_out.o motion.o init.o draw.o powerup.o play_sound_effect.o mishaps.o enemy_shoot.o
-       g++ $(CFLAGS) -o curblaster main.o check_collision.o age_bullet.o gravitize.o radar_plot.o object_out.o motion.o init.o draw.o powerup.o play_sound_effect.o mishaps.o enemy_shoot.o -lncurses -lSDL -lSDL_mixer
+       g++ $(CFLAGS) -o curblaster main.o check_collision.o age_bullet.o gravitize.o radar_plot.o object_out.o motion.o init.o draw.o powerup.o play_sound_effect.o mishaps.o enemy_shoot.o -lncurses -lSDL2 -lSDL2_mixer
 main.o: main.cpp
        $(CXX) -c main.cpp
 check_collision.o: check_collision.cpp check_collision.h
diff --git a/curblaster.appdata.xml b/curblaster.appdata.xml
new file mode 100644 (file)
index 0000000..bc85c5a
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2014 Ravi Srinivasan <ravishankar.srinivasan@gmail.com> -->
+
+<application>
+  <id type="desktop">curblaster.desktop</id>
+  <metadata_license>CC0-1.0</metadata_license>
+  <summary>A 2D side scrolling space shooter</summary>
+  <description>
+    <p>
+      Curblaster is an ncurses based 2D side scrolling space shooter.
+      The objective is to transport pods safely through gates and obstacles.
+    </p>
+  </description>
+  <url type="homepage">http://curblaster.sourceforge.net</url>
+</application>
index afeb69a..1db529c 100644 (file)
@@ -1,5 +1,5 @@
-#include "SDL/SDL.h"
-#include "SDL/SDL_mixer.h"
+#include "SDL2/SDL.h"
+#include "SDL2/SDL_mixer.h"
 
 #include "game_object.h"
 #include "play_sound_effect.h"
index 08381bc..4dd2bf3 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -26,8 +26,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include "SDL/SDL.h"
-#include "SDL/SDL_mixer.h"
+#include "SDL2/SDL.h"
+#include "SDL2/SDL_mixer.h"
 
 #include "game_object.h"
 #include "check_collision.h"
@@ -467,7 +467,6 @@ int main(int argc, char *argv[]){
   //main loop
 
   int loopvar = 0;
-  int input = 0;
   int podcount = 0;
   int podsin = 0;
   int landercount = 0;
@@ -582,11 +581,6 @@ int main(int argc, char *argv[]){
 
   Mix_Music *title = NULL;
 
-  int audio_rate = 22050;
-  Uint16 audio_format = AUDIO_S16; 
-  int audio_channels = 6;
-  int audio_buffers = 4096;
-
   char *env_tty;
   env_tty = getenv("SSH_TTY");
     
@@ -594,6 +588,12 @@ int main(int argc, char *argv[]){
     
   if(env_tty == NULL && sound == 1){
 
+    int audio_rate = 22050;
+    Uint16 audio_format = AUDIO_S16;
+    int audio_channels = 6;
+    int audio_buffers = 4096;
+
+
     SDL_Init(SDL_INIT_AUDIO);
 
     if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) {
@@ -670,6 +670,8 @@ int main(int argc, char *argv[]){
   title = NULL;
   
   while(loopvar == 0){
+
+    int input = 0;
     
     clear();
     // Draw board
index 9de7bdd..efbb5db 100644 (file)
@@ -1,8 +1,8 @@
 #include <ncurses.h>
 #include <math.h>
 #include <unistd.h>
-#include "SDL/SDL.h"
-#include "SDL/SDL_mixer.h"
+#include "SDL2/SDL.h"
+#include "SDL2/SDL_mixer.h"
 
 #include "game_object.h"
 #include "draw.h"
index e33bcfc..7b78686 100644 (file)
@@ -6,9 +6,10 @@
 
 game_object change_elevation(game_object object){
 
-  int adjust = 0;
-
   if(rand()%100<=5){  
+
+    int adjust = 0;
+
     if(rand()%100<=50){
       adjust++;
     } else {
index 00c47ec..ebf85e9 100644 (file)
@@ -1,5 +1,5 @@
-#include "SDL/SDL.h"
-#include "SDL/SDL_mixer.h"
+#include "SDL2/SDL.h"
+#include "SDL2/SDL_mixer.h"
 
 int play_sound_effect(Mix_Chunk *chunk, int channel){
   channel = Mix_PlayChannel(-1, chunk, 0);
index 399428c..77b4b4f 100644 (file)
@@ -1,7 +1,7 @@
 #include <cstdlib>
 #include <string.h>
-#include "SDL/SDL.h"
-#include "SDL/SDL_mixer.h"
+#include "SDL2/SDL.h"
+#include "SDL2/SDL_mixer.h"
 
 #include "game_object.h"
 #include "play_sound_effect.h"