mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-04-18 14:29:59 +00:00
Merge remote-tracking branch 'moonlight-stream/master'
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// Controller.h
|
||||
// Moonlight
|
||||
//
|
||||
// Created by Diego Waxemberg on 2/1/15.
|
||||
// Copyright (c) 2015 Moonlight Stream. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface Controller : NSObject
|
||||
|
||||
@property (nonatomic) int playerIndex;
|
||||
@property (nonatomic) int lastButtonFlags;
|
||||
@property (nonatomic) int emulatingButtonFlags;
|
||||
@property (nonatomic) char lastLeftTrigger;
|
||||
@property (nonatomic) char lastRightTrigger;
|
||||
@property (nonatomic) short lastLeftStickX;
|
||||
@property (nonatomic) short lastLeftStickY;
|
||||
@property (nonatomic) short lastRightStickX;
|
||||
@property (nonatomic) short lastRightStickY;
|
||||
|
||||
@end
|
||||
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// Controller.m
|
||||
// Moonlight
|
||||
//
|
||||
// Created by Diego Waxemberg on 2/1/15.
|
||||
// Copyright (c) 2015 Moonlight Stream. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Controller.h"
|
||||
|
||||
@implementation Controller
|
||||
@synthesize playerIndex;
|
||||
@synthesize lastButtonFlags, emulatingButtonFlags, lastLeftTrigger, lastRightTrigger;
|
||||
@synthesize lastLeftStickX, lastLeftStickY, lastRightStickX, lastRightStickY;
|
||||
@end
|
||||
26
Limelight/Input/Controller.swift
Normal file
26
Limelight/Input/Controller.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Controller.swift
|
||||
// Moonlight
|
||||
//
|
||||
// Created by David Aghassi on 4/11/16.
|
||||
// Copyright © 2016 Moonlight Stream. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objc
|
||||
/**
|
||||
Defines a controller layout
|
||||
*/
|
||||
class Controller: NSObject {
|
||||
// Swift requires initial properties
|
||||
var playerIndex: CInt = 0 // Controller number (e.g. 1, 2 ,3 etc)
|
||||
var lastButtonFlags: CInt = 0
|
||||
var emulatingButtonFlags: CInt = 0
|
||||
var lastLeftTrigger: CChar = 0 // Last left trigger pressed
|
||||
var lastRightTrigger: CChar = 0 // Last right trigger pressed
|
||||
var lastLeftStickX: CShort = 0 // Last X direction the left joystick went
|
||||
var lastLeftStickY: CShort = 0 // Last Y direction the left joystick went
|
||||
var lastRightStickX: CShort = 0 // Last X direction the right joystick went
|
||||
var lastRightStickY: CShort = 0 // Last Y direction the right joystick went
|
||||
}
|
||||
@@ -7,7 +7,10 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "Controller.h"
|
||||
|
||||
// Swift
|
||||
#import "Moonlight-Swift.h"
|
||||
@class Controller;
|
||||
|
||||
@class OnScreenControls;
|
||||
|
||||
|
||||
@@ -8,9 +8,12 @@
|
||||
|
||||
#import "ControllerSupport.h"
|
||||
#import "OnScreenControls.h"
|
||||
#import "Controller.h"
|
||||
#include "Limelight.h"
|
||||
|
||||
// Swift
|
||||
#import "Moonlight-Swift.h"
|
||||
@class Controller;
|
||||
|
||||
@import GameController;
|
||||
|
||||
@implementation ControllerSupport {
|
||||
|
||||
4
Limelight/Input/Moonlight-Bridging-Header.h
Normal file
4
Limelight/Input/Moonlight-Bridging-Header.h
Normal file
@@ -0,0 +1,4 @@
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
@@ -8,9 +8,12 @@
|
||||
|
||||
#import "OnScreenControls.h"
|
||||
#import "ControllerSupport.h"
|
||||
#import "Controller.h"
|
||||
//#import "Controller.h"
|
||||
#include "Limelight.h"
|
||||
|
||||
#import "Moonlight-Swift.h"
|
||||
@class Controller;
|
||||
|
||||
#define UPDATE_BUTTON(x, y) (buttonFlags = \
|
||||
(y) ? (buttonFlags | (x)) : (buttonFlags & ~(x)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user