mirror of
https://github.com/aap/librw.git
synced 2025-12-19 17:09:51 +00:00
fixed sky mipmap stream write; experimented with software pipeline
This commit is contained in:
@@ -1454,7 +1454,7 @@ unswizzle16to4(uint8 *dst, uint8 *src, int32 w, int32 h)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
expandPSMT4(uint8 *dst, uint8 *src, int32 w, int32 h, int32 srcw)
|
||||
{
|
||||
int32 x, y;
|
||||
@@ -1465,7 +1465,7 @@ expandPSMT4(uint8 *dst, uint8 *src, int32 w, int32 h, int32 srcw)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
copyPSMT8(uint8 *dst, uint8 *src, int32 w, int32 h, int32 srcw)
|
||||
{
|
||||
int32 x, y;
|
||||
@@ -1620,7 +1620,7 @@ createNativeRaster(void *object, int32 offset, int32)
|
||||
Ps2Raster *raster = PLUGINOFFSET(Ps2Raster, object, offset);
|
||||
raster->tex0 = 0;
|
||||
raster->paletteBase = 0;
|
||||
raster->kl = 0xFC0;
|
||||
raster->kl = defaultMipMapKL;
|
||||
raster->tex1low = 0;
|
||||
raster->unk2 = 0;
|
||||
raster->miptbp1 = 0;
|
||||
@@ -1668,8 +1668,10 @@ static Stream*
|
||||
writeMipmap(Stream *stream, int32, void *object, int32 offset, int32)
|
||||
{
|
||||
Texture *tex = (Texture*)object;
|
||||
if(tex->raster)
|
||||
return nil;
|
||||
if(tex->raster){
|
||||
stream->writeI32(defaultMipMapKL);
|
||||
return stream;
|
||||
}
|
||||
Ps2Raster *raster = PLUGINOFFSET(Ps2Raster, tex->raster, offset);
|
||||
stream->writeI32(raster->kl);
|
||||
return stream;
|
||||
@@ -1873,6 +1875,10 @@ streamExt.mipmapVal);
|
||||
calcTEX1(raster, &tex1, tex->filterAddressing & 0xF);
|
||||
// printTEX1(tex1);
|
||||
|
||||
// TODO: GTA SA LD_OTB.txd loses here
|
||||
assert(natras->pixelSize >= streamExt.pixelSize);
|
||||
assert(natras->paletteSize >= streamExt.paletteSize);
|
||||
|
||||
natras->tex0 = streamExt.tex0;
|
||||
natras->paletteBase = streamExt.paletteOffset;
|
||||
natras->tex1low = streamExt.tex1low;
|
||||
|
||||
@@ -220,5 +220,8 @@ Texture *readNativeTexture(Stream *stream);
|
||||
void writeNativeTexture(Texture *tex, Stream *stream);
|
||||
uint32 getSizeNativeTexture(Texture *tex);
|
||||
|
||||
void expandPSMT4(uint8 *dst, uint8 *src, int32 w, int32 h, int32 srcw);
|
||||
void copyPSMT8(uint8 *dst, uint8 *src, int32 w, int32 h, int32 srcw);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user