Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions bin/amd64/game_actions_967460.vdf
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steam Input action definitions file. Steam reads this to know what actions are available and what kind of actions they are. This is still WIP.

Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
"In Game Actions"
{
"actions"
{
"InGameControls"
{
"title" "#Set_Ingame"
"StickPadGyro"
{
"move"
{
"title" "#Action_Move"
"input_mode" "joystick_move"
}
"camera"
{
"title" "#Action_Camera"
"input_mode" "absolute_mouse"
}
}
"Button"
{
"primary" "#Action_Primary"
"secondary" "#Action_Secondary"
"reload" "#Action_Reload"
"use" "#Action_Use"
"jump" "#Action_Jump"
"walk" "#Action_Walk"
"crouch" "#Action_Crouch"
"special" "#Action_Special"
"drop" "#Action_Drop"
"affinity" "#Action_Affinity"
"dash" "#Action_Dash"

"next_weapon" "#Action_NextWeapon"
"previous_weapon" "#Action_PreviousWeapon"
"primary_weapon" "#Action_PrimaryWeapon"
"secondary_weapon" "#Action_SecondaryWeapon"
"wheel_select" "#Action_WheelSelect"
"change_loadout" "#Action_ChangeLoadout"

"scoreboard" "#Action_Scoreboard"
"suicide" "#Action_Suicide"

"recenter_camera" "#Action_RecenterCamera"

}
}
"MenuControls"
{
"title" "#Set_Menu"
"StickPadGyro"
{
}
"AnalogTrigger"
{
}
"Button"
{
"menu_up" "#Menu_Up"
"menu_down" "#Menu_Down"
"menu_left" "#Menu_Left"
"menu_right" "#Menu_Right"
"menu_select" "#Menu_Select"
"menu_cancel" "#Menu_Cancel"
"pause_menu" "#Action_ReturnToGame"
}
}
}
"localization"
{
"english"
{
"Set_Ingame" "In-Game Controls"
"Set_Menu" "Menu Controls"
"Action_Move" "Move"
"Action_Camera" "Camera"
"Action_Primary" "Primary Fire"
"Action_Secondary" "Secondary Fire"
"Action_Reload" "Reload"
"Action_Use" "Use"
"Action_Jump" "Jump"
"Action_Walk" "Walk"
"Action_Crouch" "Crouch"
"Action_Special" "Special"
"Action_Drop" "Drop"
"Action_Affinity" "Affinity"
"Action_Dash" "Dash"

"Action_RecenterCamera" "Recenter Camera"
"Menu_Up" "Up"
"Menu_Down" "Down"
"Menu_Left" "Left"
"Menu_Right" "Right"
"Menu_Select" "Select"
"Menu_Cancel" "Cancel"
}
}
}
6 changes: 6 additions & 0 deletions src/engine/cdpi.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Content Delivery Platform Integrations

#include "engine.h"
#include "controller.h"
#include <stddef.h>
#if defined(USE_STEAM)
#define HAS_STEAM 1
Expand Down Expand Up @@ -40,6 +41,7 @@ namespace cdpi
ISteamUserStats *stats = NULL;
ISteamClient *client = NULL, *sclient = NULL;
ISteamGameServer *serv = NULL;
ISteamInput *input = NULL;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of places where the whitespace is inconsistent. Sorry. I'll be sure it's fixed when I am ready to actually get this PR reviewed.

HSteamPipe umpipe = 0, smpipe = 0;
HSteamUser uupipe = 0, supipe = 0;
HAuthTicket authticket = k_HAuthTicketInvalid;
Expand Down Expand Up @@ -184,6 +186,10 @@ namespace cdpi
if(!friends) { conoutf(colourred, "Failed to get Steam friends interface."); cleanup(SWCLIENT); return true; }
stats = (ISteamUserStats *)SteamAPI_ISteamClient_GetISteamUserStats(client, uupipe, umpipe, STEAMUSERSTATS_INTERFACE_VERSION);
if(!stats) { conoutf(colourred, "Failed to get Steam stats interface."); cleanup(SWCLIENT); return true; }
input = (ISteamInput *)SteamAPI_ISteamClient_GetISteamInput(client, uupipe, umpipe, STEAMINPUT_INTERFACE_VERSION);
if (!input) { conoutf(colourred, "Failed to get Steam Input interface."); cleanup(SWCLIENT); return true; }
input->Init(false);
controller::init_action_handles();

const char *name = SteamAPI_ISteamFriends_GetPersonaName(friends);
if(name && *name)
Expand Down
6 changes: 6 additions & 0 deletions src/engine/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

#include "version.h"
#include "cube.h"
#if defined(USE_STEAM)
#include "steam_api_flat.h"
#endif

#define LOG_FILE "log.txt"

Expand Down Expand Up @@ -49,6 +52,9 @@ namespace cdpi
namespace steam
{
extern char *steamusername, *steamuserid, *steamserverid;
#if defined(USE_STEAM)
extern ISteamInput *input;
#endif

extern bool clientready();
extern bool clientauthticket(char *token, uint *tokenlen, ENetAddress *addr = NULL);
Expand Down
3 changes: 3 additions & 0 deletions src/engine/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// main.cpp: initialisation & main loop

#include "engine.h"
#include "controller.h"
#include <signal.h>
#include <stdio.h>

#ifdef SDL_VIDEO_DRIVER_X11
#include "SDL_syswm.h"
Expand Down Expand Up @@ -824,6 +826,7 @@ void checkinput()
warping = false;
if(grabinput && shouldwarp) resetcursor(true, false);
}
controller::update_from_controller();
}

void swapbuffers(bool overlay)
Expand Down
Loading