Wing Commander II
Reconstructed Win32 source (1996)
Toggle main menu visibility
Loading...
Searching...
No Matches
strwidth.c
Go to the documentation of this file.
1
/*
2
* Clamped text pixel width.
3
*
4
* Retail object 0x453B30-0x453BCF (link order; see docs/ORDER.md).
5
*/
6
#include "
game.h
"
7
8
#pragma function(memset, strcat)
9
/* Function start: 0x453B30 */
10
short
MeasureTextPixelWidthClamped
(
const
char
*text)
11
{
12
const
char
*scan;
13
short
total;
14
15
total = 0;
16
scan = text;
17
while
(total < 320 && *scan != 0)
18
total = (short)(total +
GetFontCharWidth
(*scan++));
19
if
(*scan-- != 0)
20
total = (short)(total -
GetFontCharWidth
(*scan));
21
return
total;
22
}
MeasureTextPixelWidthClamped
short MeasureTextPixelWidthClamped(const char *text)
Definition
strwidth.c:10
GetFontCharWidth
short GetFontCharWidth(char i)
Definition
eventmgr.c:216
game.h
Shared Win32 declarations, types and library interfaces.
src
strwidth.c
Generated by
1.18.0