diff options
author | Ton Roosendaal <ton@blender.org> | 2006-12-20 22:29:37 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-12-20 22:29:37 +0300 |
commit | 496410a255376d2e09f8d990501cf8847e794f1b (patch) | |
tree | c5fe95f2d2ff11490fdd95c785b085db3a45985e /source/gameengine/GamePlayer/common | |
parent | b95d5bbf444fb405dcad8cf9732d3fc525e456cc (diff) |
GamePlayer: now uses new Image API calls too, so it compiles.
Diffstat (limited to 'source/gameengine/GamePlayer/common')
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp | 43 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 2 |
2 files changed, 21 insertions, 24 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp index 97cf89e963f..5b3c2c84edb 100644 --- a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp +++ b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp @@ -100,7 +100,7 @@ static int smaller_pow2(int num) { static void my_make_repbind(Image *ima) { - if(ima==0 || ima->ibuf==0) return; + if(ima==0 || ima->ibufs.first==0) return; if(ima->repbind) { glDeleteTextures(ima->totbind, (GLuint*)ima->repbind); @@ -221,23 +221,20 @@ int set_tpage(MTFace *tface) return 0; } + + ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); + + if(ibuf==0) { + ima->ok= 0; - if(ima->ibuf==0) { - load_image(ima, IB_rect, "", 0); - - if(ima->ibuf==0) { - ima->ok= 0; - - fCurtile= tface->tile; - fCurpage= 0; - fCurmode= tilemode; - fCurTileXRep = tileXRep; - fCurTileYRep = tileYRep; - - glDisable(GL_TEXTURE_2D); - return 0; - } + fCurtile= tface->tile; + fCurpage= 0; + fCurmode= tilemode; + fCurTileXRep = tileXRep; + fCurTileYRep = tileYRep; + glDisable(GL_TEXTURE_2D); + return 0; } if(ima->tpageflag & IMA_TWINANIM) fCurtile= ima->lastframe; @@ -255,8 +252,8 @@ int set_tpage(MTFace *tface) if(*bind==0) { - fTexWindx= ima->ibuf->x/ima->xrep; - fTexWindy= ima->ibuf->y/ima->yrep; + fTexWindx= ibuf->x/ima->xrep; + fTexWindy= ibuf->y/ima->yrep; if(fCurtile>=ima->xrep*ima->yrep) fCurtile= ima->xrep*ima->yrep-1; @@ -269,16 +266,16 @@ int set_tpage(MTFace *tface) tpx= fTexWindx; tpy= fTexWindy; - rect= ima->ibuf->rect + fTexWinsy*ima->ibuf->x + fTexWinsx; + rect= ibuf->rect + fTexWinsy*ibuf->x + fTexWinsx; } } else { bind= &ima->bindcode; if(*bind==0) { - tpx= ima->ibuf->x; - tpy= ima->ibuf->y; - rect= ima->ibuf->rect; + tpx= ibuf->x; + tpy= ibuf->y; + rect= ibuf->rect; } } @@ -299,7 +296,7 @@ int set_tpage(MTFace *tface) tilerect= (unsigned int*)MEM_mallocN(rectw*recth*sizeof(*tilerect), "tilerect"); for (y=0; y<recth; y++) { - unsigned int *rectrow= &rect[y*ima->ibuf->x]; + unsigned int *rectrow= &rect[y*ibuf->x]; unsigned int *tilerectrow= &tilerect[y*rectw]; memcpy(tilerectrow, rectrow, tpx*sizeof(*rectrow)); diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 59a49c05b3c..0f6bec30437 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -312,7 +312,7 @@ void GPC_RenderTools::BL_RenderText( // space starts at offset 1 // character = character - ' ' + 1; - matrixGlyph(ima->ibuf, character, & centerx, ¢ery, &sizex, &sizey, &transx, &transy, &movex, &movey, &advance); + matrixGlyph((ImBuf *)ima->ibufs.first, character, & centerx, ¢ery, &sizex, &sizey, &transx, &transy, &movex, &movey, &advance); glBegin(GL_POLYGON); // printf(" %c %f %f %f %f\n", character, tface->uv[0][0], tface->uv[0][1], ); |