Remove the font.h header file (which had no implementation)
Remove all callers (which all were commented out) The 'real' font implementation used lives in ivis_ git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1357 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
7c9f1d19af
commit
8c517891ea
|
@ -10,7 +10,7 @@ BUILT_SOURCES = resource_parser.tab.h strres_parser.tab.h
|
|||
CLEANFILES = resource_parser.tab.h strres_parser.tab.h
|
||||
|
||||
noinst_LIBRARIES = libframework.a
|
||||
noinst_HEADERS = configfile.h cursors.h cursors16.h debug.h font.h fractions.h frame.h \
|
||||
noinst_HEADERS = configfile.h cursors.h cursors16.h debug.h fractions.h frame.h \
|
||||
frameint.h frameresource.h heap.h input.h listmacs.h mem.h resly.h \
|
||||
strres.h strresly.h treap.h treapint.h trig.h types.h
|
||||
|
||||
|
|
|
@ -1,130 +0,0 @@
|
|||
/*
|
||||
This file is part of Warzone 2100.
|
||||
Copyright (C) 1999-2004 Eidos Interactive
|
||||
Copyright (C) 2005-2007 Warzone Resurrection Project
|
||||
|
||||
Warzone 2100 is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Warzone 2100 is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Warzone 2100; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/*! \file font.h
|
||||
* \brief Definitions for the font system.
|
||||
*/
|
||||
#ifndef _font_h
|
||||
#define _font_h
|
||||
|
||||
/* Check the header files have been included from frame.h if they
|
||||
* are used outside of the framework library.
|
||||
*/
|
||||
#if !defined(_frame_h) && !defined(FRAME_LIB_INCLUDE)
|
||||
#error Framework header files MUST be included from Frame.h ONLY.
|
||||
#endif
|
||||
|
||||
/*************************************************************************************
|
||||
*
|
||||
* Definitions for the fixed size font
|
||||
*
|
||||
*/
|
||||
#define PRINTABLE_START 32
|
||||
#define PRINTABLE_CHARS 97
|
||||
|
||||
#define FONT_WIDTH 8
|
||||
#define FONT_HEIGHT 14
|
||||
|
||||
extern UBYTE aFontData[PRINTABLE_CHARS][FONT_HEIGHT];
|
||||
|
||||
/*************************************************************************************
|
||||
*
|
||||
* Definitions for proportional fonts.
|
||||
*
|
||||
*/
|
||||
|
||||
// these are file formats ... and hence can not be altered !!!!!
|
||||
/* The data for a single proportional font character */
|
||||
typedef struct _prop_char
|
||||
{
|
||||
/* The number of pixels across the character */
|
||||
UWORD width;
|
||||
/* The number of bytes used to store one horizontal line of the character */
|
||||
UWORD pitch;
|
||||
|
||||
/* The pixel data
|
||||
* This is a square array of bytes wide enough to store width bits
|
||||
* and the same height as the font.
|
||||
*/
|
||||
UBYTE *pData;
|
||||
} PROP_CHAR;
|
||||
|
||||
/* Store ranges of character codes that are printable */
|
||||
typedef struct _prop_printable
|
||||
{
|
||||
UWORD end; // End of the character code range covered by this struct
|
||||
UWORD offset; // Amount to subtract from char code if this range
|
||||
// is printable
|
||||
BOOL printable; // Whether the range is printable
|
||||
} PROP_PRINTABLE;
|
||||
|
||||
/* The proportional font data */
|
||||
typedef struct _prop_font
|
||||
{
|
||||
UWORD height; // Number of pixels high
|
||||
UWORD spaceWidth; // Number of pixels gap to leave for a space
|
||||
UWORD baseLine; // Position of bottom of letters with no tail
|
||||
// i.e. where the line on lined paper would be
|
||||
// This is relative to the absolute bottom of all characters.
|
||||
|
||||
UWORD numOffset; // Number of PROP_OFFSET stored
|
||||
UWORD numChars; // Number of PROP_CHARS stored
|
||||
|
||||
PROP_PRINTABLE *psOffset;
|
||||
PROP_CHAR *psChars;
|
||||
} PROP_FONT;
|
||||
|
||||
/* Set the current font */
|
||||
extern void fontSet(PROP_FONT *psFont);
|
||||
|
||||
/* Get the current font */
|
||||
extern PROP_FONT *fontGet(void);
|
||||
|
||||
/* Set the current font colour */
|
||||
extern void fontSetColour(UBYTE red, UBYTE green, UBYTE blue);
|
||||
|
||||
/* Set the value to be poked into screen memory for font drawing.
|
||||
* The colour value used should be one returned by screenGetCacheColour.
|
||||
*/
|
||||
extern void fontSetCacheColour(UDWORD colour);
|
||||
|
||||
/* Print text in the current font at location x,y */
|
||||
extern void fontPrint(SDWORD x, SDWORD y, char *pFormat, ...);
|
||||
|
||||
/* Directly print a single font character from the PROP_CHAR struct */
|
||||
extern void fontPrintChar(SDWORD x,SDWORD y, PROP_CHAR *psChar, UDWORD height);
|
||||
|
||||
/* Return the pixel width of a string */
|
||||
extern UDWORD fontPixelWidth(char *pString);
|
||||
|
||||
/* Return the index into the PROP_CHAR array for a character code.
|
||||
* If the code isn't printable, return 0 (space).
|
||||
*/
|
||||
extern UWORD fontGetCharIndex(UWORD code);
|
||||
|
||||
/* Save font information into a file buffer */
|
||||
extern BOOL fontSave(PROP_FONT *psFont, UBYTE **ppFileData, UDWORD *pFileSize);
|
||||
|
||||
/* Load in a font file */
|
||||
extern BOOL fontLoad(UBYTE *pFileData, UDWORD fileSize, PROP_FONT **ppsFont);
|
||||
|
||||
/* Release all the memory used by a font */
|
||||
extern void fontFree(PROP_FONT *psFont);
|
||||
|
||||
#endif
|
|
@ -53,14 +53,6 @@ BOOL buttonCreate(W_BUTTON **ppsWidget, W_BUTINIT *psInit)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
//#ifdef DEBUG
|
||||
// if (psInit->pText)
|
||||
// {
|
||||
// ASSERT( psInit->psFont != NULL,
|
||||
// "buttonCreate: Invalid font pointer" );
|
||||
// }
|
||||
//#endif
|
||||
|
||||
/* Allocate the required memory */
|
||||
#if W_USE_MALLOC
|
||||
*ppsWidget = (W_BUTTON *)MALLOC(sizeof(W_BUTTON));
|
||||
|
@ -138,7 +130,6 @@ BOOL buttonCreate(W_BUTTON **ppsWidget, W_BUTINIT *psInit)
|
|||
{
|
||||
(*ppsWidget)->display = buttonDisplay;
|
||||
}
|
||||
// (*ppsWidget)->psFont = psInit->psFont;
|
||||
(*ppsWidget)->FontID = psInit->FontID;
|
||||
|
||||
buttonInitialise(*ppsWidget);
|
||||
|
@ -351,14 +342,12 @@ void buttonDisplay(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pCo
|
|||
{
|
||||
W_BUTTON *psButton;
|
||||
SDWORD x0,y0,x1,y1, fx,fy,fw;
|
||||
// PROP_FONT *psCurrFont;
|
||||
int CurrFontID;
|
||||
|
||||
ASSERT( psWidget != NULL,
|
||||
"buttonDisplay: Invalid widget pointer" );
|
||||
|
||||
psButton = (W_BUTTON *)psWidget;
|
||||
// psCurrFont = psButton->psFont;
|
||||
CurrFontID = psButton->FontID;
|
||||
|
||||
x0=psButton->x + xOffset;
|
||||
|
|
|
@ -49,7 +49,6 @@ typedef struct _w_button
|
|||
SWORD HilightAudioID; // Audio ID for form clicked sound
|
||||
SWORD ClickedAudioID; // Audio ID for form hilighted sound
|
||||
WIDGET_AUDIOCALLBACK AudioCallback; // Pointer to audio callback function
|
||||
// PROP_FONT *psFont; // button font
|
||||
int FontID;
|
||||
} W_BUTTON;
|
||||
|
||||
|
|
|
@ -67,9 +67,6 @@ BOOL editBoxCreate(W_EDITBOX **ppsWidget, W_EDBINIT *psInit)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// ASSERT( psInit->psFont != NULL,
|
||||
// "editBoxCreate: Invalid font pointer" );
|
||||
|
||||
/* Allocate the required memory */
|
||||
#if W_USE_MALLOC
|
||||
*ppsWidget = (W_EDITBOX *)MALLOC(sizeof(W_EDITBOX));
|
||||
|
@ -91,7 +88,6 @@ BOOL editBoxCreate(W_EDITBOX **ppsWidget, W_EDBINIT *psInit)
|
|||
(*ppsWidget)->y = psInit->y;
|
||||
(*ppsWidget)->width = psInit->width;
|
||||
(*ppsWidget)->height = psInit->height;
|
||||
// (*ppsWidget)->psFont = psInit->psFont;
|
||||
(*ppsWidget)->FontID = psInit->FontID;
|
||||
if (psInit->pDisplay)
|
||||
{
|
||||
|
@ -303,13 +299,11 @@ static void fitStringStart(char *pBuffer, UDWORD boxWidth, UWORD *pCount, UWORD
|
|||
UDWORD len;
|
||||
UWORD printWidth, printChars, width;
|
||||
char *pCurr;
|
||||
// PROP_FONT *psCurrFont;
|
||||
|
||||
len = strlen(pBuffer);
|
||||
printWidth = 0;
|
||||
printChars = 0;
|
||||
pCurr = pBuffer;
|
||||
// psCurrFont = fontGet();
|
||||
|
||||
/* Find the number of characters that will fit in boxWidth */
|
||||
while (printChars < len)
|
||||
|
@ -338,11 +332,9 @@ static void fitStringEnd(char *pBuffer, UDWORD boxWidth,
|
|||
UDWORD len;
|
||||
UWORD printWidth, printChars, width;
|
||||
char *pCurr;
|
||||
// PROP_FONT *psCurrFont;
|
||||
|
||||
len = strlen(pBuffer);
|
||||
|
||||
// psCurrFont = fontGet();
|
||||
pCurr = pBuffer + len - 1;
|
||||
printChars = 0;
|
||||
printWidth = 0;
|
||||
|
@ -700,7 +692,6 @@ void editBoxDisplay(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pC
|
|||
{
|
||||
W_EDITBOX *psEdBox;
|
||||
SDWORD x0,y0,x1,y1, fx,fy, cx,cy;
|
||||
// PROP_FONT *psCurrFont;
|
||||
int CurrFontID;
|
||||
char ch, *pInsPoint, *pPrint;
|
||||
#if CURSOR_BLINK
|
||||
|
@ -708,7 +699,6 @@ void editBoxDisplay(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pC
|
|||
#endif
|
||||
|
||||
psEdBox = (W_EDITBOX *)psWidget;
|
||||
// psCurrFont = psEdBox->psFont;
|
||||
CurrFontID = psEdBox->FontID;
|
||||
|
||||
x0=psEdBox->x + xOffset;
|
||||
|
@ -728,10 +718,8 @@ void editBoxDisplay(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pC
|
|||
}
|
||||
|
||||
fx = x0 + WEDB_XGAP;// + (psEdBox->width - fw) / 2;
|
||||
// fy = y0 + (psEdBox->height - psCurrFont->height + psCurrFont->baseLine) / 2;
|
||||
|
||||
iV_SetFont(CurrFontID);
|
||||
// fontSet(psCurrFont);
|
||||
iV_SetTextColour((UBYTE)*(pColours + WCOL_TEXT));
|
||||
|
||||
fy = y0 + (psEdBox->height - iV_GetTextLineSize())/2 - iV_GetTextAboveBase();
|
||||
|
@ -780,7 +768,6 @@ void editBoxDisplay(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pC
|
|||
cx = x0 + WEDB_XGAP + iV_GetTextWidth(psEdBox->aText + psEdBox->printStart);
|
||||
*pInsPoint = ch;
|
||||
cy = fy;
|
||||
// cy = fy + psCurrFont->height - (psCurrFont->baseLine >> 1);
|
||||
iV_Line(cx,cy, cx + WEDB_CURSORSIZE,cy,*(pColours + WCOL_CURSOR));
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ typedef struct _w_editbox
|
|||
|
||||
UDWORD state; // The current edit box state
|
||||
char aText[WIDG_MAXSTR]; // The text in the edit box
|
||||
// PROP_FONT *psFont; // The font for the edit box
|
||||
int FontID;
|
||||
UWORD insPos; // The insertion point in the buffer
|
||||
UWORD printStart; // Where in the string appears at the far left of the box
|
||||
|
|
|
@ -47,9 +47,6 @@ BOOL labelCreate(W_LABEL **ppsWidget, W_LABINIT *psInit)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// ASSERT( psInit->psFont != NULL,
|
||||
// "labelCreate: Invalid font pointer" );
|
||||
|
||||
/* Allocate the required memory */
|
||||
#if W_USE_MALLOC
|
||||
*ppsWidget = (W_LABEL *)MALLOC(sizeof(W_LABEL));
|
||||
|
@ -101,7 +98,6 @@ BOOL labelCreate(W_LABEL **ppsWidget, W_LABINIT *psInit)
|
|||
(*ppsWidget)->callback = psInit->pCallback;
|
||||
(*ppsWidget)->pUserData = psInit->pUserData;
|
||||
(*ppsWidget)->UserData = psInit->UserData;
|
||||
// (*ppsWidget)->psFont = psInit->psFont;
|
||||
(*ppsWidget)->FontID = psInit->FontID;
|
||||
|
||||
if (psInit->pText)
|
||||
|
@ -143,15 +139,12 @@ void labelDisplay(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pCol
|
|||
{
|
||||
SDWORD fx,fy, fw;
|
||||
W_LABEL *psLabel;
|
||||
// PROP_FONT *psFont;
|
||||
int FontID;
|
||||
|
||||
psLabel = (W_LABEL *)psWidget;
|
||||
// psFont = psLabel->psFont;
|
||||
FontID = psLabel->FontID;
|
||||
|
||||
iV_SetFont(FontID);
|
||||
// fontSetCacheColour(*(pColours + WCOL_TEXT));
|
||||
iV_SetTextColour((UWORD)*(pColours + WCOL_TEXT));
|
||||
if (psLabel->style & WLAB_ALIGNCENTRE)
|
||||
{
|
||||
|
@ -168,10 +161,7 @@ void labelDisplay(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pCol
|
|||
fx = xOffset + psLabel->x;
|
||||
}
|
||||
fy = yOffset + psLabel->y + (psLabel->height - iV_GetTextLineSize())/2 - iV_GetTextAboveBase();
|
||||
// fy = yOffset + psLabel->y + (psLabel->height -
|
||||
// psFont->height + psFont->baseLine) / 2;
|
||||
iV_DrawText(psLabel->aText,fx,fy);
|
||||
// fontPrint(fx,fy, psLabel->aText);
|
||||
}
|
||||
|
||||
/* Respond to a mouse moving over a label */
|
||||
|
|
|
@ -38,7 +38,6 @@ typedef struct _w_label
|
|||
|
||||
UDWORD state; // The current button state
|
||||
char aText[WIDG_MAXSTR]; // Text on the label
|
||||
// PROP_FONT *psFont; // Font for the label
|
||||
int FontID;
|
||||
char *pTip; // The tool tip for the button
|
||||
} W_LABEL;
|
||||
|
|
|
@ -60,7 +60,6 @@ static SDWORD fx,fy; // Position of the text
|
|||
static char *pTip; // Tip text
|
||||
static UDWORD *pColours; // The colours for the tool tip
|
||||
static WIDGET *psWidget; // The button the tip is for
|
||||
//static PROP_FONT *psFont; // The font to display the tip with
|
||||
static int FontID = 0; // ID for the Ivis Font.
|
||||
static int TipColour;
|
||||
|
||||
|
@ -89,7 +88,6 @@ void widgSetTipColour(W_SCREEN *psScreen, UBYTE red, UBYTE green, UBYTE blue)
|
|||
* x,y,width,height - specify the position of the button to place the
|
||||
* tip by.
|
||||
*/
|
||||
//void tipStart(WIDGET *psSource, char *pNewTip, PROP_FONT *psNewFont,
|
||||
void tipStart(WIDGET *psSource, char *pNewTip, int NewFontID,
|
||||
UDWORD *pNewColours, SDWORD x, SDWORD y, UDWORD width, UDWORD height)
|
||||
{
|
||||
|
@ -97,8 +95,6 @@ void tipStart(WIDGET *psSource, char *pNewTip, int NewFontID,
|
|||
"tipStart: Invalid widget pointer" );
|
||||
// ASSERT( pNewTip != NULL,
|
||||
// "tipStart: Invalid tip pointer" );
|
||||
// ASSERT( psNewFont != NULL,
|
||||
// "tipStart: Invalid font pointer" );
|
||||
ASSERT( pNewColours != NULL,
|
||||
"tipStart: Invalid colours pointer" );
|
||||
|
||||
|
|
|
@ -89,7 +89,6 @@ typedef struct _w_screen
|
|||
{
|
||||
WIDGET *psForm; // The root form of the screen
|
||||
WIDGET *psFocus; // The widget that has keyboard focus
|
||||
// PROP_FONT *psTipFont; // The font for tool tips
|
||||
int TipFontID; // ID of the IVIS font to use for tool tips.
|
||||
} W_SCREEN;
|
||||
|
||||
|
|
|
@ -367,16 +367,6 @@ static BOOL widgCheckID(W_SCREEN *psScreen, UDWORD id)
|
|||
#endif
|
||||
|
||||
|
||||
///* Set the tool tip font for a screen */
|
||||
//void widgSetTipFont(W_SCREEN *psScreen, PROP_FONT *psFont)
|
||||
//{
|
||||
// ASSERT( psScreen != NULL,
|
||||
// "widgSetTipFont: Invalid screen pointer" );
|
||||
//
|
||||
// psScreen->psTipFont = psFont;
|
||||
//}
|
||||
|
||||
|
||||
/* Set the tool tip font for a screen */
|
||||
void widgSetTipFont(W_SCREEN *psScreen, int FontID)
|
||||
{
|
||||
|
|
|
@ -186,7 +186,6 @@ typedef struct _w_labinit
|
|||
|
||||
char *pText; // label text
|
||||
char *pTip; // Tool tip for the label.
|
||||
// PROP_FONT *psFont; // label font
|
||||
int FontID; // ID of the IVIS font to use for this widget.
|
||||
} W_LABINIT;
|
||||
|
||||
|
@ -198,7 +197,6 @@ typedef struct _w_butinit
|
|||
|
||||
char *pText; // button text
|
||||
char *pTip; // Tool tip text
|
||||
// PROP_FONT *psFont; // button font
|
||||
int FontID; // ID of the IVIS font to use for this widget.
|
||||
} W_BUTINIT;
|
||||
|
||||
|
@ -209,7 +207,6 @@ typedef struct _w_edbinit
|
|||
WINIT_BASE;
|
||||
|
||||
char *pText; // initial contents of the edit box
|
||||
// PROP_FONT *psFont; // edit box font
|
||||
int FontID; // ID of the IVIS font to use for this widget.
|
||||
WIDGET_DISPLAY pBoxDisplay; // Optional callback to display the form.
|
||||
FONT_DISPLAY pFontDisplay; // Optional callback to display a string.
|
||||
|
|
|
@ -297,7 +297,6 @@ char StringBuffer[STRING_BUFFER_SIZE];
|
|||
extern W_SCREEN *psWScreen;
|
||||
|
||||
/* the widget font */
|
||||
//extern PROP_FONT *psWFont;
|
||||
extern int WFont;
|
||||
|
||||
extern UDWORD objID; // unique ID creation thing..
|
||||
|
|
18
src/hci.c
18
src/hci.c
|
@ -282,7 +282,6 @@ W_SCREEN *psWScreen;
|
|||
|
||||
|
||||
/* the widget font */
|
||||
//PROP_FONT *psWFont;
|
||||
int WFont; // Ivis Font ID.
|
||||
|
||||
|
||||
|
@ -576,8 +575,6 @@ extern UWORD AsciiLookup[256];
|
|||
/* Initialise the in game interface */
|
||||
BOOL intInitialise(void)
|
||||
{
|
||||
// UBYTE *pFileBuffer;
|
||||
// UDWORD fileSize;
|
||||
UDWORD comp, inc;
|
||||
|
||||
AllocateSnapBuffer(&InterfaceSnap,MAX_INTERFACE_SNAPS);
|
||||
|
@ -716,19 +713,6 @@ BOOL intInitialise(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
// /* Load a font */
|
||||
// if (!loadFile("Serif.FNT", &pFileBuffer, &fileSize))
|
||||
// {
|
||||
// return FALSE;
|
||||
// }
|
||||
//
|
||||
// if (!fontLoad(pFileBuffer, fileSize, &psWFont))
|
||||
// {
|
||||
// FREE(pFileBuffer);
|
||||
// return FALSE;
|
||||
// }
|
||||
// FREE(pFileBuffer);
|
||||
|
||||
LOADBARCALLBACK(); // loadingScreenCallback();
|
||||
|
||||
intInitialiseGraphics();
|
||||
|
@ -850,8 +834,6 @@ void intShutDown(void)
|
|||
// widgEndScreen(psWScreen);
|
||||
widgReleaseScreen(psWScreen);
|
||||
|
||||
// fontFree(psWFont);
|
||||
|
||||
|
||||
#ifdef DISP2D
|
||||
ed2dShutDown();
|
||||
|
|
Loading…
Reference in New Issue