Skip to content

Commit

Permalink
Merge pull request #61 from ChillerTater/pr_fixstyle
Browse files Browse the repository at this point in the history
Fix some styling
  • Loading branch information
sjrc6 authored Jan 26, 2025
2 parents ff1ce98 + f58c2fa commit e397fe1
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 37 deletions.
16 changes: 8 additions & 8 deletions src/engine/gfx/image_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,24 @@ static int PngliteIncompatibility(png_structp pPngStruct, png_infop pPngInfo)

return Result;
}
static void PngErrorHandler(png_structp png, png_const_charp msg);
static void PngWarningHandler(png_structp png, png_const_charp msg);
static void PngErrorHandler(png_structp png, png_const_charp Msg);
static void PngWarningHandler(png_structp png, png_const_charp Msg);
const char *pngCategory = "png"; // Category for logging
// Custom error handler (called on fatal errors)
static void PngErrorHandler(png_structp png, png_const_charp msg)
static void PngErrorHandler(png_structp png, png_const_charp Msg)
{
const char *category = static_cast<const char *>(png_get_error_ptr(png));
log_error(category, "libpng error: %s", msg);
const char *Category = static_cast<const char *>(png_get_error_ptr(png));
log_error(Category, "libpng error: %s", Msg);

// Jump back to the setjmp point - essential for libpng error handling
longjmp(png_jmpbuf(png), 1); // Changed from png_longjmp
}

// Custom warning handler (called on non-fatal warnings)
static void PngWarningHandler(png_structp png, png_const_charp msg)
static void PngWarningHandler(png_structp png, png_const_charp Msg)
{
const char *category = static_cast<const char *>(png_get_error_ptr(png));
log_error(category, "libpng warning: %s", msg);
const char *Category = static_cast<const char *>(png_get_error_ptr(png));
log_error(Category, "libpng warning: %s", Msg);
}
bool CImageLoader::LoadPng(CByteBufferReader &Reader, const char *pContextName, CImageInfo &Image, int &PngliteIncompatible)
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/spectator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void CSpectator::OnRender()
}

// TClient
if(g_Config.m_ClWarList && g_Config.m_ClWarListSpectate && GameClient()->m_WarList.GetAnyWar(i))
if(g_Config.m_ClWarList && g_Config.m_ClWarListSpectate && GameClient()->m_WarList.GetAnyWar(i))
{
TextRender()->TextColor(GameClient()->m_WarList.GetPriorityColor(i));
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/tclient/bindchat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ bool CBindchat::ChatDoBinds(const char *pText)
size_t SpaceIndex = pSpace ? pSpace - pText : strlen(pText);
for(const CBind &Bind : m_vBinds)
{
if(str_startswith_nocase(pText, Bind.m_aName) &&
if(str_startswith_nocase(pText, Bind.m_aName) &&
str_comp_nocase_num(pText, Bind.m_aName, SpaceIndex) == 0)
{
ExecuteBind(&Bind - m_vBinds.data(), pSpace ? pSpace + 1 : nullptr);
Expand Down
5 changes: 2 additions & 3 deletions src/game/client/components/tclient/bindchat.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

#ifndef GAME_CLIENT_COMPONENTS_BINDCHAT_H
#define GAME_CLIENT_COMPONENTS_BINDCHAT_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_BINDCHAT_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_BINDCHAT_H
#include <game/client/component.h>

#define BINDCHAT_FILE "tclient_chatbinds.cfg"
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/bindwheel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_BINDWHEEL_H
#define GAME_CLIENT_COMPONENTS_BINDWHEEL_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_BINDWHEEL_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_BINDWHEEL_H
#include <game/client/component.h>
class IConfigManager;

Expand Down
3 changes: 1 addition & 2 deletions src/game/client/components/tclient/menus_tclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView)
continue;

TabBar.VSplitLeft(TabWidth, &Button, &TabBar);
const int Corners = Tab == 0 ? IGraphics::CORNER_L : Tab == NUMBER_OF_TCLIENT_TABS - 1 ? IGraphics::CORNER_R :
IGraphics::CORNER_NONE;
const int Corners = Tab == 0 ? IGraphics::CORNER_L : Tab == NUMBER_OF_TCLIENT_TABS - 1 ? IGraphics::CORNER_R : IGraphics::CORNER_NONE;
if(DoButton_MenuTab(&s_aPageTabs[Tab], apTabNames[Tab], s_CurCustomTab == Tab, &Button, Corners, nullptr, nullptr, nullptr, nullptr, 4.0f))
s_CurCustomTab = Tab;
}
Expand Down
1 change: 0 additions & 1 deletion src/game/client/components/tclient/outlines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ void COutlines::OnRender()
RenderTools()->RenderGameTileOutlines(pTiles, pTMap->m_Width, pTMap->m_Height, 32.0f, TILE_SOLID, (float)g_Config.m_ClOutlineAlphaSolid / 100.0f);
if(g_Config.m_ClOutlineKill)
RenderTools()->RenderGameTileOutlines(pTiles, pTMap->m_Width, pTMap->m_Height, 32.0f, TILE_DEATH, (float)g_Config.m_ClOutlineAlpha / 100.0f);

}
}
if(g_Config.m_ClOutline && IsTeleLayer)
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/outlines.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_OUTLINES_H
#define GAME_CLIENT_COMPONENTS_OUTLINES_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_OUTLINES_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_OUTLINES_H
#include <game/client/component.h>

