Re-introduce 'quake2' flag is 'idTech2' flag for properly launching legacy games.

This commit is contained in:
jdolan 2013-10-05 15:21:27 -04:00
commit 084169f348
6 changed files with 35 additions and 160 deletions

View file

@ -1325,27 +1325,6 @@ void GroupDlg::Create(){
EntWidgets[EntCheck1 + i] = check;
}
if ( g_pGameDescription->quake2 ) {
GtkWidget *check = gtk_check_button_new_with_label( _( "!Easy" ) );
gtk_widget_show( check );
gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL );
EntWidgets[EntCheck17] = check;
check = gtk_check_button_new_with_label( _( "!Medium" ) );
gtk_widget_show( check );
gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL );
EntWidgets[EntCheck18] = check;
check = gtk_check_button_new_with_label( _( "!Hard" ) );
gtk_widget_show( check );
gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL );
EntWidgets[EntCheck19] = check;
check = gtk_check_button_new_with_label( _( "!DeathMatch" ) );
gtk_widget_show( check );
gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL );
EntWidgets[EntCheck20] = check;
}
}
{

View file

@ -974,7 +974,7 @@ void QE_ExpandBspString( char *bspaction, GPtrArray *out_array, char *mapname ){
QE_ConvertDOSToUnixName( src, src );
// initialise the first step
out = new char[BIG_PATH_MAX]; //% PATH_MAX
out = new char[BIG_PATH_MAX];
g_ptr_array_add( out_array, out );
in = ValueForKey( g_qeglobals.d_project_entity, bspaction );
@ -1015,7 +1015,7 @@ void QE_ExpandBspString( char *bspaction, GPtrArray *out_array, char *mapname ){
// start a new step
*out = 0;
in = in + 2;
out = new char[BIG_PATH_MAX]; //% PATH_MAX
out = new char[BIG_PATH_MAX];
g_ptr_array_add( out_array, out );
}
}
@ -1110,10 +1110,10 @@ static gboolean RunBsp_CaptureOutput(void *data) {
void RunBsp( char *command ){
GPtrArray *sys;
char batpath[BIG_PATH_MAX]; //% PATH_MAX
char temppath[BIG_PATH_MAX]; //% PATH_MAX
char name[BIG_PATH_MAX]; //% PATH_MAX
char cWork[BIG_PATH_MAX]; //% PATH_MAX
char batpath[BIG_PATH_MAX];
char temppath[BIG_PATH_MAX];
char name[BIG_PATH_MAX];
char cWork[BIG_PATH_MAX];
FILE *hFile;
unsigned int i;
@ -1131,14 +1131,11 @@ void RunBsp( char *command ){
AddSlash( strPath );
strncpy( cWork, strPath, 1024 );
strcat( cWork, strFile );
}
else
{
} else {
strcpy( cWork, name );
}
// get the array ready
//++timo TODO: free the array, free the strings ourselves with delete[]
sys = g_ptr_array_new();
QE_ExpandBspString( command, sys, cWork );
@ -1149,9 +1146,7 @@ void RunBsp( char *command ){
ExtractFileName( currentmap, bspname );
StripExtension( bspname );
g_pParentWnd->GetWatchBSP()->DoMonitoringLoop( sys, bspname );
}
else
{
} else {
// write all the steps in a single BAT / .sh file and run it, don't bother monitoring it
CString strSys;
for ( i = 0; i < sys->len; i++ )
@ -1239,68 +1234,10 @@ void RunBsp( char *command ){
WinExec( batpath, SW_SHOWNORMAL );
#endif
}
#ifdef _DEBUG
// yeah, do it .. but not now right before 1.1-TA-beta release
Sys_Printf( "TODO: erase GPtrArray\n" );
#endif
// free the strings and the array
for ( i = 0; i < sys->len; i++ ) {
delete[] (char *)g_ptr_array_index( sys, i );
}
g_ptr_array_free( sys, TRUE );
sys = NULL;
}
#if 0
#ifdef _WIN32
int WINAPI QEW_SetupPixelFormat( HDC hDC, qboolean zbuffer ){
static PIXELFORMATDESCRIPTOR pfd = {
sizeof( PIXELFORMATDESCRIPTOR ), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER, // double buffered
PFD_TYPE_RGBA, // RGBA type
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
32, // depth bits
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
}; //
int pixelformat = 0;
zbuffer = true;
if ( !zbuffer ) {
pfd.cDepthBits = 0;
}
if ( ( pixelformat = ChoosePixelFormat( hDC, &pfd ) ) == 0 ) {
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
Sys_FPrintf( SYS_WRN, "GetLastError: %s", lpMsgBuf );
Error( "ChoosePixelFormat failed" );
}
if ( !SetPixelFormat( hDC, pixelformat, &pfd ) ) {
Error( "SetPixelFormat failed" );
}
return pixelformat;
}
#endif
#endif

View file

@ -215,7 +215,6 @@
#define MOUSE_DEF 1
#define WINDOW_DEF 0
#define RUNQ2_DEF 0
#define WATCHBSP_DEF 1
#define TLOCK_DEF 1
#define LOADLAST_DEF 1
#define RUN_DEF 0
@ -758,14 +757,12 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const Str &GameFile ){
mGameFile = GameFile;
prop = (char*)xmlGetProp( pNode, (xmlChar*)"quake2" );
prop = (char*)xmlGetProp( pNode, (xmlChar*)"idtech2" );
if ( prop == NULL ) {
// default
quake2 = false;
}
else
{
quake2 = true;
idTech2 = false;
} else {
idTech2 = true;
xmlFree( prop );
}
@ -775,9 +772,7 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const Str &GameFile ){
if ( prop == NULL ) {
// default
noMapsInHome = false;
}
else
{
} else {
noMapsInHome = true;
xmlFree( prop );
}
@ -786,14 +781,11 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const Str &GameFile ){
if ( prop == NULL ) {
// default
mBaseGame = "baseq3";
}
else
{
} else {
mBaseGame = prop;
xmlFree( prop );
}
prop = (char*)xmlGetProp( pNode, (const xmlChar*)ENGINE_ATTRIBUTE );
if ( prop == NULL ) {
#ifdef _WIN32
@ -803,9 +795,7 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const Str &GameFile ){
#elif __APPLE__
mEngine = "Quake3.app";
#endif
}
else
{
} else {
mEngine = prop;
xmlFree( prop );
}
@ -819,9 +809,7 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const Str &GameFile ){
#elif __APPLE__
mMultiplayerEngine = "Quake3.app";
#endif
}
else
{
} else {
mMultiplayerEngine = prop;
xmlFree( prop );
}
@ -887,9 +875,7 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const Str &GameFile ){
if ( !mShaderPath.GetLength() ) {
mShaderPath = "scripts/";
mShaderlist = "scripts/shaderlist.txt";
}
else
{
} else {
AddSlash( mShaderPath );
mShaderlist = mShaderPath;
mShaderlist += "shaderlist.txt";
@ -3015,17 +3001,14 @@ void PrefsDlg::LoadPrefs(){
// this will probably need to be 75 or 100 for Q1.
mLocalPrefs.GetPref( TEXTURESCALE_KEY, &m_nTextureScale, 50 );
// FIXME: Hydra - actually, this stuff is Q1,Q2 and HL specific.
if ( ( g_pGameDescription->mGameFile == "hl.game" ) ) {
// No BSP monitoring in the default compiler tools for Half-life (yet)
mLocalPrefs.GetPref( WATCHBSP_KEY, &m_bWatchBSP, FALSE );
// Texture subset on by default (HL specific really, because of halflife.wad's size)
mLocalPrefs.GetPref( TEXTURE_KEY, &m_bTextureWindow, TRUE );
}
else
{
mLocalPrefs.GetPref( WATCHBSP_KEY, &m_bWatchBSP, WATCHBSP_DEF );
} else {
mLocalPrefs.GetPref( WATCHBSP_KEY, &m_bWatchBSP, TRUE );
mLocalPrefs.GetPref( TEXTURE_KEY, &m_bTextureWindow, FALSE );
}
@ -3615,7 +3598,7 @@ void CGameInstall::Run() {
switch ( m_availGames[ m_nComboSelect ] ) {
case GAME_Q2: {
fprintf( fg, " quake2=\"true\"\n" );
fprintf( fg, " idtech2=\"true\"\n" );
fprintf( fg, " prefix=\".quake2\"\n" );
fprintf( fg, " basegame=\"baseq2\"\n" );
fprintf( fg, " no_patch=\"true\"\n" );
@ -3648,23 +3631,14 @@ void CGameInstall::Run() {
break;
}
case GAME_Q2W: {
#ifdef __APPLE__
#if defined( __APPLE__ ) || defined( __linux__ )
fprintf( fg, " " ENGINE_ATTRIBUTE "=\"quake2world\"\n" );
fprintf( fg, " " ENGINEPATH_ATTRIBUTE "=\"/Applications/Quake2World.app/Contents/Resources\"\n" );
fprintf( fg, " " EXECUTABLES_ATTRIBUTE "=\"/Applications/Quake2World.app/Contents/MacOS\"\n" );
fprintf( fg, " " PREFIX_ATTRIBUTE "=\".quake2world\"\n" );
#elif __linux__
fprintf( fg, " " ENGINE_ATTRIBUTE "=\"quake2world\"\n" );
fprintf( fg, " " ENGINEPATH_ATTRIBUTE "=\"/usr/local/games/quake2world/share\"\n" );
fprintf( fg, " " EXECUTABLES_ATTRIBUTE "=\"/usr/local/games/quake2world/bin\"\n" );
fprintf( fg, " " PREFIX_ATTRIBUTE "=\".quake2world\"\n" );
#elif _WIN32
fprintf( fg, " " ENGINE_ATTRIBUTE "=\"quake2world.exe\"\n" );
fprintf( fg, " " ENGINEPATH_ATTRIBUTE "=\"C:\\Program Files\\Quake2World\\share\"\n" );
fprintf( fg, " " EXECUTABLES_ATTRIBUTE "=\"C:\\Program Files\\Quake2World\\bin\"\n" );
fprintf( fg, " " PREFIX_ATTRIBUTE "=\"Quake2World\"\n" );
#endif
fprintf( fg, " quake2=\"true\"\n" );
fprintf( fg, " idtech2=\"true\"\n" );
fprintf( fg, " basegame=\"default\"\n" );
fprintf( fg, " no_patch=\"true\"\n" );
fprintf( fg, " default_scale=\"0.25\"\n" );

View file

@ -183,8 +183,8 @@ float mTextureDefaultScale; ///< default scale (0.5 in q3, 1.0 in q1/q2, 0.25
bool mEClassSingleLoad; ///< only load a single eclass definition file
bool mNoPatch; ///< this game doesn't support patch technology
Str mCaulkShader; ///< the shader to use for caulking
bool quake2; ///< set this to true to get quake2
bool noMapsInHome; ///< set this if you want to open the engine path/base dir/maps dir for map open/save dialoges */
bool idTech2; // set this to true for idTech2 games
CGameDescription() { mpDoc = NULL; }
/*!

View file

@ -175,14 +175,6 @@ void SetFaceTexdef_Q2( face_t *f, texdef_t *texdef, bool bFitScale ){
void SI_SetTexdef_FaceList( texdef_to_face_t* texdef_face_list, bool b_SetUndoPoint, bool bFit_to_Scale ){
texdef_to_face_t* texdef_to_face;
bool b_isQuake2;
if ( g_pGameDescription->quake2 ) {
b_isQuake2 = true;
}
else{
b_isQuake2 = false;
}
if ( !texdef_face_list ) {
return;
@ -194,13 +186,9 @@ void SI_SetTexdef_FaceList( texdef_to_face_t* texdef_face_list, bool b_SetUndoPo
}
else if ( ( selected_brushes.next != &selected_brushes ) || ( g_ptrSelectedFaces.GetSize() == 1 ) ) {
// Give something to undo to
for ( texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next )
if ( b_isQuake2 ) {
SetFaceTexdef_Q2( texdef_to_face->face, &texdef_to_face->orig_texdef, bFit_to_Scale );
}
else{
SetFaceTexdef( texdef_to_face->face, &texdef_to_face->orig_texdef, &texdef_to_face->orig_bp_texdef, bFit_to_Scale );
}
for ( texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next ) {
SetFaceTexdef( texdef_to_face->face, &texdef_to_face->orig_texdef, &texdef_to_face->orig_bp_texdef, bFit_to_Scale );
}
Undo_Start( "set facelist texdefs" );
@ -211,15 +199,11 @@ void SI_SetTexdef_FaceList( texdef_to_face_t* texdef_face_list, bool b_SetUndoPo
Undo_AddBrush( texdef_face_list->brush );
}
}
}
}
for ( texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next )
{
if ( b_isQuake2 ) {
SetFaceTexdef_Q2( texdef_to_face->face, &texdef_to_face->texdef, bFit_to_Scale );
}
else
{
brushprimit_texdef_t brushprimit_texdef;
FakeTexCoordsToTexMat( texdef_to_face->texdef.shift, texdef_to_face->texdef.rotate, texdef_to_face->texdef.scale, brushprimit_texdef.coords );

View file

@ -478,11 +478,12 @@ void CWatchBSP::RoutineProcessing(){
FindReplace( cmd, "/", "\\" );
#endif
Str cmdline;
if ( g_pGameDescription->quake2 ) {
if ( g_pGameDescription->idTech2 ) {
cmdline = "+exec radiant.cfg +map ";
cmdline += m_sBSPName;
}
else
// NOTE: idTech3 specific - there used to be some logic depending on engine breed here
{
cmdline = "+set sv_pure 0 ";
// TTimo: a check for vm_* but that's all fine