From: divverent Date: Tue, 3 Jan 2012 16:32:45 +0000 (+0000) Subject: getimagesize(): return '0 0 0' for missing texture (previously the size of the notext... X-Git-Tag: xonotic-v0.6.0~86^2~1 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=c64899c50bbe92c4f85528170b6802395fe3dffa;hp=c63a96d0455acb22993ca01751d99f509e861461 getimagesize(): return '0 0 0' for missing texture (previously the size of the notexture, that is, '16 16 0') git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11631 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/prvm_cmds.c b/prvm_cmds.c index f362d36c..6490bf18 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -3911,9 +3911,16 @@ void VM_getimagesize(prvm_prog_t *prog) VM_CheckEmptyString(prog, p); pic = Draw_CachePic_Flags (p, CACHEPICFLAG_NOTPERSISTENT); - - PRVM_G_VECTOR(OFS_RETURN)[0] = pic->width; - PRVM_G_VECTOR(OFS_RETURN)[1] = pic->height; + if( Draw_CachePic_Flags(s, 0)->tex == r_texture_notexture ) + { + PRVM_G_VECTOR(OFS_RETURN)[0] = 0; + PRVM_G_VECTOR(OFS_RETURN)[1] = 0; + } + else + { + PRVM_G_VECTOR(OFS_RETURN)[0] = pic->width; + PRVM_G_VECTOR(OFS_RETURN)[1] = pic->height; + } PRVM_G_VECTOR(OFS_RETURN)[2] = 0; }