1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-01 16:32:31 +01:00
Commit Graph

99 Commits

Author SHA1 Message Date
Anonymous Maarten
7d2da28dbc cmake: add ability to compile using conan package manager 2018-06-14 02:26:18 +02:00
Anonymous Maarten
4f98e363ce rwviewer: Visual Studio does not know about #warning 2018-06-14 02:18:10 +02:00
Anonymous Maarten
e3c0b00453 cmake: use GNUInstallDirs for install paths + install everything (optionally) 2018-06-08 18:30:25 +02:00
Christoph Heiss
5bfe0c5e00 Fix rwviewer build on macOS. 2018-02-09 22:58:49 +00:00
Christoph Heiss
6c3935cbf6 Correctly account for DPI scaling when setting viewport size. 2018-02-09 22:58:49 +00:00
Lucas Eriksson
3e96ad9c92 Stop using default initialization onglm datatypes.
It results in undefined behaviour with glm 0.9.9
2018-02-09 22:33:10 +00:00
Daniel Evans
6f9c3db52e Overahaul of rwviewer to simplify the code and improve usability
- Shared ViewerWidget has been removed. Now multiple instances exist
2018-01-27 21:44:18 +00:00
Anonymous Maarten
a40a2706a9 cmake: add support for include-what-you-use to check #include's
The output is currently very verbose and includes many false positives.
Adding a mapping file should solve this.

