mirror of
https://github.com/aap/librw.git
synced 2024-11-24 20:55:41 +00:00
gl raster fixes
This commit is contained in:
parent
dfe8d1f115
commit
8f1321f194
@ -500,7 +500,8 @@ readAsImage(Stream *stream, int32 width, int32 height, int32 depth, int32 format
|
|||||||
line[0] = palette[*idx*4+0];
|
line[0] = palette[*idx*4+0];
|
||||||
line[1] = palette[*idx*4+1];
|
line[1] = palette[*idx*4+1];
|
||||||
line[2] = palette[*idx*4+2];
|
line[2] = palette[*idx*4+2];
|
||||||
line[3] = palette[*idx*4+3];
|
if(img->bpp > 3)
|
||||||
|
line[3] = palette[*idx*4+3];
|
||||||
line += img->bpp;
|
line += img->bpp;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
@ -660,6 +660,18 @@ setRasterStage(uint32 stage, Raster *raster)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evictRaster(Raster *raster)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i = 0; i < MAXNUMSTAGES; i++){
|
||||||
|
//assert(rwStateCache.texstage[i].raster != raster);
|
||||||
|
if(rwStateCache.texstage[i].raster != raster)
|
||||||
|
continue;
|
||||||
|
setRasterStage(i, nil);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
setTexture(int32 stage, Texture *tex)
|
setTexture(int32 stage, Texture *tex)
|
||||||
{
|
{
|
||||||
|
@ -818,12 +818,15 @@ createNativeRaster(void *object, int32 offset, int32)
|
|||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void evictRaster(Raster *raster);
|
||||||
|
|
||||||
static void*
|
static void*
|
||||||
destroyNativeRaster(void *object, int32 offset, int32)
|
destroyNativeRaster(void *object, int32 offset, int32)
|
||||||
{
|
{
|
||||||
Raster *raster = (Raster*)object;
|
Raster *raster = (Raster*)object;
|
||||||
Gl3Raster *natras = PLUGINOFFSET(Gl3Raster, object, offset);
|
Gl3Raster *natras = PLUGINOFFSET(Gl3Raster, object, offset);
|
||||||
#ifdef RW_OPENGL
|
#ifdef RW_OPENGL
|
||||||
|
evictRaster(raster);
|
||||||
switch(raster->type){
|
switch(raster->type){
|
||||||
case Raster::NORMAL:
|
case Raster::NORMAL:
|
||||||
case Raster::TEXTURE:
|
case Raster::TEXTURE:
|
||||||
|
Loading…
Reference in New Issue
Block a user