Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

main.cpp File Reference

Programme du jeu LIBELL. More...

#include <windows.h>
#include <dxerr9.h>
#include <string>
#include <dinput.h>
#include "main.h"
#include "game_manager.h"
#include "errrors_display.h"

Go to the source code of this file.

Defines

#define BITMAP_FILE   "../graphs/graphs.bmp"
#define MESSAGES_FILE   "../graphs/messages.bmp"
#define FOND_FILE   "../graphs/fond.bmp"
#define TX_BITMAP   85
#define TY_BITMAP   64
#define TX_MESSAGES_BMP   276
#define TY_MESSAGES_BMP   190

Functions

bool InitDD (HWND)
 ititialise les composants Direct Draw

void CleanUp ()
 Libere proprement les composants Direct Draw.

void GameLoop ()
void WINAPI DI_Term ()
 Termine proprement les composants Direct Input.

LRESULT CALLBACK WndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 Fonctions de callback de traitement des messages de la fenetre Windows.

BOOL WINAPI DI_Init (HWND hWnd, HINSTANCE g_hinst)
 ititialise les composants Direct Input

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iShowCmd)
 WinMain.


Variables

CDisplayg_pDisplay = NULL
 l'objet DDRAW pour l'affichage

CSurfaceg_pText = NULL
 surface de text

CSurfaceg_pLeft_Time_Text = NULL
 surface du text pour afficher le temps restant

CSurfaceg_pScore_Text = NULL
 surface du text pour afficher le score

CSurfaceg_pSprites = NULL
 surface bitmap des sprites (avec clé de transparence);

CSurfaceg_pMessages = NULL
 surface des messages

CSurfaceg_pFond = NULL
 surface contenant l'image de fond d'ecran

LPDIRECTINPUT8 g_lpDI
LPDIRECTINPUTDEVICE8 g_pKeyboard
 keyboard device

cGame_Manager Game_Manager
 instanciation de l'objet de gestion du jeu

HWND hWnd
 instance de la fenetre

Debugger Debug_File ("output.txt")
 debugger ( fichier texte) vers lequel on envoie des infos

bool g_bActive = false
 indique que je jeu est actif


Detailed Description

Programme du jeu LIBELL.

Auteur : Adrien Auclair

Ce fichier contient la fonction WinMain
On trouve aussi les fonctions d'initialisation de DirectX ( draw et ddinput)
WndProc est la fonction de traitement des messages windows
elle est utilisée pour traiter certains caracteres claviers

Definition in file main.cpp.


Define Documentation

#define BITMAP_FILE   "../graphs/graphs.bmp"
 

Definition at line 28 of file main.cpp.

Referenced by InitDD().

#define FOND_FILE   "../graphs/fond.bmp"
 

Definition at line 30 of file main.cpp.

Referenced by InitDD().

#define MESSAGES_FILE   "../graphs/messages.bmp"
 

Definition at line 29 of file main.cpp.

Referenced by InitDD().

#define TX_BITMAP   85
 

Definition at line 34 of file main.cpp.

Referenced by InitDD().

#define TX_MESSAGES_BMP   276
 

Definition at line 38 of file main.cpp.

Referenced by InitDD().

#define TY_BITMAP   64
 

Definition at line 35 of file main.cpp.

Referenced by InitDD().

#define TY_MESSAGES_BMP   190
 

Definition at line 39 of file main.cpp.

Referenced by InitDD().


Function Documentation

void CleanUp  )  [static]
 

Libere proprement les composants Direct Draw.

Definition at line 340 of file main.cpp.

References g_pDisplay, g_pFond, g_pLeft_Time_Text, g_pMessages, g_pScore_Text, g_pSprites, g_pText, and SAFE_DELETE.

Referenced by WndProc().

BOOL WINAPI DI_Init HWND  hWnd,
HINSTANCE  g_hinst
 

ititialise les composants Direct Input

Definition at line 175 of file main.cpp.

References DI_Term(), g_lpDI, g_pKeyboard, and hWnd.

Referenced by WinMain().

void WINAPI DI_Term  )  [static]
 

Termine proprement les composants Direct Input.

Definition at line 83 of file main.cpp.

References g_lpDI, and g_pKeyboard.

Referenced by DI_Init(), and WndProc().

void GameLoop  )  [static]
 

bool InitDD HWND   )  [static]
 

ititialise les composants Direct Draw

Definition at line 236 of file main.cpp.

References BIT_DEPTH, BITMAP_FILE, CDisplay::CreateFullScreenDisplay(), CDisplay::CreatePaletteFromBitmap(), CDisplay::CreateSurface(), CDisplay::CreateSurfaceFromBitmap(), FOND_FILE, g_pDisplay, g_pFond, g_pLeft_Time_Text, g_pMessages, g_pScore_Text, g_pSprites, hWnd, MESSAGES_FILE, SAFE_RELEASE, CSurface::SetColorKey(), CDisplay::SetPalette(), TX_BITMAP, TX_MESSAGES_BMP, TX_SCREEN, TY_BITMAP, TY_MESSAGES_BMP, and TY_SCREEN.

Referenced by WndProc().

int WINAPI WinMain HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpCmdLine,
int  iShowCmd
 

WinMain.

Definition at line 357 of file main.cpp.

References DI_Init(), g_bActive, Game_Manager, hWnd, cGame_Manager::Main_Loop(), TX_SCREEN, TY_SCREEN, and WndProc().

LRESULT CALLBACK WndProc HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam
 

Fonctions de callback de traitement des messages de la fenetre Windows.

Definition at line 102 of file main.cpp.

References cGame_Manager::bDisplay_Ennemies_Path, cGame_Manager::bDisplay_Path_Graph, cGame_Manager::bDisplay_Square_Areas, cGame_Manager::bGame_Paused, cGame_Manager::bInvincible, CleanUp(), DI_Term(), g_bActive, g_pDisplay, Game_Manager, cGame_Manager::Game_State, hWnd, InitDD(), LEVEL_FINISHED, RUNNING, cGame_Manager::Try_Start(), and CDisplay::UpdateBounds().

Referenced by WinMain().


Variable Documentation

Debugger Debug_File("output.txt")
 

debugger ( fichier texte) vers lequel on envoie des infos

Definition at line 33 of file main.h.

bool g_bActive = false [static]
 

indique que je jeu est actif

Definition at line 71 of file main.cpp.

Referenced by WinMain(), and WndProc().

LPDIRECTINPUT8 g_lpDI
 

Definition at line 54 of file main.cpp.

Referenced by DI_Init(), and DI_Term().

CDisplay* g_pDisplay = NULL
 

l'objet DDRAW pour l'affichage

Definition at line 46 of file main.cpp.

Referenced by Call_Back_Display_Wall(), CleanUp(), cGame_Manager::Display(), cSprite_Display_Def::Display(), cBitmap_Display_Def::Display(), cSquare_Area_Debug_Displayer::Display(), cGame_Manager::Display_Debug_X(), cGame_World_Debug_Displayer::Display_Graph(), cUnit::Display_Path(), cGame_Manager::Display_Score(), cGame_Manager::Display_Time(), Draw_Line(), InitDD(), cGame_Manager::Main_Loop(), and WndProc().

CSurface* g_pFond = NULL
 

surface contenant l'image de fond d'ecran

Definition at line 52 of file main.cpp.

Referenced by CleanUp(), cGame_Manager::Display(), and InitDD().

LPDIRECTINPUTDEVICE8 g_pKeyboard
 

keyboard device

Definition at line 55 of file main.cpp.

Referenced by DI_Init(), DI_Term(), and cGame_Manager::Read_Keyboard_And_React().

CSurface* g_pLeft_Time_Text = NULL
 

surface du text pour afficher le temps restant

Definition at line 48 of file main.cpp.

Referenced by CleanUp(), cGame_Manager::Display_Time(), and InitDD().

CSurface* g_pMessages = NULL
 

surface des messages

Definition at line 51 of file main.cpp.

Referenced by CleanUp(), cBitmap_Display_Def::Display(), and InitDD().

CSurface* g_pScore_Text = NULL
 

surface du text pour afficher le score

Definition at line 49 of file main.cpp.

Referenced by CleanUp(), cGame_Manager::Display_Score(), and InitDD().

CSurface* g_pSprites = NULL
 

surface bitmap des sprites (avec clé de transparence);

Definition at line 50 of file main.cpp.

Referenced by CleanUp(), cSprite_Display_Def::Display(), and InitDD().

CSurface* g_pText = NULL
 

surface de text

Definition at line 47 of file main.cpp.

Referenced by CleanUp().

cGame_Manager Game_Manager
 

instanciation de l'objet de gestion du jeu

Definition at line 56 of file main.cpp.

Referenced by cBlue_Ball::cBlue_Ball(), cBlue_Trap::cBlue_Trap(), cBomb::cBomb(), cCadeau::cCadeau(), cGreen_Ball::cGreen_Ball(), cGreen_Trap::cGreen_Trap(), cHologramme::cHologramme(), cPlayer::cPlayer(), cRed_Ball::cRed_Ball(), cRed_Trap::cRed_Trap(), cTeleporteur::cTeleporteur(), cEnnemy::Get_Destination(), cRed_Ball::Get_Destination(), cBlue_Ball::Get_Destination(), cGreen_Ball::Get_Destination(), cGame_Manager::Main_Loop(), cUnit::Move(), cBlue_Ball::React_To_Blue_Trap(), cEnnemy::React_To_Bomb(), cPlayer::React_To_Bomb(), cEnnemy::React_To_Cadeau(), cPlayer::React_To_Cadeau(), cGreen_Ball::React_To_Green_Trap(), cEnnemy::React_To_Hologramme(), cRed_Ball::React_To_Red_Trap(), cEnnemy::React_To_Teleporteur(), cGame_Manager::Update_Game(), cEnnemy::Update_Path(), cPlayer::Use_Teleporteur(), WinMain(), and WndProc().

HWND hWnd
 

instance de la fenetre

Definition at line 57 of file main.cpp.

Referenced by CDisplay::CreateFullScreenDisplay(), CDisplay::CreateWindowedDisplay(), DI_Init(), cSprite_Display_Def::Display(), cBitmap_Display_Def::Display(), cGame_Manager::Display_Score(), cGame_Manager::Display_Time(), InitDD(), cLevel_Loader::Load(), cGame_Manager::Main_Loop(), WinMain(), and WndProc().


Generated on Fri May 21 19:22:37 2004 for LIBELL by doxygen 1.3.7