[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3727 - in trunk/pingus: . src src/components
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3727 - in trunk/pingus: . src src/components |
Date: |
Tue, 8 Jul 2008 04:39:13 +0200 |
Author: grumbel
Date: 2008-07-08 04:39:11 +0200 (Tue, 08 Jul 2008)
New Revision: 3727
Removed:
trunk/pingus/src/cheat.cpp
trunk/pingus/src/cheat.hpp
Modified:
trunk/pingus/SConstruct
trunk/pingus/src/action_holder.cpp
trunk/pingus/src/components/action_button.cpp
trunk/pingus/src/config.cpp
trunk/pingus/src/pingus_main.cpp
Log:
Removed cheat handling
Modified: trunk/pingus/SConstruct
===================================================================
--- trunk/pingus/SConstruct 2008-07-08 02:35:03 UTC (rev 3726)
+++ trunk/pingus/SConstruct 2008-07-08 02:39:11 UTC (rev 3727)
@@ -49,7 +49,6 @@
'src/addon_menu.cpp',
'src/blitter.cpp',
'src/capture_rectangle.cpp',
-'src/cheat.cpp',
'src/collision_map.cpp',
'src/collider.cpp',
'src/config_manager.cpp',
Modified: trunk/pingus/src/action_holder.cpp
===================================================================
--- trunk/pingus/src/action_holder.cpp 2008-07-08 02:35:03 UTC (rev 3726)
+++ trunk/pingus/src/action_holder.cpp 2008-07-08 02:39:11 UTC (rev 3727)
@@ -18,7 +18,6 @@
#include "pingus_level.hpp"
#include "pingu_action_factory.hpp"
#include "action_holder.hpp"
-#include "cheat.hpp"
using namespace Actions;
@@ -57,30 +56,22 @@
void
ActionHolder::push_action (ActionName name)
{
- if (!Cheat::unlimited_actions)
- available_actions[name]++;
+ available_actions[name]++;
}
bool
ActionHolder::pop_action (ActionName name)
{
- if (Cheat::unlimited_actions)
+ int& avail = available_actions[name];
+
+ if (avail > 0)
{
+ --avail;
return true;
}
else
{
- int& avail = available_actions[name];
-
- if (avail > 0)
- {
- --avail;
- return true;
- }
- else
- {
- return false;
- }
+ return false;
}
}
Deleted: trunk/pingus/src/cheat.cpp
===================================================================
--- trunk/pingus/src/cheat.cpp 2008-07-08 02:35:03 UTC (rev 3726)
+++ trunk/pingus/src/cheat.cpp 2008-07-08 02:39:11 UTC (rev 3727)
@@ -1,66 +0,0 @@
-// Pingus - A free Lemmings clone
-// Copyright (C) 2002 Ingo Ruhnke <address@hidden>
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#include <iostream>
-#include <stdlib.h>
-#include "pingus_error.hpp"
-#include "cheat.hpp"
-
-bool Cheat::unlimited_actions = false;
-bool Cheat::no_time_limit = false;
-bool Cheat::all_actions = false;
-
-void
-Cheat::activate(const std::string& cheat)
-{
- if (cheat == "unlimited-actions" || cheat == "ua")
- {
- unlimited_actions = true;
- }
- else if (cheat == "all-actions" || cheat == "aa")
- {
- all_actions = true;
- unlimited_actions = true;
- }
- else if (cheat == "no-time-limit" || cheat == "nt")
- {
- no_time_limit = true;
- }
- else if (cheat == "help")
- {
- print_help();
- }
- else
- {
- PingusError::raise("Cheat: Unknown cheat '" + cheat + "'");
- }
-}
-
-void
-Cheat::print_help()
-{
- std::cout
- << "Pingus Cheats\n"
- << "-------------\n"
- << " unlimited-actions(ua) - the number of available actions is not
limited\n"
- << " all-actions(aa) - all actions are available in all levels and
unlimited\n"
- << " no-time-limit(nt) - time limit is disabled everywhere\n"
- << std::endl;
-
- exit(EXIT_SUCCESS);
-}
-
-/* EOF */
Deleted: trunk/pingus/src/cheat.hpp
===================================================================
--- trunk/pingus/src/cheat.hpp 2008-07-08 02:35:03 UTC (rev 3726)
+++ trunk/pingus/src/cheat.hpp 2008-07-08 02:39:11 UTC (rev 3727)
@@ -1,43 +0,0 @@
-// Pingus - A free Lemmings clone
-// Copyright (C) 2002 Ingo Ruhnke <address@hidden>
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef HEADER_PINGUS_CHEAT_HPP
-#define HEADER_PINGUS_CHEAT_HPP
-
-#include <string>
-
-/** */
-namespace Cheat
-{
-/** unlimited actions are available */
-extern bool unlimited_actions;
-
-/** no timelimit for all levels */
-extern bool no_time_limit;
-
-/** all actions are available in all levels */
-extern bool all_actions;
-
-/** Activate the given cheat */
-void activate(const std::string&);
-
-/** Print a list off possible cheats to stdout */
-void print_help();
-}
-
-#endif
-
-/* EOF */
Modified: trunk/pingus/src/components/action_button.cpp
===================================================================
--- trunk/pingus/src/components/action_button.cpp 2008-07-08 02:35:03 UTC
(rev 3726)
+++ trunk/pingus/src/components/action_button.cpp 2008-07-08 02:39:11 UTC
(rev 3727)
@@ -15,7 +15,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../globals.hpp"
-#include "../cheat.hpp"
#include "action_button.hpp"
#include "../server.hpp"
#include "../game_session.hpp"
Modified: trunk/pingus/src/config.cpp
===================================================================
--- trunk/pingus/src/config.cpp 2008-07-08 02:35:03 UTC (rev 3726)
+++ trunk/pingus/src/config.cpp 2008-07-08 02:39:11 UTC (rev 3727)
@@ -21,7 +21,6 @@
#include "pingus_error.hpp"
#include "config.hpp"
#include "system.hpp"
-#include "cheat.hpp"
#include "gettext.h"
@@ -319,10 +318,6 @@
{
maintainer_mode = str_to_bool(value);
}
- else if (valueid == "unlimited-actions")
- {
- Cheat::unlimited_actions = str_to_bool(value);
- }
else if (valueid == "auto-scrolling")
{
auto_scrolling = str_to_bool(value);
Modified: trunk/pingus/src/pingus_main.cpp
===================================================================
--- trunk/pingus/src/pingus_main.cpp 2008-07-08 02:35:03 UTC (rev 3726)
+++ trunk/pingus/src/pingus_main.cpp 2008-07-08 02:39:11 UTC (rev 3727)
@@ -54,7 +54,6 @@
#include "command_line.hpp"
#include "screen/screen_manager.hpp"
-// #include "gui/input_debug_screen.hpp"
#include "path_manager.hpp"
#include "pingus_main.hpp"
#include "globals.hpp"
@@ -69,18 +68,13 @@
#include "start_screen.hpp"
#include "savegame_manager.hpp"
#include "stat_manager.hpp"
-// #include "demo_session.hpp"
#include "debug.hpp"
-//#include "fonts.hpp"
#include "pingus_menu_manager.hpp"
#include "resource.hpp"
#include "pingu_action_factory.hpp"
#include "credits.hpp"
#include "sound/sound.hpp"
#include "worldmap/worldmap_screen.hpp"
-#include "cheat.hpp"
-// #include "blitter_test.hpp"
-// #include "preview_renderer.hpp"
#include "font_test_screen.hpp"
#include "worldmap/worldmap_screen.hpp"
#include "worldobj_factory.hpp"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3727 - in trunk/pingus: . src src/components,
grumbel at BerliOS <=