Skip to content
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

Skylicht doesn't load resources #139

Closed
Joilnen opened this issue Jan 28, 2022 · 3 comments
Closed

Skylicht doesn't load resources #139

Joilnen opened this issue Jan 28, 2022 · 3 comments

Comments

@Joilnen
Copy link
Contributor

Joilnen commented Jan 28, 2022

It compiles ok but I can't run
Should I to follow XCode cmake command to compile it in linux ?
output.txt

@ducphamhong
Copy link
Contributor

ducphamhong commented Jan 31, 2022

Hello @Joilnen

Sorry because i not yet test it on MacOS.

The editor run on Windows/Linux load resources directy from path.
But MacOS need add all to .zip and add to XCode project
At the current version i need do something to load it, but i have not yet did it.

Thanks.

@ducphamhong
Copy link
Contributor

You can edit the file: SkylichtEditor.cpp
But i think the editor is not yet ready to run on MacOS

void SkylichtEditor::onUpdate()
{
	float currentTime = (float)getIrrlichtDevice()->getTimer()->getTime();

	switch (m_editorState)
	{
	case Startup:
		// init engine
		m_editorState = InitGUI;
		break;
	case InitGUI:
	{
		// import resources
		CBaseApp* app = getApplication();
		app->getFileSystem()->addFileArchive(app->getBuiltInPath("BuiltIn.zip"), false, false); << ADD THIS LINE
		app->getFileSystem()->addFileArchive(app->getBuiltInPath("Editor.zip"), false, false); << ADD THIS LINE

		// load gui shader
		CShaderManager* shaderMgr = CShaderManager::getInstance();
		shaderMgr->initGUIShader();

		// init editor gui		
		u32 w = app->getWidth();
		u32 h = app->getHeight();
		Editor::GUI::CGUIContext::initGUI((float)w, (float)h);

		m_editor = Editor::CEditor::createGetInstance();
		m_editorState = InitEngine;
	}
	break;
	case InitEngine:
	{
		CShaderManager::getInstance()->initBasicShader();
		CShaderManager::getInstance()->initSGDeferredShader();

		// import project		
		m_editor->initImportGUI();

		// change state loading
		m_editorState = Import;
	}
	break;
	case Import:
	{
		// loading project
		if (m_editor->isImportFinish() == true)
		{
			m_editor->closeImportDialog();

			if (m_editor->isUIInitiate() == false)
				m_editor->initEditorGUI();
			else
				m_editor->refresh();

			m_editorState = Running;
		}

		// running
		m_editor->update();
		Editor::GUI::CGUIContext::update(currentTime);
	}
	break;
	default:
		// running
		m_editor->update();
		Editor::GUI::CGUIContext::update(currentTime);
		break;
	}
}

@ducphamhong
Copy link
Contributor

I have fixed on MacOS and Linux
Thank you,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants