mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
@ -7,4 +7,5 @@ add_subdirectory(plFileSecure)
|
||||
add_subdirectory(plFileEncrypt)
|
||||
add_subdirectory(plMD5)
|
||||
add_subdirectory(plPageInfo)
|
||||
add_subdirectory(plPageOptimizer)
|
||||
add_subdirectory(plSHA)
|
||||
|
31
Sources/Plasma/Apps/plPageOptimizer/CMakeLists.txt
Normal file
31
Sources/Plasma/Apps/plPageOptimizer/CMakeLists.txt
Normal file
@ -0,0 +1,31 @@
|
||||
include_directories("../../Apps")
|
||||
include_directories("../../CoreLib")
|
||||
include_directories("../../FeatureLib/inc")
|
||||
include_directories("../../FeatureLib")
|
||||
include_directories("../../NucleusLib/inc")
|
||||
include_directories("../../NucleusLib")
|
||||
include_directories("../../PubUtilLib/inc")
|
||||
include_directories("../../PubUtilLib")
|
||||
|
||||
set(plPageOptimizer_SOURCES
|
||||
main.cpp
|
||||
plAllCreatables.cpp
|
||||
plPageOptimizer.cpp
|
||||
)
|
||||
|
||||
set(plPageOptimizer_HEADERS
|
||||
plPageOptimizer.h
|
||||
)
|
||||
|
||||
add_executable(plPageOptimizer ${plPageOptimizer_SOURCES})
|
||||
|
||||
target_link_libraries(plPageOptimizer CoreLib)
|
||||
target_link_libraries(plPageOptimizer plResMgr)
|
||||
target_link_libraries(plPageOptimizer pnUUID)
|
||||
|
||||
if(USE_VLD)
|
||||
target_link_libraries(plPageOptimizer ${VLD_LIBRARY})
|
||||
endif()
|
||||
|
||||
source_group("Source Files" FILES ${plPageOptimizer_SOURCES})
|
||||
source_group("Header Files" FILES ${plPageOptimizer_HEADERS})
|
@ -40,40 +40,29 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plResMgr/plResManager.h"
|
||||
#include "pfPython/plPythonFileMod.h"
|
||||
#include "plGImage/plFontCache.h"
|
||||
#include "plPhysX/plSimulationMgr.h"
|
||||
#include "plAvatar/plAvatarMgr.h"
|
||||
|
||||
#include "plPageOptimizer.h"
|
||||
#include "plFile/plFileUtils.h"
|
||||
#include "pnNetCommon/plSynchedObject.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
printf("plPageOptimizer: wrong number of arguments");
|
||||
puts("plPageOptimizer: wrong number of arguments");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Optimizing %s...", plFileUtils::GetFileName(argv[1]));
|
||||
|
||||
plFontCache* fontCache;
|
||||
#ifndef _DEBUG
|
||||
try
|
||||
{
|
||||
try {
|
||||
#endif
|
||||
plResManager* resMgr = new plResManager;
|
||||
hsgResMgr::Init(resMgr);
|
||||
|
||||
// Setup all the crap that needs to be around to load
|
||||
plSimulationMgr::Init();
|
||||
fontCache = new plFontCache;
|
||||
plPythonFileMod::SetAtConvertTime();
|
||||
#ifndef _DEBUG
|
||||
} catch (...)
|
||||
{
|
||||
printf(" ***crashed on init");
|
||||
} catch (...) {
|
||||
puts(" ***crashed on init");
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
@ -86,22 +75,15 @@ int main(int argc, char* argv[])
|
||||
optimizer.Optimize();
|
||||
}
|
||||
#ifndef _DEBUG
|
||||
catch (...)
|
||||
{
|
||||
printf(" ***crashed on optimizing");
|
||||
catch (...) {
|
||||
puts(" ***crashed on optimizing");
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _DEBUG
|
||||
try
|
||||
{
|
||||
try {
|
||||
#endif
|
||||
// Deinit the crap
|
||||
fontCache->UnRegisterAs(kFontCache_KEY);
|
||||
fontCache = nil;
|
||||
plSimulationMgr::Shutdown();
|
||||
|
||||
// Reading in objects may have generated dirty state which we're obviously
|
||||
// not sending out. Clear it so that we don't have leaked keys before the
|
||||
// ResMgr goes away.
|
||||
@ -110,9 +92,8 @@ int main(int argc, char* argv[])
|
||||
|
||||
hsgResMgr::Shutdown();
|
||||
#ifndef _DEBUG
|
||||
} catch (...)
|
||||
{
|
||||
printf(" ***crashed on shutdown");
|
||||
} catch (...) {
|
||||
puts(" ***crashed on shutdown");
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
|
@ -39,16 +39,30 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "pfCharacter/pfCharacterCreatable.h"
|
||||
#include "pfCamera/pfCameraCreatable.h"
|
||||
#include "pfAnimation/pfAnimationCreatable.h"
|
||||
#include "pfConditional/plConditionalObjectCreatable.h"
|
||||
//#include "pfConsole/pfConsoleCreatable.h"
|
||||
#include "pfSurface/pfSurfaceCreatable.h"
|
||||
#include "pfMessage/pfMessageCreatable.h"
|
||||
#include "pfAudio/pfAudioCreatable.h"
|
||||
#include "pfPython/pfPythonCreatable.h"
|
||||
#include "pfGameGUIMgr/pfGameGUIMgrCreatable.h"
|
||||
#include "pfCCR/plCCRCreatable.h"
|
||||
#include "pfJournalBook/pfJournalBookCreatable.h"
|
||||
#include "pfGameMgr/pfGameMgrCreatables.h"
|
||||
#include "HeadSpin.h"
|
||||
|
||||
#include "pnFactory/plCreator.h"
|
||||
|
||||
#include "plAudible.h"
|
||||
REGISTER_NONCREATABLE( plAudible );
|
||||
|
||||
#include "plDrawable.h"
|
||||
REGISTER_NONCREATABLE( plDrawable );
|
||||
|
||||
#include "plPhysical.h"
|
||||
REGISTER_NONCREATABLE( plPhysical );
|
||||
|
||||
#include "plgDispatch.h"
|
||||
REGISTER_NONCREATABLE( plDispatchBase );
|
||||
|
||||
#include "pnDispatch/pnDispatchCreatable.h"
|
||||
#include "pnKeyedObject/pnKeyedObjectCreatable.h"
|
||||
#include "pnMessage/pnMessageCreatable.h"
|
||||
#include "pnModifier/pnModifierCreatable.h"
|
||||
#include "pnNetCommon/pnNetCommonCreatable.h"
|
||||
#include "pnTimer/pnTimerCreatable.h"
|
||||
|
||||
#include "plResMgr/plResMgrCreatable.h"
|
||||
|
||||
#include "plMessage/plResMgrHelperMsg.h"
|
||||
REGISTER_CREATABLE(plResMgrHelperMsg);
|
@ -140,24 +140,24 @@ void plPageOptimizer::Optimize()
|
||||
|
||||
if (!loaded)
|
||||
{
|
||||
printf("no scene node.\n");
|
||||
puts("no scene node.");
|
||||
}
|
||||
else if (fOptimized)
|
||||
{
|
||||
plFileUtils::RemoveFile(fTempPagePath);
|
||||
printf("already optimized.\n");
|
||||
puts("already optimized.");
|
||||
}
|
||||
else if (oldSize == newSize)
|
||||
{
|
||||
plFileUtils::RemoveFile(fPagePath, true);
|
||||
plFileUtils::FileMove(fTempPagePath, fPagePath);
|
||||
|
||||
printf("complete\n");
|
||||
puts("complete");
|
||||
}
|
||||
else
|
||||
{
|
||||
plFileUtils::RemoveFile(fTempPagePath);
|
||||
printf("failed. File sizes different\n");
|
||||
puts("failed. File sizes different");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user