Skip to content
Permalink
Browse files

More lowercase struct field names

  • Loading branch information...
UnknownShadow200 committed Jun 8, 2019
1 parent b0794ef commit 0ed3197b09d87c6e4d60b248d0c2639438dfd0c1
Showing with 213 additions and 213 deletions.
  1. +4 −4 src/Audio.c
  2. +1 −1 src/AxisLinesRenderer.c
  3. +3 −3 src/Camera.c
  4. +2 −2 src/Camera.h
  5. +2 −2 src/Chat.c
  6. +1 −1 src/Chat.h
  7. +2 −2 src/Entity.c
  8. +1 −1 src/EntityComponents.c
  9. +2 −2 src/Funcs.h
  10. +5 −5 src/Game.c
  11. +1 −1 src/GameStructs.h
  12. +1 −1 src/HeldBlockRenderer.c
  13. +4 −4 src/Model.c
  14. +2 −2 src/Model.h
  15. +49 −49 src/Particle.c
  16. +4 −4 src/Particle.h
  17. +6 −6 src/Resources.c
  18. +104 −104 src/Vorbis.c
  19. +19 −19 src/Vorbis.h
@@ -761,17 +761,17 @@ static ReturnCode Music_PlayOgg(struct Stream* source) {
ReturnCode res;

Ogg_MakeStream(&stream, buffer, source);
vorbis.Source = &stream;
vorbis.source = &stream;
if ((res = Vorbis_DecodeHeaders(&vorbis))) goto cleanup;

fmt.Channels = vorbis.Channels;
fmt.SampleRate = vorbis.SampleRate;
fmt.Channels = vorbis.channels;
fmt.SampleRate = vorbis.sampleRate;
fmt.BitsPerSample = 16;
if ((res = Audio_SetFormat(music_out, &fmt))) goto cleanup;

/* largest possible vorbis frame decodes to blocksize1 * channels samples */
/* so we may end up decoding slightly over a second of audio */
chunkSize = fmt.Channels * (fmt.SampleRate + vorbis.BlockSizes[1]);
chunkSize = fmt.Channels * (fmt.SampleRate + vorbis.blockSizes[1]);
samplesPerSecond = fmt.Channels * fmt.SampleRate;
data = (int16_t*)Mem_Alloc(chunkSize * AUDIO_MAX_BUFFERS, 2, "Ogg final output");

@@ -38,7 +38,7 @@ void AxisLinesRenderer_Render(double delta) {

Gfx_SetTexturing(false);
pos = LocalPlayer_Instance.Base.Position; pos.Y += 0.05f;
count = Camera.Active->IsThirdPerson ? 12 : 8;
count = Camera.Active->isThirdPerson ? 12 : 8;

Vector3_Add1(&coords[0], &pos, -AXISLINES_LENGTH);
Vector3_Add1(&coords[1], &pos, -AXISLINES_THICKNESS);
@@ -80,7 +80,7 @@ static void PerspectiveCamera_UpdateMouseRotation(double delta) {
float headY, headX;
Vector2 rot = PerspectiveCamera_GetMouseDelta(delta);

if (Key_IsAltPressed() && Camera.Active->IsThirdPerson) {
if (Key_IsAltPressed() && Camera.Active->isThirdPerson) {
cam_rotOffset.X += rot.X; cam_rotOffset.Y += rot.Y;
return;
}
@@ -251,7 +251,7 @@ void Camera_Init(void) {
void Camera_CycleActive(void) {
struct LocalPlayer* p = &LocalPlayer_Instance;
if (Game_ClassicMode) return;
Camera.Active = Camera.Active->Next;
Camera.Active = Camera.Active->next;

if (!p->Hacks.CanUseThirdPersonCamera || !p->Hacks.Enabled) {
Camera.Active = &cam_FirstPerson;
@@ -268,7 +268,7 @@ static struct Camera* cams_tail;
void Camera_Register(struct Camera* cam) {
LinkedList_Add(cam, cams_head, cams_tail);
/* want a circular linked list */
cam->Next = cams_head;
cam->next = cams_head;
}

static bool cam_focussed;
@@ -32,7 +32,7 @@ extern struct _CameraData {

struct Camera {
/* Whether this camera is third person. (i.e. not allowed when -thirdperson in MOTD) */
bool IsThirdPerson;
bool isThirdPerson;

/* Calculates the current projection matrix of this camera. */
void (*GetProjection)(struct Matrix* proj);
@@ -60,7 +60,7 @@ struct Camera {
bool (*Zoom)(float amount);

/* Next camera in linked list of cameras. */
struct Camera* Next;
struct Camera* next;
};

/* Initialises the default cameras. */
@@ -239,7 +239,7 @@ static struct ChatCommand* Commands_GetMatch(const String* cmdName) {
String name;
struct ChatCommand* match = NULL;

for (cmd = cmds_head; cmd; cmd = cmd->Next) {
for (cmd = cmds_head; cmd; cmd = cmd->next) {
name = String_FromReadonly(cmd->Name);
if (!String_CaselessStarts(&name, cmdName)) continue;

@@ -270,7 +270,7 @@ static void Commands_PrintDefault(void) {
Chat_AddRaw("&eList of client commands:");
String_InitArray(str, strBuffer);

for (cmd = cmds_head; cmd; cmd = cmd->Next) {
for (cmd = cmds_head; cmd; cmd = cmd->next) {
name = String_FromReadonly(cmd->Name);

if ((str.length + name.length + 2) > str.capacity) {
@@ -40,7 +40,7 @@ struct ChatCommand {
void (*Execute)(const String* args, int argsCount);
bool SingleplayerOnly; /* Whether this command is only usable in singleplayer */
const char* Help[5]; /* Messages to show when a player uses /help on this command */
struct ChatCommand* Next; /* Next command in linked-list of client commands */
struct ChatCommand* next; /* Next command in linked-list of client commands */
};
/* Registers a client-side command, allowing it to be used with /client [cmd name] */
CC_API void Commands_Register(struct ChatCommand* cmd);
@@ -873,12 +873,12 @@ static void LocalPlayer_RenderModel(struct Entity* e, double deltaTime, float t)
AnimatedComp_GetCurrent(e, t);
TiltComp_GetCurrent(&p->Tilt, t);

if (!Camera.Active->IsThirdPerson) return;
if (!Camera.Active->isThirdPerson) return;
Model_Render(e->Model, e);
}

static void LocalPlayer_RenderName(struct Entity* e) {
if (!Camera.Active->IsThirdPerson) return;
if (!Camera.Active->isThirdPerson) return;
Player_DrawName((struct Player*)e);
}

@@ -1300,7 +1300,7 @@ static bool SoundComp_ShouldPlay(struct LocalPlayer* p, Vector3 soundPos) {
if (p->Base.Anim.Swing < 0.999f) return distSq > 1.75f * 1.75f;

/* have our legs just crossed over the '0' point? */
if (Camera.Active->IsThirdPerson) {
if (Camera.Active->isThirdPerson) {
oldLegRot = (float)Math_Cos(p->Base.Anim.WalkTimeO);
newLegRot = (float)Math_Cos(p->Base.Anim.WalkTimeN);
} else {
@@ -34,8 +34,8 @@ if (j - left <= right - i) {\
}

#define LinkedList_Add(item, head, tail)\
if (!head) { head = item; } else { tail->Next = item; }\
if (!head) { head = item; } else { tail->next = item; }\
tail = item;\
item->Next = NULL;
item->next = NULL;

#endif
@@ -196,7 +196,7 @@ void Game_Reset(void) {
World_TextureUrl.length = 0;
}

for (comp = comps_head; comp; comp = comp->Next) {
for (comp = comps_head; comp; comp = comp->next) {
if (comp->Reset) comp->Reset();
}
}
@@ -288,14 +288,14 @@ static void Game_OnResize(void* obj) {

static void Game_OnNewMapCore(void* obj) {
struct IGameComponent* comp;
for (comp = comps_head; comp; comp = comp->Next) {
for (comp = comps_head; comp; comp = comp->next) {
if (comp->OnNewMap) comp->OnNewMap();
}
}

static void Game_OnNewMapLoadedCore(void* obj) {
struct IGameComponent* comp;
for (comp = comps_head; comp; comp = comp->Next) {
for (comp = comps_head; comp; comp = comp->next) {
if (comp->OnNewMapLoaded) comp->OnNewMapLoaded();
}
}
@@ -498,7 +498,7 @@ static void Game_Load(void) {
Game_AddComponent(&AxisLinesRenderer_Component);

Game_LoadPlugins();
for (comp = comps_head; comp; comp = comp->Next) {
for (comp = comps_head; comp; comp = comp->next) {
if (comp->Init) comp->Init();
}

@@ -684,7 +684,7 @@ void Game_Free(void* obj) {
Event_UnregisterVoid(&WindowEvents.Resized, NULL, Game_OnResize);
Event_UnregisterVoid(&WindowEvents.Closing, NULL, Game_Free);

for (comp = comps_head; comp; comp = comp->Next) {
for (comp = comps_head; comp; comp = comp->next) {
if (comp->Free) comp->Free();
}

@@ -19,7 +19,7 @@ struct IGameComponent {
/* Called to update the component's state when the user has finished loading a new map. */
void (*OnNewMapLoaded)(void);
/* Next component in linked list of components. */
struct IGameComponent* Next;
struct IGameComponent* next;
};
/* Adds a component to linked list of components. (always at end) */
CC_NOINLINE void Game_AddComponent(struct IGameComponent* comp);
@@ -223,7 +223,7 @@ void HeldBlockRenderer_Render(double delta) {
HeldBlockRenderer_ResetHeldState();
HeldBlockRenderer_DoAnimation(delta, lastSwingY);
HeldBlockRenderer_SetBaseOffset();
if (!Camera.Active->IsThirdPerson) HeldBlockRenderer_RenderModel();
if (!Camera.Active->isThirdPerson) HeldBlockRenderer_RenderModel();

Gfx.View = view;
Gfx_LoadMatrix(MATRIX_PROJECTION, &Gfx.Projection);
@@ -392,7 +392,7 @@ static void Model_Make(struct Model* model) {
struct Model* Model_Get(const String* name) {
struct Model* model;

for (model = models_head; model; model = model->Next) {
for (model = models_head; model; model = model->next) {
if (!String_CaselessEqualsConst(name, model->Name)) continue;

if (!model->initalised) Model_Make(model);
@@ -404,7 +404,7 @@ struct Model* Model_Get(const String* name) {
struct ModelTex* Model_GetTexture(const String* name) {
struct ModelTex* tex;

for (tex = textures_head; tex; tex = tex->Next) {
for (tex = textures_head; tex; tex = tex->next) {
if (String_CaselessEqualsConst(name, tex->Name)) return tex;
}
return NULL;
@@ -421,7 +421,7 @@ void Model_RegisterTexture(struct ModelTex* tex) {
static void Models_TextureChanged(void* obj, struct Stream* stream, const String* name) {
struct ModelTex* tex;

for (tex = textures_head; tex; tex = tex->Next) {
for (tex = textures_head; tex; tex = tex->next) {
if (!String_CaselessEqualsConst(name, tex->Name)) continue;

Game_UpdateTexture(&tex->TexID, stream, name, &tex->SkinType);
@@ -1703,7 +1703,7 @@ static void Models_Init(void) {
static void Models_Free(void) {
struct ModelTex* tex;

for (tex = textures_head; tex; tex = tex->Next) {
for (tex = textures_head; tex; tex = tex->next) {
Gfx_DeleteTexture(&tex->TexID);
}
Models_ContextLost(NULL);
@@ -34,7 +34,7 @@ static CC_INLINE void ModelPart_Init(struct ModelPart* part, int offset, int cou

struct ModelTex;
/* Contains information about a texture used for models. */
struct ModelTex { const char* Name; uint8_t SkinType; GfxResourceID TexID; struct ModelTex* Next; };
struct ModelTex { const char* Name; uint8_t SkinType; GfxResourceID TexID; struct ModelTex* next; };

struct Model;
/* Contains a set of quads and/or boxes that describe a 3D object as well as
@@ -80,7 +80,7 @@ struct Model {
void (*DrawArm)(struct Entity* entity);

float MaxScale, ShadowScale, NameScale;
struct Model* Next;
struct Model* next;
};
#if 0
public CustomModel[] CustomModels = new CustomModel[256];

0 comments on commit 0ed3197

Please sign in to comment.
You can’t perform that action at this time.