hardcoded gl3 shaders; extended Image; bmp writer

This commit is contained in:
aap
2016-07-19 18:40:10 +02:00
parent 14547ef830
commit 69356264d7
23 changed files with 1132 additions and 187 deletions

View File

@@ -460,9 +460,9 @@ rasterFromImage(Raster *raster, Image *image)
in = image->palette;
out = (uint8*)natras->palette;
for(int32 i = 0; i < pallength; i++){
out[0] = in[2];
out[0] = in[0];
out[1] = in[1];
out[2] = in[0];
out[2] = in[2];
out[3] = in[3];
in += 4;
out += 4;
@@ -537,7 +537,7 @@ rasterToImage(Raster *raster)
if((raster->format & Raster::PAL4) == Raster::PAL4){
depth = 4;
pallength = 16;
}else if((raster->format & Raster::PAL4) == Raster::PAL8){
}else if((raster->format & Raster::PAL8) == Raster::PAL8){
depth = 8;
pallength = 256;
}
@@ -550,9 +550,9 @@ rasterToImage(Raster *raster)
out = image->palette;
in = (uint8*)natras->palette;
for(int32 i = 0; i < pallength; i++){
out[0] = in[2];
out[0] = in[0];
out[1] = in[1];
out[2] = in[0];
out[2] = in[2];
out[3] = in[3];
in += 4;
out += 4;

View File

@@ -7,6 +7,7 @@
#include "../rwplg.h"
#include "../rwpipeline.h"
#include "../rwobjects.h"
#include "../rwengine.h"
#include "rwd3d.h"
namespace rw {
@@ -224,7 +225,7 @@ beginUpdate(Camera *cam)
proj[9] = cam->viewOffset.y*invwy;
proj[12] = -proj[8];
proj[13] = -proj[9];
if(cam->projection == PERSPECTIVE){
if(cam->projection == Camera::PERSPECTIVE){
proj[10] = cam->farPlane*invz;
proj[11] = 1.0f;
@@ -242,8 +243,7 @@ beginUpdate(Camera *cam)
void
initializeRender(void)
{
driver[PLATFORM_D3D8]->beginUpdate = beginUpdate;
driver[PLATFORM_D3D9]->beginUpdate = beginUpdate;
engine->beginUpdate = beginUpdate;
}
#endif