0

add log marker for video-log

This commit is contained in:
2018-12-18 13:11:02 +03:00
parent f17400b4fd
commit de15110118
2 changed files with 23 additions and 15 deletions

View File

@@ -1,5 +1,8 @@
package lwjake2;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
import java.nio.ByteOrder;
public class Defines {
@@ -1180,4 +1183,7 @@ public class Defines {
public final static int SIZE_OF_INT = 4;
public final static int SIZE_OF_FLOAT = 4;
// Log markers
public final static Marker MARKER_VIDEO = MarkerFactory.getMarker("VID");
}

View File

@@ -43,6 +43,8 @@ import org.lwjgl.opengl.ARBMultitexture;
import org.lwjgl.opengl.EXTSharedTexturePalette;
import org.lwjgl.opengl.GL11;
import static lwjake2.Defines.MARKER_VIDEO;
/**
* Image
*
@@ -248,7 +250,7 @@ public abstract class Image extends Main {
}
if (i == NUM_GL_MODES) {
log.warn("bad filter name: [{}]", string);
log.warn(MARKER_VIDEO, "bad filter name: [{}]", string);
return;
}
@@ -282,7 +284,7 @@ public abstract class Image extends Main {
}
if (i == NUM_GL_ALPHA_MODES) {
log.warn("bad alpha texture mode name: [{}]", string);
log.warn(MARKER_VIDEO, "bad alpha texture mode name: [{}]", string);
return;
}
@@ -302,7 +304,7 @@ public abstract class Image extends Main {
}
if (i == NUM_GL_SOLID_MODES) {
log.warn("bad solid texture mode name: [{}]", string);
log.warn(MARKER_VIDEO, "bad solid texture mode name: [{}]", string);
return;
}
@@ -320,7 +322,7 @@ public abstract class Image extends Main {
int texels;
final String[] palstrings = { "RGB", "PAL" };
log.info("------------------");
log.info(MARKER_VIDEO, "------------------");
texels = 0;
for (int i = 0; i < numgltextures; i++) {
@@ -349,14 +351,14 @@ public abstract class Image extends Main {
}
sb.append(" {} {} {}: {}");
log.info(sb.toString(),
log.info(MARKER_VIDEO, sb.toString(),
image.upload_width,
image.upload_height,
(image.paletted ? 1 : 0),
image.paletted ? 1 : 0,
image.name
);
}
log.info("Total texel count (not counting mipmaps): {}", texels);
log.info(MARKER_VIDEO, "Total texel count (not counting mipmaps): {}", texels);
}
/*
@@ -455,7 +457,7 @@ public abstract class Image extends Main {
byte[] raw = fileSystem.loadFile(filename);
if (raw == null) {
log.debug(/*Defines.PRINT_DEVELOPER*/"Bad pcx file {}", filename);
log.debug(MARKER_VIDEO, "Bad pcx file {}", filename);
return null;
}
@@ -471,7 +473,7 @@ public abstract class Image extends Main {
|| pcx.xmax >= 640
|| pcx.ymax >= 480) {
log.warn("Bad pcx file {}", filename);
log.warn(MARKER_VIDEO, "Bad pcx file {}", filename);
return null;
}
@@ -553,7 +555,7 @@ public abstract class Image extends Main {
if (raw == null)
{
log.debug(/*Defines.PRINT_DEVELOPER*/"Bad tga file {}", name);
log.debug(MARKER_VIDEO, "Bad tga file {}", name);
return null;
}
@@ -1116,7 +1118,7 @@ public abstract class Image extends Main {
else if (samples == gl_alpha_format)
comp = gl_tex_alpha_format;
else {
log.info("Unknown number of texture components {}", samples);
log.info(MARKER_VIDEO, "Unknown number of texture components {}", samples);
comp = samples;
}
@@ -1435,7 +1437,7 @@ public abstract class Image extends Main {
byte[] raw = fileSystem.loadFile(name);
if (raw == null) {
log.info("GL_FindImage: can't load {}", name);
log.info(MARKER_VIDEO, "GL_FindImage: can't load {}", name);
return r_notexture;
}