/contrib/games/opentyrian/Makefile.linux |
---|
67,7 → 67,6 |
-Wextra \ |
-Wno-missing-field-initializers |
CFLAGS += -O2 |
CFLAGS += -DuSDL_Delay=SDL_Delay |
LDFLAGS := |
LDLIBS := |
/contrib/games/opentyrian/SDL/uSDL.c |
---|
File deleted |
/contrib/games/opentyrian/Tupfile.lua |
---|
8,7 → 8,7 |
tup.include(HELPERDIR .. "/use_newlib.lua") |
--use_dynamic_stack() -- default 64K are not sufficient |
tup.include(HELPERDIR .. "/use_sdl_newlib.lua") |
CFLAGS = CFLAGS .. [[ -UWIN32 -U_WIN32 -U__WIN32__ -D_KOLIBRI -DTYRIAN_DIR="\"."\" -DSDL_strlcpy=strncpy -D_GNU_SOURCE=1 -D_REENTRANT -DNDEBUG -Wno-missing-field-initializers ]] |
CFLAGS = CFLAGS .. [[ -DTYRIAN_DIR="\"."\" -D_GNU_SOURCE=1 -D_REENTRANT -DNDEBUG -Wno-missing-field-initializers ]] |
LDFLAGS = LDFLAGS .. " --subsystem native" |
69,7 → 69,6 |
"./SDL/joystick_stub.c", |
"./SDL/SDL_wave.c", |
"./SDL/SDL_audiocvt.c", |
"./SDL/uSDL.c", |
} |
link_gcc("opentyrian") |
/contrib/games/opentyrian/src/destruct.c |
---|
631,7 → 631,7 |
while (!newkey) |
{ |
service_SDL_events(false); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
fade_black(15); |
684,7 → 684,7 |
newkey = false; |
do { |
service_SDL_events(false); |
uSDL_Delay(16); |
SDL_Delay(16); |
} while(!newkey); |
/* See what was pressed */ |
1297,7 → 1297,7 |
do /* wait until user hits a key */ |
{ |
service_SDL_events(true); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
while (!newkey); |
1320,7 → 1320,7 |
do /* wait until user hits a key */ |
{ |
service_SDL_events(true); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
while (!newkey); |
/contrib/games/opentyrian/src/game_menu.c |
---|
1592,7 → 1592,7 |
network_update(); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
network_state_reset(); |
1606,7 → 1606,7 |
JE_showVGA(); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
} |
#endif |
2507,7 → 2507,7 |
JE_scaleBitmap(dst, src, 160 - i, 0, 160 + i - 1, 100 + roundf(i * 0.625f) - 1); |
JE_showVGA(); |
uSDL_Delay(1); |
SDL_Delay(1); |
} |
} |
/contrib/games/opentyrian/src/keyboard.c |
---|
61,7 → 61,7 |
service_SDL_events(false); |
while (!((keyboard && keydown) || (mouse && mousedown) || (joystick && joydown))) |
{ |
uSDL_Delay(SDL_POLL_INTERVAL); |
SDL_Delay(SDL_POLL_INTERVAL); |
push_joysticks_as_keyboard(); |
service_SDL_events(false); |
77,7 → 77,7 |
service_SDL_events(false); |
while ((keyboard && keydown) || (mouse && mousedown) || (joystick && joydown)) |
{ |
uSDL_Delay(SDL_POLL_INTERVAL); |
SDL_Delay(SDL_POLL_INTERVAL); |
poll_joysticks(); |
service_SDL_events(false); |
/contrib/games/opentyrian/src/mainint.c |
---|
159,7 → 159,7 |
if (levelWarningDisplay) |
JE_updateWarning(VGAScreen); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
while (!(delaycount() == 0 || ESCPressed)); |
803,7 → 803,7 |
{ |
NETWORK_KEEP_ALIVE(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} while (!JE_anyButton()); |
} |
1066,7 → 1066,7 |
network_update(); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
} |
#endif |
1133,7 → 1133,7 |
network_update(); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
} else { |
/* |
1150,7 → 1150,7 |
service_SDL_events(false); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
VGAScreen = temp_surface; /* side-effect of game_screen */ |
2853,7 → 2853,7 |
network_update(); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
} |
#endif |
2905,7 → 2905,7 |
service_SDL_events(false); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
} |
#endif |
/contrib/games/opentyrian/src/network.c |
---|
514,7 → 514,7 |
} |
if (network_check() == 0) |
uSDL_Delay(1); |
SDL_Delay(1); |
} |
if (network_delay > 1) |
625,7 → 625,7 |
network_update(); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
connect_again: |
671,7 → 671,7 |
if (SDL_GetTicks() - last_out_tick > NET_RETRY) |
goto connect_reset; |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
// send another packet since sometimes the network syncs without both connect packets exchanged |
724,7 → 724,7 |
service_SDL_events(false); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
} |
731,7 → 731,7 |
if (err) |
{ |
while (!JE_anyButton()) |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
fade_black(10); |
/contrib/games/opentyrian/src/nortsong.c |
---|
76,7 → 76,7 |
{ |
Sint32 delay = target - SDL_GetTicks(); |
if (delay > 0) |
uSDL_Delay(delay); |
SDL_Delay(delay); |
} |
void service_wait_delay( void ) |
83,7 → 83,7 |
{ |
while (SDL_GetTicks() < target) |
{ |
uSDL_Delay(SDL_GetTicks() - target > SDL_POLL_INTERVAL ? SDL_POLL_INTERVAL : SDL_GetTicks() - target); |
SDL_Delay(SDL_GetTicks() - target > SDL_POLL_INTERVAL ? SDL_POLL_INTERVAL : SDL_GetTicks() - target); |
service_SDL_events(false); |
} |
} |
93,7 → 93,7 |
service_SDL_events(true); |
while (SDL_GetTicks() < target && !((keyboard && keydown) || (mouse && mousedown) || (joystick && joydown))) |
{ |
uSDL_Delay(SDL_GetTicks() - target > SDL_POLL_INTERVAL ? SDL_POLL_INTERVAL : SDL_GetTicks() - target); |
SDL_Delay(SDL_GetTicks() - target > SDL_POLL_INTERVAL ? SDL_POLL_INTERVAL : SDL_GetTicks() - target); |
push_joysticks_as_keyboard(); |
service_SDL_events(false); |
} |
/contrib/games/opentyrian/src/opentyr.c |
---|
55,6 → 55,12 |
#include <string.h> |
#include <time.h> |
#ifdef _KOLIBRI |
#include <sys/ksys.h> |
#include <libgen.h> |
#endif |
const char *opentyrian_str = "OpenTyrian"; |
const char *opentyrian_version = OPENTYRIAN_VERSION; |
280,6 → 286,10 |
printf("This is free software, and you are welcome to redistribute it\n"); |
printf("under certain conditions. See the file GPL.txt for details.\n\n"); |
#ifdef _KOLIBRI |
_ksys_setcwd(dirname(argv[0])); |
#endif |
if (SDL_Init(0)) |
{ |
printf("Failed to initialize SDL: %s\n", SDL_GetError()); |
/contrib/games/opentyrian/src/opentyr.h |
---|
60,10 → 60,10 |
extern const char *opentyrian_version; |
void opentyrian_menu( void ); |
#ifdef _KOLIBRI |
extern void uSDL_SetWinCenter(uint w, uint h); |
extern void uSDL_Delay(uint ms); |
#endif |
//#ifdef _KOLIBRI |
//extern void uSDL_SetWinCenter(uint w, uint h); |
//extern void SDL_Delay(uint ms); |
//#endif |
#endif /* OPENTYR_H */ |
/contrib/games/opentyrian/src/setup.c |
---|
84,7 → 84,7 |
NETWORK_KEEP_ALIVE(); |
uSDL_Delay(16); |
SDL_Delay(16); |
if (*waitTime > 0) |
{ |
/contrib/games/opentyrian/src/tyrian2.c |
---|
3260,7 → 3260,7 |
network_update(); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
JE_initEpisode(SDLNet_Read16(&packet_in[0]->data[4])); |
3282,7 → 3282,7 |
JE_showVGA(); |
network_check(); |
uSDL_Delay(16); |
SDL_Delay(16); |
} |
} |
else |
/contrib/games/opentyrian/src/video.c |
---|
115,11 → 115,6 |
w = surface->w; |
h = surface->h; |
#ifdef _KOLIBRI |
uSDL_SetWinCenter(w,h); |
#endif |
//bpp = surface->format->BitsPerPixel; |
printf("initialized video: %dx%dx%d %s\n", w, h, bpp, fullscreen ? "fullscreen" : "windowed"); |
scaler = new_scaler; |