BUG-REPORTING: Restructure for relevance.
[Ale.git] / optimizations.h
bloba83439a655c8ea35d07708bd788e5182cee7324e
1 // Copyright 2002, 2003, 2004 David Hilvert <dhilvert@auricle.dyndns.org>,
2 // <dhilvert@ugcs.caltech.edu>
4 /* This file is part of the Anti-Lamenessing Engine.
6 The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with the Anti-Lamenessing Engine; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __optimizations_h__
22 #define __optimizations_h__
25 * Class for implementing certain optimizations
28 class optimizations {
29 public:
32 * Clean up any structures not required for Irani-Peleg rendering.
34 static void ip_sources_obtained(d2::render *ip_instance) {
35 #if OPTIMIZATIONS == 1
37 * Delete all rendering structures aside from Irani-Peleg.
40 for (int n = 0; n < d2::render::render_count(); n++) {
41 if (n == ip_instance->entry())
42 continue;
44 d2::render::free_entry(n);
46 #endif
50 * When starting work on the 3D scene, get rid of memory allocated
51 * for 2D rendering chains.
53 static void begin_3d_work() {
54 #if OPTIMIZATIONS == 1
55 d2::render::free_all_memory();
56 #endif
61 #endif