/contrib/other/sdlquake-1.0.9/sys_sdl.c |
---|
11,6 → 11,7 |
#include <string.h> |
#include <ctype.h> |
#include <errno.h> |
#include <kos32sys.h> |
#if !defined(__WIN32__) && !defined(_KOLIBRI) |
#include <sys/ipc.h> |
#include <sys/shm.h> |
19,11 → 20,6 |
#include <sys/mman.h> |
#endif |
#ifdef _KOLIBRI |
#include <sys/ksys.h> |
#include <libgen.h> |
#endif |
#include "quakedef.h" |
qboolean isDedicated; |
274,7 → 270,7 |
#ifdef __WIN32__ |
mkdir (path); |
#else |
mkdir (path, 0777); |
//mkdir (path, 0777); |
#endif |
} |
297,11 → 293,11 |
#if defined(_KOLIBRI) |
static int starttime = 0; |
if (!starttime) { |
starttime = _ksys_get_tick_count(); |
} |
if ( ! starttime ) |
__asm__ __volatile__("int $0x40" : "=a"(starttime) : "a"(26), "b"(9)); |
int curtime = _ksys_get_tick_count(); |
int curtime; |
__asm__ __volatile__("int $0x40" : "=a"(curtime) : "a"(26), "b"(9)); |
return (curtime-starttime)*0.01; |
#elif defined(__WIN32__) |
368,7 → 364,7 |
void Sys_Sleep(void) |
{ |
#ifdef _KOLIBRI |
_ksys_delay(1); |
delay(1); |
#else |
SDL_Delay(1); |
#endif |
388,6 → 384,11 |
int main (int c, char **v) |
{ |
#ifdef _KOLIBRI |
#include "kolibri.h" |
_ksys_setcwd(dirname(v[0])); |
#endif |
double time, oldtime, newtime; |
quakeparms_t parms; |
extern int vcrFile; |
399,8 → 400,6 |
#ifndef _KOLIBRI |
// signal(SIGFPE, floating_point_exception_handler); |
signal(SIGFPE, SIG_IGN); |
#else |
basedir = dirname(v[0]); |
#endif |
parms.memsize = 8*1024*1024; |
430,7 → 429,7 |
if (time < sys_ticrate.value && (vcrFile == -1 || recording) ) |
{ |
#ifdef _KOLIBRI |
_ksys_delay(1); |
delay(1); |
#else |
SDL_Delay (1); |
#endif |
/contrib/other/sdlquake-1.0.9/vid_sdl.c |
---|
4,11 → 4,6 |
#include "quakedef.h" |
#include "d_local.h" |
#ifdef _KOLIBRI |
#include <sys/ksys.h> |
#endif |
viddef_t vid; // global video state |
unsigned short d_8to16table[256]; |
83,12 → 78,10 |
Sys_Error("VID: Bad window width/height\n"); |
} |
// Set video width, height and flags |
flags = (SDL_SWSURFACE|SDL_HWPALETTE); |
#ifndef _KOLIBRI |
// Set video width, height and flags |
if ( COM_CheckParm ("-fullscreen") ) |
flags |= SDL_FULLSCREEN; |
#endif |
// Initialize display |
if (!(screen = SDL_SetVideoMode(vid.width, vid.height, 8, flags))) |
330,8 → 323,6 |
{ |
if ( COM_CheckParm ("-nomouse") ) |
return; |
SDL_WM_GrabInput(SDL_GRAB_ON); |
mouse_x = mouse_y = 0.0; |
mouse_avail = 1; |
} |
338,7 → 329,6 |
void IN_Shutdown (void) |
{ |
SDL_WM_GrabInput(SDL_GRAB_OFF); |
mouse_avail = 0; |
} |
349,8 → 339,6 |
if (!mouse_avail) return; |
SDL_WM_GrabInput(SDL_GRAB_ON); |
i = SDL_GetMouseState(NULL, NULL); |
/* Quake swaps the second and third buttons */ |
mouse_buttonstate = (i & ~0x06) | ((i & 0x02)<<1) | ((i & 0x04)>>1); |