prepare CKMesh

This commit is contained in:
yyc12345 2023-09-15 13:21:49 +08:00
parent 248b7e7385
commit b499d907f7
10 changed files with 322 additions and 151 deletions

View File

@ -45,11 +45,11 @@ public class CommonHelper {
switch (comment.getType()) { switch (comment.getType()) {
case CKGeneralLexer.CKGENERAL_LINE_COMMENT: { case CKGeneralLexer.CKGENERAL_LINE_COMMENT: {
return comment.getText().substring(2); return removeStars(comment.getText().substring(2));
} }
case CKGeneralLexer.CKGENERAL_BLOCK_COMMENT: { case CKGeneralLexer.CKGENERAL_BLOCK_COMMENT: {
String cache = comment.getText(); String cache = comment.getText();
return cache.substring(2, cache.length() - 4); return removeStars(cache.substring(2, cache.length() - 4));
} }
default: default:
return comment.getText(); return comment.getText();
@ -75,7 +75,7 @@ public class CommonHelper {
return text + " "; return text + " ";
}).collect(Collectors.joining("")); }).collect(Collectors.joining(""));
} }
// =========== Number Operations =========== // =========== Number Operations ===========
/** /**
@ -178,4 +178,14 @@ public class CommonHelper {
return strl.replace("\n", "").replace("\r", ""); return strl.replace("\n", "").replace("\r", "");
} }
/**
* Remove redundent star '*' (at least 5 continuous star chars)
* @param cmt The string provided.
* @return The string processed.
*/
public static String removeStars(String cmt) {
// only remove at least 5 continuous star chars.
return cmt.replaceAll("\\*{5,}", "");
}
} }

View File

@ -214,78 +214,6 @@ typedef enum CK_3DENTITY_FLAGS {
} CK_3DENTITY_FLAGS; } CK_3DENTITY_FLAGS;
/*****************************************************************
{filename:VX_MOVEABLE_FLAGS}
Summary: 3dEntity additionnal flags Options
Remarks:
+ The VX_MOVEABLE_FLAGS is used by CK3dEntity::SetMoveableFlags to specify different hints to the render engine about the entity.
+ The (Engine) flags are set by the render engine and should not be modified by user. They can be checked with the CK3dEntity::GetMoveableFlags method.
+ The (User) flags are to be set by the user or can be set by a specific method of CK3dEntity.
See Also: CK3dEntity::SetMoveableFlags
******************************************************************/
typedef enum VX_MOVEABLE_FLAGS {
VX_MOVEABLE_PICKABLE =0x00000001, // (User)If not set this entity cannot be returned by CKRenderContext::Pick() or CKRenderContext::RectPict() functions.
VX_MOVEABLE_VISIBLE =0x00000002, // (Engine) See CKObject::Show,CK3dEntity::IsVisible
VX_MOVEABLE_UPTODATE =0x00000004, // (Engine) Used to Notify change in the data of the entity.
VX_MOVEABLE_RENDERCHANNELS =0x00000008, // (User) If not set, additional material channels on the mesh used by this entity won't be rendered (CK3dEntity::SetRenderChannels)
VX_MOVEABLE_USERBOX =0x00000010, // (Engine) When CK3dEntity::SetBoundingBox is called with a user box, this flag is set.
VX_MOVEABLE_EXTENTSUPTODATE =0x00000020, // (Engine) Indicate that object 2D extents are up to date
VX_MOVEABLE_BOXVALID =0x00004000, // (Engine) If not set the moveable has no mesh associated so its bounding box is irrelevant (a point).
VX_MOVEABLE_RENDERLAST =0x00010000, // (User) If set the moveable will be rendered with the transparent objects (i.e in last) (CK3dEntity::SetRenderAsTransparent)
VX_MOVEABLE_HASMOVED =0x00020000, // (Engine) Set when its position or orientation has changed. (Reset every frame when rendering starts)
VX_MOVEABLE_WORLDALIGNED =0x00040000, // (User) Hint for render engine : this object is aligned with world position and orientation.
VX_MOVEABLE_NOZBUFFERWRITE =0x00080000, // (User) Set by the user to warn Render Engine that this object must not write information to Z buffer
VX_MOVEABLE_RENDERFIRST =0x00100000, // (User) If set the moveable will be rendered within the firsts objects
VX_MOVEABLE_NOZBUFFERTEST =0x00200000, // (User) Set by the user to warn Render Engine that this object must not test against Z buffer (This override settings of all materials used by this Entity)
VX_MOVEABLE_INVERSEWORLDMATVALID =0x00400000, // (Engine) Inverse world matrix is not up to date and should be recomputed
VX_MOVEABLE_DONTUPDATEFROMPARENT =0x00800000, // (User) This object will not be updated by parent (neither World nor Local matrix wil be updated) . This flags can be used by physic engine for example in which hierarchy is not relevant for physicalised objects
VX_MOVEABLE_INDIRECTMATRIX =0x01000000, // (User/Engine) Set by the engine at load time : The object matrix is in left hand referential, culling needs to be inverted
VX_MOVEABLE_ZBUFONLY =0x02000000, // (User) The object will only be rendered in depth buffer
VX_MOVEABLE_STENCILONLY =0x04000000, // (User) The object will only be rendered in stencil buffer
VX_MOVEABLE_HIERARCHICALHIDE =0x10000000, // (Engine) If Object has this flags and is hidden its children won't be rendered
VX_MOVEABLE_CHARACTERRENDERED =0x20000000, // (Engine) Set if a character was rendered last frame...
VX_MOVEABLE_RESERVED2 =0x40000000, // (Engine)
} VX_MOVEABLE_FLAGS;
/*****************************************************************
{filename:VXMESH_FLAGS}
Summary:Mesh Flags Options
Remarks:
+ The VXMESH_FLAGS is used by CKMesh::SetFlags to specify different hints to the render engine about the mesh.
+ Most of this flags can be set or asked using the appropriate method of CKMesh (given between () in the members documentation).
See Also: CKMesh,CKMesh::SetFlags
******************************************************************/
typedef enum VXMESH_FLAGS
{
VXMESH_BOUNDINGUPTODATE = 0x00000001, // If set the bounding box is up to date (internal).
VXMESH_VISIBLE = 0x00000002, // If not set the mesh will not be rendered (CKMesh::Show)
VXMESH_OPTIMIZED = 0x00000004, // Set by the render engine if the mesh is optimized for rendering. Unset it to force to recreate optimized structures (when changing materials or face organization ) (CKMesh::VertexMove)
VXMESH_RENDERCHANNELS = 0x00000008, // If not set Additional material channels won't be rendered.
VXMESH_HASTRANSPARENCY = 0x00000010, // If set indicates that one or more of the faces of this mesh use a transparent material (internal)
VXMESH_PRELITMODE = 0x00000080, // If set, no lightning should occur for this mesh, vertex color should be used instead (CKMesh::SetLitMode)
VXMESH_WRAPU = 0x00000100, // Texture coordinates wrapping among u texture coordinates. (CKMesh::SetWrapMode)
VXMESH_WRAPV = 0x00000200, // Texture coordinates wrapping among v texture coordinates. (CKMesh::SetWrapMode)
VXMESH_FORCETRANSPARENCY = 0x00001000, // Forces this mesh to be considered as transparent even if no material is tranparent. (CKMesh::SetTransparent)
VXMESH_TRANSPARENCYUPTODATE = 0x00002000, // If set, the flags VXMESH_HASTRANSPARENCY is up to date. (internal)
VXMESH_UV_CHANGED = 0x00004000, // Must be set if texture coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::UVChanged)
VXMESH_NORMAL_CHANGED = 0x00008000, // Must be set if normal coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::NormalChanged)
VXMESH_COLOR_CHANGED = 0x00010000, // Must be set if colors changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::ColorChanged)
VXMESH_POS_CHANGED = 0x00020000, // Must be set if vertex position changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove)
VXMESH_HINTDYNAMIC = 0x00040000, // Hint for render engine : Mesh geometry is updated frequently
VXMESH_GENNORMALS = 0x00080000, // Hint : Normals were generated by BuildNormals : Do not save (internal)
VXMESH_PROCEDURALUV = 0x00100000, // Hint : UVs are generated : Do not save (internal)
VXMESH_PROCEDURALPOS = 0x00200000, // Hint : Vertices postions are generated : Do not save (internal)
VXMESH_STRIPIFY = 0x00400000, // If set the mesh will be stripified.
VXMESH_MONOMATERIAL = 0x00800000, // Set by the render engine if the mesh use only one material.
VXMESH_PM_BUILDNORM = 0x01000000, // Build normals when performing progressive meshing : Do not save (internal)
VXMESH_BWEIGHTS_CHANGED = 0x02000000, // Must be set if vertex blend weights have changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove)
VXMESH_ALLFLAGS = 0x007FF39F
} VXMESH_FLAGS;
/************************************************* /*************************************************
{filename:CK_TEXTURE_SAVEOPTIONS} {filename:CK_TEXTURE_SAVEOPTIONS}
Summary: Specify the way textures or sprites will be saved Summary: Specify the way textures or sprites will be saved

View File

@ -230,3 +230,127 @@ typedef enum VX_EFFECT
VXEFFECT_MASK = 0xFUL // Mask for all possible values. VXEFFECT_MASK = 0xFUL // Mask for all possible values.
} VX_EFFECT; } VX_EFFECT;
/*****************************************************************
{filename:VX_MOVEABLE_FLAGS}
Summary: 3dEntity additionnal flags Options
Remarks:
+ The VX_MOVEABLE_FLAGS is used by CK3dEntity::SetMoveableFlags to specify different hints to the render engine about the entity.
+ The (Engine) flags are set by the render engine and should not be modified by user. They can be checked with the CK3dEntity::GetMoveableFlags method.
+ The (User) flags are to be set by the user or can be set by a specific method of CK3dEntity.
See Also: CK3dEntity::SetMoveableFlags
******************************************************************/
typedef enum VX_MOVEABLE_FLAGS {
VX_MOVEABLE_PICKABLE =0x00000001, // (User)If not set this entity cannot be returned by CKRenderContext::Pick() or CKRenderContext::RectPict() functions.
VX_MOVEABLE_VISIBLE =0x00000002, // (Engine) See CKObject::Show,CK3dEntity::IsVisible
VX_MOVEABLE_UPTODATE =0x00000004, // (Engine) Used to Notify change in the data of the entity.
VX_MOVEABLE_RENDERCHANNELS =0x00000008, // (User) If not set, additional material channels on the mesh used by this entity won't be rendered (CK3dEntity::SetRenderChannels)
VX_MOVEABLE_USERBOX =0x00000010, // (Engine) When CK3dEntity::SetBoundingBox is called with a user box, this flag is set.
VX_MOVEABLE_EXTENTSUPTODATE =0x00000020, // (Engine) Indicate that object 2D extents are up to date
VX_MOVEABLE_BOXVALID =0x00004000, // (Engine) If not set the moveable has no mesh associated so its bounding box is irrelevant (a point).
VX_MOVEABLE_RENDERLAST =0x00010000, // (User) If set the moveable will be rendered with the transparent objects (i.e in last) (CK3dEntity::SetRenderAsTransparent)
VX_MOVEABLE_HASMOVED =0x00020000, // (Engine) Set when its position or orientation has changed. (Reset every frame when rendering starts)
VX_MOVEABLE_WORLDALIGNED =0x00040000, // (User) Hint for render engine : this object is aligned with world position and orientation.
VX_MOVEABLE_NOZBUFFERWRITE =0x00080000, // (User) Set by the user to warn Render Engine that this object must not write information to Z buffer
VX_MOVEABLE_RENDERFIRST =0x00100000, // (User) If set the moveable will be rendered within the firsts objects
VX_MOVEABLE_NOZBUFFERTEST =0x00200000, // (User) Set by the user to warn Render Engine that this object must not test against Z buffer (This override settings of all materials used by this Entity)
VX_MOVEABLE_INVERSEWORLDMATVALID =0x00400000, // (Engine) Inverse world matrix is not up to date and should be recomputed
VX_MOVEABLE_DONTUPDATEFROMPARENT =0x00800000, // (User) This object will not be updated by parent (neither World nor Local matrix wil be updated) . This flags can be used by physic engine for example in which hierarchy is not relevant for physicalised objects
VX_MOVEABLE_INDIRECTMATRIX =0x01000000, // (User/Engine) Set by the engine at load time : The object matrix is in left hand referential, culling needs to be inverted
VX_MOVEABLE_ZBUFONLY =0x02000000, // (User) The object will only be rendered in depth buffer
VX_MOVEABLE_STENCILONLY =0x04000000, // (User) The object will only be rendered in stencil buffer
VX_MOVEABLE_HIERARCHICALHIDE =0x10000000, // (Engine) If Object has this flags and is hidden its children won't be rendered
VX_MOVEABLE_CHARACTERRENDERED =0x20000000, // (Engine) Set if a character was rendered last frame...
VX_MOVEABLE_RESERVED2 =0x40000000, // (Engine)
} VX_MOVEABLE_FLAGS;
/*****************************************************************
{filename:VXMESH_FLAGS}
Summary:Mesh Flags Options
Remarks:
+ The VXMESH_FLAGS is used by CKMesh::SetFlags to specify different hints to the render engine about the mesh.
+ Most of this flags can be set or asked using the appropriate method of CKMesh (given between () in the members documentation).
See Also: CKMesh,CKMesh::SetFlags
******************************************************************/
typedef enum VXMESH_FLAGS
{
VXMESH_BOUNDINGUPTODATE = 0x00000001, // If set the bounding box is up to date (internal).
VXMESH_VISIBLE = 0x00000002, // If not set the mesh will not be rendered (CKMesh::Show)
VXMESH_OPTIMIZED = 0x00000004, // Set by the render engine if the mesh is optimized for rendering. Unset it to force to recreate optimized structures (when changing materials or face organization ) (CKMesh::VertexMove)
VXMESH_RENDERCHANNELS = 0x00000008, // If not set Additional material channels won't be rendered.
VXMESH_HASTRANSPARENCY = 0x00000010, // If set indicates that one or more of the faces of this mesh use a transparent material (internal)
VXMESH_PRELITMODE = 0x00000080, // If set, no lightning should occur for this mesh, vertex color should be used instead (CKMesh::SetLitMode)
VXMESH_WRAPU = 0x00000100, // Texture coordinates wrapping among u texture coordinates. (CKMesh::SetWrapMode)
VXMESH_WRAPV = 0x00000200, // Texture coordinates wrapping among v texture coordinates. (CKMesh::SetWrapMode)
VXMESH_FORCETRANSPARENCY = 0x00001000, // Forces this mesh to be considered as transparent even if no material is tranparent. (CKMesh::SetTransparent)
VXMESH_TRANSPARENCYUPTODATE = 0x00002000, // If set, the flags VXMESH_HASTRANSPARENCY is up to date. (internal)
VXMESH_UV_CHANGED = 0x00004000, // Must be set if texture coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::UVChanged)
VXMESH_NORMAL_CHANGED = 0x00008000, // Must be set if normal coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::NormalChanged)
VXMESH_COLOR_CHANGED = 0x00010000, // Must be set if colors changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::ColorChanged)
VXMESH_POS_CHANGED = 0x00020000, // Must be set if vertex position changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove)
VXMESH_HINTDYNAMIC = 0x00040000, // Hint for render engine : Mesh geometry is updated frequently
VXMESH_GENNORMALS = 0x00080000, // Hint : Normals were generated by BuildNormals : Do not save (internal)
VXMESH_PROCEDURALUV = 0x00100000, // Hint : UVs are generated : Do not save (internal)
VXMESH_PROCEDURALPOS = 0x00200000, // Hint : Vertices postions are generated : Do not save (internal)
VXMESH_STRIPIFY = 0x00400000, // If set the mesh will be stripified.
VXMESH_MONOMATERIAL = 0x00800000, // Set by the render engine if the mesh use only one material.
VXMESH_PM_BUILDNORM = 0x01000000, // Build normals when performing progressive meshing : Do not save (internal)
VXMESH_BWEIGHTS_CHANGED = 0x02000000, // Must be set if vertex blend weights have changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove)
VXMESH_ALLFLAGS = 0x007FF39F
} VXMESH_FLAGS;
/******************************************************************
{filename:VXMESH_LITMODE}
Summary: Mesh lighting options
Remarks:
+ The VXMESH_LITMODE is used by CKMesh::SetLitMode to specify how lighting is done.
See Also: CKMaterial,CKMesh
******************************************************************/
typedef enum VXMESH_LITMODE
{
VX_PRELITMESH = 0, // Lighting use color information store with vertices
VX_LITMESH = 1, // Lighting is done by renderer using normals and face material information.
} VXMESH_LITMODE;
/*****************************************************************
{filename:VXCHANNEL_FLAGS}
Summary:Mesh additionnal material channel options
Remarks:
+ The VXCHANNEL_FLAGS is used by CKMesh::SetChannelFlags to give the behavior of
an additional material channel.
See Also: CKMesh,CKMesh::AddChannel,CKMesh::IsChannelLit,CKMesh::IsChannelActive
******************************************************************/
typedef enum VXCHANNEL_FLAGS {
VXCHANNEL_ACTIVE = 0x00000001, // This channel is active
VXCHANNEL_SAMEUV = 0x00800000, // This channel should use the texture coordinates of the base mesh.
VXCHANNEL_NOTLIT = 0x01000000, // Additionnal Material Channel should not be lit (some channels may not be rendered in one pass with this option)
VXCHANNEL_MONO = 0x02000000, // Set at runtime by render engine to indicate whether this channel was rendered using multiple pass or not.(Dot Not Modify)
VXCHANNEL_RESERVED1 = 0x04000000, // Reserved for internal use
VXCHANNEL_LAST = 0x08000000, // Set at runtime by render engine to indicate this channel isthe last to be rendered. Dot Not Modify
} VXCHANNEL_FLAGS;
/****************************************************************
{filename:VXTEXTURE_WRAPMODE}
Summary: Wrapping Flags
Remarks:
+ The VXTEXTURE_WRAPMODE is used by CKMesh::SetWrapMode() to specify how
texture coordinates are interpolated.
See Also: Using Materials,CKMaterial,CKMesh::SetWrapMode.
****************************************************************/
typedef enum VXTEXTURE_WRAPMODE
{
VXTEXTUREWRAP_NONE = 0x00000000, // Flat texture addressing
VXTEXTUREWRAP_U = 0x00000001, // Vertical cylinder mapping
VXTEXTUREWRAP_V = 0x00000002, // Horizontal cylinder mapping
VXTEXTUREWRAP_UV = 0x00000003, // Spherical mapping
} VXTEXTURE_WRAPMODE;

View File

@ -250,78 +250,13 @@ namespace LibCmo::CK2 {
CK_3DENTITY_CHARACTERDOPROCESS = 0x80000000, /**< Special flag for Characters : Automatic process of animation */ CK_3DENTITY_CHARACTERDOPROCESS = 0x80000000, /**< Special flag for Characters : Automatic process of animation */
}; };
/** /**
@brief 3dEntity additionnal flags Options {filename:CK_TEXTURE_SAVEOPTIONS}
@remark Summary: Specify the way textures or sprites will be saved
+ The VX_MOVEABLE_FLAGS is used by CK3dEntity::SetMoveableFlags to specify different hints to the render engine about the entity.
+ The (Engine) flags are set by the render engine and should not be modified by user. They can be checked with the CK3dEntity::GetMoveableFlags method. Remarks :
+ The (User) flags are to be set by the user or can be set by a specific method of CK3dEntity.
@see CK3dEntity::SetMoveableFlags
*/
enum class VX_MOVEABLE_FLAGS : uint32_t {
VX_MOVEABLE_PICKABLE = 0x00000001, /**< (User)If not set this entity cannot be returned by CKRenderContext::Pick() or CKRenderContext::RectPict() functions. */
VX_MOVEABLE_VISIBLE = 0x00000002, /**< (Engine) See CKObject::Show,CK3dEntity::IsVisible */
VX_MOVEABLE_UPTODATE = 0x00000004, /**< (Engine) Used to Notify change in the data of the entity. */
VX_MOVEABLE_RENDERCHANNELS = 0x00000008, /**< (User) If not set, additional material channels on the mesh used by this entity won't be rendered (CK3dEntity::SetRenderChannels) */
VX_MOVEABLE_USERBOX = 0x00000010, /**< (Engine) When CK3dEntity::SetBoundingBox is called with a user box, this flag is set. */
VX_MOVEABLE_EXTENTSUPTODATE = 0x00000020, /**< (Engine) Indicate that object 2D extents are up to date */
VX_MOVEABLE_BOXVALID = 0x00004000, /**< (Engine) If not set the moveable has no mesh associated so its bounding box is irrelevant (a point). */
VX_MOVEABLE_RENDERLAST = 0x00010000, /**< (User) If set the moveable will be rendered with the transparent objects (i.e in last) (CK3dEntity::SetRenderAsTransparent) */
VX_MOVEABLE_HASMOVED = 0x00020000, /**< (Engine) Set when its position or orientation has changed. (Reset every frame when rendering starts) */
VX_MOVEABLE_WORLDALIGNED = 0x00040000, /**< (User) Hint for render engine : this object is aligned with world position and orientation. */
VX_MOVEABLE_NOZBUFFERWRITE = 0x00080000, /**< (User) Set by the user to warn Render Engine that this object must not write information to Z buffer */
VX_MOVEABLE_RENDERFIRST = 0x00100000, /**< (User) If set the moveable will be rendered within the firsts objects */
VX_MOVEABLE_NOZBUFFERTEST = 0x00200000, /**< (User) Set by the user to warn Render Engine that this object must not test against Z buffer (This override settings of all materials used by this Entity) */
VX_MOVEABLE_INVERSEWORLDMATVALID = 0x00400000, /**< (Engine) Inverse world matrix is not up to date and should be recomputed */
VX_MOVEABLE_DONTUPDATEFROMPARENT = 0x00800000, /**< (User) This object will not be updated by parent (neither World nor Local matrix wil be updated) . This flags can be used by physic engine for example in which hierarchy is not relevant for physicalised objects */
VX_MOVEABLE_INDIRECTMATRIX = 0x01000000, /**< (User/Engine) Set by the engine at load time : The object matrix is in left hand referential, culling needs to be inverted */
VX_MOVEABLE_ZBUFONLY = 0x02000000, /**< (User) The object will only be rendered in depth buffer */
VX_MOVEABLE_STENCILONLY = 0x04000000, /**< (User) The object will only be rendered in stencil buffer */
VX_MOVEABLE_HIERARCHICALHIDE = 0x10000000, /**< (Engine) If Object has this flags and is hidden its children won't be rendered */
VX_MOVEABLE_CHARACTERRENDERED = 0x20000000, /**< (Engine) Set if a character was rendered last frame... */
VX_MOVEABLE_RESERVED2 = 0x40000000, /**< (Engine) */
};
/**
****************************************************************
@briefMesh Flags Options
@remark
+ The VXMESH_FLAGS is used by CKMesh::SetFlags to specify different hints to the render engine about the mesh.
+ Most of this flags can be set or asked using the appropriate method of CKMesh (given between () in the members documentation).
@see CKMesh,CKMesh::SetFlags
***************************************************************
*/
enum class VXMESH_FLAGS : uint32_t {
VXMESH_BOUNDINGUPTODATE = 0x00000001, /**< If set the bounding box is up to date (internal). */
VXMESH_VISIBLE = 0x00000002, /**< If not set the mesh will not be rendered (CKMesh::Show) */
VXMESH_OPTIMIZED = 0x00000004, /**< Set by the render engine if the mesh is optimized for rendering. Unset it to force to recreate optimized structures (when changing materials or face organization ) (CKMesh::VertexMove) */
VXMESH_RENDERCHANNELS = 0x00000008, /**< If not set Additional material channels won't be rendered. */
VXMESH_HASTRANSPARENCY = 0x00000010, /**< If set indicates that one or more of the faces of this mesh use a transparent material (internal) */
VXMESH_PRELITMODE = 0x00000080, /**< If set, no lightning should occur for this mesh, vertex color should be used instead (CKMesh::SetLitMode) */
VXMESH_WRAPU = 0x00000100, /**< Texture coordinates wrapping among u texture coordinates. (CKMesh::SetWrapMode) */
VXMESH_WRAPV = 0x00000200, /**< Texture coordinates wrapping among v texture coordinates. (CKMesh::SetWrapMode) */
VXMESH_FORCETRANSPARENCY = 0x00001000, /**< Forces this mesh to be considered as transparent even if no material is tranparent. (CKMesh::SetTransparent) */
VXMESH_TRANSPARENCYUPTODATE = 0x00002000, /**< If set, the flags VXMESH_HASTRANSPARENCY is up to date. (internal) */
VXMESH_UV_CHANGED = 0x00004000, /**< Must be set if texture coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::UVChanged) */
VXMESH_NORMAL_CHANGED = 0x00008000, /**< Must be set if normal coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::NormalChanged) */
VXMESH_COLOR_CHANGED = 0x00010000, /**< Must be set if colors changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::ColorChanged) */
VXMESH_POS_CHANGED = 0x00020000, /**< Must be set if vertex position changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove) */
VXMESH_HINTDYNAMIC = 0x00040000, /**< Hint for render engine : Mesh geometry is updated frequently */
VXMESH_GENNORMALS = 0x00080000, /**< Hint : Normals were generated by BuildNormals : Do not save (internal) */
VXMESH_PROCEDURALUV = 0x00100000, /**< Hint : UVs are generated : Do not save (internal) */
VXMESH_PROCEDURALPOS = 0x00200000, /**< Hint : Vertices postions are generated : Do not save (internal) */
VXMESH_STRIPIFY = 0x00400000, /**< If set the mesh will be stripified. */
VXMESH_MONOMATERIAL = 0x00800000, /**< Set by the render engine if the mesh use only one material. */
VXMESH_PM_BUILDNORM = 0x01000000, /**< Build normals when performing progressive meshing : Do not save (internal) */
VXMESH_BWEIGHTS_CHANGED = 0x02000000, /**< Must be set if vertex blend weights have changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove) */
VXMESH_ALLFLAGS = 0x007FF39F,
};
/**
************************************************
@brief Specify the way textures or sprites will be saved
@remark
+ Textures can be stored inside Virtools files or kept as references to external files. + Textures can be stored inside Virtools files or kept as references to external files.
+ These options can be used for a specific texture (or sprite) or as a global setting. + These options can be used for a specific texture (or sprite) or as a global setting.
@see CKBitmapData::SetSaveOptions,CKSprite::SetSaveOptions,CKContext::SetGlobalImagesSaveOptions See also: CKBitmapData::SetSaveOptions,CKSprite::SetSaveOptions,CKContext::SetGlobalImagesSaveOptions
**********************************************
*/ */
enum class CK_TEXTURE_SAVEOPTIONS : uint32_t { enum class CK_TEXTURE_SAVEOPTIONS : uint32_t {
CKTEXTURE_RAWDATA = 0, /**< Save raw data inside file. The bitmap is saved in a raw 32 bit per pixel format. */ CKTEXTURE_RAWDATA = 0, /**< Save raw data inside file. The bitmap is saved in a raw 32 bit per pixel format. */
@ -331,14 +266,14 @@ namespace LibCmo::CK2 {
CKTEXTURE_INCLUDEORIGINALFILE = 4, /**< Insert original image file inside CMO file. The bitmap file that was used originally for the texture or sprite will be append to the composition file and extracted when the file is loaded. */ CKTEXTURE_INCLUDEORIGINALFILE = 4, /**< Insert original image file inside CMO file. The bitmap file that was used originally for the texture or sprite will be append to the composition file and extracted when the file is loaded. */
}; };
/** /**
************************************************ {filename:CK_SOUND_SAVEOPTIONS}
@brief Specify the way sounds will be saved Summary: Specify the way sounds will be saved
@remark
Remarks :
+ Sounds can kept as references to external files or the original sound file can + Sounds can kept as references to external files or the original sound file can
be appended to the composition file. be appended to the composition file.
+ These options can be used for a specific sound or as a global setting. + These options can be used for a specific sound or as a global setting.
@see CKSound::SetSaveOptions,CKContext::SetGlobalSoundSaveOptions See also: CKSound::SetSaveOptions,CKContext::SetGlobalSoundSaveOptions
**********************************************
*/ */
enum class CK_SOUND_SAVEOPTIONS : uint32_t { enum class CK_SOUND_SAVEOPTIONS : uint32_t {
CKSOUND_EXTERNAL = 0, /**< Store only the file name for the sound. The sound file must be present in one of the sound paths when the composition is loaded. */ CKSOUND_EXTERNAL = 0, /**< Store only the file name for the sound. The sound file must be present in one of the sound paths when the composition is loaded. */

View File

@ -1,7 +1,6 @@
#pragma once #pragma once
#include "../../VTAll.hpp" #include "../../VTAll.hpp"
#include "../CKBitmapData.hpp"
#include "CKBeObject.hpp" #include "CKBeObject.hpp"
#include <array> #include <array>

View File

@ -0,0 +1,27 @@
#include "CKMesh.hpp"
#include "../CKStateChunk.hpp"
#include "../CKContext.hpp"
#include "CKMaterial.hpp"
namespace LibCmo::CK2::ObjImpls {
CKMesh::CKMesh(CKContext* ctx, CK_ID ckid, CKSTRING name) :
CKBeObject(ctx, ckid, name){}
CKMesh::~CKMesh() {}
bool CKMesh::Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) {
bool suc = CKBeObject::Save(chunk, file, flags);
if (!suc) return false;
return true;
}
bool CKMesh::Load(CKStateChunk* chunk, CKFileVisitor* file) {
bool suc = CKBeObject::Load(chunk, file);
if (!suc) return false;
return true;
}
}

View File

@ -0,0 +1,27 @@
#pragma once
#include "../../VTAll.hpp"
#include "CKBeObject.hpp"
namespace LibCmo::CK2::ObjImpls {
class CKMesh : public CKBeObject {
public:
CKMesh(CKContext* ctx, CK_ID ckid, CKSTRING name);
virtual ~CKMesh();
LIBCMO_DISABLE_COPY_MOVE(CKMesh);
virtual CK_CLASSID GetClassID(void) override {
return CK_CLASSID::CKCID_MESH;
}
//virtual void PreSave(CKFileVisitor* file, CKDWORD flags) override;
virtual bool Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) override;
virtual bool Load(CKStateChunk* chunk, CKFileVisitor* file) override;
//virtual void PostLoad() override;
protected:
};
}

View File

@ -188,6 +188,7 @@
<ClCompile Include="CK2\ObjImpls\CKBeObject.cpp" /> <ClCompile Include="CK2\ObjImpls\CKBeObject.cpp" />
<ClCompile Include="CK2\ObjImpls\CKGroup.cpp" /> <ClCompile Include="CK2\ObjImpls\CKGroup.cpp" />
<ClCompile Include="CK2\ObjImpls\CKMaterial.cpp" /> <ClCompile Include="CK2\ObjImpls\CKMaterial.cpp" />
<ClCompile Include="CK2\ObjImpls\CKMesh.cpp" />
<ClCompile Include="CK2\ObjImpls\CKObject.cpp" /> <ClCompile Include="CK2\ObjImpls\CKObject.cpp" />
<ClCompile Include="CK2\ObjImpls\CKRenderObject.cpp" /> <ClCompile Include="CK2\ObjImpls\CKRenderObject.cpp" />
<ClCompile Include="CK2\ObjImpls\CKSceneObject.cpp" /> <ClCompile Include="CK2\ObjImpls\CKSceneObject.cpp" />
@ -221,6 +222,7 @@
<ClInclude Include="CK2\ObjImpls\CKBeObject.hpp" /> <ClInclude Include="CK2\ObjImpls\CKBeObject.hpp" />
<ClInclude Include="CK2\ObjImpls\CKGroup.hpp" /> <ClInclude Include="CK2\ObjImpls\CKGroup.hpp" />
<ClInclude Include="CK2\ObjImpls\CKMaterial.hpp" /> <ClInclude Include="CK2\ObjImpls\CKMaterial.hpp" />
<ClInclude Include="CK2\ObjImpls\CKMesh.hpp" />
<ClInclude Include="CK2\ObjImpls\CKRenderObject.hpp" /> <ClInclude Include="CK2\ObjImpls\CKRenderObject.hpp" />
<ClInclude Include="CK2\ObjImpls\CKSceneObject.hpp" /> <ClInclude Include="CK2\ObjImpls\CKSceneObject.hpp" />
<ClInclude Include="CK2\ObjImpls\CKTexture.hpp" /> <ClInclude Include="CK2\ObjImpls\CKTexture.hpp" />

View File

@ -126,6 +126,9 @@
<ClCompile Include="CK2\ObjImpls\CKMaterial.cpp"> <ClCompile Include="CK2\ObjImpls\CKMaterial.cpp">
<Filter>Sources\CK2\ObjImpls</Filter> <Filter>Sources\CK2\ObjImpls</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CK2\ObjImpls\CKMesh.cpp">
<Filter>Sources\CK2\ObjImpls</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="VTUtils.hpp"> <ClInclude Include="VTUtils.hpp">
@ -224,5 +227,8 @@
<ClInclude Include="CK2\ObjImpls\CKMaterial.hpp"> <ClInclude Include="CK2\ObjImpls\CKMaterial.hpp">
<Filter>Headers\CK2\ObjImpls</Filter> <Filter>Headers\CK2\ObjImpls</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CK2\ObjImpls\CKMesh.hpp">
<Filter>Headers\CK2\ObjImpls</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -201,4 +201,117 @@ namespace LibCmo::VxMath {
VXEFFECT_MASK = 0xFUL, /**< Mask for all possible values. */ VXEFFECT_MASK = 0xFUL, /**< Mask for all possible values. */
}; };
/**
{filename:VX_MOVEABLE_FLAGS}
Summary: 3dEntity additionnal flags Options
Remarks:
+ The VX_MOVEABLE_FLAGS is used by CK3dEntity::SetMoveableFlags to specify different hints to the render engine about the entity.
+ The (Engine) flags are set by the render engine and should not be modified by user. They can be checked with the CK3dEntity::GetMoveableFlags method.
+ The (User) flags are to be set by the user or can be set by a specific method of CK3dEntity.
See Also: CK3dEntity::SetMoveableFlags
*/
enum class VX_MOVEABLE_FLAGS : uint32_t {
VX_MOVEABLE_PICKABLE = 0x00000001, /**< (User)If not set this entity cannot be returned by CKRenderContext::Pick() or CKRenderContext::RectPict() functions. */
VX_MOVEABLE_VISIBLE = 0x00000002, /**< (Engine) See CKObject::Show,CK3dEntity::IsVisible */
VX_MOVEABLE_UPTODATE = 0x00000004, /**< (Engine) Used to Notify change in the data of the entity. */
VX_MOVEABLE_RENDERCHANNELS = 0x00000008, /**< (User) If not set, additional material channels on the mesh used by this entity won't be rendered (CK3dEntity::SetRenderChannels) */
VX_MOVEABLE_USERBOX = 0x00000010, /**< (Engine) When CK3dEntity::SetBoundingBox is called with a user box, this flag is set. */
VX_MOVEABLE_EXTENTSUPTODATE = 0x00000020, /**< (Engine) Indicate that object 2D extents are up to date */
VX_MOVEABLE_BOXVALID = 0x00004000, /**< (Engine) If not set the moveable has no mesh associated so its bounding box is irrelevant (a point). */
VX_MOVEABLE_RENDERLAST = 0x00010000, /**< (User) If set the moveable will be rendered with the transparent objects (i.e in last) (CK3dEntity::SetRenderAsTransparent) */
VX_MOVEABLE_HASMOVED = 0x00020000, /**< (Engine) Set when its position or orientation has changed. (Reset every frame when rendering starts) */
VX_MOVEABLE_WORLDALIGNED = 0x00040000, /**< (User) Hint for render engine : this object is aligned with world position and orientation. */
VX_MOVEABLE_NOZBUFFERWRITE = 0x00080000, /**< (User) Set by the user to warn Render Engine that this object must not write information to Z buffer */
VX_MOVEABLE_RENDERFIRST = 0x00100000, /**< (User) If set the moveable will be rendered within the firsts objects */
VX_MOVEABLE_NOZBUFFERTEST = 0x00200000, /**< (User) Set by the user to warn Render Engine that this object must not test against Z buffer (This override settings of all materials used by this Entity) */
VX_MOVEABLE_INVERSEWORLDMATVALID = 0x00400000, /**< (Engine) Inverse world matrix is not up to date and should be recomputed */
VX_MOVEABLE_DONTUPDATEFROMPARENT = 0x00800000, /**< (User) This object will not be updated by parent (neither World nor Local matrix wil be updated) . This flags can be used by physic engine for example in which hierarchy is not relevant for physicalised objects */
VX_MOVEABLE_INDIRECTMATRIX = 0x01000000, /**< (User/Engine) Set by the engine at load time : The object matrix is in left hand referential, culling needs to be inverted */
VX_MOVEABLE_ZBUFONLY = 0x02000000, /**< (User) The object will only be rendered in depth buffer */
VX_MOVEABLE_STENCILONLY = 0x04000000, /**< (User) The object will only be rendered in stencil buffer */
VX_MOVEABLE_HIERARCHICALHIDE = 0x10000000, /**< (Engine) If Object has this flags and is hidden its children won't be rendered */
VX_MOVEABLE_CHARACTERRENDERED = 0x20000000, /**< (Engine) Set if a character was rendered last frame... */
VX_MOVEABLE_RESERVED2 = 0x40000000, /**< (Engine) */
};
/**
{filename:VXMESH_FLAGS}
Summary:Mesh Flags Options
Remarks:
+ The VXMESH_FLAGS is used by CKMesh::SetFlags to specify different hints to the render engine about the mesh.
+ Most of this flags can be set or asked using the appropriate method of CKMesh (given between () in the members documentation).
See Also: CKMesh,CKMesh::SetFlags
*/
enum class VXMESH_FLAGS : uint32_t {
VXMESH_BOUNDINGUPTODATE = 0x00000001, /**< If set the bounding box is up to date (internal). */
VXMESH_VISIBLE = 0x00000002, /**< If not set the mesh will not be rendered (CKMesh::Show) */
VXMESH_OPTIMIZED = 0x00000004, /**< Set by the render engine if the mesh is optimized for rendering. Unset it to force to recreate optimized structures (when changing materials or face organization ) (CKMesh::VertexMove) */
VXMESH_RENDERCHANNELS = 0x00000008, /**< If not set Additional material channels won't be rendered. */
VXMESH_HASTRANSPARENCY = 0x00000010, /**< If set indicates that one or more of the faces of this mesh use a transparent material (internal) */
VXMESH_PRELITMODE = 0x00000080, /**< If set, no lightning should occur for this mesh, vertex color should be used instead (CKMesh::SetLitMode) */
VXMESH_WRAPU = 0x00000100, /**< Texture coordinates wrapping among u texture coordinates. (CKMesh::SetWrapMode) */
VXMESH_WRAPV = 0x00000200, /**< Texture coordinates wrapping among v texture coordinates. (CKMesh::SetWrapMode) */
VXMESH_FORCETRANSPARENCY = 0x00001000, /**< Forces this mesh to be considered as transparent even if no material is tranparent. (CKMesh::SetTransparent) */
VXMESH_TRANSPARENCYUPTODATE = 0x00002000, /**< If set, the flags VXMESH_HASTRANSPARENCY is up to date. (internal) */
VXMESH_UV_CHANGED = 0x00004000, /**< Must be set if texture coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::UVChanged) */
VXMESH_NORMAL_CHANGED = 0x00008000, /**< Must be set if normal coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::NormalChanged) */
VXMESH_COLOR_CHANGED = 0x00010000, /**< Must be set if colors changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::ColorChanged) */
VXMESH_POS_CHANGED = 0x00020000, /**< Must be set if vertex position changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove) */
VXMESH_HINTDYNAMIC = 0x00040000, /**< Hint for render engine : Mesh geometry is updated frequently */
VXMESH_GENNORMALS = 0x00080000, /**< Hint : Normals were generated by BuildNormals : Do not save (internal) */
VXMESH_PROCEDURALUV = 0x00100000, /**< Hint : UVs are generated : Do not save (internal) */
VXMESH_PROCEDURALPOS = 0x00200000, /**< Hint : Vertices postions are generated : Do not save (internal) */
VXMESH_STRIPIFY = 0x00400000, /**< If set the mesh will be stripified. */
VXMESH_MONOMATERIAL = 0x00800000, /**< Set by the render engine if the mesh use only one material. */
VXMESH_PM_BUILDNORM = 0x01000000, /**< Build normals when performing progressive meshing : Do not save (internal) */
VXMESH_BWEIGHTS_CHANGED = 0x02000000, /**< Must be set if vertex blend weights have changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove) */
VXMESH_ALLFLAGS = 0x007FF39F,
};
/**
{filename:VXMESH_LITMODE}
Summary: Mesh lighting options
Remarks:
+ The VXMESH_LITMODE is used by CKMesh::SetLitMode to specify how lighting is done.
See Also: CKMaterial,CKMesh
*/
enum class VXMESH_LITMODE : uint32_t {
VX_PRELITMESH = 0, /**< Lighting use color information store with vertices */
VX_LITMESH = 1, /**< Lighting is done by renderer using normals and face material information. */
};
/**
{filename:VXCHANNEL_FLAGS}
Summary:Mesh additionnal material channel options
Remarks:
+ The VXCHANNEL_FLAGS is used by CKMesh::SetChannelFlags to give the behavior of
an additional material channel.
See Also: CKMesh,CKMesh::AddChannel,CKMesh::IsChannelLit,CKMesh::IsChannelActive
*/
enum class VXCHANNEL_FLAGS : uint32_t {
VXCHANNEL_ACTIVE = 0x00000001, /**< This channel is active */
VXCHANNEL_SAMEUV = 0x00800000, /**< This channel should use the texture coordinates of the base mesh. */
VXCHANNEL_NOTLIT = 0x01000000, /**< Additionnal Material Channel should not be lit (some channels may not be rendered in one pass with this option) */
VXCHANNEL_MONO = 0x02000000, /**< Set at runtime by render engine to indicate whether this channel was rendered using multiple pass or not.(Dot Not Modify) */
VXCHANNEL_RESERVED1 = 0x04000000, /**< Reserved for internal use */
VXCHANNEL_LAST = 0x08000000, /**< Set at runtime by render engine to indicate this channel isthe last to be rendered. Dot Not Modify */
};
/**
{filename:VXTEXTURE_WRAPMODE}
Summary: Wrapping Flags
Remarks:
+ The VXTEXTURE_WRAPMODE is used by CKMesh::SetWrapMode() to specify how
texture coordinates are interpolated.
See Also: Using Materials,CKMaterial,CKMesh::SetWrapMode.
*/
enum class VXTEXTURE_WRAPMODE : uint32_t {
VXTEXTUREWRAP_NONE = 0x00000000, /**< Flat texture addressing */
VXTEXTUREWRAP_U = 0x00000001, /**< Vertical cylinder mapping */
VXTEXTUREWRAP_V = 0x00000002, /**< Horizontal cylinder mapping */
VXTEXTUREWRAP_UV = 0x00000003, /**< Spherical mapping */
};
} }