Skip to content

Commit

Permalink
2006-08-14 Andrew Sayman <lorien420@myrealbox.com>
Browse files Browse the repository at this point in the history
	* 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
Andrew Sayman committed Aug 14, 2006
1 parent be7ccfe commit 20a7560
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 27 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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/*,
Expand Down
6 changes: 3 additions & 3 deletions src/ComputerPlayer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 2 additions & 4 deletions src/ComputerPlayerAI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/Displayer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
33 changes: 17 additions & 16 deletions src/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/gtk-gui/persist.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 20a7560

Please sign in to comment.