mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-22 22:22:53 +00:00
remove redundant stubs already handled by PR #33
This commit is contained in:
parent
a75b4cf0b2
commit
3a9af73c63
|
|
@ -1955,15 +1955,4 @@
|
|||
#define IDS_YOU_DIED 1953
|
||||
#define IDS_YOU_HAVE 1954
|
||||
#define IDS_ZOMBIE 1955
|
||||
|
||||
#ifdef __linux__
|
||||
#ifndef IDS_ERROR_NETWORK_TITLE
|
||||
#define IDS_ERROR_NETWORK_TITLE IDS_ERROR_NETWORK
|
||||
#endif
|
||||
#ifndef IDS_ONLINE_SERVICE_TITLE
|
||||
#define IDS_ONLINE_SERVICE_TITLE IDS_ERROR_NETWORK
|
||||
#endif
|
||||
#ifndef IDS_CONTENT_RESTRICTION
|
||||
#define IDS_CONTENT_RESTRICTION IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE
|
||||
#endif
|
||||
#endif
|
||||
// gone cuz previous implementation is better
|
||||
|
|
|
|||
159
Minecraft.Client/Platform/Linux/LinuxGL.cpp
Normal file
159
Minecraft.Client/Platform/Linux/LinuxGL.cpp
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
#ifdef __linux__
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#include <GL/glext.h>
|
||||
#include <dlfcn.h>
|
||||
#include "../../Minecraft.World/IntBuffer.h"
|
||||
#include "../../Minecraft.World/FloatBuffer.h"
|
||||
#include "../../Minecraft.World/ByteBuffer.h"
|
||||
|
||||
int glGenTextures()
|
||||
{
|
||||
GLuint id = 0;
|
||||
::glGenTextures(1, &id);
|
||||
return (int)id;
|
||||
}
|
||||
|
||||
void glGenTextures(IntBuffer *buf)
|
||||
{
|
||||
GLuint id = 0;
|
||||
::glGenTextures(1, &id);
|
||||
buf->put((int)id);
|
||||
buf->flip();
|
||||
}
|
||||
|
||||
void glDeleteTextures(int id)
|
||||
{
|
||||
GLuint uid = (GLuint)id;
|
||||
::glDeleteTextures(1, &uid);
|
||||
}
|
||||
|
||||
void glDeleteTextures(IntBuffer *buf)
|
||||
{
|
||||
int id = buf->get(0);
|
||||
GLuint uid = (GLuint)id;
|
||||
::glDeleteTextures(1, &uid);
|
||||
}
|
||||
|
||||
void glLight(int light, int pname, FloatBuffer *params)
|
||||
{
|
||||
::glLightfv((GLenum)light, (GLenum)pname, params->_getDataPointer());
|
||||
}
|
||||
|
||||
void glLightModel(int pname, FloatBuffer *params)
|
||||
{
|
||||
::glLightModelfv((GLenum)pname, params->_getDataPointer());
|
||||
}
|
||||
|
||||
void glGetFloat(int pname, FloatBuffer *params)
|
||||
{
|
||||
::glGetFloatv((GLenum)pname, params->_getDataPointer());
|
||||
}
|
||||
|
||||
void glTexGen(int coord, int pname, FloatBuffer *params)
|
||||
{
|
||||
::glTexGenfv((GLenum)coord, (GLenum)pname, params->_getDataPointer());
|
||||
}
|
||||
|
||||
void glFog(int pname, FloatBuffer *params)
|
||||
{
|
||||
::glFogfv((GLenum)pname, params->_getDataPointer());
|
||||
}
|
||||
|
||||
void glTexCoordPointer(int size, int type, FloatBuffer *pointer)
|
||||
{
|
||||
::glTexCoordPointer(size, (GLenum)type, 0, pointer->_getDataPointer());
|
||||
}
|
||||
|
||||
void glNormalPointer(int type, ByteBuffer *pointer)
|
||||
{
|
||||
::glNormalPointer((GLenum)type, 0, pointer->getBuffer());
|
||||
}
|
||||
|
||||
void glColorPointer(int size, bool normalized, int stride, ByteBuffer *pointer)
|
||||
{
|
||||
(void)normalized;
|
||||
::glColorPointer(size, GL_UNSIGNED_BYTE, stride, pointer->getBuffer());
|
||||
}
|
||||
|
||||
void glVertexPointer(int size, int type, FloatBuffer *pointer)
|
||||
{
|
||||
::glVertexPointer(size, (GLenum)type, 0, pointer->_getDataPointer());
|
||||
}
|
||||
|
||||
void glEndList(int)
|
||||
{
|
||||
::glEndList();
|
||||
}
|
||||
|
||||
void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer *pixels)
|
||||
{
|
||||
void *data = pixels ? pixels->getBuffer() : nullptr;
|
||||
::glTexImage2D((GLenum)target, level, internalformat, width, height, border, (GLenum)format, (GLenum)type, data);
|
||||
}
|
||||
|
||||
void glCallLists(IntBuffer *lists)
|
||||
{
|
||||
int count = lists->limit() - lists->position();
|
||||
::glCallLists(count, GL_INT, lists->getBuffer());
|
||||
}
|
||||
|
||||
static PFNGLGENQUERIESARBPROC _glGenQueriesARB = nullptr;
|
||||
static PFNGLBEGINQUERYARBPROC _glBeginQueryARB = nullptr;
|
||||
static PFNGLENDQUERYARBPROC _glEndQueryARB = nullptr;
|
||||
static PFNGLGETQUERYOBJECTUIVARBPROC _glGetQueryObjectuivARB = nullptr;
|
||||
static bool _queriesInitialized = false;
|
||||
|
||||
static void initQueryFuncs()
|
||||
{
|
||||
if (_queriesInitialized) return;
|
||||
_queriesInitialized = true;
|
||||
_glGenQueriesARB = (PFNGLGENQUERIESARBPROC)dlsym(RTLD_DEFAULT, "glGenQueriesARB");
|
||||
_glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)dlsym(RTLD_DEFAULT, "glBeginQueryARB");
|
||||
_glEndQueryARB = (PFNGLENDQUERYARBPROC)dlsym(RTLD_DEFAULT, "glEndQueryARB");
|
||||
_glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)dlsym(RTLD_DEFAULT, "glGetQueryObjectuivARB");
|
||||
}
|
||||
|
||||
void glGenQueriesARB(IntBuffer *buf)
|
||||
{
|
||||
initQueryFuncs();
|
||||
if (_glGenQueriesARB)
|
||||
{
|
||||
GLuint id = 0;
|
||||
_glGenQueriesARB(1, &id);
|
||||
buf->put((int)id);
|
||||
buf->flip();
|
||||
}
|
||||
}
|
||||
|
||||
void glBeginQueryARB(int target, int id)
|
||||
{
|
||||
initQueryFuncs();
|
||||
if (_glBeginQueryARB) _glBeginQueryARB((GLenum)target, (GLuint)id);
|
||||
}
|
||||
|
||||
void glEndQueryARB(int target)
|
||||
{
|
||||
initQueryFuncs();
|
||||
if (_glEndQueryARB) _glEndQueryARB((GLenum)target);
|
||||
}
|
||||
|
||||
void glGetQueryObjectuARB(int id, int pname, IntBuffer *params)
|
||||
{
|
||||
initQueryFuncs();
|
||||
if (_glGetQueryObjectuivARB)
|
||||
{
|
||||
GLuint val = 0;
|
||||
_glGetQueryObjectuivARB((GLuint)id, (GLenum)pname, &val);
|
||||
params->put((int)val);
|
||||
params->flip();
|
||||
}
|
||||
}
|
||||
|
||||
void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer *pixels)
|
||||
{
|
||||
::glReadPixels(x, y, width, height, (GLenum)format, (GLenum)type, pixels->getBuffer());
|
||||
}
|
||||
|
||||
#endif
|
||||
44
Minecraft.Client/Platform/Linux/linux_game_stubs.cpp
Normal file
44
Minecraft.Client/Platform/Linux/linux_game_stubs.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#ifdef __linux__
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "../stubs.h"
|
||||
#include "../Common/Consoles_App.h"
|
||||
|
||||
void Display::update() {}
|
||||
|
||||
int CMinecraftApp::GetTPConfigVal(WCHAR* pwchDataFile) { return 0; }
|
||||
|
||||
#include "../../Minecraft.World/x64headers/extraX64.h"
|
||||
|
||||
void PIXSetMarkerDeprecated(int a, const char* b, ...) {}
|
||||
|
||||
#include "../Xbox/Network/NetworkPlayerXbox.h"
|
||||
|
||||
NetworkPlayerXbox::NetworkPlayerXbox(IQNetPlayer* p) : m_qnetPlayer(p), m_pSocket(nullptr) {}
|
||||
IQNetPlayer* NetworkPlayerXbox::GetQNetPlayer() { return m_qnetPlayer; }
|
||||
unsigned char NetworkPlayerXbox::GetSmallId() { return 0; }
|
||||
void NetworkPlayerXbox::SendData(INetworkPlayer*, const void*, int, bool) {}
|
||||
bool NetworkPlayerXbox::IsSameSystem(INetworkPlayer*) { return false; }
|
||||
int NetworkPlayerXbox::GetSendQueueSizeBytes(INetworkPlayer*, bool) { return 0; }
|
||||
int NetworkPlayerXbox::GetSendQueueSizeMessages(INetworkPlayer*, bool) { return 0; }
|
||||
int NetworkPlayerXbox::GetCurrentRtt() { return 0; }
|
||||
bool NetworkPlayerXbox::IsHost() { return false; }
|
||||
bool NetworkPlayerXbox::IsGuest() { return false; }
|
||||
bool NetworkPlayerXbox::IsLocal() { return true; }
|
||||
int NetworkPlayerXbox::GetSessionIndex() { return 0; }
|
||||
bool NetworkPlayerXbox::IsTalking() { return false; }
|
||||
bool NetworkPlayerXbox::IsMutedByLocalUser(int) { return false; }
|
||||
bool NetworkPlayerXbox::HasVoice() { return false; }
|
||||
bool NetworkPlayerXbox::HasCamera() { return false; }
|
||||
int NetworkPlayerXbox::GetUserIndex() { return 0; }
|
||||
void NetworkPlayerXbox::SetSocket(Socket* s) { m_pSocket = s; }
|
||||
Socket* NetworkPlayerXbox::GetSocket() { return m_pSocket; }
|
||||
const wchar_t* NetworkPlayerXbox::GetOnlineName() { return L"Player"; }
|
||||
std::wstring NetworkPlayerXbox::GetDisplayName() { return L"Player"; }
|
||||
PlayerUID NetworkPlayerXbox::GetUID() { return PlayerUID(); }
|
||||
|
||||
#endif
|
||||
Loading…
Reference in a new issue