revert perf + fix: windows performance optimizations + x360 fixes + ps3 hdd corruption fix (#27)

revert perf + fix: windows performance optimizations + x360 fixes + ps3 hdd corruption fix (#27)

windows optimizations include:

- adding WPO/LTCG
- fixing potential memory leaks
- reducing unneeded busy waits

xbox 360 fixes include:

- all item names displaying as black
- adding newer dlcs crashing game

ps3 fix was that, when holding the ps button, it'd corrupt the hdd. NEEDS TESTING! just a guess fix since I don't have a PS3.

---------

Co-authored-by: pieeebot <piebot00@gmail.com>
Co-authored-by: piebot <piebot00@gmail.com>
Co-authored-by: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com>
Co-authored-by: str1k3r <1+str1k3r@noreply.localhost>
Co-authored-by: pieeebot <10+pieeebot@noreply.neolegacy.dev>
Co-authored-by: qloak <53+qloak@noreply.neolegacy.dev>
Reviewed-on: cafeberry/cafeberry#27
Co-authored-by: qloak <realminecart@gmail.com>
This commit is contained in:
committed 2026-08-14 10:48:38 +00:00
1 parent bad3a41225
commit 6a49df36cc
34 files changed
+82 -209

No files matched your search

@@ -406,12 +406,6 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
unsigned int uiVersion=*(unsigned int *)pbData; unsigned int uiVersion=*(unsigned int *)pbData;
uiCurrentByte+=sizeof(int); uiCurrentByte+=sizeof(int);
if(uiVersion > CURRENT_DLC_VERSION_NUM)
{
if(pbData!=NULL) delete [] pbData;
app.DebugPrintf("DLC version of %d is newer than this build can read (%d)\n", uiVersion, CURRENT_DLC_VERSION_NUM);
return false;
}
if(uiVersion < CURRENT_DLC_VERSION_NUM) if(uiVersion < CURRENT_DLC_VERSION_NUM)
{ {
if(pbData!=NULL) delete [] pbData; if(pbData!=NULL) delete [] pbData;
@@ -619,11 +613,6 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
unsigned int uiVersion=*(unsigned int *)pbData; unsigned int uiVersion=*(unsigned int *)pbData;
uiCurrentByte+=sizeof(int); uiCurrentByte+=sizeof(int);
if(uiVersion > CURRENT_DLC_VERSION_NUM)
{
app.DebugPrintf("DLC version of %d is newer than this build can read (%d)\n", uiVersion, CURRENT_DLC_VERSION_NUM);
return 0;
}
if(uiVersion < CURRENT_DLC_VERSION_NUM) if(uiVersion < CURRENT_DLC_VERSION_NUM)
{ {
app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion); app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion);
@@ -1,7 +1,7 @@
/* /*
base64.cpp and base64.h base64.cpp and base64.h
Copyright (C) 2004-2008 Ren� Nyffenegger Copyright (C) 2004-2008 René Nyffenegger
This source code is provided 'as-is', without any express or implied This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages warranty. In no event will the author be held liable for any damages
@@ -21,7 +21,7 @@
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Ren� Nyffenegger rene.nyffenegger@adp-gmbh.ch René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/ */
@@ -41,7 +41,7 @@ static inline bool is_base64(unsigned char c) {
} }
// 4J ADDED, // 4J ADDED,
std::string base64_encode(const std::string& str) std::string base64_encode(std::string str)
{ {
return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() ); return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() );
} }
@@ -2,6 +2,6 @@
#include <string> #include <string>
std::string base64_encode(const std::string& str); std::string base64_encode(std::string str);
std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s); std::string base64_decode(std::string const& s);
@@ -314,13 +314,13 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
// Make sure that we have transitioned through any joining/creating stages and are actually playing the game, so that we know the players should be valid // Make sure that we have transitioned through any joining/creating stages and are actually playing the game, so that we know the players should be valid
bool changedMessage = false; bool changedMessage = false;
while(!IsReadyToPlayOrIdle()) while(!IsReadyToPlayOrIdle())
{ {
changedMessage = true; changedMessage = true;
pMinecraft->progressRenderer->progressStage( g_NetworkManager.CorrectErrorIDS(IDS_PROGRESS_SAVING_TO_DISC) ); // "Finalizing..." vaguest message I could find pMinecraft->progressRenderer->progressStage( g_NetworkManager.CorrectErrorIDS(IDS_PROGRESS_SAVING_TO_DISC) ); // "Finalizing..." vaguest message I could find
pMinecraft->progressRenderer->progressStagePercentage( g_NetworkManager.GetJoiningReadyPercentage() ); pMinecraft->progressRenderer->progressStagePercentage( g_NetworkManager.GetJoiningReadyPercentage() );
Sleep(0); Sleep(10);
} }
if( changedMessage ) if( changedMessage )
{ {
pMinecraft->progressRenderer->progressStagePercentage( 100 ); pMinecraft->progressRenderer->progressStagePercentage( 100 );
@@ -898,7 +898,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected(); TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
while ( tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()) ) while ( tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()) )
{ {
Sleep(0); Sleep(1);
} }
ui.CleanUpSkinReload(); ui.CleanUpSkinReload();
if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None) if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
@@ -935,7 +935,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
{ {
while((Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin())) while((Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()))
{ {
Sleep(0); Sleep(1);
} }
param->levelGen->loadBaseSaveData(); param->levelGen->loadBaseSaveData();
} }
@@ -977,7 +977,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam )
while( g_NetworkManager.IsInSession() ) while( g_NetworkManager.IsInSession() )
{ {
Sleep(0); Sleep(1);
} }
// Xbox should always be online when receiving invites - on PS3 we need to check & ask the user to sign in // Xbox should always be online when receiving invites - on PS3 we need to check & ask the user to sign in
@@ -1237,7 +1237,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
// wait for the current session to end // wait for the current session to end
while( g_NetworkManager.IsInSession() ) while( g_NetworkManager.IsInSession() )
{ {
Sleep(0); Sleep(1);
} }
// Reset this flag as the we don't need to know that we only lost the room only from this point onwards, the behaviour is exactly the same // Reset this flag as the we don't need to know that we only lost the room only from this point onwards, the behaviour is exactly the same
@@ -454,7 +454,12 @@ void CXuiSceneAbstractContainer::SetPointerText(vector<HtmlString> *description,
return; return;
} }
wstring combinedText = HtmlString::Compose(description); wstring combinedText;
for(size_t i = 0; i < description->size(); ++i)
{
combinedText += (*description)[i].text;
if(i + 1 < description->size()) combinedText += L"\n";
}
vector<wstring> unformattedStrings; vector<wstring> unformattedStrings;
for(size_t i = 0; i < description->size(); ++i) for(size_t i = 0; i < description->size(); ++i)
+4 -5
View File
@@ -145,11 +145,10 @@ void EnderDragonRenderer::render(shared_ptr<Entity> _mob, double x, double y, do
int steps = 8; int steps = 8;
for (int i = 0; i <= steps; i++) for (int i = 0; i <= steps; i++)
{ {
int idx = i % steps; double d=i % steps * PI * 2 / steps;
double d = idx * PI * 2 / steps; float s = sin(i % steps * PI * 2 / steps) * 0.75f;
float s = sin(d) * 0.75f; float c = cos(i % steps * PI * 2 / steps) * 0.75f;
float c = cos(d) * 0.75f; float u = i % steps * 1.0f / steps;
float u = idx * 1.0f / steps;
//t->color(0x000000); //t->color(0x000000);
t->vertexUV(s * 0.2f, c * 0.2f, 0, u, v1); t->vertexUV(s * 0.2f, c * 0.2f, 0, u, v1);
//t->color(0xffffff); //t->color(0xffffff);
@@ -94,17 +94,6 @@ void EntityRenderDispatcher::staticCtor()
instance = new EntityRenderDispatcher(); instance = new EntityRenderDispatcher();
} }
EntityRenderDispatcher::~EntityRenderDispatcher()
{
AUTO_VAR(itEnd, renderers.end());
for( classToRendererMap::iterator it = renderers.begin(); it != itEnd; it++ )
{
delete it->second;
it->second = NULL;
}
renderers.clear();
}
EntityRenderDispatcher::EntityRenderDispatcher() EntityRenderDispatcher::EntityRenderDispatcher()
{ {
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
+1 -2
View File
@@ -1,7 +1,7 @@
#pragma once #pragma once
#include "EntityRenderer.h" #include "EntityRenderer.h"
#include "..\Minecraft.World\Entity.h"
#include "..\Minecraft.World\JavaIntHash.h" #include "..\Minecraft.World\JavaIntHash.h"
class Entity;
class font; class font;
using namespace std; using namespace std;
@@ -37,7 +37,6 @@ public:
private: private:
EntityRenderDispatcher(); EntityRenderDispatcher();
~EntityRenderDispatcher();
public: public:
EntityRenderer *getRenderer(eINSTANCEOF e); EntityRenderer *getRenderer(eINSTANCEOF e);
+27 -33
View File
@@ -105,6 +105,8 @@ GameRenderer::GameRenderer(Minecraft *mc)
zoom = 1; zoom = 1;
zoom_x = 0; zoom_x = 0;
zoom_y = 0; zoom_y = 0;
rainXa = NULL;
rainZa = NULL;
lastActiveTime = Minecraft::currentTimeMillis(); lastActiveTime = Minecraft::currentTimeMillis();
lastNsTime = 0; lastNsTime = 0;
random = new Random(); random = new Random();
@@ -179,9 +181,8 @@ GameRenderer::GameRenderer(Minecraft *mc)
// 4J Stu Added to go with 1.8.2 change // 4J Stu Added to go with 1.8.2 change
GameRenderer::~GameRenderer() GameRenderer::~GameRenderer()
{ {
delete random; if(rainXa != NULL) delete [] rainXa;
delete cameraPos; if(rainZa != NULL) delete [] rainZa;
delete lb;
} }
void GameRenderer::tick(bool first) // 4J - add bFirst void GameRenderer::tick(bool first) // 4J - add bFirst
@@ -837,21 +838,19 @@ void GameRenderer::updateLightTexture(float a)
Level *level = player->level; // 4J - was mc->level when it was just to update the one light texture Level *level = player->level; // 4J - was mc->level when it was just to update the one light texture
float skyDarken1 = level->getSkyDarken((float) 1); float skyDarken1 = level->getSkyDarken((float) 1);
float darken = skyDarken1 * 0.95f + 0.05f;
float rsGsMul = skyDarken1 * 0.65f + 0.35f;
float blockMul = blr * 0.1f + 1.5f;
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
{ {
float darken = skyDarken1 * 0.95f + 0.05f;
float sky = level->dimension->brightnessRamp[i / 16] * darken; float sky = level->dimension->brightnessRamp[i / 16] * darken;
float block = level->dimension->brightnessRamp[i % 16] * blockMul; float block = level->dimension->brightnessRamp[i % 16] * (blr * 0.1f + 1.5f);
if (level->skyFlashTime > 0) if (level->skyFlashTime > 0)
{ {
sky = level->dimension->brightnessRamp[i / 16]; sky = level->dimension->brightnessRamp[i / 16];
} }
float rs = sky * rsGsMul; float rs = sky * (skyDarken1 * 0.65f + 0.35f);
float gs = sky * rsGsMul; float gs = sky * (skyDarken1 * 0.65f + 0.35f);
float bs = sky; float bs = sky;
float rb = block; float rb = block;
@@ -1527,30 +1526,27 @@ void GameRenderer::tickRain()
int x = x0 + random->nextInt(r) - random->nextInt(r); int x = x0 + random->nextInt(r) - random->nextInt(r);
int z = z0 + random->nextInt(r) - random->nextInt(r); int z = z0 + random->nextInt(r) - random->nextInt(r);
int y = level->getTopRainBlock(x, z); int y = level->getTopRainBlock(x, z);
if (y <= y0 + r && y >= y0 - r) int t = level->getTile(x, y - 1, z);
Biome *biome = level->getBiome(x,z);
if (y <= y0 + r && y >= y0 - r && biome->hasRain() && biome->getTemperature() >= 0.2f)
{ {
int t = level->getTile(x, y - 1, z); float xa = random->nextFloat();
Biome *biome = level->getBiome(x,z); float za = random->nextFloat();
if (biome->hasRain() && biome->getTemperature() >= 0.2f) if (t > 0)
{ {
float xa = random->nextFloat(); if (Tile::tiles[t]->material == Material::lava)
float za = random->nextFloat();
if (t > 0)
{ {
if (Tile::tiles[t]->material == Material::lava) mc->particleEngine->add( shared_ptr<SmokeParticle>( new SmokeParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za, 0, 0, 0) ) );
}
else
{
if (random->nextInt(++rainPosSamples) == 0)
{ {
mc->particleEngine->add( shared_ptr<SmokeParticle>( new SmokeParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za, 0, 0, 0) ) ); rainPosX = x + xa;
} rainPosY = y + 0.1f - Tile::tiles[t]->getShapeY0();
else rainPosZ = z + za;
{
if (random->nextInt(++rainPosSamples) == 0)
{
rainPosX = x + xa;
rainPosY = y + 0.1f - Tile::tiles[t]->getShapeY0();
rainPosZ = z + za;
}
mc->particleEngine->add( shared_ptr<WaterDropParticle>( new WaterDropParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za) ) );
} }
mc->particleEngine->add( shared_ptr<WaterDropParticle>( new WaterDropParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za) ) );
} }
} }
} }
@@ -1585,12 +1581,10 @@ void GameRenderer::renderSnowAndRain(float a)
turnOnLightLayer(a); turnOnLightLayer(a);
static float rainXa[32 * 32]; if (rainXa == NULL)
static float rainZa[32 * 32];
static bool rainArraysInitialized = false;
if (!rainArraysInitialized)
{ {
rainArraysInitialized = true; rainXa = new float[32 * 32];
rainZa = new float[32 * 32];
for (int z = 0; z < 32; z++) for (int z = 0; z < 32; z++)
{ {
+2
View File
@@ -128,6 +128,8 @@ private:
void tickRain(); void tickRain();
private: private:
// 4J - brought forward from 1.8.2 // 4J - brought forward from 1.8.2
float *rainXa;
float *rainZa;
protected: protected:
void renderSnowAndRain(float a); void renderSnowAndRain(float a);
volatile int xMod; volatile int xMod;
+4 -4
View File
@@ -10,7 +10,7 @@ ResourceLocation HorseRenderer::HORSE_DONKEY_LOCATION = ResourceLocation(TN_MOB_
ResourceLocation HorseRenderer::HORSE_ZOMBIE_LOCATION = ResourceLocation(TN_MOB_HORSE_ZOMBIE); ResourceLocation HorseRenderer::HORSE_ZOMBIE_LOCATION = ResourceLocation(TN_MOB_HORSE_ZOMBIE);
ResourceLocation HorseRenderer::HORSE_SKELETON_LOCATION = ResourceLocation(TN_MOB_HORSE_SKELETON); ResourceLocation HorseRenderer::HORSE_SKELETON_LOCATION = ResourceLocation(TN_MOB_HORSE_SKELETON);
std::map<wstring, ResourceLocation> HorseRenderer::LAYERED_LOCATION_CACHE; std::map<wstring, ResourceLocation *> HorseRenderer::LAYERED_LOCATION_CACHE;
HorseRenderer::HorseRenderer(Model *model, float f) : MobRenderer(model, f) HorseRenderer::HorseRenderer(Model *model, float f) : MobRenderer(model, f)
{ {
@@ -114,14 +114,14 @@ ResourceLocation *HorseRenderer::getOrCreateLayeredTextureLocation(shared_ptr<En
ResourceLocation *location; ResourceLocation *location;
if (it != LAYERED_LOCATION_CACHE.end()) if (it != LAYERED_LOCATION_CACHE.end())
{ {
location = &(it->second); location = it->second;
} }
else else
{ {
LAYERED_LOCATION_CACHE[textureName] = ResourceLocation(horse->getLayeredTextureLayers()); LAYERED_LOCATION_CACHE[textureName] = new ResourceLocation(horse->getLayeredTextureLayers());
it = LAYERED_LOCATION_CACHE.find(textureName); it = LAYERED_LOCATION_CACHE.find(textureName);
location = &(it->second); location = it->second;
} }
return location; return location;
+1 -1
View File
@@ -8,7 +8,7 @@ class PathfinderMob;
class HorseRenderer : public MobRenderer class HorseRenderer : public MobRenderer
{ {
private: private:
static std::map<wstring, ResourceLocation> LAYERED_LOCATION_CACHE; static std::map<wstring, ResourceLocation *> LAYERED_LOCATION_CACHE;
static ResourceLocation HORSE_LOCATION; static ResourceLocation HORSE_LOCATION;
static ResourceLocation HORSE_MULE_LOCATION; static ResourceLocation HORSE_MULE_LOCATION;
+3 -3
View File
@@ -165,7 +165,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
//localIp = settings->getString(L"server-ip", L""); //localIp = settings->getString(L"server-ip", L"");
//onlineMode = settings->getBoolean(L"online-mode", true); //onlineMode = settings->getBoolean(L"online-mode", true);
//motd = settings->getString(L"motd", L"A Minecraft Server"); //motd = settings->getString(L"motd", L"A Minecraft Server");
//motd.replace('�', '$'); //motd.replace('§', '$');
setAnimals(settings->getBoolean(L"spawn-animals", true)); setAnimals(settings->getBoolean(L"spawn-animals", true));
setNpcsEnabled(settings->getBoolean(L"spawn-npcs", true)); setNpcsEnabled(settings->getBoolean(L"spawn-npcs", true));
@@ -210,7 +210,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
// 4J-JEV: Need to wait for levelGenerationOptions to load. // 4J-JEV: Need to wait for levelGenerationOptions to load.
while ( app.getLevelGenerationOptions() != NULL && !app.getLevelGenerationOptions()->hasLoadedData() ) while ( app.getLevelGenerationOptions() != NULL && !app.getLevelGenerationOptions()->hasLoadedData() )
Sleep(0); Sleep(1);
if ( app.getLevelGenerationOptions() != NULL && !app.getLevelGenerationOptions()->ready() ) if ( app.getLevelGenerationOptions() != NULL && !app.getLevelGenerationOptions()->ready() )
{ {
@@ -319,7 +319,7 @@ int MinecraftServer::runPostUpdate(void* lpParam)
{ {
LeaveCriticalSection(&server->m_postProcessCS); LeaveCriticalSection(&server->m_postProcessCS);
} }
Sleep(0); Sleep(1);
} while (!server->m_postUpdateTerminate && ShutdownManager::ShouldRun(ShutdownManager::ePostProcessThread)); } while (!server->m_postUpdateTerminate && ShutdownManager::ShouldRun(ShutdownManager::ePostProcessThread));
//#ifndef __PS3__ //#ifndef __PS3__
// One final pass through updates to make sure we're done // One final pass through updates to make sure we're done
@@ -1,7 +1,7 @@
/* /*
base64.cpp and base64.h base64.cpp and base64.h
Copyright (C) 2004-2008 Ren� Nyffenegger Copyright (C) 2004-2008 René Nyffenegger
This source code is provided 'as-is', without any express or implied This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages warranty. In no event will the author be held liable for any damages
@@ -21,7 +21,7 @@
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Ren� Nyffenegger rene.nyffenegger@adp-gmbh.ch René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/ */
@@ -41,7 +41,7 @@ static inline bool is_base64(unsigned char c) {
} }
// 4J ADDED, // 4J ADDED,
std::string base64_encode(const std::string& str) std::string base64_encode(std::string str)
{ {
return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() ); return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() );
} }
+1 -1
View File
@@ -2,6 +2,6 @@
#include <string> #include <string>
std::string base64_encode(const std::string& str); std::string base64_encode(std::string str);
std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s); std::string base64_decode(std::string const& s);
+3 -3
View File
@@ -1,7 +1,7 @@
/* /*
base64.cpp and base64.h base64.cpp and base64.h
Copyright (C) 2004-2008 Ren� Nyffenegger Copyright (C) 2004-2008 René Nyffenegger
This source code is provided 'as-is', without any express or implied This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages warranty. In no event will the author be held liable for any damages
@@ -21,7 +21,7 @@
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Ren� Nyffenegger rene.nyffenegger@adp-gmbh.ch René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/ */
@@ -41,7 +41,7 @@ static inline bool is_base64(unsigned char c) {
} }
// 4J ADDED, // 4J ADDED,
std::string base64_encode(const std::string& str) std::string base64_encode(std::string str)
{ {
return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() ); return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() );
} }
+1 -1
View File
@@ -2,6 +2,6 @@
#include <string> #include <string>
std::string base64_encode(const std::string& str); std::string base64_encode(std::string str);
std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s); std::string base64_decode(std::string const& s);
@@ -141,13 +141,15 @@ void ShutdownManager::SysUtilCallback(uint64_t status, uint64_t param, void *use
StartShutdown(); StartShutdown();
break; break;
case CELL_SYSUTIL_SYSTEM_MENU_OPEN: case CELL_SYSUTIL_SYSTEM_MENU_OPEN:
case CELL_SYSUTIL_DRAWING_BEGIN: // Tell the game UI to stop processing
StorageManager.SetSystemUIDisplaying(true); StorageManager.SetSystemUIDisplaying(true);
break; break;
case CELL_SYSUTIL_DRAWING_END: case CELL_SYSUTIL_DRAWING_END:
case CELL_SYSUTIL_SYSTEM_MENU_CLOSE:
StorageManager.SetSystemUIDisplaying(false); StorageManager.SetSystemUIDisplaying(false);
break; break;
case CELL_SYSUTIL_DRAWING_BEGIN:
case CELL_SYSUTIL_SYSTEM_MENU_CLOSE:
break;
case CELL_SYSUTIL_BGMPLAYBACK_PLAY: case CELL_SYSUTIL_BGMPLAYBACK_PLAY:
if( minecraft ) if( minecraft )
{ {
-53
View File
@@ -1,53 +0,0 @@
#include "stdafx.h"
#include "OldSdk.h"
#ifdef __PSVITA__
int sceNpBasicGetFriendOnlineStatus(const SceNpId *friendId, SceNpBasicOnlineStatus *status) {
if (status) *status = SCE_NP_BASIC_ONLINE_STATUS_UNKNOWN;
return -1;
}
int sceNpBasicGetFriendContextState(const SceNpId *friendId, SceNpBasicFriendContextState *state) {
if (state) *state = SCE_NP_BASIC_FRIEND_CONTEXT_STATE_UNKNOWN;
return -1;
}
int sceNpBasicGetGamePresenceOfFriend(const SceNpId *friendId, SceNpBasicGamePresence *presence) {
if (presence) memset(presence, 0, sizeof(SceNpBasicGamePresence));
return -1;
}
int sceNpBasicGetFriendListEntryCount(SceSize *count) {
if (count) *count = 0;
return 0;
}
int sceNpBasicGetFriendListEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved) {
if (retrieved) *retrieved = 0;
return 0;
}
int sceNpBasicGetFriendRequestEntryCount(SceSize *count) {
if (count) *count = 0;
return 0;
}
int sceNpBasicGetFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved) {
if (retrieved) *retrieved = 0;
return 0;
}
int sceNpBasicGetRequestedFriendRequestEntryCount(SceSize *count) {
if (count) *count = 0;
return 0;
}
int sceNpBasicGetRequestedFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved) {
if (retrieved) *retrieved = 0;
return 0;
}
SceInt32 sceAppUtilAppEventParseNpBasicJoinablePresence(const SceAppUtilAppEventParam *eventParam, SceAppUtilNpBasicJoinablePresenceParam *param) {
return -1;
}
#endif
-55
View File
@@ -1,55 +0,0 @@
#pragma once
#ifdef __PSVITA__
#ifndef _OLD_SDK_H
#define _OLD_SDK_H 1
#include <np.h>
#include <np/np_basic.h>
#include <apputil.h>
#include <np_toolkit.h>
#include <np_toolkit\friends_interface.h>
typedef enum {
SCE_NP_BASIC_ONLINE_STATUS_UNKNOWN = 0,
SCE_NP_BASIC_ONLINE_STATUS_OFFLINE = 1,
SCE_NP_BASIC_ONLINE_STATUS_AFK = 2,
SCE_NP_BASIC_ONLINE_STATUS_ONLINE = 3
} SceNpBasicOnlineStatus;
typedef void(*SceNpBasicFriendOnlineStatusEventHandler)(
const SceNpId *friendId,
SceNpBasicOnlineStatus status,
void *userdata
);
typedef enum {
SCE_NP_BASIC_FRIEND_CONTEXT_STATE_UNKNOWN = 0,
SCE_NP_BASIC_FRIEND_CONTEXT_STATE_OUT_OF_CONTEXT = 1,
SCE_NP_BASIC_FRIEND_CONTEXT_STATE_IN_CONTEXT = 2
} SceNpBasicFriendContextState;
typedef void(*SceNpBasicFriendContextEventHandler)(
const SceNpId *friendId,
SceNpBasicFriendContextState state,
void *userdata
);
typedef struct SceAppUtilNpBasicJoinablePresenceParam {
SceNpCommunicationId commId;
SceNpId npId;
} SceAppUtilNpBasicJoinablePresenceParam;
int sceNpBasicGetFriendOnlineStatus(const SceNpId *friendId, SceNpBasicOnlineStatus *status);
int sceNpBasicGetFriendContextState(const SceNpId *friendId, SceNpBasicFriendContextState *state);
int sceNpBasicGetGamePresenceOfFriend(const SceNpId *friendId, SceNpBasicGamePresence *presence);
int sceNpBasicGetFriendListEntryCount(SceSize *count);
int sceNpBasicGetFriendListEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved);
int sceNpBasicGetFriendRequestEntryCount(SceSize *count);
int sceNpBasicGetFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved);
int sceNpBasicGetRequestedFriendRequestEntryCount(SceSize *count);
int sceNpBasicGetRequestedFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved);
SceInt32 sceAppUtilAppEventParseNpBasicJoinablePresence(const SceAppUtilAppEventParam *eventParam, SceAppUtilNpBasicJoinablePresenceParam *param);
#define SCE_APPUTIL_APPEVENT_TYPE_NP_BASIC_JOINABLE_PRESENCE (3)
#endif
#endif
@@ -141,13 +141,15 @@ void ShutdownManager::SysUtilCallback(uint64_t status, uint64_t param, void *use
StartShutdown(); StartShutdown();
break; break;
case CELL_SYSUTIL_SYSTEM_MENU_OPEN: case CELL_SYSUTIL_SYSTEM_MENU_OPEN:
case CELL_SYSUTIL_DRAWING_BEGIN: // Tell the game UI to stop processing
StorageManager.SetSystemUIDisplaying(true); StorageManager.SetSystemUIDisplaying(true);
break; break;
case CELL_SYSUTIL_DRAWING_END: case CELL_SYSUTIL_DRAWING_END:
case CELL_SYSUTIL_SYSTEM_MENU_CLOSE:
StorageManager.SetSystemUIDisplaying(false); StorageManager.SetSystemUIDisplaying(false);
break; break;
case CELL_SYSUTIL_DRAWING_BEGIN:
case CELL_SYSUTIL_SYSTEM_MENU_CLOSE:
break;
case CELL_SYSUTIL_BGMPLAYBACK_PLAY: case CELL_SYSUTIL_BGMPLAYBACK_PLAY:
if( minecraft ) if( minecraft )
{ {
+3 -3
View File
@@ -341,7 +341,7 @@ bool Connection::readTick()
// printf("Con:0x%x readTick close EOS\n",this); // printf("Con:0x%x readTick close EOS\n",this);
// 4J Stu - Remove this line // 4J Stu - Remove this line
// Fix for #10410 - UI: If the player is removed from a splitscreened host�s game, the next game that player joins will produce a message stating that the host has left. // Fix for #10410 - UI: If the player is removed from a splitscreened host’s game, the next game that player joins will produce a message stating that the host has left.
//close(DisconnectPacket::eDisconnect_EndOfStream); //close(DisconnectPacket::eDisconnect_EndOfStream);
} }
@@ -666,7 +666,7 @@ int Connection::runClose(void* lpParam)
//try { //try {
Sleep(500); Sleep(2000);
if (con->running) if (con->running)
{ {
// 4J TODO writeThread.interrupt(); // 4J TODO writeThread.interrupt();
@@ -690,7 +690,7 @@ int Connection::runSendAndQuit(void* lpParam)
//try { //try {
Sleep(500); Sleep(2000);
if (con->running) if (con->running)
{ {
// 4J TODO writeThread.interrupt(); // 4J TODO writeThread.interrupt();