dxx-rebirth/common/main/config.h
Kp 073f00974a Eliminate uses of the typedef struct X { ... } X; pattern
C++ does not require this pattern.

import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
	m = to.match(line)
	if m:
		osn = m.group(1)
		print 'struct %s\n{' % osn
		continue
	if osn:
		m = tc.match(line)
		if m:
			csn = m.group(2)
			if osn == csn:
				print '}%s;' % m.group(1)
				osn = None
				continue
			else:
				osn = None
	print line,
2013-12-28 22:48:07 +00:00

73 lines
1.8 KiB
C

/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
/*
*
* prototype definitions for descent.cfg reading/writing
*
*/
#ifndef _CONFIG_H
#define _CONFIG_H
#include "player.h"
#include "mission.h"
#ifdef __cplusplus
struct Cfg
{
ubyte DigiVolume;
ubyte MusicVolume;
int ReverseStereo;
int OrigTrackOrder;
int MusicType;
int CMLevelMusicPlayOrder;
int CMLevelMusicTrack[2];
char CMLevelMusicPath[PATH_MAX+1];
char CMMiscMusic[5][PATH_MAX+1];
int GammaLevel;
char LastPlayer[CALLSIGN_LEN+1];
char LastMission[MISSION_NAME_LEN+1];
int ResolutionX;
int ResolutionY;
int AspectX;
int AspectY;
int WindowMode;
int TexFilt;
int VSync;
int Multisample;
int FPSIndicator;
int Grabinput;
#ifdef DXX_BUILD_DESCENT_II
int MovieTexFilt;
int MovieSubtitles;
#endif
} __pack__;
extern struct Cfg GameCfg;
//#ifdef USE_SDLMIXER
//#define EXT_MUSIC_ON (GameCfg.SndEnableRedbook || GameCfg.JukeboxOn)
//#else
//#define EXT_MUSIC_ON (GameCfg.SndEnableRedbook) // JukeboxOn shouldn't do anything if it's not supported
//#endif
extern int ReadConfigFile(void);
extern int WriteConfigFile(void);
#endif
#endif