From 9d08026e70c3a474182a7b76c25fd9cf53abdf57 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Tue, 2 Mar 2021 18:19:35 +0300 Subject: Fullscreen, etc... --- src/main.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 60fd479..5fe37fc 100644 --- a/src/main.c +++ b/src/main.c @@ -1,18 +1,17 @@ +#include "game.h" +#include "globals.h" +#include "map.h" +#include "player.h" #include -#include #include +#include #include #include -#include "globals.h" -#include "map.h" -#include "player.h" -#include "game.h" - static SDL_Texture *loadtxr(const char *path) { SDL_Surface *surf = SDL_LoadBMP(path); - SDL_Texture *res = SDL_CreateTextureFromSurface(ttrdr, surf); + SDL_Texture *res = SDL_CreateTextureFromSurface(ttrdr, surf); SDL_FreeSurface(surf); return res; } @@ -23,17 +22,15 @@ int main(int argc, char **argv) TTF_Init(); Mix_Init(MIX_INIT_OGG); Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 4096); - SDL_Window *wdw = SDL_CreateWindow("T A K E T H I S", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - 950, 540, 0); - ttrdr = SDL_CreateRenderer(wdw, -1, SDL_RENDERER_ACCELERATED); - tttxr = loadtxr("data/txr.bmp"); + ttwdw = SDL_CreateWindow("T A K E T H I S", SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, 950, 540, 0); + ttrdr = SDL_CreateRenderer(ttwdw, -1, SDL_RENDERER_ACCELERATED); + tttxr = loadtxr("data/txr.bmp"); ttfont = TTF_OpenFont("data/font.otf", 24); - grib = Mix_LoadMUS("data/grib.ogg"); - ussr = Mix_LoadMUS("data/ussr.ogg"); + grib = Mix_LoadMUS("data/grib.ogg"); + ussr = Mix_LoadMUS("data/ussr.ogg"); stalin = Mix_LoadMUS("data/stalin.ogg"); - lenin = Mix_LoadMUS("data/lenin.ogg"); + lenin = Mix_LoadMUS("data/lenin.ogg"); curmus = 0; tt_map_load(); @@ -46,7 +43,7 @@ int main(int argc, char **argv) TTF_CloseFont(ttfont); SDL_DestroyTexture(tttxr); SDL_DestroyRenderer(ttrdr); - SDL_DestroyWindow(wdw); + SDL_DestroyWindow(ttwdw); Mix_HaltMusic(); Mix_FreeMusic(lenin); Mix_FreeMusic(stalin); -- cgit v1.2.3