Skip to content

Commit

Permalink
Remove trailing whitespaces in .h, .cpp, .c and .lua files.
Browse files Browse the repository at this point in the history
  • Loading branch information
mounirlamouri committed Mar 31, 2014
1 parent 8c41615 commit 4cd9379
Show file tree
Hide file tree
Showing 392 changed files with 13,720 additions and 13,720 deletions.
38 changes: 19 additions & 19 deletions AnimView/frmMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ frmMain::frmMain()
m_bPlayingAnimation = true;
//m_bPlayingAnimation = false;
pSidebarSizer->Add(pFrame, 0, wxEXPAND | wxALL, 0);

#define ID(layer, id) (ID_LAYER_CHECKS + (layer) * 25 + (id))
wxStaticBoxSizer *pLayer0 = new wxStaticBoxSizer(wxHORIZONTAL, this, L"Layer 0 (Patient Head)");
pLayer0->Add(new wxCheckBox(this, ID(0, 0), L"0"), 0, wxALIGN_CENTER | wxALL, 1);
Expand Down Expand Up @@ -263,7 +263,7 @@ frmMain::frmMain()

SetBackgroundColour(m_btnPlayPause->GetBackgroundColour());
SetSizer(pMainSizer);

SetMinSize(ClientToWindowSize(pMainSizer->CalcMin()));
SetSize(GetMinSize());

Expand Down Expand Up @@ -405,7 +405,7 @@ your hard disk (~250MB). \n If you click No, it will write the XML and element f
the DATA folder, the Animation Viewer will use PNG sprites instead of Theme Hospital data files.",
L"Export Warning", wxYES_NO | wxCANCEL);
if( response == wxYES) { bWriteFrames = true; }
if( response != wxCANCEL)
if( response != wxCANCEL)
{
//Start with animations, then move on to sprite sheets (map tiles)
if(!m_oAnims.loadAnimationFile(_getCaseSensitivePath(L"VSTART-1.ANI", sdPath))
Expand Down Expand Up @@ -439,7 +439,7 @@ the DATA folder, the Animation Viewer will use PNG sprites instead of Theme Hosp
wxTextOutputStream outputXml(fosxml);
outputXml.WriteString(wxString::Format(L"<?xml version='1.0' encoding='ISO-8859-1' standalone='no'?>\n"));
outputXml.WriteString(wxString::Format(L"<theme_hospital_graphics scale_factor='1'>\n"));

int iAnimationCount = 0;
int iFrameCountTotal = 1;
int iElementCount = 0;
Expand All @@ -454,15 +454,15 @@ the DATA folder, the Animation Viewer will use PNG sprites instead of Theme Hosp
{
wxFileName::Mkdir(aiPath);
}
outputXml.WriteString(wxString::Format(L"<an id='%u' fr='%u' un='%u'>\n",
outputXml.WriteString(wxString::Format(L"<an id='%u' fr='%u' un='%u'>\n",
iAnimation, m_oAnims.getFrameField(iAnimation), m_oAnims.getUnknownField(iAnimation)));
aiPath += wxFileName::GetPathSeparator();
size_t iFrameCount = m_oAnims.getFrameCount(iAnimation);
for(size_t iFrame = 0; iFrame < iFrameCount; ++iFrame)
{
wxImage imgCanvas;
th_frame_t* pFrame = m_oAnims.getFrameStruct(iAnimation,iFrame);
outputXml.WriteString(wxString::Format(L"\t<fr id='%u' li='%u' w='%u' h='%u' fl='%u' nx='%u'>\n",
outputXml.WriteString(wxString::Format(L"\t<fr id='%u' li='%u' w='%u' h='%u' fl='%u' nx='%u'>\n",
iFrameCountTotal, iListIndex, pFrame->width, pFrame->height, pFrame->flags, pFrame->next));

wxSize oSize;
Expand All @@ -488,7 +488,7 @@ the DATA folder, the Animation Viewer will use PNG sprites instead of Theme Hosp
}

m_oAnims.drawFrame(imgCanvas, iAnimation, iFrame, &m_mskLayers, oSize, 0, 0);
outputLog.WriteString(wxString::Format(L"%s\t%u\t%u\t%u\t%u\t%u\n", L"VSPR-0", iAnimation, iFrame,
outputLog.WriteString(wxString::Format(L"%s\t%u\t%u\t%u\t%u\t%u\n", L"VSPR-0", iAnimation, iFrame,
oSize.x, oSize.y, m_oAnims.getUnknownField(iAnimation)));
}

Expand All @@ -506,7 +506,7 @@ the DATA folder, the Animation Viewer will use PNG sprites instead of Theme Hosp
iAnimationCount++;
}
}
//outputXml.WriteString(wxString::Format(L"\t<graphics_totals animations='%u' frames='%u' elements='%u' sprites='%u'>\n",
//outputXml.WriteString(wxString::Format(L"\t<graphics_totals animations='%u' frames='%u' elements='%u' sprites='%u'>\n",
// iAnimationCount, iFrameCount, iElementCount, iSpriteCount));
outputXml.WriteString(wxString::Format(L"</theme_hospital_graphics>\n"));

Expand All @@ -520,7 +520,7 @@ the DATA folder, the Animation Viewer will use PNG sprites instead of Theme Hosp
exportSpritesPage(true, sdPath, L"WATCH01V");
//Skip DataM directory because it appears to be low-res versions of same

//Sprite sheet code for QData directory
//Sprite sheet code for QData directory
wxString sqPath = _getCaseSensitivePath(L"QDATA", sPath);
sqPath += wxFileName::GetPathSeparator();
exportSpritesPage(true, sqPath, L"AWARD03V", L"", L"AWARD02V.PAL");
Expand Down Expand Up @@ -604,7 +604,7 @@ the DATA folder, the Animation Viewer will use PNG sprites instead of Theme Hosp

void frmMain::exportSpritesPage(bool bComplex, wxString sPath, wxString sFilename, wxString spPath, wxString sPalette)
{
if(spPath.length() == 0)
if(spPath.length() == 0)
{
spPath = sPath;
}
Expand Down Expand Up @@ -660,7 +660,7 @@ void frmMain::_onToggleMask(wxCommandEvent& evt)
int iID = evt.GetId() - ID_LAYER_CHECKS;
int iLayer = iID / 25;
iID %= 25;

if(evt.IsChecked())
m_mskLayers.set(iLayer, iID);
else
Expand Down Expand Up @@ -985,11 +985,11 @@ wxString frmMain::_getCaseSensitivePath(const wxString& sInsensitivePathPart, co
{
bool found;
bool cont;

if(!wxFileName::IsCaseSensitive()) { return sPath + sInsensitivePathPart; }

wxString retStr(sPath);

wxStringTokenizer pathTokenizer(sInsensitivePathPart, wxFileName::GetPathSeparator());
while(pathTokenizer.HasMoreTokens())
{
Expand All @@ -998,9 +998,9 @@ wxString frmMain::_getCaseSensitivePath(const wxString& sInsensitivePathPart, co
{
break;
}

wxString pathPart = pathTokenizer.GetNextToken();

wxString realName;
cont = dir.GetFirst(&realName, wxEmptyString, wxDIR_DIRS|wxDIR_FILES|wxDIR_HIDDEN|wxDIR_DOTDOT);
found = false;
Expand All @@ -1018,15 +1018,15 @@ wxString frmMain::_getCaseSensitivePath(const wxString& sInsensitivePathPart, co
}
cont = dir.GetNext(&realName);
}

if(!found)
{
retStr += wxFileName::GetPathSeparator();
retStr += pathPart;
break;
}
}

while(pathTokenizer.HasMoreTokens())
{
wxString pathPart = pathTokenizer.GetNextToken();
Expand All @@ -1036,6 +1036,6 @@ wxString frmMain::_getCaseSensitivePath(const wxString& sInsensitivePathPart, co
}
retStr += pathPart;
}

return retStr;
}
2 changes: 1 addition & 1 deletion AnimView/frmSprites.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class frmSprites : public wxFrame

std::vector<_sprite_t> m_vSprites;
THAnimations m_oAnims;

wxTextCtrl* m_txtTable;
wxTextCtrl* m_txtData;
wxTextCtrl* m_txtPalette;
Expand Down
14 changes: 7 additions & 7 deletions AnimView/th.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ bool THAnimations::loadXMLFile(TiXmlDocument* xmlDocument)
return m_bXmlLoaded;
}

void THAnimations::writeElementData(wxString aPath, wxTextOutputStream *outputLog, wxTextOutputStream *outputXml,
void THAnimations::writeElementData(wxString aPath, wxTextOutputStream *outputLog, wxTextOutputStream *outputXml,
size_t iAnimation, size_t iFrame, const THLayerMask* pMask, wxSize& size, int *iListIndex)
{
if(iAnimation >= m_iAnimCount)
Expand All @@ -504,7 +504,7 @@ void THAnimations::writeElementData(wxString aPath, wxTextOutputStream *outputLo
if(pElement->flags >> 4 != 1)
{
uint16_t iElementIndex = m_pElementList[iOldListIndex];
outputXml->WriteString(wxString::Format(L"\t\t<el id='%u' tb='%u' fl='%u' ox='%u' oy='%u' ly='%u' ",
outputXml->WriteString(wxString::Format(L"\t\t<el id='%u' tb='%u' fl='%u' ox='%u' oy='%u' ly='%u' ",
iElementIndex, pElement->table_position, pElement->flags, pElement->offx, pElement->offy, pElement->layerid ));
uint16_t iSpriteIndex = pElement->table_position / sizeof(th_sprite_t);
wxString spriteFile = aPath + wxString::Format(L"a%04ue.png", iSpriteIndex);
Expand All @@ -518,7 +518,7 @@ void THAnimations::writeElementData(wxString aPath, wxTextOutputStream *outputLo
iFarY = iBottom;
//if(pMask != NULL && !pMask->isSet(pElement->flags >> 4, pElement->layerid))
// continue;
outputXml->WriteString(wxString::Format(L"sp='%u' of='%u' w='%u' h='%u'/>\n",
outputXml->WriteString(wxString::Format(L"sp='%u' of='%u' w='%u' h='%u'/>\n",
iSpriteIndex, pSprite->offset, pSprite->width, pSprite->height ));
if(!wxFileName::FileExists(spriteFile) && pSprite->width > 0 && pSprite->height > 0)
{
Expand All @@ -539,8 +539,8 @@ void THAnimations::writeElementData(wxString aPath, wxTextOutputStream *outputLo
getSpriteBitmap(iSpriteIndex)->blit(imgSprite, 0, 0, m_pGhostMaps + m_iGhostMapOffset, m_pColours, 0 & 0xF);
if(!imgSprite.SaveFile(spriteFile,wxBITMAP_TYPE_PNG))
return;
outputLog->WriteString(wxString::Format(L"E%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\n", iSpriteIndex,
pElement->table_position, pElement->flags, pElement->layerid, pElement->offx, pElement->offy,
outputLog->WriteString(wxString::Format(L"E%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\n", iSpriteIndex,
pElement->table_position, pElement->flags, pElement->layerid, pElement->offx, pElement->offy,
iNewListIndex, sizeof(th_sprite_t), pSprite->width, pSprite->height, pSprite->offset));
}
iNewListIndex++;
Expand Down Expand Up @@ -750,7 +750,7 @@ void THAnimations::drawFrame(wxImage& imgCanvas, size_t iAnimation, size_t iFram
}

void THAnimations::copySpriteToCanvas(wxString spriteFile, int iSpriteIndex, wxImage& imgCanvas, int iX, int iY, int iFlags) {
if(!m_pSpriteImages[iSpriteIndex].IsOk())
if(!m_pSpriteImages[iSpriteIndex].IsOk())
{
th_sprite_t* pSprite = m_pSprites + iSpriteIndex;
if(m_pSpriteScaleFactors[iSpriteIndex] > 1)
Expand All @@ -764,7 +764,7 @@ void THAnimations::copySpriteToCanvas(wxString spriteFile, int iSpriteIndex, wxI
m_pSpriteImages[iSpriteIndex].LoadFile(spriteFile,wxBITMAP_TYPE_PNG);
}
//m_pSpriteImages[iSpriteIndex].SetMaskColour(0,0,0);
if(!m_pSpriteImages[iSpriteIndex].HasAlpha())
if(!m_pSpriteImages[iSpriteIndex].HasAlpha())
{
m_pSpriteImages[iSpriteIndex].InitAlpha();
}
Expand Down
4 changes: 2 additions & 2 deletions AnimView/th.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class THAnimations
bool loadGhostFile(wxString sFilename, int iIndex);
bool loadXMLFile(TiXmlDocument* xmlDocument);

void writeElementData(wxString aPath, wxTextOutputStream *outputLog, wxTextOutputStream *outputXml,
void writeElementData(wxString aPath, wxTextOutputStream *outputLog, wxTextOutputStream *outputXml,
size_t iAnimation, size_t iFrame, const THLayerMask* pMask, wxSize& size, int* iListIndex);
void writeTableDataHeader(wxTextOutputStream *outputLog);

Expand Down Expand Up @@ -257,4 +257,4 @@ class THAnimations
size_t m_iColourCount;
bool m_bXmlLoaded;
wxString m_sSpritePath;
};
};
2 changes: 1 addition & 1 deletion AnimView/tinystr.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class TiXmlString
// to the normal allocation, although use an 'int' for systems
// that are overly picky about structure alignment.
const size_type bytesNeeded = sizeof(Rep) + cap;
const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int );
const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int );
rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] );

rep_->str[ rep_->size = sz ] = '\0';
Expand Down
Loading

0 comments on commit 4cd9379

Please sign in to comment.