diff options
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/client/input.cpp | 4 | ||||
| -rw-r--r-- | src/engine/client/input.h | 2 | ||||
| -rw-r--r-- | src/engine/client/sound.cpp | 2 | ||||
| -rw-r--r-- | src/engine/client/text.cpp | 8 | ||||
| -rw-r--r-- | src/engine/shared/datafile.cpp | 2 | ||||
| -rw-r--r-- | src/engine/shared/huffman.cpp | 4 | ||||
| -rw-r--r-- | src/engine/shared/huffman.h | 2 | ||||
| -rw-r--r-- | src/engine/textrender.h | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/src/engine/client/input.cpp b/src/engine/client/input.cpp index 32e61bbb..c6d3f58e 100644 --- a/src/engine/client/input.cpp +++ b/src/engine/client/input.cpp @@ -65,8 +65,8 @@ void CInput::MouseRelative(int *x, int *y) } } - *x = nx*Sens; - *y = ny*Sens; + *x = (int)(nx*Sens); + *y = (int)(ny*Sens); } void CInput::MouseModeAbsolute() diff --git a/src/engine/client/input.h b/src/engine/client/input.h index cc4e32e3..0b6d5b76 100644 --- a/src/engine/client/input.h +++ b/src/engine/client/input.h @@ -8,7 +8,7 @@ class CInput : public IEngineInput int m_InputGrabbed; unsigned int m_LastRelease; - unsigned int m_ReleaseDelta; + int m_ReleaseDelta; void AddEvent(int Unicode, int Key, int Flags); diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp index df8fa66b..b829686c 100644 --- a/src/engine/client/sound.cpp +++ b/src/engine/client/sound.cpp @@ -121,7 +121,7 @@ static void Mix(short *pFinalOut, unsigned Frames) const int Range = 1500; // magic value, remove int dx = v->m_X - m_CenterX; int dy = v->m_Y - m_CenterY; - int Dist = sqrtf((float)dx*dx+dy*dy); // float here. nasty + int Dist = (int)sqrtf((float)dx*dx+dy*dy); // float here. nasty int p = IntAbs(dx); if(Dist < Range) { diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp index 672fde60..ef741c12 100644 --- a/src/engine/client/text.cpp +++ b/src/engine/client/text.cpp @@ -509,7 +509,7 @@ public: return Cursor.m_X; } - virtual float TextLineCount(void *pFontSetV, float Size, const char *pText, int LineWidth) + virtual int TextLineCount(void *pFontSetV, float Size, const char *pText, float LineWidth) { CTextCursor Cursor; SetCursor(&Cursor, 0, 0, Size, 0); @@ -551,14 +551,14 @@ public: FakeToScreenX = (Graphics()->ScreenWidth()/(ScreenX1-ScreenX0)); FakeToScreenY = (Graphics()->ScreenHeight()/(ScreenY1-ScreenY0)); - ActualX = pCursor->m_X * FakeToScreenX; - ActualY = pCursor->m_Y * FakeToScreenY; + ActualX = (int)(pCursor->m_X * FakeToScreenX); + ActualY = (int)(pCursor->m_Y * FakeToScreenY); CursorX = ActualX / FakeToScreenX; CursorY = ActualY / FakeToScreenY; // same with size - ActualSize = Size * FakeToScreenY; + ActualSize = (int)(Size * FakeToScreenY); Size = ActualSize / FakeToScreenY; // fetch pFont data diff --git a/src/engine/shared/datafile.cpp b/src/engine/shared/datafile.cpp index e7905f81..69b187ea 100644 --- a/src/engine/shared/datafile.cpp +++ b/src/engine/shared/datafile.cpp @@ -383,7 +383,7 @@ bool CDataFileReader::Close() unsigned CDataFileReader::Crc() { - if(!m_pDataFile) return -1; + if(!m_pDataFile) return 0xFFFFFFFF; return m_pDataFile->m_Crc; } diff --git a/src/engine/shared/huffman.cpp b/src/engine/shared/huffman.cpp index 8b0c1cd0..bb7aeaa8 100644 --- a/src/engine/shared/huffman.cpp +++ b/src/engine/shared/huffman.cpp @@ -7,7 +7,7 @@ struct CHuffmanConstructNode int m_Frequency; }; -void CHuffman::Setbits_r(CNode *pNode, int Bits, int Depth) +void CHuffman::Setbits_r(CNode *pNode, int Bits, unsigned Depth) { if(pNode->m_aLeafs[1] != 0xffff) Setbits_r(&m_aNodes[pNode->m_aLeafs[1]], Bits|(1<<Depth), Depth+1); @@ -52,7 +52,7 @@ void CHuffman::ConstructTree(const unsigned *pFrequencies) // add the symbols for(int i = 0; i < HUFFMAN_MAX_SYMBOLS; i++) { - m_aNodes[i].m_NumBits = -1; + m_aNodes[i].m_NumBits = 0xFFFFFFFF; m_aNodes[i].m_Symbol = i; m_aNodes[i].m_aLeafs[0] = -1; m_aNodes[i].m_aLeafs[1] = -1; diff --git a/src/engine/shared/huffman.h b/src/engine/shared/huffman.h index 5aa56c8f..abf6e0e4 100644 --- a/src/engine/shared/huffman.h +++ b/src/engine/shared/huffman.h @@ -35,7 +35,7 @@ class CHuffman CNode *m_pStartNode; int m_NumNodes; - void Setbits_r(CNode *pNode, int Bits, int Depth); + void Setbits_r(CNode *pNode, int Bits, unsigned Depth); void ConstructTree(const unsigned *pFrequencies); public: diff --git a/src/engine/textrender.h b/src/engine/textrender.h index 38dd5d86..6e28b1d5 100644 --- a/src/engine/textrender.h +++ b/src/engine/textrender.h @@ -45,7 +45,7 @@ public: virtual void TextColor(float r, float g, float b, float a) = 0; virtual void Text(void *pFontSetV, float x, float y, float Size, const char *pText, int MaxWidth) = 0; virtual float TextWidth(void *pFontSetV, float Size, const char *pText, int Length) = 0; - virtual float TextLineCount(void *pFontSetV, float Size, const char *pText, int LineWidth) = 0; + virtual int TextLineCount(void *pFontSetV, float Size, const char *pText, float LineWidth) = 0; }; class IEngineTextRender : public ITextRender |