0

enum ModelType

This commit is contained in:
2019-06-04 13:40:02 +03:00
parent 716c70ce9f
commit 976d405d8f
5 changed files with 25 additions and 26 deletions

View File

@@ -0,0 +1,8 @@
package dmx.lwjake2.render;
public enum ModelType {
BAD,
BRUSH,
SPRITE,
ALIAS
}

View File

@@ -47,15 +47,6 @@ public abstract class Base extends LWJGLBase {
* model skin sprite frame wall texture pic
*/
// enum modtype_t
static final int mod_bad = 0;
static final int mod_brush = 1;
static final int mod_sprite = 2;
static final int mod_alias = 3;
static final int TEXNUM_LIGHTMAPS = 1024;
static final int TEXNUM_SCRAPS = 1152;

View File

@@ -408,13 +408,13 @@ public abstract class Main extends Base {
continue;
}
switch (currentmodel.type) {
case mod_alias :
case ALIAS:
R_DrawAliasModel(currententity);
break;
case mod_brush :
case BRUSH:
R_DrawBrushModel(currententity);
break;
case mod_sprite :
case SPRITE:
R_DrawSpriteModel(currententity);
break;
default :
@@ -442,13 +442,13 @@ public abstract class Main extends Base {
continue;
}
switch (currentmodel.type) {
case mod_alias :
case ALIAS:
R_DrawAliasModel(currententity);
break;
case mod_brush :
case BRUSH:
R_DrawBrushModel(currententity);
break;
case mod_sprite :
case SPRITE:
R_DrawSpriteModel(currententity);
break;
default :

View File

@@ -19,6 +19,7 @@
package lwjake2.render.lwjgl;
import dmx.lwjake2.render.ImageType;
import dmx.lwjake2.render.ModelType;
import lwjake2.Defines;
import lwjake2.ErrorCode;
import lwjake2.client.VID;
@@ -953,7 +954,7 @@ public abstract class Model extends Surf {
qfiles.dheader_t header;
mmodel_t bm;
loadmodel.type = mod_brush;
loadmodel.type = ModelType.BRUSH;
if (loadmodel != mod_known[0])
Com.Error(ErrorCode.ERR_DROP, "Loaded a brush model after the world");
@@ -1089,7 +1090,7 @@ public abstract class Model extends Surf {
}
}
mod.type = mod_alias;
mod.type = ModelType.ALIAS;
//
// load the glcmds
@@ -1163,7 +1164,7 @@ public abstract class Model extends Surf {
mod.skins[i] = GL_FindImage(sprout.frames[i].name, SPRITE);
}
mod.type = mod_sprite;
mod.type = ModelType.SPRITE;
mod.extradata = sprout;
}
@@ -1218,13 +1219,13 @@ public abstract class Model extends Surf {
mod.registration_sequence = registration_sequence;
// register any images used by the models
if (mod.type == mod_sprite)
if (mod.type == ModelType.SPRITE)
{
sprout = (qfiles.dsprite_t)mod.extradata;
for (i=0 ; i<sprout.numframes ; i++)
mod.skins[i] = GL_FindImage(sprout.frames[i].name, SPRITE);
}
else if (mod.type == mod_alias)
else if (mod.type == ModelType.ALIAS)
{
pheader = (qfiles.dmdl_t)mod.extradata;
for (i=0 ; i<pheader.num_skins ; i++)
@@ -1233,7 +1234,7 @@ public abstract class Model extends Surf {
mod.numframes = pheader.num_frames;
// PGM
}
else if (mod.type == mod_brush)
else if (mod.type == ModelType.BRUSH)
{
for (i=0 ; i<mod.numtexinfo ; i++)
mod.texinfo[i].image.registration_sequence = registration_sequence;
@@ -1263,7 +1264,7 @@ public abstract class Model extends Surf {
Mod_Free(mod);
} else {
// precompile AliasModels
if (mod.type == mod_alias)
if (mod.type == ModelType.ALIAS)
precompileGLCmds((qfiles.dmdl_t)mod.extradata);
}
}

View File

@@ -18,6 +18,7 @@
package lwjake2.render;
import dmx.lwjake2.render.ModelType;
import lwjake2.Defines;
import lwjake2.game.cplane_t;
import lwjake2.qcommon.qfiles;
@@ -32,8 +33,7 @@ public class model_t implements Cloneable {
public int registration_sequence;
// was enum modtype_t
public int type;
public ModelType type;
public int numframes;
public int flags;
@@ -104,8 +104,7 @@ public class model_t implements Cloneable {
name = "";
registration_sequence = 0;
// was enum modtype_t
type = 0;
type = ModelType.BAD;
numframes = 0;
flags = 0;