1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00
Commit Graph

475 Commits

Author SHA1 Message Date
mole99
8d7cb91b60 Added window configs 2018-05-19 16:25:34 +02:00
NFS_MONSTR
b019d187d6 Fixed loading ZoneCylinder texture 2018-05-19 17:13:47 +03:00
Filip Gawin
93278ecb4e
Increase tickrate to 1/60
It should reduce level of perceptibility physics bugs and tearing non-interpolated objects.
2018-05-16 20:44:55 +02:00
Filip Gawin
4e1948c23c Rearrange passing args to functions/ctors
Kill extra shared_ptr by passing them using const reference.
Use perfect forwarding for strings.
Remove redundant std::move.
2018-05-16 19:17:13 +02:00
husho
ffeb83d56b Off by 1 error fix 2018-05-16 17:51:33 +03:00
husho
ee2421de41 Missions debug menu 2018-05-15 23:44:34 +03:00
darkf
0df204b430
Merge pull request #398 from ShFil119/various
Various, small changes
2018-04-30 04:42:41 -05:00
Tomi Lähteenmäki
9929f9304f Fix pausing cutscenes 2018-04-27 22:16:33 +03:00
Filip Gawin
2d5d70c1b2 More constexpr 2018-04-17 16:15:17 +02:00
Filip Gawin
2aa6d3b3b3 More nullptr 2018-04-17 16:15:17 +02:00
Filip Gawin
cf5efb9560 Use "= default" for trivial ctor/dtor 2018-04-17 16:15:17 +02:00
Anonymous Maarten
4ebc66b544 rwengine+rwgame: add missing includes 2018-02-13 22:15:26 +00:00
Anonymous Maarten
58f219c04d rwgame: rwgame needs an entry point (main) using vs2017 2018-02-13 22:15:26 +00:00
Christoph Heiss
45107f5afb Fix segfault on pressing Command+q in main menu. 2018-02-09 22:58:49 +00:00
Lucas Eriksson
51a547ee45 Create debugstate submenu weather. 2018-02-09 22:48:09 +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
Filip Gawin
73a5daab82 Use range loop 2018-02-06 19:19:09 +00:00
Florin9doi
e5694b383c Map flashing 2018-01-29 23:50:44 +00:00
Anonymous Maarten
c0a4d627af rwengine: iwyu: reduce warnings in render subdirectory 2018-01-08 22:52:48 +00:00
Anonymous Maarten
d07beff43e rwengine: iwyu: reduce warnings in objects subdirectory 2018-01-08 22:52:48 +00:00
Anonymous Maarten
fb58dfb082 rwengine: iwyu: reduce warnings in engine subdirectory 2018-01-08 22:52:48 +00:00
Filip Gawin
6d80ce6424 Cleanup, use c++11 override
Maybe some of replace with
final, what do think?
2018-01-08 22:35:21 +00:00
Filip Gawin
4a3a6daa9f Change type of GameBase dtor to virtual
There's no usage of this class, so
I've set dtor to pure virtual.
2018-01-08 22:35:21 +00:00
Filip Gawin
ef4456e623 size() -> empty()
Empty has always
computational complexity O(1).
2017-12-17 01:48:49 +00:00
Anonymous Maarten
6ab7f642ac rwgame: group command line arguments thematically
New output:
$ ./rwgame --help
I [Game] Build: 815c63cf
Generic options:
  -c [ --config ] PATH     Path of configuration file
  --help                   Show this help message

Window options:
  -w [ --width ] WIDTH     Game resolution width in pixel
  -h [ --height ] HEIGHT   Game resolution height in pixel
  -f [ --fullscreen ]      Enable fullscreen mode

Game options:
  -n [ --newgame ]         Directly start a new game
  -l [ --load ] PATH       Load save file

Developer options:
  -t [ --test ]            Starts a new game in a test location
  -b [ --benchmark ] PATH  Run benchmark from file
