Browse Source

add more custom screen resolutions, fix build

ToGLES3
nillerusr 3 years ago
parent
commit
303b387e76
  1. 4
      appframework/glmdisplaydb_linuxwin.inl
  2. 2
      engine/sys_getmodes.cpp
  3. 2
      engine/sys_mainwind.cpp
  4. 673
      game/client/arch.c
  5. 19
      game/client/cdll_client_int.cpp
  6. 69
      game/client/touch.cpp
  7. 13
      game/client/touch.h
  8. 14
      game/client/wscript
  9. 41
      gameui/OptionsSubVideo.cpp
  10. 5
      inputsystem/inputsystem.h
  11. 46
      inputsystem/touch_sdl.cpp
  12. BIN
      lib/android/armeabi-v7a/libandroid_support.a
  13. BIN
      lib/android/armeabi-v7a/libfreetype2.a
  14. 14
      materialsystem/shaderapidx9/vertexshaderdx8.cpp
  15. 2
      public/cdll_int.h
  16. 17
      public/filesystem_init.cpp
  17. 1
      public/togles/linuxwin/dxabstract_types.h
  18. 4
      scripts/waifulib/compiler_optimizations.py
  19. 2
      scripts/waifulib/xcompile.py
  20. 16
      togles/linuxwin/cglmtex.cpp
  21. 24
      vguimatsurface/Input.cpp
  22. 6
      wscript

4
appframework/glmdisplaydb_linuxwin.inl

@ -595,9 +595,13 @@ void GLMDisplayInfo::PopulateModes( void ) @@ -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.

2
engine/sys_getmodes.cpp

@ -2286,7 +2286,9 @@ bool CVideoMode_MaterialSystem::Init( ) @@ -2286,7 +2286,9 @@ bool CVideoMode_MaterialSystem::Init( )
int bitsperpixel = 32;
bool bAllowSmallModes = false;
#ifndef ANDROID
if ( CommandLine()->FindParm( "-small" ) )
#endif
{
bAllowSmallModes = true;
}

2
engine/sys_mainwind.cpp

@ -355,7 +355,7 @@ void CGame::HandleMsg_Close( const InputEvent_t &event ) @@ -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

673
game/client/arch.c

File diff suppressed because one or more lines are too long

19
game/client/cdll_client_int.cpp

@ -735,7 +735,7 @@ public: @@ -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 @@ -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 );
}

69
game/client/touch.cpp

@ -62,11 +62,36 @@ CTouchPanel::CTouchPanel( vgui::VPANEL parent ) : BaseClass( NULL, "TouchPanel" @@ -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;
@ -530,8 +555,8 @@ void CTouchControls::ProcessEvent(touch_event_t *ev) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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 @@ -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 @@ -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) @@ -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) @@ -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
{

13
game/client/touch.h

@ -72,8 +72,7 @@ struct event_clientcmd_t @@ -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 @@ -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: @@ -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: @@ -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: @@ -221,8 +224,6 @@ private:
bool config_loaded;
vgui::HFont textfont;
int mouse_events;
float screen_h, screen_w;
};
extern CTouchControls gTouch;

14
game/client/wscript

@ -66,19 +66,7 @@ def build(bld): @@ -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"]

41
gameui/OptionsSubVideo.cpp

@ -1041,6 +1041,7 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N @@ -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 @@ -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 @@ -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() @@ -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() @@ -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() @@ -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() @@ -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() @@ -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() @@ -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) @@ -1600,10 +1631,12 @@ void COptionsSubVideo::OnTextChanged(Panel *pPanel, const char *pszText)
OnDataChanged();
}
}
#ifndef ANDROID
else if (pPanel == m_pAspectRatio)
{
PrepareResolutionList();
}
#endif
else if (pPanel == m_pWindowed)
{
PrepareResolutionList();
@ -1645,7 +1678,11 @@ void COptionsSubVideo::EnableOrDisableWindowedForVR() @@ -1645,7 +1678,11 @@ void COptionsSubVideo::EnableOrDisableWindowedForVR()
}
else
{
#ifdef ANDROID
m_pWindowed->SetEnabled( false );
#else
m_pWindowed->SetEnabled( true );
#endif
}
}

