1 /**********************************************************************************
2 * Copyright (c) 2008, 2009 Derek Yu and Mossmouth, LLC
3 * Copyright (c) 2018, Ketmar Dark
5 * This file is part of Spelunky.
7 * You can redistribute and/or modify Spelunky, including its source code, under
8 * the terms of the Spelunky User License.
10 * Spelunky is distributed in the hope that it will be entertaining and useful,
11 * but WITHOUT WARRANTY. Please see the Spelunky User License for more details.
13 * The Spelunky User License should be available in "Game Information", which
14 * can be found in the Resource Explorer, or as an external file called COPYING.
15 * If not, please obtain a new copy of Spelunky from <http://spelunkyworld.com/>
17 **********************************************************************************/
18 class MapBackTile : MapEntity;
20 transient BackTileImage bgt;
22 // tile coords in `bgt`
26 //WARNING! destroying back tile WILL BREAK A LIST
27 MapBackTile next; // in various lists
29 override int width () { return w; }
30 override int height () { return h; }
33 override void onLoaded () {
36 //writeln("BGT: ", bgtName);
37 bgt = level.bgtileStore[bgtName];
42 override void drawWithOfs (int xpos, int ypos, int scale, float currFrameDelta) {
43 if (w < 1 || h < 1 || scale < 1) return;
46 bgt.tex.blitExt(xpos, ypos, xpos+w*scale, ypos+h*scale, tx0, ty0, tx0+w, ty0+h);
51 objName = 'oBackTile';
52 objType = 'oBackTile';
53 depth = 10100; // > is further