]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
getimagesize(): return '0 0 0' for missing texture (previously the size of the notext...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 3 Jan 2012 16:32:45 +0000 (16:32 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 3 Jan 2012 16:30:22 +0000 (17:30 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11631 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=c64899c50bbe92c4f85528170b6802395fe3dffa

prvm_cmds.c

index 217d897d8464e8155c319d442d57199d474a07bc..f3f38d625dbe9cd4e10cc11521d5677a9e4e5f4c 100644 (file)
@@ -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;
 }