Skip to content

Commit

Permalink
Fixing error on linux, where the != operator is not overridden when c…
Browse files Browse the repository at this point in the history
…omparing ifstreams.
  • Loading branch information
clee231 committed Oct 6, 2017
1 parent 011f926 commit 3258c4c
Show file tree
Hide file tree
Showing 16 changed files with 782 additions and 457 deletions.
1,173 changes: 749 additions & 424 deletions Game_Pencil_Engine_IDE.depend

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/audio_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ void audioResource::preprocess_self(std::string alternatePath )
std::ifstream gameResourceFileIn( newFileIn.c_str() );

record_error("Loading audio - "+newFileIn);
if( !gameResourceFileIn.fail() )
//If the level file could be loaded
if( gameResourceFileIn != NULL )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -594,7 +594,7 @@ void audioResource::save_resource(std::string alternatePath, int backupId)
}
std::ofstream newSaveDataFile( newFileOut.c_str() );
//If the audio file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down
4 changes: 2 additions & 2 deletions src/dictionaryresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void dictionaryResource::preprocess_self(std::string alternatePath )

record_error("Loading dictionary - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -363,7 +363,7 @@ void dictionaryResource::save_resource(std::string alternatePath, int backupId )
}
std::ofstream newSaveDataFile( newFileOut.c_str() );
//If the font file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down
4 changes: 2 additions & 2 deletions src/fontResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void fontResource::preprocess_self(std::string alternatePath)

record_error("Loading font - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -579,7 +579,7 @@ void fontResource::save_resource(std::string alternatePath, int backupId)
}
std::ofstream newSaveDataFile( newFileOut.c_str() );
//If the font file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down
4 changes: 2 additions & 2 deletions src/functionResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void functionResource::preprocess_self(std::string alternatePath)

record_error("Loading function - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -335,7 +335,7 @@ void functionResource::save_resource(std::string alternatePath, int backupId)
}
std::ofstream newSaveDataFile( newFileOut.c_str() );
//If the scene file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjectresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ void gameObjectResource::preprocess_self(std::string alternatePath)
std::ifstream gameObjFileIn( newameObjFilename.c_str() );

//If the level file could be loaded
if( gameObjFileIn != NULL )
if( !gameObjFileIn.fail() )
{
//makes sure the file is open
if (gameObjFileIn.is_open())
Expand Down Expand Up @@ -2520,7 +2520,7 @@ void gameObjectResource::save_resource(std::string alternatePath, int backupId)
}

std::ofstream newGameObjFile( newFileOut.c_str() );
if( newGameObjFile != NULL )
if( !newGameObjFile.fail() )
{
resourceNameLabel->set_name(resourceName );
//makes sure the file is open
Expand Down
4 changes: 2 additions & 2 deletions src/gamesceneresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ void gameSceneResource::preprocess_self(std::string alternatePath)

//record_error("Loading scene - "+newScnFilename);
//If the level file could be loaded
if( gameScnFileIn != NULL )
if( !gameScnFileIn.fail() )
{
//makes sure the file is open
if (gameScnFileIn.is_open())
Expand Down Expand Up @@ -4442,7 +4442,7 @@ void gameSceneResource::save_resource(std::string alternatePath, int backupId)
}
std::ofstream newSceneFile( newFileOut.c_str() );
//If the scene file could be saved
if( newSceneFile != NULL )
if( !newSceneFile.fail() )
{
//makes sure the file is open
if (newSceneFile.is_open())
Expand Down
14 changes: 7 additions & 7 deletions src/gpe_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13952,7 +13952,7 @@ bool GPE_TextAreaInputBasic::import_text(std::string newFileName)
{
std::ifstream newTxtFile( newFileName.c_str() );
//If the level file could be loaded
if( newTxtFile != NULL )
if( !newTxtFile.fail() )
{
//makes sure the file is open
if (newTxtFile.is_open())
Expand Down Expand Up @@ -19492,7 +19492,7 @@ void GPE_Template::load_theme(std::string themeLocationIn)
if( file_exists(themeGlobalLocation) )
{
std::ifstream templateFileIn( themeGlobalLocation.c_str() );
if( templateFileIn != NULL )
if( !templateFileIn.fail() )
{
//makes sure the file is open
if (templateFileIn.is_open())
Expand Down Expand Up @@ -24075,7 +24075,7 @@ bool GPE_ProjectFolder::load_project_file(std::string projectFileIn )
std::ifstream newprofileFile( projectFileIn.c_str() );

//If the level file could be loaded
if( newprofileFile != NULL )
if( !newprofileFile.fail() )
{
//makes sure the file is open
if (newprofileFile.is_open())
Expand Down Expand Up @@ -27257,7 +27257,7 @@ GPE_Gui_Engine::GPE_Gui_Engine()
//loads the recent file list
std::string recentFileListFileName = get_user_settings_folder()+"recent_projects.txt";
std::ifstream recentFileListFile( recentFileListFileName.c_str() );
if( recentFileListFile != NULL )
if( !recentFileListFile.fail() )
{
std::string currLine = "";
//makes sure the file is open
Expand Down Expand Up @@ -27453,7 +27453,7 @@ void GPE_Gui_Engine::add_to_recent_project_list(std::string newProjectFileName,
cSize = (int)gpeRecentProjects.size();
std::string recentFileListFileName = get_user_settings_folder()+"recent_projects.txt";
std::ofstream recentFileListFile( recentFileListFileName.c_str() );
if( recentFileListFile != NULL )
if( !recentFileListFile.fail() )
{
//makes sure the file is open
if (recentFileListFile.is_open())
Expand Down Expand Up @@ -28385,7 +28385,7 @@ void GPE_Gui_Engine::load_settings()

record_error("Loading settings - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -29633,7 +29633,7 @@ void GPE_Gui_Engine::save_settings()
std::string newSaveDataFilename = get_user_settings_folder()+"gpe_ide_settings.txt";
std::ofstream newSaveDataFile( newSaveDataFilename.c_str() );
//If the scene file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down
4 changes: 2 additions & 2 deletions src/gpe_editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void gamePencilEditorSettingsResource::preprocess_self(std::string alternatePath

record_error("Loading Local settings - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -683,7 +683,7 @@ void gamePencilEditorSettingsResource::save_resource(std::string alternatePath,
std::string newSaveDataFilename = get_user_settings_folder()+"gpe_ide_local_settings.txt";
std::ofstream newSaveDataFile( newSaveDataFilename.c_str() );
//If the scene file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down
4 changes: 2 additions & 2 deletions src/pathresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ void gamePathResource::preprocess_self(std::string alternatePath )

record_error("Loading Path - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -1149,7 +1149,7 @@ void gamePathResource::save_resource(std::string alternatePath, int backupId )
}
std::ofstream newSaveDataFile( newFileOut.c_str() );
//If the font file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down
2 changes: 1 addition & 1 deletion src/project_browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool quickProjectReader::review_project(std::string projectFileName)
std::ifstream newprofileFile( projectFileName.c_str() );

//If the level file could be loaded
if( newprofileFile != NULL )
if( !newprofileFile.fail() )
{
//makes sure the file is open
if (newprofileFile.is_open())
Expand Down
2 changes: 1 addition & 1 deletion src/project_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ void projectPropertiesResource::preprocess_self(std::string alternatePath)

record_error("Loading project properties - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
record_error("Processing project properties file...");
//makes sure the file is open
Expand Down
4 changes: 2 additions & 2 deletions src/spriteresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ void spriteResource::preprocess_self(std::string alternatePath)
//record_error("Loading sprite - "+newFileIn);
//If the level file could be loaded
double foundFileVersion = -1;
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//record_error("Procesing sprite file...");
//makes sure the file is open
Expand Down Expand Up @@ -1330,7 +1330,7 @@ void spriteResource::save_resource(std::string alternatePath, int backupId)
}
std::ofstream newSaveDataFile( newFileOut.c_str() );
//If the scene file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down
4 changes: 2 additions & 2 deletions src/textureresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void textureResource::preprocess_self(std::string alternatePath)

//record_error("Loading Texture - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -543,7 +543,7 @@ void textureResource::save_resource(std::string alternatePath, int backupId)
}
std::ofstream newSaveDataFile( newFileOut.c_str() );
//If the scene file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{

//makes sure the file is open
Expand Down
4 changes: 2 additions & 2 deletions src/tilesheet_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void tilesheetResource::preprocess_self(std::string alternatePath)

//record_error("Loading Tilesheet - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -624,7 +624,7 @@ void tilesheetResource::save_resource(std::string alternatePath, int backupId)
}
std::ofstream newSaveDataFile( newFileOut.c_str() );
//If the scene file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down
4 changes: 2 additions & 2 deletions src/video_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void videoResource::preprocess_self(std::string alternatePath)

record_error("Loading video - "+newFileIn);
//If the level file could be loaded
if( gameResourceFileIn != NULL )
if( !gameResourceFileIn.fail() )
{
//makes sure the file is open
if (gameResourceFileIn.is_open())
Expand Down Expand Up @@ -451,7 +451,7 @@ void videoResource::save_resource(std::string alternatePath, int backupId)
}
std::ofstream newSaveDataFile( newFileOut.c_str() );
//If the scene file could be saved
if( newSaveDataFile != NULL )
if( !newSaveDataFile.fail() )
{
//makes sure the file is open
if (newSaveDataFile.is_open())
Expand Down

0 comments on commit 3258c4c

Please sign in to comment.