Skip to content

Commit

Permalink
Codeclimate fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
UncertainProd committed Oct 29, 2023
1 parent a59ffb2 commit 02f8c4f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
20 changes: 10 additions & 10 deletions flixel/graphics/frames/bmfontutils/BMFont.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package flixel.graphics.frames.bmfontutils;

typedef BMFont_Info =
typedef BMFontInfoBlock =
{
public var fontSize:Null<Int>;
public var smooth:Bool;
Expand All @@ -21,7 +21,7 @@ typedef BMFont_Info =
public var fontName:String;
};

typedef BMFont_Common =
typedef BMFontCommonBlock =
{
public var lineHeight:Null<Int>;
public var base:Null<Int>;
Expand All @@ -35,13 +35,13 @@ typedef BMFont_Common =
public var blueChnl:Null<Int>;
};

typedef BMFont_PageInfo =
typedef BMFontPageInfoBlock =
{
public var id:Null<Int>;
public var file:String;
};

typedef BMFont_Char =
typedef BMFontCharBlock =
{
public var id:Null<Int>;
public var x:Null<Int>;
Expand All @@ -55,7 +55,7 @@ typedef BMFont_Char =
public var chnl:Null<Int>;
};

typedef BMFont_KerningPair =
typedef BMFontKerningPair =
{
public var first:Null<Int>;
public var second:Null<Int>;
Expand All @@ -64,11 +64,11 @@ typedef BMFont_KerningPair =

class BMFont
{
public var info:BMFont_Info;
public var common:BMFont_Common;
public var pages:Array<BMFont_PageInfo>;
public var chars:Array<BMFont_Char>;
public var kerningPairs:Array<BMFont_KerningPair>;
public var info:BMFontInfoBlock;
public var common:BMFontCommonBlock;
public var pages:Array<BMFontPageInfoBlock>;
public var chars:Array<BMFontCharBlock>;
public var kerningPairs:Array<BMFontKerningPair>;

function new()
{
Expand Down
40 changes: 20 additions & 20 deletions flixel/graphics/frames/bmfontutils/FlxBMFontParser.hx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package flixel.graphics.frames.bmfontutils;

import flixel.FlxG;
import flixel.graphics.frames.bmfontutils.BMFont.BMFont_Char;
import flixel.graphics.frames.bmfontutils.BMFont.BMFont_Common;
import flixel.graphics.frames.bmfontutils.BMFont.BMFont_Info;
import flixel.graphics.frames.bmfontutils.BMFont.BMFont_KerningPair;
import flixel.graphics.frames.bmfontutils.BMFont.BMFont_PageInfo;
import flixel.graphics.frames.bmfontutils.BMFont.BMFontCharBlock;
import flixel.graphics.frames.bmfontutils.BMFont.BMFontCommonBlock;
import flixel.graphics.frames.bmfontutils.BMFont.BMFontInfoBlock;
import flixel.graphics.frames.bmfontutils.BMFont.BMFontKerningPair;
import flixel.graphics.frames.bmfontutils.BMFont.BMFontPageInfoBlock;
import haxe.io.Bytes;
import haxe.io.BytesBuffer;
import haxe.io.BytesInput;
Expand Down Expand Up @@ -93,7 +93,7 @@ class FlxBMFontBinaryParser
var blockSize:Int = bytesInput.readInt32();
var fontSize = bytesInput.readInt16();
var bitField = bytesInput.readByte();
var fontInfo:BMFont_Info = {
var fontInfo:BMFontInfoBlock = {
fontSize: fontSize,
smooth: (bitField & 0x80) != 0,
unicode: (bitField & (0x80 >> 1)) != 0,
Expand Down Expand Up @@ -127,7 +127,7 @@ class FlxBMFontBinaryParser
var pages = bytesInput.readInt16();
var bitField = bytesInput.readByte();
var isPacked = (bitField & 0x2) != 0;
var commonBlock:BMFont_Common = {
var commonBlock:BMFontCommonBlock = {
lineHeight: lineHeight,
base: base,
scaleW: scaleW,
Expand All @@ -147,7 +147,7 @@ class FlxBMFontBinaryParser
function parsePagesBlock()
{
var blockSize = bytesInput.readInt32();
var pagesBlock:Array<BMFont_PageInfo> = [];
var pagesBlock:Array<BMFontPageInfoBlock> = [];

var bytesRead = 0;
var i = 0;
Expand Down Expand Up @@ -176,7 +176,7 @@ class FlxBMFontBinaryParser
var chars = [];
while (bytesRead < blockSize)
{
var charInfo:BMFont_Char = {
var charInfo:BMFontCharBlock = {
id: bytesInput.readInt32(),
x: bytesInput.readInt16(),
y: bytesInput.readInt16(),
Expand All @@ -201,7 +201,7 @@ class FlxBMFontBinaryParser
var kerningPairs = [];
while (bytesRead < blockSize)
{
var kerningPair:BMFont_KerningPair = {
var kerningPair:BMFontKerningPair = {
first: bytesInput.readInt32(),
second: bytesInput.readInt32(),
amount: bytesInput.readInt16(),
Expand Down Expand Up @@ -252,7 +252,7 @@ class FlxBMFontTextParser

function parseInfoBlock(attrs:String)
{
var info:BMFont_Info = {
var info:BMFontInfoBlock = {
fontName: null,
fontSize: null,
bold: false,
Expand Down Expand Up @@ -368,7 +368,7 @@ class FlxBMFontTextParser

function parseCommonBlock(attrs:String)
{
var common:BMFont_Common = {
var common:BMFontCommonBlock = {
lineHeight: null,
base: null,
scaleW: null,
Expand Down Expand Up @@ -415,7 +415,7 @@ class FlxBMFontTextParser

function parsePageBlock(attrs:String)
{
var page:BMFont_PageInfo = {
var page:BMFontPageInfoBlock = {
id: null,
file: null
};
Expand Down Expand Up @@ -477,7 +477,7 @@ class FlxBMFontTextParser

function parseCharBlock(attrs:String)
{
var char:BMFont_Char = {
var char:BMFontCharBlock = {
id: null,
x: null,
y: null,
Expand Down Expand Up @@ -587,7 +587,7 @@ class FlxBMFontTextParser

function parseKerningPair(attrs:String)
{
var kerningPair:BMFont_KerningPair = {
var kerningPair:BMFontKerningPair = {
first: null,
second: null,
amount: null
Expand Down Expand Up @@ -648,7 +648,7 @@ class FlxBMFontXMLParser
var spacingArr = spacing.split(',').map(Std.parseInt);

var outline = infoNode.has.outline ? Std.parseInt(infoNode.att.outline) : 0;
var info:BMFont_Info = {
var info:BMFontInfoBlock = {
fontSize: Std.parseInt(infoNode.att.size),
smooth: infoNode.att.smooth != '0',
unicode: infoNode.att.unicode != '0',
Expand Down Expand Up @@ -678,7 +678,7 @@ class FlxBMFontXMLParser
var redChnl = (commonNode.has.redChnl) ? Std.parseInt(commonNode.att.redChnl) : 0;
var greenChnl = (commonNode.has.greenChnl) ? Std.parseInt(commonNode.att.greenChnl) : 0;
var blueChnl = (commonNode.has.blueChnl) ? Std.parseInt(commonNode.att.blueChnl) : 0;
var common:BMFont_Common = {
var common:BMFontCommonBlock = {
lineHeight: Std.parseInt(commonNode.att.lineHeight),
base: Std.parseInt(commonNode.att.base),
scaleW: Std.parseInt(commonNode.att.scaleW),
Expand All @@ -696,7 +696,7 @@ class FlxBMFontXMLParser

function parsePagesBlock()
{
var pages:Array<BMFont_PageInfo> = [];
var pages:Array<BMFontPageInfoBlock> = [];
var pagesNode = fast.node.pages;
for (page in pagesNode.nodes.page)
{
Expand All @@ -711,7 +711,7 @@ class FlxBMFontXMLParser
function parseCharsBlock()
{
var charsNode = fast.node.chars;
var chars:Array<BMFont_Char> = [];
var chars:Array<BMFontCharBlock> = [];
for (char in charsNode.nodes.char)
{
var id = (char.has.letter) ? Util.getCorrectLetter(char.att.letter).charCodeAt(0) : Std.parseInt(char.att.id);
Expand All @@ -738,7 +738,7 @@ class FlxBMFontXMLParser
function parseKerningPairs()
{
var kerningPairsNode = fast.node.kernings;
var kerningPairs:Array<BMFont_KerningPair> = [];
var kerningPairs:Array<BMFontKerningPair> = [];
for (kerningPair in kerningPairsNode.nodes.kerning)
{
kerningPairs.push({
Expand Down

0 comments on commit 02f8c4f

Please sign in to comment.