@@ -702,37 +702,10 @@ void SetJoystickRTriggerThreshold(float threshold)
702
702
void SetJoystickMapping (int key, unsigned int joystickButton)
703
703
{
704
704
assert (s_currWindowCtx);
705
- // This function now expects ImGuiKey_* values.
706
- // For partial backwards compatibility, also expect some ImGuiNavInput_* values.
707
- ImGuiKey finalKey{};
708
- switch (key)
709
- {
710
- case ImGuiNavInput_Activate:
711
- finalKey = ImGuiKey_GamepadFaceDown;
712
- break ;
713
- case ImGuiNavInput_Cancel:
714
- finalKey = ImGuiKey_GamepadFaceRight;
715
- break ;
716
- case ImGuiNavInput_Input:
717
- finalKey = ImGuiKey_GamepadFaceUp;
718
- break ;
719
- case ImGuiNavInput_Menu:
720
- finalKey = ImGuiKey_GamepadFaceLeft;
721
- break ;
722
- case ImGuiNavInput_FocusPrev:
723
- case ImGuiNavInput_TweakSlow:
724
- finalKey = ImGuiKey_GamepadL1;
725
- break ;
726
- case ImGuiNavInput_FocusNext:
727
- case ImGuiNavInput_TweakFast:
728
- finalKey = ImGuiKey_GamepadR1;
729
- break ;
730
- default :
731
- assert (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END);
732
- finalKey = static_cast <ImGuiKey>(key);
733
- }
705
+ assert (key >= ImGuiKey_NamedKey_BEGIN);
706
+ assert (key < ImGuiKey_NamedKey_END);
734
707
assert (joystickButton < sf::Joystick::ButtonCount);
735
- s_currWindowCtx->joystickMapping [joystickButton] = finalKey ;
708
+ s_currWindowCtx->joystickMapping [joystickButton] = static_cast <ImGuiKey>(key) ;
736
709
}
737
710
738
711
void SetDPadXAxis (sf::Joystick::Axis dPadXAxis, bool inverted)
@@ -1027,18 +1000,12 @@ void RenderDrawLists(ImDrawData* draw_data)
1027
1000
const ImDrawList* cmd_list = draw_data->CmdLists [n];
1028
1001
const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer .Data ;
1029
1002
const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer .Data ;
1030
- glVertexPointer (2 ,
1031
- GL_FLOAT,
1032
- sizeof (ImDrawVert),
1033
- (const GLvoid*)((const char *)vtx_buffer + IM_OFFSETOF (ImDrawVert, pos)));
1034
- glTexCoordPointer (2 ,
1035
- GL_FLOAT,
1036
- sizeof (ImDrawVert),
1037
- (const GLvoid*)((const char *)vtx_buffer + IM_OFFSETOF (ImDrawVert, uv)));
1003
+ glVertexPointer (2 , GL_FLOAT, sizeof (ImDrawVert), (const GLvoid*)((const char *)vtx_buffer + offsetof (ImDrawVert, pos)));
1004
+ glTexCoordPointer (2 , GL_FLOAT, sizeof (ImDrawVert), (const GLvoid*)((const char *)vtx_buffer + offsetof (ImDrawVert, uv)));
1038
1005
glColorPointer (4 ,
1039
1006
GL_UNSIGNED_BYTE,
1040
1007
sizeof (ImDrawVert),
1041
- (const GLvoid*)((const char *)vtx_buffer + IM_OFFSETOF (ImDrawVert, col)));
1008
+ (const GLvoid*)((const char *)vtx_buffer + offsetof (ImDrawVert, col)));
1042
1009
1043
1010
for (int cmd_i = 0 ; cmd_i < cmd_list->CmdBuffer .Size ; cmd_i++)
1044
1011
{
0 commit comments