Commit graph

162 commits

Author SHA1 Message Date
liushuyu
ca46b4c3e2
frontend: qt: fix a freeze where...
... if you click on entry in the game list too fast, citra will hang
2019-03-12 13:35:33 -06:00
fearlessTobi
1302c9c1e7 frontend: Remove V-Sync option from UI
The V-Sync option is fundamentally broken in Citra, so let's do the same as yuzu and remove it entirely for SDL2 and at least from the frontend for QT.
(It was also only used by 7.3% of users)
2019-01-19 17:43:44 +01:00
zhupengfei
071b41cb61
citra_qt, video_core: Screenshot functionality
Allows capturing screenshot at the current internal resolution (native for software renderer), but a setting is available to capture it in other resolutions. The screenshot is saved to a single PNG in the current layout.
2018-11-30 14:14:41 +08:00
Lioncash
027197cf1f bootmanager: Use QStringLiteral instead of std::string to represent the window title
This gets rid of an unnecessary type conversion. We can just use the
regular QStringLiteral to already format the string as the type
setWindowTitle accepts instead of converting from a std::string
instance.
2018-10-26 23:56:04 +02:00
NeatNit
4ee914c7a8 implemented touch in Qt and SDL
change TouchToPixelPos to return std::pair<int, int>

static_cast (SDL)

various minor style and code improvements

style - PascalCase for function names

made touch events private

const pointer arg in touch events

make TouchToPixelPos a const member function

did I do this right?

braces on barely-multiline if

remove question comment (confirmed in Discord)

fixed consts

remove unused parameter from TouchEndEvent

DRY - High-DPI scaled touch put in separate function

also fixes a bug where if you start touching (with either mouse or touchscreen) and drag the mouse to the LEFT of the emulator window, the touch point jumps to the RIGHT side of the touchscreen; draggin to above the window would make it jump to the bottom.

implicit conversion from QPoint to QPointF, apparently

I have no idea what const even means but I'll put it here anyway

remove unused or used-once variables

make touch scaling functions const, and put their implementations together

removed unused FingerID parameters

QTouchEvent forward declaration; add comment to TouchBegin that was lost in an edit

better DRY in SDL

To do -> TODO(NeatNit)

remove unused include
2018-10-09 23:10:28 +08:00
James Rowe
3f4a7f8f58 Input: Remove global variables from SDL Input
Changes the interface as well to remove any unique methods that
frontends needed to call such as StartJoystickEventHandler by
conditionally starting the polling thread only if the frontend hasn't
started it already. Additionally, moves all global state into a single
SDLState class in order to guarantee that the destructors are called in
the proper order
2018-09-22 14:13:50 -06:00
James Rowe
687e3e74ca
Merge pull request #3959 from zhaowenlan1779/semi-reset
service/apt: Implement soft reset & CloseApplication
2018-09-19 21:02:59 -06:00
Ben
17978cf758
Joystick hotplug support (#4141)
* use SDL_PollEvent instead of SDL_JoystickUpdate

Register hot plugged controller by GUID if they were configured in a previous session

* Move SDL_PollEvent into its own thread

* Don't store SDLJoystick pointer in Input Device; Get pointer on each GetStatus call

* Fix that joystick_list gets cleared after SDL_Quit

* Add VirtualJoystick for InputDevices thats never nullptr

* fixup! Add VirtualJoystick for InputDevices thats never nullptr

* fixup! fixup! Add VirtualJoystick for InputDevices thats never nullptr

* Remove SDL_GameController, make SDL_Joystick* unique_ptr

* fixup! Remove SDL_GameController, make SDL_Joystick* unique_ptr

* Adressed feedback; fixed handling of same guid reconnects

* fixup! Adressed feedback; fixed handling of same guid reconnects

* merge the two joystick_lists into one

* make SDLJoystick a member of VirtualJoystick

* fixup! make SDLJoystick a member of VirtualJoystick

* fixup! make SDLJoystick a member of VirtualJoystick

* fixup! fixup! make SDLJoystick a member of VirtualJoystick
2018-09-08 19:01:30 +02:00
zhupengfei
ad6b140cb0
service/apt: Implement soft reset & CloseApplication 2018-09-08 11:05:23 +08:00
fearlessTobi
cf8b1726df Address review comments 2018-09-06 00:00:21 +02:00
Lioncash
3284bef360 string_util: Remove StringFromFormat() and related functions
Given we utilize fmt, we don't need to provide our own functions for formatting anymore
2018-09-06 00:00:21 +02:00
James Rowe
871196bc10 Citra-qt: Add multiplayer ui 2018-04-19 10:28:14 -06:00
Pierre de La Morinerie
c4dbdeba0a Fix QGLWidget viewport resize on macOS
This fixes #2092, a long-standing bug where on macOS resizing the window
results in a garbled display.

It seems the seemingly optional child()->makeCurrent call is actually
required on macOS. Enabling it in all cases fixes the resize issue.
2018-03-11 19:22:30 +05:30
Senjosei
f17600db1a Moved when to pause because it wasnt fast enough 2017-12-29 06:17:21 +11:00
Lioncash
a73f135868
citra_qt: Migrate to Qt 5 signal/slot connection syntax where applicable
This is more type-safe than the string-based signal/slot syntax that was
being used. It also makes the connections throughout the UI code consistent.
2017-12-17 18:44:48 -05:00
Lioncash
9ec0609ae5
citra_qt: Drop Qt 5 version checks in code
We don't support Qt 4.x anymore.
2017-12-16 13:26:14 -05:00
Lioncash
c06f7978ac bootmanager: In-class initialize EmuThread's boolean member variables
Trims down the initializer list a little.
2017-12-10 20:11:35 -05:00
Mohit Sahu
1f6da9fbc5 Capitalize the first word in a comment (#3059)
* Correct spelling of searchfield in comment
2017-10-28 12:38:56 -05:00
wwylele
188194908c move MotionEmu from core/frontend to input_common as a InputDevice 2017-08-11 11:05:08 +03:00
B3n30
2e37ce01c9 Implement basic virtual Room support based on enet (#2803)
* Added support for network with ENet lib,

connecting is possible, but data can't be sent, yet.

* fixup! Added support for network with ENet lib,

* fixup! CLang

* fixup! Added support for network with ENet lib,

* fixup! Added support for network with ENet lib,

* fixup! Clang format

* More fixups!

* Moved ENetHost* and ENetPeer* into pimpl classes

* fixup! Moved ENetHost* and ENetPeer* into pimpl classes

* fixup! Clang again

* fixup! Moved ENetHost* and ENetPeer* into pimpl classes

* fixup! Moved ENetHost* and ENetPeer* into pimpl classes

* fixup! Moved ENetHost* and ENetPeer* into pimpl classes
2017-07-07 15:34:15 -04:00
TheKoopaKingdom
0409bdfea5 Optimized messages that were repetitive and added ability for core errors to specify more details optionally. 2017-06-02 18:28:14 -04:00
TheKoopaKingdom
37bec598ea Made some changes from review comments:
- Made LoadKernelSystemMode return a pair consisting of a system mode and a result code (Could use review).
- Deleted ErrorOpenGL error code in favor of just having ErrorVideoCore.
- Made dialog messages more clear.
- Compared archive ID in fs_user.cpp to ArchiveIdCode::NCCH as opposed to hex magic.
- Cleaned up some other stuff.
2017-06-02 18:28:14 -04:00
TheKoopaKingdom
1ecb322daa Added system for handling core errors in citra-qt. 2017-06-02 18:27:56 -04:00
Yuri Kunde Schlesner
eb10f25025 Move screen size constants from video_core to core
video_core didn't even properly use them, and they were the source of
many otherwise-unnecessary dependencies from core to video_core.
2017-05-27 18:41:24 -07:00
wwylele
560884336f citra-qt: remove dead code 2017-03-17 21:45:29 +02:00
wwylele
5245c86f26 citra-qt: release all buttons when render window focus is lost
credit to @Hawkheart for the original idea
2017-03-17 21:41:25 +02:00
wwylele
e02c4b7195 Input: remove unused stuff & clean up
1. removed zl, zr and c-stick from HID::PadState. They are handled by IR, not HID
2. removed button handling in EmuWindow
3. removed key_map
4. cleanup #include
2017-03-01 23:30:57 +02:00
wwylele
38e800f70d InputCommon: add Keyboard 2017-03-01 23:30:57 +02:00
James Rowe
b090422991 Gui: Change title bar to include build name
Nightly builds now have "Citra Nightly" in the titlebar
Bleeding edge builds now have "Citra Bleeding Edge" in the titlebar
2017-02-23 00:42:55 -07:00
bunnei
7cfe3ef046 Merge pull request #1951 from wwylele/motion-sensor
Emulate motion sensor in frontend
2017-01-07 12:39:20 -05:00
Jonathan Hao
c18cb1b192 Fix some warnings (#2399) 2017-01-04 13:48:29 -03:00
wwylele
bcf9d20d57 Frontend: emulate motion sensor 2016-12-26 10:52:16 +02:00
MerryMage
64f98f4d0f core: Move emu_window and key_map into core
* Removes circular dependences (common should not depend on core)
2016-12-23 13:42:39 +00:00
bunnei
232ef55c1a core: Consolidate core and system state, remove system module & cleanups. 2016-12-21 23:29:13 -05:00
bunnei
198b6c9bdd core: Consolidate top-level system state into a singleton. 2016-12-21 23:29:04 -05:00
CaptV0rt3x
393a0f99da line fixup for travis ci 2016-12-19 00:52:54 +05:30
Vamsi Krishna
77f4743199 screen swap - Hotkey mapping 2016-12-19 00:49:57 +05:30
James Rowe
2b1654ad9b Support additional screen layouts.
Allows users to choose a single screen layout or a large screen layout.
Adds a configuration option to change the prominent screen.
2016-11-05 02:55:41 -06:00
Emmanuel Gil Peyrot
ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner
396a8d91a4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot
dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
bunnei
02702c6605 qt: Recreate GL context on startup to support changing V-Sync. 2016-08-29 21:42:32 -04:00
bunnei
08ad9b36d4 config: Add a setting for graphics V-Sync. 2016-08-29 21:42:30 -04:00
wwylele
03631f9b8f Refactor input subsystem 2016-05-15 13:24:22 +03:00
Henrik Rydgård
90501f20e6 Make Citra build with MICROPROFILE_ENABLED set to 0 (#1709)
* Make Citra build with MICROPROFILE_ENABLED set to 0

* Buildfix with microprofile kept on

* moc did not like a dialog to conditionally exist.

* Cleanup

* Fix end of line
2016-04-28 20:17:31 -04:00
Pierre de La Morinerie
ba5d0f594d citra-qt: Fix mouse events coordinates on high-DPI screens 2015-10-04 23:11:05 +02:00
LittleWhite
d06824809f Fix for the refresh issue when no rendering is done 2015-09-24 21:48:41 +02:00
Kloen
541fc80240 citra-qt: Fix connect error on startup 2015-09-18 11:36:59 +02:00
bunnei
d6e56b8c88 Merge pull request #1111 from LittleWhite-tb/qt-close-renderwindow
Stop emulation when render window is closed
2015-09-14 15:23:08 -04:00
Lioncash
abe5bb4019 citra_qt: Reorganize headers 2015-09-11 00:57:24 -04:00
LittleWhite
86e29ac281 Stop emulation when render window is closed 2015-09-07 20:34:39 +02:00
Yuri Kunde Schlesner
cd817be922 citra-qt: Move system shutdown to run inside EmuThread
This stops (for some reason sporadic) crashes and OpenGL errors during
shutdown, when the OpenGL renderer tries to clean up objects from the
UI thread, which has no OpenGL context active.
2015-09-03 15:09:50 -03:00
Yuri Kunde Schlesner
68eb197494 Increase required OpenGL version to 3.3
This gives us several niceties such as Sampler Objects, shader attribute
locations and Timer Queries.
2015-08-30 08:45:57 -03:00
Yuri Kunde Schlesner
0fcabd2b11 Integrate the MicroProfile profiling library
This brings goodies such as a configurable user interface and
multi-threaded timeline view.
2015-08-24 22:16:28 -03:00
Lioncash
5df3afd522 citra-qt: Adjust initializer list order
Silences a warning.
2015-07-29 12:03:59 -04:00
James Rowe
1bc7829ee9 Move input values into an array 2015-07-27 21:41:21 -06:00
aroulin
7ccce98389 Qt: Fix disassembly widget stepping 2015-07-13 17:27:12 +02:00
Emmanuel Gil Peyrot
45c4781544 CitraQt: Cleanup includes. 2015-06-28 00:36:54 +01:00
Emmanuel Gil Peyrot
b1503b2020 Remove every trailing whitespace from the project (but externals). 2015-05-29 21:59:29 +01:00
Yuri Kunde Schlesner
c9244a03c7 Qt: Silence a bogus warning printed when using the debug runtime
The Qt debug runtime prints a bogus warning on the console if you
haven't called makeCurrent since the last time you called swapBuffers.
This presumably means something if you're using QGLWidget the "regular"
way, but in our multi-threaded use case is harmless since we never call
doneCurrent in the rendering thread.
2015-05-23 02:27:27 -03:00
tfarley
16fbba3c2a MakeCurrent race condition fix 2015-05-22 15:51:33 -07:00
James Rowe
a406207cd8 Use condition var to properly pause the CPU thread
Adds support for threaded pausing so citra doesn't spin wait on pause
2015-05-18 08:15:57 -06:00
Yuri Kunde Schlesner
e1fbac3ca1 Common: Remove common.h 2015-05-07 15:45:22 -03:00
Tony Wasserka
7859b145cf Merge pull request #698 from Zaneo/clip_stylus_input
EmuWindow: Clip mouse input coordinates to emulated screen dimensions.
2015-05-02 19:15:03 +02:00
Zaneo
b8328593fe EmuWindow: Clip mouse input coordinates to emulated screen dimensions.
If the mouse position for a mouse move/drag would take it outside the emulated screen dimensions, clip the coordinates to
the emulated screen dimensions.
Qt and GLFW will report negative coordinates for mouse positions to the left, or above citra window. Added restriction
to mouse coordinates passed to touchmoved by Qt/GLFW to be greater or equal to zero.
2015-05-01 23:52:33 -04:00
bunnei
bc41de2131 Qt: Fixed a bug in shutdown procedure, various cleanups. 2015-05-01 18:35:51 -04:00
bunnei
43cf424907 Qt: Use signals for emu_thread start/stop and fix disasm widget. 2015-05-01 18:34:42 -04:00
bunnei
e4ea133717 Qt: Restructured to remove unnecessary shutdown event and various cleanups. 2015-05-01 18:27:07 -04:00
bunnei
28df8dbfeb Qt: Create emu thread on bootup, kill it on shutdown. 2015-05-01 18:27:00 -04:00
bunnei
d5665fea89 EmuThread: Remove unused filename attribute. 2015-05-01 18:26:59 -04:00
bunnei
762c1a9ff5 Qt: Move EmuThread ownership from render window to main window. 2015-05-01 18:26:58 -04:00
bunnei
d61b26b79f HID: Complete refactor of pad/touch input to fix threading issues. 2015-03-10 23:58:07 -04:00
bunnei
f213000cc4 Qt: Implemented EmuWindow touchpad support. 2015-03-10 18:05:18 -04:00
bunnei
9960c49c21 Set framebuffer layout from EmuWindow. 2015-03-07 17:21:19 -05:00
Emmanuel Gil Peyrot
aa64f69af0 Frontends, HID: Add New 3DS specific pad buttons, and stub the touch one. 2015-02-22 21:09:08 +01:00
archshift
1f109c6b49 Added HID_SPVR service and split HID_U implementation into service/hid/hid.xxx 2015-01-21 13:31:10 -08:00
Kingcom
2bbc12e6c3 citra-qt: Replace OnCpuStepped signal by new signals DebugModeEntered and DebugModeLeft 2015-01-11 21:22:51 +01:00
chrisvj
b0a14cfe7f citra-qt: Renamed all .hxx headers to .h 2015-01-06 04:51:54 -08:00
Yuri Kunde Schlesner
cdde76f2aa Frontends: Shutdown core when emulation is stopped 2015-01-04 01:04:46 -02:00
Yuri Kunde Schlesner
0600e2d8b5 Convert old logging calls to new logging macros 2014-12-13 02:08:02 -02:00
Tony Wasserka
2c71ec7052 Pica/DebugUtils: Add breakpoint functionality. 2014-12-09 16:37:34 +01:00
Rohit Nirmal
8a62423970 Change NULLs to nullptrs. 2014-12-03 12:57:57 -06:00
Emmanuel Gil Peyrot
739bb58c3a Remove tabs in all files except in skyeye imports and in generated GL code 2014-11-19 09:04:03 +00:00
Emmanuel Gil Peyrot
f5d38649c7 Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generated 2014-11-19 09:03:07 +00:00
Tony Wasserka
688a5c033e citra-qt: Small cleanup. 2014-11-18 13:16:02 +01:00
Tony Wasserka
182476c96a EmuWindow: Remove window title getters/setters.
The window title is none of the emulation core's business. The GUI code is free to put whatever it wants there.
Providing properly thread-safe window title getters and setters is a mess anyway.
2014-11-18 13:09:01 +01:00
Tony Wasserka
722ce22589 EmuWindow: Add support for specifying minimal client area sizes. 2014-11-18 13:09:01 +01:00
Tony Wasserka
bd8f491e4c Fixup EmuWindow interface and implementations thereof. 2014-11-18 13:09:01 +01:00
Kevin Hartman
221a9b023d Viewport scaling and display density independence
The view is scaled to be as large as possible, without changing the aspect, within the bounds of the window.
On "retina" displays, or other displays where window units != pixels, the view should no longer draw incorrectly.
2014-11-18 13:06:05 +01:00
bunnei
0fab380801 Citra-Qt: Use Core::RunLoop when not single stepping. 2014-11-11 19:53:47 -05:00
Yuri Kunde Schlesner
d72708c1f5 Add override keyword through the code.
This was automated using `clang-modernize`.
2014-10-26 16:18:05 -02:00
Yuri Kunde Schlesner
ac54cd13db OpenGL renderer: Request a forward compatible context in citra-qt
This should fix context creation on OS X. Also requests a core context on all platforms in Citra-GLFW, for consistency.
2014-10-12 14:39:02 +02:00
archshift
e6594f9f53 Added configuration file system.
Uses QSettings on citra-qt, and inih on citra-cli.
2014-10-07 15:09:37 -07:00
bunnei
5481115e71 Merge pull request #97 from archshift/cleanup
Small, general code cleanup
2014-09-13 22:58:58 -04:00
Kevin Hartman
02fd19b2f6 Added support for multiple input device types for KeyMap and connected Qt. 2014-09-12 01:15:14 -07:00
archshift
9c0efdb75b bootmanager::EmuThread: fixed initialization order 2014-09-07 12:09:02 -07:00
Sacha
1b1205cf73 Pass format to the QGLWidget and use atomic instead of mutex. 2014-08-25 03:42:52 +10:00
Sacha
b044510fa9 Fix EmuThread loop by ensuring it exits properly.
Note: There is a pre-existing issue with booting a new game in that it keeps the old EmuThread.
The GL code now supports this but the Core still doesn't.
2014-08-25 01:49:34 +10:00
Sacha
a3a70e56ac Fix the threading for GL Context in Qt5.
Connect the emu_thread start/finish to a moveContext slot.
2014-08-25 00:47:00 +10:00
archshift
d93dc81953 Revert "Removed redundant loop in EmuThread::run()" 2014-08-20 10:15:12 -07:00