/
BirdLeon
/
ROBLOX2016
Обзор
Документация
Войти
/
BirdLeon
/
ROBLOX2016
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
iOS/SharedCode/MarshallerInterface.mm
59 строк
1 KB
PatoFlamejanteTV
full source code
19 дек 2024, 19:11
19 дек 2024, 19:11
05db15d
Код
Авторство
О чём код?
// // Roblox.m // RobloxMobile // // Created by Ben Tkacheff on 1/30/13. // Copyright (c) 2013 ROBLOX. All rights reserved. // #import "MarshallerInterface.h" #include "FunctionMarshaller.h" #include "Roblox.h" @implementation FunctionMarshaller @synthesize pClosure; -(void) marshallFunction { RBX::FunctionMarshaller::handleAppEvent(pClosure); } @end static NSString* kAppEventMode = @"RobloxAppEvent"; static NSArray* kAppEventModeList = [NSArray arrayWithObjects:(NSString*)kCFRunLoopDefaultMode, kAppEventMode, nil]; void Roblox::sendAppEvent(void *pClosure) { RBX::CEvent *waitEvent = ((RBX::FunctionMarshaller::Closure *) pClosure)->waitEvent; BOOL waitFlag = (waitEvent == NULL); FunctionMarshaller* controller = [[FunctionMarshaller alloc] init]; controller->pClosure = pClosure; [controller performSelectorOnMainThread:@selector(marshallFunction) withObject:nil waitUntilDone:waitFlag modes:kAppEventModeList]; if (waitEvent) { waitEvent->Wait(); } } void Roblox::postAppEvent(void *pClosure) { FunctionMarshaller* controller = [[FunctionMarshaller alloc] init]; controller->pClosure = pClosure; [controller performSelectorOnMainThread:@selector(marshallFunction) withObject:nil waitUntilDone:NO modes:kAppEventModeList]; } void Roblox::processAppEvents() { while (CFRunLoopRunInMode((CFStringRef)kAppEventMode, 0, true) == kCFRunLoopRunHandledSource) ; }