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

« back to all changes in this revision

Viewing changes to src/render/rFont.cpp

  • Committer: SwagTron
  • Date: 2019-03-24 05:43:34 UTC
  • Revision ID: swagtron-20190324054334-dhst2s4vcdpuehhd
Allowed show_position to be used made it more accurate. Was kind of odd the show_position definition wasnt also if debug, so the command was in the game just didnt do anything. 
Added /info to get general information about players. Stuff /players and /colors wouldnt show. Displays: Colored Name, Position, Direction, Used Rubber out of max, Speed, Spectating / Playing, Chatting, Sometimes Alive / Dead
Usage: /info - Returns own information
       /info playername - Returns that players name. (or more depending if the search word is found in more than one player) 
Fixed the /colors command a bit, also moved the function to a proper spot and made the output editable (added player_colors_text)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "rScreen.h"
30
30
#include "tConfiguration.h"
31
31
#include "tColor.h"
32
 
#include "eFloor.h"
33
32
#include <ctype.h>
34
33
 
35
34
#ifndef DEDICATED
196
195
 
197
196
// **************************************************
198
197
 
199
 
static REAL sr_bigFontThresholdWidth  = 0;
200
 
static REAL sr_bigFontThresholdHeight = 0;
 
198
static REAL sr_bigFontThresholdWidth  = 12;
 
199
static REAL sr_bigFontThresholdHeight = 24;
201
200
 
202
 
static tConfItem< REAL > sr_bigFontThresholdWidthConf(  "FONT_BIG_THRESHOLD_WIDTH", sr_bigFontThresholdWidth );
203
 
static tConfItem< REAL > sr_bigFontThresholdHeightConf( "FONT_BIG_THRESHOLD_HEIGHT", sr_bigFontThresholdHeight );
 
201
static tSettingItem< REAL > sr_bigFontThresholdWidthConf(  "FONT_BIG_THRESHOLD_WIDTH", sr_bigFontThresholdWidth );
 
202
static tSettingItem< REAL > sr_bigFontThresholdHeightConf( "FONT_BIG_THRESHOLD_HEIGHT", sr_bigFontThresholdHeight );
204
203
 
205
204
static REAL sr_smallFontThresholdWidth  = 5;
206
205
static REAL sr_smallFontThresholdHeight = 8;
207
206
 
208
 
static tConfItem< REAL > sr_smallFontThresholdWidthConf(  "FONT_SMALL_THRESHOLD_WIDTH", sr_smallFontThresholdWidth );
209
 
static tConfItem< REAL > sr_smallFontThresholdHeightConf( "FONT_SMALL_THRESHOLD_HEIGHT", sr_smallFontThresholdHeight );
 
207
static tSettingItem< REAL > sr_smallFontThresholdWidthConf(  "FONT_SMALL_THRESHOLD_WIDTH", sr_smallFontThresholdWidth );
 
208
static tSettingItem< REAL > sr_smallFontThresholdHeightConf( "FONT_SMALL_THRESHOLD_HEIGHT", sr_smallFontThresholdHeight );
210
209
 
211
210
rTextField::rTextField(REAL Left,REAL Top,
212
211
                       REAL Cwidth,REAL Cheight,
271
270
static bool sr_renderBrightBackground = false;
272
271
static tConfItem<bool> rbb("TEXT_BRIGHT_BACKGROUND",sr_renderBrightBackground);
273
272
 
274
 
static bool sr_renderBrighenText = true;
275
 
static tConfItem<bool> rbt("TEXT_BRIGHTEN",sr_renderBrighenText);
276
 
 
277
273
void rTextField::FlushLine(int len,bool newline){
278
274
#ifndef DEDICATED
279
275
    // reload textures if alpha blending changed
332
328
            glEnable(GL_TEXTURE_2D);
333
329
        }
334
330
 
335
 
        //Text too dark lets brighten it
336
 
        if ( color_.IsDark() && sr_renderBrighenText)
337
 
        {
338
 
            se_MakeColorValid(r,g,b,1.0f);
339
 
        }
340
 
 
341
331
 
342
332
        if ( len > 0 )
343
333
        {