mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-26 18:12:54 +00:00
refactor: stop inheriting Game from IPlatformGame and delete the override stubs
This commit is contained in:
parent
9c502ce8fc
commit
08d8e341b9
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "app/common/Game.h"
|
||||
#include "java/Class.h" // eINSTANCEOF
|
||||
#include "platform/game/game.h"
|
||||
|
||||
AppGameServices::AppGameServices(Game& game, IMenuService& menus)
|
||||
: game_(game), menus_(menus) {}
|
||||
|
|
@ -262,19 +263,21 @@ bool AppGameServices::isXuidDeadmau5(PlayerUID xuid) {
|
|||
void AppGameServices::fatalLoadError() { game_.FatalLoadError(); }
|
||||
|
||||
void AppGameServices::setRichPresenceContext(int iPad, int contextId) {
|
||||
game_.SetRichPresenceContext(iPad, contextId);
|
||||
PlatformGame.SetRichPresenceContext(iPad, contextId);
|
||||
}
|
||||
|
||||
void AppGameServices::captureSaveThumbnail() { game_.CaptureSaveThumbnail(); }
|
||||
void AppGameServices::captureSaveThumbnail() {
|
||||
PlatformGame.CaptureSaveThumbnail();
|
||||
}
|
||||
|
||||
void AppGameServices::getSaveThumbnail(std::uint8_t** data,
|
||||
unsigned int* size) {
|
||||
game_.GetSaveThumbnail(data, size);
|
||||
PlatformGame.GetSaveThumbnail(data, size);
|
||||
}
|
||||
|
||||
void AppGameServices::readBannedList(int iPad, eTMSAction action,
|
||||
bool bCallback) {
|
||||
game_.ReadBannedList(iPad, action, bCallback);
|
||||
PlatformGame.ReadBannedList(iPad, action, bCallback);
|
||||
}
|
||||
|
||||
void AppGameServices::updatePlayerInfo(std::uint8_t networkSmallId,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include "app/common/DebugOptions.h"
|
||||
#include "app/common/GameRules/GameRuleManager.h"
|
||||
#include "app/common/GameSettingsManager.h"
|
||||
#include "platform/game/IPlatformGame.h"
|
||||
#include "app/common/LocalizationManager.h"
|
||||
#include "app/common/MenuController.h"
|
||||
#include "app/common/NetworkController.h"
|
||||
|
|
@ -62,7 +61,7 @@ class Merchant;
|
|||
|
||||
class CMinecraftAudio;
|
||||
|
||||
class Game : public IPlatformGame {
|
||||
class Game {
|
||||
public:
|
||||
Game();
|
||||
|
||||
|
|
@ -359,7 +358,6 @@ public:
|
|||
const int iPad) {
|
||||
return m_gameSettingsManager.setDefaultOptions(pSettings, iPad);
|
||||
}
|
||||
void SetRichPresenceContext(int iPad, int contextId) override = 0;
|
||||
|
||||
void SetGameSettings(int iPad, eGameSetting eVal, unsigned char ucVal) {
|
||||
m_gameSettingsManager.setGameSettings(iPad, eVal, ucVal);
|
||||
|
|
@ -896,17 +894,6 @@ public:
|
|||
void ReadXuidsFileFromTMS(int iPad, eTMSAction action,
|
||||
bool bCallback = false);
|
||||
|
||||
// images for save thumbnail/social post
|
||||
void CaptureSaveThumbnail() override = 0;
|
||||
void GetSaveThumbnail(std::uint8_t** thumbnailData,
|
||||
unsigned int* thumbnailSize) override = 0;
|
||||
void ReleaseSaveThumbnail() override = 0;
|
||||
void GetScreenshot(int iPad, std::uint8_t** screenshotData,
|
||||
unsigned int* screenshotSize) override = 0;
|
||||
|
||||
void ReadBannedList(int iPad, eTMSAction action = (eTMSAction)0,
|
||||
bool bCallback = false) override = 0;
|
||||
|
||||
// DLC data members moved to DLCController
|
||||
// Sign-in info moved to NetworkController
|
||||
|
||||
|
|
@ -1150,13 +1137,6 @@ public:
|
|||
return SkinManager::getSkinPathFromId(skinId);
|
||||
}
|
||||
|
||||
int LoadLocalTMSFile(char* wchTMSFile) override = 0;
|
||||
int LoadLocalTMSFile(char* wchTMSFile,
|
||||
eFileExtensionType eExt) override = 0;
|
||||
void FreeLocalTMSFiles(eTMSFileType eType) override = 0;
|
||||
int GetLocalTMSFileIndex(char* wchTMSFile, bool bFilenameIncludesExtension,
|
||||
eFileExtensionType eEXT) override = 0;
|
||||
|
||||
virtual bool GetTMSGlobalFileListRead() { return true; }
|
||||
virtual bool GetTMSDLCInfoRead() { return true; }
|
||||
virtual bool GetTMSXUIDsFileRead() { return true; }
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ LinuxGame app;
|
|||
|
||||
LinuxGame::LinuxGame() : Game() {}
|
||||
|
||||
void LinuxGame::SetRichPresenceContext(int iPad, int contextId) {}
|
||||
|
||||
void LinuxGame::StoreLaunchData() {}
|
||||
void LinuxGame::ExitGame() {
|
||||
app.DebugPrintf("Linux_App LinuxGame::ExitGame AFTER START\n");
|
||||
|
|
@ -36,14 +34,6 @@ void LinuxGame::FatalLoadError() {
|
|||
assert(0);
|
||||
}
|
||||
|
||||
void LinuxGame::CaptureSaveThumbnail() {}
|
||||
void LinuxGame::GetSaveThumbnail(std::uint8_t** thumbnailData,
|
||||
unsigned int* thumbnailSize) {}
|
||||
void LinuxGame::ReleaseSaveThumbnail() {}
|
||||
|
||||
void LinuxGame::GetScreenshot(int iPad, std::uint8_t** screenshotData,
|
||||
unsigned int* screenshotSize) {}
|
||||
|
||||
void LinuxGame::TemporaryCreateGameStart() {
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// From CScene_Main::OnInit
|
||||
|
|
@ -120,16 +110,3 @@ void LinuxGame::TemporaryCreateGameStart() {
|
|||
thread->run();
|
||||
}
|
||||
|
||||
int LinuxGame::GetLocalTMSFileIndex(char* wchTMSFile,
|
||||
bool bFilenameIncludesExtension,
|
||||
eFileExtensionType eEXT) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int LinuxGame::LoadLocalTMSFile(char* wchTMSFile) { return -1; }
|
||||
|
||||
int LinuxGame::LoadLocalTMSFile(char* wchTMSFile, eFileExtensionType eExt) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void LinuxGame::FreeLocalTMSFiles(eTMSFileType eType) {}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "minecraft/GameEnums.h"
|
||||
#include "app/common/Game.h"
|
||||
|
||||
class C4JStringTable;
|
||||
|
|
@ -11,31 +8,10 @@ class LinuxGame : public Game {
|
|||
public:
|
||||
LinuxGame();
|
||||
|
||||
void SetRichPresenceContext(int iPad, int contextId) override;
|
||||
|
||||
void StoreLaunchData() override;
|
||||
void ExitGame() override;
|
||||
void FatalLoadError() override;
|
||||
|
||||
void CaptureSaveThumbnail() override;
|
||||
void GetSaveThumbnail(std::uint8_t** thumbnailData,
|
||||
unsigned int* thumbnailSize) override;
|
||||
void ReleaseSaveThumbnail() override;
|
||||
void GetScreenshot(int iPad, std::uint8_t** screenshotData,
|
||||
unsigned int* screenshotSize) override;
|
||||
|
||||
int LoadLocalTMSFile(char* wchTMSFile) override;
|
||||
int LoadLocalTMSFile(char* wchTMSFile,
|
||||
eFileExtensionType eExt) override;
|
||||
|
||||
void FreeLocalTMSFiles(eTMSFileType eType) override;
|
||||
int GetLocalTMSFileIndex(
|
||||
char* wchTMSFile, bool bFilenameIncludesExtension,
|
||||
eFileExtensionType eEXT = eFileExtensionType_PNG) override;
|
||||
|
||||
void ReadBannedList(int iPad, eTMSAction action = (eTMSAction)0,
|
||||
bool bCallback = false) override {}
|
||||
|
||||
C4JStringTable* GetStringTable() { return nullptr; }
|
||||
|
||||
// original code
|
||||
|
|
|
|||
|
|
@ -18,23 +18,10 @@ WindowsGame app;
|
|||
|
||||
WindowsGame::WindowsGame() : Game() {}
|
||||
|
||||
void WindowsGame::SetRichPresenceContext(int iPad, int contextId) {
|
||||
PlatformProfile.SetRichPresenceContextValue(iPad, CONTEXT_GAME_STATE,
|
||||
contextId);
|
||||
}
|
||||
|
||||
void WindowsGame::StoreLaunchData() {}
|
||||
void WindowsGame::ExitGame() {}
|
||||
void WindowsGame::FatalLoadError() {}
|
||||
|
||||
void WindowsGame::CaptureSaveThumbnail() {}
|
||||
void WindowsGame::GetSaveThumbnail(std::uint8_t** thumbnailData,
|
||||
unsigned int* thumbnailSize) {}
|
||||
void WindowsGame::ReleaseSaveThumbnail() {}
|
||||
|
||||
void WindowsGame::GetScreenshot(int iPad, std::uint8_t** screenshotData,
|
||||
unsigned int* screenshotSize) {}
|
||||
|
||||
void WindowsGame::TemporaryCreateGameStart() {
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// From CScene_Main::OnInit
|
||||
|
|
@ -111,16 +98,3 @@ void WindowsGame::TemporaryCreateGameStart() {
|
|||
thread->run();
|
||||
}
|
||||
|
||||
int WindowsGame::GetLocalTMSFileIndex(char* wchTMSFile,
|
||||
bool bFilenameIncludesExtension,
|
||||
eFileExtensionType eEXT) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int WindowsGame::LoadLocalTMSFile(char* wchTMSFile) { return -1; }
|
||||
|
||||
int WindowsGame::LoadLocalTMSFile(char* wchTMSFile, eFileExtensionType eExt) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void WindowsGame::FreeLocalTMSFiles(eTMSFileType eType) {}
|
||||
|
|
|
|||
|
|
@ -4,31 +4,10 @@ class WindowsGame : public Game {
|
|||
public:
|
||||
WindowsGame();
|
||||
|
||||
virtual void SetRichPresenceContext(int iPad, int contextId);
|
||||
|
||||
virtual void StoreLaunchData();
|
||||
virtual void ExitGame();
|
||||
virtual void FatalLoadError();
|
||||
|
||||
virtual void CaptureSaveThumbnail();
|
||||
virtual void GetSaveThumbnail(std::uint8_t** thumbnailData,
|
||||
unsigned int* thumbnailSize);
|
||||
virtual void ReleaseSaveThumbnail();
|
||||
virtual void GetScreenshot(int iPad, std::uint8_t** screenshotData,
|
||||
unsigned int* screenshotSize);
|
||||
|
||||
virtual int LoadLocalTMSFile(char* wchTMSFile);
|
||||
virtual int LoadLocalTMSFile(char* wchTMSFile, eFileExtensionType eExt);
|
||||
|
||||
virtual void FreeLocalTMSFiles(eTMSFileType eType);
|
||||
virtual int GetLocalTMSFileIndex(
|
||||
char* wchTMSFile, bool bFilenameIncludesExtension,
|
||||
eFileExtensionType eEXT = eFileExtensionType_PNG);
|
||||
|
||||
// BANNED LEVEL LIST
|
||||
virtual void ReadBannedList(int iPad, eTMSAction action = (eTMSAction)0,
|
||||
bool bCallback = false) {}
|
||||
|
||||
C4JStringTable* GetStringTable() { return nullptr; }
|
||||
|
||||
// original code
|
||||
|
|
|
|||
Loading…
Reference in a new issue