mirror of
https://github.com/nillerusr/source-engine.git
synced 2024-12-22 06:06:50 +00:00
add more custom screen resolutions, fix build
This commit is contained in:
parent
0fb75b41fd
commit
303b387e76
@ -595,9 +595,13 @@ void GLMDisplayInfo::PopulateModes( void )
|
||||
// Add double of everything also - Retina proofing hopefully.
|
||||
m_modes->AddToTail( new GLMDisplayMode( w * 2, h * 2, 0 ) );
|
||||
}
|
||||
|
||||
m_modes->AddToTail( new GLMDisplayMode( w, w * ((float)m_info.m_displayPixelHeight/m_info.m_displayPixelWidth), 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
m_modes->AddToTail( new GLMDisplayMode( m_info.m_displayPixelWidth / 2, m_info.m_displayPixelHeight / 2, 0 ) );
|
||||
|
||||
m_modes->Sort( DisplayModeSortFunction );
|
||||
|
||||
// remove dupes.
|
||||
|
@ -2286,7 +2286,9 @@ bool CVideoMode_MaterialSystem::Init( )
|
||||
int bitsperpixel = 32;
|
||||
|
||||
bool bAllowSmallModes = false;
|
||||
#ifndef ANDROID
|
||||
if ( CommandLine()->FindParm( "-small" ) )
|
||||
#endif
|
||||
{
|
||||
bAllowSmallModes = true;
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ void CGame::HandleMsg_Close( const InputEvent_t &event )
|
||||
|
||||
void CGame::DispatchInputEvent( const InputEvent_t &event )
|
||||
{
|
||||
switch( event.m_nType )
|
||||
switch( event.m_nType & 0xFFFF )
|
||||
{
|
||||
// Handle button events specially,
|
||||
// since we have all manner of crazy filtering going on when dealing with them
|
||||
|
File diff suppressed because one or more lines are too long
@ -735,7 +735,7 @@ public:
|
||||
|
||||
virtual bool IsConnectedUserInfoChangeAllowed( IConVar *pCvar );
|
||||
|
||||
virtual void IN_TouchEvent( int type, int fingerId, int x, int y );
|
||||
virtual void IN_TouchEvent( uint data, uint data2, uint data3, uint data4 );
|
||||
private:
|
||||
void UncacheAllMaterials( );
|
||||
void ResetStringTablePointers();
|
||||
@ -1424,17 +1424,24 @@ int CHLClient::IN_KeyEvent( int eventcode, ButtonCode_t keynum, const char *pszC
|
||||
return input->KeyEvent( eventcode, keynum, pszCurrentBinding );
|
||||
}
|
||||
|
||||
void CHLClient::IN_TouchEvent( int type, int fingerId, int x, int y )
|
||||
void CHLClient::IN_TouchEvent( uint data, uint data2, uint data3, uint data4 )
|
||||
{
|
||||
if( enginevgui->IsGameUIVisible() )
|
||||
return;
|
||||
|
||||
touch_event_t ev;
|
||||
|
||||
ev.type = type;
|
||||
ev.fingerid = fingerId;
|
||||
ev.x = x;
|
||||
ev.y = y;
|
||||
ev.type = data & 0xFFFF;
|
||||
ev.fingerid = (data >> 16) & 0xFFFF;
|
||||
ev.x = (double)((data2 >> 16) & 0xFFFF) / 0xFFFF;
|
||||
ev.y = (double)(data2 & 0xFFFF) / 0xFFFF;
|
||||
|
||||
union{uint i;float f;} ifconv;
|
||||
ifconv.i = data3;
|
||||
ev.dx = ifconv.f;
|
||||
|
||||
ifconv.i = data4;
|
||||
ev.dy = ifconv.f;
|
||||
|
||||
gTouch.ProcessEvent( &ev );
|
||||
}
|
||||
|
@ -62,11 +62,36 @@ CTouchPanel::CTouchPanel( vgui::VPANEL parent ) : BaseClass( NULL, "TouchPanel"
|
||||
SetVisible( true );
|
||||
}
|
||||
|
||||
|
||||
void CTouchPanel::Paint()
|
||||
{
|
||||
gTouch.Frame();
|
||||
}
|
||||
|
||||
void CTouchPanel::OnScreenSizeChanged(int iOldWide, int iOldTall)
|
||||
{
|
||||
BaseClass::OnScreenSizeChanged(iOldWide, iOldTall);
|
||||
|
||||
int w,h;
|
||||
w = ScreenWidth();
|
||||
h = ScreenHeight();
|
||||
gTouch.screen_w = ScreenWidth(); gTouch.screen_h = h;
|
||||
|
||||
SetBounds( 0, 0, w, h );
|
||||
}
|
||||
|
||||
void CTouchPanel::ApplySchemeSettings(vgui::IScheme *pScheme)
|
||||
{
|
||||
BaseClass::ApplySchemeSettings(pScheme);
|
||||
|
||||
int w,h;
|
||||
w = ScreenWidth();
|
||||
h = ScreenHeight();
|
||||
gTouch.screen_w = ScreenWidth(); gTouch.screen_h = h;
|
||||
|
||||
SetBounds( 0, 0, w, h );
|
||||
}
|
||||
|
||||
CON_COMMAND( touch_addbutton, "add native touch button" )
|
||||
{
|
||||
rgba_t color;
|
||||
@ -282,7 +307,7 @@ void CTouchControls::Init()
|
||||
char buf[256];
|
||||
Q_snprintf(buf, sizeof buf, "exec %s\n", touch_config_file.GetString());
|
||||
engine->ClientCmd_Unrestricted(buf);
|
||||
|
||||
|
||||
Q_snprintf(buf, sizeof buf, "cfg/%s", touch_config_file.GetString());
|
||||
if( !filesystem->FileExists(buf) )
|
||||
WriteConfig();
|
||||
@ -530,8 +555,8 @@ void CTouchControls::ProcessEvent(touch_event_t *ev)
|
||||
|
||||
void CTouchControls::EditEvent(touch_event_t *ev)
|
||||
{
|
||||
float x = ev->x / (float)screen_w;
|
||||
float y = ev->y / (float)screen_h;
|
||||
const float x = ev->x;
|
||||
const float y = ev->y;
|
||||
|
||||
//CUtlLinkedList<CTouchButton*>::iterator it;
|
||||
|
||||
@ -556,13 +581,11 @@ void CTouchControls::EditEvent(touch_event_t *ev)
|
||||
{
|
||||
move_finger = ev->fingerid;
|
||||
selection = btn;
|
||||
dx = x; dy = y;
|
||||
break;
|
||||
}
|
||||
else if( resize_finger == -1 )
|
||||
{
|
||||
resize_finger = ev->fingerid;
|
||||
dx2 = x; dy2 = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -574,7 +597,6 @@ void CTouchControls::EditEvent(touch_event_t *ev)
|
||||
move_finger = -1;
|
||||
IN_CheckCoords( &selection->x1, &selection->y1, &selection->x2, &selection->y2 );
|
||||
selection = nullptr;
|
||||
dx = dy = 0.f;
|
||||
}
|
||||
else if( ev->fingerid == resize_finger )
|
||||
resize_finger = -1;
|
||||
@ -586,20 +608,15 @@ void CTouchControls::EditEvent(touch_event_t *ev)
|
||||
|
||||
if( move_finger == ev->fingerid )
|
||||
{
|
||||
selection->x1 += x-dx;
|
||||
selection->x2 += x-dx;
|
||||
selection->y1 += y-dy;
|
||||
selection->y2 += y-dy;
|
||||
|
||||
dx = x;
|
||||
dy = y;
|
||||
selection->x1 += ev->dx;
|
||||
selection->x2 += ev->dx;
|
||||
selection->y1 += ev->dy;
|
||||
selection->y2 += ev->dy;
|
||||
}
|
||||
else if( resize_finger == ev->fingerid )
|
||||
{
|
||||
selection->x2 += x-dx2;
|
||||
selection->y2 += y-dy2;
|
||||
|
||||
dx2 = x; dy2 = y;
|
||||
selection->x2 += ev->dx;
|
||||
selection->y2 += ev->dy;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -607,8 +624,8 @@ void CTouchControls::EditEvent(touch_event_t *ev)
|
||||
|
||||
void CTouchControls::FingerMotion(touch_event_t *ev) // finger in my ass
|
||||
{
|
||||
float x = ev->x / (float)screen_w;
|
||||
float y = ev->y / (float)screen_h;
|
||||
const float x = ev->x;
|
||||
const float y = ev->y;
|
||||
|
||||
float f, s;
|
||||
|
||||
@ -627,10 +644,8 @@ void CTouchControls::FingerMotion(touch_event_t *ev) // finger in my ass
|
||||
}
|
||||
else if( btn->type == touch_look )
|
||||
{
|
||||
yaw += touch_yaw.GetFloat() * ( dx - x ) * sensitivity.GetFloat();
|
||||
pitch -= touch_pitch.GetFloat() * ( dy - y ) * sensitivity.GetFloat();
|
||||
dx = x;
|
||||
dy = y;
|
||||
yaw -= touch_yaw.GetFloat() * ev->dx * sensitivity.GetFloat();
|
||||
pitch += touch_pitch.GetFloat() * ev->dy * sensitivity.GetFloat();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -638,8 +653,8 @@ void CTouchControls::FingerMotion(touch_event_t *ev) // finger in my ass
|
||||
|
||||
void CTouchControls::FingerPress(touch_event_t *ev)
|
||||
{
|
||||
float x = ev->x / (float)screen_w;
|
||||
float y = ev->y / (float)screen_h;
|
||||
const float x = ev->x;
|
||||
const float y = ev->y;
|
||||
|
||||
CUtlLinkedList<CTouchButton*>::iterator it;
|
||||
|
||||
@ -668,11 +683,7 @@ void CTouchControls::FingerPress(touch_event_t *ev)
|
||||
else if( btn->type == touch_look )
|
||||
{
|
||||
if( look_finger == -1 )
|
||||
{
|
||||
dx = x;
|
||||
dy = y;
|
||||
look_finger = ev->fingerid;
|
||||
}
|
||||
else
|
||||
btn->finger = look_finger;
|
||||
}
|
||||
@ -722,7 +733,7 @@ void CTouchControls::EnableTouchEdit(bool enable)
|
||||
resize_finger = move_finger = look_finger = wheel_finger = -1;
|
||||
move_button = NULL;
|
||||
configchanged = true;
|
||||
AddButton( "close_edit", "vgui/touch/exit", "touch_disableedit", 0.010000, 0.837778, 0.080000, 0.980000, rgba_t(255,255,255,255), 0, 1.f, TOUCH_FL_NOEDIT );
|
||||
AddButton( "close_edit", "vgui/touch/back", "touch_disableedit", 0.010000, 0.837778, 0.080000, 0.980000, rgba_t(255,255,255,255), 0, 1.f, TOUCH_FL_NOEDIT );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -72,8 +72,7 @@ struct event_clientcmd_t
|
||||
struct event_s
|
||||
{
|
||||
int type;
|
||||
int x;
|
||||
int y;
|
||||
float x,y,dx,dy;
|
||||
int fingerid;
|
||||
} typedef touch_event_t;
|
||||
|
||||
@ -110,8 +109,11 @@ class CTouchPanel : public vgui::Panel
|
||||
public:
|
||||
CTouchPanel( vgui::VPANEL parent );
|
||||
virtual ~CTouchPanel( void ) {};
|
||||
|
||||
virtual void Paint();
|
||||
virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
|
||||
|
||||
protected:
|
||||
MESSAGE_FUNC_INT_INT( OnScreenSizeChanged, "OnScreenSizeChanged", oldwide, oldtall );
|
||||
};
|
||||
|
||||
abstract_class ITouchPanel
|
||||
@ -189,6 +191,8 @@ public:
|
||||
void EnableTouchEdit(bool enable);
|
||||
|
||||
CTouchPanel *touchPanel;
|
||||
float screen_h, screen_w;
|
||||
|
||||
private:
|
||||
bool initialized = false;
|
||||
ETouchState state;
|
||||
@ -200,7 +204,6 @@ private:
|
||||
CTouchButton *move_button;
|
||||
|
||||
float move_start_x, move_start_y;
|
||||
float dx, dy, dx2, dy2;
|
||||
|
||||
// editing
|
||||
CTouchButton *edit;
|
||||
@ -221,8 +224,6 @@ private:
|
||||
bool config_loaded;
|
||||
vgui::HFont textfont;
|
||||
int mouse_events;
|
||||
|
||||
float screen_h, screen_w;
|
||||
};
|
||||
|
||||
extern CTouchControls gTouch;
|
||||
|
@ -66,19 +66,7 @@ def build(bld):
|
||||
if bld.env.DEST_OS != 'android':
|
||||
install_path += '/'+bld.env.GAMES+'/bin'
|
||||
|
||||
source = [ 'touch.cpp', 'arch.c' ]
|
||||
|
||||
if bld.env.DEST_OS == 'android':
|
||||
source += [
|
||||
'third/minizip/mz_zip.c',
|
||||
'third/minizip/mz_strm.c',
|
||||
'third/minizip/mz_strm_mem.c',
|
||||
'third/minizip/mz_strm_buf.c',
|
||||
'third/minizip/mz_strm_split.c',
|
||||
'third/minizip/mz_strm_posix.c',
|
||||
'third/minizip/mz_strm_zlib.c',
|
||||
'third/minizip/mz_os_posix.c'
|
||||
]
|
||||
source = [ 'touch.cpp' ]
|
||||
|
||||
source += game["sources"]
|
||||
includes += game["includes"]
|
||||
|
@ -1041,6 +1041,7 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N
|
||||
unicodeText = g_pVGuiLocalize->Find("#GameUI_AspectWide16x10");
|
||||
g_pVGuiLocalize->ConvertUnicodeToANSI(unicodeText, pszAspectName[2], 32);
|
||||
|
||||
#ifndef ANDROID
|
||||
int iNormalItemID = m_pAspectRatio->AddItem( pszAspectName[0], NULL );
|
||||
int i16x9ItemID = m_pAspectRatio->AddItem( pszAspectName[1], NULL );
|
||||
int i16x10ItemID = m_pAspectRatio->AddItem( pszAspectName[2], NULL );
|
||||
@ -1061,6 +1062,12 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N
|
||||
m_pAspectRatio->ActivateItem( i16x10ItemID );
|
||||
break;
|
||||
}
|
||||
#else
|
||||
int iNormalItemID = m_pAspectRatio->AddItem( "lemonparty.org", NULL );
|
||||
m_pAspectRatio->ActivateItem( iNormalItemID );
|
||||
|
||||
m_pGammaButton->SetEnabled(false);
|
||||
#endif
|
||||
|
||||
char pszVRModeName[2][64];
|
||||
unicodeText = g_pVGuiLocalize->Find("#GameUI_Disabled");
|
||||
@ -1110,6 +1117,10 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N
|
||||
m_pWindowed->AddItem( "#GameUI_Windowed", NULL );
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
m_pWindowed->SetEnabled( false );
|
||||
#endif
|
||||
|
||||
LoadControlSettings("Resource\\OptionsSubVideo.res");
|
||||
|
||||
// Moved down here so we can set the Drop down's
|
||||
@ -1160,9 +1171,10 @@ void COptionsSubVideo::PrepareResolutionList()
|
||||
|
||||
// Clean up before filling the info again.
|
||||
m_pMode->DeleteAllItems();
|
||||
#ifndef ANDROID
|
||||
m_pAspectRatio->SetItemEnabled(1, false);
|
||||
m_pAspectRatio->SetItemEnabled(2, false);
|
||||
|
||||
#endif
|
||||
// get full video mode list
|
||||
vmode_t *plist = NULL;
|
||||
int count = 0;
|
||||
@ -1225,7 +1237,9 @@ void COptionsSubVideo::PrepareResolutionList()
|
||||
GetResolutionName( plist, sz, sizeof( sz ), desktopWidth, desktopHeight );
|
||||
|
||||
int itemID = -1;
|
||||
|
||||
int iAspectMode = GetScreenAspectMode( plist->width, plist->height );
|
||||
#ifndef ANDROID
|
||||
if ( iAspectMode > 0 )
|
||||
{
|
||||
m_pAspectRatio->SetItemEnabled( iAspectMode, true );
|
||||
@ -1237,8 +1251,15 @@ void COptionsSubVideo::PrepareResolutionList()
|
||||
{
|
||||
itemID = m_pMode->AddItem( sz, NULL);
|
||||
}
|
||||
#else
|
||||
float aspect = (float)plist->width / plist->height;
|
||||
float native_aspect = (float)desktopWidth / desktopHeight;
|
||||
|
||||
// try and find the best match for the resolution to be selected
|
||||
if( fabs(native_aspect - aspect) < 0.01f )
|
||||
itemID = m_pMode->AddItem( sz, NULL);
|
||||
#endif
|
||||
|
||||
// try and find the bestplistplistplist match for the resolution to be selected
|
||||
if ( plist->width == currentWidth && plist->height == currentHeight )
|
||||
{
|
||||
selectedItemID = itemID;
|
||||
@ -1250,7 +1271,9 @@ void COptionsSubVideo::PrepareResolutionList()
|
||||
}
|
||||
|
||||
// disable ratio selection if we can't display widescreen.
|
||||
#ifndef ANDROID
|
||||
m_pAspectRatio->SetEnabled( bFoundWidescreen );
|
||||
#endif
|
||||
|
||||
m_nSelectedMode = selectedItemID;
|
||||
|
||||
@ -1377,7 +1400,11 @@ void COptionsSubVideo::OnResetData()
|
||||
#endif
|
||||
|
||||
// reset gamma control
|
||||
#ifdef ANDROID
|
||||
m_pGammaButton->SetEnabled( false );
|
||||
#else
|
||||
m_pGammaButton->SetEnabled( !config.Windowed() );
|
||||
#endif
|
||||
|
||||
m_pHDContent->SetSelected( BUseHDContent() );
|
||||
|
||||
@ -1577,8 +1604,12 @@ void COptionsSubVideo::PerformLayout()
|
||||
|
||||
if ( m_pGammaButton )
|
||||
{
|
||||
#ifdef ANDROID
|
||||
m_pGammaButton->SetEnabled( false );
|
||||
#else
|
||||
const MaterialSystem_Config_t &config = materials->GetCurrentConfigForVideoCard();
|
||||
m_pGammaButton->SetEnabled( !config.Windowed() );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1600,10 +1631,12 @@ void COptionsSubVideo::OnTextChanged(Panel *pPanel, const char *pszText)
|
||||
OnDataChanged();
|
||||
}
|
||||
}
|
||||
else if (pPanel == m_pAspectRatio)
|
||||
{
|
||||
#ifndef ANDROID
|
||||
else if (pPanel == m_pAspectRatio)
|
||||
{
|
||||
PrepareResolutionList();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (pPanel == m_pWindowed)
|
||||
{
|
||||
PrepareResolutionList();
|
||||
@ -1645,7 +1678,11 @@ void COptionsSubVideo::EnableOrDisableWindowedForVR()
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef ANDROID
|
||||
m_pWindowed->SetEnabled( false );
|
||||
#else
|
||||
m_pWindowed->SetEnabled( true );
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -333,10 +333,7 @@ public:
|
||||
void JoystickButtonRelease( int joystickId, int button ); // same as above.
|
||||
void JoystickAxisMotion( int joystickId, int axis, int value );
|
||||
|
||||
void FingerDown( int fingerId, int x, int y );
|
||||
void FingerUp( int fingerId, int x, int y );
|
||||
void FingerMotion( int fingerId, int x, int y );
|
||||
|
||||
void FingerEvent( int eventType, int fingerId, float x, float y, float dx, float dy );
|
||||
|
||||
// Steam Controller
|
||||
void ReadSteamController( int iIndex );
|
||||
|
@ -24,19 +24,15 @@ int TouchSDLWatcher( void *userInfo, SDL_Event *event )
|
||||
if( !window )
|
||||
return 0;
|
||||
|
||||
int width, height;
|
||||
width = height = 0;
|
||||
SDL_GetWindowSize(window, &width, &height);
|
||||
|
||||
switch ( event->type ) {
|
||||
case SDL_FINGERDOWN:
|
||||
pInputSystem->FingerDown( event->tfinger.fingerId, event->tfinger.x*width, event->tfinger.y*height );
|
||||
pInputSystem->FingerEvent( IE_FingerDown, event->tfinger.fingerId, event->tfinger.x, event->tfinger.y, event->tfinger.dx, event->tfinger.dy );
|
||||
break;
|
||||
case SDL_FINGERUP:
|
||||
pInputSystem->FingerUp( event->tfinger.fingerId, event->tfinger.x*width, event->tfinger.y*height );
|
||||
pInputSystem->FingerEvent( IE_FingerUp, event->tfinger.fingerId, event->tfinger.x, event->tfinger.y, event->tfinger.dx, event->tfinger.dy );
|
||||
break;
|
||||
case SDL_FINGERMOTION:
|
||||
pInputSystem->FingerMotion( event->tfinger.fingerId, event->tfinger.x*width, event->tfinger.y*height );
|
||||
pInputSystem->FingerEvent( IE_FingerMotion ,event->tfinger.fingerId, event->tfinger.x, event->tfinger.y, event->tfinger.dx, event->tfinger.dy );
|
||||
break;
|
||||
}
|
||||
|
||||
@ -67,32 +63,20 @@ void CInputSystem::ShutdownTouch()
|
||||
m_bTouchInitialized = false;
|
||||
}
|
||||
|
||||
void CInputSystem::FingerDown(int fingerId, int x, int y)
|
||||
void CInputSystem::FingerEvent(int eventType, int fingerId, float x, float y, float dx, float dy)
|
||||
{
|
||||
m_touchAccumEvent = IE_FingerDown;
|
||||
m_touchAccumFingerId = fingerId;
|
||||
m_touchAccumX = x;
|
||||
m_touchAccumY = y;
|
||||
// Shit, but should work with arm/x86
|
||||
|
||||
PostEvent(IE_FingerDown, m_nLastSampleTick, fingerId, x, y);
|
||||
}
|
||||
|
||||
void CInputSystem::FingerUp(int fingerId, int x, int y)
|
||||
{
|
||||
m_touchAccumEvent = IE_FingerUp;
|
||||
m_touchAccumFingerId = fingerId;
|
||||
m_touchAccumX = x;
|
||||
m_touchAccumY = y;
|
||||
|
||||
PostEvent(IE_FingerUp, m_nLastSampleTick, fingerId, x, y);
|
||||
}
|
||||
|
||||
void CInputSystem::FingerMotion(int fingerId, int x, int y)
|
||||
{
|
||||
m_touchAccumEvent = IE_FingerMotion;
|
||||
m_touchAccumFingerId = fingerId;
|
||||
m_touchAccumX = x;
|
||||
m_touchAccumY = y;
|
||||
|
||||
PostEvent(IE_FingerMotion, m_nLastSampleTick, fingerId, x, y);
|
||||
int data0 = fingerId << 16 | eventType;
|
||||
int _x = (int)((double)x*0xFFFF);
|
||||
int _y = (int)((double)y*0xFFFF);
|
||||
int data1 = _x << 16 | (_y & 0xFFFF);
|
||||
|
||||
union{int i;float f;} ifconv;
|
||||
ifconv.f = dx;
|
||||
int _dx = ifconv.i;
|
||||
ifconv.f = dy;
|
||||
int _dy = ifconv.i;
|
||||
|
||||
PostEvent(data0, m_nLastSampleTick, data1, _dx, _dy);
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -163,15 +163,10 @@ static FILE *GetDebugFileHandle( void )
|
||||
// mat_autosave_glshaders instructs the engine to save out the shader table at key points
|
||||
// to the filename glshaders.cfg
|
||||
//
|
||||
#ifdef ANDROID
|
||||
ConVar mat_autosave_glshaders( "mat_autosave_glshaders", "0" );
|
||||
ConVar mat_autoload_glshaders( "mat_autoload_glshaders", "0" );
|
||||
#else
|
||||
|
||||
ConVar mat_autosave_glshaders( "mat_autosave_glshaders", "1" );
|
||||
ConVar mat_autoload_glshaders( "mat_autoload_glshaders", "1" );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
// Explicit instantiation of shader buffer implementation
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -943,7 +938,8 @@ void CShaderManager::Shutdown()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DX_TO_GL_ABSTRACTION
|
||||
#if defined (DX_TO_GL_ABSTRACTION) && !defined (ANDROID)
|
||||
|
||||
if (mat_autosave_glshaders.GetInt())
|
||||
{
|
||||
SaveShaderCache("glshaders.cfg");
|
||||
@ -3757,6 +3753,10 @@ CON_COMMAND( mat_shadercount, "display count of all shaders and reset that count
|
||||
#if defined( DX_TO_GL_ABSTRACTION )
|
||||
void CShaderManager::DoStartupShaderPreloading()
|
||||
{
|
||||
#ifdef ANDROID // Too slow
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (mat_autoload_glshaders.GetInt())
|
||||
{
|
||||
double flStartTime = Plat_FloatTime();
|
||||
|
@ -790,7 +790,7 @@ public:
|
||||
|
||||
virtual bool IsConnectedUserInfoChangeAllowed( IConVar *pCvar ) = 0;
|
||||
|
||||
virtual void IN_TouchEvent( int type, int fingerId, int x, int y ) = 0;
|
||||
virtual void IN_TouchEvent( uint data, uint data2, uint data3, uint data4 ) = 0;
|
||||
};
|
||||
|
||||
#define CLIENT_DLL_INTERFACE_VERSION "VClient017"
|
||||
|
@ -581,6 +581,20 @@ FSReturnCode_t FileSystem_LoadSearchPaths( CFSSearchPathsInit &initInfo )
|
||||
}
|
||||
}
|
||||
|
||||
const char *ExtraVpkPaths = getenv( "EXTRAS_VPK_PATH" );
|
||||
char szAbsSearchPath[MAX_PATH];
|
||||
|
||||
if( ExtraVpkPaths )
|
||||
{
|
||||
CUtlStringList vecPaths;
|
||||
V_SplitString( ExtraVpkPaths, ",", vecPaths );
|
||||
|
||||
FOR_EACH_VEC( vecPaths, idxExtraPath )
|
||||
{
|
||||
FileSystem_AddLoadedSearchPath( initInfo, "GAME", vecPaths[idxExtraPath], false );
|
||||
}
|
||||
}
|
||||
|
||||
bool bLowViolence = initInfo.m_bLowViolence;
|
||||
for ( KeyValues *pCur=pSearchPaths->GetFirstValue(); pCur; pCur=pCur->GetNextValue() )
|
||||
{
|
||||
@ -602,11 +616,12 @@ FSReturnCode_t FileSystem_LoadSearchPaths( CFSSearchPathsInit &initInfo )
|
||||
// We need a special identifier in the gameinfo.txt here because the base hl2 folder exists in different places.
|
||||
// In the case of a game or a Steam-launched dedicated server, all the necessary prior engine content is mapped in with the Steam depots,
|
||||
// so we can just use the path as-is.
|
||||
|
||||
pLocation += strlen( BASESOURCEPATHS_TOKEN );
|
||||
}
|
||||
|
||||
|
||||
CUtlStringList vecFullLocationPaths;
|
||||
char szAbsSearchPath[MAX_PATH];
|
||||
V_MakeAbsolutePath( szAbsSearchPath, sizeof( szAbsSearchPath ), pLocation, pszBaseDir );
|
||||
|
||||
// Now resolve any ./'s.
|
||||
|
@ -993,6 +993,7 @@ typedef enum _D3DTEXTUREADDRESS
|
||||
|
||||
typedef enum _D3DSHADEMODE
|
||||
{
|
||||
D3DSHADE_NONE = 0,
|
||||
D3DSHADE_FLAT = 1,
|
||||
D3DSHADE_GOURAUD = 2,
|
||||
D3DSHADE_PHONG = 3,
|
||||
|
@ -48,8 +48,8 @@ CFLAGS = {
|
||||
'common': {
|
||||
# disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP
|
||||
'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS', '/Zc:threadSafeInit-', '/MT'],
|
||||
'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden'],
|
||||
'gcc': ['-g', '-fvisibility=hidden'],
|
||||
'clang': ['-g0', '-gdwarf-2', '-fvisibility=hidden'],
|
||||
'gcc': ['-g0', '-fvisibility=hidden'],
|
||||
'owcc': ['-fno-short-enum', '-ffloat-store', '-g3']
|
||||
},
|
||||
'fast': {
|
||||
|
@ -255,7 +255,7 @@ class Android:
|
||||
if self.is_arm():
|
||||
if self.arch == 'armeabi-v7a':
|
||||
# ARMv7 support
|
||||
cflags += ['-mthumb', '-mfpu=neon', '-mcpu=cortex-a9', '-DHAVE_EFFICIENT_UNALIGNED_ACCESS', '-DVECTORIZE_SINCOS']
|
||||
cflags += ['-mthumb', '-mfpu=neon-vfpv4', '-mcpu=cortex-a7', '-mtune=cortex-a7', '-DHAVE_EFFICIENT_UNALIGNED_ACCESS', '-DVECTORIZE_SINCOS']
|
||||
|
||||
if not self.is_clang() and not self.is_host():
|
||||
cflags += [ '-mvectorize-with-neon-quad' ]
|
||||
|
@ -3361,11 +3361,11 @@ void convert_texture( GLint &internalformat, GLsizei width, GLsizei height, GLen
|
||||
if( format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA )
|
||||
internalformat = format;
|
||||
|
||||
// if( internalformat == GL_SRGB8_ALPHA8 )
|
||||
// internalformat = GL_RGBA;
|
||||
if( internalformat == GL_SRGB8_ALPHA8 )
|
||||
internalformat = GL_RGBA;
|
||||
|
||||
// if( internalformat == GL_SRGB8 )
|
||||
// internalformat = GL_RGB;
|
||||
if( internalformat == GL_SRGB8 )
|
||||
internalformat = GL_RGB;
|
||||
|
||||
if( data )
|
||||
{
|
||||
@ -3412,12 +3412,12 @@ void convert_texture( GLint &internalformat, GLsizei width, GLsizei height, GLen
|
||||
else if( internalformat == GL_SRGB8_ALPHA8 )
|
||||
{
|
||||
// pixel_srgb_inplace( data, 4, width, height );
|
||||
internalformat = GL_RGBA;
|
||||
// internalformat = GL_RGBA;
|
||||
}
|
||||
else if( internalformat == GL_SRGB8 )
|
||||
{
|
||||
// pixel_srgb_inplace( data, 3, width, height );
|
||||
internalformat = GL_RGB;
|
||||
// internalformat = GL_RGB;
|
||||
}
|
||||
|
||||
}
|
||||
@ -3659,15 +3659,17 @@ void CGLMTex::WriteTexels( GLMTexLockDesc *desc, bool writeWholeSlice, bool noDa
|
||||
GLenum glDataFormat = format->m_glDataFormat; // this could change if expansion kicks in
|
||||
GLenum glDataType = format->m_glDataType;
|
||||
|
||||
GLMTexLayoutSlice *slice = &m_layout->m_slices[ desc->m_sliceIndex ];
|
||||
GLMTexLayoutSlice *slice = &m_layout->m_slices[ desc->m_sliceIndex ];
|
||||
void *sliceAddress = m_backing ? (m_backing + slice->m_storageOffset) : NULL; // this would change for PBO
|
||||
|
||||
// allow use of subimage if the target is texture2D and it has already been teximage'd
|
||||
bool mayUseSubImage = false;
|
||||
#ifdef ANDROID
|
||||
if ( (target==GL_TEXTURE_2D) && (m_sliceFlags[ desc->m_sliceIndex ] & kSliceValid) )
|
||||
{
|
||||
// mayUseSubImage = gl_enabletexsubimage.GetInt() != 0;
|
||||
mayUseSubImage = gl_enabletexsubimage.GetInt() != 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// check flavor, 2D, 3D, or cube map
|
||||
// we also have the choice to use subimage if this is a tex already created. (open question as to benefit)
|
||||
|
@ -29,11 +29,13 @@
|
||||
#ifdef _X360
|
||||
#include "xbox/xbox_win32stubs.h"
|
||||
#endif
|
||||
#include "MatSystemSurface.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
using namespace vgui;
|
||||
extern CMatSystemSurface g_MatSystemSurface;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Vgui input events
|
||||
@ -374,7 +376,7 @@ static vgui::MouseCode ButtonCodeToMouseCode( ButtonCode_t buttonCode )
|
||||
//-----------------------------------------------------------------------------
|
||||
bool InputHandleInputEvent( const InputEvent_t &event )
|
||||
{
|
||||
switch( event.m_nType )
|
||||
switch( event.m_nType & 0xFFFF )
|
||||
{
|
||||
case IE_ButtonPressed:
|
||||
{
|
||||
@ -425,25 +427,35 @@ bool InputHandleInputEvent( const InputEvent_t &event )
|
||||
break;
|
||||
case IE_FingerDown:
|
||||
{
|
||||
//g_pIInput->InternalCursorMoved( event.m_nData2, event.m_nData3 );
|
||||
g_pIInput->UpdateCursorPosInternal( event.m_nData2, event.m_nData3 );
|
||||
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
|
||||
uint data = (uint)event.m_nData;
|
||||
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF);
|
||||
y = h*((double)(data & 0xFFFF) / 0xFFFF);
|
||||
g_pIInput->UpdateCursorPosInternal( x, y );
|
||||
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_PRESSED );
|
||||
g_pIInput->InternalMousePressed( MOUSE_LEFT );
|
||||
}
|
||||
return true;
|
||||
case IE_FingerUp:
|
||||
{
|
||||
g_pIInput->UpdateCursorPosInternal( event.m_nData2, event.m_nData3 );
|
||||
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_RELEASED );
|
||||
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
|
||||
uint data = (uint)event.m_nData;
|
||||
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF);
|
||||
y = h*((double)(data & 0xFFFF) / 0xFFFF);
|
||||
g_pIInput->UpdateCursorPosInternal( x, y );
|
||||
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_RELEASED );
|
||||
g_pIInput->InternalMouseReleased( MOUSE_LEFT );
|
||||
}
|
||||
return true;
|
||||
case IE_FingerMotion:
|
||||
{
|
||||
//g_pIInput->UpdateCursorPosInternal( event.m_nData2, event.m_nData3 );
|
||||
g_pIInput->InternalCursorMoved( event.m_nData2, event.m_nData3 );
|
||||
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
|
||||
uint data = (uint)event.m_nData;
|
||||
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF);
|
||||
y = h*((double)(data & 0xFFFF) / 0xFFFF);
|
||||
g_pIInput->InternalCursorMoved( x, y );
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
case IE_ButtonDoubleClicked:
|
||||
{
|
||||
// NOTE: data2 is the virtual key code (data1 contains the scan-code one)
|
||||
|
6
wscript
6
wscript
@ -284,11 +284,9 @@ def configure(conf):
|
||||
]
|
||||
|
||||
if conf.env.DEST_CPU == 'arm':
|
||||
flags += ['-fsigned-char', '-mfpu=neon']
|
||||
flags += ['-fsigned-char']
|
||||
|
||||
if conf.env.DEST_OS == 'android':
|
||||
flags += ['-mcpu=cortex-a15', '-mtune=cortex-a15']
|
||||
else:
|
||||
if conf.env.DEST_OS != 'android':
|
||||
flags += ['-march=native', '-mtune=native']
|
||||
else:
|
||||
flags += ['-march=native','-mtune=native','-mfpmath=sse', '-msse', '-msse2']
|
||||
|
Loading…
Reference in New Issue
Block a user