]> git.lizzy.rs Git - minetest.git/blob - src/dummymap.h
Add lighting test and benchmark (#12802)
[minetest.git] / src / dummymap.h
1 /*
2 Minetest
3 Copyright (C) 2022 TurkeyMcMac, Jude Melton-Houghton <jwmhjwmh@gmail.com>
4
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.
9
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.
14
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.
18 */
19
20 #pragma once
21
22 #include "map.h"
23 #include "mapsector.h"
24
25 class DummyMap : public Map
26 {
27 public:
28         DummyMap(IGameDef *gamedef, v3s16 bpmin, v3s16 bpmax): Map(gamedef)
29         {
30                 for (s16 z = bpmin.Z; z <= bpmax.Z; z++)
31                 for (s16 x = bpmin.X; x <= bpmax.X; x++) {
32                         v2s16 p2d(x, z);
33                         MapSector *sector = new MapSector(this, p2d, gamedef);
34                         m_sectors[p2d] = sector;
35                         for (s16 y = bpmin.Y; y <= bpmax.Y; y++)
36                                 sector->createBlankBlock(y);
37                 }
38         }
39
40         ~DummyMap() = default;
41
42         bool maySaveBlocks() override { return false; }
43 };