aboutsummaryrefslogtreecommitdiffstats
path: root/games/xevil/files/patch-cmn::game_style.cpp
blob: c7179626de05a8276fc7bafe882a2e249f2c2670 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
--- cmn/game_style.cpp.orig	2012-05-27 06:52:29.000000000 +0900
+++ cmn/game_style.cpp	2012-05-27 06:53:11.000000000 +0900
@@ -33,15 +33,9 @@
 #include <string.h>
 }
 
-#if X11
-#include <strstream.h>
-#endif
-
-#if WIN32
-#include <strstrea.h>
-#endif
+#include <sstream>
 
-#include <iomanip.h>
+#include <iomanip>
 #include "utils.h"
 #include "coord.h"
 #include "world.h"
@@ -109,13 +103,13 @@
   /* DEFAULT: True */
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP) = 0;
 
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &) = 0;
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum) = 0;
   /* EFFECTS: These two functions start a new level in a scenario.  setup_world() should
      just setup the map and size of the world.  new_level() is called after world.reset()
@@ -158,13 +152,13 @@
   virtual ScenarioType get_scenario_type() {return EXTERMINATE;}
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 
 
@@ -183,13 +177,13 @@
   virtual Boolean can_refill_game_objects();
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 
   virtual void new_level_set_timer(Timer &timer);
@@ -209,7 +203,7 @@
   virtual ScenarioType get_scenario_type() {return HIVE;}
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual Boolean award_bonus();
@@ -218,7 +212,7 @@
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 
   virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
@@ -242,13 +236,13 @@
   virtual ScenarioType get_scenario_type() {return CAPTURE_THE_FLAG;}
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 
   virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
@@ -269,7 +263,7 @@
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 
   virtual Boolean advance_level();  
@@ -292,7 +286,7 @@
   
   virtual Boolean (*get_team())(LocatorP,PhysicalP,PhysicalP) = 0;
   
-  virtual void set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr) = 0;
+  virtual void set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr) = 0;
   /* EFFECTS: Called in new_level() to set the appropriate messages. */
 
   
@@ -311,7 +305,7 @@
   virtual ScenarioType get_scenario_type() {return SEALS;}
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual Boolean award_bonus();
@@ -323,7 +317,7 @@
 #endif
   virtual Boolean (*get_team())(LocatorP,PhysicalP,PhysicalP);
 
-  virtual void set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr);
+  virtual void set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr);
 
 
 private:
@@ -342,7 +336,7 @@
   virtual ScenarioType get_scenario_type() {return ANTI_SEALS;}
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
 
@@ -351,7 +345,7 @@
 #endif
   virtual Boolean (*get_team())(LocatorP,PhysicalP,PhysicalP);
 
-  virtual void set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr);
+  virtual void set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr);
 
 
 private:
@@ -369,13 +363,13 @@
   virtual SoundName get_midisoundtrack(){return SoundNames::FIRE_SOUNDTRACK;}
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 
   virtual Boolean award_bonus();
@@ -391,13 +385,13 @@
   virtual ScenarioType get_scenario_type() {return KILL_THE_DRAGON;}
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 
   virtual SoundName get_midisoundtrack(){return SoundNames::FIRE_SOUNDTRACK;}
@@ -419,13 +413,13 @@
   virtual Pos human_initial_pos(WorldP,LocatorP,const Size &s);
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 
   virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
@@ -447,13 +441,13 @@
   virtual ScenarioType get_scenario_type() {return THE_POUND;}
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 };
 
@@ -466,13 +460,13 @@
   virtual ScenarioType get_scenario_type() {return JAPAN_TOWN;}
 
   virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                               IPhysicalManagerP);
 
   virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
   virtual void new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &dLevel,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int humansNum);
 
   virtual void filter_weapons_and_other_items(LocatorP,int &weaponsNum,
@@ -581,7 +575,7 @@
 
 
 int GameStyle::new_level_check(int,WorldP,LocatorP,
-                                  int,Boolean &,ostrstream &,Timer &timer,
+                                  int,Boolean &,stringstream &,Timer &timer,
                                   IPhysicalManagerP) {  
   // A timer-based level.
   if (timer.ready()) {
@@ -791,8 +785,8 @@
 
 
 
-void Normal::describe(ostrstream &str) {
-  str << "Complete each level/scenario to proceed to the next one." << ends;
+void Normal::describe(stringstream &str) {
+  str << "Complete each level/scenario to proceed to the next one.";
 }
 
 
@@ -852,7 +846,7 @@
 
 
 int Normal::new_level_check(int enemiesPlaying,WorldP w,LocatorP l,
-                             int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
+                             int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
                              IPhysicalManagerP manager) {
   GameStyleP delegate = get_delegate();
   return delegate->new_level_check(enemiesPlaying,w,l,level,lStrChanged,levelStr,timer,manager);
@@ -876,7 +870,7 @@
 
 void Normal::new_level(int level,WorldP world,LocatorP locator,
                        const DifficultyLevel &dLevel,
-                       ostrstream &lStr,ostrstream &lTitleStr,
+                       stringstream &lStr,stringstream &lTitleStr,
                        IPhysicalManagerP manager,int humansNum) {
   // Choose which delegate to use.
   if (level % NORMAL_SCENARIOS_FREQUENCY == 0) {
@@ -934,11 +928,10 @@
 
 
 
-void Levels::describe(ostrstream &str) {
+void Levels::describe(stringstream &str) {
   str << "Human player(s) fights through increasing levels of "
 	    << "difficulty." << "\n" 
-	    << "To complete a level you must kill all enemy players." 
-	    << ends;
+	    << "To complete a level you must kill all enemy players.";
 }
 
 
@@ -969,7 +962,7 @@
 
 
 int Levels::new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                              int,Boolean &,ostrstream &,Timer &,
+                              int,Boolean &,stringstream &,Timer &,
                               IPhysicalManagerP) {
   if (enemiesPlaying == 0) {
     return 1;
@@ -983,7 +976,7 @@
 
 void Levels::new_level(int level,WorldP world,LocatorP locator,
                        const DifficultyLevel &dLevel,
-                       ostrstream &lStr,ostrstream &lTitleStr,
+                       stringstream &lStr,stringstream &lTitleStr,
                        IPhysicalManagerP manager,int) {
   world->reset();  
 
@@ -991,8 +984,8 @@
   clean_physicals(False,world,locator,manager);
 
 
-  lTitleStr << "[" << level << "] Kill All Machines" << ends;
-  lStr << "Level: " << level << ends;
+  lTitleStr << "[" << level << "] Kill All Machines";
+  lStr << "Level: " << level;
 
   enemiesNum += dLevel.enemiesIncr;
   enemiesNum = Utils::minimum(enemiesNum,dLevel.enemiesMax);
@@ -1037,8 +1030,8 @@
 
 
 
-void KillKillKill::describe(ostrstream &str) {
-  str << "Every human and machine for him/her/itself." << ends;
+void KillKillKill::describe(stringstream &str) {
+  str << "Every human and machine for him/her/itself.";
 }
 
 
@@ -1095,15 +1088,15 @@
 
 void KillKillKill::new_level(int level,WorldP world,LocatorP locator,
                              const DifficultyLevel &,
-                             ostrstream &lStr,ostrstream &lTitleStr,
+                             stringstream &lStr,stringstream &lTitleStr,
                              IPhysicalManagerP manager,int) {
   world->reset();
 
   // Don't wipe out the Enemies.
   clean_physicals(True,world,locator,manager);
 
-  lTitleStr << "Level: " << level << ends;
-  lStr << "Level: " << level << ends;
+  lTitleStr << "Level: " << level;
+  lStr << "Level: " << level;
 
   // Only create enemies first time or if enemiesRefill is set.
   if (justReset) {
@@ -1152,9 +1145,9 @@
 
 
 
-void Duel::describe(ostrstream &str) {
+void Duel::describe(stringstream &str) {
   str << "Human vs. human battle to the death." 
-	    << "\n" << "Each human has 3 lives." << ends;
+	    << "\n" << "Each human has 3 lives.";
 }
 
 
@@ -1207,13 +1200,13 @@
 
 void Duel::new_level(int level,WorldP world,LocatorP locator,
                      const DifficultyLevel &,
-                     ostrstream &lStr,ostrstream &lTitleStr,
+                     stringstream &lStr,stringstream &lTitleStr,
                      IPhysicalManagerP manager,int) {
   world->reset();
   clean_physicals(False,world,locator,manager);
 
-  lTitleStr << "Level: " << level << ends;
-  lStr << "Level: " << level << ends;
+  lTitleStr << "Level: " << level;
+  lStr << "Level: " << level;
 
   // Only create enemies first time.
   if (justReset) {
@@ -1256,9 +1249,9 @@
 
 
 
-void ExtendedDuel::describe(ostrstream &str) {
+void ExtendedDuel::describe(stringstream &str) {
   str << "Human vs. human battle to the death." 
-	    << "\n" << "Unlimited lives." << ends;
+	    << "\n" << "Unlimited lives.";
 }
 
 
@@ -1318,13 +1311,13 @@
 
 void ExtendedDuel::new_level(int level,WorldP world,LocatorP locator,
                              const DifficultyLevel &,
-                             ostrstream &lStr,ostrstream &lTitleStr,
+                             stringstream &lStr,stringstream &lTitleStr,
                              IPhysicalManagerP manager,int) {
   world->reset();
   clean_physicals(False,world,locator,manager);
 
-  lTitleStr << "Level: " << level << ends;
-  lStr << "Level: " << level << ends;
+  lTitleStr << "Level: " << level;
+  lStr << "Level: " << level;
 
   // Only create enemies first time.
   if (justReset) {
@@ -1367,8 +1360,8 @@
 
 
 
-void Training::describe(ostrstream &str) {
-  str << "No enemies.  Useful for learning the controls." << ends;
+void Training::describe(stringstream &str) {
+  str << "No enemies.  Useful for learning the controls.";
 }
 
 
@@ -1392,13 +1385,13 @@
 
 void Training::new_level(int level,WorldP world,LocatorP locator,
                         const DifficultyLevel &,
-                        ostrstream &lStr,ostrstream &lTitleStr,
+                        stringstream &lStr,stringstream &lTitleStr,
                         IPhysicalManagerP manager,int) {
   world->reset();
   clean_physicals(False,world,locator,manager);
 
-  lTitleStr << "Level: " << level << ends;
-  lStr << "Level: " << level << ends;
+  lTitleStr << "Level: " << level;
+  lStr << "Level: " << level;
 }
 
 
@@ -1428,10 +1421,10 @@
 
 
 
-void Scenarios::describe(ostrstream &str) {
+void Scenarios::describe(stringstream &str) {
   str << "A number of different scenarios." << "\n"
 	    << "You must complete each scenario to continue on to the "
-	    << "next one." << ends;
+	    << "next one.";
 }
 
 
@@ -1499,7 +1492,7 @@
 
 int Scenarios::new_level_check(int enemiesPlaying,WorldP w,LocatorP l,
                              int level,Boolean &lStrChanged,
-                               ostrstream &levelStr,Timer &timer,
+                               stringstream &levelStr,Timer &timer,
                              IPhysicalManagerP manager) {
   assert(scenario);
   return scenario->new_level_check(enemiesPlaying,w,l,level,
@@ -1534,7 +1527,7 @@
 
 void Scenarios::new_level(int level,WorldP world,LocatorP locator,
                        const DifficultyLevel &dLevel,
-                       ostrstream &lStr,ostrstream &lTitleStr,
+                       stringstream &lStr,stringstream &lTitleStr,
                        IPhysicalManagerP manager,int humansNum) {
   // Works even if scenario is NULL.
   if (!scenario || scenario->advance_level()) {
@@ -1804,7 +1797,7 @@
 
 
 int Exterminate::new_level_check(int enemiesPlaying,WorldP,LocatorP,
-                                 int,Boolean &,ostrstream &,Timer &,
+                                 int,Boolean &,stringstream &,Timer &,
                                  IPhysicalManagerP) {
   if (enemiesPlaying == 0) {
     return 1;
@@ -1822,10 +1815,10 @@
 
 void Exterminate::new_level(int level,WorldP,LocatorP,
                             const DifficultyLevel &dLevel,
-                            ostrstream &lStr,ostrstream &lTitleStr,
+                            stringstream &lStr,stringstream &lTitleStr,
                             IPhysicalManagerP manager,int) {
-  lTitleStr << "[" << level << "] EXTERMINATE" << ends;
-  lStr << "[" << level << "] EXTERMINATE\nKill all machines." << ends;
+  lTitleStr << "[" << level << "] EXTERMINATE";
+  lStr << "[" << level << "] EXTERMINATE\nKill all machines.";
 
   // Doesn't increment like LEVELS game style
   enemiesNum = dLevel.enemiesIncr;
@@ -1852,7 +1845,7 @@
 
 int Bonus::new_level_check(int,WorldP,LocatorP locator,
                            int level,Boolean &lStrChanged,
-                           ostrstream &levelStr,Timer &timer,
+                           stringstream &levelStr,Timer &timer,
                            IPhysicalManagerP) {
   // Ran out of time.
   if (timer.ready()) {
@@ -1873,13 +1866,13 @@
   if (remaining != frogsRemaining) {
     frogsRemaining = remaining;
     levelStr << "[" << level << "] BONUS LEVEL\nfrogs remaining: " 
-	      << remaining << ends;
+	      << remaining;
     lStrChanged = True;
     if (remaining > 0) {
-	    ostrstream arenaStr;
+	    stringstream arenaStr;
 	    arenaStr << remaining << " Frog" << 
-	      (remaining > 1 ? "s" : "") << " Remaining" << ends;
-	    locator->arena_message_enq(arenaStr.str());
+	      (remaining > 1 ? "s" : "") << " Remaining";
+	    locator->arena_message_enq(Utils::strdup(arenaStr.str().c_str()));
     }
 
     // Will only be called once per level.
@@ -1907,7 +1900,7 @@
 
 void Bonus::new_level(int level,WorldP world,LocatorP locator,
                       const DifficultyLevel &,
-                      ostrstream &lStr,ostrstream &lTitleStr,
+                      stringstream &lStr,stringstream &lTitleStr,
                       IPhysicalManagerP manager,int) {
   // Create frogs
   for (int n = 0; n < SCENARIO_BONUS_FROGS; n++) {
@@ -1940,9 +1933,9 @@
   frogsRemaining = SCENARIO_BONUS_FROGS;
 
   lTitleStr << "[" << level << "] Bonus Level: Kill " 
-		  << (int)SCENARIO_BONUS_FROGS << " Frogs"  << ends;
+		  << (int)SCENARIO_BONUS_FROGS << " Frogs";
   lStr << "[" << level << "] BONUS LEVEL\nfrogs remaining: " 
-	     << (int)SCENARIO_BONUS_FROGS << ends;
+	     << (int)SCENARIO_BONUS_FROGS;
 }
 
 
@@ -1960,7 +1953,7 @@
 
 
 int Hive::new_level_check(int,WorldP,LocatorP locator,
-                          int,Boolean &,ostrstream &,Timer &,
+                          int,Boolean &,stringstream &,Timer &,
                           IPhysicalManagerP) {
   PhysicalP xit = locator->lookup(xitId);
   assert(xit); // The Xit should never be destroyed.
@@ -1987,7 +1980,7 @@
 
 void Hive::new_level(int level,WorldP world,LocatorP locator,
                      const DifficultyLevel &,
-                     ostrstream &lStr,ostrstream &lTitleStr,
+                     stringstream &lStr,stringstream &lTitleStr,
                      IPhysicalManagerP manager,int) {
 	// Aliens are created in Game::clock.
 
@@ -2012,8 +2005,8 @@
     locator->add(egg);
   }
   
-  lTitleStr << "[" << level << "] HIVE" << ends;
-  lStr << "[" << level << "] HIVE.\nFind the exit." << ends;
+  lTitleStr << "[" << level << "] HIVE";
+  lStr << "[" << level << "] HIVE.\nFind the exit.";
 }
 
 
@@ -2073,7 +2066,7 @@
 
 
 int CaptureTheFlag::new_level_check(int,WorldP,LocatorP locator,
-                                    int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &,
+                                    int level,Boolean &lStrChanged,stringstream &levelStr,Timer &,
                                     IPhysicalManagerP manager) {
   int fRemaining = 0;
   for (int n = 0; n < SCENARIO_FLAG_FLAGS; n++) {
@@ -2091,19 +2084,19 @@
     flagsRemaining = fRemaining;
     levelStr <<  "[" <<  level <<  "] COLLECT " 
 	     <<  (int)SCENARIO_FLAG_FLAGS 
-	     << " FLAGS\nremaining: "<<  flagsRemaining <<   ends;
+	     << " FLAGS\nremaining: "<<  flagsRemaining;
     lStrChanged = True;
 
-    ostrstream arenaStr;
+    stringstream arenaStr;
     if (fRemaining != 0) {
       arenaStr << flagsRemaining << " Flag" <<
-	      (flagsRemaining > 1 ? "s" : "") << " Remaining" << ends;
+	      (flagsRemaining > 1 ? "s" : "") << " Remaining";
     }
     else {
-      arenaStr << "All Flags Collected" << ends;
+      arenaStr << "All Flags Collected";
     }
       
-    locator->arena_message_enq(arenaStr.str());
+    locator->arena_message_enq(Utils::strdup(arenaStr.str().c_str()));
   }
 
   if (fRemaining == 0) { // All flags are gone, so end level.
@@ -2124,7 +2117,7 @@
 
 void CaptureTheFlag::new_level(int level,WorldP world,LocatorP locator,
                                const DifficultyLevel &,
-                               ostrstream &lStr,ostrstream &lTitleStr,
+                               stringstream &lStr,stringstream &lTitleStr,
                                IPhysicalManagerP,int) {
   for (int n = 0; n < SCENARIO_FLAG_FLAGS; n++) {
 	  Pos pos = world->empty_accessible_rect(Flag::get_size_max());
@@ -2136,9 +2129,9 @@
   flagsRemaining = SCENARIO_FLAG_FLAGS;
 
   lTitleStr << "[" << level << "] Capture The Flag: " 
-		  << (int)SCENARIO_FLAG_FLAGS << " Flags" << ends;
+		  << (int)SCENARIO_FLAG_FLAGS << " Flags";
   lStr << "[" << level << "] COLLECT " << (int)SCENARIO_FLAG_FLAGS 
-	     << " FLAGS.\nremaining: " << (int)SCENARIO_FLAG_FLAGS << ends;
+	     << " FLAGS.\nremaining: " << (int)SCENARIO_FLAG_FLAGS;
 }
 
 
@@ -2169,7 +2162,7 @@
 
 void GenericSeals::new_level(int level,WorldP world,LocatorP locator,
                          const DifficultyLevel &,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP,int) {
   // Add a team for each human in the game.
   // Don't use locator->humans_registered() because they may not have been
@@ -2298,7 +2291,7 @@
 
 
 int Seals::new_level_check(int,WorldP,LocatorP locator,
-                              int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &,
+                              int level,Boolean &lStrChanged,stringstream &levelStr,Timer &,
                               IPhysicalManagerP) {  
   int lemOut,lemSafe,lemActive,lemDead;
   compute_out_safe_active_dead(locator,lemOut,lemSafe,lemActive,lemDead);
@@ -2312,10 +2305,10 @@
 
     // Only update arena string if sealsSafe has changed.
     if (lemSafe != sealsSafe && lemSafe != SCENARIO_SEALS_NEED) {
-      ostrstream arenaStr;
+      stringstream arenaStr;
       arenaStr << "Save " << (SCENARIO_SEALS_NEED - lemSafe)
-               << " More Baby Seals" << ends;
-      locator->arena_message_enq(arenaStr.str());
+               << " More Baby Seals";
+      locator->arena_message_enq(Utils::strdup(arenaStr.str().c_str()));
     }
 
     sealsSafe = lemSafe;
@@ -2324,18 +2317,17 @@
     levelStr << "[" << level << "] SAVE " 
             << (int)SCENARIO_SEALS_NEED << " BABY SEALS\n" 
             << "out: " << sealsOut << " safe: " << sealsSafe
-            << " dead: " << lemDead
-            << ends;
+            << " dead: " << lemDead;
     lStrChanged = True;
 
     // New level if enough seals are safe or too many are dead.
     if (lemDead > (SCENARIO_SEALS_SEALS - SCENARIO_SEALS_NEED)
 	      || lemSafe >= SCENARIO_SEALS_NEED) {
       if (lemSafe < SCENARIO_SEALS_NEED) {
-	      ostrstream msg;
+	      stringstream msg;
 	      msg << "YOU FAILED TO SAVE " << (int)SCENARIO_SEALS_NEED
-	          << " BABY SEALS. TRY THIS LEVEL AGAIN." << ends;
-	      locator->arena_message_enq(msg.str());
+	          << " BABY SEALS. TRY THIS LEVEL AGAIN.";
+	      locator->arena_message_enq(Utils::strdup(msg.str().c_str()));
       }
       else {
         locator->arena_message_enq(Utils::strdup("Good work.  Go to the next level."));
@@ -2365,11 +2357,10 @@
 
 
   
-void Seals::set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr) {
-  lTitleStr << "[" << level << "] SAVE THE BABY SEALS" << ends;
+void Seals::set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr) {
+  lTitleStr << "[" << level << "] SAVE THE BABY SEALS";
   lStr << "[" << level << "] SAVE "<< 
-	  (int)SCENARIO_SEALS_NEED << " BABY SEALS\n" 
-	     << "out: 0 safe: 0 dead: 0" << ends;
+	  (int)SCENARIO_SEALS_NEED << " BABY SEALS\n" << "out: 0 safe: 0 dead: 0";
 }
 
 
@@ -2430,7 +2421,7 @@
 
 
 int AntiSeals::new_level_check(int,WorldP,LocatorP locator,
-                                  int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &,
+                                  int level,Boolean &lStrChanged,stringstream &levelStr,Timer &,
                                   IPhysicalManagerP) {  
   // level not over by default.
   int ret = -1;
@@ -2441,15 +2432,13 @@
 
   // Failure
   if (lemSafe > SCENARIO_ANTI_SEALS_MAX_SLIPPAGE) {
-	  ostrstream msg;
 #if 0
     // Not enough space on screen, need two lines.
 	  msg << "YOU LET TOO MANY OF THE FAT BASTARDS GET AWAY\n"
 	      << "Try this level again" << ends;
 #else
-	  msg << "YOU LET TOO MANY OF THE FAT BASTARDS GET AWAY" << ends;
 #endif
-	  locator->arena_message_enq(msg.str());
+	  locator->arena_message_enq(Utils::strdup("YOU LET TOO MANY OF THE FAT BASTARDS GET AWAY"));
 
     // start new level
     ret = 1;
@@ -2473,13 +2462,11 @@
       }
       // Update UI
       else if (lemSafe == sealsSafe) {  // o.w. the "one got away" message takes priority
-        ostrstream arenaStr;
-        arenaStr << "Kill "
-          << lemToKill << " More Baby Seals" << ends;
-        locator->arena_message_enq(arenaStr.str());
+        stringstream arenaStr;
+        arenaStr << "Kill " << lemToKill << " More Baby Seals";
+        locator->arena_message_enq(Utils::strdup(arenaStr.str().c_str()));
 
-        levelStr << "[" << level << "] KILL " 
-                << lemToKill << " BABY SEALS" << ends;
+        levelStr << "[" << level << "] KILL " << lemToKill << " BABY SEALS";
         lStrChanged = True;
       }
     }  // lemDead != sealsDead
@@ -2502,10 +2489,10 @@
 
 
   
-void AntiSeals::set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr) {
-  lTitleStr << "[" << level << "] KILL THE BABY SEALS" << ends;
+void AntiSeals::set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr) {
+  lTitleStr << "[" << level << "] KILL THE BABY SEALS";
   lStr << "[" << level << "] KILL "<< 
-	  (int)SCENARIO_SEALS_SEALS << " BABY SEALS" << ends;
+	  (int)SCENARIO_SEALS_SEALS << " BABY SEALS";
 }
 
 
@@ -2552,7 +2539,7 @@
 
 
 int KillTheFireDemon::new_level_check(int enemiesPlaying,WorldP,LocatorP locator,
-                                   int,Boolean &,ostrstream &,Timer &,
+                                   int,Boolean &,stringstream &,Timer &,
                                    IPhysicalManagerP) {
   if (enemiesPlaying == 0) {
     locator->arena_message_enq(Utils::strdup("Take That, You Mother-Fucking Spawn From Hell"));
@@ -2572,12 +2559,12 @@
 
 void KillTheFireDemon::new_level(int level,WorldP,LocatorP,
                                  const DifficultyLevel &,
-                                 ostrstream &lStr,ostrstream &lTitleStr,
+                                 stringstream &lStr,stringstream &lTitleStr,
                                  IPhysicalManagerP manager,int) {
   manager->create_enemy(manager->enemy_physical(A_FireDemon));
 
-  lTitleStr << "[" << level << "] FIRE DEMON" << ends;
-  lStr << "[" << level << "] Kill the Fire Demon." << ends;
+  lTitleStr << "[" << level << "] FIRE DEMON";
+  lStr << "[" << level << "] Kill the Fire Demon.";
 }
 
 
@@ -2594,7 +2581,7 @@
 
 
 int KillTheDragon::new_level_check(int enemiesPlaying,WorldP,LocatorP locator,
-                                   int,Boolean &,ostrstream &,Timer &,
+                                   int,Boolean &,stringstream &,Timer &,
                                    IPhysicalManagerP) {
   if (enemiesPlaying == 0) {
     locator->arena_message_enq(Utils::strdup("The Infernal Worm has been vanquished"));
@@ -2614,7 +2601,7 @@
 
 void KillTheDragon::new_level(int level,WorldP w,LocatorP l,
                                  const DifficultyLevel &,
-                                 ostrstream &lStr,ostrstream &lTitleStr,
+                                 stringstream &lStr,stringstream &lTitleStr,
                                  IPhysicalManagerP manager,int) {
   const PhysicalContext *cx = &Dragon::creatureContext.movingContext.physicalContext;
   Pos pos = w->empty_rect(cx->sizeMax);
@@ -2628,8 +2615,8 @@
     manager->create_enemy(p,False);
   }
 
-  lTitleStr << "[" << level << "] Dragon" << ends;
-  lStr << "[" << level << "] Kill the Dragon." << ends;
+  lTitleStr << "[" << level << "] Dragon";
+  lStr << "[" << level << "] Kill the Dragon.";
 }
 
 
@@ -2667,7 +2654,7 @@
 
 
 int ZigZag::new_level_check(int,WorldP world,LocatorP locator,
-                            int,Boolean &,ostrstream &,Timer &,
+                            int,Boolean &,stringstream &,Timer &,
                             IPhysicalManagerP) {
   PhysicalP xit = locator->lookup(xitId);
   assert(xit); // The Xit should never be destroyed.
@@ -2680,7 +2667,7 @@
     HumanP human = locator->get_human(n);
     if (human) {
       // previous depth
-      int depthOld = (int)human->get_data();
+      long depthOld = (long)human->get_data();
       Id id = human->get_id();
 
       // Get physical for intelligence
@@ -2697,9 +2684,9 @@
 	        human->set_data((void *)depth);
 
           // Use 1-based counting for the User.
-	        ostrstream str;
-	        str << "Depth " << (depth + 1) << ends;
-	        locator->arena_message_enq(str.str(),p);
+	        stringstream str;
+	        str << "Depth " << (depth + 1);
+	        locator->arena_message_enq(Utils::strdup(str.str().c_str()),p);
         }
       }
   	}
@@ -2718,7 +2705,7 @@
 
 void ZigZag::new_level(int level,WorldP world,LocatorP locator,
                        const DifficultyLevel &,
-                       ostrstream &lStr,ostrstream &lTitleStr,
+                       stringstream &lStr,stringstream &lTitleStr,
                        IPhysicalManagerP,int) {
   Rooms worldRooms = world->get_rooms();
   RoomIndex upperRight(0,worldRooms.acrossMax - 1);
@@ -2731,9 +2718,8 @@
   xitId = p->get_id();
 
   // 1-based counting of depth for the user.
-  lTitleStr << "[" << level << "] ZIG-ZAG: Depth " 
-		  << worldRooms.downMax << ends;
-  lStr << "[" << level << "] ZIG-ZAG.\nFind the exit." << ends;
+  lTitleStr << "[" << level << "] ZIG-ZAG: Depth " << worldRooms.downMax;
+  lStr << "[" << level << "] ZIG-ZAG.\nFind the exit.";
 }
 
 
@@ -2761,7 +2747,7 @@
 
 
 int ThePound::new_level_check(int enemiesPlaying,WorldP,LocatorP locator,
-                              int,Boolean &,ostrstream &,Timer &,
+                              int,Boolean &,stringstream &,Timer &,
                               IPhysicalManagerP) {
   if (enemiesPlaying == 0) {
     locator->arena_message_enq(Utils::strdup("Killed the Mutts"));
@@ -2781,7 +2767,7 @@
 
 void ThePound::new_level(int level,WorldP,LocatorP locator,
                          const DifficultyLevel &,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int) {
   locator->add_team(Scenarios::dog_team,NULL);
 
@@ -2789,8 +2775,8 @@
     manager->create_enemy(manager->enemy_physical(A_Dog));
   }
 
-  lTitleStr << "[" << level << "] The Pound" << ends;
-  lStr << "[" << level << "] The Pound" << ends;
+  lTitleStr << "[" << level << "] The Pound";
+  lStr << "[" << level << "] The Pound";
 }
 
 
@@ -2801,7 +2787,7 @@
 
 
 int JapanTown::new_level_check(int enemiesPlaying,WorldP,LocatorP locator,
-                              int,Boolean &,ostrstream &,Timer &,
+                              int,Boolean &,stringstream &,Timer &,
                               IPhysicalManagerP) {
   if (enemiesPlaying == 0) {
     locator->arena_message_enq(Utils::strdup("Damn Ninjas.  Worse than roaches."));
@@ -2821,7 +2807,7 @@
 
 void JapanTown::new_level(int level,WorldP,LocatorP locator,
                          const DifficultyLevel &,
-                         ostrstream &lStr,ostrstream &lTitleStr,
+                         stringstream &lStr,stringstream &lTitleStr,
                          IPhysicalManagerP manager,int) {
   locator->add_team(JapanTown::ninja_team,NULL);
 
@@ -2829,8 +2815,8 @@
     manager->create_enemy(manager->enemy_physical(A_Ninja));
   }
 
-  lTitleStr << "[" << level << "] Japan-Town" << ends;
-  lStr << "[" << level << "] Japan-Town" << ends;
+  lTitleStr << "[" << level << "] Japan-Town";
+  lStr << "[" << level << "] Japan-Town";
 }