[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2948 - in branches/pingus_sdl: . src
From: |
jsalmon3 |
Subject: |
[Pingus-CVS] r2948 - in branches/pingus_sdl: . src |
Date: |
Thu, 16 Aug 2007 04:23:58 +0200 |
Author: jsalmon3
Date: 2007-08-16 04:23:51 +0200 (Thu, 16 Aug 2007)
New Revision: 2948
Modified:
branches/pingus_sdl/TODO
branches/pingus_sdl/src/demo_recorder.cpp
branches/pingus_sdl/src/server_event.cpp
branches/pingus_sdl/src/server_event.hpp
Log:
Converted demo from xml to sexpr
Modified: branches/pingus_sdl/TODO
===================================================================
--- branches/pingus_sdl/TODO 2007-08-16 02:08:50 UTC (rev 2947)
+++ branches/pingus_sdl/TODO 2007-08-16 02:23:51 UTC (rev 2948)
@@ -67,8 +67,6 @@
- finishing the last level doesn't show the credits screen after the story
-- data recorder writes out xml, should s-expr
-
Nice to Have:
=============
Modified: branches/pingus_sdl/src/demo_recorder.cpp
===================================================================
--- branches/pingus_sdl/src/demo_recorder.cpp 2007-08-16 02:08:50 UTC (rev
2947)
+++ branches/pingus_sdl/src/demo_recorder.cpp 2007-08-16 02:23:51 UTC (rev
2948)
@@ -54,9 +54,9 @@
record_demo = true;
// Write file header
- out << "<pingus-demo>\n"
- << " <level>" << levelname << "</level>\n"
- << " <events>" << std::endl;
+ out << "(pingus-demo\n"
+ << " (level " << levelname << ")\n"
+ << " (events " << std::endl;
}
}
else
@@ -74,9 +74,9 @@
{
if (record_demo)
{
- // Write file footer
- out << " </events>\n"
- << "</pingus-demo>" << std::endl;
+ // Write file footer - close events and pingus-demo
+ out << " )\n"
+ << ")" << std::endl;
out.close();
}
}
@@ -86,8 +86,7 @@
{
if (record_demo)
{
- event.write_xml(out);
- //event.write_xml(std::cout);
+ event.write(out);
}
}
Modified: branches/pingus_sdl/src/server_event.cpp
===================================================================
--- branches/pingus_sdl/src/server_event.cpp 2007-08-16 02:08:50 UTC (rev
2947)
+++ branches/pingus_sdl/src/server_event.cpp 2007-08-16 02:23:51 UTC (rev
2948)
@@ -55,16 +55,19 @@
}
void
-ServerEvent::write_xml(std::ostream& xml) const
+ServerEvent::write(std::ostream& out) const
{
switch(type)
{
case ARMAGEDDON_EVENT:
- xml << " <armageddon time=\"" << StringUtil::to_string(time_stamp) <<
"\"/>" << std::endl;
+ out << " (armageddon (time " << time_stamp << "))" << std::endl;
break;
case PINGU_ACTION_EVENT:
- xml << " <pingu-action time=\"" << StringUtil::to_string(time_stamp) <<
"\" id=\"" << pingu_id
- << "\" action=\"" << Actions::action_to_string(pingu_action) <<
"\"/>" << std::endl;
+ out << " (pingu-action "
+ << "(time " << time_stamp << ") "
+ << "(id " << pingu_id << ") "
+ << "(action \"" << Actions::action_to_string(pingu_action) << "\"))"
+ << std::endl;
break;
default:
assert(!"Unknown type");
Modified: branches/pingus_sdl/src/server_event.hpp
===================================================================
--- branches/pingus_sdl/src/server_event.hpp 2007-08-16 02:08:50 UTC (rev
2947)
+++ branches/pingus_sdl/src/server_event.hpp 2007-08-16 02:23:51 UTC (rev
2948)
@@ -56,7 +56,7 @@
/** Construct an server event from an xml subtree */
ServerEvent(FileReader reader);
- void write_xml(std::ostream& xml) const;
+ void write(std::ostream& out) const;
/** Send this event to the server */
void send(Server*);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2948 - in branches/pingus_sdl: . src,
jsalmon3 <=