Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
953e09dd
There was an error fetching the commit references. Please try again later.
Commit
953e09dd
authored
10 years ago
by
bunnei
Browse files
Options
Downloads
Patches
Plain Diff
EmuWindow: Made pad/touch functions non-static.
parent
a1a1a5c6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/citra/emu_window/emu_window_glfw.cpp
+14
-13
14 additions, 13 deletions
src/citra/emu_window/emu_window_glfw.cpp
src/common/emu_window.cpp
+0
-2
0 additions, 2 deletions
src/common/emu_window.cpp
src/common/emu_window.h
+6
-9
6 additions, 9 deletions
src/common/emu_window.h
with
20 additions
and
24 deletions
src/citra/emu_window/emu_window_glfw.cpp
+
14
−
13
View file @
953e09dd
...
@@ -16,35 +16,36 @@ EmuWindow_GLFW* EmuWindow_GLFW::GetEmuWindow(GLFWwindow* win) {
...
@@ -16,35 +16,36 @@ EmuWindow_GLFW* EmuWindow_GLFW::GetEmuWindow(GLFWwindow* win) {
return
static_cast
<
EmuWindow_GLFW
*>
(
glfwGetWindowUserPointer
(
win
));
return
static_cast
<
EmuWindow_GLFW
*>
(
glfwGetWindowUserPointer
(
win
));
}
}
void
EmuWindow_GLFW
::
OnMouseButtonEvent
(
GLFWwindow
*
win
dow
,
int
button
,
int
action
,
int
mods
)
{
void
EmuWindow_GLFW
::
OnMouseButtonEvent
(
GLFWwindow
*
win
,
int
button
,
int
action
,
int
mods
)
{
if
(
button
==
GLFW_MOUSE_BUTTON_LEFT
)
{
if
(
button
==
GLFW_MOUSE_BUTTON_LEFT
)
{
auto
layout
=
GetEmuWindow
(
window
)
->
GetFramebufferLayout
();
auto
emu_window
=
GetEmuWindow
(
win
);
auto
layout
=
emu_window
->
GetFramebufferLayout
();
double
x
,
y
;
double
x
,
y
;
glfwGetCursorPos
(
win
dow
,
&
x
,
&
y
);
glfwGetCursorPos
(
win
,
&
x
,
&
y
);
if
(
action
==
GLFW_PRESS
)
{
if
(
action
==
GLFW_PRESS
)
{
E
mu
W
indow
::
TouchPressed
(
layout
,
static_cast
<
u16
>
(
x
),
static_cast
<
u16
>
(
y
));
e
mu
_w
indow
->
TouchPressed
(
layout
,
static_cast
<
u16
>
(
x
),
static_cast
<
u16
>
(
y
));
}
else
if
(
action
==
GLFW_RELEASE
)
{
}
else
if
(
action
==
GLFW_RELEASE
)
{
E
mu
W
indow
::
TouchReleased
(
layout
,
static_cast
<
u16
>
(
x
),
static_cast
<
u16
>
(
y
));
e
mu
_w
indow
->
TouchReleased
(
layout
,
static_cast
<
u16
>
(
x
),
static_cast
<
u16
>
(
y
));
}
}
}
}
}
}
void
EmuWindow_GLFW
::
OnCursorPosEvent
(
GLFWwindow
*
win
dow
,
double
x
,
double
y
)
{
void
EmuWindow_GLFW
::
OnCursorPosEvent
(
GLFWwindow
*
win
,
double
x
,
double
y
)
{
auto
emu_window
=
GetEmuWindow
(
win
);
auto
layout
=
GetEmuWindow
(
window
)
->
GetFramebufferLayout
();
auto
layout
=
emu_
window
->
GetFramebufferLayout
();
E
mu
W
indow
::
TouchMoved
(
layout
,
static_cast
<
u16
>
(
x
),
static_cast
<
u16
>
(
y
));
e
mu
_w
indow
->
TouchMoved
(
layout
,
static_cast
<
u16
>
(
x
),
static_cast
<
u16
>
(
y
));
}
}
/// Called by GLFW when a key event occurs
/// Called by GLFW when a key event occurs
void
EmuWindow_GLFW
::
OnKeyEvent
(
GLFWwindow
*
win
,
int
key
,
int
scancode
,
int
action
,
int
mods
)
{
void
EmuWindow_GLFW
::
OnKeyEvent
(
GLFWwindow
*
win
,
int
key
,
int
scancode
,
int
action
,
int
mods
)
{
auto
emu_window
=
GetEmuWindow
(
win
);
int
keyboard_id
=
GetEmuWindow
(
win
)
->
keyboard_id
;
int
keyboard_id
=
emu_window
->
keyboard_id
;
if
(
action
==
GLFW_PRESS
)
{
if
(
action
==
GLFW_PRESS
)
{
E
mu
W
indow
::
KeyPressed
({
key
,
keyboard_id
});
e
mu
_w
indow
->
KeyPressed
({
key
,
keyboard_id
});
}
else
if
(
action
==
GLFW_RELEASE
)
{
}
else
if
(
action
==
GLFW_RELEASE
)
{
E
mu
W
indow
::
KeyReleased
({
key
,
keyboard_id
});
e
mu
_w
indow
->
KeyReleased
({
key
,
keyboard_id
});
}
}
Service
::
HID
::
PadUpdateComplete
();
Service
::
HID
::
PadUpdateComplete
();
...
...
This diff is collapsed.
Click to expand it.
src/common/emu_window.cpp
+
0
−
2
View file @
953e09dd
...
@@ -5,8 +5,6 @@
...
@@ -5,8 +5,6 @@
#include
"emu_window.h"
#include
"emu_window.h"
#include
"video_core/video_core.h"
#include
"video_core/video_core.h"
bool
EmuWindow
::
touch_pressed
=
false
;
void
EmuWindow
::
KeyPressed
(
KeyMap
::
HostDeviceKey
key
)
{
void
EmuWindow
::
KeyPressed
(
KeyMap
::
HostDeviceKey
key
)
{
Service
::
HID
::
PadState
mapped_key
=
KeyMap
::
GetPadKey
(
key
);
Service
::
HID
::
PadState
mapped_key
=
KeyMap
::
GetPadKey
(
key
);
...
...
This diff is collapsed.
Click to expand it.
src/common/emu_window.h
+
6
−
9
View file @
953e09dd
...
@@ -71,10 +71,10 @@ public:
...
@@ -71,10 +71,10 @@ public:
virtual
void
ReloadSetKeymaps
()
=
0
;
virtual
void
ReloadSetKeymaps
()
=
0
;
/// Signals a key press action to the HID module
/// Signals a key press action to the HID module
static
void
KeyPressed
(
KeyMap
::
HostDeviceKey
key
);
void
KeyPressed
(
KeyMap
::
HostDeviceKey
key
);
/// Signals a key release action to the HID module
/// Signals a key release action to the HID module
static
void
KeyReleased
(
KeyMap
::
HostDeviceKey
key
);
void
KeyReleased
(
KeyMap
::
HostDeviceKey
key
);
/**
/**
* Signal that a touch pressed event has occurred (e.g. mouse click pressed)
* Signal that a touch pressed event has occurred (e.g. mouse click pressed)
...
@@ -82,8 +82,7 @@ public:
...
@@ -82,8 +82,7 @@ public:
* @param framebuffer_x Framebuffer x-coordinate that was pressed
* @param framebuffer_x Framebuffer x-coordinate that was pressed
* @param framebuffer_y Framebuffer y-coordinate that was pressed
* @param framebuffer_y Framebuffer y-coordinate that was pressed
*/
*/
static
void
TouchPressed
(
const
FramebufferLayout
&
layout
,
unsigned
framebuffer_x
,
void
TouchPressed
(
const
FramebufferLayout
&
layout
,
unsigned
framebuffer_x
,
unsigned
framebuffer_y
);
unsigned
framebuffer_y
);
/**
/**
* Signal that a touch released event has occurred (e.g. mouse click released)
* Signal that a touch released event has occurred (e.g. mouse click released)
...
@@ -91,8 +90,7 @@ public:
...
@@ -91,8 +90,7 @@ public:
* @param framebuffer_x Framebuffer x-coordinate that was released
* @param framebuffer_x Framebuffer x-coordinate that was released
* @param framebuffer_y Framebuffer y-coordinate that was released
* @param framebuffer_y Framebuffer y-coordinate that was released
*/
*/
static
void
TouchReleased
(
const
FramebufferLayout
&
layout
,
unsigned
framebuffer_x
,
void
TouchReleased
(
const
FramebufferLayout
&
layout
,
unsigned
framebuffer_x
,
unsigned
framebuffer_y
);
unsigned
framebuffer_y
);
/**
/**
* Signal that a touch movement event has occurred (e.g. mouse was moved over the emu window)
* Signal that a touch movement event has occurred (e.g. mouse was moved over the emu window)
...
@@ -100,8 +98,7 @@ public:
...
@@ -100,8 +98,7 @@ public:
* @param framebuffer_x Framebuffer x-coordinate
* @param framebuffer_x Framebuffer x-coordinate
* @param framebuffer_y Framebuffer y-coordinate
* @param framebuffer_y Framebuffer y-coordinate
*/
*/
static
void
TouchMoved
(
const
FramebufferLayout
&
layout
,
unsigned
framebuffer_x
,
void
TouchMoved
(
const
FramebufferLayout
&
layout
,
unsigned
framebuffer_x
,
unsigned
framebuffer_y
);
unsigned
framebuffer_y
);
/**
/**
* Returns currently active configuration.
* Returns currently active configuration.
...
@@ -196,5 +193,5 @@ private:
...
@@ -196,5 +193,5 @@ private:
WindowConfig
config
;
///< Internal configuration (changes pending for being applied in ProcessConfigurationChanges)
WindowConfig
config
;
///< Internal configuration (changes pending for being applied in ProcessConfigurationChanges)
WindowConfig
active_config
;
///< Internal active configuration
WindowConfig
active_config
;
///< Internal active configuration
static
bool
touch_pressed
;
///< True if touchpad area is currently pressed, otherwise false
bool
touch_pressed
;
///< True if touchpad area is currently pressed, otherwise false
};
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment