Otclient  14/8/2020
client.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2020 OTClient <https://github.com/edubart/otclient>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 
23 #include "client.h"
27 #include "game.h"
28 #include "map.h"
29 #include "shadermanager.h"
30 #include "spritemanager.h"
31 #include "minimap.h"
33 
35 
36 void Client::init(std::vector<std::string>& args)
37 {
38  // register needed lua functions
40 
41  g_map.init();
42  g_minimap.init();
43  g_game.init();
44  g_shaders.init();
45  g_things.init();
46 
47  //TODO: restore options
48 /*
49  if(g_graphics.parseOption(arg))
50  continue;
51 
52  if(arg == "-version" || arg == "--version" || arg == "-v") {
53  stdext::print(
54  m_appName, " ", m_appVersion, "\n"
55  "Buitt on: ", BUILD_DATE, "\n",
56  "Commit: ", BUILD_COMMIT, "\n",
57  "Compiled by: ", BUILD_COMPILER, "\n",
58  "Build type: ", BUILD_TYPE, "\n");
59  return;
60  } else if(arg == "-help" || arg == "--help" || arg == "-h" || arg == "-?" || arg == "/?") {
61  stdext::print(
62  "Usage: ", args[0], " [options]\n"
63  "Options:\n"
64  " -help Display this information and exit\n"
65  " -version Display version and exit\n"
66  " \n"
67  " -no-fbos Disable usage of opengl framebuffer objects\n"
68  " -no-mipmaps Disable texture mipmaping\n"
69  " -no-smooth Disable texture smoothing (bilinear filter)\n"
70  " -no-non-power-of-two-textures Use only power of two textures\n"
71  " -no-clamp-to-edge Don't use GL_CLAMP_TO_EDGE\n"
72  " -no-backbuffer-cache Don't allow backbuffer caching\n"
73  " -hardware-buffers Cache vertex arrays in hardware\n"
74  " -opengl1 Use OpenGL 1.x painter\n"
75  " -opengl2 Use OpenGL 2.0 painter\n");
76  return;
77  } else {
78  stdext::println("Unrecognized option '", arg, "', please see -help for available options list");
79  return;
80  }
81  */
82 }
83 
85 {
87  g_game.terminate();
88  g_map.terminate();
93 }
graphics.h
Map::init
void init()
Definition: map.cpp:39
g_map
Map g_map
Definition: map.cpp:36
configmanager.h
ShaderManager::terminate
void terminate()
Definition: shadermanager.cpp:44
resourcemanager.h
g_game
Game g_game
Definition: game.cpp:37
g_creatures
CreatureManager g_creatures
Definition: creatures.cpp:30
minimap.h
Game::init
void init()
Definition: game.cpp:58
g_sprites
SpriteManager g_sprites
Definition: spritemanager.cpp:29
spritemanager.h
CreatureManager::terminate
void terminate()
Definition: creatures.cpp:43
g_shaders
ShaderManager g_shaders
Definition: shadermanager.cpp:29
Map::terminate
void terminate()
Definition: map.cpp:45
map.h
ThingTypeManager::init
void init()
Definition: thingtypemanager.cpp:40
g_client
Client g_client
Definition: client.cpp:34
Minimap::terminate
void terminate()
Definition: minimap.cpp:90
Minimap::init
void init()
Definition: minimap.cpp:86
Game::terminate
void terminate()
Definition: game.cpp:63
g_minimap
Minimap g_minimap
Definition: minimap.cpp:36
modulemanager.h
SpriteManager::terminate
void terminate()
Definition: spritemanager.cpp:37
game.h
Client::registerLuaFunctions
void registerLuaFunctions()
Definition: luafunctions.cpp:55
ThingTypeManager::terminate
void terminate()
Definition: thingtypemanager.cpp:56
Client
Definition: client.h:28
g_things
ThingTypeManager g_things
Definition: thingtypemanager.cpp:38
client.h
ShaderManager::init
void init()
Definition: shadermanager.cpp:31
shadermanager.h
Client::terminate
void terminate()
Definition: client.cpp:84
Client::init
void init(std::vector< std::string > &args)
Definition: client.cpp:36