remove most other linux ifdefs

This commit is contained in:
Tropical 2026-04-09 23:23:53 -05:00
parent d181ed62f6
commit 8f04e231bd
15 changed files with 43 additions and 76 deletions

View file

@ -521,12 +521,6 @@ int32_t Game::RegisterConfigValues(char* pType, int iValue) {
return hr; return hr;
} }
#if defined(_WINDOWS64)
#elif defined(__linux__)
#else
#endif
// DLC // DLC
// AUTOSAVE // AUTOSAVE

View file

@ -4,9 +4,6 @@
#include <format> #include <format>
#include <string> #include <string>
#include <vector> #include <vector>
#if !defined(__linux__)
#include <qnet.h>
#endif
#include "minecraft/network/INetworkService.h" #include "minecraft/network/INetworkService.h"
#include "platform/C4JThread.h" #include "platform/C4JThread.h"
#include "platform/network/NetTypes.h" #include "platform/network/NetTypes.h"

View file

@ -19,9 +19,6 @@ UIComponent_DebugUIMarketingGuide::UIComponent_DebugUIMarketingGuide(
IggyDataValue value[1]; IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number; value[0].type = IGGY_DATATYPE_number;
value[0].number = (F64)0; // WIN64 value[0].number = (F64)0; // WIN64
#if defined(_WINDOWS64) || defined(__linux__)
value[0].number = (F64)0;
#endif
IggyResult out = IggyPlayerCallMethodRS(getMovie(), &result, IggyResult out = IggyPlayerCallMethodRS(getMovie(), &result,
IggyPlayerRootPath(getMovie()), IggyPlayerRootPath(getMovie()),
m_funcSetPlatform, 1, value); m_funcSetPlatform, 1, value);

View file

@ -1,8 +1,9 @@
#include "UIControl_Touch.h" #include "UIControl_Touch.h"
#include "app/common/Iggy/include/iggy.h"
#include "app/common/UI/Controls/UIControl.h" #include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Controls/UIControl_Base.h" #include "app/common/UI/Controls/UIControl_Base.h"
#include "app/common/Iggy/include/iggy.h" #include "app/common/UI/ConsoleUIController.h"
#ifndef _ENABLEIGGY #ifndef _ENABLEIGGY
#include "app/common/Iggy/iggy_stubs.h" #include "app/common/Iggy/iggy_stubs.h"
#endif #endif
@ -20,7 +21,6 @@ bool UIControl_Touch::setupControl(UIScene* scene, IggyValuePath* parent,
void UIControl_Touch::init(int iId) { void UIControl_Touch::init(int iId) {
m_id = iId; m_id = iId;
#if !defined(__linux__)
switch (m_parentScene->GetParentLayer()->m_iLayer) { switch (m_parentScene->GetParentLayer()->m_iLayer) {
case eUILayer_Error: case eUILayer_Error:
case eUILayer_Fullscreen: case eUILayer_Fullscreen:
@ -29,7 +29,6 @@ void UIControl_Touch::init(int iId) {
ui.TouchBoxAdd(this, m_parentScene); ui.TouchBoxAdd(this, m_parentScene);
break; break;
} }
#endif
} }
void UIControl_Touch::ReInit() { void UIControl_Touch::ReInit() {

View file

@ -25,9 +25,7 @@ UIScene_Intro::UIScene_Intro(int iPad, void* initData, UILayer* parentLayer)
bool bChina = false; bool bChina = false;
// 4J Stu - These map to values in the Actionscript // 4J Stu - These map to values in the Actionscript
#if defined(_WINDOWS64) || defined(__linux__)
int platformIdx = 0; int platformIdx = 0;
#endif
IggyDataValue result; IggyDataValue result;
IggyDataValue value[3]; IggyDataValue value[3];

View file

@ -21,10 +21,8 @@ class UILayer;
#define DYNAMODE_FONT_CREDITS_COUNT 2 #define DYNAMODE_FONT_CREDITS_COUNT 2
#define PS3_DOLBY_CREDIT 4 #define PS3_DOLBY_CREDIT 4
#if defined(_WINDOWS64) || defined(__linux__)
#define MAX_CREDIT_STRINGS \ #define MAX_CREDIT_STRINGS \
(XBOXONE_CREDITS_COUNT + MILES_AND_IGGY_CREDITS_COUNT) (XBOXONE_CREDITS_COUNT + MILES_AND_IGGY_CREDITS_COUNT)
#endif
class UIScene_Credits : public UIScene { class UIScene_Credits : public UIScene {
private: private:

View file

@ -213,7 +213,7 @@ UIController::UIController() {
// 4J Stu - This is a bit of a hack until we change the Minecraft // 4J Stu - This is a bit of a hack until we change the Minecraft
// initialisation to store the proper screen size for other platforms // initialisation to store the proper screen size for other platforms
#if defined(_WINDOWS64) || defined(__linux__) #if 1
m_fScreenWidth = 1920.0f; m_fScreenWidth = 1920.0f;
m_fScreenHeight = 1080.0f; m_fScreenHeight = 1080.0f;
m_bScreenWidthSetup = true; m_bScreenWidthSetup = true;
@ -498,7 +498,7 @@ void UIController::tick() {
void UIController::loadSkins() { void UIController::loadSkins() {
std::string platformSkinPath = ""; std::string platformSkinPath = "";
#if defined(_WINDOWS64) || defined(__linux__) #if 1
if (m_fScreenHeight == 1080.0f) { if (m_fScreenHeight == 1080.0f) {
platformSkinPath = "skinHDWin.swf"; platformSkinPath = "skinHDWin.swf";
} else { } else {
@ -514,7 +514,7 @@ void UIController::loadSkins() {
loadSkin(platformSkinPath, "platformskin.swf"); loadSkin(platformSkinPath, "platformskin.swf");
} }
#if defined(_WINDOWS64) || defined(__linux__) #if 1
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
// 4J Stu - Load the 720/480 skins so that we have something to fallback on // 4J Stu - Load the 720/480 skins so that we have something to fallback on
@ -616,7 +616,7 @@ void UIController::ReloadSkin() {
m_iggyLibraries[i] = IGGY_INVALID_LIBRARY; m_iggyLibraries[i] = IGGY_INVALID_LIBRARY;
} }
#if defined(_WINDOWS64) || defined(__linux__) #if 1
// 4J Stu - Don't load on a thread on windows. I haven't investigated this // 4J Stu - Don't load on a thread on windows. I haven't investigated this
// in detail, so a quick fix // in detail, so a quick fix
reloadSkinThreadProc(this); reloadSkinThreadProc(this);
@ -668,7 +668,7 @@ int UIController::reloadSkinThreadProc(void* lpParam) {
// 4J Stu - Don't do this on windows, as we never navigated forwards to // 4J Stu - Don't do this on windows, as we never navigated forwards to
// start with // start with
#if !(defined(_WINDOWS64) || defined(__linux__)) #if 0
controller->NavigateBack(0, false, eUIScene_COUNT, eUILayer_Tooltips); controller->NavigateBack(0, false, eUIScene_COUNT, eUILayer_Tooltips);
#endif #endif
} }
@ -969,13 +969,8 @@ void UIController::setupCustomDrawGameState() {
m_customRenderingClearRect.top = LONG_MAX; m_customRenderingClearRect.top = LONG_MAX;
m_customRenderingClearRect.bottom = LONG_MIN; m_customRenderingClearRect.bottom = LONG_MIN;
#if defined(_WINDOWS64)
PlatformRenderer.StartFrame();
gdraw_D3D11_setViewport_4J();
#elif defined(__linux__)
PlatformRenderer.StartFrame(); PlatformRenderer.StartFrame();
#endif
PlatformRenderer.Set_matrixDirty(); PlatformRenderer.Set_matrixDirty();
// 4J Stu - We don't need to clear this here as iggy hasn't written anything // 4J Stu - We don't need to clear this here as iggy hasn't written anything
@ -1059,11 +1054,7 @@ void UIController::setupCustomDrawGameStateAndMatrices(
} }
void UIController::endCustomDrawGameState() { void UIController::endCustomDrawGameState() {
#if defined(__linux__)
PlatformRenderer.Clear(GL_DEPTH_BUFFER_BIT); PlatformRenderer.Clear(GL_DEPTH_BUFFER_BIT);
#else
PlatformRenderer.Clear(GL_DEPTH_BUFFER_BIT, &m_customRenderingClearRect);
#endif
// glClear(GL_DEPTH_BUFFER_BIT); // glClear(GL_DEPTH_BUFFER_BIT);
glDepthMask(false); glDepthMask(false);
glDisable(GL_ALPHA_TEST); glDisable(GL_ALPHA_TEST);
@ -2257,7 +2248,7 @@ UIController::RequestContentRestrictedMessageBox(
} }
if (message == -1) { if (message == -1) {
#if defined(_WINDOWS64) || defined(__linux__) #if 1
// IDS_CONTENT_RESTRICTION doesn't exist on XB1 // IDS_CONTENT_RESTRICTION doesn't exist on XB1
message = IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE; message = IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE;
#else #else
@ -2283,7 +2274,7 @@ void UIController::setFontCachingCalculationBuffer(int length) {
draw call is not large enough, Iggy will crash or otherwise behave draw call is not large enough, Iggy will crash or otherwise behave
incorrectly. incorrectly.
*/ */
#if defined(_WIN64) || defined(__linux__) #if INTPTR_MAX == INT64_MAX
static const int CHAR_SIZE = 24; static const int CHAR_SIZE = 24;
#else #else
static const int CHAR_SIZE = 16; static const int CHAR_SIZE = 16;

View file

@ -10,17 +10,10 @@
#include "util/Timer.h" #include "util/Timer.h"
#ifdef __linux__
#include "app/common/Iggy/include/iggy.h" #include "app/common/Iggy/include/iggy.h"
#ifndef _ENABLEIGGY #ifndef _ENABLEIGGY
#include "app/common/Iggy/iggy_stubs.h" #include "app/common/Iggy/iggy_stubs.h"
#endif #endif
#elif defined(_WINDOWS64)
#include "app/windows/Iggy/include/iggy.h"
#endif
#include "UIGroup.h" #include "UIGroup.h"
#include "app/common/UI/All Platforms/IUIController.h" #include "app/common/UI/All Platforms/IUIController.h"
#include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/All Platforms/UIEnums.h"

View file

@ -143,7 +143,6 @@ common/UI/Controls/UIControl_SlotList.cpp
common/UI/Controls/UIControl_SpaceIndicatorBar.cpp common/UI/Controls/UIControl_SpaceIndicatorBar.cpp
common/UI/Controls/UIControl_TextInput.cpp common/UI/Controls/UIControl_TextInput.cpp
common/UI/Controls/UIControl_TexturePackList.cpp common/UI/Controls/UIControl_TexturePackList.cpp
common/UI/Controls/UIControl_Touch.cpp
common/UI/Scenes/Debug/UIScene_DebugCreateSchematic.cpp common/UI/Scenes/Debug/UIScene_DebugCreateSchematic.cpp
common/UI/Scenes/Debug/UIScene_DebugOptions.cpp common/UI/Scenes/Debug/UIScene_DebugOptions.cpp
common/UI/Scenes/Debug/UIScene_DebugOverlay.cpp common/UI/Scenes/Debug/UIScene_DebugOverlay.cpp

View file

@ -71,11 +71,11 @@ void Minimap::reloadColours() {
int b = ((color) & 0xff) * br / 255; int b = ((color) & 0xff) * br / 255;
// 4J - changed byte order to save having to reorder later // 4J - changed byte order to save having to reorder later
#if defined(_WIN64) || __linux__ // #if defined(_WIN64) || __linux__
LUT[i] = 255 << 24 | b << 16 | g << 8 | r; LUT[i] = 255 << 24 | b << 16 | g << 8 | r;
#else // #else
LUT[i] = r << 24 | g << 16 | b << 8 | 255; // LUT[i] = r << 24 | g << 16 | b << 8 | 255;
#endif // #endif
// pixels[i] = (255) << 24 | r << 16 | g << 8 | b; // pixels[i] = (255) << 24 | r << 16 | g << 8 | b;
} }

View file

@ -802,25 +802,25 @@ void GameRenderer::renderItemInHand(float a, int eye) {
// 4J - change brought forward from 1.8.2 // 4J - change brought forward from 1.8.2
void GameRenderer::turnOffLightLayer(double alpha) { // 4J - TODO void GameRenderer::turnOffLightLayer(double alpha) { // 4J - TODO
FRAME_PROFILE_SCOPE(Lightmap); FRAME_PROFILE_SCOPE(Lightmap);
#if defined(__linux__)
// 4jcraft
if (SharedConstants::TEXTURE_LIGHTING) { if (SharedConstants::TEXTURE_LIGHTING) {
PlatformRenderer.TextureBindVertex(-1); PlatformRenderer.TextureBindVertex(-1);
} }
#else
// 4jcraft: manually handle this in order to ensure that the light layer is // // 4jcraft: manually handle this in order to ensure that the light layer is
// turned off correctly // // turned off correctly
if (SharedConstants::TEXTURE_LIGHTING) { // if (SharedConstants::TEXTURE_LIGHTING) {
glClientActiveTexture(GL_TEXTURE1); // glClientActiveTexture(GL_TEXTURE1);
glActiveTexture(GL_TEXTURE1); // glActiveTexture(GL_TEXTURE1);
glMatrixMode(GL_TEXTURE); // glMatrixMode(GL_TEXTURE);
glLoadIdentity(); // glLoadIdentity();
glMatrixMode(GL_MODELVIEW); // glMatrixMode(GL_MODELVIEW);
glDisable(GL_TEXTURE_2D); // glDisable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 0); // glBindTexture(GL_TEXTURE_2D, 0);
glClientActiveTexture(GL_TEXTURE0); // glClientActiveTexture(GL_TEXTURE0);
glActiveTexture(GL_TEXTURE0); // glActiveTexture(GL_TEXTURE0);
} // }
#endif
} }
// 4J - change brought forward from 1.8.2 // 4J - change brought forward from 1.8.2
@ -828,7 +828,7 @@ void GameRenderer::turnOnLightLayer(
double alpha, double alpha,
bool scaleLight) { // 4jcraft: added scaleLight for entity lighting bool scaleLight) { // 4jcraft: added scaleLight for entity lighting
FRAME_PROFILE_SCOPE(Lightmap); FRAME_PROFILE_SCOPE(Lightmap);
#if defined(__linux__) #if 1
if (!SharedConstants::TEXTURE_LIGHTING) return; if (!SharedConstants::TEXTURE_LIGHTING) return;
const int textureId = getLightTexture(mc->player->GetXboxPad(), mc->level); const int textureId = getLightTexture(mc->player->GetXboxPad(), mc->level);
@ -988,11 +988,11 @@ void GameRenderer::updateLightTexture(float a) {
int g = (int)(_g * 255); int g = (int)(_g * 255);
int b = (int)(_b * 255); int b = (int)(_b * 255);
#if defined(_WIN64) || __linux__ // #if defined(_WIN64) || __linux__
lightPixels[j][i] = alpha << 24 | b << 16 | g << 8 | r; lightPixels[j][i] = alpha << 24 | b << 16 | g << 8 | r;
#else // #else
lightPixels[j][i] = r << 24 | g << 16 | b << 8 | alpha; // lightPixels[j][i] = r << 24 | g << 16 | b << 8 | alpha;
#endif // #endif
} }
mc->textures->replaceTextureDirect(lightPixels[j], 16, 16, mc->textures->replaceTextureDirect(lightPixels[j], 16, 16,

View file

@ -460,14 +460,15 @@ void ItemInHandRenderer::render(float a) {
std::floor(player->z), 0); std::floor(player->z), 0);
int u = col % 65536; int u = col % 65536;
int v = col / 65536; int v = col / 65536;
#if defined(__linux__)
// 4jcraft
static int lightmapLogCount = 0; static int lightmapLogCount = 0;
if (lightmapLogCount < 8) { if (lightmapLogCount < 8) {
++lightmapLogCount; ++lightmapLogCount;
Log::info("[linux-lightmap] item-hand raw=0x%08x uv=(%d,%d)\n", col, Log::info("[4jcraft-lightmap] item-hand raw=0x%08x uv=(%d,%d)\n", col,
u, v); u, v);
} }
#endif
glMultiTexCoord2f(GL_TEXTURE1, u / 1.0f, v / 1.0f); glMultiTexCoord2f(GL_TEXTURE1, u / 1.0f, v / 1.0f);
glColor4f(1, 1, 1, 1); glColor4f(1, 1, 1, 1);
} }

View file

@ -412,7 +412,7 @@ typedef unsigned short hfloat;
extern hfloat convertFloatToHFloat(float f); extern hfloat convertFloatToHFloat(float f);
extern float convertHFloatToFloat(hfloat hf); extern float convertHFloatToFloat(hfloat hf);
#if defined(__linux__) #if 1
namespace { namespace {
void packLinuxLightmapCoords(int tex2, std::int16_t& u, std::int16_t& v) { void packLinuxLightmapCoords(int tex2, std::int16_t& u, std::int16_t& v) {
u = static_cast<std::int16_t>(tex2 & 0xffff); u = static_cast<std::int16_t>(tex2 & 0xffff);
@ -469,7 +469,7 @@ void Tesselator::vertex(float x, float y, float z) {
pShortData[5] = (((int)(v * 8192.0f)) & 0xffff); pShortData[5] = (((int)(v * 8192.0f)) & 0xffff);
std::int16_t u2 = static_cast<std::int16_t>(_tex2 & 0xffff); std::int16_t u2 = static_cast<std::int16_t>(_tex2 & 0xffff);
std::int16_t v2 = static_cast<std::int16_t>((_tex2 >> 16) & 0xffff); std::int16_t v2 = static_cast<std::int16_t>((_tex2 >> 16) & 0xffff);
#if defined(__linux__) #if 1
packLinuxLightmapCoords(_tex2, u2, v2); packLinuxLightmapCoords(_tex2, u2, v2);
logLinuxPackedLightmapCoords("compact", _tex2, u2, v2); logLinuxPackedLightmapCoords("compact", _tex2, u2, v2);
#endif #endif
@ -524,7 +524,7 @@ void Tesselator::vertex(float x, float y, float z) {
} }
if (hasTexture2) { if (hasTexture2) {
// 4jcraft: we will be lighting the blocks right in here // 4jcraft: we will be lighting the blocks right in here
#if defined(__linux__) #if 1
std::int16_t tex2U; std::int16_t tex2U;
std::int16_t tex2V; std::int16_t tex2V;
packLinuxLightmapCoords(_tex2, tex2U, tex2V); packLinuxLightmapCoords(_tex2, tex2U, tex2V);

View file

@ -38,6 +38,6 @@ int RemoveEntitiesPacket::getEstimatedSize() { return 1 + (ids.size() * 4); }
4J: These are necesary on the PS3. 4J: These are necesary on the PS3.
(and 4). (and 4).
*/ */
#if (0 || 0 || 0 || defined __linux__) #if 1
const int RemoveEntitiesPacket::MAX_PER_PACKET; const int RemoveEntitiesPacket::MAX_PER_PACKET;
#endif #endif

View file

@ -1712,7 +1712,7 @@ attrAttrModMap* Item::getDefaultAttributeModifiers() {
4J: These are necesary on the PS3. 4J: These are necesary on the PS3.
(and 4 and Vita). (and 4 and Vita).
*/ */
#if (0 || 0 || 0 || defined __linux__) #if 1
const int Item::shovel_iron_Id; const int Item::shovel_iron_Id;
const int Item::pickAxe_iron_Id; const int Item::pickAxe_iron_Id;
const int Item::hatchet_iron_Id; const int Item::hatchet_iron_Id;