Add project files.

This commit is contained in:
dude719
2017-11-07 00:33:25 -04:00
parent b9dd47e84d
commit 8238992821
11 changed files with 1680 additions and 0 deletions

53
SigMaker/Misc.cpp Normal file
View File

@@ -0,0 +1,53 @@
#include "Misc.h"
Settings_t Settings;
void Settings_t::Init( void )
{
memset( this, 0, sizeof( Settings_t ) );
Settings.iLogLevel = 1;
}
void Settings_t::Save( const char* pszFileName )
{
char szLocation[MAXSTR];
qsnprintf( szLocation, MAXSTR - 1, "%s\\%s", get_user_idadir( ), pszFileName );
if (Settings.iLogLevel >= 3)
{
msg( "saving settings to %s\n", szLocation );
}
FILE* pFile = qfopen( szLocation, "wb" );
if (pFile)
{
qfwrite( pFile, this, sizeof( Settings_t ) );
qfclose( pFile );
}
}
void Settings_t::Load( const char* pszFileName )
{
char szLocation[MAXSTR];
qsnprintf( szLocation, MAXSTR - 1, "%s\\%s", get_user_idadir( ), pszFileName );
if (Settings.iLogLevel >= 3)
{
msg( "loading settings from %s\n", szLocation );
}
FILE* pFile = qfopen( szLocation, "rb" );
if (pFile)
{
qfread( pFile, this, sizeof( Settings_t ) );
qfclose( pFile );
}
else
{
if (Settings.iLogLevel >= 2)
msg( "couldn't open settings file using either default or current settings\n" );
}
}