forked from toshok/scsharp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChangeLog
1173 lines (835 loc) · 42.6 KB
/
ChangeLog
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
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2008-01-12 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/GameScreen.cs: fix ticket #14 by checking the
hudElement's pcx file to see if it's transparent at X,Y before
looking under it at the elements on the map.
* SCSharp/SCSharp.UI/ImageElement.cs: add Pcx property so we can
get ahold of the pcx used to generate the surface (used in the HUD
code).
* SCSharp/SCSharp.UI/GuiUtil.cs: add SurfaceFromPcx.
2008-01-12 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/PlayCustomScreen.cs: apply patch from
chaos_jk@abv.bg. fixed navigation in second-level (or lower) map
directories.
2008-01-12 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/PlayCustomScreen.cs: fix ticket #25 - don't
crash when opening a map directory with no fiels.
2008-01-12 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/LoginScreen.cs (PopulateUIFromDir): don't set
SelectedIndex, listbox.AddItem does it for us if need be.
(ResourceLoader): "Ok" and "Delete" start out insensitive, and
become sensitive if a listbox element is selected. Also, create
the "characters" subdirectory if it doesn't exist, closing ticket
#15.
* SCSharp/SCSharp.UI/ListBoxElement.cs (AddItem): if cursor is -1
when an item is added, select the new item, and emit
SelectionChanged.
(set_SelectedIndex): validate the argument, and emit
SelectionChanged.
2008-01-12 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/GuiUtil.cs: hack GetBitmapData to deal with
the shadow colors and make them partially translucent.
* SCSharp/SCSharp.UI/Sprite.cs: make some spew a little more
verbose.
* SCSharp/SCSharp.Mpq/UnitsDat.cs: fix the width/height/portrait
offsets for 1.13f. Need to figure out what version(s) we're going
to support, and either hardcode these somewhere global, or if we
support more than one add support for switching between tables of
offsets.
* SCSharp/SCSharp.Mpq/IScriptBin.cs: grovel backward from the end
of the file looking for valid iscript offsets - those that point
to locations in the file that have "SCPE". Helps deal with
differences in table sizes between iscript.bin file versions.
This fixes ticket #6, as before we were pointing to random,
incorrect places.
2008-01-08 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/Game.cs: Sanitize the paths we get from the
.config file, replacing / and \ with Path.DirectorySeparatorChar.
Fixes ticket #24 (fix is based on proposed patch).
2008-01-06 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/Game.cs (Game.PlayingBroodWar): add the
patchrt.mpq to the playingMpq list.
2006-06-30 Chris Toshok <toshok@hungry.com>
* nant.build: add a dist and release target. the dist target just
zips things up from the source tree, the release target creates a
new output directory and calls the build target on it. Lastly,
add an if clause to the Consts.cs copy task so that it should be
rebuilt if nant.build is newer, but it doesn't seem to work. bug
in nant? Another bug (this time in ICSharpLib): the file
permissions are stripped from files we add to a .zip, so the
dist'ed configure file doesn't have execute permissions.
2006-06-30 Chris Toshok <toshok@hungry.com>
* nant.build: change back to a fileset for the Tao.Sdl.dll.config
and pass flatten=true to keep the source directory from being
created under the dest directory. Also, change the
scsharp.exe.config rule to copy the file if either 1)
overwriteConfig is true, or 2) the file doesn't exist in the bin/
directory already.
2006-06-30 Chris Toshok <toshok@hungry.com>
* src/scsharp.exe.sources: include ../build/Consts.cs
* SCSharp/SCSharp.dll.sources: include ../build/Consts.cs
* SCSharp/SCSharp.Smk.dll.sources: include ../build/Consts.cs
* SCSharp/SCSharp.UI.dll.sources: include ../build/Consts.cs
* SCSharp/SCSharp.UI/MainMenu.cs: use Consts.Version instead of
hardcoding the version.
* src/AssemblyInfo.cs: use Consts.Version
* SCSharp/SCSharp.Mpq/AssemblyInfo.cs: use Consts.Version
* SCSharp/SCSharp.Mpq.Smk/AssemblyInfo.cs: use Consts.Version
* SCSharp/SCSharp.UI/AssemblyInfo.cs: use Consts.Version
* build/Consts.cs.in: source for a generated per-assembly file.
* nant.build: generate build/Consts.cs from build/Consts.cs.in.
* configure.ac: same.
* SCSharp/Makefile.am (SCSHARPDLL_REFS): drop the
ICSharpCode.SharpZipLib dep.
2006-06-30 Chris Toshok <toshok@hungry.com>
* nant.build: use scsharp.exe instead of scs.exe, fix the
destination of Tao.Sdl.dll.config, and add the tools to the build.
Also fix dll references.
2006-06-30 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/ConnectionScreen.cs: fix this for
patch_rt.mpq.
* SCSharp/SCSharp.UI/Game.cs: load the patch_rt.mpq propertly,
such that it is used for resolution before either stardat.mpq or
broodat.mpq
2006-06-30 Chris Toshok <toshok@hungry.com>
* SCSharp.csproj: make the assembly strings work with xbuild.
* SCSharp/SCSharp.UI.dll.csproj: same.
* SCSharp/SCSharp.Smk.dll.csproj: same, and remove SDLPCMStream.cs
* Properties/AssemblyInfo.cs: remove the duplicate file contents.
* Properties/Resources.Designer.cs: same.
* SCSharp/Properties/SCSharp.UI.dll/AssemblyInfo.cs: same.
* SCSharp/Properties/SCSharp.Smk.dll/AssemblyInfo.cs: same.
* SCSharp/Properties/SCSharp.dll/AssemblyInfo.cs: same.
2006-06-28 Tom Allard <tom.allard@telenet.be>
* Added a NANT build (nant.build) file which:
- features easy, cross-platform building on Linux
and Windows / Mono or MS CLR.
- uses the existing .sources files to determine what files
to build the dlls from.
- copies all necessary files to the build directory. (Note:
WIN32 SDL binaries not included, put them (SDL.dll,
SDL_mixer.dll and SDL_gfx.dll) in a new 'win32' subdir
of the sdldotnet-bin folder.
- contains a flag whether or not to override the existing
config file in the build directory (default = bin-folder)
- has two main targets, the default target 'build', which
builds the libraries and the executable and the 'clean'
target wich deletes the build directory (bin)
To use it:
1. install nant
2. run nant (no parameters required)
2006-06-21 Jeffrey Stedfast <fejj@novell.com>
* SCSharp/SCSharp.Mpq.Smk/BitStream.cs: Removed unused variables.
(Reset): Instead of resetting the unused variables mCurrent and
mBitCount variables to 0 (which aren't used anywhere else in the
code), set mCurrentByte and mCurrentBit to 0, which is probably
what the author originally intended.
* SCSharp/SCSharp.Mpq.Smk/Smk.cs: Reindented - some lines seemed
to use 8-space indents and others seemed to use 4, and even others
used tab. Made everything use a uniform 4-space indent like the
other files in this directory.
* SCSharp/SCSharp.Mpq.Smk/SmkDecoder.cs: Removed unused
variables. Reindented the tables at the top too, as they were
weirdly indented in all of my editors (Emacs and MSVS).
* SCSharp.sln: Microsoft Visual Studio Solution file for SCSharp
* SCSharp.csproj: Project file for scsharp.exe
* SCSharp/SCSharp.dll.csproj: Project file for SCSharp.dll
* SCSharp/SCSharp.Smk.dll.csproj: Project file for SCSharp.Smk.dll
* SCSharp/SCSharp.UI.dll.csproj: Project file for SCSharp.UI.dll
2006-06-25 Chris Toshok <toshok@hungry.com>
* tools/: add a couple of tools: lsmpq.exe to list the contents of
mpq files, and extract.exe to extract individual files from an
mpq.
* configure.ac: output tools/Makefile.
* Makefile.am (SUBDIRS): add tools.
* SCSharp/SCSharp.UI/Game.cs: load the patch_rt.mpq before
anything else.
* SCSharp/SCSharp.UI/RaceSelectionScreen.cs: update this for the
race selection screen in patch_rt.mpq (it has the Load Replay
button).
* SCSharp/SCSharp.UI/ComboBoxElement.cs: invalidate the rectangle
of the dropdown when it is shown/hidden, and when the selection
changes.
* SCSharp/SCSharp.UI/PlayCustomScreen.cs (PopulateGameTypes): the
patch_rt.mpq templates.lst has an entry which doesn't exist in the
mpq's. make this method skip a null resource.
* SCSharp/SCSharp.UI/Pcx.cs: return if we're out the data length
while expanding an RLE block.. this isn't the right fix, but it
keeps things from crashing.
2006-06-25 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/Painter.cs: set the clip rectangle for
paintingSurface to Dirty when redrawing. this means we no longer
need to do all the complicated intersection tests in the various
paint methods.
* SCSharp/SCSharp.UI/GameScreen.cs: no need for the clip rectangle
calculation in the starfield painter.
* SCSharp/SCSharp.UI/CursorAnimator.cs: no need for the clip
rectangle calculation.
* SCSharp/SCSharp.UI/SpriteManager.cs: clean this up a
bunch. We're no longer using the painter hack, and are called
directly from an Events.Tick delegate. Also, since we're now
using a for loop (not an enumerator) to loop over the sprites, we
don't need the pendingAdds/pendingRemoves crap anymore.
* SCSharp/SCSharp.UI/PlayCustomScreen.cs: dispose of the
selectedScenario mpq when the cursor moves to another one.
* SCSharp/SCSharp.UI/UIDialog.cs: remove the clip retangle tests
for the dim painter.
* SCSharp/SCSharp.UI/Sprite.cs: remove the clip rectangle tests
for the sprite. Also, change the Tick method signature, since
SpriteManager now calls us from an Events.Tick delegate.
* SCSharp/SCSharp.UI/UIElement.cs: remove clip rectangle tests for
the element's surface.
* SCSharp/SCSharp.UI/UIScreen.cs: remove clip rectangle tests for
background painter.
2006-06-25 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.Mpq/Mpq.cs: make Mpq implement IDisposable, and
override it in the subclasses are needed.
* SCSharp/SCSharp.Mpq/MpqArchive.cs: implement IDisposable, and
add Dispose, which closes mStream. This fixes the crash
navigating through the map file selector.
2006-06-25 Chris Toshok <toshok@hungry.com>
* src/scsharp.exe.config: add new config settings.
2006-06-25 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI.dll.sources: add GrpElement/GrpButtonElement.
* SCSharp/SCSharp.UI/Painter.cs (.cctor): get
ShowFps/DebugPainterDirty configuration settings if !RELEASE.
(Redraw): redraw the fps if the setting says so, and only
invalidate the rectangle every 50 frames. Also, if debug_dirty is
on, fill the invalidated areas with red and flip the screen to
give a visual indication of what is being redrawn.
(Add, Remove): remove the calls to Invalidate from here.
(Invalidate): clip the rectangle to 0,0-640,480.
* SCSharp/SCSharp.UI/GameScreen.cs: biggest change is the removal
of PaintHud. We no longer rasterize the text screens on every
redraw, and now modify UIElements when a unit is clicked and let
the UIElement machinery take care of surface creation/blitting.
(ScrollTick): check the new topleft coordinates against the old
ones, and don't bother invalidating due to scrolling if they're
the same. Also, if we *do* invalidate, only invalidate the area
used by the map (height = 375, not 640).
(MouseButtonDown): make this work for both UI elements (like the
GrpButtonElements) as well as units on the map.
(MouseButtonUp): same.
(PointerMotion): same.
* SCSharp/SCSharp.UI/MainMenu.cs: fix the hover animation for
Single Player, which needed to be offset, and also (unlike the
other animations) appears beneath the normal animation.
* SCSharp/SCSharp.UI/MarkupScreen.cs (AdvanceToNextPage):
invalidate the painter so we'll draw the new page.
* SCSharp/SCSharp.UI/ImageElement.cs: override Type to return
ElementType.Image.
* SCSharp/SCSharp.UI/LabelElement.cs: allow this class to be used
for positioning arbitrary, resizable text elements. The
GameScreen uses it for text displayed in the HUD.
* SCSharp/SCSharp.UI/RaceSelectionScreen.cs: add offsets for the
animations, and shift the terran over so that it's centered
properly.
* SCSharp/SCSharp.UI/UIScreen.cs: make mouseDownElement and
mouseOverElement protected.
* SCSharp/SCSharp.UI/Game.cs (set_Cursor): only remove the cursor
painter and add the new one if the value has changed.
* SCSharp/SCSharp.UI/UIElement.cs (.ctor): add a new constructor
which just takes a position.
(set_Sensitive): only invalidate if the value has changed.
(set_Visible): same.
(get_ElementType): if the BinElement == null, return UserElement.
* SCSharp/SCSharp.UI/Unit.cs: add lots of checks when looking up a
unit's Portrait, return null if any of them fail.
* SCSharp/SCSharp.UI/GrpElement.cs,
SCSharp/SCSharp.UI/GrpButtonElement.cs: add two new UIElement
subclasses which take a grp file and display a specific frame. On
the GameScreen, the wireframe unit display is a GrpElement, and
the command buttons are GrpButtonElements.
2006-06-25 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.Mpq/Tbl.cs: add Count property.
* SCSharp/SCSharp.Mpq/Dat.cs: add a few methods/properties of
getting some debugging information out of variable blocks.
* SCSharp/SCSharp.Mpq/Bin.cs: add a UserElement ElementType to
reflect a user specific type (i.e. not one that corresponds to
something we might find in a .bin file.)
* SCSharp/SCSharp.Mpq/UnitsDat.cs: add Widths/Heights collection.
* SCSharp/SCSharp.Mpq/SpritesDat.cs: ugh. modify NUM_SPRITES from
517 to 386 as this number makes things work out, it appears. No
clue if this is actually *right* though.
2006-06-20 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/MainMenu.cs: reposition the hover movie
elements to better align them with the normal movies. The single
player one is still unaligned, since there's no cue to tell where
it should go. I need a screenshot :)
2006-06-18 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/GameScreen.cs: use the new MapRenderer code.
* SCSharp/SCSharp.UI/MapRenderer.cs: move this to code that
renders the map a piece at a time (and composites the tiles onto a
surface that's the size of the paintable screen instead of the
size of the map). Right now it just uses a Dictionary for a
cache, so eventually (by scrolling all over the map) the memory
usage ends up being just as bad (worse, probably) than it was
before. This should be fixed to use a LRU scheme, probably.
2006-06-18 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/GameScreen.cs: lots of changes. make almost
everything work with the Painter's Invalidate/Dirty stuff. Also,
add the portrait for the currently selected unit.
* SCSharp/SCSharp.UI/Game.cs: for the ctrl-key handling return
after handling it, so it doesn't also hit the UIScreen's keyboard
handler.
* SCSharp/SCSharp.UI/Sprite.cs: do the proper thing wrt
Invalidate/Dirty.
* SCSharp/SCSharp.UI/Painter.cs: get rid of backsurface. since
we're double buffered anyway there's no need for the extra blit
and additional 640x480x4 bytes. Also, remove the
pending{Add,Clear,Remove} stuff. this shouldn't be a problem
anymore, as we're iterating using a for loop instead of anything
requiring an enumerator. Lastly, change the way fps is calculated
- we were skipping frames that didnt require drawing in the case
where we weren't showing fps. Also, dispose of the previous
fps_surface before creating a new one.
* SCSharp/SCSharp.UI/MovieElement.cs: add a ctor for the
non-BinElement case.
* SCSharp/SCSharp.UI/ImageElement.cs: same.
* SCSharp/SCSharp.UI/UIElement.cs: add a ctor that doesn't take a
BinElement, useful for creating UIElements which don't correspond
to something in a .bin file.
* SCSharp/SCSharp.UI/Unit.cs: add Portrait property.
* SCSharp/SCSharp.UI/UIScreen.cs: remove some spew about the
background painter. Also, always create the Elements collection
and UIPainter, so we can programmatically add to it, even for
UIScreens that don't have a .bin file associated with them (like
the game screen.)
2006-06-17 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.Mpq/Dat.cs: new superclass for all *.dat files.
Makes managing the variable blocks a little easier. probably a
little less performant, but I think overall it'll be a win.
* SCSharp/SCSharp.Mpq/*Dat.cs: port to the new Dat.cs superclass.
* SCSharp/SCSharp.UI/*.cs: same. Also, clean up some compiler
warnings and (CursorAnimator.cs) speed up the cursor animation.
2006-06-16 Chris Toshok <toshok@hungry<.com>
* SCSharp/SCSharp.Mpq/PortDataDat.cs: new class.
* SCSharp/SCSharp.UI/Builtins.cs: make PortData* capitalization
consistent.
* SCSharp/SCSharp.Mpq/Mpq.cs: handle "portdata.dat".
* SCSharp/SCSharp.UI/ReadyRoomScreen.cs: rewrite most of this
class. We now show portraits correctly (in original campaigns,
not expansion.) and we get rid of the hacked Background UIElement
support.
* SCSharp/SCSharp.Mpq/UnitsDat.cs: add portrait support.
* SCSharp/SCSharp.UI/GlobalResources.cs: add
portdata.dat/portdata.tbl support.
* SCSharp/SCSharp.UI/MovieElement.cs: add back in the scaling, and
also allow the SmackerPlayer to be set instead of just created in
the ctor. We use this in the ready room screen to switch
portraits in/out.
* SCSharp/SCSharp.UI/Painter.cs: add a Prepend call to add
painters to the beginning of the list.
* SCSharp/SCSharp.UI/UIPainter.cs: Allow null UIElements to exist
in the Paint method. just skip them as we iterate over the list.
* SCSharp/SCSharp.UI/UIElement.cs: allow changing of the Text as
well Width/Height properties. Also, remove the "background" hack
that was used in the ready room. A much better solution is now in
place.
* SCSharp/SCSharp.UI/ImageElement.cs: allow specification of the
colormap index used for translucency. Transparency seems to
always be index 0.
* SCSharp/SCSharp.UI/UIScreen.cs: add a protected property so
subclasses can alter the colormap index used for translucent
images. Defaults to 254, which is used for most screens it seems.
Pass this index to the ImageElement constructor.
* SCSharp/SCSharp.Util/Util.cs: quiet the compiler.
* SCSharp/SCSharp.Mpq/Grp.cs: quiet the compiler.
* SCSharp/SCSharp.Mpq/Chk.cs: quiet the compiler.
2006-06-15 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/RaceSelectionScreen.cs: share the same
SmackerPlayer between the three disk elements.
* SCSharp/SCSharp.UI/SmackerPlayer.cs: don't throw if we call Play
or Stop multiple times, just ignore the extra calls.
* SCSharp/SCSharp.UI/MovieElement.cs: add a ctor that takes a
SmackerPlayer.
2006-06-14 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/RaceSelectionScreen.cs: add in the movies,
and try to position them correctly. the first campaign (the
center one) doesn't isn't positioned correctly, I don't think.
Another thing that needs fixing is the fact that we create 3
separate disk.smk players. Maybe multiple MovieElements should be
able to share the same SmackerPlayer?
* SCSharp/SCSharp.Mpq/Bin.cs: we're using
ElementFlags.Unused02000000 to mean ElementFlags.BottonAlignText.
* SCSharp/SCSharp.UI/MainMenu.cs: update the version (finally) to
"v0.0000008". force the single player button's text to be right
aligned and centered vertically. Also, remove the scaling flag
from the MovieElement ctor.
* SCSharp/SCSharp.UI/ButtonElement.cs: split out the text surface
creation from CreateSurface() so we can use it for the new
TextPosition getter.
* SCSharp/SCSharp.UI/UIElement.cs: add a setter for Flags.
* SCSharp/SCSharp.UI/MovieElement.cs: remove the scaling feature
(i don't think any movies in the UI are scaled), and add in
support for "dimming" a movie (which gets used in the race
selection screen).
2006-06-13 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/ImageElement.cs: just always create the
surface with 254/0 as translucent/transparent. This fixes the
"tail" of the multi player graphic.
2006-06-13 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI.dll.sources: add MovieElement.cs
* SCSharp/SCSharp.UI/SmackerPlayer.cs (.ctor): allow the user to
specify the number of frames to be buffered.
(DecoderThread): catch exception (which we seem to hit) and break
out of the loop (and thus "finish" the animation). Also, the
whole "finish" thing needs rethinking, since we need to finish
after we've *played* the last frame, not after we've queued it.
(Events_Tick): initial creation of the surface needs some extra
help so we get a surface with the proper alpha.
(Stop): don't null out decoder/surf.
* SCSharp/SCSharp.UI/MainMenu.cs (AddToPainter): start up the
movie elements.
(RemoveToPainter): stop the movie elements.
(AddMovieElements): add normal/mouseover movie elements and set up
event handlers to show/hide the mouseover element. Set the movies
to only queue 1 frame.
(ResourceLoader): set up all the movie elements.
* SCSharp/SCSharp.UI/MovieElement.cs: new hack in order to get
smacker players in UIScreens.
* SCSharp/SCSharp.Mpq.Smk/SmkDecoder.cs (BGRAData): black is
transparent.
* SCSharp/SCSharp.UI/UIElement.cs: add getter for the BinElement,
and only call Painter.Instance.Invalidate() if we're visible.
2006-06-13 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.Mpq/MpqArchive.cs (DecryptBlock): decrypt the
block in place instead of repeatedly allocating a 4 byte array.
2006-06-13 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/SmackerPlayer.cs: switch from using
Thread.Suspend/Thread.Resume to using an AutoResetEvent. the
decoder calls .WaitOne when the queue is full, and the player
thread calls .Set when the queue is less than half full. This
fixes the hanging of the player. It also seems to fix the Ctrl-q
behavior during playback.
* SCSharp/SCSharp.UI/Cinematic.cs (PlayerFrameReady): move the
scaling code here so we don't scale on every repaint. also,
dispose of the previously scaled surface.
(VideoPainter): simplify this method to just a check and Blit
call.
2006-06-13 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/Game.cs (.ctor): fix c&p error.
2006-06-13 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.Mpq.Smk/SDLPCMStream.cs (Dispose): mark "new" to
fix compile error on windows.
* SCSharp/SCSharp.UI/SpriteManager.cs (CreateSprite): Commit
Foole's fix for ticket #7.
2006-06-13 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/Game.cs: Fix ticket #8, use ToLower() to
check for the SC install.exe filename.
2006-06-13 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/SmackerPlayer.cs: mostly adapt MtPOI's
SmkTest player here. Remove the (missing) ffmpeg glu library
dependency.
* SCSharp/SCSharp.UI/Cinematic.cs: move the frame scaling stuff
here.
* SCSharp/SCSharp.UI/Painter.cs: rewrite things such that we only
have one Painter (accessed via Painter.Instance). Also, now we
only paint if there's a dirty rectangle. We rely on the various
UI elements to tell us when a region on the screen is invalid and
needs redrawing. This isn't the final iteration, but it's a lot
closer to the "right" solution.
* SCSharp/SCSharp.Util/Util.cs: add MakeTag from MtPOI's SmkLib.
it should probably live in that code instead of here, but leave it
here for now.
2006-06-08 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/GameScreen.cs: add rendering of wireframe,
some of the text strings, and (if you click on the terran command
center) the cmd icons. Cmd icons need to be in a table in the
.exe, I think (unless someone can find where they exist in the
.mpq file). The colors in the rendered text/icons are wrong at
the moment.
* SCSharp/SCSharp.UI/Race.cs: reorder this to match some strings
in stat_txt.tbl.
* SCSharp/SCSharp.Util/Util.cs: reorder RaceChar and RaceCharLower
to match Race.cs.
* SCSharp/SCSharp.UI/Unit.cs (UnitId): add a new accessor.
2006-06-04 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/SpriteManager.cs: when we're executing inside
Tick, don't modify the sprite list. store off pending
removes/adds and process them after we're done with the tick
handler. Should fix ticket #4.
2006-05-30 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/Game.cs (.ctor): guard against having
multiple broodat.mpq/stardat.mpq files in a directory (since we
have to use ToLower() to do string comparisons, we can end up with
multiple matches.)
2006-05-30 Chris Toshok <toshok@hungry.com>
* src/scsharp.cs (Main): add a test to make sure
StarcraftCDDirectory and BroodwarCDDirectory have unique values.
I can't believe anyone would do that and expect it to work, but
what have you... fixes ticket #2.
2006-05-30 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/Sprite.cs (PaintSprite): the logic for the
clipping test wasn't taking into account the fact that the x,y of
a unit changed from top-left to center. this fixes ticket #3.
2006-05-29 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/TitleScreen.cs (LoadingFlasher): flash the
"Loading" text on the screen as we load things. The managed
stormlib does take a little longer to load things, which is a
bonus - the title screen actually stays up long enough for this
string to be shown :)
2006-05-29 Chris Toshok <toshok@hungry.com>
* Makefile.am (release): make it a zip file instead of a tar.bz2.
2006-05-29 Chris Toshok <toshok@hungry.com>
* Makefile.am (release): fix this target so that it works again.
* NEWS: include news for the first time.
* configure.ac: bump to 0.0000008.
* HACKING: fix up the .smk entry, with various options for
projects, and remove the managed stormlib project since Foole's is
working.
* RELEASE_README: s/starcraft/scsharp
* src/scsharp.exe.config-example: add the new options.
* src/scsharp.exe.config: can't put -- in the middle of comments.
2006-05-29 Chris Toshok <toshok@hungry.com>
* SCSharp/Makefile.am (MCSFLAGS): define USE_STORM_DLL if
ENABLE_STORMLIB == true.
* src/scsharp.exe.config: add some comments about the debugging
options, and add a new one to enable the unmanaged mpq library.
* Tests/dump-iscript.cs (DumpIScript.ctor): we assume the mpq
passed in is the stardat.mpq.
* SCSharp/SCSharp.UI/Painter.cs (.ctor): add back in a constructor
taking a Surface so the font-foo test continues to work.
* SCSharp/SCSharp.Mpq/Mpq.cs: USE_STORM_DLL no longer switches
between managed/unmanaged implementations, but compiles in the
optional unmanaged version as well.
* Makefile.am (SUBDIRS): only build in StormLib if ENABLE_STORMLIB
== true.
* configure.ac: add AC_ARG_ENABLE for --enable-stormlib. If it's
left out, only the managed version is built.
2006-05-29 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/Game.cs (CreateWindow): switch to new Painter
ctor.
(KeyboardDown): add handling for Ctrl-F to switch between
fullscreen and windowed mode.
* SCSharp/SCSharp.UI/UIDialog.cs: s/Game/Painter for the screen
nres constants.
* SCSharp/SCSharp.UI/Sprite.cs: same.
* SCSharp/SCSharp.UI/Cinematic.cs: same.
* SCSharp/SCSharp.UI/GameScreen: same.
* SCSharp/SCSharp.UI/UIScreen.cs (FirstPaint): revert to this
the non-disgusting hack version.
* SCSharp/SCSharp.UI/Painter.cs: move the SCREEN_RES_X/Y constants
here, from Game.cs.
(Fullscreen): new property, allow switching between fullscreen and
not.
2006-05-26 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.Mpq/Chk.cs (ReadFromStream): change the loop so
that it'll work with both StormLib and the managed .mpq stuff.
2006-05-24 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/GuiUtil.cs (RenderGlyph): add a hack to
antialias the fonts. of course this is yet another hack on top of
the already hackish nature of font rendering.
2006-05-24 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/GameScreen.cs: track the Unit currently under
the cursor, and when we click on it, spew a little info about it.
2006-05-24 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/Game.cs (DisplayTitle): use the FirstPainted
event to determine when the title screen is shown, rather than the
Ready event (which is emitted when it finishes loading.)
(TitleScreenReady): pass in both stardatMpq and broodatMpq to the
GlobalResources ctor so it can load both sets of resources.
* SCSharp/SCSharp.UI/Builtins.cs: add mapdata.dat and mapdata.tbl.
* SCSharp/SCSharp.UI/GlobalResources.cs: rework things in this
class to handle loading both the broodwar and starcraft assets.
Use Game.PlayingBroodwar to implicitly switch between the
different versions when using just the resource name, but allow
explicit access to each version when necessary.
* SCSharp/SCSharp.Mpq/Mpq.cs (GetTypeFromResourcePath): handle
mapdata.dat.
* SCSharp/SCSharp.Mpq/MapDataDat.cs: new class, just a set of
indices into mapdata.tbl.
* SCSharp/SCSharp.UI/GameModeDialog.cs (LoadResources): explicitly
use broodat's gluAll.tbl to get the dialog title. This keeps us
from crashing if we select "Original", then exit back to the main
menu and open this dialog again.
* SCSharp/SCSharp.UI/Painter.cs (Tick): rename "Animate" to this.
(DrawText): remove unused, empty function.
* SCSharp/SCSharp.UI/RaceSelectionScreen.cs
(BroodwarCampaigns_MapDataStart): stop hardcoding the strings
here. instead, hardcode the indices into the mapdata.dat file.
(StarcraftCampaigns_MapDataStart): same.
(LoadResources): in the campaign element activate delegates, just
call SelectCampaign.
(SelectCampaign): factor out a lot of shared code here. Use the
campaign indices to determine the correct prefix. Also, switch to
the establishing shot for the given scenario. It'll take care of
starting up the ready room.
* SCSharp/SCSharp.UI/ReadyRoomScreen.cs (LoadResources): in the
start_element activate delegate, stop the briefing before
switching to the game screen.
(StopBriefing): remove our Events.Tick handler.
(FirstPaint): remove the AddToPainter/RemoveFromPainter
runner.Tick hack, and just hook up to Events.Tick.
(BriefingRunner.Tick): change this to a Tick event handler from a
painter. Keep track of total elapsed, and change sleepUntil to an
int from a DateTime.
(EstablishingShot): new markup screen, used for showing the
establishing shot/text before the ready room is displayed.
* SCSharp/SCSharp.UI/MarkupScreen.cs (Paint): add handling for
PageLocation.LowerLeft.
(AddMarkup): add handling for </SCREENLOWERLEFT>.
(AddToPainter): remove the FirstPainted stuff from here. we'll
just use UIScreen's.
(RemoveFromPainter): same.
(FirstPaint): change FirstPainted to this, overriding UIScreen's.
* SCSharp/SCSharp.UI/UIScreen.cs (FirstPaint): emit our
FirstPainted event and remove the painter delegate.
(AddToPainter): add the FirstPaint delegate.
(RemoveFromPainter): remove the FirstPaint delegate.
* SCSharp/SCSharp.UI/MainMenu.cs (LoadResources): in the
intro_element delegate, remove the ifdefs. Just switch to the
cinematic. If it fails to play we'll return to the main menu.
* SCSharp/SCSharp.UI/SmackerPlayer.cs: catch the
DllNotFoundException if we couldn't load ffmpegglue.dll, and just
finish immediately in that case whenever someone plays a movie.
2006-05-15 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/ReadyRoomScreen.cs (FirstPaint): remove
unused function.
(UnhighlightPortrait): only set the background if the portrait is
still visible.
(ShowPortrait): set the portrait's background to the unhighlighted
frame.
(HidePortrait): clear the portrait's background.
* SCSharp/SCSharp.UI/Game.cs: better handle the differentiation
between "what mpqs do i have installed?" and "which version
(original/expansion) am i playing?" GlobalResources still doesn't
load both sets, however.
2006-05-14 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/ReadyRoomScreen.cs: why do i insist on
writing threaded code? there's no need for it here. Also, make
things work a lot better. highlight the current speaker, set the
background/font/effects/cursor stuff correctly.
* SCSharp/SCSharp.UI/RaceSelectionScreen.cs: use the tutorials for
protoss/terran. zerg doesn't work for some reason. there are no
triggers.
* SCSharp/SCSharp.UI/UIElement.cs: kind of a hack, but allow a
"background .pcx" to be supplied. it's used to highlight the
current speaker in the mission briefings.
2006-05-14 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.UI/GameScreen.cs (.ctor): add a constructor
that's useful from the readyroom.
(PlaceInitialUnits): deal with a null template, which happens with
campaigns.
* SCSharp/SCSharp.UI/RaceSelectionScreen.cs: make this work for
both broodwar and original race selection screens. Hardcode the
first scenarios for each campaign here as well - eventually
they'll come from mapdata.dat/tbl.
* SCSharp/SCSharp.UI/Game.cs (.ctor): don't add anything to the
mpq container - let the PlayingBroodWar setter do that.
(set_PlayingBroodWar): clean this up a bit.
(set_Race): add setter.
* SCSharp/SCSharp.UI/ReadyRoomScreen.cs: subclass ReadyRoomScreen
for each race, since at least the zerg screen has different
element indices. Write an initial pass of the briefing runner,
which displays text and plays .wav files. There are definite
threading + Sdl audio issues here.
* SCSharp/SCSharp.UI/Builtins.cs: replace the race specific ready
room strings with a formatable string.
* SCSharp/SCSharp.Mpq/IScriptBin.cs (GetScriptEntryOffset): don't
throw an exception here, just return 0. the caller can handle
that.
* SCSharp/SCSharp.Mpq/Chk.cs: add mission briefing support (add
trigger, condition, action classes).
* SCSharp/SCSharp.Mpq/Mpq.cs (Add): return if mpq == null.
(Remove): same.
(Clear): new function, call mpqs.Clear.
(GetStreamForResource): spew something if we're going to return
null.
2006-05-13 Chris Toshok <toshok@hungry.com>
* src/scsharp.cs (Main): switch from just 1 CD directory setting
to 2.
* src/scsharp.exe.config: add the new CD directory settings.
* SCSharp/SCSharp.UI/RaceSelectionScreen.cs (.ctor): load the
correct resource depending on if we're BW or SC.
* SCSharp/SCSharp.UI/Game.cs (.ctor): change the way we look for
and load mpq's. Keep track of both BW and SC install.exe's.
(PlayingBroodWar): this property is initialized to true if
broodat.mpq is found, and causes either the bw or sc cd to become
available for resource lookups.
* SCSharp/SCSharp.UI/MainMenu.cs (ShowGameDialog): add some code
to display a dialog if the user is missing the correct CD
install.exe.
* SCSharp/SCSharp.UI/LoginScreen.cs (ResourceLoader): we don't
cache the race selection screen anymore, as it changes depending
on whether you pick BW/SC.
* SCSharp/SCSharp.UI/PlayCustomScreen.cs (ResourceLoader): no more
cached race selection screen.
* SCSharp/SCSharp.UI/LoadSavedScreen.cs: same.
* SCSharp/SCSharp.UI/Builtins.cs: add the original campaign ui.
* SCSharp/SCSharp.UI/ButtonElement.cs (MouseEnter): only play the
sound if the button is sensitive -- maybe we shouldn't even get
called if we're insensitive?
* SCSharp/SCSharp.UI/MarkupScreen.cs (ResourceLoader): call
LoadMarkup, and add it as an abstract method.
* SCSharp/SCSharp.UI/CreditsScreen.cs (LoadMarkup): rename
ResourceLoader to this.
* SCSharp/SCSharp.UI/UIElement.cs (.ctor): cache x1/y1 here so the
setters so we don't keep modifying the BinElement's coordinates
each time we display a dialog, shifting it further and further
down and to the right.
(X1): use the cached value.
(Y1): same.
2006-05-13 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.dll.sources: add the MpqReader sources.
* SCSharp/Makefile.am (MCSFLAGS): add -d:USE_STORM_DLL
* SCSharp/SCSharp.Mpq/Mpq.cs: add a series of USE_STORM_DLL ifdefs
to choose between libStorm.so and Foole's managed MpqReader.
* SCSharp/SCSharp.Mpq/MpqStructs.cs,
SCSharp/SCSharp.Mpq/MpqArchive.cs,
SCSharp/SCSharp.Mpq/MpqStream.cs,
SCSharp/SCSharp.Mpq/PKLibDecompress.cs: add 0.02 of Foole's
managed Mpq reading code. It doesn't work quite yet, but this way
we can test it with scsharp.
2006-05-10 Chris Toshok <toshok@hungry.com>
* SCSharp/SCSharp.Mpq/Mpq.cs (GetResource): don't cache .smk files
(the cinematics at least are enormous).
(GetTypeFromResourcePath): make .smk files use a Stream instead of
our Smk class.
* SCSharp/SCSharp.UI/SmackerPlayer.cs: use FFmpeg to display .smk
files. This works on my machine, but lacks audio and the glue
code is in general pretty ugly. Going to take a look at using
gstreamer tonight. With this in mind, I'm not adding
SmackerPlayer.cs+Cinematic.cs to the build, and I'm not going to
check in the ffmpegglue code.
* SCSharp/SCSharp.UI/Cinematic.cs: new file, basically takes over
the screen and runs a SmackerPlayer.
* SCSharp/SCSharp.UI/ButtonElement.cs (MouseEnter): rename
MouseOver to this.
* SCSharp/SCSharp.UI/GuiUtil.cs (CreateSurface): make this public.
* SCSharp/SCSharp.UI/RaceSelectionScreen.cs (ResourceLoader): add
delegates for MouseEnter/MouseLeave to display the incomplete
messages. we always show them at the moment, instead of getting
that information from the .spc file.
* SCSharp/SCSharp.UI/MainMenu.cs (ShowGameModeDialog): factor this
code out from both the single/multiplayer delegates.
(ResourceLoader): add ifdef'ed code for the intro cinematic, and
use ShowGameModeDialog for single/multiplayer.
* SCSharp/SCSharp.UI/UIElement.cs: switch from MouseOver to
MouseEnter+MouseLeave.
* SCSharp/SCSharp.UI/UIScreen.cs: switch from MouseOver to
MouseEnter+MouseLeave so we can implement things like the strings
on the race selection screen where they tell you previous
campaigns haven't been completed yet.
(KeyboardDown): guard against Elements being null.
2006-05-08 Chris Toshok <toshok@hungry.com>