Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Core/GameEngine/Source/Common/ReplaySimulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int ReplaySimulation::simulateReplaysInThisProcess(const std::vector<AsciiString
DWORD totalStartTimeMillis = GetTickCount();
for (size_t i = 0; i < filenames.size(); i++)
{
AsciiString filename = filenames[i];
const AsciiString &filename = filenames[i];
printf("Simulating Replay \"%s\"\n", filename.str());
fflush(stdout);
DWORD startTimeMillis = GetTickCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void ControlBar::populatePurchaseScience( Player* player )

setControlCommand( m_sciencePurchaseWindowsRank3[ i ], commandButton );
ScienceType st = SCIENCE_INVALID;
ScienceVec sv = commandButton->getScienceVec();
const ScienceVec &sv = commandButton->getScienceVec();
if (! sv.empty())
{
st = sv[ 0 ];
Expand Down
4 changes: 2 additions & 2 deletions Core/GameEngine/Source/GameNetwork/GameSpy/LadderDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static LadderInfo *parseLadder(AsciiString raw)
AsciiStringList validFactions = lad->validFactions;
for (AsciiStringListIterator it = validFactions.begin(); it != validFactions.end(); ++it)
{
AsciiString faction = *it;
const AsciiString &faction = *it;
AsciiString marker;
marker.format("INI:Faction%s", faction.str());
DEBUG_LOG(("Faction %s has marker %s corresponding to str %ls", faction.str(), marker.str(), TheGameText->fetch(marker).str()));
Expand All @@ -196,7 +196,7 @@ static LadderInfo *parseLadder(AsciiString raw)
std::list<AsciiString> qmMaps = TheGameSpyConfig->getQMMaps();
for (std::list<AsciiString>::const_iterator it = qmMaps.begin(); it != qmMaps.end(); ++it)
{
AsciiString mapName = *it;
const AsciiString &mapName = *it;

// check sizes on the maps before allowing them
const MapMetaData *md = TheMapCache->findMap(mapName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ void W3DTerrainVisual::addFactionBib(Object *factionBuilding, Bool highlight, Re
pos.set(0,0,0);
Real exitWidth = factionBuilding->getTemplate()->getFactoryExitWidth();
Real extraWidth = factionBuilding->getTemplate()->getFactoryExtraBibWidth() + extra;
const GeometryInfo info = factionBuilding->getGeometryInfo();
const GeometryInfo &info = factionBuilding->getGeometryInfo();
Real sizeX = info.getMajorRadius();
Real sizeY = info.getMinorRadius();
if (info.getGeomType() != GEOMETRY_BOX) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void W3DTreeBuffer::cull(const CameraClass * camera)
Int curTree;

// Calculate the vector direction that the camera is looking at.
Matrix3D camera_matrix = camera->Get_Transform();
const Matrix3D &camera_matrix = camera->Get_Transform();
float zmod = -1;
float x = zmod * camera_matrix[0][2] ;
float y = zmod * camera_matrix[1][2] ;
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ float RenderObjClass::Get_Screen_Size(CameraClass &camera)
// accurate (perhaps by using the object-space bounding-box)
Vector3 cam = camera.Get_Position();

ViewportClass viewport = camera.Get_Viewport();
const ViewportClass &viewport = camera.Get_Viewport();
Vector2 vpr_min, vpr_max;
camera.Get_View_Plane(vpr_min, vpr_max);
float width_factor = viewport.Width() / (vpr_max.X - vpr_min.X);
Expand Down
6 changes: 2 additions & 4 deletions Core/Libraries/Source/WWVegas/WW3D2/texproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,9 +931,8 @@ bool TexProjectClass::Compute_Perspective_Projection
** Calculate the axis-aligned bounding box of the model in the camera's coordinate system.
*/
AABoxClass box = obj_box;
Matrix3D obj_to_world = tm;
Matrix3D obj_to_texture;
Matrix3D::Multiply(texture_tm_inv,obj_to_world,&obj_to_texture);
Matrix3D::Multiply(texture_tm_inv,tm,&obj_to_texture);
box.Transform(obj_to_texture);

/*
Expand Down Expand Up @@ -1060,9 +1059,8 @@ bool TexProjectClass::Compute_Ortho_Projection
** Calculate the axis-aligned bounding box of the model in the camera's coordinate system.
*/
AABoxClass box = obj_box;
Matrix3D obj_to_world = tm;
Matrix3D obj_to_texture;
Matrix3D::Multiply(texture_tm_inv,obj_to_world,&obj_to_texture);
Matrix3D::Multiply(texture_tm_inv,tm,&obj_to_texture);
box.Transform(obj_to_texture);

/*
Expand Down
3 changes: 1 addition & 2 deletions Core/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,8 @@ Sound3DClass::Set_Position (const Vector3 &position)
//
// Transform the sound's position into 'listener-space'
//
Vector3 sound_pos = position;
Vector3 listener_space_pos;
Matrix3D::Inverse_Transform_Vector (m_ListenerTransform, sound_pos, &listener_space_pos);
Matrix3D::Inverse_Transform_Vector (m_ListenerTransform, position, &listener_space_pos);

//
// Update the object's position inside of Miles
Expand Down
2 changes: 1 addition & 1 deletion Core/Tools/W3DView/W3DViewDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2719,7 +2719,7 @@ CW3DViewDoc::Copy_Assets_To_Dir (LPCTSTR directory)
//
// Determine the source and destination filenames
//
StringClass filename = dependency_list[counter];
const StringClass &filename = dependency_list[counter];
CString src_filename = src_path + CString (filename);
CString dest_filename = dest_path + CString (filename);

Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/textureCompress/textureCompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ static void scanDir( const std::string& sourceDirName, const std::string& target
FileInfoSet::iterator fit = sourceFiles->find(f);
if (fit != sourceFiles->end())
{
FileInfo sf = *fit;
const FileInfo &sf = *fit;
if (f.modTime < sf.modTime)
{
/**
Expand Down Expand Up @@ -563,7 +563,7 @@ static void scanDir( const std::string& sourceDirName, const std::string& target
FileInfoSet::iterator fit = cacheFiles->find(f);
if (fit != cacheFiles->end())
{
FileInfo cf = *fit;
const FileInfo &cf = *fit;
if (cf.modTime < f.modTime)
{
origFilesToCompress.insert(fname);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ void PopulateOldBuddyMessages()
BuddyMessageList *messages = TheGameSpyInfo->getBuddyMessages();
for (BuddyMessageList::iterator mIt = messages->begin(); mIt != messages->end(); ++mIt)
{
BuddyMessage message = *mIt;
const BuddyMessage &message = *mIt;
insertChat(message);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ static void populateQuickMatchMapSelectListbox( QuickMatchPreferences& pref )
GadgetListBoxReset(listboxMapSelect);
for (std::list<AsciiString>::const_iterator it = maps.begin(); it != maps.end(); ++it)
{
AsciiString theMap = *it;
const AsciiString &theMap = *it;
const MapMetaData *md = TheMapCache->findMap(theMap);
if (md && md->m_numPlayers >= numPlayers)
{
Expand Down Expand Up @@ -1670,7 +1670,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms
if (cit != ladderInfo->validFactions.end())
{
Int numPlayerTemplates = ThePlayerTemplateStore->getPlayerTemplateCount();
AsciiString sideStr = *cit;
const AsciiString &sideStr = *cit;
DEBUG_LOG(("Chose %s as our side... finding", sideStr.str()));
for (Int c=0; c<numPlayerTemplates; ++c)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void ScriptConditions::objectTypesFromParam(Parameter *pTypeParm, ObjectTypes *o
return;
}

AsciiString str = pTypeParm->getString();
const AsciiString &str = pTypeParm->getString();

if (str.isEmpty()) {
return;
Expand Down Expand Up @@ -355,7 +355,7 @@ Bool ScriptConditions::evaluateNamedUnitTotallyDead(Parameter *pUnitParm)
//-------------------------------------------------------------------------------------------------
Bool ScriptConditions::evaluateHasUnits(Parameter *pTeamParm)
{
AsciiString desiredTeamName = pTeamParm->getString();
const AsciiString &desiredTeamName = pTeamParm->getString();
// If they are calling a <this team> condition, do it.
if (desiredTeamName == THIS_TEAM) {
Team *theTeam = TheScriptEngine->getTeamNamed( desiredTeamName );
Expand Down Expand Up @@ -396,7 +396,6 @@ Bool ScriptConditions::evaluateTeamInsideAreaPartially(Parameter *pTeamParm, Par
Team *theTeam = TheScriptEngine->getTeamNamed( pTeamParm->getString() );
// The team is the team based on the name, and the calling team (if any) and the team that
// is being considered for the condition. jba. :)
AsciiString triggerName = pTriggerAreaParm->getString();
PolygonTrigger *pTrig = TheScriptEngine->getQualifiedTriggerAreaByName(pTriggerAreaParm->getString());

if (pTrig == nullptr) return false;
Expand All @@ -418,7 +417,6 @@ Bool ScriptConditions::evaluateNamedInsideArea(Parameter *pUnitParm, Parameter *
return false;
}

AsciiString triggerName = pTriggerAreaParm->getString();
PolygonTrigger *pTrig = TheScriptEngine->getQualifiedTriggerAreaByName(pTriggerAreaParm->getString());
if (pTrig == nullptr) return false;
if (theObj) {
Expand All @@ -435,7 +433,6 @@ Bool ScriptConditions::evaluateNamedInsideArea(Parameter *pUnitParm, Parameter *
//-------------------------------------------------------------------------------------------------
Bool ScriptConditions::evaluatePlayerHasUnitTypeInArea(Condition *pCondition, Parameter *pPlayerParm, Parameter *pComparisonParm, Parameter *pCountParm, Parameter *pTypeParm, Parameter *pTriggerParm )
{
AsciiString triggerName = pTriggerParm->getString();
PolygonTrigger *pTrig = TheScriptEngine->getQualifiedTriggerAreaByName(pTriggerParm->getString());
if (pTrig == nullptr) return false;

Expand Down Expand Up @@ -527,7 +524,6 @@ Bool ScriptConditions::evaluatePlayerHasUnitTypeInArea(Condition *pCondition, Pa
//-------------------------------------------------------------------------------------------------
Bool ScriptConditions::evaluatePlayerHasUnitKindInArea(Condition *pCondition, Parameter *pPlayerParm, Parameter *pComparisonParm, Parameter *pCountParm, Parameter *pKindParm, Parameter *pTriggerParm )
{
AsciiString triggerName = pTriggerParm->getString();
PolygonTrigger *pTrig = TheScriptEngine->getQualifiedTriggerAreaByName(pTriggerParm->getString());
if (pTrig == nullptr) return false;

Expand Down Expand Up @@ -611,7 +607,7 @@ Bool ScriptConditions::evaluateTeamStateIs(Parameter *pTeamParm, Parameter *pSta
Team *theTeam = TheScriptEngine->getTeamNamed( pTeamParm->getString() );
// The team is the team based on the name, and the calling team (if any) and the team that
// is being considered for the condition. jba. :)
AsciiString stateName = pStateParm->getString();
const AsciiString &stateName = pStateParm->getString();
if (theTeam) {
return (theTeam->getState() == stateName);
}
Expand All @@ -627,7 +623,7 @@ Bool ScriptConditions::evaluateTeamStateIsNot(Parameter *pTeamParm, Parameter *p
Team *theTeam = TheScriptEngine->getTeamNamed( pTeamParm->getString() );
// The team is the team based on the name, and the calling team (if any) and the team that
// is being considered for the condition. jba. :)
AsciiString stateName = pStateParm->getString();
const AsciiString &stateName = pStateParm->getString();
if (theTeam) {
return (!(theTeam->getState() == stateName));
}
Expand All @@ -651,7 +647,6 @@ Bool ScriptConditions::evaluateTeamInsideAreaEntirely(Parameter *pTeamParm, Para
Team *theTeam = TheScriptEngine->getTeamNamed( pTeamParm->getString() );
// The team is the team based on the name, and the calling team (if any) and the team that
// is being considered for the condition. jba. :)
AsciiString triggerName = pTriggerParm->getString();
PolygonTrigger *pTrig = TheScriptEngine->getQualifiedTriggerAreaByName(pTriggerParm->getString());

if (pTrig == nullptr)
Expand Down Expand Up @@ -1290,7 +1285,7 @@ Bool ScriptConditions::evaluateNamedReachedWaypointsEnd(Parameter *pUnitParm, Pa

if (!targetWay) return false;

AsciiString pathName = pWaypointPathParm->getString();
const AsciiString &pathName = pWaypointPathParm->getString();

if (targetWay->getPathLabel1() == pathName) return true;
if (targetWay->getPathLabel2() == pathName) return true;
Expand All @@ -1309,7 +1304,7 @@ Bool ScriptConditions::evaluateTeamReachedWaypointsEnd(Parameter *pTeamParm, Par
return false;
}

AsciiString pathName = pWaypointPathParm->getString();
const AsciiString &pathName = pWaypointPathParm->getString();
Bool anyAtEnd = false;
Bool anyNotAtEnd = false;
// Note - This returns true if any of the team completed the path. This is as the current
Expand Down Expand Up @@ -2019,7 +2014,6 @@ Bool ScriptConditions::evaluateSkirmishValueInArea(Condition *pCondition, Parame
return false;
}

AsciiString triggerName = pTriggerParm->getString();
PolygonTrigger *pTrig = TheScriptEngine->getQualifiedTriggerAreaByName(pTriggerParm->getString());

if (!pTrig) {
Expand Down Expand Up @@ -2574,7 +2568,7 @@ Bool ScriptConditions::evaluateSkirmishPlayerHasDiscoveredPlayer(Parameter *pSki
//-------------------------------------------------------------------------------------------------
Bool ScriptConditions::evaluateMusicHasCompleted(Parameter *pMusicParm, Parameter *pIntParm)
{
AsciiString str = pMusicParm->getString();
const AsciiString &str = pMusicParm->getString();
return TheAudio->hasMusicTrackCompleted(str, pIntParm->getInt());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6661,7 +6661,7 @@ Bool ScriptEngine::isSpecialPowerTriggered( Int playerIndex, const AsciiString&

for (ListAsciiStringObjectIDIt findIt = specialList->begin(); findIt != specialList->end(); ++findIt)
{
AsciiStringObjectIDPair pair = *findIt;
const AsciiStringObjectIDPair &pair = *findIt;
if (pair.first == completedPower && (sourceObj == INVALID_ID || sourceObj == pair.second))
{
if (removeFromList) {
Expand All @@ -6686,7 +6686,7 @@ Bool ScriptEngine::isSpecialPowerMidway( Int playerIndex, const AsciiString& com

for (ListAsciiStringObjectIDIt findIt = specialList->begin(); findIt != specialList->end(); ++findIt)
{
AsciiStringObjectIDPair pair = *findIt;
const AsciiStringObjectIDPair &pair = *findIt;
if (pair.first == completedPower && (sourceObj == INVALID_ID || sourceObj == pair.second))
{
if (removeFromList) {
Expand All @@ -6711,7 +6711,7 @@ Bool ScriptEngine::isSpecialPowerComplete( Int playerIndex, const AsciiString& c

for (ListAsciiStringObjectIDIt findIt = specialList->begin(); findIt != specialList->end(); ++findIt)
{
AsciiStringObjectIDPair pair = *findIt;
const AsciiStringObjectIDPair &pair = *findIt;
if (pair.first == completedPower && (sourceObj == INVALID_ID || sourceObj == pair.second))
{
if (removeFromList) {
Expand All @@ -6736,7 +6736,7 @@ Bool ScriptEngine::isUpgradeComplete( Int playerIndex, const AsciiString& upgrad

for (ListAsciiStringObjectIDIt findIt = specialList->begin(); findIt != specialList->end(); ++findIt)
{
AsciiStringObjectIDPair pair = *findIt;
const AsciiStringObjectIDPair &pair = *findIt;
if (pair.first == upgrade && (sourceObj == INVALID_ID || sourceObj == pair.second))
{
if (removeFromList) {
Expand Down Expand Up @@ -6853,7 +6853,7 @@ void ScriptEngine::adjustToppleDirection( Object *object, Coord2D *direction)
//-------------------------------------------------------------------------------------------------
void ScriptEngine::adjustToppleDirection( Object *object, Coord3D *direction)
{
AsciiString objName = object->getName();
const AsciiString &objName = object->getName();
if (objName.isEmpty() || !direction) {
return;
}
Expand Down
5 changes: 1 addition & 4 deletions Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@ void MeshModelClass::compose_deformed_vertex_buffer(
for (vi = 0; vi < vertex_count;) {
const Matrix3D & tm = htree->Get_Transform(bonelink[vi]);

// Make a copy so we can set the translation to zero
Matrix3D mytm=tm;

int idx=bonelink[vi];
int cnt;
for (cnt = vi; cnt < vertex_count; cnt++) {
Expand All @@ -348,7 +345,7 @@ void MeshModelClass::compose_deformed_vertex_buffer(
}

for (int pidx=0;pidx<cnt-vi;++pidx) {
const Matrix3D& A=mytm;
const Matrix3D& A=tm;
VertexFormatXYZNDUV2* out=verts+vi+pidx;
const Vector3& v=*(src_vert+vi+pidx);
out->x = (A[0][0] * v.X + A[0][1] * v.Y + A[0][2] * v.Z + A[0][3]);
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Libraries/Source/WWVegas/WW3D2/part_buf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ void ParticleBufferClass::Prepare_LOD(CameraClass &camera)
// treat them as all being the maximum size and being in the center of the bounding sphere).

Vector3 cam = camera.Get_Position();
ViewportClass viewport = camera.Get_Viewport();
const ViewportClass &viewport = camera.Get_Viewport();
Vector2 vpr_min, vpr_max;
camera.Get_View_Plane(vpr_min, vpr_max);
float width_factor = viewport.Width() / (vpr_max.X - vpr_min.X);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void EditObjectParameter::addObject( const ThingTemplate *thingTemplate )
parent = findOrAdd( parent, "TEST" );

// first sort by Side, either create or find the tree item with matching side name
AsciiString side = thingTemplate->getDefaultOwningSide();
const AsciiString &side = thingTemplate->getDefaultOwningSide();
DEBUG_ASSERTCRASH(!side.isEmpty(), ("null default side in template") );
parent = findOrAdd( parent, side.str());

Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/src/EditParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ Bool EditParameter::loadUpgrades(CComboBox *pCombo, AsciiString match)

for (int i = 0; i < numUpgrades; ++i) {

AsciiString upgradeName = upgradeNames[i];
const AsciiString &upgradeName = upgradeNames[i];
if (pCombo) {
pCombo->AddString(upgradeName.str());
}
Expand Down
8 changes: 4 additions & 4 deletions Generals/Code/Tools/WorldBuilder/src/ScriptDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ void ScriptDialog::markWaypoint(MapObject *pObj)
void ScriptDialog::scanParmForWaypointsAndTeams(Parameter *pParm, Bool doUnits, Bool doWaypoints, Bool doTriggers)
{
if (pParm->getParameterType() == Parameter::WAYPOINT && doWaypoints) {
AsciiString waypointName = pParm->getString();
const AsciiString &waypointName = pParm->getString();
MapObject *pObj;
for (pObj = MapObject::getFirstMapObject(); pObj; pObj = pObj->getNext()) {
if (pObj->isWaypoint() && pObj->getWaypointName()==waypointName) {
Expand All @@ -1013,7 +1013,7 @@ void ScriptDialog::scanParmForWaypointsAndTeams(Parameter *pParm, Bool doUnits,
}
}
if (pParm->getParameterType() == Parameter::WAYPOINT_PATH && doWaypoints) {
AsciiString waypointPathLabel = pParm->getString();
const AsciiString &waypointPathLabel = pParm->getString();
MapObject *pObj;
for (pObj = MapObject::getFirstMapObject(); pObj; pObj = pObj->getNext()) {
if (pObj->isWaypoint() ) {
Expand All @@ -1031,7 +1031,7 @@ void ScriptDialog::scanParmForWaypointsAndTeams(Parameter *pParm, Bool doUnits,
}
}
if (pParm->getParameterType() == Parameter::TEAM) {
AsciiString teamName = pParm->getString();
const AsciiString &teamName = pParm->getString();
TeamsInfo * pInfo = m_sides.findTeamInfo(teamName);
if (pInfo) {
pInfo->getDict()->setBool(TheKey_exportWithScript, true);
Expand All @@ -1048,7 +1048,7 @@ void ScriptDialog::scanParmForWaypointsAndTeams(Parameter *pParm, Bool doUnits,
}
}
if (pParm->getParameterType() == Parameter::UNIT) {
AsciiString unitName = pParm->getString();
const AsciiString &unitName = pParm->getString();
if (doUnits) {
MapObject *pObj;
for (pObj = MapObject::getFirstMapObject(); pObj; pObj = pObj->getNext()) {
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Source/Common/Thing/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ Bool UpgradeMuxData::isTriggeredBy(const std::string &upgrade) const
std::vector<AsciiString>::const_iterator it;
for( it = m_triggerUpgradeNames.begin(); it != m_triggerUpgradeNames.end(); ++it)
{
AsciiString trigger = *it;
const AsciiString &trigger = *it;
if (stricmp(trigger.str(), upgrade.c_str()) == 0)
{
return TRUE;
Expand Down
Loading
Loading