Skip to content

Commit e8c840f

Browse files
committed
OpenWatcom support
1 parent f197117 commit e8c840f

17 files changed

+32
-23
lines changed

BaseMenu.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,12 @@ double Sys_DoubleTime( void )
871871
gettimeofday(&tv, NULL);
872872
return (double) tv.tv_sec + (double) tv.tv_usec/1000000.0;
873873
}
874+
#elif defined __DOS__
875+
double Sys_DoubleTime( void )
876+
{
877+
// fallback when no time api
878+
return gpGlobals->time + 0.01;
879+
}
874880
#else
875881
typedef unsigned long long longtime_t;
876882
#include <time.h>

CFGScript.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const char *cvartypes[] = { NULL, "BOOL" , "NUMBER", "LIST", "STRING" };
2626

2727
struct parserstate_t
2828
{
29-
parserstate_t() : buf( NULL ), token(), filename( NULL ) {}
29+
parserstate_t() : buf( NULL ), filename( NULL ) { token[0] = 0;}
3030
char *buf;
3131
char token[MAX_STRING];
3232
const char *filename;

CFGScript.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ typedef struct
5555
struct scrvardef_t
5656
{
5757
scrvardef_t() :
58-
flags(0), name(), value(), desc(),
59-
type(T_NONE), next(0) {}
58+
flags(0),
59+
type(T_NONE), next(0) {
60+
name[0] = value[0] = desc[0] = 0;}
6061

6162
int flags;
6263
char name[MAX_STRING];

Scissor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
static class CScissorState
77
{
88
public:
9-
CScissorState() : iDepth( 0 ), coordStack(), sizeStack() { }
9+
CScissorState() : iDepth( 0 ) { }
1010

1111
int iDepth;
1212
Point coordStack[MAX_SCISSORS];

controls/BaseItem.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ class CMenuBaseItem
156156
}
157157

158158
CMenuItemsHolder* Parent() const { return m_pParent; }
159-
template <class T> T* Parent() const { return static_cast<T*>(m_pParent); } // a shortcut to parent
159+
// breaks msvc6/owocc
160+
// template <class T> T* Parent() const { return static_cast<T*>(m_pParent); } // a shortcut to parent
160161
bool IsPressed() const { return m_bPressed; }
161162
int LastFocusTime() const { return m_iLastFocusTime; }
162163

controls/Editable.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ GNU General Public License for more details.
1717

1818
CMenuEditable::CMenuEditable() : BaseClass(),
1919
m_szCvarName(), m_eType(), m_bForceUpdate( false ),
20-
m_szString(), m_szOriginalString(),
2120
m_flValue(), m_flOriginalValue()
2221
{
23-
22+
m_szString[0] = m_szOriginalString[0] = 0;
2423
}
2524

2625
void CMenuEditable::LinkCvar(const char *)

controls/Field.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ GNU General Public License for more details.
2020
#include "Utils.h"
2121

2222

23-
CMenuField::CMenuField() : BaseClass(), szBuffer()
23+
CMenuField::CMenuField() : BaseClass()
2424
{
2525
bAllowColorstrings = true;
2626
bHideInput = false;
@@ -36,6 +36,7 @@ CMenuField::CMenuField() : BaseClass(), szBuffer()
3636
iScroll = 0;
3737
iRealWidth = 0;
3838
szBackground = 0;
39+
szBuffer[0] = 0;
3940
}
4041

4142
void CMenuField::Init()

controls/SpinControl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ GNU General Public License for more details.
2323
CMenuSpinControl::CMenuSpinControl() : BaseClass(), m_szBackground(),
2424
m_szLeftArrow(), m_szRightArrow(), m_szLeftArrowFocus(), m_szRightArrowFocus(),
2525
m_flMinValue(0), m_flMaxValue(1), m_flCurValue(0), m_flRange(0.1), m_pModel( NULL ),
26-
m_iFloatPrecision(0), m_szDisplay()
26+
m_iFloatPrecision(0)
2727
{
2828
m_szBackground = 0;
2929
m_szLeftArrow = UI_LEFTARROW;
3030
m_szLeftArrowFocus = UI_LEFTARROWFOCUS;
3131
m_szRightArrow = UI_RIGHTARROW;
3232
m_szRightArrowFocus = UI_RIGHTARROWFOCUS;
33+
m_szDisplay[0] = 0;
3334

3435
eTextAlignment = QM_CENTER;
3536
eFocusAnimation = QM_HIGHLIGHTIFFOCUS;
3637
iFlags |= QMF_DROPSHADOW;
37-
3838
}
3939

4040
/*

controls/Table.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ CMenuTable::CMenuTable() : BaseClass(),
2626
bFramedHintText( false ),
2727
bAllowSorting( false ),
2828
bShowScrollBar( true ),
29-
szHeaderTexts(),
3029
szBackground(),
3130
szUpArrow( UI_UPARROW ), szUpArrowFocus( UI_UPARROWFOCUS ), szUpArrowPressed( UI_UPARROWPRESSED ),
3231
szDownArrow( UI_DOWNARROW ), szDownArrowFocus( UI_DOWNARROWFOCUS ), szDownArrowPressed( UI_DOWNARROWPRESSED ),
@@ -37,6 +36,7 @@ CMenuTable::CMenuTable() : BaseClass(),
3736
m_iSortingColumn( -1 ),
3837
m_pModel( NULL )
3938
{
39+
memset( szHeaderTexts, 0, sizeof(szHeaderTexts) );
4040
eFocusAnimation = QM_HIGHLIGHTIFFOCUS;
4141
SetCharSize( QM_SMALLFONT );
4242
bDrawStroke = true;

font/BaseFontBackend.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ GNU General Public License for more details.
1818
#include "Utils.h"
1919

2020
CBaseFont::CBaseFont()
21-
: m_szName( ), m_iTall(), m_iWeight(), m_iFlags(),
21+
: m_iTall(), m_iWeight(), m_iFlags(),
2222
m_iHeight(), m_iMaxCharWidth(), m_iAscent(),
2323
m_iBlur(), m_fBrighten(),
2424
m_iEllipsisWide( 0 ),
2525
m_glyphs(0, 0)
2626
{
27+
m_szName[0] = 0;
2728
SetDefLessFunc( m_glyphs );
2829
}
2930

menus/ConnectionWarning.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void CMenuConnectionWarning::_Init()
6868
options.szName = L( "Adv. Options" );
6969
SET_EVENT_MULTI( options.onReleased,
7070
{
71-
CMenuConnectionWarning *p = pSelf->Parent<CMenuConnectionWarning>();
71+
CMenuConnectionWarning *p = (CMenuConnectionWarning*)pSelf->Parent();
7272
UI_GameOptions_Menu();
7373
p->done.SetGrayed( false );
7474
});

menus/GameOptions.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ void CMenuGameOptions::_Init( void )
215215
normal.szName = L( "Normal internet connection" ); // Такая строка где-то уже была, поэтому в отдельный файл НЕ ВЫНОШУ !
216216
SET_EVENT_MULTI( normal.onChanged,
217217
{
218-
pSelf->Parent<CMenuGameOptions>()->SetNetworkMode( 1400, 0, 30, 60, 25000 );
218+
((CMenuGameOptions*)pSelf->Parent())->SetNetworkMode( 1400, 0, 30, 60, 25000 );
219219
((CMenuCheckBox*)pSelf)->bChecked = true;
220220
});
221221

222222
dsl.SetRect( 240, 560, 24, 24 );
223223
dsl.szName = L( "DSL or PPTP with limited packet size" ); // И такое тоже уже было !
224224
SET_EVENT_MULTI( dsl.onChanged,
225225
{
226-
pSelf->Parent<CMenuGameOptions>()->SetNetworkMode( 1200, 1000, 30, 60, 25000 );
226+
((CMenuGameOptions*)pSelf->Parent())->SetNetworkMode( 1200, 1000, 30, 60, 25000 );
227227
((CMenuCheckBox*)pSelf)->bChecked = true;
228228
});
229229

@@ -232,7 +232,7 @@ void CMenuGameOptions::_Init( void )
232232
slowest.szName = L( "Slow connection mode (64kbps)" ); // Было, повтор !
233233
SET_EVENT_MULTI( slowest.onChanged,
234234
{
235-
pSelf->Parent<CMenuGameOptions>()->SetNetworkMode( 900, 700, 25, 30, 7500 );
235+
((CMenuGameOptions*)pSelf->Parent())->SetNetworkMode( 900, 700, 25, 30, 7500 );
236236
((CMenuCheckBox*)pSelf)->bChecked = true;
237237
});
238238
compress.SetNameAndStatus( L( "Compress" ), L( "Compress splitted packets (need split to work)" ) );

menus/InputDevices.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void CMenuInputDevices::_Init( void )
9595
"Are you sure to disable mouse?" ) );
9696
SET_EVENT_MULTI( msgbox.onNegative,
9797
{
98-
pSelf->Parent<CMenuInputDevices>()->mouse.bChecked = false;
98+
((CMenuInputDevices*)pSelf->Parent())->mouse.bChecked = false;
9999
});
100100

101101
msgbox.Show();

menus/Multiplayer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ void CMenuMultiplayer::_Init( void )
8282
EngFuncs::CvarSetValue( "cl_predict", 1.0f );
8383
EngFuncs::CvarSetValue( "menu_mp_firsttime", 0.0f );
8484

85-
UI_PlayerIntroduceDialog_Show( pSelf->Parent<CMenuBaseWindow>() );
85+
UI_PlayerIntroduceDialog_Show( (CMenuBaseWindow*)pSelf->Parent() );
8686
});
8787
SET_EVENT_MULTI( msgBox.onNegative,
8888
{
8989
EngFuncs::CvarSetValue( "menu_mp_firsttime", 0.0f );
9090

91-
UI_PlayerIntroduceDialog_Show( pSelf->Parent<CMenuBaseWindow>() );
91+
UI_PlayerIntroduceDialog_Show( (CMenuBaseWindow*)pSelf->Parent() );
9292
});
9393
msgBox.Link( this );
9494

menus/VideoModes.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,14 @@ void CMenuVidModes::_Init( void )
311311
windowed.SetCoord( 360, 620 );
312312
SET_EVENT_MULTI( windowed.onChanged,
313313
{
314-
CMenuVidModes *parent = pSelf->Parent<CMenuVidModes>();
314+
CMenuVidModes *parent = (CMenuVidModes*)pSelf->Parent();
315315
if( !parent->windowed.bChecked && parent->vidList.GetCurrentIndex() < VID_AUTOMODE_POS )
316316
parent->vidList.SetCurrentIndex( VID_AUTOMODE_POS );
317317
});
318318

319319
SET_EVENT_MULTI( vidList.onChanged,
320320
{
321-
CMenuVidModes *parent = pSelf->Parent<CMenuVidModes>();
321+
CMenuVidModes *parent = (CMenuVidModes*)pSelf->Parent();
322322
if( !parent->windowed.bChecked && parent->vidList.GetCurrentIndex() < VID_AUTOMODE_POS )
323323
parent->vidList.SetCurrentIndex( VID_AUTOMODE_POS );
324324
});

wscript

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def configure(conf):
7171
conf.define('NO_STL', 1)
7272
conf.env.append_unique('CXXFLAGS', '-fno-exceptions')
7373

74-
if conf.env.DEST_OS != 'win32':
74+
if conf.env.DEST_OS != 'win32' and conf.env.DEST_OS != 'dos':
7575
if not conf.env.USE_STBTT and not conf.options.LOW_MEMORY:
7676
conf.check_pkg('freetype2', 'FT2', FT2_CHECK)
7777
conf.check_pkg('fontconfig', 'FC', FC_CHECK)

0 commit comments

Comments
 (0)