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;
}
#if defined(_WINDOWS64)
#elif defined(__linux__)
#else
#endif
// DLC
// AUTOSAVE

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -213,7 +213,7 @@ UIController::UIController() {
// 4J Stu - This is a bit of a hack until we change the Minecraft
// initialisation to store the proper screen size for other platforms
#if defined(_WINDOWS64) || defined(__linux__)
#if 1
m_fScreenWidth = 1920.0f;
m_fScreenHeight = 1080.0f;
m_bScreenWidthSetup = true;
@ -498,7 +498,7 @@ void UIController::tick() {
void UIController::loadSkins() {
std::string platformSkinPath = "";
#if defined(_WINDOWS64) || defined(__linux__)
#if 1
if (m_fScreenHeight == 1080.0f) {
platformSkinPath = "skinHDWin.swf";
} else {
@ -514,7 +514,7 @@ void UIController::loadSkins() {
loadSkin(platformSkinPath, "platformskin.swf");
}
#if defined(_WINDOWS64) || defined(__linux__)
#if 1
#if defined(_WINDOWS64)
// 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;
}
#if defined(_WINDOWS64) || defined(__linux__)
#if 1
// 4J Stu - Don't load on a thread on windows. I haven't investigated this
// in detail, so a quick fix
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
// start with
#if !(defined(_WINDOWS64) || defined(__linux__))
#if 0
controller->NavigateBack(0, false, eUIScene_COUNT, eUILayer_Tooltips);
#endif
}
@ -969,13 +969,8 @@ void UIController::setupCustomDrawGameState() {
m_customRenderingClearRect.top = LONG_MAX;
m_customRenderingClearRect.bottom = LONG_MIN;
#if defined(_WINDOWS64)
PlatformRenderer.StartFrame();
gdraw_D3D11_setViewport_4J();
#elif defined(__linux__)
PlatformRenderer.StartFrame();
#endif
PlatformRenderer.Set_matrixDirty();
// 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() {
#if defined(__linux__)
PlatformRenderer.Clear(GL_DEPTH_BUFFER_BIT);
#else
PlatformRenderer.Clear(GL_DEPTH_BUFFER_BIT, &m_customRenderingClearRect);
#endif
// glClear(GL_DEPTH_BUFFER_BIT);
glDepthMask(false);
glDisable(GL_ALPHA_TEST);
@ -2257,7 +2248,7 @@ UIController::RequestContentRestrictedMessageBox(
}
if (message == -1) {
#if defined(_WINDOWS64) || defined(__linux__)
#if 1
// IDS_CONTENT_RESTRICTION doesn't exist on XB1
message = IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE;
#else
@ -2283,7 +2274,7 @@ void UIController::setFontCachingCalculationBuffer(int length) {
draw call is not large enough, Iggy will crash or otherwise behave
incorrectly.
*/
#if defined(_WIN64) || defined(__linux__)
#if INTPTR_MAX == INT64_MAX
static const int CHAR_SIZE = 24;
#else
static const int CHAR_SIZE = 16;

View file

@ -10,17 +10,10 @@
#include "util/Timer.h"
#ifdef __linux__
#include "app/common/Iggy/include/iggy.h"
#ifndef _ENABLEIGGY
#include "app/common/Iggy/iggy_stubs.h"
#endif
#elif defined(_WINDOWS64)
#include "app/windows/Iggy/include/iggy.h"
#endif
#include "UIGroup.h"
#include "app/common/UI/All Platforms/IUIController.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_TextInput.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_DebugOptions.cpp
common/UI/Scenes/Debug/UIScene_DebugOverlay.cpp

View file

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

View file

@ -460,14 +460,15 @@ void ItemInHandRenderer::render(float a) {
std::floor(player->z), 0);
int u = col % 65536;
int v = col / 65536;
#if defined(__linux__)
// 4jcraft
static int lightmapLogCount = 0;
if (lightmapLogCount < 8) {
++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);
}
#endif
glMultiTexCoord2f(GL_TEXTURE1, u / 1.0f, v / 1.0f);
glColor4f(1, 1, 1, 1);
}

View file

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

View file

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