Commit Graph

69 Commits

Author SHA1 Message Date
Léo Lam 858f00b641
Merge pull request #9492 from nolange/fix_norandr_build
Cleanup X11 and XRANDR Macros
2021-03-01 11:36:39 +01:00
Norbert Lange 29eaf09be4 Cleanup X11 and XRANDR Macros
This fixes build with X11 enabled and XRANDR disabled.
2021-02-22 14:30:43 +01:00
Léo Lam 522cb6b137
IOS: Use less ambiguous names for classes
Some of the device names can be ambiguous and require fully or partly
qualifying the name (e.g. IOS::HLE::FS::) in a somewhat verbose way.

Additionally, insufficiently qualified names are prone to breaking.
Consider the example of IOS::HLE::FS:: (namespace) and
IOS::HLE::Device::FS (class). If we use FS::Foo in a file that doesn't
know about the class, everything will work fine. However, as soon as
Device::FS is declared via a header include or even just forward
declared, that code will cease to compile because FS:: now resolves
to Device::FS if FS::Foo was used in the Device namespace.

It also leads to having to write IOS::ES:: to access ES types and
utilities even for code that is already under the IOS namespace.

The fix for this is simple: rename the device classes and give them
a "device" suffix in their names if the existing ones may be ambiguous.
This makes it clear whether we're referring to the device class or to
something else.

This is not any longer to type, considering it lets us get rid of the
Device namespace, which is now wholly unnecessary.

There are no functional changes in this commit.

A future commit will fix unnecessarily qualified names.
2021-02-12 21:40:31 +01:00
Léo Lam aaaa3896c0
VideoCommon: Get rid of the global g_available_video_backends
Replace it with a function-local static that is initialized on first
use. This gets rid of a global variable and removes the need for
manual initialization in UICommon.

This commit also replaces the weird find_if that looks for a non-null
unique_ptr with a simple "is vector empty" check considering that
none of the pointers can be null by construction.
2020-10-21 22:00:10 +02:00
Jordan Woyak 50ec747840 Clean up screen saver inhibition and apply setting change immediately. 2020-10-18 16:31:48 -05:00
JosJuice b0f9bb9f13 Port some settings to the new config system
Other than the controller settings and JIT debug settings,
these are the only settings which were defined in Java code
but not defined in the new config system in C++. (There are
still a lot of settings that are defined in the new config
system but not yet saveable in the new config system, though.)
2020-08-03 15:07:53 +02:00
Léo Lam 8df56cb319 Migrate video backend setting to the new config system
Fixes https://bugs.dolphin-emu.org/issues/12087
2020-05-22 16:54:53 +02:00
Techjar ac9b246809 Core/UICommon: Fix EnableScreenSaver preprocessor directive
The include for X11Utils.h (and by extension Xlib.h) is gated behind
HAVE_XRANDR, as well as the declaration for this function, but its
definition was mistakenly gated behind HAVE_X11. Therefore, if we have
X11 but not Xrandr, the build will fail due to declaration/definition
mismatch and the missing Window type.
2020-05-13 02:11:29 -04:00
JosJuice 466b2d7202 DolphinQt: Make block size configurable in convert dialog 2020-04-24 15:11:20 +02:00
JosJuice 1b844067aa Back up Wii setting.txt and SYSCONF while emulating
When booting a Wii game, Dolphin can overwrite certain settings
in the SYSCONF file, such as turning off PAL60 for NTSC games.
Normally, these settings get reverted at the end of emulation, but
this does not happen if Dolphin crashes or force quits in some other
way. (Personally, I have a tendency to use Visual Studio's Stop
Debugging button, which kills the process...)

Dolphin also overwrites certain values in setting.txt when booting
a Wii game. Unlike with SYSCONF, we currently make no effort to
preserve the original values in this file.

This change fixes both of these problems by copying SYSCONF and
setting.txt to the Backup folder when booting a Wii game, and then
copying them back either when launching Dolphin (in case the
previous run of Dolphin crashed) or when ending emulation.
2020-03-16 21:04:19 +01:00
Jordan Woyak 956339df4e Core/WiimoteReal: Make wiimote source type an enum class and add Get/SetWiimoteSource functions. Add connected real Wii Remotes to a pool when a slot is not available. 2020-01-05 10:15:22 -06:00
David Korth c2dd2e8a2e Use std::istringstream or std::ostringstream instead of std::stringstream where possible.
This removes std::iostream from the inheritance chain, which reduces
overhead slightly.
2019-12-29 23:45:02 -05:00
Lioncash c792961000 Common: Unify logging namespace with Common
Previously the logging was a in a little bit of a disarray. Some things
were in namespaces, and other things were not.

