mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-23 01:57:21 +03:00
Something idk
This commit is contained in:
parent
af57ea469e
commit
b0e18e4f68
1 changed files with 38 additions and 50 deletions
|
|
@ -93,24 +93,7 @@ static int clamp(int size, int targetSize)
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void debugRaster(RwRaster *r){
|
static void halveTexture(RwTexture *texture){
|
||||||
if(!r){
|
|
||||||
debug("Raster NULL");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
debug("Raster: %dx%d | depth: %d | format: 0x%X | stride: %d | platform: %d | pixels: %p",
|
|
||||||
r->width,
|
|
||||||
r->height,
|
|
||||||
r->depth,
|
|
||||||
r->format,
|
|
||||||
r->stride,
|
|
||||||
r->platform,
|
|
||||||
r->pixels);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void downscaleTexture(RwTexture *texture){
|
|
||||||
// #ifdef RW_GLES1
|
|
||||||
if(texture == nil)
|
if(texture == nil)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -167,36 +150,37 @@ static void downscaleTexture(RwTexture *texture){
|
||||||
RwImageDestroy(resized);
|
RwImageDestroy(resized);
|
||||||
RwTextureSetRaster(texture, newRaster);
|
RwTextureSetRaster(texture, newRaster);
|
||||||
RwRasterDestroy(oldRaster);
|
RwRasterDestroy(oldRaster);
|
||||||
// #else
|
}
|
||||||
// RwRaster *oldRaster = RwTextureGetRaster(texture);
|
|
||||||
// if (oldRaster == nil)
|
static void downscaleTexture(RwTexture *texture) {
|
||||||
// return;
|
RwRaster *oldRaster = RwTextureGetRaster(texture);
|
||||||
//
|
if (oldRaster == nil)
|
||||||
// extern bool moreVram;
|
return;
|
||||||
// int targetSize = moreVram ? 64 : 32;
|
|
||||||
//
|
extern bool moreVram;
|
||||||
// int oldWidth = RwRasterGetWidth(oldRaster);
|
int targetSize = moreVram ? 64 : 32;
|
||||||
// int oldHeight = RwRasterGetHeight(oldRaster);
|
|
||||||
// if (oldWidth <= targetSize && oldHeight <= targetSize) return;
|
int oldWidth = RwRasterGetWidth(oldRaster);
|
||||||
//
|
int oldHeight = RwRasterGetHeight(oldRaster);
|
||||||
// int newWidth = clamp(oldWidth, targetSize);
|
if (oldWidth <= targetSize && oldHeight <= targetSize) return;
|
||||||
// int newHeight = clamp(oldHeight, targetSize);
|
|
||||||
// if (newWidth == oldWidth && newHeight == oldHeight) return;
|
int newWidth = clamp(oldWidth, targetSize);
|
||||||
//
|
int newHeight = clamp(oldHeight, targetSize);
|
||||||
// RwImage *image = oldRaster->toImage();
|
if (newWidth == oldWidth && newHeight == oldHeight) return;
|
||||||
// if (image == nil) return;
|
|
||||||
//
|
RwImage *image = oldRaster->toImage();
|
||||||
// RwImage *resized = resizeImage(image, newWidth, newHeight);
|
if (image == nil) return;
|
||||||
// RwImageDestroy(image);
|
|
||||||
// if (resized == nil) return;
|
RwImage *resized = resizeImage(image, newWidth, newHeight);
|
||||||
//
|
RwImageDestroy(image);
|
||||||
// RwRaster *newRaster = rw::Raster::createFromImage(resized);
|
if (resized == nil) return;
|
||||||
// RwImageDestroy(resized);
|
|
||||||
// if (newRaster == nil) return;
|
RwRaster *newRaster = rw::Raster::createFromImage(resized);
|
||||||
//
|
RwImageDestroy(resized);
|
||||||
// RwTextureSetRaster(texture, newRaster);
|
if (newRaster == nil) return;
|
||||||
// RwRasterDestroy(oldRaster);
|
|
||||||
// #endif
|
RwTextureSetRaster(texture, newRaster);
|
||||||
|
RwRasterDestroy(oldRaster);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -224,9 +208,9 @@ RwTextureGtaStreamRead(RwStream *stream)
|
||||||
texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1);
|
texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1);
|
||||||
texNumLoaded++;
|
texNumLoaded++;
|
||||||
} else if (gGameState != GS_PLAYING_GAME || FrontEndMenuManager.m_bMenuActive) {
|
} else if (gGameState != GS_PLAYING_GAME || FrontEndMenuManager.m_bMenuActive) {
|
||||||
if (tex != nil && tex->raster != nil && RwRasterGetWidth(tex->raster) > 128 || RwRasterGetHeight(tex->raster) > 128) {
|
if (tex != nil && tex->raster != nil && (RwRasterGetWidth(tex->raster) > 128 || RwRasterGetHeight(tex->raster) > 128)) {
|
||||||
// debug("downscaling %s", tex->name);
|
// debug("downscaling %s", tex->name);
|
||||||
downscaleTexture(tex);
|
halveTexture(tex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -578,7 +562,11 @@ CreateTxdImageForVideoCard()
|
||||||
RwTexDictionary *texDict = CTxdStore::GetSlot(i)->texDict;
|
RwTexDictionary *texDict = CTxdStore::GetSlot(i)->texDict;
|
||||||
FORLIST(lnk, texDict->textures){
|
FORLIST(lnk, texDict->textures){
|
||||||
rw::Texture *texture = rw::Texture::fromDict(lnk);
|
rw::Texture *texture = rw::Texture::fromDict(lnk);
|
||||||
|
#ifdef RW_GL3
|
||||||
downscaleTexture(texture);
|
downscaleTexture(texture);
|
||||||
|
#else
|
||||||
|
halveTexture(texture);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
int32 pos = STREAMTELL(img);
|
int32 pos = STREAMTELL(img);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue