//======================================================================= //protected bool Application::init ( HINSTANCE hInstance, DWORD style ) { myInstanceMonitor.create( resourceClassName() ); if ( !myInstanceMonitor.isThisTheOnlyInstance() ) { Logger::message( _T("More then one type of this application is running.") ); return false; } if ( !preInit( hInstance ) ) { return false; } if ( !ourClassIsRegistered ) { Application::ourHInstance = hInstance; ourClassIsRegistered = registerClass(); } if ( !preWindow() || !setupWindow( style ) || !postInit() ) { return false; } return (GetWindowLongPtr( myHWnd, GWLP_USERDATA ) == (LONG)this); }
MicroViewProgressBarBase::MicroViewProgressBarBase(uint8_t newx, uint8_t newy, int16_t min, int16_t max, uint8_t sty): MicroViewWidget(newx, newy, min, max) { style = sty; printLabel=true; switch(sty){ case WIDGETSTYLE1: totalTicks=60; break; case WIDGETSTYLE2: totalTicks=20; break; case WIDGETSTYLE3: totalTicks=40; break; // If already 0 or invalid, just make sure it's 0. case WIDGETSTYLE0: default: style=WIDGETSTYLE0; totalTicks=30; break; } Serial.println("60"); Serial.println(printLabel); preInit(); initWidget(); postInit(); }
Engine::Engine(): m_renderbackend(0), m_guimanager(0), m_eventmanager(0), m_soundmanager(0), m_timemanager(0), m_imagepool(0), m_animpool(0), m_soundclippool(0), m_vfs(0), m_model(0), m_gui_graphics(0), m_view(0), m_logmanager(0), m_cursor(0), m_settings() { #ifdef USE_COCOA // The next lines ensure that Cocoa is initialzed correctly. // This is needed for SDL to function properly on MAC OS X. void* cocoa_lib; cocoa_lib = dlopen( "/System/Library/Frameworks/Cocoa.framework/Cocoa", RTLD_LAZY ); void (*nsappload)(void); nsappload = (void(*)()) dlsym( cocoa_lib, "NSApplicationLoad"); nsappload(); // Create an autorelease pool, so autoreleased SDL objects don't leak. objc_object *NSAutoreleasePool = objc_getClass("NSAutoreleasePool"); m_autoreleasePool = objc_msgSend(NSAutoreleasePool, sel_registerName("new")); #endif preInit(); }
// Main loop (equivalent to Viewer::Loop()) void MazeSequential::run() { preInit(); // TODO: careful with maze->done locking! while (/*!maze->dead && */!m_won) { main(); } }
/** \brief MicroViewProgressBar class initialisation. * * Initialise the MicroViewProgressBar widget with default style. */ MicroViewProgressBarBase::MicroViewProgressBarBase(uint8_t newx, uint8_t newy, int16_t min, int16_t max): MicroViewWidget(newx, newy, min, max) { style=WIDGETSTYLE0; totalTicks=30; printLabel=true; Serial.println("24"); preInit(); initWidget(); postInit(); }
Entity EntityFactory::createNewSaveableEntity( Engine& engine, const World& world, const int& entityBlueprintId, const Entity::Id& uniqueId ) { Entity entity; auto& entityBlueprint = engine.blueprint.getEntityById( entityBlueprintId ); auto& components = entityBlueprint.getComponentsByName(); for( const auto& comp : components ) { auto component = engine.pluginManager.createPlugin<Component>( comp.first ); component->preInit( engine, comp.second.getComponentValueReferencesByName() ); entity.addComponent( move( component ) ); } unique_ptr<Component> saveComponent = std::make_unique<Save>( entityBlueprintId, entityBlueprint, uniqueId ); entity.addComponent( saveComponent ); // check component requirements of each component // throw exception if not all requirements are met for( const auto& component : entity.getAllComponentsByUpdateImportance() ) { for( const auto& requieredComponentId : component->getRequieredComponents() ) { if( !entity.hasComponent( requieredComponentId ) ) { throw ComponentMissingException( component->getPluginId(), requieredComponentId ); } } } entity.initComponentsByImportance( engine, world ); return move( entity ); }
CameraSource::CameraSource( const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy, int32_t cameraId, const String16& clientName, uid_t clientUid, Size videoSize, int32_t frameRate, const sp<IGraphicBufferProducer>& surface, bool storeMetaDataInVideoBuffers) : mCameraFlags(0), mNumInputBuffers(0), mVideoFrameRate(-1), mCamera(0), mSurface(surface), mNumFramesReceived(0), mLastFrameTimestampUs(0), mStarted(false), mNumFramesEncoded(0), mTimeBetweenFrameCaptureUs(0), mFirstFrameTimeUs(0), mNumFramesDropped(0), mNumGlitches(0), mGlitchDurationThresholdUs(200000), mCollectStats(false) { mVideoSize.width = -1; mVideoSize.height = -1; #ifdef MTK_AOSP_ENHANCEMENT preInit(); #endif mInitCheck = init(camera, proxy, cameraId, clientName, clientUid, videoSize, frameRate, storeMetaDataInVideoBuffers); if (mInitCheck != OK) releaseCamera(); }