Skip to content

Commit

Permalink
Fixed wasd layout not loading correctly when the texture used more th…
Browse files Browse the repository at this point in the history
…an one row
  • Loading branch information
univrsal committed Sep 30, 2017
1 parent 30108c7 commit 6f601f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions input-overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ struct InputSource {
UnloadOverlayLayout();
}

static void UpdateScroll();

void LoadOverlayTexture(void);
void LoadOverlayLayout(void);
void UnloadOverlayLayout(void);
Expand Down Expand Up @@ -461,17 +459,19 @@ void InputSource::LoadOverlayLayout()
int index = 0;
for (int i = 0; i < m_layout.m_key_count; i++)
{
if (index != 0 && index % m_layout.texture_w == 0)
/*if (index != 0 && index % m_layout.texture_w == 0)
{
u_cord = 1;
v_cord += m_layout.texture_v_space + 6;
}
}*/

if (i == 69)
if (index >= m_layout.texture_w)
{

printf("heyo");
index = 0;
u_cord = 1;
v_cord += m_layout.texture_v_space + 6;
}

InputKey k;
k.texture_u = u_cord - 1;
k.texture_v = v_cord - 1;
Expand Down Expand Up @@ -584,8 +584,6 @@ static obs_properties_t *get_properties(void *data)
OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("input-overlay", "en-US")

std::thread monitor_thread;

bool obs_module_load(void)
{
obs_source_info si = {};
Expand Down
Binary file modified presets/wasd-full.zip
Binary file not shown.
Binary file modified presets/wasd-minimal.zip
Binary file not shown.

0 comments on commit 6f601f2

Please sign in to comment.