ObjFW  Diff

Differences From Artifact [a552f91d7e]:

To Artifact [cec84b63cd]:


532
533
534
535
536
537
538




















































539
540
541
542
543
544
	if (button == OFGameControllerButtonZL && _hasZLPressure)
		return _ZLPressure;
	if (button == OFGameControllerButtonZR && _hasZRPressure)
		return _ZRPressure;

	return ([self.pressedButtons containsObject: button] ? 1 : 0);
}





















































- (OFString *)description
{
	return [OFString stringWithFormat: @"<%@: %@>", self.class, self.name];
}
@end







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
	if (button == OFGameControllerButtonZL && _hasZLPressure)
		return _ZLPressure;
	if (button == OFGameControllerButtonZR && _hasZRPressure)
		return _ZRPressure;

	return ([self.pressedButtons containsObject: button] ? 1 : 0);
}

- (OFGameControllerButton)northButton
{
	if (_vendorID == vendorIDNintendo && _productID == productIDLeftJoycon)
		return nil;
	if (_vendorID == vendorIDNintendo && _productID == productIDRightJoycon)
		return OFGameControllerButtonX;
	if (_vendorID == vendorIDNintendo &&
	    _productID == productIDN64Controller)
		return nil;

	return OFGameControllerButtonY;
}

- (OFGameControllerButton)southButton
{
	if (_vendorID == vendorIDNintendo && _productID == productIDLeftJoycon)
		return nil;
	if (_vendorID == vendorIDNintendo && _productID == productIDRightJoycon)
		return OFGameControllerButtonB;
	if (_vendorID == vendorIDNintendo &&
	    _productID == productIDN64Controller)
		return nil;

	return OFGameControllerButtonA;
}

- (OFGameControllerButton)westButton
{
	if (_vendorID == vendorIDNintendo && _productID == productIDLeftJoycon)
		return nil;
	if (_vendorID == vendorIDNintendo && _productID == productIDRightJoycon)
		return OFGameControllerButtonY;
	if (_vendorID == vendorIDNintendo &&
	    _productID == productIDN64Controller)
		return nil;

	return OFGameControllerButtonX;
}

- (OFGameControllerButton)eastButton
{
	if (_vendorID == vendorIDNintendo && _productID == productIDLeftJoycon)
		return nil;
	if (_vendorID == vendorIDNintendo && _productID == productIDRightJoycon)
		return OFGameControllerButtonA;
	if (_vendorID == vendorIDNintendo &&
	    _productID == productIDN64Controller)
		return nil;

	return OFGameControllerButtonB;
}

- (OFString *)description
{
	return [OFString stringWithFormat: @"<%@: %@>", self.class, self.name];
}
@end