Change vid_brightness/contrast/gamma cvars to float vs double and do the same for OSD text scaling

git-svn-id: https://svn.eduke32.com/eduke32@4611 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2014-09-30 04:07:57 +00:00
parent ee82c62afc
commit c97d01111a
3 changed files with 8 additions and 8 deletions

View file

@ -1569,7 +1569,7 @@ int32_t registerosdcommands(void)
{ "mus_volume", "controls volume of midi music", (void *)&ud.config.MusicVolume, CVAR_INT, 0, 255 },
{ "osdhightile", "enable/disable hires art replacements for console text", (void *)&osdhightile, CVAR_BOOL, 0, 1 },
{ "osdscale", "adjust console text size", (void *)&osdscale, CVAR_DOUBLE|CVAR_FUNCPTR, 1.f, 4.f },
{ "osdscale", "adjust console text size", (void *)&osdscale, CVAR_FLOAT|CVAR_FUNCPTR, 1.f, 4.f },
{ "r_camrefreshdelay", "minimum delay between security camera sprite updates, 120 = 1 second", (void *)&ud.camera_time, CVAR_INT, 1, 240 },
{ "r_drawweapon", "enable/disable weapon drawing", (void *)&ud.drawweapon, CVAR_INT, 0, 2 },
@ -1599,9 +1599,9 @@ int32_t registerosdcommands(void)
{ "team","change team in multiplayer", (void *)&ud.team, CVAR_INT|CVAR_MULTI, 0, 3 },
{ "vid_gamma","adjusts gamma component of gamma ramp",(void *)&vid_gamma, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
{ "vid_contrast","adjusts contrast component of gamma ramp",(void *)&vid_contrast, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
{ "vid_brightness","adjusts brightness component of gamma ramp",(void *)&vid_brightness, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
{ "vid_gamma","adjusts gamma component of gamma ramp",(void *)&vid_gamma, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
{ "vid_contrast","adjusts contrast component of gamma ramp",(void *)&vid_contrast, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
{ "vid_brightness","adjusts brightness component of gamma ramp",(void *)&vid_brightness, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
};
osdcmd_cheatsinfo_stat.cheatnum = -1;

View file

@ -30,12 +30,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
int32_t osdhightile = 1;
#ifdef __ANDROID__
double osdscale = 2.0f;
float osdscale = 2.f;
#else
double osdscale = 1.0f;
float osdscale = 1.f;
#endif
#define OSD_SCALE(x) (int32_t)(osdscale != 1.f ? lround(osdscale*(double)(x)) : x)
#define OSD_SCALE(x) (int32_t)(osdscale != 1.f ? lround(osdscale*(x)) : (x))
#define OSD_SCALEDIV(x) (int32_t)lround((x)/osdscale)
static int32_t GAME_isspace(int32_t ch)

View file

@ -29,7 +29,7 @@ void GAME_onshowosd(int32_t shown);
void GAME_clearbackground(int32_t numcols, int32_t numrows);
extern int32_t osdhightile;
extern double osdscale;
extern float osdscale;
#define OSDCHAR_WIDTH 8