game compiles

This commit is contained in:
JuiceyDev 2026-03-06 06:13:22 +01:00
parent 5b45dacb1c
commit c55ed7b261
16 changed files with 121 additions and 20 deletions

View file

@ -9,6 +9,8 @@ const wstring LeaderboardManager::filterNames[eNumFilterModes] =
L"Friends", L"MyScore", L"TopRank"
};
LeaderboardManager *LeaderboardManager::m_instance = NULL;
void LeaderboardManager::DeleteInstance()
{
delete m_instance;

View file

@ -1,6 +1,13 @@
#pragma once
// On Linux, the Orbis TelemetryEnum.h is already pulled in via stdafx.h ->
// SentientManager.h -> MinecraftTelemetry.h. Using the Windows64 path would
// cause duplicate enum definitions.
#if defined(__linux__)
#include "../../../Platform/Orbis/Sentient/TelemetryEnum.h"
#else
#include "../../../Platform/Windows64/Sentient/TelemetryEnum.h"
#endif
#include "../UI/UIEnums.h"
class CTelemetryManager

View file

@ -26,6 +26,12 @@
#include "../Platform/PSVita/Social/SocialManager.h"
#include "../Platform/PSVita/Sentient/DynamicConfigurations.h"
#include <libperf.h>
#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.
#include "../Platform/Orbis/Sentient/SentientManager.h"
#include "../GameState/StatsCounter.h"
#else
#include "../Platform/Orbis/Sentient/SentientManager.h"
#include "../GameState/StatsCounter.h"
@ -42,13 +48,14 @@ C_4JProfile ProfileManager;
CSentientManager SentientManager;
CXuiStringTable StringTable;
#ifndef _XBOX_ONE
#if !defined(_XBOX_ONE) && !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__
bool CSocialManager::IsTitleAllowedToPostAnything() { return false; }
bool CSocialManager::AreAllUsersAllowedToPostImages() { return false; }
bool CSocialManager::IsTitleAllowedToPostImages() { return false; }
@ -57,6 +64,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__
DWORD XShowPartyUI(DWORD dwUserIndex) { return 0; }
DWORD XShowFriendsUI(DWORD dwUserIndex) { return 0; }
@ -187,7 +195,9 @@ 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__
app.DebugPrintf("Sending from 0x%x to 0x%x %d bytes\n",this,player,dwDataSize);
#endif
}
bool IQNetPlayer::IsSameSystem(IQNetPlayer *player) { return true; }
DWORD IQNetPlayer::GetSendQueueSize( IQNetPlayer *player, DWORD dwFlags ) { return 0; }

View file

@ -10,7 +10,7 @@
#define __STR2__(x) #x
#define __STR1__(x) __STR2__(x)
#define __LOC__ __FILE__ "("__STR1__(__LINE__)") : 4J Warning Msg: "
#define __LOC__ __FILE__ "(" __STR1__(__LINE__) ") : 4J Warning Msg: "
// use - #pragma message(__LOC__"Need to do something here")
@ -295,14 +295,15 @@ typedef XUID GameSessionUID;
#include "../Platform/Windows64/Windows64_UIController.h"
#elif defined __linux__
// Linux build: avoid pulling in Windows64 platform headers (they cause
// symbol/class redefinitions). Use Linux-specific stubs and controller.
// FIXME: Produce proper Linux equivalents for telemetry/sentient/etc.
#include "../Platform/OrbisMedia/strings.h" // temporary strings
#include "../Platform/Xbox/Sentient/SentientTelemetryCommon.h"
#include "../Platform/Xbox/Sentient/DynamicConfigurations.h"
#include "../Platform/Xbox/GameConfig/Minecraft.spa.h"
// symbol/class redefinitions). Use Orbis-compatible stubs and Linux controller.
#include "../Platform/Linux/Linux_App.h"
#include "../Platform/OrbisMedia/strings.h"
#include "../Platform/Orbis/Sentient/SentientTelemetryCommon.h"
#include "../Platform/Orbis/Sentient/DynamicConfigurations.h"
#include "../Platform/Orbis/GameConfig/Minecraft.spa.h"
#include "Common/Audio/SoundEngine.h"
#include "../Platform/Linux/Linux_UIController.h"
#include "../Platform/Linux/Social/SocialManager.h"
#elif defined __PSVITA__
#include "../Platform/PSVita/PSVita_App.h"
#include "../Platform/PSVitaMedia/strings.h" // TODO - create PSVita-specific version of this

View file

@ -15,4 +15,5 @@ public:
static const wstring VERSION_STRING;
static const bool DEADMAU5_CAMERA_CHEATS = false;
static const bool IS_DEMO_VERSION = false;
};

View file

