include/gui/spinning_car.h

Go to the documentation of this file.
00001 #ifndef _VGUI_SPINNING_CAR_H
00002 #define _VGUI_SPINNING_CAR_H
00003 
00004 /* image.h */
00005 #include <vamos/world/World.h>
00006 #include <vamos/body/Gl_Car.h>
00007 #include <vamos/body/Wheel.h>
00008 #include <vamos/body/Fuel_Tank.h>
00009 #include "gui/wheel.h"
00010 #include "gui/gui.h"
00011 
00012 namespace VGUI
00013 {
00014         class SpinningCar : public Widget
00015         {
00016         public:
00017                 SpinningCar() {}
00018                 SpinningCar( Widget* w );
00019                 ~SpinningCar();
00020                 void Save();
00021                 void Draw();
00022                 void Draw( float opacity );
00023                 bool MouseOver( float x, float y );
00024                 string MousePress( float x, float y );
00025                 string MouseRelease( float x, float y );
00026                 void ResetValue();
00027                 void HookIncValuePress();
00028                 void HookDecValuePress();
00029                 void HookIncValueRelease();
00030                 void HookDecValueRelease();
00031                 void HookRelease();
00032                 void IncValuePress();
00033                 void DecValuePress();
00034                 void IncValueRelease();
00035                 void DecValueRelease();
00036                 void Release();
00037                 void ClearCar();
00038 
00039                 vector<string> GetFilenameList() { return filename_list; }
00040                 vector<string> GetValueList() { return value_list; }
00041                 string GetValue() { return value_list[cur_option]; }
00042                 bool GetSelected() { return wheel->GetSelected(); }
00043                 string GetSetting() { return setting; }
00044                 float * GetCarPos() { return carpos; }
00045                 void SetFilenameList( vector<string> new_filename_list ) { filename_list = new_filename_list; }
00046                 void SetValueList( vector<string> new_value_list ) { value_list = new_value_list; }
00047                 void SetValue( string new_value ) { for( unsigned int i = 0; i < value_list.size(); i++ ) if( value_list[i] == new_value ) cur_option = i; return; }
00048                 void SetSelected( bool new_selected ) { wheel->SetSelected( new_selected ); }
00049                 void SetSetting( string new_setting ) { setting = new_setting; }
00050                 void SetCarPos( float * new_carpos ) { carpos[0] = new_carpos[0]; carpos[1] = new_carpos[1]; carpos[2] = new_carpos[2]; }
00051 
00052         private:
00053                 void LoadCar();
00054 
00055                 vector<string> filename_list;
00056                 vector<string> value_list;
00057                 Vamos_Body::Gl_Car * car;
00058                 Wheel<int> * wheel;
00059                 string setting;
00060                 TEXTURE_HANDLE img_tex, sphere_reflection;
00061                 unsigned int cur_option;
00062                 float last_t, rotation;
00063                 float fade_time;
00064                 float carpos[3];
00065                 bool l_down, r_down, loaded, car_in, car_out;
00066                 bool extra_clicks;
00067                 Uint32 press_time;
00068         };
00069 }
00070 
00071 
00072 #endif // _VGUI_SPINNING_CAR_H

Generated on Thu Oct 19 04:05:47 2006 by  doxygen 1.4.6