5
inputsystem/inputsystem.h

@ -333,10 +333,7 @@ public: @@ -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 );

46
inputsystem/touch_sdl.cpp

@ -24,19 +24,15 @@ int TouchSDLWatcher( void *userInfo, SDL_Event *event ) @@ -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() @@ -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;
PostEvent(IE_FingerDown, m_nLastSampleTick, fingerId, x, y);
}
// Shit, but should work with arm/x86
void CInputSystem::FingerUp(int fingerId, int x, int y)
{
m_touchAccumEvent = IE_FingerUp;
m_touchAccumFingerId = fingerId;
m_touchAccumX = x;
m_touchAccumY = y;
int data0 = fingerId << 16 | eventType;
int _x = (int)((double)x*0xFFFF);
int _y = (int)((double)y*0xFFFF);
int data1 = _x << 16 | (_y & 0xFFFF);
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;
union{int i;float f;} ifconv;
ifconv.f = dx;
int _dx = ifconv.i;
ifconv.f = dy;
int _dy = ifconv.i;
PostEvent(IE_FingerMotion, m_nLastSampleTick, fingerId, x, y);
PostEvent(data0, m_nLastSampleTick, data1, _dx, _dy);
}

BIN
lib/android/armeabi-v7a/libandroid_support.a

Binary file not shown.

BIN
lib/android/armeabi-v7a/libfreetype2.a

Binary file not shown.

14
materialsystem/shaderapidx9/vertexshaderdx8.cpp

@ -163,15 +163,10 @@ static FILE *GetDebugFileHandle( void ) @@ -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() @@ -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 @@ -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();

2
public/cdll_int.h

@ -790,7 +790,7 @@ public: @@ -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"

17
public/filesystem_init.cpp

@ -581,6 +581,20 @@ FSReturnCode_t FileSystem_LoadSearchPaths( CFSSearchPathsInit &initInfo ) @@ -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 ) @@ -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.

1
public/togles/linuxwin/dxabstract_types.h

@ -993,6 +993,7 @@ typedef enum _D3DTEXTUREADDRESS @@ -993,6 +993,7 @@ typedef enum _D3DTEXTUREADDRESS
typedef enum _D3DSHADEMODE
{
D3DSHADE_NONE = 0,
D3DSHADE_FLAT = 1,
D3DSHADE_GOURAUD = 2,
D3DSHADE_PHONG = 3,

4
scripts/waifulib/compiler_optimizations.py

@ -48,8 +48,8 @@ CFLAGS = { @@ -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': {

2
scripts/waifulib/xcompile.py

@ -255,7 +255,7 @@ class Android: @@ -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' ]

16
togles/linuxwin/cglmtex.cpp

@ -3361,11 +3361,11 @@ void convert_texture( GLint &internalformat, GLsizei width, GLsizei height, GLen @@ -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 @@ -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;
}
}
@ -3664,10 +3664,12 @@ void CGLMTex::WriteTexels( GLMTexLockDesc *desc, bool writeWholeSlice, bool noDa @@ -3664,10 +3664,12 @@ void CGLMTex::WriteTexels( GLMTexLockDesc *desc, bool writeWholeSlice, bool noDa
// 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)

24
vguimatsurface/Input.cpp

@ -29,11 +29,13 @@ @@ -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 ) @@ -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,23 +427,33 @@ bool InputHandleInputEvent( const InputEvent_t &event ) @@ -425,23 +427,33 @@ 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 );
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;
case IE_ButtonDoubleClicked:

6
wscript

@ -284,11 +284,9 @@ def configure(conf): @@ -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…
Cancel
Save