1
0
mirror of synced 2024-11-27 19:10:48 +01:00

Make outrun controls work

This commit is contained in:
Bobby Dilley 2022-10-09 22:41:27 +01:00
parent f6c983c156
commit c1e9120e89
2 changed files with 17 additions and 5 deletions

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <pthread.h>
#include "config.h"
#include "jvs.h"
@ -14,12 +15,23 @@
int gameModeWidth = -1;
int gameModeHeight = -1;
void *glutMainLoopThread()
{
glutMainLoop();
return NULL;
}
FGAPI int FGAPIENTRY glutEnterGameMode()
{
char gameTitle[256] = {0};
strcat(gameTitle, getGameName());
strcat(gameTitle, " (GLUT)");
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;
}
@ -83,7 +95,7 @@ Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int
// attributes->override_redirect = False;
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)
{

View File

@ -152,7 +152,7 @@ int open(const char *pathname, int flags)
{
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)
{
@ -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) = dlsym(RTLD_NEXT, "fopen");
printf("fopen %s\n", pathname);
//printf("fopen %s\n", pathname);
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 *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)
{
@ -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) = 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)
{