home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Online
/
Twiny
/
Windows
/
Source
/
Config.cpp
next >
Wrap
C/C++ Source or Header
|
2000-08-14
|
924b
|
29 lines
#include <windows.h>
#include "config.h"
struct ConfigData Config;
static char IniFileName[] = "Twiny.ini";
void LoadConfig( struct ConfigData *cfg )
{
char IniFile[ MAX_PATH ];
memset( cfg, 0, sizeof( *cfg ));
GetModuleFileName( NULL, IniFile, sizeof( IniFile ));
// I hereby state I don't code this way. Usually. :)
strrchr( IniFile, '\\' )[1] = '\0';
strcat( IniFile, IniFileName );
cfg->Port = GetPrivateProfileInt( "Server", "Port", 1414, IniFile );
cfg->WinX = GetPrivateProfileInt( "Window", "X", 650, IniFile );
cfg->WinY = GetPrivateProfileInt( "Window", "Y", 2, IniFile );
cfg->WinWidth = GetPrivateProfileInt( "Window", "Width", 100, IniFile );
cfg->WinHeight = GetPrivateProfileInt( "Window", "Height", 100, IniFile );
GetPrivateProfileString( "Server", "Host", "Amiga",
cfg->Host, sizeof( cfg->Host ), IniFile );
}