From 71b0a2c58239bebabcdd5d5043d497071054458c Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Tue, 18 Dec 2018 14:45:20 +0300 Subject: [PATCH] Com.DPrintf(String, Vargs) -> slf4j --- src/main/java/lwjake2/qcommon/CM.java | 51 +++++++++++---------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/src/main/java/lwjake2/qcommon/CM.java b/src/main/java/lwjake2/qcommon/CM.java index 481b268..856892f 100644 --- a/src/main/java/lwjake2/qcommon/CM.java +++ b/src/main/java/lwjake2/qcommon/CM.java @@ -18,6 +18,7 @@ package lwjake2.qcommon; +import lombok.extern.slf4j.Slf4j; import lwjake2.Defines; import lwjake2.Globals; import lwjake2.game.cmodel_t; @@ -36,6 +37,7 @@ import java.nio.ByteOrder; import java.nio.IntBuffer; import java.util.Arrays; +@Slf4j public class CM { private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance(); @@ -331,15 +333,11 @@ public class CM { } out.headnode = in.headnode; if (debugloadmap) { - Com - .DPrintf( - "|%6i|%8.2f|%8.2f|%8.2f| %8.2f|%8.2f|%8.2f| %8.2f|%8.2f|%8.2f|\n", - new Vargs().add(out.headnode) - .add(out.origin[0]).add(out.origin[1]) - .add(out.origin[2]).add(out.mins[0]) - .add(out.mins[1]).add(out.mins[2]).add( - out.maxs[0]).add(out.maxs[1]) - .add(out.maxs[2])); + log.debug("|{}|{}|{}| {}|{}|{}| {}|{}|{}|", + out.headnode, + out.origin[0], out.origin[1], out.origin[2], + out.mins[0], out.mins[1], out.mins[2], + out.maxs[0], out.maxs[1], out.maxs[2]); } } } @@ -378,9 +376,7 @@ public class CM { out.c.value = in.value; if (debugloadmap) { - Com.DPrintf("|%20s|%20s|%6i|%6i|\n", new Vargs() - .add(out.c.name).add(out.rname).add(out.c.value).add( - out.c.flags)); + log.debug("|{}|{}|{}|{}|", out.c.name, out.rname, out.c.value, out.c.flags); } } @@ -422,8 +418,7 @@ public class CM { out.children[j] = child; } if (debugloadmap) { - Com.DPrintf("|%6i| %6i| %6i|\n", new Vargs().add(in.planenum) - .add(out.children[0]).add(out.children[1])); + log.debug("|{}| {}| {}|", in.planenum, out.children[0], out.children[1]); } } } @@ -457,10 +452,7 @@ public class CM { out.contents = in.contents; if (debugloadmap) { - Com - .DPrintf("| %6i| %6i| %8X|\n", new Vargs().add( - out.firstbrushside).add(out.numsides).add( - out.contents)); + log.debug("| {}| {}| {}|", out.firstbrushside, out.numsides, Integer.toHexString(out.contents)); } } } @@ -507,9 +499,9 @@ public class CM { numclusters = out.cluster + 1; if (debugloadmap) { - Com.DPrintf("|%8x|%6i|%6i|%6i|\n", new Vargs() - .add(out.contents).add(out.cluster).add(out.area).add( - out.firstleafbrush).add(out.numleafbrushes)); + log.debug("|{}|{}|{}|{}|{}|", + Integer.toHexString(out.contents), out.cluster, out.area, + out.firstleafbrush, out.numleafbrushes); } } @@ -581,10 +573,9 @@ public class CM { out.signbits = (byte) bits; if (debugloadmap) { - Com.DPrintf("|%6.2f|%6.2f|%6.2f| %10.2f|%3i| %1i|\n", - new Vargs().add(out.normal[0]).add(out.normal[1]).add( - out.normal[2]).add(out.dist).add(out.type).add( - out.signbits)); + log.debug("|{}|{}|{}| {}|{}| {}|", + out.normal[0], out.normal[1], out.normal[2], + out.dist, out.type, out.signbits); } } } @@ -623,7 +614,7 @@ public class CM { for (i = 0; i < count; i++) { out[i] = bb.getShort(); if (debugloadmap) { - Com.DPrintf("|%6i|%6i|\n", new Vargs().add(i).add(out[i])); + log.debug("|{}|{}|", i, out[i]); } } } @@ -676,7 +667,7 @@ public class CM { out.surface = map_surfaces[j]; if (debugloadmap) { - Com.DPrintf("| %6i| %6i|\n", new Vargs().add(num).add(j)); + log.debug("| {}| {}|", num, j); } } } @@ -715,8 +706,7 @@ public class CM { out.floodvalid = 0; out.floodnum = 0; if (debugloadmap) { - Com.DPrintf("| %6i| %6i|\n", new Vargs() - .add(out.numareaportals).add(out.firstareaportal)); + log.debug("| {}| {}|", out.numareaportals, out.firstareaportal); } } } @@ -752,8 +742,7 @@ public class CM { out.otherarea = in.otherarea; if (debugloadmap) { - Com.DPrintf("|%6i|%6i|\n", new Vargs().add(out.portalnum).add( - out.otherarea)); + log.debug("|{}|{}|", out.portalnum, out.otherarea); } } }