1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-09 12:22:34 +01:00
Commit Graph

712 Commits

Author SHA1 Message Date
Anonymous Maarten
e448f610ff rwengine: make Renderer a shared_ptr
Should fix this memory leak:
==16721== 912 (600 direct, 312 indirect) bytes in 1 blocks are definitely lost in loss record 225 of 264
==16721==    at 0x4C2F1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==16721==    by 0x84A697: GameRenderer::GameRenderer(Logger*, GameData*) (GameRenderer.cpp:71)
==16721==    by 0x75FC7D: RWGame::RWGame(Logger&, int, char**) (RWGame.cpp:35)
==16721==    by 0x750385: main (main.cpp:13)
2017-10-18 21:52:29 +01:00
Anonymous Maarten
8175666092 rwengine: make AnimationBone a shared pointer
Should fix this memory leak:
==10780== 4,341,444 (269,712 direct, 4,071,732 indirect) bytes in 3,746 blocks are definitely lost in los
s record 2,652 of 2,654
==10780==    at 0x4C2F1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==10780==    by 0x8219B2: LoaderIFP::loadFromMemory(char*) (LoaderIFP.cpp:82)
==10780==    by 0x7C22C0: GameData::loadIFP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameData.cpp:506)
==10780==    by 0x7BD838: GameData::load() (GameData.cpp:59)
==10780==    by 0x75CD35: RWGame::RWGame(Logger&, int, char**) (RWGame.cpp:51)
==10780==    by 0x74CDE5: main (main.cpp:13)
==10780==
==10780== 6,516,576 (13,968 direct, 6,502,608 indirect) bytes in 194 blocks are definitely lost in loss record 2,654 of 2,654
==10780==    at 0x4C2F1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==10780==    by 0x8219B2: LoaderIFP::loadFromMemory(char*) (LoaderIFP.cpp:82)
==10780==    by 0x7C22C0: GameData::loadIFP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameData.cpp:506)
==10780==    by 0x7E7ECC: GameWorld::loadCutscene(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameWorld.cpp:693)
==10780==    by 0x87453E: opcode_02e4(ScriptArguments const&, char const*) (GTA3ModuleImpl.inl:8245)
==10780==    by 0x8D8149: void script_bind::call_unpacked<0u, 2u, void>::call<void (*)(ScriptArguments const&, char const*), ScriptArguments const&, char const*>(void (*)(ScriptArguments const&, char const*), ScriptArguments const&, ScriptArguments const&, char const*&&) (ScriptModule.hpp:80)
==10780==    by 0x8D2765: void script_bind::call_unpacked<1u, 1u, void, char const*>::call<void (*)(ScriptArguments const&, char const*), ScriptArguments const&>(void (*)(ScriptArguments const&, char const*), ScriptArguments const&, ScriptArguments const&) (ScriptModule.hpp:90)
==10780==    by 0x8C7EFE: void script_bind::call_unpacked<2u, 0u, void, ScriptArguments const&, char const*>::call<void (*)(ScriptArguments const&, char const*)>(void (*)(ScriptArguments const&, char const*), ScriptArguments const&) (ScriptModule.hpp:90)
==10780==    by 0x8B5A05: void script_bind::binder<void, ScriptArguments const&, char const*>::call<void (*)(ScriptArguments const&, char const*)>(void (*)(ScriptArguments const&, char const*), ScriptArguments const&) (ScriptModule.hpp:104)
==10780==    by 0x8A2E3A: void script_bind::do_unpacked_call<void, ScriptArguments const&, char const*>(void (* const&)(ScriptArguments const&, char const*), ScriptArguments const&) (ScriptModule.hpp:137)
==10780==    by 0x893BB0: void ScriptModule::bind<void (*)(ScriptArguments const&, char const*)>(unsigned short, int, void (*)(ScriptArguments const&, char const*))::{lambda(ScriptArguments const&)#1}::operator()(ScriptArguments const&) const (ScriptModule.hpp:166)
==10780==    by 0x8B5A8D: std::_Function_handler<void (ScriptArguments const&), void ScriptModule::bind<void (*)(ScriptArguments const&, char const*)>(unsigned short, int, void (*)(ScriptArguments const&, char const*))::{lambda(ScriptArguments const&)#1}>::_M_invoke(std::_Any_data const&, ScriptArguments const&) (std_function.h:316)
2017-10-18 21:52:29 +01:00
Anonymous Maarten
5e330346ec rwengine: delete corona VisualFX on delete of PickupObject
Should fix this memory leak:
==31441== 1,184 (1,144 direct, 40 indirect) bytes in 11 blocks are definitely lost in loss record 2,344 of 2,723
==31441==    at 0x4C2F1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==31441==    by 0x7E30D5: GameWorld::createEffect(VisualFX::EffectType) (GameWorld.cpp:495)
==31441==    by 0x82CE16: PickupObject::PickupObject(GameWorld*, glm::tvec3<float, (glm::precision)0> const&, BaseModelInfo*, PickupObject::PickupType) (PickupObject.cpp:126)
==31441==    by 0x82C505: ItemPickup::ItemPickup(GameWorld*, glm::tvec3<float, (glm::precision)0> const&, BaseModelInfo*, PickupObject::PickupType, WeaponData*) (ItemPickup.cpp:11)
==31441==    by 0x7E2953: GameWorld::createPickup(glm::tvec3<float, (glm::precision)0> const&, int, int) (GameWorld.cpp:389)
==31441==    by 0x86D209: opcode_0213(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&) (GTA3ModuleImpl.inl:6350)
==31441==    by 0x8DC0EF: void script_bind::call_unpacked<0u, 7u, void>::call<void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&, int&, int&, glm::tvec3<float, (glm::precision)0>&, ScriptObjectType<PickupObject> >(void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&, ScriptArguments const&, int&, int&, glm::tvec3<float, (glm::precision)0>&, ScriptObjectType<PickupObject>&&) (ScriptModule.hpp:80)
==31441==    by 0x8D9B82: void script_bind::call_unpacked<1u, 6u, void, ScriptObjectType<PickupObject>&>::call<void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&, int&, int&, glm::tvec3<float, (glm::precision)0> >(void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&, ScriptArguments const&, int&, int&, glm::tvec3<float, (glm::precision)0>&&) (ScriptModule.hpp:90)
==31441==    by 0x8D6753: void script_bind::call_unpacked<2u, 3u, void, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&>::call<void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&, int&, int>(void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&, ScriptArguments const&, int&, int&&) (ScriptModule.hpp:90)
==31441==    by 0x8D213D: void script_bind::call_unpacked<3u, 2u, void, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&>::call<void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&, int>(void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&, ScriptArguments const&, int&&) (ScriptModule.hpp:90)
==31441==    by 0x8CBEE0: void script_bind::call_unpacked<4u, 1u, void, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&>::call<void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&>(void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&, ScriptArguments const&) (ScriptModule.hpp:90)
==31441==    by 0x8C0078: void script_bind::call_unpacked<5u, 0u, void, ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&>::call<void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&)>(void (*)(ScriptArguments const&, int, int, glm::tvec3<float, (glm::precision)0>, ScriptObjectType<PickupObject>&), ScriptArguments const&) (ScriptModule.hpp:90)
2017-10-18 21:52:29 +01:00
Anonymous Maarten
8e98cf2311 rwengine: Pass CharacterController to the CharacterObject constructor
The CharacterObject should remove the CharacterController upon
destruction.

Should fix this memory leak:
==31441== 480 (360 direct, 120 indirect) bytes in 5 blocks are definitely lost in loss record 2,038 of 2,723
==31441==    at 0x4C2F1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==31441==    by 0x7E2370: GameWorld::createPedestrian(unsigned short, glm::tvec3<float, (glm::precision)0> const&, glm::tquat<float, (glm::precision)0> const&, unsigned int) (GameWorld.cpp:334)
==31441==    by 0x8E2F01: TrafficDirector::populateNearby(ViewCamera const&, float, int) (TrafficDirector.cpp:164)
==31441==    by 0x7E1170: GameWorld::createTraffic(ViewCamera const&) (GameWorld.cpp:176)
==31441==    by 0x75C616: RWGame::tick(float) (RWGame.cpp:531)
==31441==    by 0x75BF18: RWGame::run() (RWGame.cpp:420)
==31441==    by 0x749184: main (main.cpp:15)
2017-10-18 21:52:29 +01: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
Filip Gawin
c5ade22377 Implement 0197-01B0 2017-10-17 22:26:15 +01:00
Filip Gawin
863d69656d Implement 00b0, 00b1 2017-10-17 22:26:15 +01:00
Filip Gawin
5cb1cd884c Implement 00a3, 00a4
As you can see, they are copies
of 0056, 0057.

32a64aa214/rwengine/src/script/modules/GTA3ModuleImpl.inl (L939)
2017-10-17 22:26:15 +01:00
Tomi Lähteenmäki
4bf1d3795b Fix jumping in newer bullet version (#328)
* Fix jumping in newer bullet version

* Added check for bullet version
jump() was changed in bullet version 2.84
2017-10-16 22:37:02 +01:00
Christoph Heiss
a347c07961 Use memcpy instead of mempcpy as mempcpy is glibc-specific.
This fixes #324 on macOS.
The only difference between memcpy and mempcpy is that mempcpy returns
a pointer one after the last written byte - the return value is unused.
2017-10-13 23:20:23 +01:00
Daniel Evans
8e86786e5b Update Character movement at each physics sub-step 2017-10-13 21:40:40 +01:00
Daniel Evans
c915521436 Use a sliding range within a larger UBO for object data.
Improves performance quite considerably (30%) on Ivy Bridge
2017-10-13 19:58:27 +01:00
Christoph Heiss
6cab5ee31a Fix some warnings
openrw/rwengine/src/engine/GameData.cpp:358:26: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
    textureslots[slot] = std::move(loadTextureArchive(name));
                         ^
openrw/rwengine/src/engine/GameData.cpp:358:26: note: remove std::move call here
    textureslots[slot] = std::move(loadTextureArchive(name));
                         ^~~~~~~~~~                        ~

openrw/rwengine/src/objects/CharacterObject.cpp:16:18: warning: unused variable 'enter_offset' [-Wunused-variable]
static glm::vec3 enter_offset(0.81756252f, 0.34800607f, -0.486281008f);
                 ^

In file included from openrw/rwgame/RWGame.cpp:5:
openrw/rwgame/states/BenchmarkState.hpp:33:23: warning: 'BenchmarkState::getCamera' hides overloaded virtual function
      [-Woverloaded-virtual]
    const ViewCamera& getCamera();
                      ^
openrw/rwgame/State.hpp:51:31: note: hidden overloaded virtual function 'State::getCamera' declared here: different number of
      parameters (1 vs 0)
    virtual const ViewCamera& getCamera(float alpha);
                              ^
In file included from openrw/rwgame/RWGame.cpp:6:
openrw/rwgame/states/IngameState.hpp:53:18: warning: 'draw' overrides a member function but is not marked 'override'
      [-Winconsistent-missing-override]
    virtual void draw(GameRenderer* r);
                 ^
openrw/rwgame/State.hpp:28:18: note: overridden virtual function is here
    virtual void draw(GameRenderer* r) {
                 ^
In file included from openrw/rwgame/RWGame.cpp:6:
openrw/rwgame/states/IngameState.hpp:60:23: warning: 'getCamera' overrides a member function but is not marked 'override'
      [-Winconsistent-missing-override]
    const ViewCamera& getCamera(float alpha);
                      ^
openrw/rwgame/State.hpp:51:31: note: overridden virtual function is here
    virtual const ViewCamera& getCamera(float alpha);
                              ^
openrw/rwgame/RWGame.cpp:242:22: warning: unused variable 'vehicleModel' [-Wunused-variable]
            uint16_t vehicleModel = 110;  // @todo Which cars are spawned?!
                     ^

In file included from openrw/rwengine/src/script/modules/GTA3Module.cpp:1:
In file included from openrw/rwengine/src/engine/GameState.hpp:7:
openrw/rwengine/src/engine/ScreenText.hpp:140:63: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        const std::array<GameString, sizeof...(args)> vals = {args...};
                                                              ^~~~
                                                              {   }
openrw/rwengine/src/script/modules/GTA3ModuleImpl.inl:5669:16: note: in instantiation of function template specialization
      'ScreenText::format<std::__1::basic_string<unsigned short, std::__1::char_traits<unsigned short>, std::__1::allocator<unsigned short> > >'
      requested here
                        ScreenText::format(
                                    ^
In file included from openrw/rwengine/src/script/modules/GTA3Module.cpp:1:
In file included from openrw/rwengine/src/engine/GameState.hpp:7:
openrw/rwengine/src/engine/ScreenText.hpp:140:63: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        const std::array<GameString, sizeof...(args)> vals = {args...};
                                                              ^~~~
                                                              {   }
openrw/rwengine/src/script/modules/GTA3ModuleImpl.inl:10214:18: note: in instantiation of function template specialization
      'ScreenText::format<std::__1::basic_string<unsigned short, std::__1::char_traits<unsigned short>, std::__1::allocator<unsigned short> >,
      std::__1::basic_string<unsigned short, std::__1::char_traits<unsigned short>, std::__1::allocator<unsigned short> > >' requested here
            ScreenText::format(script::gxt(args, gxtEntry),
                        ^

openrw/rwgame/State.cpp:40:42: warning: unused parameter 'alpha' [-Wunused-parameter]
const ViewCamera& State::getCamera(float alpha) {
                                         ^

openrw/rwengine/src/render/ObjectRenderer.cpp:20:17: warning: unused variable 'kWorldDrawDistanceFactor'
      [-Wunused-const-variable]
constexpr float kWorldDrawDistanceFactor = kDrawDistanceFactor;
                ^
2017-10-13 19:54:10 +01:00
Filip Gawin
7b706e11d4 Fix text colors
On gtamodding.com is list
https://www.gtamodding.com/wiki/GXT#Tokens
2017-10-13 19:48:12 +01:00
Aldoxtor
7b0b82c502 implement isPlayer() 2017-10-08 18:29:14 +01:00
Daniel Evans
7f2c512f50 Use Renderer in place of raw GL calls in more places
Additionally, fix setBlend() enabling blending on every draw
2017-10-08 18:18:28 +01:00
Filip Gawin
6d67728b4f Fix opcode 00bc
After some researches I found that,
script with opcode 03d5 removes only short
connected with sound, not cutscene's text.

Example:
aa12022061/19_8ball.sc (L164)

But in case of cutscenes, script doesn't do anything,
so logically suspecting, all opcodes connected with key word NOW,
are flushing currently used text.

aa12022061/19_8ball.sc (L862)
2017-10-08 14:37:16 +01:00
Filip Gawin
26e7d57905 Fix opcode 03d5
As you can see in script:
https://github.com/Lighnat0r/GTA-III-SCM-Converted/search?utf8=%E2%9C%93&q=03d5&type=
Opcode 03d5 is cleaning only after 00BC.

00BC is using HighPriority, not Big.
2017-10-08 14:37:16 +01:00
Filip Gawin
cc61d3858d Implement opcodes arg = abs(arg)
Commit implements 0094, 0095,
0096, 0097
2017-09-28 22:21:53 +01:00
Filip Gawin
ca819e9ddc Implement opcodes feet --> meters
Implement 0425, 042D.
2017-09-28 22:21:53 +01:00
Filip Gawin
a6d153b163 Implement opcodes int <--> float
Implements 008c, 008d, 008e, 008f,
0090, 0091, 0092, 0093.
2017-09-28 22:21:53 +01:00
Filip Gawin
c16f565136 Implement 02f6 02f7 2017-09-28 22:21:53 +01:00
Filip Gawin
11e90c61e5 Simplify condition
Like suggested in #293.
2017-09-19 14:23:31 +01:00
Filip Gawin
391e993d1f Simplify condition and increase readability 2017-09-19 14:23:31 +01:00
Filip Gawin
27113e540f Deleting "empty", duplicated variables in CharacterState
All objects inherites variables: rotation and position from GameObject,
CharacterObject contains also CharacterState with empty,
never used position and rotation. They are not even initialized.

https://github.com/rwengine/openrw/search?utf8=%E2%9C%93&q=currentState&type=
https://github.com/rwengine/openrw/search?p=1&q=getCurrentState&type=&utf8=%E2%9C%93
2017-09-19 14:23:31 +01:00
Filip Gawin
2890280934 Convert default initialization to value initialization
Default initialization has a problem,
it doesn't initialize POD class,
so it's safer to use value initialization,
especially for "outside" class (like bullet).
2017-09-19 14:23:31 +01:00
Anonymous Maarten
02c60311ee rwlib/rwengine: make use of RW_ASSERT instead of assert 2017-09-16 22:19:39 +01:00
darkf
afe4928678 SoundManager: use av_frame_free, not av_free 2017-09-16 19:50:51 +01:00
darkf
8fd6d2f125 SoundManager: Set log level to error on release, warning on debug 2017-09-16 19:50:51 +01:00
darkf
f4f0f28a14 Support older libavcodec versions and update .travis.yml for new dependencies 2017-09-16 19:50:51 +01:00
darkf
ec2e940924 Remove libsndfile dependency 2017-09-16 19:50:51 +01:00
darkf
d69fdffdd1 Remove mman-win32 dependency 2017-09-16 19:50:51 +01:00
darkf
8e26431665 Remove dependency on libMAD (hurrah!) 2017-09-16 19:50:51 +01:00
darkf
4f60dcb663 Replace Music with Sound 2017-09-16 19:50:51 +01:00
darkf
c474bbe280 Implement FFmpeg audio decoder 2017-09-16 19:50:51 +01:00
Filip
8b067f4f69 Replacing "new" operators with make_unique/shared (#306)
* Replace "new" operator with std::make_unique for BS in BinaryStream.cpp

* Replace "new" operator with std::make_unique for textureArchive in TextureArchive.cpp

* Replace "new" operator with std::make_unique for variables in LoaderIDE.cpp

* Addition constructor for InstanceData

* Replace "new" operator with std::make_shared for instance  in LoaderIPL.cpp
2017-09-12 02:00:03 +01:00
Daniel Evans
b7ae0a54e4 Fix unused variable warning in rwengine 2017-09-12 01:44:22 +01:00
Aldoxtor
7a8c602c75 add missing override 2017-09-12 01:40:31 +01:00
Aldoxtor
fd5acc2be2 fixing magic numbers in playAnimation() 2017-09-12 01:35:24 +01:00
Anonymous Maarten
17bfa2cf74 rwengine: check for valid reads in DAT readers (in debug mode) 2017-09-12 00:55:41 +01:00
Anonymous Maarten
2e62a115bd rwengine: Ignore lines in DAT files starting with '*'
Last line starts with asterisk and would cause an uninitialized
DynamicsObjectDataPtr object to be inserted.
2017-09-12 00:55:41 +01:00
Anonymous Maarten
3488baae18 rwengine: Do not copy EndOfArgList to locals of created thread
integerValue RW_ERRORs for non-integer types
2017-09-12 00:55:41 +01:00
Anonymous Maarten
4700adb8c0 rwengine: std::map::end returns an iterator to the past-the-end element
Use std::map::rbegin instead
2017-09-12 00:55:41 +01:00
Anonymous Maarten
692ba92167 rwengine: extracting a float from a stream does not extract the f suffix
On Visual Studio 2017

std::istringstream ss("0.4f,0.8f,");
float f1, f2;
ss >> f1;          /* Will leave the f suffix available on the stream. */
ss.ignore(2, ','); /* Ignore until the comma. */
ss >> f2;
...
2017-09-12 00:55:41 +01:00
Filip Gawin
9e20ad6c20 ‘ObjectRenderer::m_errorTexture’ will be initialized after [-Wreorder] 2017-08-03 11:52:24 +01:00
Filip Gawin
950a83d4ba removing warning: ‘VehicleObject::mHasSpecial’ will be initialized after [-Wreorder] 2017-08-03 11:52:24 +01:00
ShFil119
d08c2686e1 Replace manual conversion with glm's function
Glm allows to use angle manipulation functions. One of them is conversion degrees to radians.
It gives optimal precision and isn't strictly connected with float.
https://glm.g-truc.net/0.9.4/api/a00136.html#ga4fb76e28851c9ff6653532566084e091
// Please close https://github.com/rwengine/openrw/pull/295 New pull request prevents trash in history, and it's easier to read.
2017-06-18 18:10:46 +02:00
Aldoxtor
963f490cf0 small clean up 2017-04-21 20:24:32 +01:00
Aldoxtor
4fdf3a2280 add missing headers 2017-04-21 20:24:32 +01:00