Given this code will feature a bit of restructuring during the
transition over to fmt, this is a good time to unify it under a single
namespace and also remove functions and types from the global namespace.

Now, all functions and types are under the Common::Log namespace. The
only outliers being, of course, the preprocessor macros.
2019-11-28 05:13:21 -05:00
Léo Lam f4e12f85bc
Merge pull request #8393 from CookiePLMonster/long-paths
Support Windows 10 long paths
2019-11-09 21:10:16 +01:00
iwubcode 490fd0c3b3 DolphinQt: Add way to override "ResourcePack" folder that controls the location of resource packs 2019-11-02 13:42:40 -05:00
iwubcode 876a1ccc3e DolphinQt: Add way to override "Load" folder that controls the location of custom textures 2019-11-02 13:30:44 -05:00
Silent 3b21d32865
Remove MAX_PATH limit from:
- GetTempFilenameForAtomicWrite
- SetUserDirectory
2019-10-07 22:45:16 +02:00
Lioncash 4f1f55093f Common/MsgHandler: Namespace code within the Common namespace
Closes another gap in the Common library where code isn't being
namespaced under it.
2019-06-19 16:03:55 -04:00
Lioncash c0c0e412e0 Core/ConfigManager: Use forward declarations where applicable
Avoids dragging in IniFile, EXI device and SI device headers in this header which is
quite widely used throughout the codebase.

This also uncovered a few cases where indirect inclusions were being
relied upon, which this also fixes.
2019-06-07 19:54:39 -04:00
Techjar ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
Léo Lam 99a4ca8de7
Merge pull request #7839 from ShFil119/impr/redundant
Remove redundant initialization
2019-05-04 22:50:51 +02:00
Mikaela Szekely 8fe7e271f3
UICommon: Properly set user dir if ./user is a file (not a directory) 2019-05-03 23:30:50 -06:00
Filip Gawin c110ffcdaa Remove redundant initialization 2019-04-30 01:22:24 +02:00
iwubcode 840afc2ad4 Config: Move the 'Display' settings from ConfigManager to the layered config system 2019-03-30 18:43:02 -05:00
spycrab 71d53c922f Implement resource packs 2018-12-19 11:03:09 +01:00
weihuoya eefef73141 nomedia, add comment text 2018-08-15 19:41:55 +08:00
weihuoya 2fac523e10 hide game cover in android gallery 2018-08-15 16:37:00 +08:00
spycrab 8fb3085b07 Revert "Revert "Qt/GameList: Add option to show covers in grid mode"" 2018-07-30 03:16:37 +02:00
Pierre Bourdon 9b94c76f81
Revert "Qt/GameList: Add option to show covers in grid mode" 2018-07-28 03:03:21 +02:00
spycrab 5ade5f4fe7 Qt/GameList: Add option to show covers in grid mode 2018-07-27 11:14:24 +02:00
Pierre Bourdon 2cfdf89898
Merge pull request #6983 from yourWaifu/add-discord-rpc-support
Add Discord Rich Presence support
2018-06-25 00:06:27 +02:00
Ryan Meredith 45b9b7d211 Give Dump Objects dedicated folder and tooltip 2018-06-06 08:42:41 -04:00
Sleepy Flower Girl d5303ddf0b Add Discord Rich Presence support 2018-06-03 15:27:20 -04:00
Léo Lam c99ac40700 Port FS, SD and dump path to onion config
This ports the Wii filesystem root, Wii SD card path and dump path
settings to the new config system (OnionConfig).

