mirror of
https://github.com/aap/librw.git
synced 2025-12-20 17:39:49 +00:00
texture changes
This commit is contained in:
@@ -513,7 +513,6 @@ readNativeTexture(Stream *stream)
|
||||
pallength = format & Raster::PAL4 ? 32 : 256;
|
||||
if(!d3d::isP8supported){
|
||||
tex->raster = readAsImage(stream, width, height, depth, format|type, numLevels);
|
||||
Texture::s_plglist.streamRead(stream, tex);
|
||||
return tex;
|
||||
}
|
||||
}
|
||||
@@ -547,7 +546,6 @@ readNativeTexture(Stream *stream)
|
||||
}else
|
||||
stream->seek(size);
|
||||
}
|
||||
Texture::s_plglist.streamRead(stream, tex);
|
||||
return tex;
|
||||
}
|
||||
|
||||
@@ -555,9 +553,7 @@ void
|
||||
writeNativeTexture(Texture *tex, Stream *stream)
|
||||
{
|
||||
int32 chunksize = getSizeNativeTexture(tex);
|
||||
int32 plgsize = Texture::s_plglist.streamGetSize(tex);
|
||||
writeChunkHeader(stream, ID_TEXTURENATIVE, chunksize);
|
||||
writeChunkHeader(stream, ID_STRUCT, chunksize-24-plgsize);
|
||||
writeChunkHeader(stream, ID_STRUCT, chunksize-12);
|
||||
stream->writeU32(PLATFORM_D3D8);
|
||||
|
||||
// Texture
|
||||
@@ -611,7 +607,6 @@ writeNativeTexture(Texture *tex, Stream *stream)
|
||||
stream->write(data, size);
|
||||
raster->unlock(i);
|
||||
}
|
||||
Texture::s_plglist.streamWrite(stream, tex);
|
||||
}
|
||||
|
||||
uint32
|
||||
@@ -625,7 +620,6 @@ getSizeNativeTexture(Texture *tex)
|
||||
size += 4*256;
|
||||
for(int32 i = 0; i < levels; i++)
|
||||
size += 4 + getLevelSize(tex->raster, i);
|
||||
size += 12 + Texture::s_plglist.streamGetSize(tex);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -656,7 +656,6 @@ readNativeTexture(Stream *stream)
|
||||
}else
|
||||
stream->seek(size);
|
||||
}
|
||||
Texture::s_plglist.streamRead(stream, tex);
|
||||
return tex;
|
||||
}
|
||||
|
||||
@@ -664,9 +663,7 @@ void
|
||||
writeNativeTexture(Texture *tex, Stream *stream)
|
||||
{
|
||||
int32 chunksize = getSizeNativeTexture(tex);
|
||||
int32 plgsize = Texture::s_plglist.streamGetSize(tex);
|
||||
writeChunkHeader(stream, ID_TEXTURENATIVE, chunksize);
|
||||
writeChunkHeader(stream, ID_STRUCT, chunksize-24-plgsize);
|
||||
writeChunkHeader(stream, ID_STRUCT, chunksize-12);
|
||||
stream->writeU32(PLATFORM_D3D9);
|
||||
|
||||
// Texture
|
||||
@@ -708,7 +705,6 @@ writeNativeTexture(Texture *tex, Stream *stream)
|
||||
stream->write(data, size);
|
||||
raster->unlock(i);
|
||||
}
|
||||
Texture::s_plglist.streamWrite(stream, tex);
|
||||
}
|
||||
|
||||
uint32
|
||||
@@ -722,7 +718,6 @@ getSizeNativeTexture(Texture *tex)
|
||||
size += 4*256;
|
||||
for(int32 i = 0; i < levels; i++)
|
||||
size += 4 + getLevelSize(tex->raster, i);
|
||||
size += 12 + Texture::s_plglist.streamGetSize(tex);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -682,7 +682,6 @@ readNativeTexture(Stream *stream)
|
||||
stream->read(data, totalSize);
|
||||
raster->unlock(0);
|
||||
|
||||
Texture::s_plglist.streamRead(stream, tex);
|
||||
return tex;
|
||||
}
|
||||
|
||||
@@ -690,9 +689,7 @@ void
|
||||
writeNativeTexture(Texture *tex, Stream *stream)
|
||||
{
|
||||
int32 chunksize = getSizeNativeTexture(tex);
|
||||
int32 plgsize = Texture::s_plglist.streamGetSize(tex);
|
||||
writeChunkHeader(stream, ID_TEXTURENATIVE, chunksize);
|
||||
writeChunkHeader(stream, ID_STRUCT, chunksize-24-plgsize);
|
||||
writeChunkHeader(stream, ID_STRUCT, chunksize-12);
|
||||
stream->writeU32(PLATFORM_XBOX);
|
||||
|
||||
// Texture
|
||||
@@ -729,8 +726,6 @@ writeNativeTexture(Texture *tex, Stream *stream)
|
||||
uint8 *data = raster->lock(0);
|
||||
stream->write(data, totalSize);
|
||||
raster->unlock(0);
|
||||
|
||||
Texture::s_plglist.streamWrite(stream, tex);
|
||||
}
|
||||
|
||||
uint32
|
||||
@@ -745,7 +740,6 @@ getSizeNativeTexture(Texture *tex)
|
||||
size += 4*32;
|
||||
else if(tex->raster->format & Raster::PAL8)
|
||||
size += 4*256;
|
||||
size += 12 + Texture::s_plglist.streamGetSize(tex);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user