X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fmain.c;h=edf7156aedddd98fffb899796f534cdcb4e2dd01;hb=c5be09436899f403e3f39c051399b160c8d2f019;hp=7bd73d4fed4f91cab282c2f9fbaaef67077ee0bb;hpb=584adc9c1911a6941ef07443a6fc6ff922d7c8ea;p=flatwaifu.git diff --git a/src/main.c b/src/main.c index 7bd73d4..edf7156 100644 --- a/src/main.c +++ b/src/main.c @@ -35,24 +35,12 @@ #include "menu.h" #include "player.h" #include "my.h" +#include "render.h" +#include "game.h" +#include "music.h" #include -void logo(const char *s,...) { - va_list ap; - int x,y; - - va_start(ap,s); - vprintf(s,ap); - va_end(ap); - fflush(stdout); -} - -void logo_gas(int cur,int all) { -} - -void myrandomize(void); - int main(int argc, char *argv[]) { if (SDL_Init(SDL_INIT_VIDEO)<0) ERR_failinit("Unable to init SDL: %s\n", SDL_GetError()); SDL_WM_SetCaption("Doom 2D v1.351", "Doom 2D"); @@ -105,22 +93,16 @@ int main(int argc, char *argv[]) { F_loadmus("MENU"); S_startmusic(0); - Uint32 ticks = 0; - for(;;) { - + Uint32 ticks = SDL_GetTicks(); + for (;;) { updatee_keys(); - S_updatemusic(); - - G_act(); - - R_draw(); - - Uint32 t; - while ((t = SDL_GetTicks())-ticks < DELAY) { - SDL_Delay(1); + Uint32 t = SDL_GetTicks(); + if (t - ticks > DELAY) { + ticks = t; + G_act(); } - ticks = t - t % DELAY; - + R_draw(); + //SDL_Delay(1); } }