2017-11-17 00:50:50 +00:00
Anonymous Maarten
853c1a01b2 rwgame: remove unused unimplemented function definitions 2017-11-17 00:50:50 +00:00
Anonymous Maarten
07a5729cef rwgame: create matrix from vectors (instead of elements) 2017-11-17 00:50:50 +00:00
Anonymous Maarten
a9f009f97f rwgame: do not copy cheat names 2017-11-17 00:50:50 +00:00
Anonymous Maarten
5edead61d0 rwgame: create texture filename in buffer in one go 2017-11-17 00:50:50 +00:00
Anonymous Maarten
820c4bd25c rwengine: GameData accepts rwfs::path as path of game data 2017-11-17 00:50:50 +00:00
Anonymous Maarten
55dd0beea0 rwgame: allow configuration files from all places (not only config path)
- add it as an argument to the rwgame executable
- update the tests
2017-11-17 00:50:50 +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
06c4bf09f7 cmake: make OpenGL an imported target 2017-10-29 20:40:57 +00:00
Anonymous Maarten
5dc707aaed cmake: make OpenAL 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
e555331748 cmake: be more specific about Boost library to link with
CMake 3.2's FindBoost.cmake does not support boost:: namespaces
2017-10-29 20:40:57 +00:00
Anonymous Maarten
66a28acaa4 cmake: make SDL2 an imported target 2017-10-29 20:40:57 +00:00
Anonymous Maarten
282a6e2714 cmake: reformat rwgame/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
Filip
c54cfa0ae8 Avoid making unnecessary copies (#337)
* frames.emplace_back

* vehicleColours.emplace_back

* colours.emplace_back

* waterBlocks.emplace_back

* state.garages.emplace_back

* bonedata->frames.emplace_back

* lines.emplace_back

* circleVerts.emplace_back

* geo.emplace_back

* Water renderer

* perf_colours.emplace_back
2017-10-29 17:14:07 +00:00
Filip Gawin
512ac6f5ee Fix double promotion 2017-10-25 01:17:46 +01:00
Anonymous Maarten
fa36c56813 rwgame: close window explicitly at end of event loop to free GL Context 2017-10-18 21:52:29 +01:00
Filip Gawin
bc8652baba Interpolating dynamic objects
How?
Calling stepsimulation each frame,
bullet interpolate vehicles and characters for us.

Removed unneeded code:
"float alpha = fmod(dt, GAME_TIMESTEP) / GAME_TIMESTEP;"
It looks like alpha shift is

I also removed unneeded variable clock
and refactored names to match bullet's example.

We should alse think about problem of
crossing the range of float.
2017-10-18 21:29:17 +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
Waritnan Sookbuntherng
c4f532fd56 Pause chase when the game paused 2017-10-13 19:12:30 +01:00
Daniel Evans
887e0333c8 Improve state access to always get the current scene
Prevents events being recieved by states that are no-longer in effect

Fixes #292
2017-09-17 00:45:58 +01:00
Anonymous Maarten
a1333360c5 rwlib: Add option to abort/break on failed checks or at request
- RW_ABORT/RW_ASSERT/RW_BREAKPOINT are only defined in debug mode
- the callback is needed to unlock the mouse when entering
    the debugger
2017-09-16 22:19:39 +01:00
darkf
1bca493dfa Remove last mman reference 2017-09-16 19:50:51 +01:00
Aldoxtor
7a8c602c75 add missing override 2017-09-12 01:40:31 +01:00
Anonymous Maarten
0308f809d6 config: Add the unknown keys to the what() message 2017-08-15 15:58:01 +01:00
Anonymous Maarten
a92f24cbb4 config: unknown data will be kept in memory and saved onto disk 2017-08-15 15:58:01 +01:00
Aldoxtor
81734ae2fe initialize some variables in constructor 2017-04-21 20:24:32 +01:00
vflyson
57ad566681 improve the ammo count display logic 2017-03-13 19:15:15 +00:00
vflyson
87fb087485 only allow to scroll through weapons if alive 2017-03-13 19:15:15 +00:00
Anonymous Maarten
d8cda62668 config: fix input string parsing 2017-02-20 01:01:30 +00:00
Anonymous Maarten
e28e429b86 rwgame+config: show an error dialog when an error occurred on parsing the config file 2017-02-20 01:01:30 +00:00
Anonymous Maarten
76f2665acf config: log parsing Errors to a ParseResult object (which is queryable) 2017-02-20 01:01:30 +00:00
Anonymous Maarten
e0813e4378 config: fix TempFile.touch() + TempFile test + extra doc of getValidConfig 2017-02-20 01:01:30 +00:00
Anonymous Maarten
90001b11ac config: fix reading of illegal values
The parser would crash when trying to convert e.g. "d" to an integer.
2017-02-20 01:01:30 +00:00
Anonymous Maarten
fe156e2984 config: bail out on invalid values
Avoid srcTree being filled with un-initialized values
such as bools, ints, floats...
2017-02-20 01:01:30 +00:00
Anonymous Maarten
66b09a64a5 config: added default INI string test + simplified tests + removed WTF 2017-02-20 01:01:30 +00:00
Anonymous Maarten
8f5664498c config: saveConfig + tests added 2017-02-20 01:01:30 +00:00
Anonymous Maarten
ed185f2526 config: add tests on reading good and bad configuration files 2017-02-20 01:01:30 +00:00
Anonymous Maarten
1dc06d9a35 config: do not use dynamic memory + bail out early on error 2017-02-20 01:01:30 +00:00
Anonymous Maarten
05db65dbbc config: allow reading INI from string, file, default and current config
This (slightly more complicated implementation) allows us,
once a configuration menu has been implemented,
to store the current/new configuration to a INI file.

The definitions of the parameters in rwgame/GameConfig.cpp
is limited to one location.
2017-02-20 01:01:30 +00:00
Anonymous Maarten
a725a51baa spelling: recieve -> receive 2017-02-20 01:01:30 +00:00
Anonymous Maarten
65b14fcb9c config: use boost::property_tree for INI read and default generation
* remove inih
* input.invert_y has now behavior as described on wiki
2017-02-20 01:01:30 +00:00
vflyson
aa8ea65f92 properly display the ammo count for weapons which don't have a clip 2017-02-19 00:57:30 +00:00
vflyson
9fc38c5d51 display the proper UI icon texture for detonator 2017-02-19 00:57:30 +00:00
vflyson
4121378729 make it impossible to scroll through weapons while driving 2017-02-19 00:57:30 +00:00
Vincent Flyson
481a705c39 make the health indicator blink if low (#267)
* make the health indicator blink if low
2017-02-15 00:30:28 +00:00
Daniel Evans
8e4d73fca9 Rename Model -> Clump 2017-02-08 21:44:25 +00:00
Daniel Evans
bb9e368dca Prevent traffic from spawning in cutscenes 2017-01-30 21:40:17 +00:00
Daniel Evans
bb6698e373 Implement Hierarchy of game ZoneData
This allows querying of the most specific ZoneData for a given point
2017-01-30 00:24:44 +00:00
haphzd
e6ec1b69f0 Bring back culling events counter 2016-12-10 22:19:38 +03:00
haphzd
b5079f4ae2 Update profiler graphs drawing routine to use GameString 2016-12-10 21:52:02 +03:00
Daniel Evans
7c41821b6c Use relative mouse motion to control player look 2016-12-06 22:43:01 +00:00
Daniel Evans
247f66f60d Move cutscene and fixed camera control into IngameState 2016-12-04 01:33:26 +00:00
Daniel Evans
ddb62ed3cd Rewrite of camera and character look code
Make states responsible for interpolating camera transformation
Apply look direction to character orientation
2016-12-04 01:06:27 +00:00
Daniel Evans
d75c476221 Remove global texture list and use a slot name to lookup textures 2016-12-03 21:59:37 +00:00
Daniel Evans
b65a513bbb Remove usages of WorkContext 2016-12-02 00:56:38 +00:00
Daniel Evans
6ef99c0de9 Fix crash starting new game
The player doesn't always exist, so we do need to check..
2016-11-24 21:30:43 +00:00
Daniel Evans
f0e0e6e747 Extract game input state handling from IngameState
Prevents input getting "stuck" when input is removed in the pause menu
2016-11-19 23:50:34 +00:00
Daniel Evans
40f18dabb0 zero all input when player input is disabled 2016-11-19 23:50:34 +00:00
Daniel Evans
57edc3648b Detect event starts by double-buffering state 2016-11-19 23:50:34 +00:00
Daniel Evans
684e32f4a9 Simplify Script system by removing SCMOpcodes
This was just a useless container for a set of modules. We only have
one module now so don't bother with it. This means we can remove some
more raw new & deletes from RWGame too.
2016-10-24 21:29:41 +01:00
Daniel Evans
fb4d9ea8c3 Use unique_ptr for GameWorld instance 2016-10-24 21:29:41 +01:00
Daniel Evans
81c27da97b Make GameState instance a direct member of RWGame 2016-10-24 21:29:41 +01:00
Daniel Evans
32352baedd Remove very dead debug code 2016-10-24 21:29:41 +01:00
Daniel Evans
d62e8a6cd2 Make MenuEntry height a property of the Menu 2016-10-24 21:29:41 +01:00
Daniel Evans
613d386488 Improve Menu system implementation 2016-10-24 21:29:41 +01:00
Daniel Evans
6a7802de87 Overhaul State and StateManager to remove pointers
Removed raw State pointers in favour of unique_ptrs
Avoid allowing control flow to re-enter States that have exited
Defer releasing states until the end of the frame
2016-10-24 21:29:40 +01:00
Daniel Evans
c54273bb63 Correct RWGame.hpp header guard 2016-10-19 22:34:51 +01:00
Daniel Evans
ad998e8a80 Avoid allocating RWGame members where possible
These objects don't need to be dynamically allocated, they can
take on the same lifetime as RWGame itself.
2016-10-19 22:34:51 +01:00
Daniel Evans
2f118631dc Move some non-game code into GameBase class
This moves window setup and configuration loading into a base
class so that RWGame can focus on game related matters
2016-10-19 22:34:51 +01:00
Daniel Evans
657a726a9b Initialise logging outside of RWGame 2016-10-19 22:34:51 +01:00
Daniel Evans
5c78930c1b Remove InventoryItem and WeaponItem
They served no purpose other than to awkwardly implement weapon firing
This is now handled in the Weapon::fire* functions, and everything else
has been changed to reference weapon data or inventory indices directly
2016-10-19 22:14:52 +01:00
Daniel Evans
13f504d699 Draw nearby object state in object debug view 2016-10-13 22:31:26 +01:00