File tree Expand file tree Collapse file tree 9 files changed +23
-25
lines changed
Expand file tree Collapse file tree 9 files changed +23
-25
lines changed Original file line number Diff line number Diff line change 1313
1414
1515// Class of whole current application
16- class App : Libraries {
16+ class App {
1717 private:
1818 // Flags of work
1919 static bool running;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ Libraries::Libraries() {
3333 if (!Mix_OpenAudio (audioDeviceID, NULL )) {
3434 throw LibararyLoadException (" Couldn't initialase audio chanel: " + std::string (SDL_GetError ()));
3535 }
36+ logAdditional (" Libraries load correctly" );
3637 #else
3738 SDL_Init (SDL_INIT_AUDIO | SDL_INIT_VIDEO);
3839 TTF_Init ();
Original file line number Diff line number Diff line change 33 * <nik.kazankov.05@mail.ru>
44 */
55
6+ #pragma once
7+
68#include < SDL3/SDL_audio.h>
79#include " exceptions.hpp"
810
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 66#pragma once
77
88// System numbers
9- #define WINDOW_NAME " Tic-tac-toe on SDL" // System game name
10- #define CELL_SIDE 100 // Width and height of mine in pixels
11- #define SEPARATOR 5 // Width of separator between cells in pixels
9+ #define WINDOW_NAME " Tic-tac-toe on SDL" // System game name
10+ #define CELL_SIDE 100 // Width and height of mine in pixels
11+ #define SEPARATOR 5 // Width of separator between cells in pixels
1212
1313// Internet constants
1414#define BASE_PORT 8000 // Base port to create/connect
1515#define MAX_SEND_ID 128 // Maximal number of send message ID
1616#define MESSAGE_GET_TIMEOUT 5000 // Time after which connection is considered lost
1717#define MESSAGE_APPLY_TIMEOUT 2000 // Time to send apply message to keep connecion
1818#define MESSAGE_RESEND_TIMEOUT 250 // Time after which need to resend message, as it was lost
19- #define CONNECTION_LOST_PERCENT 0 // Option for better testing of connection stability
2019
2120// Base file names
2221#define SETTING_FILE " settings-tic-tac-toe.ini" // File with all starting data (width, height...)
Original file line number Diff line number Diff line change 88
99float GameField::upperLineHeight;
1010int GameField::offset;
11+ Field GameField::field{};
1112
1213GameField::GameField (const Window& _window)
1314: Template(_window) {}
Original file line number Diff line number Diff line change 33 * <nik.kazankov.05@mail.ru>
44 */
55
6- #include " data/app .hpp"
6+ #include " data/libraries .hpp"
77// Load needed loader, depend on teting
88#if ARCHIEVE_LOADING
99#include " data/preloaded/loader/archieveLoader.hpp"
1616#include " cycles/selectCycle.hpp"
1717
1818
19+ // Selecting loader for data, depend on testing
20+ Libraries libraries;
21+ #if ARCHIEVE_LOADING
22+ const ArchieveLoader dataLoader{};
23+ #else
24+ const StraightLoader dataLoader{};
25+ #endif
1926// Static game objects
2027SoundsData sounds{};
2128MusicData music{};
22- Field GameField::field{};
23- InitFile initFile{};
24-
2529
2630// Main function
2731int main (int argv, char **args) {
Original file line number Diff line number Diff line change 1313#include " cycles/clientLobby.hpp"
1414
1515
16+ InitFile initFile{};
17+
1618// Data, load from setting file
1719void InitFile::loadSettings () {
1820 // Reading file
Original file line number Diff line number Diff line change 77
88// File for setting flags for all test for program
99// Debuging modifiers
10- #define DEBUG true
10+ #define DEBUG false
1111#define CHECK_CORRECTION DEBUG
1212#define CHECK_ALL DEBUG
13- #define ARCHIEVE_LOADING DEBUG
13+ #define ARCHIEVE_LOADING !DEBUG
14+
15+ // Internet testing
16+ #define CONNECTION_LOST_PERCENT 0 // Testing connection stability
You can’t perform that action at this time.
0 commit comments