@ -2,6 +2,8 @@
#include "CreativeMode.h"
#include "../Player/User.h"
#include "../Player/LocalPlayer.h"
#include "../Level/MultiPlayerLevel.h"
#include "../Player/MultiPlayerLocalPlayer.h"
#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h"
#include "../../Minecraft.World/Headers/net.minecraft.world.item.h"
#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h"

View file

@ -1,6 +1,7 @@
#include "../Build/stdafx.h"
#include "GameMode.h"
#include "../Player/LocalPlayer.h"
#include "../Level/MultiPlayerLevel.h"
#include "../Rendering/LevelRenderer.h"
#include "../../Minecraft.World/Headers/net.minecraft.world.level.h"
#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h"

View file

@ -3,6 +3,8 @@
#include "DemoMode.h"
#include "../Rendering/LevelRenderer.h"
#include "../Player/LocalPlayer.h"
#include "../Level/MultiPlayerLevel.h"
#include "../Player/MultiPlayerLocalPlayer.h"
#include "../../Minecraft.World/Headers/net.minecraft.world.level.h"
#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h"
#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h"
@ -67,7 +69,7 @@ bool SurvivalMode::destroyBlock(int x, int y, int z, int face)
bool couldDestroy = minecraft->player->canDestroy(Tile::tiles[t]);
if (item != NULL)
{
item->mineBlock(t, x, y, z, minecraft->player);
item->mineBlock(minecraft->level, t, x, y, z, minecraft->player);
if (item->count == 0)
{
minecraft->player->removeSelectedItem();

View file

@ -56,7 +56,7 @@ static void sigsegv_handler(int sig) {
//#include "NetworkManager.h"
#include "../../Rendering/Tesselator.h"
#include "../../GameState/Options.h"
#include "../Windows64/Sentient/SentientManager.h"
#include "../Orbis/Sentient/SentientManager.h"
#include "../../../Minecraft.World/Util/IntCache.h"
#include "../../Textures/Textures.h"
#include "../../../Minecraft.World/IO/Streams/Compression.h"

View file

@ -0,0 +1,13 @@
// Linux stub implementations for ShutdownManager
// The PS3/PSVita versions have full implementations; on Linux these are no-ops.
#include "../../Build/stdafx.h"
#include "../PS3/PS3Extras/ShutdownManager.h"
void ShutdownManager::Initialise() {}
void ShutdownManager::StartShutdown() {}
void ShutdownManager::MainThreadHandleShutdown() {}
void ShutdownManager::HasStarted(ShutdownManager::EThreadId /*threadId*/) {}
void ShutdownManager::HasStarted(ShutdownManager::EThreadId /*threadId*/, C4JThread::EventArray * /*eventArray*/) {}
bool ShutdownManager::ShouldRun(ShutdownManager::EThreadId /*threadId*/) { return true; }
void ShutdownManager::HasFinished(ShutdownManager::EThreadId /*threadId*/) {}

View file

@ -0,0 +1,42 @@
// ts just stink, social manager is a stupid stub rn
#pragma once
#ifndef _SOCIAL_MANAGER_H
#define _SOCIAL_MANAGER_H
enum ESocialNetwork
{
eFacebook = 0,
eNumSocialNetworks
};
class CSocialManager
{
public:
static CSocialManager* Instance()
{
static CSocialManager s_instance;
return &s_instance;
}
void Initialise() {}
void Tick() {}
bool RefreshPostingCapability() { return false; }
bool IsTitleAllowedToPostAnything() { return false; }
bool IsTitleAllowedToPostImages() { return false; }
bool IsTitleAllowedToPostLinks() { return false; }
bool AreAllUsersAllowedToPostImages() { return false; }
bool PostLinkToSocialNetwork( ESocialNetwork, DWORD, bool ) { return false; }
bool PostImageToSocialNetwork( ESocialNetwork, DWORD, bool ) { return false; }
void SetSocialPostText( const WCHAR*, const WCHAR*, const WCHAR* ) {}
private:
CSocialManager() {}
CSocialManager( const CSocialManager& );
CSocialManager& operator=( const CSocialManager& );
};
#endif // _SOCIAL_MANAGER_H

View file

@ -1,7 +1,21 @@
# get all those files
# get all those files (excluding Sony-SDK-dependent, Xbox XUI, and redist dirs)
_client_build_raw = run_command(
'sh', '-c',
'find "' + meson.current_source_dir() / 'Build' + '" -name "*.cpp" ! -path "*/redist64/*"',
'find "' + meson.current_source_dir() / 'Build' + '" -name "*.cpp"' +
' ! -path "*/redist64/*"' +
' ! -path "*/Network/Sony/*"' +
' ! -path "*/Common/XUI/*"',
check : true,
).stdout().strip().split('\n')
# Non-Build, non-Platform Minecraft.Client sources (Rendering/, UI/, Textures/,
# GameState/, Input/, Level/, Network/, Player/, Commands/, Utils/, etc.)
_client_root_raw = run_command(
'sh', '-c',
'find "' + meson.current_source_dir() + '" -name "*.cpp"' +
' ! -path "*/Build/*"' +
' ! -path "*/Platform/*"' +
' ! -path "*/CMakeFiles/*"',
check : true,
).stdout().strip().split('\n')
@ -12,6 +26,7 @@ _linux_cpp_sources = files(
'Platform/Linux/LinuxGL.cpp',
'Platform/Linux/Linux_Minecraft.cpp',
'Platform/Linux/Linux_UIController.cpp',
'Platform/Linux/Linux_ShutdownManager.cpp',
)
_linux_c_sources = files(
@ -19,7 +34,7 @@ _linux_c_sources = files(
)
executable('Minecraft.Client',
_client_build_raw + _linux_cpp_sources + _linux_c_sources,
_client_build_raw + _client_root_raw + _linux_cpp_sources + _linux_c_sources,
include_directories : include_directories('Build'),
dependencies : [
render_dep,

View file

@ -560,7 +560,7 @@ public:
virtual void onRemove(Level *level, int x, int y, int z, int id, int data);
virtual int getResourceCount(Random *random);
virtual int getResource(int data, Random *random, int playerBonusLevel);
virtual float getDestroyProgress(shared_ptr<Player> player, Level *level, int x, int y, int z);
virtual float getDestroyProgress(shared_ptr<Player> player, Level *level = nullptr, int x = 0, int y = 0, int z = 0);
virtual void spawnResources(Level *level, int x, int y, int z, int data, int playerBonusLevel);
virtual void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel);
protected:
@ -582,7 +582,7 @@ public:
virtual bool mayPlace(Level *level, int x, int y, int z);
virtual bool TestUse();
virtual bool TestUse(Level *level, int x, int y, int z, shared_ptr<Player> player);
virtual bool use(Level *level, int x, int y, int z, shared_ptr<Player> player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param
virtual bool use(Level *level, int x, int y, int z, shared_ptr<Player> player, int clickedFace = 0, float clickX = 0.0f, float clickY = 0.0f, float clickZ = 0.0f, bool soundOnly = false); // 4J added soundOnly param
virtual void stepOn(Level *level, int x, int y, int z, shared_ptr<Entity> entity);
virtual int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue);
virtual void prepareRender(Level *level, int x, int y, int z);

View file

@ -239,12 +239,14 @@ void MemSect(int sect);
#include "../../Minecraft.Client/Platform/PSVita/Sentient/SentientManager.h"
#include "../../Minecraft.Client/Platform/PSVita/Sentient/MinecraftTelemetry.h"
#elif defined(__linux__)
// FIXME: Move and port to ../Minecraft.Client/Linux
// Use Orbis-compatible headers on Linux (same as Minecraft.Client/Build/stdafx.h).
// All Orbis Sentient headers have #pragma once, preventing double-inclusion
// when DLC/other Common files also pull in Minecraft.Client stdafx.h.
#include "../../Minecraft.Client/Platform/Linux/Linux_App.h"
#include "../../Minecraft.Client/Platform/OrbisMedia/strings.h"
#include "../../Minecraft.Client/Platform/Xbox/Sentient/SentientTelemetryCommon.h"
#include "../../Minecraft.Client/Platform/Xbox/Sentient/DynamicConfigurations.h"
#include "../../Minecraft.Client/Platform/Xbox/GameConfig/Minecraft.spa.h"
#include "../../Minecraft.Client/Platform/Orbis/Sentient/SentientTelemetryCommon.h"
#include "../../Minecraft.Client/Platform/Orbis/Sentient/DynamicConfigurations.h"
#include "../../Minecraft.Client/Platform/Orbis/GameConfig/Minecraft.spa.h"
// #include "../../Minecraft.Client/Platform/Windows64/Sentient/MinecraftTelemetry.h"
#else
#include "../../Minecraft.Client/Platform/Orbis/Orbis_App.h"

View file

@ -69,7 +69,7 @@ public:
Item *getItem() const;
Icon *getIcon();
int getIconType();
bool useOn(shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false);
bool useOn(shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX = 0.0f, float clickY = 0.0f, float clickZ = 0.0f, bool bTestUseOnOnly=false);
float getDestroySpeed(Tile *tile);
bool TestUse(Level *level, shared_ptr<Player> player);
shared_ptr<ItemInstance> use(Level *level, shared_ptr<Player> player);

View file

@ -24,7 +24,10 @@ lib_world = static_library('Minecraft.World',
],
)
dep_zlib = dependency('zlib')
world_dep = declare_dependency(
link_with : lib_world,
dependencies : [dep_zlib],
include_directories : include_directories('Build/x64headers'),
)