2017-04-30 21:19:10 +00:00
|
|
|
/*
|
2018-06-14 10:05:23 +00:00
|
|
|
Copyright 2016-2018 Marco "eukara" Hladik
|
|
|
|
|
|
|
|
MIT LICENSE
|
2017-04-30 21:19:10 +00:00
|
|
|
|
2018-06-14 10:05:23 +00:00
|
|
|
Permission is hereby granted, free of charge, to any person
|
|
|
|
obtaining a copy of this software and associated documentation
|
|
|
|
files (the "Software"), to deal in the Software without
|
|
|
|
restriction, including without limitation the rights to use,
|
|
|
|
copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
sell copies of the Software, and to permit persons to whom the
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
2017-04-30 21:19:10 +00:00
|
|
|
|
2018-06-14 10:05:23 +00:00
|
|
|
The above copyright notice and this permission notice shall be
|
|
|
|
included in all copies or substantial portions of the Software.
|
2017-04-30 21:19:10 +00:00
|
|
|
|
2018-06-14 10:05:23 +00:00
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
|
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
|
|
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
OTHER DEALINGS IN THE SOFTWARE.
|
2017-04-30 21:19:10 +00:00
|
|
|
*/
|
|
|
|
|
2017-05-01 11:55:50 +00:00
|
|
|
/*
|
|
|
|
=================
|
|
|
|
m_init
|
|
|
|
|
|
|
|
Precaches and loading for the menu system
|
|
|
|
=================
|
|
|
|
*/
|
2017-09-29 06:05:40 +00:00
|
|
|
void Menu_Configuration_Init( void );
|
2017-04-30 21:19:10 +00:00
|
|
|
void m_init( void ) {
|
2017-06-21 23:49:28 +00:00
|
|
|
precache_pic( "gfx/shell/splash" );
|
2017-08-30 14:54:27 +00:00
|
|
|
precache_pic( "gfx/shell/btns_main" );
|
2018-06-10 09:40:44 +00:00
|
|
|
precache_pic( "gfx/shell/cb_empty" );
|
|
|
|
precache_pic( "gfx/shell/cb_checked" );
|
2017-04-30 23:21:49 +00:00
|
|
|
|
2017-09-29 06:05:40 +00:00
|
|
|
Menu_Configuration_Init();
|
|
|
|
|
2017-04-30 23:21:49 +00:00
|
|
|
// Index all the maps... TODO: Filter out /valve/ to avoid useless junk from being cached.
|
|
|
|
searchhandle shMaps = search_begin( "maps/*.bsp", TRUE, TRUE );
|
|
|
|
iMapCount = search_getsize( shMaps );
|
|
|
|
sMapList = memalloc( sizeof( string ) * iMapCount );
|
|
|
|
|
|
|
|
for ( int i = 0; i < iMapCount; i++ ) {
|
|
|
|
sMapList[ i ] = substring( search_getfilename( shMaps, i ), 5, strlen( search_getfilename( shMaps, i ) ) - 9 );
|
|
|
|
}
|
|
|
|
|
|
|
|
search_end( shMaps );
|
2017-08-30 14:54:27 +00:00
|
|
|
|
|
|
|
vMenuButtonsSize = drawgetimagesize( "gfx/shell/btns_main" );
|
2017-11-16 02:25:20 +00:00
|
|
|
|
|
|
|
// For those peeps who don't read or don't want to follow the instructions
|
|
|
|
if ( whichpack( "sound/items/9mmclip1.wav" ) ) {
|
|
|
|
iHLContent = TRUE;
|
|
|
|
}
|
2017-12-19 21:02:01 +00:00
|
|
|
|
|
|
|
// Initialize all the spraylogos
|
|
|
|
searchhandle shSprays = search_begin( "logos/*.bmp", TRUE, TRUE );
|
|
|
|
sLogos = memalloc( sizeof( string ) * search_getsize( shSprays ) );
|
|
|
|
for ( int i = 0; i < search_getsize( shSprays ); i++ ) {
|
|
|
|
string sShadername;
|
|
|
|
string sShortname = search_getfilename( shSprays, i );
|
|
|
|
precache_pic( sShortname );
|
|
|
|
sShortname = substring( sShortname, 6, strlen( sShortname ) - 10 );
|
|
|
|
sLogos[ i ] = sShortname;
|
|
|
|
sShadername = sprintf( "spray_%s", sShortname );
|
|
|
|
if ( substring( sShortname, 0, 1 ) == "#" ) {
|
|
|
|
shaderforname( sShadername, sprintf("{\ncull disable\npolygonOffset\n{\nmap %s\n}\n}\n", search_getfilename( shSprays, i ) ) );
|
|
|
|
} else {
|
|
|
|
shaderforname( sShadername, sprintf("{\ncull disable\npolygonOffset\n{\nmap %s\nblendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR\n\nrgbgen vertex\n}\n}\n", search_getfilename( shSprays, i ) ) );
|
|
|
|
}
|
|
|
|
iLogos += 1;
|
|
|
|
}
|
|
|
|
search_end( shSprays );
|
2017-12-28 13:31:31 +00:00
|
|
|
|
2018-06-09 16:37:42 +00:00
|
|
|
drawfont = loadfont( "font", "", "12", -1 );
|
2017-04-30 21:19:10 +00:00
|
|
|
}
|
|
|
|
|
2017-05-01 11:55:50 +00:00
|
|
|
/*
|
|
|
|
=================
|
|
|
|
m_shutdown
|
|
|
|
|
|
|
|
I can see the curtain... the ending.
|
|
|
|
=================
|
|
|
|
*/
|
2017-04-30 21:19:10 +00:00
|
|
|
void m_shutdown( void ) {
|
|
|
|
|
|
|
|
}
|