#include "stdafx.h" #include "SceneManager.h" #include "RenderSystem.h" #include "SoundSystem.h" #include "ResourceManager.h" #include "OptionManager.h" #include "LightAgent.h" #include "WorldManager.h" #include "CameraManager.h" #include "GameResourceManager.h" #include "AreaGroup.h" #include "AreaSceneNode.h" #include "LightSceneNode.h" #include "SoundSceneNode.h" #include "StaticSceneNode.h" #include "Application.h" #include "ObjectManager.h" #include "Hero.h" static const char* gSceneFileCode = "IrisScene"; static unsigned int gNodeNum = 0; static unsigned int gLoadNodeNum = 0; static unsigned int gSoundNodeNum = 0; static unsigned int gLoadSoundNodeNum = 0; bool cSceneManager::LoadEnv6( cFileLoader& loader ) { /// Ä«¸Þ¶ó float camFarDist; loader.ReadFloat( &camFarDist ); CAMERAMAN->GetCurrent()->SetFarDistance( camFarDist ); /// ÇÏ´Ã char name[64]; loader.Read( name, 64 ); name[63] = 0; cString pathName; pathName.Format( "./data/map/%s", name ); WORLDMAN->LoadSkydome( pathName, 1.0f ); unsigned int skyEnabled = 0; loader.ReadUnsignedInt( &skyEnabled ); float skyHeight = 0.f; loader.ReadFloat( &skyHeight ); //WORLDMAN->SetSkyHeight( skyHeight ); /// ¹æÇⱤ NiColor ambient; NiColor diffuse; float dimmer; NiMatrix3 r; loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); NiDirectionalLight* light = LIGHTAGENT->GetSceneDirLight( 0 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); NiMeshUpdateProcess kUpdateProcess; light->Update( kUpdateProcess ); loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); light = LIGHTAGENT->GetSceneDirLight( 1 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); light->Update( kUpdateProcess ); return true; } bool cSceneManager::LoadGlobalArea6( cFileLoader& loader ) { /// Àüü ¿µ¿ªÀÇ ±âº» ¼Ó¼ºµéÀ» ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; loader.ReadUnsignedInt( &type ); loader.Read( path, 64 ); loader.Read( name, 64 ); loader.Read( &translate, sizeof(NiPoint3) ); loader.Read( &rotate, sizeof(NiMatrix3) ); loader.ReadFloat( &scale ); /// Àüü ¿µ¿ªÀÇ ¹ÝÁö¸§À» ·Îµù float radius; loader.ReadFloat( &radius ); /// Àüü ¿µ¿ªÀÇ ÁÖº¯±¤À» ·Îµù NiColor ambient; float dimmer; loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetSkyAmbient( ambient ); mGlobalArea->SetSkyDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetTerrainAmbient( ambient ); mGlobalArea->SetTerrainDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetStaticObjectAmbient( ambient ); mGlobalArea->SetStaticObjectDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetDynamicObjectAmbient( ambient ); mGlobalArea->SetDynamicObjectDimmer( dimmer ); /// Àüü ¿µ¿ªÀÇ ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; NiColor fogColor; float fogDepth; loader.ReadUnsignedInt( &i ); loader.Read( &fogColor, sizeof(NiColor) ); loader.ReadFloat( &fogDepth ); mGlobalArea->SetFogColor( fogColor ); mGlobalArea->SetFogDepth( fogDepth ); /// ¿µ¿ª ±×·ì À妽º¸¦ ·Îµù unsigned int groupIndex; loader.ReadUnsignedInt( &groupIndex ); return true; } bool cSceneManager::LoadEnv7( cFileLoader& loader ) { /// Ä«¸Þ¶ó float camFarDist; loader.ReadFloat( &camFarDist ); CAMERAMAN->GetCurrent()->SetFarDistance( camFarDist ); /// ÇÏ´Ã char name[64]; loader.Read( name, 64 ); name[63] = 0; cString pathName; pathName.Format( "./data/map/%s", name ); unsigned int skyEnabled = 0; loader.ReadUnsignedInt( &skyEnabled ); float skyScale = 0.f; loader.ReadFloat( &skyScale ); WORLDMAN->LoadSkydome( pathName, 0.4f );//skyScale ); /// ¹æÇⱤ NiColor ambient; NiColor diffuse; float dimmer; NiMatrix3 r; loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); NiMeshUpdateProcess kUpdateProcess; NiDirectionalLight* light = LIGHTAGENT->GetSceneDirLight( 0 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); light->Update( kUpdateProcess ); loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); light = LIGHTAGENT->GetSceneDirLight( 1 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); light->Update( kUpdateProcess ); return true; } bool cSceneManager::LoadGlobalArea7( cFileLoader& loader ) { /// Àüü ¿µ¿ªÀÇ ±âº» ¼Ó¼ºµéÀ» ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; loader.ReadUnsignedInt( &type ); loader.Read( path, 64 ); loader.Read( name, 64 ); loader.Read( &translate, sizeof(NiPoint3) ); loader.Read( &rotate, sizeof(NiMatrix3) ); loader.ReadFloat( &scale ); /// Àüü ¿µ¿ªÀÇ ¹ÝÁö¸§À» ·Îµù float radius; loader.ReadFloat( &radius ); /// Àüü ¿µ¿ªÀÇ ÁÖº¯±¤À» ·Îµù NiColor ambient; float dimmer; loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetSkyAmbient( ambient ); mGlobalArea->SetSkyDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetTerrainAmbient( ambient ); mGlobalArea->SetTerrainDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetStaticObjectAmbient( ambient ); mGlobalArea->SetStaticObjectDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetDynamicObjectAmbient( ambient ); mGlobalArea->SetDynamicObjectDimmer( dimmer ); /// Àüü ¿µ¿ªÀÇ ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; NiColor fogColor; float fogDepth; loader.ReadUnsignedInt( &i ); loader.Read( &fogColor, sizeof(NiColor) ); loader.ReadFloat( &fogDepth ); mGlobalArea->SetFogColor( fogColor ); mGlobalArea->SetFogDepth( fogDepth ); /// ¿µ¿ª ±×·ì À妽º¸¦ ·Îµù unsigned int groupIndex; loader.ReadUnsignedInt( &groupIndex ); return true; } bool cSceneManager::LoadEnv8( cFileLoader& loader ) { /// Ä«¸Þ¶ó float camFarDist; loader.ReadFloat( &camFarDist ); CAMERAMAN->GetCurrent()->SetFarDistance( camFarDist ); /// °¡½Ã ·¹º§ °Å¸® float dist0 = 0.0f, dist1 = 0.0f, dist2 = 0.0f; loader.ReadFloat( &dist0 ); loader.ReadFloat( &dist1 ); loader.ReadFloat( &dist2 ); SetLevelDistance( dist0, dist1, dist2 ); /// ÇÏ´Ã char name[64]; loader.Read( name, 64 ); name[63] = 0; cString pathName; pathName.Format( "./data/map/%s", name ); unsigned int skyEnabled = 0; loader.ReadUnsignedInt( &skyEnabled ); float skyScale = 0.f; loader.ReadFloat( &skyScale ); WORLDMAN->LoadSkydome( pathName, skyScale ); /// ¹æÇⱤ NiColor ambient; NiColor diffuse; float dimmer; NiMatrix3 r; loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); NiMeshUpdateProcess kUpdateProcess; NiDirectionalLight* light = LIGHTAGENT->GetSceneDirLight( 0 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); light->Update( kUpdateProcess ); loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); light = LIGHTAGENT->GetSceneDirLight( 1 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); light->Update( kUpdateProcess ); return true; } bool cSceneManager::LoadGlobalArea8( cFileLoader& loader ) { /// Àüü ¿µ¿ªÀÇ ±âº» ¼Ó¼ºµéÀ» ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; loader.ReadUnsignedInt( &type ); loader.Read( path, 64 ); loader.Read( name, 64 ); loader.Read( &translate, sizeof(NiPoint3) ); loader.Read( &rotate, sizeof(NiMatrix3) ); loader.ReadFloat( &scale ); /// Àüü ¿µ¿ªÀÇ ¹ÝÁö¸§À» ·Îµù float radius; loader.ReadFloat( &radius ); /// Àüü ¿µ¿ªÀÇ ÁÖº¯±¤À» ·Îµù NiColor ambient; float dimmer; loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetSkyAmbient( ambient ); mGlobalArea->SetSkyDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetTerrainAmbient( ambient ); mGlobalArea->SetTerrainDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetStaticObjectAmbient( ambient ); mGlobalArea->SetStaticObjectDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetDynamicObjectAmbient( ambient ); mGlobalArea->SetDynamicObjectDimmer( dimmer ); /// Àüü ¿µ¿ªÀÇ ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; NiColor fogColor; float fogDepth; loader.ReadUnsignedInt( &i ); loader.Read( &fogColor, sizeof(NiColor) ); loader.ReadFloat( &fogDepth ); mGlobalArea->SetFogColor( fogColor ); mGlobalArea->SetFogDepth( fogDepth ); /// ¿µ¿ª ±×·ì À妽º¸¦ ·Îµù unsigned int groupIndex; loader.ReadUnsignedInt( &groupIndex ); return true; } bool cSceneManager::LoadEnv9( cFileLoader& loader ) { /// Ä«¸Þ¶ó float camFarDist; loader.ReadFloat( &camFarDist ); CAMERAMAN->GetCurrent()->SetFarDistance( camFarDist ); /// °¡½Ã ·¹º§ °Å¸® float dist0 = 0.0f, dist1 = 0.0f, dist2 = 0.0f; loader.ReadFloat( &dist0 ); loader.ReadFloat( &dist1 ); loader.ReadFloat( &dist2 ); SetLevelDistance( dist0, dist1, dist2 ); /// ÇÏ´Ã char name[64]; loader.Read( name, 64 ); name[63] = 0; cString pathName; pathName.Format( "./data/map/%s", name ); unsigned int skyEnabled = 0; loader.ReadUnsignedInt( &skyEnabled ); float skyScale = 0.f; loader.ReadFloat( &skyScale ); WORLDMAN->LoadSkydome( pathName, skyScale ); /// ¹æÇⱤ NiColor ambient; NiColor diffuse; float dimmer; NiMatrix3 r; loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); NiMeshUpdateProcess kUpdateProcess; NiDirectionalLight* light = LIGHTAGENT->GetSceneDirLight( 0 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); light->Update( kUpdateProcess ); loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); light = LIGHTAGENT->GetSceneDirLight( 1 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); light->Update( kUpdateProcess ); return true; } bool cSceneManager::LoadGlobalArea9( cFileLoader& loader ) { /// Àüü ¿µ¿ªÀÇ ±âº» ¼Ó¼ºµéÀ» ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; loader.ReadUnsignedInt( &type ); loader.Read( path, 64 ); loader.Read( name, 64 ); loader.Read( &translate, sizeof(NiPoint3) ); loader.Read( &rotate, sizeof(NiMatrix3) ); loader.ReadFloat( &scale ); /// Àüü ¿µ¿ªÀÇ ¹ÝÁö¸§À» ·Îµù float radius; loader.ReadFloat( &radius ); /// Àüü ¿µ¿ªÀÇ ÁÖº¯±¤À» ·Îµù NiColor ambient; float dimmer; loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetSkyAmbient( ambient ); mGlobalArea->SetSkyDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetTerrainAmbient( ambient ); mGlobalArea->SetTerrainDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetStaticObjectAmbient( ambient ); mGlobalArea->SetStaticObjectDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetDynamicObjectAmbient( ambient ); mGlobalArea->SetDynamicObjectDimmer( dimmer ); /// Àüü ¿µ¿ªÀÇ ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; NiColor fogColor; float fogDepth; loader.ReadUnsignedInt( &i ); loader.Read( &fogColor, sizeof(NiColor) ); loader.ReadFloat( &fogDepth ); mGlobalArea->SetFogColor( fogColor ); mGlobalArea->SetFogDepth( fogDepth ); /// ¿µ¿ª ±×·ì À妽º¸¦ ·Îµù unsigned int groupIndex; loader.ReadUnsignedInt( &groupIndex ); return true; } bool cSceneManager::LoadEnv10( cFileLoader& loader ) { /// Ä«¸Þ¶ó float camFarDist; loader.ReadFloat( &camFarDist ); CAMERAMAN->GetCurrent()->SetFarDistance( camFarDist ); /// °¡½Ã ·¹º§ °Å¸® float dist0 = 0.0f, dist1 = 0.0f, dist2 = 0.0f; loader.ReadFloat( &dist0 ); loader.ReadFloat( &dist1 ); loader.ReadFloat( &dist2 ); SetLevelDistance( dist0, dist1, dist2 ); /// ÇÏ´Ã char name[64]; loader.Read( name, 64 ); name[63] = 0; cString pathName; pathName.Format( "./data/map/%s", name ); unsigned int skyEnabled = 0; loader.ReadUnsignedInt( &skyEnabled ); float skyScale = 0.f; loader.ReadFloat( &skyScale ); WORLDMAN->LoadSkydome( pathName, skyScale ); /// ¹æÇⱤ NiColor ambient; NiColor diffuse; float dimmer; NiMatrix3 r; loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); NiMeshUpdateProcess kUpdateProcess; NiDirectionalLight* light = LIGHTAGENT->GetSceneDirLight( 0 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); light->Update( kUpdateProcess ); loader.Read( &ambient, sizeof(NiColor) ); loader.Read( &diffuse, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); loader.Read( &r, sizeof(NiMatrix3) ); light = LIGHTAGENT->GetSceneDirLight( 1 ); light->SetAmbientColor( ambient ); light->SetDiffuseColor( diffuse ); light->SetDimmer( dimmer ); light->SetRotate( r ); light->Update( kUpdateProcess ); return true; } bool cSceneManager::LoadGlobalArea10( cFileLoader& loader ) { /// Àüü ¿µ¿ªÀÇ ±âº» ¼Ó¼ºµéÀ» ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; loader.ReadUnsignedInt( &type ); loader.Read( path, 64 ); loader.Read( name, 64 ); loader.Read( &translate, sizeof(NiPoint3) ); loader.Read( &rotate, sizeof(NiMatrix3) ); loader.ReadFloat( &scale ); /// Àüü ¿µ¿ªÀÇ ¹ÝÁö¸§À» ·Îµù float radius; loader.ReadFloat( &radius ); /// Àüü ¿µ¿ªÀÇ ÁÖº¯±¤À» ·Îµù NiColor ambient; float dimmer; loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetSkyAmbient( ambient ); mGlobalArea->SetSkyDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetTerrainAmbient( ambient ); mGlobalArea->SetTerrainDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetStaticObjectAmbient( ambient ); mGlobalArea->SetStaticObjectDimmer( dimmer ); loader.Read( &ambient, sizeof(NiColor) ); loader.ReadFloat( &dimmer ); mGlobalArea->SetDynamicObjectAmbient( ambient ); mGlobalArea->SetDynamicObjectDimmer( dimmer ); /// Àüü ¿µ¿ªÀÇ ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; NiColor fogColor; float fogDepth; loader.ReadUnsignedInt( &i ); loader.Read( &fogColor, sizeof(NiColor) ); loader.ReadFloat( &fogDepth ); mGlobalArea->SetFogColor( fogColor ); mGlobalArea->SetFogDepth( fogDepth ); /// ¿µ¿ª ±×·ì À妽º¸¦ ·Îµù unsigned int groupIndex; loader.ReadUnsignedInt( &groupIndex ); return true; } bool cSceneManager::LoadSceneHeader( cFileLoader& loader, unsigned int& outNum ) { /// ÆÄÀÏ Çì´õ ·Îµù cSceneFileHeader header; if( loader.Read( &header, sizeof(cSceneFileHeader) ) != sizeof(cSceneFileHeader) ) { assert( 0 && "failed to load scene file header" ); return false; } /// Çì´õ °Ë»ç if( memcmp( header.mCode, gSceneFileCode, 10 ) != 0 ) { assert( 0 && "invalid file type" ); return false; } /// Àå¸é Æ®¸®¸¦ ÃʱâÈ­ Init( header.mCenter, header.mMinRadius, header.mMaxRadius ); /// Àüü ¿µ¿ª Á¤º¸¸¦ ·Îµù /// ¹öÀüº° ·Îµù mVersion = header.mVersion; switch( mVersion ) { case 6: if( LoadEnv6( loader ) == false ) { assert( 0 ); return false; } if( LoadGlobalArea6( loader ) == false ) { assert( 0 ); return false; } break; case 7: if( LoadEnv7( loader ) == false ) { assert( 0 ); return false; } if( LoadGlobalArea7( loader ) == false ) { assert( 0 ); return false; } break; case 8: if( LoadEnv8( loader ) == false ) { assert( 0 ); return false; } if( LoadGlobalArea8( loader ) == false ) { assert( 0 ); return false; } break; case 9: if( LoadEnv9( loader ) == false ) { assert( 0 ); return false; } if( LoadGlobalArea9( loader ) == false ) { assert( 0 ); return false; } break; case 10: case 11: if( LoadEnv10( loader ) == false ) { assert( 0 ); return false; } if( LoadGlobalArea10( loader ) == false ) { assert( 0 ); return false; } break; default: assert( 0 && "invalid file version" ); return false; } gNodeNum = header.mNumSceneNodes; outNum = gNodeNum; gLoadNodeNum = 0; return true; } bool cSceneManager::LoadSoundSceneHeader( cFileLoader& loader, unsigned int& outNum ) { /// ÆÄÀÏ Çì´õ ·Îµù cSoundSceneFileHeader header; if( loader.Read( &header, sizeof(cSoundSceneFileHeader) ) != sizeof(cSoundSceneFileHeader) ) { assert( 0 && "failed to load sound scene file header" ); return false; } /// Çì´õ °Ë»ç if( memcmp( header.mCode, gSceneFileCode, 10 ) != 0 ) { assert( 0 && "invalid file type" ); return false; } /// Àüü ¿µ¿ª Á¤º¸¸¦ ·Îµù /// ¹öÀüº° ·Îµù mVersion = header.mVersion; switch( mVersion ) { case 11: break; default: assert( 0 && "invalid file version" ); return false; } gSoundNodeNum = header.mNumSceneNodes; outNum = gSoundNodeNum; gLoadSoundNodeNum = 0; return true; } int cSceneManager::LoadSceneNode( cFileLoader& loader, unsigned int loadCount ) { switch( mVersion ) { case 6: return LoadSceneNode6( loader, loadCount ); case 7: return LoadSceneNode7( loader, loadCount ); case 8: return LoadSceneNode8( loader, loadCount ); case 9: return LoadSceneNode9( loader, loadCount ); case 10: return LoadSceneNode10( loader, loadCount ); case 11: return LoadSceneNode11( loader, loadCount ); default: assert( 0 && "invalid file version" ); } return -1; } int cSceneManager::LoadSoundSceneNode( cFileLoader& loader, unsigned int loadCount ) { switch( mVersion ) { case 11: return LoadSoundNode11( loader, loadCount ); default: assert( 0 && "invalid file version" ); } return -1; } int cSceneManager::LoadSceneNode6( cFileLoader& loader, unsigned int loadCount ) { /// Àå¸é ³ëµåµéÀ» »ý¼º ¹× ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; for( unsigned int i = 0, iend = loadCount; i < iend; ++i ) { /// ŸÀÔÀ» ·Îµù loader.ReadUnsignedInt( &type ); /// °æ·Î¸¦ ·Îµù loader.Read( path, 64 ); path[63] = 0; /// À̸§À» ·Îµù loader.Read( name, 64 ); name[63] = 0; /// À§Ä¡¸¦ ·Îµù loader.Read( &translate, sizeof(NiPoint3) ); /// ȸÀüÀ» ·Îµù loader.Read( &rotate, sizeof(NiMatrix3) ); /// ¹èÀ²À» ·Îµù loader.ReadFloat( &scale ); /// ³ëµå ŸÀÔ¿¡ µû¸¥ ·Îµù ¹× »ý¼º switch( type ) { case cSceneNode::eAREA_VER8: { cAreaSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯±¤À» ·Îµù loader.Read( &(param.mSkyAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mSkyDimmer) ); loader.Read( &(param.mTerrainAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mTerrainDimmer) ); loader.Read( &(param.mStaticObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mStaticObjectDimmer) ); loader.Read( &(param.mDynamicObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mDynamicObjectDimmer) ); /// ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; loader.ReadUnsignedInt( &i ); loader.Read( &(param.mFogColor), sizeof(NiColor) ); loader.ReadFloat( &(param.mFogDepth) ); /// ±×·ì À妽º¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mGroupIndex) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cAreaSceneNode* n = CreateArea( param ); assert( n && "failed to create area scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eLIGHT_VER8: { cLightSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯»öÀ» ·Îµù loader.Read( &(param.mAmbient), sizeof(NiColor) ); /// »ê¶õ»öÀ» ·Îµù loader.Read( &(param.mDiffuse0), sizeof(NiColor) ); loader.Read( &(param.mDiffuse1), sizeof(NiColor) ); loader.ReadFloat( &(param.mDiffuseAnimTime) ); unsigned int i; loader.ReadUnsignedInt( &i ); param.mFlickering = i != 0; /// ¹Ý»ç»öÀ» ·Îµù loader.Read( &(param.mSpecular), sizeof(NiColor) ); /// °¨¼è °è¼öµéÀ» ·Îµù loader.ReadFloat( &(param.mConstantAtten0) ); loader.ReadFloat( &(param.mConstantAtten1) ); loader.ReadFloat( &(param.mConstantAttenAnimTime) ); loader.ReadFloat( &(param.mLinearAtten) ); loader.ReadFloat( &(param.mQuadricAtten) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º // cLightSceneNode* n = CreateLight( param ); // assert( n && "failed to create light scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSOUND_VER8: { cSoundSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// °¨¼è °Å¸®¸¦ ·Îµù loader.ReadFloat( &(param.mAttenDistance) ); /// ¹Ýº¹ Ƚ¼ö¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mLoopCount) ); /// Àç»ý °£°ÝÀ» ·Îµù loader.ReadFloat( &(param.mLoopInterval) ); /// À½·® ºñÀ²À» ·Îµù loader.ReadFloat( &(param.mVolumeRatio) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./data/map/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; param.mVolumeRatio *= OPTIONMAN->GetEnvVolume(); /// ³ëµå¸¦ »ý¼º cSoundSceneNode* n = CreateEnvSound( param ); assert( n && "failed to create sound scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSTATIC_VER8: { cStaticSceneNodeParam param; param.mMaterialApplied = true; /// ÀçÁú ¼Ó¼ºÀ» ·Îµù loader.Read( ¶m.mMaterial, sizeof(cMaterialData) ); /// °¡½Ã ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mVisibleLevel) ); /// Â÷Æó ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mOccludeLevel) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./data/map/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cStaticSceneNode* n = CreateStatic( param ); assert( n && "failed to create static scene node" ); //if( n == 0 ) // return -1; } break; default: assert( 0 && "invalid scene node type" ); return -1; } gLoadNodeNum++; if( gNodeNum == gLoadNodeNum ) return 0; } return 1; } int cSceneManager::LoadSceneNode7( cFileLoader& loader, unsigned int loadCount ) { /// Àå¸é ³ëµåµéÀ» »ý¼º ¹× ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; for( unsigned int i = 0, iend = loadCount; i < iend; ++i ) { /// ŸÀÔÀ» ·Îµù loader.ReadUnsignedInt( &type ); /// °æ·Î¸¦ ·Îµù loader.Read( path, 64 ); path[63] = 0; /// À̸§À» ·Îµù loader.Read( name, 64 ); name[63] = 0; /// À§Ä¡¸¦ ·Îµù loader.Read( &translate, sizeof(NiPoint3) ); /// ȸÀüÀ» ·Îµù loader.Read( &rotate, sizeof(NiMatrix3) ); /// ¹èÀ²À» ·Îµù loader.ReadFloat( &scale ); /// ³ëµå ŸÀÔ¿¡ µû¸¥ ·Îµù ¹× »ý¼º switch( type ) { case cSceneNode::eAREA_VER8: { cAreaSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯±¤À» ·Îµù loader.Read( &(param.mSkyAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mSkyDimmer) ); loader.Read( &(param.mTerrainAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mTerrainDimmer) ); loader.Read( &(param.mStaticObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mStaticObjectDimmer) ); loader.Read( &(param.mDynamicObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mDynamicObjectDimmer) ); /// ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; loader.ReadUnsignedInt( &i ); loader.Read( &(param.mFogColor), sizeof(NiColor) ); loader.ReadFloat( &(param.mFogDepth) ); /// ±×·ì À妽º¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mGroupIndex) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cAreaSceneNode* n = CreateArea( param ); assert( n && "failed to create area scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eLIGHT_VER8: { cLightSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯»öÀ» ·Îµù loader.Read( &(param.mAmbient), sizeof(NiColor) ); /// »ê¶õ»öÀ» ·Îµù loader.Read( &(param.mDiffuse0), sizeof(NiColor) ); loader.Read( &(param.mDiffuse1), sizeof(NiColor) ); loader.ReadFloat( &(param.mDiffuseAnimTime) ); unsigned int i; loader.ReadUnsignedInt( &i ); param.mFlickering = i != 0; /// ¹Ý»ç»öÀ» ·Îµù loader.Read( &(param.mSpecular), sizeof(NiColor) ); /// °¨¼è °è¼öµéÀ» ·Îµù loader.ReadFloat( &(param.mConstantAtten0) ); loader.ReadFloat( &(param.mConstantAtten1) ); loader.ReadFloat( &(param.mConstantAttenAnimTime) ); loader.ReadFloat( &(param.mLinearAtten) ); loader.ReadFloat( &(param.mQuadricAtten) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º // cLightSceneNode* n = CreateLight( param ); // assert( n && "failed to create light scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSOUND_VER8: { cSoundSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// °¨¼è °Å¸®¸¦ ·Îµù loader.ReadFloat( &(param.mAttenDistance) ); /// ¹Ýº¹ Ƚ¼ö¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mLoopCount) ); /// Àç»ý °£°ÝÀ» ·Îµù loader.ReadFloat( &(param.mLoopInterval) ); /// À½·® ºñÀ²À» ·Îµù loader.ReadFloat( &(param.mVolumeRatio) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./Sound/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; param.mVolumeRatio *= OPTIONMAN->GetEnvVolume(); /// ³ëµå¸¦ »ý¼º cSoundSceneNode* n = CreateEnvSound( param ); assert( n && "failed to create sound scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSTATIC_VER8: { cStaticSceneNodeParam param; param.mMaterialApplied = true; /// ÀçÁú ¼Ó¼ºÀ» ·Îµù loader.Read( ¶m.mMaterial, sizeof(cMaterialData) ); /// °¡½Ã ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mVisibleLevel) ); /// Â÷Æó ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mOccludeLevel) ); /// ¾È°³ Àû¿ë ¿©ºÎ¸¦ ·Îµù unsigned int i = 0; loader.ReadUnsignedInt( &i ); param.mFogApplied = (i != 0); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./data/map/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cStaticSceneNode* n = CreateStatic( param ); assert( n && "failed to create static scene node" ); //if( n == 0 ) // return -1; } break; default: assert( 0 && "invalid scene node type" ); return -1; } gLoadNodeNum++; if( gNodeNum == gLoadNodeNum ) return 0; } return 1; } int cSceneManager::LoadSceneNode8( cFileLoader& loader, unsigned int loadCount ) { /// Àå¸é ³ëµåµéÀ» »ý¼º ¹× ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; for( unsigned int i = 0, iend = loadCount; i < iend; ++i ) { /// ŸÀÔÀ» ·Îµù loader.ReadUnsignedInt( &type ); /// °æ·Î¸¦ ·Îµù loader.Read( path, 64 ); path[63] = 0; /// À̸§À» ·Îµù loader.Read( name, 64 ); name[63] = 0; /// À§Ä¡¸¦ ·Îµù loader.Read( &translate, sizeof(NiPoint3) ); /// ȸÀüÀ» ·Îµù loader.Read( &rotate, sizeof(NiMatrix3) ); /// ¹èÀ²À» ·Îµù loader.ReadFloat( &scale ); /// ³ëµå ŸÀÔ¿¡ µû¸¥ ·Îµù ¹× »ý¼º switch( type ) { case cSceneNode::eAREA_VER8: { cAreaSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯±¤À» ·Îµù loader.Read( &(param.mSkyAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mSkyDimmer) ); loader.Read( &(param.mTerrainAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mTerrainDimmer) ); loader.Read( &(param.mStaticObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mStaticObjectDimmer) ); loader.Read( &(param.mDynamicObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mDynamicObjectDimmer) ); /// ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; loader.ReadUnsignedInt( &i ); loader.Read( &(param.mFogColor), sizeof(NiColor) ); loader.ReadFloat( &(param.mFogDepth) ); /// ±×·ì À妽º¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mGroupIndex) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cAreaSceneNode* n = CreateArea( param ); assert( n && "failed to create area scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eLIGHT_VER8: { cLightSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯»öÀ» ·Îµù loader.Read( &(param.mAmbient), sizeof(NiColor) ); /// »ê¶õ»öÀ» ·Îµù loader.Read( &(param.mDiffuse0), sizeof(NiColor) ); loader.Read( &(param.mDiffuse1), sizeof(NiColor) ); loader.ReadFloat( &(param.mDiffuseAnimTime) ); unsigned int i; loader.ReadUnsignedInt( &i ); param.mFlickering = i != 0; /// ¹Ý»ç»öÀ» ·Îµù loader.Read( &(param.mSpecular), sizeof(NiColor) ); /// °¨¼è °è¼öµéÀ» ·Îµù loader.ReadFloat( &(param.mConstantAtten0) ); loader.ReadFloat( &(param.mConstantAtten1) ); loader.ReadFloat( &(param.mConstantAttenAnimTime) ); loader.ReadFloat( &(param.mLinearAtten) ); loader.ReadFloat( &(param.mQuadricAtten) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º // cLightSceneNode* n = CreateLight( param ); // assert( n && "failed to create light scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSOUND_VER8: { cSoundSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// °¨¼è °Å¸®¸¦ ·Îµù loader.ReadFloat( &(param.mAttenDistance) ); /// ¹Ýº¹ Ƚ¼ö¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mLoopCount) ); /// Àç»ý °£°ÝÀ» ·Îµù loader.ReadFloat( &(param.mLoopInterval) ); /// À½·® ºñÀ²À» ·Îµù loader.ReadFloat( &(param.mVolumeRatio) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./Sound/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; param.mVolumeRatio *= OPTIONMAN->GetEnvVolume(); /// ³ëµå¸¦ »ý¼º cSoundSceneNode* n = CreateEnvSound( param ); assert( n && "failed to create sound scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSTATIC_VER8: { cStaticSceneNodeParam param; param.mMaterialApplied = true; /// ÀçÁú ¼Ó¼ºÀ» ·Îµù loader.Read( ¶m.mMaterial, sizeof(cMaterialData) ); /// °¡½Ã ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mVisibleLevel) ); /// Â÷Æó ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mOccludeLevel) ); /// ¾È°³ Àû¿ë ¿©ºÎ¸¦ ·Îµù unsigned int i = 0; loader.ReadUnsignedInt( &i ); param.mFogApplied = (i != 0); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./data/map/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cStaticSceneNode* n = CreateStatic( param ); assert( n && "failed to create static scene node" ); //if( n == 0 ) // return -1; } break; default: assert( 0 && "invalid scene node type" ); return -1; } gLoadNodeNum++; if( gNodeNum == gLoadNodeNum ) return 0; } return 1; } int cSceneManager::LoadSceneNode9( cFileLoader& loader, unsigned int loadCount ) { /// Àå¸é ³ëµåµéÀ» »ý¼º ¹× ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; for( unsigned int i = 0, iend = loadCount; i < iend; ++i ) { /// ŸÀÔÀ» ·Îµù loader.ReadUnsignedInt( &type ); /// °æ·Î¸¦ ·Îµù loader.Read( path, 64 ); path[63] = 0; /// À̸§À» ·Îµù loader.Read( name, 64 ); name[63] = 0; /// À§Ä¡¸¦ ·Îµù loader.Read( &translate, sizeof(NiPoint3) ); /// ȸÀüÀ» ·Îµù loader.Read( &rotate, sizeof(NiMatrix3) ); /// ¹èÀ²À» ·Îµù loader.ReadFloat( &scale ); /// ³ëµå ŸÀÔ¿¡ µû¸¥ ·Îµù ¹× »ý¼º switch( type ) { case cSceneNode::eAREA: { cAreaSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯±¤À» ·Îµù loader.Read( &(param.mSkyAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mSkyDimmer) ); loader.Read( &(param.mTerrainAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mTerrainDimmer) ); loader.Read( &(param.mStaticObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mStaticObjectDimmer) ); loader.Read( &(param.mDynamicObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mDynamicObjectDimmer) ); /// ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; loader.ReadUnsignedInt( &i ); loader.Read( &(param.mFogColor), sizeof(NiColor) ); loader.ReadFloat( &(param.mFogDepth) ); /// ±×·ì À妽º¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mGroupIndex) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cAreaSceneNode* n = CreateArea( param ); assert( n && "failed to create area scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eLIGHT: { cLightSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯»öÀ» ·Îµù loader.Read( &(param.mAmbient), sizeof(NiColor) ); /// »ê¶õ»öÀ» ·Îµù loader.Read( &(param.mDiffuse0), sizeof(NiColor) ); loader.Read( &(param.mDiffuse1), sizeof(NiColor) ); loader.ReadFloat( &(param.mDiffuseAnimTime) ); unsigned int i; loader.ReadUnsignedInt( &i ); param.mFlickering = i != 0; /// ¹Ý»ç»öÀ» ·Îµù loader.Read( &(param.mSpecular), sizeof(NiColor) ); /// °¨¼è °è¼öµéÀ» ·Îµù loader.ReadFloat( &(param.mConstantAtten0) ); loader.ReadFloat( &(param.mConstantAtten1) ); loader.ReadFloat( &(param.mConstantAttenAnimTime) ); loader.ReadFloat( &(param.mLinearAtten) ); loader.ReadFloat( &(param.mQuadricAtten) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º // cLightSceneNode* n = CreateLight( param ); // assert( n && "failed to create light scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSOUND: { cSoundSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// °¨¼è °Å¸®¸¦ ·Îµù loader.ReadFloat( &(param.mAttenDistance) ); /// ¹Ýº¹ Ƚ¼ö¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mLoopCount) ); /// Àç»ý °£°ÝÀ» ·Îµù loader.ReadFloat( &(param.mLoopInterval) ); /// À½·® ºñÀ²À» ·Îµù loader.ReadFloat( &(param.mVolumeRatio) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./Sound/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; param.mVolumeRatio *= OPTIONMAN->GetEnvVolume(); /// ³ëµå¸¦ »ý¼º cSoundSceneNode* n = CreateEnvSound( param ); assert( n && "failed to create sound scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSTATIC: { cStaticSceneNodeParam param; param.mMaterialApplied = true; /// ÀçÁú ¼Ó¼ºÀ» ·Îµù loader.Read( ¶m.mMaterial, sizeof(cMaterialData) ); /// °¡½Ã ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mVisibleLevel) ); /// Â÷Æó ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mOccludeLevel) ); /// ¾È°³ Àû¿ë ¿©ºÎ¸¦ ·Îµù unsigned int i = 0; loader.ReadUnsignedInt( &i ); param.mFogApplied = (i != 0); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./data/map/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cStaticSceneNode* n = CreateStatic( param ); assert( n && "failed to create static scene node" ); //if( n == 0 ) // return -1; } break; default: assert( 0 && "invalid scene node type" ); return -1; } gLoadNodeNum++; if( gNodeNum == gLoadNodeNum ) return 0; } return 1; } int cSceneManager::LoadSceneNode10( cFileLoader& loader, unsigned int loadCount ) { /// Àå¸é ³ëµåµéÀ» »ý¼º ¹× ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; for( unsigned int i = 0, iend = loadCount; i < iend; ++i ) { /// ŸÀÔÀ» ·Îµù loader.ReadUnsignedInt( &type ); /// °æ·Î¸¦ ·Îµù loader.Read( path, 64 ); path[63] = 0; /// À̸§À» ·Îµù loader.Read( name, 64 ); name[63] = 0; /// À§Ä¡¸¦ ·Îµù loader.Read( &translate, sizeof(NiPoint3) ); /// ȸÀüÀ» ·Îµù loader.Read( &rotate, sizeof(NiMatrix3) ); /// ¹èÀ²À» ·Îµù loader.ReadFloat( &scale ); /// ³ëµå ŸÀÔ¿¡ µû¸¥ ·Îµù ¹× »ý¼º switch( type ) { case cSceneNode::eAREA: { cAreaSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯±¤À» ·Îµù loader.Read( &(param.mSkyAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mSkyDimmer) ); loader.Read( &(param.mTerrainAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mTerrainDimmer) ); loader.Read( &(param.mStaticObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mStaticObjectDimmer) ); loader.Read( &(param.mDynamicObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mDynamicObjectDimmer) ); /// ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; loader.ReadUnsignedInt( &i ); loader.Read( &(param.mFogColor), sizeof(NiColor) ); loader.ReadFloat( &(param.mFogDepth) ); /// ±×·ì À妽º¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mGroupIndex) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cAreaSceneNode* n = CreateArea( param ); assert( n && "failed to create area scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eLIGHT: { cLightSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯»öÀ» ·Îµù loader.Read( &(param.mAmbient), sizeof(NiColor) ); /// »ê¶õ»öÀ» ·Îµù loader.Read( &(param.mDiffuse0), sizeof(NiColor) ); loader.Read( &(param.mDiffuse1), sizeof(NiColor) ); loader.ReadFloat( &(param.mDiffuseAnimTime) ); unsigned int i; loader.ReadUnsignedInt( &i ); param.mFlickering = i != 0; /// ¹Ý»ç»öÀ» ·Îµù loader.Read( &(param.mSpecular), sizeof(NiColor) ); /// °¨¼è °è¼öµéÀ» ·Îµù loader.ReadFloat( &(param.mConstantAtten0) ); loader.ReadFloat( &(param.mConstantAtten1) ); loader.ReadFloat( &(param.mConstantAttenAnimTime) ); loader.ReadFloat( &(param.mLinearAtten) ); loader.ReadFloat( &(param.mQuadricAtten) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º // cLightSceneNode* n = CreateLight( param ); // assert( n && "failed to create light scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSOUND: { cSoundSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// °¨¼è °Å¸®¸¦ ·Îµù loader.ReadFloat( &(param.mAttenDistance) ); /// ¹Ýº¹ Ƚ¼ö¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mLoopCount) ); /// Àç»ý °£°ÝÀ» ·Îµù loader.ReadFloat( &(param.mLoopInterval) ); /// À½·® ºñÀ²À» ·Îµù loader.ReadFloat( &(param.mVolumeRatio) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./Sound/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; param.mVolumeRatio *= OPTIONMAN->GetEnvVolume(); /// ³ëµå¸¦ »ý¼º cSoundSceneNode* n = CreateEnvSound( param ); assert( n && "failed to create sound scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSTATIC: { cStaticSceneNodeParam param; /// ¾È°³ Àû¿ë ¿©ºÎ¸¦ ·Îµù unsigned int i = 0; loader.ReadUnsignedInt( &i ); param.mFogApplied = (i != 0); /// ÀçÁú Àû¿ë ¿©ºÎ¸¦ ·Îµù i = 0; loader.ReadUnsignedInt( &i ); param.mMaterialApplied = (i != 0); /// ÀçÁú ¼Ó¼ºÀ» ·Îµù loader.Read( ¶m.mMaterial, sizeof(cMaterialData) ); /// °¡½Ã ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mVisibleLevel) ); /// Â÷Æó ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mOccludeLevel) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./data/map/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cStaticSceneNode* n = CreateStatic( param ); assert( n && "failed to create static scene node" ); //if( n == 0 ) // return -1; } break; default: assert( 0 && "invalid scene node type" ); return -1; } gLoadNodeNum++; if( gNodeNum == gLoadNodeNum ) return 0; } return 1; } int cSceneManager::LoadSceneNode11( cFileLoader& loader, unsigned int loadCount ) { /// Àå¸é ³ëµåµéÀ» »ý¼º ¹× ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; unsigned int i = 0; for( ; i < loadCount; ++i ) { /// ŸÀÔÀ» ·Îµù loader.ReadUnsignedInt( &type ); /// °æ·Î¸¦ ·Îµù loader.Read( path, 64 ); path[63] = 0; /// À̸§À» ·Îµù loader.Read( name, 64 ); name[63] = 0; /// À§Ä¡¸¦ ·Îµù loader.Read( &translate, sizeof(NiPoint3) ); /// ȸÀüÀ» ·Îµù loader.Read( &rotate, sizeof(NiMatrix3) ); /// ¹èÀ²À» ·Îµù loader.ReadFloat( &scale ); /// ³ëµå ŸÀÔ¿¡ µû¸¥ ·Îµù ¹× »ý¼º switch( type ) { case cSceneNode::eAREA: { cAreaSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯±¤À» ·Îµù loader.Read( &(param.mSkyAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mSkyDimmer) ); loader.Read( &(param.mTerrainAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mTerrainDimmer) ); loader.Read( &(param.mStaticObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mStaticObjectDimmer) ); loader.Read( &(param.mDynamicObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mDynamicObjectDimmer) ); /// ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; loader.ReadUnsignedInt( &i ); loader.Read( &(param.mFogColor), sizeof(NiColor) ); loader.ReadFloat( &(param.mFogDepth) ); /// ±×·ì À妽º¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mGroupIndex) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cAreaSceneNode* n = CreateArea( param ); assert( n && "failed to create area scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eLIGHT: { cLightSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯»öÀ» ·Îµù loader.Read( &(param.mAmbient), sizeof(NiColor) ); /// »ê¶õ»öÀ» ·Îµù loader.Read( &(param.mDiffuse0), sizeof(NiColor) ); loader.Read( &(param.mDiffuse1), sizeof(NiColor) ); loader.ReadFloat( &(param.mDiffuseAnimTime) ); unsigned int i; loader.ReadUnsignedInt( &i ); param.mFlickering = i != 0; /// ¹Ý»ç»öÀ» ·Îµù loader.Read( &(param.mSpecular), sizeof(NiColor) ); /// °¨¼è °è¼öµéÀ» ·Îµù loader.ReadFloat( &(param.mConstantAtten0) ); loader.ReadFloat( &(param.mConstantAtten1) ); loader.ReadFloat( &(param.mConstantAttenAnimTime) ); loader.ReadFloat( &(param.mLinearAtten) ); loader.ReadFloat( &(param.mQuadricAtten) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º // cLightSceneNode* n = CreateLight( param ); // assert( n && "failed to create light scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSTATIC: { cStaticSceneNodeParam param; /// ¾È°³ Àû¿ë ¿©ºÎ¸¦ ·Îµù unsigned int i = 0; loader.ReadUnsignedInt( &i ); param.mFogApplied = (i != 0); /// ÀçÁú Àû¿ë ¿©ºÎ¸¦ ·Îµù i = 0; loader.ReadUnsignedInt( &i ); param.mMaterialApplied = (i != 0); /// ÀçÁú ¼Ó¼ºÀ» ·Îµù loader.Read( ¶m.mMaterial, sizeof(cMaterialData) ); /// °¡½Ã ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mVisibleLevel) ); /// Â÷Æó ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mOccludeLevel) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./data/map/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cStaticSceneNode* n = CreateStatic( param ); assert( n && "failed to create static scene node" ); //if( n == 0 ) // return -1; } break; default: assert( 0 && "invalid scene node type" ); return -1; } gLoadNodeNum++; if( gNodeNum <= gLoadNodeNum ) return -2; } return i; } int cSceneManager::LoadSceneNode12( cFileLoader& loader, unsigned int loadCount ) { /// Àå¸é ³ëµåµéÀ» »ý¼º ¹× ·Îµù unsigned int type; char path[64]; char name[64]; char lightMapName[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; unsigned int i = 0; for( ; i < loadCount; ++i ) { /// ŸÀÔÀ» ·Îµù loader.ReadUnsignedInt( &type ); /// °æ·Î¸¦ ·Îµù loader.Read( path, 64 ); path[63] = 0; /// À̸§À» ·Îµù loader.Read( name, 64 ); name[63] = 0; /// À§Ä¡¸¦ ·Îµù loader.Read( &translate, sizeof(NiPoint3) ); /// ȸÀüÀ» ·Îµù loader.Read( &rotate, sizeof(NiMatrix3) ); /// ¹èÀ²À» ·Îµù loader.ReadFloat( &scale ); /// ³ëµå ŸÀÔ¿¡ µû¸¥ ·Îµù ¹× »ý¼º switch( type ) { case cSceneNode::eAREA: { cAreaSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯±¤À» ·Îµù loader.Read( &(param.mSkyAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mSkyDimmer) ); loader.Read( &(param.mTerrainAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mTerrainDimmer) ); loader.Read( &(param.mStaticObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mStaticObjectDimmer) ); loader.Read( &(param.mDynamicObjectAmbient), sizeof(NiColor) ); loader.ReadFloat( &(param.mDynamicObjectDimmer) ); /// ¾È°³ ¼Ó¼ºÀ» ·Îµù unsigned int i; loader.ReadUnsignedInt( &i ); loader.Read( &(param.mFogColor), sizeof(NiColor) ); loader.ReadFloat( &(param.mFogDepth) ); /// ±×·ì À妽º¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mGroupIndex) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cAreaSceneNode* n = CreateArea( param ); assert( n && "failed to create area scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eLIGHT: { cLightSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// ÁÖº¯»öÀ» ·Îµù loader.Read( &(param.mAmbient), sizeof(NiColor) ); /// »ê¶õ»öÀ» ·Îµù loader.Read( &(param.mDiffuse0), sizeof(NiColor) ); loader.Read( &(param.mDiffuse1), sizeof(NiColor) ); loader.ReadFloat( &(param.mDiffuseAnimTime) ); unsigned int i; loader.ReadUnsignedInt( &i ); param.mFlickering = i != 0; /// ¹Ý»ç»öÀ» ·Îµù loader.Read( &(param.mSpecular), sizeof(NiColor) ); /// °¨¼è °è¼öµéÀ» ·Îµù loader.ReadFloat( &(param.mConstantAtten0) ); loader.ReadFloat( &(param.mConstantAtten1) ); loader.ReadFloat( &(param.mConstantAttenAnimTime) ); loader.ReadFloat( &(param.mLinearAtten) ); loader.ReadFloat( &(param.mQuadricAtten) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º // cLightSceneNode* n = CreateLight( param ); // assert( n && "failed to create light scene node" ); //if( n == 0 ) // return -1; } break; case cSceneNode::eSTATIC: { cStaticSceneNodeParam param; /// ¾È°³ Àû¿ë ¿©ºÎ¸¦ ·Îµù unsigned int i = 0; loader.ReadUnsignedInt( &i ); param.mFogApplied = (i != 0); /// ÀçÁú Àû¿ë ¿©ºÎ¸¦ ·Îµù i = 0; loader.ReadUnsignedInt( &i ); param.mMaterialApplied = (i != 0); /// ÀçÁú ¼Ó¼ºÀ» ·Îµù loader.Read( ¶m.mMaterial, sizeof(cMaterialData) ); /// °¡½Ã ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mVisibleLevel) ); /// Â÷Æó ·¹º§À» ·Îµù loader.ReadUnsignedInt( &(param.mOccludeLevel) ); /// ¶óÀÌÆ®¸Ê ·Îµù loader.Read( lightMapName, 64 ); lightMapName[63] = 0; /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./data/map/%s", name ); param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; /// ³ëµå¸¦ »ý¼º cStaticSceneNode* n = CreateStatic( param ); assert( n && "failed to create static scene node" ); // if( n ) // { // if( ::strlen(lightMapName) != 0 ) // { // NiTexture* tex = RESOURCEMAN->LoadMapTexture( lightMapName, false ); // if( tex ) // { // /// change detail map // int a = 0; // a = 1; //// n->SetLightMapTexture( tex, n->GetNiNode() ); // } // else // { // cString msg; // msg.Format( "Failed to load Light Map Texture : %s", lightMapName ); // NiMessageBox( msg.Cstr(), "Load Error" ); // } // } // } // else // { // assert( n && "failed to create static scene node" ); // } } break; default: assert( 0 && "invalid scene node type" ); return -1; } gLoadNodeNum++; if( gNodeNum <= gLoadNodeNum ) return -2; } return i; } int cSceneManager::LoadSoundNode11( cFileLoader& loader, unsigned int loadCount ) { /// Àå¸é ³ëµåµéÀ» »ý¼º ¹× ·Îµù unsigned int type; char path[64]; char name[64]; NiPoint3 translate; NiMatrix3 rotate; float scale; unsigned int i = 0; for( ; i < loadCount; ++i ) { /// ŸÀÔÀ» ·Îµù loader.ReadUnsignedInt( &type ); /// °æ·Î¸¦ ·Îµù loader.Read( path, 64 ); path[63] = 0; /// À̸§À» ·Îµù loader.Read( name, 64 ); name[63] = 0; /// À§Ä¡¸¦ ·Îµù loader.Read( &translate, sizeof(NiPoint3) ); /// ȸÀüÀ» ·Îµù loader.Read( &rotate, sizeof(NiMatrix3) ); /// ¹èÀ²À» ·Îµù loader.ReadFloat( &scale ); /// ³ëµå ŸÀÔ¿¡ µû¸¥ ·Îµù ¹× »ý¼º switch( type ) { case cSceneNode::eSOUND: { cSoundSceneNodeParam param; /// ¹ÝÁö¸§À» ·Îµù loader.ReadFloat( &(param.mRadius) ); /// °¨¼è °Å¸®¸¦ ·Îµù loader.ReadFloat( &(param.mAttenDistance) ); /// ¹Ýº¹ Ƚ¼ö¸¦ ·Îµù loader.ReadUnsignedInt( &(param.mLoopCount) ); /// Àç»ý °£°ÝÀ» ·Îµù loader.ReadFloat( &(param.mLoopInterval) ); /// À½·® ºñÀ²À» ·Îµù loader.ReadFloat( &(param.mVolumeRatio) ); /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName = name; param.mTranslate = translate; param.mRotate = rotate; param.mScale = scale; param.mVolumeRatio *= OPTIONMAN->GetEnvVolume(); /// ³ëµå¸¦ »ý¼º cSoundSceneNode* n = CreateEnvSound( param ); assert( n && "failed to create sound scene node" ); //if( n == 0 ) // return -1; } break; default: assert( 0 && "invalid scene node type" ); return -1; } gLoadSoundNodeNum++; if( gSoundNodeNum == gLoadSoundNodeNum ) return -2; } return i; } bool cSceneManager::LoadAreaGroup( unsigned int mapIndex, unsigned char mapMode ) { mTextureMap.Clear(); unsigned long folderIdx = GAMERESOURCEMAN->GetMapFolderIdx( mapIndex, mapMode ); /// ¿µ¿ª ±×·ìµéÀ» Á¦°Å cAreaGroupMap::cIterator i = mAreaGroupMap.Begin(); cAreaGroupMap::cIterator iend = mAreaGroupMap.End(); for( ; i != iend; ++i ) { delete (cAreaGroup*)((*i).mSecond); } mAreaGroupMap.Clear(); /// ÆÄÀÏ ¿­±â cString pathName; pathName.Format( "./Script/Resource/%03d_areagroup.txt", folderIdx ); cFileLoader loader; if( loader.Open( pathName, true ) == false ) { return false; } cTokenizer tok( loader.GetBufferPtr(), loader.GetSize(), " \t\r\n\"", pathName.Cstr() ); cString str; /// »ç¿îµå ÆÄÀÏÀ» ·Îµù tok.GetNext( &str ); if( str == "sounds" ) { /// "{" tok.GetNext( &str ); while( tok.IsEnd() == false ) { /// »ç¿îµå À妽º tok.GetNext( &str ); if( str == "}" ) break; unsigned int sndIndex = str.ToInt(); /// »ç¿îµå ÆÄÀϸí tok.GetNext( &str ); /// ·Îµù pathName.Format( "./Sound/%s", str.Cstr() ); NiAudioSource* snd = SOUNDSYS->LoadAreaSound( sndIndex, pathName.Cstr() ); if( snd == 0 ) continue; } } /// °£ÆÇ À̹ÌÁö ÆÄÀÏÀ» ·Îµù tok.GetNext( &str ); if( str == "images" ) { /// "{" tok.GetNext( &str ); while( tok.IsEnd() == false ) { /// À̹ÌÁö À妽º tok.GetNext( &str ); if( str == "}" ) break; /// À̹ÌÁö ÆÄÀϸí unsigned int texIndex = str.ToInt(); tok.GetNext( &str ); pathName.Format( "./language/%s/%s", cApplication::mLangaugeFolder.Cstr(), str.Cstr() ); /// ·Îµù NiTexture* tex = RESOURCEMAN->LoadTexture( pathName, false ); if( tex == 0 ) continue; /// ÅØ½ºÃ³ ¸Ê¿¡ Ãß°¡ mTextureMap.Insert( texIndex, tex ); } } /// tok.GetNext( &str ); if( str == "areaGroups" ) { /// "{" tok.GetNext( &str ); while( tok.IsEnd() == false ) { /// ¿µ¿ª ±×·ì À妽º tok.GetNext( &str ); unsigned int groupIndex = str.ToInt(); /// »ç¿îµå À妽º tok.GetNext( &str ); unsigned int sndIndex = str.ToInt(); NiAudioSource* snd = SOUNDSYS->GetAreaSound( sndIndex ); /// °£ÆÇ À̹ÌÁö À妽º tok.GetNext( &str ); unsigned int texIndex = str.ToInt(); NiTexture* tex = 0; cTextureMap::cIterator ti = mTextureMap.Find( texIndex ); if( ti != mTextureMap.End() ) tex = (NiTexture*)(*ti).mSecond; /// °£ÆÇ À̹ÌÁö À§Ä¡, Å©±â tok.GetNext( &str ); unsigned int tx = str.ToInt(); tok.GetNext( &str ); unsigned int ty = str.ToInt(); tok.GetNext( &str ); unsigned int tw = str.ToInt(); tok.GetNext( &str ); unsigned int th = str.ToInt(); /// À̸§ À妽º tok.GetNext( &str ); unsigned int nameIndex = str.ToInt(); /// ¿µ¿ª ±×·ìÀ» »ý¼º cAreaGroupMap::cIterator ai = mAreaGroupMap.Find( groupIndex ); if( ai == mAreaGroupMap.End() ) { unsigned int x = (RENDERSYS->GetScreenWidth() - tw) / 2; unsigned int y = 60; cAreaGroup* areaGroup = new cAreaGroup( snd, tex, x, y, tx, ty, tw, th, nameIndex ); mAreaGroupMap.Insert( groupIndex, areaGroup ); /// ¿µ¿ª ±×·ì¿¡ ¿µ¿ª ³ëµåµéÀ» Ãß°¡ cAreaMap::cIterator i, iend; i = mAreaArray.Begin(); iend = mAreaArray.End(); for( ; i != iend; ++i ) { cAreaSceneNode* area = (cAreaSceneNode*)(*i).mSecond; if( area->GetGroupIndex() == groupIndex ) areaGroup->AddArea( area ); } } } } return true; } bool cSceneManager::LoadTutorialScene() { cStaticSceneNodeParam param; param.mFogApplied = false; param.mMaterialApplied = false; param.mVisibleLevel = 3; param.mOccludeLevel = 0; /// ±âº» ¼Ó¼º ÀÎÀÚµéÀ» ¼³Á¤ param.mPathName.Format( "./data/map/%s", "eff_derection.nif" ); /// ³ëµå¸¦ »ý¼º CreateStatic( param ); return true; }