<commit_before>/* Copyright (c) 2013-2014 <NAME>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef SDL_EVENTS_H
#define SDL_EVENTS_H

#include "util/common.h"

#include "core/interface.h"
#include "core/log.h"
#include "util/circle-buffer.h"
#include "util/vector.h"

#include <SDL.h>

mLOG_DECLARE_CATEGORY(SDL_EVENTS);

#define SDL_BINDING_KEY 0x53444C4BU
#define SDL_BINDING_BUTTON 0x53444C42U

#define MAX_PLAYERS 4

struct Configuration;

struct SDL_JoystickCombo {
	SDL_JoystickID id;
	size_t index;
	SDL_Joystick* joystick;
#if SDL_VERSION_ATLEAST(2, 0, 0)
	SDL_Haptic* haptic;
#endif
};

DECLARE_VECTOR(SDL_JoystickList, struct SDL_JoystickCombo);

struct mSDLPlayer;
struct mSDLEvents {
	struct SDL_JoystickList joysticks;
	const char* preferredJoysticks[MAX_PLAYERS];
	int playersAttached;
	struct mSDLPlayer* players[MAX_PLAYERS];
#if SDL_VERSION_ATLEAST(2, 0, 0)
	int screensaverSuspendDepth;
	bool screensaverSuspendable;
#endif
};

struct mSDLPlayer {
	size_t playerId;
	struct mInputMap* bindings;
	struct SDL_JoystickCombo* joystick;
#if SDL_VERSION_ATLEAST(2, 0, 0)
	SDL_Window* window;
	int fullscreen;
	int windowUpdated;

	struct mSDLRumble {
		struct mRumble d;
		struct mSDLPlayer* p;

		int level;<commit_msg>SDL: Fix SDL 1.2 build<commit_after>/* Copyright (c) 2013-2014 <NAME>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef SDL_EVENTS_H
#define SDL_EVENTS_H

#include "util/common.h"

#include "core/interface.h"
#include "core/log.h"
#include "util/circle-buffer.h"
#include "util/vector.h"

#include <SDL.h>

mLOG_DECLARE_CATEGORY(SDL_EVENTS);

#define SDL_BINDING_KEY 0x53444C4BU
#define SDL_BINDING_BUTTON 0x53444C42U

#define MAX_PLAYERS 4

struct Configuration;

struct SDL_JoystickCombo {
	size_t index;
	SDL_Joystick* joystick;
#if SDL_VERSION_ATLEAST(2, 0, 0)
	SDL_Haptic* haptic;
	SDL_JoystickID id;
#else
	int id;
#endif
};

DECLARE_VECTOR(SDL_JoystickList, struct SDL_JoystickCombo);

struct mSDLPlayer;
struct mSDLEvents {
	struct SDL_JoystickList joysticks;
	const char* preferredJoysticks[MAX_PLAYERS];
	int playersAttached;
	struct mSDLPlayer* players[MAX_PLAYERS];
#if SDL_VERSION_ATLEAST(2, 0, 0)
	int screensaverSuspendDepth;
	bool screensaverSuspendable;
#endif
};

struct mSDLPlayer {
	size_t playerId;
	struct mInputMap* bindings;
	struct SDL_JoystickCombo* joystick;
#if SDL_VERSION_ATLEAST(2, 0, 0)
	SDL_Window* window;
	int fullscreen;
	int windowUpdated;

	struct mSDLRumble {
		struct mRumble d;
		struct mSDLPlayer* p;

		int level;
{'fraction_non_alphanumeric': 0.09361702127659574, 'fraction_numerical': 0.02695035460992908, 'mean_word_length': 5.411363636363636, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7365556', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1066, 'n_words': 284}