diff options
-rw-r--r-- | guilib/FrameBufferObject.h | 2 | ||||
-rw-r--r-- | guilib/Shader.h | 2 | ||||
-rw-r--r-- | guilib/TextureBundle.cpp | 28 | ||||
-rw-r--r-- | guilib/TextureBundle.h | 13 | ||||
-rw-r--r-- | guilib/common/SDLJoystick.h | 2 | ||||
-rw-r--r-- | guilib/gui3d.h | 2 | ||||
-rw-r--r-- | xbmc/Application.h | 2 | ||||
-rw-r--r-- | xbmc/AutoPtrHandle.h | 2 | ||||
-rw-r--r-- | xbmc/Edl.h | 28 | ||||
-rw-r--r-- | xbmc/FileSystem/CDDADirectory.h | 7 | ||||
-rw-r--r-- | xbmc/FileSystem/FileCDDA.h | 2 | ||||
-rw-r--r-- | xbmc/FileSystem/HDHomeRun.cpp | 1 | ||||
-rw-r--r-- | xbmc/FileSystem/HTSPSession.h | 2 | ||||
-rw-r--r-- | xbmc/FileSystem/IFile.h | 1 | ||||
-rw-r--r-- | xbmc/FileSystem/VTPSession.h | 2 | ||||
-rw-r--r-- | xbmc/KeyboardStat.h | 10 | ||||
-rw-r--r-- | xbmc/MouseStat.h | 8 | ||||
-rw-r--r-- | xbmc/RenderSystem.h | 5 | ||||
-rw-r--r-- | xbmc/RenderSystemDX.cpp | 2 | ||||
-rw-r--r-- | xbmc/RenderSystemDX.h | 2 | ||||
-rw-r--r-- | xbmc/RenderSystemGL.cpp | 2 | ||||
-rw-r--r-- | xbmc/RenderSystemGL.h | 2 | ||||
-rw-r--r-- | xbmc/Util.h | 2 | ||||
-rw-r--r-- | xbmc/VideoReferenceClock.h | 2 | ||||
-rw-r--r-- | xbmc/utils/EventServer.h | 1 | ||||
-rw-r--r-- | xbmc/utils/Mutex.h | 2 | ||||
-rw-r--r-- | xbmc/utils/Stopwatch.cpp | 7 | ||||
-rw-r--r-- | xbmc/utils/Stopwatch.h | 6 | ||||
-rw-r--r-- | xbmc/utils/md5.h | 2 |
29 files changed, 70 insertions, 79 deletions
diff --git a/guilib/FrameBufferObject.h b/guilib/FrameBufferObject.h index cc3d679daf..6134678e22 100644 --- a/guilib/FrameBufferObject.h +++ b/guilib/FrameBufferObject.h @@ -22,7 +22,7 @@ * */ -#include "system.h" +#include "system.h" // for HAS_GL #ifdef HAS_GL diff --git a/guilib/Shader.h b/guilib/Shader.h index b9d6775dc8..b3e70f6fbf 100644 --- a/guilib/Shader.h +++ b/guilib/Shader.h @@ -22,7 +22,7 @@ * */ -#include "system.h" +#include "system.h" // for HAS_GL/HAS_GLES #include <vector> #include <string> diff --git a/guilib/TextureBundle.cpp b/guilib/TextureBundle.cpp index 6d7176c9a6..2089802172 100644 --- a/guilib/TextureBundle.cpp +++ b/guilib/TextureBundle.cpp @@ -246,16 +246,13 @@ void CTextureBundle::GetTexturesFromPath(const CStdString &path, std::vector<CSt } } -HRESULT CTextureBundle::LoadFile(const CStdString& Filename, CAutoTexBuffer& UnpackedBuf) +bool CTextureBundle::LoadFile(const CStdString& Filename, CAutoTexBuffer& UnpackedBuf) { - if (Filename == "-") - return 0; - CStdString name = Normalize(Filename); std::map<CStdString, FileHeader_t>::iterator file = m_FileHeaders.find(name); if (file == m_FileHeaders.end()) - return E_FAIL; + return false; // found texture - allocate the necessary buffers DWORD ReadSize = (file->second.PackedSize + (ALIGN - 1)) & ~(ALIGN - 1); @@ -280,7 +277,7 @@ HRESULT CTextureBundle::LoadFile(const CStdString& Filename, CAutoTexBuffer& Unp info.totalram); #endif free(buffer); - return E_OUTOFMEMORY; + return false; } // read the file into our buffer @@ -291,17 +288,17 @@ HRESULT CTextureBundle::LoadFile(const CStdString& Filename, CAutoTexBuffer& Unp { CLog::Log(LOGERROR, "Error loading texture: %s: %s", Filename.c_str(), strerror(ferror(m_hFile))); free(buffer); - return E_FAIL; + return false; } // allocate a buffer for our unpacked texture lzo_uint s = file->second.UnpackedSize; - HRESULT hr = S_OK; + bool success = true; if (lzo1x_decompress(buffer, file->second.PackedSize, UnpackedBuf, &s, NULL) != LZO_E_OK || s != file->second.UnpackedSize) { CLog::Log(LOGERROR, "Error loading texture: %s: Decompression error", Filename.c_str()); - hr = E_FAIL; + success = false; } try @@ -313,19 +310,18 @@ HRESULT CTextureBundle::LoadFile(const CStdString& Filename, CAutoTexBuffer& Unp CLog::Log(LOGERROR, "Error freeing preload buffer."); } - return hr; + return success; } -HRESULT CTextureBundle::LoadTexture(const CStdString& Filename, CBaseTexture** ppTexture, +bool CTextureBundle::LoadTexture(const CStdString& Filename, CBaseTexture** ppTexture, int &width, int &height) { DWORD ResDataOffset; *ppTexture = NULL; CAutoTexBuffer UnpackedBuf; - HRESULT r = LoadFile(Filename, UnpackedBuf); - if (r != S_OK) - return r; + if (!LoadFile(Filename, UnpackedBuf)) + return false; D3DTexture *pTex = (D3DTexture *)(new char[sizeof (D3DTexture)]); D3DPalette* pPal = 0; @@ -378,13 +374,13 @@ HRESULT CTextureBundle::LoadTexture(const CStdString& Filename, CBaseTexture** p pInfo->Format = desc.Format; #endif */ - return S_OK; + return true; PackedLoadError: CLog::Log(LOGERROR, "Error loading texture: %s: Invalid data", Filename.c_str()); delete[] pTex; delete pPal; - return E_FAIL; + return false; } int CTextureBundle::LoadAnim(const CStdString& Filename, CBaseTexture*** ppTextures, diff --git a/guilib/TextureBundle.h b/guilib/TextureBundle.h index c538d760a3..5ae9aebca0 100644 --- a/guilib/TextureBundle.h +++ b/guilib/TextureBundle.h @@ -22,8 +22,7 @@ */ #include "StdString.h" -#include "system.h" - +#include <stdint.h> #include <map> class CAutoTexBuffer; @@ -33,9 +32,9 @@ class CTextureBundle { struct FileHeader_t { - DWORD Offset; - DWORD UnpackedSize; - DWORD PackedSize; + uint32_t Offset; + uint32_t UnpackedSize; + uint32_t PackedSize; }; FILE* m_hFile; @@ -47,7 +46,7 @@ class CTextureBundle bool m_themeBundle; bool OpenBundle(); - HRESULT LoadFile(const CStdString& Filename, CAutoTexBuffer& UnpackedBuf); + bool LoadFile(const CStdString& Filename, CAutoTexBuffer& UnpackedBuf); public: CTextureBundle(void); @@ -60,7 +59,7 @@ public: void GetTexturesFromPath(const CStdString &path, std::vector<CStdString> &textures); static CStdString Normalize(const CStdString &name); - HRESULT LoadTexture(const CStdString& Filename, CBaseTexture** ppTexture, + bool LoadTexture(const CStdString& Filename, CBaseTexture** ppTexture, int &width, int &height); int LoadAnim(const CStdString& Filename, CBaseTexture*** ppTextures, diff --git a/guilib/common/SDLJoystick.h b/guilib/common/SDLJoystick.h index 1aa89fecd4..202593422e 100644 --- a/guilib/common/SDLJoystick.h +++ b/guilib/common/SDLJoystick.h @@ -1,7 +1,7 @@ #ifndef SDL_JOYSTICK_H #define SDL_JOYSTICK_H -#include "../system.h" +#include "../system.h" // for HAS_SDL_JOYSTICK #include <vector> #include <string> diff --git a/guilib/gui3d.h b/guilib/gui3d.h index 9ce1d988fb..b12a85e573 100644 --- a/guilib/gui3d.h +++ b/guilib/gui3d.h @@ -28,7 +28,7 @@ * */ -#include "system.h" +#include "system.h" // for WIN32 types #define GAMMA_RAMP_FLAG D3DSGR_CALIBRATE diff --git a/xbmc/Application.h b/xbmc/Application.h index a8f498b693..e6bed95c0d 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h @@ -21,7 +21,7 @@ * */ -#include "system.h" +#include "system.h" // for HAS_DVD_DRIVE et. al. #include "XBApplicationEx.h" #include "IMsgTargetCallback.h" diff --git a/xbmc/AutoPtrHandle.h b/xbmc/AutoPtrHandle.h index 2a942ba536..ff15c31355 100644 --- a/xbmc/AutoPtrHandle.h +++ b/xbmc/AutoPtrHandle.h @@ -21,7 +21,7 @@ * */ -#include "system.h" +#include "system.h" // for HANDLE and SOCKET namespace AUTOPTR { diff --git a/xbmc/Edl.h b/xbmc/Edl.h index 31ee6b4fc7..18f052e4f2 100644 --- a/xbmc/Edl.h +++ b/xbmc/Edl.h @@ -21,11 +21,11 @@ * */ -#include "StdString.h" -#include "system.h" -#include "URL.h" #include <vector> +#include <stdint.h> +#include "StdString.h" +#include "URL.h" class CEdl { @@ -43,8 +43,8 @@ public: struct Cut { - __int64 start; // ms - __int64 end; // ms + int64_t start; // ms + int64_t end; // ms Action action; }; @@ -56,21 +56,21 @@ public: bool HasCut(); bool HasSceneMarker(); CStdString GetInfo(); - __int64 GetTotalCutTime(); - __int64 RemoveCutTime(__int64 iSeek); - __int64 RestoreCutTime(__int64 iClock); + int64_t GetTotalCutTime(); + int64_t RemoveCutTime(int64_t iSeek); + int64_t RestoreCutTime(int64_t iClock); - bool InCut(__int64 iSeek, Cut *pCut = NULL); + bool InCut(int64_t iSeek, Cut *pCut = NULL); - bool GetNextSceneMarker(bool bPlus, const __int64 iClock, __int64 *iSceneMarker); + bool GetNextSceneMarker(bool bPlus, const int64_t iClock, int64_t *iSceneMarker); - static CStdString MillisecondsToTimeString(const __int64 iMilliseconds); + static CStdString MillisecondsToTimeString(const int64_t iMilliseconds); protected: private: - __int64 m_iTotalCutTime; // ms + int64_t m_iTotalCutTime; // ms std::vector<Cut> m_vecCuts; - std::vector<__int64> m_vecSceneMarkers; + std::vector<int64_t> m_vecSceneMarkers; bool ReadEdl(const CStdString& strMovie); bool ReadComskip(const CStdString& strMovie, const float fFramesPerSecond); @@ -78,7 +78,7 @@ private: bool ReadBeyondTV(const CStdString& strMovie); bool AddCut(const Cut& NewCut); - bool AddSceneMarker(const __int64 sceneMarker); + bool AddSceneMarker(const int64_t sceneMarker); bool WriteMPlayerEdl(); diff --git a/xbmc/FileSystem/CDDADirectory.h b/xbmc/FileSystem/CDDADirectory.h index 8f1d2b76fe..447aee5d08 100644 --- a/xbmc/FileSystem/CDDADirectory.h +++ b/xbmc/FileSystem/CDDADirectory.h @@ -21,10 +21,6 @@ #pragma once -#include "system.h" - -#ifdef HAS_DVD_DRIVE - #include "IDirectory.h" namespace DIRECTORY @@ -39,6 +35,3 @@ public: virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); }; } - -#endif - diff --git a/xbmc/FileSystem/FileCDDA.h b/xbmc/FileSystem/FileCDDA.h index 0f55d34359..5866cc21e9 100644 --- a/xbmc/FileSystem/FileCDDA.h +++ b/xbmc/FileSystem/FileCDDA.h @@ -20,7 +20,7 @@ * */ -#include "system.h" +#include "system.h" // for HAS_DVD_DRIVE #ifdef HAS_DVD_DRIVE diff --git a/xbmc/FileSystem/HDHomeRun.cpp b/xbmc/FileSystem/HDHomeRun.cpp index ef71f64086..407ecbf81d 100644 --- a/xbmc/FileSystem/HDHomeRun.cpp +++ b/xbmc/FileSystem/HDHomeRun.cpp @@ -19,6 +19,7 @@ * */ +#include "system.h" // needed prior to Util.h due to include order issues #include "Util.h" #include "URL.h" #include "FileItem.h" diff --git a/xbmc/FileSystem/HTSPSession.h b/xbmc/FileSystem/HTSPSession.h index 71a74ac207..de66dee7f9 100644 --- a/xbmc/FileSystem/HTSPSession.h +++ b/xbmc/FileSystem/HTSPSession.h @@ -21,7 +21,7 @@ #pragma once #include "deque" -#include "system.h" +#include "system.h" // for SOCKET #include <algorithm> #include <string> diff --git a/xbmc/FileSystem/IFile.h b/xbmc/FileSystem/IFile.h index 5bb92df7ac..3dfa2ed204 100644 --- a/xbmc/FileSystem/IFile.h +++ b/xbmc/FileSystem/IFile.h @@ -28,6 +28,7 @@ #pragma once #endif // _MSC_VER > 1000 +#include "system.h" // for __int64 #include "URL.h" #include <stdio.h> diff --git a/xbmc/FileSystem/VTPSession.h b/xbmc/FileSystem/VTPSession.h index a4ab870ea7..f1a42000e5 100644 --- a/xbmc/FileSystem/VTPSession.h +++ b/xbmc/FileSystem/VTPSession.h @@ -2,7 +2,7 @@ #include <string> #include <vector> -#include "system.h" +#include "system.h" // for SOCKET //#define VTP_STANDALONE diff --git a/xbmc/KeyboardStat.h b/xbmc/KeyboardStat.h index 42c75efa9a..0a118770e8 100644 --- a/xbmc/KeyboardStat.h +++ b/xbmc/KeyboardStat.h @@ -22,7 +22,7 @@ // Copyright: See COPYING file that comes with this distribution
//
#include "XBMC_events.h"
-#include "system.h"
+#include "system.h" // for DWORD
class CKeyboardStat
{
@@ -39,8 +39,8 @@ public: bool GetAlt() { return m_bAlt;};
bool GetRAlt() { return m_bRAlt;};
char GetAscii();// { return m_cAscii;}; // FIXME should be replaced completly by GetUnicode()
- WCHAR GetUnicode();// { return m_wUnicode;};
- BYTE GetVKey() { return m_VKey;};
+ wchar_t GetUnicode();// { return m_wUnicode;};
+ uint8_t GetVKey() { return m_VKey;};
unsigned int KeyHeld() const;
int HandleEvent(XBMC_Event& newEvent);
@@ -51,8 +51,8 @@ private: bool m_bAlt;
bool m_bRAlt;
char m_cAscii;
- WCHAR m_wUnicode;
- BYTE m_VKey;
+ wchar_t m_wUnicode;
+ uint8_t m_VKey;
XBMCKey m_lastKey;
DWORD m_lastKeyTime;
diff --git a/xbmc/MouseStat.h b/xbmc/MouseStat.h index 54e9c75d3a..e0ff84d34d 100644 --- a/xbmc/MouseStat.h +++ b/xbmc/MouseStat.h @@ -24,7 +24,7 @@ #include "XBMC_events.h"
#include "Geometry.h"
-#include "system.h"
+#include "system.h" // for DWORD
#define XBMC_BUTTON(X) (1 << ((X)-1))
#define XBMC_BUTTON_LEFT 1
@@ -79,9 +79,9 @@ public: int GetExclusiveWindowID() const { return m_exclusiveWindowID; };
int GetExclusiveControlID() const { return m_exclusiveControlID; };
const CPoint &GetExclusiveOffset() const { return m_exclusiveOffset; };
- void SetState(DWORD state) { m_pointerState = state; };
+ void SetState(MOUSE_STATE state) { m_pointerState = state; };
void SetEnabled(bool enabled = true);
- DWORD GetState() const { return m_pointerState; };
+ MOUSE_STATE GetState() const { return m_pointerState; };
CPoint GetLocation() const;
void SetLocation(const CPoint &point, bool activate=false);
CPoint GetLastMove() const;
@@ -99,7 +99,7 @@ private: CPoint m_exclusiveOffset;
// state of the mouse
- DWORD m_pointerState;
+ MOUSE_STATE m_pointerState;
MouseState m_mouseState;
bool m_mouseEnabled;
bool m_lastDown[5];
diff --git a/xbmc/RenderSystem.h b/xbmc/RenderSystem.h index e1cab20813..024881b06a 100644 --- a/xbmc/RenderSystem.h +++ b/xbmc/RenderSystem.h @@ -27,7 +27,7 @@ #include "Geometry.h" #include "TransformMatrix.h" #include "StdString.h" -#include "system.h" +#include <stdint.h> typedef enum _RenderingSystemType @@ -42,6 +42,7 @@ typedef enum _RenderingSystemType * This interface is very basic since a lot of the actual details will go in to the derived classes */ +typedef uint32_t color_t; class CRenderSystemBase { @@ -62,7 +63,7 @@ public: virtual bool BeginRender() = 0; virtual bool EndRender() = 0; virtual bool PresentRender() = 0; - virtual bool ClearBuffers(DWORD color) = 0; + virtual bool ClearBuffers(color_t color) = 0; virtual bool ClearBuffers(float r, float g, float b, float a) = 0; virtual bool IsExtSupported(const char* extension) = 0; diff --git a/xbmc/RenderSystemDX.cpp b/xbmc/RenderSystemDX.cpp index 4422ecb4a9..bba10c2ccb 100644 --- a/xbmc/RenderSystemDX.cpp +++ b/xbmc/RenderSystemDX.cpp @@ -306,7 +306,7 @@ bool CRenderSystemDX::EndRender() return true; } -bool CRenderSystemDX::ClearBuffers(DWORD color) +bool CRenderSystemDX::ClearBuffers(color_t color) { HRESULT hr; diff --git a/xbmc/RenderSystemDX.h b/xbmc/RenderSystemDX.h index af7043cda1..4b7926e8ae 100644 --- a/xbmc/RenderSystemDX.h +++ b/xbmc/RenderSystemDX.h @@ -41,7 +41,7 @@ public: virtual bool BeginRender(); virtual bool EndRender(); virtual bool PresentRender(); - virtual bool ClearBuffers(DWORD color); + virtual bool ClearBuffers(color_t color); virtual bool ClearBuffers(float r, float g, float b, float a); virtual bool IsExtSupported(const char* extension); diff --git a/xbmc/RenderSystemGL.cpp b/xbmc/RenderSystemGL.cpp index 2b903a528e..7db29400f0 100644 --- a/xbmc/RenderSystemGL.cpp +++ b/xbmc/RenderSystemGL.cpp @@ -135,7 +135,7 @@ bool CRenderSystemGL::EndRender() return true; } -bool CRenderSystemGL::ClearBuffers(DWORD color) +bool CRenderSystemGL::ClearBuffers(color_t color) { if (!m_bRenderCreated) return false; diff --git a/xbmc/RenderSystemGL.h b/xbmc/RenderSystemGL.h index 5b62e36886..dda5edfe3e 100644 --- a/xbmc/RenderSystemGL.h +++ b/xbmc/RenderSystemGL.h @@ -39,7 +39,7 @@ public: virtual bool BeginRender(); virtual bool EndRender(); virtual bool PresentRender(); - virtual bool ClearBuffers(DWORD color); + virtual bool ClearBuffers(color_t color); virtual bool ClearBuffers(float r, float g, float b, float a); virtual bool IsExtSupported(const char* extension); diff --git a/xbmc/Util.h b/xbmc/Util.h index 73f950fca3..e5e17c3eb1 100644 --- a/xbmc/Util.h +++ b/xbmc/Util.h @@ -32,8 +32,8 @@ #include <vector> #include <limits> #include <string.h> +#include <stdint.h> -#include "system.h" #include "MediaSource.h" // A list of filesystem types for LegalPath/FileName diff --git a/xbmc/VideoReferenceClock.h b/xbmc/VideoReferenceClock.h index e93d698679..2aca3ecc6b 100644 --- a/xbmc/VideoReferenceClock.h +++ b/xbmc/VideoReferenceClock.h @@ -20,7 +20,7 @@ * */ -#include "system.h" +#include "system.h" // for HAS_XRANDR, and Win32 types #include "Thread.h" #include "utils/CriticalSection.h" diff --git a/xbmc/utils/EventServer.h b/xbmc/utils/EventServer.h index 841f098ae0..8c3c371eb6 100644 --- a/xbmc/utils/EventServer.h +++ b/xbmc/utils/EventServer.h @@ -22,7 +22,6 @@ * */ -#include "system.h" #include "Thread.h" #include "Socket.h" #include "EventClient.h" diff --git a/xbmc/utils/Mutex.h b/xbmc/utils/Mutex.h index e2f54d6a63..41107825c7 100644 --- a/xbmc/utils/Mutex.h +++ b/xbmc/utils/Mutex.h @@ -25,7 +25,7 @@ // // by Bobbin007 in 2003 -#include "system.h" +#include "system.h" // for HANDLE class CMutex { diff --git a/xbmc/utils/Stopwatch.cpp b/xbmc/utils/Stopwatch.cpp index 70741ba8a1..814382fb7e 100644 --- a/xbmc/utils/Stopwatch.cpp +++ b/xbmc/utils/Stopwatch.cpp @@ -19,6 +19,7 @@ * */ +#include "system.h" // for LARGE_INTEGER, QueryPerformanceCounter etc. #include "Stopwatch.h" #if defined(_LINUX) && !defined(__APPLE__) #include <sys/sysinfo.h> @@ -80,8 +81,8 @@ void CStopWatch::Reset() float CStopWatch::GetElapsedSeconds() const { - LONGLONG totalTicks = m_isRunning ? (GetTicks() - m_startTick) : 0; - return (FLOAT)totalTicks * m_timerPeriod; + int64_t totalTicks = m_isRunning ? (GetTicks() - m_startTick) : 0; + return (float)totalTicks * m_timerPeriod; } float CStopWatch::GetElapsedMilliseconds() const @@ -89,7 +90,7 @@ float CStopWatch::GetElapsedMilliseconds() const return GetElapsedSeconds() * 1000.0f; } -LONGLONG CStopWatch::GetTicks() const +int64_t CStopWatch::GetTicks() const { #ifndef _LINUX LARGE_INTEGER currTicks; diff --git a/xbmc/utils/Stopwatch.h b/xbmc/utils/Stopwatch.h index 98d9d0043c..3109494988 100644 --- a/xbmc/utils/Stopwatch.h +++ b/xbmc/utils/Stopwatch.h @@ -21,7 +21,7 @@ * */ -#include "system.h" +#include <stdint.h> class CStopWatch { @@ -38,8 +38,8 @@ public: float GetElapsedSeconds() const; float GetElapsedMilliseconds() const; private: - __int64 GetTicks() const; + int64_t GetTicks() const; float m_timerPeriod; // to save division in GetElapsed...() - __int64 m_startTick; + int64_t m_startTick; bool m_isRunning; }; diff --git a/xbmc/utils/md5.h b/xbmc/utils/md5.h index d4b7564bb7..3606ec6a11 100644 --- a/xbmc/utils/md5.h +++ b/xbmc/utils/md5.h @@ -40,7 +40,7 @@ #ifndef _MD5_H_ #define _MD5_H_ 1 -#include "system.h" +#include <stdint.h> #include "StdString.h" /* typedef a 32 bit type */ |