Skip to content

Updating MOAI Xcode sample project settings so they compile again #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: mindsnacks-dev
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Since the touch handling methods had been using 32-bit addresses for …
…the unique ID of each touch event, and that no longer compiles, use the last 32 bits of the 64-bit pointer, and pass that in.
  • Loading branch information
aab29 committed Dec 23, 2020
commit f44a10a026da27adba9198cb60a54ca0ef38b20e
7 changes: 5 additions & 2 deletions xcode/ios/Classes/MoaiView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,14 @@ -( void ) handleTouches :( NSSet* )touches :( BOOL )down {
for ( UITouch* touch in touches ) {

CGPoint p = [ touch locationInView:self ];

UInt64 touchAddress = (UInt64)touch;
int touchID = (int)(touchAddress & UINT32_MAX);

AKUEnqueueTouchEvent (
MoaiInputDeviceID::DEVICE,
MoaiInputDeviceSensorID::TOUCH,
( int )touch, // use the address of the touch as a unique id
touchID, // use the address of the touch as a unique id
down,
p.x * [[ UIScreen mainScreen ] scale ],
p.y * [[ UIScreen mainScreen ] scale ]
Expand Down Expand Up @@ -350,4 +353,4 @@ -( void )touchesMoved:( NSSet* )touches withEvent:( UIEvent* )event {
[ self handleTouches :touches :YES ];
}

@end
@end