02 Apr 2011
This commit is contained in:
parent
3f821c16f9
commit
40e25d5589
|
@ -1,3 +1,9 @@
|
||||||
|
build 1516
|
||||||
|
|
||||||
|
Engine: fix Sys_Error blowout
|
||||||
|
GameUI: implement new credits effect in Half-Life (when game is end)
|
||||||
|
GameUI: use system cursor instead of emulated
|
||||||
|
|
||||||
build 1515
|
build 1515
|
||||||
|
|
||||||
Engine: fix some bugs
|
Engine: fix some bugs
|
||||||
|
|
|
@ -772,12 +772,6 @@ CL_ClearState
|
||||||
*/
|
*/
|
||||||
void CL_ClearState( void )
|
void CL_ClearState( void )
|
||||||
{
|
{
|
||||||
if( !cls.changelevel )
|
|
||||||
{
|
|
||||||
// continue playing if we are changing level
|
|
||||||
S_StopBackgroundTrack ();
|
|
||||||
}
|
|
||||||
|
|
||||||
S_StopAllSounds ();
|
S_StopAllSounds ();
|
||||||
CL_ClearEffects ();
|
CL_ClearEffects ();
|
||||||
CL_FreeEdicts ();
|
CL_FreeEdicts ();
|
||||||
|
@ -842,6 +836,7 @@ void CL_Disconnect( void )
|
||||||
CL_SendDisconnectMessage();
|
CL_SendDisconnectMessage();
|
||||||
CL_ClearState ();
|
CL_ClearState ();
|
||||||
|
|
||||||
|
S_StopBackgroundTrack ();
|
||||||
SCR_EndLoadingPlaque (); // get rid of loading plaque
|
SCR_EndLoadingPlaque (); // get rid of loading plaque
|
||||||
|
|
||||||
// clear the network channel, too.
|
// clear the network channel, too.
|
||||||
|
@ -1468,6 +1463,9 @@ void CL_Escape_f( void )
|
||||||
if( cls.key_dest == key_menu )
|
if( cls.key_dest == key_menu )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// the final credits is running
|
||||||
|
if( UI_CreditsActive( )) return;
|
||||||
|
|
||||||
if( cls.state == ca_cinematic )
|
if( cls.state == ca_cinematic )
|
||||||
SCR_StopCinematic();
|
SCR_StopCinematic();
|
||||||
else UI_SetActiveMenu( true );
|
else UI_SetActiveMenu( true );
|
||||||
|
@ -1665,14 +1663,11 @@ void CL_Init( void )
|
||||||
CL_InitLocal();
|
CL_InitLocal();
|
||||||
|
|
||||||
R_Init(); // init renderer
|
R_Init(); // init renderer
|
||||||
|
S_Init(); // init sound
|
||||||
|
|
||||||
if( !CL_LoadProgs( va( "%s/client.dll", GI->dll_path )))
|
if( !CL_LoadProgs( va( "%s/client.dll", GI->dll_path )))
|
||||||
Host_Error( "can't initialize client.dll\n" );
|
Host_Error( "can't initialize client.dll\n" );
|
||||||
|
|
||||||
// NOTE: hlfx has nasty hack with SetWindowHook which do mouse lag
|
|
||||||
// we must initialize sound after loading client.dll to avoid it
|
|
||||||
S_Init(); // init sound
|
|
||||||
|
|
||||||
cls.initialized = true;
|
cls.initialized = true;
|
||||||
cl.maxclients = 1; // allow to drawing player in menu
|
cl.maxclients = 1; // allow to drawing player in menu
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "gl_local.h"
|
#include "gl_local.h"
|
||||||
#include "library.h"
|
#include "library.h"
|
||||||
|
#include "input.h"
|
||||||
|
|
||||||
static MENUAPI GetMenuAPI;
|
static MENUAPI GetMenuAPI;
|
||||||
|
|
||||||
|
@ -941,6 +942,8 @@ static ui_enginefuncs_t gEngfuncs =
|
||||||
pfnHostEndGame,
|
pfnHostEndGame,
|
||||||
Com_RandomFloat,
|
Com_RandomFloat,
|
||||||
Com_RandomLong,
|
Com_RandomLong,
|
||||||
|
IN_SetCursor,
|
||||||
|
pfnIsMapValid,
|
||||||
};
|
};
|
||||||
|
|
||||||
void UI_UnloadProgs( void )
|
void UI_UnloadProgs( void )
|
||||||
|
|
|
@ -608,6 +608,12 @@ void CL_ParseServerData( sizebuf_t *msg )
|
||||||
cl.background = BF_ReadOneBit( msg );
|
cl.background = BF_ReadOneBit( msg );
|
||||||
Q_strncpy( gamefolder, BF_ReadString( msg ), MAX_STRING );
|
Q_strncpy( gamefolder, BF_ReadString( msg ), MAX_STRING );
|
||||||
|
|
||||||
|
if( !cls.changelevel )
|
||||||
|
{
|
||||||
|
// continue playing if we are changing level
|
||||||
|
S_StopBackgroundTrack ();
|
||||||
|
}
|
||||||
|
|
||||||
if( !CL_ChangeGame( gamefolder, false ))
|
if( !CL_ChangeGame( gamefolder, false ))
|
||||||
{
|
{
|
||||||
clgame.dllFuncs.pfnVidInit();
|
clgame.dllFuncs.pfnVidInit();
|
||||||
|
@ -1180,6 +1186,15 @@ void CL_ParseUserMessage( sizebuf_t *msg, int svc_num )
|
||||||
if( clgame.msg[i].func )
|
if( clgame.msg[i].func )
|
||||||
{
|
{
|
||||||
clgame.msg[i].func( clgame.msg[i].name, iSize, pbuf );
|
clgame.msg[i].func( clgame.msg[i].name, iSize, pbuf );
|
||||||
|
|
||||||
|
// HACKHACK: run final credits for Half-Life
|
||||||
|
// because hl1 doesn't have call END_SECTION
|
||||||
|
if( !Q_stricmp( clgame.msg[i].name, "HudText" ) && !Q_stricmp( GI->gamefolder, "valve" ))
|
||||||
|
{
|
||||||
|
// it's a end, so we should run credits
|
||||||
|
if( !Q_strcmp( (char *)pbuf, "END3" ))
|
||||||
|
Host_Credits();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2356,7 +2356,7 @@ static int R_StudioDrawPlayer( int flags, entity_state_t *pplayer )
|
||||||
if( RI.currentmodel == NULL )
|
if( RI.currentmodel == NULL )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
m_pStudioHeader = (studiohdr_t *)Mod_Extradata( RI.currentmodel );
|
R_StudioSetHeader((studiohdr_t *)Mod_Extradata( RI.currentmodel ));
|
||||||
|
|
||||||
if( pplayer->gaitsequence )
|
if( pplayer->gaitsequence )
|
||||||
{
|
{
|
||||||
|
@ -2520,7 +2520,7 @@ static int R_StudioDrawModel( int flags )
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pStudioHeader = (studiohdr_t *)Mod_Extradata( RI.currentmodel );
|
R_StudioSetHeader((studiohdr_t *)Mod_Extradata( RI.currentmodel ));
|
||||||
|
|
||||||
R_StudioSetUpTransform( RI.currententity );
|
R_StudioSetUpTransform( RI.currententity );
|
||||||
|
|
||||||
|
|
|
@ -565,6 +565,7 @@ void pfnDelCommand( const char *cmd_name );
|
||||||
void *Cache_Check( byte *mempool, struct cache_user_s *c );
|
void *Cache_Check( byte *mempool, struct cache_user_s *c );
|
||||||
edict_t* pfnPEntityOfEntIndex( int iEntIndex );
|
edict_t* pfnPEntityOfEntIndex( int iEntIndex );
|
||||||
void pfnGetGameDir( char *szGetGameDir );
|
void pfnGetGameDir( char *szGetGameDir );
|
||||||
|
int pfnIsMapValid( char *filename );
|
||||||
char *pfnCmd_Args( void );
|
char *pfnCmd_Args( void );
|
||||||
char *pfnCmd_Argv( int argc );
|
char *pfnCmd_Argv( int argc );
|
||||||
void Con_DPrintf( char *fmt, ... );
|
void Con_DPrintf( char *fmt, ... );
|
||||||
|
@ -665,6 +666,7 @@ int R_CreateDecalList( decallist_t *pList, qboolean changelevel );
|
||||||
struct cl_entity_s *CL_GetEntityByIndex( int index );
|
struct cl_entity_s *CL_GetEntityByIndex( int index );
|
||||||
struct cl_entity_s *CL_GetLocalPlayer( void );
|
struct cl_entity_s *CL_GetLocalPlayer( void );
|
||||||
struct player_info_s *CL_GetPlayerInfo( int playerIndex );
|
struct player_info_s *CL_GetPlayerInfo( int playerIndex );
|
||||||
|
qboolean UI_CreditsActive( void );
|
||||||
void CL_ExtraUpdate( void );
|
void CL_ExtraUpdate( void );
|
||||||
int CL_GetMaxClients( void );
|
int CL_GetMaxClients( void );
|
||||||
qboolean CL_IsPlaybackDemo( void );
|
qboolean CL_IsPlaybackDemo( void );
|
||||||
|
|
|
@ -213,6 +213,8 @@ void Con_ToggleConsole_f( void )
|
||||||
{
|
{
|
||||||
if( !host.developer ) return; // disabled
|
if( !host.developer ) return; // disabled
|
||||||
|
|
||||||
|
if( UI_CreditsActive( )) return; // diabled by final credits
|
||||||
|
|
||||||
// show console only in game or by special call from menu
|
// show console only in game or by special call from menu
|
||||||
if( cls.state != ca_active || cls.key_dest == key_menu )
|
if( cls.state != ca_active || cls.key_dest == key_menu )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -11,14 +11,12 @@
|
||||||
#define WND_HEADSIZE wnd_caption // some offset
|
#define WND_HEADSIZE wnd_caption // some offset
|
||||||
#define WND_BORDER 3 // sentinel border in pixels
|
#define WND_BORDER 3 // sentinel border in pixels
|
||||||
|
|
||||||
|
HICON in_mousecursor;
|
||||||
qboolean in_mouseactive; // false when not focus app
|
qboolean in_mouseactive; // false when not focus app
|
||||||
qboolean in_restore_spi;
|
qboolean in_restore_spi;
|
||||||
qboolean in_mouseinitialized;
|
qboolean in_mouseinitialized;
|
||||||
int in_originalmouseparms[3];
|
|
||||||
int in_mouse_oldbuttonstate;
|
int in_mouse_oldbuttonstate;
|
||||||
int in_newmouseparms[3] = { 0, 0, 1 };
|
|
||||||
qboolean in_mouse_suspended;
|
qboolean in_mouse_suspended;
|
||||||
qboolean in_mouseparmsvalid;
|
|
||||||
int in_mouse_buttons;
|
int in_mouse_buttons;
|
||||||
RECT window_rect, real_rect;
|
RECT window_rect, real_rect;
|
||||||
uint in_mouse_wheel;
|
uint in_mouse_wheel;
|
||||||
|
@ -112,7 +110,6 @@ void IN_StartupMouse( void )
|
||||||
if( Sys_CheckParm( "-nomouse" )) return;
|
if( Sys_CheckParm( "-nomouse" )) return;
|
||||||
|
|
||||||
in_mouse_buttons = 8;
|
in_mouse_buttons = 8;
|
||||||
in_mouseparmsvalid = SystemParametersInfo( SPI_GETMOUSE, 0, in_originalmouseparms, 0 );
|
|
||||||
in_mouseinitialized = true;
|
in_mouseinitialized = true;
|
||||||
in_mouse_wheel = RegisterWindowMessage( "MSWHEEL_ROLLMSG" );
|
in_mouse_wheel = RegisterWindowMessage( "MSWHEEL_ROLLMSG" );
|
||||||
}
|
}
|
||||||
|
@ -138,6 +135,22 @@ static qboolean IN_CursorInRect( void )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void IN_ActivateCursor( void )
|
||||||
|
{
|
||||||
|
if( cls.key_dest == key_menu )
|
||||||
|
{
|
||||||
|
while( ShowCursor( true ) < 0 );
|
||||||
|
SetCursor( in_mousecursor );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void IN_SetCursor( HICON hCursor )
|
||||||
|
{
|
||||||
|
in_mousecursor = hCursor;
|
||||||
|
|
||||||
|
IN_ActivateCursor();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===========
|
===========
|
||||||
IN_ToggleClientMouse
|
IN_ToggleClientMouse
|
||||||
|
@ -157,6 +170,14 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
|
||||||
{
|
{
|
||||||
clgame.dllFuncs.IN_ActivateMouse();
|
clgame.dllFuncs.IN_ActivateMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( newstate == key_menu )
|
||||||
|
{
|
||||||
|
in_mouseactive = false;
|
||||||
|
ClipCursor( NULL );
|
||||||
|
ReleaseCapture();
|
||||||
|
while( ShowCursor( true ) < 0 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -170,8 +191,6 @@ void IN_ActivateMouse( qboolean force )
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
static int oldstate;
|
static int oldstate;
|
||||||
POINT global_pos;
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
if( !in_mouseinitialized )
|
if( !in_mouseinitialized )
|
||||||
return;
|
return;
|
||||||
|
@ -189,18 +208,10 @@ void IN_ActivateMouse( qboolean force )
|
||||||
{
|
{
|
||||||
if( in_mouse_suspended )
|
if( in_mouse_suspended )
|
||||||
{
|
{
|
||||||
UI_GetCursorPos( &global_pos.x, &global_pos.y );
|
|
||||||
|
|
||||||
ClipCursor( NULL );
|
ClipCursor( NULL );
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
while( ShowCursor( true ) < 0 );
|
while( ShowCursor( true ) < 0 );
|
||||||
UI_ShowCursor( false );
|
UI_ShowCursor( false );
|
||||||
|
|
||||||
x = real_rect.left + global_pos.x;
|
|
||||||
y = real_rect.top + global_pos.y + WND_HEADSIZE;
|
|
||||||
|
|
||||||
// set system cursor position
|
|
||||||
SetCursorPos( x, y );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,15 +219,8 @@ void IN_ActivateMouse( qboolean force )
|
||||||
|
|
||||||
if( in_mouse_suspended && IN_CursorInRect( ))
|
if( in_mouse_suspended && IN_CursorInRect( ))
|
||||||
{
|
{
|
||||||
GetCursorPos( &global_pos );
|
|
||||||
in_mouse_suspended = false;
|
in_mouse_suspended = false;
|
||||||
in_mouseactive = false; // re-initialize mouse
|
in_mouseactive = false; // re-initialize mouse
|
||||||
|
|
||||||
x = global_pos.x - real_rect.left;
|
|
||||||
y = global_pos.y - real_rect.top - WND_HEADSIZE;
|
|
||||||
|
|
||||||
// set menu cursor position
|
|
||||||
UI_SetCursorPos( x, y );
|
|
||||||
UI_ShowCursor( true );
|
UI_ShowCursor( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,14 +228,12 @@ void IN_ActivateMouse( qboolean force )
|
||||||
if( in_mouseactive ) return;
|
if( in_mouseactive ) return;
|
||||||
in_mouseactive = true;
|
in_mouseactive = true;
|
||||||
|
|
||||||
|
if( UI_IsVisible( )) return;
|
||||||
|
|
||||||
if( cls.key_dest == key_game )
|
if( cls.key_dest == key_game )
|
||||||
{
|
{
|
||||||
clgame.dllFuncs.IN_ActivateMouse();
|
clgame.dllFuncs.IN_ActivateMouse();
|
||||||
}
|
}
|
||||||
else if( in_mouseparmsvalid )
|
|
||||||
{
|
|
||||||
in_restore_spi = SystemParametersInfo( SPI_SETMOUSE, 0, in_newmouseparms, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
width = GetSystemMetrics( SM_CXSCREEN );
|
width = GetSystemMetrics( SM_CXSCREEN );
|
||||||
height = GetSystemMetrics( SM_CYSCREEN );
|
height = GetSystemMetrics( SM_CYSCREEN );
|
||||||
|
@ -267,10 +269,6 @@ void IN_DeactivateMouse( void )
|
||||||
{
|
{
|
||||||
clgame.dllFuncs.IN_DeactivateMouse();
|
clgame.dllFuncs.IN_DeactivateMouse();
|
||||||
}
|
}
|
||||||
else if( in_restore_spi )
|
|
||||||
{
|
|
||||||
SystemParametersInfo( SPI_SETMOUSE, 0, in_originalmouseparms, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
in_mouseactive = false;
|
in_mouseactive = false;
|
||||||
ClipCursor( NULL );
|
ClipCursor( NULL );
|
||||||
|
@ -286,23 +284,18 @@ IN_Mouse
|
||||||
void IN_MouseMove( void )
|
void IN_MouseMove( void )
|
||||||
{
|
{
|
||||||
POINT current_pos;
|
POINT current_pos;
|
||||||
int mx, my;
|
|
||||||
|
|
||||||
if( !in_mouseinitialized || !in_mouseactive || in_mouse_suspended || cls.key_dest == key_game )
|
if( !in_mouseinitialized || !in_mouseactive || !UI_IsVisible( ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// find mouse movement
|
// find mouse movement
|
||||||
GetCursorPos( ¤t_pos );
|
GetCursorPos( ¤t_pos );
|
||||||
|
ScreenToClient( host.hWnd, ¤t_pos );
|
||||||
// force the mouse to the center, so there's room to move
|
|
||||||
SetCursorPos( host.window_center_x, host.window_center_y );
|
|
||||||
mx = current_pos.x - host.window_center_x;
|
|
||||||
my = current_pos.y - host.window_center_y;
|
|
||||||
|
|
||||||
if(( !mx && !my ) || !UI_IsVisible( )) return;
|
|
||||||
|
|
||||||
// if the menu is visible, move the menu cursor
|
// if the menu is visible, move the menu cursor
|
||||||
UI_MouseMove( mx, my );
|
UI_MouseMove( current_pos.x, current_pos.y );
|
||||||
|
|
||||||
|
IN_ActivateCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -409,8 +402,8 @@ void Host_InputFrame( void )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cl.refdef.paused && cls.key_dest == key_game )
|
if(( cl.refdef.paused && cls.key_dest == key_game ) || cls.key_dest == key_console )
|
||||||
shutdownMouse = true; // release mouse during pause
|
shutdownMouse = true; // release mouse during pause or console typeing
|
||||||
|
|
||||||
if( shutdownMouse && !Cvar_VariableInteger( "fullscreen" ))
|
if( shutdownMouse && !Cvar_VariableInteger( "fullscreen" ))
|
||||||
{
|
{
|
||||||
|
@ -445,6 +438,9 @@ long IN_WndProc( void *hWnd, uint uMsg, uint wParam, long lParam )
|
||||||
if( Cvar_VariableInteger( "fullscreen" ))
|
if( Cvar_VariableInteger( "fullscreen" ))
|
||||||
ShowWindow( host.hWnd, SW_SHOWMINNOACTIVE );
|
ShowWindow( host.hWnd, SW_SHOWMINNOACTIVE );
|
||||||
break;
|
break;
|
||||||
|
case WM_SETCURSOR:
|
||||||
|
IN_ActivateCursor();
|
||||||
|
break;
|
||||||
case WM_MOUSEWHEEL:
|
case WM_MOUSEWHEEL:
|
||||||
if( !in_mouseactive ) break;
|
if( !in_mouseactive ) break;
|
||||||
if(( short )HIWORD( wParam ) > 0 )
|
if(( short )HIWORD( wParam ) > 0 )
|
||||||
|
|
|
@ -40,6 +40,7 @@ void IN_ActivateMouse( qboolean force );
|
||||||
void IN_DeactivateMouse( void );
|
void IN_DeactivateMouse( void );
|
||||||
void IN_ToggleClientMouse( int newstate, int oldstate );
|
void IN_ToggleClientMouse( int newstate, int oldstate );
|
||||||
long IN_WndProc( void *hWnd, uint uMsg, uint wParam, long lParam );
|
long IN_WndProc( void *hWnd, uint uMsg, uint wParam, long lParam );
|
||||||
|
void IN_SetCursor( HICON hCursor );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,7 +407,10 @@ void Sys_Error( const char *error, ... )
|
||||||
SV_SysError( text );
|
SV_SysError( text );
|
||||||
|
|
||||||
if( host.type == HOST_NORMAL )
|
if( host.type == HOST_NORMAL )
|
||||||
CL_Shutdown(); // kill video
|
{
|
||||||
|
if( host.hWnd ) ShowWindow( host.hWnd, SW_HIDE );
|
||||||
|
VID_RestoreGamma();
|
||||||
|
}
|
||||||
|
|
||||||
if( host.developer > 0 )
|
if( host.developer > 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -144,6 +144,9 @@ typedef struct ui_enginefuncs_s
|
||||||
// new functions starts here
|
// new functions starts here
|
||||||
float (*pfnRandomFloat)( float flLow, float flHigh );
|
float (*pfnRandomFloat)( float flLow, float flHigh );
|
||||||
long (*pfnRandomLong)( long lLow, long lHigh );
|
long (*pfnRandomLong)( long lLow, long lHigh );
|
||||||
|
|
||||||
|
void (*pfnSetCursor)( void *hCursor ); // change cursor
|
||||||
|
int (*pfnIsMapValid)( char *filename );
|
||||||
} ui_enginefuncs_t;
|
} ui_enginefuncs_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -1503,6 +1503,8 @@ void SV_Pause_f( sv_client_t *cl )
|
||||||
{
|
{
|
||||||
string message;
|
string message;
|
||||||
|
|
||||||
|
if( UI_CreditsActive( )) return;
|
||||||
|
|
||||||
if( !sv_pausable->integer )
|
if( !sv_pausable->integer )
|
||||||
{
|
{
|
||||||
SV_ClientPrintf( cl, PRINT_HIGH, "Pause not allowed.\n" );
|
SV_ClientPrintf( cl, PRINT_HIGH, "Pause not allowed.\n" );
|
||||||
|
|
|
@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
// ui_menu.c -- main menu interface
|
// ui_menu.c -- main menu interface
|
||||||
|
#define OEMRESOURCE // for OCR_* cursor junk
|
||||||
|
|
||||||
#include "extdll.h"
|
#include "extdll.h"
|
||||||
#include "basemenu.h"
|
#include "basemenu.h"
|
||||||
|
@ -31,7 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "ui_title_anim.h"
|
#include "ui_title_anim.h"
|
||||||
|
|
||||||
cvar_t *ui_precache;
|
cvar_t *ui_precache;
|
||||||
cvar_t *ui_sensitivity;
|
|
||||||
|
|
||||||
uiStatic_t uiStatic;
|
uiStatic_t uiStatic;
|
||||||
|
|
||||||
|
@ -280,13 +280,10 @@ UI_DrawMouseCursor
|
||||||
void UI_DrawMouseCursor( void )
|
void UI_DrawMouseCursor( void )
|
||||||
{
|
{
|
||||||
menuCommon_s *item;
|
menuCommon_s *item;
|
||||||
HIMAGE hCursor = -1;
|
HICON hCursor = NULL;
|
||||||
int w = UI_CURSOR_SIZE;
|
|
||||||
int h = UI_CURSOR_SIZE;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if( uiStatic.hideCursor ) return;
|
if( uiStatic.hideCursor ) return;
|
||||||
UI_ScaleCoords( NULL, NULL, &w, &h );
|
|
||||||
|
|
||||||
for( i = 0; i < uiStatic.menuActive->numItems; i++ )
|
for( i = 0; i < uiStatic.menuActive->numItems; i++ )
|
||||||
{
|
{
|
||||||
|
@ -298,17 +295,21 @@ void UI_DrawMouseCursor( void )
|
||||||
if ( !UI_CursorInRect( item->x, item->y, item->width, item->height ))
|
if ( !UI_CursorInRect( item->x, item->y, item->width, item->height ))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( !(item->flags & QMF_GRAYED) && item->type == QMTYPE_FIELD )
|
if ( item->flags & QMF_GRAYED )
|
||||||
{
|
{
|
||||||
hCursor = PIC_Load( UI_CURSOR_TYPING, typing_tga, sizeof( typing_tga ));
|
hCursor = (HICON)LoadCursor( NULL, (LPCTSTR)OCR_NO );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( item->type == QMTYPE_FIELD )
|
||||||
|
hCursor = (HICON)LoadCursor( NULL, (LPCTSTR)OCR_IBEAM );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( hCursor == -1 ) hCursor = PIC_Load( UI_CURSOR_NORMAL, cursor_tga, sizeof( cursor_tga ));
|
if( !hCursor ) hCursor = (HICON)LoadCursor( NULL, (LPCTSTR)OCR_NORMAL );
|
||||||
|
|
||||||
PIC_Set( hCursor, 255, 255, 255 );
|
SET_CURSOR( hCursor );
|
||||||
PIC_DrawTrans( uiStatic.cursorX, uiStatic.cursorY, w, h );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -873,6 +874,8 @@ void UI_UpdateMenu( float flTime )
|
||||||
if( !uiStatic.initialized )
|
if( !uiStatic.initialized )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
UI_DrawFinalCredits ();
|
||||||
|
|
||||||
if( !uiStatic.visible )
|
if( !uiStatic.visible )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -901,7 +904,6 @@ void UI_UpdateMenu( float flTime )
|
||||||
|
|
||||||
if( uiStatic.firstDraw )
|
if( uiStatic.firstDraw )
|
||||||
{
|
{
|
||||||
UI_MouseMove( 0, 0 );
|
|
||||||
uiStatic.firstDraw = false;
|
uiStatic.firstDraw = false;
|
||||||
static int first = TRUE;
|
static int first = TRUE;
|
||||||
|
|
||||||
|
@ -1011,11 +1013,9 @@ void UI_MouseMove( int x, int y )
|
||||||
if( !uiStatic.menuActive )
|
if( !uiStatic.menuActive )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
x *= ui_sensitivity->value;
|
// now menu uses absolute coordinates
|
||||||
y *= ui_sensitivity->value;
|
uiStatic.cursorX = x;
|
||||||
|
uiStatic.cursorY = y;
|
||||||
uiStatic.cursorX += x;
|
|
||||||
uiStatic.cursorY += y;
|
|
||||||
|
|
||||||
if( UI_CursorInRect( 1, 1, ScreenWidth - 1, ScreenHeight - 1 ))
|
if( UI_CursorInRect( 1, 1, ScreenWidth - 1, ScreenHeight - 1 ))
|
||||||
uiStatic.mouseInRect = true;
|
uiStatic.mouseInRect = true;
|
||||||
|
@ -1152,8 +1152,8 @@ void UI_GetCursorPos( int *pos_x, int *pos_y )
|
||||||
|
|
||||||
void UI_SetCursorPos( int pos_x, int pos_y )
|
void UI_SetCursorPos( int pos_x, int pos_y )
|
||||||
{
|
{
|
||||||
uiStatic.cursorX = bound( 0, pos_x, ScreenWidth );
|
// uiStatic.cursorX = bound( 0, pos_x, ScreenWidth );
|
||||||
uiStatic.cursorY = bound( 0, pos_y, ScreenHeight );
|
// uiStatic.cursorY = bound( 0, pos_y, ScreenHeight );
|
||||||
uiStatic.mouseInRect = true;
|
uiStatic.mouseInRect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1378,7 +1378,6 @@ void UI_Init( void )
|
||||||
{
|
{
|
||||||
// register our cvars and commands
|
// register our cvars and commands
|
||||||
ui_precache = CVAR_REGISTER( "ui_precache", "0", FCVAR_ARCHIVE );
|
ui_precache = CVAR_REGISTER( "ui_precache", "0", FCVAR_ARCHIVE );
|
||||||
ui_sensitivity = CVAR_REGISTER( "ui_sensitivity", "1", FCVAR_ARCHIVE );
|
|
||||||
|
|
||||||
Cmd_AddCommand( "menu_main", UI_Main_Menu );
|
Cmd_AddCommand( "menu_main", UI_Main_Menu );
|
||||||
Cmd_AddCommand( "menu_newgame", UI_NewGame_Menu );
|
Cmd_AddCommand( "menu_newgame", UI_NewGame_Menu );
|
||||||
|
|
|
@ -390,6 +390,7 @@ const char *UI_DefaultKey( menuFramework_s *menu, int key, int down );
|
||||||
const char *UI_ActivateItem( menuFramework_s *menu, menuCommon_s *item );
|
const char *UI_ActivateItem( menuFramework_s *menu, menuCommon_s *item );
|
||||||
void UI_RefreshServerList( void );
|
void UI_RefreshServerList( void );
|
||||||
int UI_CreditsActive( void );
|
int UI_CreditsActive( void );
|
||||||
|
void UI_DrawFinalCredits( void );
|
||||||
|
|
||||||
void UI_CloseMenu( void );
|
void UI_CloseMenu( void );
|
||||||
void UI_PushMenu( menuFramework_s *menu );
|
void UI_PushMenu( menuFramework_s *menu );
|
||||||
|
|
|
@ -71,6 +71,7 @@ inline HIMAGE PIC_Load( const char *szPicName, const byte *ucRawImage, long ulRa
|
||||||
#define KEY_GetOverstrike (*g_engfuncs.pfnKeyGetOverstrikeMode)
|
#define KEY_GetOverstrike (*g_engfuncs.pfnKeyGetOverstrikeMode)
|
||||||
#define KEY_SetOverstrike (*g_engfuncs.pfnKeySetOverstrikeMode)
|
#define KEY_SetOverstrike (*g_engfuncs.pfnKeySetOverstrikeMode)
|
||||||
#define Key_GetState (*g_engfuncs.pfnKeyGetState)
|
#define Key_GetState (*g_engfuncs.pfnKeyGetState)
|
||||||
|
#define SET_CURSOR (*g_engfuncs.pfnSetCursor)
|
||||||
|
|
||||||
#define Cmd_AddCommand (*g_engfuncs.pfnAddCommand)
|
#define Cmd_AddCommand (*g_engfuncs.pfnAddCommand)
|
||||||
#define Cmd_RemoveCommand (*g_engfuncs.pfnDelCommand)
|
#define Cmd_RemoveCommand (*g_engfuncs.pfnDelCommand)
|
||||||
|
@ -87,6 +88,7 @@ inline HIMAGE PIC_Load( const char *szPicName, const byte *ucRawImage, long ulRa
|
||||||
#define HOST_ENDGAME (*g_engfuncs.pfnHostEndGame)
|
#define HOST_ENDGAME (*g_engfuncs.pfnHostEndGame)
|
||||||
#define GET_CLIPBOARD (*g_engfuncs.pfnGetClipboardData)
|
#define GET_CLIPBOARD (*g_engfuncs.pfnGetClipboardData)
|
||||||
#define FS_SEARCH (*g_engfuncs.pfnGetFilesList)
|
#define FS_SEARCH (*g_engfuncs.pfnGetFilesList)
|
||||||
|
#define MAP_IS_VALID (*g_engfuncs.pfnIsMapValid)
|
||||||
|
|
||||||
#define GET_SAVE_COMMENT (*g_engfuncs.pfnGetSaveComment)
|
#define GET_SAVE_COMMENT (*g_engfuncs.pfnGetSaveComment)
|
||||||
#define GET_DEMO_COMMENT (*g_engfuncs.pfnGetDemoComment)
|
#define GET_DEMO_COMMENT (*g_engfuncs.pfnGetDemoComment)
|
||||||
|
|
138
mainui/images.h
138
mainui/images.h
|
@ -5,144 +5,6 @@
|
||||||
|
|
||||||
#ifndef IMAGES_H
|
#ifndef IMAGES_H
|
||||||
#define IMAGES_H
|
#define IMAGES_H
|
||||||
|
|
||||||
const byte cursor_tga[] =
|
|
||||||
{
|
|
||||||
0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
|
|
||||||
0x00,0x20,0x00,0x20,0x08,0x00,0x0e,0x0a,0x00,0x0d,0x9e,0xff,0xff,
|
|
||||||
0xff,0x00,0x00,0x0e,0x0a,0x00,0x0d,0x9e,0xff,0xff,0xff,0x00,0x00,
|
|
||||||
0x0e,0x0a,0x00,0x0d,0x9e,0xff,0xff,0xff,0x00,0x00,0x0e,0x0a,0x00,
|
|
||||||
0x0d,0x9e,0xff,0xff,0xff,0x00,0x00,0x0e,0x0a,0x00,0x0d,0x9e,0xff,
|
|
||||||
0xff,0xff,0x00,0x00,0x0e,0x0a,0x00,0x0d,0x9e,0xff,0xff,0xff,0x00,
|
|
||||||
0x00,0x0e,0x0a,0x00,0x0d,0x9e,0xff,0xff,0xff,0x00,0x00,0x0e,0x0a,
|
|
||||||
0x00,0x0d,0x9e,0xff,0xff,0xff,0x00,0x00,0x0e,0x0a,0x00,0x0d,0x81,
|
|
||||||
0xff,0xff,0xff,0x00,0x84,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
|
|
||||||
0x06,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x94,0xff,0xff,0xff,
|
|
||||||
0x00,0x00,0x0e,0x0a,0x00,0x0d,0x81,0xff,0xff,0xff,0x00,0x84,0x00,
|
|
||||||
0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x6e,0x00,0x00,0x00,0xb2,0x00,
|
|
||||||
0x00,0x00,0x55,0x94,0xff,0xff,0xff,0x00,0x00,0x0e,0x0a,0x00,0x0d,
|
|
||||||
0x81,0xff,0xff,0xff,0x00,0x83,0x00,0x00,0x00,0x00,0x06,0x00,0x00,
|
|
||||||
0x00,0x1d,0x28,0x28,0x28,0xf3,0x45,0x45,0x45,0xff,0x00,0x00,0x00,
|
|
||||||
0xee,0x00,0x00,0x00,0xe2,0x00,0x00,0x00,0x96,0x00,0x00,0x00,0x02,
|
|
||||||
0x91,0xff,0xff,0xff,0x00,0x00,0x0e,0x0a,0x00,0x0d,0x81,0xff,0xff,
|
|
||||||
0xff,0x00,0x81,0x00,0x00,0x00,0x00,0x81,0xff,0xff,0xff,0x00,0x05,
|
|
||||||
0x00,0x00,0x00,0x6b,0xad,0xad,0xad,0xff,0xff,0xff,0xff,0xff,0xa8,
|
|
||||||
0xa8,0xa8,0xff,0x03,0x03,0x03,0xfc,0x00,0x00,0x00,0x3b,0x92,0xff,
|
|
||||||
0xff,0xff,0x00,0x00,0x0e,0x0a,0x00,0x0d,0x81,0xff,0xff,0xff,0x00,
|
|
||||||
0x81,0x00,0x00,0x00,0x00,0x06,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
|
|
||||||
0x13,0x34,0x34,0x34,0xee,0xfa,0xfa,0xfa,0xff,0xff,0xff,0xff,0xff,
|
|
||||||
0x8b,0x8b,0x8b,0xff,0x00,0x00,0x00,0xb4,0x93,0xff,0xff,0xff,0x00,
|
|
||||||
0x02,0x0e,0x0a,0x00,0x0d,0x00,0x00,0x00,0x17,0x00,0x00,0x00,0x03,
|
|
||||||
0x81,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x05,0x00,0x00,0x00,
|
|
||||||
0xb0,0xb4,0xb4,0xb4,0xff,0xff,0xff,0xff,0xff,0xeb,0xeb,0xeb,0xff,
|
|
||||||
0x16,0x16,0x16,0xfb,0x00,0x00,0x00,0x3a,0x93,0xff,0xff,0xff,0x00,
|
|
||||||
0x0a,0x0e,0x0a,0x00,0x0d,0x00,0x00,0x00,0xa9,0x00,0x00,0x00,0x6a,
|
|
||||||
0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5a,0x35,
|
|
||||||
0x35,0x35,0xfa,0xfd,0xfd,0xfd,0xff,0xff,0xff,0xff,0xff,0x88,0x88,
|
|
||||||
0x88,0xff,0x00,0x00,0x00,0xb6,0x85,0xff,0xff,0xff,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x8d,0xff,0xff,0xff,0x00,0x0a,0x0e,0x0a,0x00,0x0d,
|
|
||||||
0x07,0x07,0x07,0xf4,0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x76,0x00,
|
|
||||||
0x00,0x00,0x06,0x00,0x00,0x00,0xcf,0xb1,0xb1,0xb1,0xff,0xff,0xff,
|
|
||||||
0xff,0xff,0xf0,0xf0,0xf0,0xff,0x1c,0x1c,0x1c,0xfc,0x00,0x00,0x00,
|
|
||||||
0x3b,0x85,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x01,0x8d,0xff,
|
|
||||||
0xff,0xff,0x00,0x09,0x0e,0x0a,0x00,0x0d,0x52,0x52,0x52,0xee,0x80,
|
|
||||||
0x80,0x80,0xff,0x00,0x00,0x00,0xe9,0x00,0x00,0x00,0x9e,0x38,0x38,
|
|
||||||
0x38,0xf9,0xfd,0xfd,0xfd,0xff,0xff,0xff,0xff,0xff,0x8d,0x8d,0x8d,
|
|
||||||
0xff,0x00,0x00,0x00,0xb6,0x85,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x0a,0x8e,0xff,0xff,0xff,0x00,0x09,0x0e,0x0a,0x00,0x0d,0x54,
|
|
||||||
0x54,0x54,0xed,0xff,0xff,0xff,0xff,0x87,0x87,0x87,0xff,0x03,0x03,
|
|
||||||
0x03,0xff,0xaf,0xaf,0xaf,0xff,0xff,0xff,0xff,0xff,0xf4,0xf4,0xf4,
|
|
||||||
0xff,0x20,0x20,0x20,0xfc,0x00,0x00,0x00,0xa9,0x95,0xff,0xff,0xff,
|
|
||||||
0x00,0x01,0x0e,0x0a,0x00,0x0d,0x51,0x51,0x51,0xed,0x81,0xff,0xff,
|
|
||||||
0xff,0xff,0x05,0xc3,0xc3,0xc3,0xff,0xf8,0xf8,0xf8,0xff,0xff,0xff,
|
|
||||||
0xff,0xff,0x8b,0x8b,0x8b,0xff,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,
|
|
||||||
0xe9,0x81,0x00,0x00,0x00,0xea,0x02,0x00,0x00,0x00,0xe8,0x00,0x00,
|
|
||||||
0x00,0xde,0x00,0x00,0x00,0x2a,0x90,0xff,0xff,0xff,0x00,0x01,0x0e,
|
|
||||||
0x0a,0x00,0x0d,0x51,0x51,0x51,0xed,0x84,0xff,0xff,0xff,0xff,0x00,
|
|
||||||
0xc0,0xc0,0xc0,0xff,0x81,0xaa,0xaa,0xaa,0xff,0x03,0xad,0xad,0xad,
|
|
||||||
0xff,0x96,0x96,0x96,0xff,0x0e,0x0e,0x0e,0xf9,0x00,0x00,0x00,0x35,
|
|
||||||
0x91,0xff,0xff,0xff,0x00,0x01,0x0e,0x0a,0x00,0x0d,0x51,0x51,0x51,
|
|
||||||
0xed,0x88,0xff,0xff,0xff,0xff,0x01,0x4f,0x4f,0x4f,0xf9,0x00,0x00,
|
|
||||||
0x00,0x3d,0x92,0xff,0xff,0xff,0x00,0x01,0x0e,0x0a,0x00,0x0d,0x51,
|
|
||||||
0x51,0x51,0xed,0x86,0xff,0xff,0xff,0xff,0x02,0xf1,0xf1,0xf1,0xff,
|
|
||||||
0x43,0x43,0x43,0xfc,0x00,0x00,0x00,0x44,0x93,0xff,0xff,0xff,0x00,
|
|
||||||
0x01,0x0e,0x0a,0x00,0x0d,0x51,0x51,0x51,0xed,0x85,0xff,0xff,0xff,
|
|
||||||
0xff,0x02,0xf5,0xf5,0xf5,0xff,0x40,0x40,0x40,0xff,0x00,0x00,0x00,
|
|
||||||
0x4b,0x94,0xff,0xff,0xff,0x00,0x01,0x0e,0x0a,0x00,0x0d,0x51,0x51,
|
|
||||||
0x51,0xed,0x84,0xff,0xff,0xff,0xff,0x02,0xf9,0xf9,0xf9,0xff,0x50,
|
|
||||||
0x50,0x50,0xff,0x00,0x00,0x00,0x57,0x95,0xff,0xff,0xff,0x00,0x01,
|
|
||||||
0x0e,0x0a,0x00,0x0d,0x51,0x51,0x51,0xed,0x83,0xff,0xff,0xff,0xff,
|
|
||||||
0x02,0xf7,0xf7,0xf7,0xff,0x4f,0x4f,0x4f,0xff,0x00,0x00,0x00,0x5e,
|
|
||||||
0x96,0xff,0xff,0xff,0x00,0x01,0x0e,0x0a,0x00,0x0d,0x51,0x51,0x51,
|
|
||||||
0xed,0x82,0xff,0xff,0xff,0xff,0x02,0xfb,0xfb,0xfb,0xff,0x4f,0x4f,
|
|
||||||
0x4f,0xff,0x00,0x00,0x00,0x68,0x97,0xff,0xff,0xff,0x00,0x01,0x0e,
|
|
||||||
0x0a,0x00,0x0d,0x51,0x51,0x51,0xed,0x81,0xff,0xff,0xff,0xff,0x02,
|
|
||||||
0xfd,0xfd,0xfd,0xff,0x5d,0x5d,0x5d,0xff,0x00,0x00,0x00,0x74,0x87,
|
|
||||||
0xff,0xff,0xff,0x00,0x82,0x00,0x00,0x00,0x00,0x8d,0xff,0xff,0xff,
|
|
||||||
0x00,0x05,0x0e,0x0a,0x00,0x0d,0x51,0x51,0x51,0xed,0xff,0xff,0xff,
|
|
||||||
0xff,0xfc,0xfc,0xfc,0xff,0x5a,0x5a,0x5a,0xff,0x00,0x00,0x00,0x7d,
|
|
||||||
0x86,0xff,0xff,0xff,0x00,0x84,0x00,0x00,0x00,0x00,0x8d,0xff,0xff,
|
|
||||||
0xff,0x00,0x05,0x0e,0x0a,0x00,0x0d,0x56,0x56,0x56,0xed,0xff,0xff,
|
|
||||||
0xff,0xff,0x61,0x61,0x61,0xff,0x00,0x00,0x00,0x71,0x00,0x00,0x00,
|
|
||||||
0x02,0x83,0xff,0xff,0xff,0x00,0x87,0x00,0x00,0x00,0x00,0x8d,0xff,
|
|
||||||
0xff,0xff,0x00,0x06,0x0e,0x0a,0x00,0x0d,0x53,0x53,0x53,0xef,0x75,
|
|
||||||
0x75,0x75,0xff,0x00,0x00,0x00,0x97,0x00,0x00,0x00,0x02,0x00,0x00,
|
|
||||||
0x00,0x0e,0xff,0xff,0xff,0x00,0x8a,0x00,0x00,0x00,0x00,0x8d,0xff,
|
|
||||||
0xff,0xff,0x00,0x03,0x0e,0x0a,0x00,0x0d,0x06,0x06,0x06,0xfc,0x00,
|
|
||||||
0x00,0x00,0x9b,0x00,0x00,0x00,0x01,0x9b,0xff,0xff,0xff,0x00,0x02,
|
|
||||||
0x0e,0x0a,0x00,0x0d,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x05,0x8e,
|
|
||||||
0x00,0x00,0x00,0x00,0x8d,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x54,0x52,0x55,0x45,0x56,0x49,0x53,0x49,0x4f,
|
|
||||||
0x4e,0x2d,0x58,0x46,0x49,0x4c,0x45,0x2e,0x00,0x00
|
|
||||||
};
|
|
||||||
|
|
||||||
const byte typing_tga[] =
|
|
||||||
{
|
|
||||||
0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
|
|
||||||
0x00,0x20,0x00,0x20,0x08,0x9f,0xff,0xff,0xff,0x00,0x9f,0xff,0xff,
|
|
||||||
0xff,0x00,0x9f,0xff,0xff,0xff,0x00,0x9f,0xff,0xff,0xff,0x00,0x9f,
|
|
||||||
0xff,0xff,0xff,0x00,0x9f,0xff,0xff,0xff,0x00,0x9f,0xff,0xff,0xff,
|
|
||||||
0x00,0x9f,0xff,0xff,0xff,0x00,0x9f,0xff,0xff,0xff,0x00,0x9f,0xff,
|
|
||||||
0xff,0xff,0x00,0x9f,0xff,0xff,0xff,0x00,0x9f,0xff,0xff,0xff,0x00,
|
|
||||||
0x9f,0xff,0xff,0xff,0x00,0x9f,0xff,0xff,0xff,0x00,0x9f,0xff,0xff,
|
|
||||||
0xff,0x00,0x00,0xff,0xff,0xff,0x00,0x88,0x54,0x54,0x54,0xff,0x95,
|
|
||||||
0xff,0xff,0xff,0x00,0x02,0xff,0xff,0xff,0x00,0x54,0x54,0x54,0xff,
|
|
||||||
0xde,0xde,0xde,0xff,0x85,0xdf,0xdf,0xdf,0xff,0x00,0x54,0x54,0x54,
|
|
||||||
0xff,0x95,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0x00,0x83,0x54,
|
|
||||||
0x54,0x54,0xff,0x00,0xdf,0xdf,0xdf,0xff,0x83,0x54,0x54,0x54,0xff,
|
|
||||||
0x95,0xff,0xff,0xff,0x00,0x81,0xff,0xff,0xff,0x00,0x81,0x00,0x00,
|
|
||||||
0x00,0x00,0x02,0x54,0x54,0x54,0xff,0xdf,0xdf,0xdf,0xff,0x54,0x54,
|
|
||||||
0x54,0xff,0x98,0xff,0xff,0xff,0x00,0x81,0xff,0xff,0xff,0x00,0x81,
|
|
||||||
0x00,0x00,0x00,0x00,0x02,0x54,0x54,0x54,0xff,0xde,0xde,0xde,0xff,
|
|
||||||
0x54,0x54,0x54,0xff,0x98,0xff,0xff,0xff,0x00,0x81,0xff,0xff,0xff,
|
|
||||||
0x00,0x81,0x00,0x00,0x00,0x00,0x02,0x54,0x54,0x54,0xff,0xdf,0xdf,
|
|
||||||
0xdf,0xff,0x54,0x54,0x54,0xff,0x98,0xff,0xff,0xff,0x00,0x81,0xff,
|
|
||||||
0xff,0xff,0x00,0x81,0x00,0x00,0x00,0x00,0x02,0x54,0x54,0x54,0xff,
|
|
||||||
0xde,0xde,0xde,0xff,0x54,0x54,0x54,0xff,0x98,0xff,0xff,0xff,0x00,
|
|
||||||
0x81,0xff,0xff,0xff,0x00,0x81,0x00,0x00,0x00,0x00,0x02,0x54,0x54,
|
|
||||||
0x54,0xff,0xdf,0xdf,0xdf,0xff,0x54,0x54,0x54,0xff,0x98,0xff,0xff,
|
|
||||||
0xff,0x00,0x81,0xff,0xff,0xff,0x00,0x81,0x00,0x00,0x00,0x00,0x02,
|
|
||||||
0x54,0x54,0x54,0xff,0xde,0xde,0xde,0xff,0x54,0x54,0x54,0xff,0x98,
|
|
||||||
0xff,0xff,0xff,0x00,0x81,0xff,0xff,0xff,0x00,0x81,0x00,0x00,0x00,
|
|
||||||
0x00,0x02,0x54,0x54,0x54,0xff,0xdf,0xdf,0xdf,0xff,0x54,0x54,0x54,
|
|
||||||
0xff,0x98,0xff,0xff,0xff,0x00,0x81,0xff,0xff,0xff,0x00,0x81,0x00,
|
|
||||||
0x00,0x00,0x00,0x02,0x54,0x54,0x54,0xff,0xdf,0xdf,0xdf,0xff,0x54,
|
|
||||||
0x54,0x54,0xff,0x98,0xff,0xff,0xff,0x00,0x81,0xff,0xff,0xff,0x00,
|
|
||||||
0x81,0x00,0x00,0x00,0x00,0x02,0x54,0x54,0x54,0xff,0xdf,0xdf,0xdf,
|
|
||||||
0xff,0x54,0x54,0x54,0xff,0x98,0xff,0xff,0xff,0x00,0x81,0xff,0xff,
|
|
||||||
0xff,0x00,0x81,0x00,0x00,0x00,0x00,0x02,0x54,0x54,0x54,0xff,0xdf,
|
|
||||||
0xdf,0xdf,0xff,0x54,0x54,0x54,0xff,0x98,0xff,0xff,0xff,0x00,0x81,
|
|
||||||
0xff,0xff,0xff,0x00,0x81,0x00,0x00,0x00,0x00,0x02,0x54,0x54,0x54,
|
|
||||||
0xff,0xdf,0xdf,0xdf,0xff,0x54,0x54,0x54,0xff,0x98,0xff,0xff,0xff,
|
|
||||||
0x00,0x00,0xff,0xff,0xff,0x00,0x83,0x54,0x54,0x54,0xff,0x00,0xde,
|
|
||||||
0xde,0xde,0xff,0x83,0x54,0x54,0x54,0xff,0x95,0xff,0xff,0xff,0x00,
|
|
||||||
0x04,0xff,0xff,0xff,0x00,0x54,0x54,0x54,0xff,0xde,0xde,0xde,0xff,
|
|
||||||
0xdf,0xdf,0xdf,0xff,0xde,0xde,0xde,0xff,0x83,0xdf,0xdf,0xdf,0xff,
|
|
||||||
0x00,0x54,0x54,0x54,0xff,0x95,0xff,0xff,0xff,0x00,0x00,0xff,0xff,
|
|
||||||
0xff,0x00,0x88,0x54,0x54,0x54,0xff,0x95,0xff,0xff,0xff,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0x52,0x55,0x45,0x56,0x49,
|
|
||||||
0x53,0x49,0x4f,0x4e,0x2d,0x58,0x46,0x49,0x4c,0x45,0x2e,0x00,0x00
|
|
||||||
};
|
|
||||||
|
|
||||||
const byte font_tga[] =
|
const byte font_tga[] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,7 +54,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /opt:nowin98
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /opt:nowin98
|
||||||
# ADD LINK32 msvcrt.lib /nologo /dll /pdb:none /machine:I386 /nodefaultlib:"libc.lib" /def:".\mainui.def" /out:"..\temp\mainui\!release/menu.dll" /opt:nowin98
|
# ADD LINK32 msvcrt.lib user32.lib /nologo /dll /pdb:none /machine:I386 /nodefaultlib:"libc.lib" /def:".\mainui.def" /out:"..\temp\mainui\!release/menu.dll" /opt:nowin98
|
||||||
# SUBTRACT LINK32 /profile /nodefaultlib
|
# SUBTRACT LINK32 /profile /nodefaultlib
|
||||||
# Begin Custom Build
|
# Begin Custom Build
|
||||||
TargetDir=\Xash3D\src_main\temp\mainui\!release
|
TargetDir=\Xash3D\src_main\temp\mainui\!release
|
||||||
|
@ -91,7 +91,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /def:".\mainui.def" /pdbtype:sept
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /def:".\mainui.def" /pdbtype:sept
|
||||||
# ADD LINK32 msvcrtd.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /def:".\mainui.def" /out:"..\temp\mainui\!debug/menu.dll" /pdbtype:sept
|
# ADD LINK32 msvcrtd.lib user32.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /def:".\mainui.def" /out:"..\temp\mainui\!debug/menu.dll" /pdbtype:sept
|
||||||
# SUBTRACT LINK32 /incremental:no /nodefaultlib
|
# SUBTRACT LINK32 /incremental:no /nodefaultlib
|
||||||
# Begin Custom Build
|
# Begin Custom Build
|
||||||
TargetDir=\Xash3D\src_main\temp\mainui\!debug
|
TargetDir=\Xash3D\src_main\temp\mainui\!debug
|
||||||
|
|
|
@ -150,7 +150,7 @@ void UI_LoadBmpButtons( void )
|
||||||
int CuttedBmpSize = sizeof( bmphdr_t ) + pInfoHdr->biSize + pallete_sz + cutted_img_sz;
|
int CuttedBmpSize = sizeof( bmphdr_t ) + pInfoHdr->biSize + pallete_sz + cutted_img_sz;
|
||||||
byte *img_data = &bmp_buffer[bmp_len_holder-cutted_img_sz];
|
byte *img_data = &bmp_buffer[bmp_len_holder-cutted_img_sz];
|
||||||
|
|
||||||
if (pInfoHdr->biBitCount==8)
|
if ( pInfoHdr->biBitCount == 8 )
|
||||||
{
|
{
|
||||||
byte*pallete=&bmp_buffer[sizeof( bmphdr_t ) + pInfoHdr->biSize];
|
byte*pallete=&bmp_buffer[sizeof( bmphdr_t ) + pInfoHdr->biSize];
|
||||||
byte*firstpixel_col=&pallete[img_data[0]*4];
|
byte*firstpixel_col=&pallete[img_data[0]*4];
|
||||||
|
@ -165,7 +165,7 @@ void UI_LoadBmpButtons( void )
|
||||||
byte *raw_img_buff = (byte *)MALLOC( sizeof( bmphdr_t ) + pInfoHdr->biSize + pallete_sz + cutted_img_sz );
|
byte *raw_img_buff = (byte *)MALLOC( sizeof( bmphdr_t ) + pInfoHdr->biSize + pallete_sz + cutted_img_sz );
|
||||||
|
|
||||||
// determine buttons count by image height...
|
// determine buttons count by image height...
|
||||||
int pic_count = (pInfoHdr->biHeight == 5538) ? PC_BUTTONCOUNT : PC_BUTTONCOUNT - 2;
|
int pic_count = ( pInfoHdr->biHeight == 5538 ) ? PC_BUTTONCOUNT : PC_BUTTONCOUNT - 2;
|
||||||
|
|
||||||
for( int i = 0; i < pic_count; i++ )
|
for( int i = 0; i < pic_count; i++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,6 +86,9 @@ UI_CreateGame_Begin
|
||||||
*/
|
*/
|
||||||
static void UI_CreateGame_Begin( void )
|
static void UI_CreateGame_Begin( void )
|
||||||
{
|
{
|
||||||
|
if( !MAP_IS_VALID( uiCreateGame.mapName[uiCreateGame.mapsList.curItem] ))
|
||||||
|
return; // bad map
|
||||||
|
|
||||||
if( CVAR_GET_FLOAT( "host_serverstate" ))
|
if( CVAR_GET_FLOAT( "host_serverstate" ))
|
||||||
CLIENT_COMMAND( TRUE, "killserver\n" );
|
CLIENT_COMMAND( TRUE, "killserver\n" );
|
||||||
|
|
||||||
|
@ -465,6 +468,9 @@ UI_CreateGame_Menu
|
||||||
*/
|
*/
|
||||||
void UI_CreateGame_Menu( void )
|
void UI_CreateGame_Menu( void )
|
||||||
{
|
{
|
||||||
|
if ( gMenu.m_gameinfo.gamemode == GAME_SINGLEPLAYER_ONLY )
|
||||||
|
return;
|
||||||
|
|
||||||
UI_CreateGame_Precache();
|
UI_CreateGame_Precache();
|
||||||
UI_CreateGame_Init();
|
UI_CreateGame_Init();
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,7 @@ UI_Credits_DrawFunc
|
||||||
static void UI_Credits_DrawFunc( void )
|
static void UI_Credits_DrawFunc( void )
|
||||||
{
|
{
|
||||||
int i, y;
|
int i, y;
|
||||||
|
float speed = 40.0f;
|
||||||
int w = UI_MED_CHAR_WIDTH;
|
int w = UI_MED_CHAR_WIDTH;
|
||||||
int h = UI_MED_CHAR_HEIGHT;
|
int h = UI_MED_CHAR_HEIGHT;
|
||||||
int color = 0;
|
int color = 0;
|
||||||
|
@ -122,12 +123,14 @@ static void UI_Credits_DrawFunc( void )
|
||||||
// draw the background first
|
// draw the background first
|
||||||
if( !uiCredits.finalCredits && !CVAR_GET_FLOAT( "sv_background" ))
|
if( !uiCredits.finalCredits && !CVAR_GET_FLOAT( "sv_background" ))
|
||||||
UI_DrawPic( 0, 0, 1024 * uiStatic.scaleX, 768 * uiStatic.scaleY, uiColorWhite, ART_BACKGROUND );
|
UI_DrawPic( 0, 0, 1024 * uiStatic.scaleX, 768 * uiStatic.scaleY, uiColorWhite, ART_BACKGROUND );
|
||||||
|
else speed = 45.0f; // syncronize with final background track :-)
|
||||||
|
|
||||||
// otherwise running on cutscene
|
// otherwise running on cutscene
|
||||||
|
|
||||||
// now draw the credits
|
// now draw the credits
|
||||||
UI_ScaleCoords( NULL, NULL, &w, &h );
|
UI_ScaleCoords( NULL, NULL, &w, &h );
|
||||||
|
|
||||||
y = ScreenHeight - (( uiStatic.realTime - uiCredits.startTime ) / 40.0f );
|
y = ScreenHeight - (((gpGlobals->time * 1000) - uiCredits.startTime ) / speed );
|
||||||
|
|
||||||
// draw the credits
|
// draw the credits
|
||||||
for ( i = 0; i < uiCredits.numLines && uiCredits.credits[i]; i++, y += 20 )
|
for ( i = 0; i < uiCredits.numLines && uiCredits.credits[i]; i++, y += 20 )
|
||||||
|
@ -137,7 +140,7 @@ static void UI_Credits_DrawFunc( void )
|
||||||
|
|
||||||
if(( y < ( ScreenHeight - h ) / 2 ) && i == uiCredits.numLines - 1 )
|
if(( y < ( ScreenHeight - h ) / 2 ) && i == uiCredits.numLines - 1 )
|
||||||
{
|
{
|
||||||
if( !uiCredits.fadeTime ) uiCredits.fadeTime = uiStatic.realTime;
|
if( !uiCredits.fadeTime ) uiCredits.fadeTime = (gpGlobals->time * 1000);
|
||||||
color = UI_FadeAlpha( uiCredits.fadeTime, uiCredits.showTime );
|
color = UI_FadeAlpha( uiCredits.fadeTime, uiCredits.showTime );
|
||||||
if( UnpackAlpha( color ))
|
if( UnpackAlpha( color ))
|
||||||
UI_DrawString( 0, ( ScreenHeight - h ) / 2, 1024 * uiStatic.scaleX, h, uiCredits.credits[i], color, true, w, h, 1, true );
|
UI_DrawString( 0, ( ScreenHeight - h ) / 2, 1024 * uiStatic.scaleX, h, uiCredits.credits[i], color, true, w, h, 1, true );
|
||||||
|
@ -235,15 +238,21 @@ static void UI_Credits_Init( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
// run credits
|
// run credits
|
||||||
uiCredits.startTime = uiStatic.realTime + 500; // make half-seconds delay
|
uiCredits.startTime = (gpGlobals->time * 1000) + 500; // make half-seconds delay
|
||||||
uiCredits.showTime = bound( 100, strlen( uiCredits.credits[uiCredits.numLines - 1]) * 1000, 12000 );
|
uiCredits.showTime = bound( 1000, strlen( uiCredits.credits[uiCredits.numLines - 1]) * 1000, 10000 );
|
||||||
uiCredits.fadeTime = 0; // will be determined later
|
uiCredits.fadeTime = 0; // will be determined later
|
||||||
uiCredits.active = true;
|
uiCredits.active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UI_DrawFinalCredits( void )
|
||||||
|
{
|
||||||
|
if( uiCredits.finalCredits && uiCredits.active )
|
||||||
|
UI_Credits_DrawFunc ();
|
||||||
|
}
|
||||||
|
|
||||||
int UI_CreditsActive( void )
|
int UI_CreditsActive( void )
|
||||||
{
|
{
|
||||||
return uiCredits.active;
|
return uiCredits.active && uiCredits.finalCredits;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -271,6 +280,6 @@ void UI_Credits_Menu( void )
|
||||||
|
|
||||||
void UI_FinalCredits( void )
|
void UI_FinalCredits( void )
|
||||||
{
|
{
|
||||||
UI_Credits_Menu();
|
|
||||||
uiCredits.finalCredits = true;
|
uiCredits.finalCredits = true;
|
||||||
|
UI_Credits_Init();
|
||||||
}
|
}
|
|
@ -164,6 +164,9 @@ static void UI_LanGame_GetGamesList( void )
|
||||||
// calculate number of visible rows
|
// calculate number of visible rows
|
||||||
uiLanGame.gameList.numRows = (uiLanGame.gameList.generic.height2 / uiLanGame.gameList.generic.charHeight) - 2;
|
uiLanGame.gameList.numRows = (uiLanGame.gameList.generic.height2 / uiLanGame.gameList.generic.charHeight) - 2;
|
||||||
if( uiLanGame.gameList.numRows > uiLanGame.gameList.numItems ) uiLanGame.gameList.numRows = uiLanGame.gameList.numItems;
|
if( uiLanGame.gameList.numRows > uiLanGame.gameList.numItems ) uiLanGame.gameList.numRows = uiLanGame.gameList.numItems;
|
||||||
|
|
||||||
|
if( uiStatic.numServers )
|
||||||
|
uiLanGame.joinGame.generic.flags &= ~QMF_GRAYED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -299,7 +302,7 @@ static void UI_LanGame_Init( void )
|
||||||
|
|
||||||
uiLanGame.joinGame.generic.id = ID_JOINGAME;
|
uiLanGame.joinGame.generic.id = ID_JOINGAME;
|
||||||
uiLanGame.joinGame.generic.type = QMTYPE_BM_BUTTON;
|
uiLanGame.joinGame.generic.type = QMTYPE_BM_BUTTON;
|
||||||
uiLanGame.joinGame.generic.flags = QMF_HIGHLIGHTIFFOCUS|QMF_DROPSHADOW;
|
uiLanGame.joinGame.generic.flags = QMF_HIGHLIGHTIFFOCUS|QMF_DROPSHADOW|QMF_GRAYED;
|
||||||
uiLanGame.joinGame.generic.x = 72;
|
uiLanGame.joinGame.generic.x = 72;
|
||||||
uiLanGame.joinGame.generic.y = 230;
|
uiLanGame.joinGame.generic.y = 230;
|
||||||
uiLanGame.joinGame.generic.name = "Join game";
|
uiLanGame.joinGame.generic.name = "Join game";
|
||||||
|
@ -453,6 +456,9 @@ UI_LanGame_Menu
|
||||||
*/
|
*/
|
||||||
void UI_LanGame_Menu( void )
|
void UI_LanGame_Menu( void )
|
||||||
{
|
{
|
||||||
|
if ( gMenu.m_gameinfo.gamemode == GAME_SINGLEPLAYER_ONLY )
|
||||||
|
return;
|
||||||
|
|
||||||
UI_LanGame_Precache();
|
UI_LanGame_Precache();
|
||||||
UI_LanGame_Init();
|
UI_LanGame_Init();
|
||||||
|
|
||||||
|
|
|
@ -208,6 +208,9 @@ UI_MultiPlayer_Menu
|
||||||
*/
|
*/
|
||||||
void UI_MultiPlayer_Menu( void )
|
void UI_MultiPlayer_Menu( void )
|
||||||
{
|
{
|
||||||
|
if ( gMenu.m_gameinfo.gamemode == GAME_SINGLEPLAYER_ONLY )
|
||||||
|
return;
|
||||||
|
|
||||||
UI_MultiPlayer_Precache();
|
UI_MultiPlayer_Precache();
|
||||||
UI_MultiPlayer_Init();
|
UI_MultiPlayer_Init();
|
||||||
|
|
||||||
|
|
|
@ -476,6 +476,9 @@ UI_PlayerSetup_Menu
|
||||||
*/
|
*/
|
||||||
void UI_PlayerSetup_Menu( void )
|
void UI_PlayerSetup_Menu( void )
|
||||||
{
|
{
|
||||||
|
if ( gMenu.m_gameinfo.gamemode == GAME_SINGLEPLAYER_ONLY )
|
||||||
|
return;
|
||||||
|
|
||||||
UI_PlayerSetup_Precache();
|
UI_PlayerSetup_Precache();
|
||||||
UI_PlayerSetup_Init();
|
UI_PlayerSetup_Init();
|
||||||
|
|
||||||
|
|
Reference in New Issue