git » fp-git.git » commit a78ca49

Binded and implemented showVersion action

author ecalot
2004-08-22 06:42:50 UTC
committer ecalot
2004-08-22 06:42:50 UTC
parent f70d2e8237671c9887273582eaaedcbb39efe8a4

Binded and implemented showVersion action

FP/src/include/input.h +1 -1
FP/src/include/kernel.h +2 -0
FP/src/ker/kernel.c +4 -1
FP/src/out/input.c +3 -1

diff --git a/FP/src/include/input.h b/FP/src/include/input.h
index b04bce6..b104810 100644
--- a/FP/src/include/input.h
+++ b/FP/src/include/input.h
@@ -33,7 +33,7 @@ input.h: Free Prince : Input devices handling
 #ifndef _INPUT_H_
 #define _INPUT_H_
 
-typedef enum {none=0,quit,load,reload,passLevel,showUp,showLeft,showRight,showDown,showScreens,moreTime,lessTime,addLive,addHitPoint,gotoTitles,kill,resurrect,other}tAction;
+typedef enum {none=0,quit,load,reload,passLevel,showUp,showLeft,showRight,showDown,showScreens,showVersion,moreTime,lessTime,addLive,addHitPoint,gotoTitles,kill,resurrect,other}tAction;
 
 /*#define inputIgnoreCtrl(a)  (a&( ~(1<<1) ))*/
 /* TODO: use inputIgnore* for each Set* */
diff --git a/FP/src/include/kernel.h b/FP/src/include/kernel.h
index 02e0873..39d8152 100644
--- a/FP/src/include/kernel.h
+++ b/FP/src/include/kernel.h
@@ -43,6 +43,8 @@ kernel.h: Princed Resources : Resource Handler headers
 #define hasFlag(a) (optionflag&(a))
 #define setFlag(a) optionflag|=(a)
 
+#define FP_VERSION "0.1-pre-alpha"
+
 int kernel(int optionflag,int level);
 /* level=-1 is default
  * levels from 0 to n is the level number
diff --git a/FP/src/ker/kernel.c b/FP/src/ker/kernel.c
index 9f74096..8a6766f 100644
--- a/FP/src/ker/kernel.c
+++ b/FP/src/ker/kernel.c
@@ -105,6 +105,9 @@ int playgame(int optionflag,int level) {
 				if ((roomId=room.links[eRight]))
 					room=mapGetRoom(map,roomId);
 				break;
+			case showVersion:
+				fprintf(stderr,"FreePrince v"FP_VERSION"\n");
+				break;
 			case showScreens:
 				fprintf(stderr,"S%d L%d R%d A%d B%d\n",
 					room.id,
@@ -113,7 +116,7 @@ int playgame(int optionflag,int level) {
 					room.links[eUp],
 					room.links[eDown]
 				);
-				break;				
+				break;
 		default:
 				break;
 			}
diff --git a/FP/src/out/input.c b/FP/src/out/input.c
index aff8402..746cc34 100644
--- a/FP/src/out/input.c
+++ b/FP/src/out/input.c
@@ -61,7 +61,6 @@ int editAction(tKey* key,SDLKey k) {
 		case SDLK_r:	
 			key->actionPerformed=gotoTitles;
 			break;
-		
 		default:
 			break;
 		}
@@ -87,6 +86,9 @@ int editAction(tKey* key,SDLKey k) {
 		case SDLK_c:	
 			key->actionPerformed=showScreens;
 			break;
+		case SDLK_v:	
+			key->actionPerformed=showVersion;
+			break;
 		default:
 			break;
 		}