2006-03-20 16:43:15 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
2013-02-24 02:39:48 +00:00
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
2013-03-03 01:03:33 +00:00
|
|
|
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
2006-03-20 16:43:15 +00:00
|
|
|
*/
|
2008-02-24 14:41:27 +00:00
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
/*
|
|
|
|
*
|
2008-02-24 14:41:27 +00:00
|
|
|
* Font declarations for the game.
|
2006-03-20 16:43:15 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-01-29 04:27:36 +00:00
|
|
|
#pragma once
|
2008-02-24 14:41:27 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
2015-04-02 02:36:57 +00:00
|
|
|
#include "gr.h"
|
2012-11-11 22:12:51 +00:00
|
|
|
|
2008-02-24 14:41:27 +00:00
|
|
|
// When adding a new font, don't forget to change the filename in
|
|
|
|
// gamefont.c!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2008-02-24 14:41:27 +00:00
|
|
|
// We are interleaving low & high resolution fonts, so to access a
|
|
|
|
// font you say fontnum+flag where flag is 0 for lowres, 1 for hires
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2008-04-02 12:13:21 +00:00
|
|
|
#define GFONT_BIG_1 MacPig // the Mac data doesn't have this in hires, in the automap the scaled/hires one won't fit
|
2013-03-03 01:03:33 +00:00
|
|
|
#elif defined(DXX_BUILD_DESCENT_II)
|
|
|
|
#define GFONT_BIG_1 0
|
|
|
|
#endif
|
2008-02-24 14:41:27 +00:00
|
|
|
#define GFONT_MEDIUM_1 1
|
|
|
|
#define GFONT_MEDIUM_2 2
|
|
|
|
#define GFONT_MEDIUM_3 3
|
|
|
|
#define GFONT_SMALL 4
|
|
|
|
|
|
|
|
#define GAME_FONT (Gamefonts[GFONT_SMALL])
|
|
|
|
#define MEDIUM1_FONT (Gamefonts[GFONT_MEDIUM_1])
|
|
|
|
#define MEDIUM2_FONT (Gamefonts[GFONT_MEDIUM_2])
|
|
|
|
#define MEDIUM3_FONT (Gamefonts[GFONT_MEDIUM_3])
|
|
|
|
#define HUGE_FONT (Gamefonts[GFONT_BIG_1])
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
#define MAX_FONTS 5
|
|
|
|
|
2008-10-29 11:03:31 +00:00
|
|
|
extern float FNTScaleX, FNTScaleY;
|
2008-02-24 14:41:27 +00:00
|
|
|
|
|
|
|
// add (scaled) spacing to given font coordinate
|
2008-11-09 14:46:31 +00:00
|
|
|
#define LINE_SPACING ((float)(FNTScaleY*(grd_curcanv->cv_font->ft_h+(GAME_FONT->ft_h/5))))
|
2008-02-24 14:41:27 +00:00
|
|
|
|
2014-07-20 03:48:27 +00:00
|
|
|
extern array<grs_font_ptr, MAX_FONTS> Gamefonts;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2015-06-13 22:42:20 +00:00
|
|
|
class font_scale_float
|
|
|
|
{
|
|
|
|
const float scale;
|
|
|
|
public:
|
|
|
|
font_scale_float(float s) :
|
|
|
|
scale(s)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
float operator()(const int &i) const
|
|
|
|
{
|
|
|
|
return scale * i;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline font_scale_float FSPACX()
|
2015-06-13 22:42:20 +00:00
|
|
|
{
|
|
|
|
return FNTScaleX * (GAME_FONT->ft_w / 7);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline float FSPACX(const int &x)
|
|
|
|
{
|
2015-06-13 22:42:20 +00:00
|
|
|
return FSPACX()(x);
|
2015-06-13 22:42:20 +00:00
|
|
|
}
|
|
|
|
|
2015-06-13 22:42:20 +00:00
|
|
|
static inline font_scale_float FSPACY()
|
2015-06-13 22:42:20 +00:00
|
|
|
{
|
|
|
|
return FNTScaleY * (GAME_FONT->ft_h / 5);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline float FSPACY(const int &y)
|
|
|
|
{
|
2015-06-13 22:42:20 +00:00
|
|
|
return FSPACY()(y);
|
2015-06-13 22:42:20 +00:00
|
|
|
}
|
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
void gamefont_init();
|
|
|
|
void gamefont_close();
|
|
|
|
void gamefont_choose_game_font(int scrx,int scry);
|
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#endif
|