mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-19 09:34:18 +02:00
Replaced TXTPRNT.ASM with TXTPRNT.CPP from Chronoshift.
This commit is contained in:
@@ -83,11 +83,6 @@ extern int CachedIconsDrawn;
|
||||
extern int UnCachedIconsDrawn;
|
||||
|
||||
|
||||
extern "C" void __cdecl Set_Font_Palette_Range(void const *palette, INT start_idx, INT end_idx)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
;***************************************************************************
|
||||
;* VVC::DRAW_LINE -- Scales a virtual viewport to another virtual viewport *
|
||||
|
||||
+28
-28
@@ -57,14 +57,14 @@
|
||||
* 01/31/1992 DRD : Created. *
|
||||
* 06/30/1994 SKB : Converted to 32 bit library. *
|
||||
*=========================================================================*/
|
||||
int __cdecl Char_Pixel_Width(char chr)
|
||||
{
|
||||
int width;
|
||||
|
||||
width = (unsigned char)*(FontWidthBlockPtr + (unsigned char)chr) + FontXSpacing;
|
||||
|
||||
return(width);
|
||||
}
|
||||
//int __cdecl Char_Pixel_Width(char chr)
|
||||
//{
|
||||
// int width;
|
||||
//
|
||||
// width = (unsigned char)*(FontWidthBlockPtr + (unsigned char)chr) + FontXSpacing;
|
||||
//
|
||||
// return(width);
|
||||
//}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
@@ -84,26 +84,26 @@ int __cdecl Char_Pixel_Width(char chr)
|
||||
* 01/31/1992 DRD : Use Char_Pixel_Width. *
|
||||
* 06/30/1994 SKB : Converted to 32 bit library. *
|
||||
*=========================================================================*/
|
||||
unsigned int __cdecl String_Pixel_Width(char const *string)
|
||||
{
|
||||
WORD width; // Working accumulator of string width.
|
||||
WORD largest = 0; // Largest recorded width of the string.
|
||||
|
||||
if (!string) return(0);
|
||||
|
||||
width = 0;
|
||||
while (*string) {
|
||||
if (*string == '\r') {
|
||||
string++;
|
||||
largest = MAX(largest, width);
|
||||
width = 0;
|
||||
} else {
|
||||
width += Char_Pixel_Width(*string++); // add each char's width
|
||||
}
|
||||
}
|
||||
largest = MAX(largest, width);
|
||||
return(largest);
|
||||
}
|
||||
//unsigned int __cdecl String_Pixel_Width(char const *string)
|
||||
//{
|
||||
// WORD width; // Working accumulator of string width.
|
||||
// WORD largest = 0; // Largest recorded width of the string.
|
||||
//
|
||||
// if (!string) return(0);
|
||||
//
|
||||
// width = 0;
|
||||
// while (*string) {
|
||||
// if (*string == '\r') {
|
||||
// string++;
|
||||
// largest = MAX(largest, width);
|
||||
// width = 0;
|
||||
// } else {
|
||||
// width += Char_Pixel_Width(*string++); // add each char's width
|
||||
// }
|
||||
// }
|
||||
// largest = MAX(largest, width);
|
||||
// return(largest);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// TiberianDawn.DLL and RedAlert.dll and corresponding source code 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 3 of the License, or (at your option) any later version.
|
||||
|
||||
// TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
|
||||
/***************************************************************************
|
||||
** C O N F I D E N T I A L --- W E S T W O O D A S S O C I A T E S **
|
||||
***************************************************************************
|
||||
* *
|
||||
* Project Name : Westwood Library *
|
||||
* *
|
||||
* File Name : SET_FONT.C *
|
||||
* *
|
||||
* Programmer : Joe L. Bostic *
|
||||
* *
|
||||
* Start Date : September 6, 1991 *
|
||||
* *
|
||||
* Last Update : June 29, 1994 [SKB] *
|
||||
* *
|
||||
*-------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* Set_Font -- Changes the default text printing font. *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#include "font.h"
|
||||
#include <wwstd.h>
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* SET_FONT -- Changes the default text printing font. *
|
||||
* *
|
||||
* This routine will change the default text printing font for all *
|
||||
* text output. It handles updating the system where necessary. *
|
||||
* *
|
||||
* INPUT: fontptr -- Pointer to the font to change to. *
|
||||
* *
|
||||
* OUTPUT: Returns with a pointer to the previous font. *
|
||||
* *
|
||||
* WARNINGS: none *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 09/06/1991 JLB : Created. *
|
||||
* 09/17/1991 JLB : Fixed return value bug. *
|
||||
* 01/31/1992 DRD : Modified to use new font format. *
|
||||
* 06/29/1994 SKB : modified for 32 bit library *
|
||||
*=========================================================================*/
|
||||
void * __cdecl Set_Font(void const *fontptr)
|
||||
{
|
||||
void *oldfont;
|
||||
char const *blockptr;
|
||||
|
||||
oldfont = (void *) FontPtr;
|
||||
|
||||
if (fontptr) {
|
||||
FontPtr = (void *) fontptr;
|
||||
|
||||
/*
|
||||
** Inform the system about the new font.
|
||||
*/
|
||||
|
||||
FontWidthBlockPtr = (char*)fontptr + *(unsigned short *)((char*)fontptr + FONTWIDTHBLOCK);
|
||||
blockptr = (char*)fontptr + *(unsigned short *)((char*)fontptr + FONTINFOBLOCK);
|
||||
FontHeight = *(blockptr + FONTINFOMAXHEIGHT);
|
||||
FontWidth = *(blockptr + FONTINFOMAXWIDTH);
|
||||
//Draw_Char_Setup();
|
||||
|
||||
#if FALSE
|
||||
WindowLines = WinH / FontHeight;
|
||||
WindowWidth = WinW << 3;
|
||||
WindowColumns = WindowWidth / FontWidth;
|
||||
#endif
|
||||
}
|
||||
|
||||
return(oldfont);
|
||||
}
|
||||
Reference in New Issue
Block a user