mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-22 17:47:20 +03:00
No more out of memory errors on VC3
This commit is contained in:
parent
689c76b4c5
commit
30fff6bbab
5 changed files with 76 additions and 36 deletions
|
|
@ -145,6 +145,8 @@ int8 CMenuManager::m_PrefsIslandLoading = ISLAND_LOADING_LOW;
|
|||
#ifdef GAMEPAD_MENU
|
||||
#ifdef __SWITCH__
|
||||
int8 CMenuManager::m_PrefsControllerType = CONTROLLER_NINTENDO_SWITCH;
|
||||
#elif defined __SYMBIAN32__
|
||||
int8 CMenuManager::m_PrefsControllerType = CONTROLLER_DUALSHOCK2;
|
||||
#else
|
||||
int8 CMenuManager::m_PrefsControllerType = CONTROLLER_XBOXONE;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ enum Config {
|
|||
# define CUSTOM_FRONTEND_OPTIONS
|
||||
|
||||
# ifdef CUSTOM_FRONTEND_OPTIONS
|
||||
# define MENU_MAP // VC-like menu map. Won't appear if you don't have our menu.txd
|
||||
//# define MENU_MAP // VC-like menu map. Won't appear if you don't have our menu.txd
|
||||
# define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable
|
||||
//# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
|
||||
# define CUTSCENE_BORDERS_SWITCH
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ void debugRaster(RwRaster *r){
|
|||
}
|
||||
|
||||
static void downscaleTexture(RwTexture *texture){
|
||||
#ifdef RW_GLES1
|
||||
// #ifdef RW_GLES1
|
||||
if(texture == nil)
|
||||
return;
|
||||
|
||||
|
|
@ -146,7 +146,11 @@ static void downscaleTexture(RwTexture *texture){
|
|||
// crear nuevo raster en formato compatible con GLES1
|
||||
int32 w, h, d, f;
|
||||
rw::Raster::imageFindRasterFormat(resized, rw::Raster::TEXTURE, &w, &h, &d, &f);
|
||||
#ifdef RW_GLES1
|
||||
RwRaster *newRaster = rw::Raster::create(w, h, d, f | rw::Raster::TEXTURE, rw::PLATFORM_GLES1);
|
||||
#else
|
||||
RwRaster *newRaster = rw::Raster::create(w, h, d, f | rw::Raster::TEXTURE, rw::PLATFORM_GL3);
|
||||
#endif
|
||||
if(newRaster == nil){
|
||||
debug("downscaleTexture: raster create FAILED");
|
||||
RwImageDestroy(resized);
|
||||
|
|
@ -163,36 +167,36 @@ static void downscaleTexture(RwTexture *texture){
|
|||
RwImageDestroy(resized);
|
||||
RwTextureSetRaster(texture, newRaster);
|
||||
RwRasterDestroy(oldRaster);
|
||||
#else
|
||||
RwRaster *oldRaster = RwTextureGetRaster(texture);
|
||||
if (oldRaster == nil)
|
||||
return;
|
||||
|
||||
extern bool moreVram;
|
||||
int targetSize = moreVram ? 64 : 32;
|
||||
|
||||
int oldWidth = RwRasterGetWidth(oldRaster);
|
||||
int oldHeight = RwRasterGetHeight(oldRaster);
|
||||
if (oldWidth <= targetSize && oldHeight <= targetSize) return;
|
||||
|
||||
int newWidth = clamp(oldWidth, targetSize);
|
||||
int newHeight = clamp(oldHeight, targetSize);
|
||||
if (newWidth == oldWidth && newHeight == oldHeight) return;
|
||||
|
||||
RwImage *image = oldRaster->toImage();
|
||||
if (image == nil) return;
|
||||
|
||||
RwImage *resized = resizeImage(image, newWidth, newHeight);
|
||||
RwImageDestroy(image);
|
||||
if (resized == nil) return;
|
||||
|
||||
RwRaster *newRaster = rw::Raster::createFromImage(resized);
|
||||
RwImageDestroy(resized);
|
||||
if (newRaster == nil) return;
|
||||
|
||||
RwTextureSetRaster(texture, newRaster);
|
||||
RwRasterDestroy(oldRaster);
|
||||
#endif
|
||||
// #else
|
||||
// RwRaster *oldRaster = RwTextureGetRaster(texture);
|
||||
// if (oldRaster == nil)
|
||||
// return;
|
||||
//
|
||||
// extern bool moreVram;
|
||||
// int targetSize = moreVram ? 64 : 32;
|
||||
//
|
||||
// int oldWidth = RwRasterGetWidth(oldRaster);
|
||||
// int oldHeight = RwRasterGetHeight(oldRaster);
|
||||
// if (oldWidth <= targetSize && oldHeight <= targetSize) return;
|
||||
//
|
||||
// int newWidth = clamp(oldWidth, targetSize);
|
||||
// int newHeight = clamp(oldHeight, targetSize);
|
||||
// if (newWidth == oldWidth && newHeight == oldHeight) return;
|
||||
//
|
||||
// RwImage *image = oldRaster->toImage();
|
||||
// if (image == nil) return;
|
||||
//
|
||||
// RwImage *resized = resizeImage(image, newWidth, newHeight);
|
||||
// RwImageDestroy(image);
|
||||
// if (resized == nil) return;
|
||||
//
|
||||
// RwRaster *newRaster = rw::Raster::createFromImage(resized);
|
||||
// RwImageDestroy(resized);
|
||||
// if (newRaster == nil) return;
|
||||
//
|
||||
// RwTextureSetRaster(texture, newRaster);
|
||||
// RwRasterDestroy(oldRaster);
|
||||
// #endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -219,6 +223,11 @@ RwTextureGtaStreamRead(RwStream *stream)
|
|||
if (gGameState == GS_INIT_PLAYING_GAME) {
|
||||
texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1);
|
||||
texNumLoaded++;
|
||||
} else /*if (gGameState != GS_PLAYING_GAME)*/ {
|
||||
if (tex != nil && tex->raster != nil && RwRasterGetWidth(tex->raster) > 128 || RwRasterGetHeight(tex->raster) > 128) {
|
||||
// debug("downscaling %s", tex->name);
|
||||
downscaleTexture(tex);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ANISOTROPIC_FILTERING
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue