Don't show selection cursor when help is being displayed.
[supertux.git] / src / special.h
index cf5d21e..24ce8c2 100644 (file)
@@ -1,17 +1,21 @@
+//  $Id$
 //
-// C Interface: special
+//  SuperTux -  A Jump'n Run
+//  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
 //
-// Description: 
-//
-//
-// Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
-//
-// Copyright: See COPYING file that comes with this distribution
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
 //
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
 //
-
-#define BULLET_STARTING_YM 1
-#define BULLET_XM 5
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #ifndef SUPERTUX_SPECIAL_H
 #define SUPERTUX_SPECIAL_H
 #include "texture.h"
 #include "collision.h"
 #include "player.h"
+#include "physic.h"
 
 /* Upgrade types: */
 
-enum {
-  UPGRADE_MINTS,
-  UPGRADE_COFFEE,
-  UPGRADE_HERRING
+enum UpgradeKind {
+  UPGRADE_GROWUP,
+  UPGRADE_ICEFLOWER,
+  UPGRADE_HERRING,
+  UPGRADE_1UP
 };
 
-typedef struct upgrade_type
-  {
-    int kind;
-    base_type base;
-    base_type old_base;
-  }
-upgrade_type;
+void load_special_gfx();
+void free_special_gfx();
 
-typedef struct bullet_type
-  {
-    base_type base;
-  }
-bullet_type;
+class Upgrade : public GameObject
+{
+public:
+  UpgradeKind kind;
+  Direction  dir;
+  Physic physic;
 
-extern texture_type img_bullet;
-extern bitmask* bm_bullet;
+  void init(float x, float y, Direction dir, UpgradeKind kind);
+  void action(double frame_ratio);
+  void draw();
+  void collision(void* p_c_object, int c_object, CollisionType type);
+  std::string type() { return "Upgrade"; };
+  
+  ~Upgrade() {};
 
-void create_special_bitmasks();
+private:
+  /** removes the Upgrade from the global upgrade list. Note that after this
+   * call the class doesn't exist anymore! So don't use any member variables
+   * anymore then
+   */
+  void remove_me();
 
-extern texture_type img_golden_herring;
+  void bump(Player* player);
+};
 
-void upgrade_init(upgrade_type *pupgrade, float x, float y, int kind);
-void upgrade_action(upgrade_type *pupgrade);
-void upgrade_draw(upgrade_type *pupgrade);
-void upgrade_collision(upgrade_type *pupgrade, void* p_c_object, int c_object);
+class Bullet : public GameObject
+{
+ public:
+  int life_count;
+  base_type base;
+  base_type old_base;
+  
+  void init(float x, float y, float xm, Direction dir);
+  void action(double frame_ratio);
+  void draw();
+  void collision(int c_object);
+  std::string type() { return "Bullet"; };
 
-void bullet_init(bullet_type* pbullet, float x, float y, float xm, int dir);
-void bullet_action(bullet_type *pbullet);
-void bullet_draw(bullet_type *pbullet);
-void bullet_collision(bullet_type *pbullet, int c_object);
+private:
+  /** removes the Upgrade from the global upgrade list. Note that after this
+   * call the class doesn't exist anymore! So don't use any member variables
+   * anymore then
+   */
+  void remove_me();
+};
 
 #endif /*SUPERTUX_SPECIAL_H*/