예제 #1
0
void Exporter::readKfConfig(Interface *i)
{
   TCHAR iniName[MAX_PATH];
   GetIniFileName(iniName);

   mExportHidden = GetIniValue(KfExportSection, _T("IncludeHidden"), false, iniName);
   mExportLights = GetIniValue(KfExportSection, _T("Lights"), false, iniName);
   mExportCameras = GetIniValue(KfExportSection, _T("Cameras"), false, iniName);
   mExportTransforms = GetIniValue(KfExportSection, _T("Transforms"), true, iniName);
   mDefaultPriority = GetIniValue<float>(KfExportSection, _T("Priority"), 0.0f, iniName);
}
예제 #2
0
void Character::Init( Screen3D& Screen, WorldManager* WM, MeshManager& MM, SoundManager& AM,  char* ObjectFile )
{
	//load in the animated mesh
	char TempBuffer[255];
	GetIniValue(ObjectFile, "graphics", "animation_file", TempBuffer);
	MeshA.Init( Screen, MM, TempBuffer );

	//Store some pointery things
	WMPtr = WM;
	MMPtr = &MM;


	Health = GetIniValue(ObjectFile, "properties", "health");
	//Load in the character's primary weapon
	GetIniValue(ObjectFile, "weapon", "weapon", TempBuffer);
	if( strcmpi(TempBuffer, "nostring") != 0)
	{

		//Create the weapon
		Weapon* DefaultWeapon = new Weapon;
		DefaultWeapon->Init( Screen, WM, MM, AM, TempBuffer );

		//Add it to the world
		WMPtr->Add( DefaultWeapon );

		//also add it locally
		this->AddEntity(DefaultWeapon );
	}

	//load in the side arm
	GetIniValue(ObjectFile, "weapon", "sidearm", TempBuffer);
	if( strcmpi(TempBuffer, "nostring") != 0)
	{
		Weapon* SideWeapon = new Weapon;
		SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );

		WMPtr->Add( SideWeapon );

		this->AddEntity(SideWeapon );
	}

	CurrentState = "idle";

	//CharacterScript = GetSSLKernel()->TaskMan.BuildScript( "..\\scripts\\enemy.shil", NULL );

/*
	Value V;
	V.SetNum( ID );
	GetSSLKernel()->TaskMan.AddFunctionParameter( CharacterScript, V );
	GetSSLKernel()->TaskMan.CallAppFunction( CharacterScript, "SetCharacterHandle", 1 );
	GetSSLKernel()->TaskMan.RunActiveScripts( 100);*/
}
void InitializeLibSettings()
{
   TCHAR iniName[MAX_PATH];
   GetIniFileName(iniName);
   libVersion = GetIniValue(TEXT("System"), TEXT("MaxSDKVersion"), libVersion, iniName);
   if (libVersion == 0)
      libVersion = VERSION_3DSMAX;

   nClasses = 0;
   if ( GetIniValue<bool>(TEXT("MaxNifExport"), TEXT("Enable"), true, iniName) ) {
      classDescEnabled[CD_Export] = true;
      classDescriptions[nClasses++] = GetNifExportDesc();
   }
   if ( GetIniValue<bool>(TEXT("MaxNifImport"), TEXT("Enable"), true, iniName) ) {
      classDescEnabled[CD_Import] = true;
      classDescriptions[nClasses++] = GetMaxNifImportDesc();
   }
   if ( GetIniValue<bool>(TEXT("NifProps"), TEXT("Enable"), true, iniName) ) {
      classDescEnabled[CD_Props] = true;
      classDescriptions[nClasses++] = GetNifPropsDesc();
	  classDescriptions[nClasses++] = GetbhkListObjDesc();
	  classDescriptions[nClasses++] = GetbhkProxyObjDesc();
      classDescriptions[nClasses++] = GetbhkRigidBodyModifierDesc();
      classDescriptions[nClasses++] = GetbhkSphereDesc();
      classDescriptions[nClasses++] = GetbhkCapsuleDesc();
      classDescriptions[nClasses++] = GetbhkBoxDesc();
      classDescriptions[nClasses++] = GetBSDSModifierDesc();
      classDescriptions[nClasses++] = GetNifShaderDesc();
	  classDescriptions[nClasses++] = GetBSSIModifierDesc();
	  classDescriptions[nClasses++] = GetFO4ShaderDesc();	  
	  classDescriptions[nClasses++] = GetBGSMFileClassDesc();
	  classDescriptions[nClasses++] = GetBGEMFileClassDesc();	  
   }
   if ( GetIniValue<bool>(TEXT("NifFurniture"), TEXT("Enable"), true, iniName) ) {
      classDescEnabled[CD_Furniture] = true;
      classDescriptions[nClasses++] = GetNifFurnitureDesc();
   }
   if ( GetIniValue<bool>(TEXT("KFExport"), TEXT("Enable"), false, iniName) ) {
      classDescEnabled[CD_KFExport] = true;
      classDescriptions[nClasses++] = GetKfExportDesc();
   }
#ifdef GAME_VER
   classDescriptions[nClasses++] = (ClassDesc2 *)GetDDSLibClassDesc();
#endif
   InitializeHavok();

   InitializeNifProps();
}
예제 #4
0
BOOL GetIniInfo(WnpdInfo& info)
{
	wchar_t ads[MAX_PATH] = {0};

	GetExePath(ads);
	wcscat(ads,L"\\wnpd.ini");

	info.nginx_path = GetIniValue(L"nginx_path", ads);
	info.nginx_exe_filename = GetIniValue(L"nginx_exe_filename", ads);
	info.nginx_conf_file = GetIniValue(L"nginx_conf_file", ads);
	info.php_cgi_path = GetIniValue(L"php_cgi_path", ads);
	info.php_cgi_exe_filename = GetIniValue(L"php_cgi_exe_filename", ads);
	info.php_cgi_ip = GetIniValue(L"php_cgi_ip", ads);
	info.php_cgi_port = GetIniValue(L"php_cgi_port", ads);
	info.php_ini_file = GetIniValue(L"php_ini_file", ads);
	
	return TRUE;
}
예제 #5
0
static BOOL GetVNCServerPort(unsigned int * srvPort)
{
	BOOL bRet = FALSE;
	if(NULL == srvPort) return bRet;
	{
		char portStr[16] = {0};
		if(GetIniValue(VNCIniFilePath, "PortNumber", portStr))
		{
			if(strlen(portStr))
			{
				*srvPort = atoi(portStr);
				bRet = TRUE;
			}
		}
	}
	return bRet;
}
예제 #6
0
void InitializeLibSettings()
{
   Interface *gi = GetCOREInterface();
   TCHAR iniName[MAX_PATH];
   if (gi) {
      LPCTSTR pluginDir = gi->GetDir(APP_PLUGCFG_DIR);
      PathCombine(iniName, pluginDir, "MaxNifTools.ini");
   } else {
      GetModuleFileName(NULL, iniName, _countof(iniName));
      if (LPTSTR fname = PathFindFileName(iniName))
         fname = NULL;
      PathAddBackslash(iniName);
      PathAppend(iniName, "plugcfg");
      PathAppend(iniName, "MaxNifTools.ini");
   }
   libVersion = GetIniValue("MaxNifExport", "MaxSDKVersion", libVersion, iniName);
   if (libVersion == 0)
      libVersion = VERSION_3DSMAX;
}
예제 #7
0
void CProtocolNapt::ReadConfigurationFile()
	/*
	* Timer values are stored in Timer Class.	
	* iNaptTableScanInterval value should be less than 2147 seconds, as it is an argument
	* to CTimer::After(TTimeIntervalMicroSeconds32).	
	*/
	{
	iTimer->iNaptTableScanInterval	= GetIniValue(NAPT_INI_TIMER,NAPT_INI_TABLESCANINTERVAL,KTableScanIntervalDefault,1,KTimerMaxSeconds);
	iTimer->iNaptTcpIdleTimeout		= GetIniValue(NAPT_INI_TIMER,NAPT_INI_TCPIDLETIMEOUT,KTcpIdleTimeOutDefault,1,KMaxTInt);
	iTimer->iNaptUdpIdleTimeout		= GetIniValue(NAPT_INI_TIMER,NAPT_INI_UDPIDLETIMEOUT,KUdpIdleTimeoutDefault,1,KMaxTInt);
	iTimer->iNaptIcmpIdleTimeout	= GetIniValue(NAPT_INI_TIMER,NAPT_INI_ICMPIDLETIMEOUT,KIcmpIdleTimeoutDefault,1,KMaxTInt);
	iTimer->iNaptTcpCloseTimeout	= GetIniValue(NAPT_INI_TIMER,NAPT_INI_TCPCLOSETIMEOUT,KTcpCloseTimeoutDefault,1,KMaxTInt);
	iTimer->iNaptTcpOpenTimeout		= GetIniValue(NAPT_INI_TIMER,NAPT_INI_TCPOPENTIMEOUT,KTcpOpenTimeoutDefault,1,KMaxTInt);
	}
예제 #8
0
void Exporter::readConfig(Interface *i)
{
   if (mUseRegistry)
   {
      HKEY hKey;
      if (RegCreateKey(HKEY_CURRENT_USER, REGPATH, &hKey) != ERROR_SUCCESS)
         return;

      DWORD ver;
      regGet(hKey, _T("npx_ver"), ver);
      regGet(hKey, _T("npx_tristrips"), mTriStrips);
      regGet(hKey, _T("npx_hidden"), mExportHidden);
      regGet(hKey, _T("npx_furn"), mExportFurn);
      regGet(hKey, _T("npx_lights"), mExportLights);
      regGet(hKey, _T("npx_vcolors"), mVertexColors);
      //	regGet(hKey, "npx_wthresh", mWeldThresh);
      regGet(hKey, _T("npx_tprefix"), mTexPrefix);
      regGet(hKey, _T("npx_coll"), mExportCollision);
      regGet(hKey, _T("npx_remap"), mRemapIndices);
   }
   else
   {
      TCHAR iniName[MAX_PATH];
      GetIniFileName(iniName);

      // mVersion = GetIniValue<int>(NifExportSection, "Version", 013, iniName);
      mTriStrips = GetIniValue<bool>(NifExportSection, _T("GenerateStrips"), true, iniName);
      mExportHidden = GetIniValue<bool>(NifExportSection, _T("IncludeHidden"), false, iniName);
      mExportFurn = GetIniValue<bool>(NifExportSection, _T("FurnatureMarkers"), true, iniName);
      mExportLights = GetIniValue<bool>(NifExportSection, _T("Lights"), false, iniName);
      mVertexColors = GetIniValue<bool>(NifExportSection, _T("VertexColors"), true, iniName);
      mWeldThresh = GetIniValue<float>(NifExportSection, _T("WeldVertexThresh"), 0.01f, iniName);
      mNormThresh = GetIniValue<float>(NifExportSection, _T("WeldNormThresh"), 0.01f, iniName);
      mUVWThresh = GetIniValue<float>(NifExportSection, _T("WeldUVWThresh"), 0.01f, iniName);

      mTexPrefix = GetIniValue<std::wstring>(NifExportSection, _T("TexturePrefix"), _T("textures"), iniName);
      mExportCollision = GetIniValue<bool>(NifExportSection, _T("ExportCollision"), true, iniName);
      mRemapIndices = GetIniValue(NifExportSection, _T("RemapIndices"), true, iniName);

      mExportExtraNodes = GetIniValue(NifExportSection, _T("ExportExtraNodes"), false, iniName);
      mExportSkin = GetIniValue(NifExportSection, _T("ExportSkin"), false, iniName);
      mUserPropBuffer = GetIniValue(NifExportSection, _T("UserPropBuffer"), false, iniName);
      mFlattenHierarchy = GetIniValue(NifExportSection, _T("FlattenHierarchy"), false, iniName);
      mRemoveUnreferencedBones = GetIniValue(NifExportSection, _T("RemoveUnreferencedBones"), false, iniName);
      mSortNodesToEnd = GetIniValue(NifExportSection, _T("SortNodesToEnd"), false, iniName);
      mSkeletonOnly = GetIniValue(NifExportSection, _T("SkeletonOnly"), false, iniName);
      mExportCameras = GetIniValue(NifExportSection, _T("Cameras"), false, iniName);
      mGenerateBoneCollision = GetIniValue(NifExportSection, _T("GenerateBoneCollision"), false, iniName);

      mExportTransforms = GetIniValue(KfExportSection, _T("Transforms"), true, iniName);
      mDefaultPriority = GetIniValue<float>(KfExportSection, _T("Priority"), 0.0f, iniName);
      mExportType = ExportType(GetIniValue<int>(NifExportSection, _T("ExportType"), NIF_WO_ANIM, iniName));

      mMultiplePartitions = GetIniValue(NifExportSection, _T("MultiplePartitions"), false, iniName);
      mBonesPerVertex = GetIniValue<int>(NifExportSection, _T("BonesPerVertex"), 4, iniName);     
      mBonesPerPartition = GetIniValue<int>(NifExportSection, _T("BonesPerPartition"), 20, iniName);

      // mUseTimeTags = GetIniValue(NifExportSection, "UseTimeTags", false, iniName);
      mAllowAccum = GetIniValue(NifExportSection, _T("AllowAccum"), true, iniName);
      mCollapseTransforms = GetIniValue(NifExportSection, _T("CollapseTransforms"), false, iniName);
      mZeroTransforms = GetIniValue(NifExportSection, _T("ZeroTransforms"), false, iniName);
      mFixNormals = GetIniValue(NifExportSection, _T("FixNormals"), false, iniName);
      mTangentAndBinormalExtraData = GetIniValue(NifExportSection, _T("TangentAndBinormalExtraData"), false, iniName);
      mTangentAndBinormalMethod = GetIniValue<int>(NifExportSection, _T("TangentAndBinormalMethod"), 0, iniName);

      mUseAlternateStripper = GetIniValue(NifExportSection, _T("UseAlternateStripper"), false, iniName);
      mCreatorName = GetIniValue<std::wstring>(NifExportSection, _T("Creator"), _T(""), iniName);

      bhkScaleFactor = GetIniValue<float>(CollisionSection, _T("bhkScaleFactor"), 7.0f, iniName);

      mStartNifskopeAfterStart = GetIniValue(NifExportSection, _T("StartNifskopeAfterStart"), false, iniName);
      mNifskopeDir = ExpandEnvironment(GetIndirectValue(GetIniValue<std::wstring>(_T("System"), _T("NifskopeDir"), _T(""), iniName).c_str()));
      mTriPartStrips = GetIniValue<bool>(NifExportSection, _T("GeneratePartitionStrips"), true, iniName);

	  mRootType = GetIniValue<std::wstring>(NifExportSection, _T("RootType"), _T("NiNode"), iniName);
	  mRootTypes = TokenizeString(GetIniValue<std::wstring>(NifExportSection, _T("RootTypes"), _T("NiNode;BSFadeNode"), iniName).c_str(), _T(";"));
  }
}
예제 #9
0
파일: Weapon.cpp 프로젝트: fathat/game-src
void Weapon::Init( Screen3D& Screen, WorldManager* WM, MeshManager& MM, SoundManager& AM,  char* WeaponFile )
{
	//Declarations
	char Buffer[128];
	char Buffer2[128];
    
	
	//see if it's a dual weapon
	DualWeapons = GetIniValue(WeaponFile, "weapon", "dual_weapons");
	OddShot = false;
	
	//Load the animated mesh
	GetIniValue(WeaponFile, "weapon", "animation_file", Buffer);
	MeshA.Init( Screen, MM, Buffer );

	if(DualWeapons)
		MeshB.Init( Screen, MM, Buffer );


	GetIniValue( WeaponFile, "weapon", "muzzle_flash", Buffer );
	MuzzleFlash = Screen.GetTextureHandle( Buffer ) ;

	//load the fire sound
	GetIniValue(WeaponFile, "weapon", "fire_sound", Buffer);
	//FiringSound = AM.GetSound(Buffer);
	SndFiring = DeviceManager::OpenALSound.GetSoundBuffer( Buffer ); 

	//load the reload sound
	GetIniValue(WeaponFile, "weapon", "reload_sound", Buffer);
	//ReloadSound = AM.GetSound(Buffer);
	SndReload = DeviceManager::OpenALSound.GetSoundBuffer( Buffer ); 

	GetIniValue(WeaponFile, "weapon", "aimer", Buffer);
	GetIniValue(WeaponFile, "weapon", "aimer_a", Buffer2);

	//load in the aimer for the gun
	Aimer = Screen.GetTextureHandle(Buffer, Buffer2);
	
	//Load object's icon
	GetIniValue(WeaponFile, "graphics", "icon", Buffer);
	GetIniValue(WeaponFile, "graphics", "icon_a", Buffer2);
	Icon = Screen.GetTextureHandle( Buffer, Buffer2 );

	//load in the gloss map for the gun
	GetIniValue(WeaponFile, "weapon", "glossmap", Buffer);
	GlossMap = Screen.GetTextureHandle(Buffer);



	//Store some pointers and such
	ScreenPtr = &Screen;
	WMPtr = WM;
	AMPtr = &AM;
	MMPtr = &MM;

	//Load in the weapon attributes
	MaxAmmo     = GetIniValue(WeaponFile, "weapon", "max_ammo");
	MaxClipAmmo = GetIniValue(WeaponFile, "weapon", "max_clip_ammo");
	RateOfFire  = GetIniValue(WeaponFile, "weapon", "rate_of_fire");
	ReloadTime  = GetIniValue(WeaponFile, "weapon", "reload_time");
	ProjectileSpeed = GetIniValue(WeaponFile, "weapon", "projectile_speed");
	Ammo        = GetIniValue(WeaponFile, "weapon", "ammo");
	RightHanded = (bool)GetIniValue(WeaponFile, "weapon", "right_handed");
	ClipAmmo    = MaxClipAmmo;
	Collectible = GetIniValue(WeaponFile, "properties", "collectible");
	InstantBullets = GetIniValue(WeaponFile, "weapon", "instant_bullets");
	DamageOnHit    = GetIniValueFloat( WeaponFile, "weapon", "damage" );
	State = WS_IDLE;

	if( DamageOnHit )
	{
		GetIniValue( WeaponFile, "weapon", "explosion_particles", Buffer ) ;
		Explosives.Init( *ScreenPtr, Buffer, WMPtr );
	}

	//Load in the smoke particles
	Smoke.Init(*ScreenPtr, "..\\base\\art\\objects\\weapons\\smoke.ini", WM);


	//Load in the particles for bullets and something something 
	GetIniValue(WeaponFile, "weapon", "particles", Buffer);
	if( strcmpi(Buffer, "nostring") != 0)
	{
		Bullets.Init(Screen, Buffer, WMPtr);
	}


}
예제 #10
0
void NetworkAvatar::Init( Screen3D& Screen, WorldManager* WM, MeshManager& MM, SoundManager& AM,  char* ObjectFile )
{
	//load in the animated mesh
	char TempBuffer[255];
	GetIniValue(ObjectFile, "graphics", "animation_file", TempBuffer);
	MeshA.Init( Screen, MM, TempBuffer );


	//Store some pointery things
	WMPtr = WM;
	MMPtr = &MM;

	//Load in the character's primary weapon
	GetIniValue(ObjectFile, "weapon", "weapon", TempBuffer);
	if( strcmpi(TempBuffer, "nostring") != 0)
	{

		//Create the weapon
		Weapon* DefaultWeapon = new Weapon;
		DefaultWeapon->Init( Screen, WM, MM, AM, TempBuffer );

		//Add it to the world
		WMPtr->Add( DefaultWeapon );

		//also add it locally
		this->AddEntity(DefaultWeapon );
	}

	//load in the side arm
	GetIniValue(ObjectFile, "weapon", "sidearm", TempBuffer);
	if( strcmpi(TempBuffer, "nostring") != 0)
	{
		Weapon* SideWeapon = new Weapon;
		SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );

		WMPtr->Add( SideWeapon );

		this->AddEntity(SideWeapon );
	}

	//load in the third weapon
	GetIniValue(ObjectFile, "weapon", "third", TempBuffer);
	if( strcmpi(TempBuffer, "nostring") != 0)
	{
		Weapon* SideWeapon = new Weapon;
		SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );

		WMPtr->Add( SideWeapon );

		this->AddEntity(SideWeapon );
	}

	//load in the fourth weapon
	GetIniValue(ObjectFile, "weapon", "fourth", TempBuffer);
	if( strcmpi(TempBuffer, "nostring") != 0)
	{
		Weapon* SideWeapon = new Weapon;
		SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );

		WMPtr->Add( SideWeapon );

		this->AddEntity(SideWeapon );
	}

	//load in the fifth weapon
	GetIniValue(ObjectFile, "weapon", "fifth", TempBuffer);
	if( strcmpi(TempBuffer, "nostring") != 0)
	{
		Weapon* SideWeapon = new Weapon;
		SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );

		WMPtr->Add( SideWeapon );

		this->AddEntity(SideWeapon );
	}



}