Code Search for Developers
 
 
  

pausefader.h from FreePop at Krugle


Show pausefader.h syntax highlighted

#ifndef PAUSEFADER_H_INCLUDED
#define PAUSEFADER_H_INCLUDED

/** 
 * Used to darken the screen when the game is paused.
 *
 * \todo Should put a "Paused" text on screen.
 */
class PauseFader {
	protected:
		/**
		 * Are we currently fading the screen? Are we fading out or in?
		 */
        enum {FADED_IN, FADED_OUT, FADING_IN, FADING_OUT} type;
        
		/** 
		 * when did we start to fade? used to
		 * make the fade uniform over time, even if doStep() is called in
		 * non-uniform intervals
		 */
		int start;

        /**
         * how many sdl ticks do we want to spend on the fade?
         */
        const int max;
        
        /**
         * how much do we want to fade out? [0-255]
         */
        const int duration;
        
	public:
		/** 
		 * ctor, just sets up the internal variables
         *
         * \param m Max fade level (255 = black).
         * \param t Time to take (ms).
		 */
		PauseFader(int m = 128, int t = 1000);
        
		/** 
		 * call this in regular intervals, as often as possible (in the main
		 * loop. it will fade in/out or just return. shouldn't cost much if it
		 * does nothing */
		void doStep();
        
		/**
		 * call this whenever the game is set into pause mode
		 */
		void pause();
        
		/**
		 * call when the game leaves pause mode
		 */
		void unPause();
};

#endif




See more files for this project here

FreePop

FreePop is a multi-platform tile-based game based on the great old game Populous 2 by Bullfrog Productions Ltd., but much improved.

Project homepage: http://sourceforge.net/projects/freepop
Programming language(s): C++
License: other

  Makefile.am
  client.cpp
  client.h
  clientmisc.cpp
  clientmisc.h
  clientstate.cpp
  clientstate.h
  connectstate.cpp
  connectstate.h
  cropsclient.cpp
  cropsclient.h
  entityclient.cpp
  entityclient.h
  entityclientfactory.cpp
  entityclientfactory.h
  firecolumnclient.cpp
  firecolumnclient.h
  gamestate.cpp
  gamestate.h
  loadstate.cpp
  loadstate.h
  mapclient.cpp
  mapclient.h
  maptileclient.cpp
  maptileclient.h
  messagebox.cpp
  messagebox.h
  oversprite.cpp
  oversprite.h
  paintable.cpp
  paintable.h
  pausefader.cpp
  pausefader.h
  peepclient.cpp
  peepclient.h
  peepmagnetclient.cpp
  peepmagnetclient.h
  playerclient.cpp
  playerclient.h
  playeroptionsdialog.cpp
  playeroptionsdialog.h
  rockclient.cpp
  rockclient.h
  swampclient.cpp
  swampclient.h
  townclient.cpp
  townclient.h
  treeclient.cpp
  treeclient.h
  worldclient.cpp
  worldclient.h