Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AT24

Pages: [1]
1
General / Re: Running game from exe loading issues.
« on: August 21, 2016, 07:36:04 am »
I fixed it, I was trying read a .txt that didnt exist in a while loop.... I need to start checking if files are being loaded and opened properly from now on.

2
General / Re: Running game from exe loading issues.
« on: August 21, 2016, 06:30:57 am »
Thanks, the temp texture due to me changing my loading methods.

Texture* texture = new Texture;

                                //load and set name
                                if (texture->texture.loadFromFile(ROOT_FOLDER + subfolders[i] + '/' + files[j]))
                                {
                                        texture->name = files[j];
                                        textureList.push_back(texture);
                                }
                                else
                                {
                                        std::cout << "Failed to load " << ROOT_FOLDER + subfolders[i] + '/' + files[j] << '\n';
                                        delete texture;
                                }

3
General / Re: Running game from exe loading issues.
« on: August 19, 2016, 05:33:32 am »
Thanks, it's, c++ but here is the code anyways. I also thought it has something to do with the paths, it's not an immediate issue as it runs in vs.

void TextureManager::loadTextures()
{
        //every sub folder
        for (unsigned int i = 0; i < subfolders.size(); i++)
        {
                std::vector<std::string> files = misc::getFileNames(ROOT_FOLDER + subfolders[i]);
               
                //every file within folder
                for (unsigned int j = 0; j < files.size(); j++)
                {
                        //create texture object
                        if (validFileType(files[j]))
                        {
                                Texture* texture = new Texture;
                                sf::Texture raw_texture;

                                //load and set name
                                raw_texture.loadFromFile(ROOT_FOLDER + subfolders[i] + '/' + files[j]);
                                texture->texture = raw_texture;
                                texture->name = files[j];

                                textureList.push_back(texture);
                        }
                }
        }
}

4
General / Running game from exe loading issues.
« on: August 19, 2016, 01:10:24 am »
Hello I'm trying to launch my game from the exe generated from visual studio 2015, but it freezes whenever I load a texture. I already moved my assets folder to the exe directory and it works fine when I launch it through vs2015. Any ideas on why this is happening?

Pages: [1]