Пример #1
0
void WI_loadData (void)
{
    int i, j;
    char name[9];
    anim_t *a;
    patch_t *bg;

    if ((gameinfo.flags & GI_MAPxx) ||
            ((gameinfo.flags & GI_MENUHACK_RETAIL) && wbs->epsd >= 3))
        strcpy (name, "INTERPIC");
    else
        sprintf (name, "WIMAP%d", wbs->epsd);

    // background
    bg = W_CachePatch (name);
    background = I_AllocateScreen (bg->width(), bg->height(), 8);
    background->Lock ();
    background->DrawPatch (bg, 0, 0);
    background->Unlock ();

    for (i = 0; i < 2; i++)
    {
        char *lname = (i == 0 ? wbs->lname0 : wbs->lname1);

        if (lname)
            j = W_CheckNumForName (lname);
        else
            j = -1;

        if (j >= 0)
        {
            lnames[i] = W_CachePatch (j, PU_STATIC);
        }
        else
        {
            lnames[i] = NULL;
            lnametexts[i] = FindLevelInfo (i == 0 ? wbs->current : wbs->next)->level_name;
            lnamewidths[i] = WI_CalcWidth (lnametexts[i]);
        }
    }

    if (gamemode != commercial && gamemode != commercial_bfg )
    {
        // you are here
        yah[0] = W_CachePatch ("WIURH0", PU_STATIC);

        // you are here (alt.)
        yah[1] = W_CachePatch ("WIURH1", PU_STATIC);

        // splat
        splat = W_CachePatch ("WISPLAT", PU_STATIC);

        if (wbs->epsd < 3)
        {
            for (j=0; j<NUMANIMS[wbs->epsd]; j++)
            {
                a = &anims[wbs->epsd][j];
                for (i=0; i<a->nanims; i++)
                {
                    // MONDO HACK!
                    if (wbs->epsd != 1 || j != 8)
                    {
                        // animations
                        sprintf (name, "WIA%d%.2d%.2d", wbs->epsd, j, i);
                        a->p[i] = W_CachePatch (name, PU_STATIC);
                    }
                    else
                    {
                        // HACK ALERT!
                        a->p[i] = anims[1][4].p[i];
                    }
                }
            }
        }
    }

    for (i=0; i<10; i++)
    {
        // numbers 0-9
        sprintf(name, "WINUM%d", i);
        num[i] = W_CachePatch (name, PU_STATIC);
    }

    wiminus = W_CachePatch ("WIMINUS", PU_STATIC);

    // percent sign
    percent = W_CachePatch ("WIPCNT", PU_STATIC);

    // ":"
    colon = W_CachePatch ("WICOLON", PU_STATIC);

    // "finished"
    finished = W_CachePatch ("WIF", PU_STATIC); // (Removed) Dan - Causes GUI Issues |FIX-ME|

    // "entering"
    entering = W_CachePatch ("WIENTER", PU_STATIC);

    // "kills"
    kills = W_CachePatch ("WIOSTK", PU_STATIC);

    // "items"
    items = W_CachePatch ("WIOSTI", PU_STATIC);

    // "scrt"
    scrt = W_CachePatch ("WIOSTS", PU_STATIC);

    // "secret"
    secret = W_CachePatch ("WISCRT2", PU_STATIC);

    // "frgs"
    frags = (patch_t *)W_CachePatch ("WIFRGS", PU_STATIC);

    // "time"
    timepatch = W_CachePatch ("WITIME", PU_STATIC);

    // "sucks"
    sucks =W_CachePatch ("WISUCKS", PU_STATIC);

    // "par"
    par = W_CachePatch ("WIPAR", PU_STATIC);

    // "total"
    total = (patch_t *)W_CachePatch ("WIMSTT", PU_STATIC);

    // your face
    star = (patch_t *)W_CachePatch ("STFST01", PU_STATIC);

    // dead face
    bstar = (patch_t *)W_CachePatch("STFDEAD0", PU_STATIC);

    p = W_CachePatch ("STPBANY", PU_STATIC);

    // [Nes] Classic vanilla lifebars.
    for (i = 0; i < 4; i++) {
        sprintf(name, "STPB%d", i);
        faceclassic[i] = W_CachePatch(name, PU_STATIC);
    }
}
Пример #2
0
void WI_loadData ()
{
	int i, j;
	char name[9];
	in_anim_t *a;

	if (gameinfo.gametype != GAME_Doom)
	{
		for (i = 0; i < 2; i++)
		{
			lnames[i] = NULL;
			lnametexts[i] = G_MaybeLookupLevelName (FindLevelInfo (i == 0 ? wbs->current : wbs->next));
			lnamewidths[i] = WI_CalcWidth (lnametexts[i]);
		}
		if (gameinfo.gametype == GAME_Hexen)
		{
			background = TexMan["INTERPIC"];
			return;
		}
	}

	if (gameinfo.gametype == GAME_Doom && gamemode != commercial && epsd < 3)
	{
		for (j = 0; j < NUMANIMS[epsd]; j++)
		{
			a = &anims[epsd][j];
			for (i = 0; i < a->nanims; i++)
			{
				// MONDO HACK!
				if (epsd != 1 || j != 8) 
				{
					// animations
					sprintf (name, "WIA%d%.2d%.2d", epsd, j, i);  
					a->p[i] = TexMan[name];
				}
				else
				{
					// HACK ALERT!
					a->p[i] = anims[1][4].p[i];
				}
			}
		}
	}

	if (gameinfo.gametype == GAME_Doom)
	{
		WI_DrawDoomBack ();

		for (i = 0; i < 2; i++)
		{
			char *lname = (i == 0 ? wbs->lname0 : wbs->lname1);

			j = lname && lname[0] ? TexMan.CheckForTexture (lname, FTexture::TEX_MiscPatch) : -1;

			if (j > 0)
			{
				lnames[i] = TexMan[j];
			}
			else
			{
				lnames[i] = NULL;
				if (i == 1 && strncmp (wbs->next, "enDSeQ", 6) == 0)
				{
					lnametexts[i] = NULL;
					lnamewidths[i] = 0;
				}
				else
				{
					lnametexts[i] = G_MaybeLookupLevelName (FindLevelInfo (i == 0 ? wbs->current : wbs->next));
					lnamewidths[i] = WI_CalcWidth (lnametexts[i]);
				}
			}
		}
	}
	else
	{
		background = NULL;
	}

	if (gameinfo.gametype == GAME_Doom)
	{
		if (gamemode != commercial)
		{
			yah[0] = TexMan["WIURH0"];	// you are here
			yah[1] = TexMan["WIURH1"];	// you are here (alt.]
			splat = TexMan["WISPLAT"];	// splat
		}
		wiminus = TexMan["WIMINUS"];		// minus sign
		percent = TexMan["WIPCNT"];		// percent sign
		finished = TexMan["WIF"];		// "finished"
		entering = TexMan["WIENTER"];	// "entering"
		kills = TexMan["WIOSTK"];		// "kills"
		secret = TexMan["WIOSTS"];		// "scrt"
		sp_secret = TexMan["WISCRT2"];	// "secret"
		items = TexMan["WIOSTI"];		// "items"
		frags = TexMan["WIFRGS"];		// "frgs"
		colon = TexMan["WICOLON"];		// ":"
		timepic = TexMan["WITIME"];		// "time"
		sucks = TexMan["WISUCKS"];		// "sucks"
		par = TexMan["WIPAR"];			// "par"
		killers = TexMan["WIKILRS"];		// "killers" (vertical]
		victims = TexMan["WIVCTMS"];		// "victims" (horiz]
		total = TexMan["WIMSTT"];		// "total"
		star = TexMan["STFST01"];		// your face
		bstar = TexMan["STFDEAD0"];		// dead face
 		p = TexMan["STPBANY"];

		for (i = 0; i < 10; i++)
		{ // numbers 0-9
			sprintf (name, "WINUM%d", i);	 
			num[i] = TexMan[name];
		}
	}
	else
	{
		yah[0] =
		yah[1] = TexMan["IN_YAH"];
		splat = TexMan["IN_X"];
		wiminus = TexMan["FONTB13"];
		percent = TexMan["FONTB05"];
		colon = TexMan["FONTB26"];
		slash = TexMan["FONTB15"];
		star = TexMan["FACEA0"];
		bstar = TexMan["FACEB0"];

		for (i = 0; i < 10; i++)
		{
			sprintf (name, "FONTB%d", 16 + i);
			num[i] = TexMan[name];
		}
	}
}