mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
Merge branch 'master' into windows
This commit is contained in:
@@ -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)
|
||||
@@ -497,7 +509,7 @@ bool InputHandleInputEvent( const InputEvent_t &event )
|
||||
return true;
|
||||
|
||||
case IE_IMESetWindow:
|
||||
g_pIInput->SetIMEWindow( (void *)event.m_nData );
|
||||
g_pIInput->SetIMEWindow( (void *)(intp)event.m_nData );
|
||||
return true;
|
||||
|
||||
case IE_LocateMouseClick:
|
||||
|
||||
@@ -48,7 +48,11 @@ ILauncherMgr *g_pLauncherMgr = NULL;
|
||||
#include "mathlib/vmatrix.h"
|
||||
#include <tier0/vprof.h>
|
||||
#include "materialsystem/itexture.h"
|
||||
#ifdef OSX
|
||||
#include <malloc/malloc.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include "../vgui2/src/VPanel.h"
|
||||
#include <vgui/IInputInternal.h>
|
||||
#if defined( _X360 )
|
||||
@@ -142,7 +146,7 @@ CMatSystemSurface g_MatSystemSurface;
|
||||
EXPOSE_SINGLE_INTERFACE_GLOBALVAR( CMatSystemSurface, ISurface,
|
||||
VGUI_SURFACE_INTERFACE_VERSION, g_MatSystemSurface );
|
||||
|
||||
#ifdef LINUX
|
||||
#if defined(LINUX) || defined(OSX)
|
||||
CUtlDict< CMatSystemSurface::font_entry, unsigned short > CMatSystemSurface::m_FontData;
|
||||
#endif
|
||||
|
||||
@@ -403,7 +407,7 @@ InitReturnVal_t CMatSystemSurface::Init( void )
|
||||
FontManager().SetLanguage( "english" );
|
||||
}
|
||||
|
||||
#ifdef LINUX
|
||||
#if defined(LINUX) || defined(OSX)
|
||||
FontManager().SetFontDataHelper( &CMatSystemSurface::FontDataHelper );
|
||||
#endif
|
||||
|
||||
@@ -1903,16 +1907,7 @@ bool CMatSystemSurface::AddCustomFontFile( const char *fontName, const char *fon
|
||||
}
|
||||
Assert( success );
|
||||
return success;
|
||||
#elif OSX
|
||||
|
||||
FSRef ref;
|
||||
OSStatus err = FSPathMakeRef( (const UInt8*)fullPath, &ref, NULL );
|
||||
if ( err == noErr )
|
||||
err = ATSFontActivateFromFileReference( &ref, kATSFontContextLocal, kATSFontFormatUnspecified, NULL, kATSOptionFlagsDefault, NULL );
|
||||
|
||||
return err == noErr;
|
||||
|
||||
#elif LINUX
|
||||
#elif defined(LINUX) || defined(OSX)
|
||||
|
||||
int size;
|
||||
if ( CMatSystemSurface::FontDataHelper( fontName, size, fontFileName ) )
|
||||
@@ -1926,7 +1921,7 @@ bool CMatSystemSurface::AddCustomFontFile( const char *fontName, const char *fon
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef LINUX
|
||||
#if defined(LINUX) || defined(OSX)
|
||||
|
||||
static void RemoveSpaces( CUtlString &str )
|
||||
{
|
||||
|
||||
@@ -556,7 +556,7 @@ private:
|
||||
int m_nFullscreenViewportHeight;
|
||||
ITexture *m_pFullscreenRenderTarget;
|
||||
|
||||
#ifdef LINUX
|
||||
#if defined(LINUX) || defined(OSX)
|
||||
struct font_entry
|
||||
{
|
||||
void *data;
|
||||
|
||||
Reference in New Issue
Block a user