00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "rSDL.h"
00029
00030 #include "defs.h"
00031 #include "gStuff.h"
00032 #include "gLogo.h"
00033 #include "eFloor.h"
00034 #include "tConfiguration.h"
00035 #include "rScreen.h"
00036
00037
00038
00039 static REAL sg_gridSize=1;
00040 static tSettingItem<REAL> g_s("GRID_SIZE",sg_gridSize);
00041 static REAL sg_gridSizeMoviePack=2;
00042 static tSettingItem<REAL> g_sm("GRID_SIZE_MOVIEPACK",sg_gridSizeMoviePack);
00043
00044 static REAL moviepack_floor_red=.5,moviepack_floor_green=.5,moviepack_floor_blue=.5;
00045 static REAL floor_red=.15,floor_green=.3,floor_blue=.15;
00046
00047 static tSettingItem<REAL>
00048 mfr("MOVIEPACK_FLOOR_RED",moviepack_floor_red),
00049 mfg("MOVIEPACK_FLOOR_GREEN",moviepack_floor_green),
00050 mfb("MOVIEPACK_FLOOR_BLUE",moviepack_floor_blue),
00051 fr("FLOOR_RED",floor_red),
00052 fg("FLOOR_GREEN",floor_green),
00053 fb("FLOOR_BLUE",floor_blue);
00054
00055 #ifndef DEDICATED
00056 #include "rTexture.h"
00057 #include "rRender.h"
00058 #include "uMenu.h"
00059 #include "tSysTime.h"
00060
00061 #include "nConfig.h"
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 static rFileTexture floor_a(rTextureGroups::TEX_FLOOR,"textures/floor_a.png",1,1);
00089 static rFileTexture floor_b(rTextureGroups::TEX_FLOOR,"textures/floor_b.png",1,1);
00090 static rFileTexture mp_floor_a(rTextureGroups::TEX_FLOOR,"moviepack/floor_a.png",1,1);
00091 static rFileTexture mp_floor_b(rTextureGroups::TEX_FLOOR,"moviepack/floor_b.png",1,1);
00092 rFileTexture ArmageTron_floor(rTextureGroups::TEX_FLOOR,"textures/floor.png",1,1);
00093 rFileTexture ArmageTron_mp_floor(rTextureGroups::TEX_FLOOR,"moviepack/floor.png",1,1);
00094
00095 class gFloor: public eFloor{
00096 public:
00097 gFloor(){};
00098 virtual ~gFloor(){};
00099
00100 virtual void glFloorColor(REAL alpha, REAL intens){
00101 if (!sr_glOut)
00102 return;
00103
00104 REAL r, g, b;
00105 FloorColor(r, g, b);
00106 renderer->Color(r, g, b, alpha);
00107 }
00108
00109 virtual void FloorColor(REAL& r, REAL& g, REAL&b){
00110 if (sg_MoviePack())
00111 {
00112 r = moviepack_floor_red;
00113 g = moviepack_floor_green;
00114 b = moviepack_floor_blue;
00115 }
00116 else
00117 {
00118 r = floor_red;
00119 g = floor_green;
00120 b = floor_blue;
00121 }
00122 }
00123
00124
00125 virtual void glFloorTexture(){
00126 if (sg_MoviePack())
00127 ArmageTron_mp_floor.Select();
00128 else
00129 ArmageTron_floor.Select();
00130 }
00131
00132 virtual void glFloorTexture_a(){
00133 if (sg_MoviePack())
00134 mp_floor_a.Select();
00135 else
00136 floor_a.Select();
00137 }
00138
00139 virtual void glFloorTexture_b(){
00140 if (sg_MoviePack())
00141 mp_floor_b.Select();
00142 else
00143 floor_b.Select();
00144 }
00145
00146 virtual REAL GridSize(){
00147 if (sg_MoviePack())
00148 return sg_gridSizeMoviePack;
00149 else
00150 return sg_gridSize;
00151 }
00152
00153 virtual bool BlackSky(){
00154 return sg_MoviePack();
00155 }
00156
00157 };
00158
00159 static gFloor GFLOOR;
00160
00161 static void MenuBackground(){
00162 if (rTextureGroups::TextureMode[rTextureGroups::TEX_FLOOR]>=0){
00163 se_glFloorTexture();
00164 se_glFloorColor(1,1);
00165
00166 REAL x=tSysTimeFloat()/3.0;
00167 REAL y=tSysTimeFloat()/5.0;
00168 REAL width=16;
00169 REAL height=12;
00170
00171 static GLfloat tm[4][4]={{.8,.2,0,0},
00172 {-.2,.8,0,0},
00173 {0,0,1,0},
00174 {0,0,0,1}};
00175
00176 TexMatrix();
00177 glLoadMatrixf(&tm[0][0]);
00178
00179 glScalef((REAL)sr_screenWidth/sr_screenHeight/4. * 3., 1., 1.);
00180
00181
00182 BeginQuads();
00183
00184 glTexCoord2d(x,y);
00185 glVertex2f(-1,-1);
00186
00187 glTexCoord2d(x+width,y);
00188 glVertex2f(1,-1);
00189
00190 glTexCoord2d(x+width,y-height);
00191 glVertex2f(1,1);
00192
00193 glTexCoord2d(x,y-height);
00194 glVertex2f(-1,1);
00195
00196 RenderEnd();
00197
00198 TexMatrix();
00199 glLoadIdentity();
00200 }
00201
00202 gLogo::Display();
00203 }
00204
00205 static uCallbackMenuBackground backgr(&MenuBackground);
00206
00207 #endif