3 Copyright (C) 2018 numzero, Lobachevskiy Vitaliy <numzer0@yandex.ru>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "irrlichttypes.h"
24 #include <S3DVertex.h>
25 #include "client/tile.h"
30 std::vector<u16> indices;
31 std::vector<video::S3DVertex> vertices;
33 PreMeshBuffer() = default;
34 explicit PreMeshBuffer(const TileLayer &layer) : layer(layer) {}
39 std::array<std::vector<PreMeshBuffer>, MAX_TILE_LAYERS> prebuffers;
42 void append(const TileSpec &material,
43 const video::S3DVertex *vertices, u32 numVertices,
44 const u16 *indices, u32 numIndices);
45 void append(const TileSpec &material,
46 const video::S3DVertex *vertices, u32 numVertices,
47 const u16 *indices, u32 numIndices,
48 v3f pos, video::SColor c, u8 light_source);
53 void append(const TileLayer &material,
54 const video::S3DVertex *vertices, u32 numVertices,
55 const u16 *indices, u32 numIndices,
56 u8 layernum, bool use_scale = false);
57 void append(const TileLayer &material,
58 const video::S3DVertex *vertices, u32 numVertices,
59 const u16 *indices, u32 numIndices,
60 v3f pos, video::SColor c, u8 light_source,
61 u8 layernum, bool use_scale = false);
64 PreMeshBuffer &findBuffer(const TileLayer &layer, u8 layernum, u32 numVertices);