See
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUMappings.md
2017-10-29 20:40:57 +00:00
Anonymous Maarten
f06d9f5eb2 rwgame+rwviewer: fix -Wunused-variable warnings 2017-10-29 20:40:57 +00:00
Anonymous Maarten
ca9cc4f703 cmake: rwviewer not links to qt5's imported targets 2017-10-29 20:40:57 +00:00
Anonymous Maarten
06c4bf09f7 cmake: make OpenGL an imported target 2017-10-29 20:40:57 +00:00
Anonymous Maarten
6ccf85b770 cmake: make bullet an imported target 2017-10-29 20:40:57 +00:00
Anonymous Maarten
5b9658c03a cmake: reformat rwviewer/CMakeLists.txt 2017-10-29 20:40:57 +00:00
Anonymous Maarten
1926795d63 cmake: use rwengine::interface + no more add_definitions & include_directories 2017-10-29 20:40:57 +00:00
Filip
b9d306ae70 Improving handling game shaders (#302)
* move delete to earlier stage

* lines for better readability

* Added detach shader

* Addition forgotten glDeleteProgram

https://github.com/rwengine/openrw/search?utf8=%E2%9C%93&q=glDeleteProgram&type=
In project there's no necessary clearing call of glDeleteProgram.

* Removing/Closing shader programs

Each shader program should be taken care by glDeleteProgram.
To make it works/usefull, each shader's raw ptr will convertet to unique_ptr
in next commit.

* Converting ShaderProgram's ptr to unique

Actually deleting isn't handled,
so this commit removes memory leak.
2017-10-29 18:47:52 +00:00
Anonymous Maarten
c2da40d0a0 rwlib/rwengine: Use AnimationPtr instead of Animation*
Should fix these memory leaks:
==31441== 3,694,699 (17,248 direct, 3,677,451 indirect) bytes in 196 blocks are definitely lost in loss record 2,720 of 2,723
==31441==    at 0x4C2F1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==31441==    by 0x81D98E: LoaderIFP::loadFromMemory(char*) (LoaderIFP.cpp:69)
==31441==    by 0x7BE5D2: GameData::loadIFP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameData.cpp:506)
==31441==    by 0x7B9B4A: GameData::load() (GameData.cpp:59)
==31441==    by 0x7590C5: RWGame::RWGame(Logger&, int, char**) (RWGame.cpp:51)
==31441==    by 0x749175: main (main.cpp:13)
==31441==
==31441== 5,298,984 (1,080 direct, 5,297,904 indirect) bytes in 15 blocks are definitely lost in loss record 2,722 of 2,723
==31441==    at 0x4C2F1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==31441==    by 0x820253: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >::allocate(unsigned long, void const*) (new_allocator.h:111)
==31441==    by 0x820175: std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > > >::allocate(std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >&, unsigned long) (alloc_traits.h:436)
==31441==    by 0x81FFB4: std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >::_M_get_node() (stl_tree.h:588)
==31441==    by 0x81FE03: std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >* std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >::_M_create_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> const&>(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> const&) (stl_tree.h:642)
==31441==    by 0x81FC26: std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >* std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >::_Alloc_node::operator()<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> const&>(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> const&) const (stl_tree.h:556)
==31441==    by 0x81F620: std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >::_M_insert_<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> const&, std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >::_Alloc_node>(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> const&, std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >::_Alloc_node&) (stl_tree.h:1753)
==31441==    by 0x81EDFD: std::pair<std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >, bool> std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >::_M_insert_unique<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> const&>(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> const&) (stl_tree.h:2096)
==31441==    by 0x81E9F0: std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, AnimationBone*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> > >::insert(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, AnimationBone*> const&) (stl_map.h:796)
==31441==    by 0x81E0BB: LoaderIFP::loadFromMemory(char*) (LoaderIFP.cpp:132)
==31441==    by 0x7BE5D2: GameData::loadIFP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameData.cpp:506)
==31441==    by 0x7E4060: GameWorld::loadCutscene(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameWorld.cpp:692)
2017-10-18 21:52:29 +01:00
Anonymous Maarten
7e4e1db85d rwlib: Use ClumpPtr instead of Clump*
Should fix these memory leaks:
==22737== 14,598,040 (131,472 direct, 14,466,568 indirect) bytes in 2,739 blocks are definitely lost in loss record 3,124 of 3,126
==22737==    at 0x4C2F1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==22737==    by 0x90FE4B: LoaderDFF::loadFromMemory(std::shared_ptr<FileContentsInfo>) (LoaderDFF.cpp:443)
==22737==    by 0x7BCC86: GameData::loadModel(unsigned short) (GameData.cpp:474)
==22737==    by 0x7DF7BC: GameWorld::createInstance(unsigned short, glm::tvec3<float, (glm::precision)0> const&, glm::tquat<float, (glm::precision)0> const&) (GameWorld.cpp:144)
==22737==    by 0x7DF44C: GameWorld::placeItems(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameWorld.cpp:120)
==22737==    by 0x758D38: RWGame::newGame() (RWGame.cpp:116)
==22737==    by 0x786389: LoadingState::enter() (LoadingState.cpp:9)
==22737==    by 0x75DC59: void StateManager::enter<LoadingState, RWGame*, RWGame::RWGame(Logger&, int, char**)::{lambda()#1}>(RWGame*&&, RWGame::RWGame(Logger&, int, char**)::{lambda()#1}&&) (StateManager.hpp:40)
==22737==    by 0x758484: RWGame::RWGame(Logger&, int, char**) (RWGame.cpp:81)
==22737==    by 0x747815: main (main.cpp:13)
2017-10-18 21:52:29 +01:00
Aldoxtor
81734ae2fe initialize some variables in constructor 2017-04-21 20:24:32 +01:00
Daniel Evans
d84b492412 Remove all traces of Skeleton 2017-02-08 21:45:01 +00:00
Daniel Evans
0a0be3c52a Use new Clump structures in rwviewer + remove old renderer 2017-02-08 21:44:25 +00:00
Daniel Evans
a0eaf5b8b0 Move Atomic and Geometry out of Clump class 2017-02-08 21:44:25 +00:00
Daniel Evans
8e4d73fca9 Rename Model -> Clump 2017-02-08 21:44:25 +00:00
Daniel Evans
b65a513bbb Remove usages of WorkContext 2016-12-02 00:56:38 +00:00
Daniel Evans
6951434be8 Load objects directly 2016-09-27 22:49:08 +01:00
Daniel Evans
996a82c4bf Overhaul Model data handling to improve accuracy 2016-09-27 22:48:45 +01:00
Daniel Evans
11a9907f07 clang-format files in rwviewer/views 2016-09-09 21:13:21 +01:00
Daniel Evans
46628d98d9 clang-format files in rwviewer/widgets 2016-09-09 21:13:21 +01:00
Daniel Evans
4ca99c380a clang-format files in rwviewer/models 2016-09-09 21:13:21 +01:00
Daniel Evans
d1c33af268 clang-format files in rwviewer 2016-09-09 21:13:21 +01:00
Daniel Evans
03309d76d9 Don't defer loading IDE files 2016-09-07 01:34:42 +01:00
dan
306f6fa9d7 Use findFilePath when loading data files
This should make file loading more reliable for case sensitive
operating systems.
2016-09-07 00:42:27 +01:00
Jannik Vogel
2419fd1498 RWViewer: Use lower timer interval to stop event-lag 2016-08-08 17:04:49 +02:00
Jannik Vogel
913a5d26b4 RWViewer: Don't load files which might not exist for everyone 2016-08-08 17:04:17 +02:00
Jannik Vogel
05831bea95 RWViewer: Use OpenGL 3.3 Core to prevent crash 2016-08-08 17:03:57 +02:00
Daniel Evans
d8841c7561 Remove include directory from rwengine for consistency 2016-08-07 14:41:45 +01:00
darkf
e58be26be8 Fix the construction of WorkContext
Previously the worker thread was constructed before the queue was, leading to
unfortunate race conditions. This fixes that, along with unrelated minor cleanup.
2016-08-05 09:42:03 -07:00
darkf
6d6d772653 Open binary files in binary mode 2016-08-02 04:38:35 -07:00
orbea
27c6334cb1 CMake: Add BIN_DIR and DOC_DIR (#165)
* CMake: Add BIN_DIR and DOC_DIR

* CMake: Fix typo
2016-06-29 22:19:03 +01:00
Daniel Evans
9f85f283cb CMake: FindSFML+FindMAD, set library paths as SYSTEM, remove dead stuff. 2016-05-19 22:30:06 +01:00
Daniel Evans
8ede36c59d Implement semi-functional world viewer widget 2016-05-19 19:46:23 +01:00
Daniel Evans
5b76eb72f3 Clean up viewer widgets to make additional viewers easier to add. 2016-05-19 19:46:23 +01:00
Daniel Evans
8a5be54b91 Overhaul animation system and character activities
Replaces animator with a simpler system that can overlay multiple
animations

Character animation split into two layers, motion and action.
Walking, running and jumping animations are played on the first
layer, actions such as firing can be overlayed on the second.
More work is needed to limit overlap to only the weapons that make
sense.
2016-04-17 04:54:19 +01:00
Daniel Evans
ceb711b25e Fix animations not playing in rwviewer 2016-04-16 15:05:36 +01:00
Daniel Evans
76eb43c023 Fix compilation and runtime issues with reviewer from recent changes 2016-04-16 14:06:02 +01:00
Daniel Evans
14269d8ae5 Move first of lower level code into rwlib; tear out GLEW. 2016-04-07 01:13:46 +01:00
Daniel Evans
85b1ab120f Move GameState out of GameWorld ownership 2015-04-27 03:55:18 +01:00
Daniel Evans
1daa5a6fb2 Move GameObject to objects directory 2015-04-27 02:09:56 +01:00
Daniel Evans
5db4c28f04 Refactor Object Definition information to GameData 2015-04-24 18:10:42 +01:00
Daniel Evans
e04f9a8d40 Move GameData from GameWorld 2015-04-18 01:11:17 +01:00
Daniel Evans
efc79e8ec6 Overhaul Model Viewer behaviour with visibility toggle 2015-04-14 01:06:50 +01:00