diff --git a/main.cpp b/main.cpp index ab87abb..fcc587d 100644 --- a/main.cpp +++ b/main.cpp @@ -26,20 +26,26 @@ int gradColorMin = 64; // Minimo color más alto del degradado int gradColorMax = 192; // Minimo color más alto del degradado int gradCurrentColor = 192; // Color actual más alto del degradado int gradBreathDirection = 0; // Indica si gradCurrentColor crece o decrece +struct options_t *options; +Asset *asset; +SDL_Window *window; -int main(int argc, char *argv[]) +// Inicializa las opciones +void initOptions() { - // Inicializa las opciones - struct options_t *options = new options_t; + options = new options_t; initOptions(options); options->screen.nativeWidth = 320; options->screen.nativeHeight = 240; options->screen.nativeZoom = 2; options->screen.windowZoom = 1; options->console = true; +} - // Inicializa la lista de recursos - Asset *asset = new Asset(argv[0]); +// Inicializa la lista de recursos +void initAsset() +{ + asset = new Asset(argv[0]); asset->add("/data/music.ogg", t_music); asset->add("/data/sound.wav", t_sound); asset->add("/data/smb2.txt", t_font); @@ -55,6 +61,15 @@ int main(int argc, char *argv[]) { exit(EXIT_FAILURE); } +} + +int main(int argc, char *argv[]) +{ + // Inicializa las opciones + initOptions(); + + // Inicializa la lista de recursos + initAsset(); // Inicializa SDL y la ventana SDL_Init(SDL_INIT_EVERYTHING);