When backbuf doesn't exist, it crashed during render... Fixed!
authorTon Roosendaal <ton@blender.org>
Fri, 27 May 2005 13:28:26 +0000 (13:28 +0000)
committerTon Roosendaal <ton@blender.org>
Fri, 27 May 2005 13:28:26 +0000 (13:28 +0000)
source/blender/render/intern/source/pixelshading.c

index 8a2992b7795c02a0733bea861d9bde0c84d2ff62..0071195abcea0de905ae719d437a8caa91e4066b 100644 (file)
@@ -592,7 +592,7 @@ void shadeSkyPixel(RE_COLBUFTYPE *collector, float fx, float fy)
 
        /* 1. Do a backbuffer image: */ 
        if(R.r.bufflag & 1) {
 
        /* 1. Do a backbuffer image: */ 
        if(R.r.bufflag & 1) {
-               if(R.backbuf) fillBackgroundImage(collector, fx, fy);
+               fillBackgroundImage(collector, fx, fy);
                return;
        } else if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
                /*
                return;
        } else if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
                /*
@@ -731,9 +731,9 @@ void fillBackgroundImageChar(char *col, float x, float y)
        int iy, ix;
        unsigned int* imBufPtr;
        
        int iy, ix;
        unsigned int* imBufPtr;
        
-       /* This double check is bad... */
-       if (!(R.backbuf->ok)) {
-               /* Something went sour here... bail... */
+       /* check to be sure... */
+       if (R.backbuf==NULL || R.backbuf->ok==0) {
+               /* bail out */
                col[0] = 0;
                col[1] = 0;
                col[2] = 0;
                col[0] = 0;
                col[1] = 0;
                col[2] = 0;