Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
(cherry picked from commit ddnet/ddnet@81a39c2)
  • Loading branch information
yangfl authored and ChillerDragon committed Feb 12, 2020
1 parent fb3f76d commit c08acbe
Show file tree
Hide file tree
Showing 22 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion scripts/gen_keys.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys, os

# genereate keys.h file
# generate keys.h file
f = file("src/engine/keys.h", "w")

keynames = []
Expand Down
2 changes: 1 addition & 1 deletion src/base/hash_libtomcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static void sha_done(sha256_state* md, void* out)
md->curlen = 0;
}

// Pad upto 56 bytes of zeroes
// Pad up to 56 bytes of zeroes
while(md->curlen < 56)
md->buf[md->curlen++] = 0;

Expand Down
30 changes: 15 additions & 15 deletions src/base/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ IOHANDLE io_open(const char *filename, int flags);
Parameters:
io - Handle to the file to read data from.
buffer - Pointer to the buffer that will recive the data.
buffer - Pointer to the buffer that will receive the data.
size - Number of bytes to read from the file.
Returns:
Expand Down Expand Up @@ -528,7 +528,7 @@ int64 time_freq();

/*
Function: time_timestamp
Retrives the current time as a UNIX timestamp
Retrieves the current time as a UNIX timestamp
Returns:
The time as a UNIX timestamp
Expand Down Expand Up @@ -600,7 +600,7 @@ typedef struct
void net_invalidate_socket(NETSOCKET *socket);
/*
Function: net_init
Initiates network functionallity.
Initiates network functionality.
Returns:
Returns 0 on success,
Expand Down Expand Up @@ -699,13 +699,13 @@ int net_udp_send(NETSOCKET sock, const NETADDR *addr, const void *data, int size

/*
Function: net_udp_recv
Recives a packet over an UDP socket.
Receives a packet over an UDP socket.
Parameters:
sock - Socket to use.
addr - Pointer to an NETADDR that will recive the address.
data - Pointer to a buffer that will recive the data.
maxsize - Maximum size to recive.
addr - Pointer to an NETADDR that will receive the address.
data - Pointer to a buffer that will receive the data.
maxsize - Maximum size to receive.
Returns:
On success it returns the number of bytes recived. Returns -1
Expand Down Expand Up @@ -886,18 +886,18 @@ int str_length(const char *str);

/*
Function: str_format
Performs printf formating into a buffer.
Performs printf formatting into a buffer.
Parameters:
buffer - Pointer to the buffer to recive the formated string.
buffer - Pointer to the buffer to receive the formatted string.
buffer_size - Size of the buffer.
format - printf formating string.
... - Parameters for the formating.
format - printf formatting string.
... - Parameters for the formatting.
Remarks:
- See the C manual for syntax for the printf formating string.
- The strings are treated as zero-terminated strings.
- Garantees that dst string will contain zero-termination.
- See the C manual for syntax for the printf formatting string.
- The strings are treated as zero-termineted strings.
- Guarantees that dst string will contain zero-termination.
*/
void str_format(char *buffer, int buffer_size, const char *format, ...)
GNUC_ATTRIBUTE((format(printf, 3, 4)));
Expand Down Expand Up @@ -1244,7 +1244,7 @@ const char *str_find(const char *haystack, const char *needle);
data - Size of the data
Remarks:
- The desination buffer will be zero-terminated
- The destination buffer will be zero-terminated
*/
void str_hex(char *dst, int dst_size, const void *data, int data_size);

Expand Down
2 changes: 1 addition & 1 deletion src/base/tl/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class array : private ALLOCATOR

/*
Function: optimize
Removes unnessasary data, returns how many bytes was earned.
Removes unnecessary data, returns how many bytes was earned.
Remarks:
- Invalidates ranges
Expand Down
2 changes: 1 addition & 1 deletion src/engine/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class IClient : public IInterface
STATE_LOADING - The client has connected to a server and is loading resources.
STATE_ONLINE - The client is connected to a server and running the game.
STATE_DEMOPLAYBACK - The client is playing a demo
STATE_QUITING - The client is quiting.
STATE_QUITING - The client is quitting.
*/

enum
Expand Down
2 changes: 1 addition & 1 deletion src/engine/client/backend_sdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
class CGraphicsBackend_Threaded : public IGraphicsBackend
{
public:
// constructed on the main thread, the rest of the functions is runned on the render thread
// constructed on the main thread, the rest of the functions is run on the render thread
class ICommandProcessor
{
public:
Expand Down
2 changes: 1 addition & 1 deletion src/engine/client/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void CSound::RateConvert(int SampleID)

for(int i = 0; i < NumFrames; i++)
{
// resample TODO: this should be done better, like linear atleast
// resample TODO: this should be done better, like linear at least
float a = i/(float)NumFrames;
int f = (int)(a*pSample->m_NumFrames);
if(f >= pSample->m_NumFrames)
Expand Down
2 changes: 1 addition & 1 deletion src/engine/docs/prediction.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Title: Prediction

The engine calls <modc_predict> when reprediction is required. This happens usally when new data has arrived from the server. <modc_predict> should to prediction from the current snapshot and current snapshot tick (<client_tick> + 1) upto and including the tick returned by <client_predtick>.

Predicted input sent to the server can be retrived by calling <client_get_input> with the corresponding tick that you want the input for. Here is a simple example of how it might look.
Predicted input sent to the server can be retrieved by calling <client_get_input> with the corresponding tick that you want the input for. Here is a simple example of how it might look.

> void modc_predict()
> {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/docs/snapshots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Section: Overview

Topic: Definitions

- *Snapshot*. A is a serialized game state from which a client can render the game from. They are sent from the server at a regular interval and is created specificly for each client in order to reduce bandwidth.
- *Snapshot*. A is a serialized game state from which a client can render the game from. They are sent from the server at a regular interval and is created specifically for each client in order to reduce bandwidth.
- *Delta Snapshot*. A set of data that can be applied to a snapshot in order to create a new snapshot with the updated game state.

Topic: Structure
Expand Down
2 changes: 1 addition & 1 deletion src/engine/external/important.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The source code under this directory are external libraries
with their own licences. The source you find here is stripped
of unnessesary information. Please visit their websites for
of unnecessary information. Please visit their websites for
more information and official releases.

2 changes: 1 addition & 1 deletion src/engine/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class IKernel
static IKernel *Create();
virtual ~IKernel() {}

// templated access to handle pointer convertions and interface names
// templated access to handle pointer conversions and interface names
template<class TINTERFACE>
bool RegisterInterface(TINTERFACE *pInterface)
{
Expand Down
6 changes: 3 additions & 3 deletions src/engine/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void CSnapIDPool::FreeID(int ID)
{
if(ID < 0)
return;
dbg_assert(m_aIDs[ID].m_State == 1, "id is not alloced");
dbg_assert(m_aIDs[ID].m_State == 1, "id is not allocated");

m_InUsage--;
m_aIDs[ID].m_State = 2;
Expand Down Expand Up @@ -551,7 +551,7 @@ void CServer::DoSnapshot()
// create snapshots for all clients
for(int i = 0; i < MAX_CLIENTS; i++)
{
// client must be ingame to recive snapshots
// client must be ingame to receive snapshots
if(m_aClients[i].m_State != CClient::STATE_INGAME)
continue;

Expand Down Expand Up @@ -591,7 +591,7 @@ void CServer::DoSnapshot()
// save it the snapshot
m_aClients[i].m_Snapshots.Add(m_CurrentGameTick, time_get(), SnapshotSize, pData, 0);

// find snapshot that we can preform delta against
// find snapshot that we can perform delta against
EmptySnap.Clear();

{
Expand Down
2 changes: 1 addition & 1 deletion src/engine/server/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CSnapIDPool
{
public:
short m_Next;
short m_State; // 0 = free, 1 = alloced, 2 = timed
short m_State; // 0 = free, 1 = allocated, 2 = timed
int m_Timeout;
};

Expand Down
2 changes: 1 addition & 1 deletion src/engine/shared/netban.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ bool CNetBan::IsBanned(const NETADDR *pAddr, char *pBuf, unsigned BufferSize, in
CNetHash aHash[17];
int Length = CNetHash::MakeHashArray(pAddr, aHash);

// check ban adresses
// check ban addresses
CBanAddr *pBan = m_BanAddrPool.Find(pAddr, &aHash[Length]);
if(pBan)
{
Expand Down
2 changes: 1 addition & 1 deletion src/engine/shared/network_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ int CNetConnection::Update()
}
else
{
// resend packet if we havn't got it acked in 1 second
// resend packet if we haven't got it acked in 1 second
if(Now-pResend->m_LastSendTime > time_freq())
ResendChunk(pResend);
}
Expand Down
4 changes: 2 additions & 2 deletions src/engine/shared/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <base/system.h>

/*
Connection diagram - How the initilization works.
Connection diagram - How the initialization works.
Client -> INFO -> Server
Contains version info, name, and some other info.
Expand All @@ -20,7 +20,7 @@
modc_connected is called on the client and
mods_connected is called on the server.
The client should call client_entergame when the
mod has done it's initilization.
mod has done it's initialization.
Client -> ENTERGAME -> Server
Tells the server to start sending snapshots.
Expand Down
2 changes: 1 addition & 1 deletion src/engine/shared/ringbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int CRingBufferBase::PopFirst()
m_pConsume = NextBlock(m_pConsume);
}

// in the case that we have catched up with the produce pointer
// in the case that we have caught up with the produce pointer
// we might stand on a free block so merge em
MergeBack(m_pConsume);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ void CChat::AddLine(const char *pLine, int ClientID, int Mode, int TargetID)
while(*p)
{
pLine = p;
// find line seperator and strip multiline
// find line separator and strip multiline
while(*p)
{
if(*p++ == '\n')
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID)
s_LastGameTickTime = Client()->GameTickTime();
float Ct = (Client()->PrevGameTick()-pCurrent->m_StartTick)/(float)SERVER_TICK_SPEED + s_LastGameTickTime;
if(Ct < 0)
return; // projectile havn't been shot yet
return; // projectile haven't been shot yet

vec2 StartPos(pCurrent->m_X, pCurrent->m_Y);
vec2 StartVel(pCurrent->m_VelX/100.0f, pCurrent->m_VelY/100.0f);
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/sounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void CSounds::OnRender()
return;
}

// set listner pos
// set listener pos
vec2 Pos = *m_pClient->m_pCamera->GetCenter();
Sound()->SetListenerPos(Pos.x, Pos.y);

Expand Down
2 changes: 1 addition & 1 deletion src/game/client/gameclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void FormatTimeDiff(char *pBuf, int Size, int Time, int Precision, bool ForceSig
AppendDecimals(pBuf, Size, Time, Precision);
}

// instanciate all systems
// instantiate all systems
static CInfoMessages gs_InfoMessages;
static CCamera gs_Camera;
static CChat gs_Chat;
Expand Down
2 changes: 1 addition & 1 deletion src/game/editor/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ void CEditor::DoToolbar(CUIRect ToolBar)
// tile info button
TB_Top.VSplitLeft(40.0f, &Button, &TB_Top);
static int s_TileInfoButton = 0;
if(DoButton_Editor(&s_TileInfoButton, "Info", m_ShowTileInfo, &Button, 0, "[ctrl+i] Show tile informations") ||
if(DoButton_Editor(&s_TileInfoButton, "Info", m_ShowTileInfo, &Button, 0, "[ctrl+i] Show tile information") ||
(Input()->KeyPress(KEY_I) && (Input()->KeyIsPressed(KEY_LCTRL) || Input()->KeyIsPressed(KEY_RCTRL))))
{
m_ShowTileInfo = !m_ShowTileInfo;
Expand Down

0 comments on commit c08acbe

Please sign in to comment.