image_t -> Q2Image
This commit is contained in:
77
src/main/java/dmx/lwjake2/render/Q2Image.java
Normal file
77
src/main/java/dmx/lwjake2/render/Q2Image.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package dmx.lwjake2.render;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lwjake2.render.msurface_t;
|
||||
|
||||
import static dmx.lwjake2.render.ImageType.SKIN;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
public class Q2Image {
|
||||
|
||||
public static final int FREE_SEQUENCE = 0;
|
||||
|
||||
/**
|
||||
* used to get the pos in array
|
||||
*/
|
||||
private final int id;
|
||||
|
||||
/**
|
||||
* game path, including extension
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private ImageType type;
|
||||
|
||||
// source image
|
||||
private int width;
|
||||
private int height;
|
||||
|
||||
// after power of two and picmip
|
||||
private int uploadWidth;
|
||||
private int uploadHeight;
|
||||
|
||||
private int registrationSequence;
|
||||
|
||||
/**
|
||||
* for sort-by-texture world drawing
|
||||
*/
|
||||
private msurface_t textureChain;
|
||||
|
||||
/**
|
||||
* gl texture binding
|
||||
*/
|
||||
private int texNum;
|
||||
|
||||
// 0,0 - 1,1 unless part of the scrap
|
||||
private float sl;
|
||||
private float tl;
|
||||
private float sh;
|
||||
private float th;
|
||||
private boolean scrap;
|
||||
|
||||
private boolean alpha;
|
||||
private boolean paletted;
|
||||
|
||||
public void clear() {
|
||||
setName("");
|
||||
setType(SKIN);
|
||||
setWidth(0);
|
||||
setHeight(0);
|
||||
setUploadWidth(0);
|
||||
setUploadHeight(0);
|
||||
setRegistrationSequence(FREE_SEQUENCE);
|
||||
setTextureChain(null);
|
||||
setTexNum(0);
|
||||
setSl(0);
|
||||
setSh(0);
|
||||
setTl(0);
|
||||
setTh(0);
|
||||
setScrap(false);
|
||||
setAlpha(false);
|
||||
setPaletted(false);
|
||||
}
|
||||
}
|
||||
@@ -701,13 +701,13 @@ public class CL_ents {
|
||||
// ============
|
||||
// PGM
|
||||
if ((renderfx & Defines.RF_USE_DISGUISE) != 0) {
|
||||
if (ent.skin.name.startsWith("players/male")) {
|
||||
if (ent.skin.getName().startsWith("players/male")) {
|
||||
ent.skin = Globals.re.RegisterSkin("players/male/disguise.pcx");
|
||||
ent.model = Globals.re.RegisterModel("players/male/tris.md2");
|
||||
} else if (ent.skin.name.startsWith("players/female")) {
|
||||
} else if (ent.skin.getName().startsWith("players/female")) {
|
||||
ent.skin = Globals.re.RegisterSkin("players/female/disguise.pcx");
|
||||
ent.model = Globals.re.RegisterModel("players/female/tris.md2");
|
||||
} else if (ent.skin.name.startsWith("players/cyborg")) {
|
||||
} else if (ent.skin.getName().startsWith("players/cyborg")) {
|
||||
ent.skin = Globals.re.RegisterSkin("players/cyborg/disguise.pcx");
|
||||
ent.model = Globals.re.RegisterModel("players/cyborg/tris.md2");
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ package lwjake2.client;
|
||||
import lwjake2.Defines;
|
||||
import lwjake2.game.cmodel_t;
|
||||
import lwjake2.game.usercmd_t;
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.render.model_t;
|
||||
import lwjake2.sound.sfx_t;
|
||||
|
||||
@@ -125,7 +125,7 @@ public class client_state_t {
|
||||
cmodel_t model_clip[] = new cmodel_t[Defines.MAX_MODELS];
|
||||
|
||||
public sfx_t sound_precache[] = new sfx_t[Defines.MAX_SOUNDS];
|
||||
image_t image_precache[] = new image_t[Defines.MAX_IMAGES];
|
||||
Q2Image image_precache[] = new Q2Image[Defines.MAX_IMAGES];
|
||||
|
||||
clientinfo_t clientinfo[] = new clientinfo_t[Defines.MAX_CLIENTS];
|
||||
clientinfo_t baseclientinfo = new clientinfo_t();
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
package lwjake2.client;
|
||||
|
||||
import lwjake2.Defines;
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.render.model_t;
|
||||
|
||||
public class clientinfo_t {
|
||||
String name ="";
|
||||
String cinfo ="";
|
||||
image_t skin; // ptr
|
||||
image_t icon; // ptr
|
||||
Q2Image skin; // ptr
|
||||
Q2Image icon; // ptr
|
||||
String iconname ="";
|
||||
model_t model; // ptr
|
||||
model_t weaponmodel[] = new model_t[Defines.MAX_CLIENTWEAPONMODELS]; // arary of references
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package lwjake2.client;
|
||||
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.render.model_t;
|
||||
import lwjake2.util.Math3D;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class entity_t implements Cloneable{
|
||||
public float alpha; // ignore if RF_TRANSLUCENT isn't set
|
||||
|
||||
// reference
|
||||
public image_t skin; // NULL for inline skin
|
||||
public Q2Image skin; // NULL for inline skin
|
||||
public int flags;
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package lwjake2.client;
|
||||
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.render.model_t;
|
||||
import lwjake2.sys.KBD;
|
||||
|
||||
@@ -60,8 +60,8 @@ public interface refexport_t {
|
||||
// slash will not use the "pics/" prefix or the ".pcx" postfix)
|
||||
void BeginRegistration(String map);
|
||||
model_t RegisterModel(String name);
|
||||
image_t RegisterSkin(String name);
|
||||
image_t RegisterPic(String name);
|
||||
Q2Image RegisterSkin(String name);
|
||||
Q2Image RegisterPic(String name);
|
||||
void SetSky(String name, float rotate, /* vec3_t */
|
||||
float[] axis);
|
||||
void EndRegistration();
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package lwjake2.render;
|
||||
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.client.refdef_t;
|
||||
import lwjake2.client.refexport_t;
|
||||
import lwjake2.sys.KBD;
|
||||
@@ -61,14 +62,14 @@ public class DummyRenderer implements refexport_t {
|
||||
/* (non-Javadoc)
|
||||
* @see jake2.client.refexport_t#RegisterSkin(java.lang.String)
|
||||
*/
|
||||
public image_t RegisterSkin(String name) {
|
||||
public Q2Image RegisterSkin(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see jake2.client.refexport_t#RegisterPic(java.lang.String)
|
||||
*/
|
||||
public image_t RegisterPic(String name) {
|
||||
public Q2Image RegisterPic(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package lwjake2.render;
|
||||
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.Defines;
|
||||
import lwjake2.client.VID;
|
||||
import lwjake2.client.refdef_t;
|
||||
@@ -91,14 +92,14 @@ final class LWJGLRenderer extends Misc implements refexport_t, Ref {
|
||||
/**
|
||||
* @see jake2.client.refexport_t#RegisterSkin(java.lang.String)
|
||||
*/
|
||||
public final image_t RegisterSkin(String name) {
|
||||
public final Q2Image RegisterSkin(String name) {
|
||||
return R_RegisterSkin(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see jake2.client.refexport_t#RegisterPic(java.lang.String)
|
||||
*/
|
||||
public final image_t RegisterPic(String name) {
|
||||
public final Q2Image RegisterPic(String name) {
|
||||
return Draw_FindPic(name);
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* See the GNU General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
package lwjake2.render;
|
||||
|
||||
import dmx.lwjake2.render.ImageType;
|
||||
import lwjake2.Defines;
|
||||
|
||||
import static dmx.lwjake2.render.ImageType.SKIN;
|
||||
|
||||
public class image_t {
|
||||
|
||||
public static final int MAX_NAME_SIZE = Defines.MAX_QPATH;
|
||||
|
||||
// used to get the pos in array
|
||||
// added by cwei
|
||||
private int id;
|
||||
|
||||
// quake 2 variables
|
||||
public String name=""; // game path, including extension
|
||||
|
||||
public ImageType type;
|
||||
public int width, height; // source image
|
||||
public int upload_width, upload_height; // after power of two and picmip
|
||||
public int registration_sequence; // 0 = free
|
||||
public msurface_t texturechain; // for sort-by-texture world drawing
|
||||
public int texnum; // gl texture binding
|
||||
public float sl, tl, sh, th; // 0,0 - 1,1 unless part of the scrap
|
||||
public boolean scrap;
|
||||
public boolean has_alpha;
|
||||
|
||||
public boolean paletted;
|
||||
|
||||
public image_t(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
// don't clear the id
|
||||
// wichtig !!!
|
||||
name = "";
|
||||
type = SKIN;
|
||||
width = height = 0;
|
||||
upload_width = upload_height = 0;
|
||||
registration_sequence = 0; // 0 = free
|
||||
texturechain = null;
|
||||
texnum = 0; // gl texture binding
|
||||
sl = tl = sh = th = 0;
|
||||
scrap = false;
|
||||
has_alpha = false;
|
||||
paletted = false;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return name + ":" + texnum;
|
||||
}
|
||||
}
|
||||
@@ -18,12 +18,11 @@
|
||||
|
||||
package lwjake2.render.lwjgl;
|
||||
|
||||
import dmx.lwjake2.render.ImageType;
|
||||
import lwjake2.Defines;
|
||||
import lwjake2.ErrorCode;
|
||||
import lwjake2.client.VID;
|
||||
import lwjake2.qcommon.Com;
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.util.Lib;
|
||||
|
||||
import java.awt.Dimension;
|
||||
@@ -50,7 +49,7 @@ public abstract class Draw extends Image {
|
||||
void Draw_InitLocal() {
|
||||
// load console characters (don't bilerp characters)
|
||||
draw_chars = GL_FindImage("pics/conchars.pcx", PICTURE);
|
||||
GL_Bind(draw_chars.texnum);
|
||||
GL_Bind(draw_chars.getTexNum());
|
||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
|
||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
|
||||
}
|
||||
@@ -79,7 +78,7 @@ public abstract class Draw extends Image {
|
||||
float fcol = col*0.0625f;
|
||||
float size = 0.0625f;
|
||||
|
||||
GL_Bind(draw_chars.texnum);
|
||||
GL_Bind(draw_chars.getTexNum());
|
||||
|
||||
GL11.glBegin (GL11.GL_QUADS);
|
||||
GL11.glTexCoord2f (fcol, frow);
|
||||
@@ -99,8 +98,8 @@ public abstract class Draw extends Image {
|
||||
Draw_FindPic
|
||||
=============
|
||||
*/
|
||||
protected image_t Draw_FindPic(String name) {
|
||||
image_t image = null;
|
||||
protected Q2Image Draw_FindPic(String name) {
|
||||
Q2Image image = null;
|
||||
String fullname;
|
||||
|
||||
if (!name.startsWith("/") && !name.startsWith("\\"))
|
||||
@@ -121,9 +120,9 @@ public abstract class Draw extends Image {
|
||||
*/
|
||||
protected void Draw_GetPicSize(Dimension dim, String pic) {
|
||||
|
||||
image_t image = Draw_FindPic(pic);
|
||||
dim.width = (image != null) ? image.width : -1;
|
||||
dim.height = (image != null) ? image.height : -1;
|
||||
Q2Image image = Draw_FindPic(pic);
|
||||
dim.width = (image != null) ? image.getWidth() : -1;
|
||||
dim.height = (image != null) ? image.getHeight() : -1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -133,7 +132,7 @@ public abstract class Draw extends Image {
|
||||
*/
|
||||
protected void Draw_StretchPic (int x, int y, int w, int h, String pic) {
|
||||
|
||||
image_t image;
|
||||
Q2Image image;
|
||||
|
||||
image = Draw_FindPic(pic);
|
||||
if (image == null)
|
||||
@@ -145,22 +144,22 @@ public abstract class Draw extends Image {
|
||||
if (scrap_dirty)
|
||||
Scrap_Upload();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0) ) && !image.has_alpha)
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0) ) && !image.isAlpha())
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
GL_Bind(image.texnum);
|
||||
GL_Bind(image.getTexNum());
|
||||
GL11.glBegin (GL11.GL_QUADS);
|
||||
GL11.glTexCoord2f (image.sl, image.tl);
|
||||
GL11.glTexCoord2f (image.getSl(), image.getTl());
|
||||
GL11.glVertex2f (x, y);
|
||||
GL11.glTexCoord2f (image.sh, image.tl);
|
||||
GL11.glTexCoord2f (image.getSh(), image.getTl());
|
||||
GL11.glVertex2f (x+w, y);
|
||||
GL11.glTexCoord2f (image.sh, image.th);
|
||||
GL11.glTexCoord2f (image.getSh(), image.getTh());
|
||||
GL11.glVertex2f (x+w, y+h);
|
||||
GL11.glTexCoord2f (image.sl, image.th);
|
||||
GL11.glTexCoord2f (image.getSl(), image.getTh());
|
||||
GL11.glVertex2f (x, y+h);
|
||||
GL11.glEnd ();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) !=0 ) ) && !image.has_alpha)
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) !=0 ) ) && !image.isAlpha())
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
@@ -172,7 +171,7 @@ public abstract class Draw extends Image {
|
||||
*/
|
||||
protected void Draw_Pic(int x, int y, String pic)
|
||||
{
|
||||
image_t image;
|
||||
Q2Image image;
|
||||
|
||||
image = Draw_FindPic(pic);
|
||||
if (image == null)
|
||||
@@ -183,23 +182,23 @@ public abstract class Draw extends Image {
|
||||
if (scrap_dirty)
|
||||
Scrap_Upload();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha)
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.isAlpha())
|
||||
GL11.glDisable (GL11.GL_ALPHA_TEST);
|
||||
|
||||
GL_Bind(image.texnum);
|
||||
GL_Bind(image.getTexNum());
|
||||
|
||||
GL11.glBegin (GL11.GL_QUADS);
|
||||
GL11.glTexCoord2f (image.sl, image.tl);
|
||||
GL11.glTexCoord2f (image.getSl(), image.getTl());
|
||||
GL11.glVertex2f (x, y);
|
||||
GL11.glTexCoord2f (image.sh, image.tl);
|
||||
GL11.glVertex2f (x+image.width, y);
|
||||
GL11.glTexCoord2f (image.sh, image.th);
|
||||
GL11.glVertex2f (x+image.width, y+image.height);
|
||||
GL11.glTexCoord2f (image.sl, image.th);
|
||||
GL11.glVertex2f (x, y+image.height);
|
||||
GL11.glTexCoord2f (image.getSh(), image.getTl());
|
||||
GL11.glVertex2f (x+image.getWidth(), y);
|
||||
GL11.glTexCoord2f (image.getSh(), image.getTh());
|
||||
GL11.glVertex2f (x+image.getWidth(), y+ image.getHeight());
|
||||
GL11.glTexCoord2f (image.getSl(), image.getTh());
|
||||
GL11.glVertex2f (x, y+image.getHeight());
|
||||
GL11.glEnd ();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha)
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.isAlpha())
|
||||
GL11.glEnable (GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
@@ -212,7 +211,7 @@ public abstract class Draw extends Image {
|
||||
=============
|
||||
*/
|
||||
protected void Draw_TileClear(int x, int y, int w, int h, String pic) {
|
||||
image_t image;
|
||||
Q2Image image;
|
||||
|
||||
image = Draw_FindPic(pic);
|
||||
if (image == null)
|
||||
@@ -221,10 +220,10 @@ public abstract class Draw extends Image {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha)
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.isAlpha())
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
GL_Bind(image.texnum);
|
||||
GL_Bind(image.getTexNum());
|
||||
GL11.glBegin (GL11.GL_QUADS);
|
||||
GL11.glTexCoord2f(x/64.0f, y/64.0f);
|
||||
GL11.glVertex2f (x, y);
|
||||
@@ -236,7 +235,7 @@ public abstract class Draw extends Image {
|
||||
GL11.glVertex2f (x, y+h);
|
||||
GL11.glEnd ();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha)
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.isAlpha())
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import lwjake2.client.VID;
|
||||
import lwjake2.client.particle_t;
|
||||
import lwjake2.game.cvar_t;
|
||||
import lwjake2.qcommon.*;
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.util.Lib;
|
||||
import lwjake2.util.Vargs;
|
||||
|
||||
@@ -55,10 +55,10 @@ import static dmx.lwjake2.render.ImageType.*;
|
||||
public abstract class Image extends Main {
|
||||
// private static final FileSystem fileSystem = null/*BaseQ2FileSystem.getInstance()*/;
|
||||
|
||||
image_t draw_chars;
|
||||
Q2Image draw_chars;
|
||||
|
||||
image_t[] gltextures = new image_t[MAX_GLTEXTURES];
|
||||
//Map gltextures = new Hashtable(MAX_GLTEXTURES); // image_t
|
||||
Q2Image[] gltextures = new Q2Image[MAX_GLTEXTURES];
|
||||
//Map gltextures = new Hashtable(MAX_GLTEXTURES); // Q2Image
|
||||
int numgltextures;
|
||||
|
||||
byte[] intensitytable = new byte[256];
|
||||
@@ -84,7 +84,7 @@ public abstract class Image extends Main {
|
||||
// init the texture cache
|
||||
for (int i = 0; i < gltextures.length; i++)
|
||||
{
|
||||
gltextures[i] = new image_t(i);
|
||||
gltextures[i] = new Q2Image(i);
|
||||
}
|
||||
numgltextures = 0;
|
||||
}
|
||||
@@ -154,7 +154,7 @@ public abstract class Image extends Main {
|
||||
|
||||
if ((gl_nobind.value != 0) && (draw_chars != null)) {
|
||||
// performance evaluation option
|
||||
texnum = draw_chars.texnum;
|
||||
texnum = draw_chars.getTexNum();
|
||||
}
|
||||
if (gl_state.currenttextures[gl_state.currenttmu] == texnum)
|
||||
return;
|
||||
@@ -258,13 +258,13 @@ public abstract class Image extends Main {
|
||||
gl_filter_min = modes[i].minimize;
|
||||
gl_filter_max = modes[i].maximize;
|
||||
|
||||
image_t glt;
|
||||
Q2Image glt;
|
||||
// change all the existing mipmap texture objects
|
||||
for (i = 0; i < numgltextures; i++) {
|
||||
glt = gltextures[i];
|
||||
|
||||
if (glt.type != PICTURE && glt.type != SKY) {
|
||||
GL_Bind(glt.texnum);
|
||||
if (glt.getType() != PICTURE && glt.getType() != SKY) {
|
||||
GL_Bind(glt.getTexNum());
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, gl_filter_min);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, gl_filter_max);
|
||||
}
|
||||
@@ -319,7 +319,7 @@ public abstract class Image extends Main {
|
||||
*/
|
||||
void GL_ImageList_f() {
|
||||
|
||||
image_t image;
|
||||
Q2Image image;
|
||||
int texels;
|
||||
final String[] palstrings = { "RGB", "PAL" };
|
||||
|
||||
@@ -328,11 +328,11 @@ public abstract class Image extends Main {
|
||||
|
||||
for (int i = 0; i < numgltextures; i++) {
|
||||
image = gltextures[i];
|
||||
if (image.texnum <= 0)
|
||||
if (image.getTexNum() <= 0)
|
||||
continue;
|
||||
|
||||
texels += image.upload_width * image.upload_height;
|
||||
switch (image.type) {
|
||||
texels += image.getUploadWidth() * image.getUploadHeight();
|
||||
switch (image.getType()) {
|
||||
case SKIN:
|
||||
VID.Printf(Defines.PRINT_ALL, "M");
|
||||
break;
|
||||
@@ -353,8 +353,8 @@ public abstract class Image extends Main {
|
||||
VID.Printf(
|
||||
Defines.PRINT_ALL,
|
||||
" %3i %3i %s: %s\n",
|
||||
new Vargs(4).add(image.upload_width).add(image.upload_height).add(palstrings[(image.paletted) ? 1 : 0]).add(
|
||||
image.name));
|
||||
new Vargs(4).add(image.getUploadWidth()).add(image.getUploadHeight()).add(palstrings[(image.isPaletted()) ? 1 : 0]).add(
|
||||
image.getName()));
|
||||
}
|
||||
VID.Printf(Defines.PRINT_ALL, "Total texel count (not counting mipmaps): " + texels + '\n');
|
||||
}
|
||||
@@ -1021,7 +1021,7 @@ public abstract class Image extends Main {
|
||||
===============
|
||||
GL_Upload32
|
||||
|
||||
Returns has_alpha
|
||||
Returns alpha
|
||||
===============
|
||||
*/
|
||||
void GL_BuildPalettedTexture(ByteBuffer paletted_texture, int[] scaled, int scaled_width, int scaled_height) {
|
||||
@@ -1048,7 +1048,7 @@ public abstract class Image extends Main {
|
||||
===============
|
||||
GL_Upload32
|
||||
|
||||
Returns has_alpha
|
||||
Returns alpha
|
||||
===============
|
||||
*/
|
||||
int[] scaled = new int[256 * 256];
|
||||
@@ -1244,7 +1244,7 @@ public abstract class Image extends Main {
|
||||
===============
|
||||
GL_Upload8
|
||||
|
||||
Returns has_alpha
|
||||
Returns alpha
|
||||
===============
|
||||
*/
|
||||
|
||||
@@ -1308,15 +1308,15 @@ public abstract class Image extends Main {
|
||||
This is also used as an entry point for the generated r_notexture
|
||||
================
|
||||
*/
|
||||
image_t GL_LoadPic(String name, byte[] pic, int width, int height, ImageType type, int bits) {
|
||||
image_t image;
|
||||
Q2Image GL_LoadPic(String name, byte[] pic, int width, int height, ImageType type, int bits) {
|
||||
Q2Image image;
|
||||
int i;
|
||||
|
||||
// find a free image_t
|
||||
// find a free Q2Image
|
||||
for (i = 0; i<numgltextures ; i++)
|
||||
{
|
||||
image = gltextures[i];
|
||||
if (image.texnum == 0)
|
||||
if (image.getTexNum() == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1332,42 +1332,41 @@ public abstract class Image extends Main {
|
||||
if (name.length() > Defines.MAX_QPATH)
|
||||
Com.Error(ErrorCode.ERR_DROP, "Draw_LoadPic: \"" + name + "\" is too long");
|
||||
|
||||
image.name = name;
|
||||
image.registration_sequence = registration_sequence;
|
||||
image.setName(name);
|
||||
image.setRegistrationSequence(registration_sequence);
|
||||
|
||||
image.width = width;
|
||||
image.height = height;
|
||||
image.type = type;
|
||||
image.setWidth(width);
|
||||
image.setHeight(height);
|
||||
image.setType(type);
|
||||
|
||||
|
||||
if (image.type == SKIN && bits == 8)
|
||||
if (image.getType() == SKIN && bits == 8)
|
||||
R_FloodFillSkin(pic, width, height);
|
||||
|
||||
// load little pics into the scrap
|
||||
if (image.type == PICTURE && bits == 8 && image.width < 64 && image.height < 64) {
|
||||
if (image.getType() == PICTURE && bits == 8 && image.getWidth() < 64 && image.getHeight() < 64) {
|
||||
pos_t pos = new pos_t(0, 0);
|
||||
int j, k;
|
||||
|
||||
int texnum = Scrap_AllocBlock(image.width, image.height, pos);
|
||||
int texnum = Scrap_AllocBlock(image.getWidth(), image.getHeight(), pos);
|
||||
|
||||
if (texnum == -1) {
|
||||
// replace goto nonscrap
|
||||
|
||||
image.scrap = false;
|
||||
image.setScrap(false);
|
||||
|
||||
image.texnum = TEXNUM_IMAGES + image.getId(); // image pos in array
|
||||
GL_Bind(image.texnum);
|
||||
image.setTexNum(TEXNUM_IMAGES + image.getId()); // image pos in array
|
||||
GL_Bind(image.getTexNum());
|
||||
|
||||
image.has_alpha =
|
||||
GL_Upload8(pic, width, height, (image.type != PICTURE && image.type != SKY), image.type == SKY);
|
||||
image.setAlpha(GL_Upload8(pic, width, height, (image.getType() != PICTURE && image.getType() != SKY), image.getType() == SKY));
|
||||
|
||||
image.upload_width = upload_width; // after power of 2 and scales
|
||||
image.upload_height = upload_height;
|
||||
image.paletted = uploaded_paletted;
|
||||
image.sl = 0;
|
||||
image.sh = 1;
|
||||
image.tl = 0;
|
||||
image.th = 1;
|
||||
image.setUploadWidth(upload_width); // after power of 2 and scales
|
||||
image.setUploadHeight(upload_height);
|
||||
image.setPaletted(uploaded_paletted);
|
||||
image.setSl(0);
|
||||
image.setSh(1);
|
||||
image.setTl(0);
|
||||
image.setTh(1);
|
||||
|
||||
return image;
|
||||
}
|
||||
@@ -1376,29 +1375,29 @@ public abstract class Image extends Main {
|
||||
|
||||
// copy the texels into the scrap block
|
||||
k = 0;
|
||||
for (i = 0; i < image.height; i++)
|
||||
for (j = 0; j < image.width; j++, k++)
|
||||
for (i = 0; i < image.getHeight(); i++)
|
||||
for (j = 0; j < image.getWidth(); j++, k++)
|
||||
scrap_texels[texnum][(pos.y + i) * BLOCK_WIDTH + pos.x + j] = pic[k];
|
||||
|
||||
image.texnum = TEXNUM_SCRAPS + texnum;
|
||||
image.scrap = true;
|
||||
image.has_alpha = true;
|
||||
image.sl = (pos.x + 0.01f) / (float) BLOCK_WIDTH;
|
||||
image.sh = (pos.x + image.width - 0.01f) / (float) BLOCK_WIDTH;
|
||||
image.tl = (pos.y + 0.01f) / (float) BLOCK_WIDTH;
|
||||
image.th = (pos.y + image.height - 0.01f) / (float) BLOCK_WIDTH;
|
||||
image.setTexNum(TEXNUM_SCRAPS + texnum);
|
||||
image.setScrap(true);
|
||||
image.setAlpha(true);
|
||||
image.setSl((pos.x + 0.01f) / (float) BLOCK_WIDTH);
|
||||
image.setSh((pos.x + image.getWidth() - 0.01f) / (float) BLOCK_WIDTH);
|
||||
image.setTl((pos.y + 0.01f) / (float) BLOCK_WIDTH);
|
||||
image.setTh((pos.y + image.getHeight() - 0.01f) / (float) BLOCK_WIDTH);
|
||||
|
||||
}
|
||||
else {
|
||||
// this was label nonscrap
|
||||
|
||||
image.scrap = false;
|
||||
image.setScrap(false);
|
||||
|
||||
image.texnum = TEXNUM_IMAGES + image.getId(); //image pos in array
|
||||
GL_Bind(image.texnum);
|
||||
image.setTexNum(TEXNUM_IMAGES + image.getId()); //image pos in array
|
||||
GL_Bind(image.getTexNum());
|
||||
|
||||
if (bits == 8) {
|
||||
image.has_alpha = GL_Upload8(pic, width, height, (image.type != PICTURE && image.type != SKY), image.type == SKY);
|
||||
image.setAlpha(GL_Upload8(pic, width, height, (image.getType() != PICTURE && image.getType() != SKY), image.getType() == SKY));
|
||||
}
|
||||
else {
|
||||
int[] tmp = new int[pic.length / 4];
|
||||
@@ -1410,15 +1409,15 @@ public abstract class Image extends Main {
|
||||
tmp[i] |= ((pic[4 * i + 3] & 0xFF) << 24); // & 0xFF000000;
|
||||
}
|
||||
|
||||
image.has_alpha = GL_Upload32(tmp, width, height, (image.type != PICTURE && image.type != SKY));
|
||||
image.setAlpha(GL_Upload32(tmp, width, height, (image.getType() != PICTURE && image.getType() != SKY)));
|
||||
}
|
||||
image.upload_width = upload_width; // after power of 2 and scales
|
||||
image.upload_height = upload_height;
|
||||
image.paletted = uploaded_paletted;
|
||||
image.sl = 0;
|
||||
image.sh = 1;
|
||||
image.tl = 0;
|
||||
image.th = 1;
|
||||
image.setUploadWidth(upload_width); // after power of 2 and scales
|
||||
image.setUploadHeight(upload_height);
|
||||
image.setPaletted(uploaded_paletted);
|
||||
image.setSl(0);
|
||||
image.setSh(1);
|
||||
image.setTl(0);
|
||||
image.setTh(1);
|
||||
}
|
||||
return image;
|
||||
}
|
||||
@@ -1428,9 +1427,9 @@ public abstract class Image extends Main {
|
||||
GL_LoadWal
|
||||
================
|
||||
*/
|
||||
image_t GL_LoadWal(String name) {
|
||||
Q2Image GL_LoadWal(String name) {
|
||||
|
||||
image_t image;
|
||||
Q2Image image;
|
||||
|
||||
byte[] raw = UnpackLoader.loadFile(name);
|
||||
if (raw == null) {
|
||||
@@ -1455,8 +1454,8 @@ public abstract class Image extends Main {
|
||||
Finds or loads the given image
|
||||
===============
|
||||
*/
|
||||
image_t GL_FindImage(String name, ImageType type) {
|
||||
image_t image;
|
||||
Q2Image GL_FindImage(String name, ImageType type) {
|
||||
Q2Image image;
|
||||
|
||||
// // TODO loest das grossschreibungs problem
|
||||
// name = name.toLowerCase();
|
||||
@@ -1473,9 +1472,9 @@ public abstract class Image extends Main {
|
||||
for (int i = 0; i < numgltextures; i++)
|
||||
{
|
||||
image = gltextures[i];
|
||||
if (name.equals(image.name))
|
||||
if (name.equals(image.getName()))
|
||||
{
|
||||
image.registration_sequence = registration_sequence;
|
||||
image.setRegistrationSequence(registration_sequence);
|
||||
return image;
|
||||
}
|
||||
}
|
||||
@@ -1519,7 +1518,7 @@ public abstract class Image extends Main {
|
||||
R_RegisterSkin
|
||||
===============
|
||||
*/
|
||||
protected image_t R_RegisterSkin(String name) {
|
||||
protected Q2Image R_RegisterSkin(String name) {
|
||||
return GL_FindImage(name, SKIN);
|
||||
}
|
||||
|
||||
@@ -1536,27 +1535,27 @@ public abstract class Image extends Main {
|
||||
void GL_FreeUnusedImages() {
|
||||
|
||||
// never free r_notexture or particle texture
|
||||
r_notexture.registration_sequence = registration_sequence;
|
||||
r_particletexture.registration_sequence = registration_sequence;
|
||||
r_notexture.setRegistrationSequence(registration_sequence);
|
||||
r_particletexture.setRegistrationSequence(registration_sequence);
|
||||
|
||||
image_t image;
|
||||
Q2Image image;
|
||||
|
||||
for (int i = 0; i < numgltextures; i++) {
|
||||
image = gltextures[i];
|
||||
// used this sequence
|
||||
if (image.registration_sequence == registration_sequence)
|
||||
if (image.getRegistrationSequence() == registration_sequence)
|
||||
continue;
|
||||
// free image_t slot
|
||||
if (image.registration_sequence == 0)
|
||||
// free Q2Image slot
|
||||
if (image.getRegistrationSequence() == 0)
|
||||
continue;
|
||||
// don't free pics
|
||||
if (image.type == PICTURE)
|
||||
if (image.getType() == PICTURE)
|
||||
continue;
|
||||
|
||||
// free it
|
||||
// TODO jogl bug
|
||||
texnumBuffer.clear();
|
||||
texnumBuffer.put(0,image.texnum);
|
||||
texnumBuffer.put(0, image.getTexNum());
|
||||
GL11.glDeleteTextures(texnumBuffer);
|
||||
image.clear();
|
||||
}
|
||||
@@ -1655,18 +1654,18 @@ public abstract class Image extends Main {
|
||||
===============
|
||||
*/
|
||||
void GL_ShutdownImages() {
|
||||
image_t image;
|
||||
Q2Image image;
|
||||
|
||||
for (int i=0; i < numgltextures ; i++)
|
||||
{
|
||||
image = gltextures[i];
|
||||
|
||||
if (image.registration_sequence == 0)
|
||||
continue; // free image_t slot
|
||||
if (image.getRegistrationSequence() == 0)
|
||||
continue; // free Q2Image slot
|
||||
// free it
|
||||
// TODO jogl bug
|
||||
texnumBuffer.clear();
|
||||
texnumBuffer.put(0,image.texnum);
|
||||
texnumBuffer.put(0, image.getTexNum());
|
||||
GL11.glDeleteTextures(texnumBuffer);
|
||||
image.clear();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ package lwjake2.render.lwjgl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lwjake2.Defines;
|
||||
import lwjake2.ErrorCode;
|
||||
import lwjake2.Globals;
|
||||
import lwjake2.client.VID;
|
||||
import lwjake2.client.entity_t;
|
||||
import lwjake2.client.particle_t;
|
||||
@@ -34,7 +33,7 @@ import lwjake2.qcommon.Cvar;
|
||||
import lwjake2.qcommon.qfiles;
|
||||
import lwjake2.render.glconfig_t;
|
||||
import lwjake2.render.glstate_t;
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.render.mleaf_t;
|
||||
import lwjake2.render.model_t;
|
||||
import lwjake2.util.Math3D;
|
||||
@@ -127,8 +126,8 @@ public abstract class Main extends Base {
|
||||
glconfig_t gl_config = new glconfig_t();
|
||||
glstate_t gl_state = new glstate_t();
|
||||
|
||||
image_t r_notexture; // use for bad textures
|
||||
image_t r_particletexture; // little dot for particles
|
||||
Q2Image r_notexture; // use for bad textures
|
||||
Q2Image r_particletexture; // little dot for particles
|
||||
|
||||
entity_t currententity;
|
||||
model_t currentmodel;
|
||||
@@ -295,7 +294,7 @@ public abstract class Main extends Base {
|
||||
|
||||
GL11.glColor4f(1, 1, 1, alpha);
|
||||
|
||||
GL_Bind(currentmodel.skins[e.frame].texnum);
|
||||
GL_Bind(currentmodel.skins[e.frame].getTexNum());
|
||||
|
||||
GL_TexEnv(GL11.GL_MODULATE);
|
||||
|
||||
@@ -472,7 +471,7 @@ public abstract class Main extends Base {
|
||||
Math3D.VectorScale(vup, 1.5f, up);
|
||||
Math3D.VectorScale(vright, 1.5f, right);
|
||||
|
||||
GL_Bind(r_particletexture.texnum);
|
||||
GL_Bind(r_particletexture.getTexNum());
|
||||
GL11.glDepthMask(false); // no z buffering
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL_TexEnv(GL11.GL_MODULATE);
|
||||
|
||||
@@ -22,7 +22,7 @@ import lwjake2.Defines;
|
||||
import lwjake2.client.VID;
|
||||
import lwjake2.client.entity_t;
|
||||
import lwjake2.qcommon.qfiles;
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.util.Math3D;
|
||||
|
||||
import java.nio.FloatBuffer;
|
||||
@@ -595,7 +595,7 @@ public abstract class Mesh extends Light {
|
||||
|
||||
|
||||
|
||||
image_t skin;
|
||||
Q2Image skin;
|
||||
// select skin
|
||||
if (currententity.skin != null)
|
||||
skin = currententity.skin; // custom player skin
|
||||
@@ -612,7 +612,7 @@ public abstract class Mesh extends Light {
|
||||
}
|
||||
if (skin == null)
|
||||
skin = r_notexture; // fallback...
|
||||
GL_Bind(skin.texnum);
|
||||
GL_Bind(skin.getTexNum());
|
||||
|
||||
// draw it
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package lwjake2.render.lwjgl;
|
||||
|
||||
import dmx.lwjake2.render.ImageType;
|
||||
import dmx.lwjake2.render.ModelType;
|
||||
import lwjake2.Defines;
|
||||
import lwjake2.ErrorCode;
|
||||
@@ -1237,7 +1236,7 @@ public abstract class Model extends Surf {
|
||||
else if (mod.type == ModelType.BRUSH)
|
||||
{
|
||||
for (i=0 ; i<mod.numtexinfo ; i++)
|
||||
mod.texinfo[i].image.registration_sequence = registration_sequence;
|
||||
mod.texinfo[i].image.setRegistrationSequence(registration_sequence);
|
||||
}
|
||||
}
|
||||
return mod;
|
||||
|
||||
@@ -26,7 +26,7 @@ import lwjake2.client.lightstyle_t;
|
||||
import lwjake2.game.cplane_t;
|
||||
import lwjake2.qcommon.Com;
|
||||
import lwjake2.render.glpoly_t;
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.render.medge_t;
|
||||
import lwjake2.render.mleaf_t;
|
||||
import lwjake2.render.mnode_t;
|
||||
@@ -124,7 +124,7 @@ public abstract class Surf extends Draw {
|
||||
* R_TextureAnimation
|
||||
* Returns the proper texture for a given time and base texture
|
||||
*/
|
||||
image_t R_TextureAnimation(mtexinfo_t tex)
|
||||
Q2Image R_TextureAnimation(mtexinfo_t tex)
|
||||
{
|
||||
if (tex.next == null)
|
||||
return tex.image;
|
||||
@@ -204,11 +204,11 @@ public abstract class Surf extends Draw {
|
||||
{
|
||||
c_brush_polys++;
|
||||
|
||||
image_t image = R_TextureAnimation(fa.texinfo);
|
||||
Q2Image image = R_TextureAnimation(fa.texinfo);
|
||||
|
||||
if ((fa.flags & Defines.SURF_DRAWTURB) != 0)
|
||||
{
|
||||
GL_Bind( image.texnum );
|
||||
GL_Bind(image.getTexNum());
|
||||
|
||||
// warp texture, no lightmaps
|
||||
GL_TexEnv( GL11.GL_MODULATE );
|
||||
@@ -223,7 +223,7 @@ public abstract class Surf extends Draw {
|
||||
}
|
||||
else
|
||||
{
|
||||
GL_Bind( image.texnum );
|
||||
GL_Bind(image.getTexNum());
|
||||
GL_TexEnv( GL11.GL_REPLACE );
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ public abstract class Surf extends Draw {
|
||||
|
||||
for (msurface_t s = r_alpha_surfaces ; s != null ; s=s.texturechain)
|
||||
{
|
||||
GL_Bind(s.texinfo.image.texnum);
|
||||
GL_Bind(s.texinfo.image.getTexNum());
|
||||
c_brush_polys++;
|
||||
if ((s.texinfo.flags & Defines.SURF_TRANS33) != 0)
|
||||
GL11.glColor4f (intens, intens, intens, 0.33f);
|
||||
@@ -362,19 +362,19 @@ public abstract class Surf extends Draw {
|
||||
c_visible_textures = 0;
|
||||
|
||||
msurface_t s;
|
||||
image_t image;
|
||||
Q2Image image;
|
||||
int i;
|
||||
for (i = 0; i < numgltextures ; i++)
|
||||
{
|
||||
image = gltextures[i];
|
||||
|
||||
if (image.registration_sequence == 0)
|
||||
if (image.getRegistrationSequence() == 0)
|
||||
continue;
|
||||
if (image.texturechain == null)
|
||||
if (image.getTextureChain() == null)
|
||||
continue;
|
||||
c_visible_textures++;
|
||||
|
||||
for ( s = image.texturechain; s != null ; s=s.texturechain)
|
||||
for (s = image.getTextureChain(); s != null ; s=s.texturechain)
|
||||
{
|
||||
if ( ( s.flags & Defines.SURF_DRAWTURB) == 0 )
|
||||
R_RenderBrushPoly(s);
|
||||
@@ -386,9 +386,9 @@ public abstract class Surf extends Draw {
|
||||
{
|
||||
image = gltextures[i];
|
||||
|
||||
if (image.registration_sequence == 0)
|
||||
if (image.getRegistrationSequence() == 0)
|
||||
continue;
|
||||
s = image.texturechain;
|
||||
s = image.getTextureChain();
|
||||
if (s == null)
|
||||
continue;
|
||||
|
||||
@@ -398,7 +398,7 @@ public abstract class Surf extends Draw {
|
||||
R_RenderBrushPoly(s);
|
||||
}
|
||||
|
||||
image.texturechain = null;
|
||||
image.setTextureChain(null);
|
||||
}
|
||||
|
||||
GL_TexEnv( GL11.GL_REPLACE );
|
||||
@@ -443,7 +443,7 @@ public abstract class Surf extends Draw {
|
||||
}
|
||||
|
||||
glpoly_t p;
|
||||
image_t image = R_TextureAnimation( surf.texinfo );
|
||||
Q2Image image = R_TextureAnimation( surf.texinfo );
|
||||
int lmtex = surf.lightmaptexturenum;
|
||||
|
||||
if ( is_dynamic )
|
||||
@@ -491,7 +491,7 @@ public abstract class Surf extends Draw {
|
||||
|
||||
c_brush_polys++;
|
||||
|
||||
GL_MBind( GL_TEXTURE0, image.texnum );
|
||||
GL_MBind( GL_TEXTURE0, image.getTexNum());
|
||||
GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + lmtex );
|
||||
|
||||
// ==========
|
||||
@@ -525,7 +525,7 @@ public abstract class Surf extends Draw {
|
||||
{
|
||||
c_brush_polys++;
|
||||
|
||||
GL_MBind( GL_TEXTURE0, image.texnum );
|
||||
GL_MBind( GL_TEXTURE0, image.getTexNum());
|
||||
GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + lmtex);
|
||||
|
||||
// ==========
|
||||
@@ -805,7 +805,7 @@ public abstract class Surf extends Draw {
|
||||
|
||||
// draw stuff
|
||||
msurface_t surf;
|
||||
image_t image;
|
||||
Q2Image image;
|
||||
//for ( c = node.numsurfaces, surf = r_worldmodel.surfaces[node.firstsurface]; c != 0 ; c--, surf++)
|
||||
for ( c = 0; c < node.numsurfaces; c++)
|
||||
{
|
||||
@@ -837,8 +837,8 @@ public abstract class Surf extends Draw {
|
||||
// sorted chain
|
||||
// FIXME: this is a hack for animation
|
||||
image = R_TextureAnimation(surf.texinfo);
|
||||
surf.texturechain = image.texturechain;
|
||||
image.texturechain = surf;
|
||||
surf.texturechain = image.getTextureChain();
|
||||
image.setTextureChain(surf);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1119,10 +1119,10 @@ public abstract class Surf extends Draw {
|
||||
vec = currentmodel.vertexes[r_pedge.v[1]].position;
|
||||
}
|
||||
s = Math3D.DotProduct (vec, fa.texinfo.vecs[0]) + fa.texinfo.vecs[0][3];
|
||||
s /= fa.texinfo.image.width;
|
||||
s /= fa.texinfo.image.getWidth();
|
||||
|
||||
t = Math3D.DotProduct (vec, fa.texinfo.vecs[1]) + fa.texinfo.vecs[1][3];
|
||||
t /= fa.texinfo.image.height;
|
||||
t /= fa.texinfo.image.getHeight();
|
||||
|
||||
poly.x(i, vec[0]);
|
||||
poly.y(i, vec[1]);
|
||||
|
||||
@@ -18,13 +18,12 @@
|
||||
|
||||
package lwjake2.render.lwjgl;
|
||||
|
||||
import dmx.lwjake2.render.ImageType;
|
||||
import lwjake2.Defines;
|
||||
import lwjake2.ErrorCode;
|
||||
import lwjake2.Globals;
|
||||
import lwjake2.qcommon.Com;
|
||||
import lwjake2.render.glpoly_t;
|
||||
import lwjake2.render.image_t;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.render.msurface_t;
|
||||
import lwjake2.util.Math3D;
|
||||
import lwjake2.util.Vec3Cache;
|
||||
@@ -78,7 +77,7 @@ public abstract class Warp extends Model {
|
||||
String skyname;
|
||||
float skyrotate;
|
||||
float[] skyaxis = {0, 0, 0};
|
||||
image_t[] sky_images = new image_t[6];
|
||||
Q2Image[] sky_images = new Q2Image[6];
|
||||
|
||||
msurface_t warpface;
|
||||
|
||||
@@ -652,7 +651,7 @@ public abstract class Warp extends Model {
|
||||
|| skymins[1][i] >= skymaxs[1][i])
|
||||
continue;
|
||||
|
||||
GL_Bind(sky_images[skytexorder[i]].texnum);
|
||||
GL_Bind(sky_images[skytexorder[i]].getTexNum());
|
||||
|
||||
GL11.glBegin(GL11.GL_QUADS);
|
||||
MakeSkyVec(skymins[0][i], skymins[1][i], i);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package lwjake2.render;
|
||||
|
||||
import dmx.lwjake2.render.ModelType;
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
import lwjake2.Defines;
|
||||
import lwjake2.game.cplane_t;
|
||||
import lwjake2.qcommon.qfiles;
|
||||
@@ -92,8 +93,8 @@ public class model_t implements Cloneable {
|
||||
public byte lightdata[];
|
||||
|
||||
// for alias models and skins
|
||||
// was image_t *skins[]; (array of pointers)
|
||||
public image_t skins[] = new image_t[Defines.MAX_MD2SKINS];
|
||||
// was Q2Image *skins[]; (array of pointers)
|
||||
public Q2Image skins[] = new Q2Image[Defines.MAX_MD2SKINS];
|
||||
|
||||
public int extradatasize;
|
||||
|
||||
@@ -164,7 +165,7 @@ public class model_t implements Cloneable {
|
||||
lightdata = null;
|
||||
|
||||
// for alias models and skins
|
||||
// was image_t *skins[]; (array of pointers)
|
||||
// was Q2Image *skins[]; (array of pointers)
|
||||
Arrays.fill(skins, null);
|
||||
|
||||
extradatasize = 0;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
package lwjake2.render;
|
||||
|
||||
import dmx.lwjake2.render.Q2Image;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class mtexinfo_t {
|
||||
@@ -29,7 +31,7 @@ public class mtexinfo_t {
|
||||
public int flags;
|
||||
public int numframes;
|
||||
public mtexinfo_t next; // animation chain
|
||||
public image_t image;
|
||||
public Q2Image image;
|
||||
|
||||
public void clear() {
|
||||
Arrays.fill(vecs[0], 0);
|
||||
|
||||
@@ -410,7 +410,7 @@ public final class LWJGLSoundImpl implements Sound {
|
||||
// find a free sfx
|
||||
for (i = 0; i < num_sfx; i++)
|
||||
if (known_sfx[i].name == null)
|
||||
// registration_sequence < s_registration_sequence)
|
||||
// registrationSequence < s_registration_sequence)
|
||||
break;
|
||||
|
||||
if (i == num_sfx) {
|
||||
|
||||
Reference in New Issue
Block a user