Ejemplo n.º 1
0
//
// Create the dialog and return its handle on success
//
DWORD Dialog::Create(
		IN HWND Parent,
		IN BOOLEAN Modal)
{
	DWORD Result = ERROR_SUCCESS;

	if (!Window)
	{
		if (Modal)
		{
			if (DialogBoxParam(
					GetInstance(),
					MAKEINTRESOURCE(GetResourceId()),
					Parent,
					(DLGPROC)OnMsgSt,
					(LONG)this) == -1)
				Result = GetLastError();
		}
		else
		{
			if (!(Window = CreateDialogParam(
					GetInstance(),
					MAKEINTRESOURCE(GetResourceId()),
					Parent,
					(DLGPROC)OnMsgSt,
					(LONG)this)))
				Result = GetLastError();
		}
	}
	else
	{
		//
		// If the window is already created, make it visible and bring it to the
		// foreground
		//
		ShowWindow(
				GetWindow(), 
				SW_SHOW);

		SetForegroundWindow(
				GetWindow());
	}

	//
	// If there is no window handle, log that fact
	//
	if ((!Modal) &&
	    (!Window))
		Log(LOG_SEV_ERROR, 
				TEXT("Create(): Dialog %d failed to create, %lu."),
				GetResourceId(),
				GetLastError());

	return Result;
}
Ejemplo n.º 2
0
	void Renderer::RenderablesSort(vector<Entity*>* renderables)
	{
		if (renderables->size() <= 2)
			return;

		// Sort by depth (front to back)
		if (m_camera)
		{
			sort(renderables->begin(), renderables->end(), [this](Entity* a, Entity* b)
			{
				// Get renderable component
				auto a_renderable = a->GetRenderable_PtrRaw();
				auto b_renderable = b->GetRenderable_PtrRaw();
				if (!a_renderable || !b_renderable)
					return false;

				// Get materials
				const auto a_material = a_renderable->MaterialPtr();
				const auto b_material = b_renderable->MaterialPtr();
				if (!a_material || !b_material)
					return false;

				const auto a_depth = (a_renderable->GeometryAabb().GetCenter() - m_camera->GetTransform()->GetPosition()).LengthSquared();
				const auto b_depth = (b_renderable->GeometryAabb().GetCenter() - m_camera->GetTransform()->GetPosition()).LengthSquared();

				return a_depth < b_depth;
			});
		}

		// Sort by material
		sort(renderables->begin(), renderables->end(), [](Entity* a, Entity* b)
		{
			// Get renderable component
			const auto a_renderable = a->GetRenderable_PtrRaw();
			const auto b_renderable = b->GetRenderable_PtrRaw();
			if (!a_renderable || !b_renderable)
				return false;

			// Get materials
			const auto a_material = a_renderable->MaterialPtr();
			const auto b_material = b_renderable->MaterialPtr();
			if (!a_material || !b_material)
				return false;

			// Order doesn't matter, as long as they are not mixed
			return a_material->GetResourceId() < b_material->GetResourceId();
		});
	}
Ejemplo n.º 3
0
void Object::FillFullPacket( const PacketPtr& packet ) {
	(*packet) << static_cast<sf::Uint16>( ServerToClient::SERVER_OBJECT ) << GetId() << static_cast<sf::Uint16>( ServerToClientObject::OBJECT_STATE )
	          << GetType() << GetName()
	          << GetResourceId()
	          << GetSize().x << GetSize().y
	          << GetPosition().x << GetPosition().y
	          << GetVelocity().x << GetVelocity().y
	          << GetRotation() << GetRotationalVelocity();
}
Ejemplo n.º 4
0
/**
 * Open a stream on to the content associated with a content URI.  If there
 * is no data associated with the URI, FileNotFoundException is thrown.
 *
 * <h5>Accepts the following URI schemes:</h5>
 * <ul>
 * <li>content ({@link #SCHEME_CONTENT})</li>
 * <li>android.resource ({@link #SCHEME_ANDROID_RESOURCE})</li>
 * <li>file ({@link #SCHEME_FILE})</li>
 * </ul>
 *
 * <p>See {@link #openAssetFileDescriptor(Uri, String)} for more information
 * on these schemes.
 *
 * @param uri The desired URI.
 * @return InputStream
 * @throws FileNotFoundException if the provided URI could not be opened.
 * @see #openAssetFileDescriptor(Uri, String)
 */
ECode ContentResolver::OpenInputStream(
    /* [in] */ IUri* uri,
    /* [out] */ IInputStream** istream)
{
    VALIDATE_NOT_NULL(istream);

    String scheme;
    FAIL_RETURN(uri->GetScheme(&scheme));

    if (scheme.Equals(SCHEME_ELASTOS_RESOURCE)) {
        // Note: left here to avoid breaking compatibility.  May be removed
        // with sufficient testing.
        AutoPtr<IOpenResourceIdResult> r;
        FAIL_RETURN(GetResourceId(uri, (IOpenResourceIdResult**)&r));

        // try {
            AutoPtr<IResources> resources;
            FAIL_RETURN(r->GetResources((IResources**)&resources));

            Int32 id;
            FAIL_RETURN(r->GetResourceId(&id));

            return resources->OpenRawResource(id, istream);
        // } catch (Resources.NotFoundException ex) {
        //     throw new FileNotFoundException("Resource does not exist: " + uri);
        // }
    } else if (scheme.Equals(SCHEME_FILE)) {
        // Note: left here to avoid breaking compatibility.  May be removed
        // with sufficient testing.
        String path;
        FAIL_RETURN(uri->GetPath(&path));

        return CFileInputStream::New(path, (IFileInputStream**)&istream);
    } else {
        AutoPtr<IAssetFileDescriptor> fd;
        FAIL_RETURN(OpenAssetFileDescriptor(
            uri, String("r"), (IAssetFileDescriptor**)&fd));
        // try {
            if (fd == NULL) {
                *istream = NULL;
                return NOERROR;
            }
            else {
                // TODO: ALEX
                // return fd->CreateInputStream(istream);
                return E_NOT_IMPLEMENTED;
            }
        // } catch (IOException e) {
        //     throw new FileNotFoundException("Unable to create stream");
        // }
    }
}
Ejemplo n.º 5
0
CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name) {
  int resource_id = GetResourceId(resource_name);
  if (resource_id == 0)
    return NULL;

  DWORD dwSize;
  LPBYTE pBytes;

  if (LoadBinaryResource(resource_id, dwSize, pBytes)) {
    return CefStreamReader::CreateForHandler(
        new CefByteReadHandler(pBytes, dwSize, NULL));
  }

  ASSERT(FALSE);  // The resource should be found.
  return NULL;
}
Ejemplo n.º 6
0
bool LoadBinaryResource(const char* resource_name, std::string& resource_data) {
  int resource_id = GetResourceId(resource_name);
  if (resource_id == 0)
    return false;

  DWORD dwSize;
  LPBYTE pBytes;

  if (LoadBinaryResource(resource_id, dwSize, pBytes)) {
    resource_data = std::string(reinterpret_cast<char*>(pBytes), dwSize);
    return true;
  }

  ASSERT(FALSE);  // The resource should be found.
  return false;
}
Ejemplo n.º 7
0
void PostHightScore::generateResponse(Poco::Net::HTTPServerRequest& inRequest,
                                      Poco::Net::HTTPServerResponse& outResponse)
{
    std::string requestBody;
    inRequest.stream() >> requestBody;

    Args args;
    GetArgs(requestBody, args);

    std::string name = URIDecode(GetArg(args, "name"));
    const std::string & score = GetArg(args, "score");

    Statement insert(getSession());
    insert << "INSERT INTO HighScores VALUES(NULL, strftime('%s', 'now'), ?, ?)", use(name), use(score);
    insert.execute();

    // Return an URL instead of a HTML page.
    // This is because the client is the JavaScript application in this case.
    std::string body = ResourceManager::Instance().getResourceLocation(GetResourceId());
    outResponse.setContentLength(body.size());
    outResponse.send() << body;
}
Ejemplo n.º 8
0
const CResource* CResourceHandler::GetResourceByName(const std::string& resourceName) const
{
	return GetResource(GetResourceId(resourceName));
}
FreeMemoryThresholdMonitor::FreeMemoryThresholdMonitor( const std::string& source_id, QueryFunction threshold, QueryFunction measured ):
GenericThresholdMonitor<int64_t>(source_id, GetResourceId(), GetMessageClass(), threshold, measured )
{

}
Ejemplo n.º 10
0
MI_Result ValidateIfDuplicatedInstances(
    _In_ MI_InstanceA *instanceA,
    _Outptr_result_maybenull_ MI_Instance **extendedError)
{
    MI_Result miResult = MI_RESULT_OK;
    MI_Instance* instance0;
    MI_Instance* instance1;
    MI_Char* keywords;
    const MI_Char* resourceId0;
    const MI_Char* resourceId1;
    MI_Uint32 i, j;
    
    if (extendedError == NULL)
    {        
        return MI_RESULT_INVALID_PARAMETER; 
    }
    *extendedError = NULL;	// Explicitly set *extendedError to NULL as _Outptr_ requires setting this at least once.	

    for (i = 0; i < instanceA->size; i++)
    {
        instance0 = instanceA->data[i];
        if (instance0->classDecl->superClass != NULL &&Tcscasecmp(instance0->classDecl->superClass, BASE_RESOURCE_CLASSNAME) == 0)
        {
            for (j = i + 1; j < instanceA->size; j++)
            {
                instance1 = instanceA->data[j];
                if (Tcscasecmp(instance0->classDecl->name, instance1->classDecl->name) == 0
                    && IsMatchedKeyProperties(instance0, instance1, &keywords, &miResult, extendedError))
                {
                    if (miResult != MI_RESULT_OK && *extendedError)
                    {
                        return miResult;
                    }

                    resourceId0 = GetResourceId(instance0);
                    resourceId1 = GetResourceId(instance1);
                    if (resourceId0 == NULL || resourceId1 == NULL)
                    {
                        miResult = CreateMemoryError(extendedError);
                        DSC_free(keywords);
                        return miResult;
                    }

                    miResult = GetCimMIError4Params(MI_RESULT_ALREADY_EXISTS, extendedError, ID_CA_DUPLICATE_KEYS, instance0->classDecl->name, resourceId0, resourceId1, keywords);
                    if (keywords)
                    {
                        DSC_free(keywords);
                    }

                    return miResult;
                }
                else if (miResult != MI_RESULT_OK)
                {
                    return miResult;
                }
            }
        }
    }

    return MI_RESULT_OK;
}
Ejemplo n.º 11
0
ECode ContentResolver::OpenAssetFileDescriptor(
    /* [in] */ IUri* uri,
    /* [in] */ const String& mode,
    /* [out] */ IAssetFileDescriptor** result)
{
    VALIDATE_NOT_NULL(result);

    String scheme;
    FAIL_RETURN(uri->GetScheme(&scheme));

    if (scheme.Equals(SCHEME_ELASTOS_RESOURCE)) {
        if (!mode.Equals("r")) {
            // throw new FileNotFoundException("Can't write resources: " + uri);
            return E_FILE_NOT_FOUND_EXCEPTION;
        }

        AutoPtr<IOpenResourceIdResult> r;
        FAIL_RETURN(GetResourceId(uri, (IOpenResourceIdResult**)&r));

        // try {
            AutoPtr<IResources> resources;
            FAIL_RETURN(r->GetResources((IResources**)&resources));

            Int32 id;
            FAIL_RETURN(r->GetResourceId(&id));

            return resources->OpenRawResourceFd(id, result);
        // } catch (Resources.NotFoundException ex) {
        //     throw new FileNotFoundException("Resource does not exist: " + uri);
        // }
    } else if (scheme.Equals(SCHEME_FILE)) {
        AutoPtr<IParcelFileDescriptorHelper> helper;
        AutoPtr<IFile> file;
        AutoPtr<IParcelFileDescriptor> pfd;

        FAIL_RETURN(CParcelFileDescriptorHelper::AcquireSingleton(
            (IParcelFileDescriptorHelper**)&helper));

        String path;
        FAIL_RETURN(uri->GetPath(&path));

        FAIL_RETURN(CFile::New(path, (IFile**)&file));

        Int32 nMode;
        FAIL_RETURN(ModeToMode(uri, mode, &nMode));

        FAIL_RETURN(helper->Open(file, nMode, (IParcelFileDescriptor**)&pfd));

        return CAssetFileDescriptor::New(pfd, 0, -1, result);
    } else {
        // TODO: ALEX we need IAssetFileDescriptor::GetParcelFileDescriptor
        return E_NOT_IMPLEMENTED;
#if 0
        AutoPtr<IContentProvider> provider;
        FAIL_RETURN(AcquireProvider2(uri, (IContentProvider**)&provider));
        if (provider == NULL) {
            // throw new FileNotFoundException("No content provider: " + uri);
            return E_FILE_NOT_FOUND_EXCEPTION;
        }
        // try {
#define FAIL_RETURN_RELEASE_PROVIDER(expr) \
    do { \
        ECode ec = expr; \
        if (FAILED(ec)) { \
            ReleaseProvider(provider); \
            return ec; \
        } \
    } while(0);

            AutoPtr<IAssetFileDescriptor> fd;
            FAIL_RETURN_RELEASE_PROVIDER(provider->OpenAssetFile(uri, mode,
                (IAssetFileDescriptor**)&fd));
            if (fd == NULL) {
                ReleaseProvider(provider);
                *result = NULL;
                return NOERROR;
            }

            AutoPtr<IParcelFileDescriptor> pfd2;
            FAIL_RETURN_RELEASE_PROVIDER(fd=>GetParcelFileDescriptor(
                (IParcelFileDescriptor**)&pfd2));

            AutoPtr<IParcelFileDescriptor> pfd;
            pfd = new CParcelFileDescriptorInner(
                ProbeIContentProvider(), pfd2, provider);
            if (pfd == NULL) {
                ReleaseProvider(provider);
                return E_OUT_OF_MEMORY;
            }

            Int64 startOffset, length;
            FAIL_RETURN_RELEASE_PROVIDER(fd->GetStartOffset(&startOffset));
            FAIL_RETURN_RELEASE_PROVIDER(fd->GetDeclaredLength(&length));

            FAIL_RETURN_RELEASE_PROVIDER(CAssetFileDescriptor::New(
                pfd, startOffset, length, result));

            return NOERROR;
        // } catch (RemoteException e) {
        //     releaseProvider(provider);
        //     throw new FileNotFoundException("Dead content provider: " + uri);
        // } catch (FileNotFoundException e) {
        //     releaseProvider(provider);
        //     throw e;
        // } catch (RuntimeException e) {
        //     releaseProvider(provider);
        //     throw e;
        // }
#endif
    }
}
Ejemplo n.º 12
0
MOboolean
moResourceManager::Init(
                        const moText& p_apppath,
                        const moText& p_datapath,
						moConfig&  p_consoleconfig,
						MOint p_render_to_texture_mode,
						MOint p_screen_width,
						MOint p_screen_height,
						MOint p_render_width,
						MOint p_render_height,
						MO_HANDLE p_OpWindowHandle,
						MO_DISPLAY p_Display) {

	if ( GetResourceByType( MO_RESOURCETYPE_DEBUG ) == NULL )
		AddResource( new moDebugManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_NET ) == NULL )
		AddResource( new moNetManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_FILE ) == NULL )
		AddResource( new moFileManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_FILTER ) == NULL )
		AddResource( new moFilterManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_TIME ) == NULL )
		AddResource( new moTimeManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_DATA ) == NULL )
		AddResource( new moDataManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_MATH ) == NULL )
		AddResource( new moMathManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_SHADER ) == NULL )
		AddResource( new moShaderManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_FB )==NULL )
		AddResource( new moFBManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_GL )==NULL )
		AddResource( new moGLManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_DECODER )==NULL )
		AddResource( new moDecoderManager() );


	if ( GetResourceByType( MO_RESOURCETYPE_RENDER )==NULL )
		AddResource( new moRenderManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_TEXTURE )==NULL )
		AddResource( new moTextureManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_SOUND )==NULL )
		AddResource( new moSoundManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_VIDEO )==NULL )
		AddResource( new moVideoManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_MODEL )==NULL )
		AddResource( new mo3dModelManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_FONT )==NULL )
		AddResource( new moFontManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_GUI )==NULL )
		AddResource( new moGUIManager() );

	if ( GetResourceByType( MO_RESOURCETYPE_SCRIPT )==NULL )
		AddResource( new moScriptManager() );

	///Asigna configname, y labelname a los recursos en caso de encontrarse en el config
	moText resname;
	moText cfname;
	moText lblname;

	moParam& presources(p_consoleconfig.GetParam(moText("resources")));

	presources.FirstValue();

	for(MOuint r=0; r<presources.GetValuesCount(); r++) {

		moResource* presource = NULL;

		resname = presources[MO_SELECTED][MO_CFG_RESOURCE].Text();
		cfname = presources[MO_SELECTED][MO_CFG_RESOURCE_CONFIG].Text();
		lblname = presources[MO_SELECTED][MO_CFG_RESOURCE_LABEL].Text();

		MOint rid = GetResourceId( resname );

		if(rid>-1) presource = GetResource(rid);

		if (presource) {
			presource->SetConfigName(cfname);
			presource->SetLabelName(lblname);
		}
		presources.NextValue();
	}

    if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Embedded Resources."));
	MODebugMan = (moDebugManager*) GetResourceByType( MO_RESOURCETYPE_DEBUG );
	if (MODebugMan) {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Debug Man Resource."));
	    if (!MODebugMan->Init())
            MODebug2->Error(moText("moResourceManager:: Debug Man. Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Debug Man. Creation Error."));
    }

	MONetMan = (moNetManager*) GetResourceByType( MO_RESOURCETYPE_NET );
	if (MONetMan) {
	    if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Net Man Resource."));
	    if (!MONetMan->Init())
	        MODebug2->Error(moText("moResourceManager:: Net Man. Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Net Man. Creation Error."));
    }

	MOFileMan = (moFileManager*) GetResourceByType( MO_RESOURCETYPE_FILE );
	if (MOFileMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing File Man Resource."));
	    if (!MOFileMan->Init())
            MODebug2->Error(moText("moResourceManager:: File Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: File Man Creation Error."));
    }


	MODataMan = (moDataManager*) GetResourceByType( MO_RESOURCETYPE_DATA );
	if (MODataMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Data Man Resource."));
	    if (!MODataMan->Init( p_apppath, p_datapath, p_consoleconfig.GetName()))
            MODebug2->Error(moText("moResourceManager:: Data Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Data Man Creation Error."));
    }

	MOFilterMan = (moFilterManager*) GetResourceByType( MO_RESOURCETYPE_FILTER );
	if (MOFilterMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Filter Man Resource."));
	    if (!MOFilterMan->Init())
            MODebug2->Error(moText("moResourceManager:: Filter Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Filter Man Creation Error."));
    }

	MOTimeMan = (moTimeManager*) GetResourceByType( MO_RESOURCETYPE_TIME );
	if (MOTimeMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Time Man Resource."));
	    if (!MOTimeMan->Init())
            MODebug2->Error(moText("moResourceManager:: Time Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Time Man Creation Error."));
    }

	MOGLMan = (moGLManager*) GetResourceByType( MO_RESOURCETYPE_GL );
	if (MOGLMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing GL Man Resource."));
	    if (!MOGLMan->Init())
            MODebug2->Error(moText("moResourceManager:: GL Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: GL Man Creation Error."));
    }

	MOFBMan = (moFBManager*) GetResourceByType( MO_RESOURCETYPE_FB );
	if (MOFBMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing FrameBuffer Man Resource."));
	    if (!MOFBMan->Init())
            MODebug2->Error(moText("moResourceManager:: FrameBuffer Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: FrameBuffer Man Creation Error."));
    }

	MOTextureMan = (moTextureManager*)  GetResourceByType( MO_RESOURCETYPE_TEXTURE );
	if (MOTextureMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Texture Man Resource."));
	    if (!MOTextureMan->Init())
            MODebug2->Error(moText("moResourceManager:: Texture Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Texture Man Creation Error."));
    }

	MODecoderMan = (moDecoderManager*)  GetResourceByType( MO_RESOURCETYPE_DECODER );
	if (MODecoderMan)  {
        if (MODebug2) MODebug2->Message(moText("moDecoderMan:: Initializing Decoder Manager Resource."));
	    if (!MODecoderMan->Init())
            MODebug2->Error(moText("moDecoderMan:: Decoder Manager Initialization Error."));
	} else {
	    MODebug2->Error(moText("moDecoderMan:: Decoder Manager Creation Error."));
  }


	MORenderMan = (moRenderManager*) GetResourceByType( MO_RESOURCETYPE_RENDER );
	if (MORenderMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Render Man Resource."));
	    if (!MORenderMan->Init( (moRenderManagerMode)p_render_to_texture_mode, p_screen_width, p_screen_height, p_render_width, p_render_height ))
            MODebug2->Error(moText("moResourceManager:: Render Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Render Man Creation Error."));
    }

	MOMathMan = (moMathManager*) GetResourceByType( MO_RESOURCETYPE_MATH );
	if (MOMathMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Math Man Resource."));
	    if (!MOMathMan->Init())
            MODebug2->Error(moText("moResourceManager:: Math Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Math Man Creation Error."));
    }

	MOShaderMan = (moShaderManager*) GetResourceByType( MO_RESOURCETYPE_SHADER );
	if (MOShaderMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Shsder Man Resource."));
	    if (!MOShaderMan->Init())
            MODebug2->Error(moText("moResourceManager:: Shader Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Shader Man Creation Error."));
    }

	MOFontMan = (moFontManager*) GetResourceByType( MO_RESOURCETYPE_FONT );
	if (MOFontMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Font Man Resource."));
	    if (!MOFontMan->Init())
            MODebug2->Error(moText("moResourceManager:: Font Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Font Man Creation Error."));
    }

	MOGuiMan = (moGUIManager*)  GetResourceByType( MO_RESOURCETYPE_GUI );
	if (MOGuiMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing GUI Man Resource."));
	    if (!MOGuiMan->Init( p_OpWindowHandle, p_Display ))
            MODebug2->Error(moText("moResourceManager:: GUI Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: GUI Man Creation Error."));
    }

	MOSoundMan = (moSoundManager*)  GetResourceByType( MO_RESOURCETYPE_SOUND );
	if (MOSoundMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Sound Man Resource."));
	    if (!MOSoundMan->Init())
            MODebug2->Error(moText("moResourceManager:: Sound Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Sound Man Creation Error."));
    }

	MOVideoMan = (moVideoManager*)  GetResourceByType( MO_RESOURCETYPE_VIDEO );
	if (MOVideoMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Video Man Resource."));
	    if (!MOVideoMan->Init())
            MODebug2->Error(moText("moResourceManager:: Video Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Video Man Creation Error."));
    }

	MOModelMan = (mo3dModelManager*)  GetResourceByType( MO_RESOURCETYPE_MODEL );
	if (MOModelMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Model Man Resource."));
	    if (!MOModelMan->Init())
            MODebug2->Error(moText("moResourceManager:: Model Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Model Man Creation Error."));
    }

	MOScriptMan = (moScriptManager*)  GetResourceByType( MO_RESOURCETYPE_SCRIPT );
	if (MOScriptMan)  {
        if (MODebug2) MODebug2->Message(moText("moResourceManager:: Initializing Script Man Resource."));
	    if (!MOScriptMan->Init())
            MODebug2->Error(moText("moResourceManager:: Script Man Initialization Error."));
	} else {
	    MODebug2->Error(moText("moResourceManager:: Script Man Creation Error."));
    }

	m_Plugins.Init( 0, NULL);

	m_bInitialized = true;

    if (MODebug2) MODebug2->Message(moText("moResourceManager:: Embedded Resources Ready."));

	return Initialized();
}
Ejemplo n.º 13
0
void NativeImage::CreateGlTexture()
{
  ResourceClient& resourceClient = ThreadLocalStorage::Get().GetResourceClient();
  resourceClient.CreateGlTexture( GetResourceId() );
}