mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-11 13:47:13 +00:00
remove implicit stdafx inclusion from Client
This commit is contained in:
parent
1a2cfd5199
commit
6ef973ef8b
|
|
@ -637,70 +637,6 @@ enum EHTMLFontSize {
|
|||
eHTMLSize_COUNT,
|
||||
};
|
||||
|
||||
enum EControllerActions {
|
||||
ACTION_MENU_A,
|
||||
ACTION_MENU_B,
|
||||
ACTION_MENU_X,
|
||||
ACTION_MENU_Y,
|
||||
ACTION_MENU_UP,
|
||||
ACTION_MENU_DOWN,
|
||||
ACTION_MENU_RIGHT,
|
||||
ACTION_MENU_LEFT,
|
||||
ACTION_MENU_PAGEUP,
|
||||
ACTION_MENU_PAGEDOWN,
|
||||
ACTION_MENU_RIGHT_SCROLL,
|
||||
ACTION_MENU_LEFT_SCROLL,
|
||||
ACTION_MENU_STICK_PRESS,
|
||||
ACTION_MENU_OTHER_STICK_PRESS,
|
||||
ACTION_MENU_OTHER_STICK_UP,
|
||||
ACTION_MENU_OTHER_STICK_DOWN,
|
||||
ACTION_MENU_OTHER_STICK_LEFT,
|
||||
ACTION_MENU_OTHER_STICK_RIGHT,
|
||||
ACTION_MENU_PAUSEMENU,
|
||||
|
||||
ACTION_MENU_OK,
|
||||
ACTION_MENU_CANCEL,
|
||||
// 4jcraft added, off by one
|
||||
ACTION_MAX_MENU = ACTION_MENU_CANCEL + 1,
|
||||
|
||||
MINECRAFT_ACTION_JUMP,
|
||||
MINECRAFT_ACTION_FORWARD,
|
||||
MINECRAFT_ACTION_BACKWARD,
|
||||
MINECRAFT_ACTION_LEFT,
|
||||
MINECRAFT_ACTION_RIGHT,
|
||||
MINECRAFT_ACTION_LOOK_LEFT,
|
||||
MINECRAFT_ACTION_LOOK_RIGHT,
|
||||
MINECRAFT_ACTION_LOOK_UP,
|
||||
MINECRAFT_ACTION_LOOK_DOWN,
|
||||
MINECRAFT_ACTION_USE,
|
||||
MINECRAFT_ACTION_ACTION,
|
||||
MINECRAFT_ACTION_LEFT_SCROLL,
|
||||
MINECRAFT_ACTION_RIGHT_SCROLL,
|
||||
MINECRAFT_ACTION_INVENTORY,
|
||||
MINECRAFT_ACTION_PAUSEMENU,
|
||||
MINECRAFT_ACTION_DROP,
|
||||
MINECRAFT_ACTION_SNEAK_TOGGLE,
|
||||
MINECRAFT_ACTION_SPRINT,
|
||||
MINECRAFT_ACTION_CRAFTING,
|
||||
MINECRAFT_ACTION_RENDER_THIRD_PERSON,
|
||||
MINECRAFT_ACTION_GAME_INFO,
|
||||
MINECRAFT_ACTION_DPAD_LEFT,
|
||||
MINECRAFT_ACTION_DPAD_RIGHT,
|
||||
MINECRAFT_ACTION_DPAD_UP,
|
||||
MINECRAFT_ACTION_DPAD_DOWN,
|
||||
|
||||
MINECRAFT_ACTION_MAX,
|
||||
|
||||
// These 4 aren't mapped to the input manager directly but are created from
|
||||
// the dpad controls if required in Minecraft::run_middle Don't use them
|
||||
// with the input manager directly, just through
|
||||
// LocalPlayer::ullButtonsPressed
|
||||
MINECRAFT_ACTION_SPAWN_CREEPER,
|
||||
MINECRAFT_ACTION_CHANGE_SKIN,
|
||||
MINECRAFT_ACTION_FLY_TOGGLE,
|
||||
MINECRAFT_ACTION_RENDER_DEBUG
|
||||
};
|
||||
|
||||
enum eMCLang {
|
||||
eMCLang_null = 0,
|
||||
eMCLang_enUS,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include <cstdint>
|
||||
|
||||
#include "4J.Storage/4J_Storage.h"
|
||||
#include "Minecraft.World/x64headers/extraX64.h"
|
||||
|
||||
typedef struct {
|
||||
wchar_t* wchFilename;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
#include "Minecraft.Client/Header Files/SkinBox.h"
|
||||
#include "Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h"
|
||||
#include "Minecraft.World/net/minecraft/world/entity/item/MinecartHopper.h"
|
||||
#include "Minecraft.Client/Common/App_structs.h"
|
||||
#include "Minecraft.World/x64headers/extraX64.h"
|
||||
|
||||
typedef struct _JoinFromInviteData {
|
||||
std::uint32_t dwUserIndex; // dwUserIndex
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// using namespace std;
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
class DLCPack;
|
||||
class DLCSkinFile;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,11 @@
|
|||
#include <qnet.h>
|
||||
#endif
|
||||
#include "Minecraft.World/ConsoleHelpers/C4JThread.h"
|
||||
#include "Minecraft.World/x64headers/extraX64.h"
|
||||
#include "NetworkPlayerInterface.h"
|
||||
#include "SessionInfo.h"
|
||||
|
||||
|
||||
class ClientConnection;
|
||||
class Minecraft;
|
||||
class CGameNetworkManager;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include "TutorialEnum.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
|
||||
// #define TUTORIAL_HINT_DELAY_TIME 14000 // How long we should wait from
|
||||
// displaying one hint to the next #define TUTORIAL_DISPLAY_MESSAGE_TIME 7000
|
||||
|
|
@ -17,8 +18,10 @@
|
|||
// // 0-24000
|
||||
// #define TUTORIAL_FREEZE_TIME_VALUE 8000
|
||||
|
||||
class UIScene;
|
||||
class Level;
|
||||
class CXuiScene;
|
||||
class Player;
|
||||
|
||||
class Tutorial {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "UIEnums.h"
|
||||
#include "Minecraft.World/Header Files/SoundTypes.h"
|
||||
|
||||
// 4J Stu - An interface class that defines all the public functions that we use
|
||||
// within the game code. This allows us to build the Xbox 360 version without
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include "Minecraft.Client/Common/Source Files/Tutorial/TutorialEnum.h"
|
||||
#include "UIStructs.h"
|
||||
|
||||
class HtmlString;
|
||||
class ItemInstance;
|
||||
|
||||
// Uncomment to enable tap input detection to jump 1 slot. Doesn't work
|
||||
// particularly well yet, and I feel the system does not need it. Would probably
|
||||
// be required if we decide to slow down the pointer movement. 4J Stu - There
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@
|
|||
// #pragma message("UIStructs.h")
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
|
||||
#include "UIEnums.h"
|
||||
#include "Minecraft.Client/Common/App_Defines.h"
|
||||
#include "Minecraft.World/ConsoleHelpers/C4JThread.h"
|
||||
#include "4J.Storage/4J_Storage.h"
|
||||
|
||||
class Container;
|
||||
|
|
@ -21,6 +23,8 @@ class EntityHorse;
|
|||
class BeaconTileEntity;
|
||||
class Slot;
|
||||
class AbstractContainerMenu;
|
||||
class Level;
|
||||
class FriendSessionInfo;
|
||||
|
||||
// 4J Stu - Structs shared by Iggy and Xui scenes.
|
||||
typedef struct _UIVec2D {
|
||||
|
|
@ -218,8 +222,8 @@ typedef struct _SaveListDetails {
|
|||
saveId = 0;
|
||||
pbThumbnailData = nullptr;
|
||||
dwThumbnailSize = 0;
|
||||
ZeroMemory(UTF8SaveName, 128);
|
||||
ZeroMemory(UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH);
|
||||
std::memset(UTF8SaveName, 0, 128);
|
||||
std::memset(UTF8SaveFilename, 0, MAX_SAVEFILENAME_LENGTH);
|
||||
}
|
||||
|
||||
} SaveListDetails;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,15 @@
|
|||
#include <cstdint>
|
||||
#include <mutex>
|
||||
|
||||
#ifdef __linux__
|
||||
#include "Minecraft.Client/Linux/Iggy/include/iggy.h"
|
||||
#include "Minecraft.Client/Linux/Stubs/d3d11_stubs.h"
|
||||
#elif defined(_WINDOWS64)
|
||||
#include "Minecraft.Client/Windows64/Iggy/include/iggy.h"
|
||||
#endif
|
||||
|
||||
#include "4J.Common/4J_InputActions.h"
|
||||
|
||||
#include "Minecraft.Client/Common/Source Files/UI/All Platforms/IUIController.h"
|
||||
#include "Minecraft.Client/Common/Source Files/UI/All Platforms/UIEnums.h"
|
||||
#include "UIGroup.h"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
class Graphics;
|
||||
class DLCPack;
|
||||
|
|
|
|||
|
|
@ -42,46 +42,3 @@ uint32_t XUserAreUsersFriends(uint32_t dwUserIndex, PPlayerUID pXuids,
|
|||
uint32_t dwXuidCount, bool* pfResult,
|
||||
void* pOverlapped);
|
||||
|
||||
class XSOCIAL_IMAGEPOSTPARAMS {};
|
||||
|
||||
class XSOCIAL_LINKPOSTPARAMS {};
|
||||
|
||||
typedef struct _XSESSION_VIEW_PROPERTIES {
|
||||
uint32_t dwViewId;
|
||||
uint32_t dwNumProperties;
|
||||
XUSER_PROPERTY* pProperties;
|
||||
} XSESSION_VIEW_PROPERTIES;
|
||||
|
||||
#define XUSER_STATS_ATTRS_IN_SPEC 1
|
||||
|
||||
typedef struct _XUSER_STATS_SPEC {
|
||||
uint32_t dwViewId;
|
||||
uint32_t dwNumColumnIds;
|
||||
uint16_t rgwColumnIds[XUSER_STATS_ATTRS_IN_SPEC];
|
||||
} XUSER_STATS_SPEC, *PXUSER_STATS_SPEC;
|
||||
|
||||
typedef struct _XUSER_STATS_COLUMN {
|
||||
uint16_t wColumnId;
|
||||
XUSER_DATA Value;
|
||||
} XUSER_STATS_COLUMN, *PXUSER_STATS_COLUMN;
|
||||
|
||||
typedef struct _XUSER_STATS_ROW {
|
||||
PlayerUID xuid;
|
||||
uint32_t dwRank;
|
||||
int64_t i64Rating;
|
||||
char szGamertag[XUSER_NAME_SIZE];
|
||||
uint32_t dwNumColumns;
|
||||
PXUSER_STATS_COLUMN pColumns;
|
||||
} XUSER_STATS_ROW, *PXUSER_STATS_ROW;
|
||||
|
||||
typedef struct _XUSER_STATS_VIEW {
|
||||
uint32_t dwViewId;
|
||||
uint32_t dwTotalViewRows;
|
||||
uint32_t dwNumRows;
|
||||
PXUSER_STATS_ROW pRows;
|
||||
} XUSER_STATS_VIEW, *PXUSER_STATS_VIEW;
|
||||
|
||||
typedef struct _XUSER_STATS_READ_RESULTS {
|
||||
uint32_t dwNumViews;
|
||||
PXUSER_STATS_VIEW pViews;
|
||||
} XUSER_STATS_READ_RESULTS, *PXUSER_STATS_READ_RESULTS;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ static const int GL_FLAT = 0x1D00;
|
|||
class FloatBuffer;
|
||||
class IntBuffer;
|
||||
class ByteBuffer;
|
||||
class Minecraft;
|
||||
|
||||
void glGenTextures(IntBuffer*);
|
||||
int glGenTextures();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@
|
|||
|
||||
#include <cassert>
|
||||
#include <cstdarg>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define TRUE true
|
||||
#define FALSE false
|
||||
|
|
@ -208,13 +211,6 @@ typedef enum _GET_FILEEX_INFO_LEVELS {
|
|||
typedef void* XMEMCOMPRESSION_CONTEXT;
|
||||
typedef void* XMEMDECOMPRESSION_CONTEXT;
|
||||
|
||||
// internal search state for FindFirstFile/FindNextFile
|
||||
typedef struct _LINUXSTUBS_FIND_HANDLE {
|
||||
DIR* dir;
|
||||
char dirpath[MAX_PATH];
|
||||
char pattern[MAX_PATH];
|
||||
} _LINUXSTUBS_FIND_HANDLE;
|
||||
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-systemtime
|
||||
typedef struct _SYSTEMTIME {
|
||||
WORD wYear;
|
||||
|
|
@ -286,23 +282,6 @@ static inline FILETIME _TimeToFileTime(time_t t) {
|
|||
return ft;
|
||||
}
|
||||
|
||||
// internal helper: fill WIN32_FIND_DATAA from stat + name
|
||||
static inline void _FillFindData(const char* name, const struct stat* st,
|
||||
WIN32_FIND_DATAA* out) {
|
||||
memset(out, 0, sizeof(*out));
|
||||
out->dwFileAttributes =
|
||||
S_ISDIR(st->st_mode) ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL;
|
||||
if (!(st->st_mode & S_IWUSR))
|
||||
out->dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
|
||||
if (name[0] == '.') out->dwFileAttributes |= FILE_ATTRIBUTE_HIDDEN;
|
||||
out->ftCreationTime = _TimeToFileTime(st->st_mtime);
|
||||
out->ftLastAccessTime = _TimeToFileTime(st->st_atime);
|
||||
out->ftLastWriteTime = _TimeToFileTime(st->st_mtime);
|
||||
out->nFileSizeHigh = (DWORD)((st->st_size >> 32) & 0xFFFFFFFF);
|
||||
out->nFileSizeLow = (DWORD)(st->st_size & 0xFFFFFFFF);
|
||||
strncpy(out->cFileName, name, MAX_PATH - 1);
|
||||
}
|
||||
|
||||
static inline HANDLE CreateFileA(const char* lpFileName, DWORD dwDesiredAccess,
|
||||
DWORD dwShareMode, void* lpSecurityAttributes,
|
||||
DWORD dwCreationDisposition,
|
||||
|
|
@ -430,46 +409,6 @@ static inline DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove,
|
|||
return (DWORD)(result & 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
static inline DWORD GetFileAttributesA(const char* lpFileName) {
|
||||
struct stat st{};
|
||||
if (stat(lpFileName, &st) != 0) return INVALID_FILE_ATTRIBUTES;
|
||||
DWORD attrs =
|
||||
S_ISDIR(st.st_mode) ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL;
|
||||
if (!(st.st_mode & S_IWUSR)) attrs |= FILE_ATTRIBUTE_READONLY;
|
||||
const char* base = strrchr(lpFileName, '/');
|
||||
base = base ? base + 1 : lpFileName;
|
||||
if (base[0] == '.') attrs |= FILE_ATTRIBUTE_HIDDEN;
|
||||
return attrs;
|
||||
}
|
||||
|
||||
static inline DWORD GetFileAttributes(const char* lpFileName) {
|
||||
return GetFileAttributesA(lpFileName);
|
||||
}
|
||||
|
||||
static inline bool GetFileAttributesExA(const char* lpFileName,
|
||||
GET_FILEEX_INFO_LEVELS fInfoLevelId,
|
||||
void* lpFileInformation) {
|
||||
if (fInfoLevelId != GetFileExInfoStandard || !lpFileInformation)
|
||||
return FALSE;
|
||||
struct stat st{};
|
||||
if (stat(lpFileName, &st) != 0) return FALSE;
|
||||
WIN32_FILE_ATTRIBUTE_DATA* out =
|
||||
(WIN32_FILE_ATTRIBUTE_DATA*)lpFileInformation;
|
||||
out->dwFileAttributes = GetFileAttributesA(lpFileName);
|
||||
out->ftCreationTime = _TimeToFileTime(st.st_mtime);
|
||||
out->ftLastAccessTime = _TimeToFileTime(st.st_atime);
|
||||
out->ftLastWriteTime = _TimeToFileTime(st.st_mtime);
|
||||
out->nFileSizeHigh = (DWORD)((st.st_size >> 32) & 0xFFFFFFFF);
|
||||
out->nFileSizeLow = (DWORD)(st.st_size & 0xFFFFFFFF);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static inline bool GetFileAttributesEx(const char* lpFileName,
|
||||
GET_FILEEX_INFO_LEVELS fInfoLevelId,
|
||||
void* lpFileInformation) {
|
||||
return GetFileAttributesExA(lpFileName, fInfoLevelId, lpFileInformation);
|
||||
}
|
||||
|
||||
static inline bool CreateDirectoryA(const char* lpPathName,
|
||||
void* lpSecurityAttributes) {
|
||||
return mkdir(lpPathName, 0755) == 0;
|
||||
|
|
@ -498,107 +437,6 @@ static inline bool MoveFile(const char* lpExistingFileName,
|
|||
return MoveFileA(lpExistingFileName, lpNewFileName);
|
||||
}
|
||||
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirstfilea
|
||||
static inline HANDLE FindFirstFileA(const char* lpFileName,
|
||||
WIN32_FIND_DATAA* lpFindFileData) {
|
||||
if (!lpFileName || !lpFindFileData) return INVALID_HANDLE_VALUE;
|
||||
|
||||
char dirpath[MAX_PATH], pattern[MAX_PATH];
|
||||
const char* sep = strrchr(lpFileName, '/');
|
||||
if (sep) {
|
||||
size_t len = sep - lpFileName;
|
||||
if (len >= MAX_PATH) return INVALID_HANDLE_VALUE;
|
||||
strncpy(dirpath, lpFileName, len);
|
||||
dirpath[len] = '\0';
|
||||
strncpy(pattern, sep + 1, MAX_PATH - 1);
|
||||
} else {
|
||||
strncpy(dirpath, ".", MAX_PATH - 1);
|
||||
strncpy(pattern, lpFileName, MAX_PATH - 1);
|
||||
}
|
||||
|
||||
DIR* dir = opendir(dirpath);
|
||||
if (!dir) return INVALID_HANDLE_VALUE;
|
||||
|
||||
_LINUXSTUBS_FIND_HANDLE* fh =
|
||||
(_LINUXSTUBS_FIND_HANDLE*)malloc(sizeof(_LINUXSTUBS_FIND_HANDLE));
|
||||
if (!fh) {
|
||||
closedir(dir);
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
fh->dir = dir;
|
||||
strncpy(fh->dirpath, dirpath, MAX_PATH - 1);
|
||||
strncpy(fh->pattern, pattern, MAX_PATH - 1);
|
||||
|
||||
struct dirent* ent;
|
||||
while ((ent = readdir(fh->dir)) != nullptr) {
|
||||
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
|
||||
continue;
|
||||
if (fnmatch(fh->pattern, ent->d_name, 0) == 0) {
|
||||
char fullpath[MAX_PATH * 2];
|
||||
snprintf(fullpath, sizeof(fullpath), "%s/%s", fh->dirpath,
|
||||
ent->d_name);
|
||||
struct stat st{};
|
||||
if (stat(fullpath, &st) == 0)
|
||||
_FillFindData(ent->d_name, &st, lpFindFileData);
|
||||
else {
|
||||
memset(lpFindFileData, 0, sizeof(*lpFindFileData));
|
||||
strncpy(lpFindFileData->cFileName, ent->d_name, MAX_PATH - 1);
|
||||
}
|
||||
return (HANDLE)fh;
|
||||
}
|
||||
}
|
||||
|
||||
closedir(fh->dir);
|
||||
free(fh);
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
static inline HANDLE FindFirstFile(const char* lpFileName,
|
||||
WIN32_FIND_DATAA* lpFindFileData) {
|
||||
return FindFirstFileA(lpFileName, lpFindFileData);
|
||||
}
|
||||
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findnextfilea
|
||||
static inline bool FindNextFileA(HANDLE hFindFile,
|
||||
WIN32_FIND_DATAA* lpFindFileData) {
|
||||
if (hFindFile == INVALID_HANDLE_VALUE || !lpFindFileData) return FALSE;
|
||||
_LINUXSTUBS_FIND_HANDLE* fh = (_LINUXSTUBS_FIND_HANDLE*)hFindFile;
|
||||
|
||||
struct dirent* ent;
|
||||
while ((ent = readdir(fh->dir)) != nullptr) {
|
||||
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
|
||||
continue;
|
||||
if (fnmatch(fh->pattern, ent->d_name, 0) == 0) {
|
||||
char fullpath[MAX_PATH * 2];
|
||||
snprintf(fullpath, sizeof(fullpath), "%s/%s", fh->dirpath,
|
||||
ent->d_name);
|
||||
struct stat st{};
|
||||
if (stat(fullpath, &st) == 0)
|
||||
_FillFindData(ent->d_name, &st, lpFindFileData);
|
||||
else {
|
||||
memset(lpFindFileData, 0, sizeof(*lpFindFileData));
|
||||
strncpy(lpFindFileData->cFileName, ent->d_name, MAX_PATH - 1);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static inline bool FindNextFile(HANDLE hFindFile,
|
||||
WIN32_FIND_DATAA* lpFindFileData) {
|
||||
return FindNextFileA(hFindFile, lpFindFileData);
|
||||
}
|
||||
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findclose
|
||||
static inline bool FindClose(HANDLE hFindFile) {
|
||||
if (hFindFile == INVALID_HANDLE_VALUE) return FALSE;
|
||||
_LINUXSTUBS_FIND_HANDLE* fh = (_LINUXSTUBS_FIND_HANDLE*)hFindFile;
|
||||
closedir(fh->dir);
|
||||
free(fh);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// internal helper: convert FILETIME (100ns since 1601) to time_t (seconds since
|
||||
// 1970)
|
||||
static inline time_t _FileTimeToTimeT(const FILETIME& ft) {
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ client = executable(
|
|||
+ [
|
||||
'-DUNICODE',
|
||||
'-D_UNICODE',
|
||||
'-include', meson.current_source_dir() / 'Header Files/stdafx.h',
|
||||
# '-include', meson.current_source_dir() / 'Header Files/stdafx.h',
|
||||
],
|
||||
c_args: global_cpp_defs + ['-DUNICODE', '-D_UNICODE'],
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@ zPlayerOffs = position->get(2);
|
|||
// this is just working out how to get a (0,0,0) point in clip space to pass
|
||||
// into the inverted combined model/view/projection matrix, so we just need
|
||||
// to get this matrix and get its translation as an equivalent.
|
||||
XMMATRIX _modelview, _proj, _final, _invert;
|
||||
XMVECTOR _det;
|
||||
XMFLOAT4 trans;
|
||||
DirectX::XMMATRIX _modelview, _proj, _final, _invert;
|
||||
DirectX::XMVECTOR _det;
|
||||
DirectX::XMFLOAT4 trans;
|
||||
|
||||
memcpy(&_modelview, modelview->_getDataPointer(), 64);
|
||||
memcpy(&_proj, projection->_getDataPointer(), 64);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include <mutex>
|
||||
|
||||
class Timer;
|
||||
class MultiPlayerLevel;
|
||||
class LevelRenderer;
|
||||
|
|
@ -37,10 +38,13 @@ class ItemInHandRenderer;
|
|||
class LevelSettings;
|
||||
class ColourTable;
|
||||
class MultiPlayerGameMode;
|
||||
class LivingEntity;
|
||||
|
||||
#include "java/File.h"
|
||||
#include "Minecraft.World/net/minecraft/network/packet/DisconnectPacket.h"
|
||||
#include "Minecraft.World/ConsoleHelpers/C4JThread.h"
|
||||
#include "Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h"
|
||||
#include "4J.Common/4J_Compat.h"
|
||||
|
||||
#if defined(linux)
|
||||
#undef linux
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
|
||||
#include "Minecraft.Client/net/minecraft/server/MinecraftServer.h"
|
||||
#include "4J_Profile.h"
|
||||
#include "4J_Input.h"
|
||||
#include "Minecraft.Client/Common/App_enums.h"
|
||||
#include "Minecraft.Client/Common/Source Files/Network/GameNetworkManager.h"
|
||||
#include "Minecraft.Client/Linux/Linux_App.h"
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include "java/JavaMath.h"
|
||||
#include "4J.Common/4J_Compat.h"
|
||||
#include "4J_Profile.h"
|
||||
#include "4J_Input.h"
|
||||
#include "Minecraft.Client/Common/Source Files/Audio/SoundEngine.h"
|
||||
#include "Minecraft.Client/Common/Source Files/Console_Debug_enum.h"
|
||||
#include "Minecraft.Client/Common/Source Files/Network/GameNetworkManager.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "Input.h"
|
||||
#include "LocalPlayer.h"
|
||||
#include "4J_Input.h"
|
||||
#include "4J.Common/4J_InputActions.h"
|
||||
#include "Minecraft.Client/Common/App_enums.h"
|
||||
#include "Minecraft.Client/Linux/Linux_App.h"
|
||||
#include "Minecraft.World/net/minecraft/world/entity/player/Abilities.h"
|
||||
|
|
@ -112,7 +113,7 @@ void Input::tick(LocalPlayer* player) {
|
|||
}
|
||||
tx = ty = 0.0f;
|
||||
}
|
||||
player->interpolateTurn(tx * abs(tx) * turnSpeed, ty * abs(ty) * turnSpeed);
|
||||
player->interpolateTurn(tx * std::abs(tx) * turnSpeed, ty * std::abs(ty) * turnSpeed);
|
||||
|
||||
// jumping = controller.isButtonPressed(0);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ void VillagerGolemRenderer::setupRotations(std::shared_ptr<LivingEntity> _mob,
|
|||
float p = 13;
|
||||
float wp = mob->walkAnimPos - mob->walkAnimSpeed * (1 - a) + 6;
|
||||
float triangleWave =
|
||||
(abs(fmod(wp, p) - p * 0.5f) - p * 0.25f) / (p * 0.25f);
|
||||
(std::abs(std::fmod(wp, p) - p * 0.5f) - p * 0.25f) / (p * 0.25f);
|
||||
glRotatef(6.5f * triangleWave, 0, 0, 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "Minecraft.Client/Common/Source Files/DLC/DLCAudioFile.h"
|
||||
#include "4J_Profile.h"
|
||||
#include "4J_Storage.h"
|
||||
#include "4J_Input.h"
|
||||
#include "Minecraft.Client/Header Files/BufferedImage.h"
|
||||
#include "Minecraft.Client/Common/App_enums.h"
|
||||
#include "Minecraft.Client/Common/Source Files/Audio/SoundEngine.h"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
#include "Minecraft.World/ConsoleHelpers/ArrayWithLength.h"
|
||||
#include "Minecraft.World/net/minecraft/SharedConstants.h"
|
||||
#include "Minecraft.World/ConsoleHelpers/C4JThread.h"
|
||||
#include "Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h"
|
||||
#include "Minecraft.World/net/minecraft/world/level/chunk/ChunkSource.h"
|
||||
|
||||
class ServerConnection;
|
||||
class Settings;
|
||||
|
|
@ -14,12 +16,12 @@ class EntityTracker;
|
|||
class ConsoleInput;
|
||||
class ConsoleCommands;
|
||||
class LevelStorageSource;
|
||||
class ChunkSource;
|
||||
class INetworkPlayer;
|
||||
class LevelRuleset;
|
||||
class LevelType;
|
||||
class ProgressRenderer;
|
||||
class CommandDispatcher;
|
||||
class LevelGenerationOptions;
|
||||
|
||||
#define MINECRAFT_SERVER_SLOW_QUEUE_DELAY 250
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <list>
|
||||
|
||||
#include "Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h"
|
||||
#include "Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.ContainerListener.h"
|
||||
#include "Minecraft.World/net/minecraft/world/level/ChunkPos.h"
|
||||
|
||||
class PlayerConnection;
|
||||
class MinecraftServer;
|
||||
class ServerPlayerGameMode;
|
||||
|
|
@ -15,6 +19,7 @@ class MinecartHopper;
|
|||
class BeaconTileEntity;
|
||||
class EntityHorse;
|
||||
class Merchant;
|
||||
class ServerLevel;
|
||||
|
||||
class ServerPlayer : public Player,
|
||||
public net_minecraft_world_inventory::ContainerListener {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "java/System.h"
|
||||
#include "Minecraft.World/ConsoleHelpers/Definitions.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
// The first 4 bytes is the location of the header (the header itself is at the
|
||||
// end of the file) Then 4 bytes for the size of the header Then 2 bytes for the
|
||||
|
|
@ -106,7 +109,7 @@ public:
|
|||
|
||||
unsigned int currentFilePointer;
|
||||
|
||||
FileEntry() { ZeroMemory(&data, sizeof(FileEntrySaveData)); }
|
||||
FileEntry() { memset(&data, 0, sizeof(FileEntrySaveData)); }
|
||||
|
||||
FileEntry(wchar_t name[64], unsigned int length, unsigned int startOffset) {
|
||||
data.length = length;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
std::wstring toLower(const std::wstring& a);
|
||||
std::wstring trimString(const std::wstring& a);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
|
||||
class Random;
|
||||
|
||||
class Mth {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "java/Random.h"
|
||||
|
||||
// 4J - this WeighedRandomItem class was a nested static class within
|
||||
// WeighedRandom, but we need to be able to refer to it externally
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeModifier.h"
|
||||
#include "Minecraft.Client/Common/App_enums.h"
|
||||
|
||||
class Mob;
|
||||
class MobEffectInstance;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
#include "nbt/ListTag.h"
|
||||
#include "nbt/DoubleTag.h"
|
||||
#include "nbt/FloatTag.h"
|
||||
|
||||
#include "java/Class.h"
|
||||
|
||||
#include "Minecraft.World/net/minecraft/world/phys/Vec3.h"
|
||||
#include "Minecraft.World/ConsoleHelpers/Definitions.h"
|
||||
#include "Minecraft.World/net/minecraft/world/phys/AABB.h"
|
||||
|
|
@ -22,6 +25,9 @@ class Level;
|
|||
class CompoundTag;
|
||||
class DamageSource;
|
||||
class Explosion;
|
||||
class Tesselator;
|
||||
class Tile;
|
||||
class ItemInstance;
|
||||
|
||||
// 4J Stu Added this mainly to allow is to record telemetry for player deaths
|
||||
enum EEntityDamageType {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "Entity.h"
|
||||
#include "MobType.h"
|
||||
|
|
@ -17,6 +18,7 @@ class Attribute;
|
|||
class MobEffect;
|
||||
class HitResult;
|
||||
class Vec3;
|
||||
class Icon;
|
||||
|
||||
class LivingEntity : public Entity {
|
||||
friend class MobSpawner;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class Sensing;
|
|||
class Icon;
|
||||
class Pos;
|
||||
class MobGroupData;
|
||||
class Item;
|
||||
|
||||
class Mob : public LivingEntity {
|
||||
friend class MobSpawner;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "Minecraft.World/net/minecraft/world/Container.h"
|
||||
#include "Minecraft.World/net/minecraft/world/entity/ai/attributes/Attribute.h"
|
||||
#include "UseAnim.h"
|
||||
#include "Rarity.h"
|
||||
|
||||
|
|
@ -19,6 +20,8 @@ class BowItem;
|
|||
class FishingRodItem;
|
||||
class EnchantedBookItem;
|
||||
class EmptyMapItem;
|
||||
class LivingEntity;
|
||||
class HtmlString;
|
||||
|
||||
#define ITEM_ICON_COLUMNS 16
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ class MapItem;
|
|||
class ItemFrame;
|
||||
class Icon;
|
||||
class HtmlString;
|
||||
class Tile;
|
||||
class Item;
|
||||
|
||||
// 4J Stu - While this is not really an abstract class, we don't want to make
|
||||
// new instances of it, mainly because there are too many ctors and that doesn't
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include "Minecraft.World/net/minecraft/world/level/LevelSource.h"
|
||||
#include "Minecraft.World/net/minecraft/world/entity/Mob.h"
|
||||
#include "Minecraft.World/net/minecraft/util/WeighedRandom.h"
|
||||
#include "Minecraft.Client/Common/App_enums.h"
|
||||
|
||||
class Feature;
|
||||
class MobCategory;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include "Minecraft.World/net/minecraft/world/level/biome/Biome.h"
|
||||
class ProgressListener;
|
||||
class TilePos;
|
||||
class LevelChunk;
|
||||
|
||||
// The maximum number of chunks that we can store
|
||||
#ifdef _LARGE_WORLDS
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <list>
|
||||
|
||||
#include "Minecraft.World/net/minecraft/util/WeighedRandom.h"
|
||||
#include "BoundingBox.h"
|
||||
#include "StructureFeatureIO.h"
|
||||
|
|
|
|||
|
|
@ -180,18 +180,6 @@ typedef struct _XSESSION_SEARCHRESULT_HEADER {
|
|||
XSESSION_SEARCHRESULT* pResults;
|
||||
} XSESSION_SEARCHRESULT_HEADER, *PXSESSION_SEARCHRESULT_HEADER;
|
||||
|
||||
typedef struct _XONLINE_FRIEND {
|
||||
PlayerUID xuid;
|
||||
char szGamertag[XUSER_NAME_SIZE];
|
||||
uint32_t dwFriendState;
|
||||
SessionID sessionID;
|
||||
uint32_t dwTitleID;
|
||||
FILETIME ftUserTime;
|
||||
SessionID xnkidInvite;
|
||||
FILETIME gameinviteTime;
|
||||
uint32_t cchRichPresence;
|
||||
} XONLINE_FRIEND, *PXONLINE_FRIEND;
|
||||
|
||||
class IQNetCallbacks {};
|
||||
class IQNetGameSearch {};
|
||||
|
||||
|
|
@ -301,30 +289,6 @@ typedef struct _XMEMCODEC_PARAMETERS_LZX {
|
|||
void XMemDestroyCompressionContext(XMEMCOMPRESSION_CONTEXT Context);
|
||||
void XMemDestroyDecompressionContext(XMEMDECOMPRESSION_CONTEXT Context);
|
||||
|
||||
typedef struct {
|
||||
uint8_t type;
|
||||
union {
|
||||
int32_t nData;
|
||||
int64_t i64Data;
|
||||
double dblData;
|
||||
struct {
|
||||
uint32_t cbData;
|
||||
wchar_t* pwszData;
|
||||
} string;
|
||||
float fData;
|
||||
struct {
|
||||
uint32_t cbData;
|
||||
uint8_t* pbData;
|
||||
} binary;
|
||||
FILETIME ftData;
|
||||
};
|
||||
} XUSER_DATA, *PXUSER_DATA;
|
||||
|
||||
typedef struct {
|
||||
uint32_t dwPropertyId;
|
||||
XUSER_DATA value;
|
||||
} XUSER_PROPERTY, *PXUSER_PROPERTY;
|
||||
|
||||
const int XC_LANGUAGE_ENGLISH = 0x01;
|
||||
const int XC_LANGUAGE_JAPANESE = 0x02;
|
||||
const int XC_LANGUAGE_GERMAN = 0x03;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "java/Class.h"
|
||||
|
||||
// Java doesn't have a default hash value for ints, however, the hashmap itself
|
||||
// does some "supplemental" hashing, so our ints actually get hashed by code as
|
||||
// implemented below. std templates *do* have a standard hash for ints, but it
|
||||
|
|
|
|||
Loading…
Reference in a new issue