mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
More X11 removal.
This is all unused stuff, just doing a more-complete purge.
This commit is contained in:
parent
cfc8356436
commit
f8a4cb3cc0
@ -93,7 +93,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
message("Building for MAC OSX")
|
message("Building for MAC OSX")
|
||||||
add_compile_definitions(__LINUX__ LINUX _MAX_PATH=260 _MAX_FNAME=256 _REENRANT MACOSX=1 _USE_OGL_ACTIVE_TEXTURES)
|
add_compile_definitions(__LINUX__ LINUX _MAX_PATH=260 _MAX_FNAME=256 _REENRANT MACOSX=1 _USE_OGL_ACTIVE_TEXTURES)
|
||||||
set(PLATFORM_INCLUDES "lib/linux" ${SDL_INCLUDE_DIR} "/usr/X11/include")
|
set(PLATFORM_INCLUDES "lib/linux" ${SDL_INCLUDE_DIR})
|
||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
list(APPEND CMAKE_LIBRARY_PATH "lib/win" "lib/win/directx")
|
list(APPEND CMAKE_LIBRARY_PATH "lib/win" "lib/win/directx")
|
||||||
add_compile_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:CXX>>:/EHsc;/RTC1;/W3;/nologo;/c;/Zi;/TP;/errorReport:prompt>")
|
add_compile_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:CXX>>:/EHsc;/RTC1;/W3;/nologo;/c;/Zi;/TP;/errorReport:prompt>")
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#elif defined(__LINUX__)
|
#elif defined(__LINUX__)
|
||||||
#include "linux/linux_fix.h"
|
#include "linux/linux_fix.h"
|
||||||
#include "lnxscreenmode.h"
|
#include "lnxscreenmode.h"
|
||||||
#include <X11/Xatom.h>
|
|
||||||
#else
|
#else
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,99 +0,0 @@
|
|||||||
/*
|
|
||||||
* Descent 3
|
|
||||||
* Copyright (C) 2024 Parallax Software
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef DECLARE_POINTERS
|
|
||||||
#define FEXTERN
|
|
||||||
#else
|
|
||||||
#define FEXTERN extern
|
|
||||||
#endif
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xutil.h>
|
|
||||||
#include <X11/extensions/xf86dga.h>
|
|
||||||
|
|
||||||
#define XF86DGAQueryVersion DGAQueryVersion
|
|
||||||
#define XF86DGAQueryExtension DGAQueryExtension
|
|
||||||
#define XF86DGADirectVideo DGADirectVideo
|
|
||||||
|
|
||||||
typedef Bool (*DGAQueryVersion_fp)(Display *pa, int *pb, int *pc);
|
|
||||||
FEXTERN DGAQueryVersion_fp DGAQueryVersion;
|
|
||||||
|
|
||||||
typedef Bool (*DGAQueryExtension_fp)(Display *pa, int *pb, int *pc);
|
|
||||||
FEXTERN DGAQueryExtension_fp DGAQueryExtension;
|
|
||||||
|
|
||||||
typedef Status (*DGADirectVideo_fp)(Display *pa, int pb, int pc);
|
|
||||||
FEXTERN DGADirectVideo_fp DGADirectVideo;
|
|
||||||
|
|
||||||
#ifndef DECLARE_POINTERS
|
|
||||||
bool LoadOutrageXWindowsLib(bool load = true);
|
|
||||||
#else
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
void LoadOutrageXWindowsLibSetNULL(void) {
|
|
||||||
DGAQueryVersion = NULL;
|
|
||||||
DGAQueryExtension = NULL;
|
|
||||||
DGADirectVideo = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoadOutrageXWindowsLib(bool load) {
|
|
||||||
#define XWINDOWSEXTLIB "OutrageDynXLib.so"
|
|
||||||
static void *handle = NULL;
|
|
||||||
|
|
||||||
if (!load) {
|
|
||||||
LoadOutrageXWindowsLibSetNULL();
|
|
||||||
if (handle) {
|
|
||||||
dlclose(handle);
|
|
||||||
handle = NULL;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
fprintf(stderr, "Library Unload Failed: %s\n", XWINDOWSEXTLIB);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (handle)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// Load the library
|
|
||||||
handle = dlopen(XWINDOWSEXTLIB, RTLD_LAZY | RTLD_GLOBAL);
|
|
||||||
if (!handle) {
|
|
||||||
fprintf(stderr, "Library Load Failed: %s\n", XWINDOWSEXTLIB);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
DGAQueryVersion = (DGAQueryVersion_fp)dlsym(handle, "DGAQueryVersion");
|
|
||||||
if (!DGAQueryVersion)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
DGAQueryExtension = (DGAQueryExtension_fp)dlsym(handle, "DGAQueryExtension");
|
|
||||||
if (!DGAQueryExtension)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
DGADirectVideo = (DGADirectVideo_fp)dlsym(handle, "DGADirectVideo");
|
|
||||||
if (!DGADirectVideo)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
load_error:
|
|
||||||
LoadOutrageXWindowsLibSetNULL();
|
|
||||||
fprintf(stderr, "Library Symbol Resolve Error: %s\n", XWINDOWSEXTLIB);
|
|
||||||
dlclose(handle);
|
|
||||||
handle = NULL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -1,119 +0,0 @@
|
|||||||
/*
|
|
||||||
* Descent 3
|
|
||||||
* Copyright (C) 2024 Parallax Software
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef DECLARE_POINTERS
|
|
||||||
#define FEXTERN
|
|
||||||
#else
|
|
||||||
#define FEXTERN extern
|
|
||||||
#endif
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xutil.h>
|
|
||||||
#include <X11/extensions/XShm.h>
|
|
||||||
|
|
||||||
#define XShmAttach soXShmAttach
|
|
||||||
#define XShmCreateImage soXShmCreateImage
|
|
||||||
#define XShmDetach soXShmDetach
|
|
||||||
#define XShmPutImage soXShmPutImage
|
|
||||||
#define XShmQueryExtension soXShmQueryExtension
|
|
||||||
|
|
||||||
typedef Status (*XShmAttach_fp)(Display *, XShmSegmentInfo *);
|
|
||||||
FEXTERN XShmAttach_fp soXShmAttach;
|
|
||||||
|
|
||||||
typedef XImage *(*XShmCreateImage_fp)(Display *, Visual *, unsigned int, int, char *, XShmSegmentInfo *, unsigned int,
|
|
||||||
unsigned int);
|
|
||||||
FEXTERN XShmCreateImage_fp soXShmCreateImage;
|
|
||||||
|
|
||||||
typedef Status (*XShmDetach_fp)(Display *, XShmSegmentInfo *);
|
|
||||||
FEXTERN XShmDetach_fp soXShmDetach;
|
|
||||||
|
|
||||||
typedef Status (*XShmPutImage_fp)(Display *, Drawable, GC, XImage *, int, int, int, int, unsigned int, unsigned int,
|
|
||||||
Bool);
|
|
||||||
FEXTERN XShmPutImage_fp soXShmPutImage;
|
|
||||||
|
|
||||||
typedef Bool (*XShmQueryExtension_fp)(Display *);
|
|
||||||
FEXTERN XShmQueryExtension_fp soXShmQueryExtension;
|
|
||||||
|
|
||||||
#ifndef DECLARE_POINTERS
|
|
||||||
bool LoadXWindowsExtLib(bool load = true);
|
|
||||||
#else
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
void LoadXWindowsExtLibSetNULL(void) {
|
|
||||||
soXShmAttach = NULL;
|
|
||||||
soXShmCreateImage = NULL;
|
|
||||||
soXShmDetach = NULL;
|
|
||||||
soXShmPutImage = NULL;
|
|
||||||
soXShmQueryExtension = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoadXWindowsExtLib(bool load) {
|
|
||||||
#define XWINDOWSEXTLIB "libXext.so"
|
|
||||||
static void *handle = NULL;
|
|
||||||
|
|
||||||
if (!load) {
|
|
||||||
LoadXWindowsExtLibSetNULL();
|
|
||||||
if (handle) {
|
|
||||||
dlclose(handle);
|
|
||||||
handle = NULL;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
fprintf(stderr, "Library Unload Failed: %s\n", XWINDOWSEXTLIB);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (handle)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// Load the library
|
|
||||||
handle = dlopen(XWINDOWSEXTLIB, RTLD_LAZY | RTLD_GLOBAL);
|
|
||||||
if (!handle) {
|
|
||||||
fprintf(stderr, "Library Load Failed: %s\n", XWINDOWSEXTLIB);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
soXShmAttach = (XShmAttach_fp)dlsym(handle, "XShmAttach");
|
|
||||||
if (!soXShmAttach)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
soXShmCreateImage = (XShmCreateImage_fp)dlsym(handle, "XShmCreateImage");
|
|
||||||
if (!soXShmCreateImage)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
soXShmDetach = (XShmDetach_fp)dlsym(handle, "XShmDetach");
|
|
||||||
if (!soXShmDetach)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
soXShmPutImage = (XShmPutImage_fp)dlsym(handle, "XShmPutImage");
|
|
||||||
if (!soXShmPutImage)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
soXShmQueryExtension = (XShmQueryExtension_fp)dlsym(handle, "XShmQueryExtension");
|
|
||||||
if (!soXShmQueryExtension)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
load_error:
|
|
||||||
LoadXWindowsExtLibSetNULL();
|
|
||||||
fprintf(stderr, "Library Symbol Resolve Error: %s\n", XWINDOWSEXTLIB);
|
|
||||||
dlclose(handle);
|
|
||||||
handle = NULL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -53,8 +53,6 @@
|
|||||||
#define __LNXVIDEOMODE_H__
|
#define __LNXVIDEOMODE_H__
|
||||||
|
|
||||||
#include "linux/linux_fix.h"
|
#include "linux/linux_fix.h"
|
||||||
// #include "linux/dyna_xwin.h"
|
|
||||||
// #include <X11/extensions/xf86vmode.h>
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
#define MODE_OK 0
|
#define MODE_OK 0
|
||||||
|
@ -18,17 +18,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
** Linux Specific Notes:
|
** Linux Specific Notes:
|
||||||
** This library is dependant off of:
|
|
||||||
** -POSIX Threads (-lpthread)
|
|
||||||
** -X11 Library (-lX11)
|
|
||||||
** -Xext Library (-Xext)
|
|
||||||
**
|
|
||||||
** Only HiColor mode movies are supported. Others could
|
** Only HiColor mode movies are supported. Others could
|
||||||
** be supported, but the nf*, etc. functions need to be
|
** be supported, but the nf*, etc. functions need to be
|
||||||
** implemented to do so. See mveasm.cpp.
|
** implemented to do so. See mveasm.cpp.
|
||||||
**
|
**
|
||||||
** No gfx or resolution changing functions are implemented in
|
** No gfx or resolution changing functions are implemented in
|
||||||
** here. See the xf86vm X11 extension on how to do this.
|
** here.
|
||||||
*/
|
*/
|
||||||
static char notice1[] = "(c) 1997 Interplay Productions. All Rights Reserved.\n"
|
static char notice1[] = "(c) 1997 Interplay Productions. All Rights Reserved.\n"
|
||||||
"This file is confidential and consists of proprietary information\n"
|
"This file is confidential and consists of proprietary information\n"
|
||||||
|
@ -1,165 +0,0 @@
|
|||||||
/*
|
|
||||||
* Descent 3
|
|
||||||
* Copyright (C) 2024 Parallax Software
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/extensions/Xext.h>
|
|
||||||
#include <X11/extensions/xf86vmode.h>
|
|
||||||
#include <X11/extensions/xf86dga.h>
|
|
||||||
|
|
||||||
// interface functions to what we need
|
|
||||||
extern "C" {
|
|
||||||
Bool VidModeQueryVersion(Display *dpy, int *majorversion, int *minorversion);
|
|
||||||
Bool VidModeQueryExtension(Display *dpy, int *event_base, int *error_base);
|
|
||||||
Bool VidModeGetModeLine(Display *dpy, int screen, int *dotclock, XF86VidModeModeLine *modeline);
|
|
||||||
Bool VidModeGetAllModeLines(Display *dpy, int screen, int *modecount, XF86VidModeModeInfo ***modelinesPtr);
|
|
||||||
Bool VidModeAddModeLine(Display *dpy, int screen, XF86VidModeModeInfo *modeline, XF86VidModeModeInfo *aftermodeline);
|
|
||||||
Bool VidModeDeleteModeLine(Display *dpy, int screen, XF86VidModeModeInfo *modeline);
|
|
||||||
Bool VidModeModModeLine(Display *dpy, int screen, XF86VidModeModeLine *modeline);
|
|
||||||
Status VidModeValidateModeLine(Display *dpy, int screen, XF86VidModeModeInfo *modeline);
|
|
||||||
Bool VidModeSwitchMode(Display *dpy, int screen, int zoom);
|
|
||||||
Bool VidModeSwitchToMode(Display *dpy, int screen, XF86VidModeModeInfo *modeline);
|
|
||||||
Bool VidModeLockModeSwitch(Display *dpy, int screen, int lock);
|
|
||||||
Bool VidModeGetMonitor(Display *dpy, int screen, XF86VidModeMonitor *monitor);
|
|
||||||
Bool VidModeGetViewPort(Display *dpy, int screen, int *xreturn, int *yreturn);
|
|
||||||
Bool VidModeSetViewPort(Display *dpy, int screen, int x, int y);
|
|
||||||
void VidModeFreeData(int num_modes, XF86VidModeModeInfo **modelinePtr);
|
|
||||||
|
|
||||||
Bool DGAQueryVersion(Display *pa, int *pb, int *pc);
|
|
||||||
Bool DGAQueryExtension(Display *pa, int *pb, int *pc);
|
|
||||||
Status DGAGetVideoLL(Display *pa, int pb, int *pc, int *pd, int *pe, int *pf);
|
|
||||||
Status DGAGetVideo(Display *pa, int pb, char **pc, int *pd, int *pe, int *pf);
|
|
||||||
Status DGADirectVideo(Display *pa, int pb, int pc);
|
|
||||||
Status DGADirectVideoLL(Display *pa, int pb, int pc);
|
|
||||||
Status DGAGetViewPortSize(Display *pa, int pb, int *pc, int *pd);
|
|
||||||
Status DGASetViewPort(Display *pa, int pb, int x, int y);
|
|
||||||
Status DGAGetVidPage(Display *pa, int pb, int *pc);
|
|
||||||
Status DGASetVidPage(Display *pa, int pb, int pc);
|
|
||||||
Status DGAInstallColormap(Display *, int pa, Colormap);
|
|
||||||
int DGAForkApp(int screen);
|
|
||||||
Status DGAQueryDirectVideo(Display *pa, int pb, int *pc);
|
|
||||||
Bool DGAViewPortChanged(Display *pa, int pb, int pc);
|
|
||||||
Bool DGACopyArea(Display *pa, int pb, Drawable pc, GC pd, int pe, int pf, unsigned int pg, unsigned int ph, int pi,
|
|
||||||
int pj);
|
|
||||||
Bool DGAFillRectangle(Display *pa, int pb, Drawable pc, GC pd, int pe, int pf, unsigned int pg, unsigned int ph);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeQueryVersion(Display *dpy, int *majorversion, int *minorversion) {
|
|
||||||
return XF86VidModeQueryVersion(dpy, majorversion, minorversion);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeQueryExtension(Display *dpy, int *event_base, int *error_base) {
|
|
||||||
return XF86VidModeQueryExtension(dpy, event_base, error_base);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeGetModeLine(Display *dpy, int screen, int *dotclock, XF86VidModeModeLine *modeline) {
|
|
||||||
return XF86VidModeGetModeLine(dpy, screen, dotclock, modeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeGetAllModeLines(Display *dpy, int screen, int *modecount, XF86VidModeModeInfo ***modelinesPtr) {
|
|
||||||
return XF86VidModeGetAllModeLines(dpy, screen, modecount, modelinesPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeAddModeLine(Display *dpy, int screen, XF86VidModeModeInfo *modeline, XF86VidModeModeInfo *aftermodeline) {
|
|
||||||
return XF86VidModeAddModeLine(dpy, screen, modeline, aftermodeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeDeleteModeLine(Display *dpy, int screen, XF86VidModeModeInfo *modeline) {
|
|
||||||
return XF86VidModeDeleteModeLine(dpy, screen, modeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeModModeLine(Display *dpy, int screen, XF86VidModeModeLine *modeline) {
|
|
||||||
return XF86VidModeModModeLine(dpy, screen, modeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
Status VidModeValidateModeLine(Display *dpy, int screen, XF86VidModeModeInfo *modeline) {
|
|
||||||
return XF86VidModeValidateModeLine(dpy, screen, modeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeSwitchMode(Display *dpy, int screen, int zoom) { return XF86VidModeSwitchMode(dpy, screen, zoom); }
|
|
||||||
|
|
||||||
Bool VidModeSwitchToMode(Display *dpy, int screen, XF86VidModeModeInfo *modeline) {
|
|
||||||
return XF86VidModeSwitchToMode(dpy, screen, modeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeLockModeSwitch(Display *dpy, int screen, int lock) { return XF86VidModeLockModeSwitch(dpy, screen, lock); }
|
|
||||||
|
|
||||||
Bool VidModeGetMonitor(Display *dpy, int screen, XF86VidModeMonitor *monitor) {
|
|
||||||
return XF86VidModeGetMonitor(dpy, screen, monitor);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeGetViewPort(Display *dpy, int screen, int *xreturn, int *yreturn) {
|
|
||||||
return XF86VidModeGetViewPort(dpy, screen, xreturn, yreturn);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool VidModeSetViewPort(Display *dpy, int screen, int x, int y) { return XF86VidModeSetViewPort(dpy, screen, x, y); }
|
|
||||||
|
|
||||||
void VidModeFreeData(int num_modes, XF86VidModeModeInfo **modelinePtr) {
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < num_modes; i++) {
|
|
||||||
if (modelinePtr[i]->privsize > 0) {
|
|
||||||
XFree(modelinePtr[i]->c_private);
|
|
||||||
modelinePtr[i]->c_private = NULL;
|
|
||||||
modelinePtr[i]->privsize = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
XFree(modelinePtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool DGAQueryVersion(Display *pa, int *pb, int *pc) { return XF86DGAQueryVersion(pa, pb, pc); }
|
|
||||||
|
|
||||||
Bool DGAQueryExtension(Display *pa, int *pb, int *pc) { return XF86DGAQueryExtension(pa, pb, pc); }
|
|
||||||
|
|
||||||
Status DGAGetVideoLL(Display *pa, int pb, int *pc, int *pd, int *pe, int *pf) {
|
|
||||||
return XF86DGAGetVideoLL(pa, pb, (unsigned int *)pc, pd, pe, pf);
|
|
||||||
}
|
|
||||||
|
|
||||||
Status DGAGetVideo(Display *pa, int pb, char **pc, int *pd, int *pe, int *pf) {
|
|
||||||
return XF86DGAGetVideo(pa, pb, pc, pd, pe, pf);
|
|
||||||
}
|
|
||||||
|
|
||||||
Status DGADirectVideo(Display *pa, int pb, int pc) { return XF86DGADirectVideo(pa, pb, pc); }
|
|
||||||
|
|
||||||
Status DGADirectVideoLL(Display *pa, int pb, int pc) { return XF86DGADirectVideoLL(pa, pb, pc); }
|
|
||||||
|
|
||||||
Status DGAGetViewPortSize(Display *pa, int pb, int *pc, int *pd) { return XF86DGAGetViewPortSize(pa, pb, pc, pd); }
|
|
||||||
|
|
||||||
Status DGASetViewPort(Display *pa, int pb, int x, int y) { return XF86DGASetViewPort(pa, pb, x, y); }
|
|
||||||
|
|
||||||
Status DGAGetVidPage(Display *pa, int pb, int *pc) { return XF86DGAGetVidPage(pa, pb, pc); }
|
|
||||||
|
|
||||||
Status DGASetVidPage(Display *pa, int pb, int pc) { return XF86DGASetVidPage(pa, pb, pc); }
|
|
||||||
|
|
||||||
Status DGAInstallColormap(Display *pa, int pb, Colormap pc) { return XF86DGAInstallColormap(pa, pb, pc); }
|
|
||||||
|
|
||||||
int DGAForkApp(int screen) { return XF86DGAForkApp(screen); }
|
|
||||||
|
|
||||||
Status DGAQueryDirectVideo(Display *pa, int pb, int *pc) { return XF86DGAQueryDirectVideo(pa, pb, pc); }
|
|
||||||
|
|
||||||
Bool DGAViewPortChanged(Display *pa, int pb, int pc) { return XF86DGAViewPortChanged(pa, pb, pc); }
|
|
||||||
/*
|
|
||||||
Bool DGACopyArea(Display *pa,int pb,Drawable pc,GC pd,int pe,int pf,unsigned int pg,unsigned int ph,int pi,int pj)
|
|
||||||
{
|
|
||||||
return XDGACopyArea(pa,pb,pc,pd,pe,pf,pg,ph,pi,pj);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool DGAFillRectangle(Display *pa,int pb,Drawable pc,GC pd,int pe,int pf,unsigned int pg,unsigned int ph)
|
|
||||||
{
|
|
||||||
return XDGAFillRectangle(pa,pb,pc,pd,pe,pf,pg,ph);
|
|
||||||
}
|
|
||||||
*/
|
|
@ -1,119 +0,0 @@
|
|||||||
/*
|
|
||||||
* Descent 3
|
|
||||||
* Copyright (C) 2024 Parallax Software
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef DECLARE_POINTERS
|
|
||||||
#define FEXTERN
|
|
||||||
#else
|
|
||||||
#define FEXTERN extern
|
|
||||||
#endif
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xutil.h>
|
|
||||||
#include <X11/extensions/XShm.h>
|
|
||||||
|
|
||||||
#define XShmAttach soXShmAttach
|
|
||||||
#define XShmCreateImage soXShmCreateImage
|
|
||||||
#define XShmDetach soXShmDetach
|
|
||||||
#define XShmPutImage soXShmPutImage
|
|
||||||
#define XShmQueryExtension soXShmQueryExtension
|
|
||||||
|
|
||||||
typedef Status (*XShmAttach_fp)(Display *, XShmSegmentInfo *);
|
|
||||||
FEXTERN XShmAttach_fp soXShmAttach;
|
|
||||||
|
|
||||||
typedef XImage *(*XShmCreateImage_fp)(Display *, Visual *, unsigned int, int, char *, XShmSegmentInfo *, unsigned int,
|
|
||||||
unsigned int);
|
|
||||||
FEXTERN XShmCreateImage_fp soXShmCreateImage;
|
|
||||||
|
|
||||||
typedef Status (*XShmDetach_fp)(Display *, XShmSegmentInfo *);
|
|
||||||
FEXTERN XShmDetach_fp soXShmDetach;
|
|
||||||
|
|
||||||
typedef Status (*XShmPutImage_fp)(Display *, Drawable, GC, XImage *, int, int, int, int, unsigned int, unsigned int,
|
|
||||||
Bool);
|
|
||||||
FEXTERN XShmPutImage_fp soXShmPutImage;
|
|
||||||
|
|
||||||
typedef Bool (*XShmQueryExtension_fp)(Display *);
|
|
||||||
FEXTERN XShmQueryExtension_fp soXShmQueryExtension;
|
|
||||||
|
|
||||||
#ifndef DECLARE_POINTERS
|
|
||||||
bool LoadXWindowsExtLib(bool load = true);
|
|
||||||
#else
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
void LoadXWindowsExtLibSetNULL(void) {
|
|
||||||
soXShmAttach = NULL;
|
|
||||||
soXShmCreateImage = NULL;
|
|
||||||
soXShmDetach = NULL;
|
|
||||||
soXShmPutImage = NULL;
|
|
||||||
soXShmQueryExtension = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoadXWindowsExtLib(bool load) {
|
|
||||||
#define XWINDOWSEXTLIB "libXext.so"
|
|
||||||
static void *handle = NULL;
|
|
||||||
|
|
||||||
if (!load) {
|
|
||||||
LoadXWindowsExtLibSetNULL();
|
|
||||||
if (handle) {
|
|
||||||
dlclose(handle);
|
|
||||||
handle = NULL;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
fprintf(stderr, "Library Unload Failed: %s\n", XWINDOWSEXTLIB);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (handle)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// Load the library
|
|
||||||
handle = dlopen(XWINDOWSEXTLIB, RTLD_LAZY | RTLD_GLOBAL);
|
|
||||||
if (!handle) {
|
|
||||||
fprintf(stderr, "Library Load Failed: %s\n", XWINDOWSEXTLIB);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
soXShmAttach = (XShmAttach_fp)dlsym(handle, "XShmAttach");
|
|
||||||
if (!soXShmAttach)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
soXShmCreateImage = (XShmCreateImage_fp)dlsym(handle, "XShmCreateImage");
|
|
||||||
if (!soXShmCreateImage)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
soXShmDetach = (XShmDetach_fp)dlsym(handle, "XShmDetach");
|
|
||||||
if (!soXShmDetach)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
soXShmPutImage = (XShmPutImage_fp)dlsym(handle, "XShmPutImage");
|
|
||||||
if (!soXShmPutImage)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
soXShmQueryExtension = (XShmQueryExtension_fp)dlsym(handle, "XShmQueryExtension");
|
|
||||||
if (!soXShmQueryExtension)
|
|
||||||
goto load_error;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
load_error:
|
|
||||||
LoadXWindowsExtLibSetNULL();
|
|
||||||
fprintf(stderr, "Library Symbol Resolve Error: %s\n", XWINDOWSEXTLIB);
|
|
||||||
dlclose(handle);
|
|
||||||
handle = NULL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue
Block a user