src/util/reader.cpp

Go to the documentation of this file.
00001 /*
00002  * src/util/reader.cpp - Utility functions for config handling.
00003  * Copyright (C) 2010  Florian Forster
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License along
00016  * with this program; if not, write to the Free Software Foundation, Inc.,
00017  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018  *
00019  * Authors:
00020  *   Florian "octo" Forster <supertux at octo.it>
00021  */
00022 
00023 #include "util/reader.hpp"
00024 #include "video/drawing_request.hpp" /* LAYER_GUI */
00025 
00026 int reader_get_layer (const Reader& reader, int def)
00027 {
00028   int tmp = 0;
00029   bool status;
00030 
00031   status = reader.get ("z-pos", tmp);
00032 
00033   if (!status)
00034     status = reader.get ("layer", tmp);
00035 
00036   if (!status)
00037     tmp = def;
00038 
00039   if (tmp > (LAYER_GUI - 100))
00040     tmp = LAYER_GUI - 100;
00041 
00042   return (tmp);
00043 } /* int reader_get_layer */
00044 
00045 /* vim: set sw=2 et sts=2 : */

Generated on Mon Jun 9 03:38:23 2014 for SuperTux by  doxygen 1.5.1