Exemplo n.º 1
0
int PicManagerTryInit(
	PicManager *pm, const char *oldGfxFile1, const char *oldGfxFile2)
{
	int i;
	memset(pm, 0, sizeof *pm);
	CArrayInit(&pm->pics, sizeof(NamedPic));
	CArrayInit(&pm->sprites, sizeof(NamedSprites));
	CArrayInit(&pm->customPics, sizeof(NamedPic));
	CArrayInit(&pm->customSprites, sizeof(NamedSprites));
	char buf[CDOGS_PATH_MAX];
	GetDataFilePath(buf, oldGfxFile1);
	i = ReadPics(buf, pm->oldPics, PIC_COUNT1, pm->palette);
	if (!i)
	{
		printf("Unable to read %s\n", buf);
		return 0;
	}
	GetDataFilePath(buf, oldGfxFile2);
	if (!AppendPics(buf, pm->oldPics, PIC_COUNT1, PIC_MAX))
	{
		printf("Unable to read %s\n", buf);
		return 0;
	}
	pm->palette[0].r = pm->palette[0].g = pm->palette[0].b = 0;
	return 1;
}
Exemplo n.º 2
0
void TextInit(const char *filename, int offset, int compile, int rle)
{
    int i, h;

    dxText = offset;
    memset(font, 0, sizeof(font));
    memset(compiledFont, 0, sizeof(compiledFont));
    memset(rleFont, 0, sizeof(rleFont));
    ReadPics(filename, font, CHARS_IN_FONT, NULL);

    for (i = 0; i < CHARS_IN_FONT; i++) {
        h = PicHeight(font[i]);
        if (h > hText)
            hText = h;
    }
}