My initial plan was to wait until DolphinWX was removed before porting
most of the Main (Core, DSP, General) settings to onion config, but
I've decided to submit a small part of those changes to fix
[issue 10566](https://bugs.dolphin-emu.org/issues/10566).

Removes the need to manually set the FileUtil path in the UI frontends
and gets rid of some more members that don't really belong in SConfig.

Also fixes a bug which would cause the dump path not to get created
after change.
2018-05-23 16:07:18 +02:00
Léo Lam 94dc746351 Copy Wii NAND data to user NAND in WiiRoot
Dolphin doesn't use any of the WC24 files, so this can be done when
actually starting emulation in WiiRoot. The benefit of moving the
copy is that we don't need to handle temporary NANDs in a special way.
2018-05-12 17:08:50 +02:00
spycrab 0170052f5d Qt: Allow custom stylesheets 2018-05-08 15:07:50 +02:00
Léo Lam 2f22c76db1 UICommon: Avoid including Xrandr.h
Xlib has really terrible headers that declare non-namespaced
macros and typedefs for common words.

Just wasted 10 minutes trying to figure out why a unit test failed
to build before I remembered it was Xrandr.h conflicting with our
enum class members again.

To fix the issue, this removes the Display* parameter from the
EnableScreensaver function (which was unused) so we don't have
to include Xrandr.h anymore.
2018-04-14 17:14:38 +02:00
JosJuice a66d56aece Use configured locale in UICommon::FormatSize
StringFromFormat always uses the C locale, so we can't use it if we want
the decimal separator to be locale aware, but we can use a stringstream.
2018-04-09 19:14:15 +02:00
JosJuice 72040600d7 Set locale to "en_GB" if "en" is configured 2018-04-09 19:14:14 +02:00
JosJuice 9417fc6a3a DolphinWX: Set C++ locale
After 3a83ebc, the Show System Clock feature started using the
unfortunate combination of MM/DD/YY dates (rare outside of the US)
and 24-hour time (rare in the US) regardless of the user's locale
settings. This commit makes it use the configured locale again.

I've noticed one minor difference in behavior between now and
before 3a83ebc: The new way of setting the C/C++ locale seems to
treat "en" as "en-US", but the wx way of setting the C locale
treated it as "en-GB" (at least on Windows).
2018-04-09 19:14:14 +02:00
Léo Lam 793c6d25f4
Merge pull request #4532 from Neui/env-var-usr-cfg
Use $DOLPHIN_EMU_PATH as an alternative for the user directory
2018-03-26 23:41:27 +02:00
JosJuice 1f1dae367d Unify ISOFile (wx) with GameFile (Qt) and put it in UICommon
The original reason I wanted to do this was so that we can replace
the Android-specific code with this in the future, but of course,
just deduplicating between DolphinWX and DolphinQt2 is nice too.

Fixes:

- DolphinQt2 showing the wrong size for split WBFS disc images.

- DolphinQt2 being case sensitive when checking if a file is a DOL/ELF.

- DolphinQt2 not detecting when a Wii banner has become available
after the game list cache was created.

Removes:

- DolphinWX's ability to load PNGs as custom banners. But it was
already rather broken (see https://bugs.dolphin-emu.org/issues/10365
and https://bugs.dolphin-emu.org/issues/10366). The reason I removed
this was because PNG decoding relied on wx code and we don't have any
good non-wx/Qt code for loading PNG files right now (let's not use
SOIL), but we should be able to use libpng directly to implement PNG
loading in the future.

- DolphinQt2's ability to ignore a cached game if the last modified
time differs. We currently don't have a non-wx/Qt way to get the time.
2018-03-09 13:08:38 +01:00
spycrab 0dd52ca7ab UICommon: Move screensaver code to UICommon 2018-01-03 12:38:33 +01:00
JosJuice b3b7aef09a Android: Extract Sys to a different folder than the User folder 2017-12-26 09:53:32 +01:00
Léo Lam f5fd183571 Config: Fix the loader Load() being called twice
The Config::AddLoadLayer functions call Load on the layer
explicitly, but Load is already called in the constructor,
so they'd cause the loader's Load function to be called twice,
which is potentially expensive considering we have to read an INI
from the host filesystem.

This commit removes the Config::AddLoadLayer functions because
they don't appear to be necessary.
2017-07-31 22:32:05 +08:00
Michael Maltese 28d6c61e34 LogManager: use layered config 2017-07-09 16:28:54 -07:00
spycrab 2de31317e9 UICommon: Move TriggerSTMPowerEvent() from Wx 2017-06-26 16:28:39 +02:00
MerryMage 41afe78a44 Config: Integrate 2017-06-03 18:11:57 +01:00
spycrab c8d0b647ac Qt: Add controller (overview) window 2017-05-09 18:49:10 +02:00
Léo Lam 6a0bf24e0b Move libusb context initialization to on first use
This prevents libusb warnings from showing up even when the user is
not using Bluetooth or USB passthrough, or the Wii U GC adapter.
2017-02-07 00:47:21 +01:00