~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/tron/gFloor.cpp

  • Committer: SwagTron
  • Date: 2019-08-04 23:49:16 UTC
  • Revision ID: swagtron-20190804234916-ck8wmuxoi4cph54s
- Removing merge from 2.8.3.x due to the many errors it causes in codeblocks.
- Made these commands save their value on exit:
  CYCLE_TURN_MEMORY
  MOVIEPACK_FLOOR_*
  GRID_SIZE
  GRID_SIZE_MOVIEPACK
  FLOOR_RED
  FLOOR_BLUE
  FLOOR_GREEN
  PLAYER_RANDOM_COLOR_RANGE

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
// grid size
39
39
static REAL sg_gridSize=1;
40
 
static tSettingItem<REAL> g_s("GRID_SIZE",sg_gridSize);
 
40
static tConfItem<REAL> g_s("GRID_SIZE",sg_gridSize);
41
41
static REAL sg_gridSizeMoviePack=2;
42
 
static tSettingItem<REAL> g_sm("GRID_SIZE_MOVIEPACK",sg_gridSizeMoviePack);
 
42
static tConfItem<REAL> g_sm("GRID_SIZE_MOVIEPACK",sg_gridSizeMoviePack);
43
43
 
44
44
static REAL moviepack_floor_red=.5,moviepack_floor_green=.5,moviepack_floor_blue=.5;
45
45
static REAL floor_red=.15,floor_green=.3,floor_blue=.15;
46
46
 
47
 
static tSettingItem<REAL>
 
47
static tConfItem<REAL>
48
48
mfr("MOVIEPACK_FLOOR_RED",moviepack_floor_red),
49
49
mfg("MOVIEPACK_FLOOR_GREEN",moviepack_floor_green),
50
50
mfb("MOVIEPACK_FLOOR_BLUE",moviepack_floor_blue),
172
172
                                 {-.2,.8,0,0},
173
173
                                 {0,0,1,0},
174
174
                                 {0,0,0,1}};
175
 
 
176
 
        // make texture coordinates not too big, wrap them around.
177
 
        // unfortunately, we need to transform them with tm, then clamp them,
178
 
        // then transform them back.
179
 
        double x2 = x1*tm[0][0] + y1*tm[1][0];
180
 
        double y2 = x1*tm[0][1] + y1*tm[1][1];
181
 
        x2-=floor(x2);
182
 
        y2-=floor(y2);
183
 
        REAL x = x2*tm[0][0] + y1*tm[0][1];
184
 
        REAL y = x2*tm[1][0] + y1*tm[1][1];
185
 
        const REAL det=1/(.8*.8+.2*.2);
186
 
        x*=det;
187
 
        y*=det;
188
 
        //x=x1;
189
 
        //y=y1;
 
175
 
 
176
        // make texture coordinates not too big, wrap them around.
 
177
        // unfortunately, we need to transform them with tm, then clamp them,
 
178
        // then transform them back.
 
179
        double x2 = x1*tm[0][0] + y1*tm[1][0];
 
180
        double y2 = x1*tm[0][1] + y1*tm[1][1];
 
181
        x2-=floor(x2);
 
182
        y2-=floor(y2);
 
183
        REAL x = x2*tm[0][0] + y1*tm[0][1];
 
184
        REAL y = x2*tm[1][0] + y1*tm[1][1];
 
185
        const REAL det=1/(.8*.8+.2*.2);
 
186
        x*=det;
 
187
        y*=det;
 
188
        //x=x1;
 
189
        //y=y1;
190
190
 
191
191
        TexMatrix();
192
192
        glLoadMatrixf(&tm[0][0]);