Search the Community
Showing results for tags 'Loading'.
-
This issue started happening since the latest update where I would load a level, and if I tested it in the editor immediately, it would work without problems, but, if I just moved a single piece of code in the flowgraph it would make the level crash when loading completely, from then on out, the level wouldn't work anymore, no matter what I did. Here's a short 2 minute video showing the problem. Things I have tried: -Re-loading the level. -Re-installing the engine. -Make a new project. I'm using the latest version of LEX 1.
-
Hello Everyone, So I have started working on my game in leadwerks (C++). It has been really fun so far but for some strange reason I just can't get it to work the way I want. For now the project only consists of a few files and I was working on getting my SceneManager to work. The scenemanager should create the world / load worlds etc but when I run my code it keeps flickering the screen and doesn't load up the map correct. I have tried both world->clear and world->release but it keeps flickering the loading screen and doesn't return. So I hope someone could help me out and show me what I am doing wrong here (it works in my head ). #include "SceneManager.h" using namespace Leadwerks; SceneManager::SceneManager() { this->mLoadingTexture = NULL; this->mCustomLoadingTexture = NULL; } SceneManager::~SceneManager() { } bool SceneManager::Init() { // Create / Load a default placeholder for the loading screen this->mLoadingTexture = Texture::Load("Materials/UI/Loading_Default.tex"); if (this->mLoadingTexture == NULL) return LogUtil::returnWithMessage(LogType::LOG_ERROR, "Failed to load texture: 'Materials/UI/Loading_Default.tex'"); //this->mLoadingTexture->AddRef(); // Create / Load World this->mWorld = World::Create(); } bool SceneManager::LoadScene(std::string map, World* world, Context* context) { // Unload custom loading screen if loaded //this->UnloadCustomLoadingTexture(); // Now reload the load texture // First render the Loading Screen if (FileSystem::GetFileType("Materials/UI/Loading_" + map + ".tex") != NULL){ LogUtil::writeMessage(LogType::LOG_INFO, "Custom loadingscreen found: Materials/UI/Loading_" + map + ".tex"); // Try to load it this->mCustomLoadingTexture = Texture::Load("Materials/UI/Loading_" + map + ".tex"); //this->mCustomLoadingTexture->AddRef(); } else{ LogUtil::writeMessage(LogType::LOG_DEBUG, "Map doesn't have custom loadingscreen..."); } // Next render the loading screen (as the load map function blocks) if (mCustomLoadingTexture != NULL) context->DrawImage(mCustomLoadingTexture, 0, 0, context->GetWidth(), context->GetHeight()); else context->DrawImage(mLoadingTexture, 0, 0, context->GetWidth(), context->GetHeight()); context->Sync(false); // Clear the old world Time::Pause(); if ( world != NULL ) world->Release(); world = World::Create(); // Now load the actual map if (!Map::Load("Maps/" + map + ".map")){ // Failed to load map LogUtil::writeMessage(LogType::LOG_WARNING, "Failed to load map..."); } Time::Resume(); // The map is loaded now create a scene from it // TODO: CREATE A SCENE // Unload the custom loading texture now that we have build the scene //this->UnloadCustomLoadingTexture(); return true; } void SceneManager::UnloadCustomLoadingTexture() { if (this->mCustomLoadingTexture != NULL){ this->mCustomLoadingTexture->Release(); this->mCustomLoadingTexture = NULL; } } void SceneManager::Update() { if (mWorld != NULL) mWorld->Update(); } void SceneManager::Render() { if (mWorld != NULL) mWorld->Render(); } With kind regards, StaticCube
-
Hello, lxFirebal69xl pointed out that the loadfile() function i used in the Notes.lua crashes the application. I tested it and it looks like loadfile can only load files that are placed normally in the game directory and not inside a zip-file. is this a bug or a feature?
-
... function App:SwitchLevel(levelname) self.world:Clear() self.world = World:Create() self.mapFile = name self.world:Release() end ... function App:Loop() self:ShouldSwitchLevel() --If window has been closed, end the program if self.window:Closed() or self.window:KeyDown(Key.Escape) then return false end if (self.window:KeyHit(Key.C)) then self.world:Clear() self:SwitchLevel("Maps/Level01.map") end So I have been working on a new project and it always seemed to be no big deal to load a map but right now I dont know why its not loading at all. When i press c (test) it makes the .exe not respond http://www.artur-betz.de/sdsd..html here the full App.lua
-
I have lots of gui graphics and i would like to combine them into a single file that won't be packaged in the zip file, would it be possible to instruct the texture loader to load from file offset and length? Something like: Texture* Load(const std::string& path, int flags=0, const uint64 fileid=0, uint64 file_offset, uint64 file_length)