class COutlines : public CComponent
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/player_indicator.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_PLAYER_INDICATOR_H
#define GAME_CLIENT_COMPONENTS_PLAYER_INDICATOR_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_PLAYER_INDICATOR_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_PLAYER_INDICATOR_H
#include <game/client/component.h>

class CPlayerIndicator : public CComponent
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/rainbow.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_RAINBOW_H
#define GAME_CLIENT_COMPONENTS_RAINBOW_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_RAINBOW_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_RAINBOW_H
#include <game/client/component.h>

class CRainbow : public CComponent
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/skinprofiles.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_SKINPROFILES_H
#define GAME_CLIENT_COMPONENTS_SKINPROFILES_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_SKINPROFILES_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_SKINPROFILES_H

#include <base/system.h>
#include <engine/console.h>
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/statusbar.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_STATUSBAR_H
#define GAME_CLIENT_COMPONENTS_STATUSBAR_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_STATUSBAR_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_STATUSBAR_H
#include <game/client/component.h>

enum
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/tater.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_TATER_H
#define GAME_CLIENT_COMPONENTS_TATER_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_TATER_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_TATER_H
#include <game/client/component.h>

class CTater : public CComponent
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/trails.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_TRAILS_H
#define GAME_CLIENT_COMPONENTS_TRAILS_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_TRAILS_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_TRAILS_H
#include <game/client/component.h>

struct STrailPart
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/verify.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_VERIFY_H
#define GAME_CLIENT_COMPONENTS_VERIFY_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_VERIFY_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_VERIFY_H
#include <game/client/component.h>

class CVerify : public CComponent
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/tclient/warlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ void CWarList::UpdateWarPlayers()
{
if(!GameClient()->m_aClients[i].m_Active)
continue;

m_WarPlayers[i].IsWarName = false;
m_WarPlayers[i].IsWarClan = false;
memset(m_WarPlayers[i].m_aReason, 0, sizeof(m_WarPlayers[i].m_aReason));
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/warlist.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GAME_CLIENT_COMPONENTS_WARLIST_H
#define GAME_CLIENT_COMPONENTS_WARLIST_H
#ifndef GAME_CLIENT_COMPONENTS_TCLIENT_WARLIST_H
#define GAME_CLIENT_COMPONENTS_TCLIENT_WARLIST_H

#include <engine/console.h>
#include <engine/shared/protocol.h>
Expand Down

0 comments on commit e397fe1

Please sign in to comment.