Wing Commander II
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
suffix.c
Go to the documentation of this file.
1/*
2 * Graphics file suffixes and character conversion.
3 *
4 * Retail object 0x42BAC0-0x42BB6F (link order; see docs/ORDER.md).
5 */
6#include "game.h"
7
8/* Function start: 0x42BAC0 */
9void FillGraphicSuffix(char *path, short number, short digits)
10{
11 char *dot;
12 char *extension;
13
14 extension = DosStrchr(path, '.');
15 dot = extension;
16 extension++;
17 if (dot == 0)
18 extension = path;
19 extension[digits] = '\0';
20 ConvertChar_Int(extension, number, digits);
21}
22
23/* Function start: 0x42BB17 */
24void ConvertChar_Int(char *text, short number, short digits)
25{
26 while (digits--) {
27 text[digits] = (char)(number % 10) + '0';
28 number /= 10;
29 }
30}
void FillGraphicSuffix(char *path, short number, short digits)
Definition suffix.c:9
char * DosStrchr(const char *s, short c)
Definition eventmgr.c:459
void ConvertChar_Int(char *text, short number, short digits)
Definition suffix.c:24
Shared Win32 declarations, types and library interfaces.