Commit Graph
100 Commits
Author SHA1 Message Date
Vasily 6cf009e915 Convert C++ code to read version string from file
This is definitely not a pretty thing. Double quotes are required around
the string which means they'll need to be removed in the NSIS and Python
scripts.
2019-04-19 22:29:20 +02:00
Vasily cd1522b9e2 Make windows build scripts read file for version number 2019-04-19 22:28:46 +02:00
Vasily e91c22d20a Change NSIS to look in file for version string 2019-04-19 22:28:06 +02:00
Vasily 82e2d1c863 Update version string to append "-dev" 2019-04-19 18:20:20 +02:00
Vasily 387ae30899 Fix indentation with clang-format 8
AppVeyor automatically updated to LLVM 8 while everything else was on 7.
It is not possible to downgrade to LLVM 7 on AppVeyor, so we'll update
everything else to LLVM 8.
2019-04-19 15:29:18 +02:00
Vasily 14e2a1a3d8 Add version output to Travis 2019-04-19 15:29:18 +02:00
Vasily 89ad18ef4c Add version output to AppVeyor 2019-04-19 15:29:18 +02:00
Vasily 2cee659c2d Update windows build docs for Qt 5.12
5.12.2 is the latest version and so the most likely version for people
to download.
2019-04-17 20:51:34 +02:00
Vasily 28700575ec Replace single quotes with double quotes
Variable was not being expanded otherwise.
2019-04-17 20:51:34 +02:00
Vasily e83363052a Add QT_SELECT to TL;DR: versions 2019-04-17 20:51:34 +02:00
Vasily ed9e4008af Make Linux build scripts directory agnostic
Using the script location as an anchor, the scripts can now be called
from anywhere and work.
2019-04-17 20:51:34 +02:00
Vasily 6895a44ddb Refactor build_linux.sh into configure.sh
This moves all the error handling and setup into configure.sh, for a
cleaner script.
2019-04-17 20:51:34 +02:00
Vasily 5fad6ca4d1 Add table of contents and reduce indentation of headers
The #### headers do not look very distinct in Github markup, reducing
the header indentation will make them stand out more.
2019-04-17 20:51:34 +02:00
Vasily 1cbfd7173b Update documentation for packages required on Linux 2019-04-17 20:51:34 +02:00
Vasily bcfcb72d18 Filter qt headers with regex 2019-04-17 20:51:34 +02:00
Vasily bd5b913f20 Add qt to clang system header prefixes
Clang-tidy will error on them otherwise.
2019-04-17 20:51:34 +02:00
Vasily 176687e0aa Update travis Qt PPA to 5.12 2019-04-17 20:51:34 +02:00
Vasily b5d63c8166 Update required Qt version to 5.12
On Ubuntu 16.04 and 18.04 it is not possible to get Qt 5.12 from the
official repo. You will need to get it from
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.12.2-bionic
which places the files in /opt. This leads qmake to including the files
as non system headers, which makes them spam errors. Adding them as
-isystem headers first prevents this.
2019-04-17 20:51:34 +02:00
Vasily a631aefb05 Update whitespace in .pro file 2019-04-17 20:51:34 +02:00
Vasily b53ebb699f Remove version specific header files for KeyboardInput
The headers were identical after no longer using the abstract class for
platform independence.
2019-04-04 14:01:11 +02:00
Vasily e7df60311c Convert keyboardinput from class to regular header
No consistent state is needed so it doesn't make sense for it to be a
class.
2019-04-04 14:01:11 +02:00
Vasily 82d44b4ab5 Move KeyboardInput file into keyboardinput folder 2019-04-04 14:01:11 +02:00
Vasily c8f4ea4ea0 Convert KeyboardInput to non-virtual class 2019-04-04 14:01:11 +02:00
Vasily 70381ea680 Add instruction to desktop overlay page
It is not apparent that reopening the overlay applies the changes. The
text will make that apparent. Centered to improve visibility.
2019-03-31 22:31:26 +02:00
Vasily 3cb04f4b90 Update documentation for the desktop overlay page 2019-03-31 22:31:26 +02:00
Vasily 1f7e731de1 Improve abstraction in update function 2019-03-31 22:31:26 +02:00
Vasily c0f6f2f621 Remove faulty function to set value with keyboard 2019-03-31 22:31:26 +02:00
Vasily e0ea7e3083 Fix incorrect behavior in QML 2019-03-31 22:31:26 +02:00
Vasily cba76f6846 Remove old desktop width C++ code 2019-03-31 22:31:26 +02:00
Vasily ab901e90fc Implement new way of handling Desktop Overlay width 2019-03-31 22:31:26 +02:00
Vasily 760d262a57 Add page to change desktop overlay translation
The implementation is simple 3D vector scaling and addition. The
HmdMatrix34_t consists of a 3x3 rotation matrix and a 3D vector for
position.

The overlay position is only updated whenever a new overlay is changed
because we need the old overlay position in order to modify it. The
openvr call to get the position is only updated whenever you open the
menu.

A new page was created due to lack of space on the utilities page.
2019-03-31 22:31:26 +02:00
Vasily 2e42773529 Add special message to Qt handler
This makes it more obvious where an error came from.
2019-03-31 14:19:05 +02:00
Vasily 96513c6d07 Fix null pointer dereference in QtMessageHandler function
The `QMessageLogContext` is only filled out in debug builds. Release
builds will have null pointers in `file` and `line`. This causes any
error attempted to be logged to result in a null pointer dereference.

Since we never use debug builds anyway, simply removing the uses of
`file` and `line` makes sense.

Github issue
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/139
2019-03-31 14:19:05 +02:00
username223 86fdc8f26f Refactor actions into separate action sets (#122)
* Fix indentation in action manifest

* Rename action sets to drop unnecessary prefix notation

Since the variable is in the action_sets namespace it does not make
sense to prepend it with an identifier for it being constant, or a set.

* Rename input keys to drop prefix notation

The vars are in a namespace that only contains constant inputs, it
doesn't make sense to prepend it to every var.

* Rename actions to drop prefixes

It is implicit that actions are const values for sets, therefore the
prefix is not needed.

* Remove unneeded action set member func

* Move active action set in preparation for more action sets

* Move action strings above class

Class is not able to use variables in namespaces, which is stupid.

* Move sets into member variable

* Split music into separate action set

* Convert action_manifest.json to spaces only

* Refactor actions into separate action sets

* Rename main set to haptic

* Reorder action sets

The haptics and misc sets are misc bindings.

* format

* fixed manifest path issue

* Change path concat to use QDir

The old way was not platform independent.

* Move accessibility actions to motion set

* Remove "(Held)" from action name

Might be confusing for end users.

* Replace slash with platform independent separator

* Make paths output native paths
2019-03-20 15:42:45 -05:00
Vasily fc34347c12 Add execute permissions on all scripts 2019-03-19 16:10:35 +01:00
Vasily 8e4c28c0c2 Add g++-7 to clang CI
This is needed for std::optional.
2019-03-19 16:10:35 +01:00
Vasily 24196e9940 Update Linux building docs 2019-03-19 16:10:35 +01:00
Vasily c9f5c1a493 Add .vrmanifest to .gitattributes file 2019-03-19 16:10:35 +01:00
Vasily 1af49c0da7 Update run script with different library call 2019-03-19 16:10:35 +01:00
Vasily d9c4d223fc Update Linux build script 2019-03-19 16:10:35 +01:00
Vasily 97776b5776 Change binary dir to be binary dir for all OS
Linux did not see AppDataLocation as the binary directory, but as an
arbitrary dir in the home folder.
2019-03-19 16:10:35 +01:00
Vasily f86221d8fd Change logging call in main
Previously no file was being output.
2019-03-19 16:10:35 +01:00
Vasily 04c59d5f20 Convert setup to new paths 2019-03-19 16:10:35 +01:00
Vasily 98d1a62947 Remove unneeded imports 2019-03-19 16:10:35 +01:00
Vasily 6c0ae194a5 Convert main to new paths 2019-03-19 16:10:35 +01:00
Vasily e1866e635f Convert logfile to use new paths functions 2019-03-19 16:10:35 +01:00
Vasily d654567d98 Convert to new paths system 2019-03-19 16:10:35 +01:00
Vasily 62dcea6943 Replace dedicated functions with single binary function
There are only 1 or 2 calls to specific directories in the codebase,
hence this is unnecessary and just leads to bloat.
2019-03-19 16:10:35 +01:00
Vasily d6660049e9 Implement prototype Qml path function 2019-03-19 16:10:35 +01:00
Vasily 1d05ae96f9 Implement prototype paths in manifest class 2019-03-19 16:10:35 +01:00
Vasily ac4a124450 Add prototype for binary directory functions 2019-03-19 16:10:35 +01:00
Vasily b770d869ae Add initial planning for paths API
The idea is to reduce manual string directories in the general code as
much as possible, in order to reduce typos and general weirdness.
2019-03-19 16:10:35 +01:00
username223 921aa4ef57 Move audio profile popup to center of screen (#110) 2019-03-16 19:37:49 -05:00
Vasily a70fade089 Create DigitalAction and AnalogAction types
This errors at compile time if the wrong action is being used, instead
of at runtime.
2019-03-16 14:07:26 +01:00
Vasily 09b8458a57 Correct forward slashes to backslashes in installer script
It works with a mix, but all other paths are backslashes.
2019-03-11 20:42:49 +01:00
Vasily 82f890cbbc Add icons to Windows Installer file 2019-03-11 20:42:49 +01:00
Vasily e4f2b5369a Change windows executable icon 2019-03-11 20:42:49 +01:00
Vasily cbb13c4b72 Change icon in SteamVR 2019-03-11 20:42:49 +01:00
Vasily 815fc15414 Fix formatting
QtCreator does not reformat things when using the "Refactor Symbol"
option.
2019-03-11 12:42:35 +01:00
Vasily 7e6e06c649 Change SteamVR application key to OVRAS-Team.AdvancedSettings
This makes SteamVR treat it as a new application, which might prevent
weird non-reproducible bugs from popping up that we don't have any
control over.
2019-03-11 12:02:59 +01:00
Vasily e04a9355ea Move log and settings file to APPDATA/AdvancedSettings-Team
Keeping the logfile in a separate folder did not make sense.
2019-03-11 11:44:14 +01:00
Vasily 783e8093bd Refactor logfile name to be variable 2019-03-11 11:33:48 +01:00
Vasily 2d6d482f2d Refactor log file location to use application strings 2019-03-11 11:32:44 +01:00
Vasily 5b9e94869c Move application strings into separate namespace
Them being in the overlay controller required them to be static, which
forces the compiler to give them a memory location at compile time. They
also don't really fit into the overlaycontroller.
2019-03-11 11:24:57 +01:00
Vasily cab99041be Rename QML singleton to "ovras.advsettings"
This is more generic and in line with the rest of the renames.
2019-03-11 11:09:19 +01:00
Vasily f23b1bd7ad Move singleton name into variable 2019-03-11 10:49:26 +01:00
Vasily 9b701688fd Make desktop overlay log debug instead of info
This prevents spam of something that is highly likely to happen and out
of our control.
2019-03-10 23:12:26 +01:00
Vasily d078bd88a4 Move definitions from header file to cpp file
Clang-tidy does not like definitions in header files unless they're
inline.
2019-03-10 23:12:26 +01:00
Vasily 7bc5720bd6 Remove outdated info from readme and fix typo 2019-03-10 23:12:26 +01:00
Vasily dd5ae97b62 Move ivrinput into openvr folder
Doesn't make sense for it to have it's own folder when there's an openvr
folder now.
2019-03-10 23:12:26 +01:00
Vasily b7ff972997 Update desktop overlay waiting logic
The old version waited for a set amount of time (2 seconds) before
checking and then exiting. The new logic checks every second for up to 7
seconds. This should deal with variances in startup time across
machines. On my machine the desktop overlay seems to be initialized
after 2-3 seconds.
2019-03-10 23:12:26 +01:00
Vasily 0bb22090ba Replace easylogging parsing from string to explicit calls
This makes sure that there are no typos in the string. And prevents the
few bytes of string from being included in the final binary.
2019-03-10 23:12:26 +01:00
Vasily ef223b90a1 Remove end user changing logging settings
Fixes
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/63

Removes the ability for end users to change logging settings. This was
deemed unnecessary because logging is a developer troubleshooting tool
and users being able to change it could almost only introduce problems.

People who want to change the logging settings can compile from source.
2019-03-10 23:12:26 +01:00
Vasily fd4ab3b0e5 Remove old comments 2019-03-10 23:12:26 +01:00
Vasily 09251b04aa Move openvr_into openvr folder 2019-03-10 23:12:26 +01:00
Vasily 4a108f319a Remove old comment 2019-03-10 23:12:26 +01:00
Vasily 9f85af81d1 Save desktop width setting
The 2 seconds is arbitrarily chosen. The problem seems to be that
Valve's own overlays are not being initialized before custom overlays,
leading to the Desktop overlay sometimes not being present when our
overlay initializes.

The second if statement inside the first one checking a second time is
definitely a little disgusting, but for now it gets the job done.

The 4.0 default was arbitrarily chosen by whoever decided to initialize
the variable in the class.
2019-03-10 23:12:26 +01:00
Vasily 1d103a5265 Move desktop overlay set up into separate function 2019-03-10 23:12:26 +01:00
Vasily 293ca21af5 Convert openvr_init from class to function
Since the OpenVR initialization code is no longer inside the
overlaycontroller there is no need for it to be available during object
construction. Therefore it doesn't make sense to have it be an object.

The shutdown call was completely removed because shutdowns are handled
by an OpenVR event that calls the relevant shutdown code. The destructor
for the old object was never called, removing it adds clarity to the
actual operation of the code and also removes unnecessary code.
2019-03-10 23:12:26 +01:00
Vasily 37e0366e9d Move OpenVR init function out of Overlaycontroller
This prevents the issue of OpenVR not being initialized in constructors
of other objects, and there's really no reason not to do it.
2019-03-10 23:12:26 +01:00
Vasily 9f24099a93 Update documentation for new command line arguments 2019-03-10 23:12:26 +01:00
Vasily 45bb199a0d Replace arg parsing function with Qt built ins
This automatically provides version and help functions, and offloads the
arg parsing to a third party lib.
2019-03-10 23:12:26 +01:00
Vasily 5d2901be33 Remove option forcing bindings to show up in SteamVR
Overlay applications show up in the bindings menu after SteamVR beta
1.3.1, making these features unnecessary.
2019-03-10 23:12:26 +01:00
Vasily 84be2090c8 Move setup code in main to separate file
This makes it easier to find the entry point for the program and also
moves a lot of implementation out of the main.cpp file.
2019-03-10 23:12:26 +01:00
Vasily 38a2765b10 Add proper exit to shutdown code
The old shutdown code did not correctly exit but instead just
continuously called the QApplication notify function until it
SEGFAULTed. This led to crashes whenever SteamVR was shut down. Users
with Windows Error Reporting turned on would get a 100+ MB crashdump
file along with increased shutdown time for SteamVR.

For clarity the shutdown functions should probably be collected in a
single function.
2019-03-02 09:45:33 +01:00
Vasily 3211379844 Fix installer not putting default manifests in correct folder
Fixes this
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/80

Including things with
File "FILE\*.json"
includes the file in the base directory. Including it with /R
recursively includes the directory.
2019-02-28 21:16:53 +01:00
Vasily b75957fbaa Fix typo in .gitattributes 2019-02-28 21:16:53 +01:00
Vasily 1ea554ccb4 Update docs on building on Linux 2019-02-28 21:16:53 +01:00
Vasily da25e58cbb Add clang-tidy, create Linux build script
clang-tidy is currently set up with errors for all checks that do not
warn. This is to prevent regressing the repo.

Gradually these warnings should be removed in order to prevent further
regresssions in warnings that do not have many occurences.
2019-02-28 21:16:53 +01:00
Vasily dbb1ab70e5 Clarify cast in easylogging++
`tval.tv_usec` is a (signed) `long` and `ssPrec->m_offset` is an
`unsigned int`. Clang warns upon realizing that we are attempting to
divide a signed `long` with an `unsigned int`.

Casting the `long` to `unsigned long` makes both operands `unsigned` and
allows for auto conversion to `size_t`.

The `size_t` cast is to make it apparent that the cast is correct.
2019-02-21 18:48:53 +01:00
Vasily 4814c4686f Add brackets to optimize statement
Not having brackets forces the compiler to see the statement as (xdelta
* 360.0) * 8.0, which requires two `mulsd` operations. Adding the
brackets only requires one.

More details here
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/pull/87
2019-02-21 18:48:53 +01:00
Vasily 90ad7e7270 Remove extra parens 2019-02-21 18:48:53 +01:00
Vasily 2da88237f2 Remove -Wmissing-variable-declaration from GCC
GCC does not support it.
2019-02-21 18:48:53 +01:00
Vasily 81ae0efd1c Add -Wmissing-variable-declarations to all clang/gcc compilers 2019-02-21 18:48:53 +01:00
Vasily 9ab0b1d62d Remove -Wextra-semi for GCC
It is not currently supported yet by GCC.
2019-02-21 18:48:53 +01:00
Vasily 9d46358309 Add -Wzero-as-null-pointer-constant and fix occurences 2019-02-21 18:48:53 +01:00
Vasily 896559cc20 Add -Wextra-semi and fix occurences 2019-02-21 18:48:53 +01:00
Vasily d66e50e318 Fix wrongly placed parens 2019-02-21 18:48:53 +01:00
Vasily a93c7500d3 Fix GCC -Werror=conversion
Was mistakenly cast to long long unsigned int instead of double.
2019-02-21 18:48:53 +01:00
Vasily e99b36f610 Fix GCC -Werror=conversion in easylogging++ 2019-02-21 18:48:53 +01:00