Hi,
attached patch removes the font.h header file. There was no
implementation for any of the function defined there. Patch patch also
removes all of the callers of there functions, which all were commented
out.
Regards,
Stefan
Index: src/design.c
===================================================================
--- src/design.c (revision 998)
+++ src/design.c (working copy)
@@ -297,7 +297,6 @@
extern W_SCREEN *psWScreen;
/* the widget font */
-//extern PROP_FONT *psWFont;
extern int WFont;
extern UDWORD objID; // unique ID creation thing..
Index: src/hci.c
===================================================================
--- src/hci.c (revision 998)
+++ src/hci.c (working copy)
@@ -282,7 +282,6 @@
/* the widget font */
-//PROP_FONT *psWFont;
int WFont; // Ivis Font ID.
@@ -576,8 +575,6 @@
/* Initialise the in game interface */
BOOL intInitialise(void)
{
-// UBYTE *pFileBuffer;
-// UDWORD fileSize;
UDWORD comp, inc;
AllocateSnapBuffer(&InterfaceSnap,MAX_INTERFACE_SNAPS);
@@ -716,19 +713,6 @@
}
#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,9 +834,7 @@
// widgEndScreen(psWScreen);
widgReleaseScreen(psWScreen);
-// fontFree(psWFont);
-
#ifdef DISP2D
ed2dShutDown();
#endif
Index: lib/widget/editbox.c
===================================================================
--- lib/widget/editbox.c (revision 998)
+++ lib/widget/editbox.c (working copy)
@@ -67,9 +67,6 @@
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 @@
(*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 @@
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 @@
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 @@
{
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 @@
#endif
psEdBox = (W_EDITBOX *)psWidget;
-// psCurrFont = psEdBox->psFont;
CurrFontID = psEdBox->FontID;
x0=psEdBox->x + xOffset;
@@ -728,10 +718,8 @@
}
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 @@
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));
}
Index: lib/widget/editbox.h
===================================================================
--- lib/widget/editbox.h (revision 998)
+++ lib/widget/editbox.h (working copy)
@@ -43,7 +43,6 @@
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
Index: lib/widget/button.c
===================================================================
--- lib/widget/button.c (revision 998)
+++ lib/widget/button.c (working copy)
@@ -53,14 +53,6 @@
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 @@
{
(*ppsWidget)->display = buttonDisplay;
}
-// (*ppsWidget)->psFont = psInit->psFont;
(*ppsWidget)->FontID = psInit->FontID;
buttonInitialise(*ppsWidget);
@@ -351,14 +342,12 @@
{
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;
Index: lib/widget/label.c
===================================================================
--- lib/widget/label.c (revision 998)
+++ lib/widget/label.c (working copy)
@@ -47,9 +47,6 @@
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 @@
(*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 @@
{
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 @@
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 */
Index: lib/widget/button.h
===================================================================
--- lib/widget/button.h (revision 998)
+++ lib/widget/button.h (working copy)
@@ -49,7 +49,6 @@
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;
Index: lib/widget/widget.c
===================================================================
--- lib/widget/widget.c (revision 998)
+++ lib/widget/widget.c (working copy)
@@ -367,16 +367,6 @@
#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)
{
Index: lib/widget/label.h
===================================================================
--- lib/widget/label.h (revision 998)
+++ lib/widget/label.h (working copy)
@@ -38,7 +38,6 @@
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;
Index: lib/widget/widget.h
===================================================================
--- lib/widget/widget.h (revision 998)
+++ lib/widget/widget.h (working copy)
@@ -186,7 +186,6 @@
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 @@
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 @@
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.
Index: lib/widget/widgbase.h
===================================================================
--- lib/widget/widgbase.h (revision 998)
+++ lib/widget/widgbase.h (working copy)
@@ -89,7 +89,6 @@
{
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;
Index: lib/widget/tip.c
===================================================================
--- lib/widget/tip.c (revision 998)
+++ lib/widget/tip.c (working copy)
@@ -60,7 +60,6 @@
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 @@
* 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 @@
"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" );
Index: lib/framework/font.h
===================================================================
--- lib/framework/font.h (revision 998)
+++ lib/framework/font.h (working copy)
@@ -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
Index: lib/framework/Makefile.am
===================================================================
--- lib/framework/Makefile.am (revision 998)
+++ lib/framework/Makefile.am (working copy)
@@ -10,7 +10,7 @@
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
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev