Files
yugioh-legacy-engine/server/irrlicht/include/IDynamicMeshBuffer.h
T
donnyandClaude Fable 5.1 da27435cdb server: import the duel server (nanahira/ygopro server at 52c868ce)
The server tree of https://code.moenext.com/nanahira/ygopro.git, branch
server, commit 52c868ce071ea0f2fcb0cf39bf2fb4151d12b90c, stock: gframe/,
premake5.lua, .ci/, LICENSE, and gframe/ygopro.rc + .ico (upstream keeps
them in resource/ and copies them in before building). No game assets, no
scripts, no ocgcore submodule: the core is ../core.

The third-party sources upstream's Windows CI downloads are vendored here
at the positions its premake expects, each with its premake fragment from
upstream's premake/ folder inside it: lua 5.4.8, sqlite 3.53.3, libevent
2.1.13-stable (tests, samples and autotools helpers left out; the files
its Windows prebuild copies into include/ left out), zlib 1.3.2 (contrib
and examples left out), xz 5.8.3 (src/liblzma + src/common only), and
irrlicht 1.9 from mycard at 20f86d25: include/ plus the source/Irrlicht
headers and the 11 .cpp files the server's zip reader project compiles.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:21 -07:00

188 lines
5.3 KiB
C++

// Copyright (C) 2008-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef IRR_I_DYNAMIC_MESH_BUFFER_H_INCLUDED
#define IRR_I_DYNAMIC_MESH_BUFFER_H_INCLUDED
#include "IMeshBuffer.h"
#include "IVertexBuffer.h"
#include "IIndexBuffer.h"
namespace irr
{
namespace scene
{
/** a dynamic meshBuffer */
class IDynamicMeshBuffer : public IMeshBuffer
{
public:
virtual IVertexBuffer &getVertexBuffer() const =0;
virtual IIndexBuffer &getIndexBuffer() const =0;
virtual void setVertexBuffer(IVertexBuffer *vertexBuffer) =0;
virtual void setIndexBuffer(IIndexBuffer *indexBuffer) =0;
// ------------------- Old interface ------------------- //
// That stuff could also be in CDynamicMeshBuffer
// I suppose it was put here to show that the information
// is now basically handled by the vertex/index buffers instead
// of the meshbuffer itself.
//! get the current hardware mapping hint
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const IRR_OVERRIDE
{
return getVertexBuffer().getHardwareMappingHint();
}
//! get the current hardware mapping hint
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const IRR_OVERRIDE
{
return getIndexBuffer().getHardwareMappingHint();
}
//! set the hardware mapping hint, for driver
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) IRR_OVERRIDE
{
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
getVertexBuffer().setHardwareMappingHint(NewMappingHint);
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
getIndexBuffer().setHardwareMappingHint(NewMappingHint);
}
//! flags the mesh as changed, reloads hardware buffers
virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) IRR_OVERRIDE
{
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
getVertexBuffer().setDirty();
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
getIndexBuffer().setDirty();
}
virtual u32 getChangedID_Vertex() const IRR_OVERRIDE
{
return getVertexBuffer().getChangedID();
}
virtual u32 getChangedID_Index() const IRR_OVERRIDE
{
return getIndexBuffer().getChangedID();
}
//! Get type of vertex data which is stored in this meshbuffer.
/** \return Vertex type of this buffer. */
virtual video::E_VERTEX_TYPE getVertexType() const IRR_OVERRIDE
{
return getVertexBuffer().getType();
}
//! Get access to vertex data. The data is an array of vertices.
/** Which vertex type is used can be determined by getVertexType().
\return Pointer to array of vertices. */
virtual const void* getVertices() const IRR_OVERRIDE
{
return getVertexBuffer().getData();
}
//! Get access to vertex data. The data is an array of vertices.
/** Which vertex type is used can be determined by getVertexType().
\return Pointer to array of vertices. */
virtual void* getVertices() IRR_OVERRIDE
{
return getVertexBuffer().getData();
}
//! Get amount of vertices in meshbuffer.
/** \return Number of vertices in this buffer. */
virtual u32 getVertexCount() const IRR_OVERRIDE
{
return getVertexBuffer().size();
}
//! Get type of index data which is stored in this meshbuffer.
/** \return Index type of this buffer. */
virtual video::E_INDEX_TYPE getIndexType() const IRR_OVERRIDE
{
return getIndexBuffer().getType();
}
//! Get access to indices.
/** \return Pointer to indices array. */
virtual const u16* getIndices() const IRR_OVERRIDE
{
return (u16*)getIndexBuffer().getData();
}
//! Get access to indices.
/** \return Pointer to indices array. */
virtual u16* getIndices() IRR_OVERRIDE
{
return (u16*)getIndexBuffer().getData();
}
//! Get amount of indices in this meshbuffer.
/** \return Number of indices in this buffer. */
virtual u32 getIndexCount() const IRR_OVERRIDE
{
return getIndexBuffer().size();
}
//! returns position of vertex i
virtual const core::vector3df& getPosition(u32 i) const IRR_OVERRIDE
{
return getVertexBuffer()[i].Pos;
}
//! returns position of vertex i
virtual core::vector3df& getPosition(u32 i) IRR_OVERRIDE
{
return getVertexBuffer()[i].Pos;
}
//! returns texture coords of vertex i
virtual const core::vector2df& getTCoords(u32 i) const IRR_OVERRIDE
{
return getVertexBuffer()[i].TCoords;
}
//! returns texture coords of vertex i
virtual core::vector2df& getTCoords(u32 i) IRR_OVERRIDE
{
return getVertexBuffer()[i].TCoords;
}
//! returns normal of vertex i
virtual const core::vector3df& getNormal(u32 i) const IRR_OVERRIDE
{
return getVertexBuffer()[i].Normal;
}
//! returns normal of vertex i
virtual core::vector3df& getNormal(u32 i) IRR_OVERRIDE
{
return getVertexBuffer()[i].Normal;
}
//! returns color of vertex i
virtual video::SColor& getColor(u32 i) IRR_OVERRIDE
{
return getVertexBuffer()[i].Color;
}
//! returns color of vertex i
virtual const video::SColor& getColor(u32 i) const IRR_OVERRIDE
{
return getVertexBuffer()[i].Color;
}
};
} // end namespace scene
} // end namespace irr
#endif