Permalink
Browse files

2006-08-14 Andrew Sayman <lorien420@myrealbox.com>

	* src/gtk-gui/persist.cxx, src/Game.h, src/ComputerPlayer.cxx,
	src/ComputerPlayerAI.cxx, src/Displayer.cxx: Previous "using namespace std;"
	clean up missed some of the debug-only usages. The biggest violators were
	the output macros defined in Game.h.
	* src/ComputerPlayerAI.cxx: Removed remnants of more_gray since it's not
	used at all anymore. Put back gray_height because it is used in debug mode.
  • Loading branch information...
1 parent be7ccfe commit 20a7560055b90c1603774d09b9d68b3cfa1a3c84 Andrew Sayman committed Aug 14, 2006
Showing with 36 additions and 27 deletions.
  1. +9 −0 ChangeLog
  2. +3 −3 src/ComputerPlayer.cxx
  3. +2 −4 src/ComputerPlayerAI.cxx
  4. +3 −3 src/Displayer.cxx
  5. +17 −16 src/Game.h
  6. +2 −1 src/gtk-gui/persist.cxx
View
@@ -1,3 +1,12 @@
+2006-08-14 Andrew Sayman <lorien420@myrealbox.com>
+
+ * src/gtk-gui/persist.cxx, src/Game.h, src/ComputerPlayer.cxx,
+ src/ComputerPlayerAI.cxx, src/Displayer.cxx: Previous "using namespace std;"
+ clean up missed some of the debug-only usages. The biggest violators were
+ the output macros defined in Game.h.
+ * src/ComputerPlayerAI.cxx: Removed remnants of more_gray since it's not
+ used at all anymore. Put back gray_height because it is used in debug mode.
+
2006-08-13 Bjørn Lindeijer <bjorn@lindeijer.nl>
* src/String.cxx, src/obj_clock.cxx, src/obj_sign.cxx, data/*,
View
@@ -75,9 +75,9 @@ void ComputerPlayer::timeStep()
if (Game::time_step >= localAi.alarm()) {
localAi.garbageAmount()->sendToGenerator();
#ifndef NDEBUG
- cout << "init pop: " << GC_INITIAL_POP_DELAY << endl;
- cout << "steps per second: " << GC_STEPS_PER_SECOND << endl;
- cout << "Height: " << ai->garbageQueue()->height() << endl;
+ std::cout << "init pop: " << GC_INITIAL_POP_DELAY << std::endl;
+ std::cout << "steps per second: " << GC_STEPS_PER_SECOND << std::endl;
+ std::cout << "Height: " << ai->garbageQueue()->height() << std::endl;
#endif
localAi.resetAlarm();
MESSAGE("AI will drop again in " << ((localAi.alarm() - Game::time_step) / GC_STEPS_PER_SECOND) << " seconds");
View
@@ -107,11 +107,9 @@ GarbageQueue *ComputerPlayerAI::garbageAmount( )
int norm_div = num_normals / 3;
int norm_mod = num_normals % 3;
- //int more_gray = norm_mod / 2;
- LOG("div: " << norm_div << " mod: " << norm_mod << " gray: " << more_gray);
+ LOG("div: " << norm_div << " mod: " << norm_mod);
if (norm_div > 0) q->add(norm_div, 6, GF_NORMAL);
loopi(norm_mod) q->add(1, 6, GF_NORMAL);
- //loopi(more_gray) q->add(1, 6, GF_GRAY);
shatter();
return q;
@@ -122,7 +120,7 @@ void ComputerPlayerAI::shatter()
MESSAGE("Resetting garbageQueue " << garbageQueue()->height());
if (garbageQueue()->height() > 0) {
state = AI_SHATTERING;
- //int gray_height = garbageQueue()->specialHeight();
+ int gray_height = garbageQueue()->specialHeight();
last_shatter_height = garbageQueue()->removeWithSpecials();
MESSAGE(last_shatter_height << " shattered and " << garbageQueue()->height() << " remaining grays:" << gray_height);
loopi(last_shatter_height) {
View
@@ -407,9 +407,9 @@ void Displayer::screenShot ( )
glReadPixels(0, 0, screen_length, screen_length, GL_RGBA, GL_UNSIGNED_BYTE,
image);
- ostringstream file_name;
- file_name << DC_SCREEN_SHOT_FILE_NAME_BASE "_" << setw(GC_GARBAGE_TEX_NUMBER_DIGITS)
- << setfill('0') << count << ".tga" << ends;
+ std::ostringstream file_name;
+ file_name << DC_SCREEN_SHOT_FILE_NAME_BASE "_" << std::setw(GC_GARBAGE_TEX_NUMBER_DIGITS)
+ << std::setfill('0') << count << ".tga" << std::ends;
TextureLoader::createTGA(file_name.str().c_str(), image, screen_length, screen_length,
TL_SCREEN_SHOT_TGA_ID);
View
@@ -286,37 +286,38 @@
# define COLOR(n) ""
# define NOCOLOR ""
# endif
-# define DOT(n) { cerr << COLOR(37 - n) \
- << "." NOCOLOR << flush; }
-# define DUMP(a) { cerr << COLOR(32) << "Dump: " \
+# define DOT(n) { std::cerr << COLOR(37 - n) \
+ << "." NOCOLOR << std::flush; }
+# define DUMP(a) { std::cerr << COLOR(32) << "Dump: " \
__FILE__ ":" << __LINE__ << ": " \
NOCOLOR #a \
- " = " << (a) << endl; }
+ " = " << (a) << std::endl; }
# define PERIODIC_DUMP(a, b) { if (!(Game::time_step % a)) \
- cerr << COLOR(32) << "Dump: " \
+ std::cerr << COLOR(32) << "Dump: " \
__FILE__ ":" << __LINE__ << ": " \
NOCOLOR #b \
- " = " << (b) << endl; }
-# define MESSAGE(a) { cerr << COLOR(33) << "Mesg: " \
+ " = " << (b) << std::endl; }
+# define MESSAGE(a) { std::cerr << COLOR(33) << "Mesg: " \
__FILE__ ":" << __LINE__ << ": " \
- NOCOLOR << a << endl; }
+ NOCOLOR << a << std::endl; }
# ifndef _WIN32
-# define MARK() { cerr << COLOR(35) << "Mark: " \
+# define MARK() { std::cerr << COLOR(35) << "Mark: " \
__FILE__ ":" << __LINE__ << ": " \
<< __PRETTY_FUNCTION__ << NOCOLOR \
- << endl; }
+ << std::endl; }
# else
-# define MARK() { cerr << COLOR(35) << "Mark: " \
+# define MARK() { std::cerr << COLOR(35) << "Mark: " \
__FILE__ ":" << __LINE__ << ":" \
- NOCOLOR << endl; }
+ NOCOLOR << std::endl; }
# endif
-# define ENDL() { cerr << COLOR(34) << "Endl: " \
+# define ENDL() { std::cerr << COLOR(34) << "Endl: " \
__FILE__ ":" << __LINE__ << ":" \
- NOCOLOR << endl; }
-# define LOG(a) { ofstream log("log", ios::app); \
+ NOCOLOR << std::endl; }
+# define LOG(a) { std::ofstream log("log", \
+ std::ios::app); \
log << "Log: " __FILE__ ":" \
<< __LINE__ << ": " << a \
- << endl; }
+ << std::endl; }
#else
# define DOT(n) ((void) 0)
# define DUMP(a) ((void) 0)
View
@@ -3,6 +3,7 @@
* Kevin Webb - 3/21/05
*
* Copyright (C) 2005 Kevin Webb
+ * Copyright (C) 2006 Andrew Sayman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -99,7 +100,7 @@ gui_data_read (GtkWidget *widget)
std::ifstream file(file_name);
if (file.fail()) {
#ifdef DEVELOPMENT
- cerr << "Unable to find gui data file!\n";
+ std::cerr << "Unable to find gui data file!\n";
#endif
return;
}

0 comments on commit 20a7560

Please sign in to comment.