Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » .ini
Re: .ini [message #447174 is a reply to message #447172] Sat, 14 May 2011 05:58 Go to previous messageGo to previous message
saberhawk
Messages: 1068
Registered: January 2006
Location: ::1
Karma:
General (1 Star)
Why not just use INIClass directly, instead of SettingsLoader? It's inside engine_io.h and it's pretty simple to use. If you'd like to load lists of objects, let me know and I'll upload a modified engine_io with two extra INIClass functions that make it alot easier to do so.

/*
; lolhax.ini
[Section]
IntegerValue=42
FloatValue=13.37
BooleanValue=yes
StringValue=Can you hear me now?
*/

int integer_value = 42;
float float_value = 13.37f;
bool boolean_value = true;
char string_value[128] = "Can you hear me now?";

INIClass* ini = Get_INI("lolhax.ini");
if (ini)
{
	integer_value = ini->Get_Int("Section", "IntegerValue", 42);
	float_value = ini->Get_Float("Section", "FloatValue", 13.37f);
	boolean_value = ini->Get_Bool("Section", "BooleanValue", true);
	ini->Get_String("Section", "StringValue", "Can you hear me now?", string_value, sizeof(string_value)); 
	Release_INI(ini);
}

[Updated on: Sat, 14 May 2011 06:00]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Veh Bots.
Next Topic: Rp2's Zombie Assault
Goto Forum:
  


Current Time: Sun Dec 29 09:47:12 MST 2024

Total time taken to generate the page: 0.00929 seconds