Make outrun controls work
This commit is contained in:
parent
f6c983c156
commit
c1e9120e89
@ -6,6 +6,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "jvs.h"
|
#include "jvs.h"
|
||||||
@ -14,12 +15,23 @@
|
|||||||
int gameModeWidth = -1;
|
int gameModeWidth = -1;
|
||||||
int gameModeHeight = -1;
|
int gameModeHeight = -1;
|
||||||
|
|
||||||
|
void *glutMainLoopThread()
|
||||||
|
{
|
||||||
|
glutMainLoop();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
FGAPI int FGAPIENTRY glutEnterGameMode()
|
FGAPI int FGAPIENTRY glutEnterGameMode()
|
||||||
{
|
{
|
||||||
char gameTitle[256] = {0};
|
char gameTitle[256] = {0};
|
||||||
strcat(gameTitle, getGameName());
|
strcat(gameTitle, getGameName());
|
||||||
strcat(gameTitle, " (GLUT)");
|
strcat(gameTitle, " (GLUT)");
|
||||||
glutCreateWindow(gameTitle);
|
glutCreateWindow(gameTitle);
|
||||||
|
|
||||||
|
// Outrun doesn't run the glutMainLoop through, so we'll do that here
|
||||||
|
pthread_t glutMainLoopID;
|
||||||
|
pthread_create(&glutMainLoopID, NULL, &glutMainLoopThread, NULL);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +95,7 @@ Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int
|
|||||||
// attributes->override_redirect = False;
|
// attributes->override_redirect = False;
|
||||||
|
|
||||||
Window window = _XCreateWindow(display, parent, x, y, width, height, border_width, depth, class, visual, valueMask, attributes);
|
Window window = _XCreateWindow(display, parent, x, y, width, height, border_width, depth, class, visual, valueMask, attributes);
|
||||||
printf("%d %d %d %d\n", x, y, width, height);
|
printf("XCreateWindow Resolution %d %d %d %d\n", x, y, width, height);
|
||||||
|
|
||||||
if (getConfig()->fullscreen)
|
if (getConfig()->fullscreen)
|
||||||
{
|
{
|
||||||
|
@ -152,7 +152,7 @@ int open(const char *pathname, int flags)
|
|||||||
{
|
{
|
||||||
int (*_open)(const char *pathname, int flags) = dlsym(RTLD_NEXT, "open");
|
int (*_open)(const char *pathname, int flags) = dlsym(RTLD_NEXT, "open");
|
||||||
|
|
||||||
printf("Open %s\n", pathname);
|
//printf("Open %s\n", pathname);
|
||||||
|
|
||||||
if (strcmp(pathname, "/dev/lbb") == 0)
|
if (strcmp(pathname, "/dev/lbb") == 0)
|
||||||
{
|
{
|
||||||
@ -190,7 +190,7 @@ int open(const char *pathname, int flags)
|
|||||||
FILE *fopen(const char *restrict pathname, const char *restrict mode)
|
FILE *fopen(const char *restrict pathname, const char *restrict mode)
|
||||||
{
|
{
|
||||||
FILE *(*_fopen)(const char *restrict pathname, const char *restrict mode) = dlsym(RTLD_NEXT, "fopen");
|
FILE *(*_fopen)(const char *restrict pathname, const char *restrict mode) = dlsym(RTLD_NEXT, "fopen");
|
||||||
printf("fopen %s\n", pathname);
|
//printf("fopen %s\n", pathname);
|
||||||
|
|
||||||
if (strcmp(pathname, "/root/lindbergrc") == 0)
|
if (strcmp(pathname, "/root/lindbergrc") == 0)
|
||||||
{
|
{
|
||||||
@ -210,7 +210,7 @@ FILE *fopen(const char *restrict pathname, const char *restrict mode)
|
|||||||
FILE *fopen64(const char *pathname, const char *mode)
|
FILE *fopen64(const char *pathname, const char *mode)
|
||||||
{
|
{
|
||||||
FILE *(*_fopen64)(const char *restrict pathname, const char *restrict mode) = dlsym(RTLD_NEXT, "fopen64");
|
FILE *(*_fopen64)(const char *restrict pathname, const char *restrict mode) = dlsym(RTLD_NEXT, "fopen64");
|
||||||
printf("fopen64 %s\n", pathname);
|
//printf("fopen64 %s\n", pathname);
|
||||||
|
|
||||||
if (strcmp(pathname, "/proc/sys/kernel/osrelease") == 0)
|
if (strcmp(pathname, "/proc/sys/kernel/osrelease") == 0)
|
||||||
{
|
{
|
||||||
@ -227,7 +227,7 @@ FILE *fopen64(const char *pathname, const char *mode)
|
|||||||
int openat(int dirfd, const char *pathname, int flags)
|
int openat(int dirfd, const char *pathname, int flags)
|
||||||
{
|
{
|
||||||
int (*_openat)(int dirfd, const char *pathname, int flags) = dlsym(RTLD_NEXT, "openat");
|
int (*_openat)(int dirfd, const char *pathname, int flags) = dlsym(RTLD_NEXT, "openat");
|
||||||
printf("openat %s\n", pathname);
|
//printf("openat %s\n", pathname);
|
||||||
|
|
||||||
if (strcmp(pathname, "/dev/ttyS0") == 0 || strcmp(pathname, "/dev/ttyS1") == 0 || strcmp(pathname, "/dev/tts/0") == 0 || strcmp(pathname, "/dev/tts/1") == 0)
|
if (strcmp(pathname, "/dev/ttyS0") == 0 || strcmp(pathname, "/dev/ttyS1") == 0 || strcmp(pathname, "/dev/tts/0") == 0 || strcmp(pathname, "/dev/tts/1") == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user