Skip to content

Commit

Permalink
Fix a few typos
Browse files Browse the repository at this point in the history
  • Loading branch information
striezel authored and Web-eWorks committed Jan 26, 2023
1 parent c309a72 commit 6a3a044
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/Beam.cpp
Expand Up @@ -228,7 +228,7 @@ static void MiningLaserSpawnTastyStuff(FrameId fId, const SystemBody *asteroid,
{
lua_State *l = Lua::manager->GetLuaState();

// lua cant push "const SystemBody", needs to convert to non-const
// lua can't push "const SystemBody", needs to convert to non-const
RefCountedPtr<StarSystem> s = Pi::game->GetGalaxy()->GetStarSystem(asteroid->GetPath());
SystemBody *liveasteroid = s->GetBodyByPath(asteroid->GetPath());

Expand Down
4 changes: 2 additions & 2 deletions src/FixedGuns.cpp
Expand Up @@ -266,7 +266,7 @@ void FixedGuns::UpdateLead(float timeStep, int num, Body *ship, Body *target)
//we solve for l which can be interpreted as 1/time for the projectile to reach the target
//it gives:
// |targpos|^2 * l^2 + targpos*targvel * 2l + |targvel|^2 - projspeed^2 = 0;
// so it gives scalar quadratic equation with two posible solutions - we care only about the positive one - shooting forward
// so it gives scalar quadratic equation with two possible solutions - we care only about the positive one - shooting forward
// A basic math for solving, there is probably more elegant and efficient way to do this:
double a = targpos.LengthSqr();
double b = targpos.Dot(targvel) * 2;
Expand All @@ -287,7 +287,7 @@ void FixedGuns::UpdateLead(float timeStep, int num, Body *ship, Body *target)
m_currentLeadDir = forwardVector;
return;
} else {
//This is an exact solution as opposed to 2 step aproximation used before
//This is an exact solution as opposed to 2 step approximation used before.
//It does not improve the accuracy as expected though.
//If the target is accelerating and is far enough then this aim assist will
//actually make sure that it is mpossible to hit..
Expand Down
2 changes: 1 addition & 1 deletion src/Game.cpp
Expand Up @@ -449,7 +449,7 @@ void Game::SwitchToHyperspace()
// can clean up
m_player->NotifyRemoved(cloud);

// turn the cloud arround
// turn the cloud around
cloud->GetShip()->SetHyperspaceDest(m_hyperspaceSource);
cloud->SetIsArrival(true);

Expand Down
2 changes: 1 addition & 1 deletion src/GasGiant.cpp
Expand Up @@ -551,7 +551,7 @@ void GasGiant::GenerateTexture()
Color *colors = new Color[(s_texture_size_small * s_texture_size_small)];
for (Uint32 v = 0; v < s_texture_size_small; v++) {
for (Uint32 u = 0; u < s_texture_size_small; u++) {
// where in this row & colum are we now.
// where in this row & column are we now.
const double ustep = double(u) * fracStep;
const double vstep = double(v) * fracStep;

Expand Down
2 changes: 1 addition & 1 deletion src/GasGiantJobs.cpp
Expand Up @@ -53,7 +53,7 @@ namespace GasGiantJobs {
double fracStep = 1.0 / double(UVDims() - 1);
for (Sint32 v = 0; v < UVDims(); v++) {
for (Sint32 u = 0; u < UVDims(); u++) {
// where in this row & colum are we now.
// where in this row & column are we now.
const double ustep = double(u) * fracStep;
const double vstep = double(v) * fracStep;

Expand Down
4 changes: 2 additions & 2 deletions src/Input.cpp
Expand Up @@ -65,13 +65,13 @@ std::string Input::JoystickGUIDString(int joystick)
return std::string(guidBuffer);
}

// conveniance version of JoystickFromGUID below that handles the string mangling.
// convenience version of JoystickFromGUID below that handles the string mangling.
int Input::JoystickFromGUIDString(const std::string &guid)
{
return JoystickFromGUIDString(guid.c_str());
}

// conveniance version of JoystickFromGUID below that handles the string mangling.
// convenience version of JoystickFromGUID below that handles the string mangling.
int Input::JoystickFromGUIDString(const char *guid)
{
return JoystickFromGUID(SDL_JoystickGetGUIDFromString(guid));
Expand Down
8 changes: 4 additions & 4 deletions src/JobQueue.cpp
Expand Up @@ -131,7 +131,7 @@ Uint32 SyncJobQueue::FinishJobs()

void SyncJobQueue::Cancel(Job *job)
{
// check the waiting list. if its there then it hasn't run yet. just forget about it
// Check the waiting list. If it's there then it hasn't run yet. Just forget about it.
for (std::deque<Job *>::iterator i = m_queue.begin(); i != m_queue.end(); ++i) {
if (*i == job) {
i = m_queue.erase(i);
Expand All @@ -140,8 +140,8 @@ void SyncJobQueue::Cancel(Job *job)
}
}

// check the finshed list. if its there then it can't be cancelled, because
// its alread finished! we remove it because the caller is saying "I don't care"
// Check the finshed list. If it's there then it can't be cancelled, because
// it's already finished! We remove it because the caller is saying "I don't care".
for (std::deque<Job *>::iterator i = m_finished.begin(); i != m_finished.end(); ++i) {
if (*i == job) {
i = m_finished.erase(i);
Expand All @@ -150,7 +150,7 @@ void SyncJobQueue::Cancel(Job *job)
}
}

// its running, so we have to tell it to cancel
// it's running, so we have to tell it to cancel
job->cancelled = true;
job->UnlinkHandle();
job->OnCancel();
Expand Down
4 changes: 2 additions & 2 deletions src/ModelViewer.cpp
Expand Up @@ -424,7 +424,7 @@ void ModelViewer::DrawGrid(const matrix4x4f &trans, float radius)
m_gridLines->Draw(m_renderer, { max, max }, m_options.gridInterval);
}

// industry-standard red/green/blue XYZ axis indiactor
// industry-standard red/green/blue XYZ axis indicator
m_renderer->SetTransform(trans * matrix4x4f::ScaleMatrix(radius));
Graphics::Drawables::GetAxes3DDrawable(m_renderer)->Draw(m_renderer);
}
Expand Down Expand Up @@ -471,7 +471,7 @@ void ModelViewer::Update(float deltaTime)
m_navLights->Update(deltaTime);
m_shields->SetEnabled(m_options.showShields || m_shieldIsHit);

//Calculate the impact's radius dependant on time
//Calculate the impact's radius dependent on time
const float dif1 = 0.34 - (-1.48f);
const float dif2 = m_shieldHitPan - (-1.48f);
//Range from start (0.0) to end (1.0)
Expand Down
2 changes: 1 addition & 1 deletion src/NavLights.cpp
Expand Up @@ -133,7 +133,7 @@ NavLights::NavLights(SceneGraph::Model *model, float period) :
} else if (mt->GetName().substr(9, 3) == "pad") {
//group by pad number
// due to this problem: http://stackoverflow.com/questions/15825254/why-is-scanfhhu-char-overwriting-other-variables-when-they-are-local
// where MSVC is still using a C89 compiler the format identifer %hhu is not recognised. Therefore I've switched to Uint32 for group.
// where MSVC is still using a C89 compiler the format identifier %hhu is not recognised. Therefore I've switched to Uint32 for group.
PiVerify(1 == sscanf(mt->GetName().c_str(), "navlight_pad%u", &group));
mask = 0xf8;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ObjectViewerView.cpp
Expand Up @@ -80,7 +80,7 @@ void ObjectViewerView::Draw3D()

m_targetBody->Render(m_renderer, m_camera.get(), vector3d(0, 0, -viewingDist), m_camRot);

// industry-standard red/green/blue XYZ axis indiactor
// industry-standard red/green/blue XYZ axis indicator
matrix4x4d trans = matrix4x4d::Translation(vector3d(0, 0, -viewingDist)) * m_camRot * matrix4x4d::ScaleMatrix(m_targetBody->GetClipRadius() * 2.0);
m_renderer->SetTransform(matrix4x4f(trans));
Graphics::Drawables::GetAxes3DDrawable(m_renderer)->Draw(m_renderer);
Expand Down
2 changes: 1 addition & 1 deletion src/Quaternion.h
Expand Up @@ -47,7 +47,7 @@ class Quaternion {

void GetAxisAngle(T &angle, vector3<T> &axis)
{
if (w > 1.0) *this = Normalized(); // if w>1 acos and sqrt will produce errors, this cant happen if quaternion is normalised
if (w > 1.0) *this = Normalized(); // if w>1 acos and sqrt will produce errors, this can't happen if quaternion is normalised
angle = 2.0 * acos(w);
double s = sqrt(1.0 - w * w); // assuming quaternion normalised then w is less than 1, so term always positive.
if (s < 0.001) { // test to avoid divide by zero, s is always positive due to sqrt
Expand Down
2 changes: 1 addition & 1 deletion src/Ship.cpp
Expand Up @@ -15,7 +15,7 @@
#include "Missile.h"
#include "NavLights.h"
#include "Planet.h"
#include "Player.h" // <-- Here only for 1 occurence of "Pi::player" in Ship::Explode
#include "Player.h" // <-- Here only for 1 occurrence of "Pi::player" in Ship::Explode
#include "Sensors.h"
#include "Sfx.h"
#include "Shields.h"
Expand Down
8 changes: 4 additions & 4 deletions src/Space.cpp
Expand Up @@ -37,8 +37,8 @@ static void RelocateStarportIfNecessary(SystemBody *sbody, Planet *planet, vecto
pos = rot * vector3d(0, 1, 0);

// Check if height varies too much around the starport center
// by sampling 6 points around it. try upto 100 new positions randomly until a match is found
// this is not guaranteed to find a match but greatly increases the chancessteroids which are not too steep.
// by sampling 6 points around it. Try up to 100 new positions randomly until a match is found.
// This is not guaranteed to find a match but greatly increases the chancessteroids which are not too steep.

bool variationWithinLimits = true;
double bestVariation = 1e10; // any high value
Expand Down Expand Up @@ -77,7 +77,7 @@ static void RelocateStarportIfNecessary(SystemBody *sbody, Planet *planet, vecto

// check height at 6 points around the starport center stays within variation tolerances
// GetHeight gives a varying height field in 3 dimensions.
// Given it's smoothly varying it's fine to sample it in arbitary directions to get an idea of how sharply it varies
// Given it's smoothly varying it's fine to sample it in arbitrary directions to get an idea of how sharply it varies
double v[6];
v[0] = fabs(planet->GetTerrainHeight(vector3d(pos_.x + delta, pos_.y, pos_.z)) - radius - height);
v[1] = fabs(planet->GetTerrainHeight(vector3d(pos_.x - delta, pos_.y, pos_.z)) - radius - height);
Expand Down Expand Up @@ -549,7 +549,7 @@ std::vector<Space::BodyDist> Space::BodiesInAngle(const Body *b, const vector3d
//offset from the body center - like for view from ship cocpit
vector3d dirBody = body->GetPositionRelTo(b) * b->GetOrient() - offset;
double d = dirBody.Length();
//Normalizing but not using Normalized() function to avoid calculating Lenght again
//Normalizing but not using Normalized() function to avoid calculating Length again
dirBody = dirBody / d;

//Bodies outside of the cone disregarded
Expand Down
2 changes: 1 addition & 1 deletion src/Space.h
Expand Up @@ -21,7 +21,7 @@ class Space {
// empty space (eg for hyperspace)
Space(Game *game, RefCountedPtr<Galaxy> galaxy, Space *oldSpace = nullptr);

// initalise with system bodies
// initialise with system bodies
Space(Game *game, RefCountedPtr<Galaxy> galaxy, const SystemPath &path, Space *oldSpace = nullptr);

// initialise from save file
Expand Down
4 changes: 2 additions & 2 deletions src/SystemView.cpp
Expand Up @@ -307,7 +307,7 @@ void SystemView::GetTransformTo(const SystemBody *b, vector3d &pos)
void SystemView::GetTransformTo(Projectable &p, vector3d &pos)
{
if (p.type == Projectable::NONE) {
// notning selected
// nothing selected
pos *= 0.0;
return;
}
Expand All @@ -321,7 +321,7 @@ void SystemView::GetTransformTo(Projectable &p, vector3d &pos)
const Ship *s = static_cast<const Ship *>(p.ref.body);
CalculateShipPositionAtTime(s, s->ComputeOrbit(), m_time, pos);
pos = -pos;
// sometimes ships can dissapear from world (i.e. docking / undocking)
// sometimes ships can disappear from world (i.e. docking / undocking)
if (std::isnan(pos.x)) { // failsafe: calculate parent systembody instead
pos = vector3d(0., 0., 0.);
GetTransformTo(Frame::GetFrame(Frame::GetFrame(Pi::player->GetFrame())->GetNonRotFrame())->GetSystemBody(), pos);
Expand Down
2 changes: 1 addition & 1 deletion src/galaxy/Factions.cpp
Expand Up @@ -137,7 +137,7 @@ static int l_fac_govtype_weight(lua_State *L)

if (weight < 0) {
pi_lua_warn(L,
"weight must a postive integer: Faction{%s}:govtype_weight('%s', %d)",
"weight must be a positive integer: Faction{%s}:govtype_weight('%s', %d)",
fac->name.c_str(), typeName, weight);
return 0;
}
Expand Down
10 changes: 5 additions & 5 deletions src/galaxy/StarSystemGenerator.cpp
Expand Up @@ -845,8 +845,8 @@ void StarSystemRandomGenerator::PickPlanetType(SystemBody *sbody, Random &rand)
sbody->m_rotationPeriod = fixed(int(round(sbody->GetOrbit().Period())), 3600 * 24);
sbody->m_axialTilt = sbody->GetInclinationAsFixed();
} else if (invTidalLockTime > fixed(1, 100)) { // rotation speed changed in favour of tidal lock
// XXX: there should be some chance the satellite was captured only recenly and ignore this
// I'm ommiting that now, I do not want to change the Universe by additional rand call.
// XXX: there should be some chance the satellite was captured only recently and ignore this
// I'm omitting that now, I do not want to change the Universe by additional rand call.

fixed lambda = invTidalLockTime / (fixed(1, 20) + invTidalLockTime);
sbody->m_rotationPeriod = (1 - lambda) * sbody->GetRotationPeriodAsFixed() + lambda * sbody->GetOrbit().Period() / 3600 / 24;
Expand Down Expand Up @@ -1140,7 +1140,7 @@ void StarSystemRandomGenerator::MakeBinaryPair(SystemBody *a, SystemBody *b, fix
a->m_orbit.SetPlane(matrix3x3d::RotateY(rotY) * matrix3x3d::RotateX(rotX));
b->m_orbit.SetPlane(matrix3x3d::RotateY(rotY - M_PI) * matrix3x3d::RotateX(rotX));

// store orbit parameters for later use to be accesible in other way than by rotMatrix
// store orbit parameters for later use to be accessible in other way than by rotMatrix
b->m_orbitalPhaseAtStart = b->m_orbitalPhaseAtStart + FIXED_PI;
b->m_orbitalPhaseAtStart = b->m_orbitalPhaseAtStart > 2 * FIXED_PI ? b->m_orbitalPhaseAtStart - 2 * FIXED_PI : b->m_orbitalPhaseAtStart;
a->m_orbitalPhaseAtStart = a->m_orbitalPhaseAtStart > 2 * FIXED_PI ? a->m_orbitalPhaseAtStart - 2 * FIXED_PI : a->m_orbitalPhaseAtStart;
Expand Down Expand Up @@ -1320,7 +1320,7 @@ void PopulateStarSystemGenerator::PositionSettlementOnPlanet(SystemBody *sbody,

// store latitude and longitude to equivalent orbital parameters to
// be accessible easier
sbody->m_inclination = fixed(r1 * 10000, 10000) + FIXED_PI / 2; // latitide
sbody->m_inclination = fixed(r1 * 10000, 10000) + FIXED_PI / 2; // latitude
sbody->m_orbitalOffset = FIXED_PI / 2; // longitude
}

Expand Down Expand Up @@ -1630,7 +1630,7 @@ void PopulateStarSystemGenerator::PopulateAddStations(SystemBody *sbody, StarSys
system->AddSpaceStation(sp);
}

// garuantee that there is always a star port on a populated world
// guarantee that there is always a star port on a populated world
if (!system->HasSpaceStations()) {
SystemBody *sp = system->NewBody();
sp->m_type = SystemBody::TYPE_STARPORT_SURFACE;
Expand Down
2 changes: 1 addition & 1 deletion src/galaxy/SystemBody.cpp
Expand Up @@ -243,7 +243,7 @@ std::string SystemBody::GetAstroDescription() const
else if (m_mass > fixed(12,1000)) // ~Weight of the moon (By definition here to be
s = Lang::SMALL; // the upper limit of a Dwarf planet
else if (m_mass > fixed(1, 12000)) { // ~Larger than the weight of Salacia (0.7% moon mass)
if (moon) { // which is concidered not a dwarf planet
if (moon) { // which is considered not a dwarf planet
s = Lang::TINY;
} else {
dwarfplanet = true;
Expand Down
6 changes: 3 additions & 3 deletions src/matrix4x4.h
Expand Up @@ -200,9 +200,9 @@ class matrix4x4 {
// aligned with the Z-axis. Unless you know what you're doing, you shouldn't use this.
//
// @param left - the minimum x-value of the view volume at the near plane
// @param right - the maxiumum x-value of the view volume at the near plane
// @param bottom - the maxiumum y-value of the view volume at the near plane
// @param top - the maxiumum y-value of the view volume at the near plane
// @param right - the maximum x-value of the view volume at the near plane
// @param bottom - the maximum y-value of the view volume at the near plane
// @param top - the maximum y-value of the view volume at the near plane
// @param znear - the near clipping plane
// @param zfar - the far clipping plane
static matrix4x4 FrustumMatrix(T left, T right, T bottom, T top, T znear, T zfar)
Expand Down

0 comments on commit 6a3a044

Please sign in to comment.