00001 /************************************************************************* 00002 menu.h 00003 Project Piedmont game 00004 ------------------------- 00005 00006 Date Created: 10/4/00 Last Modified: 4/17/08 00007 Programmer: David Foster 00008 Copyright: (C) 2000 David Foster (see file COPYING) 00009 E-mail: dfoster@computer.org 00010 00011 Description: to come.... 00012 00013 This program is free software; you can redistribute it and/or modify 00014 it under the terms of the GNU General Public License as published by 00015 the Free Software Foundation; either version 2 of the License, or 00016 (at your option) any later version. 00017 00018 This program is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 GNU General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 along with this program; if not, write to the Free Software 00025 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00026 00027 ************************************************************************/ 00028 00029 #ifndef MENU_H 00030 #define MENU_H 00031 #define MENU_DEBUG 0 //1 allows debug statements to be output 00032 00033 #include <stdio.h> 00034 #include <iostream> 00035 #include <stdlib.h> 00036 #include <string> 00037 //#include <fstream> 00038 //#include <stddef.h> 00039 #include "SDL.h" 00040 #include "SDL_image.h" 00041 #include "SDL_thread.h" 00042 00043 #include "screen.h" 00044 #include "sound.h" 00045 #include "misc.h" 00046 using std::string; 00047 using namespace std; 00048 00049 //enum menu_names { new, options, quit }; 00050 #define num_menu_choices 3 00051 00052 class Menu{ 00053 friend class Sound; 00054 private: 00055 SDL_Event event; 00056 SDL_Thread* thread; 00057 Screen screen; 00058 Sound *sound; 00059 int current_selection; 00060 int current_alpha; 00061 int alpha_direction; 00062 SDL_Rect choice_rects[num_menu_choices]; 00063 SDL_Surface* menu_choices[num_menu_choices][2]; 00064 SDL_Surface* title; 00065 SDL_Surface* char_image; 00066 SDL_Rect menu_rects[num_menu_choices]; 00067 string sfx; 00068 string bgm; 00069 // MODULE *module; 00070 // SAMPLE *sample; 00071 public: 00072 Menu(Screen &scr, Sound *snd); //Pass by reference (not pointer or value) 00073 ~Menu(); 00074 void load_menu_data (); 00075 int run (); 00076 void play_menu_music (); 00077 }; 00078 00079 #endif 00080 00081 00082