mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-18 09:00:21 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
103debcf6b | ||
|
|
526ab8071c | ||
|
|
ac45f20fa6 | ||
|
|
a45b36f2f3 | ||
|
|
bea35d28fc | ||
|
|
bb71f84985 | ||
|
|
2f62e61dc8 | ||
|
|
dceceb976d | ||
|
|
59bf9fbd54 | ||
|
|
a1cd6f2746 | ||
|
|
76178064a0 | ||
|
|
31ac3f7096 | ||
|
|
545dc19811 | ||
|
|
5f598cf1f9 | ||
|
|
4e66f2482f | ||
|
|
f873fd447f | ||
|
|
a4123f65b3 |
No files matched your search
@@ -4801,7 +4801,7 @@ void ClientGameCommandManager::SpawnTempModel(int mcount, int timeAlive)
|
||||
|
||||
// Make sure to not spawn the world model as a tempmodel
|
||||
// Of course it would become extremely confusing...
|
||||
if (!(p->cgd.flags & T_DLIGHT) && p->ent.reType == ET_MODELANIM_SKEL && !p->ent.hModel)
|
||||
if (!(p->cgd.flags & T_DLIGHT) && p->ent.reType == RT_MODEL && !p->ent.hModel)
|
||||
{
|
||||
Com_Printf("^~^~^ not spawning tempmodel because it is using the world as a brush model\n");
|
||||
FreeTempModel(p);
|
||||
|
||||
@@ -273,7 +273,7 @@ enum class vsstypes_t : unsigned char {
|
||||
NUM_VSS_TYPES
|
||||
};
|
||||
|
||||
class cvssource_t : public Class
|
||||
class cvssource_t
|
||||
{
|
||||
public:
|
||||
cvssource_t* next;
|
||||
@@ -309,7 +309,7 @@ public:
|
||||
qboolean lastValid;
|
||||
};
|
||||
|
||||
class cvssourcestate_t : public Class
|
||||
class cvssourcestate_t
|
||||
{
|
||||
public:
|
||||
Vector origin;
|
||||
|
||||
@@ -145,18 +145,23 @@ void VSS_AddRepulsion(cvssource_t* pA, cvssource_t* pB)
|
||||
|
||||
cvssource_t* ClientGameCommandManager::AllocateVSSSource()
|
||||
{
|
||||
m_free_vsssources = m_free_vsssources;
|
||||
cvssource_t* pNew;
|
||||
|
||||
if (!m_free_vsssources) {
|
||||
FreeVSSSource(m_active_vsssources.prev);
|
||||
}
|
||||
|
||||
pNew = m_free_vsssources;
|
||||
m_free_vsssources = m_free_vsssources->next;
|
||||
memset(m_free_vsssources, 0, sizeof(cvssource_t));
|
||||
memset(pNew, 0, sizeof(cvssource_t));
|
||||
|
||||
m_free_vsssources->next = m_active_vsssources.next;
|
||||
m_free_vsssources->prev = &m_active_vsssources;
|
||||
pNew->next = m_active_vsssources.next;
|
||||
pNew->prev = &m_active_vsssources;
|
||||
|
||||
m_active_vsssources.next->prev = m_free_vsssources;
|
||||
m_active_vsssources.next = m_free_vsssources;
|
||||
m_active_vsssources.next->prev = pNew;
|
||||
m_active_vsssources.next = pNew;
|
||||
|
||||
return m_free_vsssources;
|
||||
return pNew;
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::FreeVSSSource(cvssource_t* p)
|
||||
@@ -201,7 +206,7 @@ void ClientGameCommandManager::ResetVSSSources()
|
||||
}
|
||||
|
||||
m_vsssources = (cvssource_t*)cgi.Malloc(sizeof(cvssource_t) * m_iAllocatedvsssources);
|
||||
memset(m_vsssources, 0, sizeof(sizeof(cvssource_t) * m_iAllocatedvsssources));
|
||||
memset(m_vsssources, 0, sizeof(cvssource_t) * m_iAllocatedvsssources);
|
||||
|
||||
m_active_vsssources.next = &m_active_vsssources;
|
||||
m_active_vsssources.prev = &m_active_vsssources;
|
||||
|
||||
@@ -934,7 +934,7 @@ void CL_WritePacket( void ) {
|
||||
clc.lastPacketSentTime = cls.realtime;
|
||||
|
||||
if ( cl_showSend->integer ) {
|
||||
Com_Printf( "%i ", buf.cursize );
|
||||
Com_Printf( "%zu ", buf.cursize );
|
||||
}
|
||||
|
||||
CL_Netchan_Transmit (&clc.netchan, &buf);
|
||||
|
||||
@@ -51,8 +51,8 @@ qboolean alt_down;
|
||||
qboolean ctrl_down;
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
int keynum;
|
||||
const char *name;
|
||||
int keynum;
|
||||
} keyname_t;
|
||||
|
||||
|
||||
@@ -466,7 +466,7 @@ void Key_SetCtrlBinding( int keynum, const char *binding ) {
|
||||
Key_GetBinding
|
||||
===================
|
||||
*/
|
||||
char *Key_GetBinding( int keynum ) {
|
||||
const char *Key_GetBinding( int keynum ) {
|
||||
if ( keynum < 0 || keynum >= K_LASTKEY ) {
|
||||
return "";
|
||||
}
|
||||
@@ -521,7 +521,7 @@ Key_GetKeysForCommand
|
||||
void Key_GetKeysForCommand( const char *command, int *key1, int *key2 ) {
|
||||
int i;
|
||||
|
||||
*key1 = *key2 = 0;
|
||||
*key1 = *key2 = -1;
|
||||
|
||||
for( i = 0; i < K_LASTKEY; i++ ) {
|
||||
if( !keys[ i ].binding ) {
|
||||
|
||||
@@ -1460,8 +1460,6 @@ void CL_Vid_Restart_f( void ) {
|
||||
UI_ResolutionChange();
|
||||
|
||||
cls.rendererRegistered = qfalse;
|
||||
cls.uiStarted = qfalse;
|
||||
cls.cgameStarted = qfalse;
|
||||
|
||||
// unpause so the cgame definately gets a snapshot and renders a frame
|
||||
Com_Unpause();
|
||||
@@ -3299,7 +3297,7 @@ CL_ServerInfoPacket
|
||||
void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
|
||||
int i, type;
|
||||
char info[MAX_INFO_STRING];
|
||||
char* str;
|
||||
const char* str;
|
||||
char *infoString;
|
||||
int prot;
|
||||
|
||||
@@ -3495,7 +3493,7 @@ CL_ServerStatusResponse
|
||||
===================
|
||||
*/
|
||||
void CL_ServerStatusResponse( netadr_t from, msg_t *msg ) {
|
||||
char *s;
|
||||
const char *s;
|
||||
char info[MAX_INFO_STRING];
|
||||
int i, l, score, ping;
|
||||
int len;
|
||||
@@ -3588,7 +3586,7 @@ CL_LocalServers_f
|
||||
==================
|
||||
*/
|
||||
void CL_LocalServers_f( void ) {
|
||||
char *message;
|
||||
const char *message;
|
||||
int i, j;
|
||||
netadr_t to;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "client.h"
|
||||
#include "cl_ui.h"
|
||||
|
||||
char *svc_strings[256] = {
|
||||
const char *svc_strings[256] = {
|
||||
"svc_bad",
|
||||
|
||||
"svc_nop",
|
||||
@@ -41,7 +41,7 @@ char *svc_strings[256] = {
|
||||
|
||||
msg_t *cl_currentMSG;
|
||||
|
||||
void SHOWNET( msg_t *msg, char *s) {
|
||||
void SHOWNET( msg_t *msg, const char *s) {
|
||||
if ( cl_shownet->integer >= 2) {
|
||||
Com_Printf ("%3i:%s\n", msg->readcount-1, s);
|
||||
}
|
||||
@@ -793,7 +793,7 @@ void CL_ParseServerMessage( msg_t *msg ) {
|
||||
int cmd;
|
||||
//Com_Printf( "ParseServerMessage: %i\n", msg->cursize );
|
||||
if ( cl_shownet->integer == 1 ) {
|
||||
Com_Printf ("%i ",msg->cursize);
|
||||
Com_Printf ("%zu ",msg->cursize);
|
||||
} else if ( cl_shownet->integer >= 2 ) {
|
||||
Com_Printf ("------------------\n");
|
||||
}
|
||||
|
||||
@@ -877,7 +877,7 @@ Key_GetBindingBuf
|
||||
====================
|
||||
*/
|
||||
static void Key_GetBindingBuf( int keynum, char *buf, int buflen ) {
|
||||
char *value;
|
||||
const char *value;
|
||||
|
||||
value = Key_GetBinding( keynum );
|
||||
if ( value ) {
|
||||
@@ -1119,7 +1119,7 @@ getNewConsole
|
||||
====================
|
||||
*/
|
||||
UIFloatingConsole* getNewConsole() {
|
||||
static constexpr char CONSOLE_NAME[] = PRODUCT_NAME_FULL " - " PRODUCT_VERSION_FULL;
|
||||
static constexpr char CONSOLE_NAME[] = PRODUCT_NAME " console version " PRODUCT_VERSION;
|
||||
|
||||
UIFloatingConsole* console = new UIFloatingConsole;
|
||||
console->Create(NULL, getDefaultConsoleRectangle(), CONSOLE_NAME, UWindowColor, UHudColor);
|
||||
@@ -3638,8 +3638,8 @@ void UI_WantsKeyboard() {
|
||||
}
|
||||
|
||||
struct widgettrans_s {
|
||||
char *src;
|
||||
char *dst;
|
||||
const char *src;
|
||||
const char *dst;
|
||||
};
|
||||
|
||||
static widgettrans_s s_widgettrans[ 2 ] =
|
||||
@@ -4885,7 +4885,7 @@ static void SaveConsoleRectangle( void ) {
|
||||
if( !fakk_console->IsMinimized() ) {
|
||||
r = fakk_console->getFrame();
|
||||
|
||||
Cvar_Set( "ui_consoleposition", va( "%d %d %d %d", r.pos.x, r.pos.y, r.size.width, r.size.height ) );
|
||||
Cvar_Set( "ui_consoleposition", va( "%d %d %d %d", (int)r.pos.x, (int)r.pos.y, (int)r.size.width, (int)r.size.height ) );
|
||||
|
||||
if( wasMinimized ) {
|
||||
fakk_console->ProcessEvent( UIFloatingWindow::W_MinimizePressed );
|
||||
@@ -5492,7 +5492,7 @@ qboolean UI_IsResourceLoaded( const char *name ) {
|
||||
case 104:
|
||||
return TIKI_FindTikiAnim( name + 1 ) != NULL;
|
||||
case 103:
|
||||
return SkeletorCacheFindFilename( name + 1, NULL ) != NULL;
|
||||
return SkeletorCacheFindFilename( name + 1, NULL );
|
||||
case 107:
|
||||
return S_IsSoundRegistered( name + 1 );
|
||||
case 110:
|
||||
|
||||
@@ -29,8 +29,8 @@ public:
|
||||
|
||||
SoundPickerClass();
|
||||
|
||||
void FileSelected( str ¤tDirectory, str &partialName, str &fullname );
|
||||
void FileChosen( str ¤tDirectory, str &partialName, str &fullname );
|
||||
void FileSelected( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
void FileChosen( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
};
|
||||
|
||||
#endif /* __CL_UISOUNDPICKER_H__ */
|
||||
@@ -519,7 +519,8 @@ void UIFakkLabel::DrawStatbar( float frac )
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -574,6 +575,8 @@ void UIFakkLabel::DrawStatbar( float frac )
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -603,6 +606,8 @@ void UIFakkLabel::DrawStatbar( float frac )
|
||||
1.0
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
void UpdateLocationPrint( int x, int y, const char *s, float alpha );
|
||||
qboolean LetterboxActive( void );
|
||||
void InitSubtitle( void );
|
||||
void FrameInitialized( void );
|
||||
void FrameInitialized( void ) override;
|
||||
virtual void Pressed( Event *ev );
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ extern int chat_playerNum;
|
||||
int Key_StringToKeynum( const char *str );
|
||||
void Key_WriteBindings( fileHandle_t f );
|
||||
void Key_SetBinding( int keynum, const char *binding );
|
||||
char *Key_GetBinding( int keynum );
|
||||
const char *Key_GetBinding( int keynum );
|
||||
qboolean Key_IsDown( int keynum );
|
||||
qboolean Key_GetOverstrikeMode( void );
|
||||
void Key_SetOverstrikeMode( qboolean state );
|
||||
|
||||
@@ -422,7 +422,7 @@ void State::ParseAndProcessCommand
|
||||
{
|
||||
int argc;
|
||||
const char *argv[ MAX_COMMANDS ];
|
||||
char args[ MAX_COMMANDS ][ MAXTOKEN ];
|
||||
char args[ MAX_COMMANDS ][ SCRIPT_MAXTOKEN ];
|
||||
Script script;
|
||||
Event *event;
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ typedef struct gameImport_s
|
||||
void ( *AddCommand )( const char *cmdName, xcommand_t cmdFunction );
|
||||
int ( *FS_ReadFile )( const char *qpath, void **buffer, qboolean quiet );
|
||||
void ( *FS_FreeFile )( void *buffer );
|
||||
size_t( *FS_WriteFile )( const char *qpath, const void *buffer, size_t size );
|
||||
int ( *FS_WriteFile )( const char *qpath, const void *buffer, int size );
|
||||
fileHandle_t ( *FS_FOpenFileWrite )( const char *fileName );
|
||||
fileHandle_t ( *FS_FOpenFileAppend )( const char *fileName );
|
||||
const char *( *FS_PrepFileWrite )( const char *fileName );
|
||||
|
||||
+39
-15
@@ -29,16 +29,36 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PRODUCT_NAME "OpenMoHAA"
|
||||
#define PRODUCT_VERSION_NUMBER "0.51"
|
||||
#define PRODUCT_VERSION_STAGE "alpha"
|
||||
#define PRODUCT_VERSION PRODUCT_VERSION_NUMBER "-" PRODUCT_VERSION_STAGE
|
||||
#define PRODUCT_DATE __DATE__
|
||||
#define PRODUCT_NAME "OpenMoHAA"
|
||||
|
||||
//
|
||||
// Version
|
||||
//
|
||||
// These values are the only one that must be set for the version
|
||||
#define PRODUCT_VERSION_MAJOR 0
|
||||
#define PRODUCT_VERSION_MINOR 52
|
||||
#define PRODUCT_VERSION_PATCH 0
|
||||
#define PRODUCT_VERSION_STAGE "alpha"
|
||||
|
||||
//
|
||||
// Version display
|
||||
//
|
||||
#define PRODUCT_VERSION_NUMBER_STRING XSTRING(PRODUCT_VERSION_MAJOR) "." XSTRING(PRODUCT_VERSION_MINOR) "." XSTRING(PRODUCT_VERSION_PATCH)
|
||||
#define PRODUCT_VERSION PRODUCT_VERSION_NUMBER_STRING "-" PRODUCT_VERSION_STAGE
|
||||
#define PRODUCT_DATE __DATE__
|
||||
|
||||
//
|
||||
// The target type specifies which content pack the engine targets.
|
||||
//
|
||||
// Note: An universal client is not currently possible without refactoring the network and the file system.
|
||||
// Pak files must be reloaded on-the-fly depending on the server the client is connecting to.
|
||||
//
|
||||
#if TARGET_GAME_TYPE == 1
|
||||
//
|
||||
// Team Assault
|
||||
//
|
||||
#define BASEGAME "mainta"
|
||||
#define PRODUCT_EXTENSION "Spearhead"
|
||||
#define PRODUCT_EXTENSION "spearhead"
|
||||
// The version string must be equal or above 2.0 to be able to connect to spearhead servers
|
||||
#define TARGET_GAME_VERSION "2.16"
|
||||
#define TARGET_GAME_PROTOCOL 17
|
||||
@@ -48,10 +68,12 @@ extern "C" {
|
||||
#define HOMEPATH_NAME_WIN "mohta"
|
||||
#define HOMEPATH_NAME_MACOSX HOMEPATH_NAME_WIN
|
||||
#elif TARGET_GAME_TYPE == 2
|
||||
//
|
||||
// Team Tactics
|
||||
//
|
||||
#define BASEGAME "maintt"
|
||||
#define PRODUCT_EXTENSION "Breakthrough"
|
||||
// The version string must be equal or above 2.0 to be able to connect to breakthrough servers
|
||||
#define PRODUCT_EXTENSION "breakthrough"
|
||||
// The version string must be equal or above 2.0 to be able to connect to breakthrough servers
|
||||
#define TARGET_GAME_VERSION "2.41"
|
||||
#define TARGET_GAME_PROTOCOL 17
|
||||
#define TARGET_GAME_NAME "mohaab"
|
||||
@@ -60,11 +82,13 @@ extern "C" {
|
||||
#define HOMEPATH_NAME_WIN "mohtt"
|
||||
#define HOMEPATH_NAME_MACOSX HOMEPATH_NAME_WIN
|
||||
#else
|
||||
// The default: the base game (no expansion)
|
||||
//
|
||||
// Base game
|
||||
//
|
||||
|
||||
#define BASEGAME "main"
|
||||
#define PRODUCT_EXTENSION "Base"
|
||||
// The version string must be below 1.12, otherwise it's not possible to connect
|
||||
#define PRODUCT_EXTENSION "base"
|
||||
// The version string must be 1.1x or below, otherwise it's not possible to connect
|
||||
#define TARGET_GAME_VERSION "1.12"
|
||||
#define TARGET_GAME_PROTOCOL 8
|
||||
#define TARGET_GAME_NAME "mohaa"
|
||||
@@ -74,11 +98,11 @@ extern "C" {
|
||||
#define HOMEPATH_NAME_MACOSX HOMEPATH_NAME_WIN
|
||||
#endif
|
||||
|
||||
#define PRODUCT_NAME_FULL PRODUCT_NAME ": " PRODUCT_EXTENSION
|
||||
#define PRODUCT_VERSION_FULL PRODUCT_VERSION " (for " TARGET_GAME_VERSION ")"
|
||||
#define PRODUCT_NAME_FULL PRODUCT_NAME " - v" PRODUCT_VERSION " - ext-" PRODUCT_EXTENSION
|
||||
#define PRODUCT_VERSION_FULL PRODUCT_NAME_FULL
|
||||
|
||||
#define CLIENT_WINDOW_TITLE "OpenMoHAA"
|
||||
#define CLIENT_WINDOW_MIN_TITLE "OpenMoHAA"
|
||||
#define CLIENT_WINDOW_TITLE PRODUCT_NAME
|
||||
#define CLIENT_WINDOW_MIN_TITLE PRODUCT_NAME
|
||||
|
||||
#define MAX_TEAMNAME 32
|
||||
|
||||
|
||||
@@ -582,7 +582,7 @@ const char* Script::GrabNextToken(qboolean crossline)
|
||||
*token_p++ = *script_p++;
|
||||
}
|
||||
|
||||
if (token_p == &token[MAXTOKEN]) {
|
||||
if (token_p == &token[SCRIPT_MAXTOKEN]) {
|
||||
FILE_Error(ERR_DROP, "Token too large on line %i in file %s\n",
|
||||
line, filename.c_str());
|
||||
}
|
||||
@@ -824,7 +824,7 @@ const char* Script::GetLine(qboolean crossline)
|
||||
start = script_p;
|
||||
SkipToEOL();
|
||||
size = script_p - start;
|
||||
if (size < (MAXTOKEN - 1)) {
|
||||
if (size < (SCRIPT_MAXTOKEN - 1)) {
|
||||
memcpy(token, start, size);
|
||||
token[size] = '\0';
|
||||
} else {
|
||||
@@ -859,7 +859,7 @@ const char* Script::GetRaw(void)
|
||||
start = script_p;
|
||||
SkipToEOL();
|
||||
size = script_p - start;
|
||||
if (size < (MAXTOKEN - 1)) {
|
||||
if (size < (SCRIPT_MAXTOKEN - 1)) {
|
||||
memset(token, 0, sizeof(token));
|
||||
memcpy(token, start, size);
|
||||
} else {
|
||||
@@ -946,7 +946,7 @@ const char* Script::GetString(qboolean crossline)
|
||||
startline, filename.c_str());
|
||||
}
|
||||
|
||||
if (token_p == &token[MAXTOKEN]) {
|
||||
if (token_p == &token[SCRIPT_MAXTOKEN]) {
|
||||
FILE_Error(ERR_DROP, "String too large on line %i in file %s\n",
|
||||
line, filename.c_str());
|
||||
}
|
||||
@@ -1075,7 +1075,7 @@ int Script::LinesInFile(void)
|
||||
qboolean temp_tokenready;
|
||||
const char* temp_script_p;
|
||||
int temp_line;
|
||||
char temp_token[MAXTOKEN];
|
||||
char temp_token[SCRIPT_MAXTOKEN];
|
||||
int numentries;
|
||||
|
||||
temp_tokenready = tokenready;
|
||||
|
||||
@@ -40,13 +40,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#define TOKENSPACE (' ')
|
||||
#define TOKENSPECIAL ('$')
|
||||
|
||||
#define MAXTOKEN 512
|
||||
#define SCRIPT_MAXTOKEN 512
|
||||
|
||||
typedef struct {
|
||||
qboolean tokenready;
|
||||
int offset;
|
||||
int line;
|
||||
char token[MAXTOKEN];
|
||||
char token[SCRIPT_MAXTOKEN];
|
||||
} scriptmarker_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -67,7 +67,7 @@ protected:
|
||||
Container<macro*> macrolist;
|
||||
|
||||
int line;
|
||||
char token[MAXTOKEN];
|
||||
char token[SCRIPT_MAXTOKEN];
|
||||
|
||||
qboolean releaseBuffer;
|
||||
qboolean hasError;
|
||||
|
||||
@@ -388,7 +388,7 @@ void TikiScript::AddMacro( const char *name, const char *expansion )
|
||||
return;
|
||||
}
|
||||
|
||||
if( nummacros >= MAXMACROS )
|
||||
if( nummacros >= TIKI_MAXMACROS )
|
||||
{
|
||||
TIKI_DPrintf( "Too many %cdefine in file %s\n", TOKENSPECIAL, Filename() );
|
||||
}
|
||||
@@ -420,7 +420,7 @@ qboolean TikiScript::ProcessCommand( qboolean crossline )
|
||||
char argument1[ 256 ];
|
||||
char argument2[ 256 ];
|
||||
|
||||
sscanf( script_p, "%c%s %s %s\n", &dummy, &command, &argument1, &argument2 );
|
||||
sscanf( script_p, "%c%s %s %s\n", &dummy, command, argument1, argument2 );
|
||||
|
||||
if( !stricmp( command, "define" ) )
|
||||
{
|
||||
@@ -760,7 +760,7 @@ const char *TikiScript::GetToken( qboolean crossline )
|
||||
*token_p++ = *i->script_p++;
|
||||
}
|
||||
|
||||
if( token_p == &i->token[ MAXTOKEN ] )
|
||||
if( token_p == &i->token[ TIKI_MAXTOKEN ] )
|
||||
{
|
||||
TIKI_DPrintf( "Token too large on line %i in file %s\n", i->line, i->Filename() );
|
||||
break;
|
||||
@@ -869,7 +869,7 @@ const char *TikiScript::GetLine( qboolean crossline )
|
||||
start = i->script_p;
|
||||
SkipToEOL();
|
||||
size = i->script_p - start;
|
||||
if( size < ( MAXTOKEN - 1 ) )
|
||||
if( size < ( TIKI_MAXTOKEN - 1 ) )
|
||||
{
|
||||
memcpy( i->token, start, size );
|
||||
i->token[ size ] = '\0';
|
||||
@@ -928,7 +928,7 @@ const char *TikiScript::GetAndIgnoreLine( qboolean crossline )
|
||||
start = script_p;
|
||||
SkipToEOL();
|
||||
size = script_p - start;
|
||||
if( size < ( MAXTOKEN - 1 ) )
|
||||
if( size < ( TIKI_MAXTOKEN - 1 ) )
|
||||
{
|
||||
memcpy( token, start, size );
|
||||
token[ size ] = '\0';
|
||||
@@ -981,7 +981,7 @@ const char *TikiScript::GetRaw( void )
|
||||
start = script_p;
|
||||
SkipToEOL();
|
||||
size = script_p - start;
|
||||
if( size < ( MAXTOKEN - 1 ) )
|
||||
if( size < ( TIKI_MAXTOKEN - 1 ) )
|
||||
{
|
||||
memset( token, 0, sizeof( token ) );
|
||||
memcpy( token, start, size );
|
||||
@@ -1086,7 +1086,7 @@ const char *TikiScript::GetString( qboolean crossline )
|
||||
"line %d in file %s\n", startline, i->filename );
|
||||
}
|
||||
|
||||
if( token_p == &i->token[ MAXTOKEN ] )
|
||||
if( token_p == &i->token[ TIKI_MAXTOKEN ] )
|
||||
{
|
||||
TIKI_DPrintf( "String too large on line %i in file %s\n", i->line, i->filename );
|
||||
}
|
||||
@@ -1192,7 +1192,7 @@ int TikiScript::LinesInFile( void )
|
||||
qboolean temp_tokenready;
|
||||
const char *temp_script_p;
|
||||
int temp_line;
|
||||
char temp_token[ MAXTOKEN ];
|
||||
char temp_token[ TIKI_MAXTOKEN ];
|
||||
int numentries;
|
||||
|
||||
temp_tokenready = tokenready;
|
||||
@@ -1232,7 +1232,7 @@ void TikiScript::Parse( char *data, int length, const char *name )
|
||||
Reset();
|
||||
this->length = length;
|
||||
end_p = script_p + length;
|
||||
strncpy( filename, name, MAXTOKEN );
|
||||
strncpy( filename, name, TIKI_MAXTOKEN );
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -32,21 +32,19 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#define TOKENSPACE (' ')
|
||||
#define TOKENSPECIAL ('$')
|
||||
|
||||
#ifndef MAXTOKEN
|
||||
#define MAXTOKEN 256
|
||||
#endif
|
||||
#define TIKI_MAXTOKEN 256
|
||||
|
||||
#define MAXMACROS 48
|
||||
#define TIKI_MAXMACROS 48
|
||||
|
||||
typedef struct {
|
||||
char name[ MAXTOKEN ];
|
||||
char macro[ MAXTOKEN ];
|
||||
char name[TIKI_MAXTOKEN];
|
||||
char macro[TIKI_MAXTOKEN];
|
||||
} tiki_macro_t;
|
||||
|
||||
typedef struct {
|
||||
const char *mark_script_p;
|
||||
qboolean mark_tokenready;
|
||||
char mark_token[ MAXTOKEN ];
|
||||
char mark_token[TIKI_MAXTOKEN];
|
||||
} tiki_mark_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -57,13 +55,13 @@ protected:
|
||||
qboolean tokenready;
|
||||
class TikiScript *include;
|
||||
class TikiScript *parent;
|
||||
char filename[ MAXTOKEN ];
|
||||
char filename[TIKI_MAXTOKEN];
|
||||
const char *script_p;
|
||||
const char *end_p;
|
||||
tiki_macro_t macros[ MAXMACROS ];
|
||||
tiki_macro_t macros[TIKI_MAXMACROS];
|
||||
int nummacros;
|
||||
int line;
|
||||
char token[ MAXTOKEN ];
|
||||
char token[TIKI_MAXTOKEN];
|
||||
qboolean releaseBuffer;
|
||||
tiki_mark_t mark[ 64 ];
|
||||
int mark_pos;
|
||||
|
||||
@@ -528,6 +528,34 @@ extern void ( APIENTRY * qglVertex4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
// GL_ARB_texture_compression
|
||||
extern void (APIENTRY* qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
|
||||
extern void (APIENTRY* qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
|
||||
extern void (APIENTRY* qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
|
||||
extern void (APIENTRY* qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
|
||||
extern void (APIENTRY* qglGetCompressedTexImageARB)(GLenum target, GLint lod, void* img);
|
||||
#ifndef GL_COMPRESSED_RGB_ARB
|
||||
#define GL_COMPRESSED_ALPHA_ARB 0x84E9
|
||||
#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
|
||||
#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
|
||||
#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
|
||||
#define GL_COMPRESSED_RGB_ARB 0x84ED
|
||||
#define GL_COMPRESSED_RGBA_ARB 0x84EE
|
||||
#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
|
||||
#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
|
||||
#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
|
||||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
|
||||
#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
|
||||
#endif
|
||||
|
||||
// GL_EXT_texture_compression_s3tc
|
||||
#ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
|
||||
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
|
||||
#endif
|
||||
|
||||
#if defined( _WIN32 )
|
||||
|
||||
extern int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *);
|
||||
|
||||
@@ -355,3 +355,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#define qglVertexPointer glVertexPointer
|
||||
#define qglViewport glViewport
|
||||
|
||||
#define qglCompressedTexImage3DARB glCompressedTexImage3D
|
||||
#define qglCompressedTexImage2DARB glCompressedTexImage2D
|
||||
#define qglCompressedTexSubImage3DARB glCompressedTexSubImage3D
|
||||
#define qglCompressedTexSubImage2DARB glCompressedTexSubImage2D
|
||||
#define qglGetCompressedTexImageARB glGetCompressedTexImage
|
||||
+217
-18
@@ -552,36 +552,62 @@ static void Upload32(
|
||||
// select proper internal format
|
||||
if ( samples == 3 )
|
||||
{
|
||||
if ( glConfig.textureCompression == TC_S3TC )
|
||||
if (!force32bit)
|
||||
{
|
||||
internalFormat = GL_RGB4_S3TC;
|
||||
}
|
||||
else if ( r_texturebits->integer == 16 )
|
||||
{
|
||||
internalFormat = GL_RGB5;
|
||||
}
|
||||
else if ( r_texturebits->integer == 32 )
|
||||
{
|
||||
internalFormat = GL_RGB8;
|
||||
if (r_texturebits->integer == 16)
|
||||
{
|
||||
internalFormat = GL_RGB5;
|
||||
}
|
||||
else if (r_texturebits->integer == 32)
|
||||
{
|
||||
internalFormat = GL_RGB8;
|
||||
}
|
||||
else if (r_colorbits->integer == 16)
|
||||
{
|
||||
internalFormat = GL_RGBA4;
|
||||
}
|
||||
else if (r_colorbits->integer == 32)
|
||||
{
|
||||
internalFormat = GL_RGBA8;
|
||||
}
|
||||
else
|
||||
{
|
||||
internalFormat = 3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
internalFormat = 3;
|
||||
internalFormat = GL_RGB8;
|
||||
}
|
||||
}
|
||||
else if ( samples == 4 )
|
||||
{
|
||||
if ( r_texturebits->integer == 16 )
|
||||
if (!force32bit)
|
||||
{
|
||||
internalFormat = GL_RGBA4;
|
||||
}
|
||||
else if ( r_texturebits->integer == 32 )
|
||||
{
|
||||
internalFormat = GL_RGBA8;
|
||||
if (r_texturebits->integer == 16)
|
||||
{
|
||||
internalFormat = GL_RGBA4;
|
||||
}
|
||||
else if (r_texturebits->integer == 32)
|
||||
{
|
||||
internalFormat = GL_RGBA8;
|
||||
}
|
||||
else if (r_colorbits->integer == 16)
|
||||
{
|
||||
internalFormat = GL_RGBA4;
|
||||
}
|
||||
else if (r_colorbits->integer == 32)
|
||||
{
|
||||
internalFormat = GL_RGBA8;
|
||||
}
|
||||
else
|
||||
{
|
||||
internalFormat = 4;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
internalFormat = 4;
|
||||
internalFormat = GL_RGB8;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -670,6 +696,161 @@ done:
|
||||
ri.Hunk_FreeTempMemory( resampledBuffer );
|
||||
}
|
||||
|
||||
static void UploadCompressed(
|
||||
byte* data,
|
||||
int width,
|
||||
int height,
|
||||
int numMipmaps,
|
||||
int iMipmapsAvailable,
|
||||
qboolean picmip,
|
||||
int glCompressMode,
|
||||
int* format,
|
||||
int* pUploadWidth,
|
||||
int* pUploadHeight,
|
||||
int* pBytesUsed
|
||||
) {
|
||||
byte* offset;
|
||||
int i;
|
||||
int iStartImage;
|
||||
int size;
|
||||
int blockSize;
|
||||
int scaled_width, scaled_height;
|
||||
|
||||
offset = data;
|
||||
iStartImage = 0;
|
||||
if (picmip) {
|
||||
iStartImage = r_picmip->integer;
|
||||
}
|
||||
|
||||
if (iStartImage > 0 && iStartImage >= iMipmapsAvailable) {
|
||||
iStartImage = iMipmapsAvailable - 1;
|
||||
}
|
||||
|
||||
scaled_width = width;
|
||||
scaled_height = height;
|
||||
if (iStartImage)
|
||||
{
|
||||
scaled_width = width >> iStartImage;
|
||||
scaled_height = height >> iStartImage;
|
||||
}
|
||||
while (scaled_width > glConfig.maxTextureSize || scaled_height > glConfig.maxTextureSize)
|
||||
{
|
||||
scaled_width >>= 1;
|
||||
scaled_height >>= 1;
|
||||
++iStartImage;
|
||||
}
|
||||
if (iStartImage > 0 && iStartImage >= iMipmapsAvailable)
|
||||
{
|
||||
iStartImage = iMipmapsAvailable - 1;
|
||||
scaled_width = width >> (iMipmapsAvailable - 1);
|
||||
scaled_height = height >> (iMipmapsAvailable - 1);
|
||||
}
|
||||
|
||||
*pUploadWidth = scaled_width;
|
||||
*pUploadHeight = scaled_height;
|
||||
*format = glCompressMode;
|
||||
blockSize = 16;
|
||||
|
||||
if (glCompressMode == GL_COMPRESSED_RGB_S3TC_DXT1_EXT || glCompressMode == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) {
|
||||
blockSize = 8;
|
||||
}
|
||||
|
||||
scaled_width = width;
|
||||
scaled_height = height;
|
||||
|
||||
for (i = iStartImage; i; i--) {
|
||||
int w, h;
|
||||
|
||||
w = scaled_width + 3;
|
||||
if (scaled_width + 3 < 0) {
|
||||
w = scaled_width + 6;
|
||||
}
|
||||
w >>= 2;
|
||||
|
||||
if (w > 1) {
|
||||
h = scaled_height + 3;
|
||||
if (scaled_height + 3 < 0) {
|
||||
h = scaled_height + 6;
|
||||
}
|
||||
|
||||
h >>= 2;
|
||||
if (h > 1) {
|
||||
offset += blockSize * w * h;
|
||||
}
|
||||
}
|
||||
|
||||
scaled_width >>= 1;
|
||||
scaled_height >>= 1;
|
||||
if (!scaled_width) scaled_width = 1;
|
||||
if (!scaled_height) scaled_height = 1;
|
||||
}
|
||||
|
||||
*pBytesUsed = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
while (scaled_width)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
if (!scaled_height) scaled_height = 1;
|
||||
w = scaled_width + 3;
|
||||
if (scaled_width + 3 < 0) w = scaled_width + 6;
|
||||
w >>= 2;
|
||||
|
||||
h = scaled_height + 3;
|
||||
if (scaled_height + 3 < 0) h = scaled_height + 6;
|
||||
h >>= 2;
|
||||
|
||||
size = blockSize * w * h;
|
||||
if (w > 1 && h > 1) *pBytesUsed += size;
|
||||
|
||||
qglCompressedTexImage2DARB(3553, i - iStartImage, glCompressMode, scaled_width, scaled_height, 0, size, data);
|
||||
GL_CheckErrors();
|
||||
|
||||
if (i < iMipmapsAvailable)
|
||||
{
|
||||
w = scaled_width + 3;
|
||||
if (scaled_width + 3 < 0) {
|
||||
w = scaled_width + 6;
|
||||
}
|
||||
|
||||
if (w >> 2 > 1)
|
||||
{
|
||||
h = scaled_height + 3;
|
||||
if (scaled_height + 3 < 0) {
|
||||
h = scaled_height + 6;
|
||||
}
|
||||
|
||||
if (h >> 2 > 1)
|
||||
data += size;
|
||||
}
|
||||
}
|
||||
scaled_width >>= 1;
|
||||
scaled_height >>= 1;
|
||||
++i;
|
||||
}
|
||||
|
||||
if (!scaled_height) {
|
||||
break;
|
||||
}
|
||||
|
||||
scaled_width = 1;
|
||||
}
|
||||
|
||||
if (numMipmaps > 1) {
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min);
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
|
||||
}
|
||||
else
|
||||
{
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
|
||||
GL_CheckErrors();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
@@ -733,6 +914,7 @@ image_t* R_CreateImage(
|
||||
image->allowPicmip = allowPicmip;
|
||||
image->dynamicallyUpdated = dynamicallyUpdated;
|
||||
image->force32bit = force32bit;
|
||||
image->UseCount = 0;
|
||||
|
||||
strcpy (image->imgName, name);
|
||||
|
||||
@@ -754,6 +936,22 @@ image_t* R_CreateImage(
|
||||
|
||||
GL_Bind(image);
|
||||
|
||||
if (glCompressMode) {
|
||||
UploadCompressed(
|
||||
pic,
|
||||
image->width,
|
||||
image->height,
|
||||
image->numMipmaps,
|
||||
iMipmapsAvailable,
|
||||
allowPicmip,
|
||||
glCompressMode,
|
||||
&image->internalFormat,
|
||||
&image->uploadWidth,
|
||||
&image->uploadHeight,
|
||||
&image->bytesUsed
|
||||
);
|
||||
}
|
||||
|
||||
Upload32(
|
||||
(unsigned*)pic,
|
||||
image->width,
|
||||
@@ -783,6 +981,7 @@ image_t* R_CreateImage(
|
||||
hash = generateHashValue(name);
|
||||
image->next = hashTable[hash];
|
||||
hashTable[hash] = image;
|
||||
image->r_sequence = r_sequencenumber;
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
@@ -1462,6 +1462,7 @@ refexport_t *GetRefAPI ( int apiVersion, refimport_t *rimp ) {
|
||||
re.UnregisterServerModel = RE_UnregisterServerModel;
|
||||
re.RegisterShader = RE_RegisterShader;
|
||||
re.RegisterShaderNoMip = RE_RegisterShaderNoMip;
|
||||
re.RefreshShaderNoMip = RE_RefreshShaderNoMip;
|
||||
re.LoadWorld = RE_LoadWorldMap;
|
||||
re.PrintBSPFileSizes = RE_PrintBSPFileSizes;
|
||||
re.MapVersion = RE_MapVersion;
|
||||
|
||||
@@ -1728,6 +1728,7 @@ skin_t *R_GetSkinByHandle( qhandle_t hSkin );
|
||||
//
|
||||
qhandle_t RE_RegisterShader( const char *name );
|
||||
qhandle_t RE_RegisterShaderNoMip( const char *name );
|
||||
qhandle_t RE_RefreshShaderNoMip(const char* name);
|
||||
qhandle_t RE_RegisterShaderFromImage(const char *name, int lightmapIndex, image_t *image, qboolean mipRawImage);
|
||||
|
||||
shader_t* R_FindShader(const char* name, int lightmapIndex, qboolean mipRawImage, qboolean picmip, qboolean wrapx, qboolean wrapy);
|
||||
|
||||
@@ -306,7 +306,6 @@ to overflow.
|
||||
==============
|
||||
*/
|
||||
void RB_BeginSurface( shader_t *shader ) {
|
||||
|
||||
tess.numIndexes = 0;
|
||||
tess.numVertexes = 0;
|
||||
tess.shader = shader;
|
||||
@@ -316,12 +315,6 @@ void RB_BeginSurface( shader_t *shader ) {
|
||||
tess.numPasses = shader->numUnfoggedPasses;
|
||||
tess.currentStageIteratorFunc = shader->optimalStageIteratorFunc;
|
||||
|
||||
tess.shaderTime = backEnd.refdef.floatTime - tess.shader->timeOffset;
|
||||
if (tess.shader->clampTime && tess.shaderTime >= tess.shader->clampTime) {
|
||||
tess.shaderTime = tess.shader->clampTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1680,7 +1680,12 @@ static void ParseSkyParms( char **text ) {
|
||||
for (i=0 ; i<6 ; i++) {
|
||||
Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga"
|
||||
, token, suf[i] );
|
||||
shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, qtrue, qtrue, qfalse, GL_CLAMP, GL_CLAMP );
|
||||
if (!r_forceClampToEdge->integer) {
|
||||
shader.sky.outerbox[i] = R_FindImageFile((char*)pathname, qtrue, qtrue, shader_force32bit, GL_CLAMP, GL_CLAMP);
|
||||
}
|
||||
else {
|
||||
shader.sky.outerbox[i] = R_FindImageFile((char*)pathname, qtrue, qtrue, shader_force32bit, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE);
|
||||
}
|
||||
if ( !shader.sky.outerbox[i] ) {
|
||||
shader.sky.outerbox[i] = tr.defaultImage;
|
||||
}
|
||||
@@ -1710,7 +1715,7 @@ static void ParseSkyParms( char **text ) {
|
||||
for (i=0 ; i<6 ; i++) {
|
||||
Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga"
|
||||
, token, suf[i] );
|
||||
shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, qtrue, qtrue, qfalse, GL_REPEAT, GL_REPEAT );
|
||||
shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, qtrue, qtrue, shader_force32bit, GL_REPEAT, GL_REPEAT );
|
||||
if ( !shader.sky.innerbox[i] ) {
|
||||
shader.sky.innerbox[i] = tr.defaultImage;
|
||||
}
|
||||
@@ -3069,6 +3074,11 @@ qhandle_t RE_RegisterShaderNoMip( const char *name ) {
|
||||
return sh->index;
|
||||
}
|
||||
|
||||
qhandle_t RE_RefreshShaderNoMip(const char* name) {
|
||||
// FIXME: unimplemented
|
||||
// Workaround
|
||||
return RE_RegisterShaderNoMip(name);
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
|
||||
@@ -811,7 +811,7 @@ void RB_StageIteratorSky( void ) {
|
||||
if ( r_showsky->integer ) {
|
||||
qglDepthRange( 0.0, 0.0 );
|
||||
} else {
|
||||
qglDepthRange( 1.0, 1.0 );
|
||||
qglDepthRange( 1.875, 1.875 );
|
||||
}
|
||||
|
||||
// draw the outer skybox
|
||||
|
||||
@@ -98,7 +98,7 @@ typedef struct uiimport_s {
|
||||
const char *( *Client_TranslateWidgetName )( const char *widget );
|
||||
void( *Connect )( const char *server );
|
||||
const char *( *Key_GetKeynameForCommand )( const char *command );
|
||||
char *( *Key_GetCommandForKey )( int keynum );
|
||||
const char *( *Key_GetCommandForKey )( int keynum );
|
||||
void ( *Key_SetBinding )( int keynum, const char *binding );
|
||||
void ( *Key_GetKeysForCommand )( const char *command, int *key1, int *key2 );
|
||||
const char *( *Key_KeynumToString )( int keynum );
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ public:
|
||||
void Pressed( void );
|
||||
void SetCommand( Event *ev );
|
||||
void SetCommand( str s );
|
||||
void DrawUnpressed( void );
|
||||
void DrawPressed( void );
|
||||
void DrawUnpressed( void ) override;
|
||||
void DrawPressed( void ) override;
|
||||
void Clear( void );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
void SetAlternate( qboolean a );
|
||||
|
||||
+14
-40
@@ -233,26 +233,13 @@ void UIButton::DrawPressed
|
||||
clientFrame.pos.x += 1;
|
||||
clientFrame.pos.y += 1;
|
||||
|
||||
if (m_bVirtual)
|
||||
{
|
||||
m_font->PrintJustified(
|
||||
clientFrame,
|
||||
m_iFontAlignmentHorizontal,
|
||||
m_iFontAlignmentVertical,
|
||||
Sys_LV_CL_ConvertString(m_title.c_str()),
|
||||
NULL
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_font->PrintJustified(
|
||||
clientFrame,
|
||||
m_iFontAlignmentHorizontal,
|
||||
m_iFontAlignmentVertical,
|
||||
Sys_LV_CL_ConvertString(m_title.c_str()),
|
||||
m_vVirtualScale
|
||||
);
|
||||
}
|
||||
m_font->PrintJustified(
|
||||
clientFrame,
|
||||
m_iFontAlignmentHorizontal,
|
||||
m_iFontAlignmentVertical,
|
||||
Sys_LV_CL_ConvertString(m_title.c_str()),
|
||||
m_bVirtual ? m_vVirtualScale : NULL
|
||||
);
|
||||
}
|
||||
|
||||
void UIButton::DrawUnpressed
|
||||
@@ -266,26 +253,13 @@ void UIButton::DrawUnpressed
|
||||
|
||||
UIRect2D clientFrame = getClientFrame();
|
||||
|
||||
if (m_bVirtual)
|
||||
{
|
||||
m_font->PrintJustified(
|
||||
clientFrame,
|
||||
m_iFontAlignmentHorizontal,
|
||||
m_iFontAlignmentVertical,
|
||||
Sys_LV_CL_ConvertString(m_title.c_str()),
|
||||
NULL
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_font->PrintJustified(
|
||||
clientFrame,
|
||||
m_iFontAlignmentHorizontal,
|
||||
m_iFontAlignmentVertical,
|
||||
Sys_LV_CL_ConvertString(m_title.c_str()),
|
||||
m_vVirtualScale
|
||||
);
|
||||
}
|
||||
m_font->PrintJustified(
|
||||
clientFrame,
|
||||
m_iFontAlignmentHorizontal,
|
||||
m_iFontAlignmentVertical,
|
||||
Sys_LV_CL_ConvertString(m_title.c_str()),
|
||||
m_bVirtual ? m_vVirtualScale : NULL
|
||||
);
|
||||
}
|
||||
|
||||
qboolean UIButton::KeyEvent
|
||||
|
||||
@@ -77,8 +77,6 @@ int UIConsole::getNextItem
|
||||
return -1;
|
||||
}
|
||||
|
||||
m_numitems = m_numitems;
|
||||
m_firstitem = m_firstitem;
|
||||
prev = prev + 1;
|
||||
|
||||
if (m_numitems < MAX_CONSOLE_ITEMS)
|
||||
@@ -827,16 +825,16 @@ void UIFloatingConsole::FrameInitialized
|
||||
m_status->setTitle(str());
|
||||
|
||||
m_console = new UIConsole();
|
||||
m_console->InitFrame(getChildSpace(), UIRect2D(0, 0, 20.0, 20.0), 0, "verdana-12");
|
||||
m_console->InitFrame(getChildSpace(), UIRect2D(0, 0, 20.0, 20.0), 0, "verdana-14");
|
||||
setConsoleColor(m_consoleColor);
|
||||
setConsoleBackground(m_consoleBackground, m_consoleAlpha);
|
||||
m_console->setConsoleHandler(m_handler);
|
||||
|
||||
Connect(this, W_SizeChanged, W_Console_ChildSizeChanged);
|
||||
getChildSpace()->Connect(this, W_SizeChanged, W_Console_ChildSizeChanged);
|
||||
getChildSpace()->AllowActivate(false);
|
||||
OnChildSizeChanged(NULL);
|
||||
|
||||
m_background_color.a = 1.0;
|
||||
m_background_color.a = 0.0;
|
||||
m_alpha = 1.0;
|
||||
|
||||
getChildSpace()->setBackgroundAlpha(1.0);
|
||||
@@ -907,6 +905,7 @@ void UIFloatingConsole::setConsoleBackground
|
||||
)
|
||||
|
||||
{
|
||||
m_alpha = alpha;
|
||||
m_consoleBackground = color;
|
||||
m_consoleAlpha = alpha;
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ void UIFloatingWindow::MinimizePressed
|
||||
// so the window can be restored later
|
||||
m_restoredHeight = size.height;
|
||||
size.height = 20.0;
|
||||
m_minimizeButton->setTitle(1);
|
||||
m_minimizeButton->setTitle("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -296,9 +296,9 @@ void UIFloatingWindow::SizeChanged
|
||||
return;
|
||||
}
|
||||
|
||||
setFrame(childRect);
|
||||
setFrame(UIRect2D(m_frame.size.width - 18.0, 2.0, 16.0, 16.0));
|
||||
setFrame(UIRect2D(m_frame.size.width - 36.0, 2.0, 16.0, 16.0));
|
||||
m_childspace->setFrame(childRect);
|
||||
m_closeButton->setFrame(UIRect2D(m_frame.size.width - 18.0, 2.0, 16.0, 16.0));
|
||||
m_minimizeButton->setFrame(UIRect2D(m_frame.size.width - 36.0, 2.0, 16.0, 16.0));
|
||||
}
|
||||
|
||||
void UIFloatingWindow::OnActivated
|
||||
@@ -368,6 +368,8 @@ void UIFloatingWindow::Draw
|
||||
textColor = m_textColor;
|
||||
|
||||
UColorHSV tmp(titleBar);
|
||||
tmp.s *= 0.75;
|
||||
tmp.v *= 1.333;
|
||||
newColor = tmp;
|
||||
|
||||
titleBorder.dark = newColor;
|
||||
@@ -379,7 +381,7 @@ void UIFloatingWindow::Draw
|
||||
{
|
||||
UColor newColor(0.1125, 0.147, 0.2085, 1.0);
|
||||
|
||||
titleBar = titleBar;
|
||||
titleBar = newColor;
|
||||
textColor = UBlack;
|
||||
|
||||
titleBorder.CreateSolidBorder(newColor, DARK);
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
public:
|
||||
UIChildSpaceWidget();
|
||||
|
||||
qboolean KeyEvent( int key, unsigned int time );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
};
|
||||
|
||||
class UIFloatingWindow : public UIWidget {
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
CLASS_PROTOTYPE( UIGlobalGameList );
|
||||
|
||||
public:
|
||||
virtual void UpdateServers();
|
||||
virtual void UpdateServers() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
void EventConnect( Event *ev );
|
||||
void PlayEnterSound( void );
|
||||
qboolean SetActiveRow( UIWidget *w );
|
||||
void Realign( void );
|
||||
void Realign( void ) override;
|
||||
};
|
||||
|
||||
class UILanGameListLabel : public UILabel {
|
||||
|
||||
+6
-6
@@ -48,28 +48,28 @@ public:
|
||||
|
||||
protected:
|
||||
void Draw( void ) override;
|
||||
qboolean KeyEvent( int key, unsigned int time );
|
||||
void CharEvent( int ch );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
void CharEvent( int ch ) override;
|
||||
void Pressed( Event *ev );
|
||||
void Released( Event *ev );
|
||||
void ScrollNext( void );
|
||||
void ScrollPrev( void );
|
||||
void FrameInitialized( void );
|
||||
void FrameInitialized( void ) override;
|
||||
void LayoutAddListItem( Event *ev );
|
||||
void AddItem( str item, str alias );
|
||||
public:
|
||||
UIList();
|
||||
~UIList();
|
||||
|
||||
void UpdateUIElement( void );
|
||||
void UpdateData( void );
|
||||
void UpdateUIElement( void ) override;
|
||||
void UpdateData( void ) override;
|
||||
};
|
||||
|
||||
class UIListIndex : public UIList {
|
||||
public:
|
||||
CLASS_PROTOTYPE( UIListIndex );
|
||||
|
||||
qboolean KeyEvent( int key, unsigned int time );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
};
|
||||
|
||||
#endif /* __UILIST_H__ */
|
||||
@@ -35,12 +35,12 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void TrySelectItem( int which );
|
||||
qboolean KeyEvent( int key, unsigned int time );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
|
||||
public:
|
||||
UIListBase();
|
||||
|
||||
void FrameInitialized( void );
|
||||
void FrameInitialized( void ) override;
|
||||
int getCurrentItem( void );
|
||||
virtual int getNumItems( void );
|
||||
virtual void DeleteAllItems( void );
|
||||
@@ -78,20 +78,20 @@ protected:
|
||||
void MouseReleased( Event *ev );
|
||||
void DeleteAllItems( Event *ev );
|
||||
void SetListFont( Event *ev );
|
||||
void TrySelectItem( int which );
|
||||
void TrySelectItem( int which ) override;
|
||||
|
||||
public:
|
||||
UIListBox();
|
||||
|
||||
void AddItem( const char *item, const char *command );
|
||||
void AddItem( int index, const char *command );
|
||||
void FrameInitialized( void );
|
||||
void FrameInitialized( void ) override;
|
||||
void LayoutAddListItem( Event *ev );
|
||||
void LayoutAddConfigstringListItem( Event *ev );
|
||||
str getItemText( int which );
|
||||
int getNumItems( void );
|
||||
void DeleteAllItems( void );
|
||||
void DeleteItem( int which );
|
||||
int getNumItems( void ) override;
|
||||
void DeleteAllItems( void ) override;
|
||||
void DeleteItem( int which ) override;
|
||||
};
|
||||
|
||||
#endif /* __UILISTBOX_H__ */
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
UIListCtrl();
|
||||
~UIListCtrl();
|
||||
|
||||
void FrameInitialized( void );
|
||||
void FrameInitialized( void ) override;
|
||||
void SetDrawHeader( qboolean bDrawHeader );
|
||||
void AddItem( UIListCtrlItem *item );
|
||||
void InsertItem( UIListCtrlItem *item, int where );
|
||||
@@ -97,9 +97,9 @@ public:
|
||||
UIListCtrlItem *GetItem( int item );
|
||||
void AddColumn( str title, int name, int width, bool numeric, bool reverse_sort );
|
||||
void RemoveAllColumns( void );
|
||||
int getNumItems( void );
|
||||
void DeleteAllItems( void );
|
||||
void DeleteItem( int which );
|
||||
int getNumItems( void ) override;
|
||||
void DeleteAllItems( void ) override;
|
||||
void DeleteItem( int which ) override;
|
||||
virtual void SortByColumn( int column );
|
||||
void SortByLastSortColumn( void );
|
||||
void setCompareFunction( int( *func ) ( const UIListCtrlItem *i1, const UIListCtrlItem *i2, int columnname ) );
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
CLASS_PROTOTYPE( UIMultiLineEdit );
|
||||
|
||||
protected:
|
||||
void FrameInitialized( void );
|
||||
void FrameInitialized( void ) override;
|
||||
void PointToSelectionPoint( UIPoint2D& p, selectionpoint_t& sel );
|
||||
str& LineFromLineNumber( int num, bool resetpos );
|
||||
void EnsureSelectionPointVisible( selectionpoint_t& point );
|
||||
@@ -67,8 +67,8 @@ public:
|
||||
UIMultiLineEdit();
|
||||
|
||||
void Draw( void ) override;
|
||||
qboolean KeyEvent( int key, unsigned int time );
|
||||
void CharEvent( int ch );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
void CharEvent( int ch ) override;
|
||||
UIPoint2D getEndSelPoint( void );
|
||||
void MouseDown( Event *ev );
|
||||
void MouseUp( Event *ev );
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
public:
|
||||
UINotepadEdit();
|
||||
|
||||
void CharEvent( int ch );
|
||||
void CharEvent( int ch ) override;
|
||||
void setNotepad( UINotepad *notepad );
|
||||
bool GotoLine( int line );
|
||||
bool FindText( const char *text, int offsetFromSel );
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
void setPopupBGColor( str menu, UColor c );
|
||||
void setPulldownShader( const char *title, UIReggedMaterial *mat );
|
||||
void setSelectedPulldownShader( const char *title, UIReggedMaterial *mat );
|
||||
void Realign( void );
|
||||
void Realign( void ) override;
|
||||
void Draw( void ) override;
|
||||
};
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ public:
|
||||
UIPulldownMenuContainer();
|
||||
|
||||
protected:
|
||||
void FrameInitialized( void );
|
||||
void setBackgroundAlpha( float f );
|
||||
void setBackgroundColor( const UColor& color, bool setbordercolor );
|
||||
void setForegroundColor( const UColor& color );
|
||||
void FrameInitialized( void ) override;
|
||||
void setBackgroundAlpha( float f ) override;
|
||||
void setBackgroundColor( const UColor& color, bool setbordercolor ) override;
|
||||
void setForegroundColor( const UColor& color ) override;
|
||||
void SetPopupHighlightFGColor( Event *ev );
|
||||
void SetPopupHighlightBGColor( Event *ev );
|
||||
void SetPopupFGColor( Event *ev );
|
||||
@@ -47,7 +47,7 @@ protected:
|
||||
void SetHighlightBGColor( Event *ev );
|
||||
void SetMenuShader( Event *ev );
|
||||
void SetSelectedMenuShader( Event *ev );
|
||||
void Realign( void );
|
||||
void Realign( void ) override;
|
||||
void PulldownVirtualRes( Event *ev );
|
||||
|
||||
public:
|
||||
|
||||
+126
-18
@@ -21,25 +21,40 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "ui_local.h"
|
||||
#include "localization.h"
|
||||
|
||||
CLASS_DECLARATION( UIWidget, UIWindowSizer, NULL )
|
||||
{
|
||||
{ &W_LeftMouseDown, &UIWindowSizer::MouseDown },
|
||||
{ &W_LeftMouseUp, &UIWindowSizer::MouseUp },
|
||||
{ &W_LeftMouseDragged, &UIWindowSizer::MouseDragged },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
UIWindowSizer::UIWindowSizer()
|
||||
{
|
||||
// FIXME: stub
|
||||
m_draggingwidget = NULL;
|
||||
m_mouseState = M_NONE;
|
||||
}
|
||||
|
||||
|
||||
UIWindowSizer::UIWindowSizer(UIWidget* w)
|
||||
: UIWindowSizer()
|
||||
{
|
||||
m_draggingwidget = w;
|
||||
}
|
||||
|
||||
void UIWindowSizer::Draw
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
m_font->setColor(UWhite);
|
||||
m_font->Print(0, 0, "o", -1, m_bVirtual);
|
||||
|
||||
m_font->setColor(UBlack);
|
||||
m_font->Print(0, 0, "p", -1, m_bVirtual);
|
||||
}
|
||||
|
||||
void UIWindowSizer::FrameInitialized
|
||||
@@ -48,7 +63,7 @@ void UIWindowSizer::FrameInitialized
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
setFont("marlett");
|
||||
}
|
||||
|
||||
void UIWindowSizer::MouseDown
|
||||
@@ -57,7 +72,10 @@ void UIWindowSizer::MouseDown
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
m_screenDragPoint.x = ev->GetFloat(1);
|
||||
m_screenDragPoint.y = ev->GetFloat(2);
|
||||
m_mouseState = M_DRAGGING;
|
||||
uWinMan.setFirstResponder(this);
|
||||
}
|
||||
|
||||
void UIWindowSizer::MouseUp
|
||||
@@ -66,7 +84,11 @@ void UIWindowSizer::MouseUp
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
if (uWinMan.getFirstResponder() == this) {
|
||||
uWinMan.setFirstResponder(NULL);
|
||||
}
|
||||
|
||||
m_mouseState = M_NONE;
|
||||
}
|
||||
|
||||
void UIWindowSizer::MouseDragged
|
||||
@@ -75,7 +97,29 @@ void UIWindowSizer::MouseDragged
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
UIPoint2D newpoint, delta;
|
||||
UISize2D newsize;
|
||||
|
||||
if (m_mouseState != M_DRAGGING) {
|
||||
return;
|
||||
}
|
||||
|
||||
newpoint.x = ev->GetFloat(1);
|
||||
newpoint.y = ev->GetFloat(2);
|
||||
delta = UIPoint2D(newpoint.x - m_screenDragPoint.x, newpoint.y - m_screenDragPoint.y);
|
||||
|
||||
if (delta.x || delta.y)
|
||||
{
|
||||
m_screenDragPoint = newpoint;
|
||||
newsize = m_draggingwidget->getSize();
|
||||
newsize.width += delta.x;
|
||||
newsize.height += delta.y;
|
||||
|
||||
if (newsize.width < 32) newsize.width = 32;
|
||||
if (newsize.height < 16) newsize.height = 16;
|
||||
|
||||
m_draggingwidget->setSize(newsize);
|
||||
}
|
||||
}
|
||||
|
||||
void UIWindowSizer::setDraggingWidget
|
||||
@@ -84,7 +128,7 @@ void UIWindowSizer::setDraggingWidget
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
m_draggingwidget = w;
|
||||
}
|
||||
|
||||
UIWidget *UIWindowSizer::getDraggingWidget
|
||||
@@ -93,18 +137,23 @@ UIWidget *UIWindowSizer::getDraggingWidget
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
return NULL;
|
||||
return m_draggingwidget;
|
||||
}
|
||||
|
||||
CLASS_DECLARATION( UIWidget, UIStatusBar, NULL )
|
||||
{
|
||||
{ &W_RealignWidget, &UIStatusBar::ParentSized },
|
||||
{ &W_SizeChanged, &UIStatusBar::SelfSized },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
UIStatusBar::UIStatusBar()
|
||||
{
|
||||
// FIXME: stub
|
||||
m_sizeenabled = NULL;
|
||||
m_created = false;
|
||||
m_sizer = NULL;
|
||||
m_align.alignment = WND_ALIGN_NONE;
|
||||
m_iFontAlignmentHorizontal = FONT_JUSTHORZ_LEFT;
|
||||
}
|
||||
|
||||
UIStatusBar::UIStatusBar
|
||||
@@ -112,9 +161,10 @@ UIStatusBar::UIStatusBar
|
||||
alignment_t align,
|
||||
float height
|
||||
)
|
||||
: UIStatusBar()
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
AlignBar(align, height);
|
||||
}
|
||||
|
||||
void UIStatusBar::FrameInitialized
|
||||
@@ -123,7 +173,14 @@ void UIStatusBar::FrameInitialized
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
m_created = true;
|
||||
Connect(this, W_SizeChanged, W_SizeChanged);
|
||||
if (m_parent) {
|
||||
m_parent->Connect(this, W_SizeChanged, W_RealignWidget);
|
||||
}
|
||||
|
||||
SelfSized(NULL);
|
||||
ParentSized(NULL);
|
||||
}
|
||||
|
||||
void UIStatusBar::Draw
|
||||
@@ -132,7 +189,25 @@ void UIStatusBar::Draw
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
if (m_align.alignment == WND_ALIGN_BOTTOM) {
|
||||
DrawBox(0.0, 0.0, m_frame.size.width, 1.0, m_border_color.dark, 1.0);
|
||||
}
|
||||
|
||||
m_font->setColor(m_foreground_color);
|
||||
m_font->PrintJustified(
|
||||
getClientFrame(),
|
||||
m_iFontAlignmentHorizontal,
|
||||
m_iFontAlignmentVertical,
|
||||
Sys_LV_CL_ConvertString(m_title.c_str()),
|
||||
m_bVirtual ? m_vVirtualScale : NULL
|
||||
);
|
||||
|
||||
if (m_sizer)
|
||||
{
|
||||
m_sizer->setForegroundColor(m_foreground_color);
|
||||
m_sizer->setBackgroundColor(m_background_color, true);
|
||||
m_sizer->setBackgroundAlpha(m_local_alpha);
|
||||
}
|
||||
}
|
||||
|
||||
void UIStatusBar::AlignBar
|
||||
@@ -142,7 +217,8 @@ void UIStatusBar::AlignBar
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
m_align.alignment = align;
|
||||
m_align.dist = height;
|
||||
}
|
||||
|
||||
void UIStatusBar::DontAlignBar
|
||||
@@ -151,7 +227,7 @@ void UIStatusBar::DontAlignBar
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
m_align.alignment = WND_ALIGN_NONE;
|
||||
}
|
||||
|
||||
void UIStatusBar::EnableSizeBox
|
||||
@@ -160,7 +236,10 @@ void UIStatusBar::EnableSizeBox
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
m_sizeenabled = which;
|
||||
if (m_created) {
|
||||
SelfSized(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void UIStatusBar::ParentSized
|
||||
@@ -169,7 +248,12 @@ void UIStatusBar::ParentSized
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
if (m_align.alignment == WND_ALIGN_BOTTOM)
|
||||
{
|
||||
UISize2D parentSize = m_parent->getSize();
|
||||
|
||||
setFrame(UIRect2D(0.0, parentSize.height - m_align.dist, parentSize.width, m_align.dist));
|
||||
}
|
||||
}
|
||||
|
||||
void UIStatusBar::SelfSized
|
||||
@@ -178,6 +262,30 @@ void UIStatusBar::SelfSized
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
if (m_sizeenabled)
|
||||
{
|
||||
if (m_sizer) {
|
||||
if (m_sizer->getDraggingWidget() != m_sizeenabled) {
|
||||
m_sizer->setDraggingWidget(m_sizeenabled);
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_sizer = new UIWindowSizer(m_sizeenabled);
|
||||
m_sizer->InitFrame(this, 0, 0, 16.0, 16.0, 0);
|
||||
}
|
||||
|
||||
|
||||
UISize2D sizerFrame = m_sizer->getSize();
|
||||
|
||||
m_sizer->setFrame(UIRect2D(
|
||||
UIPoint2D(m_frame.size.width - sizerFrame.width, m_frame.size.height - sizerFrame.height),
|
||||
sizerFrame
|
||||
));
|
||||
}
|
||||
else if (m_sizer)
|
||||
{
|
||||
delete m_sizer;
|
||||
m_sizer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public:
|
||||
CLASS_PROTOTYPE( UIWindowSizer );
|
||||
|
||||
UIWindowSizer();
|
||||
UIWindowSizer(UIWidget* w);
|
||||
|
||||
void Draw( void ) override;
|
||||
void FrameInitialized( void ) override;
|
||||
@@ -60,6 +61,7 @@ protected:
|
||||
bool m_created;
|
||||
|
||||
UIWindowSizer *m_sizer;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( UIStatusBar );
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ void UIVertScroll::DrawThumb
|
||||
m_local_alpha
|
||||
);
|
||||
}
|
||||
else
|
||||
else if (m_pressed == VS_PAGE_DOWN)
|
||||
{
|
||||
DrawBox(
|
||||
0.0,
|
||||
|
||||
@@ -2969,7 +2969,7 @@ bool UIWidget::PassEventToWidget
|
||||
|
||||
if( m_enabledCvar.length() )
|
||||
{
|
||||
if( !UI_GetCvarInt( m_cvarname, NULL ) )
|
||||
if( !UI_GetCvarInt( m_cvarname, 0 ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ public:
|
||||
UIWidget *FindPrevControl( UIWidget *control );
|
||||
void setCursor( const char *string );
|
||||
void showCursor( bool show );
|
||||
virtual void CharEvent( int ch );
|
||||
virtual qboolean KeyEvent( int key, unsigned int time );
|
||||
virtual void CharEvent( int ch ) override;
|
||||
virtual qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
void CreateMenus( void );
|
||||
UIReggedMaterial *RegisterShader( const str& name );
|
||||
UIReggedMaterial *RefreshShader( const str& name );
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
void BindKeyToCommand( str command, int key, int index, qboolean alternate );
|
||||
UIWidget *BindActive( void );
|
||||
void SetBindActive( UIWidget *w );
|
||||
virtual void Shutdown( void );
|
||||
virtual void Shutdown( void ) override;
|
||||
void DeactiveFloatingWindows( void );
|
||||
bool DialogExists( void );
|
||||
void RemoveAllDialogBoxes( void );
|
||||
|
||||
@@ -404,6 +404,12 @@ void ( APIENTRY * qglVertex4sv )(const GLshort *v);
|
||||
void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void (APIENTRY* qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* qglGetCompressedTexImageARB)(GLenum target, GLint lod, void* img);
|
||||
|
||||
void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t );
|
||||
void ( APIENTRY * qglActiveTextureARB )( GLenum texture );
|
||||
void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture );
|
||||
@@ -755,6 +761,12 @@ static void ( APIENTRY * dllVertex4sv )(const GLshort *v);
|
||||
static void ( APIENTRY * dllVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
static void ( APIENTRY * dllViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void (APIENTRY* dllCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* dllCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* dllCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* dllCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* dllGetCompressedTexImageARB)(GLenum target, GLint lod, void* img);
|
||||
|
||||
static void APIENTRY logAccum(GLenum op, GLfloat value)
|
||||
{
|
||||
fprintf( glw_state.log_fp, "glAccum\n" );
|
||||
@@ -2994,6 +3006,12 @@ void QGL_Shutdown( void )
|
||||
qglVertexPointer = NULL;
|
||||
qglViewport = NULL;
|
||||
|
||||
qglCompressedTexImage3DARB = NULL;
|
||||
qglCompressedTexImage2DARB = NULL;
|
||||
qglCompressedTexSubImage3DARB = NULL;
|
||||
qglCompressedTexSubImage2DARB = NULL;
|
||||
qglGetCompressedTexImageARB = NULL;
|
||||
|
||||
// bk001129 - from cvs1.17 (mkv)
|
||||
#if defined(__FX__)
|
||||
qfxMesaCreateContext = NULL;
|
||||
@@ -3391,6 +3409,12 @@ qboolean QGL_Init( const char *dllname )
|
||||
qglVertexPointer = dllVertexPointer = GPA( "glVertexPointer" );
|
||||
qglViewport = dllViewport = GPA( "glViewport" );
|
||||
|
||||
qglCompressedTexImage3DARB = dllCompressedTexImage3DARB = GPA("glCompressedTexImage3DARB");
|
||||
qglCompressedTexImage2DARB = dllCompressedTexImage2DARB = GPA("qglCompressedTexImage2DARB");
|
||||
qglCompressedTexSubImage3DARB = dllCompressedTexSubImage3DARB = GPA("qglCompressedTexSubImage3DARB");
|
||||
qglCompressedTexSubImage2DARB = dllCompressedTexSubImage2DARB = GPA("qglCompressedTexSubImage2DARB");
|
||||
qglGetCompressedTexImageARB = dllGetCompressedTexImageARB = GPA("qglGetCompressedTexImageARB");
|
||||
|
||||
// bk001129 - from cvs1.17 (mkv)
|
||||
#if defined(__FX__)
|
||||
qfxMesaCreateContext = GPA("fxMesaCreateContext");
|
||||
@@ -4141,6 +4165,12 @@ void QGL_EnableLogging( qboolean enable ) {
|
||||
qglVertex4sv = dllVertex4sv ;
|
||||
qglVertexPointer = dllVertexPointer ;
|
||||
qglViewport = dllViewport ;
|
||||
|
||||
qglCompressedTexImage3DARB = dllCompressedTexImage3DARB;
|
||||
qglCompressedTexImage2DARB = dllCompressedTexImage2DARB;
|
||||
qglCompressedTexSubImage3DARB = dllCompressedTexSubImage3DARB;
|
||||
qglCompressedTexSubImage2DARB = dllCompressedTexSubImage2DARB;
|
||||
qglGetCompressedTexImageARB = dllGetCompressedTexImageARB;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -404,6 +404,11 @@ void ( APIENTRY * qglVertex4s )(GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
void ( APIENTRY * qglVertex4sv )(const GLshort *v);
|
||||
void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY* qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* qglGetCompressedTexImageARB)(GLenum target, GLint lod, void* img);
|
||||
|
||||
void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t );
|
||||
void ( APIENTRY * qglActiveTextureARB )( GLenum texture );
|
||||
@@ -749,6 +754,12 @@ static void ( APIENTRY * dllVertex4sv )(const GLshort *v);
|
||||
static void ( APIENTRY * dllVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
static void ( APIENTRY * dllViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void (APIENTRY* dllCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* dllCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* dllCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* dllCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
|
||||
void (APIENTRY* dllGetCompressedTexImageARB)(GLenum target, GLint lod, void* img);
|
||||
|
||||
static const char * BooleanToString( GLboolean b )
|
||||
{
|
||||
if ( b == GL_FALSE )
|
||||
@@ -3159,6 +3170,12 @@ void QGL_Shutdown( void )
|
||||
qglVertexPointer = NULL;
|
||||
qglViewport = NULL;
|
||||
|
||||
qglCompressedTexImage3DARB = NULL;
|
||||
qglCompressedTexImage2DARB = NULL;
|
||||
qglCompressedTexSubImage3DARB = NULL;
|
||||
qglCompressedTexSubImage2DARB = NULL;
|
||||
qglGetCompressedTexImageARB = NULL;
|
||||
|
||||
qwglCopyContext = NULL;
|
||||
qwglCreateContext = NULL;
|
||||
qwglCreateLayerContext = NULL;
|
||||
@@ -3611,6 +3628,12 @@ qboolean QGL_Init( const char *dllname )
|
||||
qglVertexPointer = dllVertexPointer = GPA( "glVertexPointer" );
|
||||
qglViewport = dllViewport = GPA( "glViewport" );
|
||||
|
||||
qglCompressedTexImage3DARB = dllCompressedTexImage3DARB = GPA("glCompressedTexImage3D");
|
||||
qglCompressedTexImage2DARB = dllCompressedTexImage2DARB = GPA("glCompressedTexImage2D");
|
||||
qglCompressedTexSubImage3DARB = dllCompressedTexSubImage3DARB = GPA("glCompressedTexSubImage3D");
|
||||
qglCompressedTexSubImage2DARB = dllCompressedTexSubImage2DARB = GPA("glCompressedTexSubImage2D");
|
||||
qglGetCompressedTexImageARB = dllGetCompressedTexImageARB = GPA("glGetCompressedTexImage");
|
||||
|
||||
qwglCopyContext = GPA( "wglCopyContext" );
|
||||
qwglCreateContext = GPA( "wglCreateContext" );
|
||||
qwglCreateLayerContext = GPA( "wglCreateLayerContext" );
|
||||
@@ -4370,6 +4393,12 @@ void QGL_EnableLogging( qboolean enable )
|
||||
qglVertex4sv = dllVertex4sv ;
|
||||
qglVertexPointer = dllVertexPointer ;
|
||||
qglViewport = dllViewport ;
|
||||
|
||||
qglCompressedTexImage3DARB = dllCompressedTexImage3DARB;
|
||||
qglCompressedTexImage2DARB = dllCompressedTexImage2DARB;
|
||||
qglCompressedTexSubImage3DARB = dllCompressedTexSubImage3DARB;
|
||||
qglCompressedTexSubImage2DARB = dllCompressedTexSubImage2DARB;
|
||||
qglGetCompressedTexImageARB = dllGetCompressedTexImageARB;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user