Announcement

Collapse
No announcement yet.

PROJECT: Altered source files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #91
    Perhaps helpful tools for coders on windows

    Hi,

    This weekend i went through the source and active code changes and looked for not sighted locations to be changed for a port.

    I compiled the code a few times and added additional cygwin tools to bin, which you perhaps might feel handy.

    From what i saw until know, i can just say: Wow, great work by you all!!!

    Upload service , Could not copy file to server
    Well, i'm too dizy and will go to bed now ;
    just download the scripts.zip and install cygwin yourself, selecting the packages containing these binaries (as listed in ctp2_bin.zip).

    Ciao
    Holger

    PS: List of files:
    [CODE]
    Archive: ctp2_bin.zip
    Length Date Time Name
    -------- ---- ---- ----
    82432 01-17-04 22:54 bin/bunzip2.exe
    57856 01-17-04 22:54 bin/byacc.exe
    82432 01-17-04 22:54 bin/bzip2.exe
    15360 01-17-04 22:54 bin/bzip2recover.exe
    778 01-17-04 22:54 bin/copy_libs.sh
    75264 01-17-04 22:54 bin/cp.exe
    980992 01-17-04 22:54 bin/cygiconv-2.dll
    22016 01-17-04 22:54 bin/cygintl-1.dll
    37888 01-17-04 22:54 bin/cygintl-2.dll
    21504 01-17-04 22:54 bin/cygintl.dll
    14335 01-17-04 22:54 bin/cygpath.exe
    64924 01-17-04 22:54 bin/cygpcre.dll
    22528 01-17-04 22:54 bin/cygpopt-0.dll
    971618 01-17-04 22:54 bin/cygwin1.dll
    109568 01-17-04 22:54 bin/diff.exe
    11781 01-17-04 22:54 bin/dos2unix.exe
    78848 01-17-04 22:54 bin/find.exe
    72 01-17-04 17:08 bin/fixrep
    154649 01-17-04 22:54 bin/flex++.exe
    154624 01-17-04 22:54 bin/flex.exe
    64924 01-17-04 22:54 bin/cygpcre.dll
    22528 01-17-04 22:54 bin/cygpopt-0.dll
    971618 01-17-04 22:54 bin/cygwin1.dll
    109568 01-17-04 22:54 bin/diff.exe
    11781 01-17-04 22:54 bin/dos2unix.exe
    78848 01-17-04 22:54 bin/find.exe
    72 01-17-04 17:08 bin/fixrep
    154649 01-17-04 22:54 bin/flex++.exe
    154624 01-17-04 22:54 bin/flex.exe
    85504 01-17-04 22:54 bin/grep.exe
    62976 01-17-04 22:54 bin/gunzip.exe
    62976 01-17-04 22:54 bin/gzip.exe
    147968 01-17-04 22:54 bin/make.exe
    30208 01-17-04 22:54 bin/mkdir.exe
    83456 01-17-04 22:54 bin/mv.exe
    96757 01-17-04 22:54 bin/patch.exe
    65536 01-17-04 22:54 bin/rm.exe
    90624 01-17-04 22:54 bin/sed.exe
    76800 01-17-04 22:54 bin/sh.exe
    223 01-17-04 22:54 bin/fix2unix.sh
    245 01-17-04 22:54 bin/rem_cvs_dirs.sh
    -------- -------
    3762742 32 files

    Archive: scripts.zip
    Length Date Time Name
    -------- ---- ---- ----
    778 01-17-04 22:54 bin/copy_libs.sh
    223 01-17-04 22:54 bin/fix2unix.sh
    245 01-17-04 22:54 bin/rem_cvs_dirs.sh
    -------- -------
    1246 3 files
    Attached Files

    Comment


    • #92
      4thmoon your files are still problematic, I tried to compile it as Western Version without the _JAPANESE flag, but at first I got an error in aui_bitmapfont.cpp line 499 I replaced this:

      TT_Char_Index( m_ttCharMap, c16 ),

      by:

      TT_Char_Index( m_ttCharMap, (uint16)uint8(c) ),

      Well that problem was solved and the code compiled very well, unfortunatly I now get not only one Great Libary assert but a lot and finally a access violation, I looked into that file and noticed that you used ACTIVISION_ORIGINAL instead of _JAPANESE, unfortunatly the asserts did not go away, so please test your files first so that you can be sure that a Westerb version is built without any problems.

      Edit: It is really the greatlibrary.cpp I only replaced that file with the last version and no problems.

      -Martin
      Last edited by Martin Gühmann; January 19, 2004, 12:41.
      Civ2 military advisor: "No complaints, Sir!"

      Comment


      • #93
        ..\ctp2_code\ui\interface\greatlibarywindow.cpp
        ..\ctp2_code\gs\slic\SlicStruct.cpp

        Two memory leaks were fixed.

        -Martin
        Attached Files
        Civ2 military advisor: "No complaints, Sir!"

        Comment


        • #94
          Bug fix: repaired some line graph memory leaks.
          [Edit: link removed, included in 2004-01-31 source]
          Last edited by Fromafar; February 1, 2004, 11:24.

          Comment


          • #95
            Bug fixes:
            - agreementmatrix.cpp: CtD prevented in the HasAgreement function
            - terrimprovementpool.cpp: CtD prevented when no sound has been defined for a tile improvement
            - Citywindow.cpp: unloaded buttons which caused an exit pop-up
            - SlicEngine.cpp/slicif.h/slicif.cpp: memory leak repaired.
            [Edit: link removed, included in 2004-01-31 source]
            Last edited by Fromafar; February 1, 2004, 11:25.

            Comment


            • #96
              ..\ctp2_code\gs\slic\SlicFrame.cpp
              ..\ctp2_code\gs\slic\SlicSymbol.cpp

              Fixed memory leak in SlicSymbol.cpp, by Martin Gühmann. Unfortunatly there is still more.
              Fixed memory leaks in SlicFrame, by Martin Gühmann.
              Replaced debug assertion for slic devision by zero by a SlicDebug=Yes message. It is not a problem in C++ code but in slic code, therefore it is a task for the slicer not for a C++ coder to write bug free slic code. (By Martin Gühmann)
              Make sure that all new slic messages for database access during runtime only appear with DebugSlic=Yes.

              -Martin
              Attached Files
              Civ2 military advisor: "No complaints, Sir!"

              Comment


              • #97
                Design improvement: made map wrap handling of the trade route computation consistent with the actual map type selection.

                [Edit: link removed, see next post]
                Last edited by Fromafar; January 30, 2004, 18:29.

                Comment


                • #98
                  ..\ctp2_code\gs\world\wldgen.cpp
                  ..\ctp2_code\gs\world\Cell.cpp
                  ..\ctp2_code\gs\world\Cell.h
                  ..\ctp2_code\robot\pathing\A_Star_Heuristic_Cost.c pp
                  ..\ctp2_code\robot\pathing\A_Star_Heuristic_Cost.h

                  Implemented World::CalcTerrainFreightCost by Martin Gühmann, now the Fright flags in terrain.txt and tileimp.txt are used. The path of trade routes now follows rivers, roads, railroads and maglevs, the path is now terrain dependent, too.

                  The wldgen.cpp is based on Fromafar's last version.
                  The star heuristic files are from Fromarfar's last download, I just added them to save you another download and make shure that you don't apply them in the wrong order . So it also map wrap handling of the trade route computation is now consistent with the actual map type selection.

                  -Martin
                  Attached Files
                  Civ2 military advisor: "No complaints, Sir!"

                  Comment


                  • #99
                    Bug fix: handled a CtD (stack overflow by infinite recursion) when the advances contain a loop in the prerequisite chain. Occurred (only) with the debug version in combination with the LoTR scenario.

                    gs\gameobj\Advances.cpp
                    gs\gameobj\Advances.h

                    [Edit: link removed, included in 2004-01-31 source]
                    Last edited by Fromafar; February 1, 2004, 11:26.

                    Comment


                    • For consistancies sake, I think these files should be dated, as per the standard, so that they can be applied in the correct order. The descriptive names are unhelpful in this regard.

                      Comment


                      • Originally posted by MrBaggins
                        For consistancies sake, I think these files should be dated, as per the standard, so that they can be applied in the correct order. The descriptive names are unhelpful in this regard.
                        So what format do you propose in particular, Mr Baggins?

                        -Martin
                        Civ2 military advisor: "No complaints, Sir!"

                        Comment


                        • Why not: name of the file_version_daymonthyear.extension

                          Example: AdvanceLoop_v01_300104.zip
                          "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                          Comment


                          • Perhaps the "ctp2sc1.2_2003.12.21_All.zip" format that Keygen was using. You could append a small description, like slic, or leaks or whatever, after the date, and before "_All" or "_Incr"

                            "_All" would mean it included all previous changes, and "_Incr" would mean it was an incremental change.

                            Comment


                            • You want the name to come after the date, so it would be correctly sorted in an alphabetical order.

                              Comment


                              • OK here is another all release containing all the files posted above, except any no CD cracks.

                                ..\ctp2_data\default\gamedata\Colors00.txt
                                ..\ctp2_code\gfx\gfx_utils\colorset.h

                                Color set expansion by Martin Gühmann: Up to 33 players are now supported with their own color.


                                ..\ctp2_code\gs\database\profileDB.h

                                Modified assert by Martin Gühmann to avoid an assersation falure when you set num players higher the 17.


                                ..\ctp2_code\ui\interface\spnewgameplayersscreen.c pp
                                ..\ctp2_code\ui\interface\spnewgameplayersscreen.h
                                ..\ctp2_code\ui\interface\dipwizard.cpp
                                ..\ctp2_code\ui\interface\dipwizard.h

                                Here I fixed something in the comments of the files to match the information more adequadly.


                                ..\ctp2_code\mapgen\Crater.cpp
                                ..\ctp2_code\gs\gameobj\Exclusions.cpp
                                ..\ctp2_data\XXXXXX\uidata\layouts\dipwizard.ldl

                                Where XXXXXX stands for english, french, german, italian or spanish.

                                Some small changes by Fromafar:

                                1. Bug fix: Exclusions.cpp, some cut & paste errors repaired.
                                2. Compatibility: Crater.cpp, removed unnecessary call to sqrt, making .NET compilation of the file succeed.
                                3. Bug fix: dipwizard.ldl, replaced a reference to a non-existing file updf01.tga (after consultation of Martin - included here to save him some work).
                                4. Intended functionality implementation: Alexander scenario.slc, replaced the code in the "doesn't work, grrrr..." function with something that seems to do the job.


                                ..\ctp2_code\ui\aui_ctp2\grabitem.cpp
                                ..\ctp2_code\ui\interface\spnewgamediffscreen.h
                                ..\ctp2_code\ui\interface\spnewgamemapshapescreen. h
                                ..\ctp2_code\ui\interface\spnewgamemapsizescreen.h
                                ..\ctp2_code\ui\interface\spnewgamerulesscreen.h
                                ..\ctp2_code\ui\interface\spnewgamescreen.h

                                Bug fix by Fromafar: The memory of most single player new game setup screens will be released before starting the game.


                                ..\ctp2_code\gs\slic\slic.y
                                ..\ctp2_code\gs\slic\y.tab.c
                                ..\ctp2_code\gs\slic\y.tab.h
                                ..\ctp2_code\gs\slic\slicif.h
                                ..\ctp2_code\gs\slic\slicif.cpp
                                ..\ctp2_code\gs\slic\SlicFrame.cpp
                                ..\ctp2_code\gs\slic\SlicDBConduit.h

                                Implemented feature of CTP2 v1.1: Slic Database Access and Slic Database Size Determination.
                                Slicers can now like in the CTP2 v.1.1 access the database and also access it like it is promissed by the slic documentaion, if a flag is not in the database you get now an error message instead of an crash. There is now also a way to access the size of an database.


                                ..\ctp2_code\ctp\c3.h
                                ..\ctp2_code\ctp\ctp2_utils\pointerlist.h
                                ..\ctp2_code\gfx\tilesys\ressourcemap.h
                                ..\ctp2_code\gfx\tilesys\ressourcemap.h
                                ..\ctp2_code\gs\dbgen\ctpdb.cpp
                                ..\ctp2_code\gs\gameobj\CivilisationData.h
                                ..\ctp2_code\gs\gameobj\ID.h
                                ..\ctp2_code\gs\world\MapPoint.h
                                ..\ctp2_code\ui\aui_common\aui_action.h
                                ..\ctp2_code\ui\aui_common\aui_button.h
                                ..\ctp2_code\ui\aui_common\aui_control.h
                                ..\ctp2_code\ui\aui_common\aui_dragdropwindow.h
                                ..\ctp2_code\ui\aui_common\aui_dropdown.h
                                ..\ctp2_code\ui\aui_common\aui_listbox.h
                                ..\ctp2_code\ui\aui_common\aui_radio.h
                                ..\ctp2_code\ui\aui_common\aui_ranger.h
                                ..\ctp2_code\ui\aui_common\aui_region.h
                                ..\ctp2_code\ui\aui_common\aui_resource.h
                                ..\ctp2_code\ui\aui_common\aui_switch.h
                                ..\ctp2_code\ui\aui_common\aui_switchgroup.h
                                ..\ctp2_code\ui\aui_common\aui_tab.h
                                ..\ctp2_code\ui\aui_common\aui_textfeld.h
                                ..\ctp2_code\ui\aui_common\aui_thumb.h
                                ..\ctp2_code\ui\aui_common\aui_ui.h
                                ..\ctp2_code\ui\aui_common\aui_win.h
                                ..\ctp2_code\ui\aui_common\aui_window.h
                                ..\ctp2_code\ui\aui_common\tech_memory.h
                                ..\ctp2_code\ui\aui_ctp2\background.h
                                ..\ctp2_code\ui\aui_ctp2\c3_coloriconbutton.h
                                ..\ctp2_code\ui\aui_ctp2\c3_fancywindow.h
                                ..\ctp2_code\ui\aui_ctp2\c3_hypertextbox.h
                                ..\ctp2_code\ui\aui_ctp2\c3_static.h
                                ..\ctp2_code\ui\aui_ctp2\c3fancywindow.h
                                ..\ctp2_code\ui\aui_ctp2\c3slider.h
                                ..\ctp2_code\ui\aui_ctp2\coloriconbutton.h
                                ..\ctp2_code\ui\aui_ctp2\ctp2_button.h
                                ..\ctp2_code\ui\aui_ctp2\ctp2_hypertextbox.h
                                ..\ctp2_code\ui\aui_ctp2\ctp2_listbox.h
                                ..\ctp2_code\ui\aui_ctp2\ctp2_MenuButton.h
                                ..\ctp2_code\ui\aui_ctp2\ctp2_Static.h
                                ..\ctp2_code\ui\aui_ctp2\ctp2_Switch.h
                                ..\ctp2_code\ui\aui_ctp2\ctp2_Window.h
                                ..\ctp2_code\ui\aui_ctp2\radarmap.h
                                ..\ctp2_code\ui\aui_ctp2\thronecotrol.h
                                ..\ctp2_code\ui\aui_ctp2\thumbnailmap.h
                                ..\ctp2_code\ui\interface\messageadvice.h
                                ..\ctp2_code\ui\interface\messageiconbutton.h
                                ..\ctp2_code\ui\interface\messagemodal.h
                                ..\ctp2_code\ui\interface\workwindow.h

                                A set of syntax corrections for compilation on other compilers than MS VC++ by Fromafar. These files do not contain any functional changes.

                                Compilation with MS VC++ 6.0 is still possible - and has been tested.

                                : This set is incomplete, and will not enable you to generate the main CTP executable without making additional changes yourself.


                                ..\ctp2_code\ctp\civapp.cpp
                                ..\ctp2_code\ctp\civctp_j.dsw
                                ..\ctp2_code\ctp\civctp_j.dsp
                                ..\ctp2_code\gs\fileio\Token.cpp
                                ..\ctp2_code\gs\utility\stringutils.cpp
                                ..\ctp2_code\gs\utility\japanese.h
                                ..\ctp2_code\ui\aui_common\aui_bitmapfont.cpp
                                ..\ctp2_code\ui\aui_common\aui_bitmapfont.h
                                ..\ctp2_code\ui\interface\greatlibrary.cpp
                                ..\ctp2_code\ui\interface\loadsavewindow.cpp
                                ..\ctp2_data\japanese\gamedata\add_str.txt
                                ..\ctp2_data\japanese\gamedata\ldl_str.txt
                                ..\ctp2_data\japanese\uidata\layouts\citystatus.ld l
                                ..\ctp2_data\japanese\uidata\layouts\dipwizard.ldl
                                ..\ctp2_data\japanese\uidata\layouts\ns_strings.ld l
                                ..\ctp2_data\japanese\uidata\layouts\scenarioedito r.ldl
                                ..\ctp2_data\japanese\uidata\layouts\science.ldl
                                ..\ctp2_data\japanese\uidata\layouts\spnewgame.ldl
                                ..\ctp2_data\japanese\uidata\layouts\spnewgamepopu ps.ldl

                                Japanese source and text files by 4thmoon, note that I changed the path of the Japanese specific text files from ..\ctp2_data\english\ to ..\ctp2_data\japanese\ to ensure compartibility with the other text files. To make it work on a Japanese CTP2 you have to to rename all the folders with the name "english" to "japanese" you find within the CTP2 folders. Then you have to find the civpath.txt's on your system, if you don't have the source code you find one file in your ..\ctp2_program\ctp\ folder. Open this file there you find a line containing "english", replace "english" with "japanese". If you have installed the source code you find another file with that name in your, ..\ctp2_code\ctp\ folder, modify it in the same way as the other file.

                                Another note I got a problem in line 499 of aui_bitmapfont.cpp when compiling as Western version, therefore I changed that line:

                                TT_Char_Index( m_ttCharMap, c16 ),

                                To:

                                TT_Char_Index( m_ttCharMap, (uint16)uint8(c) ),

                                I also had some problems with the Great Libary the changes for the Japanese version only were marked in the greatlibrary.cpp were labled with #if defined(ACTIVISION_ORIGINAL) instead of #if !defined(_JAPANESE). So now I the files can generate a separate Japanese and a seperate European language version. The final solution should still be a version for all languages I think of a flag in userprofile: Japanese=Yes/No. If set to yes the Japanese specific code is used, otherwise the non Japanese specific code is used.


                                ../bin/rem_cvs_dirs.sh
                                ../bin/fix2unix.sh
                                ../bin/copy_libs.sh

                                Some UNIX scripts by ctplinuxfan aka Holger, for more peices of information see this post.


                                ..\ctp2_code\ui\interface\greatlibarywindow.cpp
                                ..\ctp2_code\gs\slic\SlicStruct.cpp

                                Two memory leaks were fixed.


                                ..\ctp2_code\ui\aui_common\aui_surface.h
                                ..\ctp2_code\ui\aui_common\aui_surface.cpp
                                ..\ctp2_code\ui\aui_ctp2\linegraph.cpp

                                Bug fix by Fromafar: Repaired some line graph memory leaks.


                                ..\ctp2_code\ai\diplomacy\agreementmatrix.cpp
                                ..\ctp2_code\gs\gameobj\TerrimprovementPool.cpp
                                ..\ctp2_code\gs\slic\SlicEngine.cpp
                                ..\ctp2_code\gs\slic\slicif.h
                                ..\ctp2_code\gs\slic\slicif.cpp
                                ..\ctp2_code\ui\interface\Citywindow.cpp

                                Bug fixes:
                                - agreementmatrix.cpp: CtD prevented in the HasAgreement function
                                - terrimprovementpool.cpp: CtD prevented when no sound has been defined for a tile improvement
                                - Citywindow.cpp: unloaded buttons which caused an exit pop-up
                                - SlicEngine.cpp/slicif.h/slicif.cpp: memory leak repaired.

                                CtD: Crash to Desktop


                                ..\ctp2_code\gs\slic\SlicFrame.cpp
                                ..\ctp2_code\gs\slic\SlicSymbol.cpp

                                Fixed memory leak in SlicSymbol.cpp, by Martin Gühmann. Unfortunatly there is still more.
                                Fixed memory leaks in SlicFrame, by Martin Gühmann.
                                Replaced debug assertion for slic devision by zero by a SlicDebug=Yes message. It is not a problem in C++ code but in slic code, therefore it is a task for the slicer not for a C++ coder to write bug free slic code. (By Martin Gühmann)
                                Make sure that all new slic messages for database access during runtime only appear with DebugSlic=Yes.


                                ..\ctp2_code\gs\world\wldgen.cpp
                                ..\ctp2_code\gs\world\Cell.cpp
                                ..\ctp2_code\gs\world\Cell.h
                                ..\ctp2_code\robot\pathing\A_Star_Heuristic_Cost.c pp
                                ..\ctp2_code\robot\pathing\A_Star_Heuristic_Cost.h

                                Implemented World::CalcTerrainFreightCost by Martin Gühmann, now the Fright flags in terrain.txt and tileimp.txt are used. The path of trade routes now follows rivers, roads, railroads and maglevs, the path is now terrain dependent, too.

                                The wldgen.cpp is based on Fromafar's last version.
                                The star heuristic files are from Fromarfar's last download, I just added them to save you another download and make shure that you don't apply them in the wrong order . So it also map wrap handling of the trade route computation is now consistent with the actual map type selection.


                                ..\ctp2_code\gs\gameobj\Advances.cpp
                                ..\ctp2_code\gs\gameobj\Advances.h

                                Bug fix by Fromafar: handled a CtD (stack overflow by infinite recursion) when the advances contain a loop in the prerequisite chain. Occurred (only) with the debug version in combination with the LoTR scenario.

                                OK let's try a naming style, I think we don't need the version number, because we don't release several files per day with the same name: So far I don't know if the upload server works so I use an external link:

                                [Edit: Link removed see first post for the lastest source pack.]

                                -Martin
                                Last edited by Martin Gühmann; June 5, 2004, 17:04.
                                Civ2 military advisor: "No complaints, Sir!"

                                Comment

                                Working...
                                X