Skip to content

Commit

Permalink
Merge commit '3fff4c532c363ac933c9'
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgammon committed Sep 16, 2010
2 parents 5f711c8 + 3fff4c5 commit fb920a3
Show file tree
Hide file tree
Showing 9 changed files with 429 additions and 395 deletions.
2 changes: 1 addition & 1 deletion ProcessPreviousLine.cpp
Expand Up @@ -746,7 +746,7 @@ assemble the full text of the original line.
if (!m_LineList.IsEmpty ())
{
m_pCurrentLine = m_LineList.GetTail ();
if ((m_pCurrentLine->flags & COMMENT == 0) ||
if (((m_pCurrentLine->flags & COMMENT) == 0) ||
m_pCurrentLine->hard_return)
m_pCurrentLine = NULL;
}
Expand Down
28 changes: 14 additions & 14 deletions dialogs/ColourPickerDlg.cpp
Expand Up @@ -160,8 +160,8 @@ int iResult = 0;

case eColourHue:
{
float hue1 = clr1.GetHue ();
float hue2 = clr2.GetHue ();
double hue1 = clr1.GetHue ();
double hue2 = clr2.GetHue ();
if (hue1 < hue2)
{
iResult = -1;
Expand All @@ -177,16 +177,16 @@ int iResult = 0;
// hue the same - fall through and compare saturation (then luminance)
case eColourSaturation:
{
float saturation1 = clr1.GetSaturation ();
float saturation2 = clr2.GetSaturation ();
double saturation1 = clr1.GetSaturation ();
double saturation2 = clr2.GetSaturation ();
if (saturation1 < saturation2)
iResult = -1;
else if (saturation1 > saturation2)
iResult = 1;
else
{ // saturation the same - compare luminance
float luminance1 = clr1.GetLuminance ();
float luminance2 = clr2.GetLuminance ();
double luminance1 = clr1.GetLuminance ();
double luminance2 = clr2.GetLuminance ();
if (luminance1 < luminance2)
iResult = -1;
else if (luminance1 > luminance2)
Expand All @@ -197,16 +197,16 @@ int iResult = 0;

case eColourLuminance:
{
float luminance1 = clr1.GetLuminance ();
float luminance2 = clr2.GetLuminance ();
double luminance1 = clr1.GetLuminance ();
double luminance2 = clr2.GetLuminance ();
if (luminance1 < luminance2)
iResult = -1;
else if (luminance1 > luminance2)
iResult = 1;
else
{ // luminance the same - compare saturation
float saturation1 = clr1.GetSaturation ();
float saturation2 = clr2.GetSaturation ();
double saturation1 = clr1.GetSaturation ();
double saturation2 = clr2.GetSaturation ();
if (saturation1 < saturation2)
iResult = -1;
else if (saturation1 > saturation2)
Expand Down Expand Up @@ -334,9 +334,9 @@ CColor clr;

clr.SetColor (m_ctlSwatch.m_colour);

float fHue = clr.GetHue ();
float fSaturation = clr.GetSaturation ();
float fLuminance = clr.GetLuminance ();
double fHue = clr.GetHue ();
double fSaturation = clr.GetSaturation ();
double fLuminance = clr.GetLuminance ();

CString strName;

Expand Down Expand Up @@ -549,7 +549,7 @@ LRESULT CColourPickerDlg::OnKickIdle(WPARAM, LPARAM)

void CColourPickerDlg::OnRandom()
{
m_ctlSwatch.m_colour = genrand () * (double) 0x1000000;
m_ctlSwatch.m_colour = (COLORREF) (genrand () * (double) 0x1000000);

m_ctlSwatch.RedrawWindow ();
ShowName ();
Expand Down
2 changes: 1 addition & 1 deletion dialogs/DebugWorldInputDlg.cpp
Expand Up @@ -208,7 +208,7 @@ CInsertUnicodeDlg dlg;

unsigned char utf8 [10];

int iLen = _pcre_ord2utf8 (dlg.m_iCode, utf8);
int iLen = _pcre_ord2utf8 ((int) dlg.m_iCode, utf8);


CString strText;
Expand Down
2 changes: 1 addition & 1 deletion doc.cpp
Expand Up @@ -6043,7 +6043,7 @@ void CMUSHclientDoc::SendWindowSizes (const int iNewWidth)

pmyView->GetTextRect (&r);

WORD height = (r.bottom - r.top - m_iPixelOffset) / m_FontHeight;
WORD height = (WORD) ((r.bottom - r.top - m_iPixelOffset) / m_FontHeight);

// now tell them our size
unsigned char p [] = { IAC, SB, TELOPT_NAWS,
Expand Down
20 changes: 10 additions & 10 deletions miniwindow.cpp
Expand Up @@ -618,7 +618,7 @@ long CMiniWindow::Font (LPCTSTR FontId, // eg. "inventory"

CFont * pFont = new CFont;

int lfHeight = -MulDiv(Size ? Size : 10.0, dc.GetDeviceCaps(LOGPIXELSY), 72);
int lfHeight = -MulDiv(Size ? (int) Size : 10, dc.GetDeviceCaps(LOGPIXELSY), 72);

if (pFont->CreateFont (lfHeight,
0, // int nWidth,
Expand Down Expand Up @@ -1293,7 +1293,7 @@ long CMiniWindow::WritePng (LPCTSTR FileName, const BITMAPINFO * bmi, unsigned c

long bpl = BytesPerLine (bmi->bmiHeader.biWidth, 24);

long row;
unsigned long row;
unsigned char * p = pData;

// have to reverse row order
Expand Down Expand Up @@ -1925,7 +1925,7 @@ long CMiniWindow::ImageOp(short Action,

} // end of CMiniWindow::ImageOp

long CMiniWindow::CreateImage(LPCTSTR ImageId, long Row1, long Row2, long Row3, long Row4, long Row5, long Row6, long Row7, long Row8)
long CMiniWindow::CreateImage(LPCTSTR ImageId, WORD Row1, WORD Row2, WORD Row3, WORD Row4, WORD Row5, WORD Row6, WORD Row7, WORD Row8)
{

ImageMapIterator it = m_Images.find (ImageId);
Expand Down Expand Up @@ -2679,12 +2679,12 @@ static void MakeTexture (const COLORREF Multiplier,
const long iHeight)
{

long rval = GetRValue (Multiplier),
ULONG rval = GetRValue (Multiplier),
gval = GetGValue (Multiplier),
bval = GetBValue (Multiplier);

long row, col;
long c;
ULONG row, col;
ULONG c;

int increment = BytesPerLine (iWidth, 24);

Expand All @@ -2695,9 +2695,9 @@ static void MakeTexture (const COLORREF Multiplier,
for (row = 0; row < iHeight; row++)
{
c = col ^ row;
p [0] = c * bval;
p [1] = c * gval;
p [2] = c * rval;
p [0] = (unsigned char) (c * bval);
p [1] = (unsigned char) (c * gval);
p [2] = (unsigned char) (c * rval);
p += increment;
} // end of each row
} // end of each column
Expand Down Expand Up @@ -2969,7 +2969,7 @@ static void Noise (unsigned char * inbuf, long iWidth, long iHeight, long iPerLi
for (i = 0; i < count; i++)
{
c = *pi;
c += (128 - genrand () * 256) * threshold;
c += (long) ((128 - genrand () * 256) * threshold);
*pi++ = CLAMP (c);
}

Expand Down
2 changes: 1 addition & 1 deletion miniwindow.h
Expand Up @@ -228,7 +228,7 @@ class CMiniWindow
long EllipseWidth, long EllipseHeight);

long CreateImage(LPCTSTR ImageId,
long Row1, long Row2, long Row3, long Row4, long Row5, long Row6, long Row7, long Row8);
WORD Row1, WORD Row2, WORD Row3, WORD Row4, WORD Row5, WORD Row6, WORD Row7, WORD Row8);

long BlendImage(LPCTSTR ImageId,
long Left, long Top, long Right, long Bottom,
Expand Down

0 comments on commit fb920a3

Please sign in to comment.