Skip to content

Commit

Permalink
Finished correction orthograph in src/ directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanemagnenat committed Oct 9, 2024
1 parent 6569c18 commit 2adc3e3
Show file tree
Hide file tree
Showing 120 changed files with 1,307 additions and 1,307 deletions.
6 changes: 3 additions & 3 deletions src/BasePlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ Uint32 BasePlayer::checkSum()
//Uint32 netHost=SDL_SwapBE32(ip.host);
//Uint32 netPort=(Uint32)SDL_SwapBE16(ip.port);
//cs^=netHost;
// IP adress can't stay in checksum, because:
// We now support NAT or IP may simply be differents between computers
// IP address can't stay in checksum, because:
// We now support NAT or IP may simply be different between computers
// And we uses checkSum in network.
// (we could uses two differents check sums, but the framework would be heavier)
// (we could uses two different check sums, but the framework would be heavier)
//cs^=netPort;

for (unsigned i=0; i<name.size(); i++)
Expand Down
16 changes: 8 additions & 8 deletions src/Brush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ void BrushTool::handleClick(int x, int y)



void BrushTool::drawBrush(int x, int y, int viewportX, int viewportY, int originalX, int originalY, bool onlines)
void BrushTool::drawBrush(int x, int y, int viewportX, int viewportY, int originalX, int originalY, bool onLines)
{
/* We use 2/3 intensity to indicate removing areas. This was
formerly 78% intensity, which was bright enough that it was hard
to notice any difference, so the brightness has been lowered. */
int i = ((mode == MODE_ADD) ? 255 : 170);
drawBrush(x, y, Color(i,i,i), viewportX, viewportY, originalX, originalY, onlines);
drawBrush(x, y, Color(i,i,i), viewportX, viewportY, originalX, originalY, onLines);
}

void BrushTool::drawBrush(int x, int y, GAGCore::Color c, int viewportX, int viewportY, int originalX, int originalY, bool onlines)
void BrushTool::drawBrush(int x, int y, GAGCore::Color c, int viewportX, int viewportY, int originalX, int originalY, bool onLines)
{
/* It violates good abstraction practices that Brush.cpp knows
this much about the visual layout of the GUI. */
x = ((x+(onlines ? 16 : 0)) & ~0x1f) + (!onlines ? 16 : 0);
y = ((y+(onlines ? 16 : 0)) & ~0x1f) + (!onlines ? 16 : 0);
x = ((x+(onLines ? 16 : 0)) & ~0x1f) + (!onLines ? 16 : 0);
y = ((y+(onLines ? 16 : 0)) & ~0x1f) + (!onLines ? 16 : 0);
int w = getBrushWidth(figure);
int h = getBrushHeight(figure);
/* Move x and y from center of focus point to upper left of
Expand All @@ -96,18 +96,18 @@ void BrushTool::drawBrush(int x, int y, GAGCore::Color c, int viewportX, int vie

if(originalX == -1)
originalX = viewportX + (x / cell_size);
else if(onlines)
else if(onLines)
originalX+=1;
if(originalY == -1)
originalY = viewportY + (y / cell_size);
else if(onlines)
else if(onLines)
originalY+=1;

for (int cx = 0; cx < w; cx++)
{
for (int cy = 0; cy < h; cy++)
{
// TODO: the brush is wrong, but without lookuping viewport in game gui, there is no way to know this
// TODO: the brush is wrong, but without looking up viewport in game gui, there is no way to know this
if (getBrushValue(figure, cx, cy, viewportX + (x / cell_size), viewportY + (y / cell_size), originalX, originalY))
{
globalContainer->gfx->drawRect(x + (cell_size * cx) + inset, y + (cell_size * cy) + inset, cell_size - inset, cell_size - inset, c);
Expand Down
4 changes: 2 additions & 2 deletions src/Brush.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class BrushTool
void defaultSelection(void) { mode = MODE_ADD; }

//! Draw the actual brush (not the brush tool)
void drawBrush(int x, int y, int viewportX, int viewportY, int originalX=-1, int originalY=-1, bool onlines=false);
void drawBrush(int x, int y, GAGCore::Color c, int viewportX, int viewportY, int originalX=-1, int originalY=-1, bool onlines=false);
void drawBrush(int x, int y, int viewportX, int viewportY, int originalX=-1, int originalY=-1, bool onLines=false);
void drawBrush(int x, int y, GAGCore::Color c, int viewportX, int viewportY, int originalX=-1, int originalY=-1, bool onLines=false);
//! Return the mode of the brush
unsigned getType(void) { return static_cast<unsigned>(mode); }
//! Set the mode of the brush
Expand Down
2 changes: 1 addition & 1 deletion src/BuildingType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void BuildingType::loadFromConfigFile(const ConfigBlock *configBlock)
}
}

//! Return a chcksum of all parameter that could lead to a game desynchronization
//! Return a checksum of all parameter that could lead to a game desynchronization
Uint32 BuildingType::checkSum(void)
{
Uint32 cs = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/BuildingType.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#ifndef __BULDING_TYPE_H
#define __BULDING_TYPE_H
#ifndef __BUILDING_TYPE_H
#define __BUILDING_TYPE_H

#include <vector>

Expand Down
26 changes: 13 additions & 13 deletions src/CampaignEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,31 @@ void CampaignEditor::onAction(Widget *source, Action action, int par1, int par2)
else if (source == addMap)
{
ChooseMapScreen cms("campaigns", "map", false);
int rcms=cms.execute(gfx, 40);
if(rcms==ChooseMapScreen::OK)
int rCms=cms.execute(gfx, 40);
if(rCms==ChooseMapScreen::OK)
{
MapHeader& mapHeader = cms.getMapHeader();
CampaignMapEntry cme(mapHeader.getMapName(), glob2NameToFilename("campaigns", mapHeader.getMapName(), "map"));
CampaignMapEntryEditor cmee(campaign, cme);
int rcmee = cmee.execute(gfx, 40);
if(rcmee==CampaignMapEntryEditor::OK)
CampaignMapEntryEditor mee(campaign, cme);
int rMee = mee.execute(gfx, 40);
if(rMee==CampaignMapEntryEditor::OK)
{
campaign.appendMap(cme);
mapList->addText(mapHeader.getMapName());
}
else if(rcmee==CampaignMapEntryEditor::CANCEL)
else if(rMee==CampaignMapEntryEditor::CANCEL)
{

}
else if(rcmee == -1)
else if(rMee == -1)
{
endExecute(-1);
}
}
else if(rcms==ChooseMapScreen::CANCEL)
else if(rCms==ChooseMapScreen::CANCEL)
{
}
else if(rcms==-1)
else if(rCms==-1)
{
endExecute(-1);
}
Expand All @@ -106,13 +106,13 @@ void CampaignEditor::onAction(Widget *source, Action action, int par1, int par2)
{
if(mapList->getSelectionIndex()!=-1 && campaign.getMap(i).getMapName()==mapList->get())
{
CampaignMapEntryEditor cmee(campaign, campaign.getMap(i));
int rcmee = cmee.execute(gfx, 40);
if(rcmee==CampaignMapEntryEditor::OK)
CampaignMapEntryEditor mee(campaign, campaign.getMap(i));
int rMee = mee.execute(gfx, 40);
if(rMee==CampaignMapEntryEditor::OK)
{
mapList->setText(mapList->getSelectionIndex(), campaign.getMap(i).getMapName());
}
else if(rcmee==CampaignMapEntryEditor::CANCEL)
else if(rMee==CampaignMapEntryEditor::CANCEL)
{
}
}
Expand Down
24 changes: 12 additions & 12 deletions src/CreditScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ using namespace GAGCore;
// New class for an auto-scrolling credit screen.

// INCLUDE part
// #ifndef __SCROLLINGTEXT_H
// #define __SCROLLINGTEXT_H
// #ifndef __SCROLLING_TEXT_H
// #define __SCROLLING_TEXT_H
//
// #include "GUIBase.h"
// #include <string>
Expand All @@ -47,9 +47,9 @@ class ScrollingText:public RectangularWidget
std::string filename;
std::string font;
std::vector<std::string> text;
std::vector<int> xPos; // Pre-calculated postions for text centering
std::vector<int> xPos; // Pre-calculated positions for text centering
int offset;
int imgid, imgid0;
int imgId, imgId0;

// cache, recomputed on internalInit
GAGCore::Font *fontPtr;
Expand Down Expand Up @@ -79,8 +79,8 @@ ScrollingText::ScrollingText(int x, int y, int w, int h, Uint32 hAlign, Uint32 v
this->vAlignFlag = vAlign;

offset = 0;
imgid = 0;
imgid0 = 88;
imgId = 0;
imgId0 = 88;

assert(font.size());
assert(filename.size());
Expand Down Expand Up @@ -112,7 +112,7 @@ void ScrollingText::internalInit(void)
getScreenPos(&x, &y, &w, &h);
offset = -h + 25;

// Measures all the length of all the lines of the file (usefull for centering)
// Measures all the length of all the lines of the file (useful for centering)
for (size_t i = 0; i < text.size(); i++)
{
std::string &s = text[i];
Expand All @@ -124,7 +124,7 @@ void ScrollingText::internalInit(void)
// If we can find a "<" and a ">" in this line
if ((f != std::string::npos) && (l != std::string::npos))
{
// Rips off the e-mail adresses
// Rips off the e-mail addresses
s.erase(f, l-f+1);
}
}
Expand All @@ -141,7 +141,7 @@ void ScrollingText::paint()
assert(parent->getSurface());

int yPos = y;
imgid = imgid0 + (offset & 0x7);
imgId = imgId0 + (offset & 0x7);

for (size_t i = 0; i < text.size(); i++)
{
Expand All @@ -159,9 +159,9 @@ void ScrollingText::paint()

Sprite *unitSprite=globalContainer->units;
unitSprite->setBaseColor(128, 128, 128);
int decX = (unitSprite->getW(imgid)-32)>>1;
int decY = (unitSprite->getH(imgid)-32)>>1;
globalContainer->gfx->drawSprite(px-decX, py-decY, unitSprite, imgid);
int decX = (unitSprite->getW(imgId)-32)>>1;
int decY = (unitSprite->getH(imgId)-32)>>1;
globalContainer->gfx->drawSprite(px-decX, py-decY, unitSprite, imgId);

yPos += 20;
}
Expand Down
12 changes: 6 additions & 6 deletions src/CustomGameOtherOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ CustomGameOtherOptions::CustomGameOtherOptions(GameHeader& gameHeader, MapHeader
addWidget(allyTeamNumbers[i]);
}

teamsFixed = new OnOffButton(300, 60, 21, 21, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, gameHeader.areAllyTeamsFixed(), TEAMSFIXED);
teamsFixed = new OnOffButton(300, 60, 21, 21, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, gameHeader.areAllyTeamsFixed(), TEAMS_FIXED);
addWidget(teamsFixed);
teamsFixedText = new Text(325, 60, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", Toolkit::getStringTable()->getString("[Teams Fixed]"));
addWidget(teamsFixedText);
if(readOnly)
teamsFixed->setClickable(false);

//These are for winning conditions
prestigeWinEnabled = new OnOffButton(300, 90, 21, 21, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, true, PRESTIGEWINENABLED);
prestigeWinEnabled = new OnOffButton(300, 90, 21, 21, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, true, PRESTIGE_WIN_ENABLED);
addWidget(prestigeWinEnabled);
prestigeWinEnabledText = new Text(325, 90, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", Toolkit::getStringTable()->getString("[Prestige Win Enabled]"));
addWidget(prestigeWinEnabledText);
Expand All @@ -94,7 +94,7 @@ CustomGameOtherOptions::CustomGameOtherOptions(GameHeader& gameHeader, MapHeader
prestigeWinEnabled->setClickable(false);

//Map discovered.
mapDiscovered = new OnOffButton(300, 120, 21, 21, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, gameHeader.isMapDiscovered(), MAPDISCOVERED);
mapDiscovered = new OnOffButton(300, 120, 21, 21, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, gameHeader.isMapDiscovered(), MAP_DISCOVERED);
addWidget(mapDiscovered);
mapDiscoveredText = new Text(325, 120, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", Toolkit::getStringTable()->getString("[Map Discovered]"));
addWidget(mapDiscoveredText);
Expand Down Expand Up @@ -152,15 +152,15 @@ void CustomGameOtherOptions::onAction(Widget *source, Action action, int par1, i
}
gameHeader.setAllyTeamNumber(team, n);
}
else if(par1 == TEAMSFIXED)
else if(par1 == TEAMS_FIXED)
{
gameHeader.setAllyTeamsFixed(teamsFixed->getState());
}
else if(par1 == PRESTIGEWINENABLED)
else if(par1 == PRESTIGE_WIN_ENABLED)
{
updateGameHeaderWinningConditions();
}
else if(par1 == MAPDISCOVERED)
else if(par1 == MAP_DISCOVERED)
{
gameHeader.setMapDiscovered(mapDiscovered->getState());
}
Expand Down
10 changes: 5 additions & 5 deletions src/CustomGameOtherOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CustomGameOtherOptions : public Glob2Screen
CustomGameOtherOptions(GameHeader& gameHeader, MapHeader& mapHeader, bool readOnly);
/// Destructor
virtual ~CustomGameOtherOptions();
///Recieves an action from a widget
///Receives an action from a widget
virtual void onAction(Widget *source, Action action, int par1, int par2);

///These are the end values for this screen
Expand All @@ -62,9 +62,9 @@ class CustomGameOtherOptions : public Glob2Screen
{
OK,
CANCEL,
TEAMSFIXED,
PRESTIGEWINENABLED,
MAPDISCOVERED,
TEAMS_FIXED,
PRESTIGE_WIN_ENABLED,
MAP_DISCOVERED,
};

///"Other Options" Title
Expand All @@ -78,7 +78,7 @@ class CustomGameOtherOptions : public Glob2Screen
Text ** playerNames;
//! Player colors
ColorButton ** color;
//! Player ally temas
//! Player ally teams
MultiTextButton ** allyTeamNumbers;

///Button fixing teams during the match
Expand Down
2 changes: 1 addition & 1 deletion src/CustomGameScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MapPreview;

const int NumberOfPlayerSelectors=12;

//! This screen is used to setup a custom game. AI can be set. Map choosing functionnalities are inherited from ChooseMapScreen
//! This screen is used to setup a custom game. AI can be set. Map choosing functionalities are inherited from ChooseMapScreen
class CustomGameScreen : public ChooseMapScreen
{

Expand Down
8 changes: 4 additions & 4 deletions src/DynamicClouds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

#define INT_ROUND_RSHIFT(x,places) ( ((x)+(1<<((places)-1))) >> (places) )

void DynamicClouds::compute(const int viewPortX, const int viewPortY, const int viewPortWdth, const int viewPortHeight, const int time)
void DynamicClouds::compute(const int viewPortX, const int viewPortY, const int viewPortWidth, const int viewPortHeight, const int time)
{
if (globalContainer->gfx->getOptionFlags() & GraphicContext::USE_GPU)
{
//tribute to the torrodial world: the viewport must never jump by more than 31.
//tribute to the toroidal world: the viewport must never jump by more than 31.
//if it does, we assume a jump in the opposite direction
static int vpX=0;
static int vpY=0;
Expand All @@ -47,7 +47,7 @@ void DynamicClouds::compute(const int viewPortX, const int viewPortY, const int
vpX += (viewPortX-vpX%64+96)%64-32;
vpY += (viewPortY-vpY%64+96)%64-32;

wGrid=viewPortWdth/granularity+1;
wGrid=viewPortWidth/granularity+1;
hGrid=viewPortHeight/granularity+1;
alphaMap.resize(wGrid*hGrid);

Expand Down Expand Up @@ -97,7 +97,7 @@ void DynamicClouds::render(DrawableSurface *dest, const int viewPortWidth, const
assert(false);
}
//magnify cloud map by cloud height in white (clouds)
//TODO: (int)(cloudheight*granularity) might round unexpectedly for
//TODO: (int)(cloudHeight*granularity) might round unexpectedly for
//low granularity resulting in unpainted areas/unscaled clouds.
dest->drawAlphaMap(alphaMap,
wGrid, hGrid,
Expand Down
8 changes: 4 additions & 4 deletions src/DynamicClouds.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifndef _DYNAMICCLOUDS_H
#define _DYNAMICCLOUDS_H
#ifndef __DYNAMIC_CLOUDS_H
#define __DYNAMIC_CLOUDS_H

#include "PerlinNoise.h"
#include "Settings.h"
Expand Down Expand Up @@ -107,8 +107,8 @@ class DynamicClouds
* @param h height of the alphaMap
* @param time time
*/
void compute(const int viewPortX, const int viewPortY, const int viewPortWdth, const int viewPortHeght, const int time);
void compute(const int viewPortX, const int viewPortY, const int viewPortWidth, const int viewPortHeight, const int time);
void render(DrawableSurface *dest, const int viewPortWidth, const int viewPortHeight, Layer layer);
};

#endif /* _DYNAMICCLOUDS_H */
#endif /* __DYNAMIC_CLOUDS_H */
Loading

0 comments on commit 2adc3e3

Please sign in to comment.