mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-13 18:11:59 +00:00
Compare commits
20 Commits
2fba264c08
...
nightly-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09df8928ee | ||
|
|
d3df53503a | ||
|
|
5bccf89fe2 | ||
|
|
5f931d74fc | ||
|
|
585455cef0 | ||
|
|
3ab29ec26e | ||
|
|
e5351b51c0 | ||
|
|
42e75876f2 | ||
|
|
5e5b685c72 | ||
|
|
d4ac3cd645 | ||
|
|
1b8a14357c | ||
|
|
7c1606837f | ||
|
|
4a7b34f4c2 | ||
|
|
9167454767 | ||
|
|
1a552fbd0c | ||
|
|
cccfd860b9 | ||
|
|
d0094a6409 | ||
|
|
78d4bc80cf | ||
|
|
6595b3820d | ||
|
|
7f0237a286 |
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: MinecraftConsoles Community Discord
|
||||
url: https://discord.gg/jrum7HhegA
|
||||
- name: ❗NEW❗ MinecraftConsoles Community Discord
|
||||
url: https://discord.gg/dH8AZWGcau
|
||||
about: If you need help, please ask for it in our Discord! You will get assistance much faster there, including help getting the project to compile.
|
||||
|
||||
2
.github/workflows/nightly-server.yml
vendored
2
.github/workflows/nightly-server.yml
vendored
@@ -31,6 +31,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set platform lowercase
|
||||
run: echo "MATRIX_PLATFORM=$('${{ matrix.platform }}'.ToLower())" >> $env:GITHUB_ENV
|
||||
|
||||
2
.github/workflows/nightly.yml
vendored
2
.github/workflows/nightly.yml
vendored
@@ -30,6 +30,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set platform lowercase
|
||||
run: echo "MATRIX_PLATFORM=$('${{ matrix.platform }}'.ToLower())" >> $env:GITHUB_ENV
|
||||
|
||||
2
.github/workflows/pull-request.yml
vendored
2
.github/workflows/pull-request.yml
vendored
@@ -18,6 +18,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -420,3 +420,6 @@ result
|
||||
result-*
|
||||
.direnv/
|
||||
.xwin-cache/
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "Minecraft.Client/Windows64/4JLibs"]
|
||||
path = Minecraft.Client/Windows64/4JLibs
|
||||
url = https://github.com/Patoke/4JLibs.git
|
||||
@@ -76,6 +76,8 @@ list(APPEND MINECRAFT_SHARED_DEFINES ${PLATFORM_DEFINES})
|
||||
# ---
|
||||
# Sources
|
||||
# ---
|
||||
add_subdirectory("Minecraft.Client/${PLATFORM_NAME}/4JLibs")
|
||||
|
||||
add_subdirectory(Minecraft.World)
|
||||
add_subdirectory(Minecraft.Client)
|
||||
if(PLATFORM_NAME STREQUAL "Windows64") # Server is only supported on Windows for now
|
||||
|
||||
15
COMPILE.md
15
COMPILE.md
@@ -2,13 +2,14 @@
|
||||
|
||||
## Visual Studio
|
||||
|
||||
1. Clone or download the repository
|
||||
1. Open the repo folder in Visual Studio 2022+.
|
||||
2. Wait for cmake to configure the project and load all assets (this may take a few minutes on the first run).
|
||||
3. Right click a folder in the solution explorer and switch to the 'CMake Targets View'
|
||||
4. Select platform and configuration from the dropdown. EG: `Windows64 - Debug` or `Windows64 - Release`
|
||||
5. Pick the startup project `Minecraft.Client.exe` or `Minecraft.Server.exe` using the debug targets dropdown
|
||||
6. Build and run the project:
|
||||
1. Clone the repo, including submodules.
|
||||
- If you don't, the build will fail. `git clone --recurse-submodules https://github.com/MCLCE/MinecraftConsoles.git`
|
||||
2. Open the repo folder in Visual Studio 2022+.
|
||||
3. Wait for cmake to configure the project and load all assets (this may take a few minutes on the first run).
|
||||
4. Right click a folder in the solution explorer and switch to the 'CMake Targets View'
|
||||
5. Select platform and configuration from the dropdown. EG: `Windows64 - Debug` or `Windows64 - Release`
|
||||
6. Pick the startup project `Minecraft.Client.exe` or `Minecraft.Server.exe` using the debug targets dropdown
|
||||
7. Build and run the project:
|
||||
- `Build > Build Solution` (or `Ctrl+Shift+B`)
|
||||
- Start debugging with `F5`.
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ byteArray ArchiveFile::getFile(const wstring &filename)
|
||||
app.DebugPrintf("Couldn't find file in archive\n");
|
||||
app.DebugPrintf("Failed to find file '%ls' in archive\n", filename.c_str());
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
|
||||
@@ -56,16 +56,10 @@ target_link_libraries(Minecraft.Client PRIVATE
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
$<$<CONFIG:Debug>: # Debug 4J libraries
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>: # Release 4J libraries
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
4JLibs.${PLATFORM_NAME}.Input
|
||||
4JLibs.${PLATFORM_NAME}.Profile
|
||||
4JLibs.${PLATFORM_NAME}.Storage
|
||||
4JLibs.${PLATFORM_NAME}.Render
|
||||
)
|
||||
|
||||
# Iggy libs
|
||||
|
||||
@@ -1016,7 +1016,7 @@ bool Chunk::isEmpty()
|
||||
void Chunk::setDirty()
|
||||
{
|
||||
// 4J - not used, but if this starts being used again then we'll need to investigate how best to handle it.
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
levelRenderer->setGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_DIRTY);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
#include "../Minecraft.World/DurangoStats.h"
|
||||
#include "../Minecraft.World/GenericStats.h"
|
||||
#endif
|
||||
#include <regex>
|
||||
|
||||
ClientConnection::ClientConnection(Minecraft *minecraft, const wstring& ip, int port)
|
||||
{
|
||||
@@ -1547,8 +1546,6 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
|
||||
bool replaceEntitySource = false;
|
||||
bool replaceItem = false;
|
||||
|
||||
static std::wregex IDS_Pattern(LR"(\{\*IDS_(\d+)\*\})"); //maybe theres a better way to do translateable IDS
|
||||
|
||||
int stringArgsSize = packet->m_stringArgs.size();
|
||||
|
||||
wstring playerDisplayName = L"";
|
||||
@@ -1565,15 +1562,10 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
|
||||
if (stringArgsSize >= 1) {
|
||||
message = packet->m_stringArgs[0];
|
||||
|
||||
std::wsmatch match;
|
||||
while (std::regex_search(message, match, IDS_Pattern)) {
|
||||
message = replaceAll(message, match[0], app.GetString(std::stoi(match[1].str())));
|
||||
}
|
||||
|
||||
message = app.EscapeHTMLString(message); //do this to enforce escaped string
|
||||
message = app.FormatChatMessage(message); //this needs to be last cause it converts colors to html colors that would have been escaped
|
||||
} else {
|
||||
message = L"empty message";
|
||||
message = L"";
|
||||
}
|
||||
displayOnGui = (packet->m_messageType == ChatPacket::e_ChatCustom);
|
||||
break;
|
||||
|
||||
@@ -878,7 +878,8 @@ enum EControllerActions
|
||||
MINECRAFT_ACTION_SPAWN_CREEPER,
|
||||
MINECRAFT_ACTION_CHANGE_SKIN,
|
||||
MINECRAFT_ACTION_FLY_TOGGLE,
|
||||
MINECRAFT_ACTION_RENDER_DEBUG
|
||||
MINECRAFT_ACTION_RENDER_DEBUG,
|
||||
MINECRAFT_ACTION_SCREENSHOT
|
||||
};
|
||||
|
||||
enum eMCLang
|
||||
|
||||
@@ -583,23 +583,26 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
||||
{
|
||||
U8 szSoundName[256];
|
||||
wstring name;
|
||||
const char* soundDir;
|
||||
|
||||
if (iSound >= eSFX_MAX)
|
||||
{
|
||||
strcpy((char*)szSoundName, "Minecraft/");
|
||||
name = wchSoundNames[iSound];
|
||||
soundDir = "Minecraft";
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy((char*)szSoundName, "Minecraft/UI/");
|
||||
name = wchUISoundNames[iSound];
|
||||
soundDir = "Minecraft/UI";
|
||||
}
|
||||
|
||||
char* SoundName = (char*)ConvertSoundPathToName(name);
|
||||
strcat((char*)szSoundName, SoundName);
|
||||
|
||||
char basePath[256];
|
||||
sprintf_s(basePath, "Windows64Media/Sound/Minecraft/UI/%s", ConvertSoundPathToName(name));
|
||||
sprintf_s(basePath, "Windows64Media/Sound/%s/%s", soundDir, ConvertSoundPathToName(name));
|
||||
|
||||
char finalPath[256];
|
||||
sprintf_s(finalPath, "%s.wav", basePath);
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
#endif
|
||||
|
||||
#include "../Common/Leaderboards/LeaderboardManager.h"
|
||||
#include <regex>
|
||||
|
||||
//CMinecraftApp app;
|
||||
unsigned int CMinecraftApp::m_uiLastSignInData = 0;
|
||||
@@ -95,7 +96,7 @@ CMinecraftApp::CMinecraftApp()
|
||||
// 4J Stu - See comment for GAME_SETTINGS_PROFILE_DATA_BYTES in Xbox_App.h
|
||||
DebugPrintf("WARNING: The size of the profile GAME_SETTINGS struct has changed, so all stat data is likely incorrect. Is: %d, Should be: %d\n",sizeof(GAME_SETTINGS),GAME_SETTINGS_PROFILE_DATA_BYTES);
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1299,9 +1300,6 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat
|
||||
{
|
||||
// This might be from a version during testing of new profile updates
|
||||
app.DebugPrintf("Don't know what to do with this profile version!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
// __debugbreak();
|
||||
#endif
|
||||
|
||||
GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData;
|
||||
pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu
|
||||
@@ -6420,7 +6418,7 @@ void CMinecraftApp::InitialiseTips()
|
||||
{
|
||||
// the m_TriviaTipA or the m_GameTipA are out of sync
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -6598,13 +6596,12 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado
|
||||
//found list of html escapes at https://stackoverflow.com/questions/7381974/which-characters-need-to-be-escaped-in-html
|
||||
wstring CMinecraftApp::EscapeHTMLString(const wstring& desc)
|
||||
{
|
||||
static std::unordered_map<wchar_t, wchar_t*> replacementMap = {
|
||||
{L'&', L"&"},
|
||||
{L'<', L"<"},
|
||||
{L'>', L">"},
|
||||
{L'\"', L"""},
|
||||
{L'\'', L"'"},
|
||||
};
|
||||
static std::unordered_map<wchar_t, wchar_t*> replacementMap = {
|
||||
{L'&', L"&"},
|
||||
{L'<', L"<"},
|
||||
{L'>', L">"},
|
||||
{L'\"', L"""},
|
||||
};
|
||||
|
||||
wstring finalString = L"";
|
||||
for (int i = 0; i < desc.size(); i++) {
|
||||
@@ -6618,60 +6615,70 @@ wstring CMinecraftApp::EscapeHTMLString(const wstring& desc)
|
||||
return finalString;
|
||||
}
|
||||
|
||||
wstring CMinecraftApp::FormatChatMessage(const wstring& desc, bool applyColor)
|
||||
wstring CMinecraftApp::FormatChatMessage(const wstring& desc, bool applyStyling)
|
||||
{
|
||||
static std::wstring_view colorFormatString = L"<font color=\"#%08x\" shadowcolor=\"#%08x\">";
|
||||
static std::wregex IDS_Pattern(LR"(\{\*IDS_(\d+)\*\})"); //maybe theres a better way to do translateable IDS
|
||||
static std::wstring_view colorFormatString = L"<font color=\"#%08x\">";
|
||||
|
||||
wstring results = desc;
|
||||
wchar_t replacements[64];
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_0), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_0), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§0", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_1), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_1), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§1", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_2), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_2), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§2", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_3), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_3), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§3", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_4), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_4), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§4", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_5), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_5), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§5", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_6), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_6), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§6", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_7), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_7), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§7", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_8), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_8), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§8", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_9), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_9), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§9", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_a), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_a), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§a", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_b), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_b), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§b", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_c), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_c), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§c", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_d), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_d), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§d", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_e), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_e), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§e", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyColor ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_f), 0xFFFFFFFF);
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_f), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§f", replacements);
|
||||
results = replaceAll(results, L"§r", replacements); //we only support color so reset is the same as white color
|
||||
|
||||
if (applyStyling) {
|
||||
std::wsmatch match;
|
||||
while (std::regex_search(results, match, IDS_Pattern)) {
|
||||
results = replaceAll(results, match[0], app.GetString(std::stoi(match[1].str())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@@ -566,7 +566,7 @@ public:
|
||||
int GetHTMLFontSize(EHTMLFontSize size);
|
||||
wstring FormatHTMLString(int iPad, const wstring& desc, int shadowColour = 0xFFFFFFFF);
|
||||
wstring EscapeHTMLString(const wstring &desc);
|
||||
wstring FormatChatMessage(const wstring& desc, bool applyColor = true);
|
||||
wstring FormatChatMessage(const wstring& desc, bool applyStyling = true);
|
||||
wstring GetActionReplacement(int iPad, unsigned char ucAction);
|
||||
wstring GetVKReplacement(unsigned int uiVKey);
|
||||
wstring GetIconReplacement(unsigned int uiIcon);
|
||||
|
||||
@@ -171,7 +171,7 @@ DLCPack *DLCManager::getPack(DWORD index, EDLCType type /*= e_DLCType_All*/)
|
||||
if(index >= m_packs.size())
|
||||
{
|
||||
app.DebugPrintf("DLCManager: Trying to access a DLC pack beyond the range of valid packs\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
pack = m_packs[index];
|
||||
}
|
||||
@@ -186,7 +186,6 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D
|
||||
if(pack == nullptr)
|
||||
{
|
||||
app.DebugPrintf("DLCManager: Attempting to find the index for a nullptr pack\n");
|
||||
//__debugbreak();
|
||||
return foundIndex;
|
||||
}
|
||||
if( type != e_DLCType_All )
|
||||
|
||||
@@ -107,7 +107,7 @@ void DLCPack::addChildPack(DLCPack *childPack)
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if(packId < 0 || packId > 15)
|
||||
{
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
#endif
|
||||
childPack->SetPackId( (packId<<24) | m_packId );
|
||||
@@ -362,7 +362,7 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bo
|
||||
{
|
||||
app.DebugPrintf("Unimplemented\n");
|
||||
#ifndef __CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -392,9 +392,6 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const wstring &path)
|
||||
/*if(type == DLCManager::e_DLCType_All)
|
||||
{
|
||||
app.DebugPrintf("Unimplemented\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
|
||||
@@ -122,7 +122,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("ConsoleSchematicFile has read a nullptr tile entity\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -635,7 +635,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
}
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if(p!=blockCount) __debugbreak();
|
||||
if(p!=blockCount) DEBUG_BREAK();
|
||||
#endif
|
||||
|
||||
// We don't know how this will compress - just make a fixed length buffer to initially decompress into
|
||||
|
||||
@@ -24,7 +24,7 @@ GameRule::ValueType GameRule::getParameter(const wstring ¶meterName)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
wprintf(L"WARNING: Parameter %ls was not set before being fetched\n", parameterName.c_str());
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
}
|
||||
return m_parameters[parameterName];
|
||||
|
||||
@@ -238,7 +238,7 @@ HRESULT SonyLeaderboardManager::fillByIdsQuery(const SceNpId &myNpId, SceNpId* &
|
||||
{
|
||||
// 4J-JEV: Something terrible must have happend,
|
||||
// 'getFriendslist' was supposed to be a synchronous operation.
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
|
||||
// 4J-JEV: We can at least fall-back to just the players score.
|
||||
len = 1;
|
||||
|
||||
@@ -247,8 +247,6 @@ void CPlatformNetworkManagerSony::HandlePlayerJoined(SQRNetworkPlayer *
|
||||
|
||||
void CPlatformNetworkManagerSony::HandlePlayerLeaving(SQRNetworkPlayer *pSQRPlayer)
|
||||
{
|
||||
//__debugbreak();
|
||||
|
||||
app.DebugPrintf( "Player 0x%p leaving.\n",
|
||||
pSQRPlayer );
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ void UIScene::loadMovie()
|
||||
{
|
||||
app.DebugPrintf("ERROR: Could not find any iggy movie for %ls!\n", moviePath.c_str());
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
@@ -335,7 +335,7 @@ void UIScene::loadMovie()
|
||||
{
|
||||
app.DebugPrintf("ERROR: Failed to load iggy scene!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
@@ -941,9 +941,6 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
|
||||
// if(m_parentLayer == nullptr)
|
||||
// {
|
||||
// app.DebugPrintf("A scene is trying to navigate forwards, but it's parent layer is nullptr!\n");
|
||||
//#ifndef _CONTENT_PACKAGE
|
||||
// __debugbreak();
|
||||
//#endif
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
@@ -960,10 +957,6 @@ void UIScene::navigateBack()
|
||||
|
||||
if(m_parentLayer == nullptr)
|
||||
{
|
||||
// app.DebugPrintf("A scene is trying to navigate back, but it's parent layer is nullptr!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
// __debugbreak();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1194,7 +1187,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handlePress did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1202,7 +1195,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handlePress were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1214,7 +1207,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleFocusChange did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1222,7 +1215,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleFocusChange were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1234,7 +1227,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleInitFocus did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1242,7 +1235,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleInitFocus were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1254,7 +1247,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleCheckboxToggled did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1262,7 +1255,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleCheckboxToggled were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1274,7 +1267,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleSliderMove did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1282,7 +1275,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleSliderMove were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1294,7 +1287,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleAnimationEnd did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1306,7 +1299,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleSelectionChanged did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1314,7 +1307,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleSelectionChanged were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1332,7 +1325,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleRequestMoreData did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1340,7 +1333,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleRequestMoreData were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -257,8 +257,10 @@ void UIScene_HUD::handleReload()
|
||||
for(unsigned int i = 0; i < CHAT_LINES_COUNT; ++i)
|
||||
{
|
||||
m_labelChatText[i].init(L"");
|
||||
IggyValueSetBooleanRS(m_labelChatText[i].getIggyValuePath(), 0, "m_bUseHtmlText", true);
|
||||
}
|
||||
m_labelJukebox.init(L"");
|
||||
IggyValueSetBooleanRS(m_labelJukebox.getIggyValuePath(), 0, "m_bUseHtmlText", true);
|
||||
|
||||
int iGuiScale;
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
@@ -53,7 +53,6 @@ int UIScene_LoadMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumb
|
||||
app.DebugPrintf("Thumbnail data is nullptr, or has size 0\n");
|
||||
pClass->m_bThumbnailGetFailed = true;
|
||||
}
|
||||
pClass->m_bRetrievingSaveThumbnail = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -100,7 +99,6 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
|
||||
m_bIsSaveOwner = true;
|
||||
|
||||
m_bSaveThumbnailReady = false;
|
||||
m_bRetrievingSaveThumbnail = true;
|
||||
m_bShowTimer = false;
|
||||
m_pDLCPack = nullptr;
|
||||
m_bAvailableTexturePacksChecked=false;
|
||||
@@ -110,6 +108,8 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
|
||||
m_bThumbnailGetFailed = false;
|
||||
m_seed = 0;
|
||||
m_bIsCorrupt = false;
|
||||
m_pbThumbnailData = nullptr;
|
||||
m_uiThumbnailSize = 0;
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
// 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it.
|
||||
@@ -249,13 +249,32 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
|
||||
#endif
|
||||
#endif
|
||||
#ifdef _WINDOWS64
|
||||
if (params->saveDetails != nullptr && params->saveDetails->UTF8SaveName[0] != '\0')
|
||||
if (params->saveDetails != nullptr)
|
||||
{
|
||||
wchar_t wSaveName[128];
|
||||
ZeroMemory(wSaveName, sizeof(wSaveName));
|
||||
mbstowcs(wSaveName, params->saveDetails->UTF8SaveName, 127);
|
||||
m_levelName = wstring(wSaveName);
|
||||
m_labelGameName.init(m_levelName);
|
||||
if (params->saveDetails->UTF8SaveName[0] != '\0')
|
||||
{
|
||||
wchar_t wSaveName[128];
|
||||
ZeroMemory(wSaveName, sizeof(wSaveName));
|
||||
mbstowcs(wSaveName, params->saveDetails->UTF8SaveName, 127);
|
||||
m_levelName = wstring(wSaveName);
|
||||
m_labelGameName.init(m_levelName);
|
||||
}
|
||||
|
||||
wchar_t wFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
ZeroMemory(wFilename, sizeof(wFilename));
|
||||
mbstowcs(wFilename, params->saveDetails->UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
|
||||
m_thumbnailName = wFilename;
|
||||
|
||||
if (params->saveDetails->pbThumbnailData && params->saveDetails->dwThumbnailSize > 0)
|
||||
{
|
||||
// save list already loaded this, register and display it
|
||||
registerSubstitutionTexture(wFilename, params->saveDetails->pbThumbnailData, params->saveDetails->dwThumbnailSize);
|
||||
m_bitmapIcon.setTextureName(wFilename);
|
||||
m_pbThumbnailData = params->saveDetails->pbThumbnailData;
|
||||
m_uiThumbnailSize = params->saveDetails->dwThumbnailSize;
|
||||
m_bSaveThumbnailReady = true;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ private:
|
||||
int m_iGameModeId;
|
||||
bool m_bHasBeenInCreative;
|
||||
bool m_bIsSaveOwner;
|
||||
bool m_bRetrievingSaveThumbnail;
|
||||
bool m_bSaveThumbnailReady;
|
||||
bool m_bMultiplayerAllowed;
|
||||
bool m_bShowTimer;
|
||||
|
||||
@@ -390,7 +390,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
|
||||
break;
|
||||
#endif
|
||||
|
||||
default: __debugbreak();
|
||||
default: DEBUG_BREAK();
|
||||
}
|
||||
|
||||
bool confirmUser = false;
|
||||
|
||||
@@ -1127,15 +1127,6 @@ void UIScene_SkinSelectMenu::handlePackIndexChanged()
|
||||
updatePackDisplay();
|
||||
}
|
||||
|
||||
std::wstring fakeWideToRealWide(const wchar_t* original)
|
||||
{
|
||||
const char* name = reinterpret_cast<const char*>(original);
|
||||
int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, nullptr, 0);
|
||||
std::wstring wName(len, 0);
|
||||
MultiByteToWideChar(CP_UTF8, 0, name, -1, &wName[0], len);
|
||||
return wName.c_str();
|
||||
}
|
||||
|
||||
void UIScene_SkinSelectMenu::updatePackDisplay()
|
||||
{
|
||||
m_currentPackCount = app.m_dlcManager.getPackCount(DLCManager::e_DLCType_Skin) + SKIN_SELECT_MAX_DEFAULTS;
|
||||
@@ -1143,18 +1134,16 @@ void UIScene_SkinSelectMenu::updatePackDisplay()
|
||||
if(m_packIndex >= SKIN_SELECT_MAX_DEFAULTS)
|
||||
{
|
||||
DLCPack *thisPack = app.m_dlcManager.getPack(m_packIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin);
|
||||
// Fix the incorrect string type on title to display correctly
|
||||
setCentreLabel(fakeWideToRealWide(thisPack->getName().c_str()));
|
||||
//setCentreLabel(thisPack->getName().c_str());
|
||||
setCentreLabel(thisPack->getName().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(m_packIndex)
|
||||
{
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
setCentreLabel(app.GetString(IDS_NO_SKIN_PACK));
|
||||
break;
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
setCentreLabel(app.GetString(IDS_FAVORITES_SKIN_PACK));
|
||||
break;
|
||||
}
|
||||
@@ -1164,18 +1153,16 @@ void UIScene_SkinSelectMenu::updatePackDisplay()
|
||||
if(nextPackIndex >= SKIN_SELECT_MAX_DEFAULTS)
|
||||
{
|
||||
DLCPack *thisPack = app.m_dlcManager.getPack(nextPackIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin);
|
||||
// Fix the incorrect string type on title to display correctly
|
||||
setRightLabel(fakeWideToRealWide(thisPack->getName().c_str()));
|
||||
//setRightLabel(thisPack->getName().c_str());
|
||||
setRightLabel(thisPack->getName().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(nextPackIndex)
|
||||
{
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
setRightLabel(app.GetString(IDS_NO_SKIN_PACK));
|
||||
break;
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
setRightLabel(app.GetString(IDS_FAVORITES_SKIN_PACK));
|
||||
break;
|
||||
}
|
||||
@@ -1185,18 +1172,16 @@ void UIScene_SkinSelectMenu::updatePackDisplay()
|
||||
if(previousPackIndex >= SKIN_SELECT_MAX_DEFAULTS)
|
||||
{
|
||||
DLCPack *thisPack = app.m_dlcManager.getPack(previousPackIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin);
|
||||
// Fix the incorrect string type on title to display correctly
|
||||
setLeftLabel(fakeWideToRealWide(thisPack->getName().c_str()));
|
||||
//setLeftLabel(thisPack->getName().c_str());
|
||||
setLeftLabel(thisPack->getName().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(previousPackIndex)
|
||||
{
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
setLeftLabel(app.GetString(IDS_NO_SKIN_PACK));
|
||||
break;
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
setLeftLabel(app.GetString(IDS_FAVORITES_SKIN_PACK));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ wstring DLCTexturePack::getResource(const wstring& name)
|
||||
{
|
||||
// 4J Stu - We should never call this function
|
||||
#ifndef __CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return L"";
|
||||
}
|
||||
@@ -115,7 +115,7 @@ InputStream *DLCTexturePack::getResourceImplementation(const wstring &name) //th
|
||||
{
|
||||
// 4J Stu - We should never call this function
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
if(hasFile(name)) return nullptr;
|
||||
#endif
|
||||
return nullptr; //resource;
|
||||
|
||||
@@ -641,7 +641,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i
|
||||
{
|
||||
DWORD error = GetLastError();
|
||||
app.DebugPrintf("Failed to open DLCXbox1.cmp with error code %d (%x)\n", error, error);
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ void ConsoleUIController::init(Microsoft::WRL::ComPtr<ID3D11Device> dev, Microso
|
||||
{
|
||||
app.DebugPrintf("Failed to initialise GDraw!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -187,8 +187,6 @@ void CPlatformNetworkManagerDurango::HandlePlayerJoined(DQRNetworkPlayer *pDQRPl
|
||||
|
||||
void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRPlayer)
|
||||
{
|
||||
//__debugbreak();
|
||||
|
||||
app.DebugPrintf( "Player 0x%p leaving.\n",
|
||||
pDQRPlayer );
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ EntityRenderer *EntityRenderDispatcher::getRenderer(eINSTANCEOF e)
|
||||
{
|
||||
app.DebugPrintf("Couldn't find renderer for entity of type %d\n", e);
|
||||
// New renderer mapping required in above table
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
/* 4J - not doing this hierarchical search anymore. We need to explicitly add renderers for any eINSTANCEOF type that we want to be able to render
|
||||
if (it == renderers.end() && e != Entity::_class)
|
||||
|
||||
@@ -83,7 +83,7 @@ void EntityTracker::addEntity(shared_ptr<Entity> e, int range, int updateInterva
|
||||
}
|
||||
if( e->entityId >= 16384 )
|
||||
{
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
shared_ptr<TrackedEntity> te = std::make_shared<TrackedEntity>(e, range, updateInterval, trackDeltas);
|
||||
entities.insert(te);
|
||||
|
||||
@@ -2112,7 +2112,7 @@ void GameRenderer::setupFog(int i, float alpha)
|
||||
|
||||
if (i == 999)
|
||||
{
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
// 4J TODO
|
||||
/*
|
||||
glFog(GL_FOG_COLOR, getBuffer(0, 0, 0, 1));
|
||||
|
||||
@@ -1437,6 +1437,37 @@ void Gui::clearMessages(int iPad)
|
||||
}
|
||||
}
|
||||
|
||||
int getVisibleMessageLength(const wstring& _string) {
|
||||
int visibleMessageLength = 0;
|
||||
bool inHtmlTag = false;
|
||||
|
||||
for (wchar_t _char : _string) {
|
||||
if (_char == L'<') inHtmlTag = true;
|
||||
if (_char == L'>') inHtmlTag = false;
|
||||
|
||||
if (!inHtmlTag) visibleMessageLength++;
|
||||
}
|
||||
|
||||
return visibleMessageLength;
|
||||
}
|
||||
|
||||
int getVisibleIndexToRaw(const wstring& _string, size_t target) {
|
||||
int visibleMessageLength = 0;
|
||||
bool inHtmlTag = false;
|
||||
|
||||
for (size_t i = 0; i < _string.size(); i++) {
|
||||
if (_string[i] == L'<') inHtmlTag = true;
|
||||
if (_string[i] == L'>') inHtmlTag = false;
|
||||
|
||||
if (!inHtmlTag) {
|
||||
if (visibleMessageLength == target) return i;
|
||||
|
||||
visibleMessageLength++;
|
||||
}
|
||||
}
|
||||
return _string.size();
|
||||
}
|
||||
|
||||
|
||||
void Gui::addMessage(const wstring& _string,int iPad,bool bIsDeathMessage)
|
||||
{
|
||||
@@ -1517,15 +1548,11 @@ void Gui::addMessage(const wstring& _string,int iPad,bool bIsDeathMessage)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
while (string.length() > maximumChars)
|
||||
while (getVisibleMessageLength(string) > maximumChars)
|
||||
{
|
||||
unsigned int i = 1;
|
||||
while (i < string.length() && (i + 1) <= maximumChars)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
size_t iLast=string.find_last_of(L" ",i);
|
||||
size_t cutOffset = getVisibleIndexToRaw(string, maximumChars);
|
||||
|
||||
size_t iLast=string.find_last_of(L" ", cutOffset);
|
||||
switch(XGetLanguage())
|
||||
{
|
||||
case XC_LANGUAGE_JAPANESE:
|
||||
@@ -1534,12 +1561,12 @@ void Gui::addMessage(const wstring& _string,int iPad,bool bIsDeathMessage)
|
||||
iLast = maximumChars;
|
||||
break;
|
||||
default:
|
||||
iLast=string.find_last_of(L" ",i);
|
||||
iLast=string.find_last_of(L" ", cutOffset);
|
||||
break;
|
||||
}
|
||||
|
||||
// if a space was found, include the space on this line
|
||||
if(iLast!=i)
|
||||
if(iLast!=cutOffset)
|
||||
{
|
||||
iLast++;
|
||||
}
|
||||
|
||||
@@ -518,7 +518,7 @@ void LocalPlayer::changeDimension(int i)
|
||||
//minecraft.setScreen(new WinScreen());
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("LocalPlayer::changeDimension from 1 to 1 but WinScreen has not been implemented.\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1553,6 +1553,9 @@ void Minecraft::run_middle()
|
||||
localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_RENDER_DEBUG;
|
||||
}
|
||||
|
||||
if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_SCREENSHOT))
|
||||
localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_SCREENSHOT;
|
||||
|
||||
// In flying mode, Shift held = sneak/descend
|
||||
if(g_KBMInput.IsKBMActive() && g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_SNEAK))
|
||||
{
|
||||
@@ -3741,6 +3744,13 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
//options->thirdPersonView = !options->thirdPersonView;
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if(player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_SCREENSHOT))
|
||||
{
|
||||
RenderManager.DoScreenGrabOnNextPresent();
|
||||
}
|
||||
#endif
|
||||
|
||||
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_GAME_INFO)) && gameMode->isInputAllowed(MINECRAFT_ACTION_GAME_INFO))
|
||||
{
|
||||
ui.NavigateToScene(iPad,eUIScene_InGameInfoMenu);
|
||||
@@ -4807,7 +4817,7 @@ void Minecraft::main()
|
||||
app.DebugPrintf("<xs:enumeration value=\"%d\"><xs:annotation><xs:documentation>%ls</xs:documentation></xs:annotation></xs:enumeration>\n", i, app.GetString( Tile::tiles[i]->getDescriptionId() ));
|
||||
}
|
||||
}
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
|
||||
// 4J-PB - Can't call this for the first 5 seconds of a game - MS rule
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -245,7 +245,7 @@ bool OrbisLeaderboardManager::getScoreByIds()
|
||||
{
|
||||
// 4J-JEV: Something terrible must have happend,
|
||||
// 'getFriendslist' was supposed to be a synchronous operation.
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
|
||||
// 4J-JEV: We can at least fall-back to just the players score.
|
||||
num = 1;
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -218,7 +218,7 @@ void Particle::setTex(Textures *textures, Icon *icon)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Invalid call to Particle.setTex, use coordinate methods\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
//throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods");
|
||||
}
|
||||
@@ -230,7 +230,7 @@ void Particle::setMiscTex(int slotIndex)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Invalid call to Particle.setMixTex\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
//throw new RuntimeException("Invalid call to Particle.setMiscTex");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -227,7 +227,6 @@ void PreStitchedTextureMap::makeTextureAnimated(TexturePack *texturePack, Stitch
|
||||
if(first->getWidth() != tex->getWidth() || first->getHeight() != tex->getHeight())
|
||||
{
|
||||
app.DebugPrintf("%ls - first w - %d, h - %d, tex w - %d, h - %d\n",textureFileName.c_str(),first->getWidth(),tex->getWidth(),first->getHeight(),tex->getHeight());
|
||||
//__debugbreak();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -246,7 +245,7 @@ StitchedTexture *PreStitchedTextureMap::getTexture(const wstring &name)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("Not implemented!\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return nullptr;
|
||||
#if 0
|
||||
@@ -277,7 +276,7 @@ Icon *PreStitchedTextureMap::registerIcon(const wstring &name)
|
||||
{
|
||||
app.DebugPrintf("Don't register nullptr\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
result = missingPosition;
|
||||
//new RuntimeException("Don't register null!").printStackTrace();
|
||||
@@ -290,7 +289,7 @@ Icon *PreStitchedTextureMap::registerIcon(const wstring &name)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("Could not find uv data for icon %ls\n", name.c_str() );
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
result = missingPosition;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
#include "Settings.h"
|
||||
#include "PlayerList.h"
|
||||
#include "MultiPlayerLevel.h"
|
||||
#include "Minecraft.h"
|
||||
#include "Common/Audio/SoundEngine.h"
|
||||
#include "../Minecraft.World/SoundTypes.h"
|
||||
|
||||
#include "../Minecraft.World/net.minecraft.network.packet.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.damagesource.h"
|
||||
@@ -783,6 +786,13 @@ void ServerPlayer::changeDimension(int i)
|
||||
// 4J: Removed on the advice of the mighty King of Achievments (JV)
|
||||
// awardStat(GenericStats::portal(), GenericStats::param_portal());
|
||||
}
|
||||
// play the travel whoosh right before the actual dimension swap
|
||||
Minecraft *mc = Minecraft::GetInstance();
|
||||
if (mc != nullptr && mc->soundEngine != nullptr)
|
||||
{
|
||||
mc->soundEngine->playUI(eSoundType_PORTAL_TRAVEL, 1, 1.0f);
|
||||
}
|
||||
|
||||
server->getPlayers()->toggleDimension( dynamic_pointer_cast<ServerPlayer>(shared_from_this()), i);
|
||||
lastSentExp = -1;
|
||||
lastSentHealth = -1;
|
||||
|
||||
@@ -87,7 +87,7 @@ void Stitcher::stitch()
|
||||
{
|
||||
app.DebugPrintf("Stitcher exception!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
//throw new StitcherException(textureHolder);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ LPCWSTR StringTable::getString(const wstring &id)
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if (isStatic)
|
||||
{
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
return L"";
|
||||
}
|
||||
#endif
|
||||
@@ -166,7 +166,7 @@ LPCWSTR StringTable::getString(int id)
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if (!isStatic)
|
||||
{
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
return L"";
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -214,7 +214,7 @@ Icon *TextureMap::registerIcon(const wstring &name)
|
||||
{
|
||||
app.DebugPrintf("Don't register nullptr\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
//new RuntimeException("Don't register null!").printStackTrace();
|
||||
}
|
||||
|
||||
@@ -339,7 +339,6 @@ bool TexturePackRepository::selectTexturePackById(DWORD id)
|
||||
app.DebugPrintf("Failed to select texture pack %d as it is not in the list\n", id);
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
// TODO - 4J Stu: We should report this to the player in some way
|
||||
//__debugbreak();
|
||||
#endif
|
||||
// Fail safely
|
||||
if( selectSkin( DEFAULT_TEXTURE_PACK ) )
|
||||
|
||||
1
Minecraft.Client/Windows64/4JLibs
Submodule
1
Minecraft.Client/Windows64/4JLibs
Submodule
Submodule Minecraft.Client/Windows64/4JLibs added at 8fb036f6d6
@@ -1,137 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#define MAP_STYLE_0 0
|
||||
#define MAP_STYLE_1 1
|
||||
#define MAP_STYLE_2 2
|
||||
|
||||
#define _360_JOY_BUTTON_A 0x00000001
|
||||
#define _360_JOY_BUTTON_B 0x00000002
|
||||
#define _360_JOY_BUTTON_X 0x00000004
|
||||
#define _360_JOY_BUTTON_Y 0x00000008
|
||||
|
||||
#define _360_JOY_BUTTON_START 0x00000010
|
||||
#define _360_JOY_BUTTON_BACK 0x00000020
|
||||
#define _360_JOY_BUTTON_RB 0x00000040
|
||||
#define _360_JOY_BUTTON_LB 0x00000080
|
||||
|
||||
#define _360_JOY_BUTTON_RTHUMB 0x00000100
|
||||
#define _360_JOY_BUTTON_LTHUMB 0x00000200
|
||||
#define _360_JOY_BUTTON_DPAD_UP 0x00000400
|
||||
#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800
|
||||
|
||||
#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000
|
||||
#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000
|
||||
// fake digital versions of analog values
|
||||
#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000
|
||||
#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000
|
||||
|
||||
#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000
|
||||
#define _360_JOY_BUTTON_RSTICK_UP 0x00020000
|
||||
#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000
|
||||
#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000
|
||||
|
||||
#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000
|
||||
#define _360_JOY_BUTTON_LSTICK_UP 0x00200000
|
||||
#define _360_JOY_BUTTON_RT 0x00400000
|
||||
#define _360_JOY_BUTTON_LT 0x00800000
|
||||
|
||||
// Stick axis maps - to allow changes for SouthPaw in-game axis mapping
|
||||
#define AXIS_MAP_LX 0
|
||||
#define AXIS_MAP_LY 1
|
||||
#define AXIS_MAP_RX 2
|
||||
#define AXIS_MAP_RY 3
|
||||
|
||||
// Trigger map - to allow for swap triggers in-game
|
||||
#define TRIGGER_MAP_0 0
|
||||
#define TRIGGER_MAP_1 1
|
||||
|
||||
enum EKeyboardResult
|
||||
{
|
||||
EKeyboard_Pending,
|
||||
EKeyboard_Cancelled,
|
||||
EKeyboard_ResultAccept,
|
||||
EKeyboard_ResultDecline,
|
||||
};
|
||||
|
||||
typedef struct _STRING_VERIFY_RESPONSE
|
||||
{
|
||||
WORD wNumStrings;
|
||||
HRESULT *pStringResult;
|
||||
}
|
||||
STRING_VERIFY_RESPONSE;
|
||||
|
||||
class C_4JInput
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
enum EKeyboardMode
|
||||
{
|
||||
EKeyboardMode_Default,
|
||||
EKeyboardMode_Numeric,
|
||||
EKeyboardMode_Password,
|
||||
EKeyboardMode_Alphabet,
|
||||
EKeyboardMode_Full,
|
||||
EKeyboardMode_Alphabet_Extended,
|
||||
EKeyboardMode_IP_Address,
|
||||
EKeyboardMode_Phone
|
||||
};
|
||||
|
||||
void Initialise( int iInputStateC, unsigned char ucMapC,unsigned char ucActionC, unsigned char ucMenuActionC );
|
||||
void Tick(void);
|
||||
void SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax );
|
||||
void SetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction,unsigned int uiActionVal);
|
||||
unsigned int GetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction);
|
||||
void SetJoypadMapVal(int iPad,unsigned char ucMap);
|
||||
unsigned char GetJoypadMapVal(int iPad);
|
||||
void SetJoypadSensitivity(int iPad, float fSensitivity);
|
||||
unsigned int GetValue(int iPad,unsigned char ucAction, bool bRepeat=false);
|
||||
bool ButtonPressed(int iPad,unsigned char ucAction=255); // toggled
|
||||
bool ButtonReleased(int iPad,unsigned char ucAction); //toggled
|
||||
bool ButtonDown(int iPad,unsigned char ucAction=255); // button held down
|
||||
// Functions to remap the axis and triggers for in-game (not menus) - SouthPaw, etc
|
||||
void SetJoypadStickAxisMap(int iPad,unsigned int uiFrom, unsigned int uiTo);
|
||||
void SetJoypadStickTriggerMap(int iPad,unsigned int uiFrom, unsigned int uiTo);
|
||||
void SetKeyRepeatRate(float fRepeatDelaySecs,float fRepeatRateSecs);
|
||||
void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam );
|
||||
FLOAT GetIdleSeconds(int iPad);
|
||||
bool IsPadConnected(int iPad);
|
||||
|
||||
// In-Game values which may have been remapped due to Southpaw, swap triggers, etc
|
||||
float GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_RX(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_RY(int iPad, bool bCheckMenuDisplay=true);
|
||||
unsigned char GetJoypadLTrigger(int iPad, bool bCheckMenuDisplay=true);
|
||||
unsigned char GetJoypadRTrigger(int iPad, bool bCheckMenuDisplay=true);
|
||||
|
||||
void SetMenuDisplayed(int iPad, bool bVal);
|
||||
|
||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
|
||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
|
||||
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode);
|
||||
void GetText(uint16_t *UTF16String);
|
||||
|
||||
// Online check strings against offensive list - TCR 92
|
||||
// TCR # 092 CMTV Player Text String Verification
|
||||
// Requirement Any player-entered text visible to another player on Xbox LIVE must be verified using the Xbox LIVE service before being transmitted. Text that is rejected by the Xbox LIVE service must not be displayed.
|
||||
//
|
||||
// Remarks
|
||||
// This requirement applies to any player-entered string that can be exposed to other players on Xbox LIVE. It includes session names, content descriptions, text messages, tags, team names, mottos, comments, and so on.
|
||||
//
|
||||
// Games may decide to not send the text, blank it out, or use generic text if the text was rejected by the Xbox LIVE service.
|
||||
//
|
||||
// Games verify the text by calling the XStringVerify function.
|
||||
//
|
||||
// Exemption It is not required to use the Xbox LIVE service to verify real-time text communication. An example of real-time text communication is in-game text chat.
|
||||
//
|
||||
// Intent Protect players from inappropriate language.
|
||||
bool VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam);
|
||||
void CancelQueuedVerifyStrings(int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam);
|
||||
void CancelAllVerifyInProgress(void);
|
||||
|
||||
//bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput);
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JInput InputManager;
|
||||
@@ -1,128 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
enum eAwardType
|
||||
{
|
||||
eAwardType_Achievement = 0,
|
||||
eAwardType_GamerPic,
|
||||
eAwardType_Theme,
|
||||
eAwardType_AvatarItem,
|
||||
};
|
||||
|
||||
enum eUpsellType
|
||||
{
|
||||
eUpsellType_Custom = 0, // This is the default, and means that the upsell dialog was initiated in the app code
|
||||
eUpsellType_Achievement,
|
||||
eUpsellType_GamerPic,
|
||||
eUpsellType_Theme,
|
||||
eUpsellType_AvatarItem,
|
||||
};
|
||||
|
||||
enum eUpsellResponse
|
||||
{
|
||||
eUpsellResponse_Declined,
|
||||
eUpsellResponse_Accepted_NoPurchase,
|
||||
eUpsellResponse_Accepted_Purchase,
|
||||
};
|
||||
|
||||
|
||||
|
||||
class C_4JProfile
|
||||
{
|
||||
public:
|
||||
struct PROFILESETTINGS
|
||||
{
|
||||
int iYAxisInversion;
|
||||
int iControllerSensitivity;
|
||||
int iVibration;
|
||||
bool bSwapSticks;
|
||||
};
|
||||
|
||||
|
||||
// 4 players have game defined data, puiGameDefinedDataChangedBitmask needs to be checked by the game side to see if there's an update needed - it'll have the bits set for players to be updated
|
||||
void Initialise( DWORD dwTitleID,
|
||||
DWORD dwOfferID,
|
||||
unsigned short usProfileVersion,
|
||||
UINT uiProfileValuesC,
|
||||
UINT uiProfileSettingsC,
|
||||
DWORD *pdwProfileSettingsA,
|
||||
int iGameDefinedDataSizeX4,
|
||||
unsigned int *puiGameDefinedDataChangedBitmask);
|
||||
void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject);
|
||||
void SetTrialAwardText(eAwardType AwardType,int iTitle,int iText); // achievement popup in the trial game
|
||||
int GetLockedProfile();
|
||||
void SetLockedProfile(int iProf);
|
||||
bool IsSignedIn(int iQuadrant);
|
||||
bool IsSignedInLive(int iProf);
|
||||
bool IsGuest(int iQuadrant);
|
||||
UINT RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
void SetPrimaryPlayerChanged(bool bVal);
|
||||
bool QuerySigninStatus(void);
|
||||
void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid);
|
||||
BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2);
|
||||
BOOL XUIDIsGuest(PlayerUID xuid);
|
||||
bool AllowedToPlayMultiplayer(int iProf);
|
||||
bool GetChatAndContentRestrictions(int iPad,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge);
|
||||
void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame
|
||||
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed);
|
||||
BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount );
|
||||
void ShowProfileCard(int iPad, PlayerUID targetUid);
|
||||
bool GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam);
|
||||
void CancelProfileAvatarRequest();
|
||||
|
||||
|
||||
// SYS
|
||||
int GetPrimaryPad();
|
||||
void SetPrimaryPad(int iPad);
|
||||
char* GetGamertag(int iPad);
|
||||
wstring GetDisplayName(int iPad);
|
||||
bool IsFullVersion();
|
||||
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
|
||||
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);
|
||||
bool RegionIsNorthAmerica(void);
|
||||
bool LocaleIsUSorCanada(void);
|
||||
HRESULT GetLiveConnectionStatus();
|
||||
bool IsSystemUIDisplayed();
|
||||
void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam);
|
||||
|
||||
|
||||
// PROFILE DATA
|
||||
int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam);
|
||||
int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam);
|
||||
PROFILESETTINGS * GetDashboardProfileSettings(int iPad);
|
||||
void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false);
|
||||
void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY);
|
||||
void *GetGameDefinedProfileData(int iQuadrant);
|
||||
void ResetProfileProcessState(); // after a sign out from the primary player, call this
|
||||
void Tick( void );
|
||||
|
||||
// ACHIEVEMENTS & AWARDS
|
||||
|
||||
void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false,
|
||||
CXuiStringTable*pStringTable=nullptr, int iTitleStr=-1, int iTextStr=-1, int iAcceptStr=-1, char *pszThemeName=nullptr, unsigned int uiThemeSize=0L);
|
||||
int GetAwardId(int iAwardNumber);
|
||||
eAwardType GetAwardType(int iAwardNumber);
|
||||
bool CanBeAwarded(int iQuadrant, int iAwardNumber);
|
||||
void Award(int iQuadrant, int iAwardNumber, bool bForce=false);
|
||||
bool IsAwardsFlagSet(int iQuadrant, int iAward);
|
||||
|
||||
// RICH PRESENCE
|
||||
|
||||
void RichPresenceInit(int iPresenceCount, int iContextCount);
|
||||
void RegisterRichPresenceContext(int iGameConfigContextID);
|
||||
void SetRichPresenceContextValue(int iPad,int iContextID, int iVal);
|
||||
void SetCurrentGameActivity(int iPad,int iNewPresence, bool bSetOthersToIdle=false);
|
||||
|
||||
// PURCHASE
|
||||
void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1);
|
||||
void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam);
|
||||
|
||||
// Debug
|
||||
void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage
|
||||
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JProfile ProfileManager;
|
||||
|
||||
@@ -1,302 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class ImageFileBuffer
|
||||
{
|
||||
public:
|
||||
enum EImageType
|
||||
{
|
||||
e_typePNG,
|
||||
e_typeJPG
|
||||
};
|
||||
|
||||
EImageType m_type;
|
||||
void* m_pBuffer;
|
||||
int m_bufferSize;
|
||||
|
||||
int GetType() { return m_type; }
|
||||
void *GetBufferPointer() { return m_pBuffer; }
|
||||
int GetBufferSize() { return m_bufferSize; }
|
||||
void Release() { free(m_pBuffer); m_pBuffer = nullptr; }
|
||||
bool Allocated() { return m_pBuffer != nullptr; }
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int Width;
|
||||
int Height;
|
||||
}D3DXIMAGE_INFO;
|
||||
|
||||
typedef struct _XSOCIAL_PREVIEWIMAGE {
|
||||
BYTE *pBytes;
|
||||
DWORD Pitch;
|
||||
DWORD Width;
|
||||
DWORD Height;
|
||||
// D3DFORMAT Format;
|
||||
} XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE;
|
||||
|
||||
class C4JRender
|
||||
{
|
||||
public:
|
||||
void Tick();
|
||||
void UpdateGamma(unsigned short usGamma);
|
||||
|
||||
// Matrix stack
|
||||
void MatrixMode(int type);
|
||||
void MatrixSetIdentity();
|
||||
void MatrixTranslate(float x,float y,float z);
|
||||
void MatrixRotate(float angle, float x, float y, float z);
|
||||
void MatrixScale(float x, float y, float z);
|
||||
void MatrixPerspective(float fovy, float aspect, float zNear, float zFar);
|
||||
void MatrixOrthogonal(float left,float right,float bottom,float top,float zNear,float zFar);
|
||||
void MatrixPop();
|
||||
void MatrixPush();
|
||||
void MatrixMult(float *mat);
|
||||
const float *MatrixGet(int type);
|
||||
void Set_matrixDirty();
|
||||
|
||||
// Core
|
||||
void Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain);
|
||||
void InitialiseContext();
|
||||
void StartFrame();
|
||||
void DoScreenGrabOnNextPresent();
|
||||
void Present();
|
||||
void Clear(int flags, D3D11_RECT *pRect = nullptr);
|
||||
void SetClearColour(const float colourRGBA[4]);
|
||||
bool IsWidescreen();
|
||||
bool IsHiDef();
|
||||
void CaptureThumbnail(ImageFileBuffer *pngOut);
|
||||
void CaptureScreen(ImageFileBuffer *jpgOut, XSOCIAL_PREVIEWIMAGE *previewOut);
|
||||
void BeginConditionalSurvey(int identifier);
|
||||
void EndConditionalSurvey();
|
||||
void BeginConditionalRendering(int identifier);
|
||||
void EndConditionalRendering();
|
||||
|
||||
// Vertex data handling
|
||||
typedef enum
|
||||
{
|
||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD
|
||||
VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout
|
||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied,
|
||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen
|
||||
VERTEX_TYPE_COUNT
|
||||
} eVertexType;
|
||||
|
||||
// Pixel shader
|
||||
typedef enum
|
||||
{
|
||||
PIXEL_SHADER_TYPE_STANDARD,
|
||||
PIXEL_SHADER_TYPE_PROJECTION,
|
||||
PIXEL_SHADER_TYPE_FORCELOD,
|
||||
PIXEL_SHADER_COUNT
|
||||
} ePixelShaderType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VIEWPORT_TYPE_FULLSCREEN,
|
||||
VIEWPORT_TYPE_SPLIT_TOP,
|
||||
VIEWPORT_TYPE_SPLIT_BOTTOM,
|
||||
VIEWPORT_TYPE_SPLIT_LEFT,
|
||||
VIEWPORT_TYPE_SPLIT_RIGHT,
|
||||
VIEWPORT_TYPE_QUADRANT_TOP_LEFT,
|
||||
VIEWPORT_TYPE_QUADRANT_TOP_RIGHT,
|
||||
VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT,
|
||||
VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT,
|
||||
} eViewportType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PRIMITIVE_TYPE_TRIANGLE_LIST,
|
||||
PRIMITIVE_TYPE_TRIANGLE_STRIP,
|
||||
PRIMITIVE_TYPE_TRIANGLE_FAN,
|
||||
PRIMITIVE_TYPE_QUAD_LIST,
|
||||
PRIMITIVE_TYPE_LINE_LIST,
|
||||
PRIMITIVE_TYPE_LINE_STRIP,
|
||||
PRIMITIVE_TYPE_COUNT
|
||||
} ePrimitiveType;
|
||||
|
||||
void DrawVertices(ePrimitiveType PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType);
|
||||
void DrawVertexBuffer(ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType);
|
||||
|
||||
// Command buffers
|
||||
void CBuffLockStaticCreations();
|
||||
int CBuffCreate(int count);
|
||||
void CBuffDelete(int first, int count);
|
||||
void CBuffStart(int index, bool full = false);
|
||||
void CBuffClear(int index);
|
||||
int CBuffSize(int index);
|
||||
void CBuffEnd();
|
||||
bool CBuffCall(int index, bool full = true);
|
||||
void CBuffTick();
|
||||
void CBuffDeferredModeStart();
|
||||
void CBuffDeferredModeEnd();
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per component
|
||||
/* Don't think these are all directly available on D3D 11 - leaving for now
|
||||
TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to alpha channel, R=G=B=0
|
||||
TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit component mapped to alpha channel, R=G=B=1
|
||||
TEXTURE_FORMAT_RxGxBxAx, // One 8-bit component mapped to all channels
|
||||
*/
|
||||
MAX_TEXTURE_FORMATS
|
||||
} eTextureFormat;
|
||||
|
||||
// Textures
|
||||
int TextureCreate();
|
||||
void TextureFree(int idx);
|
||||
void TextureBind(int idx);
|
||||
void TextureBindVertex(int idx);
|
||||
void TextureSetTextureLevels(int levels);
|
||||
int TextureGetTextureLevels();
|
||||
void TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw);
|
||||
void TextureDataUpdate(int xoffset, int yoffset, int width, int height, void *data, int level);
|
||||
void TextureSetParam(int param, int value);
|
||||
void TextureDynamicUpdateStart();
|
||||
void TextureDynamicUpdateEnd();
|
||||
HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
|
||||
HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
|
||||
HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut);
|
||||
HRESULT SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn);
|
||||
void TextureGetStats();
|
||||
ID3D11ShaderResourceView *TextureGetTexture(int idx);
|
||||
|
||||
// State control
|
||||
void StateSetColour(float r, float g, float b, float a);
|
||||
void StateSetDepthMask(bool enable);
|
||||
void StateSetBlendEnable(bool enable);
|
||||
void StateSetBlendFunc(int src, int dst);
|
||||
void StateSetBlendFactor(unsigned int colour);
|
||||
void StateSetAlphaFunc(int func, float param);
|
||||
void StateSetDepthFunc(int func);
|
||||
void StateSetFaceCull(bool enable);
|
||||
void StateSetFaceCullCW(bool enable);
|
||||
void StateSetLineWidth(float width);
|
||||
void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha);
|
||||
void StateSetDepthTestEnable(bool enable);
|
||||
void StateSetAlphaTestEnable(bool enable);
|
||||
void StateSetDepthSlopeAndBias(float slope, float bias);
|
||||
void StateSetFogEnable(bool enable);
|
||||
void StateSetFogMode(int mode);
|
||||
void StateSetFogNearDistance(float dist);
|
||||
void StateSetFogFarDistance(float dist);
|
||||
void StateSetFogDensity(float density);
|
||||
void StateSetFogColour(float red, float green, float blue);
|
||||
void StateSetLightingEnable(bool enable);
|
||||
void StateSetVertexTextureUV( float u, float v);
|
||||
void StateSetLightColour(int light, float red, float green, float blue);
|
||||
void StateSetLightAmbientColour(float red, float green, float blue);
|
||||
void StateSetLightDirection(int light, float x, float y, float z);
|
||||
void StateSetLightEnable(int light, bool enable);
|
||||
void StateSetViewport(eViewportType viewportType);
|
||||
void StateSetEnableViewportClipPlanes(bool enable);
|
||||
void StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace);
|
||||
void StateSetStencil(int Function, uint8_t stencil_ref, uint8_t stencil_func_mask, uint8_t stencil_write_mask);
|
||||
void StateSetForceLOD(int LOD);
|
||||
|
||||
// Event tracking
|
||||
void BeginEvent(LPCWSTR eventName);
|
||||
void EndEvent();
|
||||
|
||||
// PLM event handling
|
||||
void Suspend();
|
||||
bool Suspended();
|
||||
void Resume();
|
||||
};
|
||||
|
||||
|
||||
const int GL_MODELVIEW_MATRIX = 0;
|
||||
const int GL_PROJECTION_MATRIX = 1;
|
||||
const int GL_MODELVIEW = 0;
|
||||
const int GL_PROJECTION = 1;
|
||||
const int GL_TEXTURE = 2;
|
||||
|
||||
// These things required for tex gen
|
||||
|
||||
const int GL_S = 0;
|
||||
const int GL_T = 1;
|
||||
const int GL_R = 2;
|
||||
const int GL_Q = 3;
|
||||
|
||||
const int GL_TEXTURE_GEN_S = 0;
|
||||
const int GL_TEXTURE_GEN_T = 1;
|
||||
const int GL_TEXTURE_GEN_Q = 2;
|
||||
const int GL_TEXTURE_GEN_R = 3;
|
||||
|
||||
const int GL_TEXTURE_GEN_MODE = 0;
|
||||
const int GL_OBJECT_LINEAR = 0;
|
||||
const int GL_EYE_LINEAR = 1;
|
||||
const int GL_OBJECT_PLANE = 0;
|
||||
const int GL_EYE_PLANE = 1;
|
||||
|
||||
|
||||
// These things are used by glEnable/glDisable so must be different and non-zero (zero is used by things we haven't assigned yet)
|
||||
const int GL_TEXTURE_2D = 1;
|
||||
const int GL_BLEND = 2;
|
||||
const int GL_CULL_FACE = 3;
|
||||
const int GL_ALPHA_TEST = 4;
|
||||
const int GL_DEPTH_TEST = 5;
|
||||
const int GL_FOG = 6;
|
||||
const int GL_LIGHTING = 7;
|
||||
const int GL_LIGHT0 = 8;
|
||||
const int GL_LIGHT1 = 9;
|
||||
|
||||
const int CLEAR_DEPTH_FLAG = 1;
|
||||
const int CLEAR_COLOUR_FLAG = 2;
|
||||
|
||||
const int GL_DEPTH_BUFFER_BIT = CLEAR_DEPTH_FLAG;
|
||||
const int GL_COLOR_BUFFER_BIT = CLEAR_COLOUR_FLAG;
|
||||
|
||||
const int GL_SRC_ALPHA = D3D11_BLEND_SRC_ALPHA;
|
||||
const int GL_ONE_MINUS_SRC_ALPHA = D3D11_BLEND_INV_SRC_ALPHA;
|
||||
const int GL_ONE = D3D11_BLEND_ONE;
|
||||
const int GL_ZERO = D3D11_BLEND_ZERO;
|
||||
const int GL_DST_ALPHA = D3D11_BLEND_DEST_ALPHA;
|
||||
const int GL_SRC_COLOR = D3D11_BLEND_SRC_COLOR;
|
||||
const int GL_DST_COLOR = D3D11_BLEND_DEST_COLOR;
|
||||
const int GL_ONE_MINUS_DST_COLOR = D3D11_BLEND_INV_DEST_COLOR;
|
||||
const int GL_ONE_MINUS_SRC_COLOR = D3D11_BLEND_INV_SRC_COLOR;
|
||||
const int GL_CONSTANT_ALPHA = D3D11_BLEND_BLEND_FACTOR;
|
||||
const int GL_ONE_MINUS_CONSTANT_ALPHA = D3D11_BLEND_INV_BLEND_FACTOR;
|
||||
|
||||
const int GL_GREATER = D3D11_COMPARISON_GREATER;
|
||||
const int GL_EQUAL = D3D11_COMPARISON_EQUAL;
|
||||
const int GL_LEQUAL = D3D11_COMPARISON_LESS_EQUAL;
|
||||
const int GL_GEQUAL = D3D11_COMPARISON_GREATER_EQUAL;
|
||||
const int GL_ALWAYS = D3D11_COMPARISON_ALWAYS;
|
||||
|
||||
const int GL_TEXTURE_MIN_FILTER = 1;
|
||||
const int GL_TEXTURE_MAG_FILTER = 2;
|
||||
const int GL_TEXTURE_WRAP_S = 3;
|
||||
const int GL_TEXTURE_WRAP_T = 4;
|
||||
|
||||
const int GL_NEAREST = 0;
|
||||
const int GL_LINEAR = 1;
|
||||
const int GL_EXP = 2;
|
||||
const int GL_NEAREST_MIPMAP_LINEAR = 0; // TODO - mipmapping bit of this
|
||||
|
||||
const int GL_CLAMP = 0;
|
||||
const int GL_REPEAT = 1;
|
||||
|
||||
const int GL_FOG_START = 1;
|
||||
const int GL_FOG_END = 2;
|
||||
const int GL_FOG_MODE = 3;
|
||||
const int GL_FOG_DENSITY = 4;
|
||||
const int GL_FOG_COLOR = 5;
|
||||
|
||||
const int GL_POSITION = 1;
|
||||
const int GL_AMBIENT = 2;
|
||||
const int GL_DIFFUSE = 3;
|
||||
const int GL_SPECULAR = 4;
|
||||
|
||||
const int GL_LIGHT_MODEL_AMBIENT = 1;
|
||||
|
||||
const int GL_LINES = C4JRender::PRIMITIVE_TYPE_LINE_LIST;
|
||||
const int GL_LINE_STRIP = C4JRender::PRIMITIVE_TYPE_LINE_STRIP;
|
||||
const int GL_QUADS = C4JRender::PRIMITIVE_TYPE_QUAD_LIST;
|
||||
const int GL_TRIANGLE_FAN = C4JRender::PRIMITIVE_TYPE_TRIANGLE_FAN;
|
||||
const int GL_TRIANGLE_STRIP = C4JRender::PRIMITIVE_TYPE_TRIANGLE_STRIP;
|
||||
|
||||
// Singleton
|
||||
extern C4JRender RenderManager;
|
||||
|
||||
|
||||
@@ -1,344 +0,0 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
//#include <xtms.h>
|
||||
class C4JStringTable;
|
||||
|
||||
#define MAX_DISPLAYNAME_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
||||
#define MAX_DETAILS_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
||||
#define MAX_SAVEFILENAME_LENGTH 32 // CELL_SAVEDATA_DIRNAME_SIZE
|
||||
|
||||
typedef struct
|
||||
{
|
||||
time_t modifiedTime;
|
||||
unsigned int dataSize;
|
||||
unsigned int thumbnailSize;
|
||||
}
|
||||
CONTAINER_METADATA;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH];
|
||||
CONTAINER_METADATA metaData;
|
||||
PBYTE thumbnailData;
|
||||
}
|
||||
SAVE_INFO,*PSAVE_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int iSaveC;
|
||||
PSAVE_INFO SaveInfoA;
|
||||
}
|
||||
SAVE_DETAILS,*PSAVE_DETAILS;
|
||||
|
||||
typedef std::vector <PXMARKETPLACE_CONTENTOFFER_INFO> OfferDataArray;
|
||||
typedef std::vector <PXCONTENT_DATA> XContentDataArray;
|
||||
//typedef std::vector <PSAVE_DETAILS> SaveDetailsArray;
|
||||
|
||||
// Current version of the dlc data creator
|
||||
#define CURRENT_DLC_VERSION_NUM 3
|
||||
|
||||
class C4JStorage
|
||||
{
|
||||
|
||||
public:
|
||||
// Structs defined in the DLC_Creator, but added here to be used in the app
|
||||
typedef struct
|
||||
{
|
||||
unsigned int uiFileSize;
|
||||
DWORD dwType;
|
||||
DWORD dwWchCount; // count of WCHAR in next array
|
||||
WCHAR wchFile[1];
|
||||
}
|
||||
DLC_FILE_DETAILS, *PDLC_FILE_DETAILS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwType;
|
||||
DWORD dwWchCount; // count of WCHAR in next array;
|
||||
WCHAR wchData[1]; // will be an array of size dwBytes
|
||||
}
|
||||
DLC_FILE_PARAM, *PDLC_FILE_PARAM;
|
||||
// End of DLC_Creator structs
|
||||
|
||||
typedef struct
|
||||
{
|
||||
WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
|
||||
CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH];
|
||||
DWORD dwImageOffset;
|
||||
DWORD dwImageBytes;
|
||||
}
|
||||
CACHEINFOSTRUCT;
|
||||
|
||||
// structure to hold DLC info in TMS
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwVersion;
|
||||
DWORD dwNewOffers;
|
||||
DWORD dwTotalOffers;
|
||||
DWORD dwInstalledTotalOffers;
|
||||
BYTE bPadding[1024-sizeof(DWORD)*4]; // future expansion
|
||||
}
|
||||
DLC_TMS_DETAILS;
|
||||
|
||||
enum eGTS_FileTypes
|
||||
{
|
||||
eGTS_Type_Skin=0,
|
||||
eGTS_Type_Cape,
|
||||
eGTS_Type_MAX
|
||||
};
|
||||
|
||||
enum eGlobalStorage
|
||||
{
|
||||
//eGlobalStorage_GameClip=0,
|
||||
eGlobalStorage_Title=0,
|
||||
eGlobalStorage_TitleUser,
|
||||
eGlobalStorage_Max
|
||||
};
|
||||
|
||||
enum EMessageResult
|
||||
{
|
||||
EMessage_Undefined=0,
|
||||
EMessage_Busy,
|
||||
EMessage_Pending,
|
||||
EMessage_Cancelled,
|
||||
EMessage_ResultAccept,
|
||||
EMessage_ResultDecline,
|
||||
EMessage_ResultThirdOption,
|
||||
EMessage_ResultFourthOption
|
||||
};
|
||||
|
||||
enum ESaveGameControlState
|
||||
{
|
||||
ESaveGameControl_Idle=0,
|
||||
ESaveGameControl_Save,
|
||||
ESaveGameControl_InternalRequestingDevice,
|
||||
ESaveGameControl_InternalGetSaveName,
|
||||
ESaveGameControl_InternalSaving,
|
||||
ESaveGameControl_CopySave,
|
||||
ESaveGameControl_CopyingSave,
|
||||
};
|
||||
|
||||
enum ESaveGameState
|
||||
{
|
||||
ESaveGame_Idle=0,
|
||||
ESaveGame_Save,
|
||||
ESaveGame_InternalRequestingDevice,
|
||||
ESaveGame_InternalGetSaveName,
|
||||
ESaveGame_InternalSaving,
|
||||
ESaveGame_CopySave,
|
||||
ESaveGame_CopyingSave,
|
||||
ESaveGame_Load,
|
||||
ESaveGame_GetSavesInfo,
|
||||
ESaveGame_Rename,
|
||||
ESaveGame_Delete,
|
||||
|
||||
ESaveGame_GetSaveThumbnail // Not used as an actual state in the PS4, but the game expects this to be returned to indicate success when getting a thumbnail
|
||||
|
||||
};
|
||||
enum ELoadGameStatus
|
||||
{
|
||||
ELoadGame_Idle=0,
|
||||
ELoadGame_InProgress,
|
||||
ELoadGame_NoSaves,
|
||||
ELoadGame_ChangedDevice,
|
||||
ELoadGame_DeviceRemoved
|
||||
};
|
||||
|
||||
enum EDeleteGameStatus
|
||||
{
|
||||
EDeleteGame_Idle=0,
|
||||
EDeleteGame_InProgress,
|
||||
};
|
||||
|
||||
|
||||
enum ESGIStatus
|
||||
{
|
||||
ESGIStatus_Error=0,
|
||||
ESGIStatus_Idle,
|
||||
ESGIStatus_ReadInProgress,
|
||||
ESGIStatus_NoSaves,
|
||||
};
|
||||
|
||||
enum EDLCStatus
|
||||
{
|
||||
EDLC_Error=0,
|
||||
EDLC_Idle,
|
||||
EDLC_NoOffers,
|
||||
EDLC_AlreadyEnumeratedAllOffers,
|
||||
EDLC_NoInstalledDLC,
|
||||
EDLC_Pending,
|
||||
EDLC_LoadInProgress,
|
||||
EDLC_Loaded,
|
||||
EDLC_ChangedDevice
|
||||
};
|
||||
|
||||
enum ESavingMessage
|
||||
{
|
||||
ESavingMessage_None=0,
|
||||
ESavingMessage_Short,
|
||||
ESavingMessage_Long
|
||||
};
|
||||
|
||||
enum ETMSStatus
|
||||
{
|
||||
ETMSStatus_Idle=0,
|
||||
ETMSStatus_Fail,
|
||||
ETMSStatus_Fail_ReadInProgress,
|
||||
ETMSStatus_Fail_WriteInProgress,
|
||||
ETMSStatus_Pending,
|
||||
};
|
||||
|
||||
enum eTMS_FileType
|
||||
{
|
||||
eTMS_FileType_Normal=0,
|
||||
eTMS_FileType_Graphic,
|
||||
};
|
||||
|
||||
enum eTMS_FILETYPEVAL
|
||||
{
|
||||
TMS_FILETYPE_BINARY,
|
||||
TMS_FILETYPE_CONFIG,
|
||||
TMS_FILETYPE_JSON,
|
||||
TMS_FILETYPE_MAX
|
||||
};
|
||||
enum eTMS_UGCTYPE
|
||||
{
|
||||
TMS_UGCTYPE_NONE,
|
||||
TMS_UGCTYPE_IMAGE,
|
||||
TMS_UGCTYPE_MAX
|
||||
};
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CHAR szFilename[256];
|
||||
int iFileSize;
|
||||
eTMS_FILETYPEVAL eFileTypeVal;
|
||||
}
|
||||
TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int iCount;
|
||||
PTMSPP_FILE_DETAILS FileDetailsA;
|
||||
}
|
||||
TMSPP_FILE_LIST, *PTMSPP_FILE_LIST;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwSize;
|
||||
PBYTE pbData;
|
||||
}
|
||||
TMSPP_FILEDATA, *PTMSPP_FILEDATA;
|
||||
|
||||
|
||||
C4JStorage();
|
||||
|
||||
void Tick(void);
|
||||
|
||||
// Messages
|
||||
C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY,
|
||||
int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=nullptr,LPVOID lpParam=nullptr, C4JStringTable *pStringTable=nullptr, WCHAR *pwchFormatString=nullptr,DWORD dwFocusButton=0);
|
||||
|
||||
|
||||
C4JStorage::EMessageResult GetMessageBoxResult();
|
||||
|
||||
// save device
|
||||
bool SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice=false);
|
||||
|
||||
// savegame
|
||||
void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam,LPCSTR szGroupID);
|
||||
void ResetSaveData(); // Call before a new save to clear out stored save file name
|
||||
void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName);
|
||||
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
|
||||
bool GetSaveUniqueNumber(INT *piVal);
|
||||
bool GetSaveUniqueFilename(char *pszName);
|
||||
void SetSaveUniqueFilename(char *szFilename);
|
||||
void SetState(ESaveGameControlState eControlState,int( *Func)(LPVOID,const bool),LPVOID lpParam);
|
||||
void SetSaveDisabled(bool bDisable);
|
||||
bool GetSaveDisabled(void);
|
||||
unsigned int GetSaveSize();
|
||||
void GetSaveData(void *pvData,unsigned int *puiBytes);
|
||||
PVOID AllocateSaveData(unsigned int uiBytes);
|
||||
void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png
|
||||
C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam);
|
||||
void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam);
|
||||
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected);
|
||||
bool GetSaveDeviceSelected(unsigned int iPad);
|
||||
C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists);
|
||||
bool EnoughSpaceForAMinSaveGame();
|
||||
|
||||
void SetSaveMessageVPosition(float fY); // The 'Saving' message will display at a default position unless changed
|
||||
// Get the info for the saves
|
||||
C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName);
|
||||
PSAVE_DETAILS ReturnSavesInfo();
|
||||
void ClearSavesInfo(); // Clears results
|
||||
C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); // Get the thumbnail for an individual save referenced by pSaveInfo
|
||||
|
||||
void GetSaveCacheFileInfo(DWORD dwFile,XCONTENT_DATA &xContentData);
|
||||
void GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes);
|
||||
|
||||
// Load the save. Need to call GetSaveData once the callback is called
|
||||
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam);
|
||||
|
||||
// DLC
|
||||
void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam );
|
||||
void SetDLCPackageRoot(char *pszDLCRoot);
|
||||
C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
||||
DWORD CancelGetDLCOffers();
|
||||
void ClearDLCOffers();
|
||||
XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw);
|
||||
int GetOfferCount();
|
||||
DWORD InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false);
|
||||
DWORD GetAvailableDLCCount( int iPad);
|
||||
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam);
|
||||
XCONTENT_DATA& GetDLC(DWORD dw);
|
||||
DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive=nullptr);
|
||||
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = nullptr);
|
||||
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
|
||||
std::string GetMountedPath(std::string szMount);
|
||||
|
||||
// Global title storage
|
||||
C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,
|
||||
WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int)=nullptr,LPVOID lpParam=nullptr, int iAction=0);
|
||||
bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize);
|
||||
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename);
|
||||
void StoreTMSPathName(WCHAR *pwchName=nullptr);
|
||||
|
||||
// TMS++
|
||||
#ifdef _XBOX
|
||||
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)=nullptr,LPVOID lpParam=nullptr, int iUserData=0);
|
||||
// C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0);
|
||||
C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=nullptr,LPVOID lpParam=nullptr, int iUserData=0);
|
||||
// C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=nullptr,LPVOID lpParam=nullptr, int iUserData=0);
|
||||
// C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=nullptr, int iUserData=0);
|
||||
// bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename);
|
||||
// unsigned int CRC(unsigned char *buf, int len);
|
||||
|
||||
// enum eXBLWS
|
||||
// {
|
||||
// eXBLWS_GET,
|
||||
// eXBLWS_POST,
|
||||
// eXBLWS_PUT,
|
||||
// eXBLWS_DELETE,
|
||||
// };
|
||||
//bool XBLWS_Command(eXBLWS eCommand);
|
||||
|
||||
|
||||
unsigned int CRC(unsigned char *buf, int len);
|
||||
|
||||
// #ifdef _DEBUG
|
||||
// void SetSaveName(int i);
|
||||
// #endif
|
||||
// string table for all the Storage problems. Loaded by the application
|
||||
C4JStringTable *m_pStringTable;
|
||||
};
|
||||
|
||||
extern C4JStorage StorageManager;
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -36,8 +36,6 @@ public:
|
||||
static const int KEY_DEBUG_CONSOLE = VK_F6;
|
||||
static const int KEY_HOST_SETTINGS = VK_TAB;
|
||||
static const int KEY_FULLSCREEN = VK_F11;
|
||||
|
||||
// todo: implement and shi
|
||||
static const int KEY_SCREENSHOT = VK_F2;
|
||||
|
||||
void Init();
|
||||
|
||||
@@ -24,7 +24,7 @@ void ConsoleUIController::init(ID3D11Device *dev, ID3D11DeviceContext *ctx, ID3D
|
||||
{
|
||||
app.DebugPrintf("Failed to initialise GDraw!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
#ifdef _DEBUG
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
//wprintf(L"WARNING: Sound cue not found - %ls\n", name.c_str() );
|
||||
app.DebugPrintf("Not found: %s\n",xboxName);
|
||||
|
||||
@@ -183,7 +183,7 @@ bool XboxLeaderboardManager::WriteStats(unsigned int viewCount, ViewIn views)
|
||||
|
||||
// some debug code to catch the leaderboard write with 7 views
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if(viewCount>5) __debugbreak();
|
||||
if(viewCount>5) DEBUG_BREAK();
|
||||
#endif
|
||||
|
||||
// 4J Stu - If we are online we already have a session, so use that
|
||||
|
||||
@@ -211,8 +211,6 @@ VOID CPlatformNetworkManagerXbox::NotifyPlayerLeaving(
|
||||
__in IQNetPlayer * pQNetPlayer
|
||||
)
|
||||
{
|
||||
//__debugbreak();
|
||||
|
||||
app.DebugPrintf( "Player 0x%p \"%ls\" leaving.\n",
|
||||
pQNetPlayer,
|
||||
pQNetPlayer->GetGamertag() );
|
||||
|
||||
@@ -315,8 +315,6 @@ int __cdecl main()
|
||||
HRESULT hr;
|
||||
static bool bTrialTimerDisplayed=true;
|
||||
|
||||
//__debugbreak();
|
||||
|
||||
#ifdef MEMORY_TRACKING
|
||||
ResetMem();
|
||||
MEMORYSTATUS memStat;
|
||||
|
||||
@@ -147,6 +147,7 @@ typedef XUID GameSessionUID;
|
||||
#endif
|
||||
|
||||
#include "../Minecraft.World/Definitions.h"
|
||||
#include "../Minecraft.World/Debug.h"
|
||||
#include "../Minecraft.World/Class.h"
|
||||
#include "../Minecraft.World/ArrayWithLength.h"
|
||||
#include "../Minecraft.World/SharedConstants.h"
|
||||
|
||||
@@ -42,16 +42,10 @@ target_link_libraries(Minecraft.Server PRIVATE
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
$<$<CONFIG:Debug>: # Debug 4J libraries
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>: # Release 4J libraries
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
4JLibs.${PLATFORM_NAME}.Input
|
||||
4JLibs.${PLATFORM_NAME}.Profile
|
||||
4JLibs.${PLATFORM_NAME}.Storage
|
||||
4JLibs.${PLATFORM_NAME}.Render
|
||||
)
|
||||
|
||||
# Iggy libs
|
||||
|
||||
@@ -208,7 +208,7 @@ void ArmorItem::setColor(shared_ptr<ItemInstance> item, int color)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Can't dye non-leather!");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
//throw new UnsupportedOperationException("Can't dye non-leather!");
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ void BiomeDecorator::decorate(Level *level, Random *random, int xo, int zo)
|
||||
{
|
||||
app.DebugPrintf("BiomeDecorator::decorate - Already decorating!!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
//throw new RuntimeException("Already decorating!!");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup)
|
||||
{
|
||||
|
||||
#ifdef _DURANGO
|
||||
__debugbreak(); // TODO
|
||||
DEBUG_BREAK(); // TODO
|
||||
DWORD bytesRead,dwFileSize = 0;
|
||||
#else
|
||||
DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr);
|
||||
@@ -40,7 +40,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup)
|
||||
if(dwFileSize > m_biomeOverride.length)
|
||||
{
|
||||
app.DebugPrintf("Biomemap binary is too large!!\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
BOOL bSuccess = ReadFile(file,m_biomeOverride.data,dwFileSize,&bytesRead,nullptr);
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ void BiomeSource::getRawBiomeBlock(BiomeArray &biomes, int x, int z, int w, int
|
||||
if(biomes[i] == nullptr)
|
||||
{
|
||||
app.DebugPrintf("Tried to assign null biome %d\n", result[i]);
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "Debug.h"
|
||||
using namespace std;
|
||||
class InputStream;
|
||||
|
||||
@@ -598,7 +599,7 @@ public:
|
||||
|
||||
if ( (m_falsePositives.size() > 0) || (m_falseNegatives.size() > 0) )
|
||||
{
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Tried to read NBT tag with too high complexity, depth > %d" , MAX_DEPTH);
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1065,7 +1065,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/)
|
||||
#ifndef _DURANGO
|
||||
MEMORYSTATUS memStatus;
|
||||
GlobalMemoryStatus(&memStatus);
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
}
|
||||
unsigned char *pucData = newIndicesAndData + 1024;
|
||||
|
||||
@@ -88,7 +88,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
|
||||
if( pagesCommitted != 0 )
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
// Out of physical memory
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
}
|
||||
pagesCommitted = pagesRequired;
|
||||
@@ -204,7 +204,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
|
||||
if( pvRet == nullptr )
|
||||
{
|
||||
// Out of physical memory
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
pagesCommitted = pagesRequired;
|
||||
}
|
||||
@@ -495,7 +495,7 @@ void ConsoleSaveFileOriginal::finalizeWrite()
|
||||
void *pvRet = VirtualAlloc(pvHeap, pagesRequired * CSF_PAGE_SIZE, COMMIT_ALLOCATION, PAGE_READWRITE);
|
||||
if( pvRet == NULL )
|
||||
{
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
pagesCommitted = pagesRequired;
|
||||
}
|
||||
@@ -529,7 +529,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt
|
||||
if( pvRet == nullptr )
|
||||
{
|
||||
// Out of physical memory
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
pagesCommitted = pagesRequired;
|
||||
}
|
||||
@@ -731,6 +731,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail )
|
||||
s_bgSaveActive.store(true, std::memory_order_release);
|
||||
|
||||
std::thread([snap, fileSize, thumb, thumbSz, meta, metaLen, this]() {
|
||||
Compression::UseDefaultThreadStorage();
|
||||
unsigned int compLen = fileSize + 8;
|
||||
byte *buf = static_cast<byte *>(StorageManager.AllocateSaveData(compLen));
|
||||
if (!buf)
|
||||
|
||||
@@ -41,7 +41,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt
|
||||
{
|
||||
|
||||
#ifdef _DURANGO
|
||||
__debugbreak(); // TODO
|
||||
DEBUG_BREAK(); // TODO
|
||||
DWORD bytesRead,dwFileSize = 0;
|
||||
#else
|
||||
DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr);
|
||||
@@ -49,7 +49,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt
|
||||
if(dwFileSize > m_heightmapOverride.length)
|
||||
{
|
||||
app.DebugPrintf("Heightmap binary is too large!!\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
BOOL bSuccess = ReadFile(file,m_heightmapOverride.data,dwFileSize,&bytesRead,nullptr);
|
||||
|
||||
@@ -83,7 +83,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt
|
||||
{
|
||||
|
||||
#ifdef _DURANGO
|
||||
__debugbreak(); // TODO
|
||||
DEBUG_BREAK(); // TODO
|
||||
DWORD bytesRead,dwFileSize = 0;
|
||||
#else
|
||||
DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr);
|
||||
@@ -91,7 +91,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt
|
||||
if(dwFileSize > m_waterheightOverride.length)
|
||||
{
|
||||
app.DebugPrintf("waterheight binary is too large!!\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
BOOL bSuccess = ReadFile(file,m_waterheightOverride.data,dwFileSize,&bytesRead,nullptr);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ CustomPayloadPacket::CustomPayloadPacket(const wstring &identifier, byteArray da
|
||||
{
|
||||
app.DebugPrintf("Payload may not be larger than 32K\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
//throw new IllegalArgumentException("Payload may not be larger than 32k");
|
||||
}
|
||||
|
||||
12
Minecraft.World/Debug.h
Normal file
12
Minecraft.World/Debug.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include <csignal>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define DEBUG_BREAK() __debugbreak()
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define DEBUG_BREAK() __builtin_trap()
|
||||
#elif defined(SIGTRAP)
|
||||
#define DEBUG_BREAK() std::raise(SIGTRAP)
|
||||
#else
|
||||
#define DEBUG_BREAK() ((void)0)
|
||||
#endif
|
||||
@@ -43,7 +43,7 @@ int _MapDataMappings::getDimension(int id)
|
||||
default:
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Read invalid dimension from MapDataMapping\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void _MapDataMappings::setMapping(int id, PlayerUID xuid, int dimension)
|
||||
default:
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Trinyg to set a MapDataMapping for an invalid dimension.\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ void Enchantment::_init(int id)
|
||||
{
|
||||
app.DebugPrintf("Duplicate enchantment id!");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
//throw new IllegalArgumentException("Duplicate enchantment id!");
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ int Entity::getSmallId()
|
||||
return fallbackId;
|
||||
#else
|
||||
app.DebugPrintf("Out of small entity Ids... possible leak?\n");
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ bool File::renameTo(File dest)
|
||||
std::string sourcePath = wstringtofilename(getPath());
|
||||
const char *destPath = wstringtofilename(dest.getPath());
|
||||
#ifdef _DURANGO
|
||||
__debugbreak(); // TODO
|
||||
DEBUG_BREAK(); // TODO
|
||||
BOOL result = false;
|
||||
#else
|
||||
BOOL result = MoveFile(sourcePath.c_str(), destPath);
|
||||
|
||||
@@ -298,7 +298,7 @@ void FileHeader::ReadHeader( LPVOID saveMem, ESavePlatform plat /*= SAVE_FILE_PL
|
||||
default:
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("********** Invalid save version %d\n",m_saveVersion);
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ FileInputStream::FileInputStream(const File &file)
|
||||
if( m_fileHandle == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
// TODO 4J Stu - Any form of error/exception handling
|
||||
//__debugbreak();
|
||||
app.FatalLoadError();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ GameCommandPacket::GameCommandPacket(EGameCommand command, byteArray data)
|
||||
{
|
||||
app.DebugPrintf("Payload may not be larger than 32K\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
//throw new IllegalArgumentException("Payload may not be larger than 32k");
|
||||
}
|
||||
|
||||
@@ -2411,7 +2411,7 @@ void Level::tickEntities()
|
||||
{
|
||||
if(isClientSide)
|
||||
{
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
it = tileEntityList.erase(it);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ void MoveEntityPacket::write(DataOutputStream *dos) //throws IOException
|
||||
if( (id < 0 ) || (id >= 16384 ) )
|
||||
{
|
||||
// We shouln't be tracking an entity that doesn't have a short type of id
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
dos->writeShort(static_cast<short>(id));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ MoveEntityPacketSmall::MoveEntityPacketSmall(int id)
|
||||
if( (id < 0 ) || (id >= 16384 ) )
|
||||
{
|
||||
// We shouln't be tracking an entity that doesn't have a short type of id
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
|
||||
this->id = id;
|
||||
@@ -45,7 +45,7 @@ void MoveEntityPacketSmall::write(DataOutputStream *dos) //throws IOException
|
||||
if( (id < 0 ) || (id >= 16384 ) )
|
||||
{
|
||||
// We shouln't be tracking an entity that doesn't have a short type of id
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
dos->writeShort(static_cast<short>(id));
|
||||
}
|
||||
@@ -102,7 +102,7 @@ void MoveEntityPacketSmall::PosRot::write(DataOutputStream *dos) //throws IOExce
|
||||
if( (id < 0 ) || (id >= 16384 ) )
|
||||
{
|
||||
// We shouln't be tracking an entity that doesn't have a short type of id
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
short idAndRot = id | yRot << 11;
|
||||
dos->writeShort(idAndRot);
|
||||
@@ -141,7 +141,7 @@ void MoveEntityPacketSmall::Pos::write(DataOutputStream *dos) //throws IOExcepti
|
||||
if( (id < 0 ) || (id >= 16384 ) )
|
||||
{
|
||||
// We shouln't be tracking an entity that doesn't have a short type of id
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
short idAndY = id | ya << 11;
|
||||
dos->writeShort(idAndY);
|
||||
@@ -179,7 +179,7 @@ void MoveEntityPacketSmall::Rot::write(DataOutputStream *dos) //throws IOExcepti
|
||||
if( (id < 0 ) || (id >= 16384 ) )
|
||||
{
|
||||
// We shouln't be tracking an entity that doesn't have a short type of id
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
}
|
||||
short idAndRot = id | yRot << 11;
|
||||
dos->writeShort(idAndRot);
|
||||
|
||||
@@ -288,7 +288,7 @@ byteArray Packet::readBytes(DataInputStream *datainputstream)
|
||||
{
|
||||
app.DebugPrintf("Key was smaller than nothing! Weird key!");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
DEBUG_BREAK();
|
||||
#endif
|
||||
return byteArray();
|
||||
//throw new IOException("Key was smaller than nothing! Weird key!");
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user