Skip to content

Commit

Permalink
image masks and raster fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aap committed Jul 22, 2020
1 parent 853fa44 commit 4883b03
Show file tree
Hide file tree
Showing 10 changed files with 569 additions and 71 deletions.
2 changes: 1 addition & 1 deletion src/d3d/d3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ rasterFromImage(Raster *raster, Image *image)
truecolimg->pixels = image->pixels;
truecolimg->stride = image->stride;
truecolimg->palette = image->palette;
truecolimg->unindex();
truecolimg->unpalettize();
image = truecolimg;
}

Expand Down
18 changes: 9 additions & 9 deletions src/gl/gl3raster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,42 +371,42 @@ rasterFromImage(Raster *raster, Image *image)
truecolimg->pixels = image->pixels;
truecolimg->stride = image->stride;
truecolimg->palette = image->palette;
truecolimg->unindex();
truecolimg->unpalettize();
image = truecolimg;
}

Gl3Raster *natras = PLUGINOFFSET(Gl3Raster, raster, nativeRasterOffset);
switch(image->depth){
case 32:
#ifdef RW_GLES
conv = conv_RGBA8888_to_RGBA8888;
conv = conv_RGBA8888_from_RGBA8888;
#else
if(raster->format == Raster::C8888)
conv = conv_RGBA8888_to_RGBA8888;
conv = conv_RGBA8888_from_RGBA8888;
else if(raster->format == Raster::C888)
conv = conv_RGB888_to_RGB888;
conv = conv_RGB888_from_RGB888;
else
goto err;
#endif
break;
case 24:
#ifdef RW_GLES
conv = conv_RGB888_to_RGBA8888;
conv = conv_RGB888_from_RGBA8888;
#else
if(raster->format == Raster::C8888)
conv = conv_RGB888_to_RGBA8888;
conv = conv_RGBA8888_from_RGB888;
else if(raster->format == Raster::C888)
conv = conv_RGB888_to_RGB888;
conv = conv_RGB888_from_RGB888;
else
goto err;
#endif
break;
case 16:
#ifdef RW_GLES
conv = conv_RGBA1555_to_RGBA8888;
conv = conv_RGBA8888_from_ARGB1555;
#else
if(raster->format == Raster::C1555)
conv = conv_RGBA1555_to_RGBA5551;
conv = conv_RGBA5551_from_ARGB1555;
else
goto err;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/gl/gl3shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Shader *currentShader;
static void
printShaderSource(const char **src)
{
int f, l;
int f;
const char *file;
bool printline;
int line = 1;
Expand Down
Loading

0 comments on commit 4883b03

Please sign in to comment.