From f82d20e078fc06b9c49a32e1716d69e12f361408 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 11 Mar 2008 13:36:18 +0000 Subject: [PATCH] Implemented fromwad in precache_pic as per csqc specification. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2937 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/pr_menu.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/engine/client/pr_menu.c b/engine/client/pr_menu.c index 06035f771..39b57f69d 100644 --- a/engine/client/pr_menu.c +++ b/engine/client/pr_menu.c @@ -297,13 +297,23 @@ void PF_CL_precache_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str; mpic_t *pic; + float fromwad; str = PR_GetStringOfs(prinst, OFS_PARM0); + if (*prinst->callargc > 1) + fromwad = G_FLOAT(OFS_PARM1); + else + fromwad = false; - if (cls.state && !sv.active) - CL_CheckOrEnqueDownloadFile(str, str); + if (fromwad) + pic = Draw_SafePicFromWad(str); + else + { + if (cls.state && !sv.active) + CL_CheckOrEnqueDownloadFile(str, str); - pic = Draw_SafeCachePic(str); + pic = Draw_SafeCachePic(str); + } if (pic) G_INT(OFS_RETURN) = G_INT(OFS_PARM0);