diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Platform/Extrax64Stubs.cpp index a86ed4a7c..e4e144ce0 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Platform/Extrax64Stubs.cpp @@ -1,23 +1,12 @@ #include "stdafx.h" -#if 1 //#include -#endif // 0 -#if 0 -#include "../GameState/StatsCounter.h" -#include -#include -#elif 0 -#include "../GameState/StatsCounter.h" -#elif defined _WINDOWS64 +#if defined(_WINDOWS64) #include "../Platform/Windows64/Sentient/SentientManager.h" #include "../GameState/StatsCounter.h" #include "../Platform/Windows64/Social/SocialManager.h" #include "../Platform/Windows64/Sentient/DynamicConfigurations.h" -#elif 0 -#include "../GameState/StatsCounter.h" -#include -#elif defined __linux__ +#elif defined(__linux__) // On Linux, stdafx.h already provides Orbis-compatible Sentient/Dynamic headers // via #pragma once. Pull in SentientManager for CSentientManager class declaration // and StatsCounter; CSocialManager is provided as inline stubs via Platform/Linux/Social/SocialManager.h. @@ -27,26 +16,24 @@ #include "../GameState/StatsCounter.h" #endif -#if !0 && !0 && !0 -#ifdef _WINDOWS64 +#if defined(_WINDOWS64) //C4JStorage StorageManager; C_4JProfile ProfileManager; #endif -#endif // 0 CSentientManager SentientManager; -#ifndef __linux__ +#if !defined(__linux__) // On Linux this global shadows the project's StringTable class name in unity builds CXuiStringTable StringTable; #endif -#if !0 && !defined(__linux__) +#if !defined(__linux__) ATG::XMLParser::XMLParser() {} ATG::XMLParser::~XMLParser() {} HRESULT ATG::XMLParser::ParseXMLBuffer( CONST CHAR* strBuffer, UINT uBufferSize ) { return S_OK; } VOID ATG::XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) {} #endif -#ifndef __linux__ +#if !defined(__linux__) bool CSocialManager::IsTitleAllowedToPostAnything() { return false; } bool CSocialManager::AreAllUsersAllowedToPostImages() { return false; } bool CSocialManager::IsTitleAllowedToPostImages() { return false; } @@ -55,7 +42,7 @@ bool CSocialManager::PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, DWO bool CSocialManager::PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ) { return false; } CSocialManager *CSocialManager::Instance() { return NULL; } void CSocialManager::SetSocialPostText(LPCWSTR Title, LPCWSTR Caption, LPCWSTR Desc) {}; -#endif // !__linux__ +#endif DWORD XShowPartyUI(DWORD dwUserIndex) { return 0; } DWORD XShowFriendsUI(DWORD dwUserIndex) { return 0; } @@ -64,13 +51,12 @@ DWORD XContentGetThumbnail(DWORD dwUserIndex, const XCONTENT_DATA *pContentData, void XShowAchievementsUI(int i) {} DWORD XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; } -#if 1 void PIXAddNamedCounter(int a, const char *b, ...) {} //#define PS3_USE_PIX_EVENTS //#define PS4_USE_PIX_EVENTS void PIXBeginNamedEvent(int a, const char *b, ...) { -#ifdef PS4_USE_PIX_EVENTS +#if defined(PS4_USE_PIX_EVENTS) char buf[512]; va_list args; va_start(args,b); @@ -78,7 +64,7 @@ void PIXBeginNamedEvent(int a, const char *b, ...) sceRazorCpuPushMarker(buf, 0xffffffff, SCE_RAZOR_MARKER_ENABLE_HUD); #endif -#ifdef PS3_USE_PIX_EVENTS +#if defined(PS3_USE_PIX_EVENTS) char buf[256]; wchar_t wbuf[256]; va_list args; @@ -91,69 +77,19 @@ void PIXBeginNamedEvent(int a, const char *b, ...) va_end(args); #endif } -#if 0//0 - if( PixDepth < 64 ) - { - char buf[512]; - va_list args; - va_start(args,b); - vsprintf(buf,b,args); - sceRazorCpuPushMarkerWithHud(buf, 0xffffffff, SCE_RAZOR_MARKER_ENABLE_HUD); - } - PixDepth += 1; -#endif void PIXEndNamedEvent() { -#ifdef PS4_USE_PIX_EVENTS +#if defined(PS4_USE_PIX_EVENTS) sceRazorCpuPopMarker(); #endif -#ifdef PS3_USE_PIX_EVENTS +#if defined(PS3_USE_PIX_EVENTS) snPopMarker(); // RenderManager.EndEvent(); #endif -#if 0//0 - if( PixDepth <= 64 ) - { - sceRazorCpuPopMarker(); - } - PixDepth -= 1; -#endif } void PIXSetMarkerDeprecated(int a, char *b, ...) {} -#else -// 4J Stu - Removed this implementation in favour of a macro that will convert our string format -// conversion at compile time rather than at runtime -//void PIXBeginNamedEvent(int a, char *b, ...) -//{ -// char buf[256]; -// wchar_t wbuf[256]; -// va_list args; -// va_start(args,b); -// vsprintf(buf,b,args); -// -// mbstowcs(wbuf,buf,256); -// PIXBeginEvent(a,wbuf); -//} -// -//void PIXEndNamedEvent() -//{ -// PIXEndEvent(); -//} -// -//void PIXSetMarkerDeprecated(int a, char *b, ...) -//{ -// char buf[256]; -// wchar_t wbuf[256]; -// va_list args; -// va_start(args,b); -// vsprintf(buf,b,args); -// -// mbstowcs(wbuf,buf,256); -// PIXSetMarker(a, wbuf); -//} -#endif // void *D3DXBUFFER::GetBufferPointer() { return NULL; } // int D3DXBUFFER::GetBufferSize() { return 0; } @@ -166,11 +102,7 @@ void PIXSetMarkerDeprecated(int a, char *b, ...) {} bool IsEqualXUID(PlayerUID a, PlayerUID b) { -#if 0 || 0 || 0 || 0 - return (a == b); -#else return false; -#endif } void XMemCpy(void *a, const void *b, size_t s) { memcpy(a, b, s); } @@ -186,7 +118,7 @@ D3DXVECTOR3& D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& add ) { x += add.x; y BYTE IQNetPlayer::GetSmallId() { return 0; } void IQNetPlayer::SendData(IQNetPlayer *player, const void *pvData, DWORD dwDataSize, DWORD dwFlags) { -#ifndef __linux__ +#if !defined(__linux__) app.DebugPrintf("Sending from 0x%x to 0x%x %d bytes\n",this,player,dwDataSize); #endif } @@ -251,8 +183,6 @@ HRESULT CXuiStringTable::Load(LPCWSTR szId) { return S_OK; } DWORD XUserAreUsersFriends( DWORD dwUserIndex, PPlayerUID pXuids, DWORD dwXuidCount, PBOOL pfResult, void *pOverlapped) { return 0; } -#if 0 || 0 || 0 -#else HRESULT XMemDecompress( XMEMDECOMPRESSION_CONTEXT Context, VOID *pDestination, @@ -368,19 +298,16 @@ void XMemDestroyDecompressionContext(XMEMDECOMPRESSION_CONTEXT Context) // DECOMPRESSOR_HANDLE Decompressor = (DECOMPRESSOR_HANDLE)Context; // CloseDecompressor(Decompressor); } -#endif //#if 1 -#if !(0 || 0 || 0 || 0) DWORD XGetLanguage() { return 1; } DWORD XGetLocale() { return 0; } DWORD XEnableGuestSignin(BOOL fEnable) { return 0; } -#endif /////////////////////////////////////////////// Profile library -#ifdef _WINDOWS64 +#if defined(_WINDOWS64) static void *profileData[4]; static bool s_bProfileIsFullVersion; void C_4JProfile::Initialise( std::uint32_t dwTitleID, @@ -465,15 +392,6 @@ bool C_4JProfile::AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2) { return fal bool C_4JProfile::XUIDIsGuest(PlayerUID xuid) { return false; } bool C_4JProfile::AllowedToPlayMultiplayer(int iProf) { return true; } -#if 0 -bool C_4JProfile::GetChatAndContentRestrictions(int iPad, bool thisQuadrantOnly, bool *pbChatRestricted,bool *pbContentRestricted,int *piAge) -{ - if(pbChatRestricted) *pbChatRestricted = false; - if(pbContentRestricted) *pbContentRestricted = false; - if(piAge) *piAge = 100; - return true; -} -#endif void C_4JProfile::StartTrialGame() {} void C_4JProfile::AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, bool *allAllowed, bool *friendsAllowed) {} @@ -482,14 +400,8 @@ bool C_4JProfile::GetProfileAvatar(int iPad,int( *Func)(void *lpParam,std::ui void C_4JProfile::CancelProfileAvatarRequest() {} int C_4JProfile::GetPrimaryPad() { return 0; } void C_4JProfile::SetPrimaryPad(int iPad) {} -#if 0 -char fakeGamerTag[32] = "PlayerName"; -void SetFakeGamertag(char *name){ strcpy_s(fakeGamerTag, name); } -char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; } -#else char* C_4JProfile::GetGamertag(int iPad){ return "PlayerName"; } std::wstring C_4JProfile::GetDisplayName(int iPad){ return L"PlayerName"; } -#endif bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; } void C_4JProfile::SetSignInChangeCallback(void ( *Func)(void *, bool, unsigned int),void *lpParam) {} void C_4JProfile::SetNotificationsCallback(void ( *Func)(void *, std::uint32_t, unsigned int),void *lpParam) {} @@ -600,9 +512,9 @@ unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; } struct PTMSPP_FILEDATA; C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)/*=NULL*/,LPVOID lpParam/*=NULL*/, int iUserData/*=0*/) {return C4JStorage::ETMSStatus_Idle;} -#endif // _WINDOWS64 +#endif -#endif // 0 +#endif /////////////////////////////////////////////////////// Sentient manager @@ -648,7 +560,7 @@ void StatsCounter::save(int player, bool force) {} void StatsCounter::flushLeaderboards() {} void StatsCounter::saveLeaderboards() {} void StatsCounter::setupStatBoards() {} -#ifdef _DEBUG +#if defined(_DEBUG) void StatsCounter::WipeLeaderboards() {} #endif */ diff --git a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp index e21321923..a99f4d637 100644 --- a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp +++ b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp @@ -88,15 +88,7 @@ static void sigsegv_handler(int sig) { #define NUM_PROFILE_VALUES 5 #define NUM_PROFILE_SETTINGS 4 DWORD dwProfileSettingsA[NUM_PROFILE_VALUES] = { -#if 0 - XPROFILE_OPTION_CONTROLLER_VIBRATION, - XPROFILE_GAMER_YAXIS_INVERSION, - XPROFILE_GAMER_CONTROL_SENSITIVITY, - XPROFILE_GAMER_ACTION_MOVEMENT_CONTROL, - XPROFILE_TITLE_SPECIFIC1, -#else 0, 0, 0, 0, 0 -#endif }; //------------------------------------------------------------------------------------- @@ -417,52 +409,9 @@ void DefineActions(void) { _360_JOY_BUTTON_DPAD_DOWN); } -#if 0 -HRESULT InitD3D( IDirect3DDevice9 **ppDevice, -D3DPRESENT_PARAMETERS *pd3dPP ) -{ -IDirect3D9 *pD3D; - -pD3D = Direct3DCreate9( D3D_SDK_VERSION ); - -// Set up the structure used to create the D3DDevice -// Using a permanent 1280x720 backbuffer now no matter what the actual video resolution.right Have also disabled letterboxing, -// which would letterbox a 1280x720 output if it detected a 4:3 video source - we're doing an anamorphic squash in this -// mode so don't need this functionality. - -ZeroMemory( pd3dPP, sizeof(D3DPRESENT_PARAMETERS) ); -XVIDEO_MODE VideoMode; -XGetVideoMode( &VideoMode ); -g_bWidescreen = VideoMode.fIsWideScreen; -pd3dPP->BackBufferWidth = 1280; -pd3dPP->BackBufferHeight = 720; -pd3dPP->BackBufferFormat = D3DFMT_A8R8G8B8; -pd3dPP->BackBufferCount = 1; -pd3dPP->EnableAutoDepthStencil = TRUE; -pd3dPP->AutoDepthStencilFormat = D3DFMT_D24S8; -pd3dPP->SwapEffect = D3DSWAPEFFECT_DISCARD; -pd3dPP->PresentationInterval = D3DPRESENT_INTERVAL_ONE; -//pd3dPP->Flags = D3DPRESENTFLAG_NO_LETTERBOX; -//ERR[D3D]: Can't set D3DPRESENTFLAG_NO_LETTERBOX when wide-screen is enabled -// in the launcher/dashboard. -if(g_bWidescreen) - pd3dPP->Flags=0; -else - pd3dPP->Flags = D3DPRESENTFLAG_NO_LETTERBOX; - -// Create the device. -return pD3D->CreateDevice( - 0, -D3DDEVTYPE_HAL, -NULL, -D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_BUFFER_2_FRAMES, -pd3dPP, -ppDevice ); -} -#endif // #define MEMORY_TRACKING -#ifdef MEMORY_TRACKING +#if defined(MEMORY_TRACKING) void ResetMem(); void DumpMem(); void MemPixStuff(); @@ -470,7 +419,7 @@ void MemPixStuff(); void MemSect(int sect) {} #endif -#ifndef __linux__ +#if !defined(__linux__) HINSTANCE g_hInst = NULL; HWND g_hWnd = NULL; D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL; @@ -589,7 +538,7 @@ HRESULT InitDevice() { UINT height = rc.bottom - rc.top; UINT createDeviceFlags = 0; -#ifdef _DEBUG +#if defined(_DEBUG) createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; #endif @@ -753,28 +702,10 @@ int main(int argc, const char* argv[]) { if (fs) RenderManager.SetFullscreen(true); } -#if 0 - // Main message loop - MSG msg = {0}; - while( WM_QUIT != msg.message ) - { - if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) - { - TranslateMessage( &msg ); - DispatchMessage( &msg ); -} -else -{ -Render(); -} -} - -return (int) msg.wParam; -#endif static bool bTrialTimerDisplayed = true; -#ifdef MEMORY_TRACKING +#if defined(MEMORY_TRACKING) ResetMem(); MEMORYSTATUS memStat; GlobalMemoryStatus(&memStat); @@ -782,30 +713,6 @@ return (int) msg.wParam; memStat.dwAvailPhys / (1024 * 1024)); #endif -#if 0 -// Initialize D3D -hr = InitD3D( &pDevice, &d3dpp ); -g_pD3DDevice = pDevice; -if( FAILED(hr) ) -{ -app.DebugPrintf -( "Failed initializing D3D.\n" ); -return -1; -} - -// Initialize the application, assuming sharing of the d3d interface. -hr = app.InitShared( pDevice, &d3dpp, -XuiPNGTextureLoader ); - -if ( FAILED(hr) ) -{ -app.DebugPrintf -( "Failed initializing application.\n" ); - -return -1; -} - -#endif RenderManager.Initialise(); @@ -917,7 +824,7 @@ return -1; g_NetworkManager.DoWork(); PIXEndNamedEvent(); // Render game graphics. -#ifdef ENABLE_JAVA_GUIS +#if defined(ENABLE_JAVA_GUIS) pMinecraft->run_middle(); if (app.GetGameStarted()) { #else @@ -953,7 +860,7 @@ return -1; g_NetworkManager.Initialise(); } -#ifdef MEMORY_TRACKING +#if defined(MEMORY_TRACKING) static bool bResetMemTrack = false; static bool bDumpMemTrack = false; @@ -977,56 +884,9 @@ return -1; memStat.dwAvailPhys / (1024 * 1024)); printf("Renderer used: %d\n", RenderManager.CBuffSize(-1)); } -#endif -#if 0 -static bool bDumpTextureUsage = false; -if( bDumpTextureUsage ) -{ -RenderManager.TextureGetStats(); -bDumpTextureUsage = false; -} #endif ui.tick(); ui.render(); -#if 0 -app.HandleButtonPresses(); - -// store the minecraft renderstates, and re-set them after the xui render -GetRenderAndSamplerStates(pDevice,RenderStateA,SamplerStateA); - -// Tick XUI -PIXBeginNamedEvent(0,"Xui running"); -app.RunFrame(); -PIXEndNamedEvent(); - -// Render XUI - -PIXBeginNamedEvent(0,"XUI render"); -MemSect(7); -hr = app.Render(); -MemSect(0); -GetRenderAndSamplerStates(pDevice,RenderStateA2,SamplerStateA2); -PIXEndNamedEvent(); - -for(int i=0;i<8;i++) -{ -if(RenderStateA2[i]!=RenderStateA[i]) -{ -//printf("Reseting RenderStateA[%d] after a XUI render\n",i); -pDevice->SetRenderState(RenderStateModes[i],RenderStateA[i]); -} -} -for(int i=0;i<5;i++) -{ -if(SamplerStateA2[i]!=SamplerStateA[i]) -{ -//printf("Reseting SamplerStateA[%d] after a XUI render\n",i); -pDevice->SetSamplerState(0,SamplerStateModes[i],SamplerStateA[i]); -} -} - -RenderManager.Set_matrixDirty(); -#endif // Present the frame. RenderManager.Present(); @@ -1044,7 +904,7 @@ RenderManager.Set_matrixDirty(); "*** - APPLYING GAME SETTINGS CHANGE for pad %d\n", i); app.ApplyGameSettingsChanged(i); -#ifdef _DEBUG_MENUS_ENABLED +#if defined(_DEBUG_MENUS_ENABLED) if (app.DebugSettingsOn()) { app.ActionDebugMask(i); } else { @@ -1070,17 +930,8 @@ RenderManager.Set_matrixDirty(); g_NetworkManager.DoWork(); PIXEndNamedEvent(); -#if 0 -PIXBeginNamedEvent(0,"Misc extra xui"); -// Update XUI Timers -hr = XuiTimersRun(); - -#endif // Any threading type things to deal with from the xui side? app.HandleXuiActions(); -#if 0 -PIXEndNamedEvent(); -#endif // 4J-PB - Update the trial timer display if we are in the trial version if (!ProfileManager.IsFullVersion()) { @@ -1202,7 +1053,7 @@ void FreeRichPresenceStrings() { vRichPresenceStrings.clear(); } -#ifdef MEMORY_TRACKING +#if defined(MEMORY_TRACKING) int totalAllocGen = 0; std::unordered_map allocCounts; @@ -1228,7 +1079,6 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) { size_t realSize = XMemSizeDefault(p, dwAllocAttributes) - 16; if (trackEnable) { -#if 1 int sect = ((int)TlsGetValue(tlsIdx)) & 0x3f; *(((unsigned char*)p) + realSize) = sect; @@ -1236,7 +1086,6 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) { ((sect == sectCheck) || (sectCheck == -1))) { app.DebugPrintf("Found one\n"); } -#endif if (p) { totalAllocGen += realSize; diff --git a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h index 1c45d7c8d..22486cbf9 100644 --- a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h @@ -309,10 +309,6 @@ public: void StoreTMSPathName(WCHAR *pwchName=NULL); // TMS++ -#if 0 - C4JStorage::ETMSStatus WriteTMSFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,TMSCLIENT_CALLBACK Func,LPVOID lpParam); - HRESULT GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam); -#endif // C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0); // C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0); diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.cpp b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.cpp index 6aaf297dd..0fb20b8a3 100644 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.cpp +++ b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.cpp @@ -1984,11 +1984,9 @@ GDrawFunctions *gdraw_D3D_CreateContext(IDirect3DDevice9 *dev, S32 w, S32 h) } } - #if 1 D3DCAPS9 caps; dev->GetDeviceCaps(&caps); gdraw->conditional_nonpow2 = ((caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) != 0); - #endif gdraw->d3d_device = dev; create_all_shaders(); diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_shared.inl b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_shared.inl index a60fa520c..43ece64b1 100644 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_shared.inl +++ b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_shared.inl @@ -3,13 +3,13 @@ // This file implements some common code that can be shared across // all the sample implementations of GDraw. -#ifdef IGGY_DISABLE_GDRAW_ASSERT +#if defined(IGGY_DISABLE_GDRAW_ASSERT) #define assert(x) #else #include #endif -#ifndef GDRAW_MAYBE_UNUSED +#if !defined(GDRAW_MAYBE_UNUSED) #define GDRAW_MAYBE_UNUSED #endif @@ -105,13 +105,13 @@ struct GDrawHandle GDrawHandle * next,*prev; // 8/16 // doubly-linked list - #ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) void * raw_ptr; // 4/8 // pointer to allocation - when you're managing memory manually - #ifdef GDRAW_CORRUPTION_CHECK +#if defined(GDRAW_CORRUPTION_CHECK) U32 cached_raw_value[4]; rrbool has_check_value; - #endif - #endif +#endif +#endif GDrawFence fence; // 8 // (optional) platform fence for resource // 4 @@ -120,7 +120,7 @@ struct GDrawHandle }; // validate alignment to make sure structure will pack correctly -#ifdef __RAD64__ +#if defined(__RAD64__) RR_COMPILER_ASSERT((sizeof(GDrawHandle) & 7) == 0); #else RR_COMPILER_ASSERT((sizeof(GDrawHandle) & 3) == 0); @@ -136,17 +136,17 @@ struct GDrawHandleCache U32 did_defragment : 1; // 30 unused bits GDrawHandle state[GDRAW_HANDLE_STATE__count]; // sentinel nodes for all of the state lists - #ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) struct gfx_allocator *alloc; - #endif - #ifdef GDRAW_MANAGE_MEM_TWOPOOL +#endif +#if defined(GDRAW_MANAGE_MEM_TWOPOOL) struct gfx_allocator *alloc_other; - #endif +#endif GDrawFence prev_frame_start, prev_frame_end; // fence value at start/end of previous frame, for thrashing detection GDrawHandle handle[1]; // the rest of the handles must be stored right after this in the containing structure }; -#ifdef GDRAW_CORRUPTION_CHECK +#if defined(GDRAW_CORRUPTION_CHECK) // values for corruption checking #define GDRAW_CORRUPTIONCHECK_renderbegin 0x10 #define GDRAW_CORRUPTIONCHECK_renderend 0x20 @@ -217,20 +217,6 @@ static void debug_check_raw_values(GDrawHandleCache *c) assert(0); } } - #if 0 - GDrawHandle *s; - check_block_alloc(c->alloc, t->raw_ptr, 1); - s = c->head; - while (s != t) { - assert(s->raw_ptr != t->raw_ptr); - s = s->next; - } - s = c->active; - while (s != NULL) { - assert(s->raw_ptr != t->raw_ptr); - s = s->next; - } - #endif } t = t->next; } @@ -247,21 +233,12 @@ static void debug_check_raw_values(GDrawHandleCache *c) assert(0); } } - #if 0 - GDrawHandle *s; - check_block_alloc(c->alloc, t->raw_ptr, 1); - s = c->active; - while (s != t) { - assert(s->raw_ptr != t->raw_ptr); - s = s->next; - } - #endif } t = t->next; } } -#ifndef GDRAW_CORRUPTION_MASK +#if !defined(GDRAW_CORRUPTION_MASK) #define GDRAW_CORRUPTION_MASK 0 #endif #define debug_check_raw_values_if(c,v) \ @@ -308,7 +285,7 @@ static void debug_check_value_is_unreferenced(GDrawHandleCache *c, void *ptr) #define debug_check_raw_values_if(c,v) #endif -#ifdef SUPERDEBUG +#if defined(SUPERDEBUG) static void check_lists(GDrawHandleCache *c) { GDrawHandle *sentinel, *t; @@ -377,7 +354,7 @@ static void gdraw_HandleTransitionInsertBefore(GDrawHandle *t, GDrawHandleState t->prev = succ->prev; t->prev->next = t; t->next->prev = t; -#ifdef SUPERDEBUG +#if defined(SUPERDEBUG) printf("GD %chandle %p %s->%s\n", t->cache->is_vertex ? 'v' : 't', t, gdraw_StateName(t->state), gdraw_StateName(new_state)); #endif t->state = new_state; @@ -389,7 +366,7 @@ static RADINLINE void gdraw_HandleTransitionTo(GDrawHandle *t, GDrawHandleState gdraw_HandleTransitionInsertBefore(t, new_state, &t->cache->state[new_state]); } -#ifdef GDRAW_MANAGE_MEM_TWOPOOL +#if defined(GDRAW_MANAGE_MEM_TWOPOOL) static rrbool gdraw_MigrateResource(GDrawHandle *t, GDrawStats *stats); static void gdraw_res_free(GDrawHandle *t, GDrawStats *stats); #endif @@ -415,7 +392,7 @@ static rrbool gdraw_HandleCacheLockStats(GDrawHandle *t, void *owner, GDrawStats // unlock call assert(t->state == GDRAW_HANDLE_STATE_live || t->state == GDRAW_HANDLE_STATE_locked || t->state == GDRAW_HANDLE_STATE_pinned); if (t->state == GDRAW_HANDLE_STATE_live) { -#ifdef GDRAW_MANAGE_MEM_TWOPOOL +#if defined(GDRAW_MANAGE_MEM_TWOPOOL) // if we defragmented this frame, we can't just make resources live; // we need to migrate them to their new location. (which might fail // if we don't have enough memory left in the new pool) @@ -464,7 +441,7 @@ static void gdraw_HandleCacheInit(GDrawHandleCache *c, S32 num_handles, S32 byte c->state[i].owner = NULL; c->state[i].cache = NULL; // should never follow cache link from sentinels! c->state[i].next = c->state[i].prev = &c->state[i]; -#ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) c->state[i].raw_ptr = NULL; #endif c->state[i].fence.value = 0; @@ -477,7 +454,7 @@ static void gdraw_HandleCacheInit(GDrawHandleCache *c, S32 num_handles, S32 byte c->handle[i].next = (i == num_handles - 1) ? &c->state[GDRAW_HANDLE_STATE_free] : &c->handle[i+1]; c->handle[i].bytes = 0; c->handle[i].state = GDRAW_HANDLE_STATE_free; -#ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) c->handle[i].raw_ptr = NULL; #endif } @@ -485,10 +462,10 @@ static void gdraw_HandleCacheInit(GDrawHandleCache *c, S32 num_handles, S32 byte c->state[GDRAW_HANDLE_STATE_free].prev = &c->handle[num_handles - 1]; c->prev_frame_start.value = 0; c->prev_frame_end.value = 0; -#ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) c->alloc = NULL; #endif -#ifdef GDRAW_MANAGE_MEM_TWOPOOL +#if defined(GDRAW_MANAGE_MEM_TWOPOOL) c->alloc_other = NULL; #endif check_lists(c); @@ -503,10 +480,10 @@ static GDrawHandle *gdraw_HandleCacheAllocateBegin(GDrawHandleCache *c) gdraw_HandleTransitionTo(t, GDRAW_HANDLE_STATE_alloc); t->bytes = 0; t->owner = 0; -#ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) t->raw_ptr = NULL; #endif -#ifdef GDRAW_CORRUPTION_CHECK +#if defined(GDRAW_CORRUPTION_CHECK) t->has_check_value = false; #endif } @@ -537,10 +514,10 @@ static void gdraw_HandleCacheFree(GDrawHandle *t) c->bytes_free += t->bytes; t->bytes = 0; t->owner = 0; -#ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) t->raw_ptr = 0; #endif -#ifdef GDRAW_CORRUPTION_CHECK +#if defined(GDRAW_CORRUPTION_CHECK) t->has_check_value = false; #endif gdraw_HandleTransitionTo(t, GDRAW_HANDLE_STATE_free); @@ -571,7 +548,7 @@ static void gdraw_HandleCacheTick(GDrawHandleCache *c, GDrawFence now) c->did_defragment = false; } -#ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) static void gdraw_HandleCacheInsertDead(GDrawHandle *t) { @@ -1068,10 +1045,6 @@ static void gdraw_Blur(GDrawFunctions *g, GDrawBlurInfo *c, GDrawRenderState *r, gdraw_ExpandRect(&sbounds, sample_bounds, 1, 1, c->w, c->h); for (p=0; p < r->blur_passes; ++p) { - #if 0 // @OPTIMIZE do the filter in one pass - if (w*h <= MAX_TAPS) { - } else - #endif { // do the filter separably gdraw_BlurAxis(0,g,c,r,r->blur_x,dx, draw_bounds, &sbounds, protect, gstats); @@ -1080,7 +1053,7 @@ static void gdraw_Blur(GDrawFunctions *g, GDrawBlurInfo *c, GDrawRenderState *r, } } -#ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) static void make_pool_aligned(void **start, S32 *num_bytes, U32 alignment) { @@ -1166,7 +1139,7 @@ static void *gdraw_arena_alloc(GDrawArena *arena, U32 size, U32 align) // blocks is constant. // These invariants always hold before and after an allocation/free. -#ifndef GFXALLOC_ASSERT +#if !defined(GFXALLOC_ASSERT) #define GFXALLOC_ASSERT(x) #endif @@ -1192,7 +1165,7 @@ typedef struct gfx_allocator U32 block_shift; S32 actual_bytes_free; -#ifdef GFXALLOC_CHECK +#if defined(GFXALLOC_CHECK) int num_blocks; int num_unused; int num_alloc; @@ -1207,7 +1180,7 @@ typedef struct gfx_allocator } gfx_allocator; // about 1k (32bit), 2k (64bit) with 256 hash buckets (the default). dominated by hash table. -#ifdef GFXALLOC_CHECK +#if defined(GFXALLOC_CHECK) #define GFXALLOC_IF_CHECK(x) x #else #define GFXALLOC_IF_CHECK(x) @@ -1278,7 +1251,7 @@ static void gfxalloc_check1(gfx_allocator *alloc) #define gfxalloc_check1(a) #endif -#ifdef COMPLETE_DEBUG +#if defined(COMPLETE_DEBUG) static void verify_against_blocks(int num_regions, void *vptr, S32 len) { U32 *ptr = (U32 *) vptr; @@ -1350,7 +1323,7 @@ static void debug_complete_check(gfx_allocator *alloc, void *ptr, S32 len, void #define debug_complete_check(a,p,len,s) #endif -#ifdef GFXALLOC_CHECK +#if defined(GFXALLOC_CHECK) static void gfxalloc_check2(gfx_allocator *alloc) { int n=0; @@ -1620,7 +1593,7 @@ gfxalloc_check(alloc); GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_free <= alloc->num_blocks+1);) } -#ifdef GDRAW_MANAGE_MEM_TWOPOOL +#if defined(GDRAW_MANAGE_MEM_TWOPOOL) static rrbool gfxalloc_is_empty(gfx_allocator *alloc) { @@ -1644,7 +1617,7 @@ static rrbool gfxalloc_mem_contains(gfx_allocator *alloc, void *ptr) #endif -#ifdef GDRAW_DEBUG +#if defined(GDRAW_DEBUG) static void gfxalloc_dump(gfx_allocator *alloc) { @@ -1664,7 +1637,7 @@ static void gfxalloc_dump(gfx_allocator *alloc) #endif -#ifdef GDRAW_DEFRAGMENT +#if defined(GDRAW_DEFRAGMENT) #define GDRAW_DEFRAGMENT_may_overlap 1 // self-overlap for individual copies is OK @@ -1804,7 +1777,7 @@ static void gdraw_DefragmentMain(GDrawHandleCache *c, U32 flags, GDrawStats *sta #endif -#ifdef GDRAW_MANAGE_MEM_TWOPOOL +#if defined(GDRAW_MANAGE_MEM_TWOPOOL) // Defragmentation code for graphics memory, using two-pool strategy. // @@ -1968,7 +1941,7 @@ static rrbool gdraw_StateListIsEmpty(GDrawHandle *head) static void gdraw_CheckAllPointersUpdated(GDrawHandle *head) { -#ifdef GDRAW_DEBUG +#if defined(GDRAW_DEBUG) GDrawHandle *h; for (h = head->next; h != head; h = h->next) { assert(gfxalloc_mem_contains(h->cache->alloc, h->raw_ptr)); @@ -2106,7 +2079,7 @@ static GDRAW_MAYBE_UNUSED void gdraw_Downsample(U8 *dst, S32 dstpitch, U32 width } } -#ifndef GDRAW_NO_STREAMING_MIPGEN +#if !defined(GDRAW_NO_STREAMING_MIPGEN) #define GDRAW_MAXMIPS 16 // maximum number of mipmaps supported. @@ -2203,9 +2176,9 @@ static rrbool gdraw_MipmapAddLines(GDrawMipmapContext *c, U32 level) } } -#endif // GDRAW_NO_STREAMING_MIPGEN +#endif -#ifdef GDRAW_CHECK_BLOCK +#if defined(GDRAW_CHECK_BLOCK) static void check_block_alloc(gfx_allocator *alloc, void *ptr, rrbool allocated) { int i,n=0,m=0; @@ -2232,7 +2205,7 @@ static void check_block_alloc(gfx_allocator *alloc, void *ptr, rrbool allocated) #define check_block_alloc(a,p,f) #endif -#ifdef GDRAW_BUFFER_RING +#if defined(GDRAW_BUFFER_RING) //////////////////////////////////////////////////////////////////////// // @@ -2339,13 +2312,13 @@ static void *gdraw_bufring_alloc(gdraw_bufring * RADRESTRICT ring, U32 size, U32 // General resource manager // -#ifndef GDRAW_FENCE_FLUSH +#if !defined(GDRAW_FENCE_FLUSH) #define GDRAW_FENCE_FLUSH() #endif -#ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) // functions the platform must implement -#ifndef GDRAW_BUFFER_RING // avoid "redundant redeclaration" warning +#if !defined(GDRAW_BUFFER_RING // avoid "redundant redeclaration" warning) static void wait_on_fence(GDrawFence fence); #endif static rrbool is_fence_pending(GDrawFence fence); @@ -2369,13 +2342,13 @@ static void gdraw_res_free(GDrawHandle *r, GDrawStats *stats) assert(r->state == GDRAW_HANDLE_STATE_live || r->state == GDRAW_HANDLE_STATE_locked || r->state == GDRAW_HANDLE_STATE_dead || r->state == GDRAW_HANDLE_STATE_pinned || r->state == GDRAW_HANDLE_STATE_user_owned); -#ifdef GDRAW_MANAGE_MEM +#if defined(GDRAW_MANAGE_MEM) GDRAW_FENCE_FLUSH(); // make sure resource isn't in use before we actually free the memory wait_on_fence(r->fence); if (r->raw_ptr) { -#ifndef GDRAW_MANAGE_MEM_TWOPOOL +#if !defined(GDRAW_MANAGE_MEM_TWOPOOL) gfxalloc_free(r->cache->alloc, r->raw_ptr); #else GDrawHandleCache *c = r->cache; @@ -2434,7 +2407,7 @@ static GDrawHandle *gdraw_res_alloc_outofmem(GDrawHandleCache *c, GDrawHandle *t return NULL; } -#ifndef GDRAW_MANAGE_MEM +#if !defined(GDRAW_MANAGE_MEM) static GDrawHandle *gdraw_res_alloc_begin(GDrawHandleCache *c, S32 size, GDrawStats *stats) { diff --git a/Minecraft.Client/Platform/Windows64/Social/SocialManager.h b/Minecraft.Client/Platform/Windows64/Social/SocialManager.h index 3d34d1e30..51e459154 100644 --- a/Minecraft.Client/Platform/Windows64/Social/SocialManager.h +++ b/Minecraft.Client/Platform/Windows64/Social/SocialManager.h @@ -4,12 +4,12 @@ // Andy West // -#ifndef _SOCIAL_MANAGER_H +#if !defined(_SOCIAL_MANAGER_H) #define _SOCIAL_MANAGER_H -#ifndef __linux__ +#if !defined(__linux__) #include -#endif // __linux__ +#endif #define MAX_SOCIALPOST_CAPTION 60 #define MAX_SOCIALPOST_DESC 100 @@ -70,13 +70,6 @@ private: // Social post preview image struct. XSOCIAL_PREVIEWIMAGE m_PostPreviewImage; -#if 0 - // Social post image params. - XSOCIAL_IMAGEPOSTPARAMS m_PostImageParams; - - // Social post link params. - XSOCIAL_LINKPOSTPARAMS m_PostLinkParams; -#endif // Image details for posting an image to social network. unsigned char* m_pMainImageBuffer; @@ -136,4 +129,4 @@ private: }; -#endif //_SOCIAL_MANAGER_H +#endif diff --git a/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp index c4df29142..6b99c167b 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp @@ -56,15 +56,7 @@ uint16_t ui16GlobalText[256]; #define NUM_PROFILE_VALUES 5 #define NUM_PROFILE_SETTINGS 4 DWORD dwProfileSettingsA[NUM_PROFILE_VALUES] = { -#if 0 - XPROFILE_OPTION_CONTROLLER_VIBRATION, - XPROFILE_GAMER_YAXIS_INVERSION, - XPROFILE_GAMER_CONTROL_SENSITIVITY, - XPROFILE_GAMER_ACTION_MOVEMENT_CONTROL, - XPROFILE_TITLE_SPECIFIC1, -#else 0, 0, 0, 0, 0 -#endif }; //------------------------------------------------------------------------------------- @@ -384,52 +376,9 @@ void DefineActions(void) { _360_JOY_BUTTON_DPAD_DOWN); } -#if 0 -HRESULT InitD3D( IDirect3DDevice9 **ppDevice, - D3DPRESENT_PARAMETERS *pd3dPP ) -{ - IDirect3D9 *pD3D; - - pD3D = Direct3DCreate9( D3D_SDK_VERSION ); - - // Set up the structure used to create the D3DDevice - // Using a permanent 1280x720 backbuffer now no matter what the actual video resolution.right Have also disabled letterboxing, - // which would letterbox a 1280x720 output if it detected a 4:3 video source - we're doing an anamorphic squash in this - // mode so don't need this functionality. - - ZeroMemory( pd3dPP, sizeof(D3DPRESENT_PARAMETERS) ); - XVIDEO_MODE VideoMode; - XGetVideoMode( &VideoMode ); - g_bWidescreen = VideoMode.fIsWideScreen; - pd3dPP->BackBufferWidth = 1280; - pd3dPP->BackBufferHeight = 720; - pd3dPP->BackBufferFormat = D3DFMT_A8R8G8B8; - pd3dPP->BackBufferCount = 1; - pd3dPP->EnableAutoDepthStencil = TRUE; - pd3dPP->AutoDepthStencilFormat = D3DFMT_D24S8; - pd3dPP->SwapEffect = D3DSWAPEFFECT_DISCARD; - pd3dPP->PresentationInterval = D3DPRESENT_INTERVAL_ONE; - //pd3dPP->Flags = D3DPRESENTFLAG_NO_LETTERBOX; - //ERR[D3D]: Can't set D3DPRESENTFLAG_NO_LETTERBOX when wide-screen is enabled - // in the launcher/dashboard. - if(g_bWidescreen) - pd3dPP->Flags=0; - else - pd3dPP->Flags = D3DPRESENTFLAG_NO_LETTERBOX; - - // Create the device. - return pD3D->CreateDevice( - 0, - D3DDEVTYPE_HAL, - NULL, - D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_BUFFER_2_FRAMES, - pd3dPP, - ppDevice ); -} -#endif // #define MEMORY_TRACKING -#ifdef MEMORY_TRACKING +#if defined(MEMORY_TRACKING) void ResetMem(); void DumpMem(); void MemPixStuff(); @@ -606,7 +555,7 @@ HRESULT InitDevice() { app.DebugPrintf("width: %d, height: %d\n", width, height); UINT createDeviceFlags = 0; -#ifdef _DEBUG +#if defined(_DEBUG) createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; #endif @@ -765,28 +714,10 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, return 0; } -#if 0 - // Main message loop - MSG msg = {0}; - while( WM_QUIT != msg.message ) - { - if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) - { - TranslateMessage( &msg ); - DispatchMessage( &msg ); - } - else - { - Render(); - } - } - - return (int) msg.wParam; -#endif static bool bTrialTimerDisplayed = true; -#ifdef MEMORY_TRACKING +#if defined(MEMORY_TRACKING) ResetMem(); MEMORYSTATUS memStat; GlobalMemoryStatus(&memStat); @@ -794,30 +725,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, memStat.dwAvailPhys / (1024 * 1024)); #endif -#if 0 - // Initialize D3D - hr = InitD3D( &pDevice, &d3dpp ); - g_pD3DDevice = pDevice; - if( FAILED(hr) ) - { - app.DebugPrintf - ( "Failed initializing D3D.\n" ); - return -1; - } - - // Initialize the application, assuming sharing of the d3d interface. - hr = app.InitShared( pDevice, &d3dpp, - XuiPNGTextureLoader ); - - if ( FAILED(hr) ) - { - app.DebugPrintf - ( "Failed initializing application.\n" ); - - return -1; - } - -#endif app.loadMediaArchive(); RenderManager.Initialise(g_pd3dDevice, g_pSwapChain); @@ -846,66 +753,10 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, NUM_PROFILE_VALUES, NUM_PROFILE_SETTINGS, dwProfileSettingsA, app.GAME_DEFINED_PROFILE_DATA_BYTES * XUSER_MAX_COUNT, &app.uiGameDefinedDataChangedBitmask); -#if 0 - // register the awards - ProfileManager.RegisterAward(eAward_TakingInventory, ACHIEVEMENT_01, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_GettingWood, ACHIEVEMENT_02, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_Benchmarking, ACHIEVEMENT_03, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_TimeToMine, ACHIEVEMENT_04, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_HotTopic, ACHIEVEMENT_05, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_AquireHardware, ACHIEVEMENT_06, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_TimeToFarm, ACHIEVEMENT_07, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_BakeBread, ACHIEVEMENT_08, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_TheLie, ACHIEVEMENT_09, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_GettingAnUpgrade, ACHIEVEMENT_10, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_DeliciousFish, ACHIEVEMENT_11, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_OnARail, ACHIEVEMENT_12, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_TimeToStrike, ACHIEVEMENT_13, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_MonsterHunter, ACHIEVEMENT_14, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_CowTipper, ACHIEVEMENT_15, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_WhenPigsFly, ACHIEVEMENT_16, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_LeaderOfThePack, ACHIEVEMENT_17, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_MOARTools, ACHIEVEMENT_18, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_DispenseWithThis, ACHIEVEMENT_19, eAwardType_Achievement); - ProfileManager.RegisterAward(eAward_InToTheNether, ACHIEVEMENT_20, eAwardType_Achievement); - - ProfileManager.RegisterAward(eAward_mine100Blocks, GAMER_PICTURE_GAMERPIC1, eAwardType_GamerPic,false,app.GetStringTable(),IDS_AWARD_TITLE,IDS_AWARD_GAMERPIC1,IDS_CONFIRM_OK); - ProfileManager.RegisterAward(eAward_kill10Creepers, GAMER_PICTURE_GAMERPIC2, eAwardType_GamerPic,false,app.GetStringTable(),IDS_AWARD_TITLE,IDS_AWARD_GAMERPIC2,IDS_CONFIRM_OK); - - ProfileManager.RegisterAward(eAward_eatPorkChop, AVATARASSETAWARD_PORKCHOP_TSHIRT, eAwardType_AvatarItem,false,app.GetStringTable(),IDS_AWARD_TITLE,IDS_AWARD_AVATAR1,IDS_CONFIRM_OK); - ProfileManager.RegisterAward(eAward_play100Days, AVATARASSETAWARD_WATCH, eAwardType_AvatarItem,false,app.GetStringTable(),IDS_AWARD_TITLE,IDS_AWARD_AVATAR2,IDS_CONFIRM_OK); - ProfileManager.RegisterAward(eAward_arrowKillCreeper, AVATARASSETAWARD_CAP, eAwardType_AvatarItem,false,app.GetStringTable(),IDS_AWARD_TITLE,IDS_AWARD_AVATAR3,IDS_CONFIRM_OK); - - ProfileManager.RegisterAward(eAward_socialPost, 0, eAwardType_Theme,false,app.GetStringTable(),IDS_AWARD_TITLE,IDS_AWARD_THEME,IDS_CONFIRM_OK,THEME_NAME,THEME_FILESIZE); - - // Rich Presence init - number of presences, number of contexts - ProfileManager.RichPresenceInit(4,1); - ProfileManager.RegisterRichPresenceContext(CONTEXT_GAME_STATE); - - // initialise the storage manager with a default save display name, a Minimum save size, and a callback for displaying the saving message - StorageManager.Init(app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app); - // Set up the global title storage path - StorageManager.StoreTMSPathName(); - - // set a function to be called when there's a sign in change, so we can exit a level if the primary player signs out - ProfileManager.SetSignInChangeCallback(&CConsoleMinecraftApp::SignInChangeCallback,(LPVOID)&app); - - // set a function to be called when the ethernet is disconnected, so we can back out if required - ProfileManager.SetNotificationsCallback(&CConsoleMinecraftApp::NotificationsCallback,(LPVOID)&app); - -#endif // Set a callback for the default player options to be set - when there is // no profile data for the player ProfileManager.SetDefaultOptionsCallback( &CConsoleMinecraftApp::DefaultOptionsCallback, (LPVOID)&app); -#if 0 - // Set a callback to deal with old profile versions needing updated to new versions - ProfileManager.SetOldProfileVersionCallback(&CConsoleMinecraftApp::OldProfileVersionCallback,(LPVOID)&app); - - // Set a callback for when there is a read error on profile data - ProfileManager.SetProfileReadErrorCallback(&CConsoleMinecraftApp::ProfileReadErrorCallback,(LPVOID)&app); - -#endif // QNet needs to be setup after profile manager, as we do not want its // Notify listener to handle XN_SYS_SIGNINCHANGED notifications. This does // mean that we need to have a callback in the ProfileManager for @@ -918,23 +769,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // debug switch to trial version ProfileManager.SetDebugFullOverride(true); -#if 0 - //ProfileManager.AddDLC(2); - StorageManager.SetDLCPackageRoot("DLCDrive"); - StorageManager.RegisterMarketplaceCountsCallback(&CConsoleMinecraftApp::MarketplaceCountsCallback,(LPVOID)&app); - // Kinect ! - - if(XNuiGetHardwareStatus()!=0) - { - // If the Kinect Sensor is not physically connected, this function returns 0. - NuiInitialize(NUI_INITIALIZE_FLAG_USES_HIGH_QUALITY_COLOR | NUI_INITIALIZE_FLAG_USES_DEPTH | - NUI_INITIALIZE_FLAG_EXTRAPOLATE_FLOOR_PLANE | NUI_INITIALIZE_FLAG_USES_FITNESS | NUI_INITIALIZE_FLAG_NUI_GUIDE_DISABLED | NUI_INITIALIZE_FLAG_SUPPRESS_AUTOMATIC_UI,NUI_INITIALIZE_DEFAULT_HARDWARE_THREAD ); - } - - // Sentient ! - hr = TelemetryManager->Init(); - -#endif // Initialise TLS for tesselator, for this main thread Tesselator::CreateNewThreadStorage(1024 * 1024); // Initialise TLS for AABB and Vec3 pools, for this main thread @@ -950,52 +784,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, app.InitGameSettings(); -#if 0 - //bool bDisplayPauseMenu=false; - - // set the default gamma level - float fVal=50.0f*327.68f; - RenderManager.UpdateGamma((unsigned short)fVal); - - // load any skins - //app.AddSkinsToMemoryTextureFiles(); - - // set the achievement text for a trial achievement, now we have the string table loaded - ProfileManager.SetTrialTextStringTable(app.GetStringTable(),IDS_CONFIRM_OK, IDS_CONFIRM_CANCEL); - ProfileManager.SetTrialAwardText(eAwardType_Achievement,IDS_UNLOCK_TITLE,IDS_UNLOCK_ACHIEVEMENT_TEXT); - ProfileManager.SetTrialAwardText(eAwardType_GamerPic,IDS_UNLOCK_TITLE,IDS_UNLOCK_GAMERPIC_TEXT); - ProfileManager.SetTrialAwardText(eAwardType_AvatarItem,IDS_UNLOCK_TITLE,IDS_UNLOCK_AVATAR_TEXT); - ProfileManager.SetTrialAwardText(eAwardType_Theme,IDS_UNLOCK_TITLE,IDS_UNLOCK_THEME_TEXT); - ProfileManager.SetUpsellCallback(&app.UpsellReturnedCallback,&app); - - // Set up a debug character press sequence -#ifndef _FINAL_BUILD - app.SetDebugSequence("LRLRYYY"); -#endif - - // Initialise the social networking manager. - CSocialManager::Instance()->Initialise(); - - // Update the base scene quick selects now that the minecraft class exists - //CXuiSceneBase::UpdateScreenSettings(0); -#endif app.InitialiseTips(); -#if 0 - - DWORD initData=0; - -#ifndef _FINAL_BUILD -#ifndef _DEBUG -#pragma message(__LOC__ "Need to define the _FINAL_BUILD before submission") -#endif -#endif - - // Set the default sound levels - pMinecraft->options->set(Options::Option::MUSIC,1.0f); - pMinecraft->options->set(Options::Option::SOUND,1.0f); - - app.NavigateToScene(XUSER_INDEX_ANY,eUIScene_Intro,&initData); -#endif // Set the default sound levels pMinecraft->options->set(Options::Option::MUSIC, 1.0f); @@ -1004,28 +793,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // app.TemporaryCreateGameStart(); // Sleep(10000); -#if 0 - // Intro loop ? - while(app.IntroRunning()) - { - ProfileManager.Tick(); - // Tick XUI - app.RunFrame(); - - // 4J : WESTY : Added to ensure we always have clear background for intro. - RenderManager.SetClearColour(D3DCOLOR_RGBA(0,0,0,255)); - RenderManager.Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // Render XUI - hr = app.Render(); - - // Present the frame. - RenderManager.Present(); - - // Update XUI Timers - hr = XuiTimersRun(); - } -#endif MSG msg = {0}; while (WM_QUIT != msg.message) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { @@ -1034,15 +801,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, continue; } RenderManager.StartFrame(); -#if 0 - if(pMinecraft->soundEngine->isStreamingWavebankReady() && - !pMinecraft->soundEngine->isPlayingStreamingGameMusic() && - !pMinecraft->soundEngine->isPlayingStreamingCDMusic() ) - { - // play some music in the menus - pMinecraft->soundEngine->playStreaming(L"", 0, 0, 0, 0, 0, false); - } -#endif // static bool bPlay=false; // if(bPlay) @@ -1104,7 +862,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, pMinecraft->soundEngine->playMusicTick(); -#ifdef MEMORY_TRACKING +#if defined(MEMORY_TRACKING) static bool bResetMemTrack = false; static bool bDumpMemTrack = false; @@ -1128,123 +886,16 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, memStat.dwAvailPhys / (1024 * 1024)); printf("Renderer used: %d\n", RenderManager.CBuffSize(-1)); } -#endif -#if 0 - static bool bDumpTextureUsage = false; - if( bDumpTextureUsage ) - { - RenderManager.TextureGetStats(); - bDumpTextureUsage = false; - } #endif ui.tick(); ui.render(); -#if 0 - app.HandleButtonPresses(); - - // store the minecraft renderstates, and re-set them after the xui render - GetRenderAndSamplerStates(pDevice,RenderStateA,SamplerStateA); - - // Tick XUI - PIXBeginNamedEvent(0,"Xui running"); - app.RunFrame(); - PIXEndNamedEvent(); - - // Render XUI - - PIXBeginNamedEvent(0,"XUI render"); - MemSect(7); - hr = app.Render(); - MemSect(0); - GetRenderAndSamplerStates(pDevice,RenderStateA2,SamplerStateA2); - PIXEndNamedEvent(); - - for(int i=0;i<8;i++) - { - if(RenderStateA2[i]!=RenderStateA[i]) - { - //printf("Reseting RenderStateA[%d] after a XUI render\n",i); - pDevice->SetRenderState(RenderStateModes[i],RenderStateA[i]); - } - } - for(int i=0;i<5;i++) - { - if(SamplerStateA2[i]!=SamplerStateA[i]) - { - //printf("Reseting SamplerStateA[%d] after a XUI render\n",i); - pDevice->SetSamplerState(0,SamplerStateModes[i],SamplerStateA[i]); - } - } - - RenderManager.Set_matrixDirty(); -#endif // Present the frame. RenderManager.Present(); ui.CheckMenuDisplayed(); -#if 0 - PIXBeginNamedEvent(0,"Profile load check"); - // has the game defined profile data been changed (by a profile load) - if(app.uiGameDefinedDataChangedBitmask!=0) - { - void *pData; - for(int i=0;istats[ i ]->clear(); - pMinecraft->stats[i]->parse(pData); - } - } - - // Check to see if we can post to social networks. - CSocialManager::Instance()->RefreshPostingCapability(); - - // clear the flag - app.uiGameDefinedDataChangedBitmask=0; - - // Check if any profile write are needed - app.CheckGameSettingsChanged(); - } - PIXEndNamedEvent(); - app.TickDLCOffersRetrieved(); - app.TickTMSPPFilesRetrieved(); - - PIXBeginNamedEvent(0,"Network manager do work #2"); - g_NetworkManager.DoWork(); - PIXEndNamedEvent(); - - PIXBeginNamedEvent(0,"Misc extra xui"); - // Update XUI Timers - hr = XuiTimersRun(); - -#endif // Any threading type things to deal with from the xui side? app.HandleXuiActions(); -#if 0 - PIXEndNamedEvent(); -#endif // 4J-PB - Update the trial timer display if we are in the trial version if (!ProfileManager.IsFullVersion()) { @@ -1277,7 +928,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, g_pd3dDevice->Release(); } -#ifdef MEMORY_TRACKING +#if defined(MEMORY_TRACKING) int totalAllocGen = 0; std::unordered_map allocCounts; @@ -1303,7 +954,6 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) { size_t realSize = XMemSizeDefault(p, dwAllocAttributes) - 16; if (trackEnable) { -#if 1 int sect = ((int)TlsGetValue(tlsIdx)) & 0x3f; *(((unsigned char*)p) + realSize) = sect; @@ -1311,7 +961,6 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) { ((sect == sectCheck) || (sectCheck == -1))) { app.DebugPrintf("Found one\n"); } -#endif if (p) { totalAllocGen += realSize; diff --git a/Minecraft.Client/Platform/stubs.cpp b/Minecraft.Client/Platform/stubs.cpp index d0cc963f6..a4ca18df7 100644 --- a/Minecraft.Client/Platform/stubs.cpp +++ b/Minecraft.Client/Platform/stubs.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#ifdef __linux__ +#if defined(__linux__) void LinuxLogStubLightmapProbe() { static bool logged = false; @@ -111,25 +111,5 @@ void glTexGeni(int,int,int) { } -#if 0 -// 4J Stu - Added these to stop us needing to pull in loads of media libraries just to use Qnet -#include -DWORD XCamInitialize(){ return 0; } -VOID XCamShutdown() {} - -DWORD XCamCreateStreamEngine( - CONST XCAM_STREAM_ENGINE_INIT_PARAMS *pParams, - PIXCAMSTREAMENGINE *ppEngine - ) { return 0; } - -DWORD XCamSetView( - XCAMZOOMFACTOR ZoomFactor, - LONG XCenter, - LONG YCenter, - PXOVERLAPPED pOverlapped -) { return 0; } - -XCAMDEVICESTATE XCamGetStatus() { return XCAMDEVICESTATE_DISCONNECTED; } -#endif #endif