commit 8552ac617c9e51b9cbe847ca05dfc292d76f58fd Author: Karl Date: Wed Mar 9 01:31:56 2005 +0000 Import from old repository git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@1 67975925-1194-0748-b3d5-c16f83f1a3a1 diff --git a/main/1024_textscheme.txt b/main/1024_textscheme.txt new file mode 100644 index 00000000..b762d6d3 --- /dev/null +++ b/main/1024_textscheme.txt @@ -0,0 +1,96 @@ +//1024x768 text scheme file + +// Pie menu for marines +SchemeName = "PieMenuScheme" +FontName = "Arial" +FontSize = 16 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Minimap, radar +SchemeName = "HierarchyScheme" +FontName = "Helvetica" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "40 40 40 128" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 0" + +// Particle editing +SchemeName = "PSEScheme" +FontName = "Arial" +FontSize = 34 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Overwatch +SchemeName = "OverwatchScheme" +FontName = "Arial" +FontSize = 34 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Action buttons in lower right +SchemeName = "ActionButtonScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "CommanderStatusScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "MarineStatusScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "0 153 255 255" +BgColor = "0 0 0 0" + +// Scoreboard title +SchemeName = "Scoreboard Title Text" +FontName = "Arial" +FontSize = 21 +FgColor = "243 252 10 255" +BgColor = "0 0 0 0" + +// Scoreboard text (ignores color, uses hard-coded team color instead) +SchemeName = "Scoreboard Small Text" +FontName = "Arial" +FontSize = 16 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Tiny text (used for number of players) +SchemeName = "Scoreboard Tiny Text" +FontName = "Arial" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + + + +// Research area, pop-up text for action buttons +//SchemeName = "MiddleHelpScheme" +//FontName = "Helvetica" +//FontSize = 14 +//FgColor = "172 244 255 255" +//BgColor = "0 0 0 0" + +// Make the logout button obvious +//SchemeName = "LogoutButtonScheme" +//FontName = "Arial" +//FontSize = 34 +//FgColor = "255 255 255 255" +//BgColor = "0 0 0 0" + diff --git a/main/1152_textscheme.txt b/main/1152_textscheme.txt new file mode 100644 index 00000000..aacb6f76 --- /dev/null +++ b/main/1152_textscheme.txt @@ -0,0 +1,100 @@ +//1152x864 text scheme file + +// Pie menu for marines +SchemeName = "PieMenuScheme" +FontName = "Arial" +FontSize = 16 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Minimap, radar +SchemeName = "HierarchyScheme" +FontName = "Helvetica" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "40 40 40 128" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 0" + +// Particle editing +SchemeName = "PSEScheme" +FontName = "Arial" +FontSize = 34 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Overwatch +SchemeName = "OverwatchScheme" +FontName = "Arial" +FontSize = 34 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Action buttons in lower right +SchemeName = "ActionButtonScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "CommanderStatusScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "MarineStatusScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "0 153 255 255" +BgColor = "0 0 0 0" + +// Scoreboard title +SchemeName = "Scoreboard Title Text" +FontName = "Arial" +FontSize = 21 +FgColor = "243 252 10 255" +BgColor = "0 0 0 0" + +// Scoreboard text (ignores color, uses hard-coded team color instead) +SchemeName = "Scoreboard Small Text" +FontName = "Arial" +FontSize = 16 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Tiny text (used for number of players) +SchemeName = "Scoreboard Tiny Text" +FontName = "Arial" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + + + +// Research area, pop-up text for action buttons +//SchemeName = "MiddleHelpScheme" +//FontName = "Helvetica" +//FontSize = 14 +//FgColor = "172 244 255 255" +//BgColor = "0 0 0 0" + +// Make the logout button obvious +//SchemeName = "LogoutButtonScheme" +//FontName = "Arial" +//FontSize = 34 +//FgColor = "255 255 255 255" +//BgColor = "0 0 0 0" + + + + + diff --git a/main/1280_textscheme.txt b/main/1280_textscheme.txt new file mode 100644 index 00000000..68f0614f --- /dev/null +++ b/main/1280_textscheme.txt @@ -0,0 +1,95 @@ +//1280x960 text scheme file + +// Pie menu for marines +SchemeName = "PieMenuScheme" +FontName = "Arial" +FontSize = 16 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Minimap, radar +SchemeName = "HierarchyScheme" +FontName = "Helvetica" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "40 40 40 128" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 0" + +// Particle editing +SchemeName = "PSEScheme" +FontName = "Arial" +FontSize = 34 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Overwatch +SchemeName = "OverwatchScheme" +FontName = "Arial" +FontSize = 34 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Action buttons in lower right +SchemeName = "ActionButtonScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "CommanderStatusScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +SchemeName = "MarineStatusScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "0 153 255 255" +BgColor = "0 0 0 0" + +// Scoreboard title +SchemeName = "Scoreboard Title Text" +FontName = "Arial" +FontSize = 21 +FgColor = "243 252 10 255" +BgColor = "0 0 0 0" + +// Scoreboard text (ignores color, uses hard-coded team color instead) +SchemeName = "Scoreboard Small Text" +FontName = "Arial" +FontSize = 16 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Tiny text (used for number of players) +SchemeName = "Scoreboard Tiny Text" +FontName = "Arial" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + + + +// Research area, pop-up text for action buttons +//SchemeName = "MiddleHelpScheme" +//FontName = "Helvetica" +//FontSize = 14 +//FgColor = "172 244 255 255" +//BgColor = "0 0 0 0" + +// Make the logout button obvious +//SchemeName = "LogoutButtonScheme" +//FontName = "Arial" +//FontSize = 34 +//FgColor = "255 255 255 255" +//BgColor = "0 0 0 0" + diff --git a/main/1600_textscheme.txt b/main/1600_textscheme.txt new file mode 100644 index 00000000..d5c92f65 --- /dev/null +++ b/main/1600_textscheme.txt @@ -0,0 +1,95 @@ +//1600x1200 text scheme file + +// Pie menu for marines +SchemeName = "PieMenuScheme" +FontName = "Arial" +FontSize = 16 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Minimap, radar +SchemeName = "HierarchyScheme" +FontName = "Helvetica" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "40 40 40 128" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 0" + +// Particle editing +SchemeName = "PSEScheme" +FontName = "Arial" +FontSize = 34 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Overwatch +SchemeName = "OverwatchScheme" +FontName = "Arial" +FontSize = 34 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Action buttons in lower right +SchemeName = "ActionButtonScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "CommanderStatusScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +SchemeName = "MarineStatusScheme" +FontName = "Arial" +FontSize = 21 +FgColor = "0 153 255 255" +BgColor = "0 0 0 0" + +// Scoreboard title +SchemeName = "Scoreboard Title Text" +FontName = "Arial" +FontSize = 21 +FgColor = "243 252 10 255" +BgColor = "0 0 0 0" + +// Scoreboard text (ignores color, uses hard-coded team color instead) +SchemeName = "Scoreboard Small Text" +FontName = "Arial" +FontSize = 16 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Tiny text (used for number of players) +SchemeName = "Scoreboard Tiny Text" +FontName = "Arial" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + + + +// Research area, pop-up text for action buttons +//SchemeName = "MiddleHelpScheme" +//FontName = "Helvetica" +//FontSize = 14 +//FgColor = "172 244 255 255" +//BgColor = "0 0 0 0" + +// Make the logout button obvious +//SchemeName = "LogoutButtonScheme" +//FontName = "Arial" +//FontSize = 34 +//FgColor = "255 255 255 255" +//BgColor = "0 0 0 0" + diff --git a/main/320_textscheme.txt b/main/320_textscheme.txt new file mode 100644 index 00000000..8733d6c1 --- /dev/null +++ b/main/320_textscheme.txt @@ -0,0 +1,93 @@ +// 320x240 text scheme file + +// DEFAULT BUTTON TEXT +SchemeName = "PieMenuScheme" +FontName = "Helvetica" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Minimap, radar +SchemeName = "HierarchyScheme" +FontName = "Helvetica" +FontSize = 5 +FgColor = "255 170 0 255" +BgColor = "40 40 40 128" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 0" + + +// Particle editing +SchemeName = "PSEScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Overwatch +SchemeName = "OverwatchScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Action buttons in lower right +SchemeName = "ActionButtonScheme" +FontName = "Arial Bold" +FontSize = 7 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "CommanderStatusScheme" +FontName = "Arial Bold" +FontSize = 7 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +SchemeName = "MarineStatusScheme" +FontName = "Arial Bold" +FontSize = 7 +FgColor = "0 153 255 255" +BgColor = "0 0 0 0" + +// Scoreboard title +SchemeName = "Scoreboard Title Text" +FontName = "Arial Bold" +FontSize = 7 +FgColor = "243 252 10 255" +BgColor = "0 0 0 0" + +// Scoreboard text (ignores color, uses hard-coded team color instead) +SchemeName = "Scoreboard Small Text" +FontName = "Arial" +FontSize = 7 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Tiny text (used for number of players) +SchemeName = "Scoreboard Tiny Text" +FontName = "Arial" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Research area, pop-up text for action buttons +//SchemeName = "MiddleHelpScheme" +//FontName = "Helvetica" +//FontSize = 14 +//FgColor = "172 244 255 255" +//BgColor = "0 0 0 0" + +// Make the logout button obvious +//SchemeName = "LogoutButtonScheme" +//FontName = "Arial" +//FontSize = 34 +//FgColor = "255 255 255 255" +//BgColor = "0 0 0 0" diff --git a/main/400_textscheme.txt b/main/400_textscheme.txt new file mode 100644 index 00000000..b5829e09 --- /dev/null +++ b/main/400_textscheme.txt @@ -0,0 +1,93 @@ +// 400x300 text scheme file + +// DEFAULT BUTTON TEXT +SchemeName = "PieMenuScheme" +FontName = "Helvetica" +FontSize = 15 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Minimap, radar +SchemeName = "HierarchyScheme" +FontName = "Helvetica" +FontSize = 5 +FgColor = "255 170 0 255" +BgColor = "40 40 40 128" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 0" + + +// Particle editing +SchemeName = "PSEScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Overwatch +SchemeName = "OverwatchScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Action buttons in lower right +SchemeName = "ActionButtonScheme" +FontName = "Arial Bold" +FontSize = 7 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "CommanderStatusScheme" +FontName = "Arial Bold" +FontSize = 7 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +SchemeName = "MarineStatusScheme" +FontName = "Arial Bold" +FontSize = 7 +FgColor = "0 153 255 255" +BgColor = "0 0 0 0" + +// Scoreboard title +SchemeName = "Scoreboard Title Text" +FontName = "Arial Bold" +FontSize = 7 +FgColor = "243 252 10 255" +BgColor = "0 0 0 0" + +// Scoreboard text (ignores color, uses hard-coded team color instead) +SchemeName = "Scoreboard Small Text" +FontName = "Arial" +FontSize = 7 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Tiny text (used for number of players) +SchemeName = "Scoreboard Tiny Text" +FontName = "Arial" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Research area, pop-up text for action buttons +//SchemeName = "MiddleHelpScheme" +//FontName = "Helvetica" +//FontSize = 14 +//FgColor = "172 244 255 255" +//BgColor = "0 0 0 0" + +// Make the logout button obvious +//SchemeName = "LogoutButtonScheme" +//FontName = "Arial" +//FontSize = 34 +//FgColor = "255 255 255 255" +//BgColor = "0 0 0 0" diff --git a/main/512_textscheme.txt b/main/512_textscheme.txt new file mode 100644 index 00000000..5cccbca2 --- /dev/null +++ b/main/512_textscheme.txt @@ -0,0 +1,95 @@ +// 512x384 text scheme file + +// Pie menu for marines +SchemeName = "PieMenuScheme" +FontName = "Arial" +FontSize = 8 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Minimap, radar +SchemeName = "HierarchyScheme" +FontName = "Helvetica" +FontSize = 8 +FgColor = "255 170 0 255" +BgColor = "40 40 40 128" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 0" + +// Particle editing +SchemeName = "PSEScheme" +FontName = "Arial" +FontSize = 14 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Overwatch +SchemeName = "OverwatchScheme" +FontName = "Arial" +FontSize = 20 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Action buttons in lower right +SchemeName = "ActionButtonScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "CommanderStatusScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +SchemeName = "MarineStatusScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "0 153 255 255" +BgColor = "0 0 0 0" + +// Scoreboard title +SchemeName = "Scoreboard Title Text" +FontName = "Arial" +FontSize = 8 +FgColor = "243 252 10 255" +BgColor = "0 0 0 0" + +// Scoreboard text (ignores color, uses hard-coded team color instead) +SchemeName = "Scoreboard Small Text" +FontName = "Arial" +FontSize = 6 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Tiny text (used for number of players) +SchemeName = "Scoreboard Tiny Text" +FontName = "Arial" +FontSize = 6 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + + + +// Research area, pop-up text for action buttons +//SchemeName = "MiddleHelpScheme" +//FontName = "Helvetica" +//FontSize = 14 +//FgColor = "172 244 255 255" +//BgColor = "0 0 0 0" + +// Make the logout button obvious +//SchemeName = "LogoutButtonScheme" +//FontName = "Arial" +//FontSize = 34 +//FgColor = "255 255 255 255" +//BgColor = "0 0 0 0" + diff --git a/main/640_textscheme.txt b/main/640_textscheme.txt new file mode 100644 index 00000000..1c0fd296 --- /dev/null +++ b/main/640_textscheme.txt @@ -0,0 +1,96 @@ +// 640x480 text scheme file + +// Pie menu for marines +SchemeName = "PieMenuScheme" +FontName = "Arial" +FontSize = 4 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Minimap, radar +SchemeName = "HierarchyScheme" +FontName = "Helvetica" +FontSize = 8 +FgColor = "255 170 0 255" +BgColor = "40 40 40 128" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 0" + +// Particle editing +SchemeName = "PSEScheme" +FontName = "Arial" +FontSize = 14 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Overwatch +SchemeName = "OverwatchScheme" +FontName = "Arial" +FontSize = 20 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Action buttons in lower right +SchemeName = "ActionButtonScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "CommanderStatusScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "MarineStatusScheme" +FontName = "Arial" +FontSize = 10 +FgColor = "0 153 255 255" +BgColor = "0 0 0 0" + +// Scoreboard title +SchemeName = "Scoreboard Title Text" +FontName = "Arial" +FontSize = 10 +FgColor = "243 252 10 255" +BgColor = "0 0 0 0" + +// Scoreboard text (ignores color, uses hard-coded team color instead) +SchemeName = "Scoreboard Small Text" +FontName = "Arial" +FontSize = 6 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Tiny text (used for number of players) +SchemeName = "Scoreboard Tiny Text" +FontName = "Arial" +FontSize = 6 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + + + +// Research area, pop-up text for action buttons +//SchemeName = "MiddleHelpScheme" +//FontName = "Helvetica" +//FontSize = 14 +//FgColor = "172 244 255 255" +//BgColor = "0 0 0 0" + +// Make the logout button obvious +//SchemeName = "LogoutButtonScheme" +//FontName = "Arial" +//FontSize = 34 +//FgColor = "255 255 255 255" +//BgColor = "0 0 0 0" + diff --git a/main/800_textscheme.txt b/main/800_textscheme.txt new file mode 100644 index 00000000..6450c9c4 --- /dev/null +++ b/main/800_textscheme.txt @@ -0,0 +1,95 @@ +// 800x600 text scheme file + +// Pie menu for marines +SchemeName = "PieMenuScheme" +FontName = "Arial" +FontSize = 12 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Minimap, radar +SchemeName = "HierarchyScheme" +FontName = "Helvetica" +FontSize = 10 +FgColor = "255 170 0 255" +BgColor = "40 40 40 128" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 0" + +// Particle editing +SchemeName = "PSEScheme" +FontName = "Arial" +FontSize = 28 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Overwatch +SchemeName = "OverwatchScheme" +FontName = "Arial" +FontSize = 28 +FgColor = "240 179 17 255" +BgColor = "50 50 50 141" + +// Action buttons in lower right +SchemeName = "ActionButtonScheme" +FontName = "Arial" +FontSize = 18 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +// Upper left resources, reinforcements +SchemeName = "CommanderStatusScheme" +FontName = "Arial" +FontSize = 18 +FgColor = "172 244 255 255" +BgColor = "0 0 0 0" + +SchemeName = "MarineStatusScheme" +FontName = "Arial" +FontSize = 18 +FgColor = "0 153 255 255" +BgColor = "0 0 0 0" + +// Scoreboard title +SchemeName = "Scoreboard Title Text" +FontName = "Arial" +FontSize = 18 +FgColor = "243 252 10 255" +BgColor = "0 0 0 0" + +// Scoreboard text (ignores color, uses hard-coded team color instead) +SchemeName = "Scoreboard Small Text" +FontName = "Arial" +FontSize = 14 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + +// Tiny text (used for number of players) +SchemeName = "Scoreboard Tiny Text" +FontName = "Arial" +FontSize = 8 +FgColor = "255 170 0 255" +BgColor = "0 0 0 141" +FgColorArmed = "255 255 255 255" +BgColorArmed = "255 170 0 67" + + + +// Research area, pop-up text for action buttons +//SchemeName = "MiddleHelpScheme" +//FontName = "Helvetica" +//FontSize = 14 +//FgColor = "172 244 255 255" +//BgColor = "0 0 0 0" + +// Make the logout button obvious +//SchemeName = "LogoutButtonScheme" +//FontName = "Arial" +//FontSize = 34 +//FgColor = "255 255 255 255" +//BgColor = "0 0 0 0" + diff --git a/main/Balance.txt b/main/Balance.txt new file mode 100644 index 00000000..52bb5ed4 --- /dev/null +++ b/main/Balance.txt @@ -0,0 +1,459 @@ +// Automatically generated file. Last created 02/07/05, 23:08:45. + +// Integer data +#define kAcidRocketDamage 25 +#define kAcidRocketRadius 165 +#define kActiveNodesMessageUpdateTime 0 +#define kAdvArmoryHealth 4000 +#define kAlienCelerityBonus 25 +#define kAlienChamberMaxPlayers 3 +#define kAlienFlashlightRange 200 +#define kAlienResourceTowerBuildTime 20 +#define kAlienResourceTowerCost 15 +#define kAlienResourceTowerHealth 2500 +#define kAlienResourceTowerSoundDelayTime 60 +#define kAlienRespawnPlayerModifier 6 +#define kAlienRespawnTime 7 +#define kAmmoCost 1 +#define kArmorDropRange 300 +#define kArmorOneResearchCost 20 +#define kArmorOneResearchTime 60 +#define kArmorThreeResearchCost 40 +#define kArmorThreeResearchTime 120 +#define kArmorTwoResearchCost 30 +#define kArmorTwoResearchTime 90 +#define kArmoryBuildDistance 300 +#define kArmoryBuildTime 15 +#define kArmoryCost 10 +#define kArmoryHealth 2400 +#define kArmoryUpgradeCost 30 +#define kArmoryUpgradeTime 180 +#define kArmsLabBuildTime 19 +#define kArmsLabCost 25 +#define kArmsLabHealth 2200 +#define kBalanceAverageTeamSize 6 +#define kBalanceFuncResourceTime 15 +#define kBalanceHiveDistance 2500 +#define kBalanceNodeDistance 1200 +#define kBalanceNumGorges 1 +#define kBasePlayerSpeed 150 +#define kBileBombDamage 200 +#define kBileBombRadius 200 +#define kBite2Damage 60 +#define kBiteDamage 75 +#define kBiteRange 60 +#define kBuildingVisibilityRadius 1000 +#define kCatalystCost 3 +#define kCatalystDuration 8 +#define kCatalystResearchCost 20 +#define kCatalystResearchTime 40 +#define kChargeDamage 320 +#define kClawsDamage 90 +#define kCombatBaseExperience 100 +#define kCombatBaseRespawnTime 5 +#define kCombatExperienceBaseAward 60 +#define kCombatExperienceCrowdAward 10 +#define kCombatExperienceLevelAward 10 +#define kCombatFriendlyNearbyRange 500 +#define kCombatLevelHealthIncrease 0 +#define kCombatLevelSpeedIncrease 10 +#define kCombatLevelupArmorIncreasePercent 0 +#define kCombatLevelupHealthIncreasePercent 0 +#define kCombatMaxPlayersPerWave 5 +#define kCombatObjectiveExperienceScalar 600 +#define kCombatRespawnScalar 9 +#define kCombatSpawnClips 2 +#define kCombatThresholdRespawnTime 3 +#define kCombatThresholdTeamSize 8 +#define kCombatTimeLimit 300 +#define kCombatWeaponStayTime 0 +#define kCommandStationBuildDistance 400 +#define kCommandStationBuildTime 15 +#define kCommandStationCost 20 +#define kCommandStationHealth 10000 +#define kCommandStationReuseTime 5 +#define kCommanderPlayerSpeed 4000 +#define kCustomIconColorLength 3 +#define kCustomIconNameLength 5 +#define kDebugAnimations 1 +#define kDebugServerCaching 1 +#define kDebugShowEntityLog 1 +#define kDefenseChamberBuildTime 20 +#define kDefenseChamberCost 10 +#define kDefenseChamberHealth 1200 +#define kDefenseChamberThinkInterval 2 +#define kDefensiveChamberHealRange 400 +#define kDefensiveChamberRegenAmount 10 +#define kDevourDamage 3 +#define kDevourRange 100 +#define kDistressBeaconCost 15 +#define kDistressBeaconRange 600 +#define kDistressBeaconTime 3 +#define kDivineWindDamage 200 +#define kDivineWindRadius 500 +#define kElectricalDamage 20 +#define kElectricalMaxTargets 2 +#define kElectricalRange 200 +#define kElectricalUpgradeResearchCost 30 +#define kElectricalUpgradeResearchTime 30 +#define kEnsnareTime 2 +#define kEvolutionCost 0 +#define kEvolutionGestateTime 2 +#define kFadeArmorUpgrade 100 +#define kFadeBaseArmor 150 +#define kFadeBaseSpeed 240 +#define kFadeCost 50 +#define kFadeGestateTime 23 +#define kFadeHealth 300 +#define kFootstepFadeScalar 1300 +#define kFootstepGorgeScalar 500 +#define kFootstepHeavyScalar 1020 +#define kFootstepLerkScalar 1000 +#define kFootstepMarineScalar 800 +#define kFootstepOnosScalar 1200 +#define kFootstepSkulkScalar 800 +#define kFuncResourceInjectionAmount 1 +#define kFuncResourceInjectionTime 4 +#define kGGMaxAmmo 30 +#define kGGMaxClip 4 +#define kGameDownloadSize 150 +#define kGameHDSpaceNeeded 300 +#define kGameVersionMajor 3 +#define kGameVersionMinor 0 +#define kGestateBaseArmor 150 +#define kGestateHealth 200 +#define kGorgeArmorUpgrade 50 +#define kGorgeBaseArmor 50 +#define kGorgeBaseSpeed 170 +#define kGorgeCost 10 +#define kGorgeGestateTime 17 +#define kGorgeHealth 150 +#define kGrenDetonateTime 2 +#define kGrenadeDamage 125 +#define kGrenadeForce 800 +#define kGrenadeLauncherCost 15 +#define kGrenadeRadius 350 +#define kGrenadesResearchCost 20 +#define kGrenadesResearchTime 45 +#define kHGDamage 20 +#define kHGMaxAmmo 30 +#define kHGMaxClip 10 +#define kHMGCost 15 +#define kHMGDamage 20 +#define kHMGMaxAmmo 250 +#define kHMGMaxClip 125 +#define kHandGrenadeDamage 100 +#define kHandGrenadeMaxAmmo 1 +#define kHealingSprayBuildableScalar 5 +#define kHealingSprayDamage 13 +#define kHealingSprayPlayerPercent 4 +#define kHealthCost 2 +#define kHealthResearchCost 15 +#define kHealthResearchTime 20 +#define kHeavyArmorAbsorbPercent 95 +#define kHeavyArmorCost 15 +#define kHeavyArmorResearchCost 40 +#define kHeavyArmorResearchTime 100 +#define kHiveBuildTime 180 +#define kHiveCost 40 +#define kHiveHealRadius 500 +#define kHiveHealth 7000 +#define kHiveRegenerationAmount 2 +#define kInfantryPortalBuildTime 10 +#define kInfantryPortalCost 20 +#define kInfantryPortalHealth 2500 +#define kJetpackCost 15 +#define kJetpacksResearchCost 35 +#define kJetpacksResearchTime 50 +#define kKNDamage 30 +#define kKillRewardMax 3 +#define kKillRewardMin 1 +#define kLeapDamage 80 +#define kLerkArmorUpgrade 30 +#define kLerkBaseArmor 30 +#define kLerkBaseSpeed 175 +#define kLerkCost 30 +#define kLerkGestateTime 20 +#define kLerkHealth 125 +#define kMGDamage 10 +#define kMGMaxAmmo 250 +#define kMGMaxClip 50 +#define kMarineArmorUpgrade 60 +#define kMarineBaseArmor 25 +#define kMarineBaseHeavyArmor 200 +#define kMarineHealth 100 +#define kMarineHeavyArmorUpgrade 90 +#define kMarineRespawnTime 10 +#define kMarineSpawnClips 2 +#define kMaxEnsnareTime 5 +#define kMaxMarineEntitiesAllowedInRadius 50 +#define kMaxTeamStrands 30 +#define kMetabolizeHealAmount 20 +#define kMetabolizeResourceCost 0 +#define kMineCost 10 +#define kMineDamage 125 +#define kMineHealth 20 +#define kMineMaxAmmo 4 +#define kMineMaxAmmoCombat 1 +#define kMineRadius 300 +#define kMotionTrackingResearchCost 35 +#define kMotionTrackingResearchTime 100 +#define kMovementChamberBuildTime 12 +#define kMovementChamberCost 10 +#define kMovementChamberEnergyRange 500 +#define kMovementChamberHealth 1000 +#define kMovementChamberThinkInterval 2 +#define kNumInitialAlienPoints 25 +#define kNumInitialMarinePoints 100 +#define kNumSameAlienStructuresAllowedInRadius 8 +#define kNumWebsAllowedInRadius 8 +#define kObservatoryBuildTime 15 +#define kObservatoryCost 20 +#define kObservatoryHealth 1700 +#define kObservatoryXYDetectionRadius 900 +#define kOffenseChamberBuildTime 11 +#define kOffenseChamberCost 10 +#define kOffenseChamberDamage 20 +#define kOffenseChamberHealth 1000 +#define kOnosArmorUpgrade 350 +#define kOnosBaseArmor 600 +#define kOnosBaseSpeed 240 +#define kOnosCost 75 +#define kOnosGestateTime 38 +#define kOnosHealth 700 +#define kOrganicStructureHealRate 5 +#define kParasiteDamage 10 +#define kPhaseGateBuildTime 12 +#define kPhaseGateCost 15 +#define kPhaseGateHealth 3000 +#define kPhaseTechResearchCost 15 +#define kPhaseTechResearchTime 45 +#define kPheromonesBaseDistance 500 +#define kPheromonesLevelDistance 200 +#define kPointsPerHealth 50 +#define kPrimalScreamRange 500 +#define kPrototypeLabBuildTime 20 +#define kPrototypeLabCost 40 +#define kPrototypeLabHealth 4000 +#define kRecycleTime 20 +#define kResourceTowerActivateTime 2 +#define kResourceTowerBuildDistanceTolerance 250 +#define kResourceTowerBuildTime 15 +#define kResourceTowerCost 15 +#define kResourceTowerHealth 6000 +#define kSGBulletsPerShot 10 +#define kSGDamage 17 +#define kSGMaxAmmo 40 +#define kSGMaxClip 8 +#define kScanDuration 10 +#define kScanEnergyCost 20 +#define kScanRadius 800 +#define kScentOfFearRadiusPerLevel 600 +#define kScoringAlienUpgradeChamberValue 2 +#define kScoringCCValue 5 +#define kScoringHiveValue 8 +#define kScoringKillPlayer 1 +#define kScoringKillPlayerFade 4 +#define kScoringKillPlayerGorge 2 +#define kScoringKillPlayerHA 4 +#define kScoringKillPlayerJetpack 3 +#define kScoringKillPlayerLerk 3 +#define kScoringKillPlayerOnos 5 +#define kScoringMarineBuildableValue 2 +#define kScoringResourceTowerValue 3 +#define kScoringSiegeValue 3 +#define kScoringTurretValue 2 +#define kSensoryChamberBuildTime 14 +#define kSensoryChamberCost 10 +#define kSensoryChamberHealth 800 +#define kSensoryChamberRange 750 +#define kSentryBuildTime 7 +#define kSentryCost 10 +#define kSentryDamage 10 +#define kSentryHealth 1300 +#define kShotgunCost 10 +#define kSiegeBuildTime 10 +#define kSiegeCost 15 +#define kSiegeDamage 330 +#define kSiegeHealth 2000 +#define kSiegeROF 4 +#define kSiegeTurretRange 1100 +#define kSkulkArmorUpgrade 20 +#define kSkulkBaseArmor 10 +#define kSkulkBaseSpeed 290 +#define kSkulkCost 0 +#define kSkulkGestateTime 7 +#define kSkulkHealth 70 +#define kSpikeDamage 16 +#define kSpitGDamage 30 +#define kSporeCloudRadius 225 +#define kSporeCloudTime 6 +#define kSporeDamage 7 +#define kStompRadius 250 +#define kSwipeDamage 80 +#define kTurretFactoryBuildDistance 400 +#define kTurretFactoryBuildTime 13 +#define kTurretFactoryCost 10 +#define kTurretFactoryHealth 3000 +#define kTurretFactoryUpgradeCost 15 +#define kTurretFactoryUpgradeTime 15 +#define kTurretRange 800 +#define kUmbraCloudDuration 3 +#define kUmbraCloudRadius 225 +#define kUmbraEffectiveness 1 +#define kUnencumberedPlayerSpeed 220 +#define kWeaponStayTime 30 +#define kWeaponsOneResearchCost 20 +#define kWeaponsOneResearchTime 60 +#define kWeaponsThreeResearchCost 40 +#define kWeaponsThreeResearchTime 120 +#define kWeaponsTwoResearchCost 30 +#define kWeaponsTwoResearchTime 90 +#define kWelderCost 5 +#define kWelderDamage 4 +#define kWelderRange 90 +#define kWelderRepairRate 60 + +// Float data (up to three decimal places) +#define kAcidRocketEnergyCost 0.10 +#define kAcidRocketForceScalar 0.05 +#define kAcidRocketROF 1.00 +#define kAdrenalineEnergyPercentPerLevel 0.33 +#define kAirspeedMultiplier 3.00 +#define kAlertExpireTime 20.00 +#define kAlienArmorLevelOne 0.20 +#define kAlienArmorLevelThree 0.60 +#define kAlienArmorLevelTwo 0.40 +#define kAlienEnergyRate 0.08 +#define kAlienInnateRegenerationPercentage 0.02 +#define kAlienRegenerationPercentage 0.03 +#define kAlienRegenerationTime 2.00 +#define kAlienRespawnTimeModifier 0.30 +#define kArmorAbsorptionBase 0.30 +#define kArmorAbsorptionPerExtraHive 0.10 +#define kArmorValueBase 0.50 +#define kArmorValueNonAlien 2.00 +#define kArmorValuePerHive 0.50 +#define kAudioAlertInterval 6.00 +#define kBileBombEnergyCost 0.22 +#define kBileBombROF 1.50 +#define kBite2EnergyCost 0.05 +#define kBite2ROF 0.64 +#define kBiteEnergyCost 0.05 +#define kBiteROF 0.80 +#define kBlinkEnergyCost 0.04 +#define kBlinkROF 0.05 +#define kCarapaceSlowFactor 0.00 +#define kCatalystDamagePercent 0.25 +#define kCatalystROFFactor 0.25 +#define kCatalystSpeedIncrease 0.25 +#define kChargeEnergyCost 0.07 +#define kChargingEnergyScalar 2.80 +#define kClawsEnergyCost 0.07 +#define kClawsROF 0.90 +#define kCloakTime 6.00 +#define kCombatAdditiveRespawnTime 2.00 +#define kCombatDistressBeaconDeadPercentage 0.70 +#define kCombatExperienceAlienGrowthRate 0.00 +#define kCombatHealExperienceScalar 0.33 +#define kCombatIronManExperienceScalar 3.00 +#define kCombatLevelExperienceModifier 0.50 +#define kCombatModeGestationTimeScalar 0.40 +#define kCombatModeTimeScalar 0.20 +#define kCombatResupplyAmmoPercentage 0.40 +#define kCombatResupplyHealthPercentage 1.00 +#define kCombatSpawnPercentage 0.25 +#define kCombatThinkInterval 3.00 +#define kDebugPVSCoherencyTime 1.00 +#define kDevourEnergyCost 0.20 +#define kDevourROF 2.00 +#define kDigestingSpeedFactor 0.90 +#define kDivineWindEnergyCost 0.70 +#define kDivineWindROF 2.00 +#define kDrawAmount 1.00 +#define kDrawMaxInterval 5.00 +#define kDrawMinInterval 2.00 +#define kElectricalEnergyLoss 0.33 +#define kEnsnareMaximumSpeedFactor 0.60 +#define kEnsnareMinimumSpeedFactor 0.10 +#define kExplodeMaxVerticalSpeed 200 +#define kExplodeMaxHorisontalSpeed 400 +#define kFocusDamageUpgradePercentPerLevel 0.33 +#define kFocusROFPercentSlowdownPerLevel 0.50 +#define kGGROF 1.20 +#define kGrenadeLauncherBaseReloadTime 1.10 +#define kGrenadeLauncherEndReloadTime 1.10 +#define kGrenadeLauncherGrenadeReloadTime 1.10 +#define kHGROF 0.20 +#define kHMGROF 0.10 +#define kHandGrenadePrimeTime 1.00 +#define kHealingSprayEnergyCost 0.15 +#define kHealingSprayROF 1.60 +#define kHeavySpeedMultiplier 0.95 +#define kHiveRegenerationPercentage 0.15 +#define kJetpackSpeedMultiplier 0.95 +#define kJoinTeamCooldown 3.00 +#define kKNROF 0.65 +#define kLeapEnergyCost 0.25 +#define kLerkBaseAscendSpeedMax 600.00 +#define kMGROF 0.10 +#define kMarineArmorLevelOne 0.20 +#define kMarineArmorLevelThree 0.60 +#define kMarineArmorLevelTwo 0.40 +#define kMetabolizeDamageEnergyFactor 0.50 +#define kMetabolizeEnergyAmount 0.35 +#define kMetabolizeEnergyCost 0.25 +#define kMetabolizeROF 2.90 +#define kMetabolizeSpeedFactor 1.00 +#define kMinMarineBuildDistance 60.00 +#define kMinMarinePlayerBuildDistance 16.50 +#define kMovementChamberEnergyAmount 0.25 +#define kOrderIconDrawSize 30.00 +#define kParasiteEnergyCost 0.30 +#define kParasiteROF 0.50 +#define kPhaseGateDelay 2.00 +#define kPhaseGateDepartureInterval 0.80 +#define kPrimalScreamDamageModifier 0.30 +#define kPrimalScreamDuration 4.00 +#define kPrimalScreamEnergyCost 0.45 +#define kPrimalScreamEnergyFactor 0.60 +#define kPrimalScreamROF 5.00 +#define kPrimalScreamROFFactor 0.30 +#define kRecycleResourcePercentage 0.50 +#define kRecloakTime 3.0f +#define kRedemptionChance 0.45 +#define kRedemptionThreshold 0.40 +#define kReinforcementMinimumWaitLevelScalar 0.20 +#define kReinforcementMinimumWaitScalar 0.50 +#define kResupplyTime 0.90 +#define kSGROF 1.30 +#define kShotgunDamageRange 500.00 +#define kSilenceLevel1Volume 0.50 +#define kSilenceLevel2Volume 0.15 +#define kSilenceLevel3Volume 0.00 +#define kSpikeEnergyCost 0.03 +#define kSpikeROF 0.40 +#define kSpitEnergyCost 0.12 +#define kSpitROF 0.80 +#define kSporeCloudThinkInterval 0.50 +#define kSporeROF 2.00 +#define kSporesEnergyCost 0.35 +#define kStompEnergyCost 0.30 +#define kStompROF 1.50 +#define kStompTime 1.00 +#define kSwipeEnergyCost 0.06 +#define kSwipeROF 0.95 +#define kTouchDamageInterval 0.05 +#define kTurretBaseRateOfFire 0.70 +#define kTurretTrackingRate 1.60 +#define kUmbraEnergyCost 0.30 +#define kUmbraROF 1.00 +#define kUncloakTime 0.50 +#define kWeaponDamageLevelOne 0.10 +#define kWeaponDamageLevelThree 0.30 +#define kWeaponDamageLevelTwo 0.20 +#define kWebEnergyCost 0.18 +#define kWebSpinnerROF 0.50 +#define kWelderBuildingModifier 1.00 +#define kWelderPlayerModifier 0.50 +#define kWelderROF 0.40 diff --git a/main/ResetGamma.exe b/main/ResetGamma.exe new file mode 100644 index 00000000..ad867b4d Binary files /dev/null and b/main/ResetGamma.exe differ diff --git a/main/SteamifyTitles.pl b/main/SteamifyTitles.pl new file mode 100644 index 00000000..131c9855 --- /dev/null +++ b/main/SteamifyTitles.pl @@ -0,0 +1,167 @@ +# +# Updates titles.txt to Steam format. Written by Charlie Cleveland. +# +local ($kVersion, $inputFilename, $modName, $languageName, $numTranslationsFound, $outputFilename, %translationData); + +# +# Constants +# +$kVersion = "v1.0"; +$inputFilename = ""; +$modName = ""; +$languageName = ""; +$numTranslationsFound = 0; +$outputFilename = ""; + +sub Main; +Main(); + +sub Main +{ + print "\nRunning SteamifyTitles $kVersion by Charlie Cleveland (flayra\@overmind.org)\n\n"; + + # Read mod name, input filename and language name + $numArgs = $#ARGV + 1; + + if($numArgs < 3) + { + print "Usage: "; + print "Run from within your mod directory.\n" + } + else + { + # Parse arguments + $inputFilename = $ARGV[0]; + $modName = $ARGV[1]; + $languageName = $ARGV[2]; + $convertTitles = 0; + + if($numArgs > 3) + { + if($ARGV[3] == "y") + { + $convertTitles = 1; + } + } + + #print "\nReading $inputFilename, for mod $modName, in language $languageName...\n"; + + # Read in file name specified on command line + print "Reading old titles from $inputFilename.\n"; + open(INFILE, $inputFilename) or die "Couldn't open $inputFilename for reading.\n"; + + # Read all data into one string + local $/; + my $theData = ; + #print $theData; + + #while( $theData =~ m/ (\w+) \s* \{(.*?)\} /sgx) + while( $theData =~ m/ (\w+) \s* \{(.*?)\} /sgx) + { + my $theKey = $1; + my $theUntrimmedValue = $2; + if($theUntrimmedValue =~ s/(.*?)\n+/ /g) + { + my $theTrimmedData = $1; + + # Skip comments? + #if(index($theKey, "//") != -1) + #{ + # print "Skipping line: \"$theKey\" = \"$theTrimmedData\"\n"; + #} + #else + #{ + #print "Found pair: \"$theKey\" = \"$theTrimmedData\"\n"; + + $translationData{$theKey} = $theTrimmedData; + $numTranslationsFound++; + #} + } + } + + close(INFILE); + + print "Found $numTranslationsFound translations.\n"; + + if($numTranslationsFound > 0) + { + # Open file for writing as resource/modname_language.txt + $outputFilename = lc("resource/$modName") . "_" . lc($languageName) . ".txt"; + print "Writing $outputFilename.\n"; + + open(OUTFILE, ">$outputFilename") or die "Couldn't open file $outputFilename for writing.\n"; + + my $kLineDelimiter = "\n"; + my $kLineSpaceDelimiter = " \n"; + my $kPairSeparator = "\t\t\t"; + + # Write "lang" tag + print OUTFILE "\"lang\"$kLineSpaceDelimiter"; + + my $caseProperLanguage = lc($languageName); + $caseProperLanguage = ucfirst($caseProperLanguage); + + # Write "Language" tag + print OUTFILE "{$kLineSpaceDelimiter"; + print OUTFILE "\"Language\"$kPairSeparator\"$caseProperLanguage\"$kLineSpaceDelimiter"; + + # Write "Tokens" tag + print OUTFILE "\"Tokens\"$kLineSpaceDelimiter\{$kLineSpaceDelimiter"; + + # For each translation pair + my $key; + my $value; + + # sort( keys( %hash )) + #while(($key, $value) = each %translationData) + foreach my $key ( sort(keys(%translationData))) + { + my $value = $translationData{$key}; + + # Substitute any " for ', or HL stops reading the translation file + $value =~ s/\"/\'/g; + + if(length($value) == 0) + { + print (" Skipping empty entry for \"$key\"\n"); + } + else + { + my $theOutputString = "\"$key\"$kPairSeparator\"$value\"$kLineDelimiter"; + #print $theOutputString; + print OUTFILE $theOutputString; + } + } + + # Write ending braces + print OUTFILE "}$kLineSpaceDelimiter"; + print OUTFILE "}$kLineSpaceDelimiter"; + print OUTFILE "$kLineDelimiter$kLineDelimiter$kLineDelimiter"; + + # close output file + #print("Closing $outputFilename..."); + + close(OUTFILE); + + # if we're writing new titles.txt + if($convertTitles == 1) + { + my $newTitlesName = "titles.txt"; + print("Writing $newTitlesName in VGUI2 format..."); + open(TITLESFILE, ">$newTitlesName") or die "Couldn't open $newTitlesName for writing.\n"; + + foreach my $key ( sort(keys(%translationData))) + { + print TITLESFILE "$key\n"; + print TITLESFILE "\{\n\#$key\n\}\n\n"; + } + print "done.\n"; + + close(TITLESFILE); + } + + print "Done. Don't forget to save \"$outputFilename\" as Unicode using Notepad before using.\n"; + } + } +} + diff --git a/main/assets-client-source.txt b/main/assets-client-source.txt new file mode 100644 index 00000000..ef399da4 --- /dev/null +++ b/main/assets-client-source.txt @@ -0,0 +1,15 @@ +; HL client code +source/external/vgui/include/*.* +source/external/vgui/lib/win32_vc6/*.* + +; Misc client code +source/utils/vgui/include/*.* +source/utils/vgui/lib/win32_vc6/*.* + +; NS client code +source/cl_dll/*.* +source/cl_dll/hl/*.* +source/fmod/inc/*.* +source/fmod/lib/*.* +source/ui/*.* + diff --git a/main/assets-common.txt b/main/assets-common.txt new file mode 100644 index 00000000..cb9d5c0d --- /dev/null +++ b/main/assets-common.txt @@ -0,0 +1,242 @@ +; Note: Its probably best to keep the server-side pretty much identicle as the client. + +; Code +cl_dlls/client.dll +dlls/ns.dll +dlls/ns_i386.so ; This is not needed or desired on the client, but this new system doesn't easily allow its removal + +; Events +events/*.* + +; GFX +gfx/*.* + +; Manual +;manual/*.html +;manual/css/*.css +;manual/images/design/*.gif +;manual/images/design/red/*.gif +;manual/images/evolutions/*.gif +;manual/images/images/*.gif +;manual/images/images/*.jpg +;manual/images/tech/*.gif +;manual/images/tech_10/*.gif +;manual/images/titles/*.gif + +; Media +media/*.* +music/*.* + + +; Models +models/player/*.* +models/acidrocket.mdl +models/b_*.mdl +models/ba_*.mdl +models/bilebomb.mdl +models/grenade.mdl +models/hive.mdl +models/hivet.mdl +models/null.mdl +models/p_*.mdl +models/parasite.mdl +models/player.mdl +models/pshell.mdl ; Still needed? +models/shell.mdl ; Causing strange errors with mp_consistency, so include it for safety +models/shotshell.mdl +models/stomp.mdl +models/spike.mdl +models/v_*.mdl +models/w_*.mdl +models/holo*.mdl ; Utility models from Merks, that he thought others would want to use +models/agibs.mdl +models/hgibs.mdl + +; Sound +sound/hud/*.wav +sound/UI/*.wav +sound/materials.txt +sound/ambience/*.mp3 +sound/ambience/*.wav +sound/buttons/button*.wav +sound/common/wpn_*.wav +;sound/debris/*.wav +sound/doors/*.wav +sound/fans/*.wav +sound/items/*.wav +sound/misc/*.wav +sound/plats/*.wav +sound/player/*.wav +sound/turret/*.wav +sound/vox/asay*.wav +sound/vox/sack*.wav +sound/vox/sreq*.wav +sound/vox/ssay*.wav +sound/weapons/*.wav + +; Sprites +sprites/hud.txt +sprites/weapon_*.txt +sprites/320*.spr +sprites/640*.spr +sprites/acidsplash.spr +sprites/aliennode.spr +sprites/bacteria.spr +sprites/bilebomb.spr +sprites/bigspit.spr +sprites/blank.spr +sprites/blink.spr +sprites/blink2.spr +sprites/blip*.spr +sprites/blueball.spr +sprites/blueball2.spr +sprites/bluespark.spr +sprites/bubble.spr +sprites/bubble2.spr +sprites/buildcircle.spr +sprites/camera.spr +sprites/chamberdeath.spr +sprites/commandbutton.spr +sprites/commandstatus.spr +sprites/flare1.spr +sprites/flare2.spr +sprites/flare3.spr +sprites/flare6.spr +sprites/green.spr +sprites/hack.spr +sprites/haze.spr +sprites/hivehealth.spr +sprites/lightsmoke.spr +sprites/muzzleflash1.spr +sprites/muzzleflash2.spr +sprites/muzzleflash3.spr +sprites/nsteleport.spr +sprites/pheromone.spr +sprites/raindrop.spr +sprites/raindrop2.spr +sprites/reticle.spr +sprites/spikehit.spr +sprites/spithit.spr +sprites/spore.spr +sprites/spore2.spr +sprites/steam1.spr +sprites/stomp.spr +sprites/tile.spr +sprites/tinyspit.spr +sprites/turretsmoke.spr +sprites/umbra.spr +sprites/umbra2.spr +sprites/upgrades.spr +sprites/voiceicon.spr +sprites/wallpuff.spr +sprites/webprojectile.spr +sprites/webstrand.spr +sprites/welddrip.spr +sprites/weldsmoke.spr +sprites/white.spr +sprites/xhair*.spr +sprites/xspark1.spr +sprites/xspark4.spr +sprites/techtree/tech*.spr +sprites/640experience.spr +sprites/320experience.spr +sprites/alert.spr +sprites/aliencursor.spr +sprites/b-build.spr +sprites/b-health.spr +sprites/ba-build.spr +sprites/ba-health.spr +sprites/cursors.spr +sprites/digesting.spr +sprites/dustlight.spr +sprites/comm-blip.spr +sprites/fov.spr +sprites/hiveinfo.spr +sprites/helpicons.spr +sprites/hera_fog.spr +sprites/hudorder.spr +;sprites/iflag*.spr +sprites/iplayer*.spr +sprites/itech.spr +sprites/logout.spr +sprites/mainhud.spr +sprites/marinenode.spr +sprites/membrane.spr +sprites/ns.spr +;sprites/overwatch-aim.spr +;sprites/overwatch-center.spr +;sprites/overwatch-target.spr +sprites/scan.spr +sprites/selectall.spr +sprites/small640alienconnector.spr +sprites/structurescursor.spr +sprites/topdownbg.spr +sprites/topdownbottom.spr +sprites/topdowntop.spr + +; New font rendering +sprites/font_aria*.* + +; Avoid verbose Steam problems +sprites/ch_sniper.spr + +; Resources +resource/*.tga +resource/*.res +resource/*.txt +resource/background/*.tga +;resource/sound/UI/*.wav + +; Misc. +1024_textscheme.txt +1152_textscheme.txt +1280_textscheme.txt +1600_textscheme.txt +320_textscheme.txt +400_textscheme.txt +512_textscheme.txt +640_textscheme.txt +800_textscheme.txt +Balance.txt +cached.wad +config.cfg +custom.hpk +decals.wad +delta.lst +english_titles.txt +fmod.dll +french_titles.txt +gamma_tune.exe +german_titles.txt +gfx.wad +hallwall_1.wad +liblist.gam +listenserver.cfg +mapcycle.txt +motd.txt +ns-hltv.bat +ns-hltv.cfg +ns-hltv.tga +ns.fgd +ns.ico +ns.ps +ns.qrk +ns.wad +ns2.wad +nshulls.txt +readme.txt +ResetGamma.exe +server.cfg +settings.scr +skill.cfg +spanish_titles.txt +spraypaint.wad +tempdecal.wad +titles.txt +turkish_titles.txt +ui.txt +user.scr +userconfig.cfg +voice_ban.dt +v_wad.wad +wall_lab.wad \ No newline at end of file diff --git a/main/assets-ignore-source.txt b/main/assets-ignore-source.txt new file mode 100644 index 00000000..74f20568 --- /dev/null +++ b/main/assets-ignore-source.txt @@ -0,0 +1,7 @@ +*.idb +*.pcb +*.pch +*.pdb +*.obj +*.plg +source/doc/*.* diff --git a/main/assets-maps.txt b/main/assets-maps.txt new file mode 100644 index 00000000..389532af --- /dev/null +++ b/main/assets-maps.txt @@ -0,0 +1,160 @@ +; +;Classic Maps +; + + +; ns_altair +maps/ns_altair.* +sprites/minimaps/ns_altair.spr + +; ns_ayumi +ns_ayumi.wad +maps/ns_ayumi.* +sound/ns_ayumi/*.* +sprites/minimaps/ns_ayumi.spr +sprites/ns_ayumi/*.spr + + +; ns_bast +ns_bast.wad +maps/ns_bast.* +models/ns_bast/*.mdl +sprites/minimaps/ns_bast.spr +sprites/ns_bast/*.spr + + +; ns_caged +maps/ns_caged.* +sound/ns_caged/*.wav +sprites/minimaps/ns_caged.spr + + +; ns_eclipse +ns_eclipse.wad +maps/ns_eclipse.* +sprites/minimaps/ns_eclipse.spr + +; ns_eon +ns_eon.wad +maps/ns_eon.* +sprites/minimaps/ns_eon.spr + + +; ns_hera +ns_hera.wad +maps/ns_hera.* +models/ns_hera/*.mdl +models/chair1.mdl +sprites/minimaps/ns_hera.spr +sprites/hera_fog.spr + + +; ns_lost +ns_lost.wad +maps/ns_lost.* +sound/ns_lost/*.mp3 +sprites/minimaps/ns_lost.spr + + +; ns_metal +ns_metal.wad +maps/ns_metal.* +;models/ns_metal/*.mdl +sprites/minimaps/ns_metal.spr +sprites/ns_metal/*.spr + + +; ns_nancy +ns_nancy.wad +maps/ns_nancy.* +models/ns_nancy/*.mdl +sound/ns_nancy/*.wav +sprites/minimaps/ns_nancy.spr + + +; ns_nothing +ns_nothing.wad +maps/ns_nothing.* +models/ns_nothing/*.mdl +sprites/minimaps/ns_nothing.spr +sprites/ns_nothing/*.spr + + +; ns_origin +maps/ns_origin.* +models/ns_origin/*.mdl +sound/ns_origin/*.wav +sprites/minimaps/ns_origin.spr + + +; ns_tanith +ns_tanith.wad +maps/ns_tanith.* +models/ns_tanith/*.mdl +sprites/minimaps/ns_tanith.spr +sprites/ns_tanith/*.spr + + +; ns_veil +maps/ns_veil.* +sprites/minimaps/ns_veil.spr + + +; +; Combat Maps +; + + +; co_angst +maps/co_angst.* +sprites/minimaps/co_angst.spr + + +; co_core +maps/co_core.* +sprites/minimaps/co_core.spr + + +; co_daimos +maps/co_daimos.* +sprites/minimaps/co_daimos.spr +sound/co_daimos/*.wav +models/co_daimos/*.mdl + +; co_faceoff +maps/co_faceoff.* +sprites/minimaps/co_faceoff.spr + +; co_niveus +co_niveus.wad +maps/co_niveus.* +sound/co_niveus/*.wav +models/co_niveus/*.mdl +sprites/co_niveus/*.spr +gfx/env/arcn*.tga + + +; co_pulse +maps/co_pulse.* +sprites/minimaps/co_pulse.spr + +;co_kestrel +co_kestrel.wad +maps/co_kestrel.* +sound/co_kestrel/*.wav +models/co_kestrel/*.mdl +sprites/minimaps/co_kestrel.spr + +; co_sava +maps/co_sava.* +sound/co_sava/*.wav +models/co_sava/*.mdl + +; co_ulysses +maps/co_ulysses.* +sound/co_ulysses/*.wav +sprites/minimaps/co_ulysses.spr +sprites/co_ulysses/*.spr + + + diff --git a/main/assets-server-source.txt b/main/assets-server-source.txt new file mode 100644 index 00000000..e8451af3 --- /dev/null +++ b/main/assets-server-source.txt @@ -0,0 +1,67 @@ +; List of files to zip + +; CURL +source/curl/*.* +;source/curl/docs/*.* +;source/curl/docs/examples/*.* +;source/curl/docs/libcurl/*.* +source/curl/include/*.* +source/curl/lib/*.* +source/curl/packages/*.* +source/curl/packages/Linux/*.* +source/curl/packages/Linux/RPM/*.* +source/curl/packages/Win32/*.* +source/curl/packages/Win32/cygwin/*.* +;source/curl/src/*.* +;source/curl/tests/*.* +;source/curl/tests/data/*.* +;curl/tests/libtest/*.* +;source/curl/tests/server/*.* + +; HL server code +source/dlls/*.h +source/dlls/*.cpp +source/dlls/*.def +source/dlls/*.dsp + +; NS server code +source/linux/Makefile +source/linux/build-curl.sh +source/textrep/*.* + +; stlport +source/stlport/*. +source/stlport/etc/*. +source/stlport/etc/*.* +source/stlport/src/*.* +source/stlport/stlport/*. +source/stlport/stlport/*.* +source/stlport/stlport/stl/*.* +source/stlport/stlport/stl/wrappers/*.* +source/stlport/stlport/config/*.* +source/stlport/stlport/using/*. +source/stlport/stlport/using/h/*.* + +; TODO: UPP +;source/upp/common/*.h +;source/upp/*.h +;source/upp/common/DataObjects/*.* +;source/upp/common/MultiThreading/*.* +;source/upp/common/*.* +;source/upp/common/*.* +;source/upp/common/*.* + +; HPB_bot server +source/HPB_bot/dlls/*.cfg +source/HPB_bot/dlls/*.dsp +source/HPB_bot/dlls/*.h +source/HPB_bot/dlls/*.cpp +source/HPB_bot/dlls/*.dsw +source/HPB_bot/dlls/makefile* +source/HPB_bot/dlls/*.dat +source/HPB_bot/engine/*.h +source/HPB_bot/exports/*.c +source/HPB_bot/exports/*.dsp + +; Install .sh +*.sh \ No newline at end of file diff --git a/main/assets-shared-source.txt b/main/assets-shared-source.txt new file mode 100644 index 00000000..fb95c418 --- /dev/null +++ b/main/assets-shared-source.txt @@ -0,0 +1,35 @@ +; HL shared code +source/common/*.* +source/dlls/wpn_shared/*.* +source/engine/*.h +source/game_shared/*.h +source/game_shared/*.cpp +source/pm_shared/*.h +source/pm_shared/*.cpp + +; NS shared code +Balance.txt +source/build.h +source/localassert.h +source/StratHL.dsw +source/types.h +source/lua/*.dsp +source/lua/etc/*.c +source/lua/include/*.h +source/lua/src/*.h +source/lua/src/*.c +source/lua/src/lib/*.c +source/lua/src/lua/*.c +source/mod/*.h +source/mod/*.cpp +source/particles/*.cpp +source/particles/*.h +source/particles/*.dsp +source/util/*.* +source/utils/common/*.h +source/utils/common/*.c +source/utils/sprgen/*.h +source/utils/sprgen/*.c +source/utils/sprgen/*.dsp +source/utils/sprgen/*.dsw + diff --git a/main/backupserversrc.bat b/main/backupserversrc.bat new file mode 100644 index 00000000..f2b5d900 --- /dev/null +++ b/main/backupserversrc.bat @@ -0,0 +1,3 @@ +@echo off (subdirs, prompt for password <-s>, date) +c:\"program files"\Winzip\wzzip.exe -P -s -r -ex NS-server-src.zip @assets-shared-source.txt @assets-server-source.txt -x@assets-ignore-source.txt + diff --git a/main/backupsrc.bat b/main/backupsrc.bat new file mode 100644 index 00000000..e5fb760f --- /dev/null +++ b/main/backupsrc.bat @@ -0,0 +1,4 @@ +@echo off (subdirs, prompt for password <-s>, date) +REM c:\"program files"\Winzip\wzzip.exe -p -r -s -ex NS-src.zip @SourceAssets.txt +c:\"program files"\Winzip\wzzip.exe -P -r -s -ex NS-full-src.zip @assets-client-source.txt @assets-shared-source.txt @assets-server-source.txt -x@assets-ignore-source.txt + diff --git a/main/build-linux.sh b/main/build-linux.sh new file mode 100644 index 00000000..54dd0340 --- /dev/null +++ b/main/build-linux.sh @@ -0,0 +1,16 @@ +#!/bin/sh +export CC=gcc-2.95 +export CPP=cpp-2.95 +export CXX=g++-2.95 +rm -R source -f +mkdir source +cd source +unzip -a ../NS-server-src.zip +cd source/curl +dos2unix * +chmod u+rwx * +./configure --build=i386-linux +make clean +make +cd ../linux +make diff --git a/main/builddiff.bat b/main/builddiff.bat new file mode 100644 index 00000000..7db23162 --- /dev/null +++ b/main/builddiff.bat @@ -0,0 +1,2 @@ +@echo off (subdirs, prompt for password <-s>, date) +c:\"Program Files"\Winzip\wzzip.exe -P -r -ex -t100105 NS-diff.zip @assets-common.txt @assets-maps.txt diff --git a/main/buildfull.bat b/main/buildfull.bat new file mode 100644 index 00000000..1966a0a9 --- /dev/null +++ b/main/buildfull.bat @@ -0,0 +1,2 @@ +@echo off (subdirs, prompt for password <-s>, date) +c:\"program files"\Winzip\wzzip.exe -P -r -ex NS-full.zip @assets-common.txt @assets-maps.txt \ No newline at end of file diff --git a/main/buildfullserver.bat b/main/buildfullserver.bat new file mode 100644 index 00000000..e9bfb4e5 --- /dev/null +++ b/main/buildfullserver.bat @@ -0,0 +1,3 @@ +@echo off (subdirs, prompt for password <-s>, date) +c:\"program files"\Winzip\wzzip.exe -P -r -ex NS-full-server.zip @assets-server.txt @assets-ns_agora.txt @assets-ns_ayumi.txt @assets-ns_caged.txt @assets-ns_eclipse.txt @assets-ns_hera.txt @assets-ns_lost.txt @assets-ns_metal.txt @assets-ns_mineshaft.txt @assets-ns_nancy.txt @assets-ns_nothing.txt @assets-ns_origin.txt @assets-ns_tanith.txt @assets-ns_veil.txt @assets-combat.txt +move NS-full-server.zip c:\download diff --git a/main/cached.wad b/main/cached.wad new file mode 100644 index 00000000..a1c3c323 Binary files /dev/null and b/main/cached.wad differ diff --git a/main/cl_dlls/client.dll b/main/cl_dlls/client.dll new file mode 100644 index 00000000..a5a23aa5 Binary files /dev/null and b/main/cl_dlls/client.dll differ diff --git a/main/co_ether.wad b/main/co_ether.wad new file mode 100644 index 00000000..8982be8d Binary files /dev/null and b/main/co_ether.wad differ diff --git a/main/co_kestrel.wad b/main/co_kestrel.wad new file mode 100644 index 00000000..b497117a Binary files /dev/null and b/main/co_kestrel.wad differ diff --git a/main/config.cfg b/main/config.cfg new file mode 100644 index 00000000..becac51b --- /dev/null +++ b/main/config.cfg @@ -0,0 +1,178 @@ +// This file is overwritten whenever you change your user settings in the game. +// Add custom configurations to the file "userconfig.cfg". + +unbindall +bind "TAB" "+showscores" +bind "ENTER" "messagemode" +bind "ESCAPE" "cancelselect" +bind "SPACE" "+jump" +bind "'" "+moveup" +bind "+" "sizeup" +bind "," "impulse 123" +bind "-" "sizedown" +bind "." "impulse 124" +bind "/" "impulse 125" +bind "0" "slot10" +bind "1" "slot1" +bind "2" "slot2" +bind "3" "slot3" +bind "4" "slot4" +bind "5" "slot5" +bind "6" "slot6" +bind "7" "slot7" +bind "8" "slot8" +bind "9" "slot9" +bind ";" "+mlook" +bind "=" "sizeup" +bind "[" "invprev" +bind "]" "invnext" +bind "`" "toggleconsole" +bind "a" "+moveleft" +bind "c" "+showmap" +bind "d" "+moveright" +bind "e" "+use" +bind "f" "impulse 100" +bind "g" "impulse 3" +bind "l" "impulse 105" +bind "q" "lastinv" +bind "r" "+reload" +bind "s" "+back" +bind "t" "impulse 201" +bind "u" "messagemode2" +bind "v" "impulse 9" +bind "w" "+forward" +bind "x" "impulse 81" +bind "y" "messagemode" +bind "z" "impulse 80" +bind "~" "toggleconsole" +bind "UPARROW" "+forward" +bind "DOWNARROW" "+back" +bind "LEFTARROW" "+left" +bind "RIGHTARROW" "+right" +bind "ALT" "+voicerecord" +bind "CTRL" "+duck" +bind "SHIFT" "+speed" +bind "F1" "jointeamone" +bind "F2" "jointeamtwo" +bind "F3" "autoassign" +bind "F4" "readyroom" +bind "F5" "snapshot" +bind "F6" "save quick" +bind "F7" "load quick" +bind "F10" "quit prompt" +bind "INS" "+klook" +bind "PGDN" "+lookdown" +bind "PGUP" "+lookup" +bind "END" "centerview" +bind "MWHEELDOWN" "invnext" +bind "MWHEELUP" "invprev" +bind "MOUSE1" "+attack" +bind "MOUSE2" "+popupmenu" +bind "MOUSE3" "+popupmenu" +bind "MOUSE4" "lastinv" +bind "PAUSE" "pause" +_snd_mixahead "0.1" +ati_npatch "1.0" +ati_subdiv "2.0" +bgmvolume "1.000000" +bottomcolor "144.889999" +brightness "1.000000" +cl_allowdownload "1" +cl_allowupload "1" +cl_autohelp "1.0" +cl_buildmessages "1" +cl_centerentityid "0.0" +cl_cmdbackup "2" +cl_cmdrate "30" +cl_cmhotkeys "qwerasdfzxcv" +cl_dlmax "128" +cl_download_ingame "1" +cl_dynamiclights "1" +cl_forcedefaultfov "0" +cl_highdetail "1" +cl_himodels "0" +cl_idealpitchscale "0.8" +cl_lc "1" +cl_logocolor "#Valve_Orange" +cl_logofile "lambda" +cl_lw "1" +cl_musicdelay "90" +cl_musicdirectory "" +cl_musicenabled "1.0" +cl_musicvolume "155" +cl_particleinfo "0" +cl_quickselecttime ".15" +cl_timeout "60" +cl_updaterate "20" +cl_vsmoothing "0.05" +con_color "255 180 30" +console "1.000000" +crosshair "1.000000" +fps_max "72.0" +fps_modem "0.0" +gamma "2.500000" +gl_dither "1" +gl_flipmatrix "0" +gl_fog "1" +gl_monolights "0" +gl_overbright "0" +gl_polyoffset "0.1" +hisound "1" +hpk_maxsize "4" +hud_capturemouse "1" +hud_centerid "0" +hud_classautokill "1" +hud_draw "1" +hud_fastswitch "0" +hud_takesshots "0" +joystick "0" +lookspring "0.000000" +lookstrafe "0.000000" +m_filter "0" +m_forward "1" +m_pitch "0.022000" +m_side "0.8" +m_yaw "0.022" +model "barney" +MP3FadeTime "2.0" +MP3Volume "0.8" +mp_decals "300" +name "NSPlayer" +net_graph "0" +net_graphpos "1" +net_scale "5" +r_bmodelhighfrac "5.0" +r_detailtextures "0" +s_a3d "0.0" +s_automax_distance "30.0" +s_automin_distance "2.0" +s_bloat "2.0" +s_distance "60" +s_doppler "0.0" +s_eax "0.0" +s_leafnum "0" +s_max_distance "1000.0" +s_min_distance "8.0" +s_numpolys "200" +s_polykeep "1000000000" +s_polysize "10000000" +s_refdelay "4" +s_refgain "0.4" +s_rolloff "1.0" +s_verbwet "0.25" +sensitivity "4.960000" +skin "" +suitvolume "0.250000" +sv_aim "0" +sv_voiceenable "1" +team "" +topcolor "151.169998" +viewsize "120.000000" +voice_enable "1" +voice_forcemicrecord "1" +voice_modenable "1" +voice_scale "1" +volume "0.800000" ++mlook ++jlook +exec userconfig.cfg diff --git a/main/custom.hpk b/main/custom.hpk new file mode 100644 index 00000000..32f72e8f Binary files /dev/null and b/main/custom.hpk differ diff --git a/main/decals.wad b/main/decals.wad new file mode 100644 index 00000000..477dbe53 Binary files /dev/null and b/main/decals.wad differ diff --git a/main/delta.lst b/main/delta.lst new file mode 100644 index 00000000..583637de --- /dev/null +++ b/main/delta.lst @@ -0,0 +1,268 @@ +// structure name +// none == no conditional encode routine +// gamedll routine_name : before transmitting data, invoke the named function from the game .dll to reset fields as needed +// clientdll routine_name : same as above, except the routine is called via the client.dll + +clientdata_t none +{ + DEFINE_DELTA( flTimeStepSound, DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( origin[0], DT_SIGNED | DT_FLOAT, 21, 128.0 ), + DEFINE_DELTA( origin[1], DT_SIGNED | DT_FLOAT, 21, 128.0 ), + DEFINE_DELTA( velocity[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( velocity[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + + DEFINE_DELTA( m_flNextAttack, DT_FLOAT | DT_SIGNED, 22, 1000.0 ), + + DEFINE_DELTA( origin[2], DT_SIGNED | DT_FLOAT, 21, 128.0 ), + DEFINE_DELTA( velocity[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + + DEFINE_DELTA( ammo_nails, DT_SIGNED | DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( ammo_shells, DT_SIGNED | DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( ammo_cells, DT_SIGNED | DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( ammo_rockets, DT_SIGNED | DT_INTEGER, 10, 1.0 ), + + DEFINE_DELTA( m_iId, DT_INTEGER, 8, 1.0 ), + + DEFINE_DELTA( punchangle[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( flags, DT_INTEGER, 32, 1.0 ), // Cut to 3 bits? + DEFINE_DELTA( weaponanim, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( health, DT_SIGNED | DT_FLOAT, 12, 1.0 ), // Cut # of bits? + DEFINE_DELTA( maxspeed, DT_FLOAT, 16, 10.0 ), + DEFINE_DELTA( flDuckTime, DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( view_ofs[2], DT_SIGNED | DT_FLOAT, 10, 4.0 ), + DEFINE_DELTA( punchangle[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( punchangle[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( viewmodel, DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( weapons, DT_INTEGER, 32, 1.0 ), + + DEFINE_DELTA( pushmsec, DT_INTEGER, 11, 1.0 ), + DEFINE_DELTA( deadflag, DT_INTEGER, 3, 1.0 ), + DEFINE_DELTA( fov, DT_FLOAT, 8, 1.0 ), + DEFINE_DELTA( physinfo, DT_STRING, 1, 1.0 ), + DEFINE_DELTA( bInDuck, DT_INTEGER, 1, 1.0 ), + DEFINE_DELTA( flSwimTime, DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( waterjumptime, DT_INTEGER, 15, 1.0 ), + DEFINE_DELTA( waterlevel, DT_INTEGER, 2, 1.0 ), + DEFINE_DELTA( iuser1, DT_INTEGER, 3, 1.0 ), // Non-zero if I'm a spectator (1,2,3 different spec modes) + DEFINE_DELTA( iuser2, DT_INTEGER, 5, 1.0 ), // Holds the ent num of the target I'm spectating + DEFINE_DELTA( iuser3, DT_INTEGER, 6, 1.0 ), // NS custom code + DEFINE_DELTA( iuser4, DT_INTEGER, 32, 1.0 ), // NS custom parameter (needs 32 for AvHSpecialSound) + DEFINE_DELTA( fuser1, DT_FLOAT, 32, 1.0 ), // Use 32-bits because two values fit in here sometimes + DEFINE_DELTA( fuser2, DT_FLOAT, 32, 1.0 ), // Not sure if we need all 32, go back and optimize later if desired + DEFINE_DELTA( fuser3, DT_FLOAT, 32, 1.0 ), // Not sure if we need all 32, go back and optimize later if desired + DEFINE_DELTA( vuser1[0], DT_ANGLE, 8, 1.0 ), + DEFINE_DELTA( vuser1[1], DT_ANGLE, 8, 1.0 ), + DEFINE_DELTA( vuser1[2], DT_ANGLE, 8, 1.0 ), + DEFINE_DELTA( vuser4[2], DT_FLOAT, 32, 1.0 ) // Extended player info +} + +entity_state_t gamedll Entity_Encode +{ + DEFINE_DELTA( animtime, DT_TIMEWINDOW_8, 8, 1.0 ), + DEFINE_DELTA( frame, DT_FLOAT, 8, 1.0 ), + DEFINE_DELTA( origin[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( angles[0], DT_ANGLE, 16, 1.0 ), + DEFINE_DELTA( angles[1], DT_ANGLE, 16, 1.0 ), + DEFINE_DELTA( origin[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( origin[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( sequence, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( modelindex, DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( movetype, DT_INTEGER, 4, 1.0 ), + DEFINE_DELTA( solid, DT_SHORT, 3, 1.0 ), + DEFINE_DELTA( mins[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( mins[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( mins[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( maxs[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( maxs[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( maxs[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + + DEFINE_DELTA( endpos[0], DT_SIGNED | DT_FLOAT, 13, 1.0 ), + DEFINE_DELTA( endpos[1], DT_SIGNED | DT_FLOAT, 13, 1.0 ), + DEFINE_DELTA( endpos[2], DT_SIGNED | DT_FLOAT, 13, 1.0 ), + DEFINE_DELTA( startpos[0], DT_SIGNED | DT_FLOAT, 13, 1.0 ), + DEFINE_DELTA( startpos[1], DT_SIGNED | DT_FLOAT, 13, 1.0 ), + DEFINE_DELTA( startpos[2], DT_SIGNED | DT_FLOAT, 13, 1.0 ), + //DEFINE_DELTA( impacttime, DT_TIMEWINDOW_BIG, 13, 100.0 ), + DEFINE_DELTA( starttime, DT_TIMEWINDOW_BIG, 13, 100.0 ), + DEFINE_DELTA( team, DT_INTEGER, 2, 1.0 ), + + DEFINE_DELTA( weaponmodel, DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( owner, DT_INTEGER, 5, 1.0 ), + DEFINE_DELTA( effects, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( eflags, DT_INTEGER, 1, 1.0 ), + DEFINE_DELTA( angles[2], DT_ANGLE, 16, 1.0 ), + DEFINE_DELTA( colormap, DT_INTEGER, 16, 1.0 ), + DEFINE_DELTA( framerate, DT_SIGNED | DT_FLOAT, 8, 16.0 ), + DEFINE_DELTA( skin, DT_SHORT | DT_SIGNED, 9, 1.0 ), + DEFINE_DELTA( controller[0], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( controller[1], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( controller[2], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( controller[3], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( blending[0], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( blending[1], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( body, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( rendermode, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( renderamt, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( renderfx, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( scale, DT_FLOAT, 16, 256.0 ), + DEFINE_DELTA( rendercolor.r, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( rendercolor.g, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( rendercolor.b, DT_BYTE, 8, 1.0 ), + //DEFINE_DELTA( aiment, DT_INTEGER, 11, 1.0 ), + DEFINE_DELTA( basevelocity[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( basevelocity[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( basevelocity[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + + // Playerclass signifies it's a decalable glass item when referring to an object + + DEFINE_DELTA( playerclass, DT_INTEGER, 1, 1.0 ), + + //DEFINE_DELTA( iuser2, DT_INTEGER, 32, 1.0 ), // NS custom code (used for entity ids for research) + DEFINE_DELTA( iuser3, DT_INTEGER, 6, 1.0 ), // NS custom code + DEFINE_DELTA( iuser4, DT_INTEGER, 32, 1.0 ), // NS custom parameter (needs 32 for AvHSpecialSound) + DEFINE_DELTA( fuser1, DT_FLOAT, 32, 1.0 ) // Use 32-bits because two values fit in here sometimes + DEFINE_DELTA( fuser2, DT_FLOAT, 16, 1.0 ) // Not sure if we need all 32, go back and optimize later if desired + //DEFINE_DELTA( fuser3, DT_FLOAT, 32, 1.0 ) // Not sure if we need all 32, go back and optimize later if desired +} + +entity_state_player_t gamedll Player_Encode +{ + DEFINE_DELTA( animtime, DT_TIMEWINDOW_8, 8, 1.0 ), + DEFINE_DELTA( frame, DT_FLOAT, 8, 1.0 ), + DEFINE_DELTA( origin[0], DT_SIGNED | DT_FLOAT, 18, 32.0 ), + DEFINE_DELTA( angles[0], DT_ANGLE, 16, 1.0 ), + DEFINE_DELTA( angles[1], DT_ANGLE, 16, 1.0 ), + DEFINE_DELTA( origin[1], DT_SIGNED | DT_FLOAT, 18, 32.0 ), + DEFINE_DELTA( origin[2], DT_SIGNED | DT_FLOAT, 18, 32.0 ), + DEFINE_DELTA( gaitsequence, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( sequence, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( modelindex, DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( movetype, DT_INTEGER, 4, 1.0 ), + DEFINE_DELTA( solid, DT_SHORT, 3, 1.0 ), + DEFINE_DELTA( mins[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( mins[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( mins[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( maxs[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( maxs[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( maxs[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( weaponmodel, DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( team, DT_INTEGER, 4, 1.0 ) + DEFINE_DELTA( playerclass, DT_INTEGER, 4, 1.0 ) + DEFINE_DELTA( owner, DT_INTEGER, 5, 1.0 ), + DEFINE_DELTA( effects, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( angles[2], DT_ANGLE, 16, 1.0 ), +// DEFINE_DELTA( colormap, DT_INTEGER, 16, 1.0 ), + DEFINE_DELTA( framerate, DT_SIGNED | DT_FLOAT, 8, 16.0 ), + DEFINE_DELTA( skin, DT_SHORT | DT_SIGNED, 9, 1.0 ), + DEFINE_DELTA( controller[0], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( controller[1], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( controller[2], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( controller[3], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( blending[0], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( blending[1], DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( body, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( rendermode, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( renderamt, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( renderfx, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( scale, DT_FLOAT, 16, 256.0 ), + DEFINE_DELTA( rendercolor.r, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( rendercolor.g, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( rendercolor.b, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( friction, DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( usehull, DT_INTEGER, 1, 1.0 ), + DEFINE_DELTA( gravity, DT_SIGNED | DT_FLOAT, 16, 32.0 ), +// DEFINE_DELTA( aiment, DT_INTEGER, 11, 1.0 ), + DEFINE_DELTA( basevelocity[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( basevelocity[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( basevelocity[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( spectator, DT_INTEGER, 1, 1.0 ), + DEFINE_DELTA( iuser3, DT_INTEGER, 6, 1.0 ), // Need player info for AvHCommanderModeHandler::LookupClassNameForEntity + DEFINE_DELTA( iuser4, DT_INTEGER, 32, 1.0 ), // NS custom parameter (needs 32 for AvHSpecialSound) + DEFINE_DELTA( fuser2, DT_FLOAT, 12, 1.0 ), // For player health (energy is predicted so this isn't needed for it) + DEFINE_DELTA( vuser1[0], DT_ANGLE, 8, 1.0 ), + DEFINE_DELTA( vuser1[1], DT_ANGLE, 8, 1.0 ), + DEFINE_DELTA( vuser1[2], DT_ANGLE, 8, 1.0 ), + DEFINE_DELTA( vuser4[2], DT_FLOAT, 32, 1.0 ) // Extended player info +} + +custom_entity_state_t gamedll Custom_Encode +{ + DEFINE_DELTA( rendermode, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( origin[0], DT_SIGNED | DT_FLOAT, 17, 8.0 ), + DEFINE_DELTA( origin[1], DT_SIGNED | DT_FLOAT, 17, 8.0 ), + DEFINE_DELTA( origin[2], DT_SIGNED | DT_FLOAT, 17, 8.0 ), + DEFINE_DELTA( angles[0], DT_SIGNED | DT_FLOAT, 17, 8.0 ), + DEFINE_DELTA( angles[1], DT_SIGNED | DT_FLOAT, 17, 8.0 ), + DEFINE_DELTA( angles[2], DT_SIGNED | DT_FLOAT, 17, 8.0 ), + DEFINE_DELTA( sequence, DT_INTEGER, 16, 1.0 ), + DEFINE_DELTA( skin, DT_INTEGER, 16, 1.0 ), + DEFINE_DELTA( modelindex, DT_INTEGER, 16, 1.0 ), + DEFINE_DELTA_POST( scale, DT_FLOAT, 8, 1.0, 0.1 ), + DEFINE_DELTA( body, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( rendercolor.r, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( rendercolor.g, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( rendercolor.b, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( renderfx, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( renderamt, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( frame, DT_FLOAT, 8, 1.0 ), + DEFINE_DELTA_POST( animtime, DT_FLOAT, 8, 1.0, 0.1 ) +} + +usercmd_t none +{ + DEFINE_DELTA( lerp_msec, DT_SHORT, 9, 1.0 ), + DEFINE_DELTA( msec, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( viewangles[1], DT_ANGLE, 16, 1.0 ), + DEFINE_DELTA( viewangles[0], DT_ANGLE, 16, 1.0 ), + DEFINE_DELTA( buttons, DT_SHORT, 16, 1.0 ), + DEFINE_DELTA( forwardmove, DT_SIGNED | DT_FLOAT, 12, 1.0 ), + DEFINE_DELTA( lightlevel, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( sidemove, DT_SIGNED | DT_FLOAT, 12, 1.0 ), + DEFINE_DELTA( upmove, DT_SIGNED | DT_FLOAT, 12, 1.0 ), + DEFINE_DELTA( impulse, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( weaponselect, DT_BYTE, 8, 1.0 ), + DEFINE_DELTA( viewangles[2], DT_ANGLE, 16, 1.0 ), + DEFINE_DELTA( impact_index, DT_INTEGER, 6, 1.0 ), + DEFINE_DELTA( impact_position[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( impact_position[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( impact_position[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ) +} + +weapon_data_t none +{ + DEFINE_DELTA( m_flTimeWeaponIdle, DT_FLOAT | DT_SIGNED, 22, 1000.0 ), + DEFINE_DELTA( m_flNextPrimaryAttack, DT_FLOAT | DT_SIGNED, 22, 1000.0 ), + DEFINE_DELTA( m_flNextReload, DT_FLOAT | DT_SIGNED, 22, 1000.0 ), +// DEFINE_DELTA( m_fNextAimBonus, DT_FLOAT | DT_SIGNED, 22, 1000.0 ), + DEFINE_DELTA( m_flNextSecondaryAttack, DT_FLOAT | DT_SIGNED, 22, 1000.0 ), + DEFINE_DELTA( m_iClip, DT_SIGNED | DT_INTEGER, 10, 1.0 ), +// DEFINE_DELTA( m_flPumpTime, DT_FLOAT | DT_SIGNED, 22, 1000.0 ), +// DEFINE_DELTA( m_fInSpecialReload, DT_INTEGER, 2, 1.0 ), + DEFINE_DELTA( m_fReloadTime, DT_FLOAT, 16, 100.0 ), + DEFINE_DELTA( m_fInReload, DT_INTEGER, 1, 1.0 ), +// DEFINE_DELTA( m_fAimedDamage, DT_FLOAT, 6, 0.1 ), +// DEFINE_DELTA( m_fInZoom, DT_INTEGER, 1, 1.0 ), +// DEFINE_DELTA( m_iWeaponState, DT_INTEGER, 2, 1.0 ), + DEFINE_DELTA( m_iId, DT_INTEGER, 8, 1.0 ), + DEFINE_DELTA( iuser3, DT_INTEGER, 3, 1.0 ), + DEFINE_DELTA( fuser2, DT_SIGNED | DT_FLOAT, 22, 128.0 ), + DEFINE_DELTA( fuser3, DT_SIGNED | DT_FLOAT, 22, 128.0 ) +} + +event_t none +{ + DEFINE_DELTA( entindex, DT_INTEGER, 10, 1.0 ), + DEFINE_DELTA( bparam1, DT_INTEGER, 1, 1.0 ), + DEFINE_DELTA( bparam2, DT_INTEGER, 1, 1.0 ), + DEFINE_DELTA( origin[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( origin[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( origin[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( fparam1, DT_FLOAT | DT_SIGNED, 20, 100.0 ), + DEFINE_DELTA( fparam2, DT_FLOAT | DT_SIGNED, 20, 100.0 ), + DEFINE_DELTA( iparam1, DT_INTEGER | DT_SIGNED, 16, 1.0 ), + DEFINE_DELTA( iparam2, DT_INTEGER | DT_SIGNED, 16, 1.0 ), + DEFINE_DELTA( angles[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( angles[1], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( angles[2], DT_SIGNED | DT_FLOAT, 16, 8.0 ), + DEFINE_DELTA( ducking, DT_INTEGER, 1, 1.0 ) +} diff --git a/main/dev.cfg b/main/dev.cfg new file mode 100644 index 00000000..1bdce382 --- /dev/null +++ b/main/dev.cfg @@ -0,0 +1,44 @@ +// Cheat codes +//name "Flayra" +sv_cheats 1 +bigdig +lowcost +mp_tournamentmode 1 +mp_drawinvisibleentities 1 +//highdamage +bind "l" "selectall" +bind "h" "sv_restart;wait;wait;wait;numents" +bind "j" "numents" +bind "F1" "jointeamone" +bind "F2" "jointeamtwo" +bind "F3" "addbot" +bind "F9" "givepoints" +bind "F10" "spawnhive" +bind "F11" "killhive" +bind "q" "switch" + +// Camera controls +bind "MOUSE3" "camtoggle" +bind b +cammousemove +cam_idealpitch 20 +cam_idealdist 140 +cam_idealyaw 0 + +// Offense chamber +bind "t" "impulse 91" + +// Gorge, Lerk, Fade, Onos +bind "z" "impulse 114" +bind "x" "impulse 115" +bind "c" "impulse 116" +bind "v" "impulse 117" + +// Fast Pistol fire (from: http://web1.server126.notraffic.de/forum/showthread/t-13792.html) +//hud_fastswitch 1 +// +//alias +fp_fire "weapon_pistol; +attack; wait; -attack; wait; weapon_pistol; +attack; wait; -attack; wait; weapon_pistol; +attack; wait; -attack; wait; weapon_pistol; +attack; wait; -attack; wait; weapon_pistol; +attack; wait; -attack; wait; " +//alias -fp_fire "-attack" +//alias fp_fireon "bind mouse1 +fp_fire; developer 1; echo Fast Pistol Fire *ON*; developer 0; alias fp_fire fp_fireoff" +//alias fp_fireoff "bind mouse1 +attack; developer 1; echo Fast Pistol Fire *OFF*; developer 0; alias fp_fire fp_fireonn" +//alias fp_fire "fp_fireon" +//bind "x" "fp_fire" \ No newline at end of file diff --git a/main/dlls/HPB_bot.dll b/main/dlls/HPB_bot.dll new file mode 100644 index 00000000..0b235599 Binary files /dev/null and b/main/dlls/HPB_bot.dll differ diff --git a/main/dlls/ns.dll b/main/dlls/ns.dll new file mode 100644 index 00000000..cf007b6d Binary files /dev/null and b/main/dlls/ns.dll differ diff --git a/main/dlls/ns.pdb b/main/dlls/ns.pdb new file mode 100644 index 00000000..2f651a0a Binary files /dev/null and b/main/dlls/ns.pdb differ diff --git a/main/dlls/ns_i386.so b/main/dlls/ns_i386.so new file mode 100644 index 00000000..8768530a Binary files /dev/null and b/main/dlls/ns_i386.so differ diff --git a/main/dlls/private.dll b/main/dlls/private.dll new file mode 100644 index 00000000..b5ce0236 Binary files /dev/null and b/main/dlls/private.dll differ diff --git a/main/dlls/qa_i386.so b/main/dlls/qa_i386.so new file mode 100644 index 00000000..786d03f1 Binary files /dev/null and b/main/dlls/qa_i386.so differ diff --git a/main/download.html b/main/download.html new file mode 100644 index 00000000..54a565ba Binary files /dev/null and b/main/download.html differ diff --git a/main/english_titles.txt b/main/english_titles.txt new file mode 100644 index 00000000..0012ac2e --- /dev/null +++ b/main/english_titles.txt @@ -0,0 +1,4574 @@ +//TITLES FOR NATURAL SELECTION +//DO NOT ALTER THIS FILE +// Position command $position x y +// x & y are from 0 to 1 to be screen resolution independent +// -1 means center in each dimension +// Effect command $effect +// effect 0 is fade in/fade out +// effect 1 is flickery credits +// effect 2 is write out (training room) +// Text color r g b command $color +// fadein time fadeout time / hold time +// $fadein (message fade in time - per character in effect 2) +// $fadeout (message fade out time) +// $holdtime (stay on the screen for this long) + +Created_By +{ +Natural Selection is created and maintained by Unknown Worlds Entertainment. Visit www.unknownworlds.com for more information. +} + +NS_Site +{ +Check the front page of www.natural-selection.org for late-breaking news +} + +Team_AutoAssign +{ +AUTO ASSIGN +} + +Menu_Spectate +{ +SPECTATE +} + +UndefinedTeam +{ +Ready Room +} + +Menu_LeaveGame +{ +Exit game +} + +Menu_Marine1Team +{ +Join marines +} + +Menu_Alien1Team +{ +Join aliens +} + +Marine1Team +{ +Frontiersmen +} + +Alien1Team +{ +Kharaa +} + +Marine2Team +{ +Frontiersmen +} + +Alien2Team +{ +Kharaa +} + +AutoTeam +{ +Auto-assigned +} + +Muted +{ +Muted +} + +Unmuted +{ +Unmuted +} + +No_longer_hear_that_player +{ +no longer hear that player +} + +LineComplete +{ +Fully upgraded. +} + +YouAreNowA +{ +You are now a +} + +Exclamation +{ +! +} + +ChooseAnUpgrade +{ +Choose an upgrade by opening your pop-up menu (right-click by default)! +} + +Rank_Marine_1 +{ +Level 1: Private +} + +Rank_Marine_2 +{ +Level 2: Private First Class +} + +Rank_Marine_3 +{ +Level 3: Corporal +} + +Rank_Marine_4 +{ +Level 4: Sergeant +} + +Rank_Marine_5 +{ +Level 5: Lieutenant +} + +Rank_Marine_6 +{ +Level 6: Captain +} + +Rank_Marine_7 +{ +Level 7: Commander +} + +Rank_Marine_8 +{ +Level 8: Major +} + +Rank_Marine_9 +{ +Level 9: Field Marshal +} + +Rank_Marine_10 +{ +Level 10: General +} + +Rank_Alien_1 +{ +Level 1: Hatchling +} + +Rank_Alien_2 +{ +Level 2: Xenoform +} + +Rank_Alien_3 +{ +Level 3: Minion +} + +Rank_Alien_4 +{ +Level 4: Ambusher +} + +Rank_Alien_5 +{ +Level 5: Attacker +} + +Rank_Alien_6 +{ +Level 6: Rampager +} + +Rank_Alien_7 +{ +Level 7: Slaughterer +} + +Rank_Alien_8 +{ +Level 8: Eliminator +} + +Rank_Alien_9 +{ +Level 9: Nightmare +} + +Rank_Alien_10 +{ +Level 10: Behemoth +} + +// SDK 2.0 Spectator Menu +Spec_Map +{ +Map +} + +Spec_Mode1 +{ +Locked Chase-Camera +} + +Spec_Mode2 +{ +Free Chase-Camera +} + +Spec_Mode3 +{ +Free look +} + +Spec_Mode4 +{ +First Person +} + +Spec_Mode5 +{ +Free Map Overview +} + +Spec_Mode6 +{ +Chase Map Overview +} + +Spec_NoTarget +{ +No valid targets. Cannot switch to Chase-Camera Mode. +} + +Spec_Help +{ +Press F4 for Ready Room Use LEFT and RIGHT keys, JUMP and FIRE to change view. +} + +Spec_Slow_Motion +{ +Slow Motion +} + +Spec_Replay +{ +Instant Replay +} + +Spec_Help2 +{ +Your text messages and voice can only be seen by other Spectators +} + +Spec_Only_Help +{ +} + +Directed +{ +Directed +} + +SpectatorsNotAllowed +{ +This server does not currently allow spectators. +} + +ObsInEyePrefix +{ +Viewing through eyes of +} + +SpectatorTeam +{ +Spectators +} + +Spectators +{ +Spectators +} + +TEAM +{ +Team +} + +TEAMS +{ +Teams +} + +PLAYER +{ +Player +} + +Player_plural +{ +Players +} + +PLAYERS +{ +Players +} + +SCORES +{ +Player information +} + +SCORE +{ +Score +} + +KILLS +{ +Kills +} + +DEATHS +{ +Deaths +} + +LATENCY +{ +Latency +} + +VOICE +{ +Voice +} + +Unassigned +{ +Unassigned +} + +Menu_OK +{ +OK +} + +Points +{ +points +} + +Cost +{ +Cost +} + +NoSpectating +{ +Spectating isn't allowed on this server. +} + +// Main game messages +ReadyRoomMessage +{ +You are in the Ready Room. Walk through an entrance to join a team or observe the game. +} + +ReinforcementMessage +{ +You are waiting in line to spawn back in. +} + +ReinforcingMessage +{ +You are now spawning back in... +} + +ObserverMessage +{ +You are an observer. You won't be able to join this game but you can join the next game. +} + +CantSwitchTeamsInTournyMode +{ +You can't switch teams during tournament mode. +} + +CantSwitchTeamsAfterGameStart +{ +You can't switch teams once the game has started. +} + +TooManyPlayersOnTeam +{ +There are too many players on this team already. +} + +CantJoinAfterSpectating +{ +You cannot join the game in progress once you've been a spectator. +} + +CanOnlyJoinTeamYouveReinforced +{ +You have already seen the other team, you can only join that team until next round. +} + +YouCanJoinSoon +{ +You will join this team soon. +} + +AlreadyOnTeam +{ +You are already on a team. Go back to the ready room first to switch teams. +} + +SoldierMessage +{ +You are now a soldier. Try to follow orders from your commander, and do your best to keep the enemy from killing your teammates and destroying your structures. +} + +ObjectivesVsAliens +{ +You are fighting aliens! Aliens respawn at hives, so to win the game, you must kill all the alien hives and then kill the aliens. +} + +ObjectivesVsMarines +{ +You are fighting marines! Marines respawn at infantry portals, so to win the game, you must kill all their infantry portals, then kill all the marines. +} + +Handicap +{ +damage +} + +CommanderMessage +{ +Left-click or marquee-select players and right-click a location, structure or player to give them an order. The menu in the lower right lets you build structures and equip your soldiers. +} + +Commander +{ +Comm +} + +NoCommander +{ +No commander +} + +GestationMessage +{ +You are now gestating into a new alien lifeform. Get ready to hatch... +} + +CocoonMessage +{ +You have been cocooned! +} + +YouAreReinforcements +{ +You were called in as reinforcements! +} + +////////////// +// Pie menu // +////////////// +MenuMarineRoot +{ +Start +} + +//MenuMarineRoot +//{ +//!marinenode +//} + + +MenuComms +{ +Comms +} + +MenuTalk +{ +Talk +} + +MenuAttacked +{ +"Attacked!" +} + +MenuCheer +{ +Cheer +} + +MenuCoverMe +{ +"Cover me!" +} + +MenuRetreat +{ +"Retreat!" +} + +MenuInPosition +{ +"In position" +} + +MenuEnemySpotted +{ +"Enemy here" +} + +MenuMoveOut +{ +"Move out" +} + +MenuAllClear +{ +"All clear" +} + +MenuYell +{ +Yell +} + +MenuSay +{ +Say +} + +MenuRogerThat +{ +"Roger that" +} + +MenuHello +{ +"Hello" +} + +MenuNeedHelp +{ +"Need help" +} + +MenuNeedHealth +{ +"Need health" +} + +MenuNeedAmmo +{ +"Need ammo" +} + +MenuFollowMe +{ +"Follow me" +} + +MenuCovering +{ +"Covering" +} + +MenuOrders +{ +Orders +} + +MenuNeedOrder +{ +"Need order" +} + +MenuAck +{ +"Acknowledged" +} + +MenuAdmin +{ +Admin +} + +Menu_ReadyRoom +{ +Ready room +} + +MenuVoteCommanderDown +{ +Eject commander +} + +MenuArea +{ +Area +} + +MenuMoveTo +{ +Move to +} + +MenuGuard +{ +Guard +} + +MenuTarget +{ +Target +} + +MenuDeploy +{ +Deploy +} + +MenuIncoming +{ +Incoming +} + +MenuProceed +{ +Proceed +} + +MenuFireTarget +{ +Fire target +} + +MenuTaunt +{ +Taunt +} + +MenuTakeCover +{ +Take cover +} + +MenuReady +{ +Ready +} + +MenuDefendObj +{ +Defend +} + +MenuCeaseFire +{ +Cease fire +} + +MenuTeam +{ +Team +} + +MenuBuilding +{ +Build +} + +MenuAttackObj +{ +Attack +} + +MenuTaunt +{ +Taunt +} + +MenuHealth +{ +"Health" +} + +MenuCameraTower +{ +Camera +} + +MenuTurret +{ +Turret +} + +MenuSiegeTurret +{ +Siege +} + +MenuBlazeOfGlory +{ +Blaze +} + +MenuProtect +{ +Protect +} + +MenuReinforce +{ +Reinforce +} + +MenuArmorUpgrade +{ +Heavy +} + +MenuRepair +{ +Repair +} + +MenuPowerups +{ +Stim +} + +MenuAdrenaline +{ +Adrenaline +} + +MenuDefMatrix +{ +Def matrix +} + +MenuPhaseGate +{ +Phase gate +} + +MenuSelf +{ +Me +} + +MenuBuy +{ +Buy +} + +MenuHeavy +{ +Heavy +} + +MenuShotgun +{ +Shotgun +} + +MenuHMG +{ +HMG +} + +MenuGL +{ +Grenade launcher +} + +MenuFlamer +{ +Flamer +} + +MenuNuke +{ +Nuke +} + +MenuWeapon +{ +Weapon +} + +MenuEquipment +{ +Equipment +} + +MenuSupport +{ +Support +} + +MenuIntel +{ +Intel +} + +MenuCommander +{ +Commander +} + +MenuResupply +{ +Resupply +} + +MenuCatalyst +{ +Catalyst +} + +MenuScan +{ +Scan area +} + +MenuUse +{ +Use +} + +MenuNextWeapon +{ +Next weapon +} + +MenuJetpacks +{ +Jet-packs +} + +MenuReloadWeapon +{ +Reload +} + +MenuDropWeapon +{ +Drop +} + +MenuLight +{ +Light +} + +MenuEquip +{ +Equip +} + +MenuGrenade +{ +Grenade +} + +MenuMotionTracking +{ +Motion-tracking +} + +MenuDistressBeacon +{ +Distress beacon +} + +MenuUpgradeWeapon +{ +Weapon +} + +MenuUpgradeDamage1 +{ +Damage level 1 +} + +MenuUpgradeDamage2 +{ +Damage level 2 +} + +MenuUpgradeDamage3 +{ +Damage level 3 +} + +MenuUpgradeArmor1 +{ +Armor level 1 +} + +MenuUpgradeArmor2 +{ +Armor level 2 +} + +MenuUpgradeArmor3 +{ +Armor level 3 +} + +MenuAmmo +{ +Ammo +} + +MenuMines +{ +Mines +} + +MenuWelder +{ +Welder +} + +MenuGrenades +{ +Grenades +} + +MenuUpgradeMG +{ +Upgrade +} + +MenuUnlockHiveTwo +{ +Unlock next ability +} + +MenuUnlockHiveThree +{ +Unlock next ability +} + +//////////////////// +// Armor upgrades // +//////////////////// + +MenuArmorFull +{ +Armor full +} + +MenuHeavyArmor +{ +Heavy armor +} + +MenuBuyArmorMotionTrack +{ +Tracker +} + +MenuJetpack +{ +Jetpack +} + +MenuBuyArmorLifeSupport +{ +Sustain +} + +// Rank +MenuRank +{ +Rank +} + +MenuPromote +{ +Promote +} + +MenuDemote +{ +Demote +} + +////////////////////////////////////////////////// +// Don't localize these, they are sprite names: // +// (sprites/640(or 320)name.spr) // +////////////////////////////////////////////////// +MenuAlienRoot +{ +Start +} + +MenuAlienSmallMorph +{ +Lifeform +} + +MenuAlienMorphLevel1 +{ +Skulk +} + +MenuAlienMorphLevel2 +{ +Gorge +} + +MenuAlienBigMorph +{ +Advanced +} + +MenuAlienMorphLevel3 +{ +Lerk +} + +MenuAlienMorphLevel4 +{ +Fade +} + +MenuAlienMorphLevel5 +{ +Onos +} + +MenuAlienUpgrade +{ +Evolve upgrade +} + +MenuAlienComm +{ +Voice +} + +MenuAlienBuild +{ +Build +} + +MenuAlienAdvBuild +{ +Advanced +} + +MenuAlienBuildUpgrades +{ +Upgrades +} + + +MenuAlienCommSayingsWest +{ +Yells +} + +MenuAlienCommSayingOne +{ +Chuckle +} + +MenuAlienCommSayingTwo +{ +Need healing +} + +MenuAlienCommSayingThree +{ +Need backup +} + +MenuAlienCommSayingsEast +{ +Sayings +} + +MenuAlienCommSayingFour +{ +Incoming +} + +MenuAlienCommSayingFive +{ +Attack +} + +MenuAlienCommSayingSix +{ +I'm building here +} + +MenuAlienUpgradeDefOne +{ +Carapace +} + +MenuAlienUpgradeDefTwo +{ +Regeneration +} + +MenuAlienUpgradeDefThree +{ +Redemption +} + +MenuAlienUpgradeSenOne +{ +Cloaking +} + +MenuAlienUpgradeSenTwo +{ +Focus +} + +MenuAlienUpgradeSenThree +{ +Scent of Fear +} + +MenuAlienUpgradeMoveOne +{ +Celerity +} + +MenuAlienUpgradeMoveTwo +{ +Adrenaline +} + +MenuAlienUpgradeMoveThree +{ +Silence +} + +MenuAlienDefenseChamber +{ +Defense chamber +} + +MenuAlienSensoryChamber +{ +Sensory chamber +} + +MenuAlienMovementChamber +{ +Movement chamber +} + +MenuAlienDefenseUpgrades +{ +Defensive +} + +MenuAlienSensoryUpgrades +{ +Sensory +} + +MenuAlienMovementUpgrades +{ +Movement +} + +MenuAlienOffensiveChamber +{ +Offense chamber +} + +MenuAlienResourceTower +{ +Resource tower +} + +MenuAlienHive +{ +Hive +} + + + +// Armor received messages +$position -1 0.2 +$effect 0 +$fadein 0.5 +$fadeout 0.5 +$holdtime 5.0 + +ReceiveHeavyArmor +{ +Your armor has been upgraded to heavy armor. You are now more protected against enemies. +} + +ReceiveMotionTrackArmor +{ +You now have a motion-tracker built into your armor. +} + +ReceiveJetpackArmor +{ +You now have a jet-pack armor upgrade. Press and hold your jump key to use it. +} + +ReceiveLifeSupportArmor +{ +You now have a LifeSupport (TM) system. When you get near death, you will be protected until help arrives. +} + + + +$position -1 0.35 +$holdtime 3.0 + +GameStarting +{ +The game is about to start... +} + +$holdtime 2.0 +GameBegun +{ +The game has begun. +} + +// Overwatch enabled +//OverwatchActive +//{ +//Overwatch active +//} + +// Overwatch range string, expecting a float for range +OverwatchRange +{ +Target range: %f +} + +// Points awarded +$position -1 0.25 +$effect 0 +$holdtime 4 + +MarineAward +{ +Your team just killed an enemy! +} + +MarineAwardToLeader +{ +Your squad just received points for killing an enemy! +} + +// Points awarded +$position -1 0.15 +$effect 0 +$holdtime 3 +MarineAwardToCommander +{ +Your team earned points for killing an enemy! +} + +// Points awarded +$position -1 0.25 +$effect 0 +$holdtime 4 +AlienAward +{ +You just got resources for killing an enemy! +} + +Defect +{ +Leave squad +} + +WeaponCantBeDropped +{ +This weapon can't be dropped. +} + +DefectMessageToLeader +{ +A player has defected from your squad. +} + +SquadIndicator +{ +You're in Squad %d +} + +InvalidOrderGiven +{ +Invalid order +} + +$position -1 0.65 +$effect 0 +$holdtime .5 +$fadein .2 +$fadeout .2 +GameWontStart +{ +The game won't start until both sides have players. +} + +// Translation note: don't translate "ready" +GameWontStartUntilReady +{ +Game won't start until both teams type "ready". +} + +EvolvingMessage +{ +Evolving... +} + +VoteCast +{ +Your vote has been cast. +} + +VoteStarted +{ +A vote to eject the commander has started. If the commander is being disruptive, use your pop-up menu to vote against him. +} + +VoteIllegal +{ +A vote is illegal at this time. +} + +AlreadyVoted +{ +You can only vote once per game. +} + +VoteFailed +{ +The vote to eject the commander has failed. +} + +VoteCancelled +{ +The vote to eject the commander has been cancelled. +} + +VoteSucceeded +{ +The commander has been voted off the command console. +} + +BannedFromCommand +{ +You have been temporarily banned from commanding on this server. Many servers will let you command again in a few hours. +} + +MustGestateUp +{ +You can only change to to higher lifeforms. +} + +MustGestateOnGround +{ +You must stand on flat ground to gestate. +} + +NotWhileDigesting +{ +You can't gestate while digesting a player. +} + +NoReadyRoomWhileDigested +{ +You can't go to the ready room while being digested. +} + +NeedMoreRoomToGestate +{ +You need more room to gestate. +} + +NeedOneHiveToGestate +{ +Your team needs a hive to gestate into this lifeform. +} + +NeedTwoHivesToGestate +{ +Your team needs two hives to gestate into this lifeform. +} + +NeedThreeHivesToGestate +{ +Your team needs three hives to gestate into this lifeform. +} + +NeedOneHiveForStructure +{ +Your team needs a hive to build this structure. +} + +NeedTwoHivesForStructure +{ +Your team needs two hives to build this structure. +} + +NeedThreeHivesForStructure +{ +Your team needs three hives to build this structure. +} + +NeedsAnotherHiveForStructure +{ +Your team needs another hive to build this structure. +} + +MustBeBuilder +{ +You must be a Gorge to build this structure. +} + +UpgradeNotAvailable +{ +This upgrade isn't available at this time. +} + +TooManyStructuresOfThisTypeNearby +{ +There are too many structures of this type nearby. +} + +TooManyStructuresInArea +{ +There are too many structures in this area. +} + +$holdtime 2.0 +TooManyWebs +{ +Your team has reached the maximum number of webs allowed. +} + +TooManyWebsNearby +{ +There are too many webs in this area. +} + +TeamOneWon +{ +Team one won the game! +} + +TeamTwoWon +{ +Team two won the game! +} + +GameDraw +{ +Draw game! +} + +RankBeforeGameStart +{ +You can only change ranks before the game starts. +} + +DefectAfterGameStart +{ +You can only defect after the game starts. +} + +// Tech tree +MarineResourcePrefix +{ +Team resources: +} + +AlienResourcePrefix +{ +Resources +} + +CarryResourcePrefix +{ +Carrying %d resources +} + +Resources +{ +Resources: +} + + +NumericalEventResources +{ +resources +} + +NumericalEventHealth +{ +health +} + +NumericalEventResourcesDonated +{ +Resources donated +} + +NumericalEventAmmo +{ +Ammo received +} + + + + +AlienEnergyDescription +{ +Energy +} + +ResourcesDepleted +{ +Resources depleted +} + +Reinforcements +{ +Reinforcements +} + + +WeaponCategory +{ +Weapons +} + +ArmorCategory +{ +Armor +} + +BuildCategory +{ +Build +} + +RadioCategory +{ +Radio +} + +TechNodeLabel_0 +{ +None +} + +TechNodeHelp_0 +{ + +} + +TechNodeHelp_1 +{ +Switch to your next weapon. +} + +TechNodeHelp_2 +{ +Reloads your current weapon. +} + +TechNodeHelp_3 +{ +Drop your current weapon, to get more speed, or to give to someone else to use. +} + +TechNodeHelp_5 +{ +Leave game and go back to the ready room. This will let you switch teams, observe the game, or take a break. +} + +TechNodeHelp_6 +{ +If the commander is deliberately trying to ruin the game, select this to vote the commander out of the command console. If enough votes are received, he will be ejected for the rest of the game. +} + + +TechNodeLabel_10 +{ +Attacked +} + +TechNodeLabel_11 +{ +Attack +} + +TechNodeLabel_12 +{ +Destroy +} + +TechNodeLabel_13 +{ +Confirmed +} + +TechNodeLabel_14 +{ +Focus team +} + +TechNodeLabel_15 +{ +Powerful +} + + +TechNodeHelp_7 +{ +"chuckle" +} + +TechNodeHelp_8 +{ +"Need healing" +} + +TechNodeHelp_9 +{ +"Need backup" +} + +TechNodeHelp_10 +{ +"Incoming" +} + +TechNodeHelp_11 +{ +"ATTACK" +} + +TechNodeHelp_12 +{ +"I'm building here" +} + + +TechNodeLabel_20 +{ +Armor #1 +} + +TechNodeLabel_21 +{ +Armor #2 +} + +TechNodeLabel_22 +{ +Armor #3 +} + +TechNodeLabel_23 +{ +Weapons #1 +} + +TechNodeLabel_24 +{ +Weapons #2 +} + +TechNodeLabel_25 +{ +Weapons #3 +} + +TechNodeHelp_20 +{ +Level 1 player armor +} + +TechNodeHelp_21 +{ +Level 2 player armor +} + +TechNodeHelp_22 +{ +Level 3 player armor +} + + +TechNodeHelp_23 +{ +Weapons, mines, turrets do +10%% damage +} + +TechNodeHelp_24 +{ +Weapons, mines, turrets do +20%% damage +} + +TechNodeHelp_25 +{ +Weapons, mines, turrets do +30%% damage +} + +TechNodeLabel_26 +{ +Advanced turret factory +} + +TechNodeHelp_26 +{ +Upgrade to advanced turret factory +} + +TechNodeLabel_47 +{ +Catalysts +} + +TechNodeHelp_47 +{ +Catalyst research +} + +TechNodeLabel_28 +{ +Jet-packs +} + +TechNodeHelp_28 +{ +Allows jet-pack modules +} + +TechNodeLabel_29 +{ +Heavy armor +} + +TechNodeHelp_29 +{ +Allows heavy armor +} + +TechNodeLabel_30 +{ +Distress beacon +} + +TechNodeHelp_30 +{ +Respawns all dead marines at the marine start. +} + +TechNodeLabel_31 +{ +Resupply health and ammo +} + +TechNodeLabel_31 +{ +Deployable health tech +} + +TechNodeHelp_31 +{ +Allows commander to deploy health packs +} + +TechNodeLabel_32 +{ +Cancel +} + +TechNodeHelp_32 +{ +Cancel research +} + +TechNodeLabel_33 +{ +Motion-tracking +} + +TechNodeHelp_33 +{ +All moving enemies become visible. +} + +TechNodeLabel_34 +{ +Phase tech +} + +TechNodeHelp_34 +{ +Allows scanning and phase gate construction +} + +TechNodeLabel_35 +{ +Upgrade tower +} + +TechNodeHelp_35 +{ +Improve speed of resource collection +} + +TechNodeLabel_36 +{ +Electrical defense +} + +TechNodeHelp_36 +{ +Shocks enemies that get too close +} + +TechNodeLabel_37 +{ +Grenades +} + +TechNodeHelp_37 +{ +Gives all soldiers one grenade on spawn +} + +TechNodeLabel_38 +{ +Heavy armor +} + +TechNodeHelp_38 +{ +Gives heavy armor to soldier. +} + +TechNodeLabel_39 +{ +Jet-pack +} + +TechNodeHelp_39 +{ +Gives jet-pack ability to soldier. +} + +TechNodeLabel_40 +{ +Infantry portal +} + +TechNodeHelp_40 +{ +Spawns players +} + +TechNodeLabel_41 +{ +Resource tower +} + +TechNodeHelp_41 +{ +Gives resources +} + + + +TechNodeLabel_43 +{ +Turret factory +} + +TechNodeHelp_43 +{ +Allows turrets +} + +TechNodeLabel_45 +{ +Arms lab +} + +TechNodeHelp_45 +{ +Weapon and armor upgrades. +} + +TechNodeLabel_46 +{ +Prototype lab +} + +TechNodeHelp_46 +{ +Experimental technology +} + +TechNodeLabel_48 +{ +Armory +} + +TechNodeHelp_48 +{ +Access to new weapons. +} + +TechNodeLabel_49 +{ +Advanced armory +} + +TechNodeHelp_49 +{ +Upgrade to advanced armory +} + + +TechNodeLabel_50 +{ +Nuke plant +} + +TechNodeHelp_50 +{ +Allows nuke construction. +} + +TechNodeLabel_51 +{ +Observatory +} + +TechNodeHelp_51 +{ +Reconnaisance technology +} + +TechNodeLabel_52 +{ +Health nanotech +} + +TechNodeHelp_52 +{ +Allows commander to deploy health packs in the field +} + +TechNodeLabel_53 +{ +Scanner Sweep +} + +TechNodeHelp_53 +{ +Gives temporary sight into an area and reveals cloaked players. +} + +TechNodeLabel_55 +{ +Phase gate +} + +TechNodeHelp_55 +{ +Lightspeed travel +} + +TechNodeLabel_56 +{ +Turret +} + +TechNodeHelp_56 +{ +Build a sentry turret. +} + +TechNodeLabel_57 +{ +Siege turret +} + +TechNodeHelp_57 +{ +High-powered blast turret, fires sonically through walls. +} + +TechNodeLabel_58 +{ +Command console +} + +TechNodeHelp_58 +{ +An auxillary command console. +} + + + +TechNodeLabel_59 +{ +Health +} + +TechNodeHelp_59 +{ +Gives marine 50 health. +} + +TechNodeLabel_60 +{ +Ammo +} + +TechNodeHelp_60 +{ +One clip for any weapon. +} + +TechNodeLabel_27 +{ +Catalyst pack +} + +TechNodeHelp_27 +{ +Wounds marine to give +25%% speed and +25%% rate of fire for 8 seconds +} + + + +TechNodeLabel_61 +{ +Mines +} + +TechNodeHelp_61 +{ +Five mines/claymores +} + +TechNodeLabel_62 +{ +Welder +} + +TechNodeHelp_62 +{ +Repairs buildings and armor, affects weldables, burns webs. +} + +TechNodeLabel_63 +{ +Med kit +} + +TechNodeLabel_64 +{ +Shotgun +} + +TechNodeHelp_64 +{ +For close encounters +} + +TechNodeLabel_65 +{ +HMG +} + +TechNodeHelp_65 +{ +High-powered assault rifle. +} + +TechNodeLabel_66 +{ +Grenade launcher +} + +TechNodeHelp_66 +{ +Grenade launcher +} + +TechNodeLabel_67 +{ +Nuke +} + +TechNodeHelp_67 +{ +Droppable baby nuke. +} + +TechNodeLabel_69 +{ +Recycle +} + +TechNodeHelp_69 +{ +Destroy this structure, get some resources back. +} + +TechNodeHelp_80 +{ +Ask your commander for orders. The commander will be notified that you are looking for something to do, and will give you an order. +} + +TechNodeHelp_81 +{ +Tell your commander that you are acknowledging his orders. Follow the instructions for your current waypoint to carry out your orders. When completed, the waypoint will go away automatically. +} + + + +TechNodeLabel_85 +{ +Build +} + +TechNodeHelp_85 +{ +Basic build menu +} + +TechNodeLabel_86 +{ +Advanced +} + +TechNodeHelp_86 +{ +Advanced build menu +} + +TechNodeLabel_87 +{ +Assist +} + +TechNodeHelp_87 +{ +Open assist menu +} + +TechNodeLabel_88 +{ +Equip +} + +TechNodeHelp_88 +{ +Open equipment menu +} + +TechNodeHelp_90 +{ +Create resource tower: Collects resources for your team. It can only be built at a resource nozzle with resources (indicated by a white "fountain"). +} + +TechNodeHelp_91 +{ +Create offensive chamber: organic turret that attacks enemy players and structures. Damage: 20 +} + +TechNodeHelp_92 +{ +Create defensive chamber: gives defensive upgrades, heals players and structures. +} + +TechNodeHelp_93 +{ +Create sensory chamber: gives sensory upgrades. and cloaks nearby players and structures. Blocks motion-tracking within range. +} + +TechNodeHelp_94 +{ +Create movement chamber: gives movement upgrades, automatically gives energy to nearby teammates. +} + +// This is used to unlock an ability in Combat mode +TechNodeLabel_95 +{ +Unlock ability +} + +TechNodeHelp_95 +{ +Create hive: Allows access to higher lifeforms and abilities (must be built at a hive location). +} + +TechNodeLabel_101 +{ +Carapace +} + +TechNodeHelp_101 +{ +Increases amount of armor. Each level of carapace absorbs roughly 16% more damage. +} + +TechNodeLabel_102 +{ +Regeneration +} + +TechNodeHelp_102 +{ +You automatically heal all damage over time. Higher levels will heal you faster. +} + +TechNodeLabel_103 +{ +Redemption +} + +TechNodeHelp_103 +{ +The hive will automatically try to save you when you're near death, pulling you back to the hive to heal. +} + +TechNodeHelp_104 +{ +Sharpness - Your melee damage is increased by half. +} + +TechNodeHelp_105 +{ +Piercing - Your ranged damage is increased by half. +} + +TechNodeHelp_106 +{ +Penetration - Shots go through walls and targets (not implemented). +} + +TechNodeLabel_107 +{ +Celerity +} + +TechNodeHelp_107 +{ +Permanently boosts max speed. +} + +TechNodeLabel_108 +{ +Adrenaline +} + +TechNodeHelp_108 +{ +Get energy back faster. Each level of adrenaline increases your base energy recovery rate by 33%. +} + +TechNodeLabel_109 +{ +Silence +} + +TechNodeHelp_109 +{ +Each level of silence makes your footsteps and movement sounds quieter. +} + +TechNodeLabel_110 +{ +Cloaking +} + +TechNodeHelp_110 +{ +Standing still for a bit makes you nearly invisible. Higher levels of cloaking make you cloak faster. Observatories and scanner sweeps will uncloak you. +} + +TechNodeLabel_111 +{ +Focus +} + +TechNodeHelp_111 +{ +Focus decreases the rate of fire and increases damage on your slot one weapon. +} + +TechNodeLabel_112 +{ +Scent of Fear +} + +TechNodeHelp_112 +{ +Your hive sight will show you when your enemies are weakened. +} + +TechNodeLabel_113 +{ +Skulk +} + +TechNodeHelp_113 +{ +Gestate to Skulk. This is a fast, small alien that is best suited for one on one combat, harassment and guerilla tactics. Can climb walls (disable with the "duck" key). +} + +TechNodeLabel_114 +{ +Gorge +} + +TechNodeHelp_114 +{ +Gestate to Gorge. Creates and grows resource towers, hives, upgrade chambers and turrets. Weak in combat, can also heal friends and friendly structures. +} + +TechNodeLabel_115 +{ +Lerk +} + +TechNodeHelp_115 +{ +Gestate to Lerk. Provides versatile combat support. Has long-range spike shooting, choking area-effect spores and protective "umbra" ability. Fly by tapping the jump key. Glide by holding the jump key while in the air. +} + +TechNodeLabel_116 +{ +Fade +} + +TechNodeHelp_116 +{ +Gestate to Fade. A powerfully built fighter, with swiping attacks, an acid rocket attack, and teleportation. +} + +TechNodeLabel_117 +{ +Onos +} + +TechNodeHelp_117 +{ +Gestate to Onos. A behemoth that can stomp to stun his enemies, charge through enemies and devour them. This alien is capable of taking on many marines at once. +} + +TechNodeLabel_118 +{ +Unlock #2 ability +} + +TechNodeLabel_126 +{ +Unlock #3 ability +} + +TechNodeLabel_31 +{ +Level 4 needed +} + +TechNodeLabel_54 +{ +Level 7 needed +} + +ClassDead +{ +Dead +} + +ClassDigesting +{ +Digesting +} + +ClassCommander +{ +Commander +} + +ClassHeavyMarine +{ +Heavy +} + +ClassReinforcing +{ +Reinforcing +} + +ClassLevel1 +{ +Skulk +} + +ClassLevel2 +{ +Gorge +} + +ClassLevel3 +{ +Lerk +} + +ClassLevel4 +{ +Fade +} + +ClassLevel5 +{ +Onos +} + +ClassGestating +{ +Gestating +} + +Building +{ +Building: +} + + +Researching +{ +Researching: +} + +Energy +{ +Energy: +} + + +Prerequisite +{ +Requires: +} + +Cost +{ +Cost: +} + +NotFullyBuilt +{ +Not fully built +} + +Recycling +{ +Recycling... +} + +ReinforcementsText +{ +Reinforcements: +} + +LogoutText +{ +LOGOUT +} + +BlipStatus_0 +{ +enemy +} + +BlipStatus_1 +{ +weak enemy +} + +BlipStatus_2 +{ + +} + +BlipStatus_3 +{ +is under attack +} + +BlipStatus_5 +{ +is Gorge +} + +BlipStatus_6 +{ + +} + +BlipStatus_7 +{ + +} + +BlipStatus_8 +{ +Location +} + +Friend +{ +Friend +} + +Enemy +{ +Enemy +} + +User3Name_1 +{ +soldier +} + +User3Name_2 +{ +commander +} + +User3Name_3 +{ +skulk +} + +User3Name_4 +{ +gorge +} + +User3Name_5 +{ +lerk +} + +User3Name_6 +{ +fade +} + +User3Name_7 +{ +onos +} + +User3Name_8 +{ +embryo +} + +User3Name_15 +{ +equipment +} + +User3Name_17 +{ +Hive +} + +User3Desc_17 +{ +Aliens spawn here, grants access to higher alien lifeforms and upgrades. +} + +User3FriendlyDesc_17 +{ +You spawn here. It will heal you when you are close by. Provides "hive sight", which communicates friends, enemies and alerts to your team. Protect your hives at all costs. +} + +User3Name_22 +{ +Resource nozzle +} + +User3Desc_22 +{ +Gives resources when a resource tower is built upon it. These resources are infinite. +} + +User3CommanderDesc_22 +{ +Gives resources when a resource tower is built upon it. These resources are infinite. +} + +User3Name_23 +{ +command console +} + +User3Desc_23 +{ +Used by the marine commander to create structures and research new technologies. +} + +User3FriendlyDesc_23 +{ +Used by the marine commander to create structures and research new technologies. Your commander is displayed at the top-middle of your screen. If your team doesn't have a commander, you can become one by "using" the command console. +} + +User3CommanderDesc_23 +{ +Select the command console to see the range in which you can build infantry portals. If the command console is destroyed, you will be ejected back to the ground, and unable to command. Protect it at all costs. +} + + +User3Name_24 +{ +turret factory +} + +User3Desc_24 +{ +Allows sentry turrets to be built within range. Turrets need the factory to continue functioning. The commander can select the turret factory to see this range. +} + +User3Name_25 +{ +armory +} + +User3Desc_25 +{ +Gives ammo and allows construction of shotguns, mines and welders within range. +} + +User3CommanderDesc_25 +{ +Gives free ammo and health to friendly soldiers. Allows construction of shotguns, mines and welders within range. Select the armory to see this range. +} + +User3FriendlyDesc_25 +{ +"Use" the armory to get free ammo for your current weapon, and to get healed. Also allows construction of shotguns and mines within range. +} + + +User3Name_26 +{ +advanced armory +} + +User3Desc_26 +{ +Gives ammo and allows construction of heavy machine guns and grenade launchers within range. +} + +User3CommanderDesc_26 +{ +Gives free ammo and health to friendly soldiers. Allows construction of heavy machine guns and grenade launchers within range. Select the advanced armory to see this range. +} + +User3FriendlyDesc_26 +{ +"Use" the advanced armory to get free ammo for your current weapon, and to get healed. Also allows construction of heavy machine guns and grenade launchers within range. +} + + +User3Name_27 +{ +arms lab +} + +User3Desc_27 +{ +Allows access to armor and ammunition upgrades. +} + +User3Name_28 +{ +prototype lab +} + +User3Desc_28 +{ +Allows access to heavy armor and jetpacks. +} + +User3Name_29 +{ +observatory +} + +User3Desc_29 +{ +Sights nearby "blips" and uncloaks all enemies within range. Gives access to Scanner Sweep, Motion Sensor upgrade and Distress Beacon. +} + +User3Name_30 +{ +chemlab +} + +User3Name_31 +{ +medlab +} + +User3Name_33 +{ +sentry turret +} + +User3Desc_33 +{ +Automatically shoots at enemies in range. +} + +User3FriendlyName_33 +{ +Automatically shoots at your enemies. Weak against upgraded and higher-lifeform aliens. Must be built within range of a turret factory. Damage: 10 +} + +User3CommanderName_33 +{ +Automatically shoots at enemies and enemy structures. Weak against upgraded and higher-lifeform aliens. Must be built within range of a turret factory, but a turret factory isn't needed to continue working. Select the turret to see its range. Won't shoot cloaked players. Good against low level aliens. Damage: 10 +} + + +User3Name_34 +{ +siege cannon +} + +User3Desc_34 +{ +Automated Siege Cannon (ASC). Sonic weapon that attacks structures, even through walls, but doesn't attack players. +} + +User3FriendlyDesc_34 +{ +Automated Siege Cannon (ASC). Sonic weapon that attacks structures, even through walls. Doesn't attack players. Range: 400 Damage: 165 (double vs. structures) +} + +User3CommanderDesc_34 +{ +Automated Siege Cannon (ASC). Sonic weapon that attacks structures, even through walls. Doesn't attack players. It can't attack targets that are too close. Select the ASC to see its minimum and maximum range (it can hit anything in the green). Range: 400 Damage: 165 (double vs. structures) +} + +User3Name_35 +{ +resource tower +} + +User3Desc_35 +{ +Collects resources for your team at regular intervals. +} + +User3Name_37 +{ +infantry portal +} + +User3FriendlyDesc_37 +{ +Spawns marines in from their home. Destroying the infantry portal means marines can't respawn from it. +} + +User3FriendlyDesc_37 +{ +Spawns marines in from home. Without an infantry portal, your team won't be able to respawn, so keep it safe. +} + +User3CommanderDesc_37 +{ +Spawns marines in from home. Without an infantry portal, the marines can't respawn. +} + +User3Name_38 +{ +nuke +} + +User3Desc_38 +{ +Nuke is arming, and must be destroyed before it finishes! Once armed, nuke detonates, doing massive damage to nearby players and structures. +} + +User3FriendlyDesc_38 +{ +Nuke is arming, protect it while it finishes. Once armed, nuke detonates, doing massive damage to nearby players and structures. +} + +User3CommanderDesc_38 +{ +Nuke is arming, protect it while it finishes. Once armed, nuke detonates, doing massive damage to nearby players and structures. +} + +User3Name_39 +{ +Heavy armor +} + +User3Desc_39 +{ +Pick up to gain heavy armor. Can't be used with jet-pack. Provides protection from spores. +} + +User3Name_40 +{ +Jet-pack +} + +User3Desc_40 +{ +Pick up jet-pack module to gain jet-packing ability. Can't be used with heavy armor. +} + +User3Name_41 +{ +Phase gate +} + +User3Desc_41 +{ +Allows light-speed travel to other phase gates. Step onto the gate to teleport to another gate. +} + +User3CommanderDesc_41 +{ +Allows light-speed travel to other phase gates. Multiple gates are needed to function properly. +} + +User3Name_42 +{ +Defense chamber +} + +User3Desc_42 +{ +Slowly heals nearby friendly players and structures. Provides one level of defensive upgrades (Carapace, Regeneration and Redemption). +} + +User3Name_43 +{ +Movement chamber +} + +User3Desc_43 +{ +Aliens can use them to teleport to the farthest hive. Provides one level of movement upgrades (Celerity, Adrenaline and Silence). Destroying these chambers will remove alien upgrades. +} + +User3FriendlyDesc_43 +{ +Walk to chamber and press your "use" button to teleport to a hive under attack. Provides one level of movement upgrades (Celerity, Adrenaline and Silence). +} + + +User3Name_44 +{ +Offense chamber +} + +User3Desc_44 +{ +Organic turret that automatically attacks enemy players and structures. Damage: 20 +} + +User3Name_45 +{ +Sensory chamber +} + +User3Desc_45 +{ +Detects enemies in range, parasites those that touch it, and provides sensory upgrades (Cloaking, Focus, Scent of Fear). +} + + +User3Name_46 +{ +Resource tower +} + +User3Desc_46 +{ +Collects resources for the enemy. +} + +User3FriendlyDesc_46 +{ +Collects resources for your team and never runs out. +} + +User3Name_47 +{ +Heavy armor module +} + +User3Desc_47 +{ +Outfits soldier with heavy armor. +} + +User3FriendlyDesc_47 +{ +Outfits soldier with heavy armor. +} + +User3Name_48 +{ +Jet-pack module +} + +User3Desc_48 +{ +Outfits soldier with jet-pack. +} + +User3FriendlyDesc_48 +{ +Outfits soldier with jet-pack. +} + +User3Name_49 +{ +Advanced turret factory +} + +User3Desc_49 +{ +Allows construction of sentry turrets and siege turrets. +} + +User3FriendlyDesc_49 +{ +Allows construction of sentry turrets and siege turrets. +} + +User3Name_57 +{ +Mine +} + +User3Desc_57 +{ +Detonates on contact +} + +User3FriendlyDesc_57 +{ +Detonates on contact +} + +Weapon1Help +{ +Gore - Get close to your enemy and attack. Damage: %d (double vs. structures) +} + +Weapon2Help +{ +Spit - Light ranged weapon to keep your enemies at bay. Damage: %d +} + +Weapon3Help +{ +Spores - Shoots a cloud of choking spores, that slowly damage enemy players in range. Damage: %d per second +} + +Weapon4Help +{ +Spikes - Long-range instant-hit weapon. Damage: %d +} + +Weapon5Help +{ +Bite - Deadly close-combat attack. Get close to your enemies and attack. Damage: %d +} + +Weapon6Help +{ +Bite - Deadly close-combat attack. Get close to your enemies and attack. Damage: %d +} + +Weapon7Help +{ +Swipe - Deadly close-combat attack. Get close to your enemies and attack. Good against players and structures. Damage: %d +} + +Weapon8Help +{ +Webs - Shoot globules near each other and a web will be created between them. Webs slow enemies and prevent them from using their weapons for a time. Webs can be destroyed with the welder. +} + +Weapon9Help +{ +Metabolize - Heals damage at the cost of energy. +} + +Weapon10Help +{ +Parasite - Infects target with a parasite, making him show up on hive sight at all times. The parasite cannot be removed. Damage: %d +} + +Weapon11Help +{ +Blink - Allows near-instant teleportation. Point in the direction to travel, and hold the button. +} + +Weapon12Help +{ +Xenocide - Explosive suicide. Shortly after activating, you blow up, doing heavy damage to everything nearby. Damage: %d +} + +Weapon13Help +{ +Knife - Weapon of efficiency and desperation. Damage: %d +} + +Weapon14Help +{ +Pistol - High-accuracy, and packs a punch, but small clip size. Damage: %d +} + +Weapon15Help +{ +Machine gun - Good accuracy, high rate of fire, medium clip. Rate of fire: 10 bullets per second. Damage: %d +} + +Weapon16Help +{ +Shotgun - For fast moving targets and for delivering lots of damage quickly to close targets. 10 pellets per shot. Damage: %d per pellet +} + +Weapon17Help +{ +Heavy machine gun (HMG) - Heavy weaponry for larger targets and enemies. While quite inaccurate, it's massive clip size and rate of fire make it indispensable. Damage: %d per bullet (half vs. structures) +} + +Weapon18Help +{ +Welder - Weld open or closed specially designated "weldable" areas of the map. It can also repair structures, soldier armor, and can cut through webs. Damage: %d +} + +Weapon19Help +{ +Mines - Use for defense, or protect your flank on an assault. Deploying on vertical surfaces extends a laser tripwire, placing on the ground turns them into land mines. Damage: %d +} + +Weapon20Help +{ +Grenade launcher - Grenades detonate after 4 seconds, or on contact, and do splash damage. Damage: %d (double vs. structures) +} + +Weapon21Help +{ +Leap - Jump forward quickly, slashing at everything in your way. Useful for movement, and also in combat. Damage: %d +} + +Weapon22Help +{ +Charge - Trample forth in a rage, hurting everything you touch. The charge drains energy and stops when you run out of energy. Damage: incredible +} + +Weapon23Help +{ +Umbra - Emits a bacterial mist that slows enemy bullets that enter it. Any friendly player or structure inside umbra rarely gets hits by bullets, but is still susceptible to explosive damage and non-bullet attacks. Lasts %d seconds. +} + +Weapon24Help +{ +Primal scream - All teammates within range during scream gain energy back faster, move faster and do more damage. Listen for their screams of defiance. +} + +Weapon25Help +{ +Bile bomb - Organic artillery only hurts structures. Damage: %d (area damage) +} + +Weapon26Help +{ +Acid rocket - Slow moving projectile that does splash damage. Damage: %d +} + +Weapon27Help +{ +Healing spray - Bacterial spray that heals friendly players and structures and hurts enemies in range. Damage: %d (area effect) +} + +Weapon28Help +{ +Hand grenade - Grenades detonate after 4 seconds and do splash damage. Damage: %d (double vs. structures) +} + +Weapon29Help +{ +Stomp - Stuns all enemy players it touches for %d seconds. +} + +Weapon30Help +{ +Devour - Eat a nearby enemy. Player is slowly digested, taking %d damage per second. Onos gets this this damage back as health. If Onos is killed before digestion completes, the enemy is freed. +} + + + +CommandStationOtherTeam +{ +This command console belongs to the other team. +} + +CommandStationInUse +{ +Your team already has a commander, the command console can't be used. +} + +WeaponPreventingCommandStation +{ +Your weapon is preventing use of the command console. +} + +CommandStationDestroyed +{ +This command console is destroyed and can no longer be used! +} + +CommandStationWaitTime +{ +You must wait longer before entering the command console again. +} + + +// Particle editing commands +NoParticleSystem +{ +That particle system couldn't be found. +} + +EditingParticleSystem +{ +Found particle system, use F7 to edit +} + + +// Marine help text + +// Armor received messages +HelpTextCSAttractMode +{ +Point at this command console and press your "use" key to activate command mode. +} + +HelpTextArmoryResupply +{ +"Use" the armory to get free ammo for your current weapon, or to receive a free health pack. +} + +HelpTextAttackNearbyStation +{ +This is the enemy's command console, attack it! +} + +HelpTextBuildTurret +{ +Point at the base of this turret and hold your "use" key to build it. +} + +HelpTextBuildTower +{ +Point at the base of this resource tower and hold your "use" key to build it. +} + +HelpTextExplainTower +{ +This active resource tower periodically gives your team resources. +} + +HelpTextAttackHive +{ +Gather your teammates and go find an alien hive to destroy! +} + +HelpTextOtherHiveBlocked +{ +The hive is blocked by a player or structure. Clear the area nearby and try again. +} + +HelpTextOtherHiveBuilding +{ +Only one hive can be built at a time. Wait until the other hive is built before starting this one. +} + +HelpTextEmptyHiveNotNearby +{ +Hives can only be built at hive locations (look for infestation and a translucent hive indicator). +} + +HelpTextAttackNearbyHive +{ +There is an enemy hive nearby, go kill it to stop the alien menace! +} + +HelpTextFriendlyMovementChamber +{ +Press your "use" key on this movement chamber to teleport to a hive under attack. It also gives you energy when nearby. +} + +HelpTextAttackMovementChamber +{ +This is an enemy movement chamber, it allows them to teleport to their hive and gives them energy. +} + +HelpTextFriendlyOffensiveChamber +{ +This is an offense chamber, it will shoot at your enemies. +} + +HelpTextAttackOffensiveChamber +{ +This is an enemy offense chamber, watch out! +} + +HelpTextFriendlyDefensiveChamber +{ +This defensive chamber will regenerate players and structures nearby. It makes a sloshing sound when it heals. +} + +HelpTextAttackDefensiveChamber +{ +This is an enemy defensive chamber, it heals enemy players and structures. +} + +HelpTextFriendlySensoryChamber +{ +This is a sensory chamber, it cloaks nearby players and structures. +} + +HelpTextAttackSensoryChamber +{ +This is an enemy sensory chamber. +} + +HelpTextOpenWeldable +{ +This area can be opened with a welder. +} + +HelpTextCloseWeldable +{ +This area can be welded shut with a welder. +} + +HelpTextPhaseGate +{ +Enter the phase gate to teleport. +} + +HelpTextAlienPopupMenu +{ +Use your "pop-up menu" to build structures, evolve upgrades, and switch teams (right mouse button). +} + +HelpTextMarinePopupMenu +{ +Use your "pop-up menu" to access voice commands, ask for orders, leave the team, and more (right mouse button). +} + +HelpTextOrder +{ +You have been given an order by the commander. The blue circle on your screen describes the location and type of your order. Use your pop-up menu to ask for orders or acknowledge them. +} + +HelpTextCommanderUseable +{ +As commander, you can "use" any buttons or switches by left-clicking them. +} + +HelpTextMarineCommandMenu +{ +Press your "pop-up menu" key to communicate with your team (default is right mouse button). +} + +HelpTextResourceDropoff +{ +You earned resource points for your team! +} + +HelpTextJetpacks +{ +Your commander has researched jet-packs for your team. Hold your jump key to use. +} + +HelpTextAlienCommandMenu +{ +Press your "pop-up menu" key to change lifeforms and evolve upgrades (default is right mouse button). +} + +HelpTextAttackTower +{ +This resource tower earns resources for the enemy...destroy it! +} + +HelpTextAlienWeapons +{ +Use the mousewheel or the number keys to switch abilities. A red icon means that ability is disabled until you get more hives. +} + +HelpTextAlienResources +{ +The blue bar on the left is your resources. You get resources from your team's resource towers. Resources can be spent using the pop-up menu. +} + +HelpTextAlienEnergy +{ +The yellow bar on the right is your energy. Abilities cost energy to use. +} + +HelpTextAlienPendingUpgrades +{ +The small blinking icon(s) on the right side of your screen means you can now evolve new traits! Open the pop-up menu and make a choice of one of the upgrades. +} + +HelpTextAlienBuildStructure +{ +As a builder alien, you can create structures for your team using your pop-up menu. +} + +HelpTextAlienBuildStructure +{ +There is an unbuilt alien structure nearby. Alien structures build slowly on their own, but as a builder, you can speed it up. Point at the base of the structure and hold your "use" key. +} + +HelpTextAlienHiveSight +{ +The animated icons on your screen indicate your team's "hive sight". Green icons are your team's gorges, yellow-reddish icons show hive locations and red icons show structures or friends under attack. +} + +HelpTextAlienVisionMode +{ +The locations of all aliens and their structures are always known to the hive mind. It can show you all lifeforms on your team when you press your "flashlight" key. +} + +HelpTextAlienCommunication +{ +You can communicate with your team via hive sight by using your pop-up menu. If you see enemies coming towards one of your hives, open your pop-up menu, move down, right, up, then release. Your teammates will see "incoming" on hive sight. +} + +HelpTextAlienUnderAttack +{ +One of your teammates or structures is under attack. Spin your view around and look for the hive sight alert. +} + +HelpTextBuilder +{ +You are now a Gorge. Stay out of combat and use your pop-up menu to build different structures. +} + +HelpTextWeb +{ +Fire web strands at walls and floors to create webs between them. Enemies that touch webs are slowed and can't use their weapons temporarily. +} + +HelpTextWallwalking +{ +You can hold your duck key to walk up walls and ceilings. +} + +HelpTextBite +{ +Get close to your enemies and press your attack key to bite them. +} + +HelpTextFlight +{ +Try tapping your jump key to fly. You can also hold your jump key while in the air to glide. +} + +HelpTextSpores +{ +Press your attack button to launch a spore cloud that hurts players inside it. +} + +HelpTextAlienResource +{ +Find a resource node and build one of these on top of it to capture resources for your team. +} + +HelpTextPopupMenu +{ +Hold your right mouse button (secondary attack) to show the pop-up menu. +} + +HelpTextBuyUpgrade +{ +Aliens can evolve new traits by displaying the pop-up menu. Try it: hold your pop-up menu button (right mouse button by default), and move the mouse right. +} + +HelpTextBuyLifeform +{ +Aliens can morph into new lifeforms. Try it: hold your pop-up menu button (right mouse button by default), move your mouse down, then right, then release. +} + +HelpTextCommanderGiveOrders +{ +Right-click on the ground or a structure to give an order. +} + +HelpTextCommanderSelectPlayers +{ +Left-click on players or drag a box around them to select them. +} + +HelpTextCommanderLogout +{ +You can leave commander mode by clicking the red "logout" button in the upper-right corner of your screen. +} + +// This message isn't in yet +HelpTextCommanderBuild +{ +This structure has not been fully built. Select a player then right-click this structure to give him an order to build it. +} + +HelpTextCommanderUse +{ +Doors, lifts and other moving structures can be "hacked" by the commander. Left-click to hack this structure. +} + +HelpTextCommanderAttack +{ +This target can be attacked! Right-click to give an attack order. +} + +HelpTextCommanderWeld +{ +This target can be welded. Buy a welder for a teammate, then right-click here to give a welding order. +} + +HelpTextCommanderGet +{ +Right-click here to give an order to pick this up. +} + +HelpTextCommanderUnderAttack +{ +You are under attack! Press your "jump" key to go to the alert. +} + +HelpTextCommanderResearchComplete +{ +Your research is complete. Press your "jump" key to go to the site of the research. +} + +HelpTextCommanderUpgradeComplete +{ +Your upgrade is complete. Press your "jump" key to go to the upgraded structure. +} + +JetpackEnergyHUDText +{ +Jet-pack energy +} + +HelpTextDisableHelp +{ +You can turn off this help text by unchecking the "show hints" checkbox your multiplayer customization menu (cl_autohelp 0). +} + +Paralyzed +{ +Paralyzed +} + +Stunned +{ +Stunned +} + +Digested +{ +Being digested... +} + +DigestingPlayer +{ +Digesting %s... +} + +Parasited +{ +Parasited +} + +PrimalScreamed +{ +Primal scream +} + +Catalysted +{ +Catalyst +} + +Umbraed +{ +In umbra +} + +Webbed +{ +Webbed +} + +// Order descriptions +Order2 +{ +Move to waypoint +} + +Order3 +{ +Attack target +} + +Order4 +{ +Build %s +} + +Order5 +{ +Guard %s +} + +Order6 +{ +Use welder at waypoint +} + +Order7 +{ +Get %s +} + +Order9 +{ +Hold your position +} + +Range +{ +%d meters +} + +// Timelimit for tourny mode +GameTime +{ +Game time +} + +Elapsed +{ +elapsed +} + +TimeLimit +{ +Time limit +} + +Remaining +{ +left +} + +// HLTV +Spec_duck +{ +Press DUCK for Spectator Menu +} + +SPECT_OPTIONS +{ +Options +} + +CAM_OPTIONS +{ +Camera Options +} + +SpecMode5Text +{ +} + +OBS_MAP_FREE +{ +Map free camera +} + +OBS_MAP_CHASE +{ +Map chase camera +} + +OBS_CHASE_FREE +{ +Free chase camera +} + +OBS_CHASE_LOCKED +{ +Locked chase camera +} + +OBS_IN_EYE +{ +In-eye camera +} + +OBS_ROAMING +{ +Free look camera +} + +// Official map locations +testlocation1 +{ +The translated refinery +} + +///////////// +// ns_bast // +///////////// +bastlocation_dockingbay +{ +Marine Start - Docking Bay 1 +} + +bastlocation_mainjunction +{ +Main Aft Junction +} + +bastlocation_cargolock +{ +Heavy Lock Door +} + +bastlocation_atmosphericprocessing +{ +Atmospheric Processing +} + +bastlocation_furnace +{ +Steam Generation +} + +bastlocation_watertreatment +{ +Water Treatment +} + +// NOTE: The hyphen in hive location names is important. Everything before the hyphen is trimmed off when displaying +// location names for aliens (the hive icons in the upper right of their HUD). Make sure to follow the convention: +// Hive Location - name +bastlocation_feedwatercontrol +{ +Hive Location - Feedwater Control +} + +bastlocation_trammaintenance +{ +Tram Maintenance +} + +bastlocation_tramtunnel +{ +Tram Tunnel +} + +bastlocation_lowerjunction +{ +Lower Junction +} + +bastlocation_Refinery +{ +Hive Location - Refinery +} + +bastlocation_emshaft +{ +EM Drill Shaft +} + +bastlocation_engineroom +{ +Hive Location - Engine Room +} + +bastlocation_dockinghydraulics +{ +Docking Hydraulics +} + +bastlocation_maintenancejunction +{ +Maintenance Junction +} + +bastlocation_ncorridor +{ +"N" Corridor +} + +bastlocation_observationbridge +{ +Observation Bridge +} + +bastlocation_starboardairlock +{ +Starboard Airlock +} + +bastlocation_portairlock +{ +Port Airlock +} + +bastlocation_maintenanceaccess +{ +Maintenance Access Duct +} + +bastlocation_pressureequalization +{ +Pressure Equalization Conduit +} + +bastlocation_starboardcorridor +{ +Aft Starboard Corridor +} + +bastlocation_filtration +{ +Feedwater Filtration Access +} + +bastlocation_ventilation +{ +Ventilation Conduit +} + +bastlocation_databank +{ +Databank Access +} + +bastlocation_enginecorridor +{ +Engine Corridor +} + +///////////// +// ns_hera // +///////////// +heralocation_archive +{ +Hive Location - Archiving +} + +heralocation_processingcorea +{ +Data Core Alpha +} + +heralocation_reception +{ +Hera Entrance and Reception +} + +heralocation_holoroom +{ +Central Monitoring - 'Holoroom' +} + +heralocation_storage +{ +General Cargo Storage +} + +heralocation_hanger +{ +Marine Start - Loading bay +} + +heralocation_docking +{ +Marine Start - Landing Pad +} + +heralocation_processing +{ +Processing +} + +heralocation_processingcoreb +{ +Hive Location - Data Core Delta +} + +heralocation_ventilation +{ +Hive Location - Ventilation 3-C +} + +heralocation_maintenence +{ +Maintenance +} + +heralocation_fogcorridor +{ +Maintenance Corridor +} + +heralocation_tube +{ +Hera Entrance Walkway +} + +// Nothing titles +nothinglocation_rr +{ +Space Station Nothing - Sub Sector 77 +} + +nothinglocation_ms +{ +Marine Start - S77 Vestibule +} + +nothinglocation_dock +{ +Docking Wing 01 +} + +nothinglocation_thres1 +{ +The Threshold +} + +nothinglocation_thres2 +{ +The Threshold +} + +nothinglocation_junc1 +{ +The Junction +} + +nothinglocation_junc2 +{ +The Junction +} + +nothinglocation_vent +{ +Ventilation Chamber +} + +nothinglocation_comm +{ +Communications Hub 063 +} + +nothinglocation_things +{ +Room With Things +} + +nothinglocation_cargo +{ +Hive Location - Cargo Bay Foyer +} + +nothinglocation_pipe +{ +Pipe Room +} + +nothinglocation_paint1 +{ +Painted Corridor +} + +nothinglocation_paint2 +{ +Painted Corridor +} + +nothinglocation_paint3 +{ +Painted Corridor +} + +nothinglocation_quada +{ +Quad Lift Area +} + +nothinglocation_quad +{ +Quad Lift +} + +nothinglocation_chamb +{ +Foreboding Antechamber +} + +nothinglocation_sas1 +{ +Silo Access South +} + +nothinglocation_sas2 +{ +Silo Access South +} + +nothinglocation_silo +{ +Hive Location - PowerSilo +} + +nothinglocation_san1 +{ +Silo Access North +} + +nothinglocation_san2 +{ +Silo Access North +} + +nothinglocation_mias1 +{ +Miasma Walkway +} + +nothinglocation_mias2 +{ +Miasma Walkway +} + +nothinglocation_mias3 +{ +Miasma Walkway +} + +nothinglocation_gen +{ +Generator Room +} + +nothinglocation_elev1 +{ +Elevator Shaft 01 +} + +nothinglocation_elev2 +{ +Elevator Shaft 02 +} + +nothinglocation_eek +{ +Intimidation +} + +nothinglocation_kismet +{ +Ominous Kismet +} + +nothinglocation_vae +{ +Viaduct Access East +} + +nothinglocation_vaw +{ +Viaduct Access West +} + +nothinglocation_viaduct +{ +Hive Location - The Great Viaduct +} + +// TANITH info_location data START +tanith_westenter +{ +Western Entrance +} + +tanith_marinebase +{ +Marine Start - Uplink Command +} + +tanith_outsidebase +{ +Exterior Access Paths +} + +tanith_north +{ +Northern Corridor +} + +tanith_sat +{ +External Satellite Relay +} + +tanith_satcomm +{ +Hive Location - Satellite Communications +} + +tanith_transport +{ +Chemical Transport Room +} + +tanith_cpu +{ +Computer Control +} + +tanith_acid +{ +Acidic Solution Processing +} + +tanith_reactor +{ +Reactor Room +} + +tanith_enter +{ +Eastern Entrance +} + +tanith_centerenter +{ +Central Entrance +} + +tanith_east +{ +East Access Tunnels +} + +tanith_research +{ +Research Labs +} + +tanith_rr +{ +Tanith Ready Room +} +tanith_waste +{ +Hive Location - Waste Handling +} + +tanith_central +{ +Central Access Tunnels +} + +tanith_storageenter +{ +Storage Entrance +} + +tanith_cargo +{ +Cargo Storage +} + +tanith_fusion +{ +Hive Location - Fusion Reactor +} + +tanith_west +{ +West Access Corridor +} +// TANITH info_location data END + + +// NANCY info_location data START +nancy_cargo +{ +Cargo Hold 2 +} + +nancy_aux +{ +Auxillary Command +} + +nancy_engine +{ +Port Engine Room +} + +nancy_crawl +{ +Sub-tunnel +} + +nancy_maint +{ +Maintenance Shaft +} + +nancy_shaft +{ +Maintenance Shaft +} + +nancy_mother +{ +Noname +} + +nancy_lockers +{ +Crew Lockers +} + +nancy_mess +{ +Mess Hall +} + +nancy_airlock +{ +Airlock Exchange +} + +nancy_port +{ +Port Airlock +} + +nancy_bridge +{ +Bridge +} + +nancy_cockpit +{ +Cockpit +} + +nancy_star +{ +Starboard Airlock +} + +nancy_gen +{ +Auxiliary Generators +} + +nancy_motherinter +{ +Mother Interface +} + +nancy_subspace +{ +Subspace Array Interface +} + +nancy_crew +{ +Crew Quarters +} +// NANCY info_location data END + +// CAGED info_location data START +caged_marine +{ +Marine Spawn - Main Hold +} + +caged_upsewer +{ +Upper Sewer +} + +caged_dsewer +{ +Lower Sewer +} + +caged_hive1 +{ +Hive Location - Sewer +} + +caged_hive2 +{ +Hive Location - Ventilation System +} + +caged_hive3 +{ +Hive Location - Generator +} + +caged_pure +{ +Purification Station 01 +} + +caged_central +{ +Central Processing +} + +caged_vaccess +{ +Ventilation Access +} + +caged_work +{ +Stability Monitoring +} + +caged_auxgen +{ +Auxiliary Generator +} + +caged_service +{ +Shipping Tunnels +} + +caged_area2 +{ +Upper Shipping Access +} +// CAGED info_location data END + +// Eclipse info_location... info. (BEGIN) +eclipse_dock +{ +Docking Control +} + +eclipse_marinespawn +{ +Marine Spawn - Cargo Transfer +} + +eclipse_station +{ +Station Access +} + +eclipse_stationeast +{ +Station Access East +} + +eclipse_stationalpha +{ +Station Access Alpha +} + +eclipse_stationwest +{ +Station Access West +} + +eclipse_triad +{ +Triad Generator Array +} + +eclipse_triadb +{ +Triad Access B +} + +eclipse_access1c +{ +Access Corridor 1C +} + +eclipse_access1b +{ +Access Corridor 1B +} + +eclipse_access1a +{ +Primary Access Corridor 1A +} + +eclipse_horseshoe +{ +The Horseshoe +} + +eclipse_tjunct +{ +T-Junction +} + +eclipse_keyhole +{ +The Keyhole +} + +eclipse_maint +{ +Hive - Maintenance Access +} + +eclipse_south +{ +South Loop +} + +eclipse_core +{ +Hive - Computer Core +} + +eclipse_northcore +{ +North Core Access +} + +eclipse_westcore +{ +West Core Access +} + +eclipse_subjunct +{ +Power Sub-Junction 3 +} + +eclipse_access1d +{ +Access Corridor 1D +} + +eclipse_commandnorth +{ +Command Access North +} + +eclipse_command +{ +Hive - Eclipse Command +} + +eclipse_genmon +{ +Primary Generator Monitors +} + +eclipse_commandsouth +{ +Command Access South +} + +eclipse_access1a +{ +Access Corridor 1A +} +// Eclipse info_location... info. (END) + + +// Veil info_location (START) + +veil_marine +{ +Marine Spawn - Mobile Command Interface +} + +veil_lifteast +{ +Lift 5 East +} + +veil_swhive +{ +Hive - Sub-Sector 5B Access +} + +veil_south +{ +Hive - Cargo Transfer South +} + +veil_southeast +{ +Hive - The Pipeline +} + +veil_overlook +{ +The Overlook +} + +veil_topography +{ +Topographical Analysis +} + +veil_nano +{ +NanoGrid Status +} + +veil_dome +{ +The Dome +} + +veil_y +{ +Y Junction +} + +veil_skylight +{ +West Skylights +} + +veil_satellite +{ +Satellite Feed +} + +veil_pod1 +{ +Monitoring Pod 1 +} + +veil_pod2 +{ +Monitoring Pod 2 +} + +veil_waypointing +{ +System Waypointing +} + +veil_nanoeast +{ +NanoGrid Access East +} + +veil_nanowest +{ +NanoGrid Access West +} + +veil_c12 +{ +Emergency Nozzle C-12 +} + +veil_junctionwest +{ +West Junction +} + +veil_junctioneast +{ +East Junction +} + +veil_power +{ +Power Core Status +} + +// Veil info_location (END) diff --git a/main/events/Ability.sc b/main/events/Ability.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/AcidRocket.sc b/main/events/AcidRocket.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/AlienSightOff.sc b/main/events/AlienSightOff.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/AlienSightOn.sc b/main/events/AlienSightOn.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/BileBomb.sc b/main/events/BileBomb.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Bite.sc b/main/events/Bite.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Bite2.sc b/main/events/Bite2.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/BlinkGun.sc b/main/events/BlinkGun.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/BlinkSuccess.sc b/main/events/BlinkSuccess.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Build.sc b/main/events/Build.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Charge.sc b/main/events/Charge.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Claws.sc b/main/events/Claws.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/CommandPoints.sc b/main/events/CommandPoints.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Devour.sc b/main/events/Devour.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/DistressBeacon.sc b/main/events/DistressBeacon.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/DivineWind.sc b/main/events/DivineWind.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Empty.sc b/main/events/Empty.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/EndCloak.sc b/main/events/EndCloak.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Grenade.sc b/main/events/Grenade.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/GrenadeGun.sc b/main/events/GrenadeGun.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/HealingSpray.sc b/main/events/HealingSpray.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/HeavyMachineGun.sc b/main/events/HeavyMachineGun.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/HiveHit.sc b/main/events/HiveHit.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/InvalidAction.sc b/main/events/InvalidAction.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Jetpack.sc b/main/events/Jetpack.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Knife.sc b/main/events/Knife.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Leap.sc b/main/events/Leap.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/LevelUp.sc b/main/events/LevelUp.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/MachineGun.sc b/main/events/MachineGun.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Metabolize.sc b/main/events/Metabolize.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/MetabolizeSuccess.sc b/main/events/MetabolizeSuccess.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/NumericalInfo.sc b/main/events/NumericalInfo.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/OffenseChamber.sc b/main/events/OffenseChamber.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/ParasiteGun.sc b/main/events/ParasiteGun.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Particle.sc b/main/events/Particle.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/PhaseIn.sc b/main/events/PhaseIn.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Pistol.sc b/main/events/Pistol.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/PrimalScream.sc b/main/events/PrimalScream.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Regeneration.sc b/main/events/Regeneration.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/ShootSpores.sc b/main/events/ShootSpores.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/SiegeHit.sc b/main/events/SiegeHit.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/SiegeViewHit.sc b/main/events/SiegeViewHit.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/SonicGun.sc b/main/events/SonicGun.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/SpikeGun.sc b/main/events/SpikeGun.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/SpinWeb.sc b/main/events/SpinWeb.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/SpitGun.sc b/main/events/SpitGun.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/SporeCloud.sc b/main/events/SporeCloud.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/StartCloak.sc b/main/events/StartCloak.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Stomp.sc b/main/events/Stomp.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/StopScream.sc b/main/events/StopScream.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Swipe.sc b/main/events/Swipe.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Teleport.sc b/main/events/Teleport.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/UmbraCloud.sc b/main/events/UmbraCloud.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/UmbraGun.sc b/main/events/UmbraGun.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/WeaponAnimation.sc b/main/events/WeaponAnimation.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/Welder.sc b/main/events/Welder.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/WelderConst.sc b/main/events/WelderConst.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/WelderEnd.sc b/main/events/WelderEnd.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/events/WelderStart.sc b/main/events/WelderStart.sc new file mode 100644 index 00000000..e69de29b diff --git a/main/fmod.dll b/main/fmod.dll new file mode 100644 index 00000000..043b7406 Binary files /dev/null and b/main/fmod.dll differ diff --git a/main/french_titles.txt b/main/french_titles.txt new file mode 100644 index 00000000..765439ec --- /dev/null +++ b/main/french_titles.txt @@ -0,0 +1,4327 @@ +//TITLES FOR NATURAL SELECTION +// +//French translation by Emmanual 'Darwin' Marseille +// +//DO NOT ALTER THIS FILE +// Position command $position x y +// x & y are from 0 to 1 to be screen resolution independent +// -1 means center in each dimension +// Effect command $effect +// effect 0 is fade in/fade out +// effect 1 is flickery credits +// effect 2 is write out (training room) +// Text color r g b command $color +// fadein time fadeout time / hold time +// $fadein (message fade in time - per character in effect 2) +// $fadeout (message fade out time) +// $holdtime (stay on the screen for this long) + +//////////////////// +// Green teletype // +//////////////////// +$position 0.15 0.15 +$effect 2 +$color 0 200 0 +$color2 0 255 0 +$fadein 0.04 +$fxtime 0.25 +$holdtime 6.0 +$fadeout 0.5 + +Team_AutoAssign +{ +Assignation automatique +} + +Menu_Spectate +{ +Spectateur +} + +UndefinedTeam +{ +Ready Room +} + +Menu_LeaveGame +{ +Quitter le jeu +} + +Menu_ReadyRoom +{ +Ready room +} + +Menu_Marine1Team +{ +Joindre les marines +} + +Menu_Alien1Team +{ +Joindre les aliens +} + +Marine1Team +{ +Frontiersmen +} + +Alien1Team +{ +Kharaa +} + +Marine2Team +{ +Frontiersmen +} + +Alien2Team +{ +Kharaa +} + +AutoTeam +{ +Assignation automatique +} + +Muted +{ +Muet. +} + +Unmuted +{ +Non muet. +} + +No_longer_hear_that_player +{ +Vous n'entendrez plus ce joueur. +} + +// SDK 2.0 Spectator Menu +Spec_Map +{ +Carte +} + +Spec_Mode1 +{ +Camera de poursuite fixe. +} + +Spec_Mode2 +{ +Camera de poursuite libre. +} + +Spec_Mode3 +{ +Camera libre. +} + +Spec_Mode4 +{ +Vue premiere personne. +} + +Spec_Mode5 +{ +Apercu libre. +} + +Spec_Mode6 +{ +Apercu poursuite. +} + +Spec_NoTarget +{ +Pas de joueur disponible. Impossible de passer en camera de poursuite. +} + +Spec_Help +{ +Appuyez sur F4 pour retourner dans la "ready room". Utilisez les touches GAUCHE, DROITE, SAUT et TIRER pour changer de vue. +} + +Spec_Help_Text +{ +Utilisez les touches suivantes pour changer de style de vue : + + TIRER ou DROITE - Poursuivre le joueur suivant + MENU POPUP ou GAUCHE - Poursuivre le joueur precedent + SAUT - Changer de mode de vue + UTILISER - Changer le mode de la fenetre incruste + + S'ACCROUPIR - Ouvrir le menu spectateur + +En mode vue d'ensemble de la carte, deplacez-vous avec : + + DEPLACEMENT GAUCHE - Bouger a gauche + DEPLACEMENT DROITE - Bouger a droite + AVANT - Zoom avant + ARRIERE - Zoom arriere + SOURIS - Tourner autour de la carte ou du joueur +} + +Spec_Slow_Motion +{ +Ralenti +} + +Spec_Replay +{ +Reprise +} + +Spec_Help2 +{ +Vos messages et votre voix ne peuvent etre vus et entendus que par les autres spectateurs. +} + +Spec_Only_Help +{ +} + +Directed +{ +Directed +} + +SpectatorsNotAllowed +{ +Ce serveur n'autorise pas de spectateurs pour le moment. +} + +ObsInEyePrefix +{ +Mode premiere personne depuis +} + +SpectatorTeam +{ +Spectateurs +} + +Spectators +{ +Spectateurs +} + +TEAM +{ +Equipe +} + +TEAMS +{ +Equipes +} + +PLAYER +{ +Joueur +} + +Player_plural +{ +Joueurs +} + +PLAYERS +{ +Joueurs +} + +SCORES +{ +Informations sur le joueur +} + +SCORE +{ +Score +} + +DEATHS +{ +Morts +} + +LATENCY +{ +Latence +} + +VOICE +{ +Voix +} + +Unassigned +{ +Non-assigne +} + +Menu_OK +{ +OK +} + +Points +{ +points +} + +Cost +{ +Cout +} + +NoSpectating +{ +Les spectateurs ne sont pas autorises sur ce serveur. +} + +// Main game messages +ReadyRoomMessage +{ +Vous etes dans la "ready room". Passez par une des entrees pour rejoindre une equipe ou pour observer la partie en cours. +} + +ReinforcementMessage +{ +Vous attendez votre tour pour arriver en renfort. +} + +ReinforcingMessage +{ +Vous allez arriver en renfort, preparez-vous... +} + +ObserverMessage +{ +Vous etes un spectateur. Vous ne pouvez plus rejoindre la partie en cours, mais vous le pourrez a la prochaine. +} + +CantSwitchTeamsInTournyMode +{ +Vous ne pouvez pas changer d'equipe durant le mode tournoi. +} + +CantSwitchTeamsAfterGameStart +{ +Vous ne pouvez pas changer d'equipe une fois que la partie a commence. +} + +TooManyPlayersOnTeam +{ +Il y a deja trop de joueurs dans cette equipe. +} + +CantJoinAfterSpectating +{ +Vous ne pouvez pas rejoindre la partie en cours une fois que vous avez ete spectateur. +} + +CanOnlyJoinTeamYouveReinforced +{ +Vous avez deja vu l'autre equipe, vous ne pouvez pas rejoindre celle-ci avant la prochaine partie. +} + +YouCanJoinSoon +{ +Vous allez bientot rejoindre cette equipe. +} + +AlreadyOnTeam +{ +Vous etes deja dans une equipe. Retournez d'abord dans la "ready room" pour changer d'equipe. +} + +SoldierMessage +{ +Vous etes maintenant un soldat. Essayez de suivre les ordres de votre "commander", et faites de votre mieux pour empecher l'ennemi de tuer vos coequipiers et de detruire vos structures. +} + +ObjectivesVsAliens +{ +Vous affrontez les aliens ! Vous devez detruire leurs "hives" via lesquels les renforts arrivent et ensuite tous les tuer. +} + +ObjectivesVsMarines +{ +Vous affrontez les marines ! Vous devez detruire leurs "infantry portals" via lesquels les renforts arrivent et ensuite tous les tuer. +} + +Handicap +{ +Handicap +} + +CommanderMessage +{ +Selectionnez un ou plusieurs joueurs en cliquant dessus ou en faisant une zone de selection avec votre souris, cliquez ensuite sur le bouton droit a un endroit, une structure ou un joueur pour leur donner un ordre. Le menu en bas a droite vous permet de construire des structures et d'equiper vos soldats. +} + +Commander +{ +Comm +} + +NoCommander +{ +Pas de "commander". +} + +GestationMessage +{ +Vous etes maintenant en train d'evoluer en une nouvelle forme d'alien. Preparez-vous a eclore... +} + +CocoonMessage +{ +Vous avez ete mis dans un cocon ! +} + +YouAreReinforcements +{ +Vous avez ete appelle en renfort ! +} + +////////////// +// Pie menu // +////////////// +MenuMarineRoot +{ +Depart +} + +//MenuMarineRoot +//{ +//!marinenode +//} + + +MenuComms +{ +Communication +} + +MenuTalk +{ +Parler +} + +MenuAttacked +{ +"Je suis attaque !" +} + +MenuCheer +{ +Acclamations +} + +MenuCoverMe +{ +"Couvrez-moi !" +} + +MenuRetreat +{ +"Retraite !" +} + +MenuInPosition +{ +"En position" +} + +MenuEnemySpotted +{ +"Ennemi ici" +} + +MenuMoveOut +{ +"On degage" +} + +MenuAllClear +{ +"Zone securisee" +} + +MenuYell +{ +Crier +} + +MenuSay +{ +Dire +} + +MenuRogerThat +{ +"Bien compris" +} + +MenuHello +{ +"Salut" +} + +MenuNeedHelp +{ +"Besoin d'aide" +} + +MenuNeedHealth +{ +"Besoin de soins" +} + +MenuNeedAmmo +{ +"Besoin de munitions" +} + +MenuFollowMe +{ +"Suivez-moi" +} + +MenuCovering +{ +"Je couvre" +} + +MenuOrders +{ +Ordres +} + +MenuNeedOrder +{ +"Besoin d'ordre" +} + +MenuAck +{ +"Bien compris" +} + +MenuAdmin +{ +Admin +} + +MenuReadyRoom +{ +"Ready room" +} + +MenuVoteCommanderDown +{ +Ejecter le comm. +} + +MenuArea +{ +Zone +} + +MenuMoveTo +{ +Aller a +} + +MenuGuard +{ +Garder +} + +MenuTarget +{ +Cibler +} + +MenuDeploy +{ +Deployer +} + +MenuIncoming +{ +En approche +} + +MenuProceed +{ +Continuer +} + +MenuFireTarget +{ +Tirer sur la cible +} + +MenuTaunt +{ +Raillerie +} + +MenuTakeCover +{ +Se mettre a couvert +} + +MenuReady +{ +Pret +} + +MenuDefendObj +{ +Defendre +} + +MenuCeaseFire +{ +Cesser le feu +} + +MenuTeam +{ +Equipe +} + +MenuBuilding +{ +Construire +} + +MenuAttackObj +{ +Attaquer +} + +MenuTaunt +{ +Raillerie +} + +MenuHealth +{ +"Soins" +} + +MenuCameraTower +{ +Camera +} + +MenuTurret +{ +Tourelle +} + +MenuSiegeTurret +{ +Siege +} + +MenuBlazeOfGlory +{ +Blaze +} + +MenuProtect +{ +Proteger +} + +MenuReinforce +{ +Renfort +} + +MenuArmorUpgrade +{ +Heavy +} + +MenuRepair +{ +Reparer +} + +MenuPowerups +{ +Stim +} + +MenuAdrenaline +{ +Adrenaline +} + +MenuDefMatrix +{ +Def matrix +} + +MenuPhaseGate +{ +Phase gate +} + +MenuSelf +{ +Moi +} + +MenuBuy +{ +Acheter +} + +MenuHeavy +{ +Heavy +} + +MenuShotgun +{ +Shotgun +} + +MenuHeavyMG +{ +Heavy MG +} + +MenuLauncher +{ +Launcher +} + +MenuFlamer +{ +Flamer +} + +MenuNuke +{ +Nuke +} + +MenuWeapon +{ +Arme +} + +MenuEquipment +{ +Equipement +} + +MenuUse +{ +Utiliser +} + +MenuNextWeapon +{ +Arme suivante +} + +MenuJetpacks +{ +Jetpacks +} + +MenuReloadWeapon +{ +Recharger +} + +MenuDropWeapon +{ +Jeter +} + +MenuLight +{ +Torche +} + +MenuAmmo +{ +Munitions +} + +MenuMines +{ +Mines +} + +MenuGrenades +{ +Grenades +} + +MenuUpgradeMG +{ +Amelioration +} + +//////////////////// +// Armor upgrades // +//////////////////// + +MenuArmorFull +{ +Armor full +} + +MenuBuyArmorHeavy +{ +Heavy armor +} + +MenuBuyArmorMotionTrack +{ +Tracker +} + +MenuBuyArmorJetpack +{ +Jetpacks +} + +MenuBuyArmorLifeSupport +{ +Sustain +} + +// Rank +MenuRank +{ +Rank +} + +MenuPromote +{ +Promote +} + +MenuDemote +{ +Demote +} + +////////////////////////////////////////////////// +// Don't localize these, they are sprite names: // +// (sprites/640(or 320)name.spr) // +////////////////////////////////////////////////// +MenuAlienRoot +{ +Depart +} + +MenuAlienSmallMorph +{ +Creatures +} + +MenuAlienMorphLevel1 +{ +Skulk +} + +MenuAlienMorphLevel2 +{ +Gorge +} + +MenuAlienBigMorph +{ +Avancees +} + +MenuAlienMorphLevel3 +{ +Lerk +} + +MenuAlienMorphLevel4 +{ +Fade +} + +MenuAlienMorphLevel5 +{ +Onos +} + +MenuAlienUpgrade +{ +Ameliorations +} + +MenuAlienComm +{ +Autres +} + +MenuAlienBuild +{ +Constructions +} + +MenuAlienAdvBuild +{ +Avancees +} + +MenuAlienBuildUpgrades +{ +Ameliorations +} + + +MenuAlienCommSayingsWest +{ +Cris +} + +MenuAlienCommSayingOne +{ +Ricanement +} + +MenuAlienCommSayingTwo +{ +Besoin de soins +} + +MenuAlienCommSayingThree +{ +Besoin d'aide +} + +MenuAlienCommSayingsEast +{ +Dire +} + +MenuAlienCommSayingFour +{ +Ils arrivent +} + +MenuAlienCommSayingFive +{ +A l'attaque +} + +MenuAlienCommSayingSix +{ +Je construis ici +} + +// Temp artwork, change +MenuAlienReadyRoom +{ +"Ready room" +} + +MenuAlienUpgradeDefOne +{ +"Carapace" +} + +MenuAlienUpgradeDefTwo +{ +"Regeneration" +} + +MenuAlienUpgradeDefThree +{ +"Redemption" +} + +MenuAlienUpgradeSenOne +{ +"Cloaking" +} + +MenuAlienUpgradeSenTwo +{ +"Pheromones" +} + +MenuAlienUpgradeSenThree +{ +"Scent of Fear" +} + +MenuAlienUpgradeMoveOne +{ +"Celerity" +} + +MenuAlienUpgradeMoveTwo +{ +"Adrenaline" +} + +MenuAlienUpgradeMoveThree +{ +"Silence" +} + +MenuAlienDefenseChamber +{ +"Defense chamber" +} + +MenuAlienSensoryChamber +{ +"Sensory chamber" +} + +MenuAlienMovementChamber +{ +"Movement chamber" +} + +MenuAlienDefenseUpgrades +{ +Defensives +} + +MenuAlienSensoryUpgrades +{ +Sensorielles +} + +MenuAlienMovementUpgrades +{ +De mouvement +} + +MenuAlienOffensiveChamber +{ +"Offense chamber" +} + +MenuAlienResourceTower +{ +"Resource tower" +} + +MenuAlienHive +{ +"Hive" +} + + + +// Armor received messages +$position -1 0.2 +$effect 0 +$fadein 0.5 +$fadeout 0.5 +$holdtime 5.0 + +ReceiveHeavyArmor +{ +Votre armure a ete amelioree en "heavy armor" (armure lourde). Vous etes maintenant mieux protege contre les ennemis. +} + +ReceiveMotionTrackArmor +{ +Vous avez maintenant le "motion-tracking" (detecteur de mouvements) integre a votre armure. +} + +ReceiveJetpackArmor +{ +Vous avez maintenant une armure avec "jetpack". Pressez et maintenez votre touche de saut pour l'utiliser. +} + +ReceiveLifeSupportArmor +{ +Vous avez recu un systeme "LifeSupport" (TM). Lorsque vous serez sur le point de mourir, vous serez protege jusqu'a ce que de l'aide arrive. +} + + + +$position -1 0.35 +$holdtime 3.0 + +GameStarting +{ +La partie est sur le point de commencer... +} + +$holdtime 2.0 +GameBegun +{ +La partie a commence. +} + +// Overwatch enabled +//OverwatchActive +//{ +//Overwatch active +//} + +// Overwatch range string, expecting a float for range +OverwatchRange +{ +Distance de la cible : %f. +} + +// Points awarded +$position -1 0.25 +$effect 0 +$holdtime 4 + +MarineAward +{ +Votre equipe vient juste de tuer un ennemi ! +} + +MarineAwardToLeader +{ +Votre escouade vient de recevoir des points pour avoir tuer un ennemi ! +} + +// Points awarded +$position -1 0.15 +$effect 0 +$holdtime 3 +MarineAwardToCommander +{ +Votre equipe a gagne des points pour avoir tuer un ennemi ! +} + +// Points awarded +$position -1 0.25 +$effect 0 +$holdtime 4 +AlienAward +{ +Vous venez de gagner des ressources pour avoir tuer un ennemi ! +} + +Defect +{ +Quitter l'escouade +} + +WeaponCantBeDropped +{ +Cette arme ne peut pas etre jetee. +} + +DefectMessageToLeader +{ +Un joueur vient de quitter votre escouade. +} + +SquadIndicator +{ +Vous etes dans l'escouade %d. +} + +InvalidOrderGiven +{ +Ordre invalide +} + +$position -1 0.65 +$effect 0 +$holdtime .5 +$fadein .2 +$fadeout .2 +GameWontStart +{ +La partie ne commencera pas tant que les deux equipes n'ont pas de joueurs. +} + +// Translation note: don't translate "ready" +GameWontStartUntilReady +{ +La partie ne commencera pas avant que chaque equipe ecrive "ready". +} + +$position -1 0.75 +$effect 0 +$holdtime .7 +$fadein .2 +$fadeout .2 +ReceivingLevelData +{ +Receiving level data... +} + +$position -1 0.85 +ReceivingLevelData1 +{ ++--- +} + +ReceivingLevelData2 +{ +++-- +} + +ReceivingLevelData3 +{ ++++- +} + +ReceivingLevelData4 +{ +++++ +} + +$position -1 0.65 +$effect 0 +$holdtime .5 +$fadein .2 +$fadeout .2 +$position -1 0.9 +EvolvingMessage +{ +Evolution... +} + +VoteCast +{ +Votre vote a ete emis. +} + +VoteStarted +{ +Un vote pour ejecter le "commander" a demarre. S'il est incompetent, utilisez votre "menu popup" pour voter contre lui. +} + +VoteIllegal +{ +Un vote est illegal en ce moment. +} + +AlreadyVoted +{ +Vous ne pouvez voter qu'une seule fois par partie. +} + +VoteFailed +{ +Le vote pour ejecter le "commander" a echoue. +} + +VoteCancelled +{ +Le vote pour ejecter le "commander" a ete annule. +} + +VoteSucceeded +{ +Le "commander" a ete ejecte de la "command console". +} + +BannedFromCommand +{ +Vous avez ete temporairement interdit de commandemment sur ce serveur. Vous pouvez commander sur d'autres serveurs ou attendre quelques heures avant de pouvoir recommencer sur celui-ci. +} + +MustGestateUp +{ +Vous ne pouvez seulement changer que pour des formes de vie plus evoluees. +} + +MustGestateOnGround +{ +Vous devez etre sur un sol plat pour evoluer. +} + +NotWhileDigesting +{ +Vous ne pouvez pas evoluer pendant que vous digerez un joueur. +} + +NoReadyRoomWhileDigested +{ +Vous ne pouvez pas aller dans la "ready room" pendant que vous etes digere. +} + +NeedMoreRoomToGestate +{ +Vous avez besoin de plus de place pour evoluer. +} + +NeedOneHiveToGestate +{ +Votre equipe a besoin d'un "hive" pour evoluer dans cette forme de vie. +} + +NeedTwoHivesToGestate +{ +Votre equipe a besoin de deux "hives" pour evoluer dans cette forme de vie. +} + +NeedThreeHivesToGestate +{ +Votre equipe a besoin de trois "hives" pour evoluer dans cette forme de vie. +} + +NeedOneHiveForStructure +{ +Votre equipe a besoin d'un "hive" pour construire cette structure. +} + +NeedTwoHivesForStructure +{ +Votre equipe a besoin de deux "hives" pour construire cette structure. +} + +NeedThreeHivesForStructure +{ +Votre equipe a besoin de trois "hives" pour construire cette structure. +} + +NeedsAnotherHiveForStructure +{ +Votre equipe a besoin d'un autre "hive" pour construire cette structure. +} + +MustBeBuilder +{ +Vous devez etre un Gorge pour construire cette structure. +} + +UpgradeNotAvailable +{ +Cette amelioration n'est pas disponible pour le moment. +} + +TooManyStructuresOfThisTypeNearby +{ +Il y a trop de structures de ce type a proximite. +} + +TooManyStructuresInArea +{ +Il y a trop de structures dans cette zone. +} + +$holdtime 2.0 +TooManyWebs +{ +Votre equipe a atteint le nombre maximum de "webs" autorises. +} + +TooManyWebsNearby +{ +Il y a trop de "webs" dans cette zone. +} + +$position -1 0.35 +$effect 0 +$holdtime 5.0 +TeamOneWon +{ +L'equipe un a remporte la victoire ! +} + +TeamTwoWon +{ +L'equipe deux a remporte la victoire ! +} + +GameDraw +{ +Match nul ! +} + +RankBeforeGameStart +{ +Vous ne pouvez changer de rangs seulement avant que la partie debute. +} + +DefectAfterGameStart +{ +Vous ne pouvez desertez seulement qu'apres le debut de la partie. +} + +// Tech tree +MarineResourcePrefix +{ +Ressources : +} + +AlienResourcePrefix +{ +Ressources +} + +CarryResourcePrefix +{ +Transporte %d ressources +} + +Resources +{ +Ressources : +} + + +NumericalEventResources +{ +ressources +} + +NumericalEventHealth +{ +de sante +} + +NumericalEventResourcesDonated +{ +Ressources donnees +} + +NumericalEventAmmo +{ +Munitions recues +} + + + + +AlienEnergyDescription +{ +Energie +} + +ResourcesDepleted +{ +Ressources epuisees +} + +Reinforcements +{ +Renforts +} + + +WeaponCategory +{ +Armes +} + +ArmorCategory +{ +Armures +} + +BuildCategory +{ +Construire +} + +RadioCategory +{ +Radio +} + +TechNodeLabel_0 +{ +None +} + +TechNodeHelp_0 +{ + +} + +TechNodeHelp_1 +{ +Bascule a votre arme suivante. +} + +TechNodeHelp_2 +{ +Recharge votre arme actuelle. +} + +TechNodeHelp_3 +{ +Jette votre arme courante, pour gagner de la vitesse ou pour la donner a quelqu'un d'autre. +} + +TechNodeHelp_5 +{ +Quitter la partie et retourner dans la "ready room". Ceci vous permet de changer d'equipe, d'observer la partie, ou de faire une pause. +} + +TechNodeHelp_6 +{ +Si le "commander" est deliberement en train de ruiner la partie, selectionnez ceci pour voter son ejection de la "command console". Si suffisamment de votes sont recus, il sera ejecte pour le reste de la partie. +} + + +TechNodeLabel_10 +{ +Attaque(e) +} + +TechNodeLabel_11 +{ +Attaquer +} + +TechNodeLabel_12 +{ +Detruire +} + +TechNodeLabel_13 +{ +Confirme +} + +TechNodeLabel_14 +{ +Focus team +} + +TechNodeLabel_15 +{ +Powerful +} + + +TechNodeHelp_7 +{ +"Ricanement" +} + +TechNodeHelp_8 +{ +"Besoin de soins" +} + +TechNodeHelp_9 +{ +"Besoin d'aide" +} + +TechNodeHelp_10 +{ +"Ils arrivent" +} + +TechNodeHelp_11 +{ +"A l'attaque" +} + +TechNodeHelp_12 +{ +"Je construis ici" +} + + +TechNodeLabel_20 +{ +Armures #1. +} + +TechNodeLabel_21 +{ +Armures #2. +} + +TechNodeLabel_22 +{ +Armures #3. +} + +TechNodeLabel_23 +{ +Armes #1. +} + +TechNodeLabel_24 +{ +Armes #2. +} + +TechNodeLabel_25 +{ +Armes #3. +} + +TechNodeHelp_20 +{ +Les armures des joueurs sont ameliorees au niveau un. +} + +TechNodeHelp_21 +{ +Les armures des joueurs sont ameliorees au niveau deux. +} + +TechNodeHelp_22 +{ +Les armures des joueurs sont ameliorees au niveau trois. +} + + +TechNodeHelp_23 +{ +Les armes, les mines et les tourelles font +10%% de degats. +} + +TechNodeHelp_24 +{ +Les armes, les mines et les tourelles font +20%% de degats. +} + +TechNodeHelp_25 +{ +Les armes, les mines et les tourelles font +30%% de degats. +} + +TechNodeLabel_26 +{ +"Advanced turret factory" +} + +TechNodeHelp_26 +{ +Ameliorer en "advanced turret factory" +} + +TechNodeLabel_28 +{ +"Jetpacks" +} + +TechNodeHelp_28 +{ +Permet de creer des "jetpacks" +} + +TechNodeLabel_29 +{ +"Heavy armor" +} + +TechNodeHelp_29 +{ +Permet de cree des "heavy armors" +} + +TechNodeLabel_30 +{ +"Distress beacon" +} + +TechNodeHelp_30 +{ +Appelle tous les renforts disponibles (tous les joueurs morts) au "marine start". +} + +TechNodeLabel_31 +{ +"Deployable medpacks tech" +} + +TechNodeHelp_31 +{ +Permet au "commander" de parachuter des "medpacks". +} + +TechNodeLabel_32 +{ +Annuler +} + +TechNodeHelp_32 +{ +Annuler la recherche. +} + +TechNodeLabel_33 +{ +"Motion-tracking" +} + +TechNodeHelp_33 +{ +Detecte et indique tous les ennemis en mouvement. +} + +TechNodeLabel_34 +{ +"Phase tech" +} + +TechNodeHelp_34 +{ +Permet l'utilisation de "scanner sweeps" et du "distress beacon" ainsi que la recherche du "motion-tracking" et de la technologie des "phase gates". +} + +TechNodeLabel_35 +{ +Ameliorer la structure. +} + +TechNodeHelp_35 +{ +Ameliore la vitesse de collecte des ressources. +} + +TechNodeLabel_36 +{ +Defense electrique. +} + +TechNodeHelp_36 +{ +Blesse les ennemis qui s'approchent trop de la structure. +} + +TechNodeLabel_38 +{ +"Heavy armor" +} + +TechNodeHelp_38 +{ +Permet de donner des "heavy armor" aux soldats. +} + +TechNodeLabel_39 +{ +"Jetpack" +} + +TechNodeHelp_39 +{ +Permet de donner des "jetpacks" aux soldats. +} + +TechNodeLabel_40 +{ +"Infantry portal" +} + +TechNodeHelp_40 +{ +Amene les renforts (les joueurs morts) un par un. +} + +TechNodeLabel_41 +{ +"Resource tower" +} + +TechNodeHelp_41 +{ +Collecte des ressources. +} + + + +TechNodeLabel_43 +{ +"Turret factory" +} + +TechNodeHelp_43 +{ +Permet la construction de tourelles et l'electrification de certaines structures. +} + +TechNodeLabel_45 +{ +"Arms lab" +} + +TechNodeHelp_45 +{ +Permet d'ameliorer les armes et les armures. +} + +TechNodeLabel_46 +{ +"Prototype lab" +} + +TechNodeHelp_46 +{ +Permet de developper des technologies experimentales ("heavy armor" et "jetpack"). +} + +TechNodeLabel_48 +{ +"Armory" +} + +TechNodeHelp_48 +{ +Permet de creer d'autres armes. +} + +TechNodeLabel_49 +{ +"Advanced armory" +} + +TechNodeHelp_49 +{ +Amelioration en "advanced armory". +} + + +TechNodeLabel_50 +{ +"Nuke plant" +} + +TechNodeHelp_50 +{ +Permet la construction de bombes nucleaires. +} + +TechNodeLabel_51 +{ +"Observatory" +} + +TechNodeHelp_51 +{ +Permet le developpement des technologies de reconnaissance ("motion-tracking" et "phase gates") et l'utilisation de "scanner sweeps" et du "distress beacon". +} + +TechNodeLabel_52 +{ +"Medpacks nanotech" +} + +TechNodeHelp_52 +{ +Permet au "commander" de parachuter des "medpacks" sur le champ de bataille. +} + +TechNodeLabel_53 +{ +"Scanner Sweep" +} + +TechNodeHelp_53 +{ +Devoile temporairement la zone et les ennemis s'y trouvant, meme ceux camoufles ("cloaked"). +} + +TechNodeLabel_55 +{ +"Phase gate" +} + +TechNodeHelp_55 +{ +Permet de voyager instantanement entre ces differentes structures (il en faut au minimum deux). +} + +TechNodeLabel_56 +{ +"Sentry turret" +} + +TechNodeHelp_56 +{ +Tourelle de defense automatique. +} + +TechNodeLabel_57 +{ +"Siege canon" +} + +TechNodeHelp_57 +{ +Tourelle de grande puissance de feu, tire par onde a travers les murs. +} + +TechNodeLabel_58 +{ +"Command console" +} + +TechNodeHelp_58 +{ +Un poste de commande auxilliaire. +} + + + +TechNodeLabel_59 +{ +"Medpack" +} + +TechNodeHelp_59 +{ +Redonne 50 points de sante au marine. +} + +TechNodeLabel_60 +{ +"Ammo" +} + +TechNodeHelp_60 +{ +Un chargeur, valable pour n'importe quelle arme. +} + + + +TechNodeLabel_61 +{ +"Mines" +} + +TechNodeHelp_61 +{ +Cinq mines. +} + +TechNodeLabel_62 +{ +"Welder" +} + +TechNodeHelp_62 +{ +Repare batiments et armures, affecte les emplacements "weldables" et brule les "webs". +} + +TechNodeLabel_63 +{ +"Medpack" +} + +TechNodeLabel_64 +{ +"Shotgun" +} + +TechNodeHelp_64 +{ +Pour les combats rapproches. +} + +TechNodeLabel_65 +{ +"HMG" +} + +TechNodeHelp_65 +{ +Fusil d'assaut a haute puissance de feu. +} + +TechNodeLabel_66 +{ +"Grenade launcher" +} + +TechNodeHelp_66 +{ +Lance-grenades. +} + +TechNodeLabel_67 +{ +"Nuke" +} + +TechNodeHelp_67 +{ +Bombe nucleaire miniature. +} + +TechNodeLabel_69 +{ +Recycler +} + +TechNodeHelp_69 +{ +Detruisez cette structure afin d'en recuperer quelques ressources. +} + +TechNodeHelp_80 +{ +Demande des ordres a votre "commander". Il sera notifie que vous etes en train de demander quelque chose a faire, et vous donnera un ordre. +} + +TechNodeHelp_81 +{ +Dit a votre "commander" que vous avez bien recu ses ordres. Suivez les instructions du "waypoint" pour effectuer votre tache. Une fois completee, le "waypoint" disparaitra automatiquement. +} + + + +TechNodeLabel_85 +{ +Constructions +} + +TechNodeHelp_85 +{ +Menu de constructions de base. +} + +TechNodeLabel_86 +{ +Constructions avancees +} + +TechNodeHelp_86 +{ +Menu de constructions avancees. +} + +TechNodeLabel_87 +{ +Assistance +} + +TechNodeHelp_87 +{ +Ouvrir le menu d'assistance. +} + +TechNodeLabel_88 +{ +Equipement +} + +TechNodeHelp_88 +{ +Ouvrir le menu d'equipement. +} + +TechNodeHelp_90 +{ +Creer une "resource tower" : collecte des ressources pour votre equipe. Elle ne peut etre construite que sur un puit de ressources (indique par de la fumee blanche qui s'en echappe). +} + +TechNodeHelp_91 +{ +Creer une "offensive chamber" : une tourelle organique qui attaque les joueurs et structures ennemis en vue. Degats : 20 +} + +TechNodeHelp_92 +{ +Creer une "defensive chamber" : permet des ameliorations de defense, soigne les joueurs et les strucures a proximite. +} + +TechNodeHelp_93 +{ +Creer une "sensory chamber" : permet des ameliorations sensorielles, camoufle ("cloak") les joueurs et les structures a proximite. Bloque le "motion-tracking" (detecteur de mouvements) dans son rayon. +} + +TechNodeHelp_94 +{ +Creer une "movement chamber" : permet des ameliorations de mouvement et les joueurs a proximite recuperent plus vite leur energie. +} + +TechNodeHelp_95 +{ +Creer un "hive" : permet de construire d'autres structures d'ameliorations et developpe de nouvelles competences pour toutes les creatures (doit etre construit a un endroit specifique - "hive location"). +} + +TechNodeHelp_101 +{ +Augmente la protection des armures. Chaque niveau de carapace absorbe environ 16 % de degats supplementaires. +} + +TechNodeHelp_102 +{ +Vous vous soignez automatiquement petit a petit. Les plus haut niveaux vous soigneront plus rapidement. +} + +TechNodeHelp_103 +{ +Le "hive" va automatiquement essayer de vous sauver lorsque vous serez sur le point de mourir en vous ramenant a un "hive" pour vous soigner. +} + +TechNodeHelp_104 +{ +"Sharpness" - Vos degats en melee sont augmentes de moitie. +} + +TechNodeHelp_105 +{ +"Piercing" - Vos degats en bataille a distance sont augmentes de moitie. +} + +TechNodeHelp_106 +{ +"Penetration" - Vous pouvez tirer a travers les murs et les cibles (non implemente). +} + +TechNodeHelp_107 +{ +Ameliore votre vitesse maximale de facon permanente. +} + +TechNodeHelp_108 +{ +Vous permet de recuperer votre energie plus rapidement. Chaque niveau de "adrenaline" augmente votre vitesse de recuperation d'energie de 33 %. +} + +TechNodeHelp_109 +{ +Chaque niveau de "silence" rend vos bruits de pas et vos mouvements plus silencieux. +} + +TechNodeHelp_110 +{ +Restez sans bouger et vous serez quasi invisible. De plus hauts niveaux de "cloaking" vous camoufleront plus vite. Les "observatories" et les "scanner sweeps" vous rendront visibles. +} + +TechNodeHelp_111 +{ +Laisse une trainee visible derriere les ennemis a proximite. De plus hauts niveaux augmentent le rayon d'action. +} + +TechNodeHelp_112 +{ +Vous verrez vos ennemis qui se trouvent dans un certain rayon autour de vous en rouge sur votre "hive sight". +} + +TechNodeHelp_113 +{ +Evolution en Skulk. C'est un petit alien rapide ideal pour les duels, pour harceler les ennemis et elaborer des tactiques de guerilla. Il peut grimper sur les murs (desactivez-le en appuyant sur la touche "s'accroupir"). +} + +TechNodeHelp_114 +{ +Evolution en Gorge. Cree et construit les "resources towers", les "hives", les diverses "chambres" d'ameliorations et les "offense chambers". Faible pour les combats, il peut aussi soigner les structures et les joueurs allies. +} + +TechNodeHelp_115 +{ +Evolution en Lerk. Fournit un support varie au combat. Il peut tirer des "spikes" de loin, envelopper des zones de "spores" ou d'un nuage de protection ("umbra"). Volez en appuyant sur la touche saut. Planez en laissant pressee la touche saut en vol. +} + +TechNodeHelp_116 +{ +Evolution en Fade. Un puissant combattant de bonne carrure, capable de "swipe" (giffler), de lancer des "acid rockets" et de se teleporter. +} + +TechNodeHelp_117 +{ +Evolution en Onos. Un monstre qui peut "stomp" (frapper le sol) pour etourdir ("stun") ses ennemis, charger ("charge") a travers et les devorer ("devour"). Cet alien est capable d'affronter plusieurs marines a la fois. +} + + +ClassDead +{ +Mort +} + +ClassDigesting +{ +Digestion... +} + +ClassCommander +{ +Commander +} + +ClassHeavyMarine +{ +"Heavy" +} + +ClassReinforcing +{ +Renfort... +} + +ClassLevel1 +{ +Skulk +} + +ClassLevel2 +{ +Gorge +} + +ClassLevel3 +{ +Lerk +} + +ClassLevel4 +{ +Fade +} + +ClassLevel5 +{ +Onos +} + +ClassGestating +{ +Evolution... +} + +Building +{ +Construction : +} + + +Researching +{ +En recherche : +} + +Energy +{ +Energie : +} + + +Prerequisite +{ +Requiert : +} + +Cost +{ +Cout : +} + +NotFullyBuilt +{ +Pas entierement construit. +} + +Recycling +{ +Recyclage... +} + +ReinforcementsText +{ +Renforts : +} + +LogoutText +{ +Deconnexion +} + +BlipStatus_0 +{ +ennemi +} + +BlipStatus_1 +{ +ennemi affaibli +} + +BlipStatus_2 +{ + +} + +BlipStatus_3 +{ +est attaque(e). +} + +BlipStatus_5 +{ +est un gorge. +} + +BlipStatus_6 +{ + +} + +BlipStatus_7 +{ + +} + +BlipStatus_8 +{ + +} + +Friend +{ +Ami +} + +Enemy +{ +Ennemi +} + +User3Name_1 +{ +soldat +} + +User3Name_2 +{ +commander +} + +User3Name_3 +{ +skulk +} + +User3Name_4 +{ +gorge +} + +User3Name_5 +{ +lerk +} + +User3Name_6 +{ +fade +} + +User3Name_7 +{ +onos +} + +User3Name_8 +{ +embryon +} + +User3Name_15 +{ +equipement +} + +User3Name_17 +{ +Hive +} + +User3Desc_17 +{ +Les aliens naissent ici, permet egalement la construction d'autres structures et ameliorations. +} + +User3FriendlyDesc_17 +{ +Vous naissez ici. Il vous soignera lorsque vous en serez proche. Fournit le "hive sight", qui vous informe sur vos allies, vos ennemis et alerte votre equipe. Protegez vos "hives" a tout prix. +} + +User3Name_22 +{ +Puit de ressources +} + +User3Desc_22 +{ +Fournit des ressources lorsqu'une "ressource tower" est construite dessus. Ces ressources sont infinies. +} + +User3CommanderDesc_22 +{ +Fournit des ressources lorsqu'une "ressource tower" est construite dessus. Ces ressources sont infinies. +} + +User3Name_23 +{ +"Command console" +} + +User3Desc_23 +{ +Utilisee par le "commander" marine pour creer des structures et faire la recherche de nouvelles technologies. +} + +User3FriendlyDesc_23 +{ +Utilisee par le "commander" marine pour creer des structures et faire la recherche de nouvelles technologies. Le nom de votre "commander" est affiche en haut au milieu de votre ecran. Si votre equipe n'a pas de "commander", vous pouvez le devenir en "utilisant" la "command console". +} + +User3CommanderDesc_23 +{ +Selectionnez la "command console" pour voir le rayon dans lequel vous pouvez construire des "infantry portals". Si la "command console" est detruite, vous en serez ejecte et il ne sera plus possible d'avoir un "commander". Protegez-la a tout prix. +} + + +User3Name_24 +{ +"Turret factory" +} + +User3Desc_24 +{ +Permet de construire des "sentry turrets" dans son rayon d'action. Celles-ci ont besoin d'une "turret factory" pour continuer a fonctionner. Le "commander" peut selectionner cette derniere pour voir son rayon d'action. +} + +User3Name_25 +{ +"Armory" +} + +User3Desc_25 +{ +Fournit des munitions et permet la construction de "shotguns", de "mines" et de "welders" dans son rayon. +} + +User3CommanderDesc_25 +{ +Fournit des munitions gratuitement aux soldats allies. Permet la construction de "shotguns", de "mines" et de "welders" dans son rayon. Selectionnez l'"armory" pour voir son rayon. +} + +User3FriendlyDesc_25 +{ +"Utilisez" l'"armory" pour obtenir gratuitement des munitions pour votre arme courante. Permet aussi la construction de "welders", de "shotguns" et de "mines" dans son rayon. +} + + +User3Name_26 +{ +"Advanced armory" +} + +User3Desc_26 +{ +Fournit des munitions et permet la construction de "heavy machine guns" et de "grenade launchers" dans son rayon. +} + +User3CommanderDesc_26 +{ +Fournit gratuitement des munitions aux soldats allies. Permet la construction de "heavy machine guns" et de "grenade launchers" dans son rayon. Selectionnez l'"advanced armory" pour voir son rayon. +} + +User3FriendlyDesc_26 +{ +"Utilisez" cette "advanced armory" pour obtenir gratuitement des munitions pour votre arme courante. Permet aussi la construction de "heavy machine guns" et de "grenade launchers" dans son rayon. +} + + +User3Name_27 +{ +"Arms lab" +} + +User3Desc_27 +{ +Permet d'ameliorer les armures et les munitions. +} + +User3Name_28 +{ +"Prototype lab" +} + +User3Desc_28 +{ +Permet de developper les "jetpacks" et les "heavy armors". +} + +User3Name_29 +{ +"Observatory" +} + +User3Desc_29 +{ +Affiche des "blips" sur les structures et les creatures ennemies a proximite et les empeche de se camoufler. Permet de faire des "scanner sweeps", d'utiliser le "distress beacon", de rechercher le "motion-tracking" et de developper la technologie des "phase gates". +} + +User3Name_30 +{ +"Chemlab" +} + +User3Name_31 +{ +"Medlab" +} + +User3Name_33 +{ +"Sentry turret" +} + +User3Desc_33 +{ +Tire automatiquement sur les ennemis visibles. +} + +User3FriendlyName_33 +{ +Tire automatiquement sur vos ennemis. Faible contre les formes de vies aliens les plus evoluees. Doit etre construite dans le rayon d'une "turret factory". Degats : 10 +} + +User3CommanderName_33 +{ +Tire automatiquement sur les creatures et les structures ennemies. Faible contre les formes de vies aliens les plus evoluees. Doit etre construite dans le rayon d'une "turret factory". Selectionnez une "sentry turret" pour voir son rayon d'action. Ne tire pas sur les ennemis camoufles. Utile contre les aliens peu evolues. Degats : 10 +} + + +User3Name_34 +{ +"Siege canon" +} + +User3Desc_34 +{ +"Automated Siege Canon" (ASC). Arme qui attaque les structures, meme a travers les murs, mais ne vise pas les creatures. +} + +User3FriendlyDesc_34 +{ +"Automated Siege Canon" (ASC). Arme qui attaque les structures, meme a travers les murs, mais ne vise pas les creatures. Rayon : 400 Degats : 165 (le double contre les structures). +} + +User3CommanderDesc_34 +{ +"Automated Siege Canon" (ASC). Arme qui attaque les structures, meme a travers les murs, mais ne vise pas les creatures. Selectionnez le "ASC" pour voir son rayon d'action. Degats : 165 (le double contre les structures). +} + +User3Name_35 +{ +"Resource tower" +} + +User3Desc_35 +{ +Collecte des ressources pour votre equipe a intervalles reguliers. +} + +User3Name_37 +{ +"Infantry portal" +} + +User3FriendlyDesc_37 +{ +Amene les marines en renforts. Detruire l'"infantry portal" signifie que les marines ne peuvent plus avoir de renforts. +} + +User3FriendlyDesc_37 +{ +Amene les marines en renforts. Sans un "infantry portal", votre equipe ne pourra plus avoir de renforts, protegez-le donc. +} + +User3CommanderDesc_37 +{ +Amene les marines en renforts. Sans un "infantry portal", les marines ne peuvent plus avoir de renforts. +} + +User3Name_38 +{ +"Nuke" +} + +User3Desc_38 +{ +Nuke is arming, and must be destroyed before it finishes! Once armed, nuke detonates, doing massive damage to nearby players and structures. +} + +User3FriendlyDesc_38 +{ +Nuke is arming, protect it while it finishes. Once armed, nuke detonates, doing massive damage to nearby players and structures. +} + +User3CommanderDesc_38 +{ +Nuke is arming, protect it while it finishes. Once armed, nuke detonates, doing massive damage to nearby players and structures. +} + +User3Name_39 +{ +"Heavy armor" +} + +User3Desc_39 +{ +Ramassez ceci pour avoir une "heavy armor". Ne peut pas etre utilise avec un "jetpack". Protege des "spores". +} + +User3Name_40 +{ +"Jetpack" +} + +User3Desc_40 +{ +Ramassez le module "jetpack" pour pouvoir voler. Ne peut pas etre utilise avec une "heavy armor". +} + +User3Name_41 +{ +"Phase gate" +} + +User3Desc_41 +{ +Permet de voyager a la vitesse de la lumiere entre les differentes "phase gates". "Utilisez"-les pour passer d'une "phase gate" a l'autre. +} + +User3CommanderDesc_41 +{ +Permet de voyager a la vitesse de la lumiere entre les differentes "phase gates". Plusieurs sont necessaires pour fonctionner correctement. +} + +User3Name_42 +{ +"Defense chamber" +} + +User3Desc_42 +{ +Soigne lentement les joueurs et les structures allies. Fournit des ameliorations de defense ("carapace", "regeneration" ou "redemption"). +} + +User3Name_43 +{ +"Movement chamber" +} + +User3Desc_43 +{ +Les aliens peuvent les utiliser pour se teleporter au "hive" le plus eloigne. Fournit des ameliorations de mouvement ("celerity", "adrenaline" ou "silence"). Detruire ces structures va retirer les ameliorations aliens. +} + +User3FriendlyDesc_43 +{ +Avancez pres de la structure et appuyez sur votre touche "utiliser" pour vous teleporter a un "hive" attaque. Fournit des ameliorations de mouvement ("celerity", "adrenaline" ou "silence"). +} + + +User3Name_44 +{ +"Offense chamber" +} + +User3Desc_44 +{ +Tourelle organique qui attaque automatiquement les joueurs et les structures ennemis. Degats : 20 +} + +User3Name_45 +{ +"Sensory chamber" +} + +User3Desc_45 +{ +Detecte les ennemis dans son rayon, camoufle les joueurs et les structures allies a proximite et fournit des ameliorations sensorielles ("cloaking", "pheromones" ou "scent of fear"). +} + + +User3Name_46 +{ +"Resource tower" +} + +User3Desc_46 +{ +Collecte des ressources pour vos ennemis. +} + +User3FriendlyDesc_46 +{ +Collecte des ressources pour votre equipe ; ne s'epuise jamais. +} + +User3Name_47 +{ +Module d'"heavy armor" +} + +User3Desc_47 +{ +Donne une "heavy armor" au soldat. +} + +User3FriendlyDesc_47 +{ +Donne une "heavy armor" au soldat. +} + +User3Name_48 +{ +Module de "jetpack" +} + +User3Desc_48 +{ +Donne un "jetpack" au soldat. +} + +User3FriendlyDesc_48 +{ +Donne un "jetpack" au soldat. +} + +User3Name_49 +{ +"Advanced turret factory" +} + +User3Desc_49 +{ +Permet la construction de "sentry turrets" et de "siege canons". +} + +User3FriendlyDesc_49 +{ +Permet la construction de "sentry turrets" et de "siege canons". +} + +User3Name_57 +{ +"Mine" +} + +User3Desc_57 +{ +Explose au contact d'un ennemi. +} + +User3FriendlyDesc_57 +{ +Explose au contact d'un ennemi. +} + +Weapon1Help +{ +"Gore" - Approchez de votre ennemi et attaquez. Degats : %d (le double contre les structures). +} + +Weapon2Help +{ +"Spit" - Arme legere de longue portee pour garder vos ennemis a distance. Degats : %d +} + +Weapon3Help +{ +"Spores" - Projette un nuage de spores qui s'etend, causant lentement des degats aux joueurs a proximite (excepte aux "Heavy Armor"). Degats : %d par seconde. +} + +Weapon4Help +{ +"Spikes" - Arme de longue distance qui frappe instantanement. Degats : %d +} + +Weapon5Help +{ +"Bite" - Attaque mortelle au corps a corps. Approchez tout pres de vos ennemis et attaquez. Degats : %d +} + +Weapon6Help +{ +"Bite" - Attaque mortelle au corps a corps. Approchez tout pres de vos ennemis et attaquez. Degats : %d +} + +Weapon7Help +{ +"Swipe" - Attaque mortelle au corps a corps. Approchez tout pres de vos ennemis et attaquez. Efficace contre les joueurs et les structures. Degats : %d +} + +Weapon8Help +{ +"Webs" - Tirez des globules l'une pres de l'autre et une "web" va se creer entre les deux. Les "webs" ralentissent les ennemis et les empechent d'utiliser leurs armes pendant un moment. Les "webs" peuvent etre detruites avec un "welder". +} + +Weapon9Help +{ +"Metabolize" - Vous soigne en utilisant de l'energie. +} + +Weapon10Help +{ +"Parasite" - Infecte la cible avec un parasite, la devoilant en permanence sur le "hive sight". Le parasite ne peut pas etre enleve. Degats : %d +} + +Weapon11Help +{ +"Blink" - Permet de se teleporter rapidemment. Pointez dans la direction a suivre et maintenez le bouton enfonce. +} + +Weapon12Help +{ +"Xenocide" - Suicide explosif. Un court instant apres l'activation, vous explosez, causant de lourds degats a tout ce qui etait a proximite. Degats : %d +} + +Weapon13Help +{ +"Knife" - Arme de destruction ou de desespoir. Degats : %d +} + +Weapon14Help +{ +"Pistol" - Arme de haute precision qui cause de gros degats mais avec de petits chargeurs. Degats : %d +} + +Weapon15Help +{ +"Light Machine gun" - Bonne precision, haute cadence de tir, chargeur moyen. Degats : %d +} + +Weapon16Help +{ +"Shotgun" - Pour les cibles qui se deplacent rapidement et pour causer beaucoup de degats en un seul coup a un ennemi tres proche. 10 fragments par tir. Degats : %d par fragment +} + +Weapon17Help +{ +"Heavy machine gun" (HMG) - Armement lourd pour les cibles et les ennemis plus gros. Bien qu'assez peu precis, les chargeurs sont enormes et sa cadence de tir le rend indispensable. Degats : %d par balle (la moitie contre les structures) +} + +Weapon18Help +{ +"Welder" - Permet d'utiliser les zones "weldables" sur les cartes. Il peut aussi reparer les structures, l'armure des soldats et peut detruire les "webs". Degats : %d +} + +Weapon19Help +{ +"Mines" - Utilisez-les comme defense, ou pour proteger vos flans lors d'un assaut. Elles se declenchent au contact. Degats : %d +} + +Weapon20Help +{ +"Grenade launcher" - Les grenades explosent apres 4 secondes (directement si elles touchent une structure ou une creature ennemie) et causent des degats aux alentours. Degats : %d (le double contre les structures) +} + +Weapon21Help +{ +"Leap" - Sautez en avant rapidement, frappant tout ce qui se trouve sur votre chemin. Utile pour se deplacer mais aussi pour combattre. Degats : %d +} + +Weapon22Help +{ +"Charge" - Foncez rageusement droit devant vous, en blessant tout ce que vous touchez. La "charge" utilise de l'energie et s'arrete lorsque vous n'en avez plus. Degats : incroyables +} + +Weapon23Help +{ +"Umbra" - Projetez un nuage bacterien qui ralenti les balles ennemies qui le penetre. Tous les joueurs ou structures allies qui se trouvent dans le nuage sont rarement touches par les balles, mais il est toujours possible d'y subir des degats d'explosifs d'autres armes qui ne tirent pas de balles. Dure %d secondes. +} + +Weapon24Help +{ +"Primal scream" - Tous les coequipiers dans les environs regagnent leur energie plus rapidement, se deplacent plus vite et causent plus de degats. Ecoutez-les crier a leur tour en defi. +} + +Weapon25Help +{ +"Bile bomb" - Une artillerie organique efficace contre les structures. Degats : %d (degats zonaux, contre les structures uniquement) +} + +Weapon26Help +{ +"Acid rocket" - Projectile lent qui cause des degats en eclaboussant. Degats : %d +} + +Weapon27Help +{ +"Healing spray" - "Spray" bacterien qui soigne les joueurs et les structures alliees et blesse les ennemis a proximite. Degats : %d (effet zonal) +} + +Weapon28Help +{ +"Babbler" - Cree un "babbler", une version plus failbe du Skulk. Les "babblers" vont rechercher eux-memes les ennemis, mais ne vive qu'un court moment. Degats : 20 ("bite"), 40 ("xenocide"). +} + +Weapon29Help +{ +"Stomp" - Etourdit ("stun") tous les joueurs ennemis touches pendant %d secondes. +} + +Weapon30Help +{ +"Devour" - Mange un ennemi proche. Le joueur est lentement digere, prenant %d points de degats par seconde. L'Onos lui prend ses points de sante pour se regenerer. Si l'Onos est tue avant que la digestion ne soit complete, l'ennemi est libere. +} + +CommandStationOtherTeam +{ +Cette "command console" appartient a l'autre equipe. +} + +CommandStationInUse +{ +Votre equipe a deja un "commander", la "command console" ne peut pas etre utilisee. +} + +WeaponPreventingCommandStation +{ +Votre arme vous empeche d'utiliser la "command console". +} + +CommandStationDestroyed +{ +Cette "command console" est detruite et ne peut plus etre utilisee ! +} + +CommandStationWaitTime +{ +Vous devez attendre plus longtemps avant de pouvoir de nouveau entrer dans la "command console". +} + + +// Particle editing commands +$position -1 0.7 +NoParticleSystem +{ +That particle system couldn't be found. +} + +EditingParticleSystem +{ +Found particle system, use F7 to edit +} + + +// Marine help text + +// Armor received messages +$position -1 0.45 +$effect 0 +$fadein 0.5 +$fadeout 0.5 +$holdtime 5.0 + +HelpTextCSAttractMode +{ +Pointez cette "command console" et appuyez sur votre touche "utiliser" pour activer le mode "commander". +} + +HelpTextArmoryResupply +{ +"Utilisez l'"armory" pour obtenir gratuitement des munitions pour votre arme courante. +} + +HelpTextAttackNearbyStation +{ +C'est la "command console" de l'ennemi, attaquez-la ! +} + +HelpTextBuildTurret +{ +Pointez la base de cette "sentry turret" et appuyez sur votre touche "utiliser" pour la construire. +} + +HelpTextBuildTower +{ +Pointez la base de cette "resource tower" et appuyez sur votre touche "utiliser" pour la construire. +} + +HelpTextExplainTower +{ +Cette "resource tower" active donne periodiquement des ressources a votre equipe. +} + +HelpTextAttackHive +{ +Rassemblez vos coequipiers et trouvez un "hive" alien a detruire ! +} + +HelpTextOtherHiveBuilding +{ +Un seul "hive" ne peut etre construit en meme temps. Attendez que l'autre soit termine avant de commencer celui-ci. +} + +HelpTextEmptyHiveNotNearby +{ +Les "hives" ne peuvent etre construits qu'a des emplacements specifiques ("hive locations" - cherchez une zone infestee et un "hive" translucide). +} + +HelpTextAttackNearbyHive +{ +Il y a un "hive" ennemi a proximite, allez le tuer pour arreter la menace alien ! +} + +HelpTextFriendlyMovementChamber +{ +Appuyez sur votre touche "utiliser" sur cette "movement chamber" pour vous teleporter a un "hive" attaque. Elle vous redonne egalement de l'energie plus rapidement lorsque vous etes tout pres. +} + +HelpTextAttackMovementChamber +{ +C'est une "movement chamber" ennemie, elle leur permet de se teleporter a leur "hive" et leur donne de l'energie. +} + +HelpTextFriendlyOffensiveChamber +{ +C'est une "offense chamber", elle tire automatiquement sur les ennemis qui s'en approchent. +} + +HelpTextAttackOffensiveChamber +{ +C'est une "offense chamber" ennemie, faites attention ! +} + +HelpTextFriendlyDefensiveChamber +{ +Cette "defense chamber" regenere les joueurs et les structures a proximite. Elle fait un bruit de clapotement lorsqu'elle soigne. +} + +HelpTextAttackDefensiveChamber +{ +C'est une "defense chamber" ennemie, elle soigne les joueurs et les structures ennemis. +} + +HelpTextFriendlySensoryChamber +{ +C'est une "sensory chamber", elle camoufle les joueurs et les structures ennemis a proximite. +} + +HelpTextAttackSensoryChamber +{ +C'est une "sensory chamber" ennemie. +} + +HelpTextOpenWeldable +{ +Cette zone peut etre ouverte avec un "welder". +} + +HelpTextCloseWeldable +{ +Cette zone peut etre fermee avec un "welder". +} + +HelpTextPhaseGate +{ +"Utilisez" la "phase gate" pour vous teleporter. +} + +HelpTextAlienPopupMenu +{ +Utilisez votre "menu popup" (le bouton droit de la souris par defaut) pour construire des structures, subir des ameliorations, quitter l'equipe, etc. +} + +HelpTextMarinePopupMenu +{ +Utilisez votre "menu popup" (le bouton droit de la souris par defaut) pour utiliser des commandes vocales, demander des ordres, quitter l'equipe, etc. +} + +HelpTextOrder +{ +Le "commander" vous a donne un ordre. Le cercle bleu sur l'ecran decrit l'endroit et le type d'ordre. Utilisez votre "menu popup" pour demander d'autres ordres ou pour lui en signifier la bonne reception. +} + +HelpTextCommanderUseable +{ +En tant que "commander", vous pouvez "utiliser" tous les boutons ou les interrupteurs en cliquant avec le bouton gauche dessus. +} + +HelpTextMarineCommandMenu +{ +Appuyez sur la touche "menu popup" pour communiquer avec votre equipe (par defaut il s'agit du bouton droit de la souris). +} + +HelpTextResourceDropoff +{ +Vous avez gagne des points de ressources pour votre equipe ! +} + +HelpTextJetpacks +{ +Votre "commander" a recherche les "jetpacks" pour votre equipe. Si vous en avez recu un, appuyez sur votre touche "saut" pour l'utiliser. +} + +HelpTextAlienCommandMenu +{ +Appuyez sur votre touche "menu popup" pour changer de forme de vie et vous ameliorer (la touche par defaut est le bouton droit de la souris). +} + +HelpTextAttackTower +{ +Cette "resource tower" collecte des ressources pour l'ennemi... detruisez-la ! +} + +HelpTextAlienWeapons +{ +Utilisez la molette de la souris ou les touches numeriques pour basculer entre vos differentes competences. Une icone rouge indique que la competence est desactivee jusqu'a ce que vous ayez plus de "hives". +} + +HelpTextAlienResources +{ +La barre bleue sur la gauche indique vos ressources. Vous les obtenez via les "resources towers" de votre equipe. Les ressources peuvent etre depensees en utilisant le "menu popup". +} + +HelpTextAlienEnergy +{ +La barre jaune sur la droite indique votre energie. Les competences coutent de l'energie lorsqu'elles sont utilisees. +} + +HelpTextAlienPendingUpgrades +{ +La ou les petite(s) icone(s) qui clignote(nt) sur le cote droit de votre ecran signifient que vous pouvez maintenant ameliorer un ou des aspect(s) de votre creature ! Ouvrez le "menu popup" et faites un choix parmi une des ameliorations disponibles. +} + +HelpTextAlienBuildStructure +{ +En tant que constructeur alien, vous pouvez creer des structures pour votre equipe en utilisant le "menu popup". +} + +HelpTextAlienBuildStructure +{ +Il y a une structure alien non-construite a proximite. Les structures aliens se construisent elles-memes lentement, mais en tant que constructeur, vous pouvez accelerer sa construction. Pointez a la base de la structure et appuyez sur la touche "utiliser". +} + +HelpTextAlienHiveSight +{ +Les cercles lumineux sur votre ecran indiquent le "hive sight" de votre equipe. Les differents points de couleurs sur votre ecran representent vos "hives", vos coequipiers, vos structures attaquees ou encore vos ennemis parasites, habituez-vous a les reperer correctement. +} + +HelpTextAlienVisionMode +{ +L'emplacement de tous les aliens et de leurs structures est connu en permanence par le "hive mind". Il peut vous permettre de reperer plus facilement toutes les formes de vies de votre equipe lorsque vous appuyez sur la touche "flashlight". +} + +HelpTextAlienCommunication +{ +Vous pouvez ricaner en utilisant votre "menu popup". Ouvrez-le, allez vers le haut, a droite et ensuite relachez. +} + +HelpTextAlienUnderAttack +{ +Un de vos coequipiers ou une de vos structures est attaque. Regardez autour de vous et chercher l'alerte du "hive sight". +} + +HelpTextBuilder +{ +Vous etes maintenant un gorge. Restez en dehors des combats et utilisez votre "menu popup" pour construire les differentes structures. +} + +HelpTextWeb +{ +Tirez des "webs" sur les murs et les planchers pour creer des fils entre elles. Les ennemis qui touchent les "webs" sont ralentis et ne peuvent pas utiliser leurs armes pendant un moment. +} + +HelpTextWallwalking +{ +Le Skulk grimpe automatiquement sur les murs et les plafonds, pour desactiver cette fonctionnalite, appuyez sur votre touche "s'accroupir". +} + +HelpTextBite +{ +Approchez-vous tout pres de vos ennemis et appuyez sur la touche "attaquer" pour les mordre. +} + +HelpTextFlight +{ +Donner des petits coups sur votre touche "saut" pour voler. Vous pouvez aussi la garder enfoncee lorsque vous etes en l'air pour planer. +} + +HelpTextSpores +{ +Appuyez sur votre bouton "attaquer" pour lancer un nuage de spores qui blessera les ennemis qui seront dedans. Les "Heavy Armor" sont immunises contre les spores. +} + +HelpTextAlienResource +{ +Trouvez un puit de ressources et construisez une "resource tower" dessus pour qu'elle fournisse des ressources a votre equipe. +} + +HelpTextPopupMenu +{ +Appuyez sur le bouton droit de la souris (attaque secondaire) pour afficher le "menu popup". +} + +HelpTextBuyUpgrade +{ +Les aliens peuvent ameliorer certaines de leurs caracteristiques en utilisant le "menu popup". Essayez-le : appuyez sur le bouton de votre "menu popup" (le bouton droit de la souris par defaut) et deplacez la souris vers la droite. +} + +HelpTextBuyLifeform +{ +Les aliens peuvent evoluer en de nouvelles formes de vie. Essayez-le : appuyez sur le bouton de votre "menu popup" (le bouton droit de la souris par defaut) et deplacez la souris vers le bas. +} + +HelpTextCommanderGiveOrders +{ +Cliquez avec le bouton droit de la souris sur le sol ou sur une structure pour donner un ordre. +} + +HelpTextCommanderSelectPlayers +{ +Cliquez avec le bouton gauche sur des joueurs ou faites un rectangle autour d'eux pour les selectionner. +} + +HelpTextCommanderLogout +{ +Vous pouvez quitter le mode "commander" en cliquant sur le bouton rouge "Deconnexion" dans le coin superieur droit de votre ecran. +} + +// This message isn't in yet +HelpTextCommanderBuild +{ +Cette structure n'a pas ete entierement construite. Selectionnez un joueur et cliquez ensuite avec le bouton droit de la souris sur cette structure pour lui donner l'ordre de la construire. +} + +HelpTextCommanderUse +{ +Les portes, les ascenseurs et d'autres elements de la cartes peuvent etres "hackees" par le "commander". Cliquez avec le bouton gauche de la souris sur l'element pour le "hacker". +} + +HelpTextCommanderAttack +{ +Cette cible peut etre attaquee ! Cliquez avec le bouton droit de la souris dessus pour en donner l'ordre. +} + +HelpTextCommanderWeld +{ +Il est possible d'utiliser le "welder" sur cette cible. Achetez un "welder" pour l'un de vos coequipiers, ensuite cliquez avec le bouton droit dessus pour lui donner l'ordre de l'utiliser sur la cible. +} + +HelpTextCommanderGet +{ +Cliquez avec le bouton droit de la souris ici pour donner l'ordre de ramasser ce qui s'y trouve. +} + +HelpTextCommanderUnderAttack +{ +Vous etes attaques ! Appuyez sur votre touche "saut" pour aller a l'alerte. +} + +HelpTextCommanderResearchComplete +{ +Votre recherche est terminee. Appuyez sur votre touche "saut" pour vous rendre a l'endroit de la recherche. +} + +HelpTextCommanderUpgradeComplete +{ +Votre amelioration est terminee. Appuyez sur votre touche "saut" pour vous rendre au batiment ameliore. +} + +JetpackEnergyHUDText +{ +Energie du "jetpack" +} + +HelpTextDisableHelp +{ +Vous pouvez desactiver ces bulles d'aides en decochant la case "show hints" dans le menu "customization" dans "multiplayer" (cl_autohelp 0). +} + +Paralyzed +{ +Paralysie +} + +Stunned +{ +Etourdissement +} + +Digested +{ +Digestion... +} + +DigestingPlayer +{ +Digestion de %s... +} + +Parasited +{ +Parasite +} + +PrimalScreamed +{ +"Primal scream" +} + +Umbraed +{ +"Umbra" +} + +Webbed +{ +"Web" +} + +// Order descriptions +Order2 +{ +Venir ici +} + +Order3 +{ +Attaquer la cible +} + +Order4 +{ +Construire %s +} + +Order5 +{ +Garder %s +} + +Order6 +{ +Utiliser le "welder" ici +} + +Order7 +{ +Prendre %s +} + +Order9 +{ +Tenir la position +} + +Range +{ +%d metres +} + +// Timelimit for tourny mode +GameTime +{ +Duree de la partie +} + +Elapsed +{ +ecoule +} + +TimeLimit +{ +Limite de temps +} + +Remaining +{ +restant +} + +// HLTV +Spec_duck +{ +Appuyez sur "s'accroupir" pour le menu. +} + +SPECT_OPTIONS +{ +Options +} + +CAM_OPTIONS +{ +Options de la camera +} + +SpecMode5Text +{ +} + +OBS_MAP_FREE +{ +Apercu libre +} + +OBS_MAP_CHASE +{ +Apercu poursuite +} + +OBS_CHASE_FREE +{ +Camera de poursuite libre +} + +OBS_CHASE_LOCKED +{ +Camera de poursuite fixe +} + +OBS_IN_EYE +{ +Vue premiere personne +} + +OBS_ROAMING +{ +Camera libre +} + +// Official map locations +testlocation1 +{ +The translated refinery +} + +///////////// +// ns_bast // +///////////// +bastlocation_dockingbay +{ +Marine Start - Docking Bay 1 +} + +bastlocation_mainjunction +{ +Main Aft Junction +} + +bastlocation_cargolock +{ +Heavy Lock Door +} + +bastlocation_atmosphericprocessing +{ +Atmospheric Processing +} + +bastlocation_furnace +{ +Steam Generation +} + +bastlocation_watertreatment +{ +Water Treatment +} + +// NOTE: The hyphen in hive location names is important. Everything before the hyphen is trimmed off when displaying +// location names for aliens (the hive icons in the upper right of their HUD). Make sure to follow the convention: +// Hive Location - name +bastlocation_feedwatercontrol +{ +Hive Location - Feedwater Control +} + +bastlocation_trammaintenance +{ +Tram Maintenance +} + +bastlocation_tramtunnel +{ +Tram Tunnel +} + +bastlocation_lowerjunction +{ +Lower Junction +} + +bastlocation_Refinery +{ +Hive Location - Refinery +} + +bastlocation_emshaft +{ +EM Drill Shaft +} + +bastlocation_engineroom +{ +Hive Location - Engine Room +} + +bastlocation_dockinghydraulics +{ +Docking Hydraulics +} + +bastlocation_maintenancejunction +{ +Maintenance Junction +} + +bastlocation_ncorridor +{ +"N" Corridor +} + +bastlocation_observationbridge +{ +Observation Bridge +} + +bastlocation_starboardairlock +{ +Starboard Airlock +} + +bastlocation_portairlock +{ +Port Airlock +} + +bastlocation_maintenanceaccess +{ +Maintenance Access Duct +} + +bastlocation_pressureequalization +{ +Pressure Equalization Conduit +} + +bastlocation_starboardcorridor +{ +Aft Starboard Corridor +} + +bastlocation_filtration +{ +Feedwater Filtration Access +} + +bastlocation_ventilation +{ +Ventilation Conduit +} + +bastlocation_databank +{ +Databank Access +} + +bastlocation_enginecorridor +{ +Engine Corridor +} + +///////////// +// ns_hera // +///////////// +heralocation_archive +{ +Hive Location - Archiving +} + +heralocation_processingcorea +{ +Data Core Alpha +} + +heralocation_reception +{ +Hera Entrance and Reception +} + +heralocation_holoroom +{ +Central Monitoring - 'Holoroom' +} + +heralocation_storage +{ +General Cargo Storage +} + +heralocation_hanger +{ +Marine Start - Loading bay +} + +heralocation_docking +{ +Marine Start - Landing Pad +} + +heralocation_processing +{ +Processing +} + +heralocation_processingcoreb +{ +Hive Location - Data Core Delta +} + +heralocation_ventilation +{ +Hive Location - Ventilation 3-C +} + +heralocation_maintenence +{ +Maintenance +} + +heralocation_fogcorridor +{ +Maintenance Corridor +} + +heralocation_tube +{ +Hera Entrance Walkway +} + +// Nothing titles +nothinglocation_rr +{ +Space Station Nothing - Sub Sector 77 +} + +nothinglocation_ms +{ +Marine Start - S77 Vestibule +} + +nothinglocation_dock +{ +Docking Wing 01 +} + +nothinglocation_thres1 +{ +The Threshold +} + +nothinglocation_thres2 +{ +The Threshold +} + +nothinglocation_junc1 +{ +The Junction +} + +nothinglocation_junc2 +{ +The Junction +} + +nothinglocation_vent +{ +Ventilation Chamber +} + +nothinglocation_comm +{ +Communications Hub 063 +} + +nothinglocation_things +{ +Room With Things +} + +nothinglocation_cargo +{ +Hive Location - Cargo Bay Foyer +} + +nothinglocation_pipe +{ +Pipe Room +} + +nothinglocation_paint1 +{ +Painted Corridor +} + +nothinglocation_paint2 +{ +Painted Corridor +} + +nothinglocation_paint3 +{ +Painted Corridor +} + +nothinglocation_quada +{ +Quad Lift Area +} + +nothinglocation_quad +{ +Quad Lift +} + +nothinglocation_chamb +{ +Foreboding Antechamber +} + +nothinglocation_sas1 +{ +Silo Access South +} + +nothinglocation_sas2 +{ +Silo Access South +} + +nothinglocation_silo +{ +Hive Location - PowerSilo +} + +nothinglocation_san1 +{ +Silo Access North +} + +nothinglocation_san2 +{ +Silo Access North +} + +nothinglocation_mias1 +{ +Miasma Walkway +} + +nothinglocation_mias2 +{ +Miasma Walkway +} + +nothinglocation_mias3 +{ +Miasma Walkway +} + +nothinglocation_gen +{ +Generator Room +} + +nothinglocation_elev1 +{ +Elevator Shaft 01 +} + +nothinglocation_elev2 +{ +Elevator Shaft 02 +} + +nothinglocation_eek +{ +Intimidation +} + +nothinglocation_kismet +{ +Ominous Kismet +} + +nothinglocation_vae +{ +Viaduct Access East +} + +nothinglocation_vaw +{ +Viaduct Access West +} + +nothinglocation_viaduct +{ +Hive Location - The Great Viaduct +} + +// TANITH info_location data START +tanith_westenter +{ +Western Entrance +} + +tanith_marinebase +{ +Marine Start - Uplink Command +} + +tanith_outsidebase +{ +Exterior Access Paths +} + +tanith_north +{ +Northern Corridor +} + +tanith_sat +{ +External Satellite Relay +} + +tanith_satcomm +{ +Hive Location - Satellite Communications +} + +tanith_transport +{ +Chemical Transport Room +} + +tanith_cpu +{ +Computer Control +} + +tanith_acid +{ +Acidic Solution Processing +} + +tanith_reactor +{ +Reactor Room +} + +tanith_enter +{ +Eastern Entrance +} + +tanith_centerenter +{ +Central Entrance +} + +tanith_east +{ +East Access Tunnels +} + +tanith_research +{ +Research Labs +} + +tanith_rr +{ +Tanith Ready Room +} +tanith_waste +{ +Hive Location - Waste Handling +} + +tanith_central +{ +Central Access Tunnels +} + +tanith_storageenter +{ +Storage Entrance +} + +tanith_cargo +{ +Cargo Storage +} + +tanith_fusion +{ +Hive Location - Fusion Reactor +} + +tanith_west +{ +West Access Corridor +} +// TANITH info_location data END + + +// NANCY info_location data START +nancy_cargo +{ +Cargo Hold 2 +} + +nancy_aux +{ +Auxillary Command +} + +nancy_engine +{ +Port Engine Room +} + +nancy_crawl +{ +Sub-tunnel +} + +nancy_maint +{ +Maintenance Shaft +} + +nancy_shaft +{ +Maintenance Shaft +} + +nancy_mother +{ +Noname +} + +nancy_lockers +{ +Crew Lockers +} + +nancy_mess +{ +Mess Hall +} + +nancy_airlock +{ +Airlock Exchange +} + +nancy_port +{ +Port Airlock +} + +nancy_bridge +{ +Bridge +} + +nancy_cockpit +{ +Cockpit +} + +nancy_star +{ +Starboard Airlock +} + +nancy_gen +{ +Auxiliary Generators +} + +nancy_motherinter +{ +Mother Interface +} + +nancy_subspace +{ +Subspace Array Interface +} + +nancy_crew +{ +Crew Quarters +} +// NANCY info_location data END + +// CAGED info_location data START +caged_marine +{ +Marine Spawn - Main Hold +} + +caged_upsewer +{ +Upper Sewer +} + +caged_dsewer +{ +Lower Sewer +} + +caged_hive1 +{ +Hive Location - Sewer +} + +caged_hive2 +{ +Hive Location - Ventilation System +} + +caged_hive3 +{ +Hive Location - Generator +} + +caged_pure +{ +Purification Station 01 +} + +caged_central +{ +Central Processing +} + +caged_vaccess +{ +Ventilation Access +} + +caged_work +{ +Stability Monitoring +} + +caged_auxgen +{ +Auxiliary Generator +} + +caged_service +{ +Shipping Tunnels +} + +caged_area2 +{ +Upper Shipping Access +} +// CAGED info_location data END + +// Eclipse info_location... info. (BEGIN) +eclipse_dock +{ +Docking Control +} + +eclipse_marinespawn +{ +Marine Spawn - Cargo Transfer +} + +eclipse_station +{ +Station Access +} + +eclipse_stationeast +{ +Station Access East +} + +eclipse_stationalpha +{ +Station Access Alpha +} + +eclipse_stationwest +{ +Station Access West +} + +eclipse_triad +{ +Triad Generator Array +} + +eclipse_triadb +{ +Triad Access B +} + +eclipse_access1c +{ +Access Corridor 1C +} + +eclipse_access1b +{ +Access Corridor 1B +} + +eclipse_access1a +{ +Primary Access Corridor 1A +} + +eclipse_horseshoe +{ +The Horseshoe +} + +eclipse_tjunct +{ +T-Junction +} + +eclipse_keyhole +{ +The Keyhole +} + +eclipse_maint +{ +Hive - Maintenance Access +} + +eclipse_south +{ +South Loop +} + +eclipse_core +{ +Hive - Computer Core +} + +eclipse_northcore +{ +North Core Access +} + +eclipse_westcore +{ +West Core Access +} + +eclipse_subjunct +{ +Power Sub-Junction 3 +} + +eclipse_access1d +{ +Access Corridor 1D +} + +eclipse_commandnorth +{ +Command Access North +} + +eclipse_command +{ +Hive - Eclipse Command +} + +eclipse_genmon +{ +Primary Generator Monitors +} + +eclipse_commandsouth +{ +Command Access South +} + +eclipse_access1a +{ +Access Corridor 1A +} +// Eclipse info_location... info. (END) + + +// Veil info_location (START) + +veil_marine +{ +Marine Spawn - Mobile Command Interface +} + +veil_lifteast +{ +Lift 5 East +} + +veil_swhive +{ +Hive - Sub-Sector 5B Access +} + +veil_south +{ +Hive - Cargo Transfer South +} + +veil_southeast +{ +Hive - The Pipeline +} + +veil_overlook +{ +The Overlook +} + +veil_topography +{ +Topographical Analysis +} + +veil_nano +{ +NanoGrid Status +} + +veil_dome +{ +The Dome +} + +veil_y +{ +Y Junction +} + +veil_skylight +{ +West Skylights +} + +veil_satellite +{ +Satellite Feed +} + +veil_pod1 +{ +Monitoring Pod 1 +} + +veil_pod2 +{ +Monitoring Pod 2 +} + +veil_waypointing +{ +System Waypointing +} + +veil_nanoeast +{ +NanoGrid Access East +} + +veil_nanowest +{ +NanoGrid Access West +} + +veil_c12 +{ +Emergency Nozzle C-12 +} + +veil_junctionwest +{ +West Junction +} + +veil_junctioneast +{ +East Junction +} + +veil_power +{ +Power Core Status +} + +// Veil info_location (END) + + + +// Tutorial text +$position 0.15 0.15 +$effect 2 +$color 0 200 0 +$color2 0 255 0 +$fadein 0.04 +$fxtime 0.1 +$holdtime 6.0 +$fadeout 0.5 + +TutWelcome +{ +Welcome to Natural Selection Training. + +Here you will learn the basic rules of the game. + +Walk through a door to choose your training. +If you are a new to first-person shooters, marine +training is recommended. +} + +TutWelcomeMarineTraining +{ +You've chosen Marine training. Here you will +learn what it takes to be a Frontiersman and how +to fight the alien race. +} + +TutWelcomeAlienTraining +{ +You've chosen Alien training. Here you will +learn how to spread your influence throughout +the galaxy, and obliterate the human oppressors. +} diff --git a/main/gamma_tune.exe b/main/gamma_tune.exe new file mode 100644 index 00000000..35b5afb2 Binary files /dev/null and b/main/gamma_tune.exe differ diff --git a/main/german_titles.txt b/main/german_titles.txt new file mode 100644 index 00000000..4f8908b2 --- /dev/null +++ b/main/german_titles.txt @@ -0,0 +1,4338 @@ +//TITLES FOR NATURAL SELECTION +//DO NOT ALTER THIS FILE +// +//German translation by MZ.Mars, Ramses, and Nemesis Zero +// +// Position command $position x y +// x & y are from 0 to 1 to be screen resolution independent +// -1 means center in each dimension +// Effect command $effect +// effect 0 is fade in/fade out +// effect 1 is flickery credits +// effect 2 is write out (training room) +// Text color r g b command $color +// fadein time fadeout time / hold time +// $fadein (message fade in time - per character in effect 2) +// $fadeout (message fade out time) +// $holdtime (stay on the screen for this long) + +//////////////////// +// Green teletype // +//////////////////// +$position 0.15 0.15 +$effect 2 +$color 0 200 0 +$color2 0 255 0 +$fadein 0.04 +$fxtime 0.25 +$holdtime 6.0 +$fadeout 0.5 + +Team_AutoAssign +{ +Automatisch Zuteilen +} + +Menu_Spectate +{ +Zuschauen +} + +UndefinedTeam +{ +Ready Room +} + +Menu_LeaveGame +{ +Spiel verlassen. +} + +Menu_ReadyRoom +{ +Ready Room +} + +Menu_Marine1Team +{ +Marines +} + +Menu_Alien1Team +{ +Aliens +} + +Marine1Team +{ +Frontiersmen +} + +Alien1Team +{ +Kharaa +} + +Marine2Team +{ +Frontiersmen +} + +Alien2Team +{ +Kharaa +} + +AutoTeam +{ +Automatisch zugeteilt. +} + +Muted +{ +Muted +} + +Unmuted +{ +Unmuted +} + +No_longer_hear_that_player +{ +Dieser Spieler ist stummgeschaltet. +} + +// SDK 2.0 Spectator Menu +Spec_Map +{ +Map +} + +Spec_Mode1 +{ +Festgestellte Verfolgerkamera. +} + +Spec_Mode2 +{ +Freie Verfolgerkamera. +} + +Spec_Mode3 +{ +Freie Kamera. +} + +Spec_Mode4 +{ +First Person +} + +Spec_Mode5 +{ +Free Map Overview +} + +Spec_Mode6 +{ +Chase Map Overview +} + +Spec_NoTarget +{ +Keine gueltigen Ziele. Wechsel in Verfolgerkamera nicht moeglich. +} + +Spec_Help +{ +Druecke F4, um in den Ready Room zu gelangen. Benutze LINKS und RECHTS, SPRINGEN und FEUER, um durch die Perspektiven zu wechseln. +} + +Spec_Help_Text +{ +Use the following keys to change view styles: + + FIRE1 or RIGHT - Chase next player + POPUP-MENU or LEFT - Chase previous player + JUMP - Change view modes + USE - Change inset window mode + + DUCK - Enable spectator menu + +In Overview Map Mode move around with: + + MOVELEFT - move left + MOVERIGHT - move right + FORWARD - zoom in + BACK - zoom out + MOUSE - rotate around map/target +} + +Spec_Slow_Motion +{ +Slow Motion +} + +Spec_Replay +{ +Instant Replay +} + +Spec_Help2 +{ +Ihre Text-Nachrichten werden nur von anderen Zuschauern gesehen. +} + +Spec_Only_Help +{ +} + +Directed +{ +Directed +} + +SpectatorsNotAllowed +{ +Dieser Server erlaubt momentan keine Zuschauer. +} + +ObsInEyePrefix +{ +Viewing through eyes of +} + +SpectatorTeam +{ +Zuschauer +} + +Spectators +{ +Zuschauer +} + +TEAM +{ +Team +} + +TEAMS +{ +Teams +} + +PLAYER +{ +Spieler +} + +Player_plural +{ +Spieler +} + +PLAYERS +{ +Spieler +} + +SCORES +{ +Scores +} + +SCORE +{ +Score +} + +DEATHS +{ +Deaths +} + +LATENCY +{ +Ping +} + +VOICE +{ +Stimme +} + +Unassigned +{ +Nicht zugewiesen. +} + +Menu_OK +{ +OK +} + +Points +{ +Punkte +} + +Cost +{ +Kosten +} + +NoSpectating +{ +Zuschauer sind auf diesem Server nicht erlaubt. +} + +// Main game messages +ReadyRoomMessage +{ +Dies ist der 'Ready Room'. Mittels der Portale kann man einem Team beitreten oder das Spiel beobachten. +} + +ReinforcementMessage +{ +Respawn in Kuerze... +} + +ReinforcingMessage +{ +Respawn... +} + +ObserverMessage +{ +Zuschauer koennen einem laufenden Spiel nicht beitreten. +} + +CantSwitchTeamsInTournyMode +{ +Im Tournament-Modus ist der Teamwechsel waehrend eines laufenden Spiels verboten. +} + +CantSwitchTeamsAfterGameStart +{ +Nach Spielbeginn ist der Teamwechsel verboten. +} + +TooManyPlayersOnTeam +{ +In diesem Team sind schon zu viele Spieler. +} + +CantJoinAfterSpectating +{ +Zuschauer koennen einem laufenden Spiel nicht beitreten. +} + +CanOnlyJoinTeamYouveReinforced +{ +Nachdem man das andere Team gesehen hat, kann man bis zur naechsten Runde die Teams nicht wechseln. +} + +YouCanJoinSoon +{ +Teambeitritt in Kuerze... +} + +AlreadyOnTeam +{ +Teamwechsel ist nur vom Ready Room aus moeglich. +} + +SoldierMessage +{ +Sie sind ein Soldat. Versuchen Sie, den Befehlen des Commanders zu folgen und beschuetzen Sie Ihre Teamkameraden und Gebaeude vor dem Feind, koste es, was es wolle. +} + +ObjectivesVsAliens +{ +Sie bekaempfen die Aliens. Aliens werden bei den Hives geboren. Um das Spiel zu gewinnen, muessen Sie alle Hives und Aliens ausschalten. +} + +ObjectivesVsMarines +{ +Du bekaempfst die Marines! Die Marines werden durch Infanterieportale heruebertransportiert. Um das Spiel zu gewinnen, muessen alle Infanterieportale und Marines vernichtet werden. +} + +Handicap +{ +Handicap +} + +CommanderMessage +{ +Klicken Sie links oder ziehen Sie den Cursor bei gedrueckter linker Maustaste, um Spieler auszuwaehlen. Mit einem Rechtsklick auf einen Ort, eine Struktur, oder einen Spieler lassen sich Anweisungen vergeben. Klicken Sie auf die Minimap (links unten), um schnell zu anderen Teilen des Levels zu springen. Mit dem menu rechts unten koennen Sie Strukturen bauen und Ihre Soldaten ausruesten. +} + +Commander +{ +Commander +} + +NoCommander +{ +Kein Commander +} + +GestationMessage +{ +Du entwickelst Dich nun in eine andere Lebensform. Sei bereit zu schluepfen ... +} + +CocoonMessage +{ +You have been cocooned! +} + +YouAreReinforcements +{ +Sie wurden zur Verstaerkung gerufen! +} + +////////////// +// Pie menu // +////////////// +MenuMarineRoot +{ +Start +} + +//MenuMarineRoot +//{ +//!marinenode +//} + + +MenuComms +{ +Funk +} + +MenuTalk +{ +Reden +} + +MenuAttacked +{ +"Werde angegriffen!" +} + +MenuCheer +{ +Jubel +} + +MenuCoverMe +{ +"Deckt mich!" +} + +MenuRetreat +{ +"Rueckzug!" +} + +MenuInPosition +{ +"In Position!" +} + +MenuEnemySpotted +{ +"Feindkontakt." +} + +MenuMoveOut +{ +"Ausruecken!" +} + +MenuAllClear +{ +"Gebiet gesichert!" +} + +MenuYell +{ +Rufen +} + +MenuSay +{ +Sagen +} + +MenuRogerThat +{ +"Alles Klar!" +} + +MenuHello +{ +"Hallo" +} + +MenuNeedHelp +{ +"Hilfe!" +} + +MenuNeedHealth +{ +"Brauche Med-Pack" +} + +MenuNeedAmmo +{ +"Brauche Munition" +} + +MenuFollowMe +{ +"Folgt mir." +} + +MenuCovering +{ +"Decke..." +} + +MenuOrders +{ +Befehle +} + +MenuNeedOrder +{ +"Brauche Anweisungen." +} + +MenuAck +{ +"Bestaetigt." +} + +MenuAdmin +{ +Admin +} + +MenuReadyRoom +{ +Ready Room +} + +MenuVoteCommanderDown +{ +Commander abwaehlen. +} + +MenuArea +{ +Gebiet +} + +MenuMoveTo +{ +Gehe zu... +} + +MenuGuard +{ +Bewache +} + +MenuTarget +{ +Ziel +} + +MenuDeploy +{ +Einsetzen +} + +MenuIncoming +{ +Sie kommen. +} + +MenuProceed +{ +Ruecke vor. +} + +MenuFireTarget +{ +Feuer auf Ziel. +} + +MenuTaunt +{ +Spott +} + +MenuTakeCover +{ +Geh' in Deckung. +} + +MenuReady +{ +Bereit +} + +MenuDefendObj +{ +Verteidige +} + +MenuCeaseFire +{ +Feuer einstellen! +} + +MenuTeam +{ +Team +} + +MenuBuilding +{ +Bauen +} + +MenuAttackObj +{ +Angriff +} + +MenuTaunt +{ +Spott +} + +MenuHealth +{ +"Health" +} + +MenuCameraTower +{ +Kamera +} + +MenuTurret +{ +Turret +} + +MenuSiegeTurret +{ +Siege Turret +} + +MenuBlazeOfGlory +{ +Blaze +} + +MenuProtect +{ +Beschuetzen +} + +MenuReinforce +{ +Verstaerkung +} + +MenuArmorUpgrade +{ +Heavy +} + +MenuRepair +{ +Reparatur +} + +MenuPowerups +{ +Stim +} + +MenuAdrenaline +{ +Adrenalin +} + +MenuDefMatrix +{ +Def matrix +} + +MenuPhaseGate +{ +Phase Gate +} + +MenuSelf +{ +Ich +} + +MenuBuy +{ +Kaufen +} + +MenuHeavy +{ +Heavy +} + +MenuShotgun +{ +Shotgun +} + +MenuHeavyMG +{ +Heavy MG +} + +MenuLauncher +{ +Launcher +} + +MenuFlamer +{ +Flamer +} + +MenuNuke +{ +Nuke +} + +MenuWeapon +{ +Waffen +} + +MenuEquipment +{ +Equipment +} + +MenuUse +{ +Benutzen +} + +MenuNextWeapon +{ +Naechste Waffe +} + +MenuJetpacks +{ +Jet-Packs +} + +MenuReloadWeapon +{ +Nachladen +} + +MenuDropWeapon +{ +Fallen lassen +} + +MenuLight +{ +Licht +} + +MenuAmmo +{ +Munition +} + +MenuMines +{ +Minen +} + +MenuGrenades +{ +Granaten +} + +MenuUpgradeMG +{ +Upgrade +} + +//////////////////// +// Armor upgrades // +//////////////////// + +MenuArmorFull +{ +Volle Armor +} + +MenuBuyArmorHeavy +{ +Heavy Armor +} + +MenuBuyArmorMotionTrack +{ +Motion Tracking +} + +MenuBuyArmorJetpack +{ +Jet-Packs +} + +MenuBuyArmorLifeSupport +{ +Sustain +} + +// Rank +MenuRank +{ +Rang +} + +MenuPromote +{ +Befoerdern +} + +MenuDemote +{ +Degradieren +} + +////////////////////////////////////////////////// +// Don't localize these, they are sprite names: // +// (sprites/640(or 320)name.spr) // +////////////////////////////////////////////////// +MenuAlienRoot +{ +Start +} + +MenuAlienSmallMorph +{ +Lebensformen +} + +MenuAlienMorphLevel1 +{ +Skulk +} + +MenuAlienMorphLevel2 +{ +Gorge +} + +MenuAlienBigMorph +{ +Erweitert +} + +MenuAlienMorphLevel3 +{ +Lerk +} + +MenuAlienMorphLevel4 +{ +Fade +} + +MenuAlienMorphLevel5 +{ +Onos +} + +MenuAlienUpgrade +{ +Upgrades +} + +MenuAlienComm +{ +Kommunikation +} + +MenuAlienBuild +{ +Bauen +} + +MenuAlienAdvBuild +{ +Erweitert +} + +MenuAlienBuildUpgrades +{ +Upgrades +} + + +MenuAlienCommSayingsWest +{ +Rufen +} + +MenuAlienCommSayingOne +{ +Kichern +} + +MenuAlienCommSayingTwo +{ +Brauche Heilung. +} + +MenuAlienCommSayingThree +{ +Hilfe! +} + +MenuAlienCommSayingsEast +{ +Sagen +} + +MenuAlienCommSayingFour +{ +Eindringling! +} + +MenuAlienCommSayingFive +{ +Angriff! +} + +MenuAlienCommSayingSix +{ +Ich baue hier. +} + +// Temp artwork, change +MenuAlienReadyRoom +{ +Ready Room +} + +MenuAlienUpgradeDefOne +{ +Carapace +} + +MenuAlienUpgradeDefTwo +{ +Regenaration +} + +MenuAlienUpgradeDefThree +{ +Redemption +} + +MenuAlienUpgradeSenOne +{ +Cloaking +} + +MenuAlienUpgradeSenTwo +{ +Pheromones +} + +MenuAlienUpgradeSenThree +{ +Scent of Fear +} + +MenuAlienUpgradeMoveOne +{ +Celerity +} + +MenuAlienUpgradeMoveTwo +{ +Adrenaline +} + +MenuAlienUpgradeMoveThree +{ +Silence +} + +MenuAlienDefenseChamber +{ +Defense Chamber +} + +MenuAlienSensoryChamber +{ +Sensory Chamber +} + +MenuAlienMovementChamber +{ +Movement Chamber +} + +MenuAlienDefenseUpgrades +{ +Defensive +} + +MenuAlienSensoryUpgrades +{ +Sensory +} + +MenuAlienMovementUpgrades +{ +Movement +} + +MenuAlienOffensiveChamber +{ +Offensive Chamber +} + +MenuAlienResourceTower +{ +Resource Tower +} + +MenuAlienHive +{ +Hive +} + +//*// +// Armor received messages +$position -1 0.2 +$effect 0 +$fadein 0.5 +$fadeout 0.5 +$holdtime 5.0 + +ReceiveHeavyArmor +{ +Ihre Ausruestung wurde zur 'Heavy Armor' verbessert. Sie sind nun besser gepanzert. +} + +ReceiveMotionTrackArmor +{ +Ihnen wurde nun einen Motion-Tracker in die Ruestung integriert. +} + +ReceiveJetpackArmor +{ +Sie besitzen nun einen Jet-Pack. Druecken und halten Sie die SPRUNG-Taste, um ihn zu aktivieren. +} + +ReceiveLifeSupportArmor +{ +Du hast nun ein LifeSupport (TM) System. Wenn du kurz vor dem Tode bist, wirst du geschuetzt sein bis Hilfe eintrifft. +} + + + +$position -1 0.35 +$holdtime 3.0 + +GameStarting +{ +Das Spiel beginnt in Kuerze... +} + +$holdtime 2.0 +GameBegun +{ +Das Spiel hat begonnen. +} + +// Overwatch enabled +//OverwatchActive +//{ +//Overwatch active +//} + +// Overwatch range string, expecting a float for range +OverwatchRange +{ +Target range: %f +} + +// Points awarded +$position -1 0.25 +$effect 0 +$holdtime 4 + +MarineAward +{ +Ihr Team eliminierte einen Gegner! +} + +MarineAwardToLeader +{ +Ihr Squad erhielt Punkte fuer die Eliminierung eines Gegners! +} + +// Points awarded +$position -1 0.15 +$effect 0 +$holdtime 3 +MarineAwardToCommander +{ +Ihr Team verdiente sich Punkte durch die Beseitigung eines Gegners! +} + +// Points awarded +$position -1 0.25 +$effect 0 +$holdtime 4 +AlienAward +{ +Der Tod dieses Gegners brachte Dir Resourcen ein! +} + +Defect +{ +Squad verlassen +} + +WeaponCantBeDropped +{ +Diese Waffe kann nicht abgelegt werden. +} + +SquadIndicator +{ +Sie sind in Squad %d +} + +DefectMessageToLeader +{ +Ein Spieler hat Ihren Squad verlassen. +} + +InvalidOrderGiven +{ +Ungueltiger Befehl. +} + +$position -1 0.65 +$effect 0 +$holdtime .5 +$fadein .2 +$fadeout .2 +GameWontStart +{ +Das Spiel beginnt erst, wenn beide Teams Spieler haben. +} + +// Translation note: don't translate "ready" +GameWontStartUntilReady +{ +Das spiel wird nicht beginnen, bevor beide Teams "ready" eingeben. +} + +$position -1 0.75 +$effect 0 +$holdtime .7 +$fadein .2 +$fadeout .2 +ReceivingLevelData +{ +Empfange Level-Daten... +} + +$position -1 0.85 +ReceivingLevelData1 +{ ++--- +} + +ReceivingLevelData2 +{ +++-- +} + +ReceivingLevelData3 +{ ++++- +} + +ReceivingLevelData4 +{ +++++ +} + +$position -1 0.65 +$effect 0 +$holdtime .5 +$fadein .2 +$fadeout .2 +$position -1 0.9 +EvolvingMessage +{ +Entwicklungsphase... +} + +VoteCast +{ +Ihre Stimme wurde gezaehlt. +} + +VoteStarted +{ +Eine Abstimmung zur Abloesung des Commanders wurde gestartet. Wenn der Commander den Spielverlauf stoert, koennen Sie mithilfe des Pop-Up menus fuer seine Entlassung stimmen. +} + +VoteIllegal +{ +Zu diesem Zeitpunkt ist eine Abstimmung unzulaessig. +} + + +AlreadyVoted +{ +Sie koennen nur einmal pro Runde abstimmen. +} + +VoteFailed +{ +Die Abstimmung gegen den Commander war nicht erfolgreich. +} + +VoteCancelled +{ +Die Abstimmung wurde abgebrochen. +} + +VoteSucceeded +{ +Der Commander wurde abgewaehlt. +} + +BannedFromCommand +{ +Ihnen ist vorruebergehend das Kommandieren auf diesem Server verboten worden. Viele Server heben ein solches Verbot nach einigen Stunden auf. +} + +MustGestateUp +{ +Du kannst dich nur in hoehere Lebensformen entwickeln. +} + +MustGestateOnGround +{ +Du musst auf flachem Boden stehen, um die Entwicklung einzuleiten. +} + +NotWhileDigesting +{ +Du kannst waehrend der Verdauung eines Gegners keine Entwicklung in eine andere Lebensform einleiten. +} + +NoReadyRoomWhileDigested +{ +Du kannst nicht in den Ready Room, solange Du einen Marine verdaust. +} + +NeedMoreRoomToGestate +{ +Du brauchst mehr Platz fuer die Entwicklung. +} + +NeedOneHiveToGestate +{ +Dein Team benoetigt einen Hive, um diese Lebensform zu entwickeln. +} + +NeedTwoHivesToGestate +{ +Dein Team benoetigt zwei Hives, um diese Lebensform zu entwickeln. +} + +NeedThreeHivesToGestate +{ +Dein Team benoetigt drei Hives, um diese Lebensform zu entwickeln. +} + +NeedOneHiveForStructure +{ +Dein Team benoetigt einen Hive, um diese Struktur zu errichten. +} + +NeedTwoHivesForStructure +{ +Dein Team benoetigt zwei Hives, um diese Struktur zu errichten. +} + +NeedThreeHivesForStructure +{ +Dein Team benoetigt drei Hives, um diese Struktur zu errichten. +} + +NeedsAnotherHiveForStructure +{ +Dein Team braucht einen weiteren Hive, um diese Struktur zu errichten. +} + +MustBeBuilder +{ +Du must ein Gorge sein, um diese Struktur zu errichten. +} + +UpgradeNotAvailable +{ +Dieses Upgrade ist momentan nicht verfuegbar. +} + +TooManyStructuresOfThisTypeNearby +{ +Es sind zu viele Strukturen dieses Typs in der Naehe. +} + +TooManyStructuresInArea +{ +Es sind zu viele Strukturen in der Naehe. +} + +$holdtime 2.0 +TooManyWebs +{ +Dein Team hat die maximal zulaessige Anzahl an Webs erreicht. +} + +TooManyWebsNearby +{ +Es sind zuviele Webs in diesem Bereich. +} + +$position -1 0.35 +$effect 0 +$holdtime 5.0 +TeamOneWon +{ +Team Eins hat gewonnen! +} + +TeamTwoWon +{ +Team Zwei hat gewonnen! +} + +GameDraw +{ +Unendschieden! +} + +RankBeforeGameStart +{ +Du kannst nur vor dem Start des Spiels den Rang aendern. +} + +DefectAfterGameStart +{ +Du kannst erst nach Spielbeginn ueberlaufen. +} + +// Tech tree +MarineResourcePrefix +{ +Team-Resourcen: +} + +AlienResourcePrefix +{ +Resourcen: +} + +CarryResourcePrefix +{ +Traegt %d Resourcen. +} + +Resources +{ +Resourcen: +} + + +NumericalEventResources +{ +Resourcen +} + +NumericalEventHealth +{ +Health +} + +NumericalEventResourcesDonated +{ +Resourcen gespendet +} + +NumericalEventAmmo +{ +Ammo erhalten +} + + + + +AlienEnergyDescription +{ +Energie +} + +ResourcesDepleted +{ +Resourcen erschoepft. +} + +Reinforcements +{ +Verstaerkung +} + + +WeaponCategory +{ +Waffen +} + +ArmorCategory +{ +Armor +} + +BuildCategory +{ +Bauen +} + +RadioCategory +{ +Funk +} + +TechNodeLabel_0 +{ +keine +} + +TechNodeHelp_0 +{ + +} + +TechNodeHelp_1 +{ +Wechselt zur naechsten Waffe. +} + +TechNodeHelp_2 +{ +Laedt die aktive Waffe nach. +} + +TechNodeHelp_3 +{ +Laesst Ihre aktive Waffe fallen, um schneller zu werden, oder um sie jemand Anderem zu geben. +} + +TechNodeHelp_5 +{ +Verlaesst das Spiel und bringt Sie zurueck zum Ready Room. Dort koennen Sie das Team wechseln, Zuschauer werden, oder einfach nur eine Pause einlegen. +} + +TechNodeHelp_6 +{ +Falls der Commander mit Absicht versucht, das Spiel zu ruinieren, koennen Sie Ihn mit dieser Abstimmung von seinem Posten verbannen. Wenn genug Stimmen zusammenkommen, wird er fuer den Rest des Spieles suspendiert. +} + + +TechNodeLabel_10 +{ +Angegriffen +} + +TechNodeLabel_11 +{ +Attacke +} + +TechNodeLabel_12 +{ +Zerstoeren +} + +TechNodeLabel_13 +{ +Bestaetigt +} + +TechNodeLabel_14 +{ +Focus Team +} + +TechNodeLabel_15 +{ +maechtig +} + + +TechNodeHelp_7 +{ +"Kichern" +} + +TechNodeHelp_8 +{ +"Brauche Heilung." +} + +TechNodeHelp_9 +{ +"Brauche Hilfe." +} + +TechNodeHelp_10 +{ +"Eindringling." +} + +TechNodeHelp_11 +{ +"ANGRIFF" +} + +TechNodeHelp_12 +{ +"Ich baue hier." +} + + + +TechNodeLabel_20 +{ +Armor #1 +} + +TechNodeLabel_21 +{ +Armor #2 +} + +TechNodeLabel_22 +{ +Armor #3 +} + +TechNodeLabel_23 +{ +Waffen #1 +} + +TechNodeLabel_24 +{ +Waffen #2 +} + +TechNodeLabel_25 +{ +Waffen #3 +} + +TechNodeHelp_20 +{ +Stufe 1 - Armorverbesserung. +} + +TechNodeHelp_21 +{ +Stufe 2 - Armorverbesserung. +} + +TechNodeHelp_22 +{ +Stufe 3 - Armorverbesserung. +} + + +TechNodeHelp_23 +{ +Waffen, Minen, Turrets fuegen +10% Schaden zu. +} + +TechNodeHelp_24 +{ +Waffen, Minen, Turrets fuegen +20% Schaden zu. +} + +TechNodeHelp_25 +{ +Waffen, Minen, Turrets fuegen +30% Schaden zu. +} + +TechNodeLabel_26 +{ +Advanced Turret Factory. +} + +TechNodeHelp_26 +{ +Upgrade zur Advanced Turret Factory. +} + +TechNodeLabel_28 +{ +Jet-Packs +} + +TechNodeHelp_28 +{ +Ermoeglicht Jet-Pack Module. +} + +TechNodeLabel_29 +{ +Heavy Armor +} + +TechNodeHelp_29 +{ +Ermoeglicht Heavy Armor. +} + +TechNodeLabel_30 +{ +Distress Beacon +} + +TechNodeHelp_30 +{ +Laesst alle toten Marines am Startpunkt wiedererscheinen. +} + +TechNodeLabel_31 +{ +Feldmedizinische Technologie. +} + +TechNodeHelp_31 +{ +Ermoeglicht es dem Commander, Healthpacks auszugeben. +} + +TechNodeLabel_32 +{ +Abbrechen. +} + +TechNodeHelp_32 +{ +Forschung abbrechen. +} + +TechNodeLabel_33 +{ +Motion-Tracking +} + +TechNodeHelp_33 +{ +Alle sich bewegenden Feinde werden sichtbar. +} + +TechNodeLabel_34 +{ +Phase Tech +} + +TechNodeHelp_34 +{ +Ermoeglicht Scans und die Errichtung von Phasegates. +} + +TechNodeLabel_35 +{ +Upgrade Tower +} + +TechNodeHelp_35 +{ +Verbessert Resourcen-Foerderungsrate +} + +TechNodeLabel_36 +{ +Electrical defense +} + +TechNodeHelp_36 +{ +Schockt nahe Gegner. +} + +TechNodeLabel_38 +{ +Heavy Armor +} + +TechNodeHelp_38 +{ +Gibt Heavy Armor an die Soldaten aus. +} + +TechNodeLabel_39 +{ +Jet-Pack +} + +TechNodeHelp_39 +{ +Gibt einem Soldaten einen Jet-Pack. +} + +TechNodeLabel_40 +{ +Infanterie-Portal +} + +TechNodeHelp_40 +{ +Startportal der Soldaten +} + +TechNodeLabel_41 +{ +Resource Tower +} + +TechNodeHelp_41 +{ +Foerdert Resourcen. +} + + + +TechNodeLabel_43 +{ +Turret Factory +} + +TechNodeHelp_43 +{ +Ermoeglicht Geschuetztuerme (Turrets). +} + +TechNodeLabel_45 +{ +Arms Lab +} + +TechNodeHelp_45 +{ +Entwickelt Waffen und Ruestungserweiterungen. +} + +TechNodeLabel_46 +{ +Prototype Lab +} + +TechNodeHelp_46 +{ +Experimentelle Technologien +} + +TechNodeLabel_48 +{ +Armory +} + +TechNodeHelp_48 +{ +Zugriff auf neue Waffensysteme. +} + +TechNodeLabel_49 +{ +Advanced Armory +} + +TechNodeHelp_49 +{ +Upgrade zur Advanced Armory +} + + +TechNodeLabel_50 +{ +Nuke Anlage +} + +TechNodeHelp_50 +{ +Ermoeglicht Nuke Konstruktion. +} + +TechNodeLabel_51 +{ +Observatorium +} + +TechNodeHelp_51 +{ +Aufklaerungs-Technologien +} + +TechNodeLabel_52 +{ +Health nanotech +} + +TechNodeHelp_52 +{ +Ermoeglicht es dem Commander, Healthpacks auszugeben. +} + +TechNodeLabel_53 +{ +Scanner Sweep +} + +TechNodeHelp_53 +{ +Erlaubt kurzzeitigen Einblick in ein Gebiet und enthuellt getarnte Gegner. +} + +TechNodeLabel_55 +{ +Phase Gate +} + +TechNodeHelp_55 +{ +Lichtschneller Transporter. +} + +TechNodeLabel_56 +{ +Turret +} + +TechNodeHelp_56 +{ +Errichtet ein Turret. +} + +TechNodeLabel_57 +{ +Siege Turret +} + +TechNodeHelp_57 +{ +Hochleistungs-Schallwellen-Geschuetz mit enormer Druckwelle. +Kann durch Waende schiessen. +} + +TechNodeLabel_58 +{ +Command Console +} + +TechNodeHelp_58 +{ +Eine Aushilfsconsole. +} + + + +TechNodeLabel_59 +{ +Health +} + +TechNodeHelp_59 +{ +Gibt einem Marine 50 Gesundheitspunkte. +} + +TechNodeLabel_60 +{ +Ammo +} + +TechNodeHelp_60 +{ +Ein Magazin fuer jede beliebige Waffe. +} + + + +TechNodeLabel_61 +{ +Minen +} + +TechNodeHelp_61 +{ +Fuenf Minen +} + +TechNodeLabel_62 +{ +Welder (Schweissbrenner) +} + +TechNodeHelp_62 +{ +Repariert Strukturen und Armor, beeinflusst schweissbare Stellen und verbrennt Netze. +} + +TechNodeLabel_63 +{ +Med Kit +} + +TechNodeLabel_64 +{ +Shotgun +} + +TechNodeHelp_64 +{ +Fuer den Nahkampf +} + +TechNodeLabel_65 +{ +HMG +} + +TechNodeHelp_65 +{ +Hochleistungs-Sturmgewehr. +} + +TechNodeLabel_66 +{ +Grenade Launcher +} + +TechNodeHelp_66 +{ +Grenade Launcher +} + +TechNodeLabel_67 +{ +Nuke +} + +TechNodeHelp_67 +{ +Ablegbare Mini-Atombombe +} + +TechNodeLabel_69 +{ +Recyceln +} + +TechNodeHelp_69 +{ +Zerstoert diese Struktur und erstattet etwas von den Resourcen zurueck. +} + +TechNodeHelp_80 +{ +Bittet Ihren Commander um Anweisungen. Der Commander wird benachrichtigt, dass Sie etwas unternehmen wollen und kann Ihnen Befehle erteilen. +} + +TechNodeHelp_81 +{ +Teilt Ihrem Commander mit, dass Sie seine Anweisungen verstanden haben. Bewegen Sie sich nun zu Ihrem momentanen Waypoint, um Ihre Befehle auszufuehren. Wenn der Auftrag ausgefuehrt wurde, wird der Waypoint verschwinden. +} + + + +TechNodeLabel_85 +{ +Bauen +} + +TechNodeHelp_85 +{ +Grundlegendes Aufbaumenu. +} + +TechNodeLabel_86 +{ +Erweitert +} + +TechNodeHelp_86 +{ +Fortgeschrittenes Aufbaumenu. +} + +TechNodeLabel_87 +{ +Beistand +} + +TechNodeHelp_87 +{ +Unterstuetzungsmenu +} + +TechNodeLabel_88 +{ +Ausruesten +} + +TechNodeHelp_89 +{ +Zurueck zum Hauptmenu (ESC) +} + +TechNodeHelp_90 +{ +Erstellt einen Resource Tower: Er sammelt Resourcen. Kann nur auf einer 'Resource Node' (erkennbar an dem weissen Ausstoss) plaziert werden. +} + +TechNodeHelp_91 +{ +Erstellt eine Offense Chamber: Organisches Geschuetz, das feindliche Spieler und Gebaeude angreift. Schaden: 20 +} + +TechNodeHelp_92 +{ +Erstellt eine Defense Chamber: Ermoeglicht Defensiv-Upgrades, heilt Spieler und Strukturen. +} + +TechNodeHelp_93 +{ +Erstellt eine Sensory Chamber: Ermoeglicht dem Team Sensor-Upgrades, tarnt befreundete Einheiten und Strukturen im Umkreis. Blockiert Motion-Tracking +} + +//Hinweis an die Uebersetzer: Hier bin ich aktueller als Flayras Version. Lasst's bitte so. +TechNodeHelp_94 +{ +Erstellt eine Movement Chamber: Ermoeglicht Bewegungs-Updates, teleportiert Aliens zum entferntesten oder zu einem gerade angegriffenen Hive. Regeneriert die Energie naher Aliens. +} + +TechNodeHelp_95 +{ +Erstellt einen Hive: Ermoeglicht hoehere Lebensformen und Faehigkeiten. Kann nur in einer 'Hive Location' erstellt werden. +} + +//Und zum Zweiten... +TechNodeHelp_101 +{ +Verbessert deine Panzerung. Jeder Level absorbiert 20% mehr Schaden. +} + +TechNodeHelp_102 +{ +Du heilst Dich Stueck fuer Stueck selbst . Hoehere Level beschleunigen Deine Heilung. +} + +TechNodeHelp_103 +{ +Der Hive wird versuchen, dich vor dem Tode zu retten, indem du zur Heilung zu ihm zurueckteleportiert wirst. +} + +TechNodeHelp_104 +{ +Schaerfe - Dein Nahkampfwaffenschaden ist um die Haelfte gesteigert. +} + +TechNodeHelp_105 +{ +Piercing - Dein Fernwaffenschaden ist um die Haelfte gesteigert. +} + +TechNodeHelp_106 +{ +Penetration - Schiesst durch Waende und Ziele (nicht funktionsfaehig) +} + +TechNodeHelp_107 +{ +Erhoeht Deine Maximalgeschwindigkeit dauerhaft. +} + +TechNodeHelp_108 +{ +Regeneriert deine Energie schneller. Jeder Level erhoeht die Regenerationsrate um 33%. +} + +TechNodeHelp_109 +{ +Jeder Level daempft deinen Geraeusch-Pegel, bis du schliesslich lautlos bist. +} + +TechNodeHelp_110 +{ +Ruhiges Stillstehn macht Dich fast unsichtbar. Jeder Level verkuerzt die Zeit vor Einsetzen der Tarnung. +} + +TechNodeHelp_111 +{ +Feindliche Spieler hinterlassen eine sichtbare Spur. Hoehere Levels verbessern die Reichweite. +} + +TechNodeHelp_112 +{ +Deine Hive Sight zeigt Dir alle Feinde in einem bestimmten Umkreis an. +} + +TechNodeHelp_113 +{ +Entwicklung zum Skulk. Dies ist eine schnelle, kleine Kreatur, die sich am besten fuer Guerilla-Taktiken eignet. Kann an Waenden und Decken laufen (mit 'DUCKEN' deaktivierbar). +} + +TechNodeHelp_114 +{ +Entwicklung zum Gorge. Erschafft und entwickelt Resource Towers, Hives, Upgrade – und Offensive Chambers. Schwach in der Schlacht, kann aber befreundete Spieler und Strukturen heilen +} + +TechNodeHelp_115 +{ +Entwicklung zum Lerk. Ermoeglicht vielseitige Kampfunterstuetzung. Er besitzt fernkampffaehige Spikes, sich ausbreitende Spore- und schuetzende Umbra-Wolken. Durch Druck auf die "Sprung"-Taste kannst Du fliegen. Halte die "Sprung"-Taste gedrueckt, um zu gleiten. +} + +TechNodeHelp_116 +{ +Entwicklung zum Fade. Ein maechtiger Kaempfer mit gewaltigen Klauen, 'Acid Rocket' Angriff und Teleportation. +} + +TechNodeHelp_117 +{ +Entwicklung zum Onos. Gigantisches Alien, das seine Gegner durch Stampfen laehmen, durch feindliche Reihen stuermen, und Gegner verschlingen kann. Dieses Alien kann es mit mehreren Gegnern geleichzeitig aufnehmen. +} + + +ClassDead +{ +Dead +} + +ClassDigesting +{ +Verdaut +} + +ClassCommander +{ +Commander +} + +ClassHeavyMarine +{ +Heavy +} + +ClassReinforcing +{ +Rein +} + +ClassLevel1 +{ +Skulk +} + +ClassLevel2 +{ +Gorge +} + +ClassLevel3 +{ +Lerk +} + +ClassLevel4 +{ +Fade +} + +ClassLevel5 +{ +Onos +} + +ClassGestating +{ +Gestating +} + + +Building +{ +Im Bau: +} + + +Researching +{ +In der Entwicklung: +} + +Energy +{ +Energie: +} + +Prerequisite +{ +Benoetigt: +} + +Cost +{ +Kosten: +} + +NotFullyBuilt +{ +Nicht vollstaendig gebaut +} + +Recycling +{ +Wird recycelt... +} + +ReinforcementsText +{ +Verstaerkungen: +} + +LogoutText +{ +LOG OUT +} + +BlipStatus_0 +{ +Feind +} + +BlipStatus_1 +{ +Geschwaechter Feind. +} + +BlipStatus_2 +{ + +} + +BlipStatus_3 +{ +Wird angegriffen. +} + +BlipStatus_5 +{ +ist ein Gorge. +} + +BlipStatus_6 +{ + +} + +BlipStatus_7 +{ + +} + +BlipStatus_8 +{ + +} + +Friend +{ +Freund +} + +Enemy +{ +Feind +} + +User3Name_1 +{ +Soldat +} + +User3Name_2 +{ +Commander +} + +User3Name_3 +{ +Skulk +} + +User3Name_4 +{ +Gorge +} + +User3Name_5 +{ +Lerk +} + +User3Name_6 +{ +Fade +} + +User3Name_7 +{ +Onos +} + +User3Name_8 +{ +Embryo +} + +User3Name_15 +{ +Ausruestung +} + +User3Name_17 +{ +Hive +} + +User3Desc_17 +{ +Aliens werden hier geboren, ermoeglicht den Zugang zu hoeheren Lebensformen und Upgrades. +} + +User3FriendlyDesc_17 +{ +Du startest hier. Der Hive wird Dich heilen, wenn Du in der Naehe bist. Er eroeffnet Dir die "Hive Sight", welche Freunde, Feinde und Warnhinweise anzeigt. Verteidige die Hives um jeden Preis. +} + +User3Name_22 +{ +Resource Nozzle +} + +User3Desc_22 +{ +Foerdert Resourcen, wenn ein Resource Tower auf ihr gebaut ist. Diese Resourcen sind unerschoepflich. +} + +User3CommanderDesc_22 +{ +Foerdert Resourcen, wenn ein Resource Tower auf ihr gebaut ist. Diese Resourcen sind unerschoepflich. +} + +User3Name_23 +{ +Command Console +} + +User3Desc_23 +{ +Wird vom Commander der Marines benutzt, um Strukturen zu errichten und neue Technologien zu erforschen. +} + +User3FriendlyDesc_23 +{ +Wird vom Commander der Marines benutzt, um Strukturen zu errichten und neue Technologien zu erforschen. Ihr Commander wird in der oberen Mitte des Bildschirms angezeigt. Hat Ihr Team keinen Commander, so koennen Sie diese Rolle uebernehmen, indem Sie sich zur Command Console begeben und die BENUTZEN-Taste druecken. +} + +User3CommanderDesc_23 +{ +Waehlen Sie die Command Console aus, um zu sehen, wo Sie Infanterie-Portale errichten koennen. Ist die Command Console zerstoert, koennen Sie nicht mehr auf das Commander-Interface zugreifen. Beschuetzen Sie daher die Command Console um jeden Preis. +} + +User3Name_24 +{ +Turret Factory +} + +User3Desc_24 +{ +Ermoeglicht die Errichtung von Sentry Turrets in Reichweite. Turrets brauchen eine intakte Turret Factory, um weiterhin zu funktionieren. Waehlen Sie die Turret Factory an, um ihre Reichweite zu sehen. +} + +User3Name_25 +{ +Armory +} + +User3Desc_25 +{ +Spendet Munition und ermoeglicht die Ausgabe von Shotguns, Minen und Weldern innerhalb ihrer Reichweite. +} + +User3CommanderDesc_25 +{ +Spendet Munition und ermoeglicht die Konstruktion von Shotguns, Minen und Weldern innerhalb ihrer Reichweite. Waehlen Sie die Armory aus, um sich deren Reichweite anzeigen zu lassen. +} + +User3FriendlyDesc_25 +{ +"Benutzen" Sie die Armory, um kostenlose Munition fuer Ihre aktive Waffe zu erhalten. Ermoeglicht ausserdem die Ausgabe von Shotguns, Minen und Weldern in ihrer Umgebung. +} + + +User3Name_26 +{ +Advanced Armory +} + +User3Desc_26 +{ +Spendet Munition und erlaubt die Ausgabe von Heavy Machine Guns und Grenade Launchers in ihrem Umkreis. +} + +User3CommanderDesc_26 +{ +Spendet Munition an befreundete Soldaten. Erlaubt die Ausgabe von Heavy Machine Guns und Grenade Launchers in ihrem Umkreis. Waehlen Sie die 'Advanced Armory' aus, um sich ihre Reichweite anzeigen zu lassen +} + +User3FriendlyDesc_26 +{ +"Benutzen" Sie die Advanced Armory um kostenlose Munition fuer Ihre aktive Waffe zu erhalten. Ermoeglicht ausserdem die Ausgabe von Heavy Machine Guns und Grenade Launchers in ihrer Umgebung. +} + +User3Name_27 +{ +Arms Lab +} + +User3Desc_27 +{ +Ermoeglicht Zugriff auf Armor- und Waffen-Upgrades. +} + +User3Name_28 +{ +Prototype Lab +} + +User3Desc_28 +{ +Ermoeglicht die Entwicklung von Jet-Packs und Heavy Armor. +} + +User3Name_29 +{ +Observatorium +} + +User3Desc_29 +{ +Beobachtet die naehere Umgebung und enttarnt Feinde in seiner Reichweite. Ermoeglicht den Zugang zum Scanner Sweep, Motion-Tracking und das Absetzen eines Notsignals ('Distress Beacon'). +} + +User3Name_30 +{ +Chemlab +} + +User3Name_31 +{ +Medlab +} + +User3Desc_32 +{ +Ermoeglicht die Konstruktion von Baby Nuke Atombomben die durch den Commander gelegt werden koennen und automatisch, falls sie nicht zerstoert werden, nach ein paar Sekunden explodieren. +} + +User3Name_33 +{ +Sentry Turret +} + +User3Desc_33 +{ +Feuert automatisch auf in der Naehe befindliche Feinde. +} + +User3FriendlyName_33 +{ +Feuert automatisch auf feindliche Lebensformen und Gebaeude. Schwach gegen hoeher entwickelte oder aufgeruestete Aliens. Muss in Reichweite einer Turret Factory stehen, um zu funktionieren. Schaden: 10 +} + +User3CommanderName_33 +{ +Feuert automatisch auf feindliche Lebensformen und Gebaeude. Schwach gegen hoeher entwickelte oder aufgeruestete Aliens. Muss in Reichweite einer Turret Factory stehen, um zu funktionieren. Waehlen Sie das Turret aus, um seine Reichweite zu sehen. Kann keine getarnten Feinde erfassen. Wirkungsvoll gegen niedrigstufige Aliens. Schaden: 23 +} + +User3Name_34 +{ +Siege Cannon +} + +User3Desc_34 +{ +Automatische Siege Cannon (ASC). Schall-Waffe fuer den Einsatz gegen Gebaeude, die selbst durch massive Waende schiessen kann, allerdings keine Spieler direkt verletzt. Kann nur gesichtete Ziele angreifen. +Reichweite: 400 Schaden: 165 (Doppelt bei Gebaeuden) +} + +User3FriendlyDesc_34 +{ +Automatische Siege Cannon (ASC). Schall-Waffe fuer den Einsatz gegen Gebaeude, die selbst durch massive Waende schiessen kann, allerdings keine Spieler direkt verletzt. Kann nur gesichtete Ziele angreifen. +Reichweite: 400 Schaden: 165 (verdoppelt gegen Gebaeude) +} + +User3CommanderDesc_34 +{ +Automatische Siege Cannon (ASC). Schall-Waffe fuer den Einsatz gegen Gebaeude, die selbst durch massive Waende schiessen kann, allerdings keine Spieler direkt verletzt. Waehlen Sie das ASC aus, um seine Reichweite zu sehen (es kann alles im gruenen Bereich erfassen, soweit ein Marine oder Scanner Sweep es sichtbar machen). +Reichweite: 400 Schaden: 165 (verdoppelt gegen Gebaeude) +} + + +User3Name_35 +{ +Resource Tower +} + +User3Desc_35 +{ +Foerdert in regelmaessigen Abstaenden Resourcen. +} + +User3Name_37 +{ +Infanterie-Portal +} + +User3FriendlyDesc_37 +{ +Bringt Soldaten an die Front. Ohne das Infanterie-Portal koennen keine TSA-Soldaten wiedererscheinen, also bewachen Sie es, so gut es geht. +} + +User3FriendlyDesc_37 +{ +Bringt Soldaten an die Front. Ohne das Infanterie-Portal koennen keine TSA-Soldaten wiedererscheinen, also bewachen Sie es, so gut es geht. +} + +User3CommanderDesc_37 +{ +Bringt Soldaten an die Front. Ohne das Infanterie-Portal koennen keine TSA-Soldaten wiedererscheinen. +} + +User3Name_38 +{ +Nuke +} + +User3Desc_38 +{ +Nuke (Atombombe) macht sich scharf und muss bevor sie zuendet zerstoert werden! Einmal scharf explodiert die Nuke (Atombombe) mit massiven Schaden fuer Spieler und Strukturen in ihrer Naehe. +} + +User3FriendlyDesc_38 +{ +Nuke (Atombombe) macht sich scharf, verdeidigen Sie sie bis zum Abschluss. Ein mal scharf explodiert die Nuke (Atombombe) mit massivem Schaden fuer Spieler und Strukturen in ihrer Naehe. +} + +User3CommanderDesc_38 +{ +Nuke (Atombombe) macht sich scharf, verdeidigen Sie sie bis zum Abschluss. Ein mal scharf explodiert die Nuke (Atombombe) mit massivem Schaden fuer Spieler und Strukturen in ihrer Naehe. +} + +User3Name_39 +{ +Heavy Armor +} + +User3Desc_39 +{ +Aufnehmen, um Heavy Armor zu erhalten. Kann nicht zusammen mit dem Jet-Pack benutzt werden. Schuetzt vor Sporen. +} + +User3Name_40 +{ +Jet-Pack +} + +User3Desc_40 +{ +Aufnehmen, um den Jet-Pack nutzen zu koennen. Kann nicht mit der Heavy Armor kombiniert werden. +} + +User3Name_41 +{ +Phase Gate +} + +User3Desc_41 +{ +Ermoeglicht die Teleportation zu anderen Phase Gates. Treten Sie auf ein Phasegate und druecken Sie 'BENUTZEN', um sich zu teleportieren. Phase Gates koennen von allen Spielern benutzt werden. +} + +User3CommanderDesc_41 +{ +Ermoeglicht Lichtgeschwindigkeitteleportation zu anderen Phase Gates. Es werden mehrere Phase Gates benoetigt um einen Effekt zu erzielen. Phase Gates koennen von allen Spielern benutzt werden. +} + +User3Name_42 +{ +Defense Chamber +} + +User3Desc_42 +{ +Heilt langsam befreundete Spieler und Strukturen in ihrer Naehe. Eroeffnet einen Level von Defensiv-Upgrades (Carapace, Regeneration und Redemption). +} + +User3Name_43 +{ +Movement Chamber +} + +User3Desc_43 +{ +Aliens koennen sich hiermit zum am weitesten entfernten oder einem gerade angegriffenen Hive teleportieren. Erlaubt ein Level von Bewegungs-Upgrades(Celerity, Adrenaline und Silence). Wird eine Chamber vernichtet, geht auch das entsprechende Upgrade verloren. +} + +User3FriendlyDesc_43 +{ +Gehe zur Chamber und druecke die "BENUTZEN"-Taste, um Dich zu einem Hive zu teleportieren. Eroeffnet einen Level an Movement Upgrades (Celerity, Adrenaline und Silence). +} + + +User3Name_44 +{ +Offense Chamber +} + +User3Desc_44 +{ +Organisches Geschuetz, feuert automatisch auf feindliche Spieler und Strukturen. +} + +User3Name_45 +{ +Sensory Chamber +} + +User3Desc_45 +{ +Tarnt nahe Aliens. Erlaubt ein Level von Sensory-Upgrades (Cloaking, Pheromones und Scent Of Fear). +} + + +User3Name_46 +{ +Resource Tower +} + +User3Desc_46 +{ +Foerdert Resourcen fuer den Feind. +} + +User3FriendlyDesc_46 +{ +Foerdert Resourcen fuer Dein Team. +} + +User3Name_47 +{ +Heavy Armor Modul (schwere Ruestung) +} + +User3Desc_47 +{ +Stattet einen Soldaten mit Heavy Armor aus. +} + +User3FriendlyDesc_47 +{ +Stattet einen Soldaten mit Heavy Armor aus. +} + +User3Name_48 +{ +Jet-Pack Modul +} + +User3Desc_48 +{ +Stattet einen Soldaten mit einem Jet-Pack aus. +} + +User3FriendlyDesc_48 +{ +Stattet einen Soldaten mit einem Jet-Pack aus. +} + +User3Name_49 +{ +Advanced Turret Factory +} + +User3Desc_49 +{ +Ermoeglicht die Errichtung von Sentry Turrets und Siege Cannons. +} + +User3FriendlyDesc_49 +{ +Ermoeglicht die Errichtung von Sentry Turrets und Siege Cannons. +} + +User3Name_57 +{ +Mine +} + +User3Desc_57 +{ +Detoniert bei Kontakt. +} + +User3FriendlyDesc_57 +{ +Detonieren bei Kontakt mit dem Feind. +} + +Weapon1Help +{ +Gore - Gehe nah an Deinen Feind heran und greife an. Schaden: %d Punkte (verdoppelt gegen Strukturen) +} + +Weapon2Help +{ +Spit - Leichte Fernkampfwaffe, um den Feind auf Distanz zu halten. Schaden: %d Punkte +} + +Weapon3Help +{ +Sporen - verschiesst eine Wolke giftiger Sporen, die allen Feinden im Einflussgebiet langsam schadet. +Schaden: %d Punkte pro Sekunde +} + +Weapon4Help +{ +Spikes - Praezise Fernkampfwaffe fuer grosse Distanz. Schaden: %d Punkte +} + +Weapon5Help +{ +Bite - Toedliche Nahkampfwaffe. Gehe nahe an den Feind heran und beisse zu. Schaden: %d Punkte +} + +Weapon6Help +{ +Bite - Toedliche Nahkampfwaffe. Gehe nahe an den Feind heran und beisse zu. Schaden: %d Punkte +} + +Weapon7Help +{ +Swipe - Toedlicher Nahkampf-Angriff. Effektiv gegen Spieler und Gebaeude. Schaden: %d Punkte +} + +Weapon8Help +{ +Webs - Schiesse Troepfchen an zwei gegenueberliegende Waende, und ein Web wird zwischen ihnen erscheinen. Webs bremsen Gegner und macht sie kurzzeitig kampfunfaehig. Webs koennen mit Weldern verbrannt werden. +} + +Weapon9Help +{ +Metabolize - Erlaubt die Regeneration von Energie und Schaeden. +} + +Weapon10Help +{ +Parasit - Infiziert das Ziel mit einem Parasiten und macht es in der Hive Sicht fuer alle Zeit sichtbar. Der Parasit kann nicht entfernt werden. Schaden: %d Punkte +} + +Weapon11Help +{ +Blink - Quasi-Teleportation. +} + +Weapon12Help +{ +Xenocide - Explosiver Selbstmordangriff. Kurz nach der Aktivierung wirst Du detonieren und in deiner Umgebung grosse Verwuestung anrichten. Schaden: %d Punkte (verdoppelt gegen Strukturen) +} + +Weapon13Help +{ +Messer - Waffe der Sparsamen und der Verzweifelten. Schaden : %d Punkte +} + +Weapon14Help +{ +Pistole - Durchschlagkraeftige und auesserst genaue Waffe, aber mit kleinem Magazin. Schaden: %d Punkte +} + +Weapon15Help +{ +LMG - Praezise Waffe mit hoher Feuerrate und mittelgrossem Magazin. Feuerrate: 10 Kugeln pro Sekunde. Schaden: %d Punkte +} + +Weapon16Help +{ +Shotgun - Fuer schnelle Ziele und maximalen Schaden auf kurze Distanz. Feuerrate: 10 Pellets pro Schuss. Schaden pro Pellet: %d Punkte +} + +Weapon17Help +{ +Heavy Machine Gun (HMG) - Schweres Maschienengewehr fuer grosse Ziele und zur Verteidigung. Ihre Ungenauigkeit wird durch hohe Feuerrate und grosse Magazinkapazitaet mehr als wett gemacht. Schaden: %d Punkte pro Kugel (halbiert gegen Strukturen). +} + +Weapon18Help +{ +Welder - Weniger eine Waffe als ein Werkzeug. Schweisst bestimmte Punkte im Level auf oder zu. Der Welder kann ausserdem zum Reparieren von Gebaeuden und Armor und zum Verbrennen von Webs benutzt werden. Schaden: %d Punkte +} + +Weapon19Help +{ +Minen - Geeignet zur Verteidigung. Explodieren bei Feindannaeherung. Schaden: %d Punkte +} + +Weapon20Help +{ +Grenade Launcher - Eine wahre Massenvernichtungswaffe. Granaten detonieren nach 4 Sekunden und haben einen grossen Wirkungsradius. Schaden: %d Punkte (verdoppelt gegen Strukturen) +} + +Weapon21Help +{ +Leap - Schneller Sprung vorwaerts, verletzt alles in Deinem Weg. Hilfreich zur Fortbewegung und im Kampf. Schaden: %d Punkte +} + +Weapon22Help +{ +Charge – Laesst Dich wild nach vorne stuermen und alles in Deiner Bahn und beschaedigen. Der Angriff verbraucht nach und nach Energie und endet, sobald Du keine Energie mehr besitzt. Schaden: Unglaublich. +} + +Weapon23Help +{ +Umbra - Sondert einen Bakterien-Nebel ab, der feindliche Geschosse abbremst. Jede verbuendete Struktur oder Spieler in der Umbra wird sehr selten getroffen, allerdings wirkt sich dies nicht auf Explosiv-Schaden und Nicht-Projektil-Geschosse aus. Dauer: %d Sekunden. +} + +Weapon24Help +{ +Primal Scream - Alle Teamkollegen in Reichweite bekommen schneller Energie zurueck, koennen sich schneller bewegen, und richten mehr Schaden an. Hoer Ihre Antwort! +} + +Weapon25Help +{ +Bile Bomb - Organische Artillerie, die feindliche Gebaeude in sehr grossem Radius beschaedigt. Schaden: %d Punkte (ausschlieslich Gebaeude) +} + +Weapon26Help +{ +Acid Rocket - Langsam fliegendes Geschoss, das bei Aufprall in eine Saeurewolke zerplatzt. Schaden: %d Punkte +} + +Weapon27Help +{ +Healing Spray - Bakterielles Spray, das befreundete Spieler und Strukturen heilt und Feinde schaedigt. Hat geringe Reichweite, kann jedoch durch Strukturen und Waende hindurch wirken. Schaden: %d Punkte +} + +Weapon28Help +{ +Babbler - Erschafft einen "Babbler", eine schwache Ausfuehrung des Skulks. Babbler suchen sich ihre Ziele selber, haben jedoch eine sehr gringe Lebensdauer. Schaden: 20 (Bite), 40 (Xenocide) +} + +Weapon29Help +{ +Stomp - Betaeubt Gegner fuer %d Sekunden +} + +Weapon30Help +{ +Devour - Verschlingt einen nahen Feind, der dann langsam verdaut wird und %d Punkte Schaden pro Sekunde nimmt. Der Onos heilt um diese Anzahl an Punkten. Sollte er vor der vollstaendigen Verdauung des Opfers selbst sterben, kommt dieses stark geschwaecht wieder zum Vorschein. +} + +CommandStationOtherTeam +{ +Diese Command Console gehoert dem anderen Team. +} + +CommandStationInUse +{ +Ihr Team hat schon einen Commander, die Command Console kann nicht benutzt werden. +} + +WeaponPreventingCommandStation +{ +Ihre Waffe verhindert das Benutzen der Command Console. +} + +CommandStationDestroyed +{ +Diese Commando Console ist zerstoert und kann nicht mehr benutzt werden. +} + +CommandStationWaitTime +{ +Sie muessen noch etwas warten, bevor Sie die Command Console wieder benutzen koennen. +} + + +// Particle editing commands +$position -1 0.7 +NoParticleSystem +{ +Dieses Partikel-System konnte nicht gefunden werden. +} + +EditingParticleSystem +{ +Partikel-System wurde gefunden, druecke F7 um es zu bearbeiten +} + + +// Marine help text + +// Armor received messages +$position -1 0.45 +$effect 0 +$fadein 0.5 +$fadeout 0.5 +$holdtime 5.0 + +HelpTextCSAttractMode +{ +Zielen Sie auf die Command Console und druecken Sie Ihre "Benutzen"-Taste, um den Command Mode zu aktivieren. +} + +HelpTextArmoryResupply +{ +"Benutzen" Sie die Armory, um kostenlose Munition fuer Ihre aktive Waffe zu erhalten. +} + +HelpTextAttackNearbyStation +{ +Das ist die Commando Console des Feindes, attackieren Sie die Console. +} + +HelpTextBuildTurret +{ +Zielen Sie auf das Turret und halten Sie Ihre "Benutzen"-Taste gedrueckt, um es zu bauen. +} + +HelpTextBuildTower +{ +Zielen Sie auf den Resource Tower und halten Sie Ihre "Benutzen"-Taste gedrueckt, um ihn zu bauen. +} + +HelpTextExplainTower +{ +Dieser aktive 'Resource-Tower' bringt Ihrem Team regelmaessig Resourcen ein. +} + +HelpTextAttackHive +{ +Sammeln Sie sich mit ihren Teamkammeraden. Finden Sie den Hive und zerstoeren ihn! +} + +HelpTextOtherHiveBuilding +{ +Nur ein Hive kann auf einmal gebaut werden. Warte etwas. +} + +HelpTextEmptyHiveNotNearby +{ +Du kannst einen Hive nur an einer freien Hive-Location errichten (suche nach infiziertem Gebiet und einem durchsichtigen Indikator). +} + +HelpTextAttackNearbyHive +{ +Es ist ein Hive in der Naehe! Zerstoeren Sie ihn, um die Aliens zu stoppen! +} + +HelpTextFriendlyMovementChamber +{ +Gehe zur Chamber und druecke die "Benutzen"-Taste, um Dich zu einem angegriffenen Hive zu teleportieren! Zusaetzlich regeneriert sie Deine Energie. +} + +HelpTextAttackMovementChamber +{ +Dies ist eine feindliche Movement Chamber. Sie erlaubt es dem Gegner, sich zu dessen Hive zu teleportieren. Zusaetzlich regeneriert sie seine Energie. +} + +HelpTextFriendlyOffensiveChamber +{ +Das ist eine Offense Chamber, sie schiesst auf Feinde. +} + +HelpTextAttackOffensiveChamber +{ +Vorsicht, dies ist eine feindliche Offense Chamber! +} + +HelpTextFriendlyDefensiveChamber +{ +Diese Defense Chamber regeneriert nahe Spieler und Strukturen. Dabei stoesst sie jedoch deutlich hoerbare "schluckende" Geraeusche aus... +} + +HelpTextAttackDefensiveChamber +{ +Dies ist eine feindliche Defensive Chamber. Sie kann gegnerische Spieler und Strukturen heilen. +} + +HelpTextFriendlySensoryChamber +{ +Dies ist eine Sensory Chamber, sie verbirgt nahe Aliens. +} + +HelpTextAttackSensoryChamber +{ +Dies ist eine feindliche Sensory Chamber. +} + +HelpTextOpenWeldable +{ +Dieser Bereich kann mit einem Welder geoeffnet werden. +} + +HelpTextCloseWeldable +{ +Dieser Bereich kann mit einem Welder geschlossen werden. +} + +HelpTextPhaseGate +{ +Betreten Sie das Phase Gate und druechen Sie 'BENUTZEN', um den Teleport einzuleiten. +} + +HelpTextAlienPopupMenu +{ +Benutze Dein "pop-up menu" um Strukturen zu errichten, Upgrades zu entwickeln, und die Teams zu wechseln. (rechte Maustaste). +} + +HelpTextMarinePopupMenu +{ +Benutzen Sie Ihr "Pop-Up menu" um zu funken, nach Befehlen zu fragen, Teams zu wechseln und fuer vieles mehr (rechte Maustaste). +} + +HelpTextOrder +{ +Der Commander hat Ihnen einen Befehl erteilt. Der blaue Kreis auf Ihrem Display zeigt Ihnen Ort und Typ des Befehls. Benutzen Sie ihr "Pop-Up menu" um Befehle zu erfragen oder zu bestaetigen. +} + +HelpTextCommanderUseable +{ +Als Commander koennen Sie jeden Schalter durck Linksklick der Maus "Benutzen". +} + +HelpTextMarineCommandMenu +{ +Druecken Sie Ihre "Pop-Up menu"-Taste um mit Ihrem Team zu kommunizieren (standardmaessig Rechte Maustaste). +} + +HelpTextResourceDropoff +{ +Sie haben Resouren fuer ihr Team bekommen. +} + +HelpTextJetpacks +{ +Ihr Commander hat die Jet-Pack Technologie erforscht. Halten Sie Ihre "Sprung"-Taste gedrueckt, um es zu aktivieren. +} + +HelpTextAlienCommandMenu +{ +Benutze Dein "Pop-Up Menu", um Dich in andere Lebensformen zu entwickeln, und Upgrades zu erhalten (standardmaessig Rechte Maustaste). +} + +HelpTextAttackTower +{ +Dieser Resource Tower sammelt Resourcen fuer den Feind! Zerstoere ihn! +} + +HelpTextAlienWeapons +{ +Benutze das Mausrad oder die Zifferntasten, um zwischen den einzelnen Faehigkeiten zu wechseln. Ein rotes Symbol bedeutet, dass die Faehigkeit erst mit mehr Hives freigeschalten wird. +} + +HelpTextAlienResources +{ +Der blaue Balken link zeigt Deine Resourcen. Du erhaelst Resourcen von den Resource Towers deines Teams. +} + +HelpTextAlienEnergy +{ +Der gelbe Balken rechts zeigt Deine Energie. Der Einsatz von Faehigkeiten kostet Dich Energie. +} + +HelpTextAlienPendingUpgrades +{ +Die kleinen blinkenden Symbole am rechten Bildschirmrand zeigen Dir an, dass Du nun neue Eigenschaften entwickeln kannst! Oeffne das "Pop-Up Menu", um eines dieser Upgrades auszuwaehlen. +} + +HelpTextAlienBuildStructure +{ +Als ein Arbeiter-Alien kannst Du mithilfe deines "Pop-Up menus" Strukturen erschaffen. +} + +HelpTextAlienBuildStructure +{ +Eine unfertige Struktur ist in der Naehe. Alien-Strukturen entwickeln sich langsam von alleine, aber als Gorge kannst Du diesen Prozess beschleunigen. Ziele auf die Struktur und halte Deine "Benutzen"-Taste gedrueckt, um sie zu bauen. +} + +HelpTextAlienHiveSight +{ +Die gluehenden Icons repraesentieren die sog. "hive sight" Deines Teams, die alle befreundeten Einheiten und Strukturen, sowie Gegner mit Parasitenbefall anzeigt. +} + +HelpTextAlienVisionMode +{ +} + +HelpTextAlienCommunication +{ +Ueber die "Hive Sight" bist Du staendig mit Deinem Team in Kontakt. So werden alle Verbuendeten sofort erfahren, wenn einer von ihnen angegriffen wird - sein Icon wird rot blinken. Achte auf solche Meldungen, und komm' den Anderen zur Hilfe! +} + +HelpTextAlienUnderAttack +{ +Einer deiner Teamkollegen oder eine Struktur wird angegriffen. Dreh' Dich umher und such nach der Warnmeldung in der Hive Sight. +} + +HelpTextBuilder +{ +Du bist nun ein Gorge. Meide den Kampf und benutze dein "Pop-Up menu", um unterschiedliche Strukturen zu erschaffen. +} + +HelpTextWeb +{ +Schiesse Troepfchen an zwei gegenueberliegende Waende, und ein Web wird zwischen ihnen erscheinen. Webs bremsen Gegner und machen sie kurzzeitig kampfunfaehig. +} + +HelpTextWallwalking +{ +Du kannst deine "Ducken"-Taste gedrueckt halten, um von Waenden oder Decken abzuspringen. +} + +HelpTextBite +{ +Gehe nah an den Feind heran und druecke Deine "Feuer" Taste um, ihn zu beissen. +} + +HelpTextFlight +{ +Versuche durch wiederholtes Druecken der "Springen"-Taste zu fliegen. Du kannst die "Springen"-Taste gedrueckt halten, um zu gleiten. +} + +HelpTextSpores +{ +Druecke Deine "Feuer"-Taste, um eine Spore-Cloud auszustossen, die Feinde verletzt. +} + +HelpTextAlienResource +{ +Finde eine Resource Node und baue einen Resource Tower auf ihr, um Resourcen fuer dein Team zu sammeln. +} + +HelpTextPopupMenu +{ +Die rechte Maustaste (Altern. Feuer) aktiviert das 'Pop-Up Menu'. +} + +HelpTextBuyUpgrade +{ +Aliens koennen ueber das "Pop-Up menu" neue Faehigkeiten entwickeln. Versuche es: Halte deine "Pop-Up menu"-Taste (rechte Maustaste) und bewege den Cursor nach rechts. +} + +HelpTextBuyLifeform +{ +Aliens koennen sich zu neuen Lebensformen weiterentwickeln. Versuche es: Halte deine "Pop-Up menu"-Taste (rechte Maustaste) , bewege den Curser herunter und dann nach rechts. +} + +HelpTextCommanderGiveOrders +{ +Rechts-Klicken Sie auf den Boden oder eine Struktur, um einen Befehl erteilen. +} + +HelpTextCommanderSelectPlayers +{ +Links-Klicken auf einen Spieler oder ziehen Sie ein Rahmen auf, um ihn anzuwaehlen. +} + +HelpTextCommanderLogout +{ +Sie koennen den Commander-Modus verlassen, indem Sie auf den roten "Log-Out" Button klicken. +} + +// This message isn't in yet +HelpTextCommanderBuild +{ +Dieses Gebaeude ist nicht fertig gebaut. Waehlen Sie einen Spieler aus und klicken Sie mit der rechten Maustaste auf das Gebaeude, um einen Baubefehl zu erteilen. +} + +HelpTextCommanderUse +{ +Tueren, Fahrstuehle und andere Geraete koennen vom Commander "gehackt" werden. Klicken Sie links, um sie zu aktivieren. +} + +HelpTextCommanderAttack +{ +Dieses Ziel kann angegriffen werden! Recht-klicken Sie, um den Angriffsbefehl zu erteilen. +} + +HelpTextCommanderWeld +{ +Dieses Ziel kann gewelded werden. Kaufen Sie einem Spieler einen Welder und klicken Sie mit der Rechten Maustaste, um ihm einen Weld-Befehl zu erteilen. +} + +HelpTextCommanderGet +{ +Rechts-Klicken Sie hier, um einen Befehl zum Aufnehmen zu erteilen. +} + +HelpTextCommanderUnderAttack +{ +Sie werden angegriffen! Druecken Sie ihre "Sprung"-Taste, um zum Alarm zu gehen. +} + +HelpTextCommanderResearchComplete +{ +Ihre Forschung ist abgeschlossen. Druecken Sie ihre "SPRINGEN" Taste, um zu dem Platz der Forschung zu gelangen. +} + +HelpTextCommanderUpgradeComplete +{ +Ihr Upgrade ist fertiggestellt. Druecken Sie ihre "SPRINGEN" Taste, um zu der Upgradeten Struktur zu gelangen. +} + +JetpackEnergyHUDText +{ +Jet-Pack Energie +} + +HelpTextDisableHelp +{ +Sie koennen diese Tips abschalten, indem Sie in ihrem "multiplayer customization menu " die Option "show hints" abschalten (cl_autohelp 0). +} + +Paralyzed +{ +Paralysiert +} + +Stunned +{ +Gelaehmt +} + +Digested +{ +Wird verdaut... +} + +DigestingPlayer +{ +Verdaut %s... +} + +Parasited +{ +Parasit entdeckt +} + +PrimalScreamed +{ +Primal Scream +} + +Umbraed +{ +Im Umbra +} + +Webbed +{ +Verfangen +} + +// Order descriptions +Order2 +{ +Gehen Sie zum Wegpunkt. +} + +Order3 +{ +Greifen Sie das Ziel an. +} + +Order4 +{ +Bauen Sie %s +} + +Order5 +{ +Bewachen Sie %s +} + +Order6 +{ +Benutze Welder beim Wegpunkt. +} + +Order7 +{ +%s aufnehmen. +} + +Order9 +{ +Halten Sie Ihre Position +} + +Range +{ +%d Meter +} + +// Timelimit for tourny mode +GameTime +{ +Spielzeit +} + +Elapsed +{ +vergangen +} + +TimeLimit +{ +Limit +} + +Remaining +{ +verbleibend +} + +// HLTV +Spec_duck +{ +Press DUCK for Spectator Menu +} + +SPECT_OPTIONS +{ +Options +} + +CAM_OPTIONS +{ +Camera Options +} + +SpecMode5Text +{ +} + +OBS_MAP_FREE +{ +Map free camera +} + +OBS_MAP_CHASE +{ +Map chase camera +} + +OBS_CHASE_FREE +{ +Free chase camera +} + +OBS_CHASE_LOCKED +{ +Locked chase camera +} + +OBS_IN_EYE +{ +In-eye camera +} + +OBS_ROAMING +{ +Free look camera +} + +// Official map locations +testlocation1 +{ +The translated refinery +} + +///////////// +// ns_bast // +///////////// +bastlocation_dockingbay +{ +Marine Start - Docking Bay 1 +} + +bastlocation_mainjunction +{ +Main Aft Junction +} + +bastlocation_cargolock +{ +Heavy Lock Door +} + +bastlocation_atmosphericprocessing +{ +Atmospheric Processing +} + +bastlocation_furnace +{ +Steam Generation +} + +bastlocation_watertreatment +{ +Water Treatment +} + +// NOTE: The hyphen in hive location names is important. Everything before the hyphen is trimmed off when displaying +// location names for aliens (the hive icons in the upper right of their HUD). Make sure to follow the convention: +// Hive Location - name +bastlocation_feedwatercontrol +{ +Hive Location - Feedwater Control +} + +bastlocation_trammaintenance +{ +Tram Maintenance +} + +bastlocation_tramtunnel +{ +Tram Tunnel +} + +bastlocation_lowerjunction +{ +Lower Junction +} + +bastlocation_Refinery +{ +Hive Location - Refinery +} + +bastlocation_emshaft +{ +EM Drill Shaft +} + +bastlocation_engineroom +{ +Hive Location - Engine Room +} + +bastlocation_dockinghydraulics +{ +Docking Hydraulics +} + +bastlocation_maintenancejunction +{ +Maintenance Junction +} + +bastlocation_ncorridor +{ +"N" Corridor +} + +bastlocation_observationbridge +{ +Observation Bridge +} + +bastlocation_starboardairlock +{ +Starboard Airlock +} + +bastlocation_portairlock +{ +Port Airlock +} + +bastlocation_maintenanceaccess +{ +Maintenance Access Duct +} + +bastlocation_pressureequalization +{ +Pressure Equalization Conduit +} + +bastlocation_starboardcorridor +{ +Aft Starboard Corridor +} + +bastlocation_filtration +{ +Feedwater Filtration Access +} + +bastlocation_ventilation +{ +Ventilation Conduit +} + +bastlocation_databank +{ +Databank Access +} + +bastlocation_enginecorridor +{ +Engine Corridor +} + +///////////// +// ns_hera // +///////////// +heralocation_archive +{ +Hive Location - Archiving +} + +heralocation_processingcorea +{ +Data Core Alpha +} + +heralocation_reception +{ +Hera Entrance and Reception +} + +heralocation_holoroom +{ +Central Monitoring - 'Holoroom' +} + +heralocation_storage +{ +General Cargo Storage +} + +heralocation_hanger +{ +Marine Start - Loading bay +} + +heralocation_docking +{ +Marine Start - Landing Pad +} + +heralocation_processing +{ +Processing +} + +heralocation_processingcoreb +{ +Hive Location - Data Core Delta +} + +heralocation_ventilation +{ +Hive Location - Ventilation 3-C +} + +heralocation_maintenence +{ +Maintenance +} + +heralocation_fogcorridor +{ +Maintenance Corridor +} + +heralocation_tube +{ +Hera Entrance Walkway +} + +// Nothing titles +nothinglocation_rr +{ +Space Station Nothing - Sub Sector 77 +} + +nothinglocation_ms +{ +Marine Start - S77 Vestibule +} + +nothinglocation_dock +{ +Docking Wing 01 +} + +nothinglocation_thres1 +{ +The Threshold +} + +nothinglocation_thres2 +{ +The Threshold +} + +nothinglocation_junc1 +{ +The Junction +} + +nothinglocation_junc2 +{ +The Junction +} + +nothinglocation_vent +{ +Ventilation Chamber +} + +nothinglocation_comm +{ +Communications Hub 063 +} + +nothinglocation_things +{ +Room With Things +} + +nothinglocation_cargo +{ +Hive Location - Cargo Bay Foyer +} + +nothinglocation_pipe +{ +Pipe Room +} + +nothinglocation_paint1 +{ +Painted Corridor +} + +nothinglocation_paint2 +{ +Painted Corridor +} + +nothinglocation_paint3 +{ +Painted Corridor +} + +nothinglocation_quada +{ +Quad Lift Area +} + +nothinglocation_quad +{ +Quad Lift +} + +nothinglocation_chamb +{ +Foreboding Antechamber +} + +nothinglocation_sas1 +{ +Silo Access South +} + +nothinglocation_sas2 +{ +Silo Access South +} + +nothinglocation_silo +{ +Hive Location - PowerSilo +} + +nothinglocation_san1 +{ +Silo Access North +} + +nothinglocation_san2 +{ +Silo Access North +} + +nothinglocation_mias1 +{ +Miasma Walkway +} + +nothinglocation_mias2 +{ +Miasma Walkway +} + +nothinglocation_mias3 +{ +Miasma Walkway +} + +nothinglocation_gen +{ +Generator Room +} + +nothinglocation_elev1 +{ +Elevator Shaft 01 +} + +nothinglocation_elev2 +{ +Elevator Shaft 02 +} + +nothinglocation_eek +{ +Intimidation +} + +nothinglocation_kismet +{ +Ominous Kismet +} + +nothinglocation_vae +{ +Viaduct Access East +} + +nothinglocation_vaw +{ +Viaduct Access West +} + +nothinglocation_viaduct +{ +Hive Location - The Great Viaduct +} + +// TANITH info_location data START +tanith_westenter +{ +Western Entrance +} + +tanith_marinebase +{ +Marine Start - Uplink Command +} + +tanith_outsidebase +{ +Exterior Access Paths +} + +tanith_north +{ +Northern Corridor +} + +tanith_sat +{ +External Satellite Relay +} + +tanith_satcomm +{ +Hive Location - Satellite Communications +} + +tanith_transport +{ +Chemical Transport Room +} + +tanith_cpu +{ +Computer Control +} + +tanith_acid +{ +Acidic Solution Processing +} + +tanith_reactor +{ +Reactor Room +} + +tanith_enter +{ +Eastern Entrance +} + +tanith_centerenter +{ +Central Entrance +} + +tanith_east +{ +East Access Tunnels +} + +tanith_research +{ +Research Labs +} + +tanith_rr +{ +Tanith Ready Room +} +tanith_waste +{ +Hive Location - Waste Handling +} + +tanith_central +{ +Central Access Tunnels +} + +tanith_storageenter +{ +Storage Entrance +} + +tanith_cargo +{ +Cargo Storage +} + +tanith_fusion +{ +Hive Location - Fusion Reactor +} + +tanith_west +{ +West Access Corridor +} +// TANITH info_location data END + + +// NANCY info_location data START +nancy_cargo +{ +Cargo Hold 2 +} + +nancy_aux +{ +Auxillary Command +} + +nancy_engine +{ +Port Engine Room +} + +nancy_crawl +{ +Sub-tunnel +} + +nancy_maint +{ +Maintenance Shaft +} + +nancy_shaft +{ +Maintenance Shaft +} + +nancy_mother +{ +Mother +} + +nancy_lockers +{ +Crew Lockers +} + +nancy_mess +{ +Mess Hall +} + +nancy_airlock +{ +Airlock Exchange +} + +nancy_port +{ +Port Airlock +} + +nancy_bridge +{ +Bridge +} + +nancy_cockpit +{ +Cockpit +} + +nancy_star +{ +Starboard Airlock +} + +nancy_gen +{ +Auxiliary Generators +} + +nancy_motherinter +{ +Mother Interface +} + +nancy_subspace +{ +Subspace Array Interface +} + +nancy_crew +{ +Crew Quarters +} +// NANCY info_location data END + +// CAGED info_location data START +caged_marine +{ +Marine Spawn - Main Hold +} + +caged_upsewer +{ +Upper Sewer +} + +caged_dsewer +{ +Lower Sewer +} + +caged_hive1 +{ +Hive Location - Sewer +} + +caged_hive2 +{ +Hive Location - Ventilation System +} + +caged_hive3 +{ +Hive Location - Generator +} + +caged_pure +{ +Purification Station 01 +} + +caged_central +{ +Central Processing +} + +caged_vaccess +{ +Ventilation Access +} + +caged_work +{ +Stability Monitoring +} + +caged_auxgen +{ +Auxiliary Generator +} + +caged_service +{ +Shipping Tunnels +} + +caged_area2 +{ +Upper Shipping Access +} +// CAGED info_location data END + +// Eclipse info_location... info. (BEGIN) +eclipse_dock +{ +Docking Control +} + +eclipse_marinespawn +{ +Marine Spawn - Cargo Transfer +} + +eclipse_station +{ +Station Access +} + +eclipse_stationeast +{ +Station Access East +} + +eclipse_stationalpha +{ +Station Access Alpha +} + +eclipse_stationwest +{ +Station Access West +} + +eclipse_triad +{ +Triad Generator Array +} + +eclipse_triadb +{ +Triad Access B +} + +eclipse_access1c +{ +Access Corridor 1C +} + +eclipse_access1b +{ +Access Corridor 1B +} + +eclipse_access1a +{ +Primary Access Corridor 1A +} + +eclipse_horseshoe +{ +The Horseshoe +} + +eclipse_tjunct +{ +T-Junction +} + +eclipse_keyhole +{ +The Keyhole +} + +eclipse_maint +{ +Hive - Maintenance Access +} + +eclipse_south +{ +South Loop +} + +eclipse_core +{ +Hive - Computer Core +} + +eclipse_northcore +{ +North Core Access +} + +eclipse_westcore +{ +West Core Access +} + +eclipse_subjunct +{ +Power Sub-Junction 3 +} + +eclipse_access1d +{ +Access Corridor 1D +} + +eclipse_commandnorth +{ +Command Access North +} + +eclipse_command +{ +Hive - Eclipse Command +} + +eclipse_genmon +{ +Primary Generator Monitors +} + +eclipse_commandsouth +{ +Command Access South +} + +eclipse_access1a +{ +Access Corridor 1A +} +// Eclipse info_location... info. (END) + + +// Veil info_location (START) + +veil_marine +{ +Marine Spawn - Mobile Command Interface +} + +veil_lifteast +{ +Lift 5 East +} + +veil_swhive +{ +Hive - Sub-Sector 5B Access +} + +veil_south +{ +Hive - Cargo Transfer South +} + +veil_southeast +{ +Hive - The Pipeline +} + +veil_overlook +{ +The Overlook +} + +veil_topography +{ +Topographical Analysis +} + +veil_nano +{ +NanoGrid Status +} + +veil_dome +{ +The Dome +} + +veil_y +{ +Y Junction +} + +veil_skylight +{ +West Skylights +} + +veil_satellite +{ +Satellite Feed +} + +veil_pod1 +{ +Monitoring Pod 1 +} + +veil_pod2 +{ +Monitoring Pod 2 +} + +veil_waypointing +{ +System Waypointing +} + +veil_nanoeast +{ +NanoGrid Access East +} + +veil_nanowest +{ +NanoGrid Access West +} + +veil_c12 +{ +Emergency Nozzle C-12 +} + +veil_junctionwest +{ +West Junction +} + +veil_junctioneast +{ +East Junction +} + +veil_power +{ +Power Core Status +} + +// Veil info_location (END) + + + +// Tutorial text +$position 0.15 0.15 +$effect 2 +$color 0 200 0 +$color2 0 255 0 +$fadein 0.04 +$fxtime 0.1 +$holdtime 6.0 +$fadeout 0.5 + +TutWelcome +{ +Welcome to Natural Selection Training. + +Here you will learn the basic rules of the game. + +Walk through a door to choose your training. +If you are a new to first-person shooters, marine +training is recommended. +} + +TutWelcomeMarineTraining +{ +You've chosen Marine training. Here you will +learn what it takes to be a Frontiersman and how +to fight the alien race. +} + +TutWelcomeAlienTraining +{ +You've chosen Alien training. Here you will +learn how to spread your influence throughout +the galaxy, and obliterate the human oppressors. +} + diff --git a/main/gfx.wad b/main/gfx.wad new file mode 100644 index 00000000..8a8c09ec Binary files /dev/null and b/main/gfx.wad differ diff --git a/main/gfx/env/Nebular_bk.tga b/main/gfx/env/Nebular_bk.tga new file mode 100644 index 00000000..7f0f26fb Binary files /dev/null and b/main/gfx/env/Nebular_bk.tga differ diff --git a/main/gfx/env/Nebular_dn.tga b/main/gfx/env/Nebular_dn.tga new file mode 100644 index 00000000..9964a103 Binary files /dev/null and b/main/gfx/env/Nebular_dn.tga differ diff --git a/main/gfx/env/Nebular_ft.tga b/main/gfx/env/Nebular_ft.tga new file mode 100644 index 00000000..9964a103 Binary files /dev/null and b/main/gfx/env/Nebular_ft.tga differ diff --git a/main/gfx/env/Nebular_lf.tga b/main/gfx/env/Nebular_lf.tga new file mode 100644 index 00000000..9964a103 Binary files /dev/null and b/main/gfx/env/Nebular_lf.tga differ diff --git a/main/gfx/env/Nebular_rt.tga b/main/gfx/env/Nebular_rt.tga new file mode 100644 index 00000000..383da160 Binary files /dev/null and b/main/gfx/env/Nebular_rt.tga differ diff --git a/main/gfx/env/Nebular_up.tga b/main/gfx/env/Nebular_up.tga new file mode 100644 index 00000000..ac2b2ba8 Binary files /dev/null and b/main/gfx/env/Nebular_up.tga differ diff --git a/main/gfx/env/altairbk.tga b/main/gfx/env/altairbk.tga new file mode 100644 index 00000000..81e6cfcb Binary files /dev/null and b/main/gfx/env/altairbk.tga differ diff --git a/main/gfx/env/altairdn.tga b/main/gfx/env/altairdn.tga new file mode 100644 index 00000000..b42b869b Binary files /dev/null and b/main/gfx/env/altairdn.tga differ diff --git a/main/gfx/env/altairft.tga b/main/gfx/env/altairft.tga new file mode 100644 index 00000000..d90d7ef0 Binary files /dev/null and b/main/gfx/env/altairft.tga differ diff --git a/main/gfx/env/altairlf.tga b/main/gfx/env/altairlf.tga new file mode 100644 index 00000000..a4a1a32c Binary files /dev/null and b/main/gfx/env/altairlf.tga differ diff --git a/main/gfx/env/altairrt.tga b/main/gfx/env/altairrt.tga new file mode 100644 index 00000000..c2a24721 Binary files /dev/null and b/main/gfx/env/altairrt.tga differ diff --git a/main/gfx/env/altairup.tga b/main/gfx/env/altairup.tga new file mode 100644 index 00000000..ac413c68 Binary files /dev/null and b/main/gfx/env/altairup.tga differ diff --git a/main/gfx/env/arcnbk.tga b/main/gfx/env/arcnbk.tga new file mode 100644 index 00000000..3ca86d48 Binary files /dev/null and b/main/gfx/env/arcnbk.tga differ diff --git a/main/gfx/env/arcndn.tga b/main/gfx/env/arcndn.tga new file mode 100644 index 00000000..372b0a98 Binary files /dev/null and b/main/gfx/env/arcndn.tga differ diff --git a/main/gfx/env/arcnft.tga b/main/gfx/env/arcnft.tga new file mode 100644 index 00000000..5c31c603 Binary files /dev/null and b/main/gfx/env/arcnft.tga differ diff --git a/main/gfx/env/arcnlf.tga b/main/gfx/env/arcnlf.tga new file mode 100644 index 00000000..f5e3d54a Binary files /dev/null and b/main/gfx/env/arcnlf.tga differ diff --git a/main/gfx/env/arcnrt.tga b/main/gfx/env/arcnrt.tga new file mode 100644 index 00000000..1e1a0f8d Binary files /dev/null and b/main/gfx/env/arcnrt.tga differ diff --git a/main/gfx/env/arcnup.tga b/main/gfx/env/arcnup.tga new file mode 100644 index 00000000..0c5bdb64 Binary files /dev/null and b/main/gfx/env/arcnup.tga differ diff --git a/main/gfx/env/ayumibk.tga b/main/gfx/env/ayumibk.tga new file mode 100644 index 00000000..a85bc673 Binary files /dev/null and b/main/gfx/env/ayumibk.tga differ diff --git a/main/gfx/env/ayumidn.tga b/main/gfx/env/ayumidn.tga new file mode 100644 index 00000000..d4513b9a Binary files /dev/null and b/main/gfx/env/ayumidn.tga differ diff --git a/main/gfx/env/ayumift.tga b/main/gfx/env/ayumift.tga new file mode 100644 index 00000000..c3a2e268 Binary files /dev/null and b/main/gfx/env/ayumift.tga differ diff --git a/main/gfx/env/ayumilf.tga b/main/gfx/env/ayumilf.tga new file mode 100644 index 00000000..e88ae349 Binary files /dev/null and b/main/gfx/env/ayumilf.tga differ diff --git a/main/gfx/env/ayumirt.tga b/main/gfx/env/ayumirt.tga new file mode 100644 index 00000000..28d72629 Binary files /dev/null and b/main/gfx/env/ayumirt.tga differ diff --git a/main/gfx/env/ayumiup.tga b/main/gfx/env/ayumiup.tga new file mode 100644 index 00000000..f062555a Binary files /dev/null and b/main/gfx/env/ayumiup.tga differ diff --git a/main/gfx/env/daimos_1BK.tga b/main/gfx/env/daimos_1BK.tga new file mode 100644 index 00000000..a45c0a19 Binary files /dev/null and b/main/gfx/env/daimos_1BK.tga differ diff --git a/main/gfx/env/daimos_1DN.tga b/main/gfx/env/daimos_1DN.tga new file mode 100644 index 00000000..16f4c9c3 Binary files /dev/null and b/main/gfx/env/daimos_1DN.tga differ diff --git a/main/gfx/env/daimos_1FT.tga b/main/gfx/env/daimos_1FT.tga new file mode 100644 index 00000000..5d8ee4cb Binary files /dev/null and b/main/gfx/env/daimos_1FT.tga differ diff --git a/main/gfx/env/daimos_1LF.tga b/main/gfx/env/daimos_1LF.tga new file mode 100644 index 00000000..32513d67 Binary files /dev/null and b/main/gfx/env/daimos_1LF.tga differ diff --git a/main/gfx/env/daimos_1RT.tga b/main/gfx/env/daimos_1RT.tga new file mode 100644 index 00000000..2c341f1c Binary files /dev/null and b/main/gfx/env/daimos_1RT.tga differ diff --git a/main/gfx/env/daimos_1UP.tga b/main/gfx/env/daimos_1UP.tga new file mode 100644 index 00000000..fc98e3a7 Binary files /dev/null and b/main/gfx/env/daimos_1UP.tga differ diff --git a/main/gfx/env/eclipse_bk.tga b/main/gfx/env/eclipse_bk.tga new file mode 100644 index 00000000..7bb42673 Binary files /dev/null and b/main/gfx/env/eclipse_bk.tga differ diff --git a/main/gfx/env/eclipse_dn.tga b/main/gfx/env/eclipse_dn.tga new file mode 100644 index 00000000..91d89a75 Binary files /dev/null and b/main/gfx/env/eclipse_dn.tga differ diff --git a/main/gfx/env/eclipse_ft.tga b/main/gfx/env/eclipse_ft.tga new file mode 100644 index 00000000..e29515d7 Binary files /dev/null and b/main/gfx/env/eclipse_ft.tga differ diff --git a/main/gfx/env/eclipse_lf.tga b/main/gfx/env/eclipse_lf.tga new file mode 100644 index 00000000..4ee62993 Binary files /dev/null and b/main/gfx/env/eclipse_lf.tga differ diff --git a/main/gfx/env/eclipse_rt.tga b/main/gfx/env/eclipse_rt.tga new file mode 100644 index 00000000..ecc0b47c Binary files /dev/null and b/main/gfx/env/eclipse_rt.tga differ diff --git a/main/gfx/env/eclipse_up.tga b/main/gfx/env/eclipse_up.tga new file mode 100644 index 00000000..baf69891 Binary files /dev/null and b/main/gfx/env/eclipse_up.tga differ diff --git a/main/gfx/env/gammu_bk.tga b/main/gfx/env/gammu_bk.tga new file mode 100644 index 00000000..8434703c Binary files /dev/null and b/main/gfx/env/gammu_bk.tga differ diff --git a/main/gfx/env/gammu_dn.tga b/main/gfx/env/gammu_dn.tga new file mode 100644 index 00000000..2659dfa2 Binary files /dev/null and b/main/gfx/env/gammu_dn.tga differ diff --git a/main/gfx/env/gammu_ft.tga b/main/gfx/env/gammu_ft.tga new file mode 100644 index 00000000..6ba6f204 Binary files /dev/null and b/main/gfx/env/gammu_ft.tga differ diff --git a/main/gfx/env/gammu_lf.tga b/main/gfx/env/gammu_lf.tga new file mode 100644 index 00000000..f6568489 Binary files /dev/null and b/main/gfx/env/gammu_lf.tga differ diff --git a/main/gfx/env/gammu_rt.tga b/main/gfx/env/gammu_rt.tga new file mode 100644 index 00000000..7fa473be Binary files /dev/null and b/main/gfx/env/gammu_rt.tga differ diff --git a/main/gfx/env/gammu_up.tga b/main/gfx/env/gammu_up.tga new file mode 100644 index 00000000..79b1ae25 Binary files /dev/null and b/main/gfx/env/gammu_up.tga differ diff --git a/main/gfx/env/lost_bk.tga b/main/gfx/env/lost_bk.tga new file mode 100644 index 00000000..d6ece5eb Binary files /dev/null and b/main/gfx/env/lost_bk.tga differ diff --git a/main/gfx/env/lost_dn.tga b/main/gfx/env/lost_dn.tga new file mode 100644 index 00000000..da0836f5 Binary files /dev/null and b/main/gfx/env/lost_dn.tga differ diff --git a/main/gfx/env/lost_ft.tga b/main/gfx/env/lost_ft.tga new file mode 100644 index 00000000..cd3b43d7 Binary files /dev/null and b/main/gfx/env/lost_ft.tga differ diff --git a/main/gfx/env/lost_lf.tga b/main/gfx/env/lost_lf.tga new file mode 100644 index 00000000..cd000816 Binary files /dev/null and b/main/gfx/env/lost_lf.tga differ diff --git a/main/gfx/env/lost_rt.tga b/main/gfx/env/lost_rt.tga new file mode 100644 index 00000000..ec706b97 Binary files /dev/null and b/main/gfx/env/lost_rt.tga differ diff --git a/main/gfx/env/lost_up.tga b/main/gfx/env/lost_up.tga new file mode 100644 index 00000000..43081538 Binary files /dev/null and b/main/gfx/env/lost_up.tga differ diff --git a/main/gfx/env/malrav3sky256_bk.tga b/main/gfx/env/malrav3sky256_bk.tga new file mode 100644 index 00000000..f4c09771 Binary files /dev/null and b/main/gfx/env/malrav3sky256_bk.tga differ diff --git a/main/gfx/env/malrav3sky256_dn.tga b/main/gfx/env/malrav3sky256_dn.tga new file mode 100644 index 00000000..af774d10 Binary files /dev/null and b/main/gfx/env/malrav3sky256_dn.tga differ diff --git a/main/gfx/env/malrav3sky256_ft.tga b/main/gfx/env/malrav3sky256_ft.tga new file mode 100644 index 00000000..f376f09b Binary files /dev/null and b/main/gfx/env/malrav3sky256_ft.tga differ diff --git a/main/gfx/env/malrav3sky256_lf.tga b/main/gfx/env/malrav3sky256_lf.tga new file mode 100644 index 00000000..d055348f Binary files /dev/null and b/main/gfx/env/malrav3sky256_lf.tga differ diff --git a/main/gfx/env/malrav3sky256_rt.tga b/main/gfx/env/malrav3sky256_rt.tga new file mode 100644 index 00000000..6ac07093 Binary files /dev/null and b/main/gfx/env/malrav3sky256_rt.tga differ diff --git a/main/gfx/env/malrav3sky256_up.tga b/main/gfx/env/malrav3sky256_up.tga new file mode 100644 index 00000000..b76bb407 Binary files /dev/null and b/main/gfx/env/malrav3sky256_up.tga differ diff --git a/main/gfx/env/mars2bk.tga b/main/gfx/env/mars2bk.tga new file mode 100644 index 00000000..fcd7bab3 Binary files /dev/null and b/main/gfx/env/mars2bk.tga differ diff --git a/main/gfx/env/mars2dn.tga b/main/gfx/env/mars2dn.tga new file mode 100644 index 00000000..0e0eb05a Binary files /dev/null and b/main/gfx/env/mars2dn.tga differ diff --git a/main/gfx/env/mars2ft.tga b/main/gfx/env/mars2ft.tga new file mode 100644 index 00000000..f22292e0 Binary files /dev/null and b/main/gfx/env/mars2ft.tga differ diff --git a/main/gfx/env/mars2lf.tga b/main/gfx/env/mars2lf.tga new file mode 100644 index 00000000..59f43355 Binary files /dev/null and b/main/gfx/env/mars2lf.tga differ diff --git a/main/gfx/env/mars2rt.tga b/main/gfx/env/mars2rt.tga new file mode 100644 index 00000000..b181d3d9 Binary files /dev/null and b/main/gfx/env/mars2rt.tga differ diff --git a/main/gfx/env/mars2up.tga b/main/gfx/env/mars2up.tga new file mode 100644 index 00000000..9c197f4d Binary files /dev/null and b/main/gfx/env/mars2up.tga differ diff --git a/main/gfx/env/mars_envbk.tga b/main/gfx/env/mars_envbk.tga new file mode 100644 index 00000000..b4ce3bda Binary files /dev/null and b/main/gfx/env/mars_envbk.tga differ diff --git a/main/gfx/env/mars_envdn.tga b/main/gfx/env/mars_envdn.tga new file mode 100644 index 00000000..2c190a3f Binary files /dev/null and b/main/gfx/env/mars_envdn.tga differ diff --git a/main/gfx/env/mars_envft.tga b/main/gfx/env/mars_envft.tga new file mode 100644 index 00000000..63007687 Binary files /dev/null and b/main/gfx/env/mars_envft.tga differ diff --git a/main/gfx/env/mars_envlf.tga b/main/gfx/env/mars_envlf.tga new file mode 100644 index 00000000..4ee82323 Binary files /dev/null and b/main/gfx/env/mars_envlf.tga differ diff --git a/main/gfx/env/mars_envrt.tga b/main/gfx/env/mars_envrt.tga new file mode 100644 index 00000000..a8980ffc Binary files /dev/null and b/main/gfx/env/mars_envrt.tga differ diff --git a/main/gfx/env/mars_envup.tga b/main/gfx/env/mars_envup.tga new file mode 100644 index 00000000..f5128f99 Binary files /dev/null and b/main/gfx/env/mars_envup.tga differ diff --git a/main/gfx/env/marsbk.tga b/main/gfx/env/marsbk.tga new file mode 100644 index 00000000..02fc06eb Binary files /dev/null and b/main/gfx/env/marsbk.tga differ diff --git a/main/gfx/env/marsdn.tga b/main/gfx/env/marsdn.tga new file mode 100644 index 00000000..b9d498d7 Binary files /dev/null and b/main/gfx/env/marsdn.tga differ diff --git a/main/gfx/env/marsft.tga b/main/gfx/env/marsft.tga new file mode 100644 index 00000000..4c5f3dd2 Binary files /dev/null and b/main/gfx/env/marsft.tga differ diff --git a/main/gfx/env/marslf.tga b/main/gfx/env/marslf.tga new file mode 100644 index 00000000..1d33ce26 Binary files /dev/null and b/main/gfx/env/marslf.tga differ diff --git a/main/gfx/env/marsrt.tga b/main/gfx/env/marsrt.tga new file mode 100644 index 00000000..829048c5 Binary files /dev/null and b/main/gfx/env/marsrt.tga differ diff --git a/main/gfx/env/marsup.tga b/main/gfx/env/marsup.tga new file mode 100644 index 00000000..e27a76b9 Binary files /dev/null and b/main/gfx/env/marsup.tga differ diff --git a/main/gfx/env/metal_bk.tga b/main/gfx/env/metal_bk.tga new file mode 100644 index 00000000..1d90880a Binary files /dev/null and b/main/gfx/env/metal_bk.tga differ diff --git a/main/gfx/env/metal_dn.tga b/main/gfx/env/metal_dn.tga new file mode 100644 index 00000000..d4513b9a Binary files /dev/null and b/main/gfx/env/metal_dn.tga differ diff --git a/main/gfx/env/metal_ft.tga b/main/gfx/env/metal_ft.tga new file mode 100644 index 00000000..ac6cf451 Binary files /dev/null and b/main/gfx/env/metal_ft.tga differ diff --git a/main/gfx/env/metal_lf.tga b/main/gfx/env/metal_lf.tga new file mode 100644 index 00000000..62c06d6a Binary files /dev/null and b/main/gfx/env/metal_lf.tga differ diff --git a/main/gfx/env/metal_rt.tga b/main/gfx/env/metal_rt.tga new file mode 100644 index 00000000..46f085cf Binary files /dev/null and b/main/gfx/env/metal_rt.tga differ diff --git a/main/gfx/env/metal_up.tga b/main/gfx/env/metal_up.tga new file mode 100644 index 00000000..b5110cf9 Binary files /dev/null and b/main/gfx/env/metal_up.tga differ diff --git a/main/gfx/env/mora_bk.tga b/main/gfx/env/mora_bk.tga new file mode 100644 index 00000000..c574a013 Binary files /dev/null and b/main/gfx/env/mora_bk.tga differ diff --git a/main/gfx/env/mora_dn.tga b/main/gfx/env/mora_dn.tga new file mode 100644 index 00000000..7df81fa2 Binary files /dev/null and b/main/gfx/env/mora_dn.tga differ diff --git a/main/gfx/env/mora_ft.tga b/main/gfx/env/mora_ft.tga new file mode 100644 index 00000000..62f4ec6d Binary files /dev/null and b/main/gfx/env/mora_ft.tga differ diff --git a/main/gfx/env/mora_lf.tga b/main/gfx/env/mora_lf.tga new file mode 100644 index 00000000..0f5bab04 Binary files /dev/null and b/main/gfx/env/mora_lf.tga differ diff --git a/main/gfx/env/mora_rt.tga b/main/gfx/env/mora_rt.tga new file mode 100644 index 00000000..6f7a05ff Binary files /dev/null and b/main/gfx/env/mora_rt.tga differ diff --git a/main/gfx/env/mora_up.tga b/main/gfx/env/mora_up.tga new file mode 100644 index 00000000..a9aedab5 Binary files /dev/null and b/main/gfx/env/mora_up.tga differ diff --git a/main/gfx/env/td2bk.tga b/main/gfx/env/td2bk.tga new file mode 100644 index 00000000..75e2b355 Binary files /dev/null and b/main/gfx/env/td2bk.tga differ diff --git a/main/gfx/env/td2dn.tga b/main/gfx/env/td2dn.tga new file mode 100644 index 00000000..494a3d51 Binary files /dev/null and b/main/gfx/env/td2dn.tga differ diff --git a/main/gfx/env/td2ft.tga b/main/gfx/env/td2ft.tga new file mode 100644 index 00000000..a4128e19 Binary files /dev/null and b/main/gfx/env/td2ft.tga differ diff --git a/main/gfx/env/td2lf.tga b/main/gfx/env/td2lf.tga new file mode 100644 index 00000000..5cae2217 Binary files /dev/null and b/main/gfx/env/td2lf.tga differ diff --git a/main/gfx/env/td2rt.tga b/main/gfx/env/td2rt.tga new file mode 100644 index 00000000..dc42f20f Binary files /dev/null and b/main/gfx/env/td2rt.tga differ diff --git a/main/gfx/env/td2up.tga b/main/gfx/env/td2up.tga new file mode 100644 index 00000000..65c595c5 Binary files /dev/null and b/main/gfx/env/td2up.tga differ diff --git a/main/gfx/env/veil_bk.tga b/main/gfx/env/veil_bk.tga new file mode 100644 index 00000000..7bde9d90 Binary files /dev/null and b/main/gfx/env/veil_bk.tga differ diff --git a/main/gfx/env/veil_dn.tga b/main/gfx/env/veil_dn.tga new file mode 100644 index 00000000..3f603366 Binary files /dev/null and b/main/gfx/env/veil_dn.tga differ diff --git a/main/gfx/env/veil_ft.tga b/main/gfx/env/veil_ft.tga new file mode 100644 index 00000000..7e7e2e50 Binary files /dev/null and b/main/gfx/env/veil_ft.tga differ diff --git a/main/gfx/env/veil_lf.tga b/main/gfx/env/veil_lf.tga new file mode 100644 index 00000000..01ef159d Binary files /dev/null and b/main/gfx/env/veil_lf.tga differ diff --git a/main/gfx/env/veil_rt.tga b/main/gfx/env/veil_rt.tga new file mode 100644 index 00000000..182f7e82 Binary files /dev/null and b/main/gfx/env/veil_rt.tga differ diff --git a/main/gfx/env/veil_up.tga b/main/gfx/env/veil_up.tga new file mode 100644 index 00000000..c421c3cc Binary files /dev/null and b/main/gfx/env/veil_up.tga differ diff --git a/main/gfx/shell/Colors.lst b/main/gfx/shell/Colors.lst new file mode 100644 index 00000000..22c01cfd --- /dev/null +++ b/main/gfx/shell/Colors.lst @@ -0,0 +1,9 @@ +HELP_COLOR 243 199 79 +PROMPT_BG_COLOR 56 56 56 +PROMPT_TEXT_COLOR 184 125 55 +PROMPT_TITLE_COLOR 184 125 55 +INPUT_TEXT_COLOR 184 125 55 +INPUT_BG_COLOR 56 56 56 +REFRESH_TITLE_COLOR 184 125 55 +REFRESH_TEXT_COLOR 184 125 55 +REFRESH_BG_COLOR 56 56 56 diff --git a/main/gfx/shell/Logo.bmp b/main/gfx/shell/Logo.bmp new file mode 100644 index 00000000..9b0d6179 Binary files /dev/null and b/main/gfx/shell/Logo.bmp differ diff --git a/main/gfx/shell/btns_main.bmp b/main/gfx/shell/btns_main.bmp new file mode 100644 index 00000000..9a5059a8 Binary files /dev/null and b/main/gfx/shell/btns_main.bmp differ diff --git a/main/gfx/shell/cb_checked.bmp b/main/gfx/shell/cb_checked.bmp new file mode 100644 index 00000000..7243151e Binary files /dev/null and b/main/gfx/shell/cb_checked.bmp differ diff --git a/main/gfx/shell/cb_disabled.bmp b/main/gfx/shell/cb_disabled.bmp new file mode 100644 index 00000000..940c0129 Binary files /dev/null and b/main/gfx/shell/cb_disabled.bmp differ diff --git a/main/gfx/shell/cb_down.bmp b/main/gfx/shell/cb_down.bmp new file mode 100644 index 00000000..056bd45c Binary files /dev/null and b/main/gfx/shell/cb_down.bmp differ diff --git a/main/gfx/shell/cb_empty.bmp b/main/gfx/shell/cb_empty.bmp new file mode 100644 index 00000000..c6d00b88 Binary files /dev/null and b/main/gfx/shell/cb_empty.bmp differ diff --git a/main/gfx/shell/cb_over.bmp b/main/gfx/shell/cb_over.bmp new file mode 100644 index 00000000..1469609f Binary files /dev/null and b/main/gfx/shell/cb_over.bmp differ diff --git a/main/gfx/shell/cls_d.bmp b/main/gfx/shell/cls_d.bmp new file mode 100644 index 00000000..d664d9d9 Binary files /dev/null and b/main/gfx/shell/cls_d.bmp differ diff --git a/main/gfx/shell/cls_f.bmp b/main/gfx/shell/cls_f.bmp new file mode 100644 index 00000000..54f30c47 Binary files /dev/null and b/main/gfx/shell/cls_f.bmp differ diff --git a/main/gfx/shell/cls_n.bmp b/main/gfx/shell/cls_n.bmp new file mode 100644 index 00000000..7243151e Binary files /dev/null and b/main/gfx/shell/cls_n.bmp differ diff --git a/main/gfx/shell/dedicate.bmp b/main/gfx/shell/dedicate.bmp new file mode 100644 index 00000000..114eb181 Binary files /dev/null and b/main/gfx/shell/dedicate.bmp differ diff --git a/main/gfx/shell/divider.bmp b/main/gfx/shell/divider.bmp new file mode 100644 index 00000000..340271b3 Binary files /dev/null and b/main/gfx/shell/divider.bmp differ diff --git a/main/gfx/shell/dnarrowd.bmp b/main/gfx/shell/dnarrowd.bmp new file mode 100644 index 00000000..e8262f38 Binary files /dev/null and b/main/gfx/shell/dnarrowd.bmp differ diff --git a/main/gfx/shell/dnarrowf.bmp b/main/gfx/shell/dnarrowf.bmp new file mode 100644 index 00000000..6cf4d357 Binary files /dev/null and b/main/gfx/shell/dnarrowf.bmp differ diff --git a/main/gfx/shell/dnarrowp.bmp b/main/gfx/shell/dnarrowp.bmp new file mode 100644 index 00000000..85b2fd60 Binary files /dev/null and b/main/gfx/shell/dnarrowp.bmp differ diff --git a/main/gfx/shell/down.bmp b/main/gfx/shell/down.bmp new file mode 100644 index 00000000..fa4079fa Binary files /dev/null and b/main/gfx/shell/down.bmp differ diff --git a/main/gfx/shell/favorite.bmp b/main/gfx/shell/favorite.bmp new file mode 100644 index 00000000..9772d4f8 Binary files /dev/null and b/main/gfx/shell/favorite.bmp differ diff --git a/main/gfx/shell/gamma.bmp b/main/gfx/shell/gamma.bmp new file mode 100644 index 00000000..0623f837 Binary files /dev/null and b/main/gfx/shell/gamma.bmp differ diff --git a/main/gfx/shell/head_advanced.BMP b/main/gfx/shell/head_advanced.BMP new file mode 100644 index 00000000..28cf1380 Binary files /dev/null and b/main/gfx/shell/head_advanced.BMP differ diff --git a/main/gfx/shell/head_advoptions.bmp b/main/gfx/shell/head_advoptions.bmp new file mode 100644 index 00000000..116cd4fa Binary files /dev/null and b/main/gfx/shell/head_advoptions.bmp differ diff --git a/main/gfx/shell/head_audio.BMP b/main/gfx/shell/head_audio.BMP new file mode 100644 index 00000000..07ca0fcd Binary files /dev/null and b/main/gfx/shell/head_audio.BMP differ diff --git a/main/gfx/shell/head_config.BMP b/main/gfx/shell/head_config.BMP new file mode 100644 index 00000000..ac6e6153 Binary files /dev/null and b/main/gfx/shell/head_config.BMP differ diff --git a/main/gfx/shell/head_controls.BMP b/main/gfx/shell/head_controls.BMP new file mode 100644 index 00000000..5c1cb981 Binary files /dev/null and b/main/gfx/shell/head_controls.BMP differ diff --git a/main/gfx/shell/head_creategame.bmp b/main/gfx/shell/head_creategame.bmp new file mode 100644 index 00000000..bfd6115e Binary files /dev/null and b/main/gfx/shell/head_creategame.bmp differ diff --git a/main/gfx/shell/head_createroom.bmp b/main/gfx/shell/head_createroom.bmp new file mode 100644 index 00000000..721e378c Binary files /dev/null and b/main/gfx/shell/head_createroom.bmp differ diff --git a/main/gfx/shell/head_custom.bmp b/main/gfx/shell/head_custom.bmp new file mode 100644 index 00000000..8c9201fd Binary files /dev/null and b/main/gfx/shell/head_custom.bmp differ diff --git a/main/gfx/shell/head_customize.BMP b/main/gfx/shell/head_customize.BMP new file mode 100644 index 00000000..12ea570c Binary files /dev/null and b/main/gfx/shell/head_customize.BMP differ diff --git a/main/gfx/shell/head_filter.BMP b/main/gfx/shell/head_filter.BMP new file mode 100644 index 00000000..69e94794 Binary files /dev/null and b/main/gfx/shell/head_filter.BMP differ diff --git a/main/gfx/shell/head_gameopts.BMP b/main/gfx/shell/head_gameopts.BMP new file mode 100644 index 00000000..dfa7bf17 Binary files /dev/null and b/main/gfx/shell/head_gameopts.BMP differ diff --git a/main/gfx/shell/head_gore.bmp b/main/gfx/shell/head_gore.bmp new file mode 100644 index 00000000..356b0d63 Binary files /dev/null and b/main/gfx/shell/head_gore.bmp differ diff --git a/main/gfx/shell/head_inetgames.BMP b/main/gfx/shell/head_inetgames.BMP new file mode 100644 index 00000000..6adfa745 Binary files /dev/null and b/main/gfx/shell/head_inetgames.BMP differ diff --git a/main/gfx/shell/head_keyboard.BMP b/main/gfx/shell/head_keyboard.BMP new file mode 100644 index 00000000..59ea93f1 Binary files /dev/null and b/main/gfx/shell/head_keyboard.BMP differ diff --git a/main/gfx/shell/head_lan.BMP b/main/gfx/shell/head_lan.BMP new file mode 100644 index 00000000..65826c9f Binary files /dev/null and b/main/gfx/shell/head_lan.BMP differ diff --git a/main/gfx/shell/head_load.bmp b/main/gfx/shell/head_load.bmp new file mode 100644 index 00000000..b098c96c Binary files /dev/null and b/main/gfx/shell/head_load.bmp differ diff --git a/main/gfx/shell/head_multi.bmp b/main/gfx/shell/head_multi.bmp new file mode 100644 index 00000000..4e2e88cb Binary files /dev/null and b/main/gfx/shell/head_multi.bmp differ diff --git a/main/gfx/shell/head_newgame.bmp b/main/gfx/shell/head_newgame.bmp new file mode 100644 index 00000000..1eb6d60a Binary files /dev/null and b/main/gfx/shell/head_newgame.bmp differ diff --git a/main/gfx/shell/head_readme.BMP b/main/gfx/shell/head_readme.BMP new file mode 100644 index 00000000..370dea7a Binary files /dev/null and b/main/gfx/shell/head_readme.BMP differ diff --git a/main/gfx/shell/head_room.BMP b/main/gfx/shell/head_room.BMP new file mode 100644 index 00000000..fb295d65 Binary files /dev/null and b/main/gfx/shell/head_room.BMP differ diff --git a/main/gfx/shell/head_rooms.BMP b/main/gfx/shell/head_rooms.BMP new file mode 100644 index 00000000..fb788529 Binary files /dev/null and b/main/gfx/shell/head_rooms.BMP differ diff --git a/main/gfx/shell/head_save.bmp b/main/gfx/shell/head_save.bmp new file mode 100644 index 00000000..bb5553fd Binary files /dev/null and b/main/gfx/shell/head_save.bmp differ diff --git a/main/gfx/shell/head_saveload.bmp b/main/gfx/shell/head_saveload.bmp new file mode 100644 index 00000000..f454fb7a Binary files /dev/null and b/main/gfx/shell/head_saveload.bmp differ diff --git a/main/gfx/shell/head_single.BMP b/main/gfx/shell/head_single.BMP new file mode 100644 index 00000000..18384728 Binary files /dev/null and b/main/gfx/shell/head_single.BMP differ diff --git a/main/gfx/shell/head_video.BMP b/main/gfx/shell/head_video.BMP new file mode 100644 index 00000000..6e1736a3 Binary files /dev/null and b/main/gfx/shell/head_video.BMP differ diff --git a/main/gfx/shell/head_vidmodes.BMP b/main/gfx/shell/head_vidmodes.BMP new file mode 100644 index 00000000..7faa440e Binary files /dev/null and b/main/gfx/shell/head_vidmodes.BMP differ diff --git a/main/gfx/shell/head_vidoptions.bmp b/main/gfx/shell/head_vidoptions.bmp new file mode 100644 index 00000000..53920ef8 Binary files /dev/null and b/main/gfx/shell/head_vidoptions.bmp differ diff --git a/main/gfx/shell/kb_act.lst b/main/gfx/shell/kb_act.lst new file mode 100644 index 00000000..bf5d0c3e --- /dev/null +++ b/main/gfx/shell/kb_act.lst @@ -0,0 +1,94 @@ +"blank" "==========================" +"blank" " Movement" +"blank" "==========================" +"+forward" "Move forward" +"+back" "Move backward" +"+moveleft" "Move left (strafe)" +"+moveright" "Move right (strafe)" +"+left" "Turn left (optional)" +"+right" "Turn right (optional)" +"+jump" "Jump" +"+duck" "Duck" +"+speed" "Walk" +"+moveup" "Swim up" +"+movedown" "Swim down" +"+lookup" "Look up" +"+lookdown" "Look down" +"centerview" "Look straight ahead" +"+strafe" "Strafe modifier" +"+mlook" "Mouse look modifier" +"+klook" "Keyboard look modifier" +"blank" "==========================" +"blank" " Weapons and items" +"blank" "==========================" +"+attack" "Attack (important)" +"+use" "Use/build" +"+reload" "Reload weapon" +"impulse 100" "Flashlight" +"+showmap" "Show map" +"+showscores" "Display multiplayer scores" +"slot1" "Weapon category 1" +"slot2" "Weapon category 2" +"slot3" "Weapon category 3" +"slot4" "Weapon category 4" +"slot5" "Weapon category 5" +"invprev" "Previous weapon" +"impulse 1" "Next weapon" +"impulse 3" "Drop weapon" +"lastinv" "Last used weapon" +"blank" "==========================" +"blank" " Communication" +"blank" "==========================" +"+popupmenu" "Pop-up menu (important)" +"+voicerecord" "Use voice communication" +"impulse 9" "Taunt" +"messagemode" "Chat message" +"messagemode2" "Team message" +"blank" "==========================" +"blank" " Marine hotkeys" +"blank" "==========================" +"impulse 80" "Request orders" +"impulse 81" "Acknowledge orders" +"impulse 10" "Need health" +"impulse 11" "Need ammo" +"blank" "==========================" +"blank" " Commander hotkeys" +"blank" "==========================" +"impulse 105" "Select all soldiers" +"impulse 123" "Go to order request" +"impulse 124" "Go to ammo request" +"impulse 125" "Go to health request" +"blank" "==========================" +"blank" " Alien hotkeys" +"blank" "==========================" +"impulse 90" "Build resource tower" +"impulse 91" "Build offensive chamber" +"impulse 92" "Build defense chamber" +"impulse 93" "Build sensory chamber" +"impulse 94" "Build movement chamber" +"impulse 95" "Build hive" +"impulse 113" "Morph to Skulk" +"impulse 114" "Morph to Gorge" +"impulse 115" "Morph to Lerk" +"impulse 116" "Morph to Fade" +"impulse 117" "Morph to Onos" +"impulse 101" "Evolve Carapace" +"impulse 102" "Evolve Regeneration" +"impulse 103" "Evolve Redemption" +"impulse 107" "Evolve Celerity" +"impulse 108" "Evolve Adrenaline" +"impulse 109" "Evolve Silence" +"impulse 110" "Evolve Cloaking" +"impulse 111" "Evolve Pheromones" +"impulse 112" "Evolve Scent of Fear" +"blank" "==========================" +"blank" " Miscellaneous" +"blank" "==========================" +"jointeamone" "Join Marines" +"jointeamtwo" "Join Aliens" +"autoassign" "Auto Assign" +"readyroom" "Readyroom" +"impulse 201" "Spray logo" +"snapshot" "Take screen shot" +"pause" "Pause game" +"quit" "Quit game" \ No newline at end of file diff --git a/main/gfx/shell/kb_def.lst b/main/gfx/shell/kb_def.lst new file mode 100644 index 00000000..404dbb52 --- /dev/null +++ b/main/gfx/shell/kb_def.lst @@ -0,0 +1,63 @@ +"w" "+forward" +"UPARROW" "+scrollup" +"DOWNARROW" "+scrolldown" +"s" "+back" +"LEFTARROW" "+scrollleft" +"RIGHTARROW" "+scrollright" +"a" "+moveleft" +"d" "+moveright" +"SPACE" "+jump" +"CTRL" "+duck" +"TAB" "+showscores" +"e" "+use" +"'" "+moveup" +"PGUP" "+lookup" +"PGDN" "+lookdown" +"END" "centerview" +"INS" "+klook" +";" "+mlook" +"c" "+showmap" +"r" "+reload" +"SHIFT" "+speed" +"MOUSE1" "+attack" +"MOUSE2" "+popupmenu" +"MOUSE3" "+popupmenu" +"f" "impulse 100" +"g" "impulse 3" +"," "impulse 123" +"." "impulse 124" +"/" "impulse 125" +"z" "impulse 80" +"x" "impulse 81" +"v" "impulse 9" +"l" "impulse 105" +"1" "slot1" +"2" "slot2" +"3" "slot3" +"4" "slot4" +"5" "slot5" +"MWHEELUP" "invprev" +"[" "invprev" +"MWHEELDOWN" "invnext" +"]" "invnext" +"F10" "quit prompt" +"PAUSE" "pause" +"ESCAPE" "escape" +"`" "console 1.0; toggleconsole" +"~" "console 1.0; toggleconsole" +"+" "sizeup" +"=" "sizeup" +"-" "sizedown" +"t" "impulse 201" +"ENTER" "messagemode" +"y" "messagemode2" +"ALT" "+voicerecord" +"F1" "jointeamone" +"F2" "jointeamtwo" +"F3" "addbot" +"F4" "readyroom" +"F5" "snapshot" +"F7" "editps" + + + diff --git a/main/gfx/shell/kb_keys.lst b/main/gfx/shell/kb_keys.lst new file mode 100644 index 00000000..0efd7b84 --- /dev/null +++ b/main/gfx/shell/kb_keys.lst @@ -0,0 +1,256 @@ +0 "" "" DEFAULTCOLOR +1 "" "" DEFAULTCOLOR +2 "" "" DEFAULTCOLOR +3 "" "" DEFAULTCOLOR +4 "" "" DEFAULTCOLOR +5 "" "" DEFAULTCOLOR +6 "" "" DEFAULTCOLOR +7 "" "" DEFAULTCOLOR +8 "" "" DEFAULTCOLOR +9 "TAB" "TAB" DEFAULTCOLOR +10 "" "" DEFAULTCOLOR +11 "" "" DEFAULTCOLOR +12 "" "" DEFAULTCOLOR +13 "ENTER" "ENTER" DEFAULTCOLOR +14 "" "" DEFAULTCOLOR +15 "" "" DEFAULTCOLOR +16 "" "" DEFAULTCOLOR +17 "" "" DEFAULTCOLOR +18 "" "" DEFAULTCOLOR +19 "" "" DEFAULTCOLOR +20 "" "" DEFAULTCOLOR +21 "" "" DEFAULTCOLOR +22 "" "" DEFAULTCOLOR +23 "" "" DEFAULTCOLOR +24 "" "" DEFAULTCOLOR +25 "" "" DEFAULTCOLOR +26 "" "" DEFAULTCOLOR +27 "ESCAPE" "ESCAPE" DEFAULTCOLOR +28 "" "" DEFAULTCOLOR +29 "" "" DEFAULTCOLOR +30 "" "" DEFAULTCOLOR +31 "" "" DEFAULTCOLOR +32 "SPACE" "SPACE" DEFAULTCOLOR +33 "!" "!" DEFAULTCOLOR +34 """ """ DEFAULTCOLOR +35 "#" "#" DEFAULTCOLOR +36 "$" "$" DEFAULTCOLOR +37 "BACKSPACE" "BACKSPACE" DEFAULTCOLOR +38 "&" "&" DEFAULTCOLOR +39 "'" "'" DEFAULTCOLOR +40 "(" "(" DEFAULTCOLOR +41 ")" ")" DEFAULTCOLOR +42 "*" "*" DEFAULTCOLOR +43 "+" "+" DEFAULTCOLOR +44 "," "," DEFAULTCOLOR +45 "-" "-" DEFAULTCOLOR +46 "." "." DEFAULTCOLOR +47 "/" "/" DEFAULTCOLOR +48 "0" "0" DEFAULTCOLOR +49 "1" "1" DEFAULTCOLOR +50 "2" "2" DEFAULTCOLOR +51 "3" "3" DEFAULTCOLOR +52 "4" "4" DEFAULTCOLOR +53 "5" "5" DEFAULTCOLOR +54 "6" "6" DEFAULTCOLOR +55 "7" "7" DEFAULTCOLOR +56 "8" "8" DEFAULTCOLOR +57 "9" "9" DEFAULTCOLOR +58 ":" ":" DEFAULTCOLOR +59 ";" ";" DEFAULTCOLOR +60 "<" "<" DEFAULTCOLOR +61 "=" "=" DEFAULTCOLOR +62 ">" ">" DEFAULTCOLOR +63 "?" "?" DEFAULTCOLOR +64 "@" "@" DEFAULTCOLOR +65 "A" "A" DEFAULTCOLOR +66 "B" "B" DEFAULTCOLOR +67 "C" "C" DEFAULTCOLOR +68 "D" "D" DEFAULTCOLOR +69 "E" "E" DEFAULTCOLOR +70 "F" "F" DEFAULTCOLOR +71 "G" "G" DEFAULTCOLOR +72 "H" "H" DEFAULTCOLOR +73 "I" "I" DEFAULTCOLOR +74 "J" "J" DEFAULTCOLOR +75 "K" "K" DEFAULTCOLOR +76 "L" "L" DEFAULTCOLOR +77 "M" "M" DEFAULTCOLOR +78 "N" "N" DEFAULTCOLOR +79 "O" "O" DEFAULTCOLOR +80 "P" "P" DEFAULTCOLOR +81 "Q" "Q" DEFAULTCOLOR +82 "R" "R" DEFAULTCOLOR +83 "S" "S" DEFAULTCOLOR +84 "T" "T" DEFAULTCOLOR +85 "U" "U" DEFAULTCOLOR +86 "V" "V" DEFAULTCOLOR +87 "W" "W" DEFAULTCOLOR +88 "X" "X" DEFAULTCOLOR +89 "Y" "Y" DEFAULTCOLOR +90 "Z" "Z" DEFAULTCOLOR +91 "[" "[" DEFAULTCOLOR +92 "\" "\" DEFAULTCOLOR +93 "]" "]" DEFAULTCOLOR +94 "^" "^" DEFAULTCOLOR +95 "_" "_" DEFAULTCOLOR +96 "`" "`" DEFAULTCOLOR +97 "a" "a" DEFAULTCOLOR +98 "b" "b" DEFAULTCOLOR +99 "c" "c" DEFAULTCOLOR +100 "d" "d" DEFAULTCOLOR +101 "e" "e" DEFAULTCOLOR +102 "f" "f" DEFAULTCOLOR +103 "g" "g" DEFAULTCOLOR +104 "h" "h" DEFAULTCOLOR +105 "i" "i" DEFAULTCOLOR +106 "j" "j" DEFAULTCOLOR +107 "k" "k" DEFAULTCOLOR +108 "l" "l" DEFAULTCOLOR +109 "m" "m" DEFAULTCOLOR +110 "n" "n" DEFAULTCOLOR +111 "o" "o" DEFAULTCOLOR +112 "p" "p" DEFAULTCOLOR +113 "q" "q" DEFAULTCOLOR +114 "r" "r" DEFAULTCOLOR +115 "s" "s" DEFAULTCOLOR +116 "t" "t" DEFAULTCOLOR +117 "u" "u" DEFAULTCOLOR +118 "v" "v" DEFAULTCOLOR +119 "w" "w" DEFAULTCOLOR +120 "x" "x" DEFAULTCOLOR +121 "y" "y" DEFAULTCOLOR +122 "z" "z" DEFAULTCOLOR +123 "{" "{" DEFAULTCOLOR +124 "|" "|" DEFAULTCOLOR +125 "}" "}" DEFAULTCOLOR +126 "~" "~" DEFAULTCOLOR +127 "BACKSPACE" "BACKSPACE" DEFAULTCOLOR +128 "UPARROW" "UPARROW" DEFAULTCOLOR +129 "DOWNARROW" "DOWNARROW" DEFAULTCOLOR +130 "LEFTARROW" "LEFTARROW" DEFAULTCOLOR +131 "RIGHTARROW" "RIGHTARROW" DEFAULTCOLOR +132 "ALT" "ALT" DEFAULTCOLOR +133 "CTRL" "CTRL" DEFAULTCOLOR +134 "SHIFT" "SHIFT" DEFAULTCOLOR +135 "F1" "F1" DEFAULTCOLOR +136 "F2" "F2" DEFAULTCOLOR +137 "F3" "F3" DEFAULTCOLOR +138 "F4" "F4" DEFAULTCOLOR +139 "F5" "F5" DEFAULTCOLOR +140 "F6" "F6" DEFAULTCOLOR +141 "F7" "F7" DEFAULTCOLOR +142 "F8" "F8" DEFAULTCOLOR +143 "F9" "F9" DEFAULTCOLOR +144 "F10" "F10" DEFAULTCOLOR +145 "F11" "F11" DEFAULTCOLOR +146 "F12" "F12" DEFAULTCOLOR +147 "INS" "INS" DEFAULTCOLOR +148 "DEL" "DEL" DEFAULTCOLOR +149 "PGDN" "PGDN" DEFAULTCOLOR +150 "PGUP" "PGUP" DEFAULTCOLOR +151 "HOME" "HOME" DEFAULTCOLOR +152 "END" "END" DEFAULTCOLOR +153 "" "" DEFAULTCOLOR +154 "" "" DEFAULTCOLOR +155 "" "" DEFAULTCOLOR +156 "" "" DEFAULTCOLOR +157 "" "" DEFAULTCOLOR +158 "" "" DEFAULTCOLOR +159 "" "" DEFAULTCOLOR +160 "KP_HOME" "KP_HOME" DEFAULTCOLOR +161 "KP_UPARROW" "KP_UPARROW" DEFAULTCOLOR +162 "KP_PGUP" "KP_PGUP" DEFAULTCOLOR +163 "KP_LEFTARROW" "KP_LEFTARROW" DEFAULTCOLOR +164 "KP_5" "KP_5" DEFAULTCOLOR +165 "KP_RIGHTARROW" "KP_RIGHTARROW" DEFAULTCOLOR +166 "KP_END" "KP_END" DEFAULTCOLOR +167 "KP_DOWNARROW" "KP_DOWNARROW" DEFAULTCOLOR +168 "KP_PGDN" "KP_PGDN" DEFAULTCOLOR +169 "KP_ENTER" "KP_ENTER" DEFAULTCOLOR +170 "KP_INS" "KP_INS" DEFAULTCOLOR +171 "KP_DEL" "KP_DEL" DEFAULTCOLOR +172 "KP_SLASH" "KP_SLASH" DEFAULTCOLOR +173 "KP_MINUS" "KP_MINUS" DEFAULTCOLOR +174 "KP_PLUS" "KP_PLUS" DEFAULTCOLOR +175 "" "" DEFAULTCOLOR +176 "" "" DEFAULTCOLOR +177 "" "" DEFAULTCOLOR +178 "" "" DEFAULTCOLOR +179 "" "" DEFAULTCOLOR +180 "" "" DEFAULTCOLOR +181 "" "" DEFAULTCOLOR +182 "" "" DEFAULTCOLOR +183 "" "" DEFAULTCOLOR +184 "" "" DEFAULTCOLOR +185 "" "" DEFAULTCOLOR +186 "" "" DEFAULTCOLOR +187 "" "" DEFAULTCOLOR +188 "" "" DEFAULTCOLOR +189 "" "" DEFAULTCOLOR +190 "" "" DEFAULTCOLOR +191 "" "" DEFAULTCOLOR +192 "" "" DEFAULTCOLOR +193 "" "" DEFAULTCOLOR +194 "" "" DEFAULTCOLOR +195 "" "" DEFAULTCOLOR +196 "" "" DEFAULTCOLOR +197 "" "" DEFAULTCOLOR +198 "" "" DEFAULTCOLOR +199 "" "" DEFAULTCOLOR +200 "" "" DEFAULTCOLOR +201 "" "" DEFAULTCOLOR +202 "" "" DEFAULTCOLOR +203 "JOY1" "JOY1" COLOR 255 0 0 +204 "JOY2" "JOY2" COLOR 255 0 0 +205 "JOY3" "JOY3" COLOR 255 0 0 +206 "JOY4" "JOY4" COLOR 255 0 0 +207 "AUX1" "AUX1" DEFAULTCOLOR +208 "AUX2" "AUX2" DEFAULTCOLOR +209 "AUX3" "AUX3" DEFAULTCOLOR +210 "AUX4" "AUX4" DEFAULTCOLOR +211 "AUX5" "AUX5" DEFAULTCOLOR +212 "AUX6" "AUX6" DEFAULTCOLOR +213 "AUX7" "AUX7" DEFAULTCOLOR +214 "AUX8" "AUX8" DEFAULTCOLOR +215 "AUX9" "AUX9" DEFAULTCOLOR +216 "AUX10" "AUX10" DEFAULTCOLOR +217 "AUX11" "AUX11" DEFAULTCOLOR +218 "AUX12" "AUX12" DEFAULTCOLOR +219 "AUX13" "AUX13" DEFAULTCOLOR +220 "AUX14" "AUX14" DEFAULTCOLOR +221 "AUX15" "AUX15" DEFAULTCOLOR +222 "AUX16" "AUX16" DEFAULTCOLOR +223 "AUX17" "AUX17" DEFAULTCOLOR +224 "AUX18" "AUX18" DEFAULTCOLOR +225 "AUX19" "AUX19" DEFAULTCOLOR +226 "AUX20" "AUX20" DEFAULTCOLOR +227 "AUX21" "AUX21" DEFAULTCOLOR +228 "AUX22" "AUX22" DEFAULTCOLOR +229 "AUX23" "AUX23" DEFAULTCOLOR +230 "AUX24" "AUX24" DEFAULTCOLOR +231 "AUX25" "AUX25" DEFAULTCOLOR +232 "AUX26" "AUX26" DEFAULTCOLOR +233 "AUX27" "AUX27" DEFAULTCOLOR +234 "AUX28" "AUX28" DEFAULTCOLOR +235 "AUX29" "AUX29" DEFAULTCOLOR +236 "AUX30" "AUX30" DEFAULTCOLOR +237 "AUX31" "AUX31" DEFAULTCOLOR +238 "AUX32" "AUX32" DEFAULTCOLOR +239 "MWHEELDOWN" "MWHEELDOWN" DEFAULTCOLOR +240 "MWHEELUP" "MWHEELUP" DEFAULTCOLOR +241 "MOUSE1" "MOUSE1" COLOR 0 255 255 +242 "MOUSE2" "MOUSE2" COLOR 0 255 255 +243 "MOUSE3" "MOUSE3" COLOR 0 255 255 +244 "MOUSE4" "MOUSE4" COLOR 0 255 255 +245 "MOUSE5" "MOUSE5" COLOR 0 255 255 +246 "" "" DEFAULTCOLOR +247 "" "" DEFAULTCOLOR +248 "" "" DEFAULTCOLOR +249 "" "" DEFAULTCOLOR +250 "" "" DEFAULTCOLOR +251 "" "" DEFAULTCOLOR +252 "" "" DEFAULTCOLOR +253 "" "" DEFAULTCOLOR +254 "" "" DEFAULTCOLOR +255 "PAUSE" "PAUSE" DEFAULTCOLOR diff --git a/main/gfx/shell/larrowdefault.bmp b/main/gfx/shell/larrowdefault.bmp new file mode 100644 index 00000000..3c4a66fb Binary files /dev/null and b/main/gfx/shell/larrowdefault.bmp differ diff --git a/main/gfx/shell/larrowflyover.bmp b/main/gfx/shell/larrowflyover.bmp new file mode 100644 index 00000000..7a3863d9 Binary files /dev/null and b/main/gfx/shell/larrowflyover.bmp differ diff --git a/main/gfx/shell/larrowpressed.bmp b/main/gfx/shell/larrowpressed.bmp new file mode 100644 index 00000000..0e94f1e3 Binary files /dev/null and b/main/gfx/shell/larrowpressed.bmp differ diff --git a/main/gfx/shell/linux.bmp b/main/gfx/shell/linux.bmp new file mode 100644 index 00000000..249985bc Binary files /dev/null and b/main/gfx/shell/linux.bmp differ diff --git a/main/gfx/shell/listen.bmp b/main/gfx/shell/listen.bmp new file mode 100644 index 00000000..48cf1886 Binary files /dev/null and b/main/gfx/shell/listen.bmp differ diff --git a/main/gfx/shell/lock.bmp b/main/gfx/shell/lock.bmp new file mode 100644 index 00000000..c1e6e707 Binary files /dev/null and b/main/gfx/shell/lock.bmp differ diff --git a/main/gfx/shell/min_d.bmp b/main/gfx/shell/min_d.bmp new file mode 100644 index 00000000..a36ba7d3 Binary files /dev/null and b/main/gfx/shell/min_d.bmp differ diff --git a/main/gfx/shell/min_f.bmp b/main/gfx/shell/min_f.bmp new file mode 100644 index 00000000..4b8e527b Binary files /dev/null and b/main/gfx/shell/min_f.bmp differ diff --git a/main/gfx/shell/min_n.bmp b/main/gfx/shell/min_n.bmp new file mode 100644 index 00000000..dbd0b1d1 Binary files /dev/null and b/main/gfx/shell/min_n.bmp differ diff --git a/main/gfx/shell/nonfav.bmp b/main/gfx/shell/nonfav.bmp new file mode 100644 index 00000000..d17ae53d Binary files /dev/null and b/main/gfx/shell/nonfav.bmp differ diff --git a/main/gfx/shell/pcg.bmp b/main/gfx/shell/pcg.bmp new file mode 100644 index 00000000..08f582ed Binary files /dev/null and b/main/gfx/shell/pcg.bmp differ diff --git a/main/gfx/shell/rarrowdefault.bmp b/main/gfx/shell/rarrowdefault.bmp new file mode 100644 index 00000000..2dee3462 Binary files /dev/null and b/main/gfx/shell/rarrowdefault.bmp differ diff --git a/main/gfx/shell/rarrowflyover.bmp b/main/gfx/shell/rarrowflyover.bmp new file mode 100644 index 00000000..59e99b4b Binary files /dev/null and b/main/gfx/shell/rarrowflyover.bmp differ diff --git a/main/gfx/shell/rarrowpressed.bmp b/main/gfx/shell/rarrowpressed.bmp new file mode 100644 index 00000000..553c8d2d Binary files /dev/null and b/main/gfx/shell/rarrowpressed.bmp differ diff --git a/main/gfx/shell/scrn.bmp b/main/gfx/shell/scrn.bmp new file mode 100644 index 00000000..d6bedf49 Binary files /dev/null and b/main/gfx/shell/scrn.bmp differ diff --git a/main/gfx/shell/slider.bmp b/main/gfx/shell/slider.bmp new file mode 100644 index 00000000..bad05a55 Binary files /dev/null and b/main/gfx/shell/slider.bmp differ diff --git a/main/gfx/shell/sm_dnarf.bmp b/main/gfx/shell/sm_dnarf.bmp new file mode 100644 index 00000000..43f39226 Binary files /dev/null and b/main/gfx/shell/sm_dnarf.bmp differ diff --git a/main/gfx/shell/sm_dnarw.bmp b/main/gfx/shell/sm_dnarw.bmp new file mode 100644 index 00000000..f3a2b90d Binary files /dev/null and b/main/gfx/shell/sm_dnarw.bmp differ diff --git a/main/gfx/shell/splash.bmp b/main/gfx/shell/splash.bmp new file mode 100644 index 00000000..97ca032e Binary files /dev/null and b/main/gfx/shell/splash.bmp differ diff --git a/main/gfx/shell/splash8bit.bmp b/main/gfx/shell/splash8bit.bmp new file mode 100644 index 00000000..fa7881c8 Binary files /dev/null and b/main/gfx/shell/splash8bit.bmp differ diff --git a/main/gfx/shell/strings.lst b/main/gfx/shell/strings.lst new file mode 100644 index 00000000..98a41602 --- /dev/null +++ b/main/gfx/shell/strings.lst @@ -0,0 +1,35 @@ +// String patches + +// #define IDS_MAIN_PREVIEWSHELP 400 +// #define IDS_MAIN_CUSTOMHELP 530 +// #define IDS_MAIN_RETURNHELP 188 +// #define IDS_MAIN_NEWGAMEHELP 189 +// #define IDS_MAIN_TRAININGHELP 190 +// #define IDS_MAIN_LOADHELP 191 +// #define IDS_MAIN_LOADSAVEHELP 192 +// #define IDS_MAIN_CONFIGUREHELP 193 +// #define IDS_MAIN_READMEHELP 194 +// #define IDS_MAIN_ORDERHELP 195 +// #define IDS_MAIN_QUITHELP 196 +// #define IDS_MAIN_QUICKHELP 197 +// #define IDS_MAIN_MULTIPLAYERHELP 198 +// #define IDS_MAIN_QUITPROMPTINGAME 235 +// #define IDS_MAIN_QUITPROMPT 236 + +402 "www.natural-selection.org" +400 "Find out more about Natural Selection." +530 "Play a different game." +188 "Resume your current game." +189 " " +190 "Training. For best results, do this before playing online." +191 " " +192 " " +193 "Edit your Configuration." +194 "View the release notes." +196 "Quit." +198 "Multiplayer. Begin your journey." +235 "Are you sure you want to quit?" +236 "Leaving? The hive mind awaits..." +234 "Training? At a time like this?" +338 "Could not validate Natural Selection" +340 "Please insert your Half-life CD" diff --git a/main/gfx/shell/thumb.bmp b/main/gfx/shell/thumb.bmp new file mode 100644 index 00000000..0940a614 Binary files /dev/null and b/main/gfx/shell/thumb.bmp differ diff --git a/main/gfx/shell/unlock.bmp b/main/gfx/shell/unlock.bmp new file mode 100644 index 00000000..7c23ca09 Binary files /dev/null and b/main/gfx/shell/unlock.bmp differ diff --git a/main/gfx/shell/up.bmp b/main/gfx/shell/up.bmp new file mode 100644 index 00000000..e9c44011 Binary files /dev/null and b/main/gfx/shell/up.bmp differ diff --git a/main/gfx/shell/uparrowd.bmp b/main/gfx/shell/uparrowd.bmp new file mode 100644 index 00000000..3bbec01a Binary files /dev/null and b/main/gfx/shell/uparrowd.bmp differ diff --git a/main/gfx/shell/uparrowf.bmp b/main/gfx/shell/uparrowf.bmp new file mode 100644 index 00000000..9653ef62 Binary files /dev/null and b/main/gfx/shell/uparrowf.bmp differ diff --git a/main/gfx/shell/uparrowp.bmp b/main/gfx/shell/uparrowp.bmp new file mode 100644 index 00000000..06793e2a Binary files /dev/null and b/main/gfx/shell/uparrowp.bmp differ diff --git a/main/gfx/shell/windows.bmp b/main/gfx/shell/windows.bmp new file mode 100644 index 00000000..9fb6cfa8 Binary files /dev/null and b/main/gfx/shell/windows.bmp differ diff --git a/main/gfx/shell/won_logo.bmp b/main/gfx/shell/won_logo.bmp new file mode 100644 index 00000000..4eeb0f6a Binary files /dev/null and b/main/gfx/shell/won_logo.bmp differ diff --git a/main/gfx/vgui/320_arrow.tga b/main/gfx/vgui/320_arrow.tga new file mode 100644 index 00000000..5975ae93 Binary files /dev/null and b/main/gfx/vgui/320_arrow.tga differ diff --git a/main/gfx/vgui/640_arrow.tga b/main/gfx/vgui/640_arrow.tga new file mode 100644 index 00000000..2a19d527 Binary files /dev/null and b/main/gfx/vgui/640_arrow.tga differ diff --git a/main/gfx/vgui/640_checkset.tga b/main/gfx/vgui/640_checkset.tga new file mode 100644 index 00000000..f8df2b7e Binary files /dev/null and b/main/gfx/vgui/640_checkset.tga differ diff --git a/main/gfx/vgui/640_checkunset.tga b/main/gfx/vgui/640_checkunset.tga new file mode 100644 index 00000000..87b380ff Binary files /dev/null and b/main/gfx/vgui/640_checkunset.tga differ diff --git a/main/gfx/vgui/640_nsaag.tga b/main/gfx/vgui/640_nsaag.tga new file mode 100644 index 00000000..420ccf4f Binary files /dev/null and b/main/gfx/vgui/640_nsaag.tga differ diff --git a/main/gfx/vgui/640_nsab.tga b/main/gfx/vgui/640_nsab.tga new file mode 100644 index 00000000..082c7b74 Binary files /dev/null and b/main/gfx/vgui/640_nsab.tga differ diff --git a/main/gfx/vgui/640_nsap.tga b/main/gfx/vgui/640_nsap.tga new file mode 100644 index 00000000..e9d10703 Binary files /dev/null and b/main/gfx/vgui/640_nsap.tga differ diff --git a/main/gfx/vgui/640_nsar.tga b/main/gfx/vgui/640_nsar.tga new file mode 100644 index 00000000..ba5593f4 Binary files /dev/null and b/main/gfx/vgui/640_nsar.tga differ diff --git a/main/gfx/vgui/640_nsaw.tga b/main/gfx/vgui/640_nsaw.tga new file mode 100644 index 00000000..302f5679 Binary files /dev/null and b/main/gfx/vgui/640_nsaw.tga differ diff --git a/main/gfx/vgui/640_scoreboardbad.tga b/main/gfx/vgui/640_scoreboardbad.tga new file mode 100644 index 00000000..767e4f4b Binary files /dev/null and b/main/gfx/vgui/640_scoreboardbad.tga differ diff --git a/main/gfx/vgui/640_scoreboardcd.tga b/main/gfx/vgui/640_scoreboardcd.tga new file mode 100644 index 00000000..0c2e3999 Binary files /dev/null and b/main/gfx/vgui/640_scoreboardcd.tga differ diff --git a/main/gfx/vgui/640_scoreboardcontrib.tga b/main/gfx/vgui/640_scoreboardcontrib.tga new file mode 100644 index 00000000..0e4c77a1 Binary files /dev/null and b/main/gfx/vgui/640_scoreboardcontrib.tga differ diff --git a/main/gfx/vgui/640_scoreboarddev.tga b/main/gfx/vgui/640_scoreboarddev.tga new file mode 100644 index 00000000..eb1cbcde Binary files /dev/null and b/main/gfx/vgui/640_scoreboarddev.tga differ diff --git a/main/gfx/vgui/640_scoreboardguide.tga b/main/gfx/vgui/640_scoreboardguide.tga new file mode 100644 index 00000000..112759be Binary files /dev/null and b/main/gfx/vgui/640_scoreboardguide.tga differ diff --git a/main/gfx/vgui/640_scoreboardpt.tga b/main/gfx/vgui/640_scoreboardpt.tga new file mode 100644 index 00000000..b85a5d05 Binary files /dev/null and b/main/gfx/vgui/640_scoreboardpt.tga differ diff --git a/main/gfx/vgui/640_scoreboardserverop.tga b/main/gfx/vgui/640_scoreboardserverop.tga new file mode 100644 index 00000000..2ea5c880 Binary files /dev/null and b/main/gfx/vgui/640_scoreboardserverop.tga differ diff --git a/main/gfx/vgui/640_scoreboardtracker.tga b/main/gfx/vgui/640_scoreboardtracker.tga new file mode 100644 index 00000000..3e543179 Binary files /dev/null and b/main/gfx/vgui/640_scoreboardtracker.tga differ diff --git a/main/gfx/vgui/640_scoreboardunresolved.tga b/main/gfx/vgui/640_scoreboardunresolved.tga new file mode 100644 index 00000000..a82f0eca Binary files /dev/null and b/main/gfx/vgui/640_scoreboardunresolved.tga differ diff --git a/main/gfx/vgui/640_scoreboardveteran.tga b/main/gfx/vgui/640_scoreboardveteran.tga new file mode 100644 index 00000000..d2665e2d Binary files /dev/null and b/main/gfx/vgui/640_scoreboardveteran.tga differ diff --git a/main/gfx/vgui/fonts/1024_ActionButtonScheme.tga b/main/gfx/vgui/fonts/1024_ActionButtonScheme.tga new file mode 100644 index 00000000..b94738d6 Binary files /dev/null and b/main/gfx/vgui/fonts/1024_ActionButtonScheme.tga differ diff --git a/main/gfx/vgui/fonts/1024_CommanderStatusScheme.tga b/main/gfx/vgui/fonts/1024_CommanderStatusScheme.tga new file mode 100644 index 00000000..ff9a070b Binary files /dev/null and b/main/gfx/vgui/fonts/1024_CommanderStatusScheme.tga differ diff --git a/main/gfx/vgui/fonts/1024_HierarchyScheme.tga b/main/gfx/vgui/fonts/1024_HierarchyScheme.tga new file mode 100644 index 00000000..b94738d6 Binary files /dev/null and b/main/gfx/vgui/fonts/1024_HierarchyScheme.tga differ diff --git a/main/gfx/vgui/fonts/1024_PSEScheme.tga b/main/gfx/vgui/fonts/1024_PSEScheme.tga new file mode 100644 index 00000000..b94738d6 Binary files /dev/null and b/main/gfx/vgui/fonts/1024_PSEScheme.tga differ diff --git a/main/gfx/vgui/fonts/1024_PieMenuScheme.tga b/main/gfx/vgui/fonts/1024_PieMenuScheme.tga new file mode 100644 index 00000000..b94738d6 Binary files /dev/null and b/main/gfx/vgui/fonts/1024_PieMenuScheme.tga differ diff --git a/main/gfx/vgui/fonts/1024_Scoreboard Tiny Text.tga b/main/gfx/vgui/fonts/1024_Scoreboard Tiny Text.tga new file mode 100644 index 00000000..b94738d6 Binary files /dev/null and b/main/gfx/vgui/fonts/1024_Scoreboard Tiny Text.tga differ diff --git a/main/gfx/vgui/fonts/1152_ActionButtonScheme.tga b/main/gfx/vgui/fonts/1152_ActionButtonScheme.tga new file mode 100644 index 00000000..25019619 Binary files /dev/null and b/main/gfx/vgui/fonts/1152_ActionButtonScheme.tga differ diff --git a/main/gfx/vgui/fonts/1152_CommanderStatusScheme.tga b/main/gfx/vgui/fonts/1152_CommanderStatusScheme.tga new file mode 100644 index 00000000..98bbf62f Binary files /dev/null and b/main/gfx/vgui/fonts/1152_CommanderStatusScheme.tga differ diff --git a/main/gfx/vgui/fonts/1152_HierarchyScheme.tga b/main/gfx/vgui/fonts/1152_HierarchyScheme.tga new file mode 100644 index 00000000..25019619 Binary files /dev/null and b/main/gfx/vgui/fonts/1152_HierarchyScheme.tga differ diff --git a/main/gfx/vgui/fonts/1152_PSEScheme.tga b/main/gfx/vgui/fonts/1152_PSEScheme.tga new file mode 100644 index 00000000..25019619 Binary files /dev/null and b/main/gfx/vgui/fonts/1152_PSEScheme.tga differ diff --git a/main/gfx/vgui/fonts/1152_PieMenuScheme.tga b/main/gfx/vgui/fonts/1152_PieMenuScheme.tga new file mode 100644 index 00000000..25019619 Binary files /dev/null and b/main/gfx/vgui/fonts/1152_PieMenuScheme.tga differ diff --git a/main/gfx/vgui/fonts/1152_Scoreboard Tiny Text.tga b/main/gfx/vgui/fonts/1152_Scoreboard Tiny Text.tga new file mode 100644 index 00000000..25019619 Binary files /dev/null and b/main/gfx/vgui/fonts/1152_Scoreboard Tiny Text.tga differ diff --git a/main/gfx/vgui/fonts/1280_ActionButtonScheme.tga b/main/gfx/vgui/fonts/1280_ActionButtonScheme.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1280_ActionButtonScheme.tga differ diff --git a/main/gfx/vgui/fonts/1280_CommanderStatusScheme.tga b/main/gfx/vgui/fonts/1280_CommanderStatusScheme.tga new file mode 100644 index 00000000..ced13178 Binary files /dev/null and b/main/gfx/vgui/fonts/1280_CommanderStatusScheme.tga differ diff --git a/main/gfx/vgui/fonts/1280_HierarchyScheme.tga b/main/gfx/vgui/fonts/1280_HierarchyScheme.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1280_HierarchyScheme.tga differ diff --git a/main/gfx/vgui/fonts/1280_PSEScheme.tga b/main/gfx/vgui/fonts/1280_PSEScheme.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1280_PSEScheme.tga differ diff --git a/main/gfx/vgui/fonts/1280_PieMenuScheme.tga b/main/gfx/vgui/fonts/1280_PieMenuScheme.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1280_PieMenuScheme.tga differ diff --git a/main/gfx/vgui/fonts/1280_Scoreboard Tiny Text.tga b/main/gfx/vgui/fonts/1280_Scoreboard Tiny Text.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1280_Scoreboard Tiny Text.tga differ diff --git a/main/gfx/vgui/fonts/1600_ActionButtonScheme.tga b/main/gfx/vgui/fonts/1600_ActionButtonScheme.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1600_ActionButtonScheme.tga differ diff --git a/main/gfx/vgui/fonts/1600_CommanderStatusScheme.tga b/main/gfx/vgui/fonts/1600_CommanderStatusScheme.tga new file mode 100644 index 00000000..4ab6f2ae Binary files /dev/null and b/main/gfx/vgui/fonts/1600_CommanderStatusScheme.tga differ diff --git a/main/gfx/vgui/fonts/1600_HierarchyScheme.tga b/main/gfx/vgui/fonts/1600_HierarchyScheme.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1600_HierarchyScheme.tga differ diff --git a/main/gfx/vgui/fonts/1600_PSEScheme.tga b/main/gfx/vgui/fonts/1600_PSEScheme.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1600_PSEScheme.tga differ diff --git a/main/gfx/vgui/fonts/1600_PieMenuScheme.tga b/main/gfx/vgui/fonts/1600_PieMenuScheme.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1600_PieMenuScheme.tga differ diff --git a/main/gfx/vgui/fonts/1600_Scoreboard Tiny Text.tga b/main/gfx/vgui/fonts/1600_Scoreboard Tiny Text.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/1600_Scoreboard Tiny Text.tga differ diff --git a/main/gfx/vgui/fonts/320_ActionButtonScheme.tga b/main/gfx/vgui/fonts/320_ActionButtonScheme.tga new file mode 100644 index 00000000..7571b73a Binary files /dev/null and b/main/gfx/vgui/fonts/320_ActionButtonScheme.tga differ diff --git a/main/gfx/vgui/fonts/320_CommanderStatusScheme.tga b/main/gfx/vgui/fonts/320_CommanderStatusScheme.tga new file mode 100644 index 00000000..dbab826b Binary files /dev/null and b/main/gfx/vgui/fonts/320_CommanderStatusScheme.tga differ diff --git a/main/gfx/vgui/fonts/320_HierarchyScheme.tga b/main/gfx/vgui/fonts/320_HierarchyScheme.tga new file mode 100644 index 00000000..7600ffd8 Binary files /dev/null and b/main/gfx/vgui/fonts/320_HierarchyScheme.tga differ diff --git a/main/gfx/vgui/fonts/320_PSEScheme.tga b/main/gfx/vgui/fonts/320_PSEScheme.tga new file mode 100644 index 00000000..7600ffd8 Binary files /dev/null and b/main/gfx/vgui/fonts/320_PSEScheme.tga differ diff --git a/main/gfx/vgui/fonts/320_PieMenuScheme.tga b/main/gfx/vgui/fonts/320_PieMenuScheme.tga new file mode 100644 index 00000000..7600ffd8 Binary files /dev/null and b/main/gfx/vgui/fonts/320_PieMenuScheme.tga differ diff --git a/main/gfx/vgui/fonts/320_Scoreboard Tiny Text.tga b/main/gfx/vgui/fonts/320_Scoreboard Tiny Text.tga new file mode 100644 index 00000000..7600ffd8 Binary files /dev/null and b/main/gfx/vgui/fonts/320_Scoreboard Tiny Text.tga differ diff --git a/main/gfx/vgui/fonts/400_ActionButtonScheme.tga b/main/gfx/vgui/fonts/400_ActionButtonScheme.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/400_ActionButtonScheme.tga differ diff --git a/main/gfx/vgui/fonts/400_CommanderStatusScheme.tga b/main/gfx/vgui/fonts/400_CommanderStatusScheme.tga new file mode 100644 index 00000000..26c06c33 Binary files /dev/null and b/main/gfx/vgui/fonts/400_CommanderStatusScheme.tga differ diff --git a/main/gfx/vgui/fonts/400_HierarchyScheme.tga b/main/gfx/vgui/fonts/400_HierarchyScheme.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/400_HierarchyScheme.tga differ diff --git a/main/gfx/vgui/fonts/400_PSEScheme.tga b/main/gfx/vgui/fonts/400_PSEScheme.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/400_PSEScheme.tga differ diff --git a/main/gfx/vgui/fonts/400_PieMenuScheme.tga b/main/gfx/vgui/fonts/400_PieMenuScheme.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/400_PieMenuScheme.tga differ diff --git a/main/gfx/vgui/fonts/400_Scoreboard Tiny Text.tga b/main/gfx/vgui/fonts/400_Scoreboard Tiny Text.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/400_Scoreboard Tiny Text.tga differ diff --git a/main/gfx/vgui/fonts/512_ActionButtonScheme.tga b/main/gfx/vgui/fonts/512_ActionButtonScheme.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/512_ActionButtonScheme.tga differ diff --git a/main/gfx/vgui/fonts/512_CommanderStatusScheme.tga b/main/gfx/vgui/fonts/512_CommanderStatusScheme.tga new file mode 100644 index 00000000..5842e5ac Binary files /dev/null and b/main/gfx/vgui/fonts/512_CommanderStatusScheme.tga differ diff --git a/main/gfx/vgui/fonts/512_HierarchyScheme.tga b/main/gfx/vgui/fonts/512_HierarchyScheme.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/512_HierarchyScheme.tga differ diff --git a/main/gfx/vgui/fonts/512_PSEScheme.tga b/main/gfx/vgui/fonts/512_PSEScheme.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/512_PSEScheme.tga differ diff --git a/main/gfx/vgui/fonts/512_PieMenuScheme.tga b/main/gfx/vgui/fonts/512_PieMenuScheme.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/512_PieMenuScheme.tga differ diff --git a/main/gfx/vgui/fonts/512_Scoreboard Tiny Text.tga b/main/gfx/vgui/fonts/512_Scoreboard Tiny Text.tga new file mode 100644 index 00000000..75de7d84 Binary files /dev/null and b/main/gfx/vgui/fonts/512_Scoreboard Tiny Text.tga differ diff --git a/main/gfx/vgui/fonts/640_ActionButtonScheme.tga b/main/gfx/vgui/fonts/640_ActionButtonScheme.tga new file mode 100644 index 00000000..2f72eb73 Binary files /dev/null and b/main/gfx/vgui/fonts/640_ActionButtonScheme.tga differ diff --git a/main/gfx/vgui/fonts/640_CommanderStatusScheme.tga b/main/gfx/vgui/fonts/640_CommanderStatusScheme.tga new file mode 100644 index 00000000..a4638d83 Binary files /dev/null and b/main/gfx/vgui/fonts/640_CommanderStatusScheme.tga differ diff --git a/main/gfx/vgui/fonts/640_HierarchyScheme.tga b/main/gfx/vgui/fonts/640_HierarchyScheme.tga new file mode 100644 index 00000000..2f72eb73 Binary files /dev/null and b/main/gfx/vgui/fonts/640_HierarchyScheme.tga differ diff --git a/main/gfx/vgui/fonts/640_PSEScheme.tga b/main/gfx/vgui/fonts/640_PSEScheme.tga new file mode 100644 index 00000000..2f72eb73 Binary files /dev/null and b/main/gfx/vgui/fonts/640_PSEScheme.tga differ diff --git a/main/gfx/vgui/fonts/640_PieMenuScheme.tga b/main/gfx/vgui/fonts/640_PieMenuScheme.tga new file mode 100644 index 00000000..2f72eb73 Binary files /dev/null and b/main/gfx/vgui/fonts/640_PieMenuScheme.tga differ diff --git a/main/gfx/vgui/fonts/640_Scoreboard Tiny Text.tga b/main/gfx/vgui/fonts/640_Scoreboard Tiny Text.tga new file mode 100644 index 00000000..2f72eb73 Binary files /dev/null and b/main/gfx/vgui/fonts/640_Scoreboard Tiny Text.tga differ diff --git a/main/gfx/vgui/fonts/800_ActionButtonScheme.tga b/main/gfx/vgui/fonts/800_ActionButtonScheme.tga new file mode 100644 index 00000000..dbab826b Binary files /dev/null and b/main/gfx/vgui/fonts/800_ActionButtonScheme.tga differ diff --git a/main/gfx/vgui/fonts/800_CommanderStatusScheme.tga b/main/gfx/vgui/fonts/800_CommanderStatusScheme.tga new file mode 100644 index 00000000..95d69757 Binary files /dev/null and b/main/gfx/vgui/fonts/800_CommanderStatusScheme.tga differ diff --git a/main/gfx/vgui/fonts/800_HierarchyScheme.tga b/main/gfx/vgui/fonts/800_HierarchyScheme.tga new file mode 100644 index 00000000..dbab826b Binary files /dev/null and b/main/gfx/vgui/fonts/800_HierarchyScheme.tga differ diff --git a/main/gfx/vgui/fonts/800_PSEScheme.tga b/main/gfx/vgui/fonts/800_PSEScheme.tga new file mode 100644 index 00000000..dbab826b Binary files /dev/null and b/main/gfx/vgui/fonts/800_PSEScheme.tga differ diff --git a/main/gfx/vgui/fonts/800_PieMenuScheme.tga b/main/gfx/vgui/fonts/800_PieMenuScheme.tga new file mode 100644 index 00000000..dbab826b Binary files /dev/null and b/main/gfx/vgui/fonts/800_PieMenuScheme.tga differ diff --git a/main/gfx/vgui/fonts/800_Scoreboard Tiny Text.tga b/main/gfx/vgui/fonts/800_Scoreboard Tiny Text.tga new file mode 100644 index 00000000..dbab826b Binary files /dev/null and b/main/gfx/vgui/fonts/800_Scoreboard Tiny Text.tga differ diff --git a/main/gfx/vgui/icntlk_pl.tga b/main/gfx/vgui/icntlk_pl.tga new file mode 100644 index 00000000..3774ce3a Binary files /dev/null and b/main/gfx/vgui/icntlk_pl.tga differ diff --git a/main/gfx/vgui/icntlk_sv.tga b/main/gfx/vgui/icntlk_sv.tga new file mode 100644 index 00000000..7a6fded0 Binary files /dev/null and b/main/gfx/vgui/icntlk_sv.tga differ diff --git a/main/gfx/vgui/ns-logo.tga b/main/gfx/vgui/ns-logo.tga new file mode 100644 index 00000000..02a226eb Binary files /dev/null and b/main/gfx/vgui/ns-logo.tga differ diff --git a/main/hallwall_1.wad b/main/hallwall_1.wad new file mode 100644 index 00000000..83b2a671 Binary files /dev/null and b/main/hallwall_1.wad differ diff --git a/main/liblist.gam b/main/liblist.gam new file mode 100644 index 00000000..1552f43a --- /dev/null +++ b/main/liblist.gam @@ -0,0 +1,27 @@ +//////////////////////////// +// Natural Selection // +// by Charlie Cleveland // +//////////////////////////// +game "Natural Selection" +url_info "www.natural-selection.org" +url_dl "http://www.natural-selection.org/" +version "v3.0" +size "165000000" +svonly "0" +secure "0" +cldll "cl_dlls\client.dll" +hlversion "1110" +// How to allow training but disable "New game"? +type "multiplayer_only" +// Don't show models in browser +nomodels "1" +nohimodel "1" +// Only show NS-compliant maps +mpentity "info_mapinfo" +// Using HPB_bot support for now +gamedll "dlls\ns.dll" +gamedll_linux "dlls/ns_i386.so" +// Training map +//trainmap "ns_training" + + diff --git a/main/listenserver.cfg b/main/listenserver.cfg new file mode 100644 index 00000000..e3c3e62b --- /dev/null +++ b/main/listenserver.cfg @@ -0,0 +1,85 @@ +// Use this file to configure your LISTEN server. +// This config file is executed everytime the server changes levels (disable by removing mapchangecfgfile at end) +// +// Please visit the server ops forum on www.natural-selection.org, or check out the manual if you have any questions about any of these settings. +// +// If you run a listen server and choose to modify this file, note that assigning values to the following variables within +// this file will stomp the choices you make in the Launcher server configuration "Advanced Options" screen: +// + +//////////////////////////////////////////////////// +// Common between listenserver.cfg and server.cfg // +//////////////////////////////////////////////////// + +// Default server name. Change to "Bob's Server", etc. +hostname "Natural Selection v3.0" + +// Must specify sv_region, or it won't show up in Steam server browser +// 0: US East coast +// 1: US West coast +// 2: South America +// 3: Europe +// 4: Asia +// 5: Australia +// 6: Middle East +// 7: Africa +sv_region 0 + +// general gameplay +mp_autoconcede 4 +mp_limitteams 1 +mp_combattime 15 + +// block abusive console scripts (wait, special, etc.)? +mp_blockscripts 0 + +// Set to -1 to disallow voting (looks in mapcycle.txt for entries) +mp_mapvoteratio .6 + +// Enable HLTV proxies to connect +sv_proxies 1 + +// maximum client movement speed (needed for commander mode) +sv_maxspeed 4000 +sv_allowdownload 1 +mp_consistency 0 + +// Commander voting +mp_votedowntime 180 +mp_votecasttime 2 +mp_votepercentneeded .4 +mp_minvotesneeded 3 + +// More obscure settings +mp_countdowntime .2 +mp_latejointime 1.5 +mp_logdetail 0 +mp_falldamage 1 +mp_killdelay 3 +mp_flashlight 1 +mp_footsteps 1 + +// disable autoaim and mad gibs +sv_aim 0 +violence_hgibs 0 +violence_agibs 0 + +// player bounding boxes (collisions, not clipping) +sv_clienttrace 3.5 + +/////////////////////////////// +// Dedicated server specific // +/////////////////////////////// +sv_lan 0 + +// disable clients' ability to pause the server +pausable 0 + +// List server op WON or Steam ids here, delimited by semi-colons (eg, "STEAM_0:1:12345;STEAM_0:0:56736"), to display server op icon next to these players on this server. +mp_serverops "" + +// Allows display of special authentication icons next to people's names (including developers, Constellation members, etc.) +mp_uplink 0 + +// Needed so this file is executed on map change, like pre-NS v2.1 +mapchangecfgfile listenserver.cfg diff --git a/main/logos/remapped.bmp b/main/logos/remapped.bmp new file mode 100644 index 00000000..886d3a6a Binary files /dev/null and b/main/logos/remapped.bmp differ diff --git a/main/manual/Quick_Start_Guide.html b/main/manual/Quick_Start_Guide.html new file mode 100644 index 00000000..6436a110 --- /dev/null +++ b/main/manual/Quick_Start_Guide.html @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/main/manual/Quick_Start_Guide_Noframes.html b/main/manual/Quick_Start_Guide_Noframes.html new file mode 100644 index 00000000..177fe144 --- /dev/null +++ b/main/manual/Quick_Start_Guide_Noframes.html @@ -0,0 +1,646 @@ + + +Natural Selection v2.1 Manual + + + +
+
Natural Selection v2.1 Manual
Last Updated November 4th, 2003
Stats Updated ??? ??, ????
+

OVERVIEW

+

Natural Selection is a multiplayer-only Half-Life mod. In it, players join one of two very different teams:

+

The Frontiersmen - elite marines using advanced technology and weaponry to take back human ships and bases. Victory requires intense teamwork, and excellent tactics.

+

The Kharaa - ferocious alien creatures with amazing evolutionary and biological abilities, who hunt and destroy any and all intruders to their new territory. Victory requires skillful adaptation, and deadly combat proficiency. +

GETTING STARTED

+

[Charlie writes about tech requirements, downloading]

+

GOALS (VICTORY)

+

To win, the Frontiersman must destroy all of the Kharaa and their ability to respawn. Kharaa respawn from hives. Each map has three potential hive locations. The Frontiersmen must destroy any active hives, and then hunt down any remaining Kharaa. When the last hive is destroyed, the Kharaa begin to die - though as long as there is one Kharaa out there with enough resources to build a new hive, the battle isn't over. When the last alien dies, the game ends.

+

The Kharaa must destroy all Frontiersmen and their ability to respawn. Marines respawn from infantry portals. Infantry portals can be built near any command console, in any quantity desired (though they cost resources -- typical numbers range from two to six). With the infantry portals destroyed, the aliens must prevent new ones from being built. There are two ways to accomplish this: by killing every Frontiersman, or by destroying all command consoles. As long as there is one marine, and one command console, the Frontiersmen have a chance to turn things around. When the last marine dies, the game ends.

+

STARTING CONDITIONS

+

The Frontiersmen begin the game at the Marine Base. This is the same location on each map. They start play with one resource collector and one command console. Note: until an infantry portal is built, marines won't be able to respawn. Starting weaponry for a Frontiersman is an LMG (light machine gun), pistol, and knife.

+

The Kharaa begin the game at their first hive, which is randomly selected from one of three fixed locations on each map. They start play with one active hive and one resource collector. Each Kharaa begins as a Skulk (for more information on the five species of Kharaa, see the Alien Species section).

+

THE POP-UP MENU

+

The pop-up menu is a quick and intuitive way to access commands for both teams. Knowing your way around the pop-up menu will save you time … and might just save your skin.

+

For the marines, it's used primarily for communication - asking for orders, urgent equipment requests, or reporting combat conditions. The advantage to using the pop-up menu for these tasks (as opposed to typed or voice communication) is that your requests pop up on the Commander's display, at your location. The pop-up menu can also be used for actions, like selecting and dropping weapons.

+

The Kharaa also use their pop-up menu to communicate with teammates; but it's also how you spend resources to build, evolve new abilities, and change species (see the Kharaa sections below for more info).

+

RESOURCES

+

Frontiersmen need resources so their commander can give them goodies like sentry turrets, grenade launchers, jetpacks, and armor upgrades. Kharaa need resources so they can create new hives, evolve abilities like cloaking, and scent of fear, and change into new species of Kharaa like the thundering Onos, or the winged Lerk. Both teams use resources when they build anything, or improve their capabilities. This makes securing resources the key to victory in all but the quickest of games.

+

The marines and aliens distribute resources in slightly different ways, and use them very differently. There are two methods of acquiring resources:

+ + + + + + + + + + + + + + + + +
SOURCEMARINE REWARD  ALIEN REWARD
Killing an enemy player1-3 random resources
to team
1-3 random resources
to killer
Resource tower1 resource per 4 seconds
to team
1 resource per 4 seconds
split evenly among team-members
+

THE COMMANDER (AND FOLLOWING ORDERS)

+

At the heart of the marine deployment is the Commander. From inside his command chair he has a bird's eye view of the action - choosing what technology to research, deciding where to build, equipping and healing your team, and guiding the marines to victory. A team without a commander, or that doesn't work very closely with one, is almost always toast.

+

The Commander is in charge of spending the team resources. This means you'll be asking him for things fairly often (like health packs), but keep in mind: he can't give you something your team can't afford, or you haven't researched yet. And he's usually doing ten things at once - so while getting a shotgun might seem vital to you, it might not be as important as dropping health packs for the squad fighting for their lives in an enemy hive.

+

The Frontiersmen are at their best working together to carry out the Commander's orders. Following orders doesn't just lead to victory - it usually puts you where the action is, in the spots where the game is won or lost.

+

Any marine can become commander by stepping into the Command Console. There can only be one Commander at a time.

+

MARINE WEAPONS & EQUIPMENT

+

Your Commander can equip you with new weapons and gear by researching the appropriate tech (which costs resource points) and then dropping the new weapon for you (which also costs). Here's a list of the available weapons and gear:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MARINE WEAPONS - SLOT 1
LIGHT MACHINE GUN :: Default weapon. Fair damage and range. Versatile and effective, more so in groups. Marines spawn with 2 clips of ammunition. + + + + + + + + + + + + + +
Damage: 10 units/shotRate of fire: 10 shots/sec
Clip size: 50 bulletsMax storage: 250 bullets
Cost: N/ARequires: N/A
+
SHOTGUN :: Deadly at close range. Fires 10 pellets per shot. + + + + + + + + + + + + + +
Damage: 17 units/pelletRate of fire: 130 shots/sec
Clip size: 8 shotsMax storage: 40 shots
Cost: 10 resourcesRequires: Armory
+
HEAVY MACHINE GUN :: Not as accurate as the Machine Gun, but twice the punch and a bigger clip. + + + + + + + + + + + + + +
Damage: 20 units/shotRate of fire: 11 shots/sec
Clip size: 125 shotsMax storage: 250 shots
Cost: 15 resourcesRequires: Advanced Armory
+
GRENADE LAUNCHER :: Used for groups of enemies or structures. Grenades explode on contact with an enemy or after 4 seconds + with a radius of 350 units. + + + + + + + + + + + + + +
Damage: 125 units/shotRate of fire: 120 shots/sec
Clip size: 4 shotsMax storage: 30 shots
Cost: 20 resourcesRequires: Advanced Armory
+
MARINE WEAPONS - SLOT 2
PISTOL :: Default secondary weapon. Good accuracy and power, small clip. Marines spawn with 2 clips of ammunition. + + + + + + + + + + + + + +
Damage: 20 units/shotRate of fire: 20 shots/sec
Clip size: 10 shotsMax storage: 30 shots
Cost: N/ARequires: N/A
+
MARINE WEAPONS - SLOT 3
KNIFE :: Last ditch weapon when marines run out of ammo or want to conserve it. + + + + + + + + + + + + + +
Damage: 30 units/secRate of fire: 65 slashes/sec
Clip size: N/AMax storage: N/A
Cost: N/ARequires: N/A
+
MARINE WEAPONS - SLOT 4
WELDER :: Used to repair structures and armor, and to change map features. + + + + + + + + + + + + + +
Damage: 4 units/secRepair rate: 50 units/sec
Clip size: unlimitedMax storage: N/A
Cost: 5 resourcesRequires: Armory
+
MINES :: Trip mine/land mine used for defense. Mines explode on contact with an enemy or after absorbing 30 + 125 damage with a radius + of 300. + + + + + + + + + + + + + +
Damage: 125Rate of fire: N/A
Clip size: N/AMax storage: 5 mines
Cost: 10 + resources for 5Requires: Armory
+
+ + + + + + + + + + + + + + + + +
MARINE ARMOR AND EQUIPMENT

HEAVY ARMOR :: Raises the armor of a marine from 25 to + 200. The armor's extra bulk slows the marine slightly, causing him to move at + 95% of normal speed. Armor upgrades from the arms lab are cumulative with the effect of the Heavy Armor suit.
+ Cost: 15 resources per suit.

JETPACK :: Allows marines to deploy quickly, harass, and to stay out of harm's way of ground-based lifeforms. Can't be worn with Heavy Armor.
Cost: 15 resources per pack.
HEALTH PACK :: Adds up to 50 health to a wounded marine; won't cause the marine's health to exceed the + starting value of 100.
+ Cost: 2 resources per pack.
AMMO PACK :: Adds one clip worth of ammunition to the marine's inventory. Automatically transforms itself into the appropriate ammunition type for the currently selected weapon. Only picked up if the marine can hold more and the weapon requires ammunition for use.
Cost: 1 resource per pack.
+

MARINE TECHNOLOGY & UPGRADES

+

The Commander can also research upgrades that effect all marines:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ARMS LAB UPGRADES
DAMAGE UPGRADES :: Three levels of upgrade that provide 10%/ + 10%/ + 10% increase to all marines, mines, sentries, seige cannons, etc. +
Cost: 20/ + 30/ + 40 resources +
Research time: 60/ + 90/ + 120 seconds
ARMOR UPGRADES :: Three levels of upgrade that give a 20%/ + 40%/ + 60% boost to the maximum armor of all marines. +
Cost: 20/ + 30/ + 40 resources +
Research time: 60/ + 90/ + 120 seconds
TECH LAB UPGRADES
JETPACK TECH :: This technology allows marines to be equipped with jetpacks. Once researched, jetpacks can be constructed within 300 units of any prototype lab. +
Cost: 35 resources +
Research time: 50 seconds
HEAVY TECH :: This technology is required before heavy armor can be purchased. Once complete, heavy armor can be constructed within 300 units of any prototype lab. +
Cost: 40 resources +
Research time: 100 seconds
OBSERVATORY UPGRADES
MOTION TRACKING :: When this powerful upgrade is purchased, the commander and all marines see "blips" on their HUD where a moving enemy is detected, even through walls. Aliens can counter this effect by staying close to sensory chambers. +
Cost: 35 resources +
Research time: 100 seconds
DISTRESS BEACON :: The distress beacon sends an SOS signal to the orbiting dropship. When the signal is completed, the dropship reinforces the marine team (all dead marines respawn immediately). This is a last ditch safety measure that can be used from a functioning observatory. +
Cost: 15 resources +
Time to activate: 3 seconds
PHASE TECH :: Phase tech is a specialized nanite technology needed for construction of phase gates. +
Cost: 15 resources +
Research time: 45 seconds
ARMORY UPGRADES
ADVANCED ARMORY :: The armory must be upgraded to an advanced armory before heavy weapons can be purchased. When complete, heavy machine guns and grenade launchers can be dropped within 300 units of the armory. +
Cost: 30 resources +
Research time: 180 seconds
TURRET FACTORY UPGRADES
SIEGE UPGRADE :: Turret factories can be upgraded for siege capabilities. Once this upgrade completes, Automated Siege Cannons can be built within 400 units of the upgraded factory, allowing massive firepower versus enemy structures. +
Cost: 15 resources +
Research time: 15 seconds
ELECTRICAL DEFENSE :: Turret factories and resource nodes can be "electrified", providing automatic defense against smaller enemies. Up to 2 targets within a + 120 unit range will be shocked at once. + + + + + + + + + +
Damage: 25Rate of fire: 1 shock/sec
Cost: 30 resourcesResearch time: 180 seconds
+
+ +

MARINE STRUCTURES

+

Researching new weapons and upgrades requires the building of structures. Structures also serve many other purposes, from defense to allowing travel across the map. Your Commander will place structures, but until you and your teammates build them, they will not be active. To build, get within touching distance and hold down your "use" key.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BASIC MARINE STRUCTURES
COMMAND CONSOLE :: Allows one marine to connect to the command network and take the role of Commander. The marine team always starts with a single command console. +
Cost: 20 resources +
Build time: 15 seconds +
Health: 10000 health
RESOURCE TOWER :: Allows the commander to tap a ship or base's raw nano-supplies, by constructing collection machines over resource nozzles. Adds 1 resource every + 4 seconds. +
Cost: 15 resources +
Build time: 15 seconds +
Health: 6000 health
INFANTRY PORTAL :: Allows marines to respawn after killed. Infantry portals are the most crucial structure to defend, second only to the command console. Must be placed within 400 units of a command console. +
Cost: 20 resources +
Build time: 10 seconds +
Health: 2500 health
ARMORY :: Dispenses "free" ammo for a marine's active weapon, and allows weapon construction within 300 units. Can be upgraded to an advanced armory for heavier weapons. +
Cost: 10 resources +
Build time: 15 seconds +
Health: 2400 health
OBSERVATORY :: Reveals nearby enemies (even when cloaked), allows scanner sweeps, distress beacons, and research of motion tracking. 4 seconds. Scanner sweeps allow the commander to see cloaked aliens and + structures in a 800 unit radius for a duration + of 10 seconds. +
Cost: 20 resources +
Build time: 15 seconds +
Health: 1700 health
PHASE GATE :: Allows marines to teleport between to distant areas on the map. +
Cost: 15 resources +
Build time: 12 seconds +
Health: 3000 health
RESEARCH STRUCTURES
ARMS LAB :: Taps local resources to allow three levels of weapons and armor upgrades. +
Cost: 25 resources +
Build time: 19 seconds +
Health: 2200 health
PROTOTYPE LAB :: Needed for jetpacks and heavy armor. +
Cost: 40 resources +
Build time: 20 seconds +
Health: 4000 health
DEFENSIVE STRUCTURES
TURRET FACTORY :: Allows sentry turrets (automated gun emplacements) to be built for base and perimeter defense. Turrets must be placed within 400 units of a factory. Can be electrified to provide further protection. +
Cost: 10 resources +
Build time: 13 seconds +
Health: 3000 health
SENTRY TURRET :: Automatically acquires targets and fires at enemy players and structures. Needs a functioning turret factory nearby to continue working. + + + + + + + + + + + + + +
Damage: 10 health/shotRate of fire: 666 shots/sec
Cost: 10 resourcesBuild time: 7 seconds
Health: 1300 health
+
AUTOMATED SIEGE CANNON :: Stationary siege weapon that does tremendous damage to enemy structures (including hives). Can fire through walls but requires a marine spotter or scanner sweep to locate targets outside its field of view. + + + + + + + + + + + + + +
Damage: 165 health/shotRate of fire: 666 shots/sec
Cost: 15 resourcesBuild time: 10 seconds
Health: 2000 health
+
+

KHARAA BIOLOGY

+
[pic of hive, (active and inactive?)]

The Kharaa do not have a Commander - they have the Hive, and Gorges. Gorges are a species of Kharaa that can build chambers, and start new hives. Hives respawn dead aliens, and heal any aliens standing nearby. With every new active hive, all Kharaa species become more powerful, and gain access to new evolutionary abilities. Choosing your species and evolutions allows you to adapt and try different strategies over the course of a game.

+ +

KHARAA SPECIES

+

There are five species of Kharaa. All players spawn as Skulks. In order to evolve to different species, you'll need to spend resource points. If you have enough resources, you can change species as often as you like.

+

When you change species you'll cocoon into an egg, and a meter will show the remaining gestation time till you emerge as a different species. While gestating, you are helpless.

+

Each species lends itself to different roles in combat - all of them important. If you die and respawn, you lose your evolutions and revert to a Skulk - which makes the more powerful species more costly to lose.

+ + + + + + + + + + + + + + + + + + + +
KHARAA SPECIES
SKULK :: All-purpose combat and scouting class that can walk up walls and ceilings. + + + + + + + + + + + + + +
Cost: 2 resourcesGestation Time: 7 seconds
Health: 70 healthArmor: 20 armor
Speed: 290 units/sec
+
GORGE :: Builder and "medic" class. Determines team strategy by choosing which structures to build and when. + + + + + + + + + + + + + +
Cost: 10 resourcesGestation Time: 17 seconds
Health: 150 healthArmor: 40 armor
Speed: 170 units/sec
+
LERK :: Flying support class. Not much of a fighter himself, but can heavily boost effectiveness of teammates. Good for hive defense, and abilities serve as "spells" he can use to attack or defend players or areas. + + + + + + + + + + + + + +
Cost: 30 resourcesGestation Time: 28 seconds
Health: 125 healthArmor: 30 armor
Speed: 250 units/sec
+
FADE :: Finesse attacking class.
ONOS :: Lets player lead the charge and do tremendous damage to groups of players.
+

Kharaa Chambers

+ +Every active hive allows for one kind of chamber to be built (with the exception of offensive chambers and resource chambers, which can always be built). + +[Def Chamber - w/healing affect, and each one built allows another level of defensive evolutions, max 3] +[Movement Chamber - w/adrenaline and transport affect, and each one built allows another level of movement evolutions, max 3] +[Sensory Chamber - w/cloaking and hive site affect, and each one built allows another level of sensory evolutions, max 3] +[Offensive Chamber - attacks like turret. No evolutionary impact.] +[Resource Chamber - gathers res. No evolutionary impact.] + +

Kharaa Evolutions (Upgrades)

+ +There are three categories of evolution: Defensive, Movement, and Sensory. To get all three, your team will need three active hives. You can only choose one evolution from each category. If you die and respawn, you can choose again. Evolving a new ability also requires gestation time, though far less than changing species. + +[list evolutions] + +Example of evolutions and chambers: at the start of the game, the Kharaa decide to go with Movement as their first type of evolution. A Gorge builds a movement chamber, and the movement icon flashes on each player's screen. For two resource points, the players can now use their pop-up menus to choose celerity, adrenaline, or redeem. Whichever they choose, it will only be at level 1 until someone builds another chamber. Movement chambers can now be built anywhere, for offensive or defensive purposes. When a second hive goes up, the team will then have to choose whether to go for Defense or Sensory chambers. + + +

Hive sight

+ +Where the marines have a Commander and upgrades like motion tracking, the Kharaa have hive sight. When you first play a Kharaa, turn slowly in a 360º circle. You'll see ghostly circles appear. Some will be your fellow Kharaa, on the other side of the wall, or the other side of the map. Others may be hives. You'll be able to see them move, and the rings will get larger or smaller with distance. This is your hive sight. You can also use hive sight to scout the enemy. Anything that one Kharaa sees, all see. + +Hive sight icons: + +[list of hive sight icons] + +

Waypoints

+ +The Frontiersmen Commander uses waypoints to gather troops together, help them get around the map, and send lone marines or groups of them to important objectives. When you are given a waypoint, you'll hear a voice say "Move to your waypoint, soldier!" If you turn in a circle, you'll see the waypoint on your screen, looking like this: + +[pic of waypoint with random distance/room/order] + +A waypoint gives you its distance in kilometers from your current position, the name of the location on the map (unless it doesn't have one) and any orders associated with the waypoint (build/defend/etc). The distance will go down as you approach, and the waypoint icon will grow larger. + +If you're lost, or your Commander asks you to go somewhere you're unfamiliar with, ask for a waypoint. + + +

Ammo and Health (Frontiersmen)

+ +Frontiersmen can get ammo two ways - if the team has an armory, it will provide unlimited, free ammo. Just stand next to it and hit the use key. The commander can also drop ammo packs, but this costs resources. + +Frontiersmen can only be healed by health packs (which also cost resources), and only the commander can provide them. The only way to repair armor (and structures) is with a welder. + +

Ammo and Health (Kharaa)

+ +Since the Kharaa's weapons are biological, they don't have to worry about ammo. They do have to watch their energy bar, however - when it's depleted they won't be able to attack. The adrenaline evolution, or standing next to a movement chamber increase how quickly energy renews. + +Kharaa are healed by standing next to a hive or defense chamber, or if a Gorge gives them a hit of healing spray. Finally, the defensive evolution regeneration allows an alien to heal itself. Healing restores health first, then armor. + +

Controls (ala CS manual, Charlie)

+ +[list of controls] + +

Special pop-up commands

+ +- Eject commander +- Morphing +- Ready room +- Etc. + +

Minimap for both sides

+ +[ ] + +

Commander interface (Charlie)

+- Screenshot showing different symbols on UI +- How to create squads/hotgroups +- How use the keyboard shortcuts + +

Game options screen (Charlie)

+- No screenshots needed, but description for each command + +

Console commands (includes multiplayer server options)

+ +[ ] + +

Hints

+- Marine and commander philosophy +- Explain how aliens should deal with electrification + +

Version history (Charlie)

+ + +
\ No newline at end of file diff --git a/main/manual/Quick_Start_Guide_Tables.html b/main/manual/Quick_Start_Guide_Tables.html new file mode 100644 index 00000000..e93663ba --- /dev/null +++ b/main/manual/Quick_Start_Guide_Tables.html @@ -0,0 +1,1099 @@ +Natural Selection v2.1 Manual + + + + +
+
+Sample of the date tag: November 21, 2003
+Sample #2 of the date tag: 11/21/03 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
THE NATURAL SELECTION SCORING SYSTEM
MARINE ACTIONREWARDALIEN ACTIONREWARD
Killing Skulk1Killing Marine1
Killing Gorge2Killing Jetpack Marine3
Killing Lerk3Killing Heavy Armor Marine4
Killing Fade4Killing Sentry Turret2
Killing Onos5Killing Automated Siege Cannon3
Building Command Chair5Building Hive5
Building Resource Tower3Building Alien Resource Tower3
Building Other Marine Structure2Building Other Alien Structure2
+
+ + + + + + + + + + + + + + + + + + + +
THE NATURAL SELECTION RESOURCE SYSTEM
GAME ACTIONMARINE REWARDALIEN REWARD
Killing an enemy player1-3 random resources to your team1-3 random resources to you
Resource tower1 resource per 4 seconds to your team1 resource per 4 seconds split evenly among all players on your team
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MARINE WEAPONS - SLOT 1
LIGHT MACHINE GUN :: Default weapon. Fair damage and range. Versatile and effective, more so in groups. Marines spawn with 2 clips of ammunition. + + + + + + + + + + + + + +
Damage: 10 hp/shotRate of fire: 10.00 shots/sec
Clip size: 50 bulletsMax storage: 250 bullets
Cost: N/ARequires: N/A
+
SHOTGUN :: Deadly at close range. Fires 10 pellets per shot. + + + + + + + + + + + + + +
Damage: 17 hp/pelletRate of fire: 0.77 shots/sec
Clip size: 8 shotsMax storage: 40 shots
Cost: 10 resourcesRequires: Armory
+
HEAVY MACHINE GUN :: Not as accurate as the Machine Gun, but twice the punch and a bigger clip. + + + + + + + + + + + + + +
Damage: 20 hp/shotRate of fire: 9.09 shots/sec
Clip size: 125 bulletsMax storage: 250 bullets
Cost: 15 resourcesRequires: Advanced Armory
+
GRENADE LAUNCHER :: Used for groups of enemies or structures. Grenades explode on contact with an enemy or after 4 seconds with a radius of 350 units. + + + + + + + + + + + + + +
Damage: 125 hp/shotRate of fire: 0.83 shots/sec
Clip size: 4 shotsMax storage: 30 shots
Cost: 20 resourcesRequires: Advanced Armory
+
MARINE WEAPONS - SLOT 2
PISTOL :: Default secondary weapon. Good accuracy and power, small clip. Marines spawn with 2 clips of ammunition. + + + + + + + + + + + + + +
Damage: 20 hp/shotRate of fire: 5.00 shots/sec
Clip size: 10 shotsMax storage: 30 shots
Cost: N/ARequires: N/A
+
MARINE WEAPONS - SLOT 3
KNIFE :: Last ditch weapon when marines run out of ammo or want to conserve it. + + + + + + + + + + + + + +
Damage: 30 hp/slashRate of fire: 1.54 slashes/sec
Clip size: N/AMax storage: N/A
Cost: N/ARequires: N/A
+
MARINE WEAPONS - SLOT 4
WELDER :: Used to repair structures and armor, and to weld certain map features open or closed. Weldable objects are marked by special icons on the marine HUD. + + + + + + + + + + + + + +
Damage: 4 hp/secRepair rate: 50 hp/sec
Clip size: unlimitedMax storage: N/A
Cost: 5 resourcesRequires: Armory
+
MINES :: Trip mine/land mine used for defense. Mines explode on contact with an enemy or after absorbing 30 hp of damage with a radius of 300 units. + + + + + + + + + + + + + +
Damage: 125 hpRate of fire: N/A
Clip size: N/AMax storage: 5 mines
Cost: 10 resources for 5Requires: Armory
+
+
+ + + + + + + + + + + + + + + + +
MARINE ARMOR AND EQUIPMENT

HEAVY ARMOR :: Raises the armor of a marine to 200 hp. The armor's extra bulk slows the marine slightly, causing him to move at 95% of normal speed. Armor upgrades from the arms lab are cumulative with the effect of the Heavy Armor suit.
+ Cost: 15 resources
+ Duration: for the marine's lifetime

JETPACK :: Allows sustained flight, until the energy meter hits zero. Must land to recharge. Handy for avoiding fangs and claws. Can't be worn with Heavy Armor.
+ Cost: 15 resources
+ Duration: for the marine's lifetime
CATALYST PACK :: Boosts the metabolism of a marine, hurting him in the process. The marine gains a 25% bonus to speed and fires his weapons 25% faster, but loses 25% of his total health. A marine can't die from using a cat pack.
+ Cost: 4 resources
+ Duration: 8 seconds
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ARMS LAB UPGRADES
DAMAGE UPGRADES :: Three levels of upgrade that provide 10%, 20%, and 30% increases to the standard damage of all marine weapons, mines, turrets, and siege cannons.
+ Cost: 20/30/40 resources
+ Research time: 60/90/120 seconds
ARMOR UPGRADES :: Three levels of upgrade that give a 20%, 40%, and 60% boost to the maximum armor of all marines.
+ Cost: 20/30/40 resources
+ Research time: 60/90/120 seconds
CATALYSTS :: This technology allows the commander to drop catalyst packs anywhere on the map.
+ Cost: 20 resources
+ Research time: 40 seconds
TECH LAB UPGRADES
JETPACK TECH :: Once researched, this technology allows jetpacks to be constructed within 300 units of any prototype lab.
+ Cost: 35 resources
+ Research time: 50 seconds
HEAVY TECH :: This technology is required before heavy armor can be purchased. Once complete, heavy armor can be constructed within 300 units of any prototype lab.
+ Cost: 40 resources
+ Research time: 100 seconds
OBSERVATORY UPGRADES
MOTION TRACKING :: This upgrade reveals all enemy movement, anywhere on the battlefield, as "blips" automatically displayed on the marine HUD. The Kharaa can counter this effect by standing still, or staying close to sensory chambers.
+ Cost: 35 resources
+ Research time: 100 seconds
DISTRESS BEACON :: The distress beacon is the commander's last ditch SOS call for reinforcements. All marines waiting to respawn appear in the marine base, even if there are no infantry portals left.
+ Cost: 15 resources
+ Time to activate: 3 seconds
PHASE TECH :: Phase tech is a specialized nanite technology needed for the construction of phase gates (see Marine Structures).
+ Cost: 15 resources
+ Research time: 45 seconds
ARMORY UPGRADES
ADVANCED ARMORY :: The armory must be upgraded to an advanced armory before heavy weapons can be purchased. When complete, heavy machine guns and grenade launchers can be dropped within 300 units of the armory.
+ Cost: 30 resources
+ Research time: 180 seconds
TURRET FACTORY UPGRADES
SIEGE UPGRADE :: Turret factories must be be upgraded, before siege cannons can be built. Once this upgrade completes, Siege Cannons can be built within 400 units of the structure.
+ Cost: 15 resources
+ Research time: 15 seconds
ELECTRICAL DEFENSE :: An electric field that protects turret factories and resource nodes by shocking up to 2 enemies at once within a 200 unit range. + + + + + + + + + +
Damage: 25 hpRate of fire: 1.00 shock/sec
Cost: 30 resourcesResearch time: 180 seconds
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BASIC MARINE STRUCTURES
COMMAND CONSOLE :: Allows one marine to connect to the command network and take the role of Commander. The marine team always starts with a single command console.
+ Cost: 20 resources
+ Build time: 15 seconds
+ Health: 10000 hp
RESOURCE TOWER :: Allows the commander to tap a ship or base's raw nano-supplies. Can only be constructed over resource nozzles. Each tower adds 1 resource every 4 seconds.
+ Cost: 15 resources
+ Build time: 15 seconds
+ Health: 6000 hp
INFANTRY PORTAL :: Allows marines to respawn after being killed. Infantry portals are the most crucial structure to defend, second only to the command console. Must be placed within 400 units of a command console. Note: the marines do not start play with any infantry portals.
+ Cost: 20 resources
+ Build time: 10 seconds
+ Health: 2500 hp
ARMORY :: Dispenses "free" ammo for a marine's active weapon, and allows weapon construction within 300 units. Can be upgraded to an advanced armory for heavier weapons.
+ Cost: 10 resources
+ Build time: 15 seconds
+ Health: 2400 hp
OBSERVATORY :: Reveals nearby enemies (even when cloaked), allows scanner sweeps, distress beacons, and research of motion tracking. Scanner sweeps allow the commander to see cloaked aliens and structures in a 800 unit radius from the origin of the sweep, for a duration of 10 seconds.
+ Cost: 20 resources
+ Build time: 15 seconds
+ Health: 1700 hp
PHASE GATE :: Allows marines to teleport instantly between any two portals. For more than two portals, the destination is randomly determined. To use a portal, stand next to it and press your "use" key ( [ ] default setting).
+ Cost: 15 resources
+ Build time: 12 seconds
+ Health: 3000 hp
RESEARCH STRUCTURES
ARMS LAB :: Taps local resources to allow three levels of weapons and armor upgrades.
+ Cost: 25 resources
+ Build time: 19 seconds
+ Health: 2200 hp
PROTOTYPE LAB :: Allows the research of advanced, cuttinge edge technology - presently jetpacks and heavy armor.
+ Cost: 40 resources
+ Build time: 20 seconds
+ Health: 4000 hp
DEFENSIVE STRUCTURES
TURRET FACTORY :: Allows sentry turrets (automated gun emplacements) to be built for base and perimeter defense. Turrets must be placed within 400 units of a factory. The Electrical Defense upgrade protects turret factories.
+ Cost: 10 resources
+ Build time: 13 seconds
+ Health: 3000 hp
SENTRY TURRET :: Automatically acquires the nearest enemy target (players or structures) and fires. If its turret factory is destroyed, it ceases to function. The Electrical Defense upgrade protects turrets.
+ + + + + + + + + + + + + +
Damage: 10 hp/shotRate of fire: 1.43 shots/sec
Cost: 10 resourcesBuild time: 7 seconds
Health: 1300 hp
+
AUTOMATED SIEGE CANNON :: Automatically acquires the nearest enemy structure it can "see" (but not players) and focuses a devestating blast at its location. The siege cannon can fire through walls or obstacles up to the limit of its range, but only if the target is "painted" by a marine spotter (who just has to look at it) or a commander's scanner sweep (see the Observatory entry). Enemies caught standing next to a blast also take damage. Alien chambers are hurt for double the damage listed.
+ + + + + + + + + + + + + +
Damage: 165 hp/shotRate of fire: 0.25 shots/sec
Cost: 15 resourcesBuild time: 10 seconds
Health: 2000 hp
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ALIEN SPECIES
SKULK :: All-purpose combat and scouting class that can walk up walls and ceilings. + + + + + + + + + + + + + +
Cost: 2 resourcesGestation Time: 7 seconds
Health: 70 hpArmor: 20 hp
Speed: 290 units/sec
+
+ + + + + + + + + + + + + + + + + + +
Using its powerful jaws, the skulk can cause major damage point blank range
+ + + + + + + + + +
Damage: 75 hp/biteRate of Fire: ?? bites/sec
Energy Cost: ?? unitsRequires: N/A
+
A live tracking device that shows marine player and building positions on hive sight once the skulk spits it on a target
+ + + + + + + + + +
Damage: 10 hp/shotRate of Fire: ?? shots/sec
Energy Cost: ?? unitsRequires: 1 Hive
+
The skulk can jump large distances quickly to close on its prey
+ + + + + + + + + +
Damage: 80 hp/hitRate of Fire: N/A
Energy Cost: ?? unitsRequires: 2 Hives
+
An explosion of flesh and bone, killing the skulk and blasting everything within a radius of ?? units
+ + + + + + + + + +
Damage: ?? hpRate of Fire: N/A
Energy Cost: ?? unitsRequires: 3 Hives
+
+
GORGE :: Builder and "medic" class. Determines team strategy by choosing which structures to build and when. + + + + + + + + + + + + + +
Cost: 10 resourcesGestation Time: 17 seconds
Health: 150 hpArmor: 40 hp
Speed: 170 units/sec
+
+ + + + + + + + + + + + + + + + + + +
Goo projectiles that can harass an enemy
+ + + + + + + + + +
Damage: 25 hp/shotRate of Fire: ?? shots/sec
Energy Cost: ?? unitsRequires: N/A
+
A mist that heals alien players and structures while hurting marines and their equipment
+ + + + + + + + + +
Damage: 16 hp/shotRate of Fire: ?? shots/sec
Energy Cost: ?? unitsRequires: 1 Hive
+
Acid artillery that explodes in a 200 unit radius and does double damage against marine structures
+ + + + + + + + + +
Damage: 200 hp/hitRate of Fire: ?? shots/sec
Energy Cost: ?? unitsRequires: 2 Hives
+
Strung between walls, these strands cause marine equipment to fail and enemy movement to slow to a crawl for ?? seconds
+ + + + + + + + + +
Damage: N/ARate of Fire: ??
Energy Cost: ?? unitsRequires: 3 Hives
+
+
LERK :: Flying support class. Not much of a fighter himself, but can heavily boost effectiveness of teammates. Good for hive defense, and abilities serve as "spells" he can use to attack or defend players or areas. + + + + + + + + + + + + + +
Cost: 30 resourcesGestation Time: 28 seconds
Health: 125 hpArmor: 30 hp
Speed: 200 units/sec
+
+ + + + + + + + + + + + + + + + + + +
Using its powerful jaws, the lerk can cause major damage point blank range
+ + + + + + + + + +
Damage: 60 hp/biteRate of Fire: ?? bites/sec
Energy Cost: ?? unitsRequires: N/A
+
A choking gas cloud with a ?? second duration that damages normal and jetpack marines in a ?? unit radius
+ + + + + + + + + +
Damage: 7 hp/?? secondsRate of Fire: ?? shots/sec
Energy Cost: ?? unitsRequires: 1 Hive
+
A cloud that blocks marine bullets, stopping ??% of the incoming shots from hurting aliens in a ?? unit radius for 3 seconds
+ + + + + + + + + +
Damage: 80 hp/hitRate of Fire: N/A
Energy Cost: ?? unitsRequires: 2 Hives
+
lerk version of primal scream imageA loud scream that drives the aliens around it into a frenzy, increasing their attack speed by 30%, their attack damage by 30%, and their available energy by 60% for ?? seconds
+ + + + + + + + + +
Damage: N/ARate of Fire: ??
Energy Cost: ?? unitsRequires: 3 Hives
+
+
FADE :: Finesse attacking class.
+ + + + + + + + + + + + + +
Cost: 60 resourcesGestation Time: 23 seconds
Health: 250 hpArmor: 100 hp
Speed: 240 units/sec
+
+ + + + + + + + + + + + + + + + + + +
SLASH
+ + + + + + + + + +
Damage: 90 hp/biteRate of Fire: ?? bites/sec
Energy Cost: ?? unitsRequires: N/A
+
BLINK
+ + + + + + + + + +
Damage: N/ARate of Fire: ?? blinks/sec
Energy Cost: ?? unitsRequires: 1 Hive
+
The fade speeds up its metabolism, healing itself for ?? hp
+ + + + + + + + + +
Damage: N/A Rate of Fire: ??
Energy Cost: ?? unitsRequires: 2 Hives
+
ACID ROCKET (mention splash radius)
+ + + + + + + + + +
Damage: ?? hpRate of Fire: N/A
Energy Cost: ?? unitsRequires: 3 Hives
+
+
ONOS :: Lets player lead the charge and do tremendous damage to groups of players.
+ + + + + + + + + + + + + +
Cost: 100 resourcesGestation Time: 38 seconds
Health: 500 hpArmor: 400 hp
Speed: 225 units/sec
+
+ + + + + + + + + + + + + + + + + + +
GORE
+ + + + + + + + + +
Damage: 75 hp/biteRate of Fire: ?? bites/sec
Energy Cost: ?? unitsRequires: N/A
+
The Onos swallows a marine whole, removing them from the fight while they are slowly digested
+ + + + + + + + + +
Damage: 3 hp/shotRate of Fire: ?? shots/sec
Energy Cost: ?? unitsRequires: 1 Hive
+
By pounding the floor, the Onos can stun marines in a ?? unit radius for 2.00 seconds
+ + + + + + + + + +
Damage: N/AtRate of Fire: N/A
Energy Cost: ?? unitsRequires: 2 Hives
+
CHARGE
+ + + + + + + + + +
Damage: 320 hpRate of Fire: ??
Energy Cost: ?? unitsRequires: 3 Hives
+
+
+
+ + + + + + + + + + + + + + + + +
ALIEN CHAMBERS
HIVE :: Aliens need a hive to spawn. Each hive unlocks a new ability for each alien. Any alien standing within 500 units of a hive is automatically healed for 20 hp per second.
+ + + + + + + + + +
Cost: 40 resourcesBuild time: 180 seconds
Health: 7000 hpRegen Rate: 2 hp/second
+
RESOURCE TOWER :: Gathers 1 resource every 4 seconds, splitting it evenly among team members.
+ + + + + + + + + +
Cost: 15 resourcesBuild time: 20 seconds
Health: 2500 hpRegen Rate: 5 hp/second
+
DEFENSE CHAMBER :: Provides defensive upgrades and heals up to three chambers or aliens within ?? units for 10 hp per second.
+ + + + + + + + + +
Cost: 10 resourcesBuild time: 20 seconds
Health: 1200 hpRegen Rate: 5 hp/second
+
MOVEMENT CHAMBER :: Provides movement upgrades and energizes aliens within 400 units for 10% of their total energy every 2 seconds.
+ + + + + + + + + +
Cost: 10 resourcesBuild time: 12 seconds
Health: 1000 hpRegen Rate: 5 hp/second
+
SENSORY CHAMBER :: Provides sensory upgrades, and cloaks aliens and chambers within 750 units.
+ + + + + + + + + +
Cost: 10 resourcesBuild time: 14 seconds
Health: 800 hpRegen Rate: 5 hp/second
+
OFFENSE CHAMBER :: Attacks enemy players and structures when built.
+ + + + + + + + + + + + + +
Cost: 10 resourcesBuild time: 11 seconds
Health: 1000 hpRegen Rate: 5 hp/second
Damage: 20 hp/shotRate of fire: ?? shots/second
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DEFENSIVE EVOLUTIONS
CARAPACE :: Toughens alien hides, adding the armor amounts shown
+ + + + + + + + + + + + + + + + +
Skulk Armor Bonus: 20 hp/level
Gorge Armor Bonus: 50 hp/level
Lerk Armor Bonus: 30 hp/level
Fade Armor Bonus: 100 hp/level
Onos Armor Bonus: 150 hp/level
+
REDEMPTION :: Adds a ??% per level chance that an alien under ??% percent health will teleport to the hive farthest when hurt to avoid death.
REGENERATION :: Allows aliens that have been hurt to regain 3% of their health per level every ?? seconds.
MOVEMENT EVOLUTIONS
ADRENALINE :: Boosts the rate at which the alien regains energy. The boost is 8% at level one, 12% at level one, and 16% at level three.
CELERITY :: Causes the alien to move 25 units/second faster per level.
SILENCE :: Reduces the volume of alien player sounds with each upgrade. The relative volume of alien sounds drops to 50% at level one, 15% at level two, and 0% at level three.
SENSORY EVOLUTIONS
CLOAKING :: Reduces the opacity of players when they haven't moved in ?? seconds, making them harder to see. The relative visiblity of alien player models drops to ??% at level one, ??% at level two, and ??% at level three.
focus iconFOCUS :: Slows down slot 1 alien attacks while making them more powerful. Damage is increased by 0.33% and rate of fire is reduced by 0.50 for each level.
SCENT OF FEAR :: Allows the alien to detect any injured marines on hive sight. The distance increases with each level: ?? units at level one, ?? units at level one, and ?? units at level three.
+
+
\ No newline at end of file diff --git a/main/manual/Quick_Start_Guide_Tables_Framed.html b/main/manual/Quick_Start_Guide_Tables_Framed.html new file mode 100644 index 00000000..edee8e35 --- /dev/null +++ b/main/manual/Quick_Start_Guide_Tables_Framed.html @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/main/manual/UpdateManual.pl b/main/manual/UpdateManual.pl new file mode 100644 index 00000000..92cdc00d --- /dev/null +++ b/main/manual/UpdateManual.pl @@ -0,0 +1,188 @@ +# +# Updates the NS manual using Balance.txt +# +local ($kVersion, $kFileSpecifier, $kBalanceFileName, $kTempFileName,%BalanceVars,@BalanceUpdateTime); + +# +# Changelog +# +# v1.1 - Karl Patrick +# +# tag parser / content replacer +# - changed tag structure to be SGML compliant and use an ns namespace for ease of validation, e.g. value +# - widened definition of content between nsvalue tags to include all characters except '<' so non-word characters can become placeholders +# - added global processing switch for the tag substitution operators (they now replace multiple matches in a line) +# - changed nsinverse tag to print inverse value with 2 decimal places +# - changed nspercent tag to print percentile after the numeric value and never use a decimal place +# - added fourth tag type, nsdate, which inserts the timestamp of the Balance.txt file in whatever format the tag specifies +# - TODO: use m// operator to match ns namespace tags and formally parse tag attributes +# - TODO: parse entire file at once to lose dependancy on line breaks +# file handling +# - added optional command line statements to manually specify the balance file name [arg0] and files to parse [all other args] +# - default behavior remains unchanged if no args are supplied +# - the current directory is scanned for files to update if only one argument is given +# - moved filtering of file names to default array construction; any explicitly named file will now be processed +# - replaced native system calls for file handling with perl function calls +# - added early termination of program on balance.txt file read failure +# - added automatic deletion of temp file if no replacements were made to the original +# - TODO: drop use of temp file in favor of local string storage, use rename-to-.bak and update paradigm for files +# misc +# - removed previously commented out debug print statements +# - replaced some of the globals with subroutine arguments / locals +# - changed output format to be easier to scan for large numbers of files +# +# v1.0 Original Version - Charlie Cleveland +# + +# +# Constants +# +$kVersion = "v1.2"; +$kFileSpecifier = ".php"; +$kBalanceFileName = "c:\\Web\\ns\\Balance.txt"; +$kTempFileName = "UpdateManual.temp"; + +local $blankLine = "...................................................................."; + +sub Main; +Main(); + +# Subroutine that checks file out of Perforce, does a search and replace on all values, then reverts the file if unchanged +sub ProcessFileName +{ + # Read subroutine args + my $theFileName = shift(@_); + + use POSIX qw(strftime); + + # Read in whole file + my $printString = sprintf("READING \"$theFileName\""); + if(!open(FILE2, $theFileName)) + { + printf("%s%s[FAILURE]\n",$printString,substr($blankLine,length($printString))); + return 0; + } + + printf("%s%s[SUCCESS]\n",$printString,substr($blankLine,length($printString))); + + # Open tempoarary file for writing + if(!open(FILE3, '>', $kTempFileName)) + { + $printString = sprintf("WRITING \"$theFileName\""); + printf("%s%s[FAILURE]\n",$printString,substr($blankLine,length($printString))); + return 0; + } + + # Check for a match + my $theNumReplacements = 0; + + while() + { + local $theCurrentLine = $_; + + if($theCurrentLine =~ s/()[^<]*(<\/ns:value>)/$1 . $BalanceVars{$2} . $3/ge) + { $theNumReplacements++; } + + # This can't be in an else clause any more because both types may appear on the same line + if($theCurrentLine =~ s/()[^<]*(<\/ns:percent>)/$1 . sprintf("%.0f%%",$BalanceVars{$2}*100) . $3/ge) + { $theNumReplacements++; } + + if($theCurrentLine =~ s/()[^<]*(<\/ns:inverse>)/$1 . sprintf("%.2f",1\/$BalanceVars{$2}) . $3/ge) + { $theNumReplacements++; } + + if($theCurrentLine =~ s/()[^<]*(<\/ns:date>)/$1 . strftime($2,@BalanceUpdateTime) . $3/ge) + { $theNumReplacements++; } + + print FILE3 $theCurrentLine; + } + + close FILE2; + close FILE3; + + if($theNumReplacements > 0) # Update if a match was present + { + $printString = sprintf("UPDATING \"$theFileName\""); + + if(unlink($theFileName) && rename($kTempFileName,$theFileName)) + { + printf("%s%s[SUCCESS]\n",$printString,substr($blankLine,length($printString))); + return 1; + } + else + { + printf("%s%s[FAILURE]\n",$printString,substr($blankLine,length($printString))); + return 0; + } + } + else + { + unlink($kTempFileName); + return 1; + } +} + +sub ReadBalanceVariables +{ + # Read Balance file + my $printString = sprintf("PARSING \"$kBalanceFileName\""); + open(FILE, $kBalanceFileName); + + @BalanceUpdateTime = localtime((stat(FILE))[9]); + my $theSuccess = 0; + + # Print contents of Balance.txt + while() + { + my $theCurrentBalanceLine = $_; + if($theCurrentBalanceLine =~ /#define/) + { + my @theCurrentTokens; + @theCurrentTokens = split(); + + if($#theCurrentTokens == 2) + { + my $tokenOne = $theCurrentTokens[1]; + my $tokenTwo = $theCurrentTokens[2]; + + $BalanceVars{$tokenOne} = $tokenTwo; + + $theSuccess = 1; + } + } + } + + close(FILE); + + printf("%s%s[%s]\n",$printString,substr($blankLine,length($printString)),$theSuccess ? "SUCCESS" : "FAILURE"); + return $theSuccess; +} + +sub Main +{ + print "\nRunning Natural Selection Manual Updater $kVersion\n\n"; + + if($#ARGV >= 0) # First arg is the Balance document name + { + $kBalanceFileName = $ARGV[0]; + shift(@ARGV); # Drop first argument + } + + # Read in the contents of Balance.txt to use for replacement + if(ReadBalanceVariables() == 0) + { return; } # Return on failure + + if($#ARGV >= 0) # Remaining args are files to parse + { @theHTMLFiles = @ARGV } + else + { + # Search through all the files in the working directory + opendir(DIR, "."); + local @AllFiles = readdir(DIR); + @theHTMLFiles = grep(/$kFileSpecifier/i,@AllFiles); + closedir(DIR); + } + + # Process each file + foreach (@theHTMLFiles) + { ProcessFileName($_); } +} \ No newline at end of file diff --git a/main/manual/alien.html b/main/manual/alien.html new file mode 100644 index 00000000..e4686cf5 --- /dev/null +++ b/main/manual/alien.html @@ -0,0 +1,194 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+

The Kharaa will work together to defend their + hives, or attack a large force or well defended + base. Otherwise, it's each Kharaa for itself, + gestating, evolving, and behaving according to + their own objectives. Hit-and-run, ambush, and + blitz tactics are common – but just as often, + a Kharaa will bulk up and go toe-to-toe with any + foe it can find. But for the unifying presence + of the bacterium + and hive sight, + they would be little more than aggressive (and + cunning) animals.

+
+ + + + + +
+

The marine section + is organized by squad tasks, goals and equipment. + These are the integral pieces of any military + operation. The Kharaa section is organized by + the progression of their growth. This reflects + the crucial difference between the TSA and the + Kharaa. Where we are deliberately responding to + a threat, as near as we can tell they are simply + reproducing, and instinctually overcoming obstacles + (us) by drawing on more and more sophisticated + responses (hives, species, and evolutions).

+
+ + + + + + +
+ + + + + + + + + + + +
+ Bacterium
+
+
Hive
Resources
Chambers
Species
Victory
+ +
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_abilities.html b/main/manual/alien_abilities.html new file mode 100644 index 00000000..e19a2496 --- /dev/null +++ b/main/manual/alien_abilities.html @@ -0,0 +1,183 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: The + Hive: Advanced Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: New hives do more than allow + new species, they advance and evolve the abilities + of all species, and allow for new chambers + to be constructed.

+
+
+ + + + +
+

+ There are two ways the hive advances species abilities.
+
+ 1. Each hive allows Gorge's to build another kind + of chamber, making new evolutionary upgrades available + to the Kharaa, regardless of species. See the + evolutions + section for more information.
+
+ 2. New hives evolve each species into a more advanced + form. We believe that, for example, the first + Skulks to spawn + are primitive, early specimens; but with each + new hive, the Skulks becomes more advanced, and + evolved, versions of themselves. This is true + of all Kharaa species, and is reflected in the + new abilities that become available with each + hive. These abilities are unique to each species + – and each new ability is more powerful than + the last. To see descriptions of these abilities, + see the species descriptions. +

+

These advancements suggest that the hives act + as evolutionary databases, containing a record + of the long long history of the Kharaa. The bacteria's + response to new situations is to spend resources + and make a whole new array of instincts and responses + available.

+
+ + + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_abilitiesandattacks.html b/main/manual/alien_abilitiesandattacks.html new file mode 100644 index 00000000..caad7103 --- /dev/null +++ b/main/manual/alien_abilitiesandattacks.html @@ -0,0 +1,167 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species: + Abilities and Attacks
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + +
+

+ A testament to the very process of evolution, + Kharaa abilities are a match for the most advanced + human equipment and weaponry, and all without + any apparent understanding, or even the idea of, + "technology".

+

All species are spawned with certain basic, inherent + attacks and abilities (listed as "inherent" + and "primary"). Just as multiple hives + are needed for more advanced species, the more + powerful attacks and abilities also require multiple + hives (see the Hives + section for more data). Hives act as active databases, + providing ongoing access to the necessary genetic + information for each ability. Example: Lerks + did not evolve the umbra + ability until well into their history – and so + cannot evolve it again until a third hive provides + the genetic record of this complex (and remarkable) + ability. Losing a hive removes any abilities it + granted. If all hives are lost, the Kharaa lose + access to even their one-hive abilities.

+
+ + + + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_bacterium.html b/main/manual/alien_bacterium.html new file mode 100644 index 00000000..4d134c65 --- /dev/null +++ b/main/manual/alien_bacterium.html @@ -0,0 +1,184 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data: The Bacterium
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: The building block of the Kharaa, + and the key to ever unraveling their mystery and + inner-workings, is the bacteria-like life form + that first appears on a ship or base. How + it appears is one question we would desperately + like to answer.

+
+
+ + + + + +
+

+ As near as we can tell, trace amounts of the bacteria + begin to collect in areas containing water or + heat sources. The bacteria reproduce, slowly forming + a mat, visible to the naked eye. It also seems + to direct airborne streams down the hallways and + passageways, and anywhere it finds another source + of energy (water or heat) it forms another mat, + from which it sends out more streams, etcetera. + It is safe to assume that every square inch of + a facility is rapidly infiltrated with at least + trace amounts of bacteria, anchored at source + points that become potential hive + locations (so far, we have never seen more than + three). All of these bacteria are in contact with + one another, sharing data on their environment, + and triggering responses to stimuli (like energy + sources, or danger). They form a network, called + the Bacterium.
+

+
+ + + + + + +
+

+ Bacterial Gridlock

+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_chambers.html b/main/manual/alien_chambers.html new file mode 100644 index 00000000..a91d871a --- /dev/null +++ b/main/manual/alien_chambers.html @@ -0,0 +1,195 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data: Chambers
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: The Gorge + creates these chambers to serve many purposes. + Some enable new evolutions, + while others serve tactical, defensive, or resource + gathering purposes. Each hive allows for one kind + of evolution chamber. Resource chambers and + offensive chambers have no hive requirements.

+
+
+ + + + +
+

+ Each of these chambers serve a purpose in the + field, but defensive, movement, and sensory chambers + play another important role. They act as supplements + to the knowledge contained in hives, allowing + the Kharaa to specialize themselves even further + with entirely new abilities. Each hive can support + one kind of upgrade chamber – though which type + of chamber is chosen first, second, and third + has varied from battle to battle. See the evolutions + section for descriptions of these powerful biological + upgrades.

+
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ Movement + + Sensory
+ Defensive + Offensive
+ Resource Chambers 
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_chambers_d.html b/main/manual/alien_chambers_d.html new file mode 100644 index 00000000..ab7e054b --- /dev/null +++ b/main/manual/alien_chambers_d.html @@ -0,0 +1,187 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Chambers: + Defensive Chamber
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Allows defensive + evolutions.

+
+
+ + + + + +
+

Function: these growths heal any alien + or other chamber nearby (much like healing + spray or hives). + We have seen them deployed at forward positions + to assist group attacks. Multiple defense chambers + heal faster, though after three, this cumulative + effect appears to plateau.

+
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ Movement + + Sensory
+ Defensive + Offensive
+ Resource Chambers 
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_chambers_m.html b/main/manual/alien_chambers_m.html new file mode 100644 index 00000000..e39bef22 --- /dev/null +++ b/main/manual/alien_chambers_m.html @@ -0,0 +1,186 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Chambers: + Movement Chamber
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Allows movement + evolutions.

+
+
+ + + + + +
+

Function: these growths appear to transport + aliens to the active hive farthest from the chamber's + location. We understand this around as well as + the redemption + or blink phenomena + – which is to say, more data is required.

+
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ Movement + + Sensory
+ Defensive + Offensive
+ Resource Chambers 
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_chambers_o.html b/main/manual/alien_chambers_o.html new file mode 100644 index 00000000..5bb26d0d --- /dev/null +++ b/main/manual/alien_chambers_o.html @@ -0,0 +1,185 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Chambers: + Offensive Chamber
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

No evolutionary significance.

+
+
+ + + + + +
+

Function: offense chambers are the Kharaa + equivalent of turrets. Any creature entering their + area that is not hooked into the bacterium (i.e., + an alien) is attacked with projectiles similar + in strength and speed to the Gorge's spit + attack.

+
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ Movement + + Sensory
+ Defensive + Offensive
+ Resource Chambers 
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_chambers_r.html b/main/manual/alien_chambers_r.html new file mode 100644 index 00000000..423792e8 --- /dev/null +++ b/main/manual/alien_chambers_r.html @@ -0,0 +1,183 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Chambers: + Resource Chambers
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

No evolutionary significance.

+
+
+ + + + + +
+

Function: The Kharaa equivalent of a resource + tower, resource chambers harvest stores of + raw nano-sludge for the alien's use. See resources + for more information.

+
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ Movement + + Sensory
+ Defensive + Offensive
+ Resource Chambers 
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_chambers_s.html b/main/manual/alien_chambers_s.html new file mode 100644 index 00000000..7e0b6f00 --- /dev/null +++ b/main/manual/alien_chambers_s.html @@ -0,0 +1,188 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Chambers: + Sensory Chamber
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Allows sensory + evolutions.

+
+
+ + + + + +
+

Function: any hostiles a sensory chamber + can "see" are added to the Hive Sight. + Placed strategically they have turned many marine + surprise assaults into costly ambushes. Sensory + Chambers also "stain" any hostile that + touches them, adding them permanently to hive + sight (just as the parasite + ability does).

+
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ Movement + + Sensory
+ Defensive + Offensive
+ Resource Chambers 
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_changingspecies.html b/main/manual/alien_changingspecies.html new file mode 100644 index 00000000..afe3b6eb --- /dev/null +++ b/main/manual/alien_changingspecies.html @@ -0,0 +1,170 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species: + Changing Species
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + +
+

+ Ever resource conscious, the bacterium always + first creates Skulks + – they seem to provide the best results for the + least investment. After aliens spawn as Skulks, + they can change their form into the other four + species described here. A gestation sac forms + around them, and resources and information are + drawn from the bacterium. The alien that emerges + appears to have the same knowledge and evolutions + as it did in its previous form. An alien must + have access to enough resources + to gestate into each species. Some complex forms + also require two or more hives + to be active.

+

The higher cost of more complex species leads + to fascinating variation in tactics. Losing one + Onos costs the aliens + as much as a dozen (evolved) Skulks. + Because they basically "cost" nothing, + Skulks seem to be more reckless and willing to + die to destroy their target than their more powerful, + and more expensive, brothers. On the other hand, + a single Onos can destroy an entire squad and + base.

+
+ + + + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions.html b/main/manual/alien_evolutions.html new file mode 100644 index 00000000..b8cda9b7 --- /dev/null +++ b/main/manual/alien_evolutions.html @@ -0,0 +1,223 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species: + Evolutions
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: the Kharaa can travel up their + own family tree, changing their "race", + and evolving extraordinary abilities. Evolutions + are broken down into three categories – Defensive, + Movement, + and Sensory. +

+
+
+ + + + + +
+

+ When it was first noticed that the aliens seemed + to be modifying themselves over the course of + a prolonged engagement – growing more resistant + to gunfire, or becoming utterly silent – it was + assumed that they were reacting to our actions, + and developing immunities much like a virus does. + The truth is more complex.

+

Just as a marine structure contains coded information + that allows a ship or base's nanotech to perform + new, military grade, functions, so do the aliens + begin with base-level resources, and construct + structures to increase their combat abilities. + The difference is, a Kharaa defensive tower (for + instance) is less like a computer, and more like + a time capsule. It contains information similar + to a Hive's, but more specific – this information + describes variations of creatures from the Kharaa's + history: a genetic family tree. When a Kharaa + gains a new ability, it is evolving from its base + form, down some specialized branch of that tree: + growing more sophisticated, and without fail, + deadlier. This fast-forward evolution allows for + dozens of variations of alien: each supposedly + suited to some environment, lost in the Kharaa's + past. Similar to Earth species that may have arctic, + desert and jungle variants, that while all the + same kind of animal, have evolved into unique + sub-species.

+

Multiple chambers appear to also offer more and + more information, improving the effectiveness + of each evolution. Once more than three chambers + are active, this improvement plateaus.

+

Since the Kharaa have probably never seen man-made + environments like ours, and since humans don't + always attack the same way twice, they don't choose + just one variation. They tend to evolve a wide + range of species types – ranging from brawlers, + with increased speed and armor, to assassins, + with silent movement and enhanced senses.

+
+ + + + + + +
+ + + + + + +
+

Defensive
+
+

+
+ + + +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_adrenaline.html b/main/manual/alien_evolutions_adrenaline.html new file mode 100644 index 00000000..76b8b691 --- /dev/null +++ b/main/manual/alien_evolutions_adrenaline.html @@ -0,0 +1,204 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions + :: Movement: + Adrenaline
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: alien becomes tireless; its energy + renews rapidly.

+
+
+ + + + + +
+

Observation: "The 'army' of aliens + that pinned down a squad of marines with a never-ending + hail of spikes, turned out to be one extremely + annoying Lerk." Or: "the normally hyper + Skulks started literally bouncing off the walls, + like a birthday party of three-year-olds who found + Mommy's amphetamines."

+

Thesis: The aliens rely on their own physiology + for their abilities and weapons. Every spike they + fire, or extreme physical act they commit, drains + them. The adrenaline evolution is probably an + internal overhaul – an upgrade of all internal + organs and systems, in favor of stronger and more + efficient ones. The resulting body can recover + very quickly from exertion, and will not tire + as fast. As with other abilities, these modifications + prohibit other evolutionary choices – namely, + celerity + and silence.

+ + + + + + + + + + + + + + + + +
    Adrenaline + (% of energy per second)
+

Level 1

+
+

8%

+
+

Level 2

+
+

12%

+
+

Level 3

+
+

16%

+
+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_advhivesight.html b/main/manual/alien_evolutions_advhivesight.html new file mode 100644 index 00000000..72cbefde --- /dev/null +++ b/main/manual/alien_evolutions_advhivesight.html @@ -0,0 +1,178 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions + :: Sensory: + Adv. Hivesight
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: aliens seem to "notice" + the enemy with great precision – are rarely surprised, + and can pick out hiding or concealed foes much + more often.

+
+
+ + + + + +
+

Observation: "I am not a noisy person. + I grew up doing black-op assassinations, and now + as an adult I am a goddam Frontiersman. So explain + to me how that [expletive] knew I was there." +

+

Thesis: until we know how alien "hivesight" + actually works, the aliens themselves will remain + a mystery. If our current knowledge (all of it + unproven and untested) is correct, these aliens + have the equivalent of a larger radar dish – + they can detect minute and distant disturbances + in the bacterial network. Because these aliens + have never been observed using the "Cloaking" + or "Scent of Fear" evolutions, it probably + involves their outermost skin layer. Perhaps microscopic + ridges form, increasing the alien's surface area, + and improving its "reception". In any + event, these creatures can pick out the threat + alert from the bacterial information stream with + extreme accuracy. At its highest level, this evolution + seems to make enemies near impossible to miss.

+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_carapace.html b/main/manual/alien_evolutions_carapace.html new file mode 100644 index 00000000..ed6bf2cd --- /dev/null +++ b/main/manual/alien_evolutions_carapace.html @@ -0,0 +1,385 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions + :: Defensive: + Carapace
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: alien grows armor, can resist + damage.

+
+
+ + + + + +
+

Observation: "A creature that only + took one clip to kill at the beginning of a battle + shrugs off four clips of light machine gun fire + and leaves a squad of marines looking like they've + been fed through a wood-chipper."

+

Thesis: Current thinking is that anywhere + from three inches to half a foot of force-distributing + micro-honeycombed cartilage forms beneath the + skin. This means that gunfire does do damage – + just much less than normal. This cartilage takes + up internal space that would otherwise be used + by the "Regeneration" or "Redemption" + evolution.

+

Alien carapace, much like marine armor, + absorbs a certain percentage of damage. The rest + is taken off the alien's health. Different species + of alien have different amounts of armor. The + following is a chart of carapace upgrades for + each species:
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Carapace
+

+
+

Skulk

+
+

Gorge

+
+

Lerk

+
+

Fade

+
+

Onos

+
+

+
+

points +

+
+

dmg + %

+
+

points +

+
+

dmg + %

+
+

points +

+
+

dmg + %

+
+

points +

+
+

dmg + %

+
+

points +

+
+

dmg + %

+
+

Start

+
+

10

+
+

30

+
+

50

+
+

30

+
+

50

+
+

30

+
+

90

+
+

30

+
+

150

+
+

30

+
+

Level 1

+
+

30

+
+

40

+
+

75

+
+

40

+
+

75

+
+

40

+
+

125

+
+

40

+
+

200

+
+

40

+
+

Level 2

+
+

30

+
+

50

+
+

75

+
+

50

+
+

75

+
+

50

+
+

125

+
+

50

+
+

200

+
+

50

+
+

Level 3

+
+

30

+
+

60

+
+

75

+
+

60

+
+

75

+
+

60

+
+

125

+
+

60

+
+

200

+
+

60

+
+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_celerity.html b/main/manual/alien_evolutions_celerity.html new file mode 100644 index 00000000..8f959fc6 --- /dev/null +++ b/main/manual/alien_evolutions_celerity.html @@ -0,0 +1,202 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions + :: Movement: + Celerity
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: movement rate increases.

+
+
+ + + + + +
+

Observation: "You'd think this would + be scarier on the small critters – and don't get + me wrong, a Lerk with celerity is like trying + to whack a hummingbird with a baseball bat. But + it's a little scarier when one of those three-ton + freaks is pounding along behind you, and it's + comin' on like a freight train. I've never been + so happy to see a ventilation shaft in my whole + life."

+

Thesis: the tensile strength of all muscles + and tendons in the "running" group is + increased, cores of flexible and strong material + form in the bones. This is probably a relatively + simple change, but the results are dramatic. At + their peak, our simulations cannot even speculate + how they can maintain such speeds – the stress + and impact alone should shatter their bones and + snap their muscles, no matter how strong.

+ + + + + + + + + + + + + + + + +
    Celerity + (% speed increase)
+

Level 1

+
+

~10%

+
+

Level 2

+
+

~20%

+
+

Level 3

+
+

~30%

+
+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_cloaking.html b/main/manual/alien_evolutions_cloaking.html new file mode 100644 index 00000000..c8415ad3 --- /dev/null +++ b/main/manual/alien_evolutions_cloaking.html @@ -0,0 +1,212 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions + :: Sensory: + Cloaking
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: when stationary, alien blends + into background.

+
+
+ + + + + +
+

Observation: "We hate this. Hate + it hate it hate it. It's bad enough that they + hide in shadows and run on walls – when they can + sit out in plain sight in a well lit room and + just wait for you to walk by so they can jump + on you from behind … scares the sweat outta + ya. You hear stories about someone getting on + an elevator alone, closing the door, hitting the + button, and just as it starts to move they hear + this god-awful chuckle ..."

+

Thesis: the outermost epidermal layer + becomes a crude computer screen, using skin pores + as pixels, and secreting pigment for color. When + the alien stops moving, it probably "plugs + in" to the local bacterial network, and "downloads" + the correct background image. As this evolution + becomes more efficient, the "pixel" + count increases. Kharaa are naturally resistant + to most forms of detection – for instance, their + body temperature tends to match the room's. With + the cloaking evolution, their ability to disappear + is total. This upgrade works only when stationary + – once the alien moves, or attacks, the link is + broken, and their skin reverts.
+

+ + + + + + + + + + + + + + + + +
    Cloaking
+

Level 1

+
+

blurred + camouflage

+
+

Level 2

+
+

faint + outline

+
+

Level 3

+
+

totally + invisible

+
+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_d.html b/main/manual/alien_evolutions_d.html new file mode 100644 index 00000000..f30f6c6f --- /dev/null +++ b/main/manual/alien_evolutions_d.html @@ -0,0 +1,176 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions: + Defense
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + +
+

These enhancements are subcutaneous, involving + neither the skin, nor internal organs. They provide + various defensive advantages, and like many evolved + abilities, are mutually exclusive. At least, as + far as we have seen, no alien has ever combined + two of them together.

+
+ + + + + + + +
+ + + + + + +
+

Carapace
+
+

+
+ + + +
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_m.html b/main/manual/alien_evolutions_m.html new file mode 100644 index 00000000..dbe3afa0 --- /dev/null +++ b/main/manual/alien_evolutions_m.html @@ -0,0 +1,175 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions: + Movement
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + +
+

These evolutions improve the musculature and + viscera of the Kharaa, drastically increasing + the alien's efficiency. Being mutually exclusive, + they also encourage very different combat behavior. +

+
+ + + + + + + +
+ + + + + + +
+

Adrenaline
+
+

+
+ + + +
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_redemption.html b/main/manual/alien_evolutions_redemption.html new file mode 100644 index 00000000..fa5f652e --- /dev/null +++ b/main/manual/alien_evolutions_redemption.html @@ -0,0 +1,189 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions + :: Defensive: + Redemption
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: when near death, alien disappears, + reappearing at a hive.

+
+
+ + + + + +
+

Observation: "There's this one ballsy + Skulk, makes a run on the base. We all stop what + we're doing and lay down suppressing fire. It's + in mid-air, comin' right at me (I notice it's + missing half of a tooth, that's how close it gets) + – when it just disappears. Gone. We all look + at each other like 'Okaaaay …' and get back + to work. A minute later, a Skulk makes a run on + the base from another direction, starts chewin' + on our resource tower. We just cover the area + with a blanket of bullets and it disappears. So + sure. Whatever. The third time I recognize the + sucker. It zips up the wall and drops right on + top of me. I get to look right up its throat. + It's the same Skulk. I'd swear to God."

+

Thesis: This, paired with the "blink" + ability, may be the most scientifically troubling + of alien evolutions. The two must be related, + but it is unclear how – and any "experiment" + that might "test" these abilities is, + at this juncture, impractical. The best idea so + far is that a new body is created back at the + hive, and the alien's unique information (memories, + etc.) is somehow transferred to it. This information + is probably stored in some transmission-ready + bacterial form, that is released when the creature + sustains too much damage – much like a mushroom + shooting off its spores when it is stepped on.

+

The redemption ability does not appear to be + one hundred percent certain. As an alien drops + below a certain health limit, there seems to be + an increasing chance that it will be redeemed. + With each increased level of this evolution, the + chance of redemption improves.

+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_regeneration.html b/main/manual/alien_evolutions_regeneration.html new file mode 100644 index 00000000..2dd1fcbc --- /dev/null +++ b/main/manual/alien_evolutions_regeneration.html @@ -0,0 +1,215 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions + :: Defensive: + Regeneration
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: alien rebuilds its body, constantly + healing damage

+
+
+ + + + + +
+

Observation: "We pumped four grenades + up onto the catwalk – no direct hits, but the + Fade was slammed over the railing. The thing was + on fire, for chrissakes. It goes down behind the + generator, into a big pile of spent fuel canisters. + Made a hell of a racket. We figure – grenade blast, + on fire, fell a couple of stories onto cast-metal + tubes … let's kick back, get some medkits, + and set up a forward base. A minute later, we + hear a canister roll across the floor. We all + stand up like, 'Nah … couldn't be …'. + Next thing we know we're dodging acid and screaming + for ammo."

+

Thesis: the Kharaa can harvest our resources, + and use them to build various organic structures. + It looks like some aliens evolve the ability to + re-build themselves, probably creating an organ + that teaches the local bacteria to regard it as + a structure that requires construction. So it + is not actually healing itself, but literally + being built anew (the Gorge's healing + spray likely operates on the same principle). + Absorbing raw material from the surrounding bacteria + requires subdermal conduits that interfere with + carapace evolution, and as near as we can tell, + the redemption evolution as well.

+

The following chart shows how many points per + second are regained by an alien with the regeneration + evolution:
+

+ + + + + + + + + + + + + + + + +
    Regeneration + (points every 2 seconds)
+

Level 1

+
+

1pt

+
+

Level 2

+
+

2pts

+
+

Level 3

+
+

3pts

+
+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_s.html b/main/manual/alien_evolutions_s.html new file mode 100644 index 00000000..69ab4984 --- /dev/null +++ b/main/manual/alien_evolutions_s.html @@ -0,0 +1,178 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions: + Sensory
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + +
+

Evolutionary advances to the skin are common + among Earth creatures – but trust the Kharaa to + take them to an entirely new dimension. These + upgrades improve the alien's connection to the + bacterium, allowing it to receive new information, + which is put to various impressive uses.

+
+ + + + + + + +
+ + + + + + +
+

Cloaking
+
+

+
+ + + +
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_scentoffear.html b/main/manual/alien_evolutions_scentoffear.html new file mode 100644 index 00000000..ca2eb08c --- /dev/null +++ b/main/manual/alien_evolutions_scentoffear.html @@ -0,0 +1,220 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions + :: Sensory: + Scent Of Fear
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: injured marines can be found + anywhere, as if they had been parasited.

+
+
+ + + + + +
+

Observation: "You wouldn't know it + to look at us, but after the archive collapse + we were hurting, especially Nem. We just needed + to get back to the elevator and wait for some + resources to trickle in, but they kept the pressure + on, every step of the way. We put Nem in the middle, + they attacked the middle; we put him in back, + they attacked the back. It only took a few spikes + to finish him off: a Lerk shattered a window and + nailed him before we could cover. Hit-and-run + bastards. Then they started stalkin' Hanover. + I'm telling you: they knew who was hurtin', and + they were picking us off, one at a time."

+

Thesis: the most efficient ambush targets + the weakest prey. Or: the best way to attack many + foes is to reduce their number as quickly as possible. + Injured humans release microscopic triggers when + injured or harmed – these aliens must be alert + to these emissions, evolving skin receptors that + can "taste" the air and pinpoint injured + foes. TSA armor should suppress tell-tales like + these – the aliens must be amazingly sensitive. + Or perhaps the ever-present bacterial network + is responsible. This evolution is probably susceptible + to all kinds of tricks, or evasions – but our + experiments with "scent bombs" proved + disastrous. As is the case with all aspects of + the Kharaa, we need more data … but what + is an acceptable number of deaths for each bit + of information? For now, we must be satisfied + with observation, and observation only.
+

+ + + + + + + + + + + + + + + + +
    Scent + of Fear
+

Level 1

+
+

Able to pinpoint injured + marines within 17m

+
+

Level 2

+
+

Able to pinpoint injured + marines within 34m

+
+

Level 3

+
+

Able to pinpoint injured + marines within 51m

+
+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_evolutions_silence.html b/main/manual/alien_evolutions_silence.html new file mode 100644 index 00000000..a11dbe41 --- /dev/null +++ b/main/manual/alien_evolutions_silence.html @@ -0,0 +1,205 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Evolutions + :: Movement: + Silence
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: alien movement and attacks make + no noise.

+
+
+ + + + + +
+

Observation: "You almost never see + this in combat, and thank Jeezus for that. You'll + be standing with your squad, watching all the + entry points, when someone'll get hit. And you + won't know from where. Then someone else will + get hit, so you'll all dive for cover. You'll + be sitting there in dead silence, listening to + each other's breathin', when you see the bugger + glide down behind your squadmate, quiet as a hologram. + Before you can yell out, it's slammed him against + the wall and ripped him up."

+

Thesis: an alien that can hunt and attack + without being noticed is deadlier, and requires + less energy. This is the "stealth" model + – probably requires shock-absorbent cartilage + between all joints, lubricating fluids in weaponry, + and a corresponding change in behavior. Humans + can be very quiet if they move correctly – these + aliens suddenly learn similar techniques.
+

+ + + + + + + + + + + + + + + + +
    Silence + (% noise of movement and attacks)
+

Level 1

+
+

66%

+
+

Level 2

+
+

33%

+
+

Level 3

+
+

0%

+
+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_fade.html b/main/manual/alien_fade.html new file mode 100644 index 00000000..ba18d169 --- /dev/null +++ b/main/manual/alien_fade.html @@ -0,0 +1,227 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species: + Fade
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + +
+

Summary: These are the shock troops of + the Kharaa: versatile, tough, and highly specialized + to combat. Disturbingly humanoid, Fades mix excellent + ranged attacks with powerful melee damage – + which when combined with the seemingly supernatural + blink ability, + make them powerful all-around brutes, whose cunning + cannot be underestimated.        [Name]

+
+

+ Health: 200               + Armor: 90 + pts. armor (30% damage absorbed)

+
+

Abilities: + = zero hives =one + hive =two + hives =three + hives =damage + vs. structures

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Swipe

+
+

80

+
+

Acid Rocket

+
+

50, lesser splash damage

+
+

Blink

+
+

"teleportation"

+
+

Bilebomb

+
+

80/160(), + radius 500

+
+


+ Observation:
+ "If + you want to know what it's like inside a + bilebomb, here it is:"

+
+
+


+
+
+
+
+
+

+
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_fade_hive.html b/main/manual/alien_fade_hive.html new file mode 100644 index 00000000..be435572 --- /dev/null +++ b/main/manual/alien_fade_hive.html @@ -0,0 +1,221 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Fade: Hive-Learned + Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: These are the shock troops of + the Kharaa: versatile, tough, and highly specialized + to combat. Disturbingly humanoid, Fades mix excellent + ranged attacks with powerful melee damage – + which when combined with the seemingly supernatural + blink ability, + make them powerful all-around brutes, whose cunning + cannot be underestimated.        [Name]

+
+
+ + + + + + + + + +
+

+ Fade

+
+ + + + +
+

Two/Three Hive Abilities
+

+ Two Hives: Blink
+
+ The so called "blink" ability + is one of the more contentious topics for + scientists studying the Kharaa. One side + believes that it is our observations that + are incorrect, that there is an optical + illusion of some sort at work, making Fades + appear to teleport, apparently through solid + matter. They believe that, at the most, + entirely new bodies are created at the destination + – a kind of variant of the redemption + evolution. The other side believes that + there is a phenomena similar to Frontiersmen + phase + gate technology at work … some + organic, highly evolved ability that exploits + the loophole in physics called the Kensky/Libovah + effect. There are significant weak points + in both arguments. But this phenomena undoubtedly + exists: footage exists of Fades disappearing + from one side of a wall, and appearing on + the other, or instantly covering the space + between them and their target.

+


+ Three Hives: Bile + Bomb
+
+ As if its other abilities weren't enough, + with three hives the Fade becomes a mobile + mortar, launching packets of super-virulent + dissembling bacteria from its shoulder gun, + that explode with concussive force upon + impact and spread in a voracious ring. This + attack is especially effective at softening, + even obliterating, heavy defenses – + and its curved, or arcing flight allows + the Fade to destroy structures + from a safe location.

+
+
+


+
+
+
+
+
+
+

+
+
 
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_fade_inherent.html b/main/manual/alien_fade_inherent.html new file mode 100644 index 00000000..9d40d7f7 --- /dev/null +++ b/main/manual/alien_fade_inherent.html @@ -0,0 +1,204 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Fade: Inherent + Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: These are the shock troops of + the Kharaa: versatile, tough, and highly specialized + to combat. Disturbingly humanoid, Fades mix excellent + ranged attacks with powerful melee damage – which + when combined with the seemingly supernatural + blink ability, + make them powerful all-around brutes, whose cunning + cannot be underestimated.

+
+
+ + + + + + + + + +
+

+ Fade

+
+ + + + +
+

Zero Hive (inherent) Abilities
+ Strong, + Swipe

+

Strong: Though not an "ability" + like wall + crawling or flight, + the Fade has more health and armor than + any species short of the Onos. + Its primary attacks are also more powerful + than those of the Lerk, + Gorge or + Skulk. Heavy + weaponry, or heavy backup, are recommended + before engaging.

+

Swipe: a similar evolution to the + Skulk's bladed + feet, the Fade's arms end in long, deadly + sharp blades. TSA scientists speculate that, + left to their own devices, Fades might have + eventually evolved some sort of opposable + thumbs. Instead, the bacterium pushed them + to develop these sword-like claws, that + their ape-like arms swing in armor and metal + shredding arcs.

+
+
+


+
+
+
+
+
+
+

+
+
 
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_fade_name.html b/main/manual/alien_fade_name.html new file mode 100644 index 00000000..749a0ff5 --- /dev/null +++ b/main/manual/alien_fade_name.html @@ -0,0 +1,195 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Fade: Name
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: These are the shock troops of + the Kharaa: versatile, tough, and highly specialized + to combat. Disturbingly humanoid, Fades mix excellent + ranged attacks with powerful melee damage – + which when combined with the seemingly supernatural + blink ability, + make them powerful all-around brutes, whose cunning + cannot be underestimated.        [Name]

+
+
+

+ +
+
+
+ + + + + + + + +
+

+ Fade

+
+ + + + +
+

The Kharaa are so sneaky, it took some + time for Frontiersmen to realize the blink + ability existed at all. Fades seemed to + appear and disappear with no rhyme or reason, + penetrating seemingly air-tight defensive + perimeters, or vanishing from a heavy fire + fight without a trace. Marines soon reported + these creatures "fading" away + right before their eyes. Though we now understand + there is a hive ability responsible for + this phenomena, we are no closer to truly + understanding how it functions.

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_fade_observation.html b/main/manual/alien_fade_observation.html new file mode 100644 index 00000000..7af8576a --- /dev/null +++ b/main/manual/alien_fade_observation.html @@ -0,0 +1,246 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Fade: Observation
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: These are the shock troops of + the Kharaa: versatile, tough, and highly specialized + to combat. Disturbingly humanoid, Fades mix excellent + ranged attacks with powerful melee damage – + which when combined with the seemingly supernatural + blink ability, + make them powerful all-around brutes, whose cunning + cannot be underestimated.        [Name]

+
+
+ + + + + + + + + +
+

+ Fade

+
+ + + + +
+

"If you want to know what it's + like inside a bilebomb, here it is: the + thump of its decompression feels like a + kick to your guts, right to your bones and + innards, and the clumps of stuff that settle + over you just look evil, like they were + made to kill you … which is pretty + much true. Other details would include the + warning whine of my heavy armor's gauge + as it dived from two hundred towards one, + and the leg of the forward turret crumpling + so it toppled onto its side, still twitching + as it pathetically tried to acquire a target. + The other turret whined uselessly on its + perch behind me, atop the turret factory.
+
+ I got my feet under me and stood up, pointing + my shotgun at the top of the ladder, inching + forward for a shot down into the vault. + The theory was that anything that wanted + me was going to have to get past the turrets + and come up the ladder, where my shotgun + would either end it fast, or knock them + back down. No one seemed to plan on the + Kharaa getting three hives up, and a brute + of a Fade deciding to lob its little death + cocktails up at me. The vault had only one + entrance, making it a good place to defend, + but a bad place to be trapped. My perch + was on a shelf along the back of the room + that had had some furniture and a couple + of terminals. We cleared them away and set + up a small base.
+
+ The Mercantile League took its valuables + seriously. The vault was filled with smooth + self-pressurized containers, each a safe + in its own right. The gridlock had scrambled + a few, popping them open, but most were + intact, looking like oversized coffins against + the cream-colored floor below. There was + no sign of the Fade. Then a whisper of light + and movement behind me, and the Fade was + right there. Even in my heavy armor it towered + over me. It slashed with one arm – + a clang, and the last turret's feet tore + free. The second blade followed a split + second later, ripping it down and smashing + it into the wall.
+
+ I hit it from ten feet away with my shotgun + – I know I hurt it, bits of its wiry + skin blew back away from it like dust. It + whipped around to face me and the organic + gun on its right shoulder unpuckered its + lips. I jumped. I could hear acid rockets + firing overhead. My armor took more damage + from the twenty foot drop, but I figured + it was the better alternative. I stayed + crouched, pointing my shotgun at the top + of the ladder.
+
+ I heard the base being destroyed. The dish + from our observatory rolled off the edge + and cracked on the ground like a dinner + plate, not ten feet from me. So much for + our second base. I got the hell out of there + while I could."

+
+
+


+
+
+
+
+
+

+
+
 
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_fade_primary.html b/main/manual/alien_fade_primary.html new file mode 100644 index 00000000..66068413 --- /dev/null +++ b/main/manual/alien_fade_primary.html @@ -0,0 +1,177 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Fade: Primary + Attacks
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + +
+ + + + +
+

Summary: These are the shock troops of + the Kharaa: versatile, tough, and highly specialized + to combat. Disturbingly humanoid, Fades mix excellent + ranged attacks with powerful melee damage – + which when combined with the seemingly supernatural + blink ability, + make them powerful all-around brutes, whose cunning + cannot be underestimated.        [Name]

+
+
+ + + + + + + + + +
+

+ Fade

+
+ + + + +
+

One Hive (primary) Abilities
+ Acid Rocket

+

speculation is that the gun-like growths + on Fade's shoulders are actually symbiotic + organisms, that the Fades joined forces + with long ago. These growths distill stomach + acid into a more powerful form, which is + launched in loose spheres that splash open + on impact. The damage and splash of this + attack make it a highly feared and very + dangerous weapon.

+
+
+


+
+
+
+
+
+
+

+
+
+
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_gorge.html b/main/manual/alien_gorge.html new file mode 100644 index 00000000..63ca75cc --- /dev/null +++ b/main/manual/alien_gorge.html @@ -0,0 +1,267 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species: + Gorge
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + +
+

Summary: Belligerent and obese, Gorges + serve as a kind of mobile hive and support unit. + Their most important role is triggering new + hives and creating chambers + from lumps of raw matter
+ they … un-digest. Without them the aliens + cannot keep pace with marine + research and upgrades. + To this end, they receive resources much faster + than other species, and can tap a larger amount. + They can also spray healing + bacteria from their mouths, restoring chambers + and other aliens to full effectiveness. Though + their role is not as aggressive as the other species, + they consistently find ways to cause mischief + and support attacks on enemy positions. And with + their spit, + web and babbler + abilities, underestimating them in combat is a + dangerous mistake.        [Name]

+
+

+ Health: 100               + Armor: 50 + pts. armor (30% damage absorbed)

+
+

Abilities: + = zero hives =one + hive =two + hives =three + hives =damage + vs. structures

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+
+

Spit

+
+

22, low rate of fire

+
+

Build

+
+

can create chambers

+
+

New + Hive

+
+

can initiate new hives

+
+

Healing + Spray

+
+

can heal chambers and aliens

+
+

Web

+
+

immobilizes

+
+

Babblers

+
+

creates pseudo-skulks

+
+


+ Observation:
+ "[Deej: + Andre, crawl over here. Stay down!]"

+
+
+


+
+
+
+
+
+
+

+

+
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_gorge_hive.html b/main/manual/alien_gorge_hive.html new file mode 100644 index 00000000..3a0e1a8c --- /dev/null +++ b/main/manual/alien_gorge_hive.html @@ -0,0 +1,222 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Gorge: Hive-Learned + Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Belligerent and obese, Gorges + serve as a kind of mobile hive and support unit. + Their most important role is triggering new + hives and creating chambers + from lumps of raw matter
+ they … un-digest. Without them the aliens + cannot keep pace with marine + research and upgrades. + To this end, they receive resources much faster + than other species, and can tap a larger amount. + They can also spray healing + bacteria from their mouths, restoring chambers + and other aliens to full effectiveness. Though + their role is not as aggressive as the other species, + they consistently find ways to cause mischief + and support attacks on enemy positions. And with + their spit, + web and babbler + abilities, underestimating them in combat is a + dangerous mistake.        [Name]

+
+
+

+
+
+
+
+ + + + + + + + +
+

+ Gorge

+
+ + + + +
+

Two/Three Hive Abilities
+
+ Two Hives: Webs

+

Gorges often protect sensitive areas with + sticky strands of a fibrous, mucous-like + substance. When tripped, a web strand immediately + unanchors from both ends, and contracts + around its victim. After a few moments of + struggle a marine can break free – + but until he does he will be moving much + slower, and won't be able to use his + weapons, jump, or use jet packs. Webs + are highly susceptible to heat: welders + can burn them away without activating them. + Multiple webs have cumulative effects.

+

Three Hives: Babblers
+
+ with this most advanced ability, the Gorge + becomes a kind of hive itself. It can spontaneously + create primitive, fully autonomous Skulks, + that attack any enemies nearby. These Skulks + are not as powerful or clever as hive spawned + ones, and are also unstable. If not destroyed + in combat, they self-destruct after 15 seconds, + doing damage to any enemies nearby (a lesser + version of xenocide).

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_gorge_inherent.html b/main/manual/alien_gorge_inherent.html new file mode 100644 index 00000000..8539080e --- /dev/null +++ b/main/manual/alien_gorge_inherent.html @@ -0,0 +1,232 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Gorge: Inherent + Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Belligerent and obese, Gorges + serve as a kind of mobile hive and support unit. + Their most important role is triggering new + hives and creating chambers + from lumps of raw matter
+ they … un-digest. Without them the aliens + cannot keep pace with marine + research and upgrades. + To this end, they receive resources much faster + than other species, and can tap a larger amount. + They can also spray healing + bacteria from their mouths, restoring chambers + and other aliens to full effectiveness. Though + their role is not as aggressive as the other species, + they consistently find ways to cause mischief + and support attacks on enemy positions. And with + their spit, + web and babbler + abilities, underestimating them in combat is a + dangerous mistake.        [Name]

+
+
+

+ +
+
+
+
+ + + + + + + + +
+

+ Gorge

+
+ + + + +
+

Zero Hive (inherent) Abilities
+ Spit, Building, + New Hive

+

Spit: corrosive wads of pulpy matter, + hucked impressive distances by their powerful + stomach muscles. Not the most powerful alien + weapon, but powerful enough to kill.

+

Building: the Gorge is the only + Kharaa that can create alien chambers. + This gives them a primary role in triggering + alien evolutions. + These growths can also serve defensive, + offensive, and sensory purposes. See the + chambers + section for more detail. Gorges seem to + need to accrue resource "points" + much as a commander + does, to build new chambers.

+

New Hive: As the bacterium + spreads, it identifies potential hive + locations – these are usually the dampest + or warmest areas, though sometimes a location + is chosen for other instinctual reasons + not yet apparent to us. A visible bacterial + mat will spread throughout these areas, + in preparation for future growth. A Gorge + can trigger the growth of a second, then + third hive (we have never observed more + than three – perhaps the ship or base + environments are not large or resource rich + enough to support them). Activating a new + hive is a significant expenditure of resources, + and the principle motivation of the Kharaa + to create and defend resource + chambers.

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_gorge_name.html b/main/manual/alien_gorge_name.html new file mode 100644 index 00000000..c4bde53a --- /dev/null +++ b/main/manual/alien_gorge_name.html @@ -0,0 +1,206 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Gorge: Name
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Belligerent and obese, Gorges + serve as a kind of mobile hive and support unit. + Their most important role is triggering new + hives and creating chambers + from lumps of raw matter
+ they … un-digest. Without them the aliens + cannot keep pace with marine + research and upgrades. + To this end, they receive resources much faster + than other species, and can tap a larger amount. + They can also spray healing + bacteria from their mouths, restoring chambers + and other aliens to full effectiveness. Though + their role is not as aggressive as the other species, + they consistently find ways to cause mischief + and support attacks on enemy positions. And with + their spit, + web and babbler + abilities, underestimating them in combat is a + dangerous mistake.        [Name]

+
+
+

+
+
+
+
+
+ + + + + + + + +
+

+ Gorge

+
+ + + + +
+

Though we now know that the Gorge consumes + more resources than any other species, the + name has less to do with their consumption, + and more with their portly body type, and + that they always seem to be slurping away + at a chamber, + spitting + a wad of acid, or just in general doing + things with their mouths that are disturbing + to watch.

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_gorge_observation.html b/main/manual/alien_gorge_observation.html new file mode 100644 index 00000000..a7864dc6 --- /dev/null +++ b/main/manual/alien_gorge_observation.html @@ -0,0 +1,294 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Gorge: Observation
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Belligerent and obese, Gorges + serve as a kind of mobile hive and support unit. + Their most important role is triggering new + hives and creating chambers + from lumps of raw matter
+ they … un-digest. Without them the aliens + cannot keep pace with marine + research and upgrades. + To this end, they receive resources much faster + than other species, and can tap a larger amount. + They can also spray healing + bacteria from their mouths, restoring chambers + and other aliens to full effectiveness. Though + their role is not as aggressive as the other species, + they consistently find ways to cause mischief + and support attacks on enemy positions. And with + their spit, + web and babbler + abilities, underestimating them in combat is a + dangerous mistake.        [Name]

+
+
+

+
+
+
+
+ + + + + + + + +
+

+ Gorge

+
+ + + + +
+

"[Deej: Andre, crawl over here. + Stay down!]
+
+ [Andre: on my way.]
+
+ I dropped down between the stainless steel + laboratory tables, and ran, hunched over, + to Deej's forward position. At the doorway + to the room he was in I paused, and slowly + poked my head around. It was the observation + area for the testing room beyond – + designed to protect the viewers from whatever + dangerous (and probably illegal) experiments + the Mercantile League was conducting. The + viewing window ran the entire length of + the wall. The airlock into the test room + was not registering on my HUD – it + must have gone into lock-down mode after + the gridlock kicked in.
+
+ Deej was crouched beneath the window, motioning + me over. I got onto my stomach and scooted + across the floor. When I got alongside, + he pointed at his eye, then at the window. + I nodded, and slowly lifted my head to get + a view.
+
+ The experiment room had a resource node + in it. A Gorge was building on top of it + – or more accurately, was ejecting + from its mouth a thick mass of purplish-orange + organic goop, that its mucous-dripping oral + organ was working feverishly to shape, mold, + and coat with enzymes.
+
+ [Deej: Can we please please kill that thing?] +
+
+ I smirked at the text on my HUD, and pulled + my HMG off my back. He gripped his shotgun. + We both stood up. The Gorge was facing sideways, + too occupied to notice us. I glanced at + Deej, he nodded, and we both opened fire. +
+
+ The glass buckled into a mass of pockmarks + and fissures, but amazingly, held. Deej + cursed and shouldered his shotgun, pulling + a trip mine from his belt. I shoved the + barrel of my heavy into a pock mark and + the tip just poked through. I held the stock + up above my head to angle it down into the + room, and let loose another half a clip + as the Gorge ran for the back airlock to + the experiment room. This one was working + – it began to cycle open. Deej slapped + the trip mine onto the bottom sill of the + window so only two of its legs were gripping. + "Back off!" he yelled, and we + ran back into the lab room. Mines self-detonate + if placed "incorrectly". It beeped + a few times in warning. We expected shards + to come with the explosion – but there + was only the mine's concussion, and then + a ripping sound.
+
+ We ran back to find the window peeled up + from the sill into a strange curved white + form, like a frozen curtain. The back door + had cycled open, the Gorge must have just + gone through. I covered Deej as he slipped + through the gap, then pushed my heavy through + and followed. The HMG is a bitch to run + with – I shouted for Deej to hold up, + but he was already through the lock, shoving + another shell into his gun as he ran. As + I was approaching the corridor beyond, I + heard a "schlitch" – the + telltale sound of a web constricting – + and the rapid wet sound of alien weapons. + I came around the corner to find Deej covered + in glistening strands, frantically shuffling + backwards as three offensive chambers and + the Gorge nailed him over and over. From + behind I heard the glug-glug of at least + one defensive chamber healing everything + nearby. I stood in front of Deej and unloaded + onto everything in sight. The Gorge dropped + behind the chambers, I took a few hits, + and Deej and I fell back around the corner. + His armor was around as thin as cardboard, + and he wasn't doing much better. Meanwhile + I heard more movement. Great, reinforcements. + We'd never take them with the mini-base + they had going. I shoved him back through + the airlock and sent a command-request for + medkits, while the doors began to close. + I took out my frustrations on the resource + chamber."

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_gorge_primary.html b/main/manual/alien_gorge_primary.html new file mode 100644 index 00000000..719d0323 --- /dev/null +++ b/main/manual/alien_gorge_primary.html @@ -0,0 +1,212 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Gorge: Primary + Attacks
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Belligerent and obese, Gorges + serve as a kind of mobile hive and support unit. + Their most important role is triggering new + hives and creating chambers + from lumps of raw matter
+ they … un-digest. Without them the aliens + cannot keep pace with marine + research and upgrades. + To this end, they receive resources much faster + than other species, and can tap a larger amount. + They can also spray healing + bacteria from their mouths, restoring chambers + and other aliens to full effectiveness. Though + their role is not as aggressive as the other species, + they consistently find ways to cause mischief + and support attacks on enemy positions. And with + their spit, + web and babbler + abilities, underestimating them in combat is a + dangerous mistake.        [Name]

+
+
+

+ + + + + + + + + +
+

+ Gorge

+
+ + + + +
+

One Hive (primary) Abilities
+ Healing Spray
+
+
The Kharaa equivalent of medical + nanites, this appears to be a stream of + the same bacteria used when building. + In fact, this spray can heal chambers. + When directed at a fellow alien, it also + rebuilds that alien much like the regeneration + evolution. Gorges often hide around the + corner during a conflict, constantly healing + fellow Kharaa, allowing them to sustain + massive amounts of damage (this makes + Gorges primary targets for marines in + any sustained firefight). This spray causes + some damage to marines, though marine + structures + are immune.

+
+
+


+
+
+
+
+
+
+

+
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_gridlock.html b/main/manual/alien_gridlock.html new file mode 100644 index 00000000..bd065396 --- /dev/null +++ b/main/manual/alien_gridlock.html @@ -0,0 +1,194 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: The + Bacterium: Bacterial Gridlock
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: the bacteria and nanotech attack + each other, constantly struggling for control + and interfering with each other's functions.

+
+
+ + + + + +
+

+ While no ship or base would expect to be infiltrated + by a hostile microscopic xenoform, in the age + of nanotech + people are very paranoid about dangerous microscopic + threats – biological or mechanical dangers designed + by enemies, or their own technology, run amok. + The bacteria slips under this screen at first + because it is utterly unlike any human organic + compound – but once it reaches high enough concentration + alarms are triggered and anti-contamination countermeasures + kick in. The countermeasures attempt to contain + and sterilize the bacteria, and the bacteria responds + by trying to corrode and destroy all nanotech.

+

By the time marines arrive, this battle is well + underway, with both sides gridlocked, interfering + with each other. See nano-gridlock + to learn how this effects marine functions.

+

The most important consequence of this gridlock + is it prevents the bacteria from attempting to + infect or attack humans. It is our belief that + it views us (humans) as existing for the same + reason its own species + do – host lifeforms created by a different + bacterial lifeform to fight for control of an + area's resources. + If it can't win the microscopic battle, it starves + the competitor to death, and outgrows it by destroying + its hosts - stopping the competition from reproducing + or controlling resources. This implies a past + filled with conflict, and explains why it is so + ready, and able, to deal with humans in an aggressive + and deadly fashion.

+

There are more practical effects of the gridlock. + It also prevents the bacteria from instantly sensing + and transmitting the location of every marine + and marine structure onto Kharaa hive + sight. Unless a Kharaa can see you, or you've + been parasited, + they should not know where you are.

+
+ + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_healing.html b/main/manual/alien_healing.html new file mode 100644 index 00000000..7e9680a9 --- /dev/null +++ b/main/manual/alien_healing.html @@ -0,0 +1,155 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: The + Hive: Healing
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + +
+

+ Hives pump out a steady stream of healing bacteria + (see healing + spray, regeneration + and defensive + chambers for corollaries). Nearby aliens can + rapidly heal damage, and return to the fray. There + is speculation that this process long ago replaced + the Kharaa's natural need for food. It is not + surprising they defend their hives so desperately. +

+
+ + + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_hive.html b/main/manual/alien_hive.html new file mode 100644 index 00000000..db6b3cfc --- /dev/null +++ b/main/manual/alien_hive.html @@ -0,0 +1,190 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data: The Hive
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + +
+

+ Nano-gridlock, + and the presence of larger lifeforms (humans) + seem to trigger the next stage of alien growth: + the Hive. There does not seem to be any malice + involved – the bacteria just reacts naturally + and aggressively to any competition. The hive + contains all the information and abilities necessary + to set off a cascade of events that rapidly leads + to full scale conflict.

+

Hives are large organic structures, that affix + to the walls and ceiling in locations selected + by the bacterium + (potential hive locations are usually marked by + mats of visible bacteria, sometimes completely + covering every surface and even stretching out + across nearby rooms and corridors). Once the first + is active, the Kharaa can grow new + hives. After observing images brought back + from the field, TSA scientists speculate that + hives are actually creatures that have been evolved + into this form over an incredibly long time, to + serve the bacteria's ends.

+

Though not actually "hives" in the + technical sense of the word, they do serve vital + roles to the creatures they spawn, and these creatures + cannot exist without them. Hives serve four crucial + functions:

+
+ + + + + + + + +
+

+ spawning the five + species of Kharaa (and reinforcing after death)
+ + advancing the abilities + of Kharaa
+ + healing (feeding) + Kharaa
+ + linking Kharaa + into the hivesight

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_hivesight.html b/main/manual/alien_hivesight.html new file mode 100644 index 00000000..0b7ef44e --- /dev/null +++ b/main/manual/alien_hivesight.html @@ -0,0 +1,185 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: The + Hive: Hive Sight
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: alien species share information + with one another – pinpointing the location of + enemies and each other, and also receiving alerts + directly from the bacterium.

+
+
+ + + + +
+

+ It is clear that the Kharaa are linked to one + another. When a hive is attacked, nearby aliens + rush to the defense. When one alien engages marines, + others often choose to assist. And yet, the Kharaa + do not act as one – they are fiercely individual. + This, and other evidence, has lead Frontiersmen + scientists to speculate that instead of a "hive + mind", the aliens have "hive sight". +
+
+ There is documentary evidence that the aliens + seem to be responding to visual cues instead of + some kind of telepathy. For instance, when an + enemy is on the other side of a wall, they swivel + their heads as if they can see them. When a hive + is attacked, they look around wildly until they + find the direction of the threatened area, then + run in that direction. Speculation is that the + aliens have a kind of interface with the bacterium, + that uses their senses to convey information. + Probably through audible cues, and their own organic + version of a HUD + (Heads Up Display).
+
+ If all hives are destroyed, hive sight will slowly + fade away over a period of around twenty hours + - not quickly enough to impact battles with Frontiersmen, + which are usually resolved much faster than that. +

+
+ + + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_lerk.html b/main/manual/alien_lerk.html new file mode 100644 index 00000000..0eddd27d --- /dev/null +++ b/main/manual/alien_lerk.html @@ -0,0 +1,241 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species: + Lerk
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + +
+

Summary: Wiry fast and fierce, Lerks excel + at attacking from a distance, but also have a + vicious bite. They are small and light - making + them difficult targets, but less resistant to + damage. If Skulks are hit and run artists, then + Lerks are guerrilla fighters without peer, using + their speed, mobility, and range to harass marine + squads with impunity.        [Name]

+
+

+ Health: 60               + Armor: 50 + pts. armor (30% damage absorbed)

+
+

Abilities: + = zero hives =one + hive =two + hives =three + hives =damage + vs. structures

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Flight

+
+

costs energy

+
+

Bite

+
+

50

+
+

Spikes

+
+

16

+
+

Umbra

+
+

defensive cloud

+
+

Spore + Cloud

+
+

36, radius 250

+
+


+ Observation:
+ "We're + hacking through dead wiring like we're on + a freakin' safari …"

+
+
+


+
+
+
+
+
+
+

+

+
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_lerk_hive.html b/main/manual/alien_lerk_hive.html new file mode 100644 index 00000000..90952617 --- /dev/null +++ b/main/manual/alien_lerk_hive.html @@ -0,0 +1,235 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Lerk: Hive-Learned + Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Wiry fast and fierce, Lerks excel + at attacking from a distance, but also have a + vicious bite. They are small and light - making + them difficult targets, but less resistant to + damage. If Skulks are hit and run artists, then + Lerks are guerrilla fighters without peer, using + their speed, mobility, and range to harass marine + squads with impunity.        [Name]

+
+
+

+ +
+ + + + + + + + +
+

+ Lerk

+
+ + + + +
+

Two/Three Hive Abilities
+
+ Two Hives: Umbra
+
+ A variation on the sporecloud, this remarkable + ability is used for defense, not attack. + The umbra is an orange cloud that lasts + for ten seconds, and protects all friendly + creatures and chambers inside it. The particles + in the cloud seem to have disruptive kinetic + properties. Incoming bullets and shrapnel + are robbed of momentum, and are likely to + bounce harmlessly off their target. A small + percentage of projectiles in any given attack + will slip through unaffected. Knives + and grenades + are also not affected: the mass of the marine + is behind a knife slash, and a grenade's + blast particles are so small and fast they + slip through. However, LMG's, + shotguns, + HMG's and + pistols + all do a fraction of their normal damage. + Alien weapons, puzzlingly enough, can pass + out of the cloud normally. Besides personal + defense, Lerks often use umbra to protect + chambers, + hives and + other aliens during coordinated actions.

+

We would very much like to learn the composition + of this cloud – various experiments + have been proposed by TSA scientific personnel, + all quickly rejected by field commanders.
+

+

Three Hives: Sporecloud
+
+ This insidious attack appears to come from + nowhere, filling a volume of around 12 cubit + feet with a corrosive cloud of spores. These + spores appear to rot any foreign organic + matter – thankfully, marine structures + and turrets are unaffected.

+

Our best theory is that the Lerk fills + its lung guns and fires a burst of transparent, + utterly silent, bullet-shaped bubbles that + impact the target area and react violently + with the air. Lerks can fill a large area + with these attacks, often while remaining + hidden on some shadowed perch, or dodging + wildly through the air. None but the heaviest + armored marines can afford to stand within + a sporecloud for more than a few seconds.

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_lerk_inherent.html b/main/manual/alien_lerk_inherent.html new file mode 100644 index 00000000..cd00bc5f --- /dev/null +++ b/main/manual/alien_lerk_inherent.html @@ -0,0 +1,200 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Lerk: Inherent + Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Wiry fast and fierce, Lerks excel + at attacking from a distance, but also have a + vicious bite. They are small and light - making + them difficult targets, but less resistant to + damage. If Skulks are hit and run artists, then + Lerks are guerrilla fighters without peer, using + their speed, mobility, and range to harass marine + squads with impunity.        [Name]

+
+
+

+ +
+ + + + + + + + +
+

+ Lerk

+
+ + + + +
+

Zero Hive (inherent) Abilities
+ Flight, + Bite

+

Flight: Wings have evolved around + forty different times on Earth, so it would + be surprising if the Kharaa had not evolved + them as well. The Lerk can lift and propel + itself suddenly and rapidly, but seems to + tire quickly so often glides instead, or + saves flight for combat situations.

+

Bite: Where Skulks uses their jaw + muscles, the Lerk relies on its powerful + neck to thrust its razor teeth into its + target. This was probably evolved to consume + food in a vulture-like fashion, and to deliver + death blows when falling on prey from above. + It punctures TSA nano-plate with disturbing + ease.

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_lerk_name.html b/main/manual/alien_lerk_name.html new file mode 100644 index 00000000..32f53c44 --- /dev/null +++ b/main/manual/alien_lerk_name.html @@ -0,0 +1,196 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Lerk: Name
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Wiry fast and fierce, Lerks excel + at attacking from a distance, but also have a + vicious bite. They are small and light - making + them difficult targets, but less resistant to + damage. If Skulks are hit and run artists, then + Lerks are guerrilla fighters without peer, using + their speed, mobility, and range to harass marine + squads with impunity.        [Name]

+
+
+

+ +
+
+
+ + + + + + + + +
+

+ Lerk

+
+ + + + +
+

Lerks' relatively low health means that + they avoid making a target of themselves, + often hiding in a niche somewhere and attacking + marine bases with their spikes + or sporeclouds. + They often wait, lurking on some shadowed + perch, until a target presents itself. The + strange spelling of their name can be attributed + to the unique and colorful vocabulary of + one Commander Ty Sumnish, who brought back + from the field a treasure trove of data + on the Lerk very early on in the Kharaa/human + conflict.

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_lerk_observation.html b/main/manual/alien_lerk_observation.html new file mode 100644 index 00000000..9d65b377 --- /dev/null +++ b/main/manual/alien_lerk_observation.html @@ -0,0 +1,220 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Lerk: Observation
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Wiry fast and fierce, Lerks excel + at attacking from a distance, but also have a + vicious bite. They are small and light - making + them difficult targets, but less resistant to + damage. If Skulks are hit and run artists, then + Lerks are guerrilla fighters without peer, using + their speed, mobility, and range to harass marine + squads with impunity.        [Name]

+
+
+

+ +
+ + + + + + + + +
+

+ Lerk

+
+ + + + +
+

"We're hacking through dead wiring + like we're on a freakin' safari, trying + to get at a node that's supposedly on the + other side. After half an hour taking turns + with our knives we break through into the + Archive, crystal memory stacks big as redwoods, + silent and dark, waiting for the Mercantile + League to return and continue filling them + with delinquent loans, pending legal suits, + and every pack of peanuts they've shipped + across all creation.
+
+ We're standing there, wondering if we shouldn't + accidentally discharge a few clips, when + a spore cloud fills up the tunnel behind + us, and spikes start hailing from the shadowy + catwalks high above. We try to find cover, + but there isn't any – we consider climbing + the ladders up, but being stuck on a ladder + with a Lerk around is suicide. Instead we + start unloading our lmg's into the air, + hitting metal and memory stack more than + anything, flakes of falling crystal glittering + in the flash of our muzzles. The spikes + become more sporadic. Deej takes out his + welder and starts cutting into a maintenance + crawlspace; a sporecloud bursts around him + and he leaps back, cursing. Another cloud + sends Nem and Lestah diving from the far + wall. So I say 'f-this', and switch my pistol + for my grenade launcher. Someone says, 'what + are you-' then poom poom poom, I launch + three way up into the darkness. My squadmates + stare at me like I'm insane. 'What,' I say, + 'you want to die slowly?' One grenade clatters + onto a catwalk, the other two just hang + in the air, and then the whole place comes + down around our ears."

+
+
+


+
+
+
+
+
+
+

+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_lerk_primary.html b/main/manual/alien_lerk_primary.html new file mode 100644 index 00000000..5917a86b --- /dev/null +++ b/main/manual/alien_lerk_primary.html @@ -0,0 +1,201 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Lerk: Primary + Attacks
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: Wiry fast and fierce, Lerks excel + at attacking from a distance, but also have a + vicious bite. They are small and light - making + them difficult targets, but less resistant to + damage. If Skulks are hit and run artists, then + Lerks are guerrilla fighters without peer, using + their speed, mobility, and range to harass marine + squads with impunity.        [Name]

+
+
+

+ +
+ + + + + + + + +
+

+ Lerk

+
+ + + + +
+

One Hive (primary) Abilities
+ Spikes

+

The spike attack is easily the equivalent + of a conventional firearm. It allows the + Lerk to attack from a distance, and is quiet + and fast enough that it can take a moment + to pin down where the attack is coming from. + From our data, exo-biologists believe the + Lerk has evolved separate lung tubes with + thousands of tiny air sacs at their ends. + Lengths of expendable, rapidly regenerating + cartilage growing backwards off its jaw + are parsed into pointed spikes around the + size of a fist by two sets of reversed teeth. + These spikes drop into the lung tubes, which + seal and then expel them. By alternating + tubes, the Lerk can launch these spikes + at machine gun speed.

+
+
+


+
+
+
+
+
+
+

+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_newhives.html b/main/manual/alien_newhives.html new file mode 100644 index 00000000..a3e6987c --- /dev/null +++ b/main/manual/alien_newhives.html @@ -0,0 +1,160 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: The + Hive: New Hives
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + +
+

+ Once the first hive is online, it and the bacteria + seem to become a silent partners, drawing and + distributing resources, linking the aliens together, + but otherwise leaving all decisions up to the + individual creatures as to how and when to attack + the enemy. Creating new hives is one of these + decisions.

+

Any creature can gestate into the builder class, + the Gorge, and if enough resources are available, + trigger the growth of a new hive. See the Gorge + description for more information on this ability. + The Frontiersmen seem to be seen as a large enough + threat that new hives are built as fast as possible. + When three hives are activated, the full might + and power of the Kharaa is revealed.

+
+ + + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_onos.html b/main/manual/alien_onos.html new file mode 100644 index 00000000..d57ea891 --- /dev/null +++ b/main/manual/alien_onos.html @@ -0,0 +1,227 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species: + Onos
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + +
+

Summary: The dreadnaughts of the Kharaa, + the Onos are tanks – highly armored and very + powerful. They are so large they cannot use crawlspaces + and many of the narrow passages found on human + ships and bases. This does not limit their effectiveness + very much – the Onos is the highest level + response to any threat, requiring large amounts + of resources to gestate, but paying off with truly + awe-inspiring strength.        [Name]

+
+

+ Health: 500               + Armor: 150 + pts. armor (30% damage absorbed)

+
+

Abilities: + = zero hives =one + hive =two + hives =three + hives =damage + vs. structures

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Gore

+
+

120

+
+

Paralyze

+
+

Immobilizes for 6 seconds

+
+

Charge

+
+

number of "touches" x 10

+
+

Primal Scream

+
+

adrenaline rush (area effect)

+
+


+ Observation:
+ "The + grillwork - 'round 20' by 20' of 6" + metal bars - blew off …"

+
+
+


+
+
+
+
+
+

+
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_onos_hive.html b/main/manual/alien_onos_hive.html new file mode 100644 index 00000000..e08f9f63 --- /dev/null +++ b/main/manual/alien_onos_hive.html @@ -0,0 +1,206 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Onos: Hive-Learned + Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: The dreadnaughts of the Kharaa, + the Onos are tanks – highly armored and very + powerful. They are so large they cannot use crawlspaces + and many of the narrow passages found on human + ships and bases. This does not limit their effectiveness + very much – the Onos is the highest level + response to any threat, requiring large amounts + of resources to gestate, but paying off with truly + awe-inspiring strength.        [Name]

+
+
+ + + + + + + + + +
+

+ Onos

+
+ + + + +
+

Two/Three Hive Abilities
+
+ Two Hives: Charge
+
+ It's not difficult, from their appearance, + to imagine the Onos would have bull-like + charging behavior. Once again the Kharaa + exceeds the imagination – the Onos + accelerates its bulk shockingly fast, slamming + through anything in its path. The effect + is devastating – a human doesn't even + slow it down, and it hits metal or machinery + like a detonation. It cannot maintain this + speed for long, and seems to only be able + to charge in a straight line.

+

Three Hives: Primal + Scream
+
+ As the pinnacles of Kharaa strength and + power, the Onos must have always been rallying + points in battle. The so called "primal + scream" is a bellowing roar that triggers + a battle fervor in any nearby alien – + and in the Onos itself. Adrenaline courses + through their bodies – similar to the + evolution, + but affecting the entire alien's physiology + in a much more extreme fashion. They are + faster, deadlier, and can ignore more damage.

+
+
+


+
+
+
+
+
+
+

+
+
 
+ + + + +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_onos_inherent.html b/main/manual/alien_onos_inherent.html new file mode 100644 index 00000000..1b2e9140 --- /dev/null +++ b/main/manual/alien_onos_inherent.html @@ -0,0 +1,190 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Onos: Inherent + Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + +
+ + + + +
+

Summary: The dreadnaughts of the Kharaa, + the Onos are tanks – highly armored and very + powerful. They are so large they cannot use crawlspaces + and many of the narrow passages found on human + ships and bases. This does not limit their effectiveness + very much – the Onos is the highest level + response to any threat, requiring large amounts + of resources to gestate, but paying off with truly + awe-inspiring strength.        [Name]

+
+
+ + + + + + + + + +
+

+ Onos

+
+ + + + +
+

Zero Hives (inherent) Abilities
+ Strength, + Gore

+

Strength: Like the Fade, + the Onos' natural strength and armor are + the core of its deadliness. It is the most + powerful species of the Kharaa. It can soak + up incredible amounts of damage, and single-handedly + destroy all but the best outfitted bases + or squads.

+

Gore: The Onos' primary melee attack. + Its long tusks, backed by its considerable + bulk, tear through metal, flesh, and armor + with ease.

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_onos_name.html b/main/manual/alien_onos_name.html new file mode 100644 index 00000000..6e6f67a2 --- /dev/null +++ b/main/manual/alien_onos_name.html @@ -0,0 +1,208 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Onos: Name
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: The dreadnaughts of the Kharaa, + the Onos are tanks – highly armored and very + powerful. They are so large they cannot use crawlspaces + and many of the narrow passages found on human + ships and bases. This does not limit their effectiveness + very much – the Onos is the highest level + response to any threat, requiring large amounts + of resources to gestate, but paying off with truly + awe-inspiring strength.        [Name]

+
+
+

+ +
+
+
+ + + + + + + + +
+

+ Onos

+
+ + + + +
+

Though it can seem like a joke (and one + in poor taste, considering the devastation + this species has caused), the name "Onos" + does actually come from the phrase "Oh + no." Early on in the conflict with + the Kharaa, a Frontiersmen squad was fighting + to regain control of a solar array in the + Eleme system. Sporadic audio contact had + been maintained with the squad by an experimental + broadcasting spike, driven through the station's + hull. In the besieged marine base, heavy + turret placement and reinforcements had + allowed them to hold off wave after wave + of attack. Time stamp 65.05.43: Through + the sound of gunfire and grenades, the screech + of leaping Skulks and swoosh of acid rockets, + a faint roar is heard. The alien weapons + fall conspicuously silent. The turrets stop. + The roar is heard again, much closer, much + louder. Then four marine's, almost in unison + … "Oh no". All hell breaks + loose, contact is lost. These "Oh no's" + mark the first contact with this species. +

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_onos_observation.html b/main/manual/alien_onos_observation.html new file mode 100644 index 00000000..b3899e5a --- /dev/null +++ b/main/manual/alien_onos_observation.html @@ -0,0 +1,242 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Onos: Observation
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: The dreadnaughts of the Kharaa, + the Onos are tanks – highly armored and very + powerful. They are so large they cannot use crawlspaces + and many of the narrow passages found on human + ships and bases. This does not limit their effectiveness + very much – the Onos is the highest level + response to any threat, requiring large amounts + of resources to gestate, but paying off with truly + awe-inspiring strength.        [Name]

+
+
+ + + + + + + + + +
+

+ Onos

+
+ + + + +
+

"The grillwork – 'round 20' + by 20' of 6" metal bars – blew + off its welds and slid, still upright, digging + grooves into the silo's floor with an ungodly + squeal and hail of sparks. It tripped on + our arms factory and fell diagonally against + the curved wall opposite, forming a kind + of lean-to over our base. I had hit my jet + pack at the first noise, and was hovering + thirty feet above the scene. I angled onto + a catwalk. Sollis and Deej had dived to + the floor (no small feat in heavy armor), + narrowly avoiding the metal. They now stood + up, firing their HMG's down the hallway. + The Onos ran straight at them, bullets pocking + into its head plate, falling flattened to + the floor. I unloaded a clip from my LMG + into its back. They couldn't dodge in that + armor – the Onos suddenly doubled its + speed, and they went sprawling, Deej taking + the blow to his shoulders, smashing onto + his back and going down under its hooves, + Sollis getting a tusk to the midriff, throwing + him in an amazing cartwheel that terminated + halfway up the grillwork in a jumble of + bent armor and broken limbs. I reloaded + and emptied another clip into its back. + Sollis slid, inert, down the grillwork to + the Ono's feet. Deej's armor was literally + flat in places, inches thick, like he was + made out of clay. The Onos walked over to + our infantry portal and rent it in two with + its tusks. I reloaded and emptied another + clip into its back. It walked over to our + armory and butted it with its head, bending + its top, screens shattering and smoke trailing + up. I reloaded and emptied another clip + into its back. The Onos walked around to + the left of the grillwork and seemed to + consider it. It crouched down, crawling + awkwardly under the diagonal opening, then + suddenly stood, sending the grate toppling + back against the other wall. It looked down + on our command console. Our commander, Roswell, + came in over the comm line: "Andre + – I dropped another CC in the Steam + Ramp. Maybe they won't notice it. Get there + and get a portal up, stat."

+

The waypoint came up on my HUD. Steam + Ramp. 60 meters away. The Onos started to + slam against the CC. I counted to three + and slipped from the catwalk, bursting my + jets just feet above the silo floor to break + my fall. I leaped again, skimming through + the bent teeth sticking from the archway + where the grill had been. I heard a moment + of gunfire as Roswell was ejected from the + CC just before it was destroyed. Then I + was off into the red glow of the tunnels, + with two clips of ammo and a horde of beasts + between me and one small chance at turning + this around."

+
+
+


+
+
+
+
+
+
+

+
+
 
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_onos_primary.html b/main/manual/alien_onos_primary.html new file mode 100644 index 00000000..af6c681e --- /dev/null +++ b/main/manual/alien_onos_primary.html @@ -0,0 +1,207 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Onos: Primary + Attacks
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: The dreadnaughts of the Kharaa, + the Onos are tanks – highly armored and very + powerful. They are so large they cannot use crawlspaces + and many of the narrow passages found on human + ships and bases. This does not limit their effectiveness + very much – the Onos is the highest level + response to any threat, requiring large amounts + of resources to gestate, but paying off with truly + awe-inspiring strength.        [Name]

+
+
+ + + + + + + + + +
+

+ Onos

+
+ + + + +
+

One Hive (primary) Abilities
+ Paralyze
+

+ The Onos' chief disadvantage is its ponderousness. + Even with celerity, + it has a difficult time chasing down nimble + prey. The paralyze ability compensates for + this, allowing it to freeze its prey in + their tracks. The long tentacles tucked + back along its head spring to life, waving + about. They can whip barbs with sufficient + force to pierce armor, releasing a toxin + that looks for concentrations of muscle + and clumps around them in a scabrous mess, + effectively paralyzing the victim. Human + musculature is similar enough to trigger + this effect. The toxin targets the largest + muscle groups first – the victim usually + has enough fine motor control to pivot, + and pull the trigger on their weapon. But + they are stuck in place. Frontiersmen nano-screen + and bio-conditioning go to work immediately, + and can remove the blockage in 6 seconds. + If the marine is under direct attack by + this species, it is unlikely they will survive + that long.

+
+
+


+
+
+
+
+
+
+

+
+
 
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_resources.html b/main/manual/alien_resources.html new file mode 100644 index 00000000..2dda06b0 --- /dev/null +++ b/main/manual/alien_resources.html @@ -0,0 +1,174 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data: Resources
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + +
+

+ The bacterium seems capable of tapping a wide + variety of energy sources. Heat and water are + diverse enough, but it also finds the rich sludge + used for nano-construction highly desirable. Fortunately + the same safe guards that prevent marines from + automatically accessing these stores thwart the + Kharaa too. Unfortunately, the aliens seem quite + prepared for this sort of obstacle. Gorges + can build resource + chambers atop resource nodes, that draw the + sludge up and digest it. These chambers appear + to have once been a species, much like the hive. + What these resource chambers could have been used + for before the Kharaa encountered us is a perplexing + mystery. But they convert the sludge into a usable + form, just as our resource towers do.

+

As a result, marines and Kharaa end up fighting + for the same resources. Defending these resources + is vital to the Kharaa, second only to protecting + their hives.
+

+
+ + + + + + + + +
+

+ Resource Use

+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_resourceuse.html b/main/manual/alien_resourceuse.html new file mode 100644 index 00000000..d116139e --- /dev/null +++ b/main/manual/alien_resourceuse.html @@ -0,0 +1,156 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Resources: + Resource Use
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+

+ Aliens, unlike marines, divide resources between + themselves, and use them for their own ends. There + is no oversight, or selective rationing among + individuals. The only exception to this are Gorges. + In their role creating chambers + and new hives, + Gorges spend large amounts of resources, far in + excess of other species, and so seem to draw resources + faster, and have access to more. Otherwise, resources + not used by the aliens remain in reserve – stored + mainly in hives, with the surplus spread throughout + the bacterium – refilling each alien's supply. +

+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_skulk.html b/main/manual/alien_skulk.html new file mode 100644 index 00000000..44944ed7 --- /dev/null +++ b/main/manual/alien_skulk.html @@ -0,0 +1,245 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species: + Skulk
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + +
+

Summary: The most common species encountered. + They are capable of blurring speed and leaps of + near limitless height. The Skulk is a light, wiry + creature around the size of a very large dog. + Lacking any projectile attacks, it specializes + in melee. It moves on all fours – each leg + terminates in a long, sharp, bladed bone. It can + attack with these, and its powerful jaws. If it + cannot be stopped before reaching its target, + its target is in serious trouble.        [Name]

+
+

+ Health: 70               + Armor: 10 + pts. armor (30% damage absorbed)

+
+

Abilities: + = zero hives =one + hive =two + hives =three + hives =damage + vs. structures

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

can move on any surface

+
+

75 damage

+
+

"stains" target

+
+

# of "touches" on target x 4

+
+

400/800(), + reduces outwards

+
+


+ Observation:
+ "I + don't know if I blinked, or there's some + vent we missed…"

+
+
+


+
+
+
+
+
+
+

+

+
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_skulk_hive.html b/main/manual/alien_skulk_hive.html new file mode 100644 index 00000000..aa80c9cd --- /dev/null +++ b/main/manual/alien_skulk_hive.html @@ -0,0 +1,211 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Skulk: Hive-Learned + Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: The most common species encountered. + They are capable of blurring speed and leaps of + near limitless height. The Skulk is a light, wiry + creature around the size of a very large dog. + Lacking any projectile attacks, it specializes + in melee. It moves on all fours – each leg + terminates in a long, sharp, bladed bone. It can + attack with these, and its powerful jaws. If it + cannot be stopped before reaching its target, + its target is in serious trouble.        [Name]

+
+
+

+ +
+
+ + + + + + + + +
+

+ Skulk

+
+ + + + +
+

Two/Three Hive Abilities
+
+ Two Hives: Leap

+

a visually stunning sight – the leaping + ability that a Skulk evolves when two hives + are operational allows it to run away with + breathtaking speed … or attack just + as quickly. Closing large distances and + attacking in one maneuver, it becomes difficult + to hit, and impossible to run from. The + full range of these leaps have not been + measured – our ships and bases aren't + big enough.

+

Three Hives: Xenocide

+

the final, deadliest attack of the Skulk. + And we mean final. Chemical glands + crack open and mix in the center of the + Skulk's body, foaming and expanding so rapidly + that its body explodes. Though the force + of the explosion is itself enough to kill + even a heavily armored marine, the Skulk's + bones are also specially evolved to splinter + into tiny shards. A well placed, well timed + xenocide can obliterate an entire squad. + The concussive force of the blast makes + it twice as effective against marine structures.

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_skulk_inherent.html b/main/manual/alien_skulk_inherent.html new file mode 100644 index 00000000..7fb4d7c9 --- /dev/null +++ b/main/manual/alien_skulk_inherent.html @@ -0,0 +1,207 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Skulk: Inherent Abilities
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: The most common species encountered. + They are capable of blurring speed and leaps of + near limitless height. The Skulk is a light, wiry + creature around the size of a very large dog. + Lacking any projectile attacks, it specializes + in melee. It moves on all fours – each leg + terminates in a long, sharp, bladed bone. It can + attack with these, and its powerful jaws. If it + cannot be stopped before reaching its target, + its target is in serious trouble.        [Name]

+
+
+

+ +
+ + + + + + + + +
+

+ Skulk

+
+ + + + +
+

Zero Hive (inherent) Abilities
+ Wall Running, + Bite
+

+ Wall Running: equally at ease on + the ceiling as the floor, speculation is + that the bladed feet of these Kharaa have + retractable microscopic spines that shoot + out when a spike's tip pierces a surface, + and retract when the foot is lifted. This + ability gives them access to vents and passage + ways that, all too often, serve as shortcuts + and safe-passage all over a ship or base. + This also encourages ambush behavior. A + Kharaa can be hiding on absolutely any surface. + Never trust an empty room.

+

Bite: there is no Earth animal that + bites like the Skulk. Super-tensile muscles + are relaxed and swung open, and then tightened + with incredible speed, raking its jagged + teeth together. It is not trying to eat + its enemies; it is trying to savage them, + causing as much bleeding and damage as possible.

+
+
+


+
+
+
+
+
+
+

+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_skulk_name.html b/main/manual/alien_skulk_name.html new file mode 100644 index 00000000..ac76f527 --- /dev/null +++ b/main/manual/alien_skulk_name.html @@ -0,0 +1,195 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Skulk: Name
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: The most common species encountered. + They are capable of blurring speed and leaps of + near limitless height. The Skulk is a light, wiry + creature around the size of a very large dog. + Lacking any projectile attacks, it specializes + in melee. It moves on all fours – each leg + terminates in a long, sharp, bladed bone. It can + attack with these, and its powerful jaws. If it + cannot be stopped before reaching its target, + its target is in serious trouble.        [Name]

+
+
+

+ +
+
+
+ + + + + + + + +
+

+ Skulk

+
+ + + + +
+

The Skulk cannot attack most targets directly, + at least not without evolving + new abilities. It tends to remain at the + edges of marine activity, looking for opportunities + or ambushes. It only keeps a low profile + so it can get close to its target - then + mayhem ensues. Commanders were constantly + reporting something "skulking" + at the edges of sensor range, or through + the shadows, and the name stuck.

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_skulk_observation.html b/main/manual/alien_skulk_observation.html new file mode 100644 index 00000000..24364bb6 --- /dev/null +++ b/main/manual/alien_skulk_observation.html @@ -0,0 +1,216 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Skulk: Observation
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: The most common species encountered. + They are capable of blurring speed and leaps of + near limitless height. The Skulk is a light, wiry + creature around the size of a very large dog. + Lacking any projectile attacks, it specializes + in melee. It moves on all fours – each leg + terminates in a long, sharp, bladed bone. It can + attack with these, and its powerful jaws. If it + cannot be stopped before reaching its target, + its target is in serious trouble.        [Name]

+
+
+

+ +
+
+
+ + + + + + + + +
+

+ Skulk

+
+ + + + +
+

"I don't know if I blinked, or + there's some vent we missed, but suddenly + a Skulk was sitting on the counter of the + executive lunch room – like we had + caught it scrounging for a late-night snack + in the kitchen, but the six of us looked + tastier. It dodged our lmg's up the wall, + bullets splintering black chrome and ugly + artwork, zipped to the ceiling then dropped + straight onto Zachary. They went down in + a tumble of claws teeth and plush chairs, + his gun still firing, moldy food packs and + Styrofoam cups scattering everywhere. We + kept firing, bullets sparking off the tables + and metal chair legs, knowing FriendlyFire + would stop us from hitting Zach. A large + bloody piece of nano-armor popped lazily + up into the air, and Zachary's gun went + silent. We took our fingers off the triggers, + popped new clips in, and started circling + for a good angle to hit the monster, when + there was this faint hissing sound and suddenly + an explosion, bits of bone and Skulk whizzing + by my ears, and a whole table flipped sideways + and racing towards me – a black shiny + circle getting bigger and bigger then 'wham!', + and I'm out. Good news was the same table + blocked most of the shrapnel. But the rest + of the squad … medical nanites wouldn't + have the faintest idea what to do with that + mess."

+
+
+


+
+
+
+
+
+
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_skulk_primary.html b/main/manual/alien_skulk_primary.html new file mode 100644 index 00000000..d1509152 --- /dev/null +++ b/main/manual/alien_skulk_primary.html @@ -0,0 +1,199 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species + :: Skulk: Primary + Attacks
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

Summary: The most common species encountered. + They are capable of blurring speed and leaps of + near limitless height. The Skulk is a light, wiry + creature around the size of a very large dog. + Lacking any projectile attacks, it specializes + in melee. It moves on all fours – each leg + terminates in a long, sharp, bladed bone. It can + attack with these, and its powerful jaws. If it + cannot be stopped before reaching its target, + its target is in serious trouble.        [Name]

+
+
+

+ +
+ + + + + + + + +
+

+ Skulk

+
+ + + + +
+

One Hive (primary) Abilities
+ Parasite
+
+
By ejecting tiny darts from its nasal + cavities, the Skulk can "tag" + an enemy. The darts release a stain of bacteria, + that connects to the bacterium. The target + is now permanently visible to Hive + Sight – every alien always knows + where it is. Not a pleasant sensation, and + not good for survival odds. The darts do + tiny damage when they strike – and + a warning message will appear on the marine's + HUD.

+
+
+


+
+
+
+
+
+
+

+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_spawning.html b/main/manual/alien_spawning.html new file mode 100644 index 00000000..092cc799 --- /dev/null +++ b/main/manual/alien_spawning.html @@ -0,0 +1,189 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: The + Hive: Spawning Species
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: To destroy the human presence, + the bacterium employs lifeforms of its own. These + are the creatures that slaughter the crew of the + ship or base, and the same creatures that are + waiting for the Frontiersmen when they arrive + to take the ship or base back. Kharaa species + have natural weaponry and cunning that make them + a match for the best equipped and most highly + trained forces we can deploy. To read about these + species, click here. + Hives continue to spawn over the course of a conflict, + replacing lost aliens. Destroying all hives is + the only way to defeat the Kharaa.

+
+
+ + + + +
+

+ The hives seem to act as living libraries – they + contain information the bacteria uses to respond + to threats to its control of an area. The first + hive provides basic information – how to create + Skulks, Gorges + and Lerks. If the + enemy presence is strong, a second hive, and even + a third provide more and more information, allowing + more complex species – the Fade + and Onos. The Kharaa + will tend to conserve resources by upgrading their + response one step at a time, until the threat + is destroyed.

+

Hives do more than contain this information, + they act as the birthing zone for Skulks. It is + unlikely Skulks have always birthed this way – + it seems to be an example of highly specialized + evolution. As the first step of response, Skulks + are the most basic, resource-effective answer + to the human presence. As more resources are made + available, each Skulk can choose to gestate into + a more complex species. The same individual Kharaa + may gestate up through all five species + over the course of a conflict.

+
+ + + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_species.html b/main/manual/alien_species.html new file mode 100644 index 00000000..368cff72 --- /dev/null +++ b/main/manual/alien_species.html @@ -0,0 +1,224 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data: Species
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + +
+

+ There may be individual Earth creatures that approach + the Kharaa in terms of physical prowess, in a + particular fashion: a bull elephant and an Onos + engaged in a tug of war, a gazelle and a Skulk + in a 100 meter sprint – but on the whole, the + Kharaa set physical benchmarks in excess of anything + we have observed in nature thus far. From the + crucible of their brutal evolutionary period have + emerged creatures with truly awesome capabilities.

+
+ + + + +
+ + + + +
+ + + + + + +
+

+ Changing + Species

+
+

+ Abilities + and Attacks

+
+

+ The Sterkman + Point System

+
+ + + + + + + + + +
+ + + + + + + + + +
+ +
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_sterkman.html b/main/manual/alien_sterkman.html new file mode 100644 index 00000000..21a66f33 --- /dev/null +++ b/main/manual/alien_sterkman.html @@ -0,0 +1,149 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data :: Species: + Sterkman Point System
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + +
+

+ Species health, armor, and attack stats, are determined + using the Sterkman + Point System.

+
+ + + + + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/alien_victory.html b/main/manual/alien_victory.html new file mode 100644 index 00000000..704939f3 --- /dev/null +++ b/main/manual/alien_victory.html @@ -0,0 +1,148 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Kharaa + Data: Victory
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

+ If every Frontiersman is dead, and there is no + apparatus operational to phase in reinforcements, + then the Kharaa have won.

+
+ + +

+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/css/alien.css b/main/manual/css/alien.css new file mode 100644 index 00000000..a5017110 --- /dev/null +++ b/main/manual/css/alien.css @@ -0,0 +1,12 @@ +.sectionlink { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; font-weight: bold; color: #CC0000; text-decoration: underline} +p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; line-height: normal} +h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #CC0000} +.subsectionlink { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; font-weight: normal; color: #FFFFFF; text-decoration: underline } +.sectionlinkon { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; font-weight: bold; color: #FFFFFF; text-decoration: underline } +a:link { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #CC0000; text-decoration: underline } +a:active { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #FF6600; text-decoration: underline } +a:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #CC0000; text-decoration: underline } +a:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #FFFFFF; text-decoration: underline } +.sectiontext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; font-weight: bold; color: #CC0000} +body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: normal } +.unnamed1 { border: #CC0000; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px} diff --git a/main/manual/css/marine.css b/main/manual/css/marine.css new file mode 100644 index 00000000..ecd0f580 --- /dev/null +++ b/main/manual/css/marine.css @@ -0,0 +1,11 @@ +.sectionlink { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; font-weight: bold; color: #0099FF; text-decoration: underline} +p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; line-height: normal} +h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #FFFFFF} +.subsectionlink { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; font-weight: normal; color: #FFFFFF; text-decoration: underline } +.sectionlinkon { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; font-weight: bold; color: #FFFFFF; text-decoration: underline } +a:link { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #0099FF; text-decoration: underline } +a:active { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #FF6600; text-decoration: underline } +a:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #0099FF; text-decoration: underline } +a:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #FFFFFF; text-decoration: underline } +.sectiontext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; font-weight: bold; color: #0099FF} +body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: normal } diff --git a/main/manual/front_armor.html b/main/manual/front_armor.html new file mode 100644 index 00000000..ae38f6f3 --- /dev/null +++ b/main/manual/front_armor.html @@ -0,0 +1,165 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Technical: Armor
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

+ Standard issue Frontiersmen nano-armor consists + of a breastplate, helmet, and arm and leg sheaths. + It is made from a plastic/ceramic hybrid of tremendous + strength and resiliency. Beneath its outer layer + are millions of egg-shaped nodules designed to + first resist impact, and then shatter, releasing + the kinetic energy of the blow to their neighbors + and so distributing the force as quickly and widely + as possible. If breached, the armor reseals its + outer skin. It then distributes its remaining + mass equally, creating new nano-eggs, thinning + their number and thickness to compensate. So while + the armor doesn't technically heal itself, no + part of it is ever weaker than any other, and + it maintains integrity up to its last armor point + – though by that stage it has become paper thin.

+

Heavy armor works on the same principle, but + has so many layers of defensive nano that very + little damage makes it through. For more information + on heavy armor, click here.

+

Welders can + repair any armor, pumping new nanos directly into + its structure.

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_building.html b/main/manual/front_building.html new file mode 100644 index 00000000..de298291 --- /dev/null +++ b/main/manual/front_building.html @@ -0,0 +1,179 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine: + Building
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: The commander + selects and places all structures, + but before they are activated, they must be "built" + by Frontiersmen. Marines will see a nano-ghost + of the structure. By standing next to it and activating + their "use" function, they can complete + its construction. The build + indicator will show the structure's progress + on the marine's HUD. The indicator for unbuilt + structures is outlined in yellow, complete structures + are outlined in green. When a structure is complete, + it will visibly deploy. Structures allow new weapons, + upgrades, and equipment.

+
+
+ + + + + + +
+

+ This is an unfortunate limitation of the command + network – as non-military systems pressed + into combat use, many of the pre-existing safeguards + regarding civilian nanotech use remain in place. + Traditionally, onsite construction crews would + have to be present when a new structure is created + – activating the construction nanos, and monitoring + the progress of the build closely, looking for + any nano-leakage, instability, or defect. The + best Frontiersmen software can do to get around + this is to convince the network that marines are + authorized maintenance personnel, serving the + same function. A useful by-product of this work-around + is that the Frontiersmen welder becomes an authorized + maintenance tool. See the welder + entry for more information.

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_choosingcommander.html b/main/manual/front_choosingcommander.html new file mode 100644 index 00000000..15a77ffd --- /dev/null +++ b/main/manual/front_choosingcommander.html @@ -0,0 +1,203 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Commander: + Choosing a Commander
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: Any marine may become commander. + Frontiersmen deploy according to the Hirshelm + Doctrine of Tactical Flexibility.

+
+
+ + + + + + +
+

+ When arriving at the starting base, any marine + may choose to enter the command console, and plug + into the network. The Frontiersmen adhere to the + Hirshelm Doctrine of Tactical Flexibility, + which advocates that while a command structure + is necessary off the battlefield (to avoid the + endless debates of boardrooms and parliaments), + it is better for squads to evolve a hierarchy + organically – favoring those best suited + or prepared for each situation over pre-selected + officers. It is specially designed to allow rapid + training and deployment of troops – the standard + is 100 hours simulator training, and 100 hours + classroom time before being promoted to the field. + This also allows impromptu squads of all sizes + to form and head into combat with little preparation, + while decreasing the severity of losing an officer. + With the Frontiersmen, mobility and flexibility + is the order of the day.

+

What this means is that, usually, the individual + with the best odds of leading the team to victory + in each situation will take control. To quote + Sergeant Haverhill, principle instructor at TSA + Headquarters, "A Frontiersman must not surrender + to ego, greed, or power-lust. Remember who the + bad guys are. The reason the TSA has been kickin' + ass for the last decade, is we don't having pissing + contests when lives are at stake. We get the job + done, with extreme effectiveness. Then + we kick back and brag."

+

If no one steps forward to fill the command role, + someone will usually volunteer for the sake of + the group. Those with the desire to learn command + tactics can only do so much in training – + sooner or later they will have to just jump in + and begin gaining experience.

+

What this also means is that you don't have + to listen to your commander. But the numbers from + the field tell the story: your odds of survival + on your own are minimal-to-none, and a team that + isn't working closely with a commander is, in + every recorded instance, doomed.

+
+ + + + + +
+ Voting out a + Commander
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_comduties.html b/main/manual/front_comduties.html new file mode 100644 index 00000000..b0b99315 --- /dev/null +++ b/main/manual/front_comduties.html @@ -0,0 +1,203 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: + Commander: Command + Duties
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: The commander performs vital + tasks – providing his team with equipment and + weapons, and upgrading the network to create more + advanced and powerful equipment and weapons.

+
+
+ + + + + + +
+

+ The best way to understand the command interface + and tasks is by diving right in. A tutorial will + be online soon, allowing marines to explore the + command interface in a non-combat environment. + The following sections provide an overview:

+ + + + + +
+ + + + + + + + + + +
+

The + Command HUD
+
+
+

+
+

Dropping + Equipment
+
+
+

+
Structures
+
+
+
+

Resources
+
+
+

+
+

Upgrades
+
+

+
+
 
+ +
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_comhud.html b/main/manual/front_comhud.html new file mode 100644 index 00000000..6469246c --- /dev/null +++ b/main/manual/front_comhud.html @@ -0,0 +1,175 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: + Command + Duties: Command HUD
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

The interface that the commander uses to watch + over his squad is called the command HUD (heads + up display). When plugged into a Command + Console, the HUD replaces the commander's + field of vision, and basic controls allow him + to manipulate and control the display.

+
+
+ + + + + + +
+

The three most important components of the HUD + are the mini-map, + the menu, + and the view.

+
+
+ + + + +
+ +
+ + + + +
+

+
+
+
+ +
+ + + + + +
+
+ + + Menu + View + Minimap + + + \ No newline at end of file diff --git a/main/manual/front_comhud_menu.html b/main/manual/front_comhud_menu.html new file mode 100644 index 00000000..a42c8279 --- /dev/null +++ b/main/manual/front_comhud_menu.html @@ -0,0 +1,171 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: + Command + Duties :: + Command HUD: + Menu
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + + + + + + + +
+ + + + +
+

The interface that the commander uses to watch over + his squad is called the command HUD (heads up display). + When plugged into a Command + Console, the HUD replaces the commander's field + of vision, and basic controls allow him to manipulate + and control the display.

+
+
+ + + + +
+

The three most important components of the HUD are + the mini-map, + the menu, and the + view.

+
+ + + + +
+
+
+ + + + +
+ + + + +
+

Menu
+ On the lower right, the command menu contains + icons for all marine structures and equipment. + Clicking on an icon selects it, and placing it + on the view + tells the nano-network to create it at that location. + If structure is selected on the view, + any upgrades it makes available are displayed + on the menu.

+

+
+ +
+
+
 
+
+
+ + + \ No newline at end of file diff --git a/main/manual/front_comhud_minimap.html b/main/manual/front_comhud_minimap.html new file mode 100644 index 00000000..2a75a7c9 --- /dev/null +++ b/main/manual/front_comhud_minimap.html @@ -0,0 +1,215 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: + Command + Duties :: + Command HUD: + Mini-map
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+ + + + +
+

The interface that the commander uses to watch + over his squad is called the command HUD (heads + up display). When plugged into a Command + Console, the HUD replaces the commander's + field of vision, and basic controls allow him + to manipulate and control the display.

+
+
+ + + + +
+

The three most important components of the HUD + are the mini-map, + the menu, + and the view.

+
+ + + + +
+
+
+ + + + +
+

Mini-map
+ A map of the entire ship or base, this is a quick + way to jump the display (view) to another area + (just click on the map to jump). Marines appear + on this map as green, structures blue, and aliens, + when visible, as red (see nano-gridlock). + Requests for ammo, structures under attack, and + other alerts appear on the minimap. The minimap + is invaluable for quickly identifying and responding + to urgent events all over the battlefield.

+ + + + + +
+ + + + + + + + + + + + + +
+
+

Marines

+
+
+
+

Structures

+
+
+
+

Aliens

+
+
+
+

Resource Nodes

+
+
+
+
+
+
+ + + + +
+
+
+
+ +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_comhud_view.html b/main/manual/front_comhud_view.html new file mode 100644 index 00000000..d7d795c1 --- /dev/null +++ b/main/manual/front_comhud_view.html @@ -0,0 +1,268 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: + Command + Duties :: + Command HUD: + View
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + + + + + + + + + +
+ + + + +
+

The interface that the commander uses to watch over + his squad is called the command HUD (heads up display). + When plugged into a Command + Console, the HUD replaces the commander's field + of vision, and basic controls allow him to manipulate + and control the display.

+
+
+ + + + +
+

The three most important components of the HUD are + the mini-map, + the menu, and the + view.

+
+ + + + +
+
+
+ + + + +
+

View
+ The commander's view of the battlefield, and his principle + means of interacting with his squad. This display incorporates + a wide variety of functions, the most important of which + are listed below:

+ + + + +
+
+

Watching Over Marines + – monitoring their status and progress, dropping + equipment as necessary.

+
+
+ + + + +
+

Sighting Aliens + – any uncloaked + aliens near a marine are clearly visible to the + commander, even if the marine is unaware of them.

+
+ + + + +
+
+

Giving Orders + – by selecting a marine or group of marines, + and then designating a map location, the commander + causes a waypoint to appear on the marines' + HUD. These can be used to navigate and group + marines, direct them to a build + a structure, or + alert them to each other's location.

+
+
+ + + + +
+

Selecting Structures + – select structures to see what upgrades + they make available, or to recycle them for resources.

+
+ + + + +
+
+

Dropping Equipment + and Placing Structures – use the view + to place equipment + and structures. + When a structure or piece of equipment is available + (see the tech tree), + it can be selected on the menu, + and its icon will appear as a three dimensional + "ghost" on the view. If the location + is invalid (over rough, occupied, or gridlock-restricted + space) the icon will change color to red. If + the location is valid, it will be colored green, + and can be successfully placed. Equipment + can then be picked up by any marine. Structures + will have to be built + by one or more marines, before they become active. + Most structures must be built in range of others + (for instance, turrets + must be built within range of a turret + factory), and all weapons must be placed + in range of an armory + or advanced + armory. Valid ranges will be drawn in fields + of green. See the appropriate listing for more + information.

+
+
+ + + + +
+

Environment Controls + – any item that can be operated by a button or + lever (i.e. doors, lifts, airlocks), can also + be operated by the commander.

+
+ + + + +
+
+

Scans – + select the observatory, + choose the scanner icon from the menu, + and move the view to the area of the map you + wish to scan. Any alien chambers, + hives or lifeforms + (cloaked or not) will be briefly revealed. Useful + to find the location of hives, or to plan an + assault.

+
+
+ +
+
+ +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_commander.html b/main/manual/front_commander.html new file mode 100644 index 00000000..1819e25a --- /dev/null +++ b/main/manual/front_commander.html @@ -0,0 +1,217 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data: Commander
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: By plugging in to a ship or base's + command network, the commander oversees marine + activities and provides them with equipment, + defenses, and upgrades.

+
+
+ + + + + + +
+

+ Since you will be fighting the Kharaa on home + territory (our own ships and bases), you have + many advantages. Some of these are obvious – like + having maps of the battleground. But even more + important, is the existing command network in + each ship.

+

The command network is a layer of multi-purpose + nanos that spreads, root-like, just above all + ceilings and overhangs. Micro-arrays of lenses, + tiny packets of construction nanos, and hundreds + of other nano-devices all tied into millions of + relays and computing nodules – cohering into a + pervasive, responsive system intimately connected + to every aspect of its ship's or base's existence. + This network also holds the marine's resources, + distributed throughout its veins.
+

+

To take advantage of the network, every ship + or base has a command interface, which, before + the Kharaa, was used by top administrative or + authority figures to manage and govern their domain. + These interfaces replaced vast numbers of support + staff with one person, who could instantly turn + their attention anywhere within the ship or base, + and guide the crew through their duties. Used + for tasks as varied as maintenance or surveillance, + the command interface also allowed its user to + operate some elements of the physical environment, + like doors and lights; and, crucially, granted + clearance for nano-construction.

+

Put to use by a Frontiersman Commander (using + a command console), + the network becomes the heart of any military + campaign. Gaining control of the command network + is the first and most vital task for a squad. + This is easily accomplished. Since we are returning + these ships and bases to the previous owners, + they gladly provide us with the encryption keys + to access their systems. Before a squad even deploys, + they are already online. For a description of + the command interface, click here.

+
+ + + + + +
+ + + + + +
+ Nano-Gridlock +
+ + Command + Strategies and Tactics
+ Choosing + a Commander
+ + Command Duties +
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_commandstrats.html b/main/manual/front_commandstrats.html new file mode 100644 index 00000000..f5df62c5 --- /dev/null +++ b/main/manual/front_commandstrats.html @@ -0,0 +1,161 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: + Commander: Command + Strategies and Tactics
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

+ Because the commander must spend resource points + to acquire new items, this is often called "purchasing". + Commanding is very much like trying to run a business + on a limited budget.

+

Even the smallest decisions facing a commander + can be vital. Buy one set of heavy armor, or another + siege turret? Hold off on the heavier weapons, + or cash in your reserves and go for broke? The + larger decisions are even tougher: build a second + base and dig in, or assault the enemy hive? Research + defensive or offensive upgrades? Split your forces, + or group them for a concerted attack?

+

Unfortunately, there are no tried and true methods, + and never any easy answers. We are counting on + you to help us crack the Kharaa's deployment, + and start building a database of command expertise. +

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_communicating.html b/main/manual/front_communicating.html new file mode 100644 index 00000000..397b00f8 --- /dev/null +++ b/main/manual/front_communicating.html @@ -0,0 +1,169 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data + :: Marine: + Communicating
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

Your commander will be communicating with you + using text, voice, and waypoints. + Understand though that even an experienced commander + can be hard pressed to keep up with the individual + demands of his squad while still managing the + big picture. Getting more health, more ammo, or + a new weapon may seem like life or death to you, + but there will be many times your commander has + more important things on his mind – like + another battle happening on the far side of the + map, with its own soldiers, with their own needs. + A commander may be managing three battles and + construction of a forward base all at the same + time. He can see the big picture. You can't.

+

There is a certain kind of shell shock that can + afflict commanders in combat – especially sprawling + conflicts with multiple objectives. Commander + shell-shock is a sure-fire squad killer. Ironically, + the squad is often responsible for this condition. + Repeated requests for health and ammo, irate demands, + or even critical comments can fill the command + console with a clamor of voices and lights. Tempers + fray, and poor decisions are made. Not getting + a medkit may put your life in danger, but yelling + at your commander moves your entire squad closer + to defeat.

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_equipment.html b/main/manual/front_equipment.html new file mode 100644 index 00000000..384b69f9 --- /dev/null +++ b/main/manual/front_equipment.html @@ -0,0 +1,217 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data + :: Marine: + Equipment and Provisions
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: A Frontiersman relies upon his + commander, + or structures his + commander has the squad build, + for all equipment and provisions. Communication + between commander and squad is critical.

+
+
+ + + + + +
+

The + following are primary marine needs, and how to + address them.

+
+

+ Health: watch your HUD + to monitor your health. Health can only be restored + by Medkits, + dropped by the commander. Maximum health is + 100 points.

+
+

+ Armor: marines begin with 50 points + of armor. Defensive nano-arrays absorb 30% of + damage, the rest of which effects your health. + Upgrades + to armor, and the equipment heavy + armor, can dramatically improve this protection. + Armor can only be repaired by a welder.
+

+
+

+ Ammo: watch your HUD + to monitor ammo. Ammo can be gotten automatically + from an armory, + or dropped as ammo + packs by the commander (critical when away + from base). While an armory upgrading to an + advanced + armory, it will be unable to supply ammo.

+
+

+ Weapons: all new weapons (besides + starting equipment) must be purchased and dropped + by the commander. A marine can carry one primary + weapon (LMG, shotgun, HMG or grenade launcher), + a pistol, and knife. He can also carry a welder + or mines (which replace the pistol), if these + items are made available. See the weaponry + section for more information.
+

+
+

+ Upgrades: upgrades to armor and + weapon strength, plus the motion tracking ability, + can be researched by the commander. See the + upgrades section + for more information.

+
+

+ Advanced Equipment: jet + packs and heavy + armor can be researched by the commander, + and then purchased for each marine.
+

+
+

+ Support Artillery: the commander + can create turrets + and siege turrets + to defend a base, or support a forward position. + These defenses must be built by marines.

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_friendlyfire.html b/main/manual/front_friendlyfire.html new file mode 100644 index 00000000..c5395ab0 --- /dev/null +++ b/main/manual/front_friendlyfire.html @@ -0,0 +1,162 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Friendly Fire
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

A note on "Friendly Fire": + the phenomena of "friendly fire" (weapons + damaging one's own teammates) has been circumvented + in the 22nd century, by the use of nano-triggers + and nano-weaponry. Currently the term "FriendlyFire" + refers to this system. Shrapnel, bullets, and + blast particles are split-second destabilized + before striking any Frontiersmen, fragmenting + harmlessly against their armor. In rare cases + nano-gridlock + has been known to interfere with this protection + for the duration of a battle. Another strange + gap in the FriendlyFire system: a fired weapon + still injures the person who activated it. This + is only a danger with grenades + and mines … + but is very important to note.

+
+ + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_marine.html b/main/manual/front_marine.html new file mode 100644 index 00000000..cbac3fa0 --- /dev/null +++ b/main/manual/front_marine.html @@ -0,0 +1,205 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data: The + Marine
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Though the commander's duties are complex and + vital, they exist only to support his squad. The + squad are the ones fighting and dying to accomplish + the mission. By working closely together, the + commander and squad can achieve victory, even + against seemingly overwhelming odds.

+
+
+ + + + + + +
+

+ Frontiersmen must pass rigorous physical and psychological + exams before they can even enter training. The + training process, though in many respects similar + to militaries all over the galaxies and all throughout + history, is unique in its emphasis on small squads, + tactical flexibility, and the unprecedented nature + of the enemy Frontiersmen train to confront. Frontiersmen + are trained to enter a new environment in squads + of 5 to 15 individuals, with very little equipment + or support, and achieve definitive victory against + a virulent and hostile xenoform foe. See The Hirshelm + Doctrine of Tactical Flexibility for more + information on Frontiersmen deployment philosophy.

+
+ + + + + +
+ + + + + + + + + + +
+

+ Equipment + and Provisions

+
+

+ Communicating

+
+

+ Building

+
+

+ Weapons

+
+

+ Upgrades

+
+ +
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_marineupgrades.html b/main/manual/front_marineupgrades.html new file mode 100644 index 00000000..827af32b --- /dev/null +++ b/main/manual/front_marineupgrades.html @@ -0,0 +1,145 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine: + Upgrades
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+

The commander can research upgrades to marine + armor, weapons, and unique modifications like + motion tracking. For full descriptions, see the + upgrade section.

+
+
 
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_nanogridlock.html b/main/manual/front_nanogridlock.html new file mode 100644 index 00000000..578d43a9 --- /dev/null +++ b/main/manual/front_nanogridlock.html @@ -0,0 +1,191 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Commander: + Nano-Gridlock
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: The Kharaa's bacterial network + attacks the marine nano-network + – interfering with command functions.

+
+
+ + + + + + +
+

+ As you will see in the Bacterium + and Bacterial Gridlock + sections, the Kharaa have a kind of network of + their own – that is constantly struggling with + ours on a microscopic level. Though they have + no commander or leader, they can clearly receive + and send information, coordinate their efforts + to respond to threats, and organize assaults. +

+

The nano-battle between the bacterium and our + nanotech creates what has been termed "nano-gridlock". + It greatly reduces the effectiveness of the commander, + in the following ways:

+

Blindness
+ The commander cannot see the Kharaa, or their + hives or chambers, unless marines are nearby. + Every Frontiersman has a defensive nano-grid, + originally used to protect them against enemy + biological and nanotech attacks. These screens + clear away some of the gridlock from the local + command network, allowing commanders to see enemy + threats before troops on the ground can. Listen + to your commander – it can save your life. See + also motion + tracking and sensor + sweep for other methods of detecting the alien + presence.

+

Build limits
+ The bacterium interferes with construction, making + it difficult to create structures, or drop weapons. + Bases provide "clean" zones, and some + Frontiersmen towers – like the turret factory + for instance, have boosted nano-signatures that + resist meddling. Once built, many structures allow + other structures and equipment to be created nearby. + Ammo and medkits can be dropped anywhere – + due to their simple design and some clever TSA + hacking.

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_nanotech.html b/main/manual/front_nanotech.html new file mode 100644 index 00000000..f50420df --- /dev/null +++ b/main/manual/front_nanotech.html @@ -0,0 +1,218 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data: Nanotech
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + + +
+

+ The cornerstone of scientific advancement and + technology in the last century has been nanotech: + the use of molecular machines to manipulate the + very atoms of matter. This technology has allowed + humanity to construct objects that are lighter, + stronger, and more perfectly assembled than ever + before – one molecule at a time. It also means + that if we have the "blueprints" of + any device, we can construct it perfectly, over + and over.

+

There are two types of nanotech (also called + "nanites") currently in use – replicating, + and fixed. Fixed nanotech are molecular machines + that perform one function only, running off an + internal energy supply, and expiring when their + work is done. An example would be the medical + nanos in medkits. They enter the body, locate + damage, and repair it. Once their energy is used + up, they "die", entering the bloodstream + to be filtered out naturally. Each medkit can + only repair so much damage (and good thing – + medical nanites with no energy limit might continue + to "repair" even after the damage was + fixed). Replicating nanotech, on the other hand, + draw energy from their environment (usually a + single type of matter) and some even have the + ability to reproduce, creating new versions of + themselves that can in turn replicate, ad infinitum. + An example would be the biotech patrolling every + Frontiersman's body, looking for foreign biotech + or nanotech attack. These machines convert iron + in the blood into the minimal charge needed to + continue functioning. Replicating nanotech is + extremely dangerous and nearly non-existent today. + The dangers of a machine that never stops, or + can reproduce itself into infinity, are too great. + Early mistakes destroyed entire planets, and created + "hot zones" that will be off limits + for many generations. The destructive potential + of this technology dwarfs anything man has encountered + or imagined.

+

For this reason, there are strict limits on the + use of nanotech in civilian or industrial applications. + These limits are relaxed slightly on ships, where + accidents can be contained, or in military situations, + where it seems any advantage will be exploited + sooner or later, no matter the risk.

+

Most ships or bases have carefully contained + stores of "raw" nano-sludge, a mineral + rich slop that can serve as the base material + for any desired object. Nanotech assemblers are + designed to accept this sludge, and this sludge + only, as their fuel, and the building blocks for + nano-construction. This helps limit the dangers + of nanotech, and also allows the Trans-Govs to + police its use (by controlling the nano-sludge + supply). There are few greater crimes than the + unsanctioned development or use of nanotech.

+ + + + + +
+

Stores of nano-sludge on ships or bases + are called Resource Nodes. They are only + accessed under supervised conditions, requiring + the oversight of a ship's captain. Frontiersmen + can tap them using Resource + Towers. See Resources + and Equipment for more information. +

+
+ +
+ + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_phasetech.html b/main/manual/front_phasetech.html new file mode 100644 index 00000000..42486764 --- /dev/null +++ b/main/manual/front_phasetech.html @@ -0,0 +1,195 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Technical: Phase + Technology
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

+ When a marine steps into a phase gate, he becomes + the anchor for a subject field. A tunnel is then + carved through dimensional space, guided by the + observatory, till it finds another phase gate. + This tunnel is called the "potentiality stream". + To put it simply, it makes it more and more likely + that the subject will actually be in the new location, + until it becomes so likely the probability + fulfills itself, and the subject is.

+

Distress beacons + make use of temporary, basically disposable phase + gates, generated out of the nano-construction + abilities of a ship or base's command + network. Subject fields are created just long + enough to send all waiting reinforcements, with + the observatory + pinpointing the location. Some day, technology + like this may allow for point-specific personal + phase gate travel to any location within a command + network.

+

Phase travel requires energy commiserate with + the amount of mass being sent and the distance + it is to cover: first to generate the subject + field, and then to create the potentiality stream, + which must be tamed if the destination end is + to remain fixed. The observatory's job is to bombard + the stream with spatial information, allowing + it to latch on to the destination field. Without + a fixed destination point generating its own subject + field, the potentiality stream is too difficult + to control, and will wave about blindly. It will + as likely smear the marine over a few miles one + sliver at a time, or deposit them in solid matter + (which splits the stream – not a pretty sight), + as transport them to a safe location. Even then, + on a small bit of pressurized metal surrounded + by an unforgiving vacuum, "safe" is + a relative term.

+

This is basically the same principle employed + by the huge, galaxy bridging gates that anchor + trans-system civilization – except they deal in + thousands of light-years instead of a couple square + miles. As one expect, the size of the gates, and + the energy drain, is commensurately larger. Getting + such huge streams to hold still is a massive feat. + Human civilization went bankrupt trying to build + and operate these gates, while competing and fighting + with one another. The + Charter has paved the way for economic and + military stability, and the TSA is dedicated to + preserving it.
+

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_resources.html b/main/manual/front_resources.html new file mode 100644 index 00000000..96300e27 --- /dev/null +++ b/main/manual/front_resources.html @@ -0,0 +1,173 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersman + Data :: + Commander :: Command + Duties: Resources
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

Frontiersmen and Kharaa are drawing from the + same resources. Controlling resources (as discussed + in the next section) is critical. The only way + to do this is to capture + resource nodes, and prevent the Kharaa from + using them. Each resource node connects to a supply + of raw nano sludge. This sludge is converted into + resource points, that can then be spent by the + commander to create every weapon, + structure, and provision + the squad will need, and to purchase all upgrades + and research.

+

Without any towers, resources will trickle slowly + in through the command network. With every active + resource tower, this trickles increases. Keeping + pace with alien growth requires controlling as + many, or more, resource nodes as they do. Next + to structures like the command + console and infantry + portal, they are the most vital structures + to defend.
+

+
+ + + + + +
+ Resources + and Equipment
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_resourcesandequip.html b/main/manual/front_resourcesandequip.html new file mode 100644 index 00000000..05c5ab7c --- /dev/null +++ b/main/manual/front_resourcesandequip.html @@ -0,0 +1,189 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + ... :: Command + Duties :: Resources: + Resources and Equipment
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + +
+ + + + + +
+

Summary: the basic equipment for a Frontiersman + is nano-plate armor, an LMG + and pistol (with + ammo), a knife, + and one command console + and resource + tower for the squad. Any further equipment + or upgrades must be purchased, by tapping local + resources. Resources at any given moment will + be limited, and depending on the number of resource + towers, may grow very slowly; so command + strategy should determine what is and isn't + purchased.

+
+
+ + + + + + +
+

Details on how to research and purchase new equipment + can be found in the structure, + equipment and upgrade + sections.

+

+ The Frontiersmen are fighting many small to mid-scale + battles at any given moment. Provisioning all + of these far flung conflicts would exceed their + budget, and be a logistical nightmare. The TSA + can't afford to give jet + packs to marines crawling through sewers, + or heavy armor to + a squad that needs to move fast and light over + long distances.
+
+ Ever adaptable, Frontiersmen squads have learned + to tap into local resources, using a ship or base's + store of nano-sludge + to enhance the command network and outfit marines + with weapons and + upgrades. Not + only does this allow each squad's commander to + choose the optimal strategy for each situation, + it uses the Trans-Govs own resources to pay for + operations – vastly extending the TSA's budget.

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_sterkman.html b/main/manual/front_sterkman.html new file mode 100644 index 00000000..8c00a56e --- /dev/null +++ b/main/manual/front_sterkman.html @@ -0,0 +1,171 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Technical: The + Sterkman Point System
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

+ In order to discuss abstracts such as health or + damage, the TSA and Frontiersmen use Louise Sterkman's + Tactical Point System. Originally created for + virtual games and training simulators, the system + is a mathematical calculation that attempts to + build a useful reference point for how much damage + is done to a target, and how much health a marine + (or in the new system, an alien) possesses relative + to these weapons. The system assumes each marine + has 100 'points' of health (given Frontiersmen + health conditioning, there is little variation + between marines), and 50 points of armor. All + weapon stats and alien abilities are calculated + from this baseline. This can lead to some seemingly + gruesome statistics, like determining the strength + of a Skulk's bite, + based on the average number of attacks it takes + to inflict fatal damage on a marine in field armor. + This number has been determined, after accumulating + first-hand data, by the following calculation:
+
+ Average (successful) attacks required = 2.
+ An un-upgraded marine has 50pts of armor, which + absorbs 30% of damage.
+ So, the Skulk is doing at least 71 points of damage + per attack (30% of 71= 50.4).
+ Further refinements have led us to assume the + bite attack is closer to 75 points.

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_upgrades.html b/main/manual/front_upgrades.html new file mode 100644 index 00000000..e9949f9a --- /dev/null +++ b/main/manual/front_upgrades.html @@ -0,0 +1,161 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: + Commander :: Command + Duties: Upgrades
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + +
+ + + + + +
+

Summary: upgrades affect all marines, + providing permanent improvements to their weapons, + armor, and sensors. Each upgrade requires a structure + before it can be researched (see the tech + tree).

+
+
+ + + + + + +
+

+ There are currently three available upgrades -- + Weapon, + Armor + and Motion + Tracking.

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_upgrades_armor.html b/main/manual/front_upgrades_armor.html new file mode 100644 index 00000000..b6f3638c --- /dev/null +++ b/main/manual/front_upgrades_armor.html @@ -0,0 +1,304 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Upgrades: + Armor Upgrades
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: upgrades affect all marines, + providing permanent improvements to their weapons, + armor, and sensors. Each upgrade requires a structure + before it can be researched (see the tech + tree).

+
+
+ + + + + + +
+

+ There are currently three available upgrades -- + Weapon, + Armor + and Motion + Tracking.

+
+
+ + + + +
+ +
+
+ +
+ + + + + + + + +
+
+ + + + +
+ + + + + +
+

Armor Upgrades
+ Required structure: Arms + Lab
+ : + Frontiersmen standard issue nano-armor provides 50 + points of protection, and absorbs 30% of incoming + damage. For more information on armor, click here. + By researching armor upgrades at the arms + lab, the commander can armor boost this protection. + The following chart shows how each level of upgrade + improves the hit points and damage absorption for + regular armor, or heavy + armor.

+

Once researched, these modifications are made automatically + for all marines.
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Weapon + Upgrades
+

+
+

+ Armor Pts. Points

+
+

+ % dmg

+
+

+ HA Points

+
+

+ HA % dmg

+
+

No upgrades

+
+

50

+
+

30%

+
+

200

+
+

95%

+
+

Level 1

+
+

70

+
+

40%

+
+

230

+
+

95%

+
+

Level 2

+
+

90

+
+

50%

+
+

260

+
+

95%

+
+

Level 3

+
+

110

+
+

60%

+
+

290

+
+

95%

+
+
+ + + + +
+


+
+

+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/front_upgrades_motiontracking.html b/main/manual/front_upgrades_motiontracking.html new file mode 100644 index 00000000..07fa0686 --- /dev/null +++ b/main/manual/front_upgrades_motiontracking.html @@ -0,0 +1,216 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Upgrades: + Motion Tracking
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: upgrades affect all marines, + providing permanent improvements to their weapons, + armor, and sensors. Each upgrade requires a structure + before it can be researched (see the tech + tree).

+
+
+ + + + + + +
+

+ There are currently three available upgrades -- + Weapon, + Armor + and Motion + Tracking.

+
+
+ +
+ + + + +
+ + + + + +
+
+
+ + + + +
+
+ + + + +
+ + + + + +
+

Motion Tracking
+ Required structure: Observatory
+
+ : + If the commander spends the resources to boost its + detection field, the observatory + is capable of detecting all movement in a very large + radius – which tends to cover the whole of + a ship or base, with plenty to spare. Marine movements + are already known, so anything else is painted as + a hostile. Kharaa locations are shown both on the + command HUD and + the marine HUD, + appearing as rings that grow larger or smaller depending + on how close they are. Knowing the location of the + aliens lets the marines breath easier … but + doesn't take the place of constant alertness. If + the Kharaa stops moving, they cannot be tracked. + And when they do move, they move fast. If you're + not looking in their direction, you won't know they're + coming. Keep your guard up at all times, and listen + to your commander.

+
+ + + + +
+


+
+

+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/front_upgrades_weapon.html b/main/manual/front_upgrades_weapon.html new file mode 100644 index 00000000..880a9bc8 --- /dev/null +++ b/main/manual/front_upgrades_weapon.html @@ -0,0 +1,239 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + ... :: Command + Duties :: Upgrades: + Weapon Upgrades
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: upgrades affect all marines, + providing permanent improvements to their weapons, + armor, and sensors. Each upgrade requires a structure + before it can be researched (see the tech + tree).

+
+
+ + + + + + +
+

+ There are currently three available upgrades -- + Weapon, + Armor + and Motion + Tracking.

+
+
+ + + + +
+ +
+
+ +
+ + + +
+ + + + +
+
+ + + + +
+ + + + + +
+

Weapon Upgrades
+ Required structure: Arms + Lab
+ : + by researching weapon upgrades at the arms lab, + the commander can improve the damage of all + marine weapons. + The specific modifications for each weapon are different, + but usually involve refitting them to accept hardened + or explosive rounds.

+

Once researched, these modifications are made automatically + for all marines.

+ + + + + + + + + + + + + + + + + +
+

      Weapon + Upgrades

+
 
+

Level 1

+
+

all weapons + 10%

+
+

Level 2

+
+

all weapons + 20%

+
+

Level 3

+
+

all weapons + 30%

+
+ +
+ + + + +
+


+
+

+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/front_victory.html b/main/manual/front_victory.html new file mode 100644 index 00000000..75c053f4 --- /dev/null +++ b/main/manual/front_victory.html @@ -0,0 +1,151 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data: Victory
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

As long as a single hive + is active, the aliens will continue to spawn. + If all existing hives are destroyed, there is + still a possibility the surviving Kharaa will + have enough resources to establish a new + one. Therefore, victory is only assured when + every hive has been destroyed and every alien + accounted for.

+
+ +

 

+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_votingoutcomm.html b/main/manual/front_votingoutcomm.html new file mode 100644 index 00000000..05487c80 --- /dev/null +++ b/main/manual/front_votingoutcomm.html @@ -0,0 +1,167 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: Commander + :: Choosing + a Commander: Voting + Out a Commander
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + +
+

Summary: In rare cases of Commander misconduct, + the squad can "vote" the commander out. + Inexperience does not qualify as misconduct.

+
+
+ + + + + + +
+

+ In very rare cases, Commanders have been known + to allow the stress of the job, or their own egos + and psychological problems, to interfere with + their squad's mission. An inexperienced Commander + should be given the benefit of the doubt – + everyone makes mistakes. On the other hand, an + insane or hostile commander can be removed from + his seat. This requires a majority vote from all + combat operatives. Once voted out, a commander + will be unable to resume command duties for the + remainder of the battle, and any other battles + in the same campaign.

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/front_wepsterkman.html b/main/manual/front_wepsterkman.html new file mode 100644 index 00000000..52917ee0 --- /dev/null +++ b/main/manual/front_wepsterkman.html @@ -0,0 +1,147 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: Marine + :: Weaponry: + The Sterkman Point System
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

All weapon stats are determined using the Sterkman + Point System.

+
+ + +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/frontiersmen.html b/main/manual/frontiersmen.html new file mode 100644 index 00000000..62b9f9a6 --- /dev/null +++ b/main/manual/frontiersmen.html @@ -0,0 +1,195 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
+ + + + + +
+

Frontiersmen squads, like most human groups, + are at their best when working together under + the direction of a skilled individual. Frontiersmen + work towards objectives, not personal reward. + While physically tough, most of their effectiveness + comes from weapons, armor, and equipment. One + marine is at a disadvantage against one alien. + But a Frontiersman is rarely alone.

+
+
 
+ + + + +
+ +
+
+ +
+ + + +
+ + + + +
+
+ + + + + +
+ + + + + + + + + +
+

Nanotech
+ + +

+
Commander
+ + +
+

 

+

Marines
+ + +

+
+

 

+

Victory
+ + +

+
+ +
 
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/general.html b/main/manual/general.html new file mode 100644 index 00000000..37365bc9 --- /dev/null +++ b/main/manual/general.html @@ -0,0 +1,199 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
General + Data
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+ + + + + +
+

 

+ + + + +
+ + + + + + + +
+ + + + +
+ + + + + + +
+

What is + the TSA?

+
+ + + +
+ +
+
+ + + + +
+
+
+
+
+ + + + +
+
+ + + + +
+ + + + + +
+

Reading Material
+
For more detailed information on topics + related to the history of the TSA and Frontiersmen, + we recommend the Techtrope article "Gather + Frontiersmen!"
+ Click here to read
.
+ For further insight into the war, and the + Kharaa, your best bet is the eyewitness accounts + and journals of the soldiers who have fought + them.
+ Click here to read
.
+

+
+ + + + +
+


+

+
+
+
+
+
+
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/general_aliens.html b/main/manual/general_aliens.html new file mode 100644 index 00000000..c43b1917 --- /dev/null +++ b/main/manual/general_aliens.html @@ -0,0 +1,238 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
General + Data: What + are the Kharaa?
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+ + + + + +
+

 

+ + + + +
+ + + + + + + +
+ + + + +
+

This question still plagues the scientific + community. The Kharaa began appearing on + ships and bases throughout the Ariadne Arm + a decade ago, slaughtering everyone on board. + In almost every case the ship then wandered + off course, and either destroyed itself + by slipping into some gravity well (usually + a planet or sun), or was tracked down and + destroyed by the owners of the craft. Life + support on bases and ships usually fails + soon after the Kharaa take over, so even + without military response, they don't last + very long. But without more detailed knowledge + about them, we will never learn how to prevent + them from appearing on our ships in the + first place. Every successful team returns + with valuable information. And our fragile + economy cannot afford to loose all those + ships and bases. There is also the danger + that a fallen ship will automatically dock + at a major city-base, or land on an Earth-compatible + planet. Lord help us if this happens – + we have seen what they do with the limited + resources on ships … and can only imagine + an entire planet of Kharaa. Thankfully, + the Ariadne Arm is a frontier sector, and + there are few large habitations. So far, + there have been no incidents involving more + than a crew of civilians.

+

The terminology for the aliens is still + being developed. At the moment, we refer + to the aliens, and their whole system of + bacteria, lifeforms and growths, as the + "Kharaa"; and the pre hive-stage + presence as the "bacterium". The + first TSA encounter with the aliens occurred + aboard the Mongol's Sanjii mining facility. + The tattered voice comm logs they extracted + from the command network had one word that + stood out, used again and again – "Kharaa!" + "Kharaa!" Later, it was understood + that this means "Watch out!" in + Mongolian. By then, it had stuck.

+

The relatively obscure field of exo-biology + has flourished since the beginning of the + conflict, attracting many of the best and + brightest from biology, chemistry and even + paleontology and sociology. And while we + have made huge strides (as you will read + in the pages to follow), we are a long way + off from a true understanding of these prolific + and dangerous creatures. The information + in this manual is that small amount we are + confident enough in to tell you as you head + in to combat.

+
+
+ + + + +
+
+
+
+
+ + + + +
+
+ + + + +
+ + + + + +
+

Reading Material
+
For more detailed information on topics + related to the history of the TSA and Frontiersmen, + we recommend the Techtrope article "Gather + Frontiersmen!"
+ Click here to read
.
+ For further insight into the war, and the + Kharaa, your best bet is the eyewitness accounts + and journals of the soldiers who have fought + them.
+ Click here to read
.
+

+
+ + + + +
+


+

+
+
+
+
+
+
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/general_front.html b/main/manual/general_front.html new file mode 100644 index 00000000..ce1da1b5 --- /dev/null +++ b/main/manual/general_front.html @@ -0,0 +1,213 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
General + Data: What are the Frontiersmen?
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+ + + + + +
+

 

+ + + + +
+ + + + + + + +
+ + + + +
+

With the failure of corporate and government + forces to contain the spread of the Kharaa, + the opinion (among those in power) was humanity + should just quarantine the entire Ariadne + Arm (the string of solar systems where the + Kharaa were encountered). The TSA found + this intolerable, both for the people trapped + in the Arm, and for the future of human + expansion (the economic blow of losing all + those ships and bases could threaten the + tenuous peace of the Charter). The TSA volunteered + to mount a response to the Kharaa – effectively + creating a new army, with a new mandate. + The resolution passed, and the new force + was called the Frontiersmen: "standing + on the edge of the unknown, between all + of humanity and whatever would threaten + it." The Frontiersmen have clearance + to travel anywhere, and board any craft. + They have rapid-response outposts scattered + throughout the Ariadne Arm, with teams of + marines ready to deploy. The Frontiersmen + initiative is a huge opportunity for the + TSA. It's also a risk: if the Frontiersmen + fail, on such a public and historic stage, + the Ariadne Arm will be signed off as a + loss and the trans-govs may have the excuse + they've been looking for to "re-organize" + TSA leadership – replacing the Admiral and + her staff with corporate lackeys. If that + happens, dark days are sure to follow.

+
+
+ + + + +
+
+
+
+
+ + + + +
+
+ + + + +
+ + + + + +
+

Reading Material
+
For more detailed information on topics + related to the history of the TSA and Frontiersmen, + we recommend the Techtrope article "Gather + Frontiersmen!"
+ Click here to read
.
+ For further insight into the war, and the + Kharaa, your best bet is the eyewitness accounts + and journals of the soldiers who have fought + them.
+ Click here to read
.
+

+
+ + + + +
+


+

+
+
+
+
+
+
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/general_tsa.html b/main/manual/general_tsa.html new file mode 100644 index 00000000..17362119 --- /dev/null +++ b/main/manual/general_tsa.html @@ -0,0 +1,219 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
General + Data: What + is the TSA?
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+ + + + + +
+

 

+ + + + +
+ + + + + + + +
+ + + + +
+

The Trans-System Authority is an independent + body funded by 37 trans-gov powers (governments + or super-corporations that own and operate + phase gates between solar systems), and + given jurisdiction over trans-system affairs: + as defined by a document called The Charter. + The Charter is a comprehensive document, + covering disarmament, fair trade agreements + (most importantly, sharing phase gates), + and certain basic civil rights that had + become blurred (or tossed aside) during + the dark times of the Expansion.

+

To enforce The Charter, the Trans-Govs + chose Admiral Rathine Studaber, former head + of the revived British Secret Service, and + gave her a budget for a small military force + – which proved hard pressed to stop those + same greedy and quarrelsome powers from + violating almost every agreement they had + made: often concerning their own citizens + (termed "population abuse"). It + was not very long before the TSA had to + resort to military police actions. Its surprising + success against the vastly more powerful + and far better equipped Trans-Govs earned + it the secret hatred of the same powers + that created it. They have long been angling + to curtail the TSA's powers, slash its funding, + or even dissolve it entirely and replace + it with something they can control. So far, + their distrust of each other, and intense + media scrutiny, has kept the TSA alive. + The TSA sees itself as the only sane player + in trans-system politics, and has become + an unappreciated (and often vilified) champion + of human rights.

+
+
+ + + + +
+
+
+
+
+ + + + +
+
+ + + + +
+ + + + + +
+

Reading Material
+
For more detailed information on topics + related to the history of the TSA and Frontiersmen, + we recommend the Techtrope article "Gather + Frontiersmen!"
+ Click here to read
.
+ For further insight into the war, and the + Kharaa, your best bet is the eyewitness accounts + and journals of the soldiers who have fought + them.
+ Click here to read
.
+

+
+ + + + +
+


+

+
+
+
+
+
+
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/images/design/background.gif b/main/manual/images/design/background.gif new file mode 100644 index 00000000..db9cdce9 Binary files /dev/null and b/main/manual/images/design/background.gif differ diff --git a/main/manual/images/design/background_n.gif b/main/manual/images/design/background_n.gif new file mode 100644 index 00000000..a394a078 Binary files /dev/null and b/main/manual/images/design/background_n.gif differ diff --git a/main/manual/images/design/buttons_alien_off.gif b/main/manual/images/design/buttons_alien_off.gif new file mode 100644 index 00000000..363cf645 Binary files /dev/null and b/main/manual/images/design/buttons_alien_off.gif differ diff --git a/main/manual/images/design/buttons_alien_on.gif b/main/manual/images/design/buttons_alien_on.gif new file mode 100644 index 00000000..0a558708 Binary files /dev/null and b/main/manual/images/design/buttons_alien_on.gif differ diff --git a/main/manual/images/design/buttons_front_off.gif b/main/manual/images/design/buttons_front_off.gif new file mode 100644 index 00000000..72d852d7 Binary files /dev/null and b/main/manual/images/design/buttons_front_off.gif differ diff --git a/main/manual/images/design/buttons_front_on.gif b/main/manual/images/design/buttons_front_on.gif new file mode 100644 index 00000000..c4d0de4d Binary files /dev/null and b/main/manual/images/design/buttons_front_on.gif differ diff --git a/main/manual/images/design/buttons_gen_off.gif b/main/manual/images/design/buttons_gen_off.gif new file mode 100644 index 00000000..fea76523 Binary files /dev/null and b/main/manual/images/design/buttons_gen_off.gif differ diff --git a/main/manual/images/design/buttons_gen_on.gif b/main/manual/images/design/buttons_gen_on.gif new file mode 100644 index 00000000..82c81b0e Binary files /dev/null and b/main/manual/images/design/buttons_gen_on.gif differ diff --git a/main/manual/images/design/buttons_nav_off.gif b/main/manual/images/design/buttons_nav_off.gif new file mode 100644 index 00000000..05eec143 Binary files /dev/null and b/main/manual/images/design/buttons_nav_off.gif differ diff --git a/main/manual/images/design/buttons_nav_on.gif b/main/manual/images/design/buttons_nav_on.gif new file mode 100644 index 00000000..130caa0a Binary files /dev/null and b/main/manual/images/design/buttons_nav_on.gif differ diff --git a/main/manual/images/design/divider.gif b/main/manual/images/design/divider.gif new file mode 100644 index 00000000..9e29de95 Binary files /dev/null and b/main/manual/images/design/divider.gif differ diff --git a/main/manual/images/design/info_bar.gif b/main/manual/images/design/info_bar.gif new file mode 100644 index 00000000..532b250d Binary files /dev/null and b/main/manual/images/design/info_bar.gif differ diff --git a/main/manual/images/design/link.gif b/main/manual/images/design/link.gif new file mode 100644 index 00000000..fb20da2f Binary files /dev/null and b/main/manual/images/design/link.gif differ diff --git a/main/manual/images/design/page_background.gif b/main/manual/images/design/page_background.gif new file mode 100644 index 00000000..c9d5f6c3 Binary files /dev/null and b/main/manual/images/design/page_background.gif differ diff --git a/main/manual/images/design/red/background.gif b/main/manual/images/design/red/background.gif new file mode 100644 index 00000000..033cce58 Binary files /dev/null and b/main/manual/images/design/red/background.gif differ diff --git a/main/manual/images/design/red/background_n.gif b/main/manual/images/design/red/background_n.gif new file mode 100644 index 00000000..2c89e466 Binary files /dev/null and b/main/manual/images/design/red/background_n.gif differ diff --git a/main/manual/images/design/red/surround_e.gif b/main/manual/images/design/red/surround_e.gif new file mode 100644 index 00000000..655699f1 Binary files /dev/null and b/main/manual/images/design/red/surround_e.gif differ diff --git a/main/manual/images/design/red/surround_s.gif b/main/manual/images/design/red/surround_s.gif new file mode 100644 index 00000000..77dbe5d6 Binary files /dev/null and b/main/manual/images/design/red/surround_s.gif differ diff --git a/main/manual/images/design/red/surround_title_animated.gif b/main/manual/images/design/red/surround_title_animated.gif new file mode 100644 index 00000000..9704c084 Binary files /dev/null and b/main/manual/images/design/red/surround_title_animated.gif differ diff --git a/main/manual/images/design/red/surround_title_c.gif b/main/manual/images/design/red/surround_title_c.gif new file mode 100644 index 00000000..433a9d34 Binary files /dev/null and b/main/manual/images/design/red/surround_title_c.gif differ diff --git a/main/manual/images/design/red/surround_title_s.gif b/main/manual/images/design/red/surround_title_s.gif new file mode 100644 index 00000000..582b8c29 Binary files /dev/null and b/main/manual/images/design/red/surround_title_s.gif differ diff --git a/main/manual/images/design/red/surround_title_w.gif b/main/manual/images/design/red/surround_title_w.gif new file mode 100644 index 00000000..45c91ea2 Binary files /dev/null and b/main/manual/images/design/red/surround_title_w.gif differ diff --git a/main/manual/images/design/red/surround_w.gif b/main/manual/images/design/red/surround_w.gif new file mode 100644 index 00000000..8e8c6186 Binary files /dev/null and b/main/manual/images/design/red/surround_w.gif differ diff --git a/main/manual/images/design/spacer.gif b/main/manual/images/design/spacer.gif new file mode 100644 index 00000000..46a2cf08 Binary files /dev/null and b/main/manual/images/design/spacer.gif differ diff --git a/main/manual/images/design/surround_e.gif b/main/manual/images/design/surround_e.gif new file mode 100644 index 00000000..0467b465 Binary files /dev/null and b/main/manual/images/design/surround_e.gif differ diff --git a/main/manual/images/design/surround_n.gif b/main/manual/images/design/surround_n.gif new file mode 100644 index 00000000..1437e1fd Binary files /dev/null and b/main/manual/images/design/surround_n.gif differ diff --git a/main/manual/images/design/surround_ne1.gif b/main/manual/images/design/surround_ne1.gif new file mode 100644 index 00000000..0ba37fbc Binary files /dev/null and b/main/manual/images/design/surround_ne1.gif differ diff --git a/main/manual/images/design/surround_power.gif b/main/manual/images/design/surround_power.gif new file mode 100644 index 00000000..757805cf Binary files /dev/null and b/main/manual/images/design/surround_power.gif differ diff --git a/main/manual/images/design/surround_power_anim.gif b/main/manual/images/design/surround_power_anim.gif new file mode 100644 index 00000000..2cdc6e53 Binary files /dev/null and b/main/manual/images/design/surround_power_anim.gif differ diff --git a/main/manual/images/design/surround_s.gif b/main/manual/images/design/surround_s.gif new file mode 100644 index 00000000..ffb0f8d2 Binary files /dev/null and b/main/manual/images/design/surround_s.gif differ diff --git a/main/manual/images/design/surround_title_animated.gif b/main/manual/images/design/surround_title_animated.gif new file mode 100644 index 00000000..5f9b8722 Binary files /dev/null and b/main/manual/images/design/surround_title_animated.gif differ diff --git a/main/manual/images/design/surround_title_c.gif b/main/manual/images/design/surround_title_c.gif new file mode 100644 index 00000000..be9d8a84 Binary files /dev/null and b/main/manual/images/design/surround_title_c.gif differ diff --git a/main/manual/images/design/surround_title_e.gif b/main/manual/images/design/surround_title_e.gif new file mode 100644 index 00000000..dcbcbf95 Binary files /dev/null and b/main/manual/images/design/surround_title_e.gif differ diff --git a/main/manual/images/design/surround_title_initial.gif b/main/manual/images/design/surround_title_initial.gif new file mode 100644 index 00000000..bee960ea Binary files /dev/null and b/main/manual/images/design/surround_title_initial.gif differ diff --git a/main/manual/images/design/surround_title_s.gif b/main/manual/images/design/surround_title_s.gif new file mode 100644 index 00000000..f3076359 Binary files /dev/null and b/main/manual/images/design/surround_title_s.gif differ diff --git a/main/manual/images/design/surround_title_w.gif b/main/manual/images/design/surround_title_w.gif new file mode 100644 index 00000000..e43b72e9 Binary files /dev/null and b/main/manual/images/design/surround_title_w.gif differ diff --git a/main/manual/images/design/surround_w.gif b/main/manual/images/design/surround_w.gif new file mode 100644 index 00000000..d65f2b57 Binary files /dev/null and b/main/manual/images/design/surround_w.gif differ diff --git a/main/manual/images/evolutions/adrenaline.gif b/main/manual/images/evolutions/adrenaline.gif new file mode 100644 index 00000000..8d42b6be Binary files /dev/null and b/main/manual/images/evolutions/adrenaline.gif differ diff --git a/main/manual/images/evolutions/advhivesight.gif b/main/manual/images/evolutions/advhivesight.gif new file mode 100644 index 00000000..2859f51f Binary files /dev/null and b/main/manual/images/evolutions/advhivesight.gif differ diff --git a/main/manual/images/evolutions/carapace.gif b/main/manual/images/evolutions/carapace.gif new file mode 100644 index 00000000..034a8b7e Binary files /dev/null and b/main/manual/images/evolutions/carapace.gif differ diff --git a/main/manual/images/evolutions/celerity.gif b/main/manual/images/evolutions/celerity.gif new file mode 100644 index 00000000..60d77f96 Binary files /dev/null and b/main/manual/images/evolutions/celerity.gif differ diff --git a/main/manual/images/evolutions/cloaking.gif b/main/manual/images/evolutions/cloaking.gif new file mode 100644 index 00000000..0f5a8481 Binary files /dev/null and b/main/manual/images/evolutions/cloaking.gif differ diff --git a/main/manual/images/evolutions/d.gif b/main/manual/images/evolutions/d.gif new file mode 100644 index 00000000..0b769179 Binary files /dev/null and b/main/manual/images/evolutions/d.gif differ diff --git a/main/manual/images/evolutions/m.gif b/main/manual/images/evolutions/m.gif new file mode 100644 index 00000000..9bc3d057 Binary files /dev/null and b/main/manual/images/evolutions/m.gif differ diff --git a/main/manual/images/evolutions/redemption.gif b/main/manual/images/evolutions/redemption.gif new file mode 100644 index 00000000..4bb86727 Binary files /dev/null and b/main/manual/images/evolutions/redemption.gif differ diff --git a/main/manual/images/evolutions/regeneration.gif b/main/manual/images/evolutions/regeneration.gif new file mode 100644 index 00000000..99582bea Binary files /dev/null and b/main/manual/images/evolutions/regeneration.gif differ diff --git a/main/manual/images/evolutions/s.gif b/main/manual/images/evolutions/s.gif new file mode 100644 index 00000000..0a544641 Binary files /dev/null and b/main/manual/images/evolutions/s.gif differ diff --git a/main/manual/images/evolutions/scentoffear.gif b/main/manual/images/evolutions/scentoffear.gif new file mode 100644 index 00000000..2850449a Binary files /dev/null and b/main/manual/images/evolutions/scentoffear.gif differ diff --git a/main/manual/images/evolutions/silence.gif b/main/manual/images/evolutions/silence.gif new file mode 100644 index 00000000..7cfa6c2d Binary files /dev/null and b/main/manual/images/evolutions/silence.gif differ diff --git a/main/manual/images/images/10_armor.gif b/main/manual/images/images/10_armor.gif new file mode 100644 index 00000000..3f70cbcc Binary files /dev/null and b/main/manual/images/images/10_armor.gif differ diff --git a/main/manual/images/images/10_clip.gif b/main/manual/images/images/10_clip.gif new file mode 100644 index 00000000..b19df5a2 Binary files /dev/null and b/main/manual/images/images/10_clip.gif differ diff --git a/main/manual/images/images/10_cost.gif b/main/manual/images/images/10_cost.gif new file mode 100644 index 00000000..086feee4 Binary files /dev/null and b/main/manual/images/images/10_cost.gif differ diff --git a/main/manual/images/images/10_damage.gif b/main/manual/images/images/10_damage.gif new file mode 100644 index 00000000..e224c6e4 Binary files /dev/null and b/main/manual/images/images/10_damage.gif differ diff --git a/main/manual/images/images/10_data.gif b/main/manual/images/images/10_data.gif new file mode 100644 index 00000000..58b52728 Binary files /dev/null and b/main/manual/images/images/10_data.gif differ diff --git a/main/manual/images/images/10_datasmall.gif b/main/manual/images/images/10_datasmall.gif new file mode 100644 index 00000000..b2f97c4a Binary files /dev/null and b/main/manual/images/images/10_datasmall.gif differ diff --git a/main/manual/images/images/10_harmor.gif b/main/manual/images/images/10_harmor.gif new file mode 100644 index 00000000..7cd03a30 Binary files /dev/null and b/main/manual/images/images/10_harmor.gif differ diff --git a/main/manual/images/images/10_hud.gif b/main/manual/images/images/10_hud.gif new file mode 100644 index 00000000..d7b42dbd Binary files /dev/null and b/main/manual/images/images/10_hud.gif differ diff --git a/main/manual/images/images/10_newequip.gif b/main/manual/images/images/10_newequip.gif new file mode 100644 index 00000000..545d4c63 Binary files /dev/null and b/main/manual/images/images/10_newequip.gif differ diff --git a/main/manual/images/images/10_newstruct.gif b/main/manual/images/images/10_newstruct.gif new file mode 100644 index 00000000..de5ad2e3 Binary files /dev/null and b/main/manual/images/images/10_newstruct.gif differ diff --git a/main/manual/images/images/10_note.gif b/main/manual/images/images/10_note.gif new file mode 100644 index 00000000..90f0e996 Binary files /dev/null and b/main/manual/images/images/10_note.gif differ diff --git a/main/manual/images/images/10_percent.gif b/main/manual/images/images/10_percent.gif new file mode 100644 index 00000000..99359a4f Binary files /dev/null and b/main/manual/images/images/10_percent.gif differ diff --git a/main/manual/images/images/10_range.gif b/main/manual/images/images/10_range.gif new file mode 100644 index 00000000..621a92d8 Binary files /dev/null and b/main/manual/images/images/10_range.gif differ diff --git a/main/manual/images/images/10_time.gif b/main/manual/images/images/10_time.gif new file mode 100644 index 00000000..373563de Binary files /dev/null and b/main/manual/images/images/10_time.gif differ diff --git a/main/manual/images/images/10red_0.gif b/main/manual/images/images/10red_0.gif new file mode 100644 index 00000000..cea372ee Binary files /dev/null and b/main/manual/images/images/10red_0.gif differ diff --git a/main/manual/images/images/10red_1.gif b/main/manual/images/images/10red_1.gif new file mode 100644 index 00000000..de66abdc Binary files /dev/null and b/main/manual/images/images/10red_1.gif differ diff --git a/main/manual/images/images/10red_2.gif b/main/manual/images/images/10red_2.gif new file mode 100644 index 00000000..2de1fcae Binary files /dev/null and b/main/manual/images/images/10red_2.gif differ diff --git a/main/manual/images/images/10red_3.gif b/main/manual/images/images/10red_3.gif new file mode 100644 index 00000000..4522e6ff Binary files /dev/null and b/main/manual/images/images/10red_3.gif differ diff --git a/main/manual/images/images/10red_4.gif b/main/manual/images/images/10red_4.gif new file mode 100644 index 00000000..6023296b Binary files /dev/null and b/main/manual/images/images/10red_4.gif differ diff --git a/main/manual/images/images/10red_armor.gif b/main/manual/images/images/10red_armor.gif new file mode 100644 index 00000000..de11af62 Binary files /dev/null and b/main/manual/images/images/10red_armor.gif differ diff --git a/main/manual/images/images/10red_bar.gif b/main/manual/images/images/10red_bar.gif new file mode 100644 index 00000000..0f7fc173 Binary files /dev/null and b/main/manual/images/images/10red_bar.gif differ diff --git a/main/manual/images/images/10red_bar2.gif b/main/manual/images/images/10red_bar2.gif new file mode 100644 index 00000000..e36c1527 Binary files /dev/null and b/main/manual/images/images/10red_bar2.gif differ diff --git a/main/manual/images/images/10red_c.gif b/main/manual/images/images/10red_c.gif new file mode 100644 index 00000000..be7a388e Binary files /dev/null and b/main/manual/images/images/10red_c.gif differ diff --git a/main/manual/images/images/10red_data.gif b/main/manual/images/images/10red_data.gif new file mode 100644 index 00000000..2337abb7 Binary files /dev/null and b/main/manual/images/images/10red_data.gif differ diff --git a/main/manual/images/images/10red_h.gif b/main/manual/images/images/10red_h.gif new file mode 100644 index 00000000..7ac8bda2 Binary files /dev/null and b/main/manual/images/images/10red_h.gif differ diff --git a/main/manual/images/images/10red_health.gif b/main/manual/images/images/10red_health.gif new file mode 100644 index 00000000..a8463d82 Binary files /dev/null and b/main/manual/images/images/10red_health.gif differ diff --git a/main/manual/images/images/10red_hud.gif b/main/manual/images/images/10red_hud.gif new file mode 100644 index 00000000..c04e4af8 Binary files /dev/null and b/main/manual/images/images/10red_hud.gif differ diff --git a/main/manual/images/images/10red_null.gif b/main/manual/images/images/10red_null.gif new file mode 100644 index 00000000..34e921c5 Binary files /dev/null and b/main/manual/images/images/10red_null.gif differ diff --git a/main/manual/images/images/10red_o.gif b/main/manual/images/images/10red_o.gif new file mode 100644 index 00000000..2827aed3 Binary files /dev/null and b/main/manual/images/images/10red_o.gif differ diff --git a/main/manual/images/images/10red_range.gif b/main/manual/images/images/10red_range.gif new file mode 100644 index 00000000..c30363d9 Binary files /dev/null and b/main/manual/images/images/10red_range.gif differ diff --git a/main/manual/images/images/10red_s.gif b/main/manual/images/images/10red_s.gif new file mode 100644 index 00000000..c93f0165 Binary files /dev/null and b/main/manual/images/images/10red_s.gif differ diff --git a/main/manual/images/images/advanced armory.gif b/main/manual/images/images/advanced armory.gif new file mode 100644 index 00000000..96a19cdd Binary files /dev/null and b/main/manual/images/images/advanced armory.gif differ diff --git a/main/manual/images/images/alien_bacterium.gif b/main/manual/images/images/alien_bacterium.gif new file mode 100644 index 00000000..86910074 Binary files /dev/null and b/main/manual/images/images/alien_bacterium.gif differ diff --git a/main/manual/images/images/alien_bacterium_s.gif b/main/manual/images/images/alien_bacterium_s.gif new file mode 100644 index 00000000..b9684e08 Binary files /dev/null and b/main/manual/images/images/alien_bacterium_s.gif differ diff --git a/main/manual/images/images/alien_chambers.gif b/main/manual/images/images/alien_chambers.gif new file mode 100644 index 00000000..e6c5c0f4 Binary files /dev/null and b/main/manual/images/images/alien_chambers.gif differ diff --git a/main/manual/images/images/alien_chambers_s.gif b/main/manual/images/images/alien_chambers_s.gif new file mode 100644 index 00000000..22445196 Binary files /dev/null and b/main/manual/images/images/alien_chambers_s.gif differ diff --git a/main/manual/images/images/alien_hive.gif b/main/manual/images/images/alien_hive.gif new file mode 100644 index 00000000..106f728d Binary files /dev/null and b/main/manual/images/images/alien_hive.gif differ diff --git a/main/manual/images/images/alien_hive_s.gif b/main/manual/images/images/alien_hive_s.gif new file mode 100644 index 00000000..45c86199 Binary files /dev/null and b/main/manual/images/images/alien_hive_s.gif differ diff --git a/main/manual/images/images/alien_resources.gif b/main/manual/images/images/alien_resources.gif new file mode 100644 index 00000000..77aa8edc Binary files /dev/null and b/main/manual/images/images/alien_resources.gif differ diff --git a/main/manual/images/images/alien_resources_s.gif b/main/manual/images/images/alien_resources_s.gif new file mode 100644 index 00000000..70a37d88 Binary files /dev/null and b/main/manual/images/images/alien_resources_s.gif differ diff --git a/main/manual/images/images/alien_species.gif b/main/manual/images/images/alien_species.gif new file mode 100644 index 00000000..c0afe9a6 Binary files /dev/null and b/main/manual/images/images/alien_species.gif differ diff --git a/main/manual/images/images/alien_species_s.gif b/main/manual/images/images/alien_species_s.gif new file mode 100644 index 00000000..5713ab61 Binary files /dev/null and b/main/manual/images/images/alien_species_s.gif differ diff --git a/main/manual/images/images/alien_victory.gif b/main/manual/images/images/alien_victory.gif new file mode 100644 index 00000000..21aada58 Binary files /dev/null and b/main/manual/images/images/alien_victory.gif differ diff --git a/main/manual/images/images/alien_victory_s.gif b/main/manual/images/images/alien_victory_s.gif new file mode 100644 index 00000000..5fc3fd5b Binary files /dev/null and b/main/manual/images/images/alien_victory_s.gif differ diff --git a/main/manual/images/images/armory.gif b/main/manual/images/images/armory.gif new file mode 100644 index 00000000..ae71f40f Binary files /dev/null and b/main/manual/images/images/armory.gif differ diff --git a/main/manual/images/images/blip_blue.gif b/main/manual/images/images/blip_blue.gif new file mode 100644 index 00000000..72c9bddf Binary files /dev/null and b/main/manual/images/images/blip_blue.gif differ diff --git a/main/manual/images/images/blip_green.gif b/main/manual/images/images/blip_green.gif new file mode 100644 index 00000000..b03bb20a Binary files /dev/null and b/main/manual/images/images/blip_green.gif differ diff --git a/main/manual/images/images/blip_red.gif b/main/manual/images/images/blip_red.gif new file mode 100644 index 00000000..126005dd Binary files /dev/null and b/main/manual/images/images/blip_red.gif differ diff --git a/main/manual/images/images/blip_white.gif b/main/manual/images/images/blip_white.gif new file mode 100644 index 00000000..310b6208 Binary files /dev/null and b/main/manual/images/images/blip_white.gif differ diff --git a/main/manual/images/images/chamber_d.gif b/main/manual/images/images/chamber_d.gif new file mode 100644 index 00000000..59ae6ba3 Binary files /dev/null and b/main/manual/images/images/chamber_d.gif differ diff --git a/main/manual/images/images/chamber_m.gif b/main/manual/images/images/chamber_m.gif new file mode 100644 index 00000000..aeb205a3 Binary files /dev/null and b/main/manual/images/images/chamber_m.gif differ diff --git a/main/manual/images/images/chamber_o.gif b/main/manual/images/images/chamber_o.gif new file mode 100644 index 00000000..c3b0459d Binary files /dev/null and b/main/manual/images/images/chamber_o.gif differ diff --git a/main/manual/images/images/chamber_s.gif b/main/manual/images/images/chamber_s.gif new file mode 100644 index 00000000..3a42bea8 Binary files /dev/null and b/main/manual/images/images/chamber_s.gif differ diff --git a/main/manual/images/images/command console.gif b/main/manual/images/images/command console.gif new file mode 100644 index 00000000..85e36fe2 Binary files /dev/null and b/main/manual/images/images/command console.gif differ diff --git a/main/manual/images/images/commander.gif b/main/manual/images/images/commander.gif new file mode 100644 index 00000000..b6bf82c6 Binary files /dev/null and b/main/manual/images/images/commander.gif differ diff --git a/main/manual/images/images/commander_s.gif b/main/manual/images/images/commander_s.gif new file mode 100644 index 00000000..554495f6 Binary files /dev/null and b/main/manual/images/images/commander_s.gif differ diff --git a/main/manual/images/images/commanderhud.jpg b/main/manual/images/images/commanderhud.jpg new file mode 100644 index 00000000..ed5b3ba6 Binary files /dev/null and b/main/manual/images/images/commanderhud.jpg differ diff --git a/main/manual/images/images/commenu.gif b/main/manual/images/images/commenu.gif new file mode 100644 index 00000000..d4c61da9 Binary files /dev/null and b/main/manual/images/images/commenu.gif differ diff --git a/main/manual/images/images/droppables.gif b/main/manual/images/images/droppables.gif new file mode 100644 index 00000000..91841208 Binary files /dev/null and b/main/manual/images/images/droppables.gif differ diff --git a/main/manual/images/images/droppables_s.gif b/main/manual/images/images/droppables_s.gif new file mode 100644 index 00000000..aa6c56f2 Binary files /dev/null and b/main/manual/images/images/droppables_s.gif differ diff --git a/main/manual/images/images/fade.gif b/main/manual/images/images/fade.gif new file mode 100644 index 00000000..95ba0a40 Binary files /dev/null and b/main/manual/images/images/fade.gif differ diff --git a/main/manual/images/images/gl.gif b/main/manual/images/images/gl.gif new file mode 100644 index 00000000..9e615663 Binary files /dev/null and b/main/manual/images/images/gl.gif differ diff --git a/main/manual/images/images/gorge.gif b/main/manual/images/images/gorge.gif new file mode 100644 index 00000000..c81ee06a Binary files /dev/null and b/main/manual/images/images/gorge.gif differ diff --git a/main/manual/images/images/ha.gif b/main/manual/images/images/ha.gif new file mode 100644 index 00000000..633b13dd Binary files /dev/null and b/main/manual/images/images/ha.gif differ diff --git a/main/manual/images/images/hive.gif b/main/manual/images/images/hive.gif new file mode 100644 index 00000000..5f509698 Binary files /dev/null and b/main/manual/images/images/hive.gif differ diff --git a/main/manual/images/images/hmg.gif b/main/manual/images/images/hmg.gif new file mode 100644 index 00000000..e8ead8c7 Binary files /dev/null and b/main/manual/images/images/hmg.gif differ diff --git a/main/manual/images/images/hud_ammo.gif b/main/manual/images/images/hud_ammo.gif new file mode 100644 index 00000000..a84d8957 Binary files /dev/null and b/main/manual/images/images/hud_ammo.gif differ diff --git a/main/manual/images/images/hud_armor.gif b/main/manual/images/images/hud_armor.gif new file mode 100644 index 00000000..c0cb8c9c Binary files /dev/null and b/main/manual/images/images/hud_armor.gif differ diff --git a/main/manual/images/images/hud_health.gif b/main/manual/images/images/hud_health.gif new file mode 100644 index 00000000..64e45571 Binary files /dev/null and b/main/manual/images/images/hud_health.gif differ diff --git a/main/manual/images/images/inf portal.gif b/main/manual/images/images/inf portal.gif new file mode 100644 index 00000000..80ee7b44 Binary files /dev/null and b/main/manual/images/images/inf portal.gif differ diff --git a/main/manual/images/images/jetpack.gif b/main/manual/images/images/jetpack.gif new file mode 100644 index 00000000..cb22022c Binary files /dev/null and b/main/manual/images/images/jetpack.gif differ diff --git a/main/manual/images/images/knife.gif b/main/manual/images/images/knife.gif new file mode 100644 index 00000000..c626d3cd Binary files /dev/null and b/main/manual/images/images/knife.gif differ diff --git a/main/manual/images/images/lerk.gif b/main/manual/images/images/lerk.gif new file mode 100644 index 00000000..32a54185 Binary files /dev/null and b/main/manual/images/images/lerk.gif differ diff --git a/main/manual/images/images/level1.gif b/main/manual/images/images/level1.gif new file mode 100644 index 00000000..afd631b3 Binary files /dev/null and b/main/manual/images/images/level1.gif differ diff --git a/main/manual/images/images/level2.gif b/main/manual/images/images/level2.gif new file mode 100644 index 00000000..dcc8f704 Binary files /dev/null and b/main/manual/images/images/level2.gif differ diff --git a/main/manual/images/images/level3.gif b/main/manual/images/images/level3.gif new file mode 100644 index 00000000..b0b6f434 Binary files /dev/null and b/main/manual/images/images/level3.gif differ diff --git a/main/manual/images/images/level4.gif b/main/manual/images/images/level4.gif new file mode 100644 index 00000000..ed3460f7 Binary files /dev/null and b/main/manual/images/images/level4.gif differ diff --git a/main/manual/images/images/level5.gif b/main/manual/images/images/level5.gif new file mode 100644 index 00000000..fe5a4d7c Binary files /dev/null and b/main/manual/images/images/level5.gif differ diff --git a/main/manual/images/images/lmg.gif b/main/manual/images/images/lmg.gif new file mode 100644 index 00000000..7a4988dd Binary files /dev/null and b/main/manual/images/images/lmg.gif differ diff --git a/main/manual/images/images/marine.gif b/main/manual/images/images/marine.gif new file mode 100644 index 00000000..c8373b51 Binary files /dev/null and b/main/manual/images/images/marine.gif differ diff --git a/main/manual/images/images/marine_s.gif b/main/manual/images/images/marine_s.gif new file mode 100644 index 00000000..12f12ea4 Binary files /dev/null and b/main/manual/images/images/marine_s.gif differ diff --git a/main/manual/images/images/mine.gif b/main/manual/images/images/mine.gif new file mode 100644 index 00000000..180b8818 Binary files /dev/null and b/main/manual/images/images/mine.gif differ diff --git a/main/manual/images/images/minimap.gif b/main/manual/images/images/minimap.gif new file mode 100644 index 00000000..29433bdb Binary files /dev/null and b/main/manual/images/images/minimap.gif differ diff --git a/main/manual/images/images/motionsensor.gif b/main/manual/images/images/motionsensor.gif new file mode 100644 index 00000000..7acca77c Binary files /dev/null and b/main/manual/images/images/motionsensor.gif differ diff --git a/main/manual/images/images/nanotech.gif b/main/manual/images/images/nanotech.gif new file mode 100644 index 00000000..dcde6466 Binary files /dev/null and b/main/manual/images/images/nanotech.gif differ diff --git a/main/manual/images/images/nanotech_s.gif b/main/manual/images/images/nanotech_s.gif new file mode 100644 index 00000000..bdbfed9f Binary files /dev/null and b/main/manual/images/images/nanotech_s.gif differ diff --git a/main/manual/images/images/observatory.gif b/main/manual/images/images/observatory.gif new file mode 100644 index 00000000..60f88402 Binary files /dev/null and b/main/manual/images/images/observatory.gif differ diff --git a/main/manual/images/images/onos.gif b/main/manual/images/images/onos.gif new file mode 100644 index 00000000..56694677 Binary files /dev/null and b/main/manual/images/images/onos.gif differ diff --git a/main/manual/images/images/phase gate.gif b/main/manual/images/images/phase gate.gif new file mode 100644 index 00000000..c344abda Binary files /dev/null and b/main/manual/images/images/phase gate.gif differ diff --git a/main/manual/images/images/pics_cc.gif b/main/manual/images/images/pics_cc.gif new file mode 100644 index 00000000..3dfb5fb8 Binary files /dev/null and b/main/manual/images/images/pics_cc.gif differ diff --git a/main/manual/images/images/pistol.gif b/main/manual/images/images/pistol.gif new file mode 100644 index 00000000..70df0cfb Binary files /dev/null and b/main/manual/images/images/pistol.gif differ diff --git a/main/manual/images/images/prototype lab.gif b/main/manual/images/images/prototype lab.gif new file mode 100644 index 00000000..7588d598 Binary files /dev/null and b/main/manual/images/images/prototype lab.gif differ diff --git a/main/manual/images/images/reading.gif b/main/manual/images/images/reading.gif new file mode 100644 index 00000000..64fc2434 Binary files /dev/null and b/main/manual/images/images/reading.gif differ diff --git a/main/manual/images/images/resource tower.gif b/main/manual/images/images/resource tower.gif new file mode 100644 index 00000000..83767693 Binary files /dev/null and b/main/manual/images/images/resource tower.gif differ diff --git a/main/manual/images/images/resourcecollector.gif b/main/manual/images/images/resourcecollector.gif new file mode 100644 index 00000000..fea88043 Binary files /dev/null and b/main/manual/images/images/resourcecollector.gif differ diff --git a/main/manual/images/images/resourcenode.gif b/main/manual/images/images/resourcenode.gif new file mode 100644 index 00000000..a62dbbcb Binary files /dev/null and b/main/manual/images/images/resourcenode.gif differ diff --git a/main/manual/images/images/resources.gif b/main/manual/images/images/resources.gif new file mode 100644 index 00000000..8547f991 Binary files /dev/null and b/main/manual/images/images/resources.gif differ diff --git a/main/manual/images/images/resources_s.gif b/main/manual/images/images/resources_s.gif new file mode 100644 index 00000000..bed6d8c1 Binary files /dev/null and b/main/manual/images/images/resources_s.gif differ diff --git a/main/manual/images/images/sentry gun.gif b/main/manual/images/images/sentry gun.gif new file mode 100644 index 00000000..cb0cb184 Binary files /dev/null and b/main/manual/images/images/sentry gun.gif differ diff --git a/main/manual/images/images/shotgun.gif b/main/manual/images/images/shotgun.gif new file mode 100644 index 00000000..45ed1cf3 Binary files /dev/null and b/main/manual/images/images/shotgun.gif differ diff --git a/main/manual/images/images/siege turret.gif b/main/manual/images/images/siege turret.gif new file mode 100644 index 00000000..44ed36c2 Binary files /dev/null and b/main/manual/images/images/siege turret.gif differ diff --git a/main/manual/images/images/siege.gif b/main/manual/images/images/siege.gif new file mode 100644 index 00000000..1f4da226 Binary files /dev/null and b/main/manual/images/images/siege.gif differ diff --git a/main/manual/images/images/skulk.gif b/main/manual/images/images/skulk.gif new file mode 100644 index 00000000..083452fc Binary files /dev/null and b/main/manual/images/images/skulk.gif differ diff --git a/main/manual/images/images/speciesupgrades.gif b/main/manual/images/images/speciesupgrades.gif new file mode 100644 index 00000000..06064325 Binary files /dev/null and b/main/manual/images/images/speciesupgrades.gif differ diff --git a/main/manual/images/images/splitter.gif b/main/manual/images/images/splitter.gif new file mode 100644 index 00000000..75b35825 Binary files /dev/null and b/main/manual/images/images/splitter.gif differ diff --git a/main/manual/images/images/structures.gif b/main/manual/images/images/structures.gif new file mode 100644 index 00000000..265ad5c4 Binary files /dev/null and b/main/manual/images/images/structures.gif differ diff --git a/main/manual/images/images/structures_s.gif b/main/manual/images/images/structures_s.gif new file mode 100644 index 00000000..3ca35b97 Binary files /dev/null and b/main/manual/images/images/structures_s.gif differ diff --git a/main/manual/images/images/techtree.gif b/main/manual/images/images/techtree.gif new file mode 100644 index 00000000..3a8b5e9a Binary files /dev/null and b/main/manual/images/images/techtree.gif differ diff --git a/main/manual/images/images/transparent.gif b/main/manual/images/images/transparent.gif new file mode 100644 index 00000000..f4a2493a Binary files /dev/null and b/main/manual/images/images/transparent.gif differ diff --git a/main/manual/images/images/tsa_motto.gif b/main/manual/images/images/tsa_motto.gif new file mode 100644 index 00000000..b21de5b1 Binary files /dev/null and b/main/manual/images/images/tsa_motto.gif differ diff --git a/main/manual/images/images/tsalogo.gif b/main/manual/images/images/tsalogo.gif new file mode 100644 index 00000000..1ae89004 Binary files /dev/null and b/main/manual/images/images/tsalogo.gif differ diff --git a/main/manual/images/images/turret factory.gif b/main/manual/images/images/turret factory.gif new file mode 100644 index 00000000..7d0f49f7 Binary files /dev/null and b/main/manual/images/images/turret factory.gif differ diff --git a/main/manual/images/images/turret.gif b/main/manual/images/images/turret.gif new file mode 100644 index 00000000..e192020a Binary files /dev/null and b/main/manual/images/images/turret.gif differ diff --git a/main/manual/images/images/upgrades.gif b/main/manual/images/images/upgrades.gif new file mode 100644 index 00000000..739e0f59 Binary files /dev/null and b/main/manual/images/images/upgrades.gif differ diff --git a/main/manual/images/images/upgrades_s.gif b/main/manual/images/images/upgrades_s.gif new file mode 100644 index 00000000..3012edb8 Binary files /dev/null and b/main/manual/images/images/upgrades_s.gif differ diff --git a/main/manual/images/images/victory.gif b/main/manual/images/images/victory.gif new file mode 100644 index 00000000..9d4827a9 Binary files /dev/null and b/main/manual/images/images/victory.gif differ diff --git a/main/manual/images/images/victory_aliens.gif b/main/manual/images/images/victory_aliens.gif new file mode 100644 index 00000000..c9d967bb Binary files /dev/null and b/main/manual/images/images/victory_aliens.gif differ diff --git a/main/manual/images/images/victory_pose.gif b/main/manual/images/images/victory_pose.gif new file mode 100644 index 00000000..0798a569 Binary files /dev/null and b/main/manual/images/images/victory_pose.gif differ diff --git a/main/manual/images/images/victory_s.gif b/main/manual/images/images/victory_s.gif new file mode 100644 index 00000000..11d3799b Binary files /dev/null and b/main/manual/images/images/victory_s.gif differ diff --git a/main/manual/images/images/weapons lab.gif b/main/manual/images/images/weapons lab.gif new file mode 100644 index 00000000..6ef9db09 Binary files /dev/null and b/main/manual/images/images/weapons lab.gif differ diff --git a/main/manual/images/images/welder.gif b/main/manual/images/images/welder.gif new file mode 100644 index 00000000..841eee98 Binary files /dev/null and b/main/manual/images/images/welder.gif differ diff --git a/main/manual/images/tech/ammopack.gif b/main/manual/images/tech/ammopack.gif new file mode 100644 index 00000000..273f22d6 Binary files /dev/null and b/main/manual/images/tech/ammopack.gif differ diff --git a/main/manual/images/tech/armor1.gif b/main/manual/images/tech/armor1.gif new file mode 100644 index 00000000..879ad0a7 Binary files /dev/null and b/main/manual/images/tech/armor1.gif differ diff --git a/main/manual/images/tech/armor1s.gif b/main/manual/images/tech/armor1s.gif new file mode 100644 index 00000000..df53eb07 Binary files /dev/null and b/main/manual/images/tech/armor1s.gif differ diff --git a/main/manual/images/tech/armor2.gif b/main/manual/images/tech/armor2.gif new file mode 100644 index 00000000..eacc586f Binary files /dev/null and b/main/manual/images/tech/armor2.gif differ diff --git a/main/manual/images/tech/armor3.gif b/main/manual/images/tech/armor3.gif new file mode 100644 index 00000000..9568b0a1 Binary files /dev/null and b/main/manual/images/tech/armor3.gif differ diff --git a/main/manual/images/tech/armory.gif b/main/manual/images/tech/armory.gif new file mode 100644 index 00000000..acae0999 Binary files /dev/null and b/main/manual/images/tech/armory.gif differ diff --git a/main/manual/images/tech/armory_adv.gif b/main/manual/images/tech/armory_adv.gif new file mode 100644 index 00000000..d279e8e8 Binary files /dev/null and b/main/manual/images/tech/armory_adv.gif differ diff --git a/main/manual/images/tech/armslab.gif b/main/manual/images/tech/armslab.gif new file mode 100644 index 00000000..758c4843 Binary files /dev/null and b/main/manual/images/tech/armslab.gif differ diff --git a/main/manual/images/tech/asc.gif b/main/manual/images/tech/asc.gif new file mode 100644 index 00000000..f4a9d064 Binary files /dev/null and b/main/manual/images/tech/asc.gif differ diff --git a/main/manual/images/tech/comcenter.gif b/main/manual/images/tech/comcenter.gif new file mode 100644 index 00000000..273610a5 Binary files /dev/null and b/main/manual/images/tech/comcenter.gif differ diff --git a/main/manual/images/tech/exoskel.gif b/main/manual/images/tech/exoskel.gif new file mode 100644 index 00000000..588f9210 Binary files /dev/null and b/main/manual/images/tech/exoskel.gif differ diff --git a/main/manual/images/tech/grenadel.gif b/main/manual/images/tech/grenadel.gif new file mode 100644 index 00000000..d8cb98e7 Binary files /dev/null and b/main/manual/images/tech/grenadel.gif differ diff --git a/main/manual/images/tech/healthpack.gif b/main/manual/images/tech/healthpack.gif new file mode 100644 index 00000000..e9d1a4f1 Binary files /dev/null and b/main/manual/images/tech/healthpack.gif differ diff --git a/main/manual/images/tech/heavya.gif b/main/manual/images/tech/heavya.gif new file mode 100644 index 00000000..7176eba3 Binary files /dev/null and b/main/manual/images/tech/heavya.gif differ diff --git a/main/manual/images/tech/hmg.gif b/main/manual/images/tech/hmg.gif new file mode 100644 index 00000000..20e735df Binary files /dev/null and b/main/manual/images/tech/hmg.gif differ diff --git a/main/manual/images/tech/inf_portal.gif b/main/manual/images/tech/inf_portal.gif new file mode 100644 index 00000000..43d43e4f Binary files /dev/null and b/main/manual/images/tech/inf_portal.gif differ diff --git a/main/manual/images/tech/jetpacks.gif b/main/manual/images/tech/jetpacks.gif new file mode 100644 index 00000000..6cf75b4b Binary files /dev/null and b/main/manual/images/tech/jetpacks.gif differ diff --git a/main/manual/images/tech/jetpacks2.gif b/main/manual/images/tech/jetpacks2.gif new file mode 100644 index 00000000..ee50ccaf Binary files /dev/null and b/main/manual/images/tech/jetpacks2.gif differ diff --git a/main/manual/images/tech/knife.gif b/main/manual/images/tech/knife.gif new file mode 100644 index 00000000..926c239e Binary files /dev/null and b/main/manual/images/tech/knife.gif differ diff --git a/main/manual/images/tech/lightspeed.gif b/main/manual/images/tech/lightspeed.gif new file mode 100644 index 00000000..ab825f31 Binary files /dev/null and b/main/manual/images/tech/lightspeed.gif differ diff --git a/main/manual/images/tech/lmg.gif b/main/manual/images/tech/lmg.gif new file mode 100644 index 00000000..59abefa7 Binary files /dev/null and b/main/manual/images/tech/lmg.gif differ diff --git a/main/manual/images/tech/mines.gif b/main/manual/images/tech/mines.gif new file mode 100644 index 00000000..bc6f38f5 Binary files /dev/null and b/main/manual/images/tech/mines.gif differ diff --git a/main/manual/images/tech/motiont.gif b/main/manual/images/tech/motiont.gif new file mode 100644 index 00000000..96c890c9 Binary files /dev/null and b/main/manual/images/tech/motiont.gif differ diff --git a/main/manual/images/tech/observ.gif b/main/manual/images/tech/observ.gif new file mode 100644 index 00000000..c062426f Binary files /dev/null and b/main/manual/images/tech/observ.gif differ diff --git a/main/manual/images/tech/phase.gif b/main/manual/images/tech/phase.gif new file mode 100644 index 00000000..8b0d99b9 Binary files /dev/null and b/main/manual/images/tech/phase.gif differ diff --git a/main/manual/images/tech/pistol.gif b/main/manual/images/tech/pistol.gif new file mode 100644 index 00000000..7d7a578f Binary files /dev/null and b/main/manual/images/tech/pistol.gif differ diff --git a/main/manual/images/tech/protolab.gif b/main/manual/images/tech/protolab.gif new file mode 100644 index 00000000..38fa284e Binary files /dev/null and b/main/manual/images/tech/protolab.gif differ diff --git a/main/manual/images/tech/recycle.gif b/main/manual/images/tech/recycle.gif new file mode 100644 index 00000000..36e4e9d2 Binary files /dev/null and b/main/manual/images/tech/recycle.gif differ diff --git a/main/manual/images/tech/restower.gif b/main/manual/images/tech/restower.gif new file mode 100644 index 00000000..bd6fe1fa Binary files /dev/null and b/main/manual/images/tech/restower.gif differ diff --git a/main/manual/images/tech/scan.gif b/main/manual/images/tech/scan.gif new file mode 100644 index 00000000..9a95065c Binary files /dev/null and b/main/manual/images/tech/scan.gif differ diff --git a/main/manual/images/tech/shotgun.gif b/main/manual/images/tech/shotgun.gif new file mode 100644 index 00000000..f85c5102 Binary files /dev/null and b/main/manual/images/tech/shotgun.gif differ diff --git a/main/manual/images/tech/siege.gif b/main/manual/images/tech/siege.gif new file mode 100644 index 00000000..90b122ba Binary files /dev/null and b/main/manual/images/tech/siege.gif differ diff --git a/main/manual/images/tech/tfact.gif b/main/manual/images/tech/tfact.gif new file mode 100644 index 00000000..cf0d3793 Binary files /dev/null and b/main/manual/images/tech/tfact.gif differ diff --git a/main/manual/images/tech/turret.gif b/main/manual/images/tech/turret.gif new file mode 100644 index 00000000..1c90dbf5 Binary files /dev/null and b/main/manual/images/tech/turret.gif differ diff --git a/main/manual/images/tech/weapon1.gif b/main/manual/images/tech/weapon1.gif new file mode 100644 index 00000000..ff0888c9 Binary files /dev/null and b/main/manual/images/tech/weapon1.gif differ diff --git a/main/manual/images/tech/weapon2.gif b/main/manual/images/tech/weapon2.gif new file mode 100644 index 00000000..062db385 Binary files /dev/null and b/main/manual/images/tech/weapon2.gif differ diff --git a/main/manual/images/tech/weapon3.gif b/main/manual/images/tech/weapon3.gif new file mode 100644 index 00000000..9646fad6 Binary files /dev/null and b/main/manual/images/tech/weapon3.gif differ diff --git a/main/manual/images/tech/welder.gif b/main/manual/images/tech/welder.gif new file mode 100644 index 00000000..b9e64944 Binary files /dev/null and b/main/manual/images/tech/welder.gif differ diff --git a/main/manual/images/tech_10/abilities1.gif b/main/manual/images/tech_10/abilities1.gif new file mode 100644 index 00000000..2f52e229 Binary files /dev/null and b/main/manual/images/tech_10/abilities1.gif differ diff --git a/main/manual/images/tech_10/abilities2.gif b/main/manual/images/tech_10/abilities2.gif new file mode 100644 index 00000000..24ed0fac Binary files /dev/null and b/main/manual/images/tech_10/abilities2.gif differ diff --git a/main/manual/images/tech_10/abilities3.gif b/main/manual/images/tech_10/abilities3.gif new file mode 100644 index 00000000..eb71793b Binary files /dev/null and b/main/manual/images/tech_10/abilities3.gif differ diff --git a/main/manual/images/tech_10/alien_back.gif b/main/manual/images/tech_10/alien_back.gif new file mode 100644 index 00000000..232b3a7a Binary files /dev/null and b/main/manual/images/tech_10/alien_back.gif differ diff --git a/main/manual/images/tech_10/alienattacks.gif b/main/manual/images/tech_10/alienattacks.gif new file mode 100644 index 00000000..cbac5b3f Binary files /dev/null and b/main/manual/images/tech_10/alienattacks.gif differ diff --git a/main/manual/images/tech_10/ammopack.gif b/main/manual/images/tech_10/ammopack.gif new file mode 100644 index 00000000..8cd48355 Binary files /dev/null and b/main/manual/images/tech_10/ammopack.gif differ diff --git a/main/manual/images/tech_10/armor1.gif b/main/manual/images/tech_10/armor1.gif new file mode 100644 index 00000000..2405dcaa Binary files /dev/null and b/main/manual/images/tech_10/armor1.gif differ diff --git a/main/manual/images/tech_10/armor1s.gif b/main/manual/images/tech_10/armor1s.gif new file mode 100644 index 00000000..25c040fa Binary files /dev/null and b/main/manual/images/tech_10/armor1s.gif differ diff --git a/main/manual/images/tech_10/armor2.gif b/main/manual/images/tech_10/armor2.gif new file mode 100644 index 00000000..592881a4 Binary files /dev/null and b/main/manual/images/tech_10/armor2.gif differ diff --git a/main/manual/images/tech_10/armor3.gif b/main/manual/images/tech_10/armor3.gif new file mode 100644 index 00000000..e8bf1af2 Binary files /dev/null and b/main/manual/images/tech_10/armor3.gif differ diff --git a/main/manual/images/tech_10/armory.gif b/main/manual/images/tech_10/armory.gif new file mode 100644 index 00000000..4de0aad2 Binary files /dev/null and b/main/manual/images/tech_10/armory.gif differ diff --git a/main/manual/images/tech_10/armory_adv.gif b/main/manual/images/tech_10/armory_adv.gif new file mode 100644 index 00000000..89b4b1b6 Binary files /dev/null and b/main/manual/images/tech_10/armory_adv.gif differ diff --git a/main/manual/images/tech_10/armslab.gif b/main/manual/images/tech_10/armslab.gif new file mode 100644 index 00000000..494d090e Binary files /dev/null and b/main/manual/images/tech_10/armslab.gif differ diff --git a/main/manual/images/tech_10/arrow.gif b/main/manual/images/tech_10/arrow.gif new file mode 100644 index 00000000..5d9f8278 Binary files /dev/null and b/main/manual/images/tech_10/arrow.gif differ diff --git a/main/manual/images/tech_10/asc.gif b/main/manual/images/tech_10/asc.gif new file mode 100644 index 00000000..24180961 Binary files /dev/null and b/main/manual/images/tech_10/asc.gif differ diff --git a/main/manual/images/tech_10/bactgridlock.gif b/main/manual/images/tech_10/bactgridlock.gif new file mode 100644 index 00000000..eb5664e3 Binary files /dev/null and b/main/manual/images/tech_10/bactgridlock.gif differ diff --git a/main/manual/images/tech_10/changingspecies.gif b/main/manual/images/tech_10/changingspecies.gif new file mode 100644 index 00000000..a2aad797 Binary files /dev/null and b/main/manual/images/tech_10/changingspecies.gif differ diff --git a/main/manual/images/tech_10/comcenter.gif b/main/manual/images/tech_10/comcenter.gif new file mode 100644 index 00000000..817e69a5 Binary files /dev/null and b/main/manual/images/tech_10/comcenter.gif differ diff --git a/main/manual/images/tech_10/communicating.gif b/main/manual/images/tech_10/communicating.gif new file mode 100644 index 00000000..1a7d7ca8 Binary files /dev/null and b/main/manual/images/tech_10/communicating.gif differ diff --git a/main/manual/images/tech_10/defence.gif b/main/manual/images/tech_10/defence.gif new file mode 100644 index 00000000..0508fc88 Binary files /dev/null and b/main/manual/images/tech_10/defence.gif differ diff --git a/main/manual/images/tech_10/equipment.gif b/main/manual/images/tech_10/equipment.gif new file mode 100644 index 00000000..e91b31d2 Binary files /dev/null and b/main/manual/images/tech_10/equipment.gif differ diff --git a/main/manual/images/tech_10/evolutions.gif b/main/manual/images/tech_10/evolutions.gif new file mode 100644 index 00000000..c32f014b Binary files /dev/null and b/main/manual/images/tech_10/evolutions.gif differ diff --git a/main/manual/images/tech_10/exoskel.gif b/main/manual/images/tech_10/exoskel.gif new file mode 100644 index 00000000..b3783c02 Binary files /dev/null and b/main/manual/images/tech_10/exoskel.gif differ diff --git a/main/manual/images/tech_10/friendlyfire.gif b/main/manual/images/tech_10/friendlyfire.gif new file mode 100644 index 00000000..98f5cbe1 Binary files /dev/null and b/main/manual/images/tech_10/friendlyfire.gif differ diff --git a/main/manual/images/tech_10/grenadel.gif b/main/manual/images/tech_10/grenadel.gif new file mode 100644 index 00000000..606fcce6 Binary files /dev/null and b/main/manual/images/tech_10/grenadel.gif differ diff --git a/main/manual/images/tech_10/heal.gif b/main/manual/images/tech_10/heal.gif new file mode 100644 index 00000000..6fa06b2f Binary files /dev/null and b/main/manual/images/tech_10/heal.gif differ diff --git a/main/manual/images/tech_10/healthpack.gif b/main/manual/images/tech_10/healthpack.gif new file mode 100644 index 00000000..e873178a Binary files /dev/null and b/main/manual/images/tech_10/healthpack.gif differ diff --git a/main/manual/images/tech_10/heavya.gif b/main/manual/images/tech_10/heavya.gif new file mode 100644 index 00000000..351e3bcd Binary files /dev/null and b/main/manual/images/tech_10/heavya.gif differ diff --git a/main/manual/images/tech_10/hive.gif b/main/manual/images/tech_10/hive.gif new file mode 100644 index 00000000..cbe96e05 Binary files /dev/null and b/main/manual/images/tech_10/hive.gif differ diff --git a/main/manual/images/tech_10/hiveabilities.gif b/main/manual/images/tech_10/hiveabilities.gif new file mode 100644 index 00000000..65825b9b Binary files /dev/null and b/main/manual/images/tech_10/hiveabilities.gif differ diff --git a/main/manual/images/tech_10/hivesightlink.gif b/main/manual/images/tech_10/hivesightlink.gif new file mode 100644 index 00000000..046f4db0 Binary files /dev/null and b/main/manual/images/tech_10/hivesightlink.gif differ diff --git a/main/manual/images/tech_10/hmg.gif b/main/manual/images/tech_10/hmg.gif new file mode 100644 index 00000000..de606dfe Binary files /dev/null and b/main/manual/images/tech_10/hmg.gif differ diff --git a/main/manual/images/tech_10/hud.gif b/main/manual/images/tech_10/hud.gif new file mode 100644 index 00000000..3289b3cf Binary files /dev/null and b/main/manual/images/tech_10/hud.gif differ diff --git a/main/manual/images/tech_10/inf_portal.gif b/main/manual/images/tech_10/inf_portal.gif new file mode 100644 index 00000000..3465c5ee Binary files /dev/null and b/main/manual/images/tech_10/inf_portal.gif differ diff --git a/main/manual/images/tech_10/jetpacks.gif b/main/manual/images/tech_10/jetpacks.gif new file mode 100644 index 00000000..0a63316f Binary files /dev/null and b/main/manual/images/tech_10/jetpacks.gif differ diff --git a/main/manual/images/tech_10/jetpacks2.gif b/main/manual/images/tech_10/jetpacks2.gif new file mode 100644 index 00000000..25f1df27 Binary files /dev/null and b/main/manual/images/tech_10/jetpacks2.gif differ diff --git a/main/manual/images/tech_10/knife.gif b/main/manual/images/tech_10/knife.gif new file mode 100644 index 00000000..af8187ca Binary files /dev/null and b/main/manual/images/tech_10/knife.gif differ diff --git a/main/manual/images/tech_10/lightspeed.gif b/main/manual/images/tech_10/lightspeed.gif new file mode 100644 index 00000000..19090ba0 Binary files /dev/null and b/main/manual/images/tech_10/lightspeed.gif differ diff --git a/main/manual/images/tech_10/list.gif b/main/manual/images/tech_10/list.gif new file mode 100644 index 00000000..8f708a8d Binary files /dev/null and b/main/manual/images/tech_10/list.gif differ diff --git a/main/manual/images/tech_10/lmg.gif b/main/manual/images/tech_10/lmg.gif new file mode 100644 index 00000000..681d727a Binary files /dev/null and b/main/manual/images/tech_10/lmg.gif differ diff --git a/main/manual/images/tech_10/mines.gif b/main/manual/images/tech_10/mines.gif new file mode 100644 index 00000000..1c14e14f Binary files /dev/null and b/main/manual/images/tech_10/mines.gif differ diff --git a/main/manual/images/tech_10/motiont.gif b/main/manual/images/tech_10/motiont.gif new file mode 100644 index 00000000..c268c71c Binary files /dev/null and b/main/manual/images/tech_10/motiont.gif differ diff --git a/main/manual/images/tech_10/movement.gif b/main/manual/images/tech_10/movement.gif new file mode 100644 index 00000000..8089d549 Binary files /dev/null and b/main/manual/images/tech_10/movement.gif differ diff --git a/main/manual/images/tech_10/nanogridlock.gif b/main/manual/images/tech_10/nanogridlock.gif new file mode 100644 index 00000000..c638474e Binary files /dev/null and b/main/manual/images/tech_10/nanogridlock.gif differ diff --git a/main/manual/images/tech_10/observ.gif b/main/manual/images/tech_10/observ.gif new file mode 100644 index 00000000..f0be086f Binary files /dev/null and b/main/manual/images/tech_10/observ.gif differ diff --git a/main/manual/images/tech_10/observation.gif b/main/manual/images/tech_10/observation.gif new file mode 100644 index 00000000..b001c6e2 Binary files /dev/null and b/main/manual/images/tech_10/observation.gif differ diff --git a/main/manual/images/tech_10/offense.gif b/main/manual/images/tech_10/offense.gif new file mode 100644 index 00000000..df560a2f Binary files /dev/null and b/main/manual/images/tech_10/offense.gif differ diff --git a/main/manual/images/tech_10/phase.gif b/main/manual/images/tech_10/phase.gif new file mode 100644 index 00000000..c4f1fc9e Binary files /dev/null and b/main/manual/images/tech_10/phase.gif differ diff --git a/main/manual/images/tech_10/pistol.gif b/main/manual/images/tech_10/pistol.gif new file mode 100644 index 00000000..433e8b48 Binary files /dev/null and b/main/manual/images/tech_10/pistol.gif differ diff --git a/main/manual/images/tech_10/protolab.gif b/main/manual/images/tech_10/protolab.gif new file mode 100644 index 00000000..41114a81 Binary files /dev/null and b/main/manual/images/tech_10/protolab.gif differ diff --git a/main/manual/images/tech_10/query.gif b/main/manual/images/tech_10/query.gif new file mode 100644 index 00000000..bafd6cfe Binary files /dev/null and b/main/manual/images/tech_10/query.gif differ diff --git a/main/manual/images/tech_10/reclamarray.gif b/main/manual/images/tech_10/reclamarray.gif new file mode 100644 index 00000000..1a6dedd4 Binary files /dev/null and b/main/manual/images/tech_10/reclamarray.gif differ diff --git a/main/manual/images/tech_10/recycle.gif b/main/manual/images/tech_10/recycle.gif new file mode 100644 index 00000000..31bbd602 Binary files /dev/null and b/main/manual/images/tech_10/recycle.gif differ diff --git a/main/manual/images/tech_10/resource.gif b/main/manual/images/tech_10/resource.gif new file mode 100644 index 00000000..dd727054 Binary files /dev/null and b/main/manual/images/tech_10/resource.gif differ diff --git a/main/manual/images/tech_10/restower.gif b/main/manual/images/tech_10/restower.gif new file mode 100644 index 00000000..ca317f18 Binary files /dev/null and b/main/manual/images/tech_10/restower.gif differ diff --git a/main/manual/images/tech_10/scan.gif b/main/manual/images/tech_10/scan.gif new file mode 100644 index 00000000..8fc70221 Binary files /dev/null and b/main/manual/images/tech_10/scan.gif differ diff --git a/main/manual/images/tech_10/sensory.gif b/main/manual/images/tech_10/sensory.gif new file mode 100644 index 00000000..de264d00 Binary files /dev/null and b/main/manual/images/tech_10/sensory.gif differ diff --git a/main/manual/images/tech_10/shotgun.gif b/main/manual/images/tech_10/shotgun.gif new file mode 100644 index 00000000..4c1eed94 Binary files /dev/null and b/main/manual/images/tech_10/shotgun.gif differ diff --git a/main/manual/images/tech_10/siege.gif b/main/manual/images/tech_10/siege.gif new file mode 100644 index 00000000..bcbca92c Binary files /dev/null and b/main/manual/images/tech_10/siege.gif differ diff --git a/main/manual/images/tech_10/sterkman.gif b/main/manual/images/tech_10/sterkman.gif new file mode 100644 index 00000000..506c55ae Binary files /dev/null and b/main/manual/images/tech_10/sterkman.gif differ diff --git a/main/manual/images/tech_10/sterkmanred.gif b/main/manual/images/tech_10/sterkmanred.gif new file mode 100644 index 00000000..6f7ee151 Binary files /dev/null and b/main/manual/images/tech_10/sterkmanred.gif differ diff --git a/main/manual/images/tech_10/tactics.gif b/main/manual/images/tech_10/tactics.gif new file mode 100644 index 00000000..822a6578 Binary files /dev/null and b/main/manual/images/tech_10/tactics.gif differ diff --git a/main/manual/images/tech_10/tfact.gif b/main/manual/images/tech_10/tfact.gif new file mode 100644 index 00000000..fe956e99 Binary files /dev/null and b/main/manual/images/tech_10/tfact.gif differ diff --git a/main/manual/images/tech_10/turret.gif b/main/manual/images/tech_10/turret.gif new file mode 100644 index 00000000..bab3e5cf Binary files /dev/null and b/main/manual/images/tech_10/turret.gif differ diff --git a/main/manual/images/tech_10/weapon1.gif b/main/manual/images/tech_10/weapon1.gif new file mode 100644 index 00000000..49655740 Binary files /dev/null and b/main/manual/images/tech_10/weapon1.gif differ diff --git a/main/manual/images/tech_10/weapon2.gif b/main/manual/images/tech_10/weapon2.gif new file mode 100644 index 00000000..8c926f97 Binary files /dev/null and b/main/manual/images/tech_10/weapon2.gif differ diff --git a/main/manual/images/tech_10/weapon3.gif b/main/manual/images/tech_10/weapon3.gif new file mode 100644 index 00000000..245b89c4 Binary files /dev/null and b/main/manual/images/tech_10/weapon3.gif differ diff --git a/main/manual/images/tech_10/weapons.gif b/main/manual/images/tech_10/weapons.gif new file mode 100644 index 00000000..3b34f896 Binary files /dev/null and b/main/manual/images/tech_10/weapons.gif differ diff --git a/main/manual/images/tech_10/welder.gif b/main/manual/images/tech_10/welder.gif new file mode 100644 index 00000000..f7877279 Binary files /dev/null and b/main/manual/images/tech_10/welder.gif differ diff --git a/main/manual/images/titles/alien.gif b/main/manual/images/titles/alien.gif new file mode 100644 index 00000000..287e634a Binary files /dev/null and b/main/manual/images/titles/alien.gif differ diff --git a/main/manual/images/titles/alien_abilities.gif b/main/manual/images/titles/alien_abilities.gif new file mode 100644 index 00000000..3097593c Binary files /dev/null and b/main/manual/images/titles/alien_abilities.gif differ diff --git a/main/manual/images/titles/alien_adren.gif b/main/manual/images/titles/alien_adren.gif new file mode 100644 index 00000000..749731cb Binary files /dev/null and b/main/manual/images/titles/alien_adren.gif differ diff --git a/main/manual/images/titles/alien_advabilities.gif b/main/manual/images/titles/alien_advabilities.gif new file mode 100644 index 00000000..575d653e Binary files /dev/null and b/main/manual/images/titles/alien_advabilities.gif differ diff --git a/main/manual/images/titles/alien_advhivesight.gif b/main/manual/images/titles/alien_advhivesight.gif new file mode 100644 index 00000000..5688dc15 Binary files /dev/null and b/main/manual/images/titles/alien_advhivesight.gif differ diff --git a/main/manual/images/titles/alien_bacterium.gif b/main/manual/images/titles/alien_bacterium.gif new file mode 100644 index 00000000..5b764012 Binary files /dev/null and b/main/manual/images/titles/alien_bacterium.gif differ diff --git a/main/manual/images/titles/alien_carapace.gif b/main/manual/images/titles/alien_carapace.gif new file mode 100644 index 00000000..f9880b01 Binary files /dev/null and b/main/manual/images/titles/alien_carapace.gif differ diff --git a/main/manual/images/titles/alien_celerity.gif b/main/manual/images/titles/alien_celerity.gif new file mode 100644 index 00000000..ad030ce2 Binary files /dev/null and b/main/manual/images/titles/alien_celerity.gif differ diff --git a/main/manual/images/titles/alien_chamber_d.gif b/main/manual/images/titles/alien_chamber_d.gif new file mode 100644 index 00000000..58236107 Binary files /dev/null and b/main/manual/images/titles/alien_chamber_d.gif differ diff --git a/main/manual/images/titles/alien_chamber_m.gif b/main/manual/images/titles/alien_chamber_m.gif new file mode 100644 index 00000000..abd55448 Binary files /dev/null and b/main/manual/images/titles/alien_chamber_m.gif differ diff --git a/main/manual/images/titles/alien_chamber_o.gif b/main/manual/images/titles/alien_chamber_o.gif new file mode 100644 index 00000000..eb505612 Binary files /dev/null and b/main/manual/images/titles/alien_chamber_o.gif differ diff --git a/main/manual/images/titles/alien_chamber_s.gif b/main/manual/images/titles/alien_chamber_s.gif new file mode 100644 index 00000000..d71b5cc4 Binary files /dev/null and b/main/manual/images/titles/alien_chamber_s.gif differ diff --git a/main/manual/images/titles/alien_chambers.gif b/main/manual/images/titles/alien_chambers.gif new file mode 100644 index 00000000..e963f10f Binary files /dev/null and b/main/manual/images/titles/alien_chambers.gif differ diff --git a/main/manual/images/titles/alien_changingspecies.gif b/main/manual/images/titles/alien_changingspecies.gif new file mode 100644 index 00000000..0b88e031 Binary files /dev/null and b/main/manual/images/titles/alien_changingspecies.gif differ diff --git a/main/manual/images/titles/alien_cloaking.gif b/main/manual/images/titles/alien_cloaking.gif new file mode 100644 index 00000000..fb46373d Binary files /dev/null and b/main/manual/images/titles/alien_cloaking.gif differ diff --git a/main/manual/images/titles/alien_defensive.gif b/main/manual/images/titles/alien_defensive.gif new file mode 100644 index 00000000..5fae4fd1 Binary files /dev/null and b/main/manual/images/titles/alien_defensive.gif differ diff --git a/main/manual/images/titles/alien_evolutions.gif b/main/manual/images/titles/alien_evolutions.gif new file mode 100644 index 00000000..fed04bf3 Binary files /dev/null and b/main/manual/images/titles/alien_evolutions.gif differ diff --git a/main/manual/images/titles/alien_fade.gif b/main/manual/images/titles/alien_fade.gif new file mode 100644 index 00000000..3b1e5f1d Binary files /dev/null and b/main/manual/images/titles/alien_fade.gif differ diff --git a/main/manual/images/titles/alien_gorge.gif b/main/manual/images/titles/alien_gorge.gif new file mode 100644 index 00000000..d647f957 Binary files /dev/null and b/main/manual/images/titles/alien_gorge.gif differ diff --git a/main/manual/images/titles/alien_gridlock.gif b/main/manual/images/titles/alien_gridlock.gif new file mode 100644 index 00000000..fd7c3750 Binary files /dev/null and b/main/manual/images/titles/alien_gridlock.gif differ diff --git a/main/manual/images/titles/alien_healing.gif b/main/manual/images/titles/alien_healing.gif new file mode 100644 index 00000000..ff9f9283 Binary files /dev/null and b/main/manual/images/titles/alien_healing.gif differ diff --git a/main/manual/images/titles/alien_hive.gif b/main/manual/images/titles/alien_hive.gif new file mode 100644 index 00000000..1b6430a0 Binary files /dev/null and b/main/manual/images/titles/alien_hive.gif differ diff --git a/main/manual/images/titles/alien_hivelearned.gif b/main/manual/images/titles/alien_hivelearned.gif new file mode 100644 index 00000000..ad6156c2 Binary files /dev/null and b/main/manual/images/titles/alien_hivelearned.gif differ diff --git a/main/manual/images/titles/alien_hivesight.gif b/main/manual/images/titles/alien_hivesight.gif new file mode 100644 index 00000000..1a75ee0b Binary files /dev/null and b/main/manual/images/titles/alien_hivesight.gif differ diff --git a/main/manual/images/titles/alien_inherentabilities.gif b/main/manual/images/titles/alien_inherentabilities.gif new file mode 100644 index 00000000..f299001e Binary files /dev/null and b/main/manual/images/titles/alien_inherentabilities.gif differ diff --git a/main/manual/images/titles/alien_lerk.gif b/main/manual/images/titles/alien_lerk.gif new file mode 100644 index 00000000..50ee0f61 Binary files /dev/null and b/main/manual/images/titles/alien_lerk.gif differ diff --git a/main/manual/images/titles/alien_movement.gif b/main/manual/images/titles/alien_movement.gif new file mode 100644 index 00000000..fda58f04 Binary files /dev/null and b/main/manual/images/titles/alien_movement.gif differ diff --git a/main/manual/images/titles/alien_name.gif b/main/manual/images/titles/alien_name.gif new file mode 100644 index 00000000..62122772 Binary files /dev/null and b/main/manual/images/titles/alien_name.gif differ diff --git a/main/manual/images/titles/alien_newabilities.gif b/main/manual/images/titles/alien_newabilities.gif new file mode 100644 index 00000000..c2fe2af8 Binary files /dev/null and b/main/manual/images/titles/alien_newabilities.gif differ diff --git a/main/manual/images/titles/alien_newhives.gif b/main/manual/images/titles/alien_newhives.gif new file mode 100644 index 00000000..50739d57 Binary files /dev/null and b/main/manual/images/titles/alien_newhives.gif differ diff --git a/main/manual/images/titles/alien_observation.gif b/main/manual/images/titles/alien_observation.gif new file mode 100644 index 00000000..844d6d9a Binary files /dev/null and b/main/manual/images/titles/alien_observation.gif differ diff --git a/main/manual/images/titles/alien_onos.gif b/main/manual/images/titles/alien_onos.gif new file mode 100644 index 00000000..6056ac78 Binary files /dev/null and b/main/manual/images/titles/alien_onos.gif differ diff --git a/main/manual/images/titles/alien_primaryattacks.gif b/main/manual/images/titles/alien_primaryattacks.gif new file mode 100644 index 00000000..eabafc3e Binary files /dev/null and b/main/manual/images/titles/alien_primaryattacks.gif differ diff --git a/main/manual/images/titles/alien_redemption.gif b/main/manual/images/titles/alien_redemption.gif new file mode 100644 index 00000000..03e12bfe Binary files /dev/null and b/main/manual/images/titles/alien_redemption.gif differ diff --git a/main/manual/images/titles/alien_regen.gif b/main/manual/images/titles/alien_regen.gif new file mode 100644 index 00000000..66996118 Binary files /dev/null and b/main/manual/images/titles/alien_regen.gif differ diff --git a/main/manual/images/titles/alien_rescollectors.gif b/main/manual/images/titles/alien_rescollectors.gif new file mode 100644 index 00000000..94a24dce Binary files /dev/null and b/main/manual/images/titles/alien_rescollectors.gif differ diff --git a/main/manual/images/titles/alien_resources.gif b/main/manual/images/titles/alien_resources.gif new file mode 100644 index 00000000..5946bb7f Binary files /dev/null and b/main/manual/images/titles/alien_resources.gif differ diff --git a/main/manual/images/titles/alien_resourceuse.gif b/main/manual/images/titles/alien_resourceuse.gif new file mode 100644 index 00000000..706508a1 Binary files /dev/null and b/main/manual/images/titles/alien_resourceuse.gif differ diff --git a/main/manual/images/titles/alien_scentof.gif b/main/manual/images/titles/alien_scentof.gif new file mode 100644 index 00000000..5119d9a0 Binary files /dev/null and b/main/manual/images/titles/alien_scentof.gif differ diff --git a/main/manual/images/titles/alien_sensory.gif b/main/manual/images/titles/alien_sensory.gif new file mode 100644 index 00000000..d8ac805a Binary files /dev/null and b/main/manual/images/titles/alien_sensory.gif differ diff --git a/main/manual/images/titles/alien_silence.gif b/main/manual/images/titles/alien_silence.gif new file mode 100644 index 00000000..3a4f0dbb Binary files /dev/null and b/main/manual/images/titles/alien_silence.gif differ diff --git a/main/manual/images/titles/alien_skulk.gif b/main/manual/images/titles/alien_skulk.gif new file mode 100644 index 00000000..29b9b32e Binary files /dev/null and b/main/manual/images/titles/alien_skulk.gif differ diff --git a/main/manual/images/titles/alien_spawning.gif b/main/manual/images/titles/alien_spawning.gif new file mode 100644 index 00000000..abd13fbc Binary files /dev/null and b/main/manual/images/titles/alien_spawning.gif differ diff --git a/main/manual/images/titles/alien_species.gif b/main/manual/images/titles/alien_species.gif new file mode 100644 index 00000000..386c128c Binary files /dev/null and b/main/manual/images/titles/alien_species.gif differ diff --git a/main/manual/images/titles/alien_sterkman.gif b/main/manual/images/titles/alien_sterkman.gif new file mode 100644 index 00000000..6dba7d81 Binary files /dev/null and b/main/manual/images/titles/alien_sterkman.gif differ diff --git a/main/manual/images/titles/alien_victory.gif b/main/manual/images/titles/alien_victory.gif new file mode 100644 index 00000000..30c79cc4 Binary files /dev/null and b/main/manual/images/titles/alien_victory.gif differ diff --git a/main/manual/images/titles/front.gif b/main/manual/images/titles/front.gif new file mode 100644 index 00000000..a882c7a1 Binary files /dev/null and b/main/manual/images/titles/front.gif differ diff --git a/main/manual/images/titles/front_armor.gif b/main/manual/images/titles/front_armor.gif new file mode 100644 index 00000000..0b5526c1 Binary files /dev/null and b/main/manual/images/titles/front_armor.gif differ diff --git a/main/manual/images/titles/front_building.gif b/main/manual/images/titles/front_building.gif new file mode 100644 index 00000000..bf05e9e6 Binary files /dev/null and b/main/manual/images/titles/front_building.gif differ diff --git a/main/manual/images/titles/front_choosing.gif b/main/manual/images/titles/front_choosing.gif new file mode 100644 index 00000000..2c6c3a49 Binary files /dev/null and b/main/manual/images/titles/front_choosing.gif differ diff --git a/main/manual/images/titles/front_commandduties.gif b/main/manual/images/titles/front_commandduties.gif new file mode 100644 index 00000000..16a5d8be Binary files /dev/null and b/main/manual/images/titles/front_commandduties.gif differ diff --git a/main/manual/images/titles/front_commander.gif b/main/manual/images/titles/front_commander.gif new file mode 100644 index 00000000..972ca0b2 Binary files /dev/null and b/main/manual/images/titles/front_commander.gif differ diff --git a/main/manual/images/titles/front_commandhud.gif b/main/manual/images/titles/front_commandhud.gif new file mode 100644 index 00000000..1228f19d Binary files /dev/null and b/main/manual/images/titles/front_commandhud.gif differ diff --git a/main/manual/images/titles/front_commandstrats.gif b/main/manual/images/titles/front_commandstrats.gif new file mode 100644 index 00000000..64dac6e9 Binary files /dev/null and b/main/manual/images/titles/front_commandstrats.gif differ diff --git a/main/manual/images/titles/front_communicating.gif b/main/manual/images/titles/front_communicating.gif new file mode 100644 index 00000000..3f28813c Binary files /dev/null and b/main/manual/images/titles/front_communicating.gif differ diff --git a/main/manual/images/titles/front_droppingequip.gif b/main/manual/images/titles/front_droppingequip.gif new file mode 100644 index 00000000..3231e367 Binary files /dev/null and b/main/manual/images/titles/front_droppingequip.gif differ diff --git a/main/manual/images/titles/front_equipment.gif b/main/manual/images/titles/front_equipment.gif new file mode 100644 index 00000000..aab0a9d3 Binary files /dev/null and b/main/manual/images/titles/front_equipment.gif differ diff --git a/main/manual/images/titles/front_friendlyfire.gif b/main/manual/images/titles/front_friendlyfire.gif new file mode 100644 index 00000000..05b01406 Binary files /dev/null and b/main/manual/images/titles/front_friendlyfire.gif differ diff --git a/main/manual/images/titles/front_gridlock.gif b/main/manual/images/titles/front_gridlock.gif new file mode 100644 index 00000000..3bdecddd Binary files /dev/null and b/main/manual/images/titles/front_gridlock.gif differ diff --git a/main/manual/images/titles/front_marine.gif b/main/manual/images/titles/front_marine.gif new file mode 100644 index 00000000..a743639d Binary files /dev/null and b/main/manual/images/titles/front_marine.gif differ diff --git a/main/manual/images/titles/front_marinehud.gif b/main/manual/images/titles/front_marinehud.gif new file mode 100644 index 00000000..6b6eb158 Binary files /dev/null and b/main/manual/images/titles/front_marinehud.gif differ diff --git a/main/manual/images/titles/front_nano.gif b/main/manual/images/titles/front_nano.gif new file mode 100644 index 00000000..2e35ddfd Binary files /dev/null and b/main/manual/images/titles/front_nano.gif differ diff --git a/main/manual/images/titles/front_phasetech.gif b/main/manual/images/titles/front_phasetech.gif new file mode 100644 index 00000000..6189523c Binary files /dev/null and b/main/manual/images/titles/front_phasetech.gif differ diff --git a/main/manual/images/titles/front_reclamarray.gif b/main/manual/images/titles/front_reclamarray.gif new file mode 100644 index 00000000..580e45d2 Binary files /dev/null and b/main/manual/images/titles/front_reclamarray.gif differ diff --git a/main/manual/images/titles/front_research.gif b/main/manual/images/titles/front_research.gif new file mode 100644 index 00000000..165c0578 Binary files /dev/null and b/main/manual/images/titles/front_research.gif differ diff --git a/main/manual/images/titles/front_resources.gif b/main/manual/images/titles/front_resources.gif new file mode 100644 index 00000000..6bf67e41 Binary files /dev/null and b/main/manual/images/titles/front_resources.gif differ diff --git a/main/manual/images/titles/front_resourcesandequip.gif b/main/manual/images/titles/front_resourcesandequip.gif new file mode 100644 index 00000000..e6964821 Binary files /dev/null and b/main/manual/images/titles/front_resourcesandequip.gif differ diff --git a/main/manual/images/titles/front_sterkman.gif b/main/manual/images/titles/front_sterkman.gif new file mode 100644 index 00000000..0218572e Binary files /dev/null and b/main/manual/images/titles/front_sterkman.gif differ diff --git a/main/manual/images/titles/front_structures.gif b/main/manual/images/titles/front_structures.gif new file mode 100644 index 00000000..d8853cc6 Binary files /dev/null and b/main/manual/images/titles/front_structures.gif differ diff --git a/main/manual/images/titles/front_upgrades.gif b/main/manual/images/titles/front_upgrades.gif new file mode 100644 index 00000000..a0de655c Binary files /dev/null and b/main/manual/images/titles/front_upgrades.gif differ diff --git a/main/manual/images/titles/front_victory.gif b/main/manual/images/titles/front_victory.gif new file mode 100644 index 00000000..e311dfcc Binary files /dev/null and b/main/manual/images/titles/front_victory.gif differ diff --git a/main/manual/images/titles/front_votingoutcom.gif b/main/manual/images/titles/front_votingoutcom.gif new file mode 100644 index 00000000..e9d7bcd6 Binary files /dev/null and b/main/manual/images/titles/front_votingoutcom.gif differ diff --git a/main/manual/images/titles/front_weaponry.gif b/main/manual/images/titles/front_weaponry.gif new file mode 100644 index 00000000..355c8407 Binary files /dev/null and b/main/manual/images/titles/front_weaponry.gif differ diff --git a/main/manual/images/titles/general.gif b/main/manual/images/titles/general.gif new file mode 100644 index 00000000..670b0000 Binary files /dev/null and b/main/manual/images/titles/general.gif differ diff --git a/main/manual/images/titles/general_aliens.gif b/main/manual/images/titles/general_aliens.gif new file mode 100644 index 00000000..b2442e22 Binary files /dev/null and b/main/manual/images/titles/general_aliens.gif differ diff --git a/main/manual/images/titles/general_front.gif b/main/manual/images/titles/general_front.gif new file mode 100644 index 00000000..bae56d5a Binary files /dev/null and b/main/manual/images/titles/general_front.gif differ diff --git a/main/manual/images/titles/general_tsa.gif b/main/manual/images/titles/general_tsa.gif new file mode 100644 index 00000000..5e3a01cc Binary files /dev/null and b/main/manual/images/titles/general_tsa.gif differ diff --git a/main/manual/images/titles/introduction.gif b/main/manual/images/titles/introduction.gif new file mode 100644 index 00000000..51945b21 Binary files /dev/null and b/main/manual/images/titles/introduction.gif differ diff --git a/main/manual/images/titles/weapons_gl.gif b/main/manual/images/titles/weapons_gl.gif new file mode 100644 index 00000000..895f582f Binary files /dev/null and b/main/manual/images/titles/weapons_gl.gif differ diff --git a/main/manual/images/titles/weapons_handgun.gif b/main/manual/images/titles/weapons_handgun.gif new file mode 100644 index 00000000..6694afaf Binary files /dev/null and b/main/manual/images/titles/weapons_handgun.gif differ diff --git a/main/manual/images/titles/weapons_heavya.gif b/main/manual/images/titles/weapons_heavya.gif new file mode 100644 index 00000000..9d718e54 Binary files /dev/null and b/main/manual/images/titles/weapons_heavya.gif differ diff --git a/main/manual/images/titles/weapons_hmg.gif b/main/manual/images/titles/weapons_hmg.gif new file mode 100644 index 00000000..9a12bf82 Binary files /dev/null and b/main/manual/images/titles/weapons_hmg.gif differ diff --git a/main/manual/images/titles/weapons_jetpacks.gif b/main/manual/images/titles/weapons_jetpacks.gif new file mode 100644 index 00000000..477c116c Binary files /dev/null and b/main/manual/images/titles/weapons_jetpacks.gif differ diff --git a/main/manual/images/titles/weapons_knife.gif b/main/manual/images/titles/weapons_knife.gif new file mode 100644 index 00000000..9e48020a Binary files /dev/null and b/main/manual/images/titles/weapons_knife.gif differ diff --git a/main/manual/images/titles/weapons_lmg.gif b/main/manual/images/titles/weapons_lmg.gif new file mode 100644 index 00000000..2ebfa2c6 Binary files /dev/null and b/main/manual/images/titles/weapons_lmg.gif differ diff --git a/main/manual/images/titles/weapons_shotgun.gif b/main/manual/images/titles/weapons_shotgun.gif new file mode 100644 index 00000000..2e832a1a Binary files /dev/null and b/main/manual/images/titles/weapons_shotgun.gif differ diff --git a/main/manual/images/titles/weapons_siege.gif b/main/manual/images/titles/weapons_siege.gif new file mode 100644 index 00000000..9f2e1681 Binary files /dev/null and b/main/manual/images/titles/weapons_siege.gif differ diff --git a/main/manual/images/titles/weapons_tripmines.gif b/main/manual/images/titles/weapons_tripmines.gif new file mode 100644 index 00000000..e73c50c8 Binary files /dev/null and b/main/manual/images/titles/weapons_tripmines.gif differ diff --git a/main/manual/images/titles/weapons_turrets.gif b/main/manual/images/titles/weapons_turrets.gif new file mode 100644 index 00000000..9bab941d Binary files /dev/null and b/main/manual/images/titles/weapons_turrets.gif differ diff --git a/main/manual/images/titles/weapons_welders.gif b/main/manual/images/titles/weapons_welders.gif new file mode 100644 index 00000000..8f1583ca Binary files /dev/null and b/main/manual/images/titles/weapons_welders.gif differ diff --git a/main/manual/index.html b/main/manual/index.html new file mode 100644 index 00000000..89d71f98 --- /dev/null +++ b/main/manual/index.html @@ -0,0 +1,200 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Introduction
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + + + + +
+


+
+

+
+

Greetings Frontiersman! If you're reading + this, you've just received your field uniform + and posting to a TSA training facility. Congratulations! + You have had the courage to take a stand and head + into great danger, at what is possibly the most + crucial point in human history. You are not just + the elite of all the militaries of all the governments + and corporations that exist; you are a rare soul, + who has risen above centuries of prejudice and + violence to find your destiny on the front lines + of freedom and honor, putting duty to mankind + ahead of all else.

+

This document is an overview of Frontiersmen + deployment, weaponry and equipment, and a corresponding + examination of the alien's deployment and armaments. + Every recruit is given a copy – but not every + recruit reads it. Familiarize yourself, and you'll + be ahead of the curve.

+
+

This information is considered Yellow Classified + – it's probably not a secret to anyone with a + spy network, but some bits of this knowledge might + still be unknown – and you can bet the general + public is mostly clueless. So – don't discuss + it outside of TSA walls. Better yet, clear all + TSA related correspondence with the media office.
+

+ + + + +
+ + + + + + + +
+

General + Data

+
+ + + + + +
+
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/introduction.html b/main/manual/introduction.html new file mode 100644 index 00000000..89d71f98 --- /dev/null +++ b/main/manual/introduction.html @@ -0,0 +1,200 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Introduction
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + + + + +
+


+
+

+
+

Greetings Frontiersman! If you're reading + this, you've just received your field uniform + and posting to a TSA training facility. Congratulations! + You have had the courage to take a stand and head + into great danger, at what is possibly the most + crucial point in human history. You are not just + the elite of all the militaries of all the governments + and corporations that exist; you are a rare soul, + who has risen above centuries of prejudice and + violence to find your destiny on the front lines + of freedom and honor, putting duty to mankind + ahead of all else.

+

This document is an overview of Frontiersmen + deployment, weaponry and equipment, and a corresponding + examination of the alien's deployment and armaments. + Every recruit is given a copy – but not every + recruit reads it. Familiarize yourself, and you'll + be ahead of the curve.

+
+

This information is considered Yellow Classified + – it's probably not a secret to anyone with a + spy network, but some bits of this knowledge might + still be unknown – and you can bet the general + public is mostly clueless. So – don't discuss + it outside of TSA walls. Better yet, clear all + TSA related correspondence with the media office.
+

+ + + + +
+ + + + + + + +
+

General + Data

+
+ + + + + +
+
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/items_ammo.html b/main/manual/items_ammo.html new file mode 100644 index 00000000..354aa698 --- /dev/null +++ b/main/manual/items_ammo.html @@ -0,0 +1,202 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: + Command + Duties :: + Equipment: + Ammo
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+
+
+ + + + +
+

Summary: The commander can create weapons, + ammo packs and health packs. Weapons can only + be placed within range of the appropriate structure. + Jet packs and heavy armor are also dropped.

+
+
+ + + + +
+

+ Select the desired equipment from the equipment + menu, and + place the icon over an approved location (see + equipment descriptions).

+
+ + + + +
+ + + + + +
+ Weapons
+ + Jet packs + and Heavy Armor
+ + Scanner Sweeps
+
+ Ammo
+ + Medkits
+ + Distress Beacon +
+
+ + + + +
+ + + + + +
+

Ammo
+ Ammo packs are mini nano-generators, primed to + become one of the five ammo types. Ammo can be + dropped anywhere. When picked up, they interface + with marine armor, and stabilize as ammo for whichever + gun type the marine is using. Ammo can also be + obtained from the armory.

+
+
+
+ + + + +
+
+
+
+
+
 
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/items_distress.html b/main/manual/items_distress.html new file mode 100644 index 00000000..e04a9b4a --- /dev/null +++ b/main/manual/items_distress.html @@ -0,0 +1,209 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + ... :: + Command + Duties :: + Equipment: + Distress Beacon
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+
+
+ + + + +
+

Summary: The commander can create weapons, + ammo packs and health packs. Weapons can only + be placed within range of the appropriate structure. + Jet packs and heavy armor are also dropped.

+
+
+ + + + +
+

+ Select the desired equipment from the equipment + menu, and + place the icon over an approved location (see + equipment descriptions).

+
+ + + + +
+ + + + + +
+ Weapons
+ + Jet packs + and Heavy Armor
+ + Scanner Sweeps
+
+ Ammo
+ + Medkits
+ + Distress Beacon +
+
+ + + + +
+ + + + + +
+

Distress Beacon
+ The observatory + punches through the nano-gridlock, sending an + emergency signal to the neighboring dropship. + The dropship immediately sends reinforcements, + homing in on the signal's location, and spending + large amounts of energy to create temporary "subject + fields" out of the construction nanos in + the ceiling-based command network. The squad immediately + returns to full deployment. The reinforcements + get there every time, but it is incredibly stressful + and dangerous for the dropship's engines (not + to mention the dropship's commander). See phase + technology for more information on phase travel.

+

+
+
+ + + + +
+
+
+
+
+
 
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/items_jetpacksha.html b/main/manual/items_jetpacksha.html new file mode 100644 index 00000000..8dd4d593 --- /dev/null +++ b/main/manual/items_jetpacksha.html @@ -0,0 +1,207 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + ... :: + Command + Duties :: + Equipment: + Jetpacks and Heavy Armor
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+
+
+ + + + +
+

Summary: The commander can create weapons, + ammo packs and health packs. Weapons can only + be placed within range of the appropriate structure. + Jet packs and heavy armor are also dropped.

+
+
+ + + + +
+

+ Select the desired equipment from the equipment + menu, and + place the icon over an approved location (see + equipment descriptions).

+
+ + + + +
+ + + + + +
+ Weapons
+ + Jet packs + and Heavy Armor
+ + Scanner Sweeps
+
+ Ammo
+ + Medkits
+ + Distress Beacon +
+
+ + + + +
+ + + + + +
+

Jet packs and Heavy armor
+ Jet packs and + heavy armor work + like upgrades + (providing enhanced abilities for marines) but + must be purchased and dropped individually for + each marine, like weapons. For this reason they + are listed and explained in the weaponry + section. This equipment can only be dropped with + range of a prototype + lab.

+

+ +
+
+ + + + +
+
+
+
+
+
 
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/items_main.html b/main/manual/items_main.html new file mode 100644 index 00000000..d6527698 --- /dev/null +++ b/main/manual/items_main.html @@ -0,0 +1,192 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: + Command + Duties: Equipment
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+ + + + +
+

Summary: The commander can create weapons, + ammo packs and medkits. Weapons can only be placed + within range of an armory + (or advanced + armory). Jet packs and heavy armor may only + be deployed with range of a prototype + lab. Scanner sweeps and distress beacons are + also, in a way, equipment, and so are listed here.

+
+
+ + + + +
+

+ Select the desired equipment from the equipment + menu, and + place the icon over an approved location (see + equipment descriptions).
+
+ + A commander can induce the local network to produce + an accepted blueprint from its ceiling nodules. + In other words, the commander can drop weapons, + ammo, and medkits from the ceiling, spending resources + to create them. Scanner sweeps and distress beacons + also involve material manipulation of the command + network's ceiling construction nanos, and so are + listed here.

+
+ + + + +
+ + + + + +
+ Weapons
+ + Jet packs + and Heavy Armor
+ + Scanner Sweeps
+
+ Ammo
+ + Medkits
+ + Distress Beacon +
+
+
+ + + + +
+
+
+
+
+
 
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/items_medkit.html b/main/manual/items_medkit.html new file mode 100644 index 00000000..74201e2d --- /dev/null +++ b/main/manual/items_medkit.html @@ -0,0 +1,205 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: + Command + Duties :: + Equipment: + Medkits
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+
+
+ + + + +
+

Summary: The commander can create weapons, + ammo packs and health packs. Weapons can only + be placed within range of the appropriate structure. + Jet packs and heavy armor are also dropped.

+
+
+ + + + +
+

+ Select the desired equipment from the equipment + menu, and + place the icon over an approved location (see + equipment descriptions).

+
+ + + + +
+ + + + + +
+ Weapons
+ + Jet packs + and Heavy Armor
+ + Scanner Sweeps
+
+ Ammo
+ + Medkits
+ + Distress Beacon +
+
+ + + + +
+ + + + + +
+

Health Packs
+ Often referred to as "health packs," + medkits interface with a Frontiersman's armor, + releasing targeted bursts of medical nanites directly + to damaged areas. Medkits can be dropped anywhere. + Medical nanites have not been approved for civil + use, and have been shown to have severe long-term + side effects. Frontiersmen philosophy is that + death is a long-term side effect. Other + risks are just part of the job.

+
+
+
+ + + + +
+
+
+
+
+
 
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/items_scanner.html b/main/manual/items_scanner.html new file mode 100644 index 00000000..f2ab49c8 --- /dev/null +++ b/main/manual/items_scanner.html @@ -0,0 +1,206 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + ... :: + Command + Duties :: + Equipment: + Scanner Sweeps
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+
+
+ + + + +
+

Summary: The commander can create weapons, + ammo packs and health packs. Weapons can only + be placed within range of the appropriate structure. + Jet packs and heavy armor are also dropped.

+
+
+ + + + +
+

+ Select the desired equipment from the equipment + menu, and + place the icon over an approved location (see + equipment descriptions).

+
+ + + + +
+ + + + + +
+ Weapons
+ + Jet packs + and Heavy Armor
+ + Scanner Sweeps
+
+ Ammo
+ + Medkits
+ + Distress Beacon +
+
+ + + + +
+ + + + + +
+

Scanner Sweeps
+ By linking the observatory + to the command + network and dropping a packet of microscopic + nano-sensors, a surging field of energy can be + created at any location of the commander's choosing. + This field lasts for a brief time, and reveals + all Kharaa lifeforms and structures, including + cloaked + aliens. It is especially useful for planning assaults, + or finding the location of active hives.

+

+
+
+ + + + +
+
+
+
+
+
 
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/items_weapons.html b/main/manual/items_weapons.html new file mode 100644 index 00000000..c15b40f7 --- /dev/null +++ b/main/manual/items_weapons.html @@ -0,0 +1,209 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: + Command + Duties :: + Equipment: + Weapons
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+
+
+ + + + +
+

Summary: The commander can create weapons, + ammo packs and health packs. Weapons can only + be placed within range of the appropriate structure. + Jet packs and heavy armor are also dropped.

+
+
+ + + + +
+

+ Select the desired equipment from the equipment + menu, and + place the icon over an approved location (see + equipment descriptions).

+
+ + + + +
+ + + + + +
+ Weapons
+ + Jet packs + and Heavy Armor
+ + Scanner Sweeps
+
+ Ammo
+ + Medkits
+ + Distress Beacon +
+
+ + + + +
+ + + + + +
+

Weapons
+ See the weaponry + section for descriptions. Weapons can only be + dropped within range (appearing as a green field + on the command HUD) of an armory + or advanced + armory. Note that while basic weapons can + be deployed near any armory, advanced weapons + can only be deployed near advanced armories. If + a marine discards a weapon, and it remains on + the ground for more than a few moments (roughly + 30 seconds), the command network activates its + recycling protocol and disassembles it.
+

+
+
+
+ + + + +
+
+
+
+
+
 
+
+
+
+ + + \ No newline at end of file diff --git a/main/manual/notes.html b/main/manual/notes.html new file mode 100644 index 00000000..0e36184d --- /dev/null +++ b/main/manual/notes.html @@ -0,0 +1,160 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Manual + Notes
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
 
+ + + + + +
+

The following TSA personnel + are responsible for the creation of this manual:

+

Jeff Paris – + Writer, Content Developer
+ Mark James – + Design Concept, Layout, Art
+ Daniel Johnson + – Tech Tree Contributed
+ Gareth Eckley + – invaluable Editing, Proofing, and Critique
+ Charlie Cleveland + – Executive Oversight, Field Expert, and Boss. +

+

Any errors or omissions are solely the responsibility + of Jeff Paris.

+

No part of this manual or design (including all + art and content) may be used for any publishing + or professional use without express consent of + the authors.

+

Copyright 2002, Charles G. Cleveland

+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/quick_start_files/ammo.gif b/main/manual/quick_start_files/ammo.gif new file mode 100644 index 00000000..cd59e28e Binary files /dev/null and b/main/manual/quick_start_files/ammo.gif differ diff --git a/main/manual/quick_start_files/armory.gif b/main/manual/quick_start_files/armory.gif new file mode 100644 index 00000000..b2a6e0c5 Binary files /dev/null and b/main/manual/quick_start_files/armory.gif differ diff --git a/main/manual/quick_start_files/arms_lab.gif b/main/manual/quick_start_files/arms_lab.gif new file mode 100644 index 00000000..c0d15b18 Binary files /dev/null and b/main/manual/quick_start_files/arms_lab.gif differ diff --git a/main/manual/quick_start_files/comm_icon.gif b/main/manual/quick_start_files/comm_icon.gif new file mode 100644 index 00000000..55c9d471 Binary files /dev/null and b/main/manual/quick_start_files/comm_icon.gif differ diff --git a/main/manual/quick_start_files/command_console.gif b/main/manual/quick_start_files/command_console.gif new file mode 100644 index 00000000..12046dc1 Binary files /dev/null and b/main/manual/quick_start_files/command_console.gif differ diff --git a/main/manual/quick_start_files/fade.gif b/main/manual/quick_start_files/fade.gif new file mode 100644 index 00000000..e2b15956 Binary files /dev/null and b/main/manual/quick_start_files/fade.gif differ diff --git a/main/manual/quick_start_files/gorge.gif b/main/manual/quick_start_files/gorge.gif new file mode 100644 index 00000000..b090e3ef Binary files /dev/null and b/main/manual/quick_start_files/gorge.gif differ diff --git a/main/manual/quick_start_files/grenade_launcher.gif b/main/manual/quick_start_files/grenade_launcher.gif new file mode 100644 index 00000000..51f11f88 Binary files /dev/null and b/main/manual/quick_start_files/grenade_launcher.gif differ diff --git a/main/manual/quick_start_files/health.gif b/main/manual/quick_start_files/health.gif new file mode 100644 index 00000000..02e3d503 Binary files /dev/null and b/main/manual/quick_start_files/health.gif differ diff --git a/main/manual/quick_start_files/heavy.gif b/main/manual/quick_start_files/heavy.gif new file mode 100644 index 00000000..50052b8c Binary files /dev/null and b/main/manual/quick_start_files/heavy.gif differ diff --git a/main/manual/quick_start_files/hive_icon.gif b/main/manual/quick_start_files/hive_icon.gif new file mode 100644 index 00000000..c8c31373 Binary files /dev/null and b/main/manual/quick_start_files/hive_icon.gif differ diff --git a/main/manual/quick_start_files/hmg.gif b/main/manual/quick_start_files/hmg.gif new file mode 100644 index 00000000..5d94bbf1 Binary files /dev/null and b/main/manual/quick_start_files/hmg.gif differ diff --git a/main/manual/quick_start_files/inf_portal.gif b/main/manual/quick_start_files/inf_portal.gif new file mode 100644 index 00000000..c31a3b1a Binary files /dev/null and b/main/manual/quick_start_files/inf_portal.gif differ diff --git a/main/manual/quick_start_files/jetpack.gif b/main/manual/quick_start_files/jetpack.gif new file mode 100644 index 00000000..9cda8174 Binary files /dev/null and b/main/manual/quick_start_files/jetpack.gif differ diff --git a/main/manual/quick_start_files/join_aliens_sign.gif b/main/manual/quick_start_files/join_aliens_sign.gif new file mode 100644 index 00000000..e4e1154a Binary files /dev/null and b/main/manual/quick_start_files/join_aliens_sign.gif differ diff --git a/main/manual/quick_start_files/join_marines_sign.gif b/main/manual/quick_start_files/join_marines_sign.gif new file mode 100644 index 00000000..bbdfcf1e Binary files /dev/null and b/main/manual/quick_start_files/join_marines_sign.gif differ diff --git a/main/manual/quick_start_files/knife.gif b/main/manual/quick_start_files/knife.gif new file mode 100644 index 00000000..1bbf03a9 Binary files /dev/null and b/main/manual/quick_start_files/knife.gif differ diff --git a/main/manual/quick_start_files/lerk.gif b/main/manual/quick_start_files/lerk.gif new file mode 100644 index 00000000..e62cb903 Binary files /dev/null and b/main/manual/quick_start_files/lerk.gif differ diff --git a/main/manual/quick_start_files/lmg.gif b/main/manual/quick_start_files/lmg.gif new file mode 100644 index 00000000..fcd48dd4 Binary files /dev/null and b/main/manual/quick_start_files/lmg.gif differ diff --git a/main/manual/quick_start_files/mine.gif b/main/manual/quick_start_files/mine.gif new file mode 100644 index 00000000..49f7cade Binary files /dev/null and b/main/manual/quick_start_files/mine.gif differ diff --git a/main/manual/quick_start_files/observatory.gif b/main/manual/quick_start_files/observatory.gif new file mode 100644 index 00000000..3492c12a Binary files /dev/null and b/main/manual/quick_start_files/observatory.gif differ diff --git a/main/manual/quick_start_files/onos.gif b/main/manual/quick_start_files/onos.gif new file mode 100644 index 00000000..0fa35adc Binary files /dev/null and b/main/manual/quick_start_files/onos.gif differ diff --git a/main/manual/quick_start_files/phase_gate.gif b/main/manual/quick_start_files/phase_gate.gif new file mode 100644 index 00000000..5e8a035f Binary files /dev/null and b/main/manual/quick_start_files/phase_gate.gif differ diff --git a/main/manual/quick_start_files/pistol.gif b/main/manual/quick_start_files/pistol.gif new file mode 100644 index 00000000..30dc08b7 Binary files /dev/null and b/main/manual/quick_start_files/pistol.gif differ diff --git a/main/manual/quick_start_files/placeholder.gif b/main/manual/quick_start_files/placeholder.gif new file mode 100644 index 00000000..29c4276d Binary files /dev/null and b/main/manual/quick_start_files/placeholder.gif differ diff --git a/main/manual/quick_start_files/proto_lab.gif b/main/manual/quick_start_files/proto_lab.gif new file mode 100644 index 00000000..b3603318 Binary files /dev/null and b/main/manual/quick_start_files/proto_lab.gif differ diff --git a/main/manual/quick_start_files/res_tower.gif b/main/manual/quick_start_files/res_tower.gif new file mode 100644 index 00000000..84b98751 Binary files /dev/null and b/main/manual/quick_start_files/res_tower.gif differ diff --git a/main/manual/quick_start_files/sentry.gif b/main/manual/quick_start_files/sentry.gif new file mode 100644 index 00000000..8c3709de Binary files /dev/null and b/main/manual/quick_start_files/sentry.gif differ diff --git a/main/manual/quick_start_files/shotgun.gif b/main/manual/quick_start_files/shotgun.gif new file mode 100644 index 00000000..7a1ac66c Binary files /dev/null and b/main/manual/quick_start_files/shotgun.gif differ diff --git a/main/manual/quick_start_files/siege.gif b/main/manual/quick_start_files/siege.gif new file mode 100644 index 00000000..27cbe66e Binary files /dev/null and b/main/manual/quick_start_files/siege.gif differ diff --git a/main/manual/quick_start_files/skulk.gif b/main/manual/quick_start_files/skulk.gif new file mode 100644 index 00000000..6855f828 Binary files /dev/null and b/main/manual/quick_start_files/skulk.gif differ diff --git a/main/manual/quick_start_files/turret_factory.gif b/main/manual/quick_start_files/turret_factory.gif new file mode 100644 index 00000000..fff1f98b Binary files /dev/null and b/main/manual/quick_start_files/turret_factory.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_0.gif b/main/manual/quick_start_files/upgrade_icon_0.gif new file mode 100644 index 00000000..0d3850bc Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_0.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_1.gif b/main/manual/quick_start_files/upgrade_icon_1.gif new file mode 100644 index 00000000..17c5ee64 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_1.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_10.gif b/main/manual/quick_start_files/upgrade_icon_10.gif new file mode 100644 index 00000000..be47dcfd Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_10.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_11.gif b/main/manual/quick_start_files/upgrade_icon_11.gif new file mode 100644 index 00000000..d716b1cd Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_11.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_2.gif b/main/manual/quick_start_files/upgrade_icon_2.gif new file mode 100644 index 00000000..400d78b1 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_2.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_6.gif b/main/manual/quick_start_files/upgrade_icon_6.gif new file mode 100644 index 00000000..1478049f Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_6.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_7.gif b/main/manual/quick_start_files/upgrade_icon_7.gif new file mode 100644 index 00000000..f3664494 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_7.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_8.gif b/main/manual/quick_start_files/upgrade_icon_8.gif new file mode 100644 index 00000000..abd89e36 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_8.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_9.gif b/main/manual/quick_start_files/upgrade_icon_9.gif new file mode 100644 index 00000000..e00a4cf4 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_9.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_a.gif b/main/manual/quick_start_files/upgrade_icon_a.gif new file mode 100644 index 00000000..ee99d38e Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_a.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_b.gif b/main/manual/quick_start_files/upgrade_icon_b.gif new file mode 100644 index 00000000..c3af2543 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_b.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_c.gif b/main/manual/quick_start_files/upgrade_icon_c.gif new file mode 100644 index 00000000..400a2c6d Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_c.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_d.gif b/main/manual/quick_start_files/upgrade_icon_d.gif new file mode 100644 index 00000000..3e5cea9b Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_d.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_e_animated.gif b/main/manual/quick_start_files/upgrade_icon_e_animated.gif new file mode 100644 index 00000000..62191cee Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_e_animated.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_f_animated.gif b/main/manual/quick_start_files/upgrade_icon_f_animated.gif new file mode 100644 index 00000000..2a50dbcf Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_f_animated.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_g.gif b/main/manual/quick_start_files/upgrade_icon_g.gif new file mode 100644 index 00000000..4190f510 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_g.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_h.gif b/main/manual/quick_start_files/upgrade_icon_h.gif new file mode 100644 index 00000000..963e81a8 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_h.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_i.gif b/main/manual/quick_start_files/upgrade_icon_i.gif new file mode 100644 index 00000000..3aec080e Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_i.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_j.gif b/main/manual/quick_start_files/upgrade_icon_j.gif new file mode 100644 index 00000000..816216c1 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_j.gif differ diff --git a/main/manual/quick_start_files/upgrade_icon_k.gif b/main/manual/quick_start_files/upgrade_icon_k.gif new file mode 100644 index 00000000..e0257bc3 Binary files /dev/null and b/main/manual/quick_start_files/upgrade_icon_k.gif differ diff --git a/main/manual/quick_start_files/welder.gif b/main/manual/quick_start_files/welder.gif new file mode 100644 index 00000000..3cae4750 Binary files /dev/null and b/main/manual/quick_start_files/welder.gif differ diff --git a/main/manual/structures.html b/main/manual/structures.html new file mode 100644 index 00000000..ff083559 --- /dev/null +++ b/main/manual/structures.html @@ -0,0 +1,245 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: + Commander :: Command + Duties: Structures
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+ + + + +
+ +

Summary: all equipment, resources, and + most marine activities, depend upon structures, + selected and placed by the commander. Placed structures + must be built + by marines.

+
+
+ + + + + + +
+ +

+ Most command networks + were never intended for military use. In order + to "teach" these networks to create + new equipment – like guns, + turrets, + or upgrades + to existing equipment – the commander must first + build the following structures. These structures + work together, allowing more and more powerful + upgrades, weapons, and abilities. To get an overall + picture, see the tech + tree.

+

The following list describes each structure's + function, the equipment it makes available, and + what new structures can be built once it is on + online. If it allows equipment or other structures + to be created within a certain range, these too + are noted.

+
+
+ + + + +
+ + +
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_advarmory.html b/main/manual/structures_advarmory.html new file mode 100644 index 00000000..c0d7e7f7 --- /dev/null +++ b/main/manual/structures_advarmory.html @@ -0,0 +1,231 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Adv Armory
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Advanced Armory
+
+ Function: not a new structure, but instead + a researched upgrade to the existing armory.
+
+ + New Equipment: commander can purchase + heavy machine guns, + and in conjunction with an arms + lab, purchase grenade + launchers. Note: while upgrading to an advanced + armory, the armory will not be able to dispense + ammo to marines.
+

+ + + + + + + + + + + + + + + + +
+

      Advanced + Armory

+
+

+ Cost:

+
+

35 rps

+
+

+ Build time

+
+

120

+
+

+ Armor Pts.

+
+

2400

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_advtfact.html b/main/manual/structures_advtfact.html new file mode 100644 index 00000000..2814df0c --- /dev/null +++ b/main/manual/structures_advtfact.html @@ -0,0 +1,236 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + ... :: Command + Duties :: Structures: + Adv. Turret Factory
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Advanced Turret Factory
+
+ Function: not a new structure, but instead + a research upgrade to the Turret + Factory.
+
+ : + extremely powerful offensive + artillery, siege turrets are a common tactical + response to alien hives + and chambers. + See the siege turret + entry in the weaponry + section for more information.
+
+ + New Equipment: commander can purchase + siege turrets.
+

+ + + + + + + + + + + + + + + + +
+

      Advanced + Turret Factory

+
+

+ Cost:

+
+

25 rps

+
+

+ Build time

+
+

30

+
+

+ Armor Pts.

+
+

3000

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_armory.html b/main/manual/structures_armory.html new file mode 100644 index 00000000..d3c8aaad --- /dev/null +++ b/main/manual/structures_armory.html @@ -0,0 +1,248 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Armory
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Armory
+
+ Function: dispenses "free" + ammo for a marine's active weapon.
+

+

: + operates in a similar + fashion to ammo-packs, + supplying any marine that "uses" it + with ammunition for their active weapon. The + armory also teaches the command network a few + new tricks – namely how to create shotguns, + welders and + mines within + a small radius.
+

+ + New Equipment: + commander can now purchase shotguns, + welders and + mines.
+ + New Structures: + Advanced + Armory. Note: while upgrading to an advanced + armory, the armory will not be able to dispense + ammo to marines.
+ + Range:
weapons must be dropped within + range.
+

+ + + + + + + + + + + + + + + + +
+

      Armory +

+
+

+ Cost:

+
+

25 rps

+
+

+ Build time

+
+

30

+
+

+ Armor Pts.

+
+

2400

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_armslab.html b/main/manual/structures_armslab.html new file mode 100644 index 00000000..f12a104f --- /dev/null +++ b/main/manual/structures_armslab.html @@ -0,0 +1,242 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Arms Lab
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Arms lab
+
+
Function: taps local resources to + allow three levels of weapons and armor upgrades.
+
+
: + The commander may choose to research three levels + of armor upgrades, + and three levels of weaponry upgrades. + Each level researched increases the strength + of marine armor, or firepower. The astute observer + will note that this structure was modified from + an obsolete armory design, hence the word "ammo" + still appearing on its casing.
+

+ + New Equipment: + commander can purchase grenade + launchers, in conjunction with an advanced + armory.
+ + New Structures: + Prototype + Lab.
+

+ + + + + + + + + + + + + + + + +
+

      Arms + Lab

+
+

+ Cost:

+
+

50 rps

+
+

+ Build time

+
+

40

+
+

+ Armor Pts.

+
+

2200

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_cc.html b/main/manual/structures_cc.html new file mode 100644 index 00000000..8c4e14f0 --- /dev/null +++ b/main/manual/structures_cc.html @@ -0,0 +1,247 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + ... :: Command + Duties :: Structures: + Command Console
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Command Console
+
+ Function: allows one marine to connect + to the command network and take the role of + commander.
+
+ + Frontiersmen insertion + points are usually as far away as possible from + possible hive + locations. A command console (often just called + the "CC") is brought on board and + rapidly deployed, flushing the network with + military-grade nanos, and placing it completely + under the commander's control. New command consoles + may be built by the commander (though only one + may be used at a time). This is the most vital + structure to defend. A team without a commander + has very poor survival odds.
+
+ + New Equipment: all equipment requires + a functional command console.
+ + New Structures: all structures require + a functional command console.
+ + Range: infantry + portals must be placed within range of a + command console.
+

+ + + + + + + + + + + + + + + + +
+

      Command + Console

+
+

+ Cost:

+
+

30 rps

+
+

+ Build time

+
+

35

+
+

+ Armor Pts.

+
+

10000

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_infportal.html b/main/manual/structures_infportal.html new file mode 100644 index 00000000..a005433f --- /dev/null +++ b/main/manual/structures_infportal.html @@ -0,0 +1,241 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Infantry Portal
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Infantry Portal
+
+ Function: phases in reinforcements from + the dropship. Without an infantry portal, the + aliens' advantage will grow with every marine + lost. Infantry portals are the most crucial + structure to defend, second only to the command + console.
+
+ : + dropships do not remain + docked with the battlefield, for fear of contamination. + The phase gate on a dropship is large enough + to rapidly send multiple marines across a modest + distance, as long as there are infantry portals + at the other end. The more portals, the faster + reinforcements arrive. See phase + technology for more info.
+
+ + New Structures: + Arms Lab, + Turret Factory, + Armory
+

+ + + + + + + + + + + + + + + + +
+

      Infantry + Portal

+
+

+ Cost:

+
+

15 rps

+
+

+ Build time

+
+

22

+
+

+ Armor Pts.

+
+

2000

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_observatory.html b/main/manual/structures_observatory.html new file mode 100644 index 00000000..97499a19 --- /dev/null +++ b/main/manual/structures_observatory.html @@ -0,0 +1,252 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Observatory
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Observatory
+
+ Function: reveals nearby enemies (even + when cloaked), + allows scanner + sweeps, distress + beacons, and research of motion + tracking.
+

+
: + Responding to the command + blindness caused by nano-gridlock, + the TSA science corps developed the observatory. + Adapted from sensor and surveillance components + used by the TSA fleet to detect minute gravitational + disturbances (like incoming missiles, other + ships in "silent running", or even + movement inside bases or space-facilities), + when the observatory deploys its dish, it can + detect any movement within its range. By researching + sophisticated software and uplink components, + the observatory can be linked directly into + the command network, allowing enhanced functions + like motion tracking and scanner sweeps. The + observatory also provides the crucial spatial + link between phase + gates, ensuring that all matter entering + the potentiality stream finds its way to a waiting + gate. Finally, it can punch through nano-gridlock + and fire off a distress beacon to the dropship, + requesting reinforcements.
+
+ + New Structures: + Phase + gates.
+

+ + + + + + + + + + + + + + + + +
+

      Observatory

+
+

+ Cost:

+
+

25 rps

+
+

+ Build time

+
+

30

+
+

+ Armor Pts.

+
+

1000

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_phasegate.html b/main/manual/structures_phasegate.html new file mode 100644 index 00000000..a711b19e --- /dev/null +++ b/main/manual/structures_phasegate.html @@ -0,0 +1,247 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Phase Gates
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Phase Gates
+
+ Function: instantaneous travel from one + map location to another – very effective for + staging assaults, or linking bases, especially + on the more sprawling battlefields. At this + time, if more than two gates are active, a marine + cannot choose which gate is his destination + (so may have to try more than once to get to + the desired gate). Gates have no way (as of + this manual's writing) of determining friend + from foe – so be aware that a curious Kharaa + may step through one, right into your base. +
+
+ + Until + now, personal phase gates have been too expensive + and unstable for general use. The TSA stunned + the Trans-Govs by revealing they had a working + prototype – a carefully timed information leak, + that had much to do with their winning the Frontiersmen + charter. Since then, it has since seen vigorous + field testing. There are still some kinks to + work out – noted above. But they have become + cheap and reliable enough to enter general use. + Once in place, they make it much easier for + Frontiersmen to control an area and muster troops. + For more information on phase technology, click + here.

+ + + + + + + + + + + + + + + + +
+

      Phase + Gates

+
+

+ Cost:

+
+

20 rps

+
+

+ Build time

+
+

30

+
+

+ Armor Pts.

+
+

3500

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_protolab.html b/main/manual/structures_protolab.html new file mode 100644 index 00000000..f5235e2c --- /dev/null +++ b/main/manual/structures_protolab.html @@ -0,0 +1,249 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Prototype Lab
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + + + +
+ +

+ Most command networks + were never intended for military use. In order + to "teach" these networks to create + new equipment – like guns, + turrets, + or upgrades + to existing equipment – the commander must first + build the following structures. These structures + work together, allowing more and more powerful + upgrades, weapons, and abilities. To get an overall + picture, see the tech + tree.

+

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Prototype Lab
+
+ Function: allows the research and purchase + of advanced, experimental equipment.
+
+
: + Equipment that is cleared + for field testing is programmed into the prototype + lab. As of this manual, prototype equipment + consists of heavy armor and jet pack technology. + This equipment is powerful, and cutting edge. + Whether its cost is justified is a matter of + debate, and left to command + strategy.
+

+ + New Equipment: + commander can purchase and drop heavy + armor and jet + packs.

+ + + + + + + + + + + + + + + + +
+

      Prototype + Lab

+
+

+ Cost:

+
+

45 rps

+
+

+ Build time

+
+

50

+
+

+ Armor Pts.

+
+

2000

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_restower.html b/main/manual/structures_restower.html new file mode 100644 index 00000000..48dc378f --- /dev/null +++ b/main/manual/structures_restower.html @@ -0,0 +1,234 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Resource Tower
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Resource Tower
+
+ Function: allows the commander to tap + a ship or base's raw nano-supplies, by constructing + collection machines over resource nozzles. See + Resources + and Nanotech + for more information.
+

+ + Reserves of nano-sludge (see nanotech) + are stored throughout ships and bases, intended + mainly for use in emergencies or for large repairs. + Resource towers put these reserves to work for + the marines, slowly converting them into a ready-to-use + form, and storing them in the network. Active + resource nozzles are marked by white nano-telltales, + rising like steam into the air.

+ + + + + + + + + + + + + + + + +
+

      Resource + Tower

+
+

+ Cost:

+
+

22 rps

+
+

+ Build time

+
+

50

+
+

+ Armor Pts.

+
+

5000

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_tfact.html b/main/manual/structures_tfact.html new file mode 100644 index 00000000..fb55e300 --- /dev/null +++ b/main/manual/structures_tfact.html @@ -0,0 +1,230 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Turret Factory
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + + +
+

Turret Factory
+
+ Function:
allows turrets + to be built within range.
+
+ + New Equipment: Commander can now + purchase turrets – automated gun emplacements + used for base and perimeter defense (see turrets + for more info.).
+ + New Structures: arms + lab, advanced + turret factory

+ + + + + + + + + + + + + + + + +
+

      Turret + Factory

+
+

+ Cost:

+
+

25 rps

+
+

+ Build time

+
+

40

+
+

+ Armor Pts.

+
+

3000

+
+ +
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/structures_turrets.html b/main/manual/structures_turrets.html new file mode 100644 index 00000000..16486e28 --- /dev/null +++ b/main/manual/structures_turrets.html @@ -0,0 +1,259 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
... + :: + Commander :: Command + Duties :: Structures: + Turrets
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + +
+ + + + +
+

Summary: all equipment, resources, + and most marine activities, depend upon structures, + selected and placed by the commander. Placed + structures must be built by marines.

+
+
+ + + + +
+

+ To get an overall picture, see the tech + tree.

+
+
+ + + + +
+ +
+ + + + +
+ + + + + + +
+


+ Turrets and Siege Turrets
+
+ Though constructed like structures, turrets + and siege turrets + are weapons, and so listed in the weaponry + section.
+

+ + + + + + + + + + + + + + + + +
+

      Sentry + Turret

+
+

+ Cost

+
+

16 rps

+
+

+ Build time

+
+

30

+
+

+ Armor Pts.

+
+

1000

+
+ +
+ + + + + + + + + + + + + + + + +
+

      Siege + Turret

+
+

+ Cost

+
+

25 rps

+
+

+ Build time

+
+

50

+
+

+ Armor Pts.

+
+

2000

+
+
+ + + + +
+

+
+ +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/techtree.html b/main/manual/techtree.html new file mode 100644 index 00000000..fd2cd230 --- /dev/null +++ b/main/manual/techtree.html @@ -0,0 +1,156 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: + Commander :: Command + Duties: Tech + Tree
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + + +
+ + + + +
+
+ + + + +
+
+
+
+ + + + +
+
+ + + Motion Tracking + Distress Beacon + Upgrades + Tripmines + Shotgun + Droppable Items + GL + Heavy machine Gun + Welder + Droppable Items + Scanner Sweep + Command Console + Resource Tower + Infantry Portal + Armory + Observatory + Adv. Armory + + Arms Lab + Sentry Turret + Prototype Lab + Siege Upgrade + + Phase Gate + Upgrades + Droppable Items + + + + \ No newline at end of file diff --git a/main/manual/weapons_grenadelauncher.html b/main/manual/weapons_grenadelauncher.html new file mode 100644 index 00000000..d6df1ddd --- /dev/null +++ b/main/manual/weapons_grenadelauncher.html @@ -0,0 +1,252 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Grenade Launcher
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: compressed + air system launches concussive grenades, + with a timer delay.
+
+
+ Use: + mainly a support weapon, especially effective + against stationary targets, but also has + been put to devious use in cramped quarters + – around corners and into vents. With its + 4 second time delay, the grenade will often + bounce, and even come to rest, before exploding. +
+
+
+ Data: + Frontiersmen have a love/hate relationship + with the "Arc" grenade launcher. + It has been put to spectacular use in heavy + conflicts, especially when assaulting Kharaa + hive rooms. The pneumatic delivery system + is relatively basic – it's the grenades + that are high tech. They can detect the + heat and bacterial signature of a Kharaa + lifeform (including chambers and hives), + and will explode instead of bouncing off. + Otherwise, they explode after 4 seconds. + Though the blast particles are large enough + to incorporate TSA FriendlyFire + technology, the firer is still vulnerable + to these blasts – so the Arc is best placed + in experienced hands.
+

+ + + + + + + + + + + + + + + + +
+

      Arc + (GL)

+
+

+ Damage

+
+

200 at blast point, reduces outwards

+
+

+ Clip

+
+

6

+
+

+ Note

+
+

4 second delay, damages firer

+
+
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_ha.html b/main/manual/weapons_ha.html new file mode 100644 index 00000000..e34c83dc --- /dev/null +++ b/main/manual/weapons_ha.html @@ -0,0 +1,248 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Heavy Armor
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: heavy + armor absorbs 95% of damage, until it is + destroyed.
+
+
+ Use: the + trade-off for increased protection is much + slower speed. Heavy armor wearers must work + strategically with their more vulnerable + (and more nimble) squadmates. Heavy armor + can be repaired with a welder.
+
+
+ Data: + the development of heavy armor has transformed + 23rd century warfare, as militaries race + to perfect and field test this new technology. + A cutting edge, head-to-toe defensive system, + this protective shell can absorb tremendous + amounts of damage. Beneath the plasticene + nano-armor shielding, thousands of independent + layers of defensive nanos spread and share + kinetic energy, using some of an impact's + own force to repair damage. Corrosives don't + have much effect either. Combining armor + upgrades and heavy armor, a single skilled + marine becomes a juggernaut (albeit, a very + slow one). Jet + packs cannot attach to this bulky, full + body armor (and would find its weight difficult + to lift if they could).

+ + + + + + + + + + + + + + +
+

      Heavy + Armor

+
+

 

+
+

Armor + Points

+
+

% + Damage absorbed

+
+

Heavy Armor (un-upgraded)

+
+

200

+
+

95%

+
+
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_hmg.html b/main/manual/weapons_hmg.html new file mode 100644 index 00000000..1b72e1b0 --- /dev/null +++ b/main/manual/weapons_hmg.html @@ -0,0 +1,245 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + HMG
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: double + barrels, double rate of fire with less recoil. + Heavy. Loud. Large clip.
+
+
+ Use: + The best choice when going toe-to-toe with + the larger aliens – and it shreds smaller + aliens quite nicely too. It's heavy though, + and difficult to move with (marines carrying + one move much slower). It also has a complicated + reload procedure – the ammo cartridge + is too large to be discarded and replaced + quickly. Reload strategically.
+
+
+ Data: + reminiscent of Eastern European late 21st + century designs, this gun is usually just + called "Heavy," as in: "He + aint heavy, he's my HMG." Also referred + to as "pom-poms," after the opposing + recoil action of its double barrels. The + Heavy was originally designed in TSA labs + for field use against heavy + armor, or robotic opponents. This is + the most powerful one-man weapon fielded + by the TSA, and possibly by any existing + military. It has proven the only reliable + response to larger alien species like the + Fade or Onos. +
+

+ + + + + + + + + + + + +
+

     Heavy + (HMG)

+
+

+ Damage

+
+

20

+
+

+ Clip

+
+

150

+
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_jetpack.html b/main/manual/weapons_jetpack.html new file mode 100644 index 00000000..1e159ea4 --- /dev/null +++ b/main/manual/weapons_jetpack.html @@ -0,0 +1,212 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Jet Pack
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: back + mounted maneuvering jets, dropped + by the commander.
+
+
+ Use: high + mobility – the marine can ride the column + of propulsion for rapid movement in any + direction.
+
+
+ Data: + Jet Packs are still being refined, but so + far have proven very valuable for evading + enemy attacks, or rapid travel through otherwise + inaccessible areas of the battlefield (ceiling + vents, etc.). The power source is a rechargeable + chemical catalyst battery, that spins the + ram jets and creates two columns of super-heated + air. The battery can recharge with the tiniest + jolt from the command network – a fast + process, but the marine must land to initiate + it. Watch the jetpack energy meter on your + HUD to know when to recharge. Running out + of energy high above the ground is ill-advised. +

+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_knife.html b/main/manual/weapons_knife.html new file mode 100644 index 00000000..6ca78e0f --- /dev/null +++ b/main/manual/weapons_knife.html @@ -0,0 +1,224 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Knife
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: Hyper-alloys + nano-crafted to a perfect edge – slightly + flexible, and nearly unbreakable.
+
+
+ Use: + Last resort weapon. Conserves ammo against + defenseless targets, like chambers.
+
+
+ Data: + Knives have been around for a very long + time. Few weapons have been field tested + as often, or as vigorously. Your standard + issue blade is the most effective size, + shape, and grip we believe exists for the + wide variety of in-field tasks a Frontiersman + may face – including, when necessary, combat. + However, against the Kharaa, this is a very + last resort. Better to retreat than engage + the Kharaa in melee.
+

+ + + + + + + + +
+

      Knife

+
+

+ Damage

+
+

30

+
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_lmg.html b/main/manual/weapons_lmg.html new file mode 100644 index 00000000..27305ea2 --- /dev/null +++ b/main/manual/weapons_lmg.html @@ -0,0 +1,236 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + LMG
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: Full + automatic, lightweight, given to all Frontiersmen.
+
+
+ Use: + Default, starting weapon. Fair damage and + range. Versatile and effective, more so + in groups.
+
+
+ Data: + This utterly reliable weapon is standard + issue for all Frontiersmen. Based on a Czech-Consortium + design, and modified with United Trans-States + parts, the CZU's high rate of fire and near + non-existent recoil represent the peak of + light-weight, multi-use weapons. Against + standard human opponents, the CZU shreds + armor and delivers extreme suppression capabilities. + Against the Kharaa, it allows rapid response + for a squad, especially against fast moving + targets – but should not be used as a solo-mission + weapon against heavier targets. At long + range, its slight spread reduces accuracy.

+ + + + + + + + + + + + +
+

      CZU + (LMG)

+
+

+ Damage

+
+

10

+
+

+ Clip

+
+

50

+
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_main.html b/main/manual/weapons_main.html new file mode 100644 index 00000000..33220d9a --- /dev/null +++ b/main/manual/weapons_main.html @@ -0,0 +1,244 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine: + Weaponry
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + +
 
+ + + + + + +
+

Default armament for a Frontiersman is an LMG, + pistol and knife. + New weapons must be researched and dropped + by the commander. + The following are descriptions of marine armament. + Descriptions give an overview of the weapon. + Use gives an idea of how it is deployed. + And Data provides background and other + secondary details.

+
+ + + + + +
+ + + + + +
+

+ Friendly + Fire

+
+

+ The Sterkman + Point System

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Primary

+
+

Secondary

+
+

Knife

+
+

Other

+
+ Light Machine + Gun
+ +

+
Pistol
+
+
Knife
+ +
Jet + Pack
+ +
Shotgun
+
Welder
+ +
 Turret
+ +
Heavy + Machine Gun
+ +
Trip + Mine
+ +
 Heavy + Armor
+ +
Grenade + Launcher
+ +
  Siege + Turret
+ +
+
+
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_mines.html b/main/manual/weapons_mines.html new file mode 100644 index 00000000..e97cb9b9 --- /dev/null +++ b/main/manual/weapons_mines.html @@ -0,0 +1,258 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Trip Mine
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: multi-purpose + mines, can be placed on vertical surfaces + (laser-tripped) or on the ground (contact-tripped)
+
+
+ Use: + defensive and rear-guard uses, plus booby-traps + in high-use areas. Effective mine placement + can seal off a corridor against all but + the strongest Kharaa. Smaller aliens have + a way of slipping past these, squeezing + along the ceiling or walls – so place them + strategically. Explosions can injure marines, + so standing next to an alien who trips a + mine is dangerous.
+
+
+ Data: + usually just called "trips", mines + are used to supplement defenses, or deter + alien prowlers. If placed on a vertical + surface, the mine attaches with its magnetic + gripping legs, and shoots a laser beam directly + from its center. When this laser is tripped, + the mine explodes. Aliens seem to quickly + learn the purpose of these lasers, and will + attempt to avoid them. More stealthy, but + less of a deterrent, trips can also be placed + on the ground, where they will affix and + arm themselves. This landmine variant will + beep when touched by a friendly marine. + An improperly placed mine (only half gripping + a surface, no room for laser to deploy, + etc.) may explode moments after release, + injuring nearby marines. A mine tripped + by a hostile can also injure nearby marines + with its blast.

+ + + + + + + + + + + + + + + + +
+

      Trip + Mines

+
+

+ Damage

+
+

100 at epicenter, reduces outwards

+
+

+ Clip

+
+

dropped in packs of 5

+
+

+ Note

+
+

also damages friendlies

+
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_pistol.html b/main/manual/weapons_pistol.html new file mode 100644 index 00000000..61bf952d --- /dev/null +++ b/main/manual/weapons_pistol.html @@ -0,0 +1,238 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Pistol
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: military-grade + handgun, state-of-the-art chambering system. + Given to all Frontiersmen.
+
+
+ Use: + Secondary weapon. Burst or precision shots.
+
+
+ Data: + Designed for police work in the China Territories, + and quickly adopted by security and police + forces far and wide, the Cx10 combat pistol + provides impressive killing power in a tiny + package. This is more than a last resort + weapon – the clever Frontiersman will make + use of its perfect accuracy and impressive + range. Its looping kinetic reload means + that it takes the recoil energy from each + shot and uses it to reload and recharge + – so there is barely any kick, and it fires + as fast as you can pull the trigger. While + not recommended as a primary use weapon + against the Kharaa, the Cx10 is well suited + to many combat situations.
+

+ + + + + + + + + + + + +
+

      Cx10 + (pistol)

+
+

+ Damage

+
+

20

+
+

+ Clip

+
+

10

+
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_shotgun.html b/main/manual/weapons_shotgun.html new file mode 100644 index 00000000..067dbad0 --- /dev/null +++ b/main/manual/weapons_shotgun.html @@ -0,0 +1,233 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Shotgun
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: single + barreled, pump action, shell-type ammo. +
+
+
+ Use: + Big damage, short range. Cone of fire helps + take down fast opponents.
+
+
+ Data: + The TSA "Serieux" model shotgun + shoots a cone of accelerated metal fragments. + Up close, it has proven very effective against + the Kharaa. The Serieux was designed by + French covert ops for insurgency missions + as a powerful, easy to use and manufacture + weapon for rebel and guerrilla groups. Its + relatively basic design makes it a cost-effective + upgrade early on in an engagement.

+ + + + + + + + + + + + +
+

      Serieux + (shotgun)

+
+

+ Damage

+
+

16 per fragment. 10 fragments per + shot.

+
+

+ Clip

+
+

10

+
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_siege.html b/main/manual/weapons_siege.html new file mode 100644 index 00000000..3ffdd9e9 --- /dev/null +++ b/main/manual/weapons_siege.html @@ -0,0 +1,279 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Siege Turrets
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: heavy + artillery, that ignores walls and barriers, + doing massive damage to any alien growth + (hives or chambers) in range. Does splash + damage to any alien or chamber next to the + blast.
+
+
+ Use: + most commonly used to destroy hives from + a safe location. Once it starts firing, + be prepared for an extreme alien response.
+
+
+ Data: + developed for use against enemy defensive + emplacements, and made to operate independent + from a nano-network or even human control, + one siege turret can completely halt alien + development (if placed strategically, and + defended). Siege turrets generate their + own gravitational field effect, which can + register all objects with more than a few + pounds of mass within its radius. The shape-signatures + of the objects are matched against its database, + and any hostile patterns are eliminated. + Alien structures have been successfully + added to this database. The turret manipulates + its gravitational field to induce a catastrophic + effect – much like a sonic boom – + that ignores intervening barriers and walls. + The splash damage from this effect makes + the siege especially effective against clusters + of alien chambers. Since aliens themselves + don't hold the same shape very long (i.e. + they tend to move … a lot) they, + and other mobile targets, don't register. + But if an alien is standing next to a chamber + or hive when a siege turret starts its bombardment, + the incidental damage alone is often enough + to kill them.

+ + + + + + + + + + + + + + + + + + + + + + + + +
+

      Siege + Turret

+
+

+ Damage

+
+

700, 350 incidental damage.

+
+

+ Range

+
+

1250

+
+

+ Rate of Fire

+
+

once every 5 seconds

+
+

+ Armor Pts.

+
+

2000

+
+

+ Note

+
+

special attack (see description)

+
+
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_turrets.html b/main/manual/weapons_turrets.html new file mode 100644 index 00000000..c0e6f420 --- /dev/null +++ b/main/manual/weapons_turrets.html @@ -0,0 +1,274 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Turrets
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: automated + anti-personnel emplacements, turrets are + equivalent in damage to a machine gun, but + can fire on full automatic indefinitely, + and never run out of ammo.
+
+
+ Use: + turrets are used to defend an area. More + than one is usually required to successfully + hold off a determined Kharaa. Turret placement + is crucial, and there are many theories + on how to best cover an area. Turrets target + line-of-sight in 360 degrees, but have limited + vertical acquisition (they can't aim up + or down more than around 30° - a 60° + total vertical). Fast moving targets are + also difficult for them to acquire.
+
+
+ Data: + turrets are designed as deploy-and-forget + (automated) anti-personnel weapons. They + perform regular optical sweeps of their + environment (around two a second), and fire + on any object that can't be accounted for + by the command + network (chambers or hives) or FriendlyFire + (alien species). Without an observatory + present, cloaked aliens can also evade them + (although aliens cannot move and remain + cloaked). + If attacked by multiple targets, turrets + will always acquire the closest hostile.
+

+ + + + + + + + + + + + + + + + + + + + + + + + +
+

      Sentry + Turret

+
+

+ Damage

+
+

27

+
+

+ Range

+
+

800

+
+

+ Rate of Fire

+
+

1-2x a second

+
+

+ Armor Pts.

+
+

1000

+
+

+ Note

+
+

automated defense

+
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/manual/weapons_welders.html b/main/manual/weapons_welders.html new file mode 100644 index 00000000..729de0e8 --- /dev/null +++ b/main/manual/weapons_welders.html @@ -0,0 +1,255 @@ + + +Natural Selection Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Frontiersmen + Data :: Marine + :: Weaponry: + Welders
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + +
+

+ + + + +
+ + + + + + + + + + + + + +
 
+ + + + +
+ + + + + + +
+ Knife
+ + Shotgun
+ + Trip Mine
+ + Jet Pack
+ Pistol
+ + Heavy Machine Gun
+ + Welder
+ + Heavy Armor
+ Light Machine Gun
+ + Grenade + Launcher
+ + Turret
+ + Siege Turret
+
+ + + + +
+ + + + + +
+

Desc.: portable + welder, plastic/ceramic construction, closes + when not in use.
+

+
+ Use: can + open or seal weldable areas, repair structures, + and repair regular + or heavy armor. + Also destroys webs. + Replaces the pistol.
+
+
+ Data: + taken almost directly from industrial designs, + the N-Welder is half "traditional" + welder (self-combusting nanites create a + metal melting hot point), and half nano-tool + (sending a stream of construction nanites + into the softened metal). It is designed + to repair structures in the field, saving + resources and strengthening defenses between + attacks. It is also the only way to repair + damaged armor, so is especially useful in + squads using heavy + armor. The N-Welder can safely destroy + webs, + without triggering them. As an authorized + maintenance tool it has one final, incredibly + useful function – it can seal or unseal + certain doors and vents, or open or close + control panels that may allow all manner + of actions. Weldable objects are marked + by special icons on the marine HUD.
+

+ + + + + + + + + + + + + + + + +
+

      N-Welder

+
+

+ Damage

+
+

heals armor and structures

+
+

+ Clip

+
+

n/a

+
+

+ Note

+
+

can weld certain areas

+
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/main/mapcycle.txt b/main/mapcycle.txt new file mode 100644 index 00000000..6fa9db40 --- /dev/null +++ b/main/mapcycle.txt @@ -0,0 +1,47 @@ +// Old default instructions: +// +// Instructions for using mapcycle.txt +// No, you can't change maxplayers on the server, but you can skip maps that don't fit the current # of players +// If no suitable match is found anywhere in your mapcycle file, then the server just moves to the next map in the file anyway. +// Minplayers or maxplayers set to 0 mean don't restrict based on that parameter. You don't have to include minplayers or maxplayers if you +// are not making a restriction. They default to 0 if missing. +// You can list a file twice in the rotation now +// You can issue a command ( rather than setting key value pairs ) at the server console by bracketing it with a blank +// key value: e.g., \mycommand\\ +// minplayers and maxplayers are special tokens and are parsed and removed before the commands are executed +// Commands are executed just after the changelevel command occurs. +// Be sure to remove conflicting settings from any server.cfg or listenserver.cfg files you use since those values will stomp +// on the ones you set here +// The double quotes are necessary +// BTW, the old format will still work +// +// NS instructions: +// +// Other notes: +// - Combat and NS maps are mixed to both types for variety. +// - Use minplayers of 0 for popular combat maps, so an empty server is ready for small numbers of players to join. +// - Reduced maxplayers on bast and hera for CPU reasons +// +ns_eon "\minplayers\16\maxplayers\32\" +ns_metal "\minplayers\16\maxplayers\32\" +ns_caged "\minplayers\16\maxplayers\32\" +co_sava "\minplayers\6\maxplayers\20\" +co_angst "\minplayers\4\maxplayers\20\" +ns_hera "\minplayers\16\maxplayers\24\" +ns_lost "\minplayers\16\maxplayers\32\" +ns_nothing "\minplayers\16\maxplayers\32\" +co_niveus "\minplayers\4\maxplayers\20\" +co_faceoff "\minplayers\0\maxplayers\18\" +co_daimos "\minplayers\8\maxplayers\20\" +ns_bast "\minplayers\14\maxplayers\28\" +ns_origin "\minplayers\16\maxplayers\32\" +co_kestrel "\minplayers\8\maxplayers\20\" +ns_tanith "\minplayers\16\maxplayers\32\" +ns_nancy "\minplayers\14\maxplayers\32\" +ns_veil "\minplayers\16\maxplayers\32\" +co_core "\minplayers\0\maxplayers\20\" +co_ulysses "\minplayers\4\maxplayers\20\" +ns_eclipse "\minplayers\14\maxplayers\32\" +co_pulse "\minplayers\0\maxplayers\20\" +ns_ayumi "\minplayers\16\maxplayers\32\" +ns_altair "\minplayers\16\maxplayers\32\" \ No newline at end of file diff --git a/main/maps/co_angst.bsp b/main/maps/co_angst.bsp new file mode 100644 index 00000000..00e8ad82 Binary files /dev/null and b/main/maps/co_angst.bsp differ diff --git a/main/maps/co_angst.txt b/main/maps/co_angst.txt new file mode 100644 index 00000000..6a2be7af --- /dev/null +++ b/main/maps/co_angst.txt @@ -0,0 +1,58 @@ +===================================================================== + Half-Life Map Spec Sheet +===================================================================== +------General Information-------------------------------------------- + +Status : Final + +Title : Angst +Filename : co_angst +Author : ChromeAngel +Home page : http://www.chromeangel.co.uk/ +Description : The crew of the froniersman strikeship "Angst" have been revived from suspended animation when the on-board computer notices something is wrong in the drive section +Previous Maps : NS_Next, NS_11th_Hr, NS_Gammu, NS_Thief, NS_AM + +------Credits and Thanks--------------------------------------------- +Natural Selection team and all the folks on the NS forums. HTTP://WWW.Natural-Selection.org +and Justin Fisher for his nebula skybox + +------Play Information----------------------------------------------- + +Deathmatch : No +Single Player : No +Natural Selection : YES! +Map Description : Small combat style map acrross 2 floors, lots of connectivity by ladders, doors and vents +How Many Players: 16 + +------Map Information------------------------------------------------ + +New Models : No +New Textures : Yes +New Sounds : No + +------Construction--------------------------------------------------- + +Base : From scratch +Editor(s) used : Worldcraft 3.4 and the Valve Hammer +Compile Machine : Pentium 4 3.0Ghz, 1 GB RAM +Compile time : ~ 5 mins + +------Map Instructions----------------------------------------------- + +Unzip the files in this archive to your NS directory. +The zip file should extract to the correct directories otherwise place the following files +in your half-life/NS/Maps directory, "co_angst.bsp","co_angst.res" and "co_angst.txt". +Place the minimap "co_angst6.spr" in your half-life/NS/sprites/minimaps directory. +Place all the files starting "Nebular_" and "readme-jf-nebula_sky.txt" in your gfx/env directory. + +------Additional Info------------------------------------------------ + +This template is available at The radium Half-Life Map Center... +http://www.planethalflife.com/radium + +Natural Selection maps are available from NS World +http://nsworld.ns-central.co.uk/Main.php + +------Copyright-Permissions------------------------------------------ + +Authors MAY NOT use this level as a base to build additional levels. diff --git a/main/maps/co_core.bsp b/main/maps/co_core.bsp new file mode 100644 index 00000000..02bad765 Binary files /dev/null and b/main/maps/co_core.bsp differ diff --git a/main/maps/co_daimos.bsp b/main/maps/co_daimos.bsp new file mode 100644 index 00000000..75955fd3 Binary files /dev/null and b/main/maps/co_daimos.bsp differ diff --git a/main/maps/co_daimos.txt b/main/maps/co_daimos.txt new file mode 100644 index 00000000..15568c8c --- /dev/null +++ b/main/maps/co_daimos.txt @@ -0,0 +1,82 @@ +TITLE : Daimos +LEVEL FILENAME : co_daimos.bsp +AUTHOR : Oliver "Hypergrip" Richter +DATE : 22.02.2005 +CONTACT EMAIL : hypergrip@gmx.de +HOMEPAGE URL : www.hypergrip.de +--------------------------------------------------------------------- +REQUIRED FILES : /maps/co_daimos.bsp + /maps/co_daimos.txt (The thing you're reading now) + /models/co_daimos/skulk_pose.mdl + /models/co_daimos/soldier_salute.mdl + /sound/co_daimos/vocal04.wav + /sound/co_daimos/unworthy.wav + /sound/co_daimos/rr_choir.wav + /gfx/env/daimos_1UP.tga + /gfx/env/daimos_1DN.tga + /gfx/env/daimos_1RT.tga + /gfx/env/daimos_1LF.tga + /gfx/env/daimos_1FT.tga + /gfx/env/daimos_1BK.tga + + Textures were compiled into the map, so you do not + need any .WAD files besides those that come with NS + anyway. + +--------------------------------------------------------------------- +BACKSTORY : Daimos is an abandoned outpost that has been bought + by the TSA and slightly modified for use as + training ground. + Small groups of Marines are phased in and fight + Aliens (only god and myself know, where the TSA + gets the Aliens for this training) in a life-like + enviroment. + The average rate of survivors is at 26,53%. + +--------------------------------------------------------------------- +EDITOR(S) USED : Mjoellnir + +--------------------------------------------------------------------- +COMPILER(S) USED: ZHLT (XP-Cageys build p15) + +--------------------------------------------------------------------- +COMPILE HARDWARE: 1,3GHz, 256MB RAM + +COMPILE TIME : too long... need better hardware +--------------------------------------------------------------------- +ACKNOWLEDGEMENTS: Missy for providing this nice vocal. + Thanks to PS_Mouse for creating the infested versions + of some textures for me. + The creator of v_wad and the environment map + daimos uses. + Greetings go out to Xeno Kamikaze Corps (www.x-k-c.de) + and Vis Maior (Stonehenge / Albion) as well as + + +=========================== +Changelog: +=========================== + +== co_daimos (NS 3.0 final) + +o Recreated the whole damn thing from scratch + + +=========================== +FAQ +=========================== + +Q: What does "Daimos" mean? +A: Daimos is a character from the greek mythology. Son of Ares, the god of war, and brother to Phobos (phobos = "fear"). the meaning of Daimos is "panic". + +Q: What is the optimal player count for co_daimos? +A: The map has been scaled down a bit because it was oversized, anyway I recommend at least 4vs4. + +Q: Are there any secrets or eastereggs in co_daimos? +A: There was a secret room on the "old" Daimos, that has not made it's way into the new version. But maybe there is something new somewhere... + +Q: How long do you work on this map? +A: I don't count hours.. but it's been quite a lot. + +Q: Hyper, you suck! +A: That is not a question. \ No newline at end of file diff --git a/main/maps/co_ether.bsp b/main/maps/co_ether.bsp new file mode 100644 index 00000000..423f590e Binary files /dev/null and b/main/maps/co_ether.bsp differ diff --git a/main/maps/co_faceoff.bsp b/main/maps/co_faceoff.bsp new file mode 100644 index 00000000..52d0e432 Binary files /dev/null and b/main/maps/co_faceoff.bsp differ diff --git a/main/maps/co_kestrel.bsp b/main/maps/co_kestrel.bsp new file mode 100644 index 00000000..cd30a768 Binary files /dev/null and b/main/maps/co_kestrel.bsp differ diff --git a/main/maps/co_niveus.bsp b/main/maps/co_niveus.bsp new file mode 100644 index 00000000..02d0ce0b Binary files /dev/null and b/main/maps/co_niveus.bsp differ diff --git a/main/maps/co_niveus.res b/main/maps/co_niveus.res new file mode 100644 index 00000000..5c96db71 --- /dev/null +++ b/main/maps/co_niveus.res @@ -0,0 +1,18 @@ +maps/co_niveus.txt +gfx/env/arcnbk.tga +gfx/env/arcndn.tga +gfx/env/arcnft.tga +gfx/env/arcnlf.tga +gfx/env/arcnrt.tga +gfx/env/arcnup.tga +models/co_niveus/helix.mdl +models/co_niveus/plant_pod2.mdl +sound/co_niveus/steamjet1.wav +sound/co_niveus/steamburst1.wav +sound/co_niveus/bastwind2.wav +sound/co_niveus/bg.wav +sound/co_niveus/hum.wav +sprites/co_niveus/hera_fog.spr +sprites/co_niveus/welddrip.spr +sprites/co_niveus/xsmoke1.spr +sprites/co_niveus/raindrop.spr \ No newline at end of file diff --git a/main/maps/co_niveus.txt b/main/maps/co_niveus.txt new file mode 100644 index 00000000..d835144e --- /dev/null +++ b/main/maps/co_niveus.txt @@ -0,0 +1,41 @@ +========== +CO_NIVEUS +========== + +STANDARD INFORMATION +-------------------- +- Title: Niveus +- Filename: co_niveus.bsp +- First Release: June 2004 +- LAtest Release: November 2004 +- Author: Craig Bryson aka Drath +- Email Address: cbryson@gmail.com + + +MAP INFORMATION +--------------- +Game: Natural Selection (http://www.natural-selection.org) +Status: RC5 +Entities: 200 +Editor: Valve Hammer Editor +Compiler(s) used: ZHLT p13 +Compile Hardware: P4 2.4Ghz, 512 MB RAM +Compile Time: 1-2 hours + + +CREDITS +----------------------------- +- plant model by Psycho-Kinetic Hyper-Geek, animated by Ollj. +- helix model by Aegis, animated by Drath +- Sky Map "Arctic Night" by Crinity (taken from http://www.planethalflife.com/crinity). +- Textures used from eclipse, ayumi and tanith. Much <3 to the creators of these textures + +SPECIAL THANKS +-------------- +- To WHC for their server for playtesting +- To Ausns for file hosting, and use of their server for playtesting +- Mendasp for help with env_sprites and .fgds +- Lethy for help with .res files +- Aegis for some secret texture work +- [SuB] and Martigen for supr_pimpage +- To all of stf and cbf \ No newline at end of file diff --git a/main/maps/co_pulse.bsp b/main/maps/co_pulse.bsp new file mode 100644 index 00000000..02df2359 Binary files /dev/null and b/main/maps/co_pulse.bsp differ diff --git a/main/maps/co_sava.bsp b/main/maps/co_sava.bsp new file mode 100644 index 00000000..81c3ebc4 Binary files /dev/null and b/main/maps/co_sava.bsp differ diff --git a/main/maps/co_sava.txt b/main/maps/co_sava.txt new file mode 100644 index 00000000..90f0dae7 --- /dev/null +++ b/main/maps/co_sava.txt @@ -0,0 +1,18 @@ +co_sava by Mendasp +------------------ + +Map information: +---------------- +NS 3.0 version + +Credits: +-------- +The custom sounds used are from Marr's Ambience Pack +Nanotech texture by spacer +Scrolling smoke texture by Elcle +Water tank model by CoolCookieCooks + +Thanks to: +---------- +Lordy +tankefugl \ No newline at end of file diff --git a/main/maps/co_ulysses.bsp b/main/maps/co_ulysses.bsp new file mode 100644 index 00000000..628d1ea5 Binary files /dev/null and b/main/maps/co_ulysses.bsp differ diff --git a/main/maps/co_ulysses.txt b/main/maps/co_ulysses.txt new file mode 100644 index 00000000..c8950961 --- /dev/null +++ b/main/maps/co_ulysses.txt @@ -0,0 +1,12 @@ +co_ulysses_b6 + +10/01/2004 +__________ + + +Changes: + +:: Added drips and steam FX all over the map. +:: Added sounds and ambient. + +Jordi Carazo :: bLuEMaN diff --git a/main/maps/ns_agora.bsp b/main/maps/ns_agora.bsp new file mode 100644 index 00000000..d4469e54 Binary files /dev/null and b/main/maps/ns_agora.bsp differ diff --git a/main/maps/ns_agora.txt b/main/maps/ns_agora.txt new file mode 100644 index 00000000..e56ded6b --- /dev/null +++ b/main/maps/ns_agora.txt @@ -0,0 +1,61 @@ +--Ns_Agora-- + +By KawaK +Contact: Johnsmith2711@hotmail.com + + +--------------------------CREDITS---------------------------------- + + +Textures: + +_ V.wad by FAM ( fam@box7.co.uk , http://www.evolutionarily.org ) + +_ Some textures are created/modified by me + +_ And the officials wads + + + +Special Thanks to: + + Flayra and the dev team (to have made this awesome game!) , the playtesters, and the NS Mapping's community for their very useful feedback. + + Drunken.Monkey for his very appreciated help with the Rad's settings. + + XP-Cagey for his marvelous tools which allowed me to add more details in the map (a lot more!). + + Ian and oOTOo for being the first beta-testers. + + WolfWings for his help with a strange compilation's error (now I know what is the -chop for ;) ). + + + +Additional Thanks to the following people for their suggestions (about the info_location's names and the layout), criticisms and encouragements: + +_Dullgarian +_Burster +_Stakhanov +_le_gardien_prime +_tueurdechat +_Epsylon. +_Mighty-Squirrel +_Roly +_Dark 4rchangel +_Pot-Au-Feu +_Bonebreaker +_achronax | Akro-Jesus +_malou +_FlyFlown +_Naxo +_Klems the Jedi +_Epaulard +_Samcai +_CZ-Cdt`H`Sobel +_Bcastaldi +_huhuh +_katarn +_M@teo21 (webmaster of a French mapping site: http://www.siteduzero.com ) + + +And Thanks to all the people who said something about the map.. \ No newline at end of file diff --git a/main/maps/ns_altair.bsp b/main/maps/ns_altair.bsp new file mode 100644 index 00000000..36d7e6a5 Binary files /dev/null and b/main/maps/ns_altair.bsp differ diff --git a/main/maps/ns_altair.txt b/main/maps/ns_altair.txt new file mode 100644 index 00000000..1011fda4 --- /dev/null +++ b/main/maps/ns_altair.txt @@ -0,0 +1,105 @@ +===================================================================== + Natural-Selection Map Spec Sheet +===================================================================== +------General Information-------------------------------------------- + +Title : Altair Underwater Mining Facility +Filename : ns_altair.bsp +Author : Paul "KungFuDiscoMonkey" Traylor +EMail : kungfudiscomonkey@gmail.com +URL : http://kungfudiscomonkey.net +Date : February 21, 2005 + +------Play Information----------------------------------------------- + +NS:Classic +How Many Players: 32 + +------Map Information------------------------------------------------ + +New Textures : Yes (ns_altair.wad embedded in BSP) + Some Textures taken from Poke646 by Marc Schröder + Button Textures, damaged door, and new monitors by + Samejima +New Sounds : No +New Skybox : Yes based on deepsea1 + by Darc + http://telefragged.com/soup/ +New Models : Not yet +New Prefabs : Yes Tube Container by KungFuSquirrel + +------Construction--------------------------------------------------- + +Base : From scratch +Editor(s) used : Valve Hammer Editor 3.5 + Adobe Photoshop Elements 2.0 + Wally +Compile Machine : 3 Ghz P4, 1 gb RAM +Compile time : ~1 hour + +------Changelog------------------------------------------------------ +v1-6 OLD Versions + +v7 (11/8/04) + Version number incrimented by request to reflect the massive number of improvemts since the b5 version of the map + Added vent from Omega to Zeta with two exits into Phi + Added vent from Muck Pump to Parts Room RT + Rspeed optimizations + Adjustments to Surface Umbilical to reduce LOS + Adjustments to MS top entrance + New monitor textures by Samejima + Covered up pit in Omega + More details + New minimap built for new changes to rooms + +v7b (1/29/05) + Removed Diving tanks and connected Nanite Regulation and Settling tanks + Rerouted path from Settling tanks into Communications + Moved weldable to Muck Pump + Optimized Sub Bay + Moved node from outside Parts room into parts room + +v7c (2/10/05) + Moved Parts Room RT to Sigma Test Site + Added new info_locations to help navigation and direction + Split up Life Support info_location + Split up Sub Bay info_location + Removed weldable door + Reopened path between Sub Bay and Parts Room + Moved some alien spawns into Life Support instead of being a bit outside the hive room + +v7d (2/14/05) + Played with HLRAD compile settings a bit + Added a few new lights to sewer + Misc detail to parts room and Station Monitoring + Small tweek to fix minimap glitch till I have time to do a full sprite again + Added new vent weldables + +v7e (2/21/05) + Reopened route from Settling Tanks to Consistancy + Combined Station Monitoring and Sub Refueling node into one node at SM-Power. + Moved Settling Tank node back to Nanite Regulation + Added small ledge in sub bay to help get around pool + Fixed custom minimap. + + +------Additional Info------------------------------------------------ + +Any feedback or suggestions, please send them to kungfudiscomonkey@gmail.com + +------Copyright-Permissions------------------------------------------ + +I give NO permission whatsoever to decompile this map or use the textures in any other mapping project. Also, please no using ripent or similar to modify the map, if you want something changed, email me about it and if i consider it to be valid i'll sort it. + +------And Finally---------------------------------------------------- + +Thanks to the NS Dev team for making this great mod that has kept me from doing as much homework as I should. + +Thanks to the NS Playtester team for helping me with good feedback and taking time to disuss with me the changes and updates to help make the map that much better. + +Thanks Plaguebearer for taking my mediocre layout and turning it into something awsome. Without his help you wouldn't be playing this map. + +Thanks to TyrNemesis^ for helping me walk around the map and pointing out balance issues and node placement issues and generally helping to make Altair even better. Half the reason you are reading this file is because this guy helped make Altair what it is. + +------Dedication----------------------------------------------------- +Altair is dedicated to my friends from Wake Christian Academy, Cary Alliance Church, and Grace Community Church who will never realize how much their lives have impacted mine and made me a better person because of it. \ No newline at end of file diff --git a/main/maps/ns_ayumi.bsp b/main/maps/ns_ayumi.bsp new file mode 100644 index 00000000..d103b84d Binary files /dev/null and b/main/maps/ns_ayumi.bsp differ diff --git a/main/maps/ns_ayumi.txt b/main/maps/ns_ayumi.txt new file mode 100644 index 00000000..9f061357 --- /dev/null +++ b/main/maps/ns_ayumi.txt @@ -0,0 +1,33 @@ +"ns_ayumi" +Pär Fredriksson aka Drunken.Monkey aka Toad +par_fredriksson@hotmail.com + +---------------------- + +Textures: +Cory "Squeal Like a Pig" Strader +Blazeeer +Fam +Moultano +Me :) + +Sky: +Chalupamonk +---------------------- +Thanks to: + +NS Dev. Team +- Guess why! :P + +MaDMaXX and Immacolata +- You guys came with lots of great feedback on the map. Even though it gave me many hours of more work to do, it was still worth it. Thanks guys! + +Olmy +-For helping me with compiling the map. + +All the cool people in #nsmapping @ Gamesurge +- MrBen, Mendasp, quazilin, Zazi, Insane, bLuEMaN, Marcos and everyone else, for your endless inspiration and support during my late nights with Hammer. :P + + + +/Pär - Drunken.Monkey \ No newline at end of file diff --git a/main/maps/ns_bast.bsp b/main/maps/ns_bast.bsp new file mode 100644 index 00000000..b18f5f92 Binary files /dev/null and b/main/maps/ns_bast.bsp differ diff --git a/main/maps/ns_bast.txt b/main/maps/ns_bast.txt new file mode 100644 index 00000000..838a79f2 --- /dev/null +++ b/main/maps/ns_bast.txt @@ -0,0 +1,15 @@ +Original author: Relic25 + +Remake team: +------------ +Mendasp (project lead and current the maintainer of the map) +MrBen +quazilin +Drunken Monkey +Insane +Marcos + +Thanks to: +------------ +Mr. Headcrab - Reactor display texture +NS Playtesters - Tons of feedback! \ No newline at end of file diff --git a/main/maps/ns_caged.bsp b/main/maps/ns_caged.bsp new file mode 100644 index 00000000..f14c5647 Binary files /dev/null and b/main/maps/ns_caged.bsp differ diff --git a/main/maps/ns_caged.txt b/main/maps/ns_caged.txt new file mode 100644 index 00000000..b9b5c718 --- /dev/null +++ b/main/maps/ns_caged.txt @@ -0,0 +1,79 @@ +TITLE : Caged +FILENAME : ns_caged.bsp +AUTHOR : Nelson 'manah' Ferryman +DATE : 18/10/2002 +EMAIL ADDRESS : manah@planethalflife.com +HOMEPAGE URL : http://www.planethalflife.com/manah/ + +BACKSTORY: + +The small shuttlecraft cut through the bleakness of space like a bird against a vast desert plain, the only life that reveals itself, a beacon to anything lurking, watching, waiting. Inside the craft the passengers waited, some ruefully, some nervously, some expectantly and all eager to reach there destination. + +"So here we go, on our way to the new frontier," Managerial Director Stevens leant back in his seat, slid both his hands through his hair and brought them to rest at the nape of his neck and sighed, happy in the knowledge that one of his dreams was about to be realised. + +"Your still hung up on that whole pioneer ideal, Cowboys and Indians, the Wild West!" a scathing, laugh broke from Ruchechnik, he hunched forward holding his stomach as if to further degrade Stevens fascination. Stevens just shrugged it off, coming from anyone else it would have hurt, no, angered him but he'd grow used to the half-Russian Quantum Physicists bitter humour years ago. "Your vicious, you know that don't you?" Stevens remarked with a mixture of fake scorn and facetiousness he tried to disguise. Ruchechnik smiled briefly, reached into a compartment under his seat and produced two mugs and a slender metallic flask. He poured out generous amounts of steaming transparent liquid and handed one to Stevens. They both sat silently, drinking and listening to the sounds of the other passengers. + +There were ten of them altogether, Stevens and Ruchechnik, Engineers Powell and Blackwell, two large corporate types, Archer and Winans, two security officers, the pilot and a nameless drunk Ruchechnik believed was a spy the company had sent along just to keep an eye on proceedings. Stevens put down his mug and began to speak " You know its always fascinated me, I don't know why but," he paused, brought the mug back up to his lips then continued "I mean you've got to admit it does have a certain allure, a certain ..." Stevens glanced over at Ruchechnik, he'd tilted his head slightly to the side and raised one eyebrow, his eyes glazed over. Stevens sighed again and changed his focus to an imaginary place in the middle distant between himself and the ceiling and in doing so missed a sly smile cross Ruchechniks face, he was playing with him, just like when they were younger. That look was Ruchechnik's standard response to a topic he didn't even consider worthy of his consideration or attention, to the uninitiated it could be as unpleasant as his barbed tongue. But Stevens had a suborn side, he was determined to get at least some of his argument across, "Okay then," his voice was unsure as he tried to establish a coherent line of thought "what about being the first in a new land, getting to explore, discover and ..." + +"And pillage, steal, kill," Ruchechnik interrupted sharply, leaving a small pause between each word to increase there poignancy. + +"Yes, okay, so its not all perfect and things would be handled differently in this day and age but just think, with our space travel, there are so many chances to repeat that experience and this is mine, my chance to explore, discover and," + +"and pillage, steal, kill" grins Ruchechnik + +"Knock that off " + +"Sorry," + +"Yeah, yeah whatever. But anyway, here we are on our way to oversee the construction of the first mining facility in the whole of the Sado Island asteroid field, collecting the equivalent of gold. I just feel like a ... err," + +"Pioneer?" + +"Yeah. Yeah. We're out here setting this thing up. Then it'll become a fully operational mining community, bleeding edge technology, tens of thousands of people living, working, prospering all because we had this opportunity." Stevens's voice drifted off and an inexplicable happiness contorted his face and radiated from him. Ruchechnik looked at the liquid sloshing around in his mug and smiled, Stevens wasn't normally like this, so gullible, unsure. Ruchechnik put it down to nerves and stress, Stevens was having some family difficulties and he'd never been this far offworld before, it must be quite an experience for him. Stevens had drifted off to sleep, Ruchechnik got up and walked to a window, he stood silently for a few minutes, staring at the passing dust clouds and distant stars and listening to the noise of everything around him. + +Powell and Blackwell were discussing the possible strategies for continuation of the project and the kind of state they hoped it would be in, Archer was drowning under a seemingly infinite sea of papers and files that he'd pulled out of a considerably small brief case. Winans and the mysterious drunk were mysteriously missing, Ruchechnik sniggered as various implausible conspiracy theories shot through his mind. He wandered over to the table Powel and Blackwell were sat around and pulled up a chair, they began to talk him through some over their opposing ideas with increasing enthusiasm, Ruchechnik decided to change the subject rather than be drawn into an argument, "Do either of you two know the history of this place?" + +"Well yes, I know there were some ... complications with the original construction," Powell began, + +"Complications!" Ruchechnik laughed again and Blackwell grinned, sharing the joke. Blackwell straightened her glasses and face then began, "What have they told you? It was an absolute disaster, over 400 people lost their lives, millions of dollars worth of equipment wasted, years of work and over what? A company skimping on its human rights policies, that can of thing was abhorrent a 100 years ago, now its totally unacceptable!" Blackwell's voice was confident to such a degree she almost sounded arrogant or perhaps, Ruchechnik pondered, she only took that tone to Powell, it was quite clear she didn't like him. Ruchechnik wandered away again as Powell began to try and defend himself. + +Stevens was awake, he beckoned for Ruchechnik to sit again, opposite him, Ruchechnik sat. Stevens rolled his eyes over toward Powell and Blackwell then back and said, in a hushed voice "What do you think of all the history and stories?" + +Ruchechnik cupped his chin in his left hand and stroked his stubble, "I'm not sure, I know what officially happened and I've heard all the unofficial tales, the riots, the suicides, the disappearances, but," his attention shifted to Winans who'd just emerged out of the cockpit. Winans started toward Archer but stopped as he saw the flustered state he was in, he frowned at Blackwell then headed toward Stevens and Ruchechnik. He took a seat and turned to Stevens, "What are they arguing about?" + +"Who knows, but I know one thing, by time we make the return journey these arguments will have developed in lovers tiffs or we'll be one member short," The three of them laughed slightly then Stevens continued "There arguing about the history of the Sado Island site, about the failure of the original construction project." Winans looked at Powel, who was now standing and pointing one ominous finger at Blackwell then back to Stevens, his face a total blank. Ruchechnik was performing his 'look' again, "You don't know?!", Winans placed one hand over his mouth and shook his head slightly then said "I know the first attempt failed, I know the details of the project and what it was trying to achieve and I know theirs a hell of a lot of profit to be made. I'm a businessman this is a business venture, all that I want to know is the business side of things," + +Ruchechnik took a deep breath "I think you really ought to do more research before becoming a potential investor," he sighed then nodded at Stevens, as if to ask him to take over. Stevens wiped his brow with the cuff of his shirt then started "The area of space we are heading for was originally thought to be void, useless, no planets, no stars, no resources, no anything. It was left alone for 50 or so years until a tiny Japanese express courier craft ran into some unforeseen objects when on course straight across this sector. A massively dense asteroid field was discovered, quite how it was missed before was uncertain, conspiracy theories floating around say perhaps it was first discovered years ago but particular powers decided to keep it hidden or harvest the resources for there own ends. Anyway the Japanese corporation claimed the field and named it the Sado Island asteroid belt, after a real 'lost' Japanese island that appears in Japanese mythology and folklore, if I'm not mistaken. The reasoning isn't important," he paused, reached into the storage compartment under his own seat and retrieved a large bottle of water, he poured himself some then offered the bottle to Winans. Stevens continued "so the Japanese sent out several teams to set-up a facility out here but all failed, there are talks of technical difficulties, of the asteroids in the field being exceptionally tough and volatile, of mercenaries, space pirates, you name it. Eventually the Japanese gave up for undisclosed reasons and offered the area up for international use, so long as a suitable percentage made its way to their wallets. + +This is where we come in, well almost. Our company signed an agreement with the Japanese for sole mining privilege of this area, provided a multi-billion dollar settlement fee and a promised percentage of all harvested resources. So five years ago the first expeditions were sent out to chart and document the entire field and decided on the most efficient place for setting up a mining colony. Several craft vanished but of the ones that returned the data presented showed a density of chemical and mineral resources that far exceeded original ideas, the plans for a mining colony were quickly altered from the standard into the single largest, most ambitious offworld colony ever planned. An entire construction company was purchased to be the fleet who would build this thing. It began slowly at first with more rumours and inexplicable events of technical difficulties, the asteroids being tough and volatile, mercenaries, space pirates, the same stuff. +Then it all begins to get hazy. Something happened, quite what is uncertain, theirs never been a single official standing on it or an outside investigation of any kind. The generally excepted story is that the company, in efforts to cut down costs of this already inconceivably expensive endeavour, had been taking on cheap, illegal workers and using convicts from a nearby prison colony as unpaid labour. Eventually tension flared up and riots broke out, over lack of safety measures, over the supposed frequent disappearances, perhaps over the convict labours, no-one knows. +What we do know how ever is that the company's private security force was brought in, lots of damage was done, lots of people died, the project was officially abandoned." Stevens leant back in seat and poured himself some more water. Ruchechnik took over "Unofficially however the project was just put on the backburner. The site was evacuated but a cleanup team and a considerable portion of the security force were left behind to protect and prepare the site for continuation once the trouble had died down, been easily forgotten like all the other terrible events we hear of daily." Ruchechnik paused, perhaps for dramatic effect, perhaps because he wanted to see the look in Winans eyes, perhaps because he's an idiot, Stevens though to himself. Ruchechnik stretched his arms then continued "Months, Years passed without major incident, the security force gradually departed until just a single cleanup team remained. And that brings us up to date, we're here, on our way to the Sado Island site to assess the viability of an immediate restart to the project." Ruchechnik turned to Winans, didn't say anything but just stared, expectantly, waiting for Winans to speak. He remained silent for the best part of 5 minutes then said, "Okay, so people died, it was tragic, sure, but was I involved? Should I feel guilt or even remorse for actions that didn't slightly concern me? Like I said I'm a businessman and all I'm interested in is the opportunities this project can open for me, for all of us." +Ruchechnik laughed "And you say I'm vicious!" he got up and walked off towards the most distant window at the back of the hold, disappearing behind an assortment of crates, boxes and supplies. Winans too had wandered off toward Archer leaving Stevens alone, he shrugged, leant his head back even further and shut his eyes. + +Several hours later Stevens awoke to a thumping headache, whatever Ruchechnik was drinking it didn't agree with him, it had a potent and vile aftertaste even after all that water and all this time. Stevens muttered "Must be narcotics, chemicals, he moved past alcohol years ago," Steven's grinned then noticed no one was around him. He stood up, carefully at first just in case his legs were a little unsteady, and listened, he heard murmuring and the shuffling of bodies close by, toward the front of the hold, adjacent to the cockpit. He cautiously began to work his way rough the network of stacked boxes and towards the sounds, he turned one more corner and found the rest of the team. They were packed, tightly into a small space between the first row of crates and the main loading door window, puzzled Stevens drew attention to his presence by clearing his throat. Ruchechnik stepped out from the small huddled crowd and beckoned with his hand for Stevens to take his place. Bemused and also intrigued Stevens stepped forward to see what they were looking at. + +What he saw astounded him. He'd expected the framework of the mining colony project, all that was left after the incidents, to be massive as he'd been to an offworld construction before and was awe-struck by the sheer size of it. It paled into insignificance when compared to what he now saw. Seventeen or so 'U' shaped structures stretched off before them all joined at the centre of the curve by what seemed like an immense vertebral column, in fact now he though of it that's what the structure reminded him off. The ribcage and vertebrae of some long dead creature, a creature that's size, presence and incredible mass could intimidate the vastness of space itself. A feeling swept over Stevens, almost indescribable, he guessed this is what people meant when they discussed that moment in everyone's life when they realise there total insignificant in comparison to the universe around them. Only Stevens experienced it at an intensity that made his knees weak, made his stomach retch and gave him the foul taste and sting of acidic bile in the back of his mouth, he was amazed, speechless, frightened and distressed. He struggled in his mind to comprehend what the colony would look like when finished, he struggled to find a word to encompass the magnitude of what he imaged, something so much more than a colony. + +The next hour or so passed like a dream where time is tangible you taste, sometimes touch and always feel it but your perception of its passing leaves you disoriented. Stevens's mind was going round and round, he imaged the feeling of what the first people to see the Pyramids must have felt and he questioned whether he could actually realise his dream or whether truly discovering something new was far beyond him. + +The construction site also overwhelmed Ruchechnik, he'd known about it for years, seen images before but he wasn't prepared for it. He didn't show how much it concerned, excited and disgusted him, all he said was "Nice," whilst in his head he questioned the stability, constitution and motives of a race that could build such a monstrosity all for the purely material gain of 'precious' natural resources. Ruchechnik needed a distraction, he got up from his seat and headed towards the cockpit to enquire how long before they docked with the only remaining vessel of the cleanup team, he wanted to shower, shave and rest his mind. Ruchechnik wondered if the sight of the colony structure had affected the pilot, he asked. "Not really," was the slightly unexpected and underwhelming reply that greeted him, the pilot continued "I've been coming out here every few months since the cleanup project started, doing resupply runs, y'know its like anything, you get used to it after a while." Ruchechnik couldn't imagine getting used to that sight. "I'm coming around for a docking approach now," the pilot announced after a good ten minutes of silence, "Don't you need to contact the crew of the vessel first?" Ruchechnik wondered. "I have, but got no response," the pilot said then continued quickly before Ruchechnik began to worry "But it doesn't matter, all the systems need to dock are online, it'll be fine. Chances are the crew are either asleep or experiencing some generator difficulties, this has happened plenty of times," + +Ruchechnik thought back to a conversation several days earlier with Blackwell, he'd asked what kind of craft had been left alone out here to clean up the mess over 3 years. She'd answered with "The 02883, a industrial variant of a standard Corral class construction vessel." Ruchechnik didn't recognise that class, "I'm not surprised," Blackwell continued "Its not a commercial vessel, if your not in the construction industry it really has no relevance,". Ruchechnik opened his mouth and Blackwell pre-empted his question "It's generally used for storage or as additional workspace or inexpensive additional housing for workers or whatever the situation calls for, it's a very flexible design." He beckoned for her to continue, glad he chose not to ask Powell and endure the monotonous drone of his voice. "It's based around a central hub from that theirs a network of tunnels and rooms that make vessels basically circular upper decks. In the central area is the dock, access to the mainframe and standard facilities for the crew: quarters, kitchens, bathroom, briefing room, lounge area, it's quite comfortable." She spoke the last three words in a way that made it sound like she'd spent a decent amount of time on one of these vessels. She paused, ran her fingers through her hair and sighed "Unless, of course, you have to spend your time on the lower decks ..." The remainder of the conversation blurred out of Ruchechniks mind, until he came to the reason he'd remembered in the first place, the generator. "The generators are horribly unstable and require frequent periods inactivity for cooling down, they do however have an excellent fuel to power output ratio," + +Ruchechnik was brought back to the real world by the pilot pointing and saying "Here we are," The ship wasn't exactly what Ruchechnik had been expecting, given Blackwell's description. It was almost circular on the upper decks, the bottom was a smaller series of circular decks and several cylindrical tubes extending vertically down to bank of solar panels and various satellites. The remarkable thing however was the upper potion of the craft, extending horizontally from it at equal intervals were six long support beams and hundreds of smaller beams protruding at all angles. Large facilities where quite literally hung from the larger beams and secured with a network of girders, starting at the bottom of each facility and working there way back up to the support beam. Ruchechnik could see how the name 'cages' Blackwell had used for these precisely and precariously hung facilities came about. From the angle they were at now the nonchalantly named 02883 seemed like a large, space faring, twelve legged insect with a fat round body as its centre. The pilot announced over the intercom system that docking was about to commence and if people could please take a seat and fasten their security measures so he won't lose his insurance 'no incident' bonus. + +The docking procedure went smoothly, the two security guards emerged from the back room and opened the interior door as Ruchechnik and the pilot came down from the cockpit. The pilot turned and pointed at one of the windows on the side of the shuttle opposite the 02883, "Take a good long look as it's the last time you'll see them for the next two weeks," he then turned to punch a security code into a keypad, the door hummed slightly then opened slowly, the pilot and security guards stepped off first and left the others staring blankly at the stars. + + + +Several weeks later a partially audible message was recovered from a distress beacon: + +"Ship overrun, crew dead" static interference cuts out the message "half the craft locked down" static again "can't get us here but oxygen is limited" heavy breathing followed by a period of violent coughing, then sounds, distant unfamiliar sounds and then silence. The message continues for several minutes, distant arguments can just be heard. Someone wants to leave, someone else wants to stop them, someone gets shot, a door is slammed, some else's voice can be heard chanting, the words can't be made out. Again a long period of silence followed by noises, this time screams, human screams and then silence. Uncontrollable crying fades in and out between layers of static, the tearing of metal and heavy breathing. A single gunshot. The message ends. + +The beacon is handed over to the Frontiersmen, a squad is dispatched. + + +THANKS TO: +The entire NS clan (all developers, mappers, community members) - For letting me get involved in such an excellent project and for all the help/comment & citiscms/inspiration. + +Captain McJesus - for saving my arse on the compiling front. Or rather blackmailing. *cough*You'll never get that cake*cough* \ No newline at end of file diff --git a/main/maps/ns_delta.bsp b/main/maps/ns_delta.bsp new file mode 100644 index 00000000..0aeeef33 Binary files /dev/null and b/main/maps/ns_delta.bsp differ diff --git a/main/maps/ns_delta.txt b/main/maps/ns_delta.txt new file mode 100644 index 00000000..da3dcd8f --- /dev/null +++ b/main/maps/ns_delta.txt @@ -0,0 +1,13 @@ +delta-9 +2/13/02 +tommyd +email: tjd159@psu.edu + +aknowledgements: +Fam for the join team backgrounds +ken20banks for lighting inspiration +TNoF for the missile launcher model +Chalupamonk for the sky +Cory Strader/Relic25 for the NS texture set +additional textures taken from public domain sources + diff --git a/main/maps/ns_eclipse.bsp b/main/maps/ns_eclipse.bsp new file mode 100644 index 00000000..9eb6955e Binary files /dev/null and b/main/maps/ns_eclipse.bsp differ diff --git a/main/maps/ns_eon.bsp b/main/maps/ns_eon.bsp new file mode 100644 index 00000000..9642b4f1 Binary files /dev/null and b/main/maps/ns_eon.bsp differ diff --git a/main/maps/ns_eon.txt b/main/maps/ns_eon.txt new file mode 100644 index 00000000..bfe64636 --- /dev/null +++ b/main/maps/ns_eon.txt @@ -0,0 +1,55 @@ +ns_eon version 7 + +Released (22/2/05) + +-Made some minor aesthetic improvements. + +v6a changelog (20/2/05) + +-Removed Maintenance Corridors' node. +-Moved Engine Walkway node to other side (closer to the hive). + +v6 changelog (19/2/05): + +-Moved Living Area node into Engine Walkway. +-Reduced gaps at sides of corridors connecting to Core hive. +-Removed the ms vent. +-Changed layout on east side of Bridge hive. +-Changed a Bridge vent slightly as a result of Bridge changes. +-Slightly widened turn on N-turn to add more space. +-Removed Repair Bay lift and replaced with ramp/ladder combination. +-Removed Vent leading from Sleeping Area to Repair Bay. +-Slightly shortened the corridors leading out of Marine Start to Repair Bay and N-turn (brought the ms in a bit closer). + +v5 changelog (07/2/05): + +-Lowered Marine Start roof considerably, and added a cc alcove. +-Small aesthetic changes to N-Turn. +-Centre console in Core Monitoring to reduce line of sight. +-Vents rearranged in Core Monitoring to help aliens and a new vent added. +-Vent in Core Power moved as part of the vent rearrangement. +-New space added to Engineering Hive to increase space for spawn points and add more cover, + and just make it cooler. +-Other minor adjustments to Engineering Hive. +-Removed vent doors from Bridge Hive, while blocking line of sight to hive created by their removal. +-Increased usefulness of bridge vents (one exits from the cieling, the other is higher), + and removed stickiness on one vent exit. +-Decreased Bridge Hive vent weld time from 60 seconds to 20 seconds. +-Increased lift speed from 70 to 90. +-Fixed onos stuck issue at Core Monitoring. + +v4 changelog (26/1/05): + +-Major visual revamp for The Hub. Also, more open and more marine friendly (pits are smaller). +-New weldable vent at Bridge hive. +-Sped up the elevator a bit. +-Uncluttered 2 corridors by moving vent exits. +-New exit point for the vent near sleeping area. +-No longer possible to build in the marine start vent. +-More space above and below Engineering and Bridge hive. +-Some areas uncluttered (less things sticking out of walls in a few places). +-Life support corridor floor and ceiling are now smooth. +-Slightly changed layout in Core Monitoring to reduce line of sight problems. +-Fixed a stuck issue in bridge (you would get stuck on light fixtures). +-Nearly every vent that could not accomodate two skulks side by side now can. +-Included a txt file. :) \ No newline at end of file diff --git a/main/maps/ns_hera.bsp b/main/maps/ns_hera.bsp new file mode 100644 index 00000000..2bb67190 Binary files /dev/null and b/main/maps/ns_hera.bsp differ diff --git a/main/maps/ns_hera.txt b/main/maps/ns_hera.txt new file mode 100644 index 00000000..ea1416ba --- /dev/null +++ b/main/maps/ns_hera.txt @@ -0,0 +1,14 @@ +ns_hera version 3.0 by Jon A Chapman aka 'Merkaba' + +========= +BACKSTORY +========= + +The communications colony on planet Hera (named so for its similarity with Earth's neighbour, Mars, but on a much grander scale) was among the first of the targets set by the TSA for salvaging from the then mysterious Kharaa intruders. Due to its ideal transmitting position on the outskirts of the Ariadne Arm, this colony was decided crucial to the TSA’s attack against the Kharaa. Therefore, they had to first eradicate it of all Kharaa presence before moving in. The colony consists of many various stations, all connecting to two central structures via high-speed transport tubes. All the workers and their families live in Rhea, the larger of the two complexes. Cronus is the name of the other, and is the control centre of the communications outpost. The only other man-made structures of note on Hera are the fields of electricity harnesses, set up in calculated positions on Hera’s surface and designed to capture the energy from the raging electrical storms thus powering the colony. + + +======= +MISSION +======= + +This particular mission takes place in station 16-B, one of the few operational complexes with a landing site. The mission as instructed by the TSA is to secure all accessible areas of the station, eradicating all Kharaa, and then to use it as a temporary base camp while the transit tubes are used to access and clear the other stations. All alien findings are to be reported back to the TSA council using the station’s communications capabilities as soon as possible. \ No newline at end of file diff --git a/main/maps/ns_lost.bsp b/main/maps/ns_lost.bsp new file mode 100644 index 00000000..28cf027a Binary files /dev/null and b/main/maps/ns_lost.bsp differ diff --git a/main/maps/ns_lost.txt b/main/maps/ns_lost.txt new file mode 100644 index 00000000..50255a5a --- /dev/null +++ b/main/maps/ns_lost.txt @@ -0,0 +1,64 @@ +ns_lost +Greedo386 +mrolek@gmail.com +http://www.martinrolek.com + + +v2.0 changelog + +o New marine start +o Removed closet weld node +o Moved node from Los Paranoias to Beta Deck Access +o Altered Emergency Access Corridor weld setup +o Added 5 weldable vent covers +o Added ladder to Coolant Exchange +o Made window into Equilbrium siege room breakable + + + + +----------------------------------- + + +Well, this is it. Nearly a year's worth of work on this level, and it's all come to this. It's been a wild ride, but it's been worth it. + +Thanks to the following: +-HanzGruber for the alienhive.mp3 soundfile that I've used in my hive rooms. +-The EC groupies who helped me playtest this, because without you, I wouldn't have had nearly as long of a hall as I do now. +-Relic, Merk, and Ken - You showed me how great a level can look, and I can only hope one day to be able to make mine look as good as yours. +-Flayra, Cory, and the rest of the NS dev team - You've given me the best game I've ever played and asked nothing in return. +-All you lamers out there - Without you, I'd never have had as much fun as I did this past year. !b *!*@* ;Þ +-And lastly, I'd like to thank all the people who end up playing this map, and enjoying it. If that's even one person out there, all this work will be worth it. + + +Some random, uninteresting to most people statstics follow below: + +Compiled on a 2.4 GHz P4, 512MB RAM machine. + +150 textures from 5 wads - Texture usage is at 3.16 mb (of 4.00 mb MAX) + +HLCSG -chart -estimate -wadconfig NS -hullfile nshulls.txt ns_lost.map +HLBSP -chart -estimate ns_lost.map +HLVIS -chart -estimate -full ns_lost.bsp +HLRAD -chart -estimate -bounce 1 -dscale 1 -smooth 80 -sparse -extra -chop 32 -noskyfix -lights lost.rad ns_lost.bsp + +Object names Objects/Maxobjs Memory / Maxmem Fullness +------------ --------------- --------------- -------- +models 116/400 7424/25600 (29.0%) +planes 14198/32767 283960/655340 (43.3%) +vertexes 17217/65535 206604/786420 (26.3%) +nodes 6490/32767 155760/786408 (19.8%) +texinfos 3535/32767 141400/1310680 (10.8%) +faces 12268/65535 245360/1310700 (18.7%) +clipnodes 19093/32767 152744/262136 (58.3%) +leaves 3488/8192 97664/229376 (42.6%) +marksurfaces 15663/65535 31326/131070 (23.9%) +surfedges 58380/512000 233520/2048000 (11.4%) +edges 29996/256000 119984/1024000 (11.7%) +texdata [variable] 144812/4194304 ( 3.5%) +lightdata [variable] 1711746/4194304 (40.8%) +visdata [variable] 84409/2097152 ( 4.0%) +entdata [variable] 48050/524288 ( 9.2%) +152 textures referenced +=== Total BSP file data space used: 3664763 bytes === +13900.22 seconds elapsed [3h 51m 40s] \ No newline at end of file diff --git a/main/maps/ns_metal.bsp b/main/maps/ns_metal.bsp new file mode 100644 index 00000000..c38f8a59 Binary files /dev/null and b/main/maps/ns_metal.bsp differ diff --git a/main/maps/ns_metal.txt b/main/maps/ns_metal.txt new file mode 100644 index 00000000..6394a5b9 --- /dev/null +++ b/main/maps/ns_metal.txt @@ -0,0 +1,140 @@ +Metal 27-8-2004 +=============================================== + +Natural Selection map : Metal (ns_metal.bsp) +Level Design : Juha "quazilin" Lipsonen (quazilin@hotmail.com) + +New environment sky "metal_" +New sprite. + +------------------------------------------------------- + +Stuff: + +Bug reports/Suggestions are welcome to quazilin@hotmail.com + +Machine : 500/700mhz 192mb ram +Build time : Eight months + playtesting/updating +Compile time : ~2hours? + +While mapping I listened great oldskool musik tunes - www.kohina.com ! +Have fun and enjoy the map! + +Greetings : + +Dracka +RedDog NS Clan - #reddog @ quakenet +Flayra +Zazi +Mendasp +Insane +blueman +manah +Nay +Yamazaki +Hypergrip +Ekaj +|DL|JazzX +Marcos +Mr.Ben +Drunken.Monkey ++all you nubs and ns fans out there! + + + +Changelog : + +------------------------- + ++ update-12 + +* Bug Fixes. +* New Res SA-hive + +------------------------- + ++ update-11 + +* More infestation/Tweaks +* Optimized surface access +* Fixed 3 build exploits + +------------------------- + ++ update-10 + +* New "Supply way" +* Smaller "Storage D" +* New res +* More infestation/Tweaks +* Added steam bursts. + +------------------------- + ++ update-9 + +* Tweaks +* Crash bug fix + +------------------------- + ++ update-8 + +* Tweaks +* More vents +* Removed double node + +------------------------- + ++ update-7 + +* Lowered Storage D ceiling +* Small bug fixes + +------------------------- + ++ update-6 + +* Small layout change +* Tweaks + +------------------------- + ++ update-5 + +* One res added +* Lowered ceiling +* Weldable door changed a bit + +------------------------- + ++ update-4 + +* One res node removed +* Res node location changed +* Little tweaks +* Cooling hive easier to heal + +------------------------- + ++ update-3 + +* Res node location changes +* Cargo -> Storage D +* More details. + +------------------------- + ++ update-2 + +* Removed 2 res nodes +* More particle effects +* More ambience sounds +* Bug fixes + -Ladder bug (thanks Ekaj) +* More vents/hiding places + +------------------------- + + + diff --git a/main/maps/ns_mineshaft.bsp b/main/maps/ns_mineshaft.bsp new file mode 100644 index 00000000..ad8151cb Binary files /dev/null and b/main/maps/ns_mineshaft.bsp differ diff --git a/main/maps/ns_mineshaft.txt b/main/maps/ns_mineshaft.txt new file mode 100644 index 00000000..4a5c8454 --- /dev/null +++ b/main/maps/ns_mineshaft.txt @@ -0,0 +1,92 @@ +map: ns_mineshaft +Author: Ekaj +Contact: PM me on the www.natural-selection.org forums + +Thanks to, in no particular order... +Flayra +SquealLikeAPig +FilthyPanda (he made the custom rock textures) +Ken20Banks +Yamazaki +Mazy +Chalupamonk +Monsieur Evil +Grendel +DOOManiac +Tommyd +KungFuSquirrel +Relic25 +Merkaba +Coil +SpaceApe +Ferret +Professional Victim +Badmofo +Fam +Nemisis Zero +Plaguebearer +Silver Fox +BoZmAn20 +Comprox +Blueman +Manah +Khaim +Internecine +BitchSLAP +Cyanide +Storm +Greedo +Who? Me? +Ion Storm (Deus Ex=best game ever) +Valve Software +Craig Mullins (a very good artist, www.goodbrush.com) +Feng Zhu (more great art, www.artbyfeng.com) +The NS play testers/vets and dev team members + +-chart: + +Object names Objects/Maxobjs Memory / Maxmem Fullness +------------ --------------- --------------- -------- +models 163/400 10432/25600 (40.8%) +planes 30394/32767 607880/655340 (92.8%) +vertexes 23512/65535 282144/786420 (35.9%) +nodes 11285/32767 270840/786408 (34.4%) +texinfos 11698/32767 467920/1310680 (35.7%) +faces 17615/65535 352300/1310700 (26.9%) +clipnodes 31921/32767 255368/262136 (97.4%) +leaves 5939/8192 166292/229376 (72.5%) +marksurfaces 23212/65535 46424/131070 (35.4%) +surfedges 79207/512000 316828/2048000 (15.5%) +edges 41687/256000 166748/1024000 (16.3%) +texdata [variable] 1468396/4194304 (35.0%) +lightdata [variable] 1659465/4194304 (39.6%) +visdata [variable] 187400/2097152 ( 8.9%) +entdata [variable] 28442/524288 ( 5.4%) +52 textures referenced +=== Total BSP file data space used: 6286879 bytes === + +Map Information: +Solids: 5031 +Faces: 30828 +PointEntities: 115 +SolidEntities: 162 +Unique Textures: 52 +.rmf size: 12,469 kb + +Textures: +=== Texture usage is at 1.40 mb (of 4.00 mb MAX) === + +Compile times and command lines: +CSG: -chart -hullfile C:\games\hl\ns\nshulls.txt +=== 123.64 seconds elapsed [2m 3s] === + +BSP: +=== 93.48 seconds elapsed [1m 33s] === + +VIS: -full +=== 746.98 seconds elapsed [12m 26s] === + +RAD: -chart -bounce 1 -extra -gamma 0.9 -smooth 80 -sparse +=== 3431.46 seconds elapsed [57m 11s] === + +My computer is a P4 2.4 with a 512 stick of DDR RAM. \ No newline at end of file diff --git a/main/maps/ns_nancy.bsp b/main/maps/ns_nancy.bsp new file mode 100644 index 00000000..e8b3ec44 Binary files /dev/null and b/main/maps/ns_nancy.bsp differ diff --git a/main/maps/ns_nothing.bsp b/main/maps/ns_nothing.bsp new file mode 100644 index 00000000..bfd8f473 Binary files /dev/null and b/main/maps/ns_nothing.bsp differ diff --git a/main/maps/ns_nothing.txt b/main/maps/ns_nothing.txt new file mode 100644 index 00000000..9bce6326 --- /dev/null +++ b/main/maps/ns_nothing.txt @@ -0,0 +1,178 @@ +ns_nothing - "Space Station Nothing - Sub Sector 77" +=================================================== +Natural Selection 2.0 + +== +v2.0 Modifications by Andrew Weldon +Original Level by Ken Banks + +== +X - Deleted Communications Hub nozzle (KB) +X - Reduced volume in Power Silo (KB) +X - moved Cargo Bay Foyer vent into an alcove without LOS to the hive (AW) +X - Deleted Docking wing 01 nozzle (AW) +X - Made 1.1 info_location tweaks (AW) +X - Extended dead-end Viaduct vents to enter each side of Viaduct (AW) +X - Tweaked power silo geometry, hive location, and spawn points (AW) +X - Adjusted Red Room vents to exit closer to the ceiling for added protection (AW) +X - Entity count optimizations (AW) +X - Lighting adjustments (AW) + +== +Special thanks to: +Ken "ken20banks" Banks +The Natural Selection team +XP-Cagey +Cadaver + +== +July 2003 + +ORIGINAL README FOLLOWS: +======================= + +ns_nothing readme +Last Updated: 10/04/02 +------------------------------------------------------- + +Level Name: Space Station Nothing - Sub Sector 77 +Level File Name: ns_nothing.bsp +Additional Files: (See "Other Required Files") +Level Completed: July, 2002 +------------------------------------------------------- + +Level Designer: Ken Banks +Contact: ken20banks@yahoo.com +Website: http://tald.readyroom.org +------------------------------------------------------- + +Other Required Files: + +|ns| +(|maps|, |models|, |sprites|, ns_nothing.wad) + + |maps| + (ns_nothing.bsp, ns_nothing.txt) + + |models| + (|ns_nothing| + + |ns_nothing| + (ssn_powersilo.mdl, ssn_viaduct.mdl) + + |sprites| + (|minimaps|, |ns_nothing|) + + |minimaps| + (ns_nothing.spr) + + |ns_nothing| + (glow03.spr, redflare2.spr) +------------------------------------------------------- + +About the Level: + +Game: Natural Selection +Type: Standard Marines vs. Aliens +Recommended Players: At least 16 +Maximum Players: 32 + +Description: + +Space Station Nothing +Research and Containment Facility +Sub Sector 77 + +An immense facility, the players are located on level -77, near an auxiliary docking bay. Primary use of the sector is purely for maintenance, but it has proven useful for those last minute shipments while the station's main shipping and loading docks were full. A back door of sorts. + +After the workers of the facility discovered that Sector 77 had received a freak shipment of... aliens... the entire level was closed off and quarantined for a week until TSA troops could be brought in. Ship still attached, the aliens began to infest what they could. Three hives began to develop: Two within the station itself, another on board the ship. + +Enter, the Frontiersmen. +------------------------------------------------------- + +Special Thanks: + +Ned "MonsieurEvil" Pyle - I really owe you big time. From the website hosting and lifesaver SHODAN compiles, to the encouraging words and support you provided during the various "rough times", I really don't have the words to express my appreciation. At times it felt as though you were even more devoted to the level than I was. I'll never forget the several times you scrambled through dozens of emails and forum posts to help solve the showstopper compile errors and map bugs. If I were to dedicate this level to someone as a sign of respect and gratitude, it would definitely have to be you. Thanks, man. + +Charlie "Flayra" Cleveland - Your game is amazing. Truly revolutionary. I still can't get over the groundbreaking innovation. It comes as no surprise to me that its creator is one of the smartest and most dedicated people I've met. Thank you so much for allowing me to become involved with the game, and for getting involved with this level yourself. Your feedback on the map was extremely helpful. I have learned so much from you... both directly, and from the experiences of working on this. Thanks for putting up with my uncondensed ramblings too. ;) + +"Ekaj" - Your dedication to the level was made obvious by your flurry of comments, suggestions, and concerns. I don't know where the level would be right now if you hadn't returned my faith in the map by doing your rmf revisions that critical night. Thanks for the seemingly never-ending supply of suggestions and solutions to problems. + +Andrew "KungFuSquirrel" Weldon - Your comments, support, and suggestions were more than encouraging. Thanks for being there as a fellow level designer to discuss various aspects of the level with, and more importantly: as a great friend. + +Jon "Merkaba" Chapman - Your motivating words and insightful suggestions really helped me pull through at the end. I'm delighted that you enjoy the level, and you know that the feeling is mutual regarding your own creation. + +Russell "DOOManiac" Weed - While I unfortunately wasn't able to implement/fix all of them, your numerous suggestions and bug reports were invaluable. Thanks for devoting your time and energy to this. + +"Fam" - You're an incredible artist, which clearly shows in the fabulous sign textures/models you created for the level. Thanks again for doing this. + +Cory "Squeal Like A Pig" Strader - I regret never really getting involved with you in regard to the level's development, because it would undoubtedly have been better as a result. I whole-heartedly appreciate your devotion to defining and creating the visual appearance of the game. Your work is truly inspirational. + +Additional Thanks to the following people/companies for comments, suggestions, criticism, support, and/or for inspiration: + +Adam Foster +Behrooz +Blackdog +blueman +Bozman20 +Bungie +chalupamonk +ChromeAngel +coil +Comprox +Craig Mullins +Cyanide +DevilDog +Digital Extremes +Epic Games +ferret +Feng Zhu +Freemantle +Greedo386 +Grendel +HanzGruber +humbaba +H'BNayr +Id Software +Insane +Ion Storm +Jedisar +Kassinger +Killtoy +Looking Glass Studios +manah +Mantis +Merl +Moleculor +MotherGoose +Mouse +Mutant +narby +Nemesis Zero +Plaugebearer +QUAD +Ramses +Randy Reddig +Relic25 +RhoadsToNowhere +rob6264 +SentrySteve +Sgt. Bilko +shoven +Silver Fox ( Dude, I can jump! Honest! ) +tommyd +Valve Software +Yamazaki + +A big thanks goes out to all of the NS Playtesters, and anyone else who, in any way, commented on the level. +------------------------------------------------------- + +Additional Information: + +I was going to assemble a long, detailed rambling here describing how difficult - yet at the same time, enjoyable - making Space Station Nothing was for me. Though now, as I write this several months after completing the level, my passion for it has been somewhat subdued. I truly feel that by completing the level, I was able to leap over a substantial hurdle that had once been holding me back. I had never before been able to maintain the focus required to complete a project of this scale. The sense of accomplishment I felt after completing a playable build was overwhelming. While that gratification still lingers somewhere in the back of my mind, it's more of a dull tingle now, rather than the incredible burning in my chest that I experienced during the first days the map was released to the playtesters. The horrible stress and moody days that accompanied the numerous roadblocks I encountered during the development cycle also seem like more of a faint memory now than anything else. I was once very eager to share these experiences with everyone - both the good and the bad. I would have done anything for the satisfaction of knowing that at least one person really truly knew the pain and joy I went through. That desire has all but faded away now. Rather than feeling the need to burst out and share every single detail with any - and every - person who is willing to listen, I'm quite satisfied simply looking back at the work that was done and smiling. +------------------------------------------------------- + +Contact: ken20banks@yahoo.com +------------------------------------------------------- + +Reality is dead. \ No newline at end of file diff --git a/main/maps/ns_origin.bsp b/main/maps/ns_origin.bsp new file mode 100644 index 00000000..3acf0786 Binary files /dev/null and b/main/maps/ns_origin.bsp differ diff --git a/main/maps/ns_origin.txt b/main/maps/ns_origin.txt new file mode 100644 index 00000000..2ebcda08 --- /dev/null +++ b/main/maps/ns_origin.txt @@ -0,0 +1,29 @@ +Map name: Origin of Species +BSP name: ns_origin +Author: Cadaver (cadaver@planethalflife.com) + +Credits: Biodome plant models by Psycho-Kinetic Hyper-Geek, animated by Ollj. + Thanks to XP-Cagey for the plane optimising tool which allowed the extra detail in this map. + Holo-Fade and Holo-Lerk models by UKChaos. + Additional textures: third nipple of fury, Fam, Cadaver. + Sky map by Raven (taken from The Wadfather site: http://www.planethalflife.com/wadfather). + Thanks to theiggsta and clan EC for help in playtesting. + New Furnace sound by MaDMaXX + Thanks to MaDMaXX, Khaim, Immacolata, grepdashv, BoZmAn20, Grendel and Flayra for their valuable feedback which helped me improve the map. Thanks also to anyone else who proffered feedback, and sorry for forgetting you! + + +Backstory: Although the origin of the Kharaa is shrouded in mystery, one of the very first human colonies to succumb to the alien scourge was a mining facility on a moon known as Freya IV. Perhaps the miners dug a little too deep, and released the Kharaa from their ancient sleep; none shall ever know, for those unlucky miners never lived to tell their tales. This lonely outpost became enshrined in TSA literature as "Colony Zero", the epidemiological epi-centre of the alien plague which soon ensued, as a result of bacterial contagion caused by the rash evacuation of the miners without due quarantine controls. + +Within weeks, six other planets and moons in the same quadrant as Freya IV became contaminated by the Kharaa; facing the serious possibility of uncontrollable bacterial spread, the TSA unwillingly placed a cordon sanitaire around the affected planets. No-one in, no-one out. The inhabitants of these accursed colonies were condemned to infested tombs. + +One year on, unmanned probes, sent in by the TSA to monitor the situation, found something extremely strange - with the human "threat" vanquished, the Kharaa had apparently disappeared - no trace of them, other than organic infestation remains, could be found. Tentatively sending in a human scouting party, the TSA soon realised that the Kharaa were not gone, merely dormant; in the presence of humans, the Kharaa once again awoke. Reporting "chuckling creatures, skulking in the shadows", the scouting party beat a hasty retreat. + +For the next 50 years, Freya IV was a strict no-go area. in the intervening time, however, the TSA had not been idle. Having identified the Bacterium as the basis for the Kharaa life-form, the TSA developed a bio-chemical weapon to combat it, dubbed "Nano-Penicillin". This weapon worked on the principle of destroying the Bacterium, and hence the Kharaa. In a symbolic act, Freya IV was chosen as the first infestation site to be cleansed with Nano-Penicillin, blanket-dropped upon the site by aerial probes. The mission was a success - the TSA's monitoring equipment could detect no signs of Bacterium. + +As part of the TSA's ongoing Kharaa research, Freya IV became manned once more, as part of efforts to unravel the secrets of the Kharaa by investigating the source. A new science annex was constructed to study the Kharaa and Bacterium under laboratory conditions, safe in the knowledge that Nano-Penicillin could always be used in emergency situations. + +Things did not go according to plan, however... + +A hive, specially cultivated in the biodome, began giving birth to immense numbers of the gargantuan Onos Kharaa, whose angry roars echoed about the entire station. En masse, they began charging at the containment doors, denting it, buckling it, straining it to its limits. Panicking, the scientists manning the biodome released Nano-Penicillin into the biodome...to no effect. The Bacterium had evolved once more, and had become resistant. At last, the containment doors gave way, and the corridors of the complex on Freya IV seethed with angry Kharaa... + +Once more, Freya IV was over-run. The TSA vowed never again to be so foolhardy and reckless as to believe they could confine and contain the Kharaa on human terms. Nevertheless, the scientists on Freya IV made unprecedented headway in Kharaa research, but this research stood to be lost if it could not be retrieved from Freya IV. One last foray was needed - one last journey to the origin of species, this time with a clear objective: search and destroy. \ No newline at end of file diff --git a/main/maps/ns_tanith.bsp b/main/maps/ns_tanith.bsp new file mode 100644 index 00000000..3f4d3dd4 Binary files /dev/null and b/main/maps/ns_tanith.bsp differ diff --git a/main/maps/ns_tanith.txt b/main/maps/ns_tanith.txt new file mode 100644 index 00000000..a2f9ffae --- /dev/null +++ b/main/maps/ns_tanith.txt @@ -0,0 +1,26 @@ +tanith v1.1 beta +2/13/02 +tommyd +email: tjd159@psu.edu + +missing: +-outside satellite part +-several models, including 'reactor' model for the reactor room +-models showing directions +-a few welds +-readyroom (ns_ass style!) + +changes: +-smaller by 10%, aimed for faster matches +-75% reduction in entities, should run very fast +-texturing overhaul +-total revamp of MS - no more problems with issuing commands in MS +-added world models, more to come +-moved fusion hive +-new reactor room and surrounding halls +-fixed aliens-falling-thru-grates +-HLTV support + +aknowledgements: +Fam (textures) +shaderlab textures (these are temporary - will be replaced) diff --git a/main/maps/ns_veil.bsp b/main/maps/ns_veil.bsp new file mode 100644 index 00000000..359dfddd Binary files /dev/null and b/main/maps/ns_veil.bsp differ diff --git a/main/maps/ns_veil.txt b/main/maps/ns_veil.txt new file mode 100644 index 00000000..a9784f7f --- /dev/null +++ b/main/maps/ns_veil.txt @@ -0,0 +1,10 @@ +ns_veil - "Veil" +===================== +Natural Selection 3.0 + +Level by Andrew "KungFuSquirrel" Weldon +http://www.kungfusquirrel.net/ +http://www.hl-nightwatch.net/ + +== +April 2004 \ No newline at end of file diff --git a/main/media/gamestartup.mp3 b/main/media/gamestartup.mp3 new file mode 100644 index 00000000..c406a5c4 Binary files /dev/null and b/main/media/gamestartup.mp3 differ diff --git a/main/media/launch_deny1.wav b/main/media/launch_deny1.wav new file mode 100644 index 00000000..5de7b0f0 Binary files /dev/null and b/main/media/launch_deny1.wav differ diff --git a/main/media/launch_deny2.wav b/main/media/launch_deny2.wav new file mode 100644 index 00000000..842fa69b Binary files /dev/null and b/main/media/launch_deny2.wav differ diff --git a/main/media/launch_dnmenu1.wav b/main/media/launch_dnmenu1.wav new file mode 100644 index 00000000..2b721051 Binary files /dev/null and b/main/media/launch_dnmenu1.wav differ diff --git a/main/media/launch_glow1.wav b/main/media/launch_glow1.wav new file mode 100644 index 00000000..7583339e Binary files /dev/null and b/main/media/launch_glow1.wav differ diff --git a/main/media/launch_select1.wav b/main/media/launch_select1.wav new file mode 100644 index 00000000..0bbb86bd Binary files /dev/null and b/main/media/launch_select1.wav differ diff --git a/main/media/launch_select2.wav b/main/media/launch_select2.wav new file mode 100644 index 00000000..e71197e7 Binary files /dev/null and b/main/media/launch_select2.wav differ diff --git a/main/media/launch_upmenu1.wav b/main/media/launch_upmenu1.wav new file mode 100644 index 00000000..70be2a06 Binary files /dev/null and b/main/media/launch_upmenu1.wav differ diff --git a/main/media/logo.avi b/main/media/logo.avi new file mode 100644 index 00000000..ed8b65b8 Binary files /dev/null and b/main/media/logo.avi differ diff --git a/main/media/startupvids.txt b/main/media/startupvids.txt new file mode 100644 index 00000000..e69de29b diff --git a/main/media/trailer.avi b/main/media/trailer.avi new file mode 100644 index 00000000..5a03373e Binary files /dev/null and b/main/media/trailer.avi differ diff --git a/main/media/uwe.avi b/main/media/uwe.avi new file mode 100644 index 00000000..99696884 Binary files /dev/null and b/main/media/uwe.avi differ diff --git a/main/models/acidrocket.mdl b/main/models/acidrocket.mdl new file mode 100644 index 00000000..2e8990ef Binary files /dev/null and b/main/models/acidrocket.mdl differ diff --git a/main/models/agibs.mdl b/main/models/agibs.mdl new file mode 100644 index 00000000..30c68708 Binary files /dev/null and b/main/models/agibs.mdl differ diff --git a/main/models/b_armory.mdl b/main/models/b_armory.mdl new file mode 100644 index 00000000..453fbf59 Binary files /dev/null and b/main/models/b_armory.mdl differ diff --git a/main/models/b_armoryT.mdl b/main/models/b_armoryT.mdl new file mode 100644 index 00000000..7db62069 Binary files /dev/null and b/main/models/b_armoryT.mdl differ diff --git a/main/models/b_armslab.mdl b/main/models/b_armslab.mdl new file mode 100644 index 00000000..8b6eaa9d Binary files /dev/null and b/main/models/b_armslab.mdl differ diff --git a/main/models/b_armslabT.mdl b/main/models/b_armslabT.mdl new file mode 100644 index 00000000..8b6a9686 Binary files /dev/null and b/main/models/b_armslabT.mdl differ diff --git a/main/models/b_chemlab.mdl b/main/models/b_chemlab.mdl new file mode 100644 index 00000000..a7e5cb36 Binary files /dev/null and b/main/models/b_chemlab.mdl differ diff --git a/main/models/b_chemlabt.mdl b/main/models/b_chemlabt.mdl new file mode 100644 index 00000000..cf72955f Binary files /dev/null and b/main/models/b_chemlabt.mdl differ diff --git a/main/models/b_commandstation.mdl b/main/models/b_commandstation.mdl new file mode 100644 index 00000000..e9cdfcc7 Binary files /dev/null and b/main/models/b_commandstation.mdl differ diff --git a/main/models/b_commandstationt.mdl b/main/models/b_commandstationt.mdl new file mode 100644 index 00000000..b7e401fd Binary files /dev/null and b/main/models/b_commandstationt.mdl differ diff --git a/main/models/b_infportal.mdl b/main/models/b_infportal.mdl new file mode 100644 index 00000000..3477d17d Binary files /dev/null and b/main/models/b_infportal.mdl differ diff --git a/main/models/b_infportalt.mdl b/main/models/b_infportalt.mdl new file mode 100644 index 00000000..b8da0884 Binary files /dev/null and b/main/models/b_infportalt.mdl differ diff --git a/main/models/b_medlab.mdl b/main/models/b_medlab.mdl new file mode 100644 index 00000000..3048dce3 Binary files /dev/null and b/main/models/b_medlab.mdl differ diff --git a/main/models/b_observatory.mdl b/main/models/b_observatory.mdl new file mode 100644 index 00000000..4a448742 Binary files /dev/null and b/main/models/b_observatory.mdl differ diff --git a/main/models/b_observatoryt.mdl b/main/models/b_observatoryt.mdl new file mode 100644 index 00000000..3e5c2108 Binary files /dev/null and b/main/models/b_observatoryt.mdl differ diff --git a/main/models/b_phasegate.mdl b/main/models/b_phasegate.mdl new file mode 100644 index 00000000..a4b49886 Binary files /dev/null and b/main/models/b_phasegate.mdl differ diff --git a/main/models/b_prototypelab.mdl b/main/models/b_prototypelab.mdl new file mode 100644 index 00000000..08461257 Binary files /dev/null and b/main/models/b_prototypelab.mdl differ diff --git a/main/models/b_prototypelabT.mdl b/main/models/b_prototypelabT.mdl new file mode 100644 index 00000000..cdc8ca62 Binary files /dev/null and b/main/models/b_prototypelabT.mdl differ diff --git a/main/models/b_resource_nozzle.mdl b/main/models/b_resource_nozzle.mdl new file mode 100644 index 00000000..c6b6541d Binary files /dev/null and b/main/models/b_resource_nozzle.mdl differ diff --git a/main/models/b_resource_nozzlet.mdl b/main/models/b_resource_nozzlet.mdl new file mode 100644 index 00000000..cf6f5186 Binary files /dev/null and b/main/models/b_resource_nozzlet.mdl differ diff --git a/main/models/b_resourcetower.mdl b/main/models/b_resourcetower.mdl new file mode 100644 index 00000000..eb09ec4d Binary files /dev/null and b/main/models/b_resourcetower.mdl differ diff --git a/main/models/b_resourcetowert.mdl b/main/models/b_resourcetowert.mdl new file mode 100644 index 00000000..a6e8e4c4 Binary files /dev/null and b/main/models/b_resourcetowert.mdl differ diff --git a/main/models/b_scan.mdl b/main/models/b_scan.mdl new file mode 100644 index 00000000..4c962732 Binary files /dev/null and b/main/models/b_scan.mdl differ diff --git a/main/models/b_sentry.mdl b/main/models/b_sentry.mdl new file mode 100644 index 00000000..89bda1b1 Binary files /dev/null and b/main/models/b_sentry.mdl differ diff --git a/main/models/b_sentryt.mdl b/main/models/b_sentryt.mdl new file mode 100644 index 00000000..51bed175 Binary files /dev/null and b/main/models/b_sentryt.mdl differ diff --git a/main/models/b_siege.mdl b/main/models/b_siege.mdl new file mode 100644 index 00000000..b82bff3b Binary files /dev/null and b/main/models/b_siege.mdl differ diff --git a/main/models/b_sieget.mdl b/main/models/b_sieget.mdl new file mode 100644 index 00000000..c0538bae Binary files /dev/null and b/main/models/b_sieget.mdl differ diff --git a/main/models/b_turretfactory.mdl b/main/models/b_turretfactory.mdl new file mode 100644 index 00000000..0685baca Binary files /dev/null and b/main/models/b_turretfactory.mdl differ diff --git a/main/models/b_turretfactoryt.mdl b/main/models/b_turretfactoryt.mdl new file mode 100644 index 00000000..cf72955f Binary files /dev/null and b/main/models/b_turretfactoryt.mdl differ diff --git a/main/models/ba_chamber.mdl b/main/models/ba_chamber.mdl new file mode 100644 index 00000000..3fff0bb6 Binary files /dev/null and b/main/models/ba_chamber.mdl differ diff --git a/main/models/ba_chambert.mdl b/main/models/ba_chambert.mdl new file mode 100644 index 00000000..7fa54e79 Binary files /dev/null and b/main/models/ba_chambert.mdl differ diff --git a/main/models/ba_defense.mdl b/main/models/ba_defense.mdl new file mode 100644 index 00000000..b5385f96 Binary files /dev/null and b/main/models/ba_defense.mdl differ diff --git a/main/models/ba_defenset.mdl b/main/models/ba_defenset.mdl new file mode 100644 index 00000000..a1df9a41 Binary files /dev/null and b/main/models/ba_defenset.mdl differ diff --git a/main/models/ba_movement.mdl b/main/models/ba_movement.mdl new file mode 100644 index 00000000..3655e086 Binary files /dev/null and b/main/models/ba_movement.mdl differ diff --git a/main/models/ba_movementt.mdl b/main/models/ba_movementt.mdl new file mode 100644 index 00000000..751e89cc Binary files /dev/null and b/main/models/ba_movementt.mdl differ diff --git a/main/models/ba_offense.mdl b/main/models/ba_offense.mdl new file mode 100644 index 00000000..4364bb43 Binary files /dev/null and b/main/models/ba_offense.mdl differ diff --git a/main/models/ba_offenset.mdl b/main/models/ba_offenset.mdl new file mode 100644 index 00000000..b323ce61 Binary files /dev/null and b/main/models/ba_offenset.mdl differ diff --git a/main/models/ba_resource.mdl b/main/models/ba_resource.mdl new file mode 100644 index 00000000..3fff0bb6 Binary files /dev/null and b/main/models/ba_resource.mdl differ diff --git a/main/models/ba_resourcet.mdl b/main/models/ba_resourcet.mdl new file mode 100644 index 00000000..7fa54e79 Binary files /dev/null and b/main/models/ba_resourcet.mdl differ diff --git a/main/models/ba_sensory.mdl b/main/models/ba_sensory.mdl new file mode 100644 index 00000000..77662c78 Binary files /dev/null and b/main/models/ba_sensory.mdl differ diff --git a/main/models/ba_sensoryt.mdl b/main/models/ba_sensoryt.mdl new file mode 100644 index 00000000..b6a6cd2a Binary files /dev/null and b/main/models/ba_sensoryt.mdl differ diff --git a/main/models/bilebomb.mdl b/main/models/bilebomb.mdl new file mode 100644 index 00000000..a37ab917 Binary files /dev/null and b/main/models/bilebomb.mdl differ diff --git a/main/models/chair1.mdl b/main/models/chair1.mdl new file mode 100644 index 00000000..26afbb6e Binary files /dev/null and b/main/models/chair1.mdl differ diff --git a/main/models/co_daimos/skulk_pose.mdl b/main/models/co_daimos/skulk_pose.mdl new file mode 100644 index 00000000..9535fed3 Binary files /dev/null and b/main/models/co_daimos/skulk_pose.mdl differ diff --git a/main/models/co_daimos/soldier_salute.mdl b/main/models/co_daimos/soldier_salute.mdl new file mode 100644 index 00000000..d8ab060a Binary files /dev/null and b/main/models/co_daimos/soldier_salute.mdl differ diff --git a/main/models/co_ether/plant1.mdl b/main/models/co_ether/plant1.mdl new file mode 100644 index 00000000..365bc075 Binary files /dev/null and b/main/models/co_ether/plant1.mdl differ diff --git a/main/models/co_ether/uplant1.mdl b/main/models/co_ether/uplant1.mdl new file mode 100644 index 00000000..25c08f74 Binary files /dev/null and b/main/models/co_ether/uplant1.mdl differ diff --git a/main/models/co_ether/uplant1t.mdl b/main/models/co_ether/uplant1t.mdl new file mode 100644 index 00000000..aacae5da Binary files /dev/null and b/main/models/co_ether/uplant1t.mdl differ diff --git a/main/models/co_kestrel/sign_comm.mdl b/main/models/co_kestrel/sign_comm.mdl new file mode 100644 index 00000000..9e78bb37 Binary files /dev/null and b/main/models/co_kestrel/sign_comm.mdl differ diff --git a/main/models/co_kestrel/sign_fusion.mdl b/main/models/co_kestrel/sign_fusion.mdl new file mode 100644 index 00000000..b5701a0a Binary files /dev/null and b/main/models/co_kestrel/sign_fusion.mdl differ diff --git a/main/models/co_kestrel/sign_hangar3.mdl b/main/models/co_kestrel/sign_hangar3.mdl new file mode 100644 index 00000000..c11fe9c8 Binary files /dev/null and b/main/models/co_kestrel/sign_hangar3.mdl differ diff --git a/main/models/co_kestrel/sign_hangar7.mdl b/main/models/co_kestrel/sign_hangar7.mdl new file mode 100644 index 00000000..77692d21 Binary files /dev/null and b/main/models/co_kestrel/sign_hangar7.mdl differ diff --git a/main/models/co_kestrel/sign_power.mdl b/main/models/co_kestrel/sign_power.mdl new file mode 100644 index 00000000..2c4b11be Binary files /dev/null and b/main/models/co_kestrel/sign_power.mdl differ diff --git a/main/models/co_kestrel/sign_subhangar5.mdl b/main/models/co_kestrel/sign_subhangar5.mdl new file mode 100644 index 00000000..0faad70e Binary files /dev/null and b/main/models/co_kestrel/sign_subhangar5.mdl differ diff --git a/main/models/co_niveus/helix.mdl b/main/models/co_niveus/helix.mdl new file mode 100644 index 00000000..b8716596 Binary files /dev/null and b/main/models/co_niveus/helix.mdl differ diff --git a/main/models/co_niveus/plant_pod2.mdl b/main/models/co_niveus/plant_pod2.mdl new file mode 100644 index 00000000..80b12c8f Binary files /dev/null and b/main/models/co_niveus/plant_pod2.mdl differ diff --git a/main/models/co_sava/watertank.mdl b/main/models/co_sava/watertank.mdl new file mode 100644 index 00000000..6fdf27ab Binary files /dev/null and b/main/models/co_sava/watertank.mdl differ diff --git a/main/models/co_sava/watertank2.mdl b/main/models/co_sava/watertank2.mdl new file mode 100644 index 00000000..d2c94acd Binary files /dev/null and b/main/models/co_sava/watertank2.mdl differ diff --git a/main/models/grenade.mdl b/main/models/grenade.mdl new file mode 100644 index 00000000..06ee08b2 Binary files /dev/null and b/main/models/grenade.mdl differ diff --git a/main/models/hgibs.mdl b/main/models/hgibs.mdl new file mode 100644 index 00000000..c9535b5d Binary files /dev/null and b/main/models/hgibs.mdl differ diff --git a/main/models/hive.mdl b/main/models/hive.mdl new file mode 100644 index 00000000..3155e2fc Binary files /dev/null and b/main/models/hive.mdl differ diff --git a/main/models/hivet.mdl b/main/models/hivet.mdl new file mode 100644 index 00000000..471da510 Binary files /dev/null and b/main/models/hivet.mdl differ diff --git a/main/models/holo_base.mdl b/main/models/holo_base.mdl new file mode 100644 index 00000000..458aa307 Binary files /dev/null and b/main/models/holo_base.mdl differ diff --git a/main/models/holo_light.mdl b/main/models/holo_light.mdl new file mode 100644 index 00000000..fff9ebdf Binary files /dev/null and b/main/models/holo_light.mdl differ diff --git a/main/models/ns_bast/bast.mdl b/main/models/ns_bast/bast.mdl new file mode 100644 index 00000000..99b0ae97 Binary files /dev/null and b/main/models/ns_bast/bast.mdl differ diff --git a/main/models/ns_bast/bastsign1.mdl b/main/models/ns_bast/bastsign1.mdl new file mode 100644 index 00000000..ba44ab62 Binary files /dev/null and b/main/models/ns_bast/bastsign1.mdl differ diff --git a/main/models/ns_bast/bastsign10.mdl b/main/models/ns_bast/bastsign10.mdl new file mode 100644 index 00000000..7a3d84d0 Binary files /dev/null and b/main/models/ns_bast/bastsign10.mdl differ diff --git a/main/models/ns_bast/bastsign2.mdl b/main/models/ns_bast/bastsign2.mdl new file mode 100644 index 00000000..33ee6ba3 Binary files /dev/null and b/main/models/ns_bast/bastsign2.mdl differ diff --git a/main/models/ns_bast/bastsign3.mdl b/main/models/ns_bast/bastsign3.mdl new file mode 100644 index 00000000..aabb2f32 Binary files /dev/null and b/main/models/ns_bast/bastsign3.mdl differ diff --git a/main/models/ns_bast/bastsign4.mdl b/main/models/ns_bast/bastsign4.mdl new file mode 100644 index 00000000..032587eb Binary files /dev/null and b/main/models/ns_bast/bastsign4.mdl differ diff --git a/main/models/ns_bast/bastsign5.mdl b/main/models/ns_bast/bastsign5.mdl new file mode 100644 index 00000000..20c9192b Binary files /dev/null and b/main/models/ns_bast/bastsign5.mdl differ diff --git a/main/models/ns_bast/bastsign6.mdl b/main/models/ns_bast/bastsign6.mdl new file mode 100644 index 00000000..7e492d6e Binary files /dev/null and b/main/models/ns_bast/bastsign6.mdl differ diff --git a/main/models/ns_bast/bastsign7.mdl b/main/models/ns_bast/bastsign7.mdl new file mode 100644 index 00000000..680dc8e6 Binary files /dev/null and b/main/models/ns_bast/bastsign7.mdl differ diff --git a/main/models/ns_bast/bastsign8.mdl b/main/models/ns_bast/bastsign8.mdl new file mode 100644 index 00000000..546a6f6e Binary files /dev/null and b/main/models/ns_bast/bastsign8.mdl differ diff --git a/main/models/ns_bast/bastsign9.mdl b/main/models/ns_bast/bastsign9.mdl new file mode 100644 index 00000000..7e49ef81 Binary files /dev/null and b/main/models/ns_bast/bastsign9.mdl differ diff --git a/main/models/ns_bast/command1.mdl b/main/models/ns_bast/command1.mdl new file mode 100644 index 00000000..82b92bec Binary files /dev/null and b/main/models/ns_bast/command1.mdl differ diff --git a/main/models/ns_bast/noentry.mdl b/main/models/ns_bast/noentry.mdl new file mode 100644 index 00000000..2d396b1a Binary files /dev/null and b/main/models/ns_bast/noentry.mdl differ diff --git a/main/models/ns_bast/tripod1.mdl b/main/models/ns_bast/tripod1.mdl new file mode 100644 index 00000000..ecedf1fd Binary files /dev/null and b/main/models/ns_bast/tripod1.mdl differ diff --git a/main/models/ns_bast/warn.mdl b/main/models/ns_bast/warn.mdl new file mode 100644 index 00000000..6d39d495 Binary files /dev/null and b/main/models/ns_bast/warn.mdl differ diff --git a/main/models/ns_hera/hera_logo.mdl b/main/models/ns_hera/hera_logo.mdl new file mode 100644 index 00000000..a15dcbb1 Binary files /dev/null and b/main/models/ns_hera/hera_logo.mdl differ diff --git a/main/models/ns_hera/holo_hera.mdl b/main/models/ns_hera/holo_hera.mdl new file mode 100644 index 00000000..22c32e45 Binary files /dev/null and b/main/models/ns_hera/holo_hera.mdl differ diff --git a/main/models/ns_nancy/raveroom.mdl b/main/models/ns_nancy/raveroom.mdl new file mode 100644 index 00000000..78584218 Binary files /dev/null and b/main/models/ns_nancy/raveroom.mdl differ diff --git a/main/models/ns_nothing/ssn_powersilo.mdl b/main/models/ns_nothing/ssn_powersilo.mdl new file mode 100644 index 00000000..07436810 Binary files /dev/null and b/main/models/ns_nothing/ssn_powersilo.mdl differ diff --git a/main/models/ns_nothing/ssn_viaduct.mdl b/main/models/ns_nothing/ssn_viaduct.mdl new file mode 100644 index 00000000..eaa51990 Binary files /dev/null and b/main/models/ns_nothing/ssn_viaduct.mdl differ diff --git a/main/models/ns_origin/holo_fade.mdl b/main/models/ns_origin/holo_fade.mdl new file mode 100644 index 00000000..4484fcf5 Binary files /dev/null and b/main/models/ns_origin/holo_fade.mdl differ diff --git a/main/models/ns_origin/holo_lerk.mdl b/main/models/ns_origin/holo_lerk.mdl new file mode 100644 index 00000000..fa78a5ec Binary files /dev/null and b/main/models/ns_origin/holo_lerk.mdl differ diff --git a/main/models/ns_origin/plant_pod2.mdl b/main/models/ns_origin/plant_pod2.mdl new file mode 100644 index 00000000..80b12c8f Binary files /dev/null and b/main/models/ns_origin/plant_pod2.mdl differ diff --git a/main/models/ns_origin/plant_shroomtree2.mdl b/main/models/ns_origin/plant_shroomtree2.mdl new file mode 100644 index 00000000..86389373 Binary files /dev/null and b/main/models/ns_origin/plant_shroomtree2.mdl differ diff --git a/main/models/ns_tanith/1wall3.mdl b/main/models/ns_tanith/1wall3.mdl new file mode 100644 index 00000000..9a857057 Binary files /dev/null and b/main/models/ns_tanith/1wall3.mdl differ diff --git a/main/models/ns_tanith/1wall4.mdl b/main/models/ns_tanith/1wall4.mdl new file mode 100644 index 00000000..ecad4b10 Binary files /dev/null and b/main/models/ns_tanith/1wall4.mdl differ diff --git a/main/models/ns_tanith/1wall5.mdl b/main/models/ns_tanith/1wall5.mdl new file mode 100644 index 00000000..32e3a81b Binary files /dev/null and b/main/models/ns_tanith/1wall5.mdl differ diff --git a/main/models/ns_tanith/1wall6.mdl b/main/models/ns_tanith/1wall6.mdl new file mode 100644 index 00000000..f96a73f0 Binary files /dev/null and b/main/models/ns_tanith/1wall6.mdl differ diff --git a/main/models/ns_tanith/czg_screen96.mdl b/main/models/ns_tanith/czg_screen96.mdl new file mode 100644 index 00000000..c1763dc5 Binary files /dev/null and b/main/models/ns_tanith/czg_screen96.mdl differ diff --git a/main/models/ns_tanith/tansign.mdl b/main/models/ns_tanith/tansign.mdl new file mode 100644 index 00000000..a02eef6e Binary files /dev/null and b/main/models/ns_tanith/tansign.mdl differ diff --git a/main/models/null.mdl b/main/models/null.mdl new file mode 100644 index 00000000..5bad6548 Binary files /dev/null and b/main/models/null.mdl differ diff --git a/main/models/p_gg.mdl b/main/models/p_gg.mdl new file mode 100644 index 00000000..764c4bbb Binary files /dev/null and b/main/models/p_gg.mdl differ diff --git a/main/models/p_gr.mdl b/main/models/p_gr.mdl new file mode 100644 index 00000000..6077e154 Binary files /dev/null and b/main/models/p_gr.mdl differ diff --git a/main/models/p_hg.mdl b/main/models/p_hg.mdl new file mode 100644 index 00000000..b41a47c0 Binary files /dev/null and b/main/models/p_hg.mdl differ diff --git a/main/models/p_hmg.mdl b/main/models/p_hmg.mdl new file mode 100644 index 00000000..e34b0b90 Binary files /dev/null and b/main/models/p_hmg.mdl differ diff --git a/main/models/p_kn.mdl b/main/models/p_kn.mdl new file mode 100644 index 00000000..556f7836 Binary files /dev/null and b/main/models/p_kn.mdl differ diff --git a/main/models/p_mg.mdl b/main/models/p_mg.mdl new file mode 100644 index 00000000..1019c241 Binary files /dev/null and b/main/models/p_mg.mdl differ diff --git a/main/models/p_mine.mdl b/main/models/p_mine.mdl new file mode 100644 index 00000000..69a4ba74 Binary files /dev/null and b/main/models/p_mine.mdl differ diff --git a/main/models/p_pistol.mdl b/main/models/p_pistol.mdl new file mode 100644 index 00000000..38407542 Binary files /dev/null and b/main/models/p_pistol.mdl differ diff --git a/main/models/p_sg.mdl b/main/models/p_sg.mdl new file mode 100644 index 00000000..29016001 Binary files /dev/null and b/main/models/p_sg.mdl differ diff --git a/main/models/p_shotgun.mdl b/main/models/p_shotgun.mdl new file mode 100644 index 00000000..2551e5c5 Binary files /dev/null and b/main/models/p_shotgun.mdl differ diff --git a/main/models/p_tripmine.mdl b/main/models/p_tripmine.mdl new file mode 100644 index 00000000..309eb4ad Binary files /dev/null and b/main/models/p_tripmine.mdl differ diff --git a/main/models/p_welder.mdl b/main/models/p_welder.mdl new file mode 100644 index 00000000..20c8e8c9 Binary files /dev/null and b/main/models/p_welder.mdl differ diff --git a/main/models/parasite.mdl b/main/models/parasite.mdl new file mode 100644 index 00000000..79ee0e69 Binary files /dev/null and b/main/models/parasite.mdl differ diff --git a/main/models/player.mdl b/main/models/player.mdl new file mode 100644 index 00000000..010ef4ff Binary files /dev/null and b/main/models/player.mdl differ diff --git a/main/models/player/alien1/alien1.mdl b/main/models/player/alien1/alien1.mdl new file mode 100644 index 00000000..988965ad Binary files /dev/null and b/main/models/player/alien1/alien1.mdl differ diff --git a/main/models/player/alien2/alien2.mdl b/main/models/player/alien2/alien2.mdl new file mode 100644 index 00000000..e534f2c7 Binary files /dev/null and b/main/models/player/alien2/alien2.mdl differ diff --git a/main/models/player/alien3/alien3.mdl b/main/models/player/alien3/alien3.mdl new file mode 100644 index 00000000..63d6aef2 Binary files /dev/null and b/main/models/player/alien3/alien3.mdl differ diff --git a/main/models/player/alien4/alien4.mdl b/main/models/player/alien4/alien4.mdl new file mode 100644 index 00000000..4d0e75c7 Binary files /dev/null and b/main/models/player/alien4/alien4.mdl differ diff --git a/main/models/player/alien5/alien5.mdl b/main/models/player/alien5/alien5.mdl new file mode 100644 index 00000000..c1adc956 Binary files /dev/null and b/main/models/player/alien5/alien5.mdl differ diff --git a/main/models/player/commander/commander.mdl b/main/models/player/commander/commander.mdl new file mode 100644 index 00000000..010ef4ff Binary files /dev/null and b/main/models/player/commander/commander.mdl differ diff --git a/main/models/player/gestate/gestate.mdl b/main/models/player/gestate/gestate.mdl new file mode 100644 index 00000000..294628ed Binary files /dev/null and b/main/models/player/gestate/gestate.mdl differ diff --git a/main/models/player/gestate/gestatet.mdl b/main/models/player/gestate/gestatet.mdl new file mode 100644 index 00000000..24bcca7f Binary files /dev/null and b/main/models/player/gestate/gestatet.mdl differ diff --git a/main/models/player/heavy/heavy.mdl b/main/models/player/heavy/heavy.mdl new file mode 100644 index 00000000..5d2506ea Binary files /dev/null and b/main/models/player/heavy/heavy.mdl differ diff --git a/main/models/player/remapped.bmp b/main/models/player/remapped.bmp new file mode 100644 index 00000000..72fd3d5b Binary files /dev/null and b/main/models/player/remapped.bmp differ diff --git a/main/models/player/soldier/soldier.mdl b/main/models/player/soldier/soldier.mdl new file mode 100644 index 00000000..b0e626b8 Binary files /dev/null and b/main/models/player/soldier/soldier.mdl differ diff --git a/main/models/pshell.mdl b/main/models/pshell.mdl new file mode 100644 index 00000000..69a93966 Binary files /dev/null and b/main/models/pshell.mdl differ diff --git a/main/models/shell.mdl b/main/models/shell.mdl new file mode 100644 index 00000000..6c8428c3 Binary files /dev/null and b/main/models/shell.mdl differ diff --git a/main/models/shotshell.mdl b/main/models/shotshell.mdl new file mode 100644 index 00000000..681ab3db Binary files /dev/null and b/main/models/shotshell.mdl differ diff --git a/main/models/spike.mdl b/main/models/spike.mdl new file mode 100644 index 00000000..a70dbeab Binary files /dev/null and b/main/models/spike.mdl differ diff --git a/main/models/stomp.mdl b/main/models/stomp.mdl new file mode 100644 index 00000000..d6bd3fef Binary files /dev/null and b/main/models/stomp.mdl differ diff --git a/main/models/v_gg.mdl b/main/models/v_gg.mdl new file mode 100644 index 00000000..a0dcea61 Binary files /dev/null and b/main/models/v_gg.mdl differ diff --git a/main/models/v_gg_hv.mdl b/main/models/v_gg_hv.mdl new file mode 100644 index 00000000..35911937 Binary files /dev/null and b/main/models/v_gg_hv.mdl differ diff --git a/main/models/v_gr.mdl b/main/models/v_gr.mdl new file mode 100644 index 00000000..02a7c7e0 Binary files /dev/null and b/main/models/v_gr.mdl differ diff --git a/main/models/v_gr_hv.mdl b/main/models/v_gr_hv.mdl new file mode 100644 index 00000000..8f27ba83 Binary files /dev/null and b/main/models/v_gr_hv.mdl differ diff --git a/main/models/v_hg.mdl b/main/models/v_hg.mdl new file mode 100644 index 00000000..49f9c2d9 Binary files /dev/null and b/main/models/v_hg.mdl differ diff --git a/main/models/v_hg_hv.mdl b/main/models/v_hg_hv.mdl new file mode 100644 index 00000000..11194af5 Binary files /dev/null and b/main/models/v_hg_hv.mdl differ diff --git a/main/models/v_hmg.mdl b/main/models/v_hmg.mdl new file mode 100644 index 00000000..71e59949 Binary files /dev/null and b/main/models/v_hmg.mdl differ diff --git a/main/models/v_hmg_hv.mdl b/main/models/v_hmg_hv.mdl new file mode 100644 index 00000000..95c81a36 Binary files /dev/null and b/main/models/v_hmg_hv.mdl differ diff --git a/main/models/v_kn.mdl b/main/models/v_kn.mdl new file mode 100644 index 00000000..0894d485 Binary files /dev/null and b/main/models/v_kn.mdl differ diff --git a/main/models/v_kn_hv.mdl b/main/models/v_kn_hv.mdl new file mode 100644 index 00000000..534c24b9 Binary files /dev/null and b/main/models/v_kn_hv.mdl differ diff --git a/main/models/v_lvl1.mdl b/main/models/v_lvl1.mdl new file mode 100644 index 00000000..0fa192d8 Binary files /dev/null and b/main/models/v_lvl1.mdl differ diff --git a/main/models/v_lvl2.mdl b/main/models/v_lvl2.mdl new file mode 100644 index 00000000..235ff9c7 Binary files /dev/null and b/main/models/v_lvl2.mdl differ diff --git a/main/models/v_lvl3.mdl b/main/models/v_lvl3.mdl new file mode 100644 index 00000000..978463b6 Binary files /dev/null and b/main/models/v_lvl3.mdl differ diff --git a/main/models/v_lvl4.mdl b/main/models/v_lvl4.mdl new file mode 100644 index 00000000..27a67ca8 Binary files /dev/null and b/main/models/v_lvl4.mdl differ diff --git a/main/models/v_lvl5.mdl b/main/models/v_lvl5.mdl new file mode 100644 index 00000000..0b6064f6 Binary files /dev/null and b/main/models/v_lvl5.mdl differ diff --git a/main/models/v_mg.mdl b/main/models/v_mg.mdl new file mode 100644 index 00000000..589e9eca Binary files /dev/null and b/main/models/v_mg.mdl differ diff --git a/main/models/v_mg_hv.mdl b/main/models/v_mg_hv.mdl new file mode 100644 index 00000000..0016331e Binary files /dev/null and b/main/models/v_mg_hv.mdl differ diff --git a/main/models/v_mine.mdl b/main/models/v_mine.mdl new file mode 100644 index 00000000..2c3803fe Binary files /dev/null and b/main/models/v_mine.mdl differ diff --git a/main/models/v_mine_hv.mdl b/main/models/v_mine_hv.mdl new file mode 100644 index 00000000..0658a435 Binary files /dev/null and b/main/models/v_mine_hv.mdl differ diff --git a/main/models/v_sg.mdl b/main/models/v_sg.mdl new file mode 100644 index 00000000..00402640 Binary files /dev/null and b/main/models/v_sg.mdl differ diff --git a/main/models/v_sg_hv.mdl b/main/models/v_sg_hv.mdl new file mode 100644 index 00000000..640c1d0e Binary files /dev/null and b/main/models/v_sg_hv.mdl differ diff --git a/main/models/v_welder.mdl b/main/models/v_welder.mdl new file mode 100644 index 00000000..3bb35617 Binary files /dev/null and b/main/models/v_welder.mdl differ diff --git a/main/models/v_welder_hv.mdl b/main/models/v_welder_hv.mdl new file mode 100644 index 00000000..22f1e059 Binary files /dev/null and b/main/models/v_welder_hv.mdl differ diff --git a/main/models/w_ammo.mdl b/main/models/w_ammo.mdl new file mode 100644 index 00000000..7601c68c Binary files /dev/null and b/main/models/w_ammo.mdl differ diff --git a/main/models/w_ammopack.mdl b/main/models/w_ammopack.mdl new file mode 100644 index 00000000..736c7b0b Binary files /dev/null and b/main/models/w_ammopack.mdl differ diff --git a/main/models/w_ammot.mdl b/main/models/w_ammot.mdl new file mode 100644 index 00000000..b244eb27 Binary files /dev/null and b/main/models/w_ammot.mdl differ diff --git a/main/models/w_catalyst.mdl b/main/models/w_catalyst.mdl new file mode 100644 index 00000000..bdb3bbc6 Binary files /dev/null and b/main/models/w_catalyst.mdl differ diff --git a/main/models/w_gg.mdl b/main/models/w_gg.mdl new file mode 100644 index 00000000..1dd4a477 Binary files /dev/null and b/main/models/w_gg.mdl differ diff --git a/main/models/w_gr.mdl b/main/models/w_gr.mdl new file mode 100644 index 00000000..67b46e47 Binary files /dev/null and b/main/models/w_gr.mdl differ diff --git a/main/models/w_grT.mdl b/main/models/w_grT.mdl new file mode 100644 index 00000000..78b151bb Binary files /dev/null and b/main/models/w_grT.mdl differ diff --git a/main/models/w_gren.mdl b/main/models/w_gren.mdl new file mode 100644 index 00000000..cc458e9b Binary files /dev/null and b/main/models/w_gren.mdl differ diff --git a/main/models/w_grenade.mdl b/main/models/w_grenade.mdl new file mode 100644 index 00000000..b6b85945 Binary files /dev/null and b/main/models/w_grenade.mdl differ diff --git a/main/models/w_health.mdl b/main/models/w_health.mdl new file mode 100644 index 00000000..960b675c Binary files /dev/null and b/main/models/w_health.mdl differ diff --git a/main/models/w_healtht.mdl b/main/models/w_healtht.mdl new file mode 100644 index 00000000..8cf4e2d9 Binary files /dev/null and b/main/models/w_healtht.mdl differ diff --git a/main/models/w_heavy.mdl b/main/models/w_heavy.mdl new file mode 100644 index 00000000..443dbd8b Binary files /dev/null and b/main/models/w_heavy.mdl differ diff --git a/main/models/w_hg.mdl b/main/models/w_hg.mdl new file mode 100644 index 00000000..4bb3a45f Binary files /dev/null and b/main/models/w_hg.mdl differ diff --git a/main/models/w_hgt.mdl b/main/models/w_hgt.mdl new file mode 100644 index 00000000..df67c8bc Binary files /dev/null and b/main/models/w_hgt.mdl differ diff --git a/main/models/w_hmg.mdl b/main/models/w_hmg.mdl new file mode 100644 index 00000000..bf1f872c Binary files /dev/null and b/main/models/w_hmg.mdl differ diff --git a/main/models/w_hmgT.mdl b/main/models/w_hmgT.mdl new file mode 100644 index 00000000..492a4d87 Binary files /dev/null and b/main/models/w_hmgT.mdl differ diff --git a/main/models/w_jetpack.mdl b/main/models/w_jetpack.mdl new file mode 100644 index 00000000..c3e20705 Binary files /dev/null and b/main/models/w_jetpack.mdl differ diff --git a/main/models/w_kn.mdl b/main/models/w_kn.mdl new file mode 100644 index 00000000..e50b5c49 Binary files /dev/null and b/main/models/w_kn.mdl differ diff --git a/main/models/w_knT.mdl b/main/models/w_knT.mdl new file mode 100644 index 00000000..67cd8bcc Binary files /dev/null and b/main/models/w_knT.mdl differ diff --git a/main/models/w_mg.mdl b/main/models/w_mg.mdl new file mode 100644 index 00000000..ee76edc8 Binary files /dev/null and b/main/models/w_mg.mdl differ diff --git a/main/models/w_mgt.mdl b/main/models/w_mgt.mdl new file mode 100644 index 00000000..c29d24df Binary files /dev/null and b/main/models/w_mgt.mdl differ diff --git a/main/models/w_mine.mdl b/main/models/w_mine.mdl new file mode 100644 index 00000000..32d238a9 Binary files /dev/null and b/main/models/w_mine.mdl differ diff --git a/main/models/w_mine2.mdl b/main/models/w_mine2.mdl new file mode 100644 index 00000000..30285323 Binary files /dev/null and b/main/models/w_mine2.mdl differ diff --git a/main/models/w_none.mdl b/main/models/w_none.mdl new file mode 100644 index 00000000..ca9d4f22 Binary files /dev/null and b/main/models/w_none.mdl differ diff --git a/main/models/w_sg.mdl b/main/models/w_sg.mdl new file mode 100644 index 00000000..458961d5 Binary files /dev/null and b/main/models/w_sg.mdl differ diff --git a/main/models/w_sgt.mdl b/main/models/w_sgt.mdl new file mode 100644 index 00000000..017a26d0 Binary files /dev/null and b/main/models/w_sgt.mdl differ diff --git a/main/models/w_welder.mdl b/main/models/w_welder.mdl new file mode 100644 index 00000000..688171ce Binary files /dev/null and b/main/models/w_welder.mdl differ diff --git a/main/models/w_welderT.mdl b/main/models/w_welderT.mdl new file mode 100644 index 00000000..5348b605 Binary files /dev/null and b/main/models/w_welderT.mdl differ diff --git a/main/motd.txt b/main/motd.txt new file mode 100644 index 00000000..05885f00 --- /dev/null +++ b/main/motd.txt @@ -0,0 +1 @@ +Welcome to Natural Selection...enjoy yourself! diff --git a/main/music/ns_ambient1.mp3 b/main/music/ns_ambient1.mp3 new file mode 100644 index 00000000..f26e4b54 Binary files /dev/null and b/main/music/ns_ambient1.mp3 differ diff --git a/main/music/ns_ambient2.mp3 b/main/music/ns_ambient2.mp3 new file mode 100644 index 00000000..193766ad Binary files /dev/null and b/main/music/ns_ambient2.mp3 differ diff --git a/main/music/ns_ambient3.mp3 b/main/music/ns_ambient3.mp3 new file mode 100644 index 00000000..7dfa5578 Binary files /dev/null and b/main/music/ns_ambient3.mp3 differ diff --git a/main/music/ns_ambient4.mp3 b/main/music/ns_ambient4.mp3 new file mode 100644 index 00000000..73375c77 Binary files /dev/null and b/main/music/ns_ambient4.mp3 differ diff --git a/main/music/ns_ambient5.mp3 b/main/music/ns_ambient5.mp3 new file mode 100644 index 00000000..63d3bf56 Binary files /dev/null and b/main/music/ns_ambient5.mp3 differ diff --git a/main/music/ns_titlescreen.mp3 b/main/music/ns_titlescreen.mp3 new file mode 100644 index 00000000..c406a5c4 Binary files /dev/null and b/main/music/ns_titlescreen.mp3 differ diff --git a/main/ns-hltv.bat b/main/ns-hltv.bat new file mode 100644 index 00000000..9c66acb2 --- /dev/null +++ b/main/ns-hltv.bat @@ -0,0 +1,5 @@ +REM Make sure you've installed and ran the "dedicated server" package to get hltv.exe +cd ../../"dedicated server" +REM hltv.exe +exec ns\ns-hltv.cfg +maxclients 256 +autorecord 1 +connect IPADDRESS:27020 +hltv.exe +exec nsp\ns-hltv.cfg +maxclients 256 +autorecord 1 +connect 192.168.0.4:27016 +cd ../half-life/nsp \ No newline at end of file diff --git a/main/ns-hltv.cfg b/main/ns-hltv.cfg new file mode 100644 index 00000000..3c7718f4 --- /dev/null +++ b/main/ns-hltv.cfg @@ -0,0 +1,46 @@ +// ============================= +// Base Config for NS-HLTV v1.0 +// ============================= +delay 60.0 // delays game for 60 seconds +multicast 0 // multicast disabled +rate 10000 // amount of data proxy gets from match server +maxclientrate 8000 // maximum client data from HLTV proxy +updaterate 20 // get 20 updates per second from server +logfile 1 // log events in proxy.log +chatmode 1 // local chatting on +name "NS-HLTV" // HLTV Host Name +// ======================================= +// Careful when modifying lines above this +// ======================================= + +// http://www.slipgate.de/hltv/hltv_FAQ_admins.html for more information + +// Turns off reporting to WON database +nomaster 1 + +//serverpassword // server password (that HLTV will be connecting to) + +// set offline info text clients will see as reject reason if HLTV isn't broadcasting yet +offlinetext "Sorry, the game isn't broadcasting yet." + +// disallow joingame for HLTV spectators +allowjoingame 0 + +// banner +bannerfile ns-hltv.tga + +// incoming voice data is blocked +blockvoice 1 + +// passwords +//adminpassword // proxy's admin password for rcon, commentator etc. (like server rcon) +//proxypassword // protects proxy against unwanted relay proxies +//spectatorpassword // If your HLTV will have spectators, you'll need to provide them with this password. + +// show message for 5 seconds each 120 seconds in center of X axis (-1) and +// above help text bar (0.85). Color given as hexadecimal RGBA . +localmsg "NS-HLTV Broadcast" 90 5 -1 0.825 FFA000FF + +// these commands will be executed on connecting spectator client and may be used +// to adjust settings for HLTV (for example voice parameters) +signoncommands "voice_scale 2; voice_overdrive 16; volume 0.5; echo Voice adjusted for NS-HLTV" \ No newline at end of file diff --git a/main/ns-hltv.tga b/main/ns-hltv.tga new file mode 100644 index 00000000..38fdad95 Binary files /dev/null and b/main/ns-hltv.tga differ diff --git a/main/ns.fgd b/main/ns.fgd new file mode 100644 index 00000000..4ea0a2aa --- /dev/null +++ b/main/ns.fgd @@ -0,0 +1,2382 @@ +// +// Natural Selection game definition file (.fgd) +// Version 2.1 +// for Valve Hammer Editor 3.5 and above, and Half-Life 1.1.1.0 and above +// last update: 7/29/03, Andrew Weldon (aweldon@planethalflife.com) +// + + +// +// NS20 - NS FGD v. 2.1 +// - Adjusted FGD information to be current to 2.1 version number. +// +// NS11 - NS FGD v. 1.1 +// - Added Valve Hammer Editor 3.5 model rendering support for +// cycler, cycler_weapon, info_player_start, team_hive, +// team_command, and func_resource. +// - Added "Angles" base class to fgd and relevant entities. +// - Removed unnecessary Half-Life single player entities. +// - Removed standard Half-Life turret and mortar-related entities. +// - Added support for MHLT Custom Build 1.7 of ZHLT 2.5.3 For further +// information on these features, refer to your MHLT 1.7 documentation. +// - Added support for XP-Cagey's tool modifications. *This should +// also allow for theoretical MHLT 1.8 support* For further +// information on these features, please refer to your zhlt17p8 documentation. +// - Added original ZHLT-specific keyvalues to applicable entities. +// - Removed old Half-Life fgd changelogs (Changes are viewable in +// standard Half-Life .fgd and mostly irrelevant to NS-specific +// work). Can be re-added at a later date if deemed necessary. +// - Removed env_fog for compatibility reasons. +// - Uncommented "Momentary open time" and "Momentary close time" in +// trigger_precence [sic]. +// +// NOTE ON ADDITION OF ZHLT LIGHTFLAGS: +// The ZHLT lightflags can be added to any brush entity. In most cases, +// this should not include movable/toggleable geometry, but there +// are some applications where this is necessary. As such, I've gone ahead +// and added them to all visible brush entities despite some that seem +// almost counter-intuitive. This is only for the sake of people who do +// find uses for the flags on these entities. Smart and careful use of +// these flags will give the best results. +// +// NOTE ON ADDITION OF TOGGLEABLE TEXTURE LIGHTING: +// The ability to toggle textured lights has only been added on non-moving +// brushes, with the exception of the func_button. Use of this feature on a +// moving brush is not recommended, but if you find it necessary to do so, +// simply refer to instructions.html in your MHLT directory for information +// on how to set up the functionality yourself. This is a safeguard against +// inexperienced users attempting to implement textured lighting on a moving brush. + +// +// worldspawn +// + +@SolidClass = worldspawn : "World entity" +[ + message(string) : "Map Description / Title" + skyname(string) : "environment map (cl_skyname)" + sounds(integer) : "CD track to play" : 1 + light(integer) : "Default light level" + WaveHeight(string) : "Default Wave Height" + MaxRange(string) : "Max viewable distance" : "4096" + chaptertitle(string) : "Chapter Title Message" + startdark(choices) : "Level Fade In" : 0 = + [ + 0 : "No" + 1 : "Yes" + ] + gametitle(choices) : "Display game title" : 0 = + [ + 0 : "No" + 1 : "Yes" + ] + newunit(choices) : "New Level Unit" : 0 = + [ + 0 : "No, keep current" + 1 : "Yes, clear previous levels" + ] + mapteams(string) : "Map Team List" + defaultteam(choices) : "Default Team" : 0 = + [ + 0 : "Fewest Players" + 1 : "First Team" + ] +] + +// +// BaseClasses +// + +@BaseClass = Appearflags +[ + spawnflags(Flags) = + [ + 2048 : "Not in Deathmatch" : 0 + ] +] + +@BaseClass size(0 0 0, 32 32 32) color(80 0 200) base(Appearflags) = Ammo [] + +@BaseClass = Targetname +[ + targetname(target_source) : "Name" +] +@BaseClass = Target +[ + target(target_destination) : "Target" +] +@BaseClass size(-16 -16 0, 16 16 32) color(0 0 200) base(Targetname, Appearflags) = Weapon [] +@BaseClass = Global +[ + globalname(string) : "Global Entity Name" +] + +@BaseClass base(Target) = Targetx +[ + delay(string) : "Delay before trigger" : "0" + killtarget(target_destination) : "KillTarget" +] + +@BaseClass = RenderFxChoices +[ + renderfx(choices) :"Render FX" : 0 = + [ + 0: "Normal" + 1: "Slow Pulse" + 2: "Fast Pulse" + 3: "Slow Wide Pulse" + 4: "Fast Wide Pulse" + 9: "Slow Strobe" + 10: "Fast Strobe" + 11: "Faster Strobe" + 12: "Slow Flicker" + 13: "Fast Flicker" + 5: "Slow Fade Away" + 6: "Fast Fade Away" + 7: "Slow Become Solid" + 8: "Fast Become Solid" + 14: "Constant Glow" + 15: "Distort" + 16: "Hologram (Distort + fade)" + ] +] + +@BaseClass base(RenderFxChoices) = RenderFields +[ + rendermode(choices) : "Render Mode" : 0 = + [ + 0: "Normal" + 1: "Color" + 2: "Texture" + 3: "Glow" + 4: "Solid" + 5: "Additive" + ] + renderamt(integer) : "FX Amount (1 - 255)" + rendercolor(color255) : "FX Color (R G B)" : "0 0 0" +] + +@BaseClass base(Appearflags) size(-16 -16 -36, 16 16 36) color(0 255 0) = PlayerClass [] + +@BaseClass base(Target, Targetname, RenderFields) color(0 200 200) = Monster +[ + TriggerTarget(String) : "TriggerTarget" + TriggerCondition(Choices) : "Trigger Condition" : 0 = + [ + 0 : "No Trigger" + 1 : "See Player, Mad at Player" + 2 : "Take Damage" + 3 : "50% Health Remaining" + 4 : "Death" + 7 : "Hear World" + 8 : "Hear Player" + 9 : "Hear Combat" + 10: "See Player Unconditional" + 11: "See Player, Not In Combat" + ] + spawnflags(Flags) = + [ + 1 : "WaitTillSeen" : 0 + 2 : "Gag" : 0 + 4 : "MonsterClip" : 0 + 16: "Prisoner" : 0 + 128: "WaitForScript" : 0 + 256: "Pre-Disaster" : 0 + 512: "Fade Corpse" : 0 + ] +] + +@BaseClass = TalkMonster +[ + UseSentence(String) : "Use Sentence" + UnUseSentence(String) : "Un-Use Sentence" +] + +@BaseClass size(-16 -16 -16, 16 16 16) = gibshooterbase +[ + targetname (target_source) : "Name" + + // how many pieces to create + m_iGibs(integer) : "Number of Gibs" : 3 + + // delay (in seconds) between shots. If 0, all gibs shoot at once. + delay(string) : "Delay between shots" : "0" + + // how fast the gibs are fired + m_flVelocity(integer) : "Gib Velocity" : 200 + + // Course variance + m_flVariance(string) : "Course Variance" : "0.15" + + // Time in seconds for gibs to live +/- 5% + m_flGibLife(string) : "Gib Life" : "4" + + spawnflags(Flags) = + [ + 1 : "Repeatable" : 0 + ] +] + +@BaseClass = Light +[ + _light(color255) : "Brightness" : "255 255 128 200" + style(Choices) : "Appearance" : 0 = + [ + 0 : "Normal" + 10: "Fluorescent flicker" + 2 : "Slow, strong pulse" + 11: "Slow pulse, noblack" + 5 : "Gentle pulse" + 1 : "Flicker A" + 6 : "Flicker B" + 3 : "Candle A" + 7 : "Candle B" + 8 : "Candle C" + 4 : "Fast strobe" + 9 : "Slow strobe" + ] + pattern(string) : "Custom Appearance" + _fade(integer) : "Fade (ZHLT)" + _falloff(integer) : "Falloff 1-2 (ZHLT)" +] + +@BaseClass base(Targetname,Global) = Breakable +[ + target(target_destination) : "Target on break" + health(integer) : "Strength" : 1 + material(choices) :"Material type" : 0 = + [ + 0: "Glass" + 1: "Wood" + 2: "Metal" + 3: "Flesh" + 4: "Cinder Block" + 5: "Ceiling Tile" + 6: "Computer" + 7: "Unbreakable Glass" + 8: "Rocks" + ] + explosion(choices) : "Gibs Direction" : 0 = + [ + 0: "Random" + 1: "Relative to Attack" + ] + delay(string) : "Delay before fire" : "0" + gibmodel(studio) : "Gib Model" : "" + spawnobject(choices) : "Spawn On Break" : 0 = + [ + 0: "Nothing" + 1: "Battery" + 2: "Healthkit" + 3: "9mm Handgun" + 4: "9mm Clip" + 5: "Machine Gun" + 6: "Machine Gun Clip" + 7: "Machine Gun Grenades" + 8: "Shotgun" + 9: "Shotgun Shells" + 10: "Crossbow" + 11: "Crossbow Bolts" + 12: "357" + 13: "357 clip" + 14: "RPG" + 15: "RPG Clip" + 16: "Gauss clip" + 17: "Hand grenade" + 18: "Tripmine" + 19: "Satchel Charge" + 20: "Snark" + 21: "Hornet Gun" + ] + explodemagnitude(integer) : "Explode Magnitude (0=none)" : 0 +] + +@BaseClass base(Appearflags, Targetname, RenderFields, Global) = Door +[ + killtarget(target_destination) : "KillTarget" + speed(integer) : "Speed" : 100 + master(string) : "Master" + movesnd(choices) : "Move Sound" : 0 = + [ + 0: "No Sound" + 1: "Servo (Sliding)" + 2: "Pneumatic (Sliding)" + 3: "Pneumatic (Rolling)" + 4: "Vacuum" + 5: "Power Hydraulic" + 6: "Large Rollers" + 7: "Track Door" + 8: "Snappy Metal Door" + 9: "Squeaky 1" + 10: "Squeaky 2" + ] + stopsnd(choices) : "Stop Sound" : 0 = + [ + 0: "No Sound" + 1: "Clang with brake" + 2: "Clang reverb" + 3: "Ratchet Stop" + 4: "Chunk" + 5: "Light airbrake" + 6: "Metal Slide Stop" + 7: "Metal Lock Stop" + 8: "Snappy Metal Stop" + ] + wait(integer) : "delay before close, -1 stay open " : 4 + lip(integer) : "Lip" + dmg(integer) : "Damage inflicted when blocked" : 0 + message(string) : "Message if triggered" + target(target_destination) : "Target" + delay(integer) : "Delay before fire" + netname(string) : "Fire on Close" + health(integer) : "Health (shoot open)" : 0 + spawnflags(flags) = + [ + 1 : "Starts Open" : 0 + 4 : "Don't link" : 0 + 8: "Passable" : 0 + 32: "Toggle" : 0 + 256:"Use Only" : 0 + 512: "Monsters Can't" : 0 + + // These flags were going to go in, but are currently implemented. + // You can make a door invisible on the ground by using a func_seethrough and setting player alpha to 0 + //1024: "Fade for commander" : 0 + //2048: "Invisible from ground" : 0 + ] + // NOTE: must be duplicated in BUTTON + locked_sound(choices) : "Locked Sound" : 0 = + [ + 0: "None" + 2: "Access Denied" + 8: "Small zap" + 10: "Buzz" + 11: "Buzz Off" + 12: "Latch Locked" + ] + unlocked_sound(choices) : "Unlocked Sound" : 0 = + [ + 0: "None" + 1: "Big zap & Warmup" + 3: "Access Granted" + 4: "Quick Combolock" + 5: "Power Deadbolt 1" + 6: "Power Deadbolt 2" + 7: "Plunger" + 8: "Small zap" + 9: "Keycard Sound" + 10: "Buzz" + 13: "Latch Unlocked" + ] + locked_sentence(choices) : "Locked Sentence" : 0 = + [ + 0: "None" + 1: "Gen. Access Denied" + 2: "Security Lockout" + 3: "Blast Door" + 4: "Fire Door" + 5: "Chemical Door" + 6: "Radiation Door" + 7: "Gen. Containment" + 8: "Maintenance Door" + 9: "Broken Shut Door" + ] + unlocked_sentence(choices) : "Unlocked Sentence" : 0 = + [ + 0: "None" + 1: "Gen. Access Granted" + 2: "Security Disengaged" + 3: "Blast Door" + 4: "Fire Door" + 5: "Chemical Door" + 6: "Radiation Door" + 7: "Gen. Containment" + 8: "Maintenance area" + ] + _minlight(string) : "Minimum light level" +] + +@BaseClass base(Targetname, Target, RenderFields, Global) = BaseTank +[ + spawnflags(flags) = + [ + 1 : "Active" : 0 + 16: "Only Direct" : 0 + 32: "Controllable" : 0 + ] + + // Mainly for use with 1009 team settings (game_team_master) + master(string) : "(Team) Master" + + yawrate(string) : "Yaw rate" : "30" + yawrange(string) : "Yaw range" : "180" + yawtolerance(string) : "Yaw tolerance" : "15" + pitchrate(string) : "Pitch rate" : "0" + pitchrange(string) : "Pitch range" : "0" + pitchtolerance(string) : "Pitch tolerance" : "5" + barrel(string) : "Barrel Length" : "0" + barrely(string) : "Barrel Horizontal" : "0" + barrelz(string) : "Barrel Vertical" : "0" + spritesmoke(string) : "Smoke Sprite" : "" + spriteflash(string) : "Flash Sprite" : "" + spritescale(string) : "Sprite scale" : "1" + rotatesound(sound) : "Rotate Sound" : "" + firerate(string) : "Rate of Fire" : "1" + bullet_damage(string) : "Damage Per Bullet" : "0" + persistence(string) : "Firing persistence" : "1" + firespread(choices) : "Bullet accuracy" : 0 = + [ + 0: "Perfect Shot" + 1: "Small cone" + 2: "Medium cone" + 3: "Large cone" + 4: "Extra-large cone" + ] + minRange(string) : "Minmum target range" : "0" + maxRange(string) : "Maximum target range" : "0" + _minlight(string) : "Minimum light level" +] + +@BaseClass = PlatSounds +[ + movesnd(choices) : "Move Sound" : 0 = + [ + 0: "No Sound" + 1: "big elev 1" + 2: "big elev 2" + 3: "tech elev 1" + 4: "tech elev 2" + 5: "tech elev 3" + 6: "freight elev 1" + 7: "freight elev 2" + 8: "heavy elev" + 9: "rack elev" + 10: "rail elev" + 11: "squeek elev" + 12: "odd elev 1" + 13: "odd elev 2" + ] + stopsnd(choices) : "Stop Sound" : 0 = + [ + 0: "No Sound" + 1: "big elev stop1" + 2: "big elev stop2" + 3: "freight elev stop" + 4: "heavy elev stop" + 5: "rack stop" + 6: "rail stop" + 7: "squeek stop" + 8: "quick stop" + ] + volume(string) : "Sound Volume 0.0 - 1.0" : "0.85" +] + +@BaseClass base(Targetname, RenderFields, Global, PlatSounds) = Trackchange +[ + height(integer) : "Travel altitude" : 0 + spawnflags(flags) = + [ + 1: "Auto Activate train" : 0 + 2: "Relink track" : 0 + 8: "Start at Bottom" : 0 + 16: "Rotate Only" : 0 + 64: "X Axis" : 0 + 128: "Y Axis" : 0 + ] + rotation(integer) : "Spin amount" : 0 + train(target_destination) : "Train to switch" + toptrack(target_destination) : "Top track" + bottomtrack(target_destination) : "Bottom track" + speed(integer) : "Move/Rotate speed" : 0 +] + +@BaseClass base(Target, Targetname) = Trigger +[ + killtarget(target_destination) : "Kill target" + netname(target_destination) : "Target Path" + master(string) : "Master" + sounds(choices) : "Sound style" : 0 = + [ + 0 : "No Sound" + ] + delay(string) : "Delay before trigger" : "0" + message(string) : "Message (set sound too!)" + spawnflags(flags) = + [ + 1: "Monsters" : 0 + 2: "No Clients" : 0 + 4: "Pushables": 0 + ] +] + +@BaseClass = Angles [ + angles(string) : "Pitch Yaw Roll (Y Z X)" : "0 0 0" +] + +@BaseClass = ZHLTLightFlags [ + zhlt_lightflags(choices) :"Light Flags (Zhlt 2.2+)" : 0 = [ + 0: "Normal" + 1: "Embedded Fix" + 2: "Opaque (Blocks Light)" + 3: "Opaque + Embedded Fix" + ] + light_origin(string) : "Light Origin (Zhlt 2.2+)" + zhlt_customshadow(string) : "Custom Shadow (MHLT)" : "0.0 0.0 0.0" +] + +// +// Entities +// + +@PointClass iconsprite("sprites/speaker.spr") base(Targetname) = ambient_generic : "Universal Ambient" +[ + message(sound) : "WAV Name" + health(integer) : "Volume (10 = loudest)" : 10 + preset(choices) :"Dynamic Presets" : 0 = + [ + 0: "None" + 1: "Huge Machine" + 2: "Big Machine" + 3: "Machine" + 4: "Slow Fade in" + 5: "Fade in" + 6: "Quick Fade in" + 7: "Slow Pulse" + 8: "Pulse" + 9: "Quick pulse" + 10: "Slow Oscillator" + 11: "Oscillator" + 12: "Quick Oscillator" + 13: "Grunge pitch" + 14: "Very low pitch" + 15: "Low pitch" + 16: "High pitch" + 17: "Very high pitch" + 18: "Screaming pitch" + 19: "Oscillate spinup/down" + 20: "Pulse spinup/down" + 21: "Random pitch" + 22: "Random pitch fast" + 23: "Incremental Spinup" + 24: "Alien" + 25: "Bizzare" + 26: "Planet X" + 27: "Haunted" + ] + volstart(integer) : "Start Volume" : 0 + fadein(integer) : "Fade in time (0-100)" : 0 + fadeout(integer) : "Fade out time (0-100)" : 0 + pitch(integer) : "Pitch (> 100 = higher)" : 100 + pitchstart(integer) : "Start Pitch" : 100 + spinup(integer) : "Spin up time (0-100)" : 0 + spindown(integer) : "Spin down time (0-100)" : 0 + lfotype(integer) : "LFO type 0)off 1)sqr 2)tri 3)rnd" : 0 + lforate(integer) : "LFO rate (0-1000)" : 0 + lfomodpitch(integer) : "LFO mod pitch (0-100)" : 0 + lfomodvol(integer) : "LFO mod vol (0-100)" : 0 + cspinup(integer) : "Incremental spinup count" : 0 + spawnflags(flags) = + [ + 1: "Play Everywhere" : 0 + 2: "Small Radius" : 0 + 4: "Medium Radius" : 1 + 8: "Large Radius" : 0 + 16:"Start Silent":0 + 32:"Is NOT Looped":0 + ] +] + +@SolidClass base(Target) = button_target : "Target Button" +[ + spawnflags(flags) = + [ + 1: "Use Activates" : 1 + 2: "Start On" : 0 + ] + master(string) : "Master" + renderfx(choices) :"Render FX" : 0 = + [ + 0: "Normal" + 1: "Slow Pulse" + 2: "Fast Pulse" + 3: "Slow Wide Pulse" + 4: "Fast Wide Pulse" + 9: "Slow Strobe" + 10: "Fast Strobe" + 11: "Faster Strobe" + 12: "Slow Flicker" + 13: "Fast Flicker" + 5: "Slow Fade Away" + 6: "Fast Fade Away" + 7: "Slow Become Solid" + 8: "Fast Become Solid" + 14: "Constant Glow" + 15: "Distort" + 16: "Hologram (Distort + fade)" + ] + rendermode(choices) : "Render Mode" : 0 = + [ + 0: "Normal" + 1: "Color" + 2: "Texture" + 3: "Glow" + 4: "Solid" + 5: "Additive" + ] + renderamt(integer) : "FX Amount (1 - 255)" + rendercolor(color255) : "FX Color (R G B)" : "0 0 0" +] + + +// +// cyclers +// + +@PointClass base(Targetname, Angles) size(-16 -16 0, 16 16 72) studio() = cycler : "Monster Cycler" +[ + model(studio) : "Model" + renderfx(choices) :"Render FX" : 0 = + [ + 0: "Normal" + 1: "Slow Pulse" + 2: "Fast Pulse" + 3: "Slow Wide Pulse" + 4: "Fast Wide Pulse" + 9: "Slow Strobe" + 10: "Fast Strobe" + 11: "Faster Strobe" + 12: "Slow Flicker" + 13: "Fast Flicker" + 5: "Slow Fade Away" + 6: "Fast Fade Away" + 7: "Slow Become Solid" + 8: "Fast Become Solid" + 14: "Constant Glow" + 15: "Distort" + 16: "Hologram (Distort + fade)" + ] + rendermode(choices) : "Render Mode" : 0 = + [ + 0: "Normal" + 1: "Color" + 2: "Texture" + 3: "Glow" + 4: "Solid" + 5: "Additive" + ] + renderamt(integer) : "FX Amount (1 - 255)" + rendercolor(color255) : "FX Color (R G B)" : "0 0 0" +] + +@PointClass base(Targetname, Angles) sprite() = cycler_sprite : "Sprite Cycler" +[ + model(sprite) : "Sprite" + framerate(integer) : "Frames per second" : 10 + renderfx(choices) :"Render FX" : 0 = + [ + 0: "Normal" + 1: "Slow Pulse" + 2: "Fast Pulse" + 3: "Slow Wide Pulse" + 4: "Fast Wide Pulse" + 9: "Slow Strobe" + 10: "Fast Strobe" + 11: "Faster Strobe" + 12: "Slow Flicker" + 13: "Fast Flicker" + 5: "Slow Fade Away" + 6: "Fast Fade Away" + 7: "Slow Become Solid" + 8: "Fast Become Solid" + 14: "Constant Glow" + 15: "Distort" + 16: "Hologram (Distort + fade)" + ] + rendermode(choices) : "Render Mode" : 0 = + [ + 0: "Normal" + 1: "Color" + 2: "Texture" + 3: "Glow" + 4: "Solid" + 5: "Additive" + ] + renderamt(integer) : "FX Amount (1 - 255)" + rendercolor(color255) : "FX Color (R G B)" : "0 0 0" +] + +@PointClass base(Monster, Angles) size(-16 -16 -16, 16 16 16) studio() = cycler_weapon : "Weapon Cycler" +[ + model(studio) : "model" +] + +// +// Environmental effects +// + +@BaseClass = BeamStartEnd +[ + LightningStart(target_destination) : "Start Entity" + LightningEnd(target_destination) : "Ending Entity" +] +@PointClass base(Targetname, BeamStartEnd, RenderFxChoices) size(-16 -16 -16, 16 16 16) = env_beam : "Energy Beam Effect" +[ + renderamt(integer) : "Brightness (1 - 255)" : 100 + rendercolor(color255) : "Beam Color (R G B)" : "0 0 0" + Radius(integer) : "Radius" : 256 + life(string) : "Life (seconds 0 = infinite)" : "1" + BoltWidth(integer) : "Width of beam (pixels*0.1 0-255)" : 20 + NoiseAmplitude(integer) : "Amount of noise (0-255)" : 0 + texture(sprite) : "Sprite Name" : "sprites/laserbeam.spr" + TextureScroll(integer) : "Texture Scroll Rate (0-100)" : 35 + framerate(integer) : "Frames per 10 seconds" : 0 + framestart(integer) : "Starting Frame" : 0 + StrikeTime(string) : "Strike again time (secs)" : "1" + damage(string) : "Damage / second" : "0" + spawnflags(flags) = + [ + 1 : "Start On" : 0 + 2 : "Toggle" : 0 + 4 : "Random Strike" : 0 + 8 : "Ring" : 0 + 16: "StartSparks" : 0 + 32: "EndSparks" : 0 + 64: "Decal End" : 0 + 128: "Shade Start" : 0 + 256: "Shade End" : 0 + ] +] + +@SolidClass base(Targetname) = env_bubbles : "Bubble Volume" +[ + density(integer) : "Bubble density" : 2 + frequency(integer) : "Bubble frequency" : 2 + current(integer) : "Speed of Current" : 0 + spawnflags(Flags) = + [ + 1 : "Start Off" : 0 + ] +] + +@PointClass base(Targetname) size(-16 -16 -16, 16 16 16) = env_explosion : "Explosion" +[ + iMagnitude(Integer) : "Magnitude" : 100 + spawnflags(flags) = + [ + 1: "No Damage" : 0 + 2: "Repeatable" : 0 + 4: "No Fireball" : 0 + 8: "No Smoke" : 0 + 16: "No Decal" : 0 + 32: "No Sparks" : 0 + ] +] + +@PointClass base(Targetname) color(255 255 128) = env_global : "Global State" +[ + globalstate(string) : "Global State to Set" + triggermode(choices) : "Trigger Mode" : 0 = + [ + 0 : "Off" + 1 : "On" + 2 : "Dead" + 3 : "Toggle" + ] + initialstate(choices) : "Initial State" : 0 = + [ + 0 : "Off" + 1 : "On" + 2 : "Dead" + ] + spawnflags(flags) = + [ + 1 : "Set Initial State" : 0 + ] +] + +@PointClass sprite() base(Targetname, RenderFields) size(-4 -4 -4, 4 4 4) color(30 100 0) = env_glow : "Light Glow/Haze" +[ + model(sprite) : "Sprite Name" : "sprites/glow01.spr" + scale(integer) : "Scale" : 1 +] + +@PointClass base(Targetname) = env_fade : "Screen Fade" +[ + spawnflags(flags) = + [ + 1: "Fade From" : 0 + 2: "Modulate" : 0 + 4: "Activator Only" : 0 + ] + duration(string) : "Duration (seconds)" : "2" + holdtime(string) : "Hold Fade (seconds)" : "0" + renderamt(integer) : "Fade Alpha" : 255 + rendercolor(color255) : "Fade Color (R G B)" : "0 0 0" +] + +@PointClass base(Targetname, RenderFxChoices) size(-16 -16 -16, 16 16 16) = env_laser : "Laser Beam Effect" +[ + LaserTarget(target_destination) : "Target of Laser" + renderamt(integer) : "Brightness (1 - 255)" : 100 + rendercolor(color255) : "Beam Color (R G B)" : "0 0 0" + width(integer) : "Width of beam (pixels*0.1 0-255)" : 20 + NoiseAmplitude(integer) : "Amount of noise (0-255)" : 0 + texture(sprite) : "Sprite Name" : "sprites/laserbeam.spr" + EndSprite(sprite) : "End Sprite" : "" + TextureScroll(integer) : "Texture Scroll Rate (0-100)" : 35 + framestart(integer) : "Starting Frame" : 0 + damage(string) : "Damage / second" : "100" + spawnflags(flags) = + [ + 1 : "Start On" : 0 + 16: "StartSparks" : 0 + 32: "EndSparks" : 0 + 64: "Decal End" : 0 + ] +] + +@PointClass base(Targetname, Target) = env_message : "HUD Text Message" +[ + message(string) : "Message Name" + spawnflags(flags) = + [ + 1: "Play Once" : 0 + 2: "All Clients" : 0 + ] + messagesound(sound) : "Sound Effect" + messagevolume(string) : "Volume 0-10" : "10" + messageattenuation(Choices) : "Sound Radius" : 0 = + [ + 0 : "Small Radius" + 1 : "Medium Radius" + 2 : "Large Radius" + 3 : "Play Everywhere" + ] +] + +@PointClass base(Targetname, Target, RenderFields) size(-16 -16 -16, 16 16 16) color(100 100 0) = env_render : "Render Controls" +[ + spawnflags(flags) = + [ + 1: "No Renderfx" : 0 + 2: "No Renderamt" : 0 + 4: "No Rendermode" : 0 + 8: "No Rendercolor" : 0 + ] +] + +@PointClass base(Targetname) = env_shake : "Screen Shake" +[ + spawnflags(flags) = + [ + 1: "GlobalShake" : 0 + ] + amplitude(string) : "Amplitude 0-16" : "4" + radius(string) : "Effect radius" : "500" + duration(string) : "Duration (seconds)" : "1" + frequency(string) : "0.1 = jerk, 255.0 = rumble" : "2.5" +] + +@PointClass base(gibshooterbase, RenderFields) size(-16 -16 -16, 16 16 16) = env_shooter : "Model Shooter" +[ + shootmodel(studio) : "Model or Sprite name" : "" + shootsounds(choices) :"Material Sound" : -1 = + [ + -1: "None" + 0: "Glass" + 1: "Wood" + 2: "Metal" + 3: "Flesh" + 4: "Concrete" + ] + scale(string) : "Gib Sprite Scale" : "" + skin(integer) : "Gib Skin" : 0 +] + +@PointClass iconsprite("sprites/speaker.spr") = env_sound : "DSP Sound" +[ + radius(integer) : "Radius" : 128 + roomtype(Choices) : "Room Type" : 0 = + [ + 0 : "Normal (off)" + 1 : "Generic" + + 2 : "Metal Small" + 3 : "Metal Medium" + 4 : "Metal Large" + + 5 : "Tunnel Small" + 6 : "Tunnel Medium" + 7 : "Tunnel Large" + + 8 : "Chamber Small" + 9 : "Chamber Medium" + 10: "Chamber Large" + + 11: "Bright Small" + 12: "Bright Medium" + 13: "Bright Large" + + 14: "Water 1" + 15: "Water 2" + 16: "Water 3" + + 17: "Concrete Small" + 18: "Concrete Medium" + 19: "Concrete Large" + + 20: "Big 1" + 21: "Big 2" + 22: "Big 3" + + 23: "Cavern Small" + 24: "Cavern Medium" + 25: "Cavern Large" + + 26: "Weirdo 1" + 27: "Weirdo 2" + 28: "Weirdo 3" + ] +] + +@PointClass base(Targetname) size(-16 -16 -16, 16 16 16) = env_spark : "Spark" +[ + MaxDelay(string) : "Max Delay" : "0" + spawnflags(flags) = + [ + 32: "Toggle" : 0 + 64: "Start ON" : 0 + ] +] + +@PointClass sprite() base(Targetname, RenderFields) size(-4 -4 -4, 4 4 4) = env_sprite : "Sprite Effect" +[ + framerate(string) : "Framerate" : "10.0" + model(sprite) : "Sprite Name" : "sprites/glow01.spr" + scale(string) : "Scale" : "" + spawnflags(flags) = + [ + 1: "Start on" : 0 + 2: "Play Once" : 0 + ] +] + +// +// Solid Entities +// + +@SolidClass base(Breakable, RenderFields, ZHLTLightFlags) = func_breakable : "Breakable Object" +[ + spawnflags(flags) = + [ + 1 : "Only Trigger" : 0 + 2 : "Touch" : 0 + 4 : "Pressure" : 0 + 256: "Instant Crowbar" : 1 + ] + _minlight(string) : "Minimum light level" +] + +@SolidClass base(Global,Targetname, Target, RenderFields, ZHLTLightFlags, Angles) = func_button : "Button" +[ + speed(integer) : "Speed" : 5 + health(integer) : "Health (shootable if > 0)" + lip(integer) : "Lip" + master(string) : "Master" + sounds(choices) : "Sounds" : 0 = + [ + 0: "None" + 1: "Big zap & Warmup" + 2: "Access Denied" + 3: "Access Granted" + 4: "Quick Combolock" + 5: "Power Deadbolt 1" + 6: "Power Deadbolt 2" + 7: "Plunger" + 8: "Small zap" + 9: "Keycard Sound" + 10: "Buzz" + 11: "Buzz Off" + 14: "Lightswitch" + ] + wait(integer) : "delay before reset (-1 stay)" : 3 + delay(string) : "Delay before trigger" : "0" + spawnflags(flags) = + [ + 1: "Don't move" : 0 + 32: "Toggle" : 0 + 64: "Sparks" : 0 + 256:"Touch Activates": 0 + ] + locked_sound(choices) : "Locked Sound" : 0 = + [ + 0: "None" + 2: "Access Denied" + 8: "Small zap" + 10: "Buzz" + 11: "Buzz Off" + 12: "Latch Locked" + ] + unlocked_sound(choices) : "Unlocked Sound" : 0 = + [ + 0: "None" + 1: "Big zap & Warmup" + 3: "Access Granted" + 4: "Quick Combolock" + 5: "Power Deadbolt 1" + 6: "Power Deadbolt 2" + 7: "Plunger" + 8: "Small zap" + 9: "Keycard Sound" + 10: "Buzz" + 13: "Latch Unlocked" + 14: "Lightswitch" + ] + locked_sentence(choices) : "Locked Sentence" : 0 = + [ + 0: "None" + 1: "Gen. Access Denied" + 2: "Security Lockout" + 3: "Blast Door" + 4: "Fire Door" + 5: "Chemical Door" + 6: "Radiation Door" + 7: "Gen. Containment" + 8: "Maintenance Door" + 9: "Broken Shut Door" + ] + unlocked_sentence(choices) : "Unlocked Sentence" : 0 = + [ + 0: "None" + 1: "Gen. Access Granted" + 2: "Security Disengaged" + 3: "Blast Door" + 4: "Fire Door" + 5: "Chemical Door" + 6: "Radiation Door" + 7: "Gen. Containment" + 8: "Maintenance area" + ] + _minlight(string) : "Minimum light level" + style(choices) : "Texlight style" : 0 = + [ + 0 : "Normal" + -3: "Grouped" + 10: "Fluorescent flicker" + 2 : "Slow, strong pulse" + 11: "Slow pulse, noblack" + 5 : "Gentle pulse" + 1 : "Flicker A" + 6 : "Flicker B" + 3 : "Candle A" + 7 : "Candle B" + 8 : "Candle C" + 4 : "Fast strobe" + 9 : "Slow strobe" + 12: "Underwater" + ] +] + +@SolidClass base(Global,RenderFields, Targetname, ZHLTLightFlags) = func_conveyor : "Conveyor Belt" +[ + spawnflags(flags) = + [ + 1 : "No Push" : 0 + 2 : "Not Solid" : 0 + ] + speed(string) : "Conveyor Speed" : "100" + _minlight(string) : "Minimum light level" +] + +@SolidClass base(Door, ZHLTLightFlags, Angles) = func_door : "Basic door" [] + +@SolidClass base(Door, ZHLTLightFlags) = func_door_rotating : "Rotating door" +[ + spawnflags(flags) = + [ + 2 : "Reverse Dir" : 0 + 16: "One-way" : 0 + 64: "X Axis" : 0 + 128: "Y Axis" : 0 + ] + distance(integer) : "Distance (deg)" : 90 + angles(string) : "Pitch Yaw Roll (Y Z X)" : "0 0 0" +] + +@SolidClass base(Appearflags, RenderFields) = func_friction : "Surface with a change in friction" +[ + modifier(integer) : "Percentage of standard (0 - 100)" : 15 +] + +@SolidClass base(Targetname, RenderFields, Global, ZHLTLightFlags) = func_guntarget : "Moving platform" +[ + speed(integer) : "Speed (units per second)" : 100 + target(target_source) : "First stop target" + message(target_source) : "Fire on damage" + health(integer) : "Damage to Take" : 0 + _minlight(string) : "Minimum light level" +] + +@SolidClass base(Targetname, RenderFields, ZHLTLightFlags) = func_illusionary : "Fake Wall/Light" +[ + //commanderAlpha(string) : "Alpha for commander (0-255)" : "0" + //playerAlpha(string) : "Alpha for players (0-255)" : "255" + + skin(choices) : "Contents" : -1 = + [ + -1: "Empty" + -7: "Volumetric Light" + ] + _minlight(string) : "Minimum light level" + + spawnflags(flags) = + [ + 1: "Invis from top down" : 0 + 2: "Invis from ground" : 0 + ] + style(choices) : "Texlight style" : 0 = + [ + 0 : "Normal" + -3: "Grouped" + 10: "Fluorescent flicker" + 2 : "Slow, strong pulse" + 11: "Slow pulse, noblack" + 5 : "Gentle pulse" + 1 : "Flicker A" + 6 : "Flicker B" + 3 : "Candle A" + 7 : "Candle B" + 8 : "Candle C" + 4 : "Fast strobe" + 9 : "Slow strobe" + 12: "Underwater" + ] +] + +@SolidClass base(Targetname) = func_ladder : "Ladder" [] + +@SolidClass base(Targetname) = func_mortar_field : "Mortar Field" +[ + m_flSpread(integer) : "Spread Radius" : 64 + m_iCount(integer) : "Repeat Count" : 1 + m_fControl(Choices) : "Targeting" : 0 = + [ + 0 : "Random" + 1 : "Activator" + 2 : "Table" + ] + m_iszXController(target_destination) : "X Controller" + m_iszYController(target_destination) : "Y Controller" +] + +@SolidClass base(Global,Appearflags, Targetname, RenderFields, ZHLTLightFlags) = func_pendulum : "Swings back and forth" +[ + speed(integer) : "Speed" : 100 + distance(integer) : "Distance (deg)" : 90 + damp(integer) : "Damping (0-1000)" : 0 + dmg(integer) : "Damage inflicted when blocked" : 0 + spawnflags(flags) = + [ + 1: "Start ON" : 0 + 8: "Passable" : 0 + 16: "Auto-return" : 0 + 64: "X Axis" : 0 + 128: "Y Axis" : 0 + ] + + _minlight(integer) : "_minlight" + angles(string) : "Pitch Yaw Roll (Y Z X)" : "0 0 0" +] + +@SolidClass base(Targetname,Global,RenderFields, PlatSounds, ZHLTLightFlags, Angles) = func_plat : "Elevator" +[ + spawnflags(Flags) = + [ + 1: "Toggle" : 0 + ] + height(integer) : "Travel altitude (can be negative)" : 0 + speed(integer) : "Speed" : 50 + _minlight(string) : "Minimum light level" +] + +@SolidClass base(Targetname, Global, RenderFields, PlatSounds, ZHLTLightFlags) = func_platrot : "Moving Rotating platform" +[ + spawnflags(Flags) = + [ + 1: "Toggle" : 1 + 64: "X Axis" : 0 + 128: "Y Axis" : 0 + ] + speed(integer) : "Speed of rotation" : 50 + height(integer) : "Travel altitude (can be negative)" : 0 + rotation(integer) : "Spin amount" : 0 + angles(string) : "Pitch Yaw Roll (Y Z X)" : "0 0 0" + _minlight(string) : "Minimum light level" +] + +@SolidClass base(Breakable, RenderFields, ZHLTLightFlags) = func_pushable : "Pushable object" +[ + size(choices) : "Hull Size" : 0 = + [ + 0: "Point size" + 1: "Player size" + 2: "Big Size" + 3: "Player duck" + ] + spawnflags(flags) = + [ + 128: "Breakable" : 0 + ] + friction(integer) : "Friction (0-400)" : 50 + buoyancy(integer) : "Buoyancy" : 20 + _minlight(string) : "Minimum light level" +] + +@SolidClass base(Targetname, Global, RenderFields, ZHLTLightFlags) = func_rot_button : "RotatingButton" +[ + target(target_destination) : "Targetted object" + // changetarget will change the button's target's TARGET field to the button's changetarget. + changetarget(target_destination) : "ChangeTarget Name" + master(string) : "Master" + speed(integer) : "Speed" : 50 + health(integer) : "Health (shootable if > 0)" + sounds(choices) : "Sounds" : 21 = + [ + 21: "Squeaky" + 22: "Squeaky Pneumatic" + 23: "Ratchet Groan" + 24: "Clean Ratchet" + 25: "Gas Clunk" + ] + wait(choices) : "Delay before reset" : 3 = + [ + -1: "Stays pressed" + ] + delay(string) : "Delay before trigger" : "0" + distance(integer) : "Distance (deg)" : 90 + spawnflags(flags) = + [ + 1 : "Not solid" : 0 + 2 : "Reverse Dir" : 0 + 32: "Toggle" : 0 + 64: "X Axis" : 0 + 128: "Y Axis" : 0 + 256:"Touch Activates": 0 + ] + _minlight(integer) : "_minlight" + angles(string) : "Pitch Yaw Roll (Y Z X)" : "0 0 0" +] + +@SolidClass base(Targetname, Global, RenderFields, ZHLTLightFlags) = func_rotating : "Rotating Object" +[ + speed(integer) : "Rotation Speed" : 0 + volume(integer) : "Volume (10 = loudest)" : 10 + fanfriction(integer) : "Friction (0 - 100%)" : 20 + sounds(choices) : "Fan Sounds" : 0 = + [ + 0 : "No Sound" + 1 : "Fast Whine" + 2 : "Slow Rush" + 3 : "Medium Rickety" + 4 : "Fast Beating" + 5 : "Slow Smooth" + ] + message(sound) : "WAV Name" + spawnflags(flags) = + [ + 1 : "Start ON" : 0 + 2 : "Reverse Direction" : 0 + 4 : "X Axis" : 0 + 8 : "Y Axis" : 0 + 16: "Acc/Dcc" : 0 + 32: "Fan Pain" : 0 + 64: "Not Solid" : 0 + 128: "Small Radius" : 0 + 256: "Medium Radius" : 0 + 512: "Large Radius" : 1 + ] + _minlight(integer) : "_minlight" + angles(string) : "Pitch Yaw Roll (Y Z X)" : "0 0 0" + spawnorigin(string) : "X Y Z - Move here after lighting" : "0 0 0" + dmg(integer) : "Damage inflicted when blocked" : 0 +] + +@SolidClass base(BaseTank, ZHLTLightFlags) = func_tank : "Brush Gun Turret" +[ + bullet(choices) : "Bullets" : 0 = + [ + 0: "None" + 1: "9mm" + 2: "MP5" + 3: "12mm" + ] +] + +@SolidClass base(ZHLTLightFlags) = func_tankcontrols : "Tank controls" +[ + target(target_destination) : "Tank entity name" +] + +@SolidClass base(BaseTank, ZHLTLightFlags) = func_tanklaser : "Brush Laser Turret" +[ + laserentity(target_source) : "env_laser Entity" +] + +@SolidClass base(BaseTank, ZHLTLightFlags) = func_tankrocket : "Brush Rocket Turret" [] + + +@SolidClass base(BaseTank, ZHLTLightFlags) = func_tankmortar : "Brush Mortar Turret" +[ + iMagnitude(Integer) : "Explosion Magnitude" : 100 +] + +@SolidClass base(Trackchange) = func_trackautochange : "Automatic track changing platform" +[ + _minlight(string) : "Minimum light level" +] + +@SolidClass base(Trackchange) = func_trackchange : "Train track changing platform" +[ + _minlight(string) : "Minimum light level" +] + +@SolidClass base(Targetname, Global, RenderFields, ZHLTLightFlags) = func_tracktrain : "Track Train" +[ + spawnflags(flags) = + [ + 1 : "No Pitch (X-rot)" : 0 + 2 : "No User Control" : 0 + 8 : "Passable" : 0 + ] + target(target_destination) : "First stop target" + sounds(choices) : "Sound" : 0 = + [ + 0: "None" + 1: "Rail 1" + 2: "Rail 2" + 3: "Rail 3" + 4: "Rail 4" + 5: "Rail 6" + 6: "Rail 7" + ] + wheels(integer) : "Distance between the wheels" : 50 + height(integer) : "Height above track" : 4 + startspeed(integer) : "Initial speed" : 0 + speed(integer) : "Speed (units per second)" : 64 + dmg(integer) : "Damage on crush" : 0 + volume(integer) : "Volume (10 = loudest)" : 10 + bank(string) : "Bank angle on turns" : "0" + _minlight(string) : "Minimum light level" +] + +@SolidClass = func_traincontrols : "Train Controls" +[ + target(target_destination) : "Train Name" +] + +@SolidClass base(Targetname, Global, RenderFields, ZHLTLightFlags, Angles) = func_train : "Moving platform" +[ + target(target_source) : "First stop target" + movesnd(choices) : "Move Sound" : 0 = + [ + 0: "No Sound" + 1: "big elev 1" + 2: "big elev 2" + 3: "tech elev 1" + 4: "tech elev 2" + 5: "tech elev 3" + 6: "freight elev 1" + 7: "freight elev 2" + 8: "heavy elev" + 9: "rack elev" + 10: "rail elev" + 11: "squeek elev" + 12: "odd elev 1" + 13: "odd elev 2" + ] + stopsnd(choices) : "Stop Sound" : 0 = + [ + 0: "No Sound" + 1: "big elev stop1" + 2: "big elev stop2" + 3: "freight elev stop" + 4: "heavy elev stop" + 5: "rack stop" + 6: "rail stop" + 7: "squeek stop" + 8: "quick stop" + ] + speed(integer) : "Speed (units per second)" : 64 + dmg(integer) : "Damage on crush" : 0 + skin(integer) : "Contents" : 0 + volume(string) : "Sound Volume 0.0 - 1.0" : "0.85" + spawnflags(flags) = + [ + 8 : "Not solid" : 0 + ] + _minlight(string) : "Minimum light level" +] + +@SolidClass base(Targetname, Appearflags, RenderFields, Global, ZHLTLightFlags) = func_wall : "Wall" +[ + _minlight(string) : "Minimum light level" + style(choices) : "Texlight style" : 0 = + [ + 0 : "Normal" + -3: "Grouped" + 10: "Fluorescent flicker" + 2 : "Slow, strong pulse" + 11: "Slow pulse, noblack" + 5 : "Gentle pulse" + 1 : "Flicker A" + 6 : "Flicker B" + 3 : "Candle A" + 7 : "Candle B" + 8 : "Candle C" + 4 : "Fast strobe" + 9 : "Slow strobe" + 12: "Underwater" + ] +] + +@SolidClass base(func_wall, ZHLTLightFlags) = func_wall_toggle : "Toggleable geometry" +[ + spawnflags(flags) = + [ + 1 : "Starts Invisible" : 0 + ] +] + +@SolidClass base(Door, Angles) = func_water : "Liquid" +[ + spawnflags(flags) = + [ + 1 : "Starts Open" : 0 + 256:"Use Only" : 0 + ] + skin(choices) : "Contents" : -3 = + [ + -3: "Water" + -4: "Slime" + -5: "Lava" + ] + WaveHeight(string) : "Wave Height" : "3.2" +] + +// +// game entities (requires Half-Life 1.0.0.9) +// + +@PointClass base(Targetname, Targetx) = game_counter : "Fires when it hits limit" +[ + spawnflags(flags) = + [ + 1: "Remove On fire" : 0 + 2: "Reset On fire" : 1 + ] + master(string) : "Master" + frags(integer) : "Initial Value" : 0 + health(integer) : "Limit Value" : 10 +] + +@PointClass base(Targetname, Target) = game_counter_set : "Sets a game_counter" +[ + spawnflags(flags) = + [ + 1: "Remove On fire" : 0 + ] + master(string) : "Master" + frags(integer) : "New Value" : 10 +] + +@PointClass base(Targetname) = game_end : "End this multiplayer game" +[ + master(string) : "Master" +] + +@PointClass base(Targetname) = game_player_equip : "Initial player equipment" +[ + spawnflags(flags) = + [ + 1: "Use Only" : 0 + ] + master(string) : "Team Master" +] + +@PointClass base(Targetname) = game_player_hurt : "Hurts player who fires" +[ + dmg(string) : "Damage To Apply" : "999" + spawnflags(flags) = + [ + 1: "Remove On fire" : 0 + ] + master(string) : "Master" +] + +@PointClass base(Targetname) = game_player_team : "Allows player to change teams" +[ + spawnflags(flags) = + [ + 1 : "Remove On fire" : 0 + 2 : "Kill Player" : 0 + 4 : "Gib Player" : 0 + ] + target(string) : "game_team_master to use" + master(string) : "Master" +] + +@PointClass base(Targetname) = game_score : "Award/Deduct Points" +[ + spawnflags(flags) = + [ + 1: "Allow Negative" : 0 + 2: "Team Points" : 0 + ] + + points(integer) : "Points to add (+/-)" : 1 + master(string) : "Master" +] + +@PointClass base(Targetname, Targetx) = game_team_master : "Team based master/relay" +[ + spawnflags(flags) = + [ + 1: "Remove On fire" : 0 + ] + triggerstate(choices) : "Trigger State" : 0 = + [ + 0: "Off" + 1: "On" + 2: "Toggle" + ] + teamindex(integer) : "Team Index (-1 = no team)" : -1 + master(string) : "Master" +] + +@PointClass base(Targetname, Targetx) = game_team_set : "Sets team of team_master" +[ + spawnflags(flags) = + [ + 1: "Remove On fire" : 0 + ] + master(string) : "Master" +] + +@PointClass base(Targetname, Target) = game_text : "HUD Text Message" +[ + spawnflags(flags) = + [ + 1: "All Players" : 0 + ] + + message(string) : "Message Text" + x(string) : "X (0 - 1.0 = left to right) (-1 centers)" : "-1" + y(string) : "Y (0 - 1.0 = top to bottom) (-1 centers)" : "-1" + effect(Choices) : "Text Effect" : 0 = + [ + 0 : "Fade In/Out" + 1 : "Credits" + 2 : "Scan Out" + ] + color(color255) : "Color1" : "100 100 100" + color2(color255) : "Color2" : "240 110 0" + fadein(string) : "Fade in Time (or character scan time)" : "1.5" + fadeout(string) : "Fade Out Time" : "0.5" + holdtime(string) : "Hold Time" : "1.2" + fxtime(string) : "Scan time (scan effect only)" : "0.25" + channel(choices) : "Text Channel" : 1 = + [ + 1 : "Channel 1" + 2 : "Channel 2" + 3 : "Channel 3" + 4 : "Channel 4" + ] + master(string) : "Master" +] + +@SolidClass base(Targetname) = game_zone_player : "Player Zone brush" +[ + intarget(target_destination) : "Target for IN players" + outtarget(target_destination) : "Target for OUT players" + incount(target_destination) : "Counter for IN players" + outcount(target_destination) : "Counter for OUT players" + // master(string) : "Master" +] + +@PointClass base(gibshooterbase) = gibshooter : "Gib Shooter" [] + +// +// info entities +// + +@PointClass decal() base(Targetname, Appearflags) = infodecal : "Decal" +[ + texture(decal) +] + +@PointClass base(Targetname) size(-24 -24 0, 24 24 16) color(20 190 60) = info_bigmomma : "Big Mamma Node" +[ + spawnflags(Flags) = + [ + 1 : "Run To Node" : 0 + 2 : "Wait Indefinitely" : 0 + ] + target(target_destination) : "Next node" + radius(string) : "Radius" : "0" + reachdelay(string) : "Wait after approach" : "0" + killtarget(target_destination) : "KillTarget" + reachtarget(target_destination) : "Fire on approach" + reachsequence(string) : "Sequence on approach" : "" + health(string) : "Health on approach" : "" + presequence(string) : "Sequence before approach" : "" +] + +@PointClass base(Targetname) = info_null : "info_null (spotlight target)" [] + +@PointClass base(PlayerClass, Angles) size(-32 -32 -54, 32 32 54) studio("models/player/soldier/soldier.mdl") = info_player_start : "Ready room start" [] + +@PointClass base(Targetname) size(-4 -4 -4, 4 4 4) color(200 100 50) = info_target : "Beam Target" [] +@PointClass size(-8 -8 0, 8 8 16) base(PlayerClass, Targetname) = info_teleport_destination : "Teleport destination" [] + +// +// lights +// + +@PointClass iconsprite("sprites/lightbulb.spr") base(Target, Targetname, Light) = light : "Invisible lightsource" +[ + spawnflags(Flags) = [ 1 : "Initially dark" : 0 ] +] + +@PointClass iconsprite("sprites/lightbulb.spr") base(Targetname, Target, Angles) = light_spot : "Spotlight" +[ + _cone(integer) : "Inner (bright) angle" : 30 + _cone2(integer) : "Outer (fading) angle" : 45 + pitch(integer) : "Pitch" : -90 + _light(color255) : "Brightness" : "255 255 128 200" + _sky(Choices) : "Is Sky" : 0 = + [ + 0 : "No" + 1 : "Yes" + ] + spawnflags(Flags) = [ 1 : "Initially dark" : 0 ] + style(Choices) : "Appearance" : 0 = + [ + 0 : "Normal" + 10: "Fluorescent flicker" + 2 : "Slow, strong pulse" + 11: "Slow pulse, noblack" + 5 : "Gentle pulse" + 1 : "Flicker A" + 6 : "Flicker B" + 3 : "Candle A" + 7 : "Candle B" + 8 : "Candle C" + 4 : "Fast strobe" + 9 : "Slow strobe" + ] + pattern(string) : "Custom Appearance" +] + +@PointClass base(Angles) iconsprite("sprites/lightbulb.spr") = light_environment : "Environment" +[ + pitch(integer) : "Pitch" : 0 + _light(color255) : "Brightness" : "255 255 128 200" + _fade(integer) : "Fade (ZHLT)" + _falloff(integer) : "Falloff 1-2 (ZHLT)" + _diffuse_light(color255) : "Diffuse Light (Leave Blank for None)" : "" +] + +@SolidClass base(Door) = momentary_door : "Momentary/Continuous door" +[ + spawnflags(flags) = + [ + 1 : "Starts Open" : 0 + ] +] + +@SolidClass base(RenderFields, Targetname) = momentary_rot_button : "Direct wheel control" +[ + target(target_destination) : "Targetted object" + speed(integer) : "Speed" : 50 + master(string) : "Master" + sounds(choices) : "Sounds" : 0 = + [ + 0: "None" + 1: "Big zap & Warmup" + 2: "Access Denied" + 3: "Access Granted" + 4: "Quick Combolock" + 5: "Power Deadbolt 1" + 6: "Power Deadbolt 2" + 7: "Plunger" + 8: "Small zap" + 9: "Keycard Sound" + 21: "Squeaky" + 22: "Squeaky Pneumatic" + 23: "Ratchet Groan" + 24: "Clean Ratchet" + 25: "Gas Clunk" + ] + distance(integer) : "Distance (deg)" : 90 + returnspeed(integer) : "Auto-return speed" : 0 + spawnflags(flags) = + [ + 1: "Door Hack" : 0 + 2: "Not useable" : 0 + 16: "Auto Return" : 0 + 64: "X Axis" : 0 + 128: "Y Axis" : 0 + ] + _minlight(integer) : "_minlight" + angles(string) : "Pitch Yaw Roll (Y Z X)" : "0 0 0" +] + +@PointClass base(Targetname) color(255 128 0) = multi_manager : "MultiTarget Manager" +[ + spawnflags(Flags) = + [ + 1 : "multithreaded" : 0 + ] +] + +@PointClass base(Targetname, Target) color(128 255 128) = multisource : "Multisource" +[ + globalstate(string) : "Global State Master" +] + +@PointClass base(Targetname) size(16 16 16) color(247 181 82) = path_corner : "Moving platform stop" +[ + spawnflags(Flags) = + [ + 1: "Wait for retrigger" : 0 + 2: "Teleport" : 0 + 4: "Fire once" : 0 + ] + target(target_destination) : "Next stop target" + message(target_destination) : "Fire On Pass" + wait(integer) : "Wait here (secs)" : 0 + speed(integer) : "New Train Speed" : 0 + yaw_speed(integer) : "New Train rot. Speed" : 0 + angles(string) : "X Y Z angles" +] + +@PointClass base(Targetname) size(16 16 16) = path_track : "Train Track Path" +[ + spawnflags(Flags) = + [ + 1: "Disabled" : 0 + 2: "Fire once" : 0 + 4: "Branch Reverse" : 0 + 8: "Disable train" : 0 + ] + target(target_destination) : "Next stop target" + message(target_destination) : "Fire On Pass" + altpath(target_destination) : "Branch Path" + netname(target_destination) : "Fire on dead end" + speed(integer) : "New Train Speed" : 0 +] + +// +// Triggers +// + +@PointClass base(Targetx) = trigger_auto : "AutoTrigger" +[ + spawnflags(Flags) = + [ + 1 : "Remove On fire" : 1 + ] + globalstate(string) : "Global State to Read" + triggerstate(choices) : "Trigger State" : 0 = + [ + 0 : "Off" + 1 : "On" + 2 : "Toggle" + ] +] + +@PointClass base(Targetx, Targetname) = trigger_camera : "Trigger Camera" +[ + wait(integer) : "Hold time" : 10 + moveto(string) : "Path Corner" + spawnflags(flags) = + [ + 1: "Start At Player" : 1 + 2: "Follow Player" : 1 + 4: "Freeze Player" : 0 + ] + speed(string) : "Initial Speed" : "0" + acceleration(string) : "Acceleration units/sec^2" : "500" + deceleration(string) : "Stop Deceleration units/sec^2" : "500" +] + +@PointClass base(Targetx, Targetname) = trigger_changetarget : "Trigger Change Target" +[ + m_iszNewTarget(string) : "New Target" +] + +@SolidClass base(Trigger, Targetname) = trigger_counter : "Trigger counter" +[ + spawnflags(flags) = + [ + 1 : "No Message" : 0 + ] + master(string) : "Master" + count(integer) : "Count before activation" : 2 +] + +@SolidClass base(Targetname) = trigger_endsection : "EndSection Trigger" +[ + section(string) : "Section" + spawnflags(flags) = + [ + 1: "USE Only" : 0 + ] +] + +@SolidClass base(Trigger) = trigger_gravity : "Trigger Gravity" +[ + gravity(integer) : "Gravity (0-1)" : 1 +] + +@SolidClass base(Targetname,Target) = trigger_hurt : "Trigger player hurt" +[ + spawnflags(flags) = + [ + 1: "Target Once" : 0 + 2: "Start Off" : 0 + 8: "No clients" : 0 + 16:"FireClientOnly" : 0 + 32:"TouchClientOnly" : 0 + ] + master(string) : "Master" + dmg(integer) : "Damage" : 10 + delay(string) : "Delay before trigger" : "0" + damagetype(choices) : "Damage Type" : 0 = + [ + 0 : "GENERIC" + 1 : "CRUSH" + 2 : "BULLET" + 4 : "SLASH" + 8 : "BURN" + 16 : "FREEZE" + 32 : "FALL" + 64 : "BLAST" + 128 : "CLUB" + 256 : "SHOCK" + 512 : "SONIC" + 1024 : "ENERGYBEAM" + 16384: "DROWN" + 32768 : "PARALYSE" + 65536 : "NERVEGAS" + 131072 : "POISON" + 262144 : "RADIATION" + 524288 : "DROWNRECOVER" + 1048576 : "CHEMICAL" + 2097152 : "SLOWBURN" + 4194304 : "SLOWFREEZE" + ] +] + +@SolidClass base(Trigger) = trigger_multiple : "Trigger: Activate multiple" +[ + wait(integer) : "Delay before reset" : 10 +] + +@SolidClass base(Trigger) = trigger_once : "Trigger: Activate once" [] + +@SolidClass base(Trigger) = trigger_push : "Trigger player push" +[ + spawnflags(flags) = + [ + 1: "Once Only" : 0 + 2: "Start Off" : 0 + ] + speed(integer) : "Speed of push" : 40 +] + +@PointClass base(Targetname, Targetx) = trigger_relay : "Trigger Relay" +[ + spawnflags(flags) = + [ + 1: "Remove On fire" : 0 + ] + triggerstate(choices) : "Trigger State" : 0 = + [ + 0: "Off" + 1: "On" + 2: "Toggle" + ] +] + +@SolidClass base(Trigger) = trigger_teleport : "Trigger teleport" [] + +@SolidClass base(Targetname) = trigger_transition : "Trigger: Select Transition Area" [] + +// ZHLT 2.5.3 Merl's Custom Build 1.7 Custom Entity Support + +@PointClass size(-8 -8 0, 8 8 32) = info_compile_parameters : "Compile Options" +[ + hlcsg(choices) : "HLCSG" : 1 = + [ + 1 : "Normal" + 2 : "Onlyents" + 0 : "Off" + ] + hlbsp(choices) : "HLBSP" : 1 = + [ + 0 : "Off" + 1 : "Normal" + 2 : "Leakonly" + ] + hlvis(choices) : "HLVIS" : 2 = + [ + 0 : "Off" + 1 : "Fast" + 2 : "Normal" + 3 : "Full" + ] + hlrad(choices) : "HLRAD" : 1 = + [ + 0 : "Off" + 1 : "Normal" + 2 : "Extra" + ] + texdata(string) : "Texture Data Memory (in KB)" : "4096" + estimate(choices) : "Estimate Compile Times?" : 0 = + [ + 0: "Yes" + 1: "No" + ] + bounce(integer) : "Number of radiosity bounces" : 0 + ambient(string) : "Ambient world light (0.0 to 1.0, R G B)" : "0 0 0" + smooth(integer) : "Smoothing threshold (in degrees)" : 0 + dscale(integer) : "Direct Lighting Scale" : 1 + chop(integer) : "Chop Size" : 64 + texchop(integer) : "Texture Light Chop Size" : 32 + hullfile(string) : "Custom Hullfile" + priority(choices) : "Priority Level" : 0 = + [ + 0 : "Normal" + 1 : "High" + -1 : "Low" + ] + wadautodetect(choices) : "Wad Auto Detect" : 0 = + [ + 0 : "Off" + 1 : "On" + ] + wadconfig(string) : "Custom Wad Configuration" : "" + verbose(choices) : "Verbose compile messages" : 0 = + [ + 0 : "Off" + 1 : "On" + ] + noclipeconomy(choices) : "Strip Uneeded Clipnodes?" : 1 = + [ + 1 : "Yes" + 0 : "No" + ] + nocliphull(choices) : "Generate clipping hulls" : 0 = + [ + 0 : "Yes" + 1 : "No" + ] + noskyclip(choices) : "No Sky Clip" : 0 = + [ + 1 : "On" + 0 : "Off" + ] + sparse(choices) : "Vismatrix Method" : 2 = + [ + 0 : "No Vismatrix" + 1 : "Sparse Vismatrix" + 2 : "Normal" + ] + circus(choices) : "Circus RAD lighting" : 0 = + [ + 0 : "Off" + 1 : "On" + ] +] + +@PointClass color(255 128 0) = info_texlights : "Texture Light Config" [] + + + +////////////////////////////////////// +// Final Natural Selection entities // +////////////////////////////////////// +@BaseClass size(-8 -8 -8, 8 8 8) = ParticleSystem +[ +] + +//@PointClass base(ParticleSystem, Targetname) = env_particles : "Particle system" +//[ +// // This is the name to use from the appropriate .ps +// particleSystemName(string) : "Name (from .ps)" : "TheEffect" +// +// // Misc. particle flags +// spawnFlags(flags) = +// [ +// 1 : "start on" : 1 +// ] +//] + +@PointClass base(ParticleSystem, Targetname) = env_particles_custom : "Custom particle system" +[ + // Use this source if possible + pGenSource(string) : "Generation entity" : "" + + // Generation shape + pGenShape(choices) : "Generation shape" : 0 = + [ + 0: "Point" + 4: "Box" + 5: "Sphere" + 8: "Blob" + ] + + // Generation parms + pGenShapeParams(string) : "Generation shape parms" : "" + + // Particle generation rate + pGenRate(integer) : "Generation rate (parts/second)" : 50 + + // Particle sprite + pSprite(sprite) : "Particle sprite" : "" + + // Num sprite frames + pSpriteNumFrames(integer) : "Animation frames in sprite" : 1 + + // Max number of particles + pNumParticles(integer) : "Maximum particles" : 50 + + // Particle size + pSize(string) : "Particle size" : "1.0" + + // Particle system lifetime + pSystemLifetime(string) : "System lifetime (-1 infinite)" : "-1" + + // Particle lifetime + pLifetime(string) : "Particle lifetime (-1 infinite)" : "-1" + + // Starting velocity shape + pVelShape(choices) : "Starting velocity shape" : 2 = + [ + 1: "Point" + 2: "Box" + 3: "Sphere" + 4: "Blob" + ] + + // Starting velocity + pVelParams(string) : "Starting velocity params" : "0,0,0,0,0,0,0,0" + + // Scaling + pScale(string) : "Scale particle over lifetime" : "1.0" + + // Max alpha + pMaxAlpha(string) : "Particle max alpha" : "1.0" + + // Particle render mode + pRenderMode(choices) : "Render mode" : 5 = + [ + 0 : "Normal" + 1 : "Trans color -> (c*a+dest*(1-a))" + 2 : "Trans texture -> (src*a+dest*(1-a))" + 3 : "Glow -> (normal?)" + 4 : "Trans alpha -> (src*srca+dest*(1-srca))" + 5 : "Additive -> (src*a+dest)" + ] + + // Particle system to generate on collision + pPSToGen(string) : "Generate system on collision" : "" + + // Animation speed + pAnimationSpeed(string) : "Animation speed" : "1" + + // TODO: add fields for entities to collide with + //collideEntityOne(string) : "Collide entity #1" : "" + //collideEntityTwo(string) : "Collide entity #2" : "" + + // Misc. particle flags + spawnFlags(flags) = + [ + 1 : "start on" : 1 + 2 : "particle density" : 0 + 4 : "fade in" : 0 + 8 : "fade out" : 1 + 16 : "use world grav" : 0 + 32 : "tri, not quads" : 0 + //64 : "minimize edges" : 1 + 128 : "constrain pitch" : 0 + 256 : "collide" : 0 + 512 : "high-detail only" : 1 + 1024 : "face up" : 0 + ] +] + +@PointClass size(-16 -16 -16, 16 16 16) = env_gamma : "Desired map gamma" +[ + desiredgamma(string) : "Gamma ramp" : "2" +] + +@SolidClass base(Targetname, RenderFields) = func_weldable : "Weldable" +[ + weldableHealth(string) : "Health (-1 infinite)" : "-1" + + weldableTime(string) : "Seconds to weld" : "20" + + material(choices) :"Explosion material" : 0 = + [ + 0: "Glass" + 1: "Wood" + 2: "Metal" + 3: "Flesh" + 4: "Cinder Block" + 5: "Ceiling Tile" + 6: "Computer" + 7: "Unbreakable Glass" + 8: "Rocks" + ] + + //targetOnFinish(string) : "Target to trigger on finish" : "" + + targetOnFinish(target_destination) : "Target to trigger on finish" : "" + + targetOnBreak(target_destination) : "Target on break" + + targetOnUse(target_destination) : "Target on use (toggle only)" + + spawnFlags(flags) = + [ + 1 : "start enabled" : 1 + 2 : "weld opens, not closes" : 0 + ] +] + +@SolidClass base(Targetname, ZHLTLightFlags) = func_seethrough : "SeeThrough" +[ + commanderAlpha(string) : "Alpha for commander (0-255)" : "0" + playerAlpha(string) : "Alpha for players (0-255)" : "255" + style(choices) : "Texlight style" : 0 = + [ + 0 : "Normal" + -3: "Grouped" + 10: "Fluorescent flicker" + 2 : "Slow, strong pulse" + 11: "Slow pulse, noblack" + 5 : "Gentle pulse" + 1 : "Flicker A" + 6 : "Flicker B" + 3 : "Candle A" + 7 : "Candle B" + 8 : "Candle C" + 4 : "Fast strobe" + 9 : "Slow strobe" + 12: "Underwater" + ] +] + +@SolidClass base(Door, ZHLTLightFlags, Angles) = func_seethroughdoor : "SeeThrough (door)" +[ + commanderAlpha(string) : "Alpha for commander (0-255)" : "0" + playerAlpha(string) : "Alpha for players (0-255)" : "255" +] + +@PointClass size(-24 -24 -4, 24 24 4) base(Targetname, Angles) studio() = func_resource +[ + model(studio) : "Model" : "models/b_resource_nozzle.mdl" + resourcepoints(integer) : "Num resources" : 200 + targetOnBuild(target_destination) : "Target on build" + targetOnDestroy(target_destination) : "Target on destroy" +] + +//@SolidClass base(Targetname) = func_viewheight : "Commander view height" +//[ +//] + +//@SolidClass base(Targetname) = func_waypoint : "Floor to use for orders" +//[ +//] + +@SolidClass base(Targetname) = func_nobuild : "Blocks orders and building" +[ +] + +@BaseClass size(-16 -16 -36, 16 16 36) color(0 255 0) = TeamChoice +[ + teamchoice(choices) : "Team" : 1 = + [ + 1 : "Team one" + 2 : "Team two" + ] +] + +@PointClass base(info_player_start, TeamChoice) color(0 0 128) studio() = info_team_start : "Marine/Alien start" [] + +@SolidClass base(Targetname) = info_spectate : "Activate spectator mode" [] + +@SolidClass base(TeamChoice) = info_join_team : "A player touches this to join team one (marine default)" [] + +@SolidClass base(Targetname) = info_join_autoassign : "A player touches this to be auto-assigned a team" [] + +@SolidClass base(Targetname) = info_leave_game : "A player touches this go back to the ready room, remembering that he was on this team" [] + +@PointClass base(Targetname) size(-16 -16 -16, 16 16 16) = target_mp3audio : "Plays a sound" +[ + soundname(string) : "Sound (sound/file.mp3)" : "" + soundvolume(integer) : "Volume (0-255)" : 255 + fadedistance(integer) : "Fade distance (inaudible here)" : 1000 + + spawnflags(Flags) = + [ + 1 : "Don't fade volume" : 0 + 2 : "Looping" : 0 + 4 : "Start on" : 0 + ] +] + +@PointClass base(Targetname) size(-16 -16 -16, 16 16 16) = info_mapinfo : "Playable map size, for commander mini-map and scrolling" +[ + viewheight(integer) : "View height (for commander)" : 0 + minviewheight(integer) : "Min map Z (black background)" : -1000 + minx(integer) : "Minimum X" : -4000 + miny(integer) : "Minimum Y" : -4000 + maxx(integer) : "Maximum X" : 4000 + maxy(integer) : "Maximum Y" : 4000 + culldistance(integer) : "Top down XY cull distance" : 1024 + + spawnflags(Flags) = + [ + 1 : "No background" : 0 + ] +] + +@PointClass base(Targetname) size(-16 -16 -16, 16 16 16) = info_gameplay : "Changes game balance" +[ + teamone(choices) : "Team one type" : 1 = + [ + 1 : "Human" + 2 : "Alien" + ] + + teamtwo(choices) : "Team two type" : 2 = + [ + 1 : "Human" + 2 : "Alien" + ] +] + +@PointClass base(Targetname) = trigger_random +[ + minfiretime(string) : "shortest fire time" : 0 + maxfiretime(string) : "longest fire time" : 1 + wait(integer) : "delay before reset (-1 stay)" : 3 + balancedtarget(string) : "target for tournament play" : "" + + spawnflags(Flags) = + [ + 1 : "Start on" : 0 + 2 : "Toggle" : 0 + 4: "Remove On fire" : 0 + ] +] + +@SolidClass base(Targetname) = trigger_presence +[ + master(string) : "Master" : "" + targetenter(string) : "Activation target" : "" + targetleave(string) : "Deactivation target" : "" + momentarytarget(string) : "momentary_door to target" + momentaryopentime(string) : "seconds to open over (small = fast)" : "1.0" + momentaryclosetime(string) : "seconds to close over (small = fast)" : "1.0" + timebeforeleave(string) : "time before leave fires" : ".5" + + spawnflags(Flags) = + [ + 1 : "No clients" : 0 + 2 : "No monsters" : 0 + 4 : "No pushables" : 0 + 8 : "Team 1 only" : 0 + 16 : "Team 2 only" : 0 + ] +] + +@PointClass base(Targetname) = trigger_script +[ + scriptname(string) : "Script name" : "" + spawnflags(Flags) = + [ + 1 : "Start on" : 0 + ] +] + +@SolidClass = info_location +[ + locationname(string) : "Location name" : "" +] + +// NS base classes +@BaseClass = SpawnDeathTarget +[ + targetonspawn(string) : "Target on spawn" : "" + targetondeath(string) : "Target on death" : "" +] + +@BaseClass size(-16 -16 0, 16 16 42) color(0 0 200) base(TeamChoice, Angles) = BasePlayerEquipment +[ + lifetime(integer) : "Lifetime (0 for infinite, -1 for NS default)" : 0 +] + +// Structures +@BaseClass base(TeamChoice, Angles, SpawnDeathTarget) = BaseBuildable +[ + spawnflags(Flags) = + [ + 1 : "Starts built" : 1 + ] +] + +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 70) studio("models/b_commandstation.mdl") = team_command : "Command station" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 15) studio("models/b_infportal.mdl") = team_infportal : "Infantry portal" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 15) studio("models/b_phasegate.mdl") = phasegate : "Phase gate" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 67) studio("models/b_resourcetower.mdl") = resourcetower : "Marine resource tower" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 62) studio("models/b_turretfactory.mdl") = team_turretfactory : "Turret factory" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 62) studio("models/b_armory.mdl") = team_armory : "Armory" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 67) studio("models/b_armslab.mdl") = team_armslab : "Arms lab" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 68) studio("models/b_prototypelab.mdl") = team_prototypelab : "Prototype lab" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 81) studio("models/b_observatory.mdl") = team_observatory : "Observatory" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 42) studio("models/b_sentry.mdl") = turret : "Sentry turret" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 62) studio("models/b_siege.mdl") = siegeturret : "Automated Siege Cannon (ASC)" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 67) studio("models/ba_resource.mdl") = alienresourcetower : "Alien resource tower" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 44) studio("models/ba_offense.mdl") = offensechamber : "Offense chamber" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 44) studio("models/ba_defense.mdl") = defensechamber : "Defense chamber" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 44) studio("models/ba_sensory.mdl") = sensorychamber : "Sensory chamber" [] +@PointClass base(BaseBuildable) size(-16 -16 0, 16 16 44) studio("models/ba_movement.mdl") = movementchamber : "Movement chamber" [] +@PointClass base(BaseBuildable) size(-80 -80 -145, 80 80 50) studio("models/hive.mdl") = team_hive : "Hive" +[ + maxspawndistance(integer) : "Spawn distance" : 2000 +] +// TODO: Advanced armory +// TODO: Advanced turret factory + +// Marine weapons +@PointClass base(BasePlayerEquipment) studio("models/w_mg.mdl") = weapon_machinegun : "Machine gun" [] +@PointClass base(BasePlayerEquipment) studio("models/w_hg.mdl") = weapon_pistol : "Pistol" [] +@PointClass base(BasePlayerEquipment) studio("models/w_hmg.mdl") = weapon_heavymachinegun : "Heavy machine gun" [] +@PointClass base(BasePlayerEquipment) studio("models/w_gg.mdl") = weapon_grenadegun : "Grenade launcher" [] +@PointClass base(BasePlayerEquipment) studio("models/w_sg.mdl") = weapon_shotgun : "Shotgun" [] +@PointClass base(BasePlayerEquipment) studio("models/w_welder.mdl") = weapon_welder : "Welder" [] +@PointClass base(BasePlayerEquipment) studio("models/w_mine2.mdl") = weapon_mine : "Pack of mines" [] + +// Equipment +@PointClass base(BasePlayerEquipment) studio("models/w_health.mdl") = item_health : "Health pack" [] +//@PointClass base(BasePlayerEquipment) studio("models/w_ammo.mdl") = item_genericammo : "Ammo" [] +@PointClass base(BasePlayerEquipment) studio("models/w_jetpack.mdl") = item_jetpack : "Jetpack" [] +@PointClass base(BasePlayerEquipment) studio("models/w_heavy.mdl") = item_heavyarmor : "Heavy armor" [] +//@PointClass base(BasePlayerEquipment) studio("models/w_mine.mdl") = item_mine : "Deployed mine" [] + + + diff --git a/main/ns.ico b/main/ns.ico new file mode 100644 index 00000000..0c71a76a Binary files /dev/null and b/main/ns.ico differ diff --git a/main/ns.ps b/main/ns.ps new file mode 100644 index 00000000..8cbb1313 --- /dev/null +++ b/main/ns.ps @@ -0,0 +1,2020 @@ +' avh particle systems + +start pSystemName ShotgunSmoke + ' Max number of particles + pNumParticles = 1 + + ' size + pSize = 20 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 10 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 3 + + ' Particle sprite + pSprite = sprites/lightsmoke.spr + + ' particle max alpha + pMaxAlpha = .6 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (fade in, fade out) + pSpawnFlags = 12 + + ' system lifetime + pSystemLifetime = .1 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -2,-2,0,2,2,10,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle lifetime + pLifetime = 1.0 + + ' Gen rate + pGenRate = 40 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Point + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName WelderLightSmoke + ' Max number of particles + pNumParticles = 1 + + ' size + pSize = 8 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 11 + + ' Particle base color + pBaseColor = .2 .2 .2 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 3 + + ' Particle sprite + pSprite = sprites/weldsmoke.spr + + ' system lifetime + pSystemLifetime = .1 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -5,-5,5,5,5,40,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle max alpha + particleMaxAlpha = .2 + + ' particle lifetime + pLifetime = .5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' Gen rate + pGenRate = 40 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -2,-2,-2,2,2,2,0,0 +end + +start pSystemName WelderHeavySmoke + ' Max number of particles + pNumParticles = 1 + + ' size + pSize = 8 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 16 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .8 + + ' Particle sprite + pSprite = sprites/steam1.spr + + ' system lifetime + pSystemLifetime = .1 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -8,-8,5,8,8,40,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle max alpha + particleMaxAlpha = .2 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = .8 + + ' Gen rate + pGenRate = 40 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Point + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + + +' This plasma just stays still to give that hot blue magma look +start pSystemName WelderBluePlasma + ' Max number of particles + pNumParticles = 1 + + ' size + pSize = 8 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 11 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .5 + + ' Particle sprite + pSprite = sprites/xspark1.spr + + ' system lifetime + pSystemLifetime = .5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = 0,0,0,0,0,0,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = 1 + + ' Gen rate + pGenRate = 40 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -2,-2,-2,2,2,2,0,0 +end + +start pSystemName WelderBluePlasmaDrops + ' Max number of particles + pNumParticles = 4 + + ' size + pSize = 6 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 1 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .5 + + ' Particle sprite + pSprite = sprites/welddrip.spr + + ' system lifetime + pSystemLifetime = .5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -20,-20,0,20,20,-10,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 24 + + ' particle lifetime + pLifetime = 1 + + ' Gen rate + pGenRate = 40 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Point + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName HeavyMGSmoke + ' Max number of particles + pNumParticles = 1 + + ' size + pSize = 20 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 10 + + ' Particle base color + pBaseColor = .5 .5 .5 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 1 + + ' Particle sprite + pSprite = sprites/lightsmoke.spr + + ' particle max alpha + particleMaxAlpha = .4 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (fade in, fade out) + pSpawnFlags = 12 + + ' system lifetime + pSystemLifetime = .1 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -2,-2,0,2,2,3,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle lifetime + pLifetime = .5 + + ' Gen rate + pGenRate = 40 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Point + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName TeleportEffect + ' Max number of particles + pNumParticles = 60 + + ' size + pSize = 14 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 1 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .25 + + ' Particle sprite + pSprite = sprites/nsteleport.spr + + ' system lifetime + pSystemLifetime = .5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = 0,0,150,0,0,-150,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + '128: "constrain pitch" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = 1 + + ' Gen rate + pGenRate = 800 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -20,-20,-10,20,20,45,0,0 +end + +start pSystemName CommandHack + + ' Max number of particles + pNumParticles = 30 + + ' size + pSize = 15 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 1 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .03 + + ' Particle sprite + pSprite = sprites/blueball.spr + + ' system lifetime + pSystemLifetime = .5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -10,-10,-10,0,10,10,10,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = 2 + + ' Gen rate + pGenRate = 800 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -12,-12,-25,12,12,25,0,0 +end + +start pSystemName PhaseInEffect2 + ' Max number of particles + pNumParticles = 30 + + ' size + pSize = 10 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 11 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 1 + + ' Particle sprite + pSprite = sprites/xspark4.spr + + ' system lifetime + pSystemLifetime = .5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -15,-15,0,15,15,20,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = 1.2 + + ' Gen rate + pGenRate = 800 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -15,-15,-25,15,15,25,0,0 +end + +start pSystemName SpitHit + ' Max number of particles + pNumParticles = 12 + + ' size + pSize = 5 + + ' number of times to loop through an animated texture + pAnimationSpeed = 3 + + ' num frames in sprite + pSpriteNumFrames = 3 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .3 + + ' Particle sprite + pSprite = sprites/bigspit.spr + + ' system lifetime + pSystemLifetime = .3 + + ' starting velocity + pVelShape = Point + + ' starting velocity parms + pVelParams = 0,0,50,0,0,0,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 2 + + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 24 + + ' particle lifetime + pLifetime = .8 + + ' Gen rate + pGenRate = 200 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -20,-5,-5,5,20,16,0,0 +end + + +start pSystemName SpitShoot + ' Max number of particles + pNumParticles = 10 + + ' size + pSize = 2 + + ' number of times to loop through an animated texture + pAnimationSpeed = 3 + + ' num frames in sprite + pSpriteNumFrames = 3 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 2 + + ' Particle sprite + pSprite = sprites/bigspit.spr + + ' system lifetime + pSystemLifetime = .3 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -10,-10,0,10,10,0,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 2 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 24 + + ' particle lifetime + pLifetime = .8 + + ' Gen rate + pGenRate = 200 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Point + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName SpikeHit + ' Max number of particles + 'pNumParticles = 8 + pNumParticles = 4 + + ' size + pSize = 16 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 11 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 2.5 + + ' Particle sprite + 'pSprite = sprites/spithit.spr + pSprite = sprites/spikehit.spr + + ' system lifetime + pSystemLifetime = .3 + + ' starting velocity + pVelShape = Point + + ' starting velocity parms + pVelParams = 0,0,0,0,0,0,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle max alpha + particleMaxAlpha = .2 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + 'pSpawnFlags = 24 + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = .4 + + ' Gen rate + pGenRate = 200 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -10,-10,-15,10,10,10,0,0 +end + +start pSystemName SporeShoot + ' Max number of particles + pNumParticles = 10 + + ' size + pSize = 2 + + ' number of times to loop through an animated texture + pAnimationSpeed = 3 + + ' num frames in sprite + pSpriteNumFrames = 9 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 2 + + ' Particle sprite + pSprite = sprites/spore.spr + + ' system lifetime + pSystemLifetime = .3 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -10,-10,0,10,10,0,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 24 + + ' particle lifetime + pLifetime = .8 + + ' Gen rate + pGenRate = 200 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Point + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName SporeCloud + ' Max number of particles + pNumParticles = 20 + + ' size + pSize = 45 + + ' number of times to loop through an animated texture + pAnimationSpeed = 6 + + ' num frames in sprite + pSpriteNumFrames = 17 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 3 + + ' Particle sprite + pSprite = sprites/spore.spr + + ' system lifetime + pSystemLifetime = 1.0 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -5,-5,-5,5,5,5,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = 8 + + ' Gen rate + pGenRate = 30 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -125,-125,-125,125,125,125,0,0 +end + + +start pSystemName MeleeDamage + ' Max number of particles + pNumParticles = 8 + + ' size + pSize = 3 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 1 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 1 + + ' Particle sprite + pSprite = sprites/meleehit.spr + + ' system lifetime + pSystemLifetime = .5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -50,-50,-50,50,50,60,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 24 + + ' particle lifetime + pLifetime = .4 + + ' Gen rate + pGenRate = 40 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Point + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName PhaseGateIdle + ' Max number of particles + pNumParticles = 40 + + ' size + pSize = 20 + + ' number of times to loop through an animated texture + pAnimationSpeed = 2 + + ' num frames in sprite + pSpriteNumFrames = 20 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .2 + + ' Particle sprite + pSprite = sprites/flare6.spr + + ' system lifetime + pSystemLifetime = 1.0 + + ' starting velocity + pVelShape = box + + ' starting velocity parms + pVelParams = 0,0,0,0,0,20,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle max alpha + particleMaxAlpha = 1 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 12 + + ' particle lifetime + pLifetime = 2 + + ' Gen rate + pGenRate = 20 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -20,-20,-20,20,20,40,0,0 +end + +start pSystemName ResourceEmission + ' Max number of particles + pNumParticles = 100 + + ' size + pSize = 6 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 1 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 5.0 + + ' Particle sprite + pSprite = sprites/flare3.spr + + ' system lifetime + pSystemLifetime = -1 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -5,-5,20,5,5,80,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle max alpha + particleMaxAlpha = .4 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out) + pSpawnFlags = 9 + + ' particle lifetime + pLifetime = 1.5 + + ' Gen rate + pGenRate = 20 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Point + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName UmbraCloud + ' Max number of particles + pNumParticles = 20 + + ' size + pSize = 40 + + ' number of times to loop through an animated texture + pAnimationSpeed = 6 + + ' num frames in sprite + pSpriteNumFrames = 17 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 3 + + ' Particle sprite + pSprite = sprites/umbra.spr + + ' system lifetime + pSystemLifetime = 1.0 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -5,-5,-5,5,5,5,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' particle lifetime (same as umbra cloud duration) + pLifetime = 3 + + ' Gen rate + pGenRate = 50 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -100,-100,-100,100,100,100,0,0 +end + +start pSystemName AcidHit + ' Max number of particles + pNumParticles = 50 + + ' size + pSize = 25 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 12 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 3 + + ' Particle sprite + pSprite = sprites/acidsplash.spr + + ' system lifetime + pSystemLifetime = .3 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = 200,200,250,-200,-200,-20,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + 'pSpawnFlags = 24 + pSpawnFlags = 24 + + ' particle lifetime + pLifetime = .8 + + ' Gen rate + pGenRate = 600 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -8,-8,-8,8,8,8,0,0 +end + +start pSystemName BacteriaSpray + ' Max number of particles + pNumParticles = 6 + + ' size + pSize = 20 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 6 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 4 + + ' Particle sprite + pSprite = sprites/bacteria.spr + + ' system lifetime + pSystemLifetime = 1 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = 0,0,0,0,0,0,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + 'pSpawnFlags = 24 + pSpawnFlags = 12 + + ' particle lifetime + pLifetime = .8 + + ' Gen rate + pGenRate = 4 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -30,-30,-20,30,30,20,0,0 +end + +start pSystemName Xenocide + ' Max number of particles + pNumParticles = 50 + + ' size + pSize = 15 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 25 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 5 + + ' Particle sprite + pSprite = sprites/eexplo.spr + + ' system lifetime + pSystemLifetime = .3 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = 240,240,30,-240,-240,-20,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + 'pSpawnFlags = 24 + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = .7 + + ' Gen rate + pGenRate = 800 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -12,-12,-8,12,12,8,0,0 +end + +start pSystemName BileBomb + ' Max number of particles + pNumParticles = 50 + + ' size + pSize = 15 + + ' number of times to loop through an animated texture + pAnimationSpeed = 2 + + ' num frames in sprite + pSpriteNumFrames = 10 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 8 + + ' Particle sprite + pSprite = sprites/bilebomb.spr + + ' system lifetime + pSystemLifetime = 0.5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -200,-200,150,200,200,400,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 24 + + ' particle lifetime + pLifetime = 1.2 + + ' Gen rate + pGenRate = 800 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -8,-8,-8,8,8,8,0,0 +end + +start pSystemName PhaseInEffect + ' Max number of particles + pNumParticles = 40 + + ' size + pSize = 35 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 1 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .2 + + ' Particle sprite + pSprite = sprites/hack.spr + + ' system lifetime + pSystemLifetime = 1.2 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -40,-40,-40,40,40,40,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + 'pSpawnFlags = 24 + pSpawnFlags = 12 + + ' particle lifetime + pLifetime = 1.2 + + ' Gen rate + pGenRate = 20 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -10,-10,-10,10,10,10,0,0 +end + +start pSystemName ScanEffect + ' Max number of particles + pNumParticles = 10 + + ' size + pSize = 10 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 1 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 100 + + ' Particle sprite + pSprite = sprites/scan.spr + + ' system lifetime + pSystemLifetime = 10 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = 0,0,0,0,0,0,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + '128: "constrain pitch" + '512: "high-detail only" + '1024: "face up" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 1032 + + ' particle lifetime + pLifetime = 1.5 + + ' Gen rate + pGenRate = 1 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = 0,0,20,0,0,20,0,0 +end + +start pSystemName JetpackEffect + ' Max number of particles + pNumParticles = 4 + + ' size + pSize = 12 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 15 + + ' Particle base color + pBaseColor = .2 .2 .2 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .5 + + ' Particle sprite + pSprite = sprites/blink2.spr + + ' system lifetime + pSystemLifetime = .5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = 0,0,-20,0,0,-30,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle max alpha + particleMaxAlpha = .1 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = 2 + + ' Gen rate + pGenRate = 1 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName SmokePuffs + ' Max number of particles + pNumParticles = 5 + + ' size + pSize = 7 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 10 + + ' Particle base color + pBaseColor = .2 .2 .2 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 4 + + ' Particle sprite + pSprite = sprites/turretsmoke.spr + + ' system lifetime + pSystemLifetime = .5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -1,-1,2,1,1,20,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle max alpha + particleMaxAlpha = .1 + + ' particle lifetime + pLifetime = 1.5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + '512: "high-detail only" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 520 + + ' Gen rate + pGenRate = 2 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -4,-4,-2,4,4,2,0,0 +end + +start pSystemName ChamberDeath + ' Max number of particles + pNumParticles = 25 + + ' size + pSize = 15 + + ' number of times to loop through an animated texture + pAnimationSpeed = 2 + + ' num frames in sprite + pSpriteNumFrames = 10 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 4 + + ' Particle sprite + pSprite = sprites/chamberdeath.spr + + ' system lifetime + pSystemLifetime = 0.5 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -100,-100,75,100,100,400,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 24 + + ' particle lifetime + pLifetime = .6 + + ' Gen rate + pGenRate = 800 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -8,-8,-8,8,8,8,0,0 +end + +start pSystemName HiveDeath + ' Max number of particles + pNumParticles = 50 + + ' size + pSize = 15 + + ' number of times to loop through an animated texture + pAnimationSpeed = 2 + + ' num frames in sprite + pSpriteNumFrames = 10 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 4 + + ' Particle sprite + pSprite = sprites/chamberdeath.spr + + ' system lifetime + pSystemLifetime = 0.8 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = -100,-100,75,100,100,400,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 24 + + ' particle lifetime + pLifetime = 1.2 + + ' Gen rate + pGenRate = 800 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -64,-64,-64,64,64,64,0,0 +end + +start pSystemName StompEffect + ' Max number of particles + pNumParticles = 2 + + ' size + pSize = 10 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 1 + + ' Particle base color + pBaseColor = 1 1 1 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 20 + + ' Particle sprite + pSprite = sprites/stomp.spr + + ' system lifetime + pSystemLifetime = .2 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = 0,0,0,0,0,0,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + '128: "constrain pitch" + '512: "high-detail only" + '1024: "face up" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 1032 + + ' particle lifetime + pLifetime = .5 + + ' Gen rate + pGenRate = 50 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params (this is offset a bit because stomp originates at Onos center) + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName PheromoneEffect + ' Max number of particles + pNumParticles = 1 + + ' size + pSize = 30 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 1 + + ' Particle base color + pBaseColor = .2 .2 .2 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = .8 + + ' Particle sprite + pSprite = sprites/pheromone.spr + + ' system lifetime + pSystemLifetime = .1 + + ' starting velocity + pVelShape = Point + + ' starting velocity parms + pVelParams = 0,0,0,0,0,0,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle max alpha + particleMaxAlpha = .1 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + ' flags (start on, fade in, fade out, triangles) + pSpawnFlags = 8 + + ' particle lifetime + pLifetime = 10 + + ' Gen rate + pGenRate = 10 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = 0,0,0,0,0,0,0,0 +end + +start pSystemName StompSmoke + ' Max number of particles + pNumParticles = 1 + + ' size + pSize = 20 + + ' number of times to loop through an animated texture + pAnimationSpeed = 1 + + ' num frames in sprite + pSpriteNumFrames = 10 + + ' Particle base color + pBaseColor = .2 .2 .2 + + ' Scale by the lifetime, so it will eventually be pScale*pSize right before it dies + pScale = 4 + + ' Particle sprite + pSprite = sprites/lightsmoke.spr + + ' system lifetime + pSystemLifetime = .1 + + ' starting velocity + pVelShape = Box + + ' starting velocity parms + pVelParams = 0,0,5,0,0,10,0,0 + + ' render mode + ' 0 = kRenderNormal + ' 1 = kRenderTransColor, // c*a+dest*(1-a) + ' 2 = kRenderTransTexture, // src*a+dest*(1-a) + ' 3 = kRenderGlow, // src*a+dest -- No Z buffer checks + ' 4 = kRenderTransAlpha, // src*srca+dest*(1-srca) + ' 5 = kRenderTransAdd, // src*a+dest + pRenderMode = 5 + + ' particle max alpha + particleMaxAlpha = .1 + + ' particle lifetime + pLifetime = .7 + + '1 : "start on" + '2 : "particle density" + '4 : "fade in" + '8 : "fade out" + '16 : "use world gravity" + '32 : "tri, not quads" + '64 : "minimize edges" + '128: "constrain pitch" + '512: "high-detail only" + '1024: "face up" + ' fade out, high detail + pSpawnFlags = 520 + + ' Gen rate + pGenRate = 40 + + ' Gen shape (one of: Point, Line, Triangle, Plane, Box, Cylinder, Cone, Blob, Disc, Rectangle, None) + pGenShape = Box + + ' Gen params + pGenShapeParams = -40,-40,0,40,40,10,0,0 +end + + + diff --git a/main/ns.qrk b/main/ns.qrk new file mode 100644 index 00000000..9e37c49e Binary files /dev/null and b/main/ns.qrk differ diff --git a/main/ns.wad b/main/ns.wad new file mode 100644 index 00000000..9988a762 Binary files /dev/null and b/main/ns.wad differ diff --git a/main/ns2.wad b/main/ns2.wad new file mode 100644 index 00000000..d6df62eb Binary files /dev/null and b/main/ns2.wad differ diff --git a/main/ns_ayumi.wad b/main/ns_ayumi.wad new file mode 100644 index 00000000..eac63cd5 Binary files /dev/null and b/main/ns_ayumi.wad differ diff --git a/main/ns_bast.wad b/main/ns_bast.wad new file mode 100644 index 00000000..4151c5d9 Binary files /dev/null and b/main/ns_bast.wad differ diff --git a/main/ns_context.qrk b/main/ns_context.qrk new file mode 100644 index 00000000..6ab09787 Binary files /dev/null and b/main/ns_context.qrk differ diff --git a/main/ns_delta.wad b/main/ns_delta.wad new file mode 100644 index 00000000..0b632508 Binary files /dev/null and b/main/ns_delta.wad differ diff --git a/main/ns_eclipse.wad b/main/ns_eclipse.wad new file mode 100644 index 00000000..56481e48 Binary files /dev/null and b/main/ns_eclipse.wad differ diff --git a/main/ns_eon.wad b/main/ns_eon.wad new file mode 100644 index 00000000..7efd2491 Binary files /dev/null and b/main/ns_eon.wad differ diff --git a/main/ns_eon_b6.wad b/main/ns_eon_b6.wad new file mode 100644 index 00000000..84ca9605 Binary files /dev/null and b/main/ns_eon_b6.wad differ diff --git a/main/ns_hera.wad b/main/ns_hera.wad new file mode 100644 index 00000000..fa4301d9 Binary files /dev/null and b/main/ns_hera.wad differ diff --git a/main/ns_lost.wad b/main/ns_lost.wad new file mode 100644 index 00000000..f2497624 Binary files /dev/null and b/main/ns_lost.wad differ diff --git a/main/ns_metal.wad b/main/ns_metal.wad new file mode 100644 index 00000000..9e441668 Binary files /dev/null and b/main/ns_metal.wad differ diff --git a/main/ns_nancy.wad b/main/ns_nancy.wad new file mode 100644 index 00000000..70fbcc23 Binary files /dev/null and b/main/ns_nancy.wad differ diff --git a/main/ns_nothing.wad b/main/ns_nothing.wad new file mode 100644 index 00000000..938f119a Binary files /dev/null and b/main/ns_nothing.wad differ diff --git a/main/ns_tanith.wad b/main/ns_tanith.wad new file mode 100644 index 00000000..98e4ff74 Binary files /dev/null and b/main/ns_tanith.wad differ diff --git a/main/nshulls.txt b/main/nshulls.txt new file mode 100644 index 00000000..b13e2465 --- /dev/null +++ b/main/nshulls.txt @@ -0,0 +1,3 @@ +32 32 72 +64 64 108 +32 32 36 diff --git a/main/readme.txt b/main/readme.txt new file mode 100644 index 00000000..404956f0 --- /dev/null +++ b/main/readme.txt @@ -0,0 +1,181 @@ +-------------------------------------------------------------------------- +- Natural Selection - http://www.natural-selection.org - v2.0 - 07/30/03 - +-------------------------------------------------------------------------- + +The NS Team +----------- + +Charles "Flayra" Cleveland +flayra@overmind.org +Project leader, programming, game design + +Cory "Squeal Like A Pig" Strader +cory.strader@verizon.net +Lead artist - World concept, level textures, player textures, structure design and textures + +Josh McHugh +vze2chp9@verizon.net +Artist - Alien player models, shotgun model, marine equipment models + +Mike Wislocki +mike@squarewaveinteractive.com +Artist - Flash, marine weapons + +Kevin "Relic25" Roberts +relic25@ec.rr.com +Level designer, 2D art, particle effects, ns_bast + +Jon "Merkaba" Chapman +merkaba@onthebog.net +Level designer, level tech R&D, 2D art, ns_hera + +Ned "MonsieurEvil" Pyle +monsieurevil@natural-selection.org +Public relations, network engineer, system maintainence, general, Jack of All Trades + +Jeff Paris +jparis@ngenre.com +Writer, world-builder, manual + +Alex "Mojo" Boylan +mojo@planethalflife.com +Animator - building animations, alien animations + +Phil "Def One" Mayfield +alien_51@hotmail.com +Animator - Most player animations, all view model animations, trailer CG + +Joe "joev" Vaughan +joev@jarhedz.com +Site admin, database programmer, DBA, linux helper + +Max McGuire +mmcguire@ironlore.com +Additional programming + + +Other credits +------------- +Jeremy Soule +jeremy@jeremysoule.com +Music + +Andrew King +andrew@squarewaveinteractive.com +Flash + +Adam Otcasek +adam@squarewaveinteractive.com +Website design + +Guy "smedic" Rabiller +grabiller@3dvf.net +Alien player animations + +Scott "Superfly" Haraldsen +haraldsen@earthlink.net +Sound effects (game and trailer) + +Dave "MaDMaXX" Monks +Dave@MaDMaXX.Demon.co.uk +Additional sound effects + +Oliver "Hypergrip" Richter +Hypergrip@gmx.de +Additional ambient music + +Max Mcgill +maxtoo@earthlink.net +Marine voice acting + +Lani Minella +lani@audiogodz.com +Alien, Hive and Commander voice acting + +Hugo "[Dr]Hugo" Silvério +drhugo@uol.com.br +Player animations + +Nelson "manah" Ferryman +manah@planethalflife.com +Mapper - ns_caged + +Andrew "KungFuSquirrel" Weldon +aweldon@planethalflife.com +Mapper - ns_eclipse, ns_veil, extra work on ns_nothing + +Galen "DevilDog" Surlak-Ramsey +devildog@planetavp.com +Mapper - ns_nancy (RIP) + +Ken "Ken20Banks" Banks +ken20banks@yahoo.com +Mapper - ns_nothing + +Tom "tommyd" Dilazaro +tjd159@psu.edu +Mapper - ns_tanith + +Mike "Cadaver" Rosser +mike@cadaveruk.fsnet.co.uk +Mapper - ns_origin + +Marty "Greedo386" Rolek +mrolek@ucla.edu +Mapper - ns_lost + +Jake "Ekaj" Griffith +ekaj_niop@hotmail.com +Mapper - ns_mineshaft + +Mark "Fam" James +fam@readyroom.org +Manual layout + +Daniel "Coil" Johnson +danj@Princeton.EDU +Slideshow, miscellaneous other stuff + +Gareth "Grendel" Eckley +games_design@hotmail.com +Playtest lead + + +Natural Selection uses technology from: +--------------------------------------- +VALVe software (HL engine) +FMOD (music playback) +http://www.cs.unc.edu/~davemc/Particle (particle engine) +Sound Ideas - The General 6000 (source sound library) + + +Special thanks to: +------------------ +Coffee +Mom & Dad +VALVe software +Chris and Elaine Kakambouras +Dave McAllister +Bitchslap, and Clan F.o.R. +Iron Lore Entertainment +Adrenaline Zone (www.adrenzone.com) +Gamespy and PlanetHalflife +Josh Buck +Steve Ashley +Jason Childress +Russell "Doomaniac" Weed +Nick "Crinity" Coombe +Nemesis Zero +Maria "Mara" Cruzado +The NS IRC operators (Commando, eBnar, Insane, Necrotic, pielemius, Scythe, shoven, BoZman20, chalupamonk, Cyanide, DOOManiac, Kenichi, KungFuSquirrel, Mouse, Us3r) +The NS Forum Admins and Moderators (Coil, Comprox, Nemesis Zero, SpyderMonkey, Fam, Greedo386, humbaba, Marik Steele, rob6264, Talesin) +Stainless Steel Studios +Thai Hut +Beran Peters +The NS playtesters, veterans, and beta server ops (we couldn't have done it without you!) + +Natural Selection and all content is Copyright (C) 2003 Charles G. Cleveland +"Natural Selection" is a trademark owned by Charles G. Cleveland + + +Natural Selection is dedicated to Siobhan Colhoun, RIP \ No newline at end of file diff --git a/main/resource/ClientScheme.res b/main/resource/ClientScheme.res new file mode 100644 index 00000000..a3d13fd1 --- /dev/null +++ b/main/resource/ClientScheme.res @@ -0,0 +1,1137 @@ +// +// TRACKER SCHEME RESOURCE FILE +// +// sections: +// colors - all the colors used by the scheme +// basesettings - contains settings for app to use to draw controls +// fonts - list of all the fonts used by app +// borders - description of all the borders +// +// notes: +// hit ctrl-alt-shift-R in the app to reload this file +// +Scheme +{ + //Name - currently overriden in code + //{ + // "Name" "ClientScheme" + //} + + //////////////////////// COLORS /////////////////////////// + Colors + { + // base colors + "BaseText" "255 176 0 255" // used in text windows, lists + "BrightBaseText" "255 176 0 255" // brightest text + "SelectedText" "255 176 0 255" // selected text + "DimBaseText" "255 176 0 255" // dim base text + "LabelDimText" "255 176 0 164" // used for info text + "ControlText" "255 176 0 255" // used in all text controls + // "BrightControlText" "255 176 0 255" // use for selected controls + "BrightControlText" "255 255 255 255" // use for selected controls + "DisabledText1" "80 48 0 255" // disabled text + "DisabledText2" "0 0 0 0" // overlay color for disabled text (to give that inset look) + "DimListText" "188 112 0 255" // offline friends, unsubscribed games, etc. + + // background colors + "ControlBG" "0 0 0 0" // background color of controls + "ControlDarkBG" "0 0 0 128" // darker background color; used for background of scrollbars + "WindowBG" "0 0 0 200" // background color of text edit panes (chat, text entries, etc.) + "SelectionBG" "192 28 0 140" // background color of any selected text or menu item + "SelectionBG2" "70 12 0 0" // selection background in window w/o focus + "ListBG" "0 0 0 128" // background of scoreboard + "ViewportBG" "55 43 29 140" + + // titlebar colors + "TitleText" "255 174 0 255" + "TitleDimText" "255 174 0 255" + "TitleBG" "255 255 0 0" + "TitleDimBG" "255 255 0 0" + + // slider tick colors + "SliderTickColor" "127 140 127 255" + "SliderTrackColor" "31 31 31 255" + + // border colors + "BorderBright" "64 52 36 255" // the lit side of a control + "BorderDark" "64 52 36 255" // the dark/unlit side of a control + "BorderSelection" "188 112 0 0" // the additional border color for displaying the default/selected button + + "team0" "255 179 0 255" + "team1" "76 102 76 255" + "team2" "255 64 64 255" + "team3" "255 179 0 255" + "team4" "255 179 0 255" + + "HintColor" "255 255 255 160" + "HintBackgroundColor" "0 0 0 128" + + //new class menu colours + "ClassMenuLight" "175 127 1 255" + "ClassMenuDark" "64 52 36 255" + "white" "255 255 255 255" + "red" "255 0 0 255" + "nothing" "0 0 0 0" + + "MapDescriptionText" "255 255 255 255" // the text used in the map description window + } + + ///////////////////// BASE SETTINGS //////////////////////// + // default settings for all panels + // controls use these to determine their settings + BaseSettings + { + "FgColor" "ControlText" + "BgColor" "ControlBG" + "LabelBgColor" "ControlBG" + "SubPanelBgColor" "ControlBG" + + "DisabledFgColor1" "DisabledText1" + "DisabledFgColor2" "DisabledText2" // set this to the BgColor if you don't want it to draw + + "TitleBarFgColor" "TitleText" + "TitleBarDisabledFgColor" "TitleDimText" + "TitleBarBgColor" "TitleBG" + "TitleBarDisabledBgColor" "TitleDimBG" + + "TitleBarIcon" "resource/icon_steam" + "TitleBarDisabledIcon" "resource/icon_steam_disabled" + + "TitleButtonFgColor" "BorderBright" + "TitleButtonBgColor" "ControlBG" + "TitleButtonDisabledFgColor" "TitleDimText" + "TitleButtonDisabledBgColor" "TitleDimBG" + + "TextCursorColor" "BaseText" // color of the blinking text cursor in text entries + "URLTextColor" "BrightBaseText" // color that URL's show up in chat window + + Menu + { + "FgColor" "DimBaseText" + "BgColor" "ControlBG" + "ArmedFgColor" "BrightBaseText" + "ArmedBgColor" "SelectionBG" + "DividerColor" "BorderDark" + "TextInset" "6" + } + + MenuButton // the little arrow on the side of boxes that triggers drop down menus + { + "ButtonArrowColor" "DimBaseText" // color of arrows + "ButtonBgColor" "WindowBG" // bg color of button. same as background color of text edit panes + "ArmedArrowColor" "BrightBaseText" // color of arrow when mouse is over button + "ArmedBgColor" "DimBaseText" // bg color of button when mouse is over button + } + + Slider + { + "SliderFgColor" "ControlBG" // handle with which the slider is grabbed + "SliderBgColor" "ControlDarkBG" // area behind handle + } + + ScrollBarSlider + { + "BgColor" "ControlBG" // this isn't really used + "ScrollBarSliderFgColor" "ControlBG" // handle with which the slider is grabbed + "ScrollBarSliderBgColor" "ControlDarkBG" // area behind handle + "ButtonFgColor" "DimBaseText" // color of arrows + } + + + // text edit windows + "WindowFgColor" "BaseText" // off-white + "WindowBgColor" "WindowBG" // redundant. can we get rid of WindowBgColor and just use WindowBG? + "WindowDisabledFgColor" "DimBaseText" + "WindowDisabledBgColor" "ListBG" // background of chat conversation + "SelectionFgColor" "SelectedText" // fg color of selected text + "SelectionBgColor" "SelectionBG" + "ListSelectionFgColor" "SelectedText" + "ListBgColor" "ListBG" // background of server browser control, etc + "BuddyListBgColor" "ListBG" // background of buddy list pane + + // App-specific stuff + "ChatBgColor" "WindowBG" + + // status selection + "StatusSelectFgColor" "BrightBaseText" + "StatusSelectFgColor2" "BrightControlText" // this is the color of the friends status + + // checkboxes + "CheckButtonBorder1" "BorderDark" // the left checkbutton border + "CheckButtonBorder2" "BorderBright" // the right checkbutton border + "CheckButtonCheck" "BrightControlText" // color of the check itself + "CheckBgColor" "ListBG" + + // buttons (default fg/bg colors are used if these are not set) + "ButtonArmedFgColor" "BrightControlText" + "ButtonArmedBgColor" "ClassMenuLight" + "ButtonDepressedFgColor" "BrightControlText" + "ButtonDepressedBgColor" "ClassMenuLight" + + "ButtonFgColor" "BrightControlText" + "ButtonBgColor" "ClassMenuDark" + + // buddy buttons + BuddyButton + { + "FgColor1" "ControlText" + "FgColor2" "DimListText" + "ArmedFgColor1" "BrightBaseText" + "ArmedFgColor2" "BrightBaseText" + "ArmedBgColor" "SelectionBG" + } + + Chat + { + "TextColor" "BrightControlText" + "SelfTextColor" "BaseText" + "SeperatorTextColor" "DimBaseText" + } + + "SectionTextColor" "BrightControlText" // text color for IN-GAME, ONLINE, OFFLINE sections of buddy list + "SectionDividerColor" "BorderDark" // color of line that runs under section name in buddy list + } + + // + //////////////////////// FONTS ///////////////////////////// + // + // describes all the fonts + Fonts + { + // fonts are used in order that they are listed + // fonts listed later in the order will only be used if they fulfill a range not already filled + // if a font fails to load then the subsequent fonts will replace + "Default" + { + "1" + { + "name" "Times New Roman" + "tall" "15" + "weight" "400" + "range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A + "antialias" "1" + } + "2" + { + "name" "Courier New" + "tall" "15" + "weight" "400" + "range" "0x0000 0xFFFF" // all + "antialias" "1" + } + } + "DefaultUnderline" + { + "1" + { + "name" "Tahoma" + "tall" "12" + "weight" "500" + "underline" "1" + "range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A + } + "2" + { + "name" "Tahoma" + "tall" "12" + "weight" "500" + "underline" "1" + "range" "0x0000 0xFFFF" // all + } + } + "DefaultSmall" + { + "1" + { + "name" "Times New Roman" + "tall" "13" + "weight" "800" + "range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A + } + "2" + { + "name" "Courier New" + "tall" "13" + "weight" "800" + "range" "0x0000 0xFFFF" // all + } + } + "DefaultVerySmall" + { + "1" + { + "name" "Courier New" + "tall" "11" + "weight" "0" + "range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A + "antialiased" "1" + } + "2" + { + "name" "Courier" + "tall" "11" + "weight" "0" + "range" "0x0000 0xFFFF" // all + "antialiased" "1" + } + } + + // this is the symbol font + "Marlett" + { + "1" + { + "name" "Marlett" + "tall" "14" + "weight" "0" + "symbol" "1" + "range" "0x0000 0x007F" // Basic Latin + } + } + + "ClassMenuTitleFont" + { + "1" + { + "name" "Times New Roman" + "tall" "20" + "weight" "500" //bold 0 - 1000 + "range" "0x0000 0x007F" // all + "antialias" "1" + } + "2" + { + "name" "Times New Roman" + "tall" "20" + "weight" "500" + "range" "0x0000 0xFFFF" // all + "antialias" "1" + } + } + + "ClassMenuBoldFont" + { + "1" + { + "name" "Times New Roman" + "tall" "11" + "weight" "800" //bold 0 - 1000 + "range" "0x0000 0x007F" // all + "antialias" "1" + } + "2" + { + "name" "Times New Roman" + "tall" "11" + "weight" "800" + "range" "0x0000 0xFFFF" // all + "antialias" "1" + } + } + + "ClassMenuBodyFont" + { + "1" + { + "name" "Times New Roman" + "tall" "13" + "weight" "500" //bold 0 - 1000 + "range" "0x0000 0x007F" // all + "antialias" "1" + } + "2" + { + "name" "Times New Roman" + "tall" "13" + "weight" "500" + "range" "0x0000 0xFFFF" // all + "antialias" "1" + } + } + } + + // + //////////////////// BORDERS ////////////////////////////// + // + // describes all the border types + Borders + { + BaseBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + + TitleButtonBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BorderBright" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "4" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + } + + TitleButtonDisabledBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BgColor" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BgColor" + "offset" "1 0" + } + } + Top + { + "1" + { + "color" "BgColor" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BgColor" + "offset" "0 0" + } + } + } + + TitleButtonDepressedBorder + { + "inset" "1 1 1 1" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + + ScrollBarButtonBorder + { + "inset" "1 0 0 0" + Left + { + "1" + { + "color" "BorderBright" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + } + + ScrollBarButtonDepressedBorder + { + "inset" "2 2 0 0" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + + ButtonDepressedBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "nothing" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "nothing" + "offset" "0 0" + } + } + + Top + { + "1" + { + "color" "nothing" + "offset" "0 1" + } + } + + Bottom + { + "1" + { + "color" "nothing" + "offset" "0 0" + } + } + } + + ButtonKeyFocusBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "nothing" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "nothing" + "offset" "0 0" + } + } + + Top + { + "1" + { + "color" "nothing" + "offset" "0 1" + } + } + + Bottom + { + "1" + { + "color" "nothing" + "offset" "0 0" + } + } + } + + ButtonBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "nothing" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "nothing" + "offset" "0 0" + } + } + + Top + { + "1" + { + "color" "nothing" + "offset" "0 1" + } + } + + Bottom + { + "1" + { + "color" "nothing" + "offset" "0 0" + } + } + } + + FrameBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "ControlBG" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "ControlBG" + "offset" "0 0" + } + } + + Top + { + "1" + { + "color" "ControlBG" + "offset" "0 1" + } + } + + Bottom + { + "1" + { + "color" "ControlBG" + "offset" "0 0" + } + } + } + + HintBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "HintColor" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "HintColor" + "offset" "0 0" + } + } + + Top + { + "1" + { + "color" "HintColor" + "offset" "0 1" + } + } + + Bottom + { + "1" + { + "color" "HintColor" + "offset" "0 0" + } + } + } + + + TabBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BorderBright" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + + TabActiveBorder + { + "inset" "0 0 1 0" + Left + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "ControlBG" + "offset" "6 2" + } + } + } + + + ToolTipBorder + { + "inset" "0 0 1 0" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + } + + // this is the border used for default buttons (the button that gets pressed when you hit enter) + ButtonKeyFocusBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BorderSelection" + "offset" "0 0" + } + "2" + { + "color" "BorderBright" + "offset" "0 1" + } + } + Top + { + "1" + { + "color" "BorderSelection" + "offset" "0 0" + } + "2" + { + "color" "BorderBright" + "offset" "1 0" + } + } + Right + { + "1" + { + "color" "BorderSelection" + "offset" "0 0" + } + "2" + { + "color" "BorderDark" + "offset" "1 0" + } + } + Bottom + { + "1" + { + "color" "BorderSelection" + "offset" "0 0" + } + "2" + { + "color" "BorderDark" + "offset" "1 1" + } + } + } + + ButtonDepressedBorder + { + "inset" "2 1 1 1" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + + ComboBoxBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + + MenuBorder + { + "inset" "1 1 1 1" + Left + { + "1" + { + "color" "BorderBright" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + } + BrowserBorder + { + "inset" "0 0 0 1" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + } +} \ No newline at end of file diff --git a/main/resource/GameMenu.res b/main/resource/GameMenu.res new file mode 100644 index 00000000..3bc43eb2 --- /dev/null +++ b/main/resource/GameMenu.res @@ -0,0 +1,83 @@ +"GameMenu" +{ + "1" + { + "label" "#GameUI_GameMenu_ResumeGame" + "command" "ResumeGame" + "OnlyInGame" "1" + } + "2" + { + "label" "#Menu_ReadyRoom" + "command" "engine readyroom" + "OnlyInGame" "1" + } + "3" + { + "label" "#GameUI_GameMenu_Disconnect" + "command" "Disconnect" + "OnlyInGame" "1" + } +// "4" +// { +// "label" "#GameUI_GameMenu_NewGame" +// "command" "OpenNewGameDialog" +// "notmulti" "1" +// } +// "5" +// { +// "label" "#GameUI_GameMenu_LoadGame" +// "command" "OpenLoadGameDialog" +// "notmulti" "1" +// } + "6" + { + "label" "#GameUI_GameMenu_SaveGame" + "command" "OpenSaveGameDialog" + "notmulti" "1" + "OnlyInGame" "1" + } + "7" + { + "label" "" + "command" "" + "notmulti" "1" + } + "8" + { + "label" "#GameUI_GameMenu_FindServers" + "command" "OpenServerBrowser" + } + "9" + { + "label" "#GameUI_GameMenu_CreateServer" + "command" "OpenCreateMultiplayerGameDialog" + } +// "10" +// { +// "name" "LoadDemo" +// "label" "#GameUI_GameMenu_PlayDemo" +// "command" "OpenLoadDemoDialog" +// } + "11" + { + "label" "" + "command" "" + } + "12" + { + "label" "#GameUI_GameMenu_ChangeGame" + "command" "OpenChangeGameDialog" + "notsteam" "1" + } + "13" + { + "label" "#GameUI_GameMenu_Options" + "command" "OpenOptionsDialog" + } + "14" + { + "label" "#GameUI_GameMenu_Quit" + "command" "Quit" + } +} \ No newline at end of file diff --git a/main/resource/TrackerScheme.res b/main/resource/TrackerScheme.res new file mode 100644 index 00000000..81073305 --- /dev/null +++ b/main/resource/TrackerScheme.res @@ -0,0 +1,833 @@ +// +// TRACKER SCHEME RESOURCE FILE +// +// sections: +// colors - all the colors used by the scheme +// basesettings - contains settings for app to use to draw controls +// fonts - list of all the fonts used by app +// borders - description of all the borders +// +// notes: +// hit ctrl-alt-shift-R in the app to reload this file +// +Scheme +{ + //////////////////////// COLORS /////////////////////////// + Colors + { + // base colors + "BaseText" "255 170 0 220" // used in text windows, lists + "BrightBaseText" "255 170 0 255" // brightest text + "SelectedText" "255 170 0 255" // selected text + "DimBaseText" "255 170 0 200" // dim base text + "LabelDimText" "255 170 0 200" // used for info text + "ControlText" "255 170 0 200" // used in all text controls + "BrightControlText" "255 170 0 220" // use for selected controls + "DisabledText1" "236 236 236 155" // disabled text + "DisabledText2" "148 148 148 155" // overlay color for disabled text (to give that inset look) + "DimListText" "112 112 112 255" // offline friends, unsubscribed games, etc. + + // background colors + "ControlBG" "0 0 0 128" // background color of controls + "ControlDarkBG" "0 0 0 200" // darker background color; used for background of scrollbars + "WindowBG" "0 0 0 150" // background color of text edit panes (chat, text entries, etc.) + "SelectionBG" "224 156 48 160" // background color of any selected text or menu item + "SelectionBG2" "164 164 164 255" // selection background in window w/o focus + "ListBG" "0 0 0 200" // background of server browser, buddy list, etc. + + // titlebar colors + "TitleText" "255 255 255 255" + "TitleDimText" "125 125 125 255" + "TitleBG" "206 206 206 0" + "TitleDimBG" "206 206 206 0" + + // slider tick colors + "SliderTickColor" "206 206 206 255" + "SliderTrackColor" "56 56 56 255" + + // border colors + "BorderBright" "236 236 236 255" // the lit side of a control + "BorderDark" "112 112 112 255" // the dark/unlit side of a control + "BorderSelection" "0 0 0 255" // the additional border color for displaying the default/selected button + + // from kTeamColors in AvHSharedUtil.cpp + "team0" "255 255 255 255" + "team1" "125 165 210 255" + "team2" "255 170 0 255" + "team3" "145 215 140 255" + "team4" "200 90 70 255" + } + + ///////////////////// BASE SETTINGS //////////////////////// + // default settings for all panels + // controls use these to determine their settings + BaseSettings + { + "FgColor" "ControlText" + "BgColor" "ControlBG" + "LabelBgColor" "ControlBG" + "SubPanelBgColor" "ControlBG" + + "DisabledFgColor1" "DisabledText1" + "DisabledFgColor2" "DisabledText2" // set this to the BgColor if you don't want it to draw + + "TitleBarFgColor" "TitleText" + "TitleBarDisabledFgColor" "TitleDimText" + "TitleBarBgColor" "TitleBG" + "TitleBarDisabledBgColor" "TitleDimBG" + + "TitleBarIcon" "resource/icon_steam" + "TitleBarDisabledIcon" "resource/icon_steam_disabled" + + "TitleButtonFgColor" "TitleText" + "TitleButtonBgColor" "ControlBG" + "TitleButtonDisabledFgColor" "TitleDimText" + "TitleButtonDisabledBgColor" "TitleDimBG" + + "TextCursorColor" "BaseText" // color of the blinking text cursor in text entries + "URLTextColor" "BrightBaseText" // color that URL's show up in chat window + + Menu + { + "FgColor" "DimBaseText" + "BgColor" "ControlBG" + "ArmedFgColor" "BrightBaseText" + "ArmedBgColor" "SelectionBG" + "DividerColor" "BorderDark" + + "TextInset" "6" + } + + MenuButton // the little arrow on the side of boxes that triggers drop down menus + { + "ButtonArrowColor" "DimBaseText" // color of arrows + "ButtonBgColor" "WindowBG" // bg color of button. same as background color of text edit panes + "ArmedArrowColor" "BorderBright" // color of arrow when mouse is over button + "ArmedBgColor" "DimBaseText" // bg color of button when mouse is over button + } + + Slider + { + "SliderFgColor" "ControlBG" // handle with which the slider is grabbed + "SliderBgColor" "ControlDarkBG" // area behind handle + } + + ScrollBarSlider + { + "BgColor" "ControlBG" // this isn't really used + "ScrollBarSliderFgColor" "ControlBG" // handle with which the slider is grabbed + "ScrollBarSliderBgColor" "ControlDarkBG" // area behind handle + "ButtonFgColor" "DimBaseText" // color of arrows + } + + + // text edit windows + "WindowFgColor" "BaseText" // off-white + "WindowBgColor" "WindowBG" // redundant. can we get rid of WindowBgColor and just use WindowBG? + "WindowDisabledFgColor" "DimBaseText" + "WindowDisabledBgColor" "ListBG" // background of chat conversation + "SelectionFgColor" "SelectedText" // fg color of selected text + "SelectionBgColor" "SelectionBG" + "ListSelectionFgColor" "SelectedText" + "ListBgColor" "ListBG" // background of server browser control, etc + "BuddyListBgColor" "ListBG" // background of buddy list pane + + // App-specific stuff + "ChatBgColor" "WindowBG" + + // status selection + "StatusSelectFgColor" "BrightBaseText" + "StatusSelectFgColor2" "BrightControlText" // this is the color of the friends status + + // checkboxes + "CheckButtonBorder1" "BorderDark" // the left checkbutton border + "CheckButtonBorder2" "BorderBright" // the right checkbutton border + "CheckButtonCheck" "BrightControlText" // color of the check itself + "CheckBgColor" "ListBG" + + // buttons (default fg/bg colors are used if these are not set) +// "ButtonArmedFgColor" +// "ButtonArmedBgColor" +// "ButtonDepressedFgColor" "BrightControlText" +// "ButtonDepressedBgColor" + + // buddy buttons + BuddyButton + { + "FgColor1" "ControlText" + "FgColor2" "DimListText" + "ArmedFgColor1" "BrightBaseText" + "ArmedFgColor2" "BrightBaseText" + "ArmedBgColor" "SelectionBG" + } + + Chat + { + "TextColor" "BrightControlText" + "SelfTextColor" "BaseText" + "SeperatorTextColor" "DimBaseText" + } + + InGameDesktop + { + "MenuColor" "200 200 200 255" + "ArmedMenuColor" "255 255 255 255" + "DepressedMenuColor" "192 186 80 255" + "WidescreenBarColor" "0 0 0 0" + "MenuItemVisibilityRate" "0.03" // time it takes for one menu item to appear + "MenuItemHeight" "28" + "GameMenuInset" "32" + } + + "SectionTextColor" "BrightControlText" // text color for IN-GAME, ONLINE, OFFLINE sections of buddy list + "SectionDividerColor" "BorderDark" // color of line that runs under section name in buddy list + } + + // + //////////////////////// FONTS ///////////////////////////// + // + // describes all the fonts + Fonts + { + // fonts are used in order that they are listed + // fonts listed later in the order will only be used if they fulfill a range not already filled + // if a font fails to load then the subsequent fonts will replace + "Default" + { + "1" + { + "name" "Tahoma" + "tall" "16" + "weight" "0" + } + } + "DefaultUnderline" + { + "1" + { + "name" "Tahoma" + "tall" "16" + "weight" "0" + "underline" "1" + } + } + "DefaultSmall" + { + "1" + { + "name" "Tahoma" + "tall" "13" + "weight" "0" + } + } + "DefaultVerySmall" + { + "1" + { + "name" "Tahoma" + "tall" "12" + "weight" "0" + } + } + "MenuLarge" + { + "1" + { + "name" "Verdana" + "tall" "18" + "weight" "1000" + "antialias" "1" + } + "2" + { + "name" "Arial" + "tall" "18" + "weight" "800" + "antialias" "1" + } + } + + // this is the symbol font + "Marlett" + { + "1" + { + "name" "Marlett" + "tall" "14" + "weight" "0" + "symbol" "1" + } + } + + "EngineFont" + { + "1" + { + "name" "Verdana Bold" + "tall" "12" + "weight" "0" + "yres" "480 599" + "dropshadow" "1" + } + "2" + { + "name" "Verdana Bold" + "tall" "13" + "weight" "0" + "yres" "600 767" + "dropshadow" "1" + } + "3" + { + "name" "Verdana Bold" + "tall" "14" + "weight" "0" + "yres" "768 1023" + "dropshadow" "1" + } + "4" + { + "name" "Verdana Bold" + "tall" "20" + "weight" "0" + "yres" "1024 1199" + "dropshadow" "1" + } + "5" + { + "name" "Verdana Bold" + "tall" "24" + "weight" "0" + "yres" "1200 6000" + "dropshadow" "1" + } + "6" + { + "name" "Verdana" + "tall" "12" + "weight" "600" + "dropshadow" "1" + } + "7" + { + "name" "Arial" + "tall" "11" + "weight" "800" + "dropshadow" "1" + } + } + + "CreditsFont" + { + "1" + { + "name" "Trebuchet MS" + "tall" "18" + "weight" "600" + "antialias" "1" + } + "2" + { + "name" "Arial" + "tall" "18" + "weight" "600" + "dropshadow" "1" + } + } + + "Legacy_CreditsFont" // Added to accomodate 3rd party server plugins, etc. This version should not scale. + { + "1" + { + "name" "Trebuchet MS" + "tall" "20" + "weight" "700" + "antialias" "1" + "yres" "1 10000" + } + "2" + { + "name" "Arial" + "tall" "20" + "weight" "600" + "dropshadow" "1" + } + } + } + + // + //////////////////// BORDERS ////////////////////////////// + // + // describes all the border types + Borders + { + // references to other borders + BaseBorder "InsetBorder" + ComboBoxBorder "InsetBorder" + BrowserBorder "InsetBorder" + ButtonBorder "RaisedBorder" + FrameBorder "RaisedBorder" + TabBorder "RaisedBorder" + MenuBorder "RaisedBorder" + + // standard borders + InsetBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + + RaisedBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BorderBright" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Top + { + "1" + { + "color" "BorderBright" + "offset" "0 1" + } + } + + Bottom + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + } + + // special border types + TitleButtonBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BorderBright" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "4" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + } + + TitleButtonDisabledBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BgColor" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BgColor" + "offset" "1 0" + } + } + Top + { + "1" + { + "color" "BgColor" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BgColor" + "offset" "0 0" + } + } + } + + TitleButtonDepressedBorder + { + "inset" "1 1 1 1" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + + ScrollBarButtonBorder + { + "inset" "1 0 0 0" + Left + { + "1" + { + "color" "BorderBright" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + } + + ScrollBarButtonDepressedBorder + { + "inset" "2 2 0 0" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + + TabActiveBorder + { + "inset" "0 0 1 0" + Left + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "ControlBG" + "offset" "6 2" + } + } + } + + + ToolTipBorder + { + "inset" "0 0 1 0" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Right + { + "1" + { + "color" "BorderDark" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + } + + // this is the border used for default buttons (the button that gets pressed when you hit enter) + ButtonKeyFocusBorder + { + "inset" "0 0 1 1" + Left + { + "1" + { + "color" "BorderSelection" + "offset" "0 0" + } + "2" + { + "color" "BorderBright" + "offset" "0 1" + } + } + Top + { + "1" + { + "color" "BorderSelection" + "offset" "0 0" + } + "2" + { + "color" "BorderBright" + "offset" "1 0" + } + } + Right + { + "1" + { + "color" "BorderSelection" + "offset" "0 0" + } + "2" + { + "color" "BorderDark" + "offset" "1 0" + } + } + Bottom + { + "1" + { + "color" "BorderSelection" + "offset" "0 0" + } + "2" + { + "color" "BorderDark" + "offset" "1 1" + } + } + } + + ButtonDepressedBorder + { + "inset" "2 1 1 1" + Left + { + "1" + { + "color" "BorderDark" + "offset" "0 1" + } + } + + Right + { + "1" + { + "color" "BorderBright" + "offset" "1 0" + } + } + + Top + { + "1" + { + "color" "BorderDark" + "offset" "0 0" + } + } + + Bottom + { + "1" + { + "color" "BorderBright" + "offset" "0 0" + } + } + } + } +} \ No newline at end of file diff --git a/main/resource/background/800_1_a_loading.tga b/main/resource/background/800_1_a_loading.tga new file mode 100644 index 00000000..8a1841bc Binary files /dev/null and b/main/resource/background/800_1_a_loading.tga differ diff --git a/main/resource/background/800_1_b_loading.tga b/main/resource/background/800_1_b_loading.tga new file mode 100644 index 00000000..02a8b5a1 Binary files /dev/null and b/main/resource/background/800_1_b_loading.tga differ diff --git a/main/resource/background/800_1_c_loading.tga b/main/resource/background/800_1_c_loading.tga new file mode 100644 index 00000000..49965abf Binary files /dev/null and b/main/resource/background/800_1_c_loading.tga differ diff --git a/main/resource/background/800_1_d_loading.tga b/main/resource/background/800_1_d_loading.tga new file mode 100644 index 00000000..2ed1b203 Binary files /dev/null and b/main/resource/background/800_1_d_loading.tga differ diff --git a/main/resource/background/800_2_a_loading.tga b/main/resource/background/800_2_a_loading.tga new file mode 100644 index 00000000..159e7050 Binary files /dev/null and b/main/resource/background/800_2_a_loading.tga differ diff --git a/main/resource/background/800_2_b_loading.tga b/main/resource/background/800_2_b_loading.tga new file mode 100644 index 00000000..17f55872 Binary files /dev/null and b/main/resource/background/800_2_b_loading.tga differ diff --git a/main/resource/background/800_2_c_loading.tga b/main/resource/background/800_2_c_loading.tga new file mode 100644 index 00000000..679b8ecb Binary files /dev/null and b/main/resource/background/800_2_c_loading.tga differ diff --git a/main/resource/background/800_2_d_loading.tga b/main/resource/background/800_2_d_loading.tga new file mode 100644 index 00000000..5cfebaef Binary files /dev/null and b/main/resource/background/800_2_d_loading.tga differ diff --git a/main/resource/background/800_3_a_loading.tga b/main/resource/background/800_3_a_loading.tga new file mode 100644 index 00000000..79b78d1d Binary files /dev/null and b/main/resource/background/800_3_a_loading.tga differ diff --git a/main/resource/background/800_3_b_loading.tga b/main/resource/background/800_3_b_loading.tga new file mode 100644 index 00000000..4ac55798 Binary files /dev/null and b/main/resource/background/800_3_b_loading.tga differ diff --git a/main/resource/background/800_3_c_loading.tga b/main/resource/background/800_3_c_loading.tga new file mode 100644 index 00000000..a1b16960 Binary files /dev/null and b/main/resource/background/800_3_c_loading.tga differ diff --git a/main/resource/background/800_3_d_loading.tga b/main/resource/background/800_3_d_loading.tga new file mode 100644 index 00000000..d58012e7 Binary files /dev/null and b/main/resource/background/800_3_d_loading.tga differ diff --git a/main/resource/game_menu.tga b/main/resource/game_menu.tga new file mode 100644 index 00000000..a079cf2a Binary files /dev/null and b/main/resource/game_menu.tga differ diff --git a/main/resource/game_menu_mouseover.tga b/main/resource/game_menu_mouseover.tga new file mode 100644 index 00000000..6c66ecdd Binary files /dev/null and b/main/resource/game_menu_mouseover.tga differ diff --git a/main/resource/ns_english.txt b/main/resource/ns_english.txt new file mode 100644 index 00000000..31887a0e Binary files /dev/null and b/main/resource/ns_english.txt differ diff --git a/main/resource/ns_french.txt b/main/resource/ns_french.txt new file mode 100644 index 00000000..8da627fa Binary files /dev/null and b/main/resource/ns_french.txt differ diff --git a/main/resource/ns_german.txt b/main/resource/ns_german.txt new file mode 100644 index 00000000..0017d394 Binary files /dev/null and b/main/resource/ns_german.txt differ diff --git a/main/resource/ns_spanish.txt b/main/resource/ns_spanish.txt new file mode 100644 index 00000000..aafc304f Binary files /dev/null and b/main/resource/ns_spanish.txt differ diff --git a/main/resource/ns_turkish.txt b/main/resource/ns_turkish.txt new file mode 100644 index 00000000..cd990f13 Binary files /dev/null and b/main/resource/ns_turkish.txt differ diff --git a/main/server.cfg b/main/server.cfg new file mode 100644 index 00000000..79e50d18 --- /dev/null +++ b/main/server.cfg @@ -0,0 +1,97 @@ +// Use this file to configure your DEDICATED server. +// This config file is executed everytime the server changes levels (disable by removing mapchangecfgfile at end) +// +// Please visit the server ops forum on www.natural-selection.org, or check out the manual if you have any questions about any of these settings. +// + +//////////////////////////////////////////////////// +// Common between listenserver.cfg and server.cfg // +//////////////////////////////////////////////////// + +// Default server name. Change to "Bob's Server", etc. +hostname "Natural Selection v3.0" + +// Must specify sv_region, or it won't show up in Steam server browser +// 0: US East coast +// 1: US West coast +// 2: South America +// 3: Europe +// 4: Asia +// 5: Australia +// 6: Middle East +// 7: Africa +sv_region 0 + +// general gameplay +mp_autoconcede 4 +mp_limitteams 1 +mp_combattime 15 + +// block abusive console scripts (wait, special, etc.)? +mp_blockscripts 0 + +// Set to -1 to disallow voting (looks in mapcycle.txt for entries) +mp_mapvoteratio .6 + +// Enable HLTV proxies to connect +sv_proxies 1 + +// maximum client movement speed (needed for commander mode) +sv_maxspeed 4000 +sv_allowdownload 1 +mp_consistency 0 + +// Commander voting +mp_votedowntime 180 +mp_votecasttime 2 +mp_votepercentneeded .4 +mp_minvotesneeded 3 + +// More obscure settings +mp_countdowntime .2 +mp_latejointime 1.5 +mp_logdetail 0 +mp_falldamage 1 +mp_killdelay 3 +mp_flashlight 1 +mp_footsteps 1 + +// disable autoaim and mad gibs +sv_aim 0 +violence_hgibs 0 +violence_agibs 0 + +// player bounding boxes (collisions, not clipping) +sv_clienttrace 3.5 + +///////////////////////////////////////// +// Server options (in listenserver UI) // +///////////////////////////////////////// +mp_tournamentmode 0 +mp_friendlyfire 0 +sv_cheats 0 +mp_drawdamage 0 + +// Handicap one side (0-100) +mp_team1damagepercent 100 +mp_team2damagepercent 100 + +// 60 minute timelimit (never ends match in progress) +mp_timelimit 60 + +/////////////////////////////// +// Dedicated server specific // +/////////////////////////////// +sv_lan 0 + +// disable clients' ability to pause the server +pausable 0 + +// List server op WON or Steam ids here, delimited by semi-colons (eg, "STEAM_0:1:12345;STEAM_0:0:56736"), to display server op icon next to these players on this server. +mp_serverops "" + +// Allows display of special authentication icons next to people's names (including developers, Constellation members, etc.) +mp_uplink 1 + +// Needed so this file is executed on map change, like pre-NS v2.1 +mapchangecfgfile server.cfg diff --git a/main/settings.scr b/main/settings.scr new file mode 100644 index 00000000..385de080 --- /dev/null +++ b/main/settings.scr @@ -0,0 +1,161 @@ +// NOTE: THIS FILE IS AUTOMATICALLY REGENERATED, +//DO NOT EDIT THIS HEADER, YOUR COMMENTS WILL BE LOST IF YOU DO +// Multiplayer options script +// +// Format: +// Version [float] +// Options description followed by +// Options defaults +// +// Option description syntax: +// +// "cvar" { "Prompt" { type [ type info ] } { default } } +// +// type = +// BOOL (a yes/no toggle) +// STRING +// NUMBER +// LIST +// +// type info: +// BOOL no type info +// NUMBER min max range, use -1 -1 for no limits +// STRING no type info +// LIST delimited list of options value pairs +// +// +// default depends on type +// BOOL is "0" or "1" +// NUMBER is "value" +// STRING is "value" +// LIST is "index", where index "0" is the first element of the list + + +// Half-Life Server Configuration Layout Script (stores last settings chosen, too) +// File generated: Thu Mar 03 11:29:18 PM +// +// +// Cvar - Setting + +VERSION 1.0 + +DESCRIPTION SERVER_OPTIONS +{ + "sv_lan" + { + "LAN Game" + { BOOL } + { "0" } + } + + "hostname" + { + "#Valve_Hostname" + { STRING } + { "Natural Selection 3.0 Server" } + } + + "maxplayers" + { + "#Valve_Max_Players" + { NUMBER 2.000000 32.000000 } + { "2.000000" } + } + + "sv_password" + { + "#Valve_Server_Password" + { STRING } + { "" } + } + + "sv_region" + { + "Server Location (Steam)" + { + LIST + "255: World" "255" + "0: US East coast" "0" + "1: US West coast" "1" + "2: South America" "2" + "3: Europe" "3" + "4: Asia" "4" + "5: Australia" "5" + "6: Middle East" "6" + "7: Africa" "7" + } + { "255.000000" } + } + + "sv_sendvelocity" + { + "Low ping server physics" + { BOOL } + { "1" } + } + + "mp_tournamentmode" + { + "Server mode" + { + LIST + "Casual" "0" + "Tournament" "1" + } + { "0.000000" } + } + + "mp_friendlyfire" + { + "Friendly fire" + { + LIST + "Disabled" "0" + "Enabled" "1" + } + { "0.000000" } + } + + "sv_cheats" + { + "Enable cheats" + { BOOL } + { "1" } + } + + "mp_drawdamage" + { + "Draw numeric damage" + { BOOL } + { "0" } + } + + "mp_team1damagepercent" + { + "Marine damage percent" + { NUMBER 0.000000 100.000000 } + { "100.000000" } + } + + "mp_team2damagepercent" + { + "Alien damage percent" + { NUMBER 0.000000 100.000000 } + { "100.000000" } + } + + "mp_timelimit" + { + "Time limit (minutes)" + { NUMBER 0.000000 -1.000000 } + { "30.000000" } + } + + "mp_votemapratio" + { + "Votemap ratio" + { NUMBER -1.000000 1.000000 } + { "0.510000" } + } + +} diff --git a/main/skill.cfg b/main/skill.cfg new file mode 100644 index 00000000..c64fffb8 --- /dev/null +++ b/main/skill.cfg @@ -0,0 +1,393 @@ +// DON'T MESS WITH THIS. + +// MONSTERS + +// Alien Grunt +sk_agrunt_health1 "60" +sk_agrunt_health2 "90" +sk_agrunt_health3 "120" + +sk_agrunt_dmg_punch1 "10" +sk_agrunt_dmg_punch2 "20" +sk_agrunt_dmg_punch3 "20" + + +// Apache +sk_apache_health1 "150" +sk_apache_health2 "250" +sk_apache_health3 "400" + + +// Barney +sk_barney_health1 "35" +sk_barney_health2 "35" +sk_barney_health3 "35" + + +// Bullsquid +sk_bullsquid_health1 "40" +sk_bullsquid_health2 "40" +sk_bullsquid_health3 "120" + +sk_bullsquid_dmg_bite1 "15" +sk_bullsquid_dmg_bite2 "25" +sk_bullsquid_dmg_bite3 "25" + +sk_bullsquid_dmg_whip1 "25" +sk_bullsquid_dmg_whip2 "35" +sk_bullsquid_dmg_whip3 "35" + +sk_bullsquid_dmg_spit1 "10" +sk_bullsquid_dmg_spit2 "10" +sk_bullsquid_dmg_spit3 "15" + +// Big momma +sk_bigmomma_health_factor1 "1.0" +sk_bigmomma_health_factor2 "1.5" +sk_bigmomma_health_factor3 "2" + +sk_bigmomma_dmg_slash1 "50" +sk_bigmomma_dmg_slash2 "60" +sk_bigmomma_dmg_slash3 "70" + +sk_bigmomma_dmg_blast1 "100" +sk_bigmomma_dmg_blast2 "120" +sk_bigmomma_dmg_blast3 "160" + +sk_bigmomma_radius_blast1 "250" +sk_bigmomma_radius_blast2 "250" +sk_bigmomma_radius_blast3 "275" + +// Gargantua +sk_gargantua_health1 "800" +sk_gargantua_health2 "800" +sk_gargantua_health3 "1000" + +sk_gargantua_dmg_slash1 "10" +sk_gargantua_dmg_slash2 "30" +sk_gargantua_dmg_slash3 "30" + +sk_gargantua_dmg_fire1 "3" +sk_gargantua_dmg_fire2 "5" +sk_gargantua_dmg_fire3 "5" + +sk_gargantua_dmg_stomp1 "50" +sk_gargantua_dmg_stomp2 "100" +sk_gargantua_dmg_stomp3 "100" + + +// Hassassin +sk_hassassin_health1 "30" +sk_hassassin_health2 "50" +sk_hassassin_health3 "50" + + +// Headcrab +sk_headcrab_health1 "10" +sk_headcrab_health2 "10" +sk_headcrab_health3 "20" + +sk_headcrab_dmg_bite1 "5" +sk_headcrab_dmg_bite2 "10" +sk_headcrab_dmg_bite3 "10" + + +// Hgrunt +sk_hgrunt_health1 "50" +sk_hgrunt_health2 "50" +sk_hgrunt_health3 "80" + +sk_hgrunt_kick1 "5" +sk_hgrunt_kick2 "10" +sk_hgrunt_kick3 "10" + +sk_hgrunt_pellets1 "3" +sk_hgrunt_pellets2 "5" +sk_hgrunt_pellets3 "6" + +sk_hgrunt_gspeed1 "400" +sk_hgrunt_gspeed2 "600" +sk_hgrunt_gspeed3 "800" + +// Houndeye +sk_houndeye_health1 "20" +sk_houndeye_health2 "20" +sk_houndeye_health3 "30" + +sk_houndeye_dmg_blast1 "10" +sk_houndeye_dmg_blast2 "15" +sk_houndeye_dmg_blast3 "15" + + +// ISlave +sk_islave_health1 "30" +sk_islave_health2 "30" +sk_islave_health3 "60" + +sk_islave_dmg_claw1 "8" +sk_islave_dmg_claw2 "10" +sk_islave_dmg_claw3 "10" + +sk_islave_dmg_clawrake1 "25" +sk_islave_dmg_clawrake2 "25" +sk_islave_dmg_clawrake3 "25" + +sk_islave_dmg_zap1 "10" +sk_islave_dmg_zap2 "10" +sk_islave_dmg_zap3 "15" + + +// Icthyosaur +sk_ichthyosaur_health1 "200" +sk_ichthyosaur_health2 "200" +sk_ichthyosaur_health3 "400" + +sk_ichthyosaur_shake1 "20" +sk_ichthyosaur_shake2 "35" +sk_ichthyosaur_shake3 "50" + + +// Leech +sk_leech_health1 "2" +sk_leech_health2 "2" +sk_leech_health3 "2" + +sk_leech_dmg_bite1 "2" +sk_leech_dmg_bite2 "2" +sk_leech_dmg_bite3 "2" + + +// Controller +sk_controller_health1 "60" +sk_controller_health2 "60" +sk_controller_health3 "100" + +sk_controller_dmgzap1 "15" +sk_controller_dmgzap2 "25" +sk_controller_dmgzap3 "35" + +sk_controller_speedball1 "650" +sk_controller_speedball2 "800" +sk_controller_speedball3 "1000" + +sk_controller_dmgball1 "3" +sk_controller_dmgball2 "4" +sk_controller_dmgball3 "5" + +// Nihilanth +sk_nihilanth_health1 "800" +sk_nihilanth_health2 "800" +sk_nihilanth_health3 "1000" + +sk_nihilanth_zap1 "30" +sk_nihilanth_zap2 "30" +sk_nihilanth_zap3 "50" + +// Scientist +sk_scientist_health1 "20" +sk_scientist_health2 "20" +sk_scientist_health3 "20" + + +// Snark +sk_snark_health1 "2" +sk_snark_health2 "2" +sk_snark_health3 "2" + +sk_snark_dmg_bite1 "10" +sk_snark_dmg_bite2 "10" +sk_snark_dmg_bite3 "10" + +sk_snark_dmg_pop1 "5" +sk_snark_dmg_pop2 "5" +sk_snark_dmg_pop3 "5" + + +// Zombie +sk_zombie_health1 "50" +sk_zombie_health2 "50" +sk_zombie_health3 "100" + +sk_zombie_dmg_one_slash1 "10" +sk_zombie_dmg_one_slash2 "20" +sk_zombie_dmg_one_slash3 "20" + +sk_zombie_dmg_both_slash1 "25" +sk_zombie_dmg_both_slash2 "40" +sk_zombie_dmg_both_slash3 "40" + + +//Turret +sk_turret_health1 "50" +sk_turret_health2 "50" +sk_turret_health3 "60" + + +// MiniTurret +sk_miniturret_health1 "40" +sk_miniturret_health2 "40" +sk_miniturret_health3 "50" + + +// Sentry Turret +sk_sentry_health1 "40" +sk_sentry_health2 "40" +sk_sentry_health3 "50" + + +// PLAYER WEAPONS + +// Crowbar whack +sk_plr_crowbar1 "10" +sk_plr_crowbar2 "10" +sk_plr_crowbar3 "10" + +// 9mmhandgun Round +sk_plr_9mm_bullet1 "8" +sk_plr_9mm_bullet2 "8" +sk_plr_9mm_bullet3 "8" + +// 357 Round +sk_plr_357_bullet1 "40" +sk_plr_357_bullet2 "40" +sk_plr_357_bullet3 "40" + +// 9mmAR Round +sk_plr_9mmAR_bullet1 "5" +sk_plr_9mmAR_bullet2 "5" +sk_plr_9mmAR_bullet3 "5" + +// M203 grenade +sk_plr_9mmAR_grenade1 "100" +sk_plr_9mmAR_grenade2 "100" +sk_plr_9mmAR_grenade3 "100" + +// Shotgun buckshot +sk_plr_buckshot1 "5" +sk_plr_buckshot2 "5" +sk_plr_buckshot3 "5" + +// Crossbow +sk_plr_xbow_bolt_client1 "10" +sk_plr_xbow_bolt_client2 "10" +sk_plr_xbow_bolt_client3 "10" + +sk_plr_xbow_bolt_monster1 "50" +sk_plr_xbow_bolt_monster2 "50" +sk_plr_xbow_bolt_monster3 "50" + +// RPG +sk_plr_rpg1 "100" +sk_plr_rpg2 "100" +sk_plr_rpg3 "100" + +// Gauss Gun +sk_plr_gauss1 "20" +sk_plr_gauss2 "20" +sk_plr_gauss3 "20" + +// Egon Gun +sk_plr_egon_narrow1 "6" +sk_plr_egon_narrow2 "6" +sk_plr_egon_narrow3 "6" + +sk_plr_egon_wide1 "14" +sk_plr_egon_wide2 "14" +sk_plr_egon_wide3 "14" + +// Hand Grendade +sk_plr_hand_grenade1 "100" +sk_plr_hand_grenade2 "100" +sk_plr_hand_grenade3 "100" + +// Satchel Charge +sk_plr_satchel1 "150" +sk_plr_satchel2 "150" +sk_plr_satchel3 "150" + +// Tripmine +sk_plr_tripmine1 "150" +sk_plr_tripmine2 "150" +sk_plr_tripmine3 "150" + +// MONSTER WEAPONS +sk_12mm_bullet1 "8" +sk_12mm_bullet2 "10" +sk_12mm_bullet3 "10" + +sk_9mmAR_bullet1 "3" +sk_9mmAR_bullet2 "4" +sk_9mmAR_bullet3 "5" + +sk_9mm_bullet1 "5" +sk_9mm_bullet2 "5" +sk_9mm_bullet3 "8" + +// HORNET +sk_hornet_dmg1 "4" +sk_hornet_dmg2 "5" +sk_hornet_dmg3 "8" + +// HEALTH/SUIT CHARGE DISTRIBUTION +sk_suitcharger1 "75" +sk_suitcharger2 "50" +sk_suitcharger3 "35" + +sk_battery1 "15" +sk_battery2 "15" +sk_battery3 "10" + +sk_healthcharger1 "50" +sk_healthcharger2 "40" +sk_healthcharger3 "25" + +sk_healthkit1 "15" +sk_healthkit2 "15" +sk_healthkit3 "10" + +sk_scientist_heal1 "25" +sk_scientist_heal2 "25" +sk_scientist_heal3 "25" + +// monster damage adjusters +sk_monster_head1 "3" +sk_monster_head2 "3" +sk_monster_head3 "3" + +sk_monster_chest1 "1" +sk_monster_chest2 "1" +sk_monster_chest3 "1" + +sk_monster_stomach1 "1" +sk_monster_stomach2 "1" +sk_monster_stomach3 "1" + +sk_monster_arm1 "1" +sk_monster_arm2 "1" +sk_monster_arm3 "1" + +sk_monster_leg1 "1" +sk_monster_leg2 "1" +sk_monster_leg3 "1" + +// player damage adjusters +sk_player_head1 "3" +sk_player_head2 "3" +sk_player_head3 "3" + +sk_player_chest1 "1" +sk_player_chest2 "1" +sk_player_chest3 "1" + +sk_player_stomach1 "1" +sk_player_stomach2 "1" +sk_player_stomach3 "1" + +sk_player_arm1 "1" +sk_player_arm2 "1" +sk_player_arm3 "1" + +sk_player_leg1 "1" +sk_player_leg2 "1" +sk_player_leg3 "1" + diff --git a/main/sound/ambience/alarmloop.wav b/main/sound/ambience/alarmloop.wav new file mode 100644 index 00000000..568ce998 Binary files /dev/null and b/main/sound/ambience/alarmloop.wav differ diff --git a/main/sound/ambience/ambient02.mp3 b/main/sound/ambience/ambient02.mp3 new file mode 100644 index 00000000..0e52aa24 Binary files /dev/null and b/main/sound/ambience/ambient02.mp3 differ diff --git a/main/sound/ambience/ambient04.mp3 b/main/sound/ambience/ambient04.mp3 new file mode 100644 index 00000000..d5537711 Binary files /dev/null and b/main/sound/ambience/ambient04.mp3 differ diff --git a/main/sound/ambience/ambient05.mp3 b/main/sound/ambience/ambient05.mp3 new file mode 100644 index 00000000..b1d3d7df Binary files /dev/null and b/main/sound/ambience/ambient05.mp3 differ diff --git a/main/sound/ambience/ambient06.mp3 b/main/sound/ambience/ambient06.mp3 new file mode 100644 index 00000000..2bc37a21 Binary files /dev/null and b/main/sound/ambience/ambient06.mp3 differ diff --git a/main/sound/ambience/ambient07.mp3 b/main/sound/ambience/ambient07.mp3 new file mode 100644 index 00000000..64bb88ae Binary files /dev/null and b/main/sound/ambience/ambient07.mp3 differ diff --git a/main/sound/ambience/ambient08.mp3 b/main/sound/ambience/ambient08.mp3 new file mode 100644 index 00000000..156c9da4 Binary files /dev/null and b/main/sound/ambience/ambient08.mp3 differ diff --git a/main/sound/ambience/ambient09.mp3 b/main/sound/ambience/ambient09.mp3 new file mode 100644 index 00000000..9e2d3f7f Binary files /dev/null and b/main/sound/ambience/ambient09.mp3 differ diff --git a/main/sound/ambience/ambient10.mp3 b/main/sound/ambience/ambient10.mp3 new file mode 100644 index 00000000..b9ba445c Binary files /dev/null and b/main/sound/ambience/ambient10.mp3 differ diff --git a/main/sound/ambience/ambient11.mp3 b/main/sound/ambience/ambient11.mp3 new file mode 100644 index 00000000..c325c66e Binary files /dev/null and b/main/sound/ambience/ambient11.mp3 differ diff --git a/main/sound/ambience/ambient12.mp3 b/main/sound/ambience/ambient12.mp3 new file mode 100644 index 00000000..a868e82b Binary files /dev/null and b/main/sound/ambience/ambient12.mp3 differ diff --git a/main/sound/ambience/ambient13.mp3 b/main/sound/ambience/ambient13.mp3 new file mode 100644 index 00000000..ed4a4e6e Binary files /dev/null and b/main/sound/ambience/ambient13.mp3 differ diff --git a/main/sound/ambience/ambient14.mp3 b/main/sound/ambience/ambient14.mp3 new file mode 100644 index 00000000..5a2bb634 Binary files /dev/null and b/main/sound/ambience/ambient14.mp3 differ diff --git a/main/sound/ambience/atmospheric.mp3 b/main/sound/ambience/atmospheric.mp3 new file mode 100644 index 00000000..533f1366 Binary files /dev/null and b/main/sound/ambience/atmospheric.mp3 differ diff --git a/main/sound/ambience/b1.mp3 b/main/sound/ambience/b1.mp3 new file mode 100644 index 00000000..53ebd9c7 Binary files /dev/null and b/main/sound/ambience/b1.mp3 differ diff --git a/main/sound/ambience/b2.mp3 b/main/sound/ambience/b2.mp3 new file mode 100644 index 00000000..53c33cd1 Binary files /dev/null and b/main/sound/ambience/b2.mp3 differ diff --git a/main/sound/ambience/b3.wav b/main/sound/ambience/b3.wav new file mode 100644 index 00000000..0ddf9d6d Binary files /dev/null and b/main/sound/ambience/b3.wav differ diff --git a/main/sound/ambience/b4.wav b/main/sound/ambience/b4.wav new file mode 100644 index 00000000..a6549e11 Binary files /dev/null and b/main/sound/ambience/b4.wav differ diff --git a/main/sound/ambience/b5.wav b/main/sound/ambience/b5.wav new file mode 100644 index 00000000..0634bca2 Binary files /dev/null and b/main/sound/ambience/b5.wav differ diff --git a/main/sound/ambience/b6.mp3 b/main/sound/ambience/b6.mp3 new file mode 100644 index 00000000..25fa1ec2 Binary files /dev/null and b/main/sound/ambience/b6.mp3 differ diff --git a/main/sound/ambience/b9.mp3 b/main/sound/ambience/b9.mp3 new file mode 100644 index 00000000..533f1366 Binary files /dev/null and b/main/sound/ambience/b9.mp3 differ diff --git a/main/sound/ambience/bastturbine.wav b/main/sound/ambience/bastturbine.wav new file mode 100644 index 00000000..3d953422 Binary files /dev/null and b/main/sound/ambience/bastturbine.wav differ diff --git a/main/sound/ambience/bastwind2.wav b/main/sound/ambience/bastwind2.wav new file mode 100644 index 00000000..f95d40a4 Binary files /dev/null and b/main/sound/ambience/bastwind2.wav differ diff --git a/main/sound/ambience/bb.wav b/main/sound/ambience/bb.wav new file mode 100644 index 00000000..294fbd0c Binary files /dev/null and b/main/sound/ambience/bb.wav differ diff --git a/main/sound/ambience/bc.wav b/main/sound/ambience/bc.wav new file mode 100644 index 00000000..0a425f6b Binary files /dev/null and b/main/sound/ambience/bc.wav differ diff --git a/main/sound/ambience/bd.wav b/main/sound/ambience/bd.wav new file mode 100644 index 00000000..8c0ee6c1 Binary files /dev/null and b/main/sound/ambience/bd.wav differ diff --git a/main/sound/ambience/be.wav b/main/sound/ambience/be.wav new file mode 100644 index 00000000..a467cb42 Binary files /dev/null and b/main/sound/ambience/be.wav differ diff --git a/main/sound/ambience/bf.wav b/main/sound/ambience/bf.wav new file mode 100644 index 00000000..0eede568 Binary files /dev/null and b/main/sound/ambience/bf.wav differ diff --git a/main/sound/ambience/bg.wav b/main/sound/ambience/bg.wav new file mode 100644 index 00000000..57b4125d Binary files /dev/null and b/main/sound/ambience/bg.wav differ diff --git a/main/sound/ambience/bighum.mp3 b/main/sound/ambience/bighum.mp3 new file mode 100644 index 00000000..e3af8748 Binary files /dev/null and b/main/sound/ambience/bighum.mp3 differ diff --git a/main/sound/ambience/controlroom.mp3 b/main/sound/ambience/controlroom.mp3 new file mode 100644 index 00000000..d53118b2 Binary files /dev/null and b/main/sound/ambience/controlroom.mp3 differ diff --git a/main/sound/ambience/distantmoan1.mp3 b/main/sound/ambience/distantmoan1.mp3 new file mode 100644 index 00000000..4e926346 Binary files /dev/null and b/main/sound/ambience/distantmoan1.mp3 differ diff --git a/main/sound/ambience/distantmoan2.mp3 b/main/sound/ambience/distantmoan2.mp3 new file mode 100644 index 00000000..bf5e027e Binary files /dev/null and b/main/sound/ambience/distantmoan2.mp3 differ diff --git a/main/sound/ambience/distantmortar3.wav b/main/sound/ambience/distantmortar3.wav new file mode 100644 index 00000000..e77fe6d1 Binary files /dev/null and b/main/sound/ambience/distantmortar3.wav differ diff --git a/main/sound/ambience/doorclose2.wav b/main/sound/ambience/doorclose2.wav new file mode 100644 index 00000000..13d5088b Binary files /dev/null and b/main/sound/ambience/doorclose2.wav differ diff --git a/main/sound/ambience/echodrops.mp3 b/main/sound/ambience/echodrops.mp3 new file mode 100644 index 00000000..8fec59dd Binary files /dev/null and b/main/sound/ambience/echodrops.mp3 differ diff --git a/main/sound/ambience/emdrill.wav b/main/sound/ambience/emdrill.wav new file mode 100644 index 00000000..62e61c4c Binary files /dev/null and b/main/sound/ambience/emdrill.wav differ diff --git a/main/sound/ambience/emptyhowl.mp3 b/main/sound/ambience/emptyhowl.mp3 new file mode 100644 index 00000000..64046a2c Binary files /dev/null and b/main/sound/ambience/emptyhowl.mp3 differ diff --git a/main/sound/ambience/eng.wav b/main/sound/ambience/eng.wav new file mode 100644 index 00000000..af198954 Binary files /dev/null and b/main/sound/ambience/eng.wav differ diff --git a/main/sound/ambience/engagelev.wav b/main/sound/ambience/engagelev.wav new file mode 100644 index 00000000..0cdebd20 Binary files /dev/null and b/main/sound/ambience/engagelev.wav differ diff --git a/main/sound/ambience/enginethrob.mp3 b/main/sound/ambience/enginethrob.mp3 new file mode 100644 index 00000000..d1d772fc Binary files /dev/null and b/main/sound/ambience/enginethrob.mp3 differ diff --git a/main/sound/ambience/forcefield1.mp3 b/main/sound/ambience/forcefield1.mp3 new file mode 100644 index 00000000..25fa1ec2 Binary files /dev/null and b/main/sound/ambience/forcefield1.mp3 differ diff --git a/main/sound/ambience/forcefield2.mp3 b/main/sound/ambience/forcefield2.mp3 new file mode 100644 index 00000000..2eed02ee Binary files /dev/null and b/main/sound/ambience/forcefield2.mp3 differ diff --git a/main/sound/ambience/hatch2.mp3 b/main/sound/ambience/hatch2.mp3 new file mode 100644 index 00000000..1bb8868d Binary files /dev/null and b/main/sound/ambience/hatch2.mp3 differ diff --git a/main/sound/ambience/hiveamb.mp3 b/main/sound/ambience/hiveamb.mp3 new file mode 100644 index 00000000..eab585c5 Binary files /dev/null and b/main/sound/ambience/hiveamb.mp3 differ diff --git a/main/sound/ambience/hotspark.wav b/main/sound/ambience/hotspark.wav new file mode 100644 index 00000000..adf4039a Binary files /dev/null and b/main/sound/ambience/hotspark.wav differ diff --git a/main/sound/ambience/howl1.mp3 b/main/sound/ambience/howl1.mp3 new file mode 100644 index 00000000..52e591b9 Binary files /dev/null and b/main/sound/ambience/howl1.mp3 differ diff --git a/main/sound/ambience/howl2.mp3 b/main/sound/ambience/howl2.mp3 new file mode 100644 index 00000000..5d0b047d Binary files /dev/null and b/main/sound/ambience/howl2.mp3 differ diff --git a/main/sound/ambience/hum.wav b/main/sound/ambience/hum.wav new file mode 100644 index 00000000..92538158 Binary files /dev/null and b/main/sound/ambience/hum.wav differ diff --git a/main/sound/ambience/hvyvibrate.mp3 b/main/sound/ambience/hvyvibrate.mp3 new file mode 100644 index 00000000..b4606e89 Binary files /dev/null and b/main/sound/ambience/hvyvibrate.mp3 differ diff --git a/main/sound/ambience/klaxon.wav b/main/sound/ambience/klaxon.wav new file mode 100644 index 00000000..6dd19319 Binary files /dev/null and b/main/sound/ambience/klaxon.wav differ diff --git a/main/sound/ambience/klaxon2.wav b/main/sound/ambience/klaxon2.wav new file mode 100644 index 00000000..7c455ebf Binary files /dev/null and b/main/sound/ambience/klaxon2.wav differ diff --git a/main/sound/ambience/klaxon3.wav b/main/sound/ambience/klaxon3.wav new file mode 100644 index 00000000..86849ee6 Binary files /dev/null and b/main/sound/ambience/klaxon3.wav differ diff --git a/main/sound/ambience/klaxon4.wav b/main/sound/ambience/klaxon4.wav new file mode 100644 index 00000000..cfd5e9cb Binary files /dev/null and b/main/sound/ambience/klaxon4.wav differ diff --git a/main/sound/ambience/lapwater.mp3 b/main/sound/ambience/lapwater.mp3 new file mode 100644 index 00000000..c507f5fe Binary files /dev/null and b/main/sound/ambience/lapwater.mp3 differ diff --git a/main/sound/ambience/leverthrow.wav b/main/sound/ambience/leverthrow.wav new file mode 100644 index 00000000..48382949 Binary files /dev/null and b/main/sound/ambience/leverthrow.wav differ diff --git a/main/sound/ambience/lkburner1.wav b/main/sound/ambience/lkburner1.wav new file mode 100644 index 00000000..fad42b2d Binary files /dev/null and b/main/sound/ambience/lkburner1.wav differ diff --git a/main/sound/ambience/lkburner2.wav b/main/sound/ambience/lkburner2.wav new file mode 100644 index 00000000..49575dd5 Binary files /dev/null and b/main/sound/ambience/lkburner2.wav differ diff --git a/main/sound/ambience/lkburner3.wav b/main/sound/ambience/lkburner3.wav new file mode 100644 index 00000000..a60b422d Binary files /dev/null and b/main/sound/ambience/lkburner3.wav differ diff --git a/main/sound/ambience/lobeep1.wav b/main/sound/ambience/lobeep1.wav new file mode 100644 index 00000000..29180e13 Binary files /dev/null and b/main/sound/ambience/lobeep1.wav differ diff --git a/main/sound/ambience/lockdoor.mp3 b/main/sound/ambience/lockdoor.mp3 new file mode 100644 index 00000000..e4d1f7a3 Binary files /dev/null and b/main/sound/ambience/lockdoor.mp3 differ diff --git a/main/sound/ambience/lowhit1.mp3 b/main/sound/ambience/lowhit1.mp3 new file mode 100644 index 00000000..770de5fa Binary files /dev/null and b/main/sound/ambience/lowhit1.mp3 differ diff --git a/main/sound/ambience/lowhit2.mp3 b/main/sound/ambience/lowhit2.mp3 new file mode 100644 index 00000000..d7990117 Binary files /dev/null and b/main/sound/ambience/lowhit2.mp3 differ diff --git a/main/sound/ambience/lowsteam.wav b/main/sound/ambience/lowsteam.wav new file mode 100644 index 00000000..8f21b5e0 Binary files /dev/null and b/main/sound/ambience/lowsteam.wav differ diff --git a/main/sound/ambience/metalnoise.mp3 b/main/sound/ambience/metalnoise.mp3 new file mode 100644 index 00000000..b2ffa718 Binary files /dev/null and b/main/sound/ambience/metalnoise.mp3 differ diff --git a/main/sound/ambience/metalstress.wav b/main/sound/ambience/metalstress.wav new file mode 100644 index 00000000..1b37dc1e Binary files /dev/null and b/main/sound/ambience/metalstress.wav differ diff --git a/main/sound/ambience/ominous.mp3 b/main/sound/ambience/ominous.mp3 new file mode 100644 index 00000000..167db563 Binary files /dev/null and b/main/sound/ambience/ominous.mp3 differ diff --git a/main/sound/ambience/pings.mp3 b/main/sound/ambience/pings.mp3 new file mode 100644 index 00000000..0e741bfc Binary files /dev/null and b/main/sound/ambience/pings.mp3 differ diff --git a/main/sound/ambience/processing.wav b/main/sound/ambience/processing.wav new file mode 100644 index 00000000..fb79cdfe Binary files /dev/null and b/main/sound/ambience/processing.wav differ diff --git a/main/sound/ambience/pulsingwhine.wav b/main/sound/ambience/pulsingwhine.wav new file mode 100644 index 00000000..6bcab76d Binary files /dev/null and b/main/sound/ambience/pulsingwhine.wav differ diff --git a/main/sound/ambience/rain.wav b/main/sound/ambience/rain.wav new file mode 100644 index 00000000..372cb430 Binary files /dev/null and b/main/sound/ambience/rain.wav differ diff --git a/main/sound/ambience/rain2.wav b/main/sound/ambience/rain2.wav new file mode 100644 index 00000000..864ca2df Binary files /dev/null and b/main/sound/ambience/rain2.wav differ diff --git a/main/sound/ambience/rocket_groan4.wav b/main/sound/ambience/rocket_groan4.wav new file mode 100644 index 00000000..43f5b51d Binary files /dev/null and b/main/sound/ambience/rocket_groan4.wav differ diff --git a/main/sound/ambience/rumblewhine.wav b/main/sound/ambience/rumblewhine.wav new file mode 100644 index 00000000..461c994b Binary files /dev/null and b/main/sound/ambience/rumblewhine.wav differ diff --git a/main/sound/ambience/rustydoor.mp3 b/main/sound/ambience/rustydoor.mp3 new file mode 100644 index 00000000..f3d63e33 Binary files /dev/null and b/main/sound/ambience/rustydoor.mp3 differ diff --git a/main/sound/ambience/scaryambience.mp3 b/main/sound/ambience/scaryambience.mp3 new file mode 100644 index 00000000..922fbd8b Binary files /dev/null and b/main/sound/ambience/scaryambience.mp3 differ diff --git a/main/sound/ambience/shaft.wav b/main/sound/ambience/shaft.wav new file mode 100644 index 00000000..3743b305 Binary files /dev/null and b/main/sound/ambience/shaft.wav differ diff --git a/main/sound/ambience/steamburst1.wav b/main/sound/ambience/steamburst1.wav new file mode 100644 index 00000000..b2a0522b Binary files /dev/null and b/main/sound/ambience/steamburst1.wav differ diff --git a/main/sound/ambience/steamburst2.mp3 b/main/sound/ambience/steamburst2.mp3 new file mode 100644 index 00000000..522ca678 Binary files /dev/null and b/main/sound/ambience/steamburst2.mp3 differ diff --git a/main/sound/ambience/steamburst2.wav b/main/sound/ambience/steamburst2.wav new file mode 100644 index 00000000..fac8a25c Binary files /dev/null and b/main/sound/ambience/steamburst2.wav differ diff --git a/main/sound/ambience/steamburst4.wav b/main/sound/ambience/steamburst4.wav new file mode 100644 index 00000000..8da2d963 Binary files /dev/null and b/main/sound/ambience/steamburst4.wav differ diff --git a/main/sound/ambience/steamjet1.wav b/main/sound/ambience/steamjet1.wav new file mode 100644 index 00000000..f5f9fa11 Binary files /dev/null and b/main/sound/ambience/steamjet1.wav differ diff --git a/main/sound/ambience/thunder1.wav b/main/sound/ambience/thunder1.wav new file mode 100644 index 00000000..b93f1afd Binary files /dev/null and b/main/sound/ambience/thunder1.wav differ diff --git a/main/sound/ambience/thunder2.wav b/main/sound/ambience/thunder2.wav new file mode 100644 index 00000000..a38a0c3b Binary files /dev/null and b/main/sound/ambience/thunder2.wav differ diff --git a/main/sound/ambience/thunder_clap.wav b/main/sound/ambience/thunder_clap.wav new file mode 100644 index 00000000..eca59fd7 Binary files /dev/null and b/main/sound/ambience/thunder_clap.wav differ diff --git a/main/sound/ambience/thunder_st_1.wav b/main/sound/ambience/thunder_st_1.wav new file mode 100644 index 00000000..18656f97 Binary files /dev/null and b/main/sound/ambience/thunder_st_1.wav differ diff --git a/main/sound/ambience/turbine.wav b/main/sound/ambience/turbine.wav new file mode 100644 index 00000000..1bda6b8d Binary files /dev/null and b/main/sound/ambience/turbine.wav differ diff --git a/main/sound/ambience/waterfall1.wav b/main/sound/ambience/waterfall1.wav new file mode 100644 index 00000000..398f0042 Binary files /dev/null and b/main/sound/ambience/waterfall1.wav differ diff --git a/main/sound/ambience/wind2.wav b/main/sound/ambience/wind2.wav new file mode 100644 index 00000000..059b0070 Binary files /dev/null and b/main/sound/ambience/wind2.wav differ diff --git a/main/sound/ambience/wind3.wav b/main/sound/ambience/wind3.wav new file mode 100644 index 00000000..f67b1507 Binary files /dev/null and b/main/sound/ambience/wind3.wav differ diff --git a/main/sound/buttons/button1.wav b/main/sound/buttons/button1.wav new file mode 100644 index 00000000..01dfcefc Binary files /dev/null and b/main/sound/buttons/button1.wav differ diff --git a/main/sound/buttons/button10.wav b/main/sound/buttons/button10.wav new file mode 100644 index 00000000..66371bfe Binary files /dev/null and b/main/sound/buttons/button10.wav differ diff --git a/main/sound/buttons/button2.wav b/main/sound/buttons/button2.wav new file mode 100644 index 00000000..4cb222dd Binary files /dev/null and b/main/sound/buttons/button2.wav differ diff --git a/main/sound/buttons/button3.wav b/main/sound/buttons/button3.wav new file mode 100644 index 00000000..8c9fd0f2 Binary files /dev/null and b/main/sound/buttons/button3.wav differ diff --git a/main/sound/buttons/button4.wav b/main/sound/buttons/button4.wav new file mode 100644 index 00000000..1f796b0a Binary files /dev/null and b/main/sound/buttons/button4.wav differ diff --git a/main/sound/buttons/button5.wav b/main/sound/buttons/button5.wav new file mode 100644 index 00000000..5980ed58 Binary files /dev/null and b/main/sound/buttons/button5.wav differ diff --git a/main/sound/buttons/button6.wav b/main/sound/buttons/button6.wav new file mode 100644 index 00000000..4cf8ae0c Binary files /dev/null and b/main/sound/buttons/button6.wav differ diff --git a/main/sound/buttons/button7.wav b/main/sound/buttons/button7.wav new file mode 100644 index 00000000..01eaffee Binary files /dev/null and b/main/sound/buttons/button7.wav differ diff --git a/main/sound/buttons/button9.wav b/main/sound/buttons/button9.wav new file mode 100644 index 00000000..9216ae1a Binary files /dev/null and b/main/sound/buttons/button9.wav differ diff --git a/main/sound/co_daimos/rrsec.wav b/main/sound/co_daimos/rrsec.wav new file mode 100644 index 00000000..09a7f09e Binary files /dev/null and b/main/sound/co_daimos/rrsec.wav differ diff --git a/main/sound/co_daimos/vocal01.wav b/main/sound/co_daimos/vocal01.wav new file mode 100644 index 00000000..07c26fcd Binary files /dev/null and b/main/sound/co_daimos/vocal01.wav differ diff --git a/main/sound/co_daimos/vocal02.wav b/main/sound/co_daimos/vocal02.wav new file mode 100644 index 00000000..77a03021 Binary files /dev/null and b/main/sound/co_daimos/vocal02.wav differ diff --git a/main/sound/co_daimos/vocal03.wav b/main/sound/co_daimos/vocal03.wav new file mode 100644 index 00000000..bdb2723a Binary files /dev/null and b/main/sound/co_daimos/vocal03.wav differ diff --git a/main/sound/co_daimos/vocal04.wav b/main/sound/co_daimos/vocal04.wav new file mode 100644 index 00000000..0fdf7786 Binary files /dev/null and b/main/sound/co_daimos/vocal04.wav differ diff --git a/main/sound/co_kestrel/catticked.wav b/main/sound/co_kestrel/catticked.wav new file mode 100644 index 00000000..00939b37 Binary files /dev/null and b/main/sound/co_kestrel/catticked.wav differ diff --git a/main/sound/co_niveus/bastwind2.wav b/main/sound/co_niveus/bastwind2.wav new file mode 100644 index 00000000..f95d40a4 Binary files /dev/null and b/main/sound/co_niveus/bastwind2.wav differ diff --git a/main/sound/co_niveus/bg.wav b/main/sound/co_niveus/bg.wav new file mode 100644 index 00000000..57b4125d Binary files /dev/null and b/main/sound/co_niveus/bg.wav differ diff --git a/main/sound/co_niveus/emdrill.wav b/main/sound/co_niveus/emdrill.wav new file mode 100644 index 00000000..62e61c4c Binary files /dev/null and b/main/sound/co_niveus/emdrill.wav differ diff --git a/main/sound/co_niveus/hum.wav b/main/sound/co_niveus/hum.wav new file mode 100644 index 00000000..92538158 Binary files /dev/null and b/main/sound/co_niveus/hum.wav differ diff --git a/main/sound/co_niveus/steamburst1.wav b/main/sound/co_niveus/steamburst1.wav new file mode 100644 index 00000000..b2a0522b Binary files /dev/null and b/main/sound/co_niveus/steamburst1.wav differ diff --git a/main/sound/co_niveus/steamjet1.wav b/main/sound/co_niveus/steamjet1.wav new file mode 100644 index 00000000..f5f9fa11 Binary files /dev/null and b/main/sound/co_niveus/steamjet1.wav differ diff --git a/main/sound/co_sava/fan2.wav b/main/sound/co_sava/fan2.wav new file mode 100644 index 00000000..e7a8d7b2 Binary files /dev/null and b/main/sound/co_sava/fan2.wav differ diff --git a/main/sound/co_sava/pulsingwhine.wav b/main/sound/co_sava/pulsingwhine.wav new file mode 100644 index 00000000..4cf69df2 Binary files /dev/null and b/main/sound/co_sava/pulsingwhine.wav differ diff --git a/main/sound/co_sava/steamburst1.wav b/main/sound/co_sava/steamburst1.wav new file mode 100644 index 00000000..dfed4e64 Binary files /dev/null and b/main/sound/co_sava/steamburst1.wav differ diff --git a/main/sound/co_ulysses/raindos.wav b/main/sound/co_ulysses/raindos.wav new file mode 100644 index 00000000..8352c50b Binary files /dev/null and b/main/sound/co_ulysses/raindos.wav differ diff --git a/main/sound/co_ulysses/raindos2.wav b/main/sound/co_ulysses/raindos2.wav new file mode 100644 index 00000000..8c8a5885 Binary files /dev/null and b/main/sound/co_ulysses/raindos2.wav differ diff --git a/main/sound/common/wpn_denyselect-a.wav b/main/sound/common/wpn_denyselect-a.wav new file mode 100644 index 00000000..51d2829f Binary files /dev/null and b/main/sound/common/wpn_denyselect-a.wav differ diff --git a/main/sound/common/wpn_denyselect.wav b/main/sound/common/wpn_denyselect.wav new file mode 100644 index 00000000..3279a514 Binary files /dev/null and b/main/sound/common/wpn_denyselect.wav differ diff --git a/main/sound/common/wpn_hudoff-a.wav b/main/sound/common/wpn_hudoff-a.wav new file mode 100644 index 00000000..5f6fea05 Binary files /dev/null and b/main/sound/common/wpn_hudoff-a.wav differ diff --git a/main/sound/common/wpn_hudoff.wav b/main/sound/common/wpn_hudoff.wav new file mode 100644 index 00000000..4955ceb4 Binary files /dev/null and b/main/sound/common/wpn_hudoff.wav differ diff --git a/main/sound/common/wpn_hudon-a.wav b/main/sound/common/wpn_hudon-a.wav new file mode 100644 index 00000000..67e4769b Binary files /dev/null and b/main/sound/common/wpn_hudon-a.wav differ diff --git a/main/sound/common/wpn_hudon.wav b/main/sound/common/wpn_hudon.wav new file mode 100644 index 00000000..128fe19c Binary files /dev/null and b/main/sound/common/wpn_hudon.wav differ diff --git a/main/sound/common/wpn_moveselect-a.wav b/main/sound/common/wpn_moveselect-a.wav new file mode 100644 index 00000000..aa08160b Binary files /dev/null and b/main/sound/common/wpn_moveselect-a.wav differ diff --git a/main/sound/common/wpn_moveselect.wav b/main/sound/common/wpn_moveselect.wav new file mode 100644 index 00000000..8e45250f Binary files /dev/null and b/main/sound/common/wpn_moveselect.wav differ diff --git a/main/sound/common/wpn_select-a.wav b/main/sound/common/wpn_select-a.wav new file mode 100644 index 00000000..a6247233 Binary files /dev/null and b/main/sound/common/wpn_select-a.wav differ diff --git a/main/sound/common/wpn_select.wav b/main/sound/common/wpn_select.wav new file mode 100644 index 00000000..456c4030 Binary files /dev/null and b/main/sound/common/wpn_select.wav differ diff --git a/main/sound/doors/doormove1.wav b/main/sound/doors/doormove1.wav new file mode 100644 index 00000000..70e426b0 Binary files /dev/null and b/main/sound/doors/doormove1.wav differ diff --git a/main/sound/doors/doormove2.wav b/main/sound/doors/doormove2.wav new file mode 100644 index 00000000..fa40cfa0 Binary files /dev/null and b/main/sound/doors/doormove2.wav differ diff --git a/main/sound/doors/doormove3.wav b/main/sound/doors/doormove3.wav new file mode 100644 index 00000000..999072cb Binary files /dev/null and b/main/sound/doors/doormove3.wav differ diff --git a/main/sound/doors/doormove4.wav b/main/sound/doors/doormove4.wav new file mode 100644 index 00000000..b473a57c Binary files /dev/null and b/main/sound/doors/doormove4.wav differ diff --git a/main/sound/doors/doormove5.wav b/main/sound/doors/doormove5.wav new file mode 100644 index 00000000..e70c8837 Binary files /dev/null and b/main/sound/doors/doormove5.wav differ diff --git a/main/sound/doors/doormove6.wav b/main/sound/doors/doormove6.wav new file mode 100644 index 00000000..a2f9e091 Binary files /dev/null and b/main/sound/doors/doormove6.wav differ diff --git a/main/sound/doors/doormove7.wav b/main/sound/doors/doormove7.wav new file mode 100644 index 00000000..f8e24bf4 Binary files /dev/null and b/main/sound/doors/doormove7.wav differ diff --git a/main/sound/doors/doormove8.wav b/main/sound/doors/doormove8.wav new file mode 100644 index 00000000..a6932602 Binary files /dev/null and b/main/sound/doors/doormove8.wav differ diff --git a/main/sound/doors/doorstop1.wav b/main/sound/doors/doorstop1.wav new file mode 100644 index 00000000..11343df6 Binary files /dev/null and b/main/sound/doors/doorstop1.wav differ diff --git a/main/sound/doors/doorstop2.wav b/main/sound/doors/doorstop2.wav new file mode 100644 index 00000000..6ec27716 Binary files /dev/null and b/main/sound/doors/doorstop2.wav differ diff --git a/main/sound/doors/doorstop3.wav b/main/sound/doors/doorstop3.wav new file mode 100644 index 00000000..b2a0522b Binary files /dev/null and b/main/sound/doors/doorstop3.wav differ diff --git a/main/sound/doors/doorstop4.wav b/main/sound/doors/doorstop4.wav new file mode 100644 index 00000000..44ac78dd Binary files /dev/null and b/main/sound/doors/doorstop4.wav differ diff --git a/main/sound/fans/fan2.wav b/main/sound/fans/fan2.wav new file mode 100644 index 00000000..e20f3bf8 Binary files /dev/null and b/main/sound/fans/fan2.wav differ diff --git a/main/sound/hud/alien_enemyapproaches1.wav b/main/sound/hud/alien_enemyapproaches1.wav new file mode 100644 index 00000000..7220f286 Binary files /dev/null and b/main/sound/hud/alien_enemyapproaches1.wav differ diff --git a/main/sound/hud/alien_enemyapproaches2.wav b/main/sound/hud/alien_enemyapproaches2.wav new file mode 100644 index 00000000..840a3c1f Binary files /dev/null and b/main/sound/hud/alien_enemyapproaches2.wav differ diff --git a/main/sound/hud/alien_gamestart1.wav b/main/sound/hud/alien_gamestart1.wav new file mode 100644 index 00000000..e48f0dad Binary files /dev/null and b/main/sound/hud/alien_gamestart1.wav differ diff --git a/main/sound/hud/alien_gamestart2.wav b/main/sound/hud/alien_gamestart2.wav new file mode 100644 index 00000000..0eda27cb Binary files /dev/null and b/main/sound/hud/alien_gamestart2.wav differ diff --git a/main/sound/hud/alien_hiveattack.wav b/main/sound/hud/alien_hiveattack.wav new file mode 100644 index 00000000..81937822 Binary files /dev/null and b/main/sound/hud/alien_hiveattack.wav differ diff --git a/main/sound/hud/alien_hivecomplete1.wav b/main/sound/hud/alien_hivecomplete1.wav new file mode 100644 index 00000000..b90edcdc Binary files /dev/null and b/main/sound/hud/alien_hivecomplete1.wav differ diff --git a/main/sound/hud/alien_hivecomplete2.wav b/main/sound/hud/alien_hivecomplete2.wav new file mode 100644 index 00000000..454fa980 Binary files /dev/null and b/main/sound/hud/alien_hivecomplete2.wav differ diff --git a/main/sound/hud/alien_hivedying1.wav b/main/sound/hud/alien_hivedying1.wav new file mode 100644 index 00000000..a70b5eb2 Binary files /dev/null and b/main/sound/hud/alien_hivedying1.wav differ diff --git a/main/sound/hud/alien_hivedying2.wav b/main/sound/hud/alien_hivedying2.wav new file mode 100644 index 00000000..95d57459 Binary files /dev/null and b/main/sound/hud/alien_hivedying2.wav differ diff --git a/main/sound/hud/alien_lifeformattack1.wav b/main/sound/hud/alien_lifeformattack1.wav new file mode 100644 index 00000000..2a808008 Binary files /dev/null and b/main/sound/hud/alien_lifeformattack1.wav differ diff --git a/main/sound/hud/alien_lifeformattack2.wav b/main/sound/hud/alien_lifeformattack2.wav new file mode 100644 index 00000000..96011994 Binary files /dev/null and b/main/sound/hud/alien_lifeformattack2.wav differ diff --git a/main/sound/hud/alien_lowresources.wav b/main/sound/hud/alien_lowresources.wav new file mode 100644 index 00000000..cccef648 Binary files /dev/null and b/main/sound/hud/alien_lowresources.wav differ diff --git a/main/sound/hud/alien_mess.wav b/main/sound/hud/alien_mess.wav new file mode 100644 index 00000000..1e698d55 Binary files /dev/null and b/main/sound/hud/alien_mess.wav differ diff --git a/main/sound/hud/alien_more1.wav b/main/sound/hud/alien_more1.wav new file mode 100644 index 00000000..b0939157 Binary files /dev/null and b/main/sound/hud/alien_more1.wav differ diff --git a/main/sound/hud/alien_more2.wav b/main/sound/hud/alien_more2.wav new file mode 100644 index 00000000..6a7a6a7f Binary files /dev/null and b/main/sound/hud/alien_more2.wav differ diff --git a/main/sound/hud/alien_myhive.wav b/main/sound/hud/alien_myhive.wav new file mode 100644 index 00000000..a1023390 Binary files /dev/null and b/main/sound/hud/alien_myhive.wav differ diff --git a/main/sound/hud/alien_needbetter.wav b/main/sound/hud/alien_needbetter.wav new file mode 100644 index 00000000..743d7576 Binary files /dev/null and b/main/sound/hud/alien_needbetter.wav differ diff --git a/main/sound/hud/alien_needbuilders1.wav b/main/sound/hud/alien_needbuilders1.wav new file mode 100644 index 00000000..d5b4fa9f Binary files /dev/null and b/main/sound/hud/alien_needbuilders1.wav differ diff --git a/main/sound/hud/alien_needbuilders2.wav b/main/sound/hud/alien_needbuilders2.wav new file mode 100644 index 00000000..ab7c8a09 Binary files /dev/null and b/main/sound/hud/alien_needbuilders2.wav differ diff --git a/main/sound/hud/alien_newtrait1.wav b/main/sound/hud/alien_newtrait1.wav new file mode 100644 index 00000000..c3603c49 Binary files /dev/null and b/main/sound/hud/alien_newtrait1.wav differ diff --git a/main/sound/hud/alien_newtrait2.wav b/main/sound/hud/alien_newtrait2.wav new file mode 100644 index 00000000..5d901a1c Binary files /dev/null and b/main/sound/hud/alien_newtrait2.wav differ diff --git a/main/sound/hud/alien_now.wav b/main/sound/hud/alien_now.wav new file mode 100644 index 00000000..23afcf34 Binary files /dev/null and b/main/sound/hud/alien_now.wav differ diff --git a/main/sound/hud/alien_points_received.wav b/main/sound/hud/alien_points_received.wav new file mode 100644 index 00000000..96ded4e0 Binary files /dev/null and b/main/sound/hud/alien_points_received.wav differ diff --git a/main/sound/hud/alien_resourceattack1.wav b/main/sound/hud/alien_resourceattack1.wav new file mode 100644 index 00000000..20e34dd5 Binary files /dev/null and b/main/sound/hud/alien_resourceattack1.wav differ diff --git a/main/sound/hud/alien_resourceattack2.wav b/main/sound/hud/alien_resourceattack2.wav new file mode 100644 index 00000000..5879fedf Binary files /dev/null and b/main/sound/hud/alien_resourceattack2.wav differ diff --git a/main/sound/hud/alien_seedead.wav b/main/sound/hud/alien_seedead.wav new file mode 100644 index 00000000..7cf7e482 Binary files /dev/null and b/main/sound/hud/alien_seedead.wav differ diff --git a/main/sound/hud/alien_structureattack1.wav b/main/sound/hud/alien_structureattack1.wav new file mode 100644 index 00000000..467bd577 Binary files /dev/null and b/main/sound/hud/alien_structureattack1.wav differ diff --git a/main/sound/hud/alien_structureattack2.wav b/main/sound/hud/alien_structureattack2.wav new file mode 100644 index 00000000..0bef8af5 Binary files /dev/null and b/main/sound/hud/alien_structureattack2.wav differ diff --git a/main/sound/hud/alien_upgrade_lost.wav b/main/sound/hud/alien_upgrade_lost.wav new file mode 100644 index 00000000..ea8b1865 Binary files /dev/null and b/main/sound/hud/alien_upgrade_lost.wav differ diff --git a/main/sound/hud/countdown.wav b/main/sound/hud/countdown.wav new file mode 100644 index 00000000..0bbb86bd Binary files /dev/null and b/main/sound/hud/countdown.wav differ diff --git a/main/sound/hud/m-squad1.wav b/main/sound/hud/m-squad1.wav new file mode 100644 index 00000000..74b79393 Binary files /dev/null and b/main/sound/hud/m-squad1.wav differ diff --git a/main/sound/hud/m-squad2.wav b/main/sound/hud/m-squad2.wav new file mode 100644 index 00000000..368898ef Binary files /dev/null and b/main/sound/hud/m-squad2.wav differ diff --git a/main/sound/hud/m-squad3.wav b/main/sound/hud/m-squad3.wav new file mode 100644 index 00000000..cf922fbe Binary files /dev/null and b/main/sound/hud/m-squad3.wav differ diff --git a/main/sound/hud/m-squad4.wav b/main/sound/hud/m-squad4.wav new file mode 100644 index 00000000..654d155a Binary files /dev/null and b/main/sound/hud/m-squad4.wav differ diff --git a/main/sound/hud/m-squad5.wav b/main/sound/hud/m-squad5.wav new file mode 100644 index 00000000..d449858e Binary files /dev/null and b/main/sound/hud/m-squad5.wav differ diff --git a/main/sound/hud/marine_armoryupgrading.wav b/main/sound/hud/marine_armoryupgrading.wav new file mode 100644 index 00000000..973fa6c5 Binary files /dev/null and b/main/sound/hud/marine_armoryupgrading.wav differ diff --git a/main/sound/hud/marine_baseattack1.wav b/main/sound/hud/marine_baseattack1.wav new file mode 100644 index 00000000..ed9cd62c Binary files /dev/null and b/main/sound/hud/marine_baseattack1.wav differ diff --git a/main/sound/hud/marine_baseattack2.wav b/main/sound/hud/marine_baseattack2.wav new file mode 100644 index 00000000..f315de1c Binary files /dev/null and b/main/sound/hud/marine_baseattack2.wav differ diff --git a/main/sound/hud/marine_cconline1.wav b/main/sound/hud/marine_cconline1.wav new file mode 100644 index 00000000..d73fa5ee Binary files /dev/null and b/main/sound/hud/marine_cconline1.wav differ diff --git a/main/sound/hud/marine_cconline2.wav b/main/sound/hud/marine_cconline2.wav new file mode 100644 index 00000000..831bab42 Binary files /dev/null and b/main/sound/hud/marine_cconline2.wav differ diff --git a/main/sound/hud/marine_ccunderattack1.wav b/main/sound/hud/marine_ccunderattack1.wav new file mode 100644 index 00000000..bbb0a648 Binary files /dev/null and b/main/sound/hud/marine_ccunderattack1.wav differ diff --git a/main/sound/hud/marine_ccunderattack2.wav b/main/sound/hud/marine_ccunderattack2.wav new file mode 100644 index 00000000..47acf9cc Binary files /dev/null and b/main/sound/hud/marine_ccunderattack2.wav differ diff --git a/main/sound/hud/marine_commander_ejected.wav b/main/sound/hud/marine_commander_ejected.wav new file mode 100644 index 00000000..ad1ec8a8 Binary files /dev/null and b/main/sound/hud/marine_commander_ejected.wav differ diff --git a/main/sound/hud/marine_commanderidle1.wav b/main/sound/hud/marine_commanderidle1.wav new file mode 100644 index 00000000..81dcf4f8 Binary files /dev/null and b/main/sound/hud/marine_commanderidle1.wav differ diff --git a/main/sound/hud/marine_commanderidle2.wav b/main/sound/hud/marine_commanderidle2.wav new file mode 100644 index 00000000..1034676d Binary files /dev/null and b/main/sound/hud/marine_commanderidle2.wav differ diff --git a/main/sound/hud/marine_gamestart1.wav b/main/sound/hud/marine_gamestart1.wav new file mode 100644 index 00000000..1783a82a Binary files /dev/null and b/main/sound/hud/marine_gamestart1.wav differ diff --git a/main/sound/hud/marine_gamestart2.wav b/main/sound/hud/marine_gamestart2.wav new file mode 100644 index 00000000..05e8ce26 Binary files /dev/null and b/main/sound/hud/marine_gamestart2.wav differ diff --git a/main/sound/hud/marine_giveorders.wav b/main/sound/hud/marine_giveorders.wav new file mode 100644 index 00000000..d009cd3e Binary files /dev/null and b/main/sound/hud/marine_giveorders.wav differ diff --git a/main/sound/hud/marine_gotoalert.wav b/main/sound/hud/marine_gotoalert.wav new file mode 100644 index 00000000..8eff19b7 Binary files /dev/null and b/main/sound/hud/marine_gotoalert.wav differ diff --git a/main/sound/hud/marine_lowresources.wav b/main/sound/hud/marine_lowresources.wav new file mode 100644 index 00000000..492b4a40 Binary files /dev/null and b/main/sound/hud/marine_lowresources.wav differ diff --git a/main/sound/hud/marine_more.wav b/main/sound/hud/marine_more.wav new file mode 100644 index 00000000..fd7333fe Binary files /dev/null and b/main/sound/hud/marine_more.wav differ diff --git a/main/sound/hud/marine_needportal1.wav b/main/sound/hud/marine_needportal1.wav new file mode 100644 index 00000000..e5237266 Binary files /dev/null and b/main/sound/hud/marine_needportal1.wav differ diff --git a/main/sound/hud/marine_needportal2.wav b/main/sound/hud/marine_needportal2.wav new file mode 100644 index 00000000..d3acf461 Binary files /dev/null and b/main/sound/hud/marine_needportal2.wav differ diff --git a/main/sound/hud/marine_needsammo1.wav b/main/sound/hud/marine_needsammo1.wav new file mode 100644 index 00000000..bf3245f2 Binary files /dev/null and b/main/sound/hud/marine_needsammo1.wav differ diff --git a/main/sound/hud/marine_needsammo2.wav b/main/sound/hud/marine_needsammo2.wav new file mode 100644 index 00000000..a0df1364 Binary files /dev/null and b/main/sound/hud/marine_needsammo2.wav differ diff --git a/main/sound/hud/marine_needshealth1.wav b/main/sound/hud/marine_needshealth1.wav new file mode 100644 index 00000000..80b18914 Binary files /dev/null and b/main/sound/hud/marine_needshealth1.wav differ diff --git a/main/sound/hud/marine_needshealth2.wav b/main/sound/hud/marine_needshealth2.wav new file mode 100644 index 00000000..be6c6b2f Binary files /dev/null and b/main/sound/hud/marine_needshealth2.wav differ diff --git a/main/sound/hud/marine_needsorder1.wav b/main/sound/hud/marine_needsorder1.wav new file mode 100644 index 00000000..7c406bfd Binary files /dev/null and b/main/sound/hud/marine_needsorder1.wav differ diff --git a/main/sound/hud/marine_needsorder2.wav b/main/sound/hud/marine_needsorder2.wav new file mode 100644 index 00000000..acf376b0 Binary files /dev/null and b/main/sound/hud/marine_needsorder2.wav differ diff --git a/main/sound/hud/marine_order_attack.wav b/main/sound/hud/marine_order_attack.wav new file mode 100644 index 00000000..afef2423 Binary files /dev/null and b/main/sound/hud/marine_order_attack.wav differ diff --git a/main/sound/hud/marine_order_build.wav b/main/sound/hud/marine_order_build.wav new file mode 100644 index 00000000..9bb765df Binary files /dev/null and b/main/sound/hud/marine_order_build.wav differ diff --git a/main/sound/hud/marine_order_complete1.wav b/main/sound/hud/marine_order_complete1.wav new file mode 100644 index 00000000..3c9cf507 Binary files /dev/null and b/main/sound/hud/marine_order_complete1.wav differ diff --git a/main/sound/hud/marine_order_complete2.wav b/main/sound/hud/marine_order_complete2.wav new file mode 100644 index 00000000..dd046f98 Binary files /dev/null and b/main/sound/hud/marine_order_complete2.wav differ diff --git a/main/sound/hud/marine_order_complete3.wav b/main/sound/hud/marine_order_complete3.wav new file mode 100644 index 00000000..0fec9bb1 Binary files /dev/null and b/main/sound/hud/marine_order_complete3.wav differ diff --git a/main/sound/hud/marine_order_complete4.wav b/main/sound/hud/marine_order_complete4.wav new file mode 100644 index 00000000..64c90113 Binary files /dev/null and b/main/sound/hud/marine_order_complete4.wav differ diff --git a/main/sound/hud/marine_order_complete5.wav b/main/sound/hud/marine_order_complete5.wav new file mode 100644 index 00000000..25fa85f0 Binary files /dev/null and b/main/sound/hud/marine_order_complete5.wav differ diff --git a/main/sound/hud/marine_order_complete6.wav b/main/sound/hud/marine_order_complete6.wav new file mode 100644 index 00000000..5de02887 Binary files /dev/null and b/main/sound/hud/marine_order_complete6.wav differ diff --git a/main/sound/hud/marine_order_get.wav b/main/sound/hud/marine_order_get.wav new file mode 100644 index 00000000..3378b3f8 Binary files /dev/null and b/main/sound/hud/marine_order_get.wav differ diff --git a/main/sound/hud/marine_order_guard.wav b/main/sound/hud/marine_order_guard.wav new file mode 100644 index 00000000..dedadeb4 Binary files /dev/null and b/main/sound/hud/marine_order_guard.wav differ diff --git a/main/sound/hud/marine_order_move1.wav b/main/sound/hud/marine_order_move1.wav new file mode 100644 index 00000000..0efffb26 Binary files /dev/null and b/main/sound/hud/marine_order_move1.wav differ diff --git a/main/sound/hud/marine_order_move2.wav b/main/sound/hud/marine_order_move2.wav new file mode 100644 index 00000000..5ad0ec68 Binary files /dev/null and b/main/sound/hud/marine_order_move2.wav differ diff --git a/main/sound/hud/marine_order_move3.wav b/main/sound/hud/marine_order_move3.wav new file mode 100644 index 00000000..0efffb26 Binary files /dev/null and b/main/sound/hud/marine_order_move3.wav differ diff --git a/main/sound/hud/marine_order_move4.wav b/main/sound/hud/marine_order_move4.wav new file mode 100644 index 00000000..0cb95e19 Binary files /dev/null and b/main/sound/hud/marine_order_move4.wav differ diff --git a/main/sound/hud/marine_order_weld.wav b/main/sound/hud/marine_order_weld.wav new file mode 100644 index 00000000..98f90800 Binary files /dev/null and b/main/sound/hud/marine_order_weld.wav differ diff --git a/main/sound/hud/marine_points_received.wav b/main/sound/hud/marine_points_received.wav new file mode 100644 index 00000000..567a1882 Binary files /dev/null and b/main/sound/hud/marine_points_received.wav differ diff --git a/main/sound/hud/marine_research_complete.wav b/main/sound/hud/marine_research_complete.wav new file mode 100644 index 00000000..9bda0028 Binary files /dev/null and b/main/sound/hud/marine_research_complete.wav differ diff --git a/main/sound/hud/marine_sentryfiring1.wav b/main/sound/hud/marine_sentryfiring1.wav new file mode 100644 index 00000000..446200dd Binary files /dev/null and b/main/sound/hud/marine_sentryfiring1.wav differ diff --git a/main/sound/hud/marine_sentryfiring2.wav b/main/sound/hud/marine_sentryfiring2.wav new file mode 100644 index 00000000..18c362b3 Binary files /dev/null and b/main/sound/hud/marine_sentryfiring2.wav differ diff --git a/main/sound/hud/marine_sentrytakingdamage1.wav b/main/sound/hud/marine_sentrytakingdamage1.wav new file mode 100644 index 00000000..84bb5a5d Binary files /dev/null and b/main/sound/hud/marine_sentrytakingdamage1.wav differ diff --git a/main/sound/hud/marine_sentrytakingdamage2.wav b/main/sound/hud/marine_sentrytakingdamage2.wav new file mode 100644 index 00000000..3bda182c Binary files /dev/null and b/main/sound/hud/marine_sentrytakingdamage2.wav differ diff --git a/main/sound/hud/marine_soldierlost1.wav b/main/sound/hud/marine_soldierlost1.wav new file mode 100644 index 00000000..7e1ce880 Binary files /dev/null and b/main/sound/hud/marine_soldierlost1.wav differ diff --git a/main/sound/hud/marine_soldierlost2.wav b/main/sound/hud/marine_soldierlost2.wav new file mode 100644 index 00000000..d7c6f529 Binary files /dev/null and b/main/sound/hud/marine_soldierlost2.wav differ diff --git a/main/sound/hud/marine_soldierunderattack.wav b/main/sound/hud/marine_soldierunderattack.wav new file mode 100644 index 00000000..eef890a7 Binary files /dev/null and b/main/sound/hud/marine_soldierunderattack.wav differ diff --git a/main/sound/hud/marine_upgradecomplete.wav b/main/sound/hud/marine_upgradecomplete.wav new file mode 100644 index 00000000..0b40faf7 Binary files /dev/null and b/main/sound/hud/marine_upgradecomplete.wav differ diff --git a/main/sound/hud/place_building.wav b/main/sound/hud/place_building.wav new file mode 100644 index 00000000..09483f84 Binary files /dev/null and b/main/sound/hud/place_building.wav differ diff --git a/main/sound/hud/points_spent.wav b/main/sound/hud/points_spent.wav new file mode 100644 index 00000000..10065398 Binary files /dev/null and b/main/sound/hud/points_spent.wav differ diff --git a/main/sound/hud/select-a.wav b/main/sound/hud/select-a.wav new file mode 100644 index 00000000..94fe8359 Binary files /dev/null and b/main/sound/hud/select-a.wav differ diff --git a/main/sound/hud/select.wav b/main/sound/hud/select.wav new file mode 100644 index 00000000..5de7b0f0 Binary files /dev/null and b/main/sound/hud/select.wav differ diff --git a/main/sound/hud/select_node_backward-a.wav b/main/sound/hud/select_node_backward-a.wav new file mode 100644 index 00000000..2beac2af Binary files /dev/null and b/main/sound/hud/select_node_backward-a.wav differ diff --git a/main/sound/hud/select_node_backward.wav b/main/sound/hud/select_node_backward.wav new file mode 100644 index 00000000..e27bbc25 Binary files /dev/null and b/main/sound/hud/select_node_backward.wav differ diff --git a/main/sound/hud/select_node_forward-a.wav b/main/sound/hud/select_node_forward-a.wav new file mode 100644 index 00000000..94fe8359 Binary files /dev/null and b/main/sound/hud/select_node_forward-a.wav differ diff --git a/main/sound/hud/select_node_forward.wav b/main/sound/hud/select_node_forward.wav new file mode 100644 index 00000000..77ef2a70 Binary files /dev/null and b/main/sound/hud/select_node_forward.wav differ diff --git a/main/sound/hud/squad1.wav b/main/sound/hud/squad1.wav new file mode 100644 index 00000000..48161ba9 Binary files /dev/null and b/main/sound/hud/squad1.wav differ diff --git a/main/sound/hud/squad2.wav b/main/sound/hud/squad2.wav new file mode 100644 index 00000000..e23871bc Binary files /dev/null and b/main/sound/hud/squad2.wav differ diff --git a/main/sound/hud/squad3.wav b/main/sound/hud/squad3.wav new file mode 100644 index 00000000..f3e15920 Binary files /dev/null and b/main/sound/hud/squad3.wav differ diff --git a/main/sound/hud/squad4.wav b/main/sound/hud/squad4.wav new file mode 100644 index 00000000..cf526b2e Binary files /dev/null and b/main/sound/hud/squad4.wav differ diff --git a/main/sound/hud/squad5.wav b/main/sound/hud/squad5.wav new file mode 100644 index 00000000..e8158bde Binary files /dev/null and b/main/sound/hud/squad5.wav differ diff --git a/main/sound/hud/tooltip.wav b/main/sound/hud/tooltip.wav new file mode 100644 index 00000000..05362783 Binary files /dev/null and b/main/sound/hud/tooltip.wav differ diff --git a/main/sound/hud/you_lose.wav b/main/sound/hud/you_lose.wav new file mode 100644 index 00000000..38bf5d57 Binary files /dev/null and b/main/sound/hud/you_lose.wav differ diff --git a/main/sound/hud/you_win.wav b/main/sound/hud/you_win.wav new file mode 100644 index 00000000..306bae1b Binary files /dev/null and b/main/sound/hud/you_win.wav differ diff --git a/main/sound/items/9mmclip1.wav b/main/sound/items/9mmclip1.wav new file mode 100644 index 00000000..ed6cf9b4 Binary files /dev/null and b/main/sound/items/9mmclip1.wav differ diff --git a/main/sound/items/9mmclip2.wav b/main/sound/items/9mmclip2.wav new file mode 100644 index 00000000..aeb5579d Binary files /dev/null and b/main/sound/items/9mmclip2.wav differ diff --git a/main/sound/items/catalyst.wav b/main/sound/items/catalyst.wav new file mode 100644 index 00000000..a7a30586 Binary files /dev/null and b/main/sound/items/catalyst.wav differ diff --git a/main/sound/items/flashlight1.wav b/main/sound/items/flashlight1.wav new file mode 100644 index 00000000..d48811b8 Binary files /dev/null and b/main/sound/items/flashlight1.wav differ diff --git a/main/sound/items/gunpickup2-a.wav b/main/sound/items/gunpickup2-a.wav new file mode 100644 index 00000000..2beac2af Binary files /dev/null and b/main/sound/items/gunpickup2-a.wav differ diff --git a/main/sound/items/gunpickup2.wav b/main/sound/items/gunpickup2.wav new file mode 100644 index 00000000..fde4d069 Binary files /dev/null and b/main/sound/items/gunpickup2.wav differ diff --git a/main/sound/items/health.wav b/main/sound/items/health.wav new file mode 100644 index 00000000..5a516215 Binary files /dev/null and b/main/sound/items/health.wav differ diff --git a/main/sound/items/pickup_heavy.wav b/main/sound/items/pickup_heavy.wav new file mode 100644 index 00000000..1f9de140 Binary files /dev/null and b/main/sound/items/pickup_heavy.wav differ diff --git a/main/sound/items/pickup_jetpack.wav b/main/sound/items/pickup_jetpack.wav new file mode 100644 index 00000000..0de4c107 Binary files /dev/null and b/main/sound/items/pickup_jetpack.wav differ diff --git a/main/sound/items/weapondrop1.wav b/main/sound/items/weapondrop1.wav new file mode 100644 index 00000000..9d6bff65 Binary files /dev/null and b/main/sound/items/weapondrop1.wav differ diff --git a/main/sound/materials.txt b/main/sound/materials.txt new file mode 100644 index 00000000..1d92395c --- /dev/null +++ b/main/sound/materials.txt @@ -0,0 +1,584 @@ +//----------------------------------------------------------- +// Counter-Strike +//----------------------------------------------------------- +// In this file you can modify the sound the textures give +// when the player walks on them +// +// Location: X:\halflife\valve\sound\materials.txt +// +// NOTE: only the first 12 characters of the texture name are used +// NOTE: a maximum of 512 textures may be tagged in this file +// +// 'M' metal +// 'V' ventillation +// 'D' dirt +// 'S' slosh liquid +// 'T' tile +// 'G' grate (Concrete is the default) +// 'W' wood +// 'P' computer +// 'Y' glass +// 'N' snow + +// NS textures + +M plainmet +M plainmet-big +M platform +M platfrom-a +M r25_beam +M r25_detail +M r25_fan +M r25_junction +M r25_monitorbox +M r25_piston +M r25_silowall2 +M r25_strut2 +M r25_trainwheel2 +M rustypipe +M shaftlights +M shaftlights2 +M shaftlights3 +M teckfloor01 +M teckfloor01-big +M teckwall05 +M teckwall05-big +M teckwall07 +M teckwall07-big +M teckwall08 +M teckwall09 +M teckwall10 +M teckwall13 +M teckwall13-big +M teckwall14 +M teckwall14-big +M teckwall15 +M teckwall15-big +M teckwall16 +M teckwall16-big +M teckwall17 +M teckwall17-big +M teckwall18 +M teckwall18-big +M teckwall19 +M teckwall19-big +M teckwall20 +M tecwall1 +M tecwall1-big +M tecwall2 +M tecwall2-big +M trim +M trim_black +M trim_black2 +M trim_bolts +M trim_bump +M trim_dark +M trim_grey +M trim_labwall1 +M trim_labwall2 +M trim_ridges +M wall +M wall_1 +M wall_1-big +M wall_2 +M wall_2-big +M wall_3 +M wall_3-big +M wall_1 +M wall_black1 +M wall_black2 +M wall_black3 +M wall_blckstrp1 +M wall_blckstrp2 +M wall_compthin +M wall_green4 +M wall_lab1 +M wall_lab2 +M wall_lab3 +M wall_lab4 +M wall_panels +M wall_shaft +M wall_tech1 +M wall_tech2 +M wall_tech3 +M wall_tech4 +M wall_techdoor +M wall1 +M wall1-b +M wall1-big +M wall2-b +M wall2-big +M wall-big +M wallteck12 +M wallteck12-big +M wetwall1 +M wetwall1-big +M wetwall2 +M wetwall2-big +M wetwall3 +M wetwall3-big +V pipe +V pipes_1 +V pipes_weird +V pipes1 +V pipes1-big +V pipes2 +V pipes2-big +V pipes3 +V pipes3-big +V r25_tank2 +V r25_tank3 +V r25_yellow1 +D r25_asphalt3 +S scroll_smelt +G r25_grate2 +G r25_ladder +G r25_nonslip2 +G r25_pipewall3 +G r25_platform1 +G r25_yellow2 +G r6_light2 +G step +G step_bump +G step_ridged +G step_ridged2 +G teckfloor04 +G teckwall04 +G teckwall04-b +G teckwall04-big +G teckwall06 +G teckwall06-big +G vent +G vent2 +P panel1 +P panel2 +P panel3 +P panel4 +P panel4b +P r25_cabinet2 +P r25_cabinet4 +P r25_controls2 +P r25_instwal1 +P r25_keypad +P r25_mech2 +P r25_monitor2 +P screen_alien1 +P screen_lab1 +P teck01 +P teck02 +P teck03 +P teck04 +P wall_bluestrip +P wall_circuits +Y window1 +Y window02 +Y window03 +Y window01 +Y r25_light3 +Y subway_lights +Y r6_light1 +Y r6_light3 + +// First map +M {HALL_FLOOR +M HALL_FLOOR +M {CATWALK_RAIL +M {CATWALK +M CATWALK +M CATWALK_RAIL +Y PLATFORM +T PIPES4 +M {GRATE +M {GRATE2 + +//----------------------------------------------------------- +// Valve's Textures +//----------------------------------------------------------- +V DUCT_FLR01 +V DUCT_FLR01A +V DUCT_FLR02A +V DUCT_VNT +V DUCT_VNT2 +V DUCT_WALL01 +V DUCT_WALL02 +V DUCT_WALL03 +V DUCT_WALL04 +V SILO2_COR +D OUT_GRVL1 +D OUT_GRVL2 +D OUT_GRVL2B +D OUT_GRVL3 +D OUT_MUD1 +D OUT_SND1 +D OUT_SND2 +D OUT_SND2B +D OUT_SND2C +D OUT_WLK +D OUT_GRSS1 +D OUT_DIRT1 +D OUT_DIRT2 +D GENERIC48 +D GENERIC49 +D GENERIC51 +D GENERIC52 +D GENERIC93 +D OUT_PAVE2 +D OUT_SNBAG +D OUT_SNBAG2 +D OUT_SNBAGB +D OUT_SNBAGC +D OUT_TNT2 +D OUT_TNT1 +D OUT_TNT1B +D OUT_TNT1C +D OUT_TNT3 +D OUT_TNT3B +D OUT_NET1 +D OUT_NET1B +D FROSTSEWFLR +G GENERIC109 +G GENERIC015C +G GENERIC015D +G GENERIC015E +G GENERIC015F +G GENERIC015G +G GENERIC015H +G GENERIC015I +G GENERIC015 +G GENERIC015A +G GENERIC015B +G BABTECH_FLR02 +G CRETE2_FLR03 +G CRETE2_FLR03A +G CRETE2_FLR03B +G CRETE2_FLR03C +G ELEV1_FLR +G ELEV2_FLR +G ELEV_FLR +G GRATE1 +G GRATE2 +G GRATE2A +G GRATE3A +G GRID1 +G GRID2 +G TNNL_FLR12 +G TNNL_FLR12A +G TNNL_FLR1A +G LAB1_STAIR2A +G FROSTFLOOR +G GRATE4A +G GRATE3B +G GRATESTEP1 +G GRATESTEP2 +G GRATESTEP3 +G GRID1 +G GRID2 +G GENERIC015V +M C1A1_FLR1 +M BABFL +M C2A3TURBINE1 +M C2A3TURBINE2 +M C2A3TURBINE3 +M C2A3TURBINE4 +M SILO2_P2 +M SILO2_P2B +M SILO2_P3 +M SILO2_P4 +M SILO2_PAN2 +M SILO2_W1 +M SILO2_W1A +M SILO2_WALL1 +M SILO2_W2 +M BABTECH_C5 +M LAB3_FLR2A +M LAB3_FLR2B +M FIFTIES_CMP3 +M LAB1_STAIR2B +M OUT_QUNST11 +M FREEZER_FLR1 +M GENERIC015N +M GENERIC015P +M GENERIC015R +M GENERIC0150 +M GENERIC015S +M GENERIC015T +M GENERIC015U +M GENERIC015V +M GENERIC015V2 +M C1A4_DOME3 +S GENERIC_114 +S WATERBLUE +S WATERGREEN +S TOXICGRN +S FLUID1A +S FLUID1B +S FLUID2 +S FLUID3 +S FLUID4 +S WATERSILO +S WATERSILO2 +S WATERF +S FLUID1A +T FIFT_BLOODFLR +T FIFT_BLOODFLRA +T FIFTIES_F01 +T FIFTIES_F02 +T FIFTIES_F03 +T FIFTIES_F03B +T FIFTIES_FLR01 +T FIFTIES_FLR02 +T FIFTIES_FLR02B +T FIFTIES_FLR02C +T FIFTIES_FLR03 +T FIFTIES_FLR03B +T FIFTIES_FLR5 +T LAB1_BLUXFLR1 +T LAB1_BLUXFLR1B +T LAB1_BLUX1 +T LAB1_BLUX1B +T LAB1_C4003 +T LAB1_C4A001 +T LAB1_C4B002 +T LAB1_C4D2 +T LAB1_CAB2 +T LAB1_FLOOR2A +T LAB1_FLOOR2B +T LAB1_FLOOR3 +T LAB1_FLOOR4 +T LAB1_FLOOR5 +T LAB1_FLOOR6 +T LAB1_FLOOR10 +T LAB1_FLR3 +T LAB1_FLR4 +T LAB1_FLR4B +T LAB1_FLR4C +T LAB1_FLR4D +T LAB1_FLR5B +T LAB1_FLR5C +T LAB1_FLR5D +T LAB1_FLR5D +T LAB1_FLR6B +T LAB1_FLR6C +T LAB1_FLR6D +T LAB1_W8FLR1 +T LAB1_W8FLR1B +T LAB1_W8FLR1C +T LAB1_W8FLR1D +T C2A4_FLR6 +T C1A2_FLR1 +T C1A2_FLR2 +T C1A0_LABFLRB +T C1A0_LABFLRC +T C1A0_LABFLRD +T C1A0_LABFLRE +T C1A0_LABFLR +W CRATE01 +W CRATE02 +W CRATE02B +W CRATE03 +W CRATE04 +W CRATE05 +W CRATE06 +W CRATE07 +W CRATE08 +W CRATE08B +W CRATE09 +W CRATE09B +W CRATE09C +W CRATE19 +W CRATE20 +W CRATE21 +W CRATE22 +W CRATE23 +W CRATE25 +W FIFTIES_DR6 +W FIFTIES_DR6A +W FIFTIES_CCH1 +W FIFTIES_CCH2 +W FIFTIES_CCH3 +W FIFTIES_CCH4 +W FIFTIES_DR1K +W FIFTIES_DR2 +W FIFTIES_DR7 +W FIFTIES_DR8 +W FIFTIES_DR9 +W FIFTIES_DSK1 +W OUT_SLAT01 +W OUT_WD +W OUT_CAC1 +W OUT_CAC2 +W OUT_CAC2 +W BCRATE02 +W BCRATE03 +W BCRATE04 +W BCRATE05 +W BCRATE06 +W BCRATE07 +W BCRATE08 +W BCRATE12 +W BCRATE14 +W BCRATE15 +W BCRATE16 +W BCRATE17 +W BCRATE18 +W BCRATE25 +W BCRATE26 +W CRATE10 +W CRATE11 +W CRATE12 +W CRATE13 +W CRATE24 +W CRATE27 +P C3A1_NRC2 +P C1A1_GAD1 +P C1A1_GAD2 +P C1A1_GAD3 +P C1A1_GAD4 +P C1A1_GAD4A +P C1A1_GGT8 +P C1A4_PAN1A +P C1A4_PAN1B +P C1A4_SWTCH1 +P C2A2_SATORB +P C2A4_CMP1 +P C2A4_GAD2 +P C3A2A_W1D +P C3A2A_W1E +P C3A2A_W2D +P C3A2A_W2E +P DRKMTL_SCRN2 +P DRKMTL_SCRN3 +P DRKMTL_SCRN4 +P DRKMTLT_WALL +P FIFTIES_GGT8 +P FIFTIES_MON1 +P FIFTIES_MON1B +P FIFTIES_MON2 +P FIFTIES_MON2B +P FIFTIES_MON3 +P FIFTIES_MON3B +P FIFTIES_MON4 +P FIFTIES_PAN2 +P GENERIC105 +P GENERIC106 +P GENERIC107 +P GENERIC114 +P GENERIC87A +P GENERIC88A +P GENERIC89A +P GENERIC113 +P LAB1_CMPM1 +P LAB1_CMPM2 +P LAB1_CMPM3 +P LAB1_CMPM4 +P LAB1_CMPM5 +P LAB1_CMPM6 +P LAB1_CMPM7 +P LAB1_CMPM8 +P LAB1_COMP1 +P LAB1_COMP2 +P LAB1_COMP3 +P LAB1_COMP2A +P LAB1_COMP10A +P LAB1_COMP10B +P LAB1_COMP10C +P LAB1_COMP10D +P LAB1_COMP10E +P LAB1_COMP7 +P LAB1_COMP8 +P LAB1_COMP9A +P LAB1_COMP9A2 +P LAB1_COMP9B +P LAB1_COMP9C +P LAB1_COMP9D +P LAB1_GAD2 +P LAB1_GAD3 +P LAB1_GAD4 +P LAB1_RADSCRN2 +P LAB4_GAD3 +P LAB4_GAD4 +P LAB4_SWTCH +P LAB_COMPM4 +P RECHARGEA +P TNNL_GAD1 +P TNNL_GAD2 +P TNNL_GAD4 +P C2A4C2C +P C2A4W1B +P LAB1_CMP +P LAB1_CMP1 +P LAB1_CMP2 +P LAB1_COMP3 +P LAB1_COMP3A +P LAB1_COMP3B +P LAB1_COMP3C +P LAB1_COMP3D +P LAB1_COMP4 +P LAB1_COMP5 +P LAB1_COMP7 +P LAB1_COMP8 +P LAB1_SW1 +P LAB_CRT1 +P LAB_CRT10A +P LAB_CRT10B +P LAB_CRT10C +P LAB_CRT10D +P LAB_CRT2 +P LAB_CRT3 +P LAB_CRT4 +P LAB_CRT5 +P LAB_CRT6 +P LAB_CRT7 +P LAB_CRT8 +P LAB_CRT9C +P CRETESTCH01A +P DRKMTLLGT1 +P FIFTS_LGHT01 +P FIFTS_LGHT3 +P FIFTS_LGHT4 +P FIFTIES_LGT2 +P FIFTS_LGHT5 +P GYMLIGHT +P LIGHT1 +P LIGHT2A +P LIGHT3A +P LIGHT3B +P LIGHT3C +P LIGHT3D +P LIGHT3E +P LIGHT3F +P LIGHT4A +P LIGHT5A +P LIGHT5B +P LIGHT5C +P LIGHT5D +P LIGHT5E +P LIGHT5F +P LIGHT6A +P METALSTCH2 +P TNNL_LGT1 +P TNNL_LGT2 +P TNNL_LGT3 +P TNNL_LGT4 +P LAB1_GAD2 +P ELEV1_DWN +P SPOTBLUE +P SPOTGREEN +P SPOTRED +P SPOTYELLOW +P LAB1_GAD3 +P LAB1_GAD3B +P ELEV2_PAN +P ELEV1_PAN +P C2A4X_C3 +P C2A4X_C1 +P MEDKIT +Y GLASS_BRIGHT +Y GLASS_DARK +Y GLASS_MED +Y GLASSBLUE1 +Y GLASSBLUE2 +Y GLASSGREEEN +Y GLASSGREEEN + + diff --git a/main/sound/misc/a-build1.wav b/main/sound/misc/a-build1.wav new file mode 100644 index 00000000..6040e8d9 Binary files /dev/null and b/main/sound/misc/a-build1.wav differ diff --git a/main/sound/misc/a-build2.wav b/main/sound/misc/a-build2.wav new file mode 100644 index 00000000..b13fd08a Binary files /dev/null and b/main/sound/misc/a-build2.wav differ diff --git a/main/sound/misc/a-levelup.wav b/main/sound/misc/a-levelup.wav new file mode 100644 index 00000000..6430706a Binary files /dev/null and b/main/sound/misc/a-levelup.wav differ diff --git a/main/sound/misc/a_resource_idle1.wav b/main/sound/misc/a_resource_idle1.wav new file mode 100644 index 00000000..6503dc6d Binary files /dev/null and b/main/sound/misc/a_resource_idle1.wav differ diff --git a/main/sound/misc/a_resource_idle2.wav b/main/sound/misc/a_resource_idle2.wav new file mode 100644 index 00000000..516f5255 Binary files /dev/null and b/main/sound/misc/a_resource_idle2.wav differ diff --git a/main/sound/misc/alien_chamber_deploy.wav b/main/sound/misc/alien_chamber_deploy.wav new file mode 100644 index 00000000..dbe92494 Binary files /dev/null and b/main/sound/misc/alien_chamber_deploy.wav differ diff --git a/main/sound/misc/alien_chamber_die.wav b/main/sound/misc/alien_chamber_die.wav new file mode 100644 index 00000000..2126be53 Binary files /dev/null and b/main/sound/misc/alien_chamber_die.wav differ diff --git a/main/sound/misc/aliensightoff.wav b/main/sound/misc/aliensightoff.wav new file mode 100644 index 00000000..9a8c60cd Binary files /dev/null and b/main/sound/misc/aliensightoff.wav differ diff --git a/main/sound/misc/aliensighton.wav b/main/sound/misc/aliensighton.wav new file mode 100644 index 00000000..535fac9a Binary files /dev/null and b/main/sound/misc/aliensighton.wav differ diff --git a/main/sound/misc/b_marine_deploy.wav b/main/sound/misc/b_marine_deploy.wav new file mode 100644 index 00000000..891768ef Binary files /dev/null and b/main/sound/misc/b_marine_deploy.wav differ diff --git a/main/sound/misc/b_marine_killed.wav b/main/sound/misc/b_marine_killed.wav new file mode 100644 index 00000000..99cbc8a4 Binary files /dev/null and b/main/sound/misc/b_marine_killed.wav differ diff --git a/main/sound/misc/b_recycle.wav b/main/sound/misc/b_recycle.wav new file mode 100644 index 00000000..47a85972 Binary files /dev/null and b/main/sound/misc/b_recycle.wav differ diff --git a/main/sound/misc/build1.wav b/main/sound/misc/build1.wav new file mode 100644 index 00000000..e986d5f6 Binary files /dev/null and b/main/sound/misc/build1.wav differ diff --git a/main/sound/misc/build2.wav b/main/sound/misc/build2.wav new file mode 100644 index 00000000..a759d3f9 Binary files /dev/null and b/main/sound/misc/build2.wav differ diff --git a/main/sound/misc/build3.wav b/main/sound/misc/build3.wav new file mode 100644 index 00000000..17b2ac06 Binary files /dev/null and b/main/sound/misc/build3.wav differ diff --git a/main/sound/misc/build4.wav b/main/sound/misc/build4.wav new file mode 100644 index 00000000..8f33cec8 Binary files /dev/null and b/main/sound/misc/build4.wav differ diff --git a/main/sound/misc/build5.wav b/main/sound/misc/build5.wav new file mode 100644 index 00000000..86796ec8 Binary files /dev/null and b/main/sound/misc/build5.wav differ diff --git a/main/sound/misc/commstat-die.wav b/main/sound/misc/commstat-die.wav new file mode 100644 index 00000000..54f0812c Binary files /dev/null and b/main/sound/misc/commstat-die.wav differ diff --git a/main/sound/misc/commstat-end.wav b/main/sound/misc/commstat-end.wav new file mode 100644 index 00000000..f8e62fe9 Binary files /dev/null and b/main/sound/misc/commstat-end.wav differ diff --git a/main/sound/misc/commstat-start.wav b/main/sound/misc/commstat-start.wav new file mode 100644 index 00000000..b58c752b Binary files /dev/null and b/main/sound/misc/commstat-start.wav differ diff --git a/main/sound/misc/connect.wav b/main/sound/misc/connect.wav new file mode 100644 index 00000000..444c0d49 Binary files /dev/null and b/main/sound/misc/connect.wav differ diff --git a/main/sound/misc/distressbeacon.wav b/main/sound/misc/distressbeacon.wav new file mode 100644 index 00000000..21fb0683 Binary files /dev/null and b/main/sound/misc/distressbeacon.wav differ diff --git a/main/sound/misc/egg_die.wav b/main/sound/misc/egg_die.wav new file mode 100644 index 00000000..fa6b7a3b Binary files /dev/null and b/main/sound/misc/egg_die.wav differ diff --git a/main/sound/misc/egg_idle.wav b/main/sound/misc/egg_idle.wav new file mode 100644 index 00000000..d8104cb9 Binary files /dev/null and b/main/sound/misc/egg_idle.wav differ diff --git a/main/sound/misc/elecspark1.wav b/main/sound/misc/elecspark1.wav new file mode 100644 index 00000000..bfc3c9ac Binary files /dev/null and b/main/sound/misc/elecspark1.wav differ diff --git a/main/sound/misc/elecspark2.wav b/main/sound/misc/elecspark2.wav new file mode 100644 index 00000000..2fe96eba Binary files /dev/null and b/main/sound/misc/elecspark2.wav differ diff --git a/main/sound/misc/elecspark3.wav b/main/sound/misc/elecspark3.wav new file mode 100644 index 00000000..b107fcce Binary files /dev/null and b/main/sound/misc/elecspark3.wav differ diff --git a/main/sound/misc/endcloak.wav b/main/sound/misc/endcloak.wav new file mode 100644 index 00000000..13cbd554 Binary files /dev/null and b/main/sound/misc/endcloak.wav differ diff --git a/main/sound/misc/energy.wav b/main/sound/misc/energy.wav new file mode 100644 index 00000000..0752bbba Binary files /dev/null and b/main/sound/misc/energy.wav differ diff --git a/main/sound/misc/gestate.wav b/main/sound/misc/gestate.wav new file mode 100644 index 00000000..c496541a Binary files /dev/null and b/main/sound/misc/gestate.wav differ diff --git a/main/sound/misc/hit.wav b/main/sound/misc/hit.wav new file mode 100644 index 00000000..13ec1029 Binary files /dev/null and b/main/sound/misc/hit.wav differ diff --git a/main/sound/misc/hive_ambient.wav b/main/sound/misc/hive_ambient.wav new file mode 100644 index 00000000..a6642149 Binary files /dev/null and b/main/sound/misc/hive_ambient.wav differ diff --git a/main/sound/misc/hive_death.wav b/main/sound/misc/hive_death.wav new file mode 100644 index 00000000..8655e417 Binary files /dev/null and b/main/sound/misc/hive_death.wav differ diff --git a/main/sound/misc/hive_spawn.wav b/main/sound/misc/hive_spawn.wav new file mode 100644 index 00000000..9fa84784 Binary files /dev/null and b/main/sound/misc/hive_spawn.wav differ diff --git a/main/sound/misc/hive_wound1.wav b/main/sound/misc/hive_wound1.wav new file mode 100644 index 00000000..5c04b315 Binary files /dev/null and b/main/sound/misc/hive_wound1.wav differ diff --git a/main/sound/misc/hive_wound2.wav b/main/sound/misc/hive_wound2.wav new file mode 100644 index 00000000..a36bb01e Binary files /dev/null and b/main/sound/misc/hive_wound2.wav differ diff --git a/main/sound/misc/hive_wound3.wav b/main/sound/misc/hive_wound3.wav new file mode 100644 index 00000000..4d5fa198 Binary files /dev/null and b/main/sound/misc/hive_wound3.wav differ diff --git a/main/sound/misc/hive_wound4.wav b/main/sound/misc/hive_wound4.wav new file mode 100644 index 00000000..647f900a Binary files /dev/null and b/main/sound/misc/hive_wound4.wav differ diff --git a/main/sound/misc/hive_wound5.wav b/main/sound/misc/hive_wound5.wav new file mode 100644 index 00000000..51f7555f Binary files /dev/null and b/main/sound/misc/hive_wound5.wav differ diff --git a/main/sound/misc/invalid.wav b/main/sound/misc/invalid.wav new file mode 100644 index 00000000..01eaffee Binary files /dev/null and b/main/sound/misc/invalid.wav differ diff --git a/main/sound/misc/jetpack.wav b/main/sound/misc/jetpack.wav new file mode 100644 index 00000000..817b8ef1 Binary files /dev/null and b/main/sound/misc/jetpack.wav differ diff --git a/main/sound/misc/levelup.wav b/main/sound/misc/levelup.wav new file mode 100644 index 00000000..102ccbeb Binary files /dev/null and b/main/sound/misc/levelup.wav differ diff --git a/main/sound/misc/phasegate.wav b/main/sound/misc/phasegate.wav new file mode 100644 index 00000000..31626b29 Binary files /dev/null and b/main/sound/misc/phasegate.wav differ diff --git a/main/sound/misc/phasein.wav b/main/sound/misc/phasein.wav new file mode 100644 index 00000000..780adadb Binary files /dev/null and b/main/sound/misc/phasein.wav differ diff --git a/main/sound/misc/regeneration.wav b/main/sound/misc/regeneration.wav new file mode 100644 index 00000000..b54af13c Binary files /dev/null and b/main/sound/misc/regeneration.wav differ diff --git a/main/sound/misc/res_deploy.wav b/main/sound/misc/res_deploy.wav new file mode 100644 index 00000000..92bd63d9 Binary files /dev/null and b/main/sound/misc/res_deploy.wav differ diff --git a/main/sound/misc/resource_idle1.wav b/main/sound/misc/resource_idle1.wav new file mode 100644 index 00000000..87245947 Binary files /dev/null and b/main/sound/misc/resource_idle1.wav differ diff --git a/main/sound/misc/resource_idle2.wav b/main/sound/misc/resource_idle2.wav new file mode 100644 index 00000000..60a85d9a Binary files /dev/null and b/main/sound/misc/resource_idle2.wav differ diff --git a/main/sound/misc/resource_idle3.wav b/main/sound/misc/resource_idle3.wav new file mode 100644 index 00000000..c7e32b43 Binary files /dev/null and b/main/sound/misc/resource_idle3.wav differ diff --git a/main/sound/misc/resupply.wav b/main/sound/misc/resupply.wav new file mode 100644 index 00000000..e91ea38c Binary files /dev/null and b/main/sound/misc/resupply.wav differ diff --git a/main/sound/misc/scan.wav b/main/sound/misc/scan.wav new file mode 100644 index 00000000..4892a0d8 Binary files /dev/null and b/main/sound/misc/scan.wav differ diff --git a/main/sound/misc/startcloak.wav b/main/sound/misc/startcloak.wav new file mode 100644 index 00000000..b102ca45 Binary files /dev/null and b/main/sound/misc/startcloak.wav differ diff --git a/main/sound/misc/talk.wav b/main/sound/misc/talk.wav new file mode 100644 index 00000000..2eb68620 Binary files /dev/null and b/main/sound/misc/talk.wav differ diff --git a/main/sound/misc/transport.wav b/main/sound/misc/transport.wav new file mode 100644 index 00000000..a894f2ed Binary files /dev/null and b/main/sound/misc/transport.wav differ diff --git a/main/sound/misc/transport2.wav b/main/sound/misc/transport2.wav new file mode 100644 index 00000000..e72e5c0e Binary files /dev/null and b/main/sound/misc/transport2.wav differ diff --git a/main/sound/misc/web_break.wav b/main/sound/misc/web_break.wav new file mode 100644 index 00000000..7c5d2938 Binary files /dev/null and b/main/sound/misc/web_break.wav differ diff --git a/main/sound/ns_agora/comploop.wav b/main/sound/ns_agora/comploop.wav new file mode 100644 index 00000000..7b106b90 Binary files /dev/null and b/main/sound/ns_agora/comploop.wav differ diff --git a/main/sound/ns_agora/drips.wav b/main/sound/ns_agora/drips.wav new file mode 100644 index 00000000..f7e12c95 Binary files /dev/null and b/main/sound/ns_agora/drips.wav differ diff --git a/main/sound/ns_agora/fan2.wav b/main/sound/ns_agora/fan2.wav new file mode 100644 index 00000000..77cf6f3e Binary files /dev/null and b/main/sound/ns_agora/fan2.wav differ diff --git a/main/sound/ns_agora/man_breather.wav b/main/sound/ns_agora/man_breather.wav new file mode 100644 index 00000000..9a963070 Binary files /dev/null and b/main/sound/ns_agora/man_breather.wav differ diff --git a/main/sound/ns_agora/man_computalk2.wav b/main/sound/ns_agora/man_computalk2.wav new file mode 100644 index 00000000..92d96823 Binary files /dev/null and b/main/sound/ns_agora/man_computalk2.wav differ diff --git a/main/sound/ns_agora/processing.wav b/main/sound/ns_agora/processing.wav new file mode 100644 index 00000000..fb79cdfe Binary files /dev/null and b/main/sound/ns_agora/processing.wav differ diff --git a/main/sound/ns_agora/pumper.wav b/main/sound/ns_agora/pumper.wav new file mode 100644 index 00000000..98050b03 Binary files /dev/null and b/main/sound/ns_agora/pumper.wav differ diff --git a/main/sound/ns_agora/railclack1.wav b/main/sound/ns_agora/railclack1.wav new file mode 100644 index 00000000..a6b221c9 Binary files /dev/null and b/main/sound/ns_agora/railclack1.wav differ diff --git a/main/sound/ns_agora/railclack3.wav b/main/sound/ns_agora/railclack3.wav new file mode 100644 index 00000000..57d65ea8 Binary files /dev/null and b/main/sound/ns_agora/railclack3.wav differ diff --git a/main/sound/ns_ayumi/ayumi_rr.mp3 b/main/sound/ns_ayumi/ayumi_rr.mp3 new file mode 100644 index 00000000..917ff846 Binary files /dev/null and b/main/sound/ns_ayumi/ayumi_rr.mp3 differ diff --git a/main/sound/ns_bast/bast-rr.wav b/main/sound/ns_bast/bast-rr.wav new file mode 100644 index 00000000..645e532e Binary files /dev/null and b/main/sound/ns_bast/bast-rr.wav differ diff --git a/main/sound/ns_caged/drips.wav b/main/sound/ns_caged/drips.wav new file mode 100644 index 00000000..f7e12c95 Binary files /dev/null and b/main/sound/ns_caged/drips.wav differ diff --git a/main/sound/ns_caged/man_breather.wav b/main/sound/ns_caged/man_breather.wav new file mode 100644 index 00000000..9a963070 Binary files /dev/null and b/main/sound/ns_caged/man_breather.wav differ diff --git a/main/sound/ns_caged/man_computalk2.wav b/main/sound/ns_caged/man_computalk2.wav new file mode 100644 index 00000000..92d96823 Binary files /dev/null and b/main/sound/ns_caged/man_computalk2.wav differ diff --git a/main/sound/ns_caged/man_labdrone1.wav b/main/sound/ns_caged/man_labdrone1.wav new file mode 100644 index 00000000..7ec2685d Binary files /dev/null and b/main/sound/ns_caged/man_labdrone1.wav differ diff --git a/main/sound/ns_lost/alienhive.mp3 b/main/sound/ns_lost/alienhive.mp3 new file mode 100644 index 00000000..69653213 Binary files /dev/null and b/main/sound/ns_lost/alienhive.mp3 differ diff --git a/main/sound/ns_nancy/nancy-rr.wav b/main/sound/ns_nancy/nancy-rr.wav new file mode 100644 index 00000000..645e532e Binary files /dev/null and b/main/sound/ns_nancy/nancy-rr.wav differ diff --git a/main/sound/ns_origin/fan2.wav b/main/sound/ns_origin/fan2.wav new file mode 100644 index 00000000..77cf6f3e Binary files /dev/null and b/main/sound/ns_origin/fan2.wav differ diff --git a/main/sound/ns_origin/fan4.wav b/main/sound/ns_origin/fan4.wav new file mode 100644 index 00000000..2e298e7e Binary files /dev/null and b/main/sound/ns_origin/fan4.wav differ diff --git a/main/sound/ns_origin/hotspark.wav b/main/sound/ns_origin/hotspark.wav new file mode 100644 index 00000000..4fdedd11 Binary files /dev/null and b/main/sound/ns_origin/hotspark.wav differ diff --git a/main/sound/ns_origin/hvyvibrate.wav b/main/sound/ns_origin/hvyvibrate.wav new file mode 100644 index 00000000..725c74bb Binary files /dev/null and b/main/sound/ns_origin/hvyvibrate.wav differ diff --git a/main/sound/ns_origin/pings.wav b/main/sound/ns_origin/pings.wav new file mode 100644 index 00000000..a4f27568 Binary files /dev/null and b/main/sound/ns_origin/pings.wav differ diff --git a/main/sound/ns_origin/pumper.wav b/main/sound/ns_origin/pumper.wav new file mode 100644 index 00000000..98050b03 Binary files /dev/null and b/main/sound/ns_origin/pumper.wav differ diff --git a/main/sound/ns_origin/rain.wav b/main/sound/ns_origin/rain.wav new file mode 100644 index 00000000..52409500 Binary files /dev/null and b/main/sound/ns_origin/rain.wav differ diff --git a/main/sound/plats/bigstop2.wav b/main/sound/plats/bigstop2.wav new file mode 100644 index 00000000..1cfe5b38 Binary files /dev/null and b/main/sound/plats/bigstop2.wav differ diff --git a/main/sound/plats/rackmove1.wav b/main/sound/plats/rackmove1.wav new file mode 100644 index 00000000..5bc814a5 Binary files /dev/null and b/main/sound/plats/rackmove1.wav differ diff --git a/main/sound/player/digesting.wav b/main/sound/player/digesting.wav new file mode 100644 index 00000000..4e32f4f6 Binary files /dev/null and b/main/sound/player/digesting.wav differ diff --git a/main/sound/player/jointeam.wav b/main/sound/player/jointeam.wav new file mode 100644 index 00000000..73091bf4 Binary files /dev/null and b/main/sound/player/jointeam.wav differ diff --git a/main/sound/player/pl_fallpain3-1.wav b/main/sound/player/pl_fallpain3-1.wav new file mode 100644 index 00000000..b7d664b4 Binary files /dev/null and b/main/sound/player/pl_fallpain3-1.wav differ diff --git a/main/sound/player/pl_fallpain3-2.wav b/main/sound/player/pl_fallpain3-2.wav new file mode 100644 index 00000000..7d6c8fc4 Binary files /dev/null and b/main/sound/player/pl_fallpain3-2.wav differ diff --git a/main/sound/player/pl_fallpain3-3.wav b/main/sound/player/pl_fallpain3-3.wav new file mode 100644 index 00000000..d6dce381 Binary files /dev/null and b/main/sound/player/pl_fallpain3-3.wav differ diff --git a/main/sound/player/pl_fallpain3-4.wav b/main/sound/player/pl_fallpain3-4.wav new file mode 100644 index 00000000..9a4e0767 Binary files /dev/null and b/main/sound/player/pl_fallpain3-4.wav differ diff --git a/main/sound/player/pl_fallpain3-5.wav b/main/sound/player/pl_fallpain3-5.wav new file mode 100644 index 00000000..3bfbc47f Binary files /dev/null and b/main/sound/player/pl_fallpain3-5.wav differ diff --git a/main/sound/player/pl_fallpain3-6.wav b/main/sound/player/pl_fallpain3-6.wav new file mode 100644 index 00000000..1c6c7b8c Binary files /dev/null and b/main/sound/player/pl_fallpain3-6.wav differ diff --git a/main/sound/player/pl_fallpain3-7.wav b/main/sound/player/pl_fallpain3-7.wav new file mode 100644 index 00000000..80928784 Binary files /dev/null and b/main/sound/player/pl_fallpain3-7.wav differ diff --git a/main/sound/player/pl_fallpain3-8.wav b/main/sound/player/pl_fallpain3-8.wav new file mode 100644 index 00000000..5f95bc5f Binary files /dev/null and b/main/sound/player/pl_fallpain3-8.wav differ diff --git a/main/sound/player/pl_fallpain3-a.wav b/main/sound/player/pl_fallpain3-a.wav new file mode 100644 index 00000000..6f0fc022 Binary files /dev/null and b/main/sound/player/pl_fallpain3-a.wav differ diff --git a/main/sound/player/pl_fallpain3.wav b/main/sound/player/pl_fallpain3.wav new file mode 100644 index 00000000..b7d664b4 Binary files /dev/null and b/main/sound/player/pl_fallpain3.wav differ diff --git a/main/sound/player/pl_ladder1.wav b/main/sound/player/pl_ladder1.wav new file mode 100644 index 00000000..a6c6b1d9 Binary files /dev/null and b/main/sound/player/pl_ladder1.wav differ diff --git a/main/sound/player/pl_ladder2.wav b/main/sound/player/pl_ladder2.wav new file mode 100644 index 00000000..377ea5d6 Binary files /dev/null and b/main/sound/player/pl_ladder2.wav differ diff --git a/main/sound/player/pl_ladder3.wav b/main/sound/player/pl_ladder3.wav new file mode 100644 index 00000000..d1c5103a Binary files /dev/null and b/main/sound/player/pl_ladder3.wav differ diff --git a/main/sound/player/pl_ladder4.wav b/main/sound/player/pl_ladder4.wav new file mode 100644 index 00000000..10be48b7 Binary files /dev/null and b/main/sound/player/pl_ladder4.wav differ diff --git a/main/sound/player/pl_metal1.wav b/main/sound/player/pl_metal1.wav new file mode 100644 index 00000000..55a6521a Binary files /dev/null and b/main/sound/player/pl_metal1.wav differ diff --git a/main/sound/player/pl_metal2.wav b/main/sound/player/pl_metal2.wav new file mode 100644 index 00000000..ec4875fa Binary files /dev/null and b/main/sound/player/pl_metal2.wav differ diff --git a/main/sound/player/pl_metal3.wav b/main/sound/player/pl_metal3.wav new file mode 100644 index 00000000..c24a43ac Binary files /dev/null and b/main/sound/player/pl_metal3.wav differ diff --git a/main/sound/player/pl_metal4.wav b/main/sound/player/pl_metal4.wav new file mode 100644 index 00000000..cbf8cae0 Binary files /dev/null and b/main/sound/player/pl_metal4.wav differ diff --git a/main/sound/player/pl_step1-a.wav b/main/sound/player/pl_step1-a.wav new file mode 100644 index 00000000..1eb0138f Binary files /dev/null and b/main/sound/player/pl_step1-a.wav differ diff --git a/main/sound/player/pl_step1-a1.wav b/main/sound/player/pl_step1-a1.wav new file mode 100644 index 00000000..ce8a42b8 Binary files /dev/null and b/main/sound/player/pl_step1-a1.wav differ diff --git a/main/sound/player/pl_step1-a5.wav b/main/sound/player/pl_step1-a5.wav new file mode 100644 index 00000000..77e162b5 Binary files /dev/null and b/main/sound/player/pl_step1-a5.wav differ diff --git a/main/sound/player/pl_step1-h.wav b/main/sound/player/pl_step1-h.wav new file mode 100644 index 00000000..dcc07f74 Binary files /dev/null and b/main/sound/player/pl_step1-h.wav differ diff --git a/main/sound/player/pl_step1.wav b/main/sound/player/pl_step1.wav new file mode 100644 index 00000000..d818e17d Binary files /dev/null and b/main/sound/player/pl_step1.wav differ diff --git a/main/sound/player/pl_step2-a.wav b/main/sound/player/pl_step2-a.wav new file mode 100644 index 00000000..a5787d68 Binary files /dev/null and b/main/sound/player/pl_step2-a.wav differ diff --git a/main/sound/player/pl_step2-a1.wav b/main/sound/player/pl_step2-a1.wav new file mode 100644 index 00000000..fd862cd4 Binary files /dev/null and b/main/sound/player/pl_step2-a1.wav differ diff --git a/main/sound/player/pl_step2-a5.wav b/main/sound/player/pl_step2-a5.wav new file mode 100644 index 00000000..6fe7a936 Binary files /dev/null and b/main/sound/player/pl_step2-a5.wav differ diff --git a/main/sound/player/pl_step2-h.wav b/main/sound/player/pl_step2-h.wav new file mode 100644 index 00000000..5dba1fa7 Binary files /dev/null and b/main/sound/player/pl_step2-h.wav differ diff --git a/main/sound/player/pl_step2.wav b/main/sound/player/pl_step2.wav new file mode 100644 index 00000000..fee82b3b Binary files /dev/null and b/main/sound/player/pl_step2.wav differ diff --git a/main/sound/player/pl_step3-a.wav b/main/sound/player/pl_step3-a.wav new file mode 100644 index 00000000..d5379ce8 Binary files /dev/null and b/main/sound/player/pl_step3-a.wav differ diff --git a/main/sound/player/pl_step3-a1.wav b/main/sound/player/pl_step3-a1.wav new file mode 100644 index 00000000..0a6ff907 Binary files /dev/null and b/main/sound/player/pl_step3-a1.wav differ diff --git a/main/sound/player/pl_step3-a5.wav b/main/sound/player/pl_step3-a5.wav new file mode 100644 index 00000000..b31ba794 Binary files /dev/null and b/main/sound/player/pl_step3-a5.wav differ diff --git a/main/sound/player/pl_step3-h.wav b/main/sound/player/pl_step3-h.wav new file mode 100644 index 00000000..5b1a46e5 Binary files /dev/null and b/main/sound/player/pl_step3-h.wav differ diff --git a/main/sound/player/pl_step3.wav b/main/sound/player/pl_step3.wav new file mode 100644 index 00000000..dd843b8b Binary files /dev/null and b/main/sound/player/pl_step3.wav differ diff --git a/main/sound/player/pl_step4-a.wav b/main/sound/player/pl_step4-a.wav new file mode 100644 index 00000000..ff69af7c Binary files /dev/null and b/main/sound/player/pl_step4-a.wav differ diff --git a/main/sound/player/pl_step4-a1.wav b/main/sound/player/pl_step4-a1.wav new file mode 100644 index 00000000..8b35710d Binary files /dev/null and b/main/sound/player/pl_step4-a1.wav differ diff --git a/main/sound/player/pl_step4-a5.wav b/main/sound/player/pl_step4-a5.wav new file mode 100644 index 00000000..1d4238c4 Binary files /dev/null and b/main/sound/player/pl_step4-a5.wav differ diff --git a/main/sound/player/pl_step4-h.wav b/main/sound/player/pl_step4-h.wav new file mode 100644 index 00000000..32a4f1c1 Binary files /dev/null and b/main/sound/player/pl_step4-h.wav differ diff --git a/main/sound/player/pl_step4.wav b/main/sound/player/pl_step4.wav new file mode 100644 index 00000000..fa82c443 Binary files /dev/null and b/main/sound/player/pl_step4.wav differ diff --git a/main/sound/player/primalscreaming.wav b/main/sound/player/primalscreaming.wav new file mode 100644 index 00000000..338c0a2e Binary files /dev/null and b/main/sound/player/primalscreaming.wav differ diff --git a/main/sound/player/role1_die1.wav b/main/sound/player/role1_die1.wav new file mode 100644 index 00000000..55497d00 Binary files /dev/null and b/main/sound/player/role1_die1.wav differ diff --git a/main/sound/player/role1_die2.wav b/main/sound/player/role1_die2.wav new file mode 100644 index 00000000..30647ac7 Binary files /dev/null and b/main/sound/player/role1_die2.wav differ diff --git a/main/sound/player/role1_wound1.wav b/main/sound/player/role1_wound1.wav new file mode 100644 index 00000000..164a93f4 Binary files /dev/null and b/main/sound/player/role1_wound1.wav differ diff --git a/main/sound/player/role1_wound2.wav b/main/sound/player/role1_wound2.wav new file mode 100644 index 00000000..1f73c2bf Binary files /dev/null and b/main/sound/player/role1_wound2.wav differ diff --git a/main/sound/player/role1_wound3.wav b/main/sound/player/role1_wound3.wav new file mode 100644 index 00000000..c542eab5 Binary files /dev/null and b/main/sound/player/role1_wound3.wav differ diff --git a/main/sound/player/role3_die1.wav b/main/sound/player/role3_die1.wav new file mode 100644 index 00000000..6075fd28 Binary files /dev/null and b/main/sound/player/role3_die1.wav differ diff --git a/main/sound/player/role3_idle1.wav b/main/sound/player/role3_idle1.wav new file mode 100644 index 00000000..810d6290 Binary files /dev/null and b/main/sound/player/role3_idle1.wav differ diff --git a/main/sound/player/role3_move1.wav b/main/sound/player/role3_move1.wav new file mode 100644 index 00000000..cc14ea8c Binary files /dev/null and b/main/sound/player/role3_move1.wav differ diff --git a/main/sound/player/role3_pain1.wav b/main/sound/player/role3_pain1.wav new file mode 100644 index 00000000..a520fb98 Binary files /dev/null and b/main/sound/player/role3_pain1.wav differ diff --git a/main/sound/player/role3_spawn1.wav b/main/sound/player/role3_spawn1.wav new file mode 100644 index 00000000..a4ef1942 Binary files /dev/null and b/main/sound/player/role3_spawn1.wav differ diff --git a/main/sound/player/role3_spawn2.wav b/main/sound/player/role3_spawn2.wav new file mode 100644 index 00000000..ae1e0686 Binary files /dev/null and b/main/sound/player/role3_spawn2.wav differ diff --git a/main/sound/player/role3_wound1.wav b/main/sound/player/role3_wound1.wav new file mode 100644 index 00000000..2d96497c Binary files /dev/null and b/main/sound/player/role3_wound1.wav differ diff --git a/main/sound/player/role4_die1.wav b/main/sound/player/role4_die1.wav new file mode 100644 index 00000000..17416be9 Binary files /dev/null and b/main/sound/player/role4_die1.wav differ diff --git a/main/sound/player/role4_idle1.wav b/main/sound/player/role4_idle1.wav new file mode 100644 index 00000000..a0085aad Binary files /dev/null and b/main/sound/player/role4_idle1.wav differ diff --git a/main/sound/player/role4_move1.wav b/main/sound/player/role4_move1.wav new file mode 100644 index 00000000..1c5e7867 Binary files /dev/null and b/main/sound/player/role4_move1.wav differ diff --git a/main/sound/player/role4_pain1.wav b/main/sound/player/role4_pain1.wav new file mode 100644 index 00000000..24cd7a9b Binary files /dev/null and b/main/sound/player/role4_pain1.wav differ diff --git a/main/sound/player/role4_spawn1.wav b/main/sound/player/role4_spawn1.wav new file mode 100644 index 00000000..115d4a81 Binary files /dev/null and b/main/sound/player/role4_spawn1.wav differ diff --git a/main/sound/player/role4_wound1.wav b/main/sound/player/role4_wound1.wav new file mode 100644 index 00000000..5586dee6 Binary files /dev/null and b/main/sound/player/role4_wound1.wav differ diff --git a/main/sound/player/role4_wound2.wav b/main/sound/player/role4_wound2.wav new file mode 100644 index 00000000..d6e1ffa1 Binary files /dev/null and b/main/sound/player/role4_wound2.wav differ diff --git a/main/sound/player/role5_die1.wav b/main/sound/player/role5_die1.wav new file mode 100644 index 00000000..25e74269 Binary files /dev/null and b/main/sound/player/role5_die1.wav differ diff --git a/main/sound/player/role5_idle1.wav b/main/sound/player/role5_idle1.wav new file mode 100644 index 00000000..c65ebec9 Binary files /dev/null and b/main/sound/player/role5_idle1.wav differ diff --git a/main/sound/player/role5_idle2.wav b/main/sound/player/role5_idle2.wav new file mode 100644 index 00000000..c85fb42b Binary files /dev/null and b/main/sound/player/role5_idle2.wav differ diff --git a/main/sound/player/role5_move1.wav b/main/sound/player/role5_move1.wav new file mode 100644 index 00000000..c4254854 Binary files /dev/null and b/main/sound/player/role5_move1.wav differ diff --git a/main/sound/player/role5_move2.wav b/main/sound/player/role5_move2.wav new file mode 100644 index 00000000..1ff6c97f Binary files /dev/null and b/main/sound/player/role5_move2.wav differ diff --git a/main/sound/player/role5_pain1.wav b/main/sound/player/role5_pain1.wav new file mode 100644 index 00000000..84bf8380 Binary files /dev/null and b/main/sound/player/role5_pain1.wav differ diff --git a/main/sound/player/role5_pain2.wav b/main/sound/player/role5_pain2.wav new file mode 100644 index 00000000..296d2574 Binary files /dev/null and b/main/sound/player/role5_pain2.wav differ diff --git a/main/sound/player/role5_spawn1.wav b/main/sound/player/role5_spawn1.wav new file mode 100644 index 00000000..778307bb Binary files /dev/null and b/main/sound/player/role5_spawn1.wav differ diff --git a/main/sound/player/role5_wound1.wav b/main/sound/player/role5_wound1.wav new file mode 100644 index 00000000..1a23f138 Binary files /dev/null and b/main/sound/player/role5_wound1.wav differ diff --git a/main/sound/player/role6_die1.wav b/main/sound/player/role6_die1.wav new file mode 100644 index 00000000..dde9b07b Binary files /dev/null and b/main/sound/player/role6_die1.wav differ diff --git a/main/sound/player/role6_idle1.wav b/main/sound/player/role6_idle1.wav new file mode 100644 index 00000000..848d7b2b Binary files /dev/null and b/main/sound/player/role6_idle1.wav differ diff --git a/main/sound/player/role6_move1.wav b/main/sound/player/role6_move1.wav new file mode 100644 index 00000000..db29437d Binary files /dev/null and b/main/sound/player/role6_move1.wav differ diff --git a/main/sound/player/role6_move2.wav b/main/sound/player/role6_move2.wav new file mode 100644 index 00000000..b4c37ea8 Binary files /dev/null and b/main/sound/player/role6_move2.wav differ diff --git a/main/sound/player/role6_pain1.wav b/main/sound/player/role6_pain1.wav new file mode 100644 index 00000000..c48c4302 Binary files /dev/null and b/main/sound/player/role6_pain1.wav differ diff --git a/main/sound/player/role6_spawn1.wav b/main/sound/player/role6_spawn1.wav new file mode 100644 index 00000000..ba3f9344 Binary files /dev/null and b/main/sound/player/role6_spawn1.wav differ diff --git a/main/sound/player/role6_wound1.wav b/main/sound/player/role6_wound1.wav new file mode 100644 index 00000000..60a278f9 Binary files /dev/null and b/main/sound/player/role6_wound1.wav differ diff --git a/main/sound/player/role7_die1.wav b/main/sound/player/role7_die1.wav new file mode 100644 index 00000000..9dd45724 Binary files /dev/null and b/main/sound/player/role7_die1.wav differ diff --git a/main/sound/player/role7_die2.wav b/main/sound/player/role7_die2.wav new file mode 100644 index 00000000..0252e526 Binary files /dev/null and b/main/sound/player/role7_die2.wav differ diff --git a/main/sound/player/role7_idle1.wav b/main/sound/player/role7_idle1.wav new file mode 100644 index 00000000..9908dd9a Binary files /dev/null and b/main/sound/player/role7_idle1.wav differ diff --git a/main/sound/player/role7_move1.wav b/main/sound/player/role7_move1.wav new file mode 100644 index 00000000..ab412075 Binary files /dev/null and b/main/sound/player/role7_move1.wav differ diff --git a/main/sound/player/role7_move2.wav b/main/sound/player/role7_move2.wav new file mode 100644 index 00000000..59cb4cda Binary files /dev/null and b/main/sound/player/role7_move2.wav differ diff --git a/main/sound/player/role7_pain1.wav b/main/sound/player/role7_pain1.wav new file mode 100644 index 00000000..da602dd2 Binary files /dev/null and b/main/sound/player/role7_pain1.wav differ diff --git a/main/sound/player/role7_spawn1.wav b/main/sound/player/role7_spawn1.wav new file mode 100644 index 00000000..429961cf Binary files /dev/null and b/main/sound/player/role7_spawn1.wav differ diff --git a/main/sound/player/role7_wound1.wav b/main/sound/player/role7_wound1.wav new file mode 100644 index 00000000..1cdd77ee Binary files /dev/null and b/main/sound/player/role7_wound1.wav differ diff --git a/main/sound/player/wingflap1.wav b/main/sound/player/wingflap1.wav new file mode 100644 index 00000000..adc16b48 Binary files /dev/null and b/main/sound/player/wingflap1.wav differ diff --git a/main/sound/player/wingflap2.wav b/main/sound/player/wingflap2.wav new file mode 100644 index 00000000..d4a257e7 Binary files /dev/null and b/main/sound/player/wingflap2.wav differ diff --git a/main/sound/player/wingflap3.wav b/main/sound/player/wingflap3.wav new file mode 100644 index 00000000..3154beb7 Binary files /dev/null and b/main/sound/player/wingflap3.wav differ diff --git a/main/sound/turret/aturret-1.wav b/main/sound/turret/aturret-1.wav new file mode 100644 index 00000000..fce5f10a Binary files /dev/null and b/main/sound/turret/aturret-1.wav differ diff --git a/main/sound/turret/siege_deploy.wav b/main/sound/turret/siege_deploy.wav new file mode 100644 index 00000000..87464de0 Binary files /dev/null and b/main/sound/turret/siege_deploy.wav differ diff --git a/main/sound/turret/siege_ping.wav b/main/sound/turret/siege_ping.wav new file mode 100644 index 00000000..92a0ed99 Binary files /dev/null and b/main/sound/turret/siege_ping.wav differ diff --git a/main/sound/turret/siegehit1.wav b/main/sound/turret/siegehit1.wav new file mode 100644 index 00000000..03702576 Binary files /dev/null and b/main/sound/turret/siegehit1.wav differ diff --git a/main/sound/turret/siegehit2.wav b/main/sound/turret/siegehit2.wav new file mode 100644 index 00000000..582881da Binary files /dev/null and b/main/sound/turret/siegehit2.wav differ diff --git a/main/sound/turret/st_fire1.wav b/main/sound/turret/st_fire1.wav new file mode 100644 index 00000000..d9a62671 Binary files /dev/null and b/main/sound/turret/st_fire1.wav differ diff --git a/main/sound/turret/tu_ping.wav b/main/sound/turret/tu_ping.wav new file mode 100644 index 00000000..52d294b4 Binary files /dev/null and b/main/sound/turret/tu_ping.wav differ diff --git a/main/sound/turret/turret-1.wav b/main/sound/turret/turret-1.wav new file mode 100644 index 00000000..d0c9db06 Binary files /dev/null and b/main/sound/turret/turret-1.wav differ diff --git a/main/sound/turret/turret-2.wav b/main/sound/turret/turret-2.wav new file mode 100644 index 00000000..4f3c0b5b Binary files /dev/null and b/main/sound/turret/turret-2.wav differ diff --git a/main/sound/turret/turret-3.wav b/main/sound/turret/turret-3.wav new file mode 100644 index 00000000..df08e847 Binary files /dev/null and b/main/sound/turret/turret-3.wav differ diff --git a/main/sound/turret/turret-4.wav b/main/sound/turret/turret-4.wav new file mode 100644 index 00000000..2cc4d728 Binary files /dev/null and b/main/sound/turret/turret-4.wav differ diff --git a/main/sound/turret/turret_deploy.wav b/main/sound/turret/turret_deploy.wav new file mode 100644 index 00000000..fca77419 Binary files /dev/null and b/main/sound/turret/turret_deploy.wav differ diff --git a/main/sound/turret/turret_ping.wav b/main/sound/turret/turret_ping.wav new file mode 100644 index 00000000..35a6a68b Binary files /dev/null and b/main/sound/turret/turret_ping.wav differ diff --git a/main/sound/ui/buttonclickrelease.wav b/main/sound/ui/buttonclickrelease.wav new file mode 100644 index 00000000..9b9b53b4 Binary files /dev/null and b/main/sound/ui/buttonclickrelease.wav differ diff --git a/main/sound/ui/buttonrollover.wav b/main/sound/ui/buttonrollover.wav new file mode 100644 index 00000000..6611d3ef Binary files /dev/null and b/main/sound/ui/buttonrollover.wav differ diff --git a/main/sound/vox/asay11.wav b/main/sound/vox/asay11.wav new file mode 100644 index 00000000..f65530da Binary files /dev/null and b/main/sound/vox/asay11.wav differ diff --git a/main/sound/vox/asay21.wav b/main/sound/vox/asay21.wav new file mode 100644 index 00000000..ab5ef7f7 Binary files /dev/null and b/main/sound/vox/asay21.wav differ diff --git a/main/sound/vox/asay31.wav b/main/sound/vox/asay31.wav new file mode 100644 index 00000000..7b61604b Binary files /dev/null and b/main/sound/vox/asay31.wav differ diff --git a/main/sound/vox/asay41.wav b/main/sound/vox/asay41.wav new file mode 100644 index 00000000..7412bedf Binary files /dev/null and b/main/sound/vox/asay41.wav differ diff --git a/main/sound/vox/asay51.wav b/main/sound/vox/asay51.wav new file mode 100644 index 00000000..2f490e6e Binary files /dev/null and b/main/sound/vox/asay51.wav differ diff --git a/main/sound/vox/asay61.wav b/main/sound/vox/asay61.wav new file mode 100644 index 00000000..551edf74 Binary files /dev/null and b/main/sound/vox/asay61.wav differ diff --git a/main/sound/vox/sack1.wav b/main/sound/vox/sack1.wav new file mode 100644 index 00000000..6eec2d98 Binary files /dev/null and b/main/sound/vox/sack1.wav differ diff --git a/main/sound/vox/sack2.wav b/main/sound/vox/sack2.wav new file mode 100644 index 00000000..ca0c84d4 Binary files /dev/null and b/main/sound/vox/sack2.wav differ diff --git a/main/sound/vox/sack3.wav b/main/sound/vox/sack3.wav new file mode 100644 index 00000000..9aca5a7a Binary files /dev/null and b/main/sound/vox/sack3.wav differ diff --git a/main/sound/vox/sack4.wav b/main/sound/vox/sack4.wav new file mode 100644 index 00000000..93bed312 Binary files /dev/null and b/main/sound/vox/sack4.wav differ diff --git a/main/sound/vox/sreq1.wav b/main/sound/vox/sreq1.wav new file mode 100644 index 00000000..a1a363cc Binary files /dev/null and b/main/sound/vox/sreq1.wav differ diff --git a/main/sound/vox/sreq2.wav b/main/sound/vox/sreq2.wav new file mode 100644 index 00000000..d7e3a9a8 Binary files /dev/null and b/main/sound/vox/sreq2.wav differ diff --git a/main/sound/vox/sreq3.wav b/main/sound/vox/sreq3.wav new file mode 100644 index 00000000..f9ce6e80 Binary files /dev/null and b/main/sound/vox/sreq3.wav differ diff --git a/main/sound/vox/sreq4.wav b/main/sound/vox/sreq4.wav new file mode 100644 index 00000000..71c80eef Binary files /dev/null and b/main/sound/vox/sreq4.wav differ diff --git a/main/sound/vox/ssay11.wav b/main/sound/vox/ssay11.wav new file mode 100644 index 00000000..e5afa037 Binary files /dev/null and b/main/sound/vox/ssay11.wav differ diff --git a/main/sound/vox/ssay12.wav b/main/sound/vox/ssay12.wav new file mode 100644 index 00000000..e19cea69 Binary files /dev/null and b/main/sound/vox/ssay12.wav differ diff --git a/main/sound/vox/ssay21.wav b/main/sound/vox/ssay21.wav new file mode 100644 index 00000000..6262619c Binary files /dev/null and b/main/sound/vox/ssay21.wav differ diff --git a/main/sound/vox/ssay22.wav b/main/sound/vox/ssay22.wav new file mode 100644 index 00000000..af252591 Binary files /dev/null and b/main/sound/vox/ssay22.wav differ diff --git a/main/sound/vox/ssay23.wav b/main/sound/vox/ssay23.wav new file mode 100644 index 00000000..0bc80532 Binary files /dev/null and b/main/sound/vox/ssay23.wav differ diff --git a/main/sound/vox/ssay31.wav b/main/sound/vox/ssay31.wav new file mode 100644 index 00000000..d53a79a1 Binary files /dev/null and b/main/sound/vox/ssay31.wav differ diff --git a/main/sound/vox/ssay32.wav b/main/sound/vox/ssay32.wav new file mode 100644 index 00000000..8f5f353b Binary files /dev/null and b/main/sound/vox/ssay32.wav differ diff --git a/main/sound/vox/ssay33.wav b/main/sound/vox/ssay33.wav new file mode 100644 index 00000000..189f28b6 Binary files /dev/null and b/main/sound/vox/ssay33.wav differ diff --git a/main/sound/vox/ssay34.wav b/main/sound/vox/ssay34.wav new file mode 100644 index 00000000..28d288e7 Binary files /dev/null and b/main/sound/vox/ssay34.wav differ diff --git a/main/sound/vox/ssay41.wav b/main/sound/vox/ssay41.wav new file mode 100644 index 00000000..4628bca9 Binary files /dev/null and b/main/sound/vox/ssay41.wav differ diff --git a/main/sound/vox/ssay42.wav b/main/sound/vox/ssay42.wav new file mode 100644 index 00000000..f6cecb23 Binary files /dev/null and b/main/sound/vox/ssay42.wav differ diff --git a/main/sound/vox/ssay51.wav b/main/sound/vox/ssay51.wav new file mode 100644 index 00000000..7a588866 Binary files /dev/null and b/main/sound/vox/ssay51.wav differ diff --git a/main/sound/vox/ssay52.wav b/main/sound/vox/ssay52.wav new file mode 100644 index 00000000..d86ccc52 Binary files /dev/null and b/main/sound/vox/ssay52.wav differ diff --git a/main/sound/vox/ssay53.wav b/main/sound/vox/ssay53.wav new file mode 100644 index 00000000..2e364b38 Binary files /dev/null and b/main/sound/vox/ssay53.wav differ diff --git a/main/sound/vox/ssay61.wav b/main/sound/vox/ssay61.wav new file mode 100644 index 00000000..6b7598f5 Binary files /dev/null and b/main/sound/vox/ssay61.wav differ diff --git a/main/sound/vox/ssay62.wav b/main/sound/vox/ssay62.wav new file mode 100644 index 00000000..a1b26ebe Binary files /dev/null and b/main/sound/vox/ssay62.wav differ diff --git a/main/sound/vox/ssay71.wav b/main/sound/vox/ssay71.wav new file mode 100644 index 00000000..12d6b5d4 Binary files /dev/null and b/main/sound/vox/ssay71.wav differ diff --git a/main/sound/vox/ssay72.wav b/main/sound/vox/ssay72.wav new file mode 100644 index 00000000..5c7d771a Binary files /dev/null and b/main/sound/vox/ssay72.wav differ diff --git a/main/sound/vox/ssay73.wav b/main/sound/vox/ssay73.wav new file mode 100644 index 00000000..eff03e26 Binary files /dev/null and b/main/sound/vox/ssay73.wav differ diff --git a/main/sound/vox/ssay81.wav b/main/sound/vox/ssay81.wav new file mode 100644 index 00000000..99035833 Binary files /dev/null and b/main/sound/vox/ssay81.wav differ diff --git a/main/sound/vox/ssay82.wav b/main/sound/vox/ssay82.wav new file mode 100644 index 00000000..05e8ce26 Binary files /dev/null and b/main/sound/vox/ssay82.wav differ diff --git a/main/sound/vox/ssay83.wav b/main/sound/vox/ssay83.wav new file mode 100644 index 00000000..d6afa88a Binary files /dev/null and b/main/sound/vox/ssay83.wav differ diff --git a/main/sound/vox/ssay91.wav b/main/sound/vox/ssay91.wav new file mode 100644 index 00000000..b9b4976b Binary files /dev/null and b/main/sound/vox/ssay91.wav differ diff --git a/main/sound/vox/ssay92.wav b/main/sound/vox/ssay92.wav new file mode 100644 index 00000000..694ea5c2 Binary files /dev/null and b/main/sound/vox/ssay92.wav differ diff --git a/main/sound/weapons/357_cock1.wav b/main/sound/weapons/357_cock1.wav new file mode 100644 index 00000000..2203dfde Binary files /dev/null and b/main/sound/weapons/357_cock1.wav differ diff --git a/main/sound/weapons/a_ric1.wav b/main/sound/weapons/a_ric1.wav new file mode 100644 index 00000000..3562e497 Binary files /dev/null and b/main/sound/weapons/a_ric1.wav differ diff --git a/main/sound/weapons/a_ric2.wav b/main/sound/weapons/a_ric2.wav new file mode 100644 index 00000000..023cbf9a Binary files /dev/null and b/main/sound/weapons/a_ric2.wav differ diff --git a/main/sound/weapons/a_ric3.wav b/main/sound/weapons/a_ric3.wav new file mode 100644 index 00000000..84bbfd68 Binary files /dev/null and b/main/sound/weapons/a_ric3.wav differ diff --git a/main/sound/weapons/acidrocketfire.wav b/main/sound/weapons/acidrocketfire.wav new file mode 100644 index 00000000..14c7d162 Binary files /dev/null and b/main/sound/weapons/acidrocketfire.wav differ diff --git a/main/sound/weapons/acidrockethit.wav b/main/sound/weapons/acidrockethit.wav new file mode 100644 index 00000000..ecc013a1 Binary files /dev/null and b/main/sound/weapons/acidrockethit.wav differ diff --git a/main/sound/weapons/alien_spray.wav b/main/sound/weapons/alien_spray.wav new file mode 100644 index 00000000..20f811a7 Binary files /dev/null and b/main/sound/weapons/alien_spray.wav differ diff --git a/main/sound/weapons/bilebombfire.wav b/main/sound/weapons/bilebombfire.wav new file mode 100644 index 00000000..880f0570 Binary files /dev/null and b/main/sound/weapons/bilebombfire.wav differ diff --git a/main/sound/weapons/bilebombhit.wav b/main/sound/weapons/bilebombhit.wav new file mode 100644 index 00000000..7d10dfae Binary files /dev/null and b/main/sound/weapons/bilebombhit.wav differ diff --git a/main/sound/weapons/bite.wav b/main/sound/weapons/bite.wav new file mode 100644 index 00000000..25127f31 Binary files /dev/null and b/main/sound/weapons/bite.wav differ diff --git a/main/sound/weapons/bite2.wav b/main/sound/weapons/bite2.wav new file mode 100644 index 00000000..4ff1ea42 Binary files /dev/null and b/main/sound/weapons/bite2.wav differ diff --git a/main/sound/weapons/bitehit1.wav b/main/sound/weapons/bitehit1.wav new file mode 100644 index 00000000..c75e168c Binary files /dev/null and b/main/sound/weapons/bitehit1.wav differ diff --git a/main/sound/weapons/bitehit2.wav b/main/sound/weapons/bitehit2.wav new file mode 100644 index 00000000..75090981 Binary files /dev/null and b/main/sound/weapons/bitehit2.wav differ diff --git a/main/sound/weapons/bitehit3.wav b/main/sound/weapons/bitehit3.wav new file mode 100644 index 00000000..c8bbfa1d Binary files /dev/null and b/main/sound/weapons/bitehit3.wav differ diff --git a/main/sound/weapons/bitekill.wav b/main/sound/weapons/bitekill.wav new file mode 100644 index 00000000..07c48b5c Binary files /dev/null and b/main/sound/weapons/bitekill.wav differ diff --git a/main/sound/weapons/blinkeffect.wav b/main/sound/weapons/blinkeffect.wav new file mode 100644 index 00000000..55803344 Binary files /dev/null and b/main/sound/weapons/blinkeffect.wav differ diff --git a/main/sound/weapons/blinkfire.wav b/main/sound/weapons/blinkfire.wav new file mode 100644 index 00000000..b22ef476 Binary files /dev/null and b/main/sound/weapons/blinkfire.wav differ diff --git a/main/sound/weapons/blinkfire2.wav b/main/sound/weapons/blinkfire2.wav new file mode 100644 index 00000000..f87acd65 Binary files /dev/null and b/main/sound/weapons/blinkfire2.wav differ diff --git a/main/sound/weapons/blinksuccess.wav b/main/sound/weapons/blinksuccess.wav new file mode 100644 index 00000000..072ad752 Binary files /dev/null and b/main/sound/weapons/blinksuccess.wav differ diff --git a/main/sound/weapons/bullet_hit1.wav b/main/sound/weapons/bullet_hit1.wav new file mode 100644 index 00000000..715ffb08 Binary files /dev/null and b/main/sound/weapons/bullet_hit1.wav differ diff --git a/main/sound/weapons/bullet_hit2.wav b/main/sound/weapons/bullet_hit2.wav new file mode 100644 index 00000000..80970e6a Binary files /dev/null and b/main/sound/weapons/bullet_hit2.wav differ diff --git a/main/sound/weapons/charge1.wav b/main/sound/weapons/charge1.wav new file mode 100644 index 00000000..9f4bf14d Binary files /dev/null and b/main/sound/weapons/charge1.wav differ diff --git a/main/sound/weapons/chargekill.wav b/main/sound/weapons/chargekill.wav new file mode 100644 index 00000000..e98195e8 Binary files /dev/null and b/main/sound/weapons/chargekill.wav differ diff --git a/main/sound/weapons/claws1.wav b/main/sound/weapons/claws1.wav new file mode 100644 index 00000000..45898a2a Binary files /dev/null and b/main/sound/weapons/claws1.wav differ diff --git a/main/sound/weapons/claws2.wav b/main/sound/weapons/claws2.wav new file mode 100644 index 00000000..4fe16a44 Binary files /dev/null and b/main/sound/weapons/claws2.wav differ diff --git a/main/sound/weapons/claws3.wav b/main/sound/weapons/claws3.wav new file mode 100644 index 00000000..0ab2c264 Binary files /dev/null and b/main/sound/weapons/claws3.wav differ diff --git a/main/sound/weapons/clawshit1.wav b/main/sound/weapons/clawshit1.wav new file mode 100644 index 00000000..3819bbbc Binary files /dev/null and b/main/sound/weapons/clawshit1.wav differ diff --git a/main/sound/weapons/clawshit2.wav b/main/sound/weapons/clawshit2.wav new file mode 100644 index 00000000..71b99a9c Binary files /dev/null and b/main/sound/weapons/clawshit2.wav differ diff --git a/main/sound/weapons/clawskill.wav b/main/sound/weapons/clawskill.wav new file mode 100644 index 00000000..8e85c06b Binary files /dev/null and b/main/sound/weapons/clawskill.wav differ diff --git a/main/sound/weapons/devour.wav b/main/sound/weapons/devour.wav new file mode 100644 index 00000000..68d501cb Binary files /dev/null and b/main/sound/weapons/devour.wav differ diff --git a/main/sound/weapons/devourcancel.wav b/main/sound/weapons/devourcancel.wav new file mode 100644 index 00000000..2f4a4762 Binary files /dev/null and b/main/sound/weapons/devourcancel.wav differ diff --git a/main/sound/weapons/devourcomplete.wav b/main/sound/weapons/devourcomplete.wav new file mode 100644 index 00000000..5eeb67dc Binary files /dev/null and b/main/sound/weapons/devourcomplete.wav differ diff --git a/main/sound/weapons/devourswallow.wav b/main/sound/weapons/devourswallow.wav new file mode 100644 index 00000000..e60036f8 Binary files /dev/null and b/main/sound/weapons/devourswallow.wav differ diff --git a/main/sound/weapons/divinewindexplode.wav b/main/sound/weapons/divinewindexplode.wav new file mode 100644 index 00000000..9bbc54a4 Binary files /dev/null and b/main/sound/weapons/divinewindexplode.wav differ diff --git a/main/sound/weapons/divinewindfire.wav b/main/sound/weapons/divinewindfire.wav new file mode 100644 index 00000000..dd7e1be2 Binary files /dev/null and b/main/sound/weapons/divinewindfire.wav differ diff --git a/main/sound/weapons/explode1.wav b/main/sound/weapons/explode1.wav new file mode 100644 index 00000000..85c2e298 Binary files /dev/null and b/main/sound/weapons/explode1.wav differ diff --git a/main/sound/weapons/explode2.wav b/main/sound/weapons/explode2.wav new file mode 100644 index 00000000..de897966 Binary files /dev/null and b/main/sound/weapons/explode2.wav differ diff --git a/main/sound/weapons/explode3.wav b/main/sound/weapons/explode3.wav new file mode 100644 index 00000000..09670990 Binary files /dev/null and b/main/sound/weapons/explode3.wav differ diff --git a/main/sound/weapons/explode4.wav b/main/sound/weapons/explode4.wav new file mode 100644 index 00000000..85b4d988 Binary files /dev/null and b/main/sound/weapons/explode4.wav differ diff --git a/main/sound/weapons/explode5.wav b/main/sound/weapons/explode5.wav new file mode 100644 index 00000000..533af121 Binary files /dev/null and b/main/sound/weapons/explode5.wav differ diff --git a/main/sound/weapons/g-deploy.wav b/main/sound/weapons/g-deploy.wav new file mode 100644 index 00000000..1d7a5506 Binary files /dev/null and b/main/sound/weapons/g-deploy.wav differ diff --git a/main/sound/weapons/g_reload.wav b/main/sound/weapons/g_reload.wav new file mode 100644 index 00000000..d80b5b1a Binary files /dev/null and b/main/sound/weapons/g_reload.wav differ diff --git a/main/sound/weapons/gg-1.wav b/main/sound/weapons/gg-1.wav new file mode 100644 index 00000000..c1892424 Binary files /dev/null and b/main/sound/weapons/gg-1.wav differ diff --git a/main/sound/weapons/gg-deploy.wav b/main/sound/weapons/gg-deploy.wav new file mode 100644 index 00000000..62b8f27e Binary files /dev/null and b/main/sound/weapons/gg-deploy.wav differ diff --git a/main/sound/weapons/gg_draw.wav b/main/sound/weapons/gg_draw.wav new file mode 100644 index 00000000..dc650277 Binary files /dev/null and b/main/sound/weapons/gg_draw.wav differ diff --git a/main/sound/weapons/gg_insert.wav b/main/sound/weapons/gg_insert.wav new file mode 100644 index 00000000..fdd66f60 Binary files /dev/null and b/main/sound/weapons/gg_insert.wav differ diff --git a/main/sound/weapons/gg_reload_end.wav b/main/sound/weapons/gg_reload_end.wav new file mode 100644 index 00000000..403778ee Binary files /dev/null and b/main/sound/weapons/gg_reload_end.wav differ diff --git a/main/sound/weapons/gg_reload_start.wav b/main/sound/weapons/gg_reload_start.wav new file mode 100644 index 00000000..073bdaba Binary files /dev/null and b/main/sound/weapons/gg_reload_start.wav differ diff --git a/main/sound/weapons/gg_rotate.wav b/main/sound/weapons/gg_rotate.wav new file mode 100644 index 00000000..66578e40 Binary files /dev/null and b/main/sound/weapons/gg_rotate.wav differ diff --git a/main/sound/weapons/gl_clipin.wav b/main/sound/weapons/gl_clipin.wav new file mode 100644 index 00000000..e1d0a2d0 Binary files /dev/null and b/main/sound/weapons/gl_clipin.wav differ diff --git a/main/sound/weapons/gl_clipout.wav b/main/sound/weapons/gl_clipout.wav new file mode 100644 index 00000000..3b9b60c2 Binary files /dev/null and b/main/sound/weapons/gl_clipout.wav differ diff --git a/main/sound/weapons/gl_draw.wav b/main/sound/weapons/gl_draw.wav new file mode 100644 index 00000000..4c35e19c Binary files /dev/null and b/main/sound/weapons/gl_draw.wav differ diff --git a/main/sound/weapons/grenade_draw.wav b/main/sound/weapons/grenade_draw.wav new file mode 100644 index 00000000..61a329e7 Binary files /dev/null and b/main/sound/weapons/grenade_draw.wav differ diff --git a/main/sound/weapons/grenade_explode.wav b/main/sound/weapons/grenade_explode.wav new file mode 100644 index 00000000..c29cbe26 Binary files /dev/null and b/main/sound/weapons/grenade_explode.wav differ diff --git a/main/sound/weapons/grenade_hit.wav b/main/sound/weapons/grenade_hit.wav new file mode 100644 index 00000000..84c4c493 Binary files /dev/null and b/main/sound/weapons/grenade_hit.wav differ diff --git a/main/sound/weapons/grenade_hit1.wav b/main/sound/weapons/grenade_hit1.wav new file mode 100644 index 00000000..e17fdaf0 Binary files /dev/null and b/main/sound/weapons/grenade_hit1.wav differ diff --git a/main/sound/weapons/grenade_hit2.wav b/main/sound/weapons/grenade_hit2.wav new file mode 100644 index 00000000..e49d40d4 Binary files /dev/null and b/main/sound/weapons/grenade_hit2.wav differ diff --git a/main/sound/weapons/grenade_hit3.wav b/main/sound/weapons/grenade_hit3.wav new file mode 100644 index 00000000..c787b045 Binary files /dev/null and b/main/sound/weapons/grenade_hit3.wav differ diff --git a/main/sound/weapons/grenade_prime.wav b/main/sound/weapons/grenade_prime.wav new file mode 100644 index 00000000..f09ee410 Binary files /dev/null and b/main/sound/weapons/grenade_prime.wav differ diff --git a/main/sound/weapons/grenade_throw.wav b/main/sound/weapons/grenade_throw.wav new file mode 100644 index 00000000..638b63cd Binary files /dev/null and b/main/sound/weapons/grenade_throw.wav differ diff --git a/main/sound/weapons/hg-1.wav b/main/sound/weapons/hg-1.wav new file mode 100644 index 00000000..e014d948 Binary files /dev/null and b/main/sound/weapons/hg-1.wav differ diff --git a/main/sound/weapons/hg-deploy.wav b/main/sound/weapons/hg-deploy.wav new file mode 100644 index 00000000..5a3641ee Binary files /dev/null and b/main/sound/weapons/hg-deploy.wav differ diff --git a/main/sound/weapons/hmg-1.wav b/main/sound/weapons/hmg-1.wav new file mode 100644 index 00000000..99e7a380 Binary files /dev/null and b/main/sound/weapons/hmg-1.wav differ diff --git a/main/sound/weapons/hmg-deploy.wav b/main/sound/weapons/hmg-deploy.wav new file mode 100644 index 00000000..fbeb4b2d Binary files /dev/null and b/main/sound/weapons/hmg-deploy.wav differ diff --git a/main/sound/weapons/hmg_clipin.wav b/main/sound/weapons/hmg_clipin.wav new file mode 100644 index 00000000..b91b4093 Binary files /dev/null and b/main/sound/weapons/hmg_clipin.wav differ diff --git a/main/sound/weapons/hmg_clipout.wav b/main/sound/weapons/hmg_clipout.wav new file mode 100644 index 00000000..6215da75 Binary files /dev/null and b/main/sound/weapons/hmg_clipout.wav differ diff --git a/main/sound/weapons/hmg_draw.wav b/main/sound/weapons/hmg_draw.wav new file mode 100644 index 00000000..a35e6bba Binary files /dev/null and b/main/sound/weapons/hmg_draw.wav differ diff --git a/main/sound/weapons/kn-1.wav b/main/sound/weapons/kn-1.wav new file mode 100644 index 00000000..abcb1479 Binary files /dev/null and b/main/sound/weapons/kn-1.wav differ diff --git a/main/sound/weapons/kn-2.wav b/main/sound/weapons/kn-2.wav new file mode 100644 index 00000000..c330ff53 Binary files /dev/null and b/main/sound/weapons/kn-2.wav differ diff --git a/main/sound/weapons/kn-deploy.wav b/main/sound/weapons/kn-deploy.wav new file mode 100644 index 00000000..5674943b Binary files /dev/null and b/main/sound/weapons/kn-deploy.wav differ diff --git a/main/sound/weapons/kn-hit-1.wav b/main/sound/weapons/kn-hit-1.wav new file mode 100644 index 00000000..0d257916 Binary files /dev/null and b/main/sound/weapons/kn-hit-1.wav differ diff --git a/main/sound/weapons/kn-hit-2.wav b/main/sound/weapons/kn-hit-2.wav new file mode 100644 index 00000000..53ed4aed Binary files /dev/null and b/main/sound/weapons/kn-hit-2.wav differ diff --git a/main/sound/weapons/kn-hit-wall.wav b/main/sound/weapons/kn-hit-wall.wav new file mode 100644 index 00000000..edb46970 Binary files /dev/null and b/main/sound/weapons/kn-hit-wall.wav differ diff --git a/main/sound/weapons/leap1.wav b/main/sound/weapons/leap1.wav new file mode 100644 index 00000000..f93d5eb4 Binary files /dev/null and b/main/sound/weapons/leap1.wav differ diff --git a/main/sound/weapons/leaphit1.wav b/main/sound/weapons/leaphit1.wav new file mode 100644 index 00000000..9eb48943 Binary files /dev/null and b/main/sound/weapons/leaphit1.wav differ diff --git a/main/sound/weapons/leapkill.wav b/main/sound/weapons/leapkill.wav new file mode 100644 index 00000000..ceb235ca Binary files /dev/null and b/main/sound/weapons/leapkill.wav differ diff --git a/main/sound/weapons/lmg_clipin.wav b/main/sound/weapons/lmg_clipin.wav new file mode 100644 index 00000000..88cb2e73 Binary files /dev/null and b/main/sound/weapons/lmg_clipin.wav differ diff --git a/main/sound/weapons/lmg_clipout.wav b/main/sound/weapons/lmg_clipout.wav new file mode 100644 index 00000000..d34ba1f0 Binary files /dev/null and b/main/sound/weapons/lmg_clipout.wav differ diff --git a/main/sound/weapons/lmg_draw.wav b/main/sound/weapons/lmg_draw.wav new file mode 100644 index 00000000..df954b5a Binary files /dev/null and b/main/sound/weapons/lmg_draw.wav differ diff --git a/main/sound/weapons/metabolize1.wav b/main/sound/weapons/metabolize1.wav new file mode 100644 index 00000000..b940f755 Binary files /dev/null and b/main/sound/weapons/metabolize1.wav differ diff --git a/main/sound/weapons/metabolize2.wav b/main/sound/weapons/metabolize2.wav new file mode 100644 index 00000000..b940f755 Binary files /dev/null and b/main/sound/weapons/metabolize2.wav differ diff --git a/main/sound/weapons/metabolize3.wav b/main/sound/weapons/metabolize3.wav new file mode 100644 index 00000000..b940f755 Binary files /dev/null and b/main/sound/weapons/metabolize3.wav differ diff --git a/main/sound/weapons/metabolize_fire.wav b/main/sound/weapons/metabolize_fire.wav new file mode 100644 index 00000000..d74299db Binary files /dev/null and b/main/sound/weapons/metabolize_fire.wav differ diff --git a/main/sound/weapons/metabolize_success.wav b/main/sound/weapons/metabolize_success.wav new file mode 100644 index 00000000..29ea7c02 Binary files /dev/null and b/main/sound/weapons/metabolize_success.wav differ diff --git a/main/sound/weapons/mg-1.wav b/main/sound/weapons/mg-1.wav new file mode 100644 index 00000000..657453fe Binary files /dev/null and b/main/sound/weapons/mg-1.wav differ diff --git a/main/sound/weapons/mg-deploy.wav b/main/sound/weapons/mg-deploy.wav new file mode 100644 index 00000000..9ebd80ad Binary files /dev/null and b/main/sound/weapons/mg-deploy.wav differ diff --git a/main/sound/weapons/mine_activate.wav b/main/sound/weapons/mine_activate.wav new file mode 100644 index 00000000..e5dc9ff9 Binary files /dev/null and b/main/sound/weapons/mine_activate.wav differ diff --git a/main/sound/weapons/mine_charge.wav b/main/sound/weapons/mine_charge.wav new file mode 100644 index 00000000..51b4b279 Binary files /dev/null and b/main/sound/weapons/mine_charge.wav differ diff --git a/main/sound/weapons/mine_deploy.wav b/main/sound/weapons/mine_deploy.wav new file mode 100644 index 00000000..bf3f158f Binary files /dev/null and b/main/sound/weapons/mine_deploy.wav differ diff --git a/main/sound/weapons/mine_draw.wav b/main/sound/weapons/mine_draw.wav new file mode 100644 index 00000000..4a2b2e7e Binary files /dev/null and b/main/sound/weapons/mine_draw.wav differ diff --git a/main/sound/weapons/mine_step.wav b/main/sound/weapons/mine_step.wav new file mode 100644 index 00000000..343b06b9 Binary files /dev/null and b/main/sound/weapons/mine_step.wav differ diff --git a/main/sound/weapons/parasitefire.wav b/main/sound/weapons/parasitefire.wav new file mode 100644 index 00000000..2a83aa35 Binary files /dev/null and b/main/sound/weapons/parasitefire.wav differ diff --git a/main/sound/weapons/parasitehit.wav b/main/sound/weapons/parasitehit.wav new file mode 100644 index 00000000..8087deef Binary files /dev/null and b/main/sound/weapons/parasitehit.wav differ diff --git a/main/sound/weapons/pistol_clipin.wav b/main/sound/weapons/pistol_clipin.wav new file mode 100644 index 00000000..25bdbc74 Binary files /dev/null and b/main/sound/weapons/pistol_clipin.wav differ diff --git a/main/sound/weapons/pistol_clipout.wav b/main/sound/weapons/pistol_clipout.wav new file mode 100644 index 00000000..c4f7b011 Binary files /dev/null and b/main/sound/weapons/pistol_clipout.wav differ diff --git a/main/sound/weapons/pistol_draw.wav b/main/sound/weapons/pistol_draw.wav new file mode 100644 index 00000000..e8503ecc Binary files /dev/null and b/main/sound/weapons/pistol_draw.wav differ diff --git a/main/sound/weapons/pistol_slide_release.wav b/main/sound/weapons/pistol_slide_release.wav new file mode 100644 index 00000000..403ecc58 Binary files /dev/null and b/main/sound/weapons/pistol_slide_release.wav differ diff --git a/main/sound/weapons/primalscream.wav b/main/sound/weapons/primalscream.wav new file mode 100644 index 00000000..1af9c758 Binary files /dev/null and b/main/sound/weapons/primalscream.wav differ diff --git a/main/sound/weapons/ric1.wav b/main/sound/weapons/ric1.wav new file mode 100644 index 00000000..07605d4e Binary files /dev/null and b/main/sound/weapons/ric1.wav differ diff --git a/main/sound/weapons/ric2.wav b/main/sound/weapons/ric2.wav new file mode 100644 index 00000000..7565586a Binary files /dev/null and b/main/sound/weapons/ric2.wav differ diff --git a/main/sound/weapons/ric3.wav b/main/sound/weapons/ric3.wav new file mode 100644 index 00000000..bdb2c47b Binary files /dev/null and b/main/sound/weapons/ric3.wav differ diff --git a/main/sound/weapons/ric4.wav b/main/sound/weapons/ric4.wav new file mode 100644 index 00000000..eb7cafd4 Binary files /dev/null and b/main/sound/weapons/ric4.wav differ diff --git a/main/sound/weapons/ric5.wav b/main/sound/weapons/ric5.wav new file mode 100644 index 00000000..4e6c33c5 Binary files /dev/null and b/main/sound/weapons/ric5.wav differ diff --git a/main/sound/weapons/ric_conc-1.wav b/main/sound/weapons/ric_conc-1.wav new file mode 100644 index 00000000..d2e9a69f Binary files /dev/null and b/main/sound/weapons/ric_conc-1.wav differ diff --git a/main/sound/weapons/ric_conc-2.wav b/main/sound/weapons/ric_conc-2.wav new file mode 100644 index 00000000..83826a9b Binary files /dev/null and b/main/sound/weapons/ric_conc-2.wav differ diff --git a/main/sound/weapons/ric_metal-1.wav b/main/sound/weapons/ric_metal-1.wav new file mode 100644 index 00000000..fa454f3c Binary files /dev/null and b/main/sound/weapons/ric_metal-1.wav differ diff --git a/main/sound/weapons/ric_metal-2.wav b/main/sound/weapons/ric_metal-2.wav new file mode 100644 index 00000000..356404d5 Binary files /dev/null and b/main/sound/weapons/ric_metal-2.wav differ diff --git a/main/sound/weapons/sg-1.wav b/main/sound/weapons/sg-1.wav new file mode 100644 index 00000000..f18c9c30 Binary files /dev/null and b/main/sound/weapons/sg-1.wav differ diff --git a/main/sound/weapons/sg-cock.wav b/main/sound/weapons/sg-cock.wav new file mode 100644 index 00000000..7577c88a Binary files /dev/null and b/main/sound/weapons/sg-cock.wav differ diff --git a/main/sound/weapons/sg-deploy.wav b/main/sound/weapons/sg-deploy.wav new file mode 100644 index 00000000..950329e0 Binary files /dev/null and b/main/sound/weapons/sg-deploy.wav differ diff --git a/main/sound/weapons/shotgun_draw.wav b/main/sound/weapons/shotgun_draw.wav new file mode 100644 index 00000000..b03a3f28 Binary files /dev/null and b/main/sound/weapons/shotgun_draw.wav differ diff --git a/main/sound/weapons/shotgun_pump.wav b/main/sound/weapons/shotgun_pump.wav new file mode 100644 index 00000000..80a201e2 Binary files /dev/null and b/main/sound/weapons/shotgun_pump.wav differ diff --git a/main/sound/weapons/shotgun_reload.wav b/main/sound/weapons/shotgun_reload.wav new file mode 100644 index 00000000..a4b220e6 Binary files /dev/null and b/main/sound/weapons/shotgun_reload.wav differ diff --git a/main/sound/weapons/shotgun_stock_release.wav b/main/sound/weapons/shotgun_stock_release.wav new file mode 100644 index 00000000..d0e3c202 Binary files /dev/null and b/main/sound/weapons/shotgun_stock_release.wav differ diff --git a/main/sound/weapons/spikefire.wav b/main/sound/weapons/spikefire.wav new file mode 100644 index 00000000..a17b4670 Binary files /dev/null and b/main/sound/weapons/spikefire.wav differ diff --git a/main/sound/weapons/spit-1.wav b/main/sound/weapons/spit-1.wav new file mode 100644 index 00000000..f27288df Binary files /dev/null and b/main/sound/weapons/spit-1.wav differ diff --git a/main/sound/weapons/spit-2.wav b/main/sound/weapons/spit-2.wav new file mode 100644 index 00000000..7cf6c7e5 Binary files /dev/null and b/main/sound/weapons/spit-2.wav differ diff --git a/main/sound/weapons/spithit1.wav b/main/sound/weapons/spithit1.wav new file mode 100644 index 00000000..8a7a5ac2 Binary files /dev/null and b/main/sound/weapons/spithit1.wav differ diff --git a/main/sound/weapons/spithit2.wav b/main/sound/weapons/spithit2.wav new file mode 100644 index 00000000..6e1eed27 Binary files /dev/null and b/main/sound/weapons/spithit2.wav differ diff --git a/main/sound/weapons/sporecloud.wav b/main/sound/weapons/sporecloud.wav new file mode 100644 index 00000000..6f3b02a0 Binary files /dev/null and b/main/sound/weapons/sporecloud.wav differ diff --git a/main/sound/weapons/sporefire.wav b/main/sound/weapons/sporefire.wav new file mode 100644 index 00000000..a628032c Binary files /dev/null and b/main/sound/weapons/sporefire.wav differ diff --git a/main/sound/weapons/stomp.wav b/main/sound/weapons/stomp.wav new file mode 100644 index 00000000..fe5813c9 Binary files /dev/null and b/main/sound/weapons/stomp.wav differ diff --git a/main/sound/weapons/swipe1.wav b/main/sound/weapons/swipe1.wav new file mode 100644 index 00000000..4af771cc Binary files /dev/null and b/main/sound/weapons/swipe1.wav differ diff --git a/main/sound/weapons/swipe2.wav b/main/sound/weapons/swipe2.wav new file mode 100644 index 00000000..699f6ae8 Binary files /dev/null and b/main/sound/weapons/swipe2.wav differ diff --git a/main/sound/weapons/swipe3.wav b/main/sound/weapons/swipe3.wav new file mode 100644 index 00000000..99a01485 Binary files /dev/null and b/main/sound/weapons/swipe3.wav differ diff --git a/main/sound/weapons/swipe4.wav b/main/sound/weapons/swipe4.wav new file mode 100644 index 00000000..8ece7269 Binary files /dev/null and b/main/sound/weapons/swipe4.wav differ diff --git a/main/sound/weapons/swipehit1.wav b/main/sound/weapons/swipehit1.wav new file mode 100644 index 00000000..a13fcab5 Binary files /dev/null and b/main/sound/weapons/swipehit1.wav differ diff --git a/main/sound/weapons/swipehit2.wav b/main/sound/weapons/swipehit2.wav new file mode 100644 index 00000000..f0317e44 Binary files /dev/null and b/main/sound/weapons/swipehit2.wav differ diff --git a/main/sound/weapons/swipekill.wav b/main/sound/weapons/swipekill.wav new file mode 100644 index 00000000..627a51a2 Binary files /dev/null and b/main/sound/weapons/swipekill.wav differ diff --git a/main/sound/weapons/umbrablocked.wav b/main/sound/weapons/umbrablocked.wav new file mode 100644 index 00000000..395b8e26 Binary files /dev/null and b/main/sound/weapons/umbrablocked.wav differ diff --git a/main/sound/weapons/umbrafire.wav b/main/sound/weapons/umbrafire.wav new file mode 100644 index 00000000..267f2377 Binary files /dev/null and b/main/sound/weapons/umbrafire.wav differ diff --git a/main/sound/weapons/webspin1.wav b/main/sound/weapons/webspin1.wav new file mode 100644 index 00000000..a43e9665 Binary files /dev/null and b/main/sound/weapons/webspin1.wav differ diff --git a/main/sound/weapons/webspin2.wav b/main/sound/weapons/webspin2.wav new file mode 100644 index 00000000..32e15d7e Binary files /dev/null and b/main/sound/weapons/webspin2.wav differ diff --git a/main/sound/weapons/welderhit.wav b/main/sound/weapons/welderhit.wav new file mode 100644 index 00000000..a62e4720 Binary files /dev/null and b/main/sound/weapons/welderhit.wav differ diff --git a/main/sound/weapons/welderidle.wav b/main/sound/weapons/welderidle.wav new file mode 100644 index 00000000..164ef1fe Binary files /dev/null and b/main/sound/weapons/welderidle.wav differ diff --git a/main/sound/weapons/welderstop.wav b/main/sound/weapons/welderstop.wav new file mode 100644 index 00000000..951e09c4 Binary files /dev/null and b/main/sound/weapons/welderstop.wav differ diff --git a/main/source/HPB_bot/dlls/HPB_bot.def b/main/source/HPB_bot/dlls/HPB_bot.def new file mode 100644 index 00000000..e3e89fda --- /dev/null +++ b/main/source/HPB_bot/dlls/HPB_bot.def @@ -0,0 +1,5 @@ +LIBRARY HPB_bot +EXPORTS + GiveFnptrsToDll @1 +SECTIONS + .data READ WRITE diff --git a/main/source/HPB_bot/dlls/HPB_bot.vcproj b/main/source/HPB_bot/dlls/HPB_bot.vcproj new file mode 100644 index 00000000..d67014e2 --- /dev/null +++ b/main/source/HPB_bot/dlls/HPB_bot.vcproj @@ -0,0 +1,393 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/source/HPB_bot/dlls/bot.cpp b/main/source/HPB_bot/dlls/bot.cpp new file mode 100644 index 00000000..cc341a06 --- /dev/null +++ b/main/source/HPB_bot/dlls/bot.cpp @@ -0,0 +1,2087 @@ +// +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// bot.cpp +// + +//#include "windows.h" +#include "extdll.h" +#include "util.h" +#include "cbase.h" + +#include "bot.h" +#include "bot_func.h" +#include "waypoint.h" +#include "bot_weapons.h" + +#include +#include +#include "mod/AvHMarineEquipmentConstants.h" +#include "mod/AvHMessage.h" +#include "mod/AvHCommandConstants.h" +#include "mod/AvHMessage.h" +#include "mod/AvHPlayer.h" + +#ifndef __linux__ +extern HINSTANCE h_Library; +#else +extern void *h_Library; +#endif + + +extern int mod_id; +extern WAYPOINT waypoints[MAX_WAYPOINTS]; +extern int num_waypoints; // number of waypoints currently in use +extern int default_bot_skill; +extern edict_t *pent_info_ctfdetect; + +extern int max_team_players[4]; +extern int team_class_limits[4]; +extern int max_teams; +extern char bot_whine[MAX_BOT_WHINE][81]; +extern int whine_count; + +extern int flf_bug_fix; + +static FILE *fp; + + +#define PLAYER_SEARCH_RADIUS 40.0 +#define FLF_PLAYER_SEARCH_RADIUS 60.0 + + +bot_t bots[32]; // max of 32 bots in a game +bool b_observer_mode = FALSE; +bool b_botdontshoot = FALSE; + +extern int recent_bot_whine[5]; + +int number_names = 0; + +#define MAX_BOT_NAMES 100 + +#define VALVE_MAX_SKINS 10 +#define GEARBOX_MAX_SKINS 20 + +// indicate which models are currently used for random model allocation +bool valve_skin_used[VALVE_MAX_SKINS] = { + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; + +bool gearbox_skin_used[GEARBOX_MAX_SKINS] = { + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; + +// store the names of the models... +char *valve_bot_skins[VALVE_MAX_SKINS] = { + "barney", "gina", "gman", "gordon", "helmet", + "hgrunt", "recon", "robo", "scientist", "zombie"}; + +char *gearbox_bot_skins[GEARBOX_MAX_SKINS] = { + "barney", "beret", "cl_suit", "drill", "fassn", "gina", "gman", + "gordon", "grunt", "helmet", "hgrunt", "massn", "otis", "recon", + "recruit", "robo", "scientist", "shepard", "tower", "zombie"}; + +// store the player names for each of the models... +char *valve_bot_names[VALVE_MAX_SKINS] = { + "Barney", "Gina", "G-Man", "Gordon", "Helmet", + "H-Grunt", "Recon", "Robo", "Scientist", "Zombie"}; + +char *gearbox_bot_names[GEARBOX_MAX_SKINS] = { + "Barney", "Beret", "Cl_suit", "Drill", "Fassn", "Gina", "G-Man", + "Gordon", "Grunt", "Helmet", "H-Grunt", "Massn", "Otis", "Recon", + "Recruit", "Robo", "Scientist", "Shepard", "Tower", "Zombie"}; + +char bot_names[MAX_BOT_NAMES][BOT_NAME_LEN+1]; + +// how often (out of 1000 times) the bot will pause, based on bot skill +float pause_frequency[5] = {4, 7, 10, 15, 20}; + +float pause_time[5][2] = { + {0.2, 0.5}, {0.5, 1.0}, {0.7, 1.3}, {1.0, 1.7}, {1.2, 2.0}}; + + +inline edict_t *CREATE_FAKE_CLIENT( const char *netname ) +{ + return (*g_engfuncs.pfnCreateFakeClient)( netname ); +} + +inline char *GET_INFOBUFFER( edict_t *e ) +{ + return (*g_engfuncs.pfnGetInfoKeyBuffer)( e ); +} + +inline char *GET_INFO_KEY_VALUE( char *infobuffer, char *key ) +{ + return (g_engfuncs.pfnInfoKeyValue( infobuffer, key )); +} + +inline void SET_CLIENT_KEY_VALUE( int clientIndex, char *infobuffer, + char *key, char *value ) +{ + (*g_engfuncs.pfnSetClientKeyValue)( clientIndex, infobuffer, key, value ); +} + + +// this is the LINK_ENTITY_TO_CLASS function that creates a player (bot) +void player( entvars_t *pev ) +{ + static LINK_ENTITY_FUNC otherClassName = NULL; + if (otherClassName == NULL) + otherClassName = (LINK_ENTITY_FUNC)GetProcAddress(h_Library, "player"); + if (otherClassName != NULL) + { + (*otherClassName)(pev); + } +} + +void BotProcessVoiceCommands(bot_t* pBot) +{ + if((pBot->mTimeOfNextOrderRequest != -1) && (gpGlobals->time > pBot->mTimeOfNextOrderRequest)) + { + if(pBot->pEdict->v.impulse == 0) + { + pBot->pEdict->v.impulse = ORDER_REQUEST; + pBot->mTimeOfNextOrderRequest = -1; + } + } + if((pBot->mTimeOfNextAmmoRequest != -1) && (gpGlobals->time > pBot->mTimeOfNextAmmoRequest)) + { + if(pBot->pEdict->v.impulse == 0) + { + pBot->pEdict->v.impulse = SAYING_5; + pBot->mTimeOfNextAmmoRequest = -1; + } + } + if((pBot->mTimeOfNextRandomSaying != -1) && (gpGlobals->time > pBot->mTimeOfNextRandomSaying)) + { + if(pBot->pEdict->v.impulse == 0) + { + pBot->pEdict->v.impulse = SAYING_1 + g_engfuncs.pfnRandomLong(0, 5); + pBot->mTimeOfNextRandomSaying = -1; + } + } + if((pBot->mTimeOfNextTaunt != -1) && (gpGlobals->time > pBot->mTimeOfNextTaunt)) + { + if(pBot->pEdict->v.impulse == 0) + { + pBot->pEdict->v.impulse = SAYING_3; + pBot->mTimeOfNextTaunt = -1; + } + } + if((pBot->mTimeOfNextAcknowledge != -1) && (gpGlobals->time > pBot->mTimeOfNextAcknowledge)) + { + if(pBot->pEdict->v.impulse == 0) + { + pBot->pEdict->v.impulse = ORDER_ACK; + pBot->mTimeOfNextAcknowledge = -1; + } + } +} + +void BotSpawnInit( bot_t *pBot ) +{ + pBot->v_prev_origin = Vector(9999.0, 9999.0, 9999.0); + pBot->prev_time = gpGlobals->time; + + pBot->waypoint_origin = Vector(0, 0, 0); + pBot->f_waypoint_time = 0.0; + pBot->curr_waypoint_index = -1; + pBot->prev_waypoint_index[0] = -1; + pBot->prev_waypoint_index[1] = -1; + pBot->prev_waypoint_index[2] = -1; + pBot->prev_waypoint_index[3] = -1; + pBot->prev_waypoint_index[4] = -1; + + pBot->f_random_waypoint_time = gpGlobals->time; + pBot->waypoint_goal = -1; + pBot->f_waypoint_goal_time = 0.0; + pBot->waypoint_near_flag = FALSE; + pBot->waypoint_flag_origin = Vector(0, 0, 0); + pBot->prev_waypoint_distance = 0.0; + + pBot->msecnum = 0; + pBot->msecdel = 0.0; + pBot->msecval = 0.0; + + pBot->bot_health = 0; + pBot->bot_armor = 0; + pBot->bot_weapons = 0; + pBot->blinded_time = 0.0; + + // Init AvH variables + pBot->mBotPlayMode = PLAYMODE_READYROOM; + + pBot->mOrderState = 0; + pBot->mOrderNumPlayers = -1; + pBot->mOrderType = ORDERTYPE_UNDEFINED; + pBot->mOrderTargetType = ORDERTARGETTYPE_UNDEFINED; + pBot->mOrderLocation[0] = pBot->mOrderLocation[1] = pBot->mOrderLocation[2] = 0.0f; + pBot->mOrderTargetIndex = -1; + pBot->mOrderCompleted = false; + + pBot->mTimeOfNextAcknowledge = -1; + pBot->mTimeOfNextAmmoRequest = -1; + pBot->mTimeOfNextOrderRequest = -1; + pBot->mTimeOfNextTaunt = -1; + pBot->mTimeOfNextRandomSaying = -1; + + pBot->mGestateUser3 = AVH_USER3_NONE; + pBot->mResources = 0; + // end AvH variable init + + pBot->f_max_speed = CVAR_GET_FLOAT("sv_maxspeed"); + + pBot->prev_speed = 0.0; // fake "paused" since bot is NOT stuck + + pBot->f_find_item = 0.0; + + pBot->ladder_dir = LADDER_UNKNOWN; + pBot->f_start_use_ladder_time = 0.0; + pBot->f_end_use_ladder_time = 0.0; + pBot->waypoint_top_of_ladder = FALSE; + + pBot->f_wall_check_time = 0.0; + pBot->f_wall_on_right = 0.0; + pBot->f_wall_on_left = 0.0; + pBot->f_dont_avoid_wall_time = 0.0; + pBot->f_look_for_waypoint_time = 0.0; + pBot->f_jump_time = 0.0; + pBot->f_dont_check_stuck = 0.0; + + // pick a wander direction (50% of the time to the left, 50% to the right) + if (RANDOM_LONG(1, 100) <= 50) + pBot->wander_dir = WANDER_LEFT; + else + pBot->wander_dir = WANDER_RIGHT; + + pBot->f_exit_water_time = 0.0; + + pBot->pBotEnemy = NULL; + pBot->f_bot_see_enemy_time = gpGlobals->time; + pBot->f_bot_find_enemy_time = gpGlobals->time; + pBot->pBotUser = NULL; + pBot->f_bot_use_time = 0.0; + pBot->b_bot_say_killed = FALSE; + pBot->f_bot_say_killed = 0.0; + pBot->f_sniper_aim_time = 0.0; + + pBot->f_shoot_time = gpGlobals->time; + pBot->f_primary_charging = -1.0; + pBot->f_secondary_charging = -1.0; + pBot->charging_weapon_id = 0; + + pBot->f_pause_time = 0.0; + pBot->f_sound_update_time = 0.0; + pBot->bot_has_flag = FALSE; + + pBot->b_see_tripmine = FALSE; + pBot->b_shoot_tripmine = FALSE; + pBot->v_tripmine = Vector(0,0,0); + + pBot->b_use_health_station = FALSE; + pBot->f_use_health_time = 0.0; + pBot->b_use_HEV_station = FALSE; + pBot->f_use_HEV_time = 0.0; + + pBot->b_use_button = FALSE; + pBot->f_use_button_time = 0; + pBot->b_lift_moving = FALSE; + + pBot->b_use_capture = FALSE; + pBot->f_use_capture_time = 0.0; + pBot->pCaptureEdict = NULL; + + memset(&(pBot->current_weapon), 0, sizeof(pBot->current_weapon)); + memset(&(pBot->m_rgAmmo), 0, sizeof(pBot->m_rgAmmo)); +} + + +void BotNameInit( void ) +{ + FILE *bot_name_fp; + char bot_name_filename[256]; + int str_index; + char name_buffer[80]; + int length, index; + + UTIL_BuildFileName(bot_name_filename, "bot_names.txt", NULL); + + bot_name_fp = fopen(bot_name_filename, "r"); + + if (bot_name_fp != NULL) + { + while ((number_names < MAX_BOT_NAMES) && + (fgets(name_buffer, 80, bot_name_fp) != NULL)) + { + length = strlen(name_buffer); + + if (name_buffer[length-1] == '\n') + { + name_buffer[length-1] = 0; // remove '\n' + length--; + } + + str_index = 0; + while (str_index < length) + { + if ((name_buffer[str_index] < ' ') || (name_buffer[str_index] > '~') || + (name_buffer[str_index] == '"')) + for (index=str_index; index < length; index++) + name_buffer[index] = name_buffer[index+1]; + + str_index++; + } + + if (name_buffer[0] != 0) + { + strncpy(bot_names[number_names], name_buffer, BOT_NAME_LEN); + + number_names++; + } + } + + fclose(bot_name_fp); + } +} + + +void BotPickName( char *name_buffer ) +{ + int name_index, index; + bool used; + edict_t *pPlayer; + int attempts = 0; + + // see if a name exists from a kicked bot (if so, reuse it) + for (index=0; index < 32; index++) + { + if ((bots[index].is_used == FALSE) && (bots[index].name[0])) + { + strcpy(name_buffer, bots[index].name); + + return; + } + } + + name_index = RANDOM_LONG(1, number_names) - 1; // zero based + + // check make sure this name isn't used + used = TRUE; + + while (used) + { + used = FALSE; + + for (index = 1; index <= gpGlobals->maxClients; index++) + { + pPlayer = INDEXENT(index); + + if (pPlayer && !pPlayer->free) + { + if (strcmp(bot_names[name_index], STRING(pPlayer->v.netname)) == 0) + { + used = TRUE; + break; + } + } + } + + if (used) + { + name_index++; + + if (name_index == number_names) + name_index = 0; + + attempts++; + + if (attempts == number_names) + used = FALSE; // break out of loop even if already used + } + } + + strcpy(name_buffer, bot_names[name_index]); +} + + +void BotCreate( edict_t *pPlayer, const char *arg1, const char *arg2, + const char *arg3, const char *arg4) +{ + edict_t *BotEnt; + bot_t *pBot; + char c_skin[BOT_SKIN_LEN+1]; + char c_name[BOT_NAME_LEN+1]; + int skill; + int index; + int i, j, length; + bool found = FALSE; + + + if ((mod_id == VALVE_DLL) || + ((mod_id == GEARBOX_DLL) && (pent_info_ctfdetect == NULL))) + { + int max_skin_index; + + if (mod_id == VALVE_DLL) + max_skin_index = VALVE_MAX_SKINS; + else // must be GEARBOX_DLL + max_skin_index = GEARBOX_MAX_SKINS; + + if ((arg1 == NULL) || (*arg1 == 0)) + { + bool *pSkinUsed; + + // pick a random skin + if (mod_id == VALVE_DLL) + { + index = RANDOM_LONG(0, VALVE_MAX_SKINS-1); + pSkinUsed = &valve_skin_used[0]; + } + else // must be GEARBOX_DLL + { + index = RANDOM_LONG(0, GEARBOX_MAX_SKINS-1); + pSkinUsed = &gearbox_skin_used[0]; + } + + // check if this skin has already been used... + while (pSkinUsed[index] == TRUE) + { + index++; + + if (index == max_skin_index) + index = 0; + } + + pSkinUsed[index] = TRUE; + + // check if all skins are now used... + for (i = 0; i < max_skin_index; i++) + { + if (pSkinUsed[i] == FALSE) + break; + } + + // if all skins are used, reset used to FALSE for next selection + if (i == max_skin_index) + { + for (i = 0; i < max_skin_index; i++) + pSkinUsed[i] = FALSE; + } + + if (mod_id == VALVE_DLL) + strcpy( c_skin, valve_bot_skins[index] ); + else // must be GEARBOX_DLL + strcpy( c_skin, gearbox_bot_skins[index] ); + } + else + { + strncpy( c_skin, arg1, BOT_SKIN_LEN-1 ); + c_skin[BOT_SKIN_LEN] = 0; // make sure c_skin is null terminated + } + + for (i = 0; c_skin[i] != 0; i++) + c_skin[i] = tolower( c_skin[i] ); // convert to all lowercase + + index = 0; + + while ((!found) && (index < max_skin_index)) + { + if (mod_id == VALVE_DLL) + { + if (strcmp(c_skin, valve_bot_skins[index]) == 0) + found = TRUE; + else + index++; + } + else // must be GEARBOX_DLL + { + if (strcmp(c_skin, gearbox_bot_skins[index]) == 0) + found = TRUE; + else + index++; + } + } + + if (found == TRUE) + { + if ((arg2 != NULL) && (*arg2 != 0)) + { + strncpy( c_name, arg2, BOT_SKIN_LEN-1 ); + c_name[BOT_SKIN_LEN] = 0; // make sure c_name is null terminated + } + else + { + if (number_names > 0) + BotPickName( c_name ); + else if (mod_id == VALVE_DLL) + strcpy( c_name, valve_bot_names[index] ); + else // must be GEARBOX_DLL + strcpy( c_name, gearbox_bot_names[index] ); + } + } + else + { + char dir_name[32]; + char filename[128]; + + struct stat stat_str; + + GET_GAME_DIR(dir_name); + +#ifndef __linux__ + sprintf(filename, "%s\\models\\player\\%s", dir_name, c_skin); +#else + sprintf(filename, "%s/models/player/%s", dir_name, c_skin); +#endif + + if (stat(filename, &stat_str) != 0) + { +#ifndef __linux__ + sprintf(filename, "valve\\models\\player\\%s", c_skin); +#else + sprintf(filename, "valve/models/player/%s", c_skin); +#endif + if (stat(filename, &stat_str) != 0) + { + char err_msg[80]; + + sprintf( err_msg, "model \"%s\" is unknown.\n", c_skin ); + if (pPlayer) + ClientPrint(pPlayer, HUD_PRINTNOTIFY, err_msg ); + if (IS_DEDICATED_SERVER()) + printf(err_msg); + + if (pPlayer) + ClientPrint(pPlayer, HUD_PRINTNOTIFY, + "use barney, gina, gman, gordon, helmet, hgrunt,\n"); + if (IS_DEDICATED_SERVER()) + printf("use barney, gina, gman, gordon, helmet, hgrunt,\n"); + if (pPlayer) + ClientPrint(pPlayer, HUD_PRINTNOTIFY, + " recon, robo, scientist, or zombie\n"); + if (IS_DEDICATED_SERVER()) + printf(" recon, robo, scientist, or zombie\n"); + return; + } + } + + if ((arg2 != NULL) && (*arg2 != 0)) + { + strncpy( c_name, arg2, BOT_NAME_LEN-1 ); + c_name[BOT_NAME_LEN] = 0; // make sure c_name is null terminated + } + else + { + if (number_names > 0) + BotPickName( c_name ); + else + { + // copy the name of the model to the bot's name... + strncpy( c_name, arg1, BOT_NAME_LEN-1 ); + c_name[BOT_NAME_LEN] = 0; // make sure c_skin is null terminated + } + } + } + + skill = 0; + + if ((arg3 != NULL) && (*arg3 != 0)) + skill = atoi(arg3); + + if ((skill < 1) || (skill > 5)) + skill = default_bot_skill; + } + else + { + if ((arg3 != NULL) && (*arg3 != 0)) + { + strncpy( c_name, arg3, BOT_NAME_LEN-1 ); + c_name[BOT_NAME_LEN] = 0; // make sure c_name is null terminated + } + else + { + if (number_names > 0) + BotPickName( c_name ); + else + strcpy(c_name, "Bot"); + } + + skill = 0; + + if ((arg4 != NULL) && (*arg4 != 0)) + skill = atoi(arg4); + + if ((skill < 1) || (skill > 5)) + skill = default_bot_skill; + } + + length = strlen(c_name); + + // remove any illegal characters from name... + for (i = 0; i < length; i++) + { + if ((c_name[i] <= ' ') || (c_name[i] > '~') || + (c_name[i] == '"')) + { + for (j = i; j < length; j++) // shuffle chars left (and null) + c_name[j] = c_name[j+1]; + length--; + } + } + + BotEnt = CREATE_FAKE_CLIENT( c_name ); + + if (FNullEnt( BotEnt )) + { + if (pPlayer) + ClientPrint( pPlayer, HUD_PRINTNOTIFY, "Max. Players reached. Can't create bot!\n"); + } + else + { + char ptr[128]; // allocate space for message from ClientConnect + char *infobuffer; + int clientIndex; + int index; + + if (IS_DEDICATED_SERVER()) + printf("Creating bot...\n"); + else if (pPlayer) + ClientPrint( pPlayer, HUD_PRINTNOTIFY, "Creating bot...\n"); + + index = 0; + while ((bots[index].is_used) && (index < 32)) + index++; + + if (index == 32) + { + ClientPrint( pPlayer, HUD_PRINTNOTIFY, "Can't create bot!\n"); + return; + } + + // create the player entity by calling MOD's player function + // (from LINK_ENTITY_TO_CLASS for player object) + + player( VARS(BotEnt) ); + + infobuffer = GET_INFOBUFFER( BotEnt ); + clientIndex = ENTINDEX( BotEnt ); + + + if ((mod_id == VALVE_DLL) || (mod_id == GEARBOX_DLL)) + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "model", c_skin ); + else // other mods + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "model", "gina" ); + + if (mod_id == CSTRIKE_DLL) + { + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "rate", "3500.000000"); + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "cl_updaterate", "20"); + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "cl_lw", "1"); + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "cl_lc", "1"); + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "tracker", "0"); + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "cl_dlmax", "128"); + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "lefthand", "1"); + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "friends", "0"); + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "dm", "0"); + SET_CLIENT_KEY_VALUE( clientIndex, infobuffer, "ah", "1"); + } + + ClientConnect( BotEnt, c_name, "127.0.0.1", ptr ); + + // Pieter van Dijk - use instead of DispatchSpawn() - Hip Hip Hurray! + ClientPutInServer( BotEnt ); + + BotEnt->v.flags |= FL_FAKECLIENT; + + // initialize all the variables for this bot... + + pBot = &bots[index]; + + pBot->is_used = TRUE; + pBot->respawn_state = RESPAWN_IDLE; + pBot->create_time = gpGlobals->time; + pBot->name[0] = 0; // name not set by server yet + pBot->bot_money = 0; + + strcpy(pBot->skin, c_skin); + + pBot->pEdict = BotEnt; + + pBot->not_started = 1; // hasn't joined game yet + + if (mod_id == TFC_DLL) + pBot->start_action = MSG_TFC_IDLE; + else if (mod_id == CSTRIKE_DLL) + pBot->start_action = MSG_CS_IDLE; + else if ((mod_id == GEARBOX_DLL) && (pent_info_ctfdetect != NULL)) + pBot->start_action = MSG_OPFOR_IDLE; + else if (mod_id == FRONTLINE_DLL) + pBot->start_action = MSG_FLF_IDLE; + else if (mod_id == AVH_DLL) + pBot->start_action = MSG_AVH_IDLE; + else + pBot->start_action = 0; // not needed for non-team MODs + + + BotSpawnInit(pBot); + + pBot->need_to_initialize = FALSE; // don't need to initialize yet + + BotEnt->v.idealpitch = BotEnt->v.v_angle.x; + BotEnt->v.ideal_yaw = BotEnt->v.v_angle.y; + BotEnt->v.pitch_speed = BOT_PITCH_SPEED; + BotEnt->v.yaw_speed = BOT_YAW_SPEED; + + pBot->warmup = 0; // for Front Line Force + pBot->idle_angle = 0.0; + pBot->idle_angle_time = 0.0; + pBot->round_end = 0; + pBot->defender = 0; + + pBot->bot_skill = skill - 1; // 0 based for array indexes + + pBot->bot_team = -1; + pBot->bot_class = -1; + + if ((mod_id == TFC_DLL) || (mod_id == CSTRIKE_DLL) || + ((mod_id == GEARBOX_DLL) && (pent_info_ctfdetect != NULL)) || + (mod_id == FRONTLINE_DLL)) + { + if ((arg1 != NULL) && (arg1[0] != 0)) + { + pBot->bot_team = atoi(arg1); + + if ((arg2 != NULL) && (arg2[0] != 0)) + { + pBot->bot_class = atoi(arg2); + } + } + } + } +} + + +int BotInFieldOfView(bot_t *pBot, Vector dest) +{ + // find angles from source to destination... + Vector entity_angles = UTIL_VecToAngles( dest ); + + // make yaw angle 0 to 360 degrees if negative... + if (entity_angles.y < 0) + entity_angles.y += 360; + + // get bot's current view angle... + float view_angle = pBot->pEdict->v.v_angle.y; + + // make view angle 0 to 360 degrees if negative... + if (view_angle < 0) + view_angle += 360; + + // return the absolute value of angle to destination entity + // zero degrees means straight ahead, 45 degrees to the left or + // 45 degrees to the right is the limit of the normal view angle + + // rsm - START angle bug fix + int angle = abs((int)view_angle - (int)entity_angles.y); + + if (angle > 180) + angle = 360 - angle; + + return angle; + // rsm - END +} + + +bool BotEntityIsVisible( bot_t *pBot, Vector dest ) +{ + TraceResult tr; + + // trace a line from bot's eyes to destination... + UTIL_TraceLine( pBot->pEdict->v.origin + pBot->pEdict->v.view_ofs, + dest, ignore_monsters, + pBot->pEdict->v.pContainingEntity, &tr ); + + // check if line of sight to object is not blocked (i.e. visible) + if (tr.flFraction >= 1.0) + return TRUE; + else + return FALSE; +} + + +void BotFindItem( bot_t *pBot ) +{ + edict_t *pent = NULL; + edict_t *pPickupEntity = NULL; + Vector pickup_origin; + Vector entity_origin; + float radius = 500; + bool can_pickup; + float min_distance; + char item_name[40]; + TraceResult tr; + Vector vecStart; + Vector vecEnd; + int angle_to_entity; + edict_t *pEdict = pBot->pEdict; + + pBot->pBotPickupItem = NULL; + + // use a MUCH smaller search radius when waypoints are available + if ((num_waypoints > 0) && (pBot->curr_waypoint_index != -1)) + radius = 100.0; + else + radius = 500.0; + + min_distance = radius + 1.0; + + while ((pent = UTIL_FindEntityInSphere( pent, pEdict->v.origin, radius )) != NULL) + { + can_pickup = FALSE; // assume can't use it until known otherwise + + strcpy(item_name, STRING(pent->v.classname)); + + // see if this is a "func_" type of entity (func_button, etc.)... + if (strncmp("func_", item_name, 5) == 0) + { + // BModels have 0,0,0 for origin so must use VecBModelOrigin... + entity_origin = VecBModelOrigin(pent); + + vecStart = pEdict->v.origin + pEdict->v.view_ofs; + vecEnd = entity_origin; + + angle_to_entity = BotInFieldOfView( pBot, vecEnd - vecStart ); + + // check if entity is outside field of view (+/- 45 degrees) + if (angle_to_entity > 45) + continue; // skip this item if bot can't "see" it + + // check if entity is a ladder (ladders are a special case) + // DON'T search for ladders if there are waypoints in this level... + if ((strcmp("func_ladder", item_name) == 0) && (num_waypoints == 0)) + { + // force ladder origin to same z coordinate as bot since + // the VecBModelOrigin is the center of the ladder. For + // LONG ladders, the center MAY be hundreds of units above + // the bot. Fake an origin at the same level as the bot... + + entity_origin.z = pEdict->v.origin.z; + vecEnd = entity_origin; + + // trace a line from bot's eyes to func_ladder entity... + UTIL_TraceLine( vecStart, vecEnd, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // check if traced all the way up to the entity (didn't hit wall) + if (tr.flFraction >= 1.0) + { + // find distance to item for later use... + float distance = (vecEnd - vecStart).Length( ); + + // use the ladder about 100% of the time, if haven't + // used a ladder in at least 5 seconds... + if ((RANDOM_LONG(1, 100) <= 100) && + ((pBot->f_end_use_ladder_time + 5.0) < gpGlobals->time)) + { + // if close to ladder... + if (distance < 100) + { + // don't avoid walls for a while + pBot->f_dont_avoid_wall_time = gpGlobals->time + 5.0; + } + + can_pickup = TRUE; + } + } + } + else + { + // trace a line from bot's eyes to func_ entity... + UTIL_TraceLine( vecStart, vecEnd, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // check if traced all the way up to the entity (didn't hit wall) + if (strcmp(item_name, STRING(tr.pHit->v.classname)) == 0) + { + // find distance to item for later use... + float distance = (vecEnd - vecStart).Length( ); + + // check if entity is wall mounted health charger... + if (strcmp("func_healthcharger", item_name) == 0) + { + // check if the bot can use this item and + // check if the recharger is ready to use (has power left)... + if ((pEdict->v.health < 100) && (pent->v.frame == 0)) + { + // check if flag not set... + if (!pBot->b_use_health_station) + { + // check if close enough and facing it directly... + if ((distance < PLAYER_SEARCH_RADIUS) && + (angle_to_entity <= 10)) + { + pBot->b_use_health_station = TRUE; + pBot->f_use_health_time = gpGlobals->time; + } + + // if close to health station... + if (distance < 100) + { + // don't avoid walls for a while + pBot->f_dont_avoid_wall_time = gpGlobals->time + 5.0; + } + + can_pickup = TRUE; + } + } + else + { + // don't need or can't use this item... + pBot->b_use_health_station = FALSE; + } + } + + // check if entity is wall mounted HEV charger... + else if (strcmp("func_recharge", item_name) == 0) + { + // check if the bot can use this item and + // check if the recharger is ready to use (has power left)... + if ((pEdict->v.armorvalue < VALVE_MAX_NORMAL_BATTERY) && + (pent->v.frame == 0)) + { + // check if flag not set and facing it... + if (!pBot->b_use_HEV_station) + { + // check if close enough and facing it directly... + if ((distance < PLAYER_SEARCH_RADIUS) && + (angle_to_entity <= 10)) + { + pBot->b_use_HEV_station = TRUE; + pBot->f_use_HEV_time = gpGlobals->time; + } + + // if close to HEV recharger... + if (distance < 100) + { + // don't avoid walls for a while + pBot->f_dont_avoid_wall_time = gpGlobals->time + 5.0; + } + + can_pickup = TRUE; + } + } + else + { + // don't need or can't use this item... + pBot->b_use_HEV_station = FALSE; + } + } + + // check if entity is a button... + else if (strcmp("func_button", item_name) == 0) + { + // use the button about 100% of the time, if haven't + // used a button in at least 5 seconds... + if ((RANDOM_LONG(1, 100) <= 100) && + ((pBot->f_use_button_time + 5) < gpGlobals->time)) + { + // check if flag not set and facing it... + if (!pBot->b_use_button) + { + // check if close enough and facing it directly... + if ((distance < PLAYER_SEARCH_RADIUS) && + (angle_to_entity <= 10)) + { + pBot->b_use_button = TRUE; + pBot->b_lift_moving = FALSE; + pBot->f_use_button_time = gpGlobals->time; + } + + // if close to button... + if (distance < 100) + { + // don't avoid walls for a while + pBot->f_dont_avoid_wall_time = gpGlobals->time + 5.0; + } + + can_pickup = TRUE; + } + } + else + { + // don't need or can't use this item... + pBot->b_use_button = FALSE; + } + } + } + } + } + else // everything else... + { + entity_origin = pent->v.origin; + + vecStart = pEdict->v.origin + pEdict->v.view_ofs; + vecEnd = entity_origin; + + // find angles from bot origin to entity... + angle_to_entity = BotInFieldOfView( pBot, vecEnd - vecStart ); + + // check if entity is outside field of view (+/- 45 degrees) + if (angle_to_entity > 45) + continue; // skip this item if bot can't "see" it + + // check if line of sight to object is not blocked (i.e. visible) + if (BotEntityIsVisible( pBot, vecEnd )) + { + // check if entity is a weapon... + if (strncmp("weapon_", item_name, 7) == 0) + { + if (pent->v.effects & EF_NODRAW) + { + // someone owns this weapon or it hasn't respawned yet + continue; + } + + can_pickup = TRUE; + } + + // check if entity is ammo... + else if (strncmp("ammo_", item_name, 5) == 0) + { + // check if the item is not visible (i.e. has not respawned) + if (pent->v.effects & EF_NODRAW) + continue; + + can_pickup = TRUE; + } + + // check if entity is a battery... + else if (strcmp("item_battery", item_name) == 0) + { + // check if the item is not visible (i.e. has not respawned) + if (pent->v.effects & EF_NODRAW) + continue; + + // check if the bot can use this item... + if (pEdict->v.armorvalue < VALVE_MAX_NORMAL_BATTERY) + { + can_pickup = TRUE; + } + } + + // check if entity is a healthkit... + else if (strcmp("item_healthkit", item_name) == 0) + { + // check if the item is not visible (i.e. has not respawned) + if (pent->v.effects & EF_NODRAW) + continue; + + // check if the bot can use this item... + if (pEdict->v.health < 100) + { + can_pickup = TRUE; + } + } + + // check if entity is a packed up weapons box... + else if (strcmp("weaponbox", item_name) == 0) + { + can_pickup = TRUE; + } + + // check if entity is the spot from RPG laser + else if (strcmp("laser_spot", item_name) == 0) + { + } + + // check if entity is an armed tripmine + //else if (strcmp("monster_tripmine", item_name) == 0) + else if (strcmp(kwsDeployedMine, item_name) == 0) + { + float distance = (pent->v.origin - pEdict->v.origin).Length( ); + + if (pBot->b_see_tripmine) + { + // see if this tripmine is closer to bot... + if (distance < (pBot->v_tripmine - pEdict->v.origin).Length()) + { + pBot->v_tripmine = pent->v.origin; + pBot->b_shoot_tripmine = FALSE; + + // see if bot is far enough to shoot the tripmine... + if (distance >= 375) + { + pBot->b_shoot_tripmine = TRUE; + } + } + } + else + { + pBot->b_see_tripmine = TRUE; + pBot->v_tripmine = pent->v.origin; + pBot->b_shoot_tripmine = FALSE; + + // see if bot is far enough to shoot the tripmine... + if (distance >= 375) // 375 is damage radius + { + pBot->b_shoot_tripmine = TRUE; + } + } + } + + // check if entity is an armed satchel charge + else if (strcmp("monster_satchel", item_name) == 0) + { + } + + // check if entity is a snark (squeak grenade) + else if (strcmp("monster_snark", item_name) == 0) + { + } + + else if ((mod_id == FRONTLINE_DLL) && (!pBot->defender) && + (strcmp("capture_point", item_name) == 0)) + { + int team = UTIL_GetTeam(pEdict); // skin and team must match + + if (flf_bug_fix) + team = 1 - team; // BACKWARDS bug! + + // check if flag not set and point not captured... + if ((!pBot->b_use_capture) && (pent->v.skin == team)) + { + float distance = (pent->v.origin - pEdict->v.origin).Length( ); + + // check if close enough and facing it directly... + if ((distance < FLF_PLAYER_SEARCH_RADIUS) && + (angle_to_entity <= 20)) + { + pBot->b_use_capture = TRUE; + pBot->f_use_capture_time = gpGlobals->time + 8.0; + pBot->pCaptureEdict = pent; + } + + // if close to capture point... + if (distance < 160) + { + // don't avoid walls for a while + pBot->f_dont_avoid_wall_time = gpGlobals->time + 5.0; + } + + can_pickup = TRUE; + } + } + + } // end if object is visible + } // end else not "func_" entity + + if (can_pickup) // if the bot found something it can pickup... + { + float distance = (entity_origin - pEdict->v.origin).Length( ); + + // see if it's the closest item so far... + if (distance < min_distance) + { + min_distance = distance; // update the minimum distance + pPickupEntity = pent; // remember this entity + pickup_origin = entity_origin; // remember location of entity + } + } + } // end while loop + + if (pPickupEntity != NULL) + { + // let's head off toward that item... + Vector v_item = pickup_origin - pEdict->v.origin; + + Vector bot_angles = UTIL_VecToAngles( v_item ); + + pEdict->v.ideal_yaw = bot_angles.y; + + BotFixIdealYaw(pEdict); + + pBot->pBotPickupItem = pPickupEntity; // save the item bot is trying to get + } +} + + +void BotThink( bot_t *pBot ) +{ + int index = 0; + Vector v_diff; // vector from previous to current location + float pitch_degrees; + float yaw_degrees; + float moved_distance; // length of v_diff vector (distance bot moved) + TraceResult tr; + bool found_waypoint; + bool is_idle; + + edict_t *pEdict = pBot->pEdict; + + + pEdict->v.flags |= FL_FAKECLIENT; + + if (pBot->name[0] == 0) // name filled in yet? + strcpy(pBot->name, STRING(pBot->pEdict->v.netname)); + + +// TheFatal - START from Advanced Bot Framework (Thanks Rich!) + + // adjust the millisecond delay based on the frame rate interval... + if (pBot->msecdel <= gpGlobals->time) + { + pBot->msecdel = gpGlobals->time + 0.5; + if (pBot->msecnum > 0) + pBot->msecval = 450.0/pBot->msecnum; + pBot->msecnum = 0; + } + else + pBot->msecnum++; + + if (pBot->msecval < 1) // don't allow msec to be less than 1... + pBot->msecval = 1; + + if (pBot->msecval > 100) // ...or greater than 100 + pBot->msecval = 100; + +// TheFatal - END + + + pEdict->v.button = 0; + pBot->f_move_speed = 0.0; + + if(pBot->mBotPlayMode == PLAYMODE_READYROOM) + { + // Look at desired team and head to nearest start entity + AvHClassType theClassType = AVH_CLASS_TYPE_UNDEFINED; + + FakeClientCommand(pEdict, kcAutoAssign, NULL, NULL); + + // bot has now joined the game (doesn't need to be started) + pBot->not_started = 0; + } + + // if the bot hasn't selected stuff to start the game yet, go do that... + if (pBot->not_started) + { + BotStartGame( pBot ); + + // Do this to test server performance + //return; + + g_engfuncs.pfnRunPlayerMove( pEdict, pEdict->v.v_angle, 0.0, + 0, 0, pEdict->v.button, 0, pBot->msecval); + + //return; + } + + if((pBot->mOrderType != ORDERTYPE_UNDEFINED) && (!pBot->mOrderCompleted)) + { + // Every once in a while mention our order + if(RANDOM_LONG(0, 200) == 0) + { + char theMessage[256]; + sprintf(theMessage, "Order type: %d, target type: %d\n", pBot->mOrderType, pBot->mOrderTargetType); + //UTIL_HostSay(pBot->pEdict, 0, theMessage); + } + } + else + { + // Occasionally ask for orders when not doing anything else + if(RANDOM_LONG(0, 1800) == 0) + { + if(pBot->mTimeOfNextOrderRequest == -1) + { + pBot->mTimeOfNextOrderRequest = gpGlobals->time; + } + } + } + + if(RANDOM_LONG(0, 1000)) + { + pBot->mTimeOfNextRandomSaying = gpGlobals->time; + } + + // If we're out of ammo, occasionally ask for more + // Get current weapon + int theWeaponID = pBot->current_weapon.iId; + if(theWeaponID > 0) + { + if((pBot->current_weapon.iAmmo1 != -1) && (pBot->current_weapon.iClip <= 10)) + { + if(RANDOM_LONG(0, 40)) + { + if(pBot->mTimeOfNextAmmoRequest == -1) + { + pBot->mTimeOfNextAmmoRequest = gpGlobals->time; + } + } + } + } + + + if ((pBot->b_bot_say_killed) && (pBot->f_bot_say_killed < gpGlobals->time)) + { + int whine_index = 0; + bool used; + int i, recent_count; + char msg[120]; + + pBot->b_bot_say_killed = FALSE; + + recent_count = 0; + + while (recent_count < 5) + { + whine_index = RANDOM_LONG(0, whine_count-1); + + used = FALSE; + + for (i=0; i < 5; i++) + { + if (recent_bot_whine[i] == whine_index) + used = TRUE; + } + + if (used) + recent_count++; + else + break; + } + + for (i=4; i > 0; i--) + recent_bot_whine[i] = recent_bot_whine[i-1]; + + recent_bot_whine[0] = whine_index; + + if (strstr(bot_whine[whine_index], "%s") != NULL) // is "%s" in whine text? + sprintf(msg, bot_whine[whine_index], STRING(pBot->killer_edict->v.netname)); + else + sprintf(msg, bot_whine[whine_index]); + + UTIL_HostSay(pEdict, 0, msg); + } + + // if the bot is dead, randomly press fire to respawn... + if ((pEdict->v.health < 1) || (pEdict->v.deadflag != DEAD_NO)) + { + if (pBot->need_to_initialize) + { + BotSpawnInit(pBot); + + // did another player kill this bot AND bot whine messages loaded AND + // has the bot been alive for at least 15 seconds AND + if ((pBot->killer_edict != NULL) && (whine_count > 0) && + ((pBot->f_bot_spawn_time + 15.0) <= gpGlobals->time)) + { + if ((RANDOM_LONG(1,100) <= 10)) + { + pBot->b_bot_say_killed = TRUE; + pBot->f_bot_say_killed = gpGlobals->time + 10.0 + RANDOM_FLOAT(0.0, 5.0); + } + } + + pBot->need_to_initialize = FALSE; + } + + if (RANDOM_LONG(1, 100) > 50) + pEdict->v.button = IN_ATTACK; + + g_engfuncs.pfnRunPlayerMove( pEdict, pEdict->v.v_angle, pBot->f_move_speed, + 0, 0, pEdict->v.button, 0, pBot->msecval); + + return; + } + + // set this for the next time the bot dies so it will initialize stuff + if (pBot->need_to_initialize == FALSE) + { + pBot->need_to_initialize = TRUE; + pBot->f_bot_spawn_time = gpGlobals->time; + } + + is_idle = FALSE; + + if ((mod_id == FRONTLINE_DLL) && (pBot->round_end)) + { + if (pBot->warmup) // has warmup started (i.e. start of round?) + { + pBot->round_end = 0; + + BotSpawnInit(pBot); + } + + is_idle = TRUE; + + flf_bug_fix = 0; // BACKWARDS bug off now! + } + + if ((mod_id == FRONTLINE_DLL) && (pBot->warmup) && (!pBot->defender)) + { + if (pBot->curr_waypoint_index == -1) + { + // find the nearest visible waypoint + int i = WaypointFindNearest(pEdict, REACHABLE_RANGE, pBot->defender); + + if (i != -1) + { + Vector v_direction = waypoints[i].origin - pEdict->v.origin; + + Vector bot_angles = UTIL_VecToAngles( v_direction ); + + pBot->idle_angle = bot_angles.y; + } + else + pBot->idle_angle = pEdict->v.v_angle.y; + } + + is_idle = TRUE; + } + + if (pBot->blinded_time > gpGlobals->time) + { + is_idle = TRUE; // don't do anything while blinded + } + + if(CVAR_GET_FLOAT("freezebots") > 0) + { + return; // Don't move. + } + + if (is_idle) + { + if (pBot->idle_angle_time <= gpGlobals->time) + { + pBot->idle_angle_time = gpGlobals->time + RANDOM_FLOAT(0.5, 2.0); + + pEdict->v.ideal_yaw = pBot->idle_angle + RANDOM_FLOAT(0.0, 40.0) - 20.0; + + BotFixIdealYaw(pEdict); + } + + // turn towards ideal_yaw by yaw_speed degrees (slower than normal) + BotChangeYaw( pBot, pEdict->v.yaw_speed / 2 ); + + g_engfuncs.pfnRunPlayerMove( pEdict, pEdict->v.v_angle, pBot->f_move_speed, + 0, 0, pEdict->v.button, 0, pBot->msecval); + + return; + } + else + { + pBot->idle_angle = pEdict->v.v_angle.y; + } + + // check if time to check for player sounds (if don't already have enemy) + if ((pBot->f_sound_update_time <= gpGlobals->time) && + (pBot->pBotEnemy == NULL)) + { + int ind; + edict_t *pPlayer; + + pBot->f_sound_update_time = gpGlobals->time + 1.0; + + for (ind = 1; ind <= gpGlobals->maxClients; ind++) + { + pPlayer = INDEXENT(ind); + + // is this player slot is valid and it's not this bot... + if ((pPlayer) && (!pPlayer->free) && (pPlayer != pEdict)) + { + // if observer mode enabled, don't listen to this player... + if ((b_observer_mode) && !(pPlayer->v.flags & FL_FAKECLIENT)) + continue; + + if (IsAlive(pPlayer) && + (FBitSet(pPlayer->v.flags, FL_CLIENT) || + FBitSet(pPlayer->v.flags, FL_FAKECLIENT))) + { + // check for sounds being made by other players... + if (UpdateSounds(pEdict, pPlayer)) + { + // don't check for sounds for another 30 seconds + pBot->f_sound_update_time = gpGlobals->time + 30.0; + } + } + } + } + } + + pBot->f_move_speed = pBot->f_max_speed; // set to max speed + + if (pBot->prev_time <= gpGlobals->time) + { + // see how far bot has moved since the previous position... + v_diff = pBot->v_prev_origin - pEdict->v.origin; + moved_distance = v_diff.Length(); + + // save current position as previous + pBot->v_prev_origin = pEdict->v.origin; + pBot->prev_time = gpGlobals->time + 0.2; + } + else + { + moved_distance = 2.0; + } + + // if the bot is under water, adjust pitch by pitch_speed degrees + if ((pEdict->v.waterlevel == 2) || + (pEdict->v.waterlevel == 3)) + { + // turn towards ideal_pitch by pitch_speed degrees + pitch_degrees = BotChangePitch( pBot, pEdict->v.pitch_speed ); + } + else + pitch_degrees = 0.0; + + // turn towards ideal_yaw by yaw_speed degrees + yaw_degrees = BotChangeYaw( pBot, pEdict->v.yaw_speed ); + + if ((pitch_degrees >= pEdict->v.pitch_speed) || + (yaw_degrees >= pEdict->v.yaw_speed)) + { + pBot->f_move_speed = 0.0; // don't move while turning a lot + } + else if ((pitch_degrees >= 10) || + (yaw_degrees >= 10)) // turning more than 10 degrees? + { + pBot->f_move_speed = pBot->f_move_speed / 4; // slow down while turning + } + else // else handle movement related actions... + { + if (b_botdontshoot == 0) + { + if ((mod_id == TFC_DLL) && (pBot->bot_has_flag == TRUE)) + { + // is it time to check whether bot should look for enemies yet? + if (pBot->f_bot_find_enemy_time <= gpGlobals->time) + { + pBot->f_bot_find_enemy_time = gpGlobals->time + 5.0; + + if (RANDOM_LONG(1, 100) <= 40) + pBot->pBotEnemy = BotFindEnemy( pBot ); + } + } + else + { + // Now that bots scan every entity in the world, do this less often + if(RANDOM_LONG(1, 100) <= 20) + { + pBot->pBotEnemy = BotFindEnemy( pBot ); + } + } + } + else + pBot->pBotEnemy = NULL; // clear enemy pointer (no ememy for you!) + + if (pBot->pBotEnemy != NULL) // does an enemy exist? + { + BotShootAtEnemy( pBot ); // shoot at the enemy + + pBot->f_pause_time = 0; // dont't pause if enemy exists + } + + else if (pBot->f_pause_time > gpGlobals->time) // is bot "paused"? + { + // you could make the bot look left then right, or look up + // and down, to make it appear that the bot is hunting for + // something (don't do anything right now) + } + + // is bot being "used" and can still follow "user"? + else if ((pBot->pBotUser != NULL) && BotFollowUser( pBot )) + { + // do nothing here! + ; + } + + else + { + // no enemy, let's just wander around... + + if ((pEdict->v.waterlevel != 2) && // is bot NOT under water? + (pEdict->v.waterlevel != 3)) + { + // reset pitch to 0 (level horizontally) + pEdict->v.idealpitch = 0; + pEdict->v.v_angle.x = 0; + } + + pEdict->v.v_angle.z = 0; // reset roll to 0 (straight up and down) + + pEdict->v.angles.x = 0; + pEdict->v.angles.y = pEdict->v.v_angle.y; + pEdict->v.angles.z = 0; + + // check if bot should look for items now or not... + if (pBot->f_find_item < gpGlobals->time) + { + BotFindItem( pBot ); // see if there are any visible items + } + + // check if bot sees a tripmine... + if (pBot->b_see_tripmine) + { + // check if bot can shoot the tripmine... + if ((pBot->b_shoot_tripmine) && BotShootTripmine( pBot )) + { + // shot at tripmine, may or may not have hit it, clear + // flags anyway, next BotFindItem will see it again if + // it is still there... + + pBot->b_shoot_tripmine = FALSE; + pBot->b_see_tripmine = FALSE; + + // pause for a while to allow tripmine to explode... + pBot->f_pause_time = gpGlobals->time + 0.5; + } + else // run away!!! + { + Vector tripmine_angles; + + tripmine_angles = UTIL_VecToAngles( pBot->v_tripmine - pEdict->v.origin ); + + // face away from the tripmine + pEdict->v.ideal_yaw += 180; // rotate 180 degrees + + BotFixIdealYaw(pEdict); + + pBot->b_see_tripmine = FALSE; + + pBot->f_move_speed = 0; // don't run while turning + } + } + + // check if should use wall mounted health station... + else if (pBot->b_use_health_station) + { + if ((pBot->f_use_health_time + 10.0) > gpGlobals->time) + { + pBot->f_move_speed = 0; // don't move while using health station + + pEdict->v.button = IN_USE; + } + else + { + // bot is stuck trying to "use" a health station... + + pBot->b_use_health_station = FALSE; + + // don't look for items for a while since the bot + // could be stuck trying to get to an item + pBot->f_find_item = gpGlobals->time + 0.5; + } + } + + // check if should use wall mounted HEV station... + else if (pBot->b_use_HEV_station) + { + if ((pBot->f_use_HEV_time + 10.0) > gpGlobals->time) + { + pBot->f_move_speed = 0; // don't move while using HEV station + + pEdict->v.button = IN_USE; + } + else + { + // bot is stuck trying to "use" a HEV station... + + pBot->b_use_HEV_station = FALSE; + + // don't look for items for a while since the bot + // could be stuck trying to get to an item + pBot->f_find_item = gpGlobals->time + 0.5; + } + } + + // check if should capture a point by using it... + else if (pBot->b_use_capture) + { + int team = UTIL_GetTeam(pEdict); // skin and team must match + + if (flf_bug_fix) + team = 1 - team; // BACKWARDS bug fix! + + // still capturing and hasn't captured yet... + if ((pBot->f_use_capture_time > gpGlobals->time) && + (pBot->pCaptureEdict->v.skin == team)) + { + pBot->f_move_speed = 0; // don't move while capturing + + pEdict->v.button = IN_USE; + } + else + { + // bot is stuck trying to "use" a capture point... + + pBot->b_use_capture = FALSE; + + // don't look for items for a while since the bot + // could be stuck trying to get to an item + pBot->f_find_item = gpGlobals->time + 0.5; + } + } + + else if (pBot->b_use_button) + { + pBot->f_move_speed = 0; // don't move while using elevator + + BotUseLift( pBot, moved_distance ); + } + + else + { + if (pEdict->v.waterlevel == 3) // check if the bot is underwater... + { + BotUnderWater( pBot ); + } + + found_waypoint = FALSE; + + // if the bot is not trying to get to something AND + // it is time to look for a waypoint AND + // there are waypoints in this level... + + if ((pBot->pBotPickupItem == NULL) && + (pBot->f_look_for_waypoint_time <= gpGlobals->time) && + (num_waypoints != 0)) + { + found_waypoint = BotHeadTowardWaypoint(pBot); + } + + // check if the bot is on a ladder... + if (pEdict->v.movetype == MOVETYPE_FLY) + { + // check if bot JUST got on the ladder... + if ((pBot->f_end_use_ladder_time + 1.0) < gpGlobals->time) + pBot->f_start_use_ladder_time = gpGlobals->time; + + // go handle the ladder movement + BotOnLadder( pBot, moved_distance ); + + pBot->f_dont_avoid_wall_time = gpGlobals->time + 2.0; + pBot->f_end_use_ladder_time = gpGlobals->time; + } + else + { + // check if the bot JUST got off the ladder... + if ((pBot->f_end_use_ladder_time + 1.0) > gpGlobals->time) + { + pBot->ladder_dir = LADDER_UNKNOWN; + } + } + + // if the bot isn't headed toward a waypoint... + if (found_waypoint == FALSE) + { + TraceResult tr; + + // check if we should be avoiding walls + if (pBot->f_dont_avoid_wall_time <= gpGlobals->time) + { + // let's just randomly wander around + if (BotStuckInCorner( pBot )) + { + pEdict->v.ideal_yaw += 180; // turn 180 degrees + + BotFixIdealYaw(pEdict); + + pBot->f_move_speed = 0; // don't move while turning + pBot->f_dont_avoid_wall_time = gpGlobals->time + 1.0; + + moved_distance = 2.0; // dont use bot stuck code + } + else + { + // check if there is a wall on the left... + if (!BotCheckWallOnLeft( pBot )) + { + // if there was a wall on the left over 1/2 a second ago then + // 20% of the time randomly turn between 45 and 60 degrees + + if ((pBot->f_wall_on_left != 0) && + (pBot->f_wall_on_left <= gpGlobals->time - 0.5) && + (RANDOM_LONG(1, 100) <= 20)) + { + pEdict->v.ideal_yaw += RANDOM_LONG(45, 60); + + BotFixIdealYaw(pEdict); + + pBot->f_move_speed = 0; // don't move while turning + pBot->f_dont_avoid_wall_time = gpGlobals->time + 1.0; + } + + pBot->f_wall_on_left = 0; // reset wall detect time + } + else if (!BotCheckWallOnRight( pBot )) + { + // if there was a wall on the right over 1/2 a second ago then + // 20% of the time randomly turn between 45 and 60 degrees + + if ((pBot->f_wall_on_right != 0) && + (pBot->f_wall_on_right <= gpGlobals->time - 0.5) && + (RANDOM_LONG(1, 100) <= 20)) + { + pEdict->v.ideal_yaw -= RANDOM_LONG(45, 60); + + BotFixIdealYaw(pEdict); + + pBot->f_move_speed = 0; // don't move while turning + pBot->f_dont_avoid_wall_time = gpGlobals->time + 1.0; + } + + pBot->f_wall_on_right = 0; // reset wall detect time + } + } + } + + // check if bot is about to hit a wall. TraceResult gets returned + if ((pBot->f_dont_avoid_wall_time <= gpGlobals->time) && + BotCantMoveForward( pBot, &tr )) + { + // ADD LATER + // need to check if bot can jump up or duck under here... + // ADD LATER + + BotTurnAtWall( pBot, &tr ); + } + } + + // check if bot is on a ladder and has been on a ladder for + // more than 5 seconds... + if ((pEdict->v.movetype == MOVETYPE_FLY) && + (pBot->f_start_use_ladder_time > 0.0) && + ((pBot->f_start_use_ladder_time + 5.0) <= gpGlobals->time)) + { + // bot is stuck on a ladder... + + BotRandomTurn(pBot); + + // don't look for items for 2 seconds + pBot->f_find_item = gpGlobals->time + 2.0; + + pBot->f_start_use_ladder_time = 0.0; // reset start ladder time + } + + // check if the bot hasn't moved much since the last location + // (and NOT on a ladder since ladder stuck handled elsewhere) + // (don't check for stuck if f_dont_check_stuck in the future) + if ((moved_distance <= 1.0) && (pBot->prev_speed >= 1.0) && + (pEdict->v.movetype != MOVETYPE_FLY) && + (pBot->f_dont_check_stuck < gpGlobals->time)) + { + // the bot must be stuck! + + pBot->f_dont_avoid_wall_time = gpGlobals->time + 1.0; + pBot->f_look_for_waypoint_time = gpGlobals->time + 1.0; + + if (BotCanJumpUp( pBot )) // can the bot jump onto something? + { + if ((pBot->f_jump_time + 2.0) <= gpGlobals->time) + { + pBot->f_jump_time = gpGlobals->time; + pEdict->v.button |= IN_JUMP; // jump up and move forward + } + else + { + // bot already tried jumping less than two seconds ago, just turn + BotRandomTurn(pBot); + } + } + else if (BotCanDuckUnder( pBot )) // can the bot duck under something? + { + pEdict->v.button |= IN_DUCK; // duck down and move forward + } + else + { + BotRandomTurn(pBot); + + // is the bot trying to get to an item?... + if (pBot->pBotPickupItem != NULL) + { + // don't look for items for a while since the bot + // could be stuck trying to get to an item + pBot->f_find_item = gpGlobals->time + 0.5; + } + } + } + + // should the bot pause for a while here? + // (don't pause on ladders or while being "used"... + if ((RANDOM_LONG(1, 1000) <= pause_frequency[pBot->bot_skill]) && + (pEdict->v.movetype != MOVETYPE_FLY) && + (pBot->pBotUser == NULL)) + { + // set the time that the bot will stop "pausing" + pBot->f_pause_time = gpGlobals->time + + RANDOM_FLOAT(pause_time[pBot->bot_skill][0], + pause_time[pBot->bot_skill][1]); + } + } + } + } + + // Potentially morph up if we're an alien + AvHUser3 theUser3 = (AvHUser3)(pBot->pEdict->v.iuser3); + if((pBot->pBotEnemy == NULL) && (theUser3 >= AVH_USER3_ALIEN_PLAYER1) && (theUser3 <= AVH_USER3_ALIEN_PLAYER4)) + { + int theMaxUpgrade = (int)(AVH_USER3_ALIEN_PLAYER5 - theUser3); + //const UpgradeCostListType& theUpgradeCosts = GetGameRules()->GetUpgradeCosts(); + + if(RANDOM_LONG(0, 400) == 0) + { + // Pick a random upgrade + AvHUser3 theMinUpgrade = (AvHUser3)(theUser3 + 1); + int theMaxUpgrade = AVH_USER3_ALIEN_PLAYER5; + AvHUser3 theUpgradeUser3 = (AvHUser3)(RANDOM_LONG((int)theMinUpgrade, (int)theMaxUpgrade)); + int thePointCost = 0; + AvHMessageID theMessage = MESSAGE_NULL; + switch(theUpgradeUser3) + { + case AVH_USER3_ALIEN_PLAYER2: + thePointCost = 15; + theMessage = ALIEN_LIFEFORM_TWO; + break; + case AVH_USER3_ALIEN_PLAYER3: + thePointCost = 30; + theMessage = ALIEN_LIFEFORM_THREE; + break; + case AVH_USER3_ALIEN_PLAYER4: + thePointCost = 50; + theMessage = ALIEN_LIFEFORM_FOUR; + break; + case AVH_USER3_ALIEN_PLAYER5: + thePointCost = 75; + theMessage = ALIEN_LIFEFORM_FIVE; + break; + } + + //thePointCost = GetGameRules()->GetPointCostForMessageID(theMessage); + + //if(pBot->mResources >= thePointCost) + //{ + pBot->pEdict->v.impulse = theMessage; + //} + } + + if(RANDOM_LONG(0, 75) == 0) + { + // Pick a random upgrade to try to "buy" + AvHMessageID theUpgrade = (AvHMessageID)(ALIEN_EVOLUTION_ONE + RANDOM_LONG(0, kNumAlienUpgrades-1)); + pBot->pEdict->v.impulse = theUpgrade; + } + } + + // TODO: Help build a nearby team structure + if(pBot->pBotEnemy == NULL && (theUser3 == AVH_USER3_MARINE_PLAYER)) + { + } + + if (pBot->curr_waypoint_index != -1) // does the bot have a waypoint? + { + // check if the next waypoint is a door waypoint... + if (waypoints[pBot->curr_waypoint_index].flags & W_FL_DOOR) + { + pBot->f_move_speed = pBot->f_max_speed / 3; // slow down for doors + } + + // check if the next waypoint is a ladder waypoint... + if (waypoints[pBot->curr_waypoint_index].flags & W_FL_LADDER) + { + // check if the waypoint is at the top of a ladder AND + // the bot isn't currenly on a ladder... + if ((pBot->waypoint_top_of_ladder) && + (pEdict->v.movetype != MOVETYPE_FLY)) + { + // is the bot on "ground" above the ladder? + if (pEdict->v.flags & FL_ONGROUND) + { + float waypoint_distance = (pEdict->v.origin - pBot->waypoint_origin).Length(); + + if (waypoint_distance <= 20.0) // if VERY close... + pBot->f_move_speed = 20.0; // go VERY slow + else if (waypoint_distance <= 100.0) // if fairly close... + pBot->f_move_speed = 50.0; // go fairly slow + + pBot->ladder_dir = LADDER_DOWN; + pBot->f_dont_check_stuck = gpGlobals->time + 1.0; + } + else // bot must be in mid-air, go BACKWARDS to touch ladder... + { + pBot->f_move_speed = -pBot->f_max_speed; + } + } + else + { + // don't avoid walls for a while + pBot->f_dont_avoid_wall_time = gpGlobals->time + 5.0; + + pBot->waypoint_top_of_ladder = FALSE; + } + } + + // check if the next waypoint is a crouch waypoint... + if (waypoints[pBot->curr_waypoint_index].flags & W_FL_CROUCH) + pEdict->v.button |= IN_DUCK; // duck down while moving forward + + // check if the waypoint is a sniper waypoint AND + // bot isn't currently aiming at an ememy... + if ((waypoints[pBot->curr_waypoint_index].flags & W_FL_SNIPER) && + (pBot->pBotEnemy == NULL)) + { + if ((mod_id != TFC_DLL) || + ((mod_id == TFC_DLL) && (pEdict->v.playerclass == TFC_CLASS_SNIPER))) + { + // check if it's time to adjust aim yet... + if (pBot->f_sniper_aim_time <= gpGlobals->time) + { + int aim_index; + + aim_index = WaypointFindNearestAiming(waypoints[pBot->curr_waypoint_index].origin); + + if (aim_index != -1) + { + Vector v_aim = waypoints[aim_index].origin - waypoints[pBot->curr_waypoint_index].origin; + + Vector aim_angles = UTIL_VecToAngles( v_aim ); + + aim_angles.y += RANDOM_LONG(0, 30) - 15; + + pEdict->v.ideal_yaw = aim_angles.y; + + BotFixIdealYaw(pEdict); + } + + // don't adjust aim again until after a few seconds... + pBot->f_sniper_aim_time = gpGlobals->time + RANDOM_FLOAT(3.0, 5.0); + } + } + } + } + + // Process voice commands + BotProcessVoiceCommands(pBot); + + if (pBot->f_pause_time > gpGlobals->time) // is the bot "paused"? + pBot->f_move_speed = 0; // don't move while pausing + + // make the body face the same way the bot is looking + pEdict->v.angles.y = pEdict->v.v_angle.y; + + // save the previous speed (for checking if stuck) + pBot->prev_speed = pBot->f_move_speed; + + //CBaseEntity* theEntity = CBaseEntity::Instance(pEdict); + //CBasePlayer* thePlayer = (CBasePlayer*)(theEntity); + //thePlayer->PreThink(); + + g_engfuncs.pfnRunPlayerMove( pEdict, pEdict->v.v_angle, pBot->f_move_speed, + 0, 0, pEdict->v.button, 0, pBot->msecval); + + //thePlayer->PostThink(); + + return; +} + diff --git a/main/source/HPB_bot/dlls/bot.h b/main/source/HPB_bot/dlls/bot.h new file mode 100644 index 00000000..8687d3ab --- /dev/null +++ b/main/source/HPB_bot/dlls/bot.h @@ -0,0 +1,309 @@ +// +// HPB_bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// bot.h +// + +#ifndef BOT_H +#define BOT_H + +// stuff for Win32 vs. Linux builds + +#ifndef __linux__ + +typedef int (FAR *GETENTITYAPI)(DLL_FUNCTIONS *, int); +typedef int (FAR *GETNEWDLLFUNCTIONS)(NEW_DLL_FUNCTIONS *, int *); +typedef void (DLLEXPORT *GIVEFNPTRSTODLL)(enginefuncs_t *, globalvars_t *); +typedef void (FAR *LINK_ENTITY_FUNC)(entvars_t *); + +#else + +#include +#define GetProcAddress dlsym + +typedef int BOOL; + +typedef int (*GETENTITYAPI)(DLL_FUNCTIONS *, int); +typedef int (*GETNEWDLLFUNCTIONS)(NEW_DLL_FUNCTIONS *, int *); +typedef void (*GIVEFNPTRSTODLL)(enginefuncs_t *, globalvars_t *); +typedef void (*LINK_ENTITY_FUNC)(entvars_t *); + +#endif + + + +// define constants used to identify the MOD we are playing... + +#define VALVE_DLL 1 +#define TFC_DLL 2 +#define CSTRIKE_DLL 3 +#define GEARBOX_DLL 4 +#define FRONTLINE_DLL 5 +#define AVH_DLL 6 + + +// define some function prototypes... +BOOL ClientConnect( edict_t *pEntity, const char *pszName, + const char *pszAddress, char szRejectReason[ 128 ] ); +void ClientPutInServer( edict_t *pEntity ); +void ClientCommand( edict_t *pEntity ); + +void FakeClientCommand(edict_t *pBot, char *arg1, char *arg2, char *arg3); + + +const char *Cmd_Args( void ); +const char *Cmd_Argv( int argc ); +int Cmd_Argc( void ); + + +#define LADDER_UNKNOWN 0 +#define LADDER_UP 1 +#define LADDER_DOWN 2 + +#define WANDER_LEFT 1 +#define WANDER_RIGHT 2 + +#define BOT_PITCH_SPEED 20 +#define BOT_YAW_SPEED 20 + +#define RESPAWN_IDLE 1 +#define RESPAWN_NEED_TO_RESPAWN 2 +#define RESPAWN_IS_RESPAWNING 3 + +// game start messages for TFC... +#define MSG_TFC_IDLE 1 +#define MSG_TFC_TEAM_SELECT 2 +#define MSG_TFC_CLASS_SELECT 3 + +// game start messages for CS... +#define MSG_CS_IDLE 1 +#define MSG_CS_TEAM_SELECT 2 +#define MSG_CS_CT_SELECT 3 +#define MSG_CS_T_SELECT 4 + +// game start messages for OpFor... +#define MSG_OPFOR_IDLE 1 +#define MSG_OPFOR_TEAM_SELECT 2 +#define MSG_OPFOR_CLASS_SELECT 3 + +// game start messages for FrontLineForce... +#define MSG_FLF_IDLE 1 +#define MSG_FLF_TEAM_SELECT 2 +#define MSG_FLF_CLASS_SELECT 3 +#define MSG_FLF_PISTOL_SELECT 4 +#define MSG_FLF_WEAPON_SELECT 5 +#define MSG_FLF_RIFLE_SELECT 6 +#define MSG_FLF_SHOTGUN_SELECT 7 +#define MSG_FLF_SUBMACHINE_SELECT 8 +#define MSG_FLF_HEAVYWEAPONS_SELECT 9 + +// game start messages for Aliens vs. Humans... +#define MSG_AVH_IDLE 1 + +#define TFC_CLASS_CIVILIAN 0 +#define TFC_CLASS_SCOUT 1 +#define TFC_CLASS_SNIPER 2 +#define TFC_CLASS_SOLDIER 3 +#define TFC_CLASS_DEMOMAN 4 +#define TFC_CLASS_MEDIC 5 +#define TFC_CLASS_HWGUY 6 +#define TFC_CLASS_PYRO 7 +#define TFC_CLASS_SPY 8 +#define TFC_CLASS_ENGINEER 9 + + +#define BOT_SKIN_LEN 32 +#define BOT_NAME_LEN 32 + +#define MAX_BOT_WHINE 100 + +#include "mod/AvHConstants.h" +#include "mod/AvHSpecials.h" + +typedef struct +{ + int iId; // weapon ID + int iClip; // amount of ammo in the clip + int iAmmo1; // amount of ammo in primary reserve + int iAmmo2; // amount of ammo in secondary reserve +} bot_current_weapon_t; + + +typedef struct +{ + bool is_used; + int respawn_state; + edict_t *pEdict; + bool need_to_initialize; + char name[BOT_NAME_LEN+1]; + char skin[BOT_SKIN_LEN+1]; + int bot_skill; + int not_started; + int start_action; + float kick_time; + float create_time; + +// TheFatal - START + int msecnum; + float msecdel; + float msecval; +// TheFatal - END + + // things from pev in CBasePlayer... + int bot_team; + int bot_class; + int bot_health; + int bot_armor; + int bot_weapons; // bit map of weapons the bot is carrying + int bot_money; // for Counter-Strike + int primary_weapon; // for Front Line Force + int secondary_weapon; // for Front Line Force + int defender; // for Front Line Force + int warmup; // for Front Line Force + float idle_angle; + float idle_angle_time; // for Front Line Force + int round_end; // round has ended (in round based games) + float blinded_time; + + // For AvH + AvHPlayMode mBotPlayMode; + + int mOrderState; + int mOrderNumPlayers; + AvHOrderType mOrderType; + AvHOrderTargetType mOrderTargetType; + float mOrderLocation[3]; + int mOrderTargetIndex; + bool mOrderCompleted; + + float mTimeOfNextTaunt; + float mTimeOfNextAmmoRequest; + float mTimeOfNextOrderRequest; + float mTimeOfNextAcknowledge; + float mTimeOfNextRandomSaying; + + AvHUser3 mGestateUser3; + int mResources; + // end for AvH + + float f_max_speed; + float prev_speed; + float prev_time; + Vector v_prev_origin; + + float f_find_item; + edict_t *pBotPickupItem; + + int ladder_dir; + float f_start_use_ladder_time; + float f_end_use_ladder_time; + bool waypoint_top_of_ladder; + + float f_wall_check_time; + float f_wall_on_right; + float f_wall_on_left; + float f_dont_avoid_wall_time; + float f_look_for_waypoint_time; + float f_jump_time; + float f_dont_check_stuck; + + int wander_dir; + float f_exit_water_time; + + Vector waypoint_origin; + float f_waypoint_time; + int curr_waypoint_index; + int prev_waypoint_index[5]; + float f_random_waypoint_time; + int waypoint_goal; + float f_waypoint_goal_time; + bool waypoint_near_flag; + Vector waypoint_flag_origin; + float prev_waypoint_distance; + + edict_t *pBotEnemy; + float f_bot_see_enemy_time; + float f_bot_find_enemy_time; + edict_t *pBotUser; + float f_bot_use_time; + float f_bot_spawn_time; + edict_t *killer_edict; + bool b_bot_say_killed; + float f_bot_say_killed; + float f_sniper_aim_time; + + + float f_shoot_time; + float f_primary_charging; + float f_secondary_charging; + int charging_weapon_id; + float f_move_speed; + float f_pause_time; + float f_sound_update_time; + bool bot_has_flag; + + bool b_see_tripmine; + bool b_shoot_tripmine; + Vector v_tripmine; + + bool b_use_health_station; + float f_use_health_time; + bool b_use_HEV_station; + float f_use_HEV_time; + + bool b_use_button; + float f_use_button_time; + bool b_lift_moving; + + bool b_use_capture; + float f_use_capture_time; + edict_t *pCaptureEdict; + + bot_current_weapon_t current_weapon; // one current weapon for each bot + int m_rgAmmo[MAX_AMMO_SLOTS]; // total ammo amounts (1 array for each bot) + +} bot_t; + + +//#define MAX_TEAMS 32 +//#define MAX_TEAMNAME_LENGTH 16 +#include "game_shared/teamconst.h" + + +#define MAX_FLAGS 5 + +typedef struct { + bool mdl_match; + int team_no; + edict_t *edict; +} FLAG_S; + + +// new UTIL.CPP functions... +edict_t *UTIL_FindEntityInSphere( edict_t *pentStart, const Vector &vecCenter, float flRadius ); +edict_t *UTIL_FindEntityByString( edict_t *pentStart, const char *szKeyword, const char *szValue ); +edict_t *UTIL_FindEntityByClassname( edict_t *pentStart, const char *szName ); +edict_t *UTIL_FindEntityByTargetname( edict_t *pentStart, const char *szName ); +void ClientPrint( edict_t *pEdict, int msg_dest, const char *msg_name); +void UTIL_SayText( const char *pText, edict_t *pEdict ); +void UTIL_HostSay( edict_t *pEntity, int teamonly, char *message ); +int UTIL_GetTeam(edict_t *pEntity); +int UTIL_GetClass(edict_t *pEntity); +int UTIL_GetBotIndex(edict_t *pEdict); +bot_t *UTIL_GetBotPointer(edict_t *pEdict); +bool IsAlive(edict_t *pEdict); +bool FInViewCone(Vector *pOrigin, edict_t *pEdict); +bool FVisible( const Vector &vecOrigin, edict_t *pEdict ); +Vector Center(edict_t *pEdict); +Vector GetGunPosition(edict_t *pEdict); +void UTIL_SelectItem(edict_t *pEdict, char *item_name); +Vector VecBModelOrigin(edict_t *pEdict); +bool UpdateSounds(edict_t *pEdict, edict_t *pPlayer); +void UTIL_ShowMenu( edict_t *pEdict, int slots, int displaytime, bool needmore, char *pText ); +void UTIL_BuildFileName(char *filename, char *arg1, char *arg2); + + +#endif // BOT_H + diff --git a/main/source/HPB_bot/dlls/bot_client.cpp b/main/source/HPB_bot/dlls/bot_client.cpp new file mode 100644 index 00000000..d51b1e92 --- /dev/null +++ b/main/source/HPB_bot/dlls/bot_client.cpp @@ -0,0 +1,960 @@ +// +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// bot_client.cpp +// + +#include "extdll.h" +#include "util.h" +#include "cbase.h" + +#include "bot.h" +#include "bot_func.h" +#include "bot_client.h" +#include "bot_weapons.h" + +// types of damage to ignore... +#define IGNORE_DAMAGE (DMG_CRUSH | DMG_FREEZE | DMG_FALL | DMG_SHOCK | \ + DMG_DROWN | DMG_NERVEGAS | DMG_RADIATION | \ + DMG_DROWNRECOVER | DMG_ACID | DMG_SLOWBURN | \ + DMG_SLOWFREEZE | 0xFF000000) + +extern int mod_id; +extern bot_t bots[32]; + +bot_weapon_t weapon_defs[MAX_WEAPONS]; // array of weapon definitions + + +// This message is sent when the TFC VGUI menu is displayed. +void BotClient_TFC_VGUI(void *p, int bot_index) +{ + if ((*(int *)p) == 2) // is it a team select menu? + + bots[bot_index].start_action = MSG_TFC_TEAM_SELECT; + + else if ((*(int *)p) == 3) // is is a class selection menu? + + bots[bot_index].start_action = MSG_TFC_CLASS_SELECT; +} + + +// This message is sent when the Counter-Strike VGUI menu is displayed. +void BotClient_CS_VGUI(void *p, int bot_index) +{ + if ((*(int *)p) == 2) // is it a team select menu? + + bots[bot_index].start_action = MSG_CS_TEAM_SELECT; + + else if ((*(int *)p) == 26) // is is a terrorist model select menu? + + bots[bot_index].start_action = MSG_CS_T_SELECT; + + else if ((*(int *)p) == 27) // is is a counter-terrorist model select menu? + + bots[bot_index].start_action = MSG_CS_CT_SELECT; +} + + +// This message is sent when a menu is being displayed in Counter-Strike. +void BotClient_CS_ShowMenu(void *p, int bot_index) +{ + static int state = 0; // current state machine state + + if (state < 3) + { + state++; // ignore first 3 fields of message + return; + } + + if (strcmp((char *)p, "#Team_Select") == 0) // team select menu? + { + bots[bot_index].start_action = MSG_CS_TEAM_SELECT; + } + else if (strcmp((char *)p, "#Terrorist_Select") == 0) // T model select? + { + bots[bot_index].start_action = MSG_CS_T_SELECT; + } + else if (strcmp((char *)p, "#CT_Select") == 0) // CT model select menu? + { + bots[bot_index].start_action = MSG_CS_CT_SELECT; + } + + state = 0; // reset state machine +} + + +// This message is sent when the TFC VGUI menu is displayed. +void BotClient_Gearbox_VGUI(void *p, int bot_index) +{ + if ((*(int *)p) == 2) // is it a team select menu? + + bots[bot_index].start_action = MSG_OPFOR_TEAM_SELECT; + + else if ((*(int *)p) == 3) // is is a class selection menu? + + bots[bot_index].start_action = MSG_OPFOR_CLASS_SELECT; +} + + +// This message is sent when the FrontLineForce VGUI menu is displayed. +void BotClient_FLF_VGUI(void *p, int bot_index) +{ + if ((*(int *)p) == 2) // is it a team select menu? + bots[bot_index].start_action = MSG_FLF_TEAM_SELECT; + else if ((*(int *)p) == 3) // is it a class selection menu? + bots[bot_index].start_action = MSG_FLF_CLASS_SELECT; + else if ((*(int *)p) == 70) // is it a weapon selection menu? + bots[bot_index].start_action = MSG_FLF_WEAPON_SELECT; + else if ((*(int *)p) == 72) // is it a submachine gun selection menu? + bots[bot_index].start_action = MSG_FLF_SUBMACHINE_SELECT; + else if ((*(int *)p) == 73) // is it a shotgun selection menu? + bots[bot_index].start_action = MSG_FLF_SHOTGUN_SELECT; + else if ((*(int *)p) == 75) // is it a rifle selection menu? + bots[bot_index].start_action = MSG_FLF_RIFLE_SELECT; + else if ((*(int *)p) == 76) // is it a pistol selection menu? + bots[bot_index].start_action = MSG_FLF_PISTOL_SELECT; + else if ((*(int *)p) == 78) // is it a heavyweapons selection menu? + bots[bot_index].start_action = MSG_FLF_HEAVYWEAPONS_SELECT; +} + + +// This message is sent when a client joins the game. All of the weapons +// are sent with the weapon ID and information about what ammo is used. +void BotClient_Valve_WeaponList(void *p, int bot_index) +{ + static int state = 0; // current state machine state + static bot_weapon_t bot_weapon; + + if (state == 0) + { + state++; + strcpy(bot_weapon.szClassname, (char *)p); + } + else if (state == 1) + { + state++; + bot_weapon.iAmmo1 = *(int *)p; // ammo index 1 + } + else if (state == 2) + { + state++; + bot_weapon.iAmmo1Max = *(int *)p; // max ammo1 + } + else if (state == 3) + { + state++; + bot_weapon.iAmmo2 = *(int *)p; // ammo index 2 + } + else if (state == 4) + { + state++; + bot_weapon.iAmmo2Max = *(int *)p; // max ammo2 + } + else if (state == 5) + { + state++; + bot_weapon.iSlot = *(int *)p; // slot for this weapon + } + else if (state == 6) + { + state++; + bot_weapon.iPosition = *(int *)p; // position in slot + } + else if (state == 7) + { + state++; + bot_weapon.iId = *(int *)p; // weapon ID + } + else if (state == 8) + { + state = 0; + + bot_weapon.iFlags = *(int *)p; // flags for weapon (WTF???) + + // store away this weapon with it's ammo information... + weapon_defs[bot_weapon.iId] = bot_weapon; + } +} + +void BotClient_TFC_WeaponList(void *p, int bot_index) +{ + // this is just like the Valve Weapon List message + BotClient_Valve_WeaponList(p, bot_index); +} + +void BotClient_CS_WeaponList(void *p, int bot_index) +{ + // this is just like the Valve Weapon List message + BotClient_Valve_WeaponList(p, bot_index); +} + +void BotClient_Gearbox_WeaponList(void *p, int bot_index) +{ + // this is just like the Valve Weapon List message + BotClient_Valve_WeaponList(p, bot_index); +} + +void BotClient_FLF_WeaponList(void *p, int bot_index) +{ + // this is just like the Valve Weapon List message + BotClient_Valve_WeaponList(p, bot_index); +} + + +// This message is sent when a weapon is selected (either by the bot chosing +// a weapon or by the server auto assigning the bot a weapon). +void BotClient_Valve_CurrentWeapon(void *p, int bot_index) +{ + static int state = 0; // current state machine state + static int iState; + static int iId; + static int iClip; + + if (state == 0) + { + state++; + iState = *(int *)p; // state of the current weapon + } + else if (state == 1) + { + state++; + iId = *(int *)p; // weapon ID of current weapon + } + else if (state == 2) + { + state = 0; + + iClip = *(int *)p; // ammo currently in the clip for this weapon + + if (iId <= 31) + { + bots[bot_index].bot_weapons |= (1< 0) || (damage_taken > 0)) + { + // ignore certain types of damage... + if (damage_bits & IGNORE_DAMAGE) + return; + + // if the bot doesn't have an enemy and someone is shooting at it then + // turn in the attacker's direction... + if (bots[bot_index].pBotEnemy == NULL) + { + // face the attacker... + Vector v_enemy = damage_origin - bots[bot_index].pEdict->v.origin; + Vector bot_angles = UTIL_VecToAngles( v_enemy ); + + bots[bot_index].pEdict->v.ideal_yaw = bot_angles.y; + + BotFixIdealYaw(bots[bot_index].pEdict); + + // stop using health or HEV stations... + bots[bot_index].b_use_health_station = FALSE; + bots[bot_index].b_use_HEV_station = FALSE; + bots[bot_index].b_use_capture = FALSE; + } + } + } +} + +void BotClient_TFC_Damage(void *p, int bot_index) +{ + // this is just like the Valve Battery message + BotClient_Valve_Damage(p, bot_index); +} + +void BotClient_CS_Damage(void *p, int bot_index) +{ + // this is just like the Valve Battery message + BotClient_Valve_Damage(p, bot_index); +} + +void BotClient_Gearbox_Damage(void *p, int bot_index) +{ + // this is just like the Valve Battery message + BotClient_Valve_Damage(p, bot_index); +} + +void BotClient_FLF_Damage(void *p, int bot_index) +{ + // this is just like the Valve Battery message + BotClient_Valve_Damage(p, bot_index); +} + + +// This message gets sent when the bots money ammount changes (for CS) +void BotClient_CS_Money(void *p, int bot_index) +{ + static int state = 0; // current state machine state + + if (state == 0) + { + state++; + + bots[bot_index].bot_money = *(int *)p; // amount of money + } + else + { + state = 0; // ingore this field + } +} + +// This message gets sent when the bots get killed +void BotClient_Valve_DeathMsg(void *p, int bot_index) +{ + static int state = 0; // current state machine state + static int killer_index; + static int victim_index; + static edict_t *victim_edict; + static int index; + + if (state == 0) + { + state++; + killer_index = *(int *)p; // ENTINDEX() of killer + } + else if (state == 1) + { + state++; + victim_index = *(int *)p; // ENTINDEX() of victim + } + else if (state == 2) + { + state = 0; + + victim_edict = INDEXENT(victim_index); + + index = UTIL_GetBotIndex(victim_edict); + + // is this message about a bot being killed? + if (index != -1) + { + if ((killer_index == 0) || (killer_index == victim_index)) + { + // bot killed by world (worldspawn) or bot killed self... + bots[index].killer_edict = NULL; + } + else + { + // store edict of player that killed this bot... + bots[index].killer_edict = INDEXENT(killer_index); + } + } + } +} + +void BotClient_TFC_DeathMsg(void *p, int bot_index) +{ + // this is just like the Valve DeathMsg message + BotClient_Valve_DeathMsg(p, bot_index); +} + +void BotClient_CS_DeathMsg(void *p, int bot_index) +{ + // this is just like the Valve DeathMsg message + BotClient_Valve_DeathMsg(p, bot_index); +} + +void BotClient_Gearbox_DeathMsg(void *p, int bot_index) +{ + // this is just like the Valve DeathMsg message + BotClient_Valve_DeathMsg(p, bot_index); +} + +void BotClient_FLF_DeathMsg(void *p, int bot_index) +{ + // this is just like the Valve DeathMsg message + BotClient_Valve_DeathMsg(p, bot_index); +} + + +// This message gets sent when a text message is displayed +void BotClient_FLF_TextMsg(void *p, int bot_index) +{ + static int state = 0; // current state machine state + static int msg_dest = 0; + + if (state == 0) + { + state++; + msg_dest = *(int *)p; // HUD_PRINTCENTER, etc. + } + else if (state == 1) + { + state = 0; + + if (strcmp((char *)p, "You are Attacking\n") == 0) // attacker msg + { + bots[bot_index].defender = 0; // attacker + } + else if (strcmp((char *)p, "You are Defending\n") == 0) // defender msg + { + bots[bot_index].defender = 1; // defender + } + } +} + + +// This message gets sent when the WarmUpTime is enabled/disabled +void BotClient_FLF_WarmUp(void *p, int bot_index) +{ + bots[bot_index].warmup = *(int *)p; +} + + +// This message gets sent to ALL when the WarmUpTime is enabled/disabled +void BotClient_FLF_WarmUpAll(void *p, int bot_index) +{ + for (int i=0; i < 32; i++) + { + if (bots[i].is_used) // count the number of bots in use + bots[i].warmup = *(int *)p; + } +} + + +// This message gets sent when the round is over +void BotClient_FLF_WinMessage(void *p, int bot_index) +{ + for (int i=0; i < 32; i++) + { + if (bots[i].is_used) // count the number of bots in use + bots[i].round_end = 1; + } +} + + +// This message gets sent when a temp entity is created +void BotClient_FLF_TempEntity(void *p, int bot_index) +{ + static int state = 0; // current state machine state + static int te_type; // TE_ message type + + if (p == NULL) // end of message? + { + state = 0; + return; + } + + if (state == 0) + { + state++; + te_type = *(int *)p; + + return; + } + + if (te_type == TE_TEXTMESSAGE) + { + if (state == 16) + { + if (strncmp((char *)p, "Capturing ", 10) == 0) + { + // if bot is currently capturing, keep timer alive... + if (bots[bot_index].b_use_capture) + bots[bot_index].f_use_capture_time = gpGlobals->time + 2.0; + } + } + + state++; + } +} + + +void BotClient_Valve_ScreenFade(void *p, int bot_index) +{ + static int state = 0; // current state machine state + static int duration; + static int hold_time; + static int fade_flags; + int length; + + if (state == 0) + { + state++; + duration = *(int *)p; + } + else if (state == 1) + { + state++; + hold_time = *(int *)p; + } + else if (state == 2) + { + state++; + fade_flags = *(int *)p; + } + else if (state == 6) + { + state = 0; + + length = (duration + hold_time) / 4096; + bots[bot_index].blinded_time = gpGlobals->time + length - 2.0; + } + else + { + state++; + } +} + +void BotClient_TFC_ScreenFade(void *p, int bot_index) +{ + // this is just like the Valve ScreenFade message + BotClient_Valve_ScreenFade(p, bot_index); +} + +void BotClient_CS_ScreenFade(void *p, int bot_index) +{ + // this is just like the Valve ScreenFade message + BotClient_Valve_ScreenFade(p, bot_index); +} + +void BotClient_Gearbox_ScreenFade(void *p, int bot_index) +{ + // this is just like the Valve ScreenFade message + BotClient_Valve_ScreenFade(p, bot_index); +} + +void BotClient_FLF_ScreenFade(void *p, int bot_index) +{ + // this is just like the Valve ScreenFade message + BotClient_Valve_ScreenFade(p, bot_index); +} + +// AvH client functions +void BotClient_AVH_SetOrder(void *p, int bot_index) +{ + bot_t* theCurrentBot = &bots[bot_index]; + + if(theCurrentBot->mOrderNumPlayers == -1) + { + if (theCurrentBot->mOrderState == 0) + { + // Read num players + theCurrentBot->mOrderState++; + theCurrentBot->mOrderNumPlayers = *(byte *)p; + } + } + else + { + if(theCurrentBot->mOrderState <= theCurrentBot->mOrderNumPlayers) + { + // Skip by players + theCurrentBot->mOrderState++; + } + else + { + int theRealState = theCurrentBot->mOrderState - theCurrentBot->mOrderNumPlayers - 1; + if(theRealState == 0) + { + // read order + theCurrentBot->mOrderState++; + theCurrentBot->mOrderType = *((AvHOrderType *)p); + } + else if(theRealState == 1) + { + // read order target type + theCurrentBot->mOrderState++; + theCurrentBot->mOrderTargetType = *((AvHOrderTargetType *)p); + } + else + { + if((theCurrentBot->mOrderTargetType == ORDERTARGETTYPE_LOCATION) && ((theRealState >= 2) && (theRealState <= 4))) + { + theCurrentBot->mOrderLocation[theRealState-2] = *((float*)p); + theCurrentBot->mOrderState++; + } + else if((theCurrentBot->mOrderTargetType == ORDERTARGETTYPE_TARGET) && (theRealState == 2)) + { + theCurrentBot->mOrderTargetIndex = *((int*)p); + theCurrentBot->mOrderState++; + } + else if( ((theCurrentBot->mOrderTargetType == ORDERTARGETTYPE_LOCATION) && (theRealState == 5)) || + ((theCurrentBot->mOrderTargetType == ORDERTARGETTYPE_TARGET) && (theRealState == 3)) || + (theRealState == 2) ) + { + theCurrentBot->mOrderCompleted = *((int*)p); + theCurrentBot->mOrderState++; + } + else + { + // Reset + theCurrentBot->mOrderState = 0; + theCurrentBot->mOrderNumPlayers = -1; + theCurrentBot->mOrderType = ORDERTYPE_UNDEFINED; + theCurrentBot->mOrderTargetType = ORDERTARGETTYPE_UNDEFINED; + theCurrentBot->mOrderLocation[0] = theCurrentBot->mOrderLocation[1] = theCurrentBot->mOrderLocation[2] = 0.0f; + theCurrentBot->mOrderTargetIndex = -1; + theCurrentBot->mOrderCompleted = false; + } + } + } + } +} + + + +void BotClient_AVH_SetPlayMode(void *p, int bot_index) +{ + static int state = 0; // current state machine state + + if (state == 0) + { + state++; + + bots[bot_index].mBotPlayMode = (AvHPlayMode)(*(byte *)p); // amount of money + bots[bot_index].pBotEnemy = NULL; + } + else + { + state = 0; // ingore this field + } +} + +void BotClient_AVH_SetResources(void *p, int bot_index) +{ + static int state = 0; // current state machine state + + if(state == 0) + { + state++; + } + else if(state == 1) + { + bots[bot_index].mResources = (*(int *)p); // amount of money + state += 4; + } + else + { + state = 0; // ingore this field + } +} + + + diff --git a/main/source/HPB_bot/dlls/bot_client.h b/main/source/HPB_bot/dlls/bot_client.h new file mode 100644 index 00000000..4dc9e030 --- /dev/null +++ b/main/source/HPB_bot/dlls/bot_client.h @@ -0,0 +1,96 @@ +// +// HPB_bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// bot_client.h +// + +void BotClient_TFC_VGUI(void *p, int bot_index); +void BotClient_CS_VGUI(void *p, int bot_index); +void BotClient_CS_ShowMenu(void *p, int bot_index); +void BotClient_Gearbox_VGUI(void *p, int bot_index); +void BotClient_FLF_VGUI(void *p, int bot_index); + +void BotClient_Valve_WeaponList(void *p, int bot_index); +void BotClient_TFC_WeaponList(void *p, int bot_index); +void BotClient_CS_WeaponList(void *p, int bot_index); +void BotClient_Gearbox_WeaponList(void *p, int bot_index); +void BotClient_FLF_WeaponList(void *p, int bot_index); + +void BotClient_Valve_CurrentWeapon(void *p, int bot_index); +void BotClient_TFC_CurrentWeapon(void *p, int bot_index); +void BotClient_CS_CurrentWeapon(void *p, int bot_index); +void BotClient_Gearbox_CurrentWeapon(void *p, int bot_index); +void BotClient_FLF_CurrentWeapon(void *p, int bot_index); + +void BotClient_Valve_AmmoX(void *p, int bot_index); +void BotClient_TFC_AmmoX(void *p, int bot_index); +void BotClient_CS_AmmoX(void *p, int bot_index); +void BotClient_Gearbox_AmmoX(void *p, int bot_index); +void BotClient_FLF_AmmoX(void *p, int bot_index); + +void BotClient_Valve_AmmoPickup(void *p, int bot_index); +void BotClient_TFC_AmmoPickup(void *p, int bot_index); +void BotClient_CS_AmmoPickup(void *p, int bot_index); +void BotClient_Gearbox_AmmoPickup(void *p, int bot_index); +void BotClient_FLF_AmmoPickup(void *p, int bot_index); + +void BotClient_Valve_WeaponPickup(void *p, int bot_index); +void BotClient_TFC_WeaponPickup(void *p, int bot_index); +void BotClient_CS_WeaponPickup(void *p, int bot_index); +void BotClient_Gearbox_WeaponPickup(void *p, int bot_index); +void BotClient_FLF_WeaponPickup(void *p, int bot_index); + +void BotClient_Valve_ItemPickup(void *p, int bot_index); +void BotClient_TFC_ItemPickup(void *p, int bot_index); +void BotClient_CS_ItemPickup(void *p, int bot_index); +void BotClient_Gearbox_ItemPickup(void *p, int bot_index); +void BotClient_FLF_ItemPickup(void *p, int bot_index); + +void BotClient_Valve_Health(void *p, int bot_index); +void BotClient_TFC_Health(void *p, int bot_index); +void BotClient_CS_Health(void *p, int bot_index); +void BotClient_Gearbox_Health(void *p, int bot_index); +void BotClient_FLF_Health(void *p, int bot_index); + +void BotClient_Valve_Battery(void *p, int bot_index); +void BotClient_TFC_Battery(void *p, int bot_index); +void BotClient_CS_Battery(void *p, int bot_index); +void BotClient_Gearbox_Battery(void *p, int bot_index); +void BotClient_FLF_Battery(void *p, int bot_index); + +void BotClient_Valve_Damage(void *p, int bot_index); +void BotClient_TFC_Damage(void *p, int bot_index); +void BotClient_CS_Damage(void *p, int bot_index); +void BotClient_Gearbox_Damage(void *p, int bot_index); +void BotClient_FLF_Damage(void *p, int bot_index); + +void BotClient_CS_Money(void *p, int bot_index); + +void BotClient_Valve_DeathMsg(void *p, int bot_index); +void BotClient_TFC_DeathMsg(void *p, int bot_index); +void BotClient_CS_DeathMsg(void *p, int bot_index); +void BotClient_Gearbox_DeathMsg(void *p, int bot_index); +void BotClient_FLF_DeathMsg(void *p, int bot_index); + +void BotClient_FLF_TextMsg(void *p, int bot_index); + +void BotClient_FLF_WarmUp(void *p, int bot_index); +void BotClient_FLF_WarmUpAll(void *p, int bot_index); + +void BotClient_FLF_WinMessage(void *p, int bot_index); + +void BotClient_FLF_TempEntity(void *p, int bot_index); + +void BotClient_Valve_ScreenFade(void *p, int bot_index); +void BotClient_TFC_ScreenFade(void *p, int bot_index); +void BotClient_CS_ScreenFade(void *p, int bot_index); +void BotClient_Gearbox_ScreenFade(void *p, int bot_index); +void BotClient_FLF_ScreenFade(void *p, int bot_index); + +// AvH client functions +void BotClient_AVH_SetOrder(void *p, int bot_index); +void BotClient_AVH_SetPlayMode(void *p, int bot_index); +void BotClient_AVH_SetResources(void *p, int bot_index); + diff --git a/main/source/HPB_bot/dlls/bot_combat.cpp b/main/source/HPB_bot/dlls/bot_combat.cpp new file mode 100644 index 00000000..85d4d609 --- /dev/null +++ b/main/source/HPB_bot/dlls/bot_combat.cpp @@ -0,0 +1,1301 @@ +// +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// bot_combat.cpp +// + +#include "extdll.h" +#include "util.h" +#include "cbase.h" + +#include "bot.h" +#include "bot_func.h" +#include "bot_weapons.h" +#include "mod/AvHBasePlayerWeaponConstants.h" +#include "mod/AvHMarineWeaponConstants.h" +#include "mod/AvHAlienWeaponConstants.h" +#include "mod/AvHPlayer.h" + +extern int mod_id; +extern bot_weapon_t weapon_defs[MAX_WEAPONS]; +extern bool b_observer_mode; +extern int team_allies[4]; +extern edict_t *pent_info_ctfdetect; +extern float is_team_play; +extern bool checked_teamplay; + +FILE *fp; + + +typedef struct +{ + int iId; // the weapon ID value + char weapon_name[64]; // name of the weapon when selecting it + int skill_level; // bot skill must be less than or equal to this value + float primary_min_distance; // 0 = no minimum + float primary_max_distance; // 9999 = no maximum + float secondary_min_distance; // 0 = no minimum + float secondary_max_distance; // 9999 = no maximum + int use_percent; // times out of 100 to use this weapon when available + bool can_use_underwater; // can use this weapon underwater + int primary_fire_percent; // times out of 100 to use primary fire + int min_primary_ammo; // minimum ammout of primary ammo needed to fire + int min_secondary_ammo; // minimum ammout of seconday ammo needed to fire + bool primary_fire_hold; // hold down primary fire button to use? + bool secondary_fire_hold; // hold down secondary fire button to use? + bool primary_fire_charge; // charge weapon using primary fire? + bool secondary_fire_charge; // charge weapon using secondary fire? + float primary_charge_delay; // time to charge weapon + float secondary_charge_delay; // time to charge weapon +} bot_weapon_select_t; + +typedef struct +{ + int iId; + float primary_base_delay; + float primary_min_delay[5]; + float primary_max_delay[5]; + float secondary_base_delay; + float secondary_min_delay[5]; + float secondary_max_delay[5]; +} bot_fire_delay_t; + + +// weapons are stored in priority order, most desired weapon should be at +// the start of the array and least desired should be at the end + +bot_weapon_select_t valve_weapon_select[] = { + {VALVE_WEAPON_CROWBAR, "weapon_crowbar", 2, 0.0, 50.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_HANDGRENADE, "weapon_handgrenade", 5, 250.0, 750.0, 0.0, 0.0, + 30, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_SNARK, "weapon_snark", 5, 150.0, 500.0, 0.0, 0.0, + 50, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_EGON, "weapon_egon", 5, 0.0, 9999.0, 0.0, 0.0, + 100, FALSE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_GAUSS, "weapon_gauss", 5, 0.0, 9999.0, 0.0, 9999.0, + 100, FALSE, 80, 1, 10, FALSE, FALSE, FALSE, TRUE, 0.0, 0.8}, + {VALVE_WEAPON_SHOTGUN, "weapon_shotgun", 5, 30.0, 150.0, 30.0, 150.0, + 100, FALSE, 70, 1, 2, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_PYTHON, "weapon_357", 5, 30.0, 700.0, 0.0, 0.0, + 100, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_HORNETGUN, "weapon_hornetgun", 5, 30.0, 1000.0, 30.0, 1000.0, + 100, TRUE, 50, 1, 4, FALSE, TRUE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_MP5, "weapon_9mmAR", 5, 0.0, 250.0, 300.0, 600.0, + 100, FALSE, 90, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_CROSSBOW, "weapon_crossbow", 5, 100.0, 1000.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_RPG, "weapon_rpg", 5, 300.0, 9999.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {VALVE_WEAPON_GLOCK, "weapon_9mmhandgun", 5, 0.0, 1200.0, 0.0, 1200.0, + 100, TRUE, 70, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + /* terminator */ + {0, "", 0, 0.0, 0.0, 0.0, 0.0, 0, TRUE, 0, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0} +}; + +bot_weapon_select_t tfc_weapon_select[] = { + {TF_WEAPON_AXE, "tf_weapon_axe", 5, 0.0, 50.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_KNIFE, "tf_weapon_knife", 5, 0.0, 40.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_SPANNER, "tf_weapon_knife", 5, 0.0, 40.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_MEDIKIT, "tf_weapon_medikit", 5, 0.0, 40.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_SNIPERRIFLE, "tf_weapon_sniperrifle", 5, 300.0, 2500.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, TRUE, FALSE, 1.0, 0.0}, + {TF_WEAPON_FLAMETHROWER, "tf_weapon_flamethrower", 5, 100.0, 500.0, 0.0, 0.0, + 100, FALSE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_AC, "tf_weapon_ac", 5, 50.0, 1000.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_GL, "tf_weapon_gl", 5, 300.0, 900.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_RPG, "tf_weapon_rpg", 5, 300.0, 900.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_IC, "tf_weapon_ic", 5, 300.0, 800.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_TRANQ, "tf_weapon_tranq", 5, 40.0, 1000.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_RAILGUN, "tf_weapon_railgun", 5, 40.0, 800.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_SUPERNAILGUN, "tf_weapon_superng", 5, 40.0, 800.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_SUPERSHOTGUN, "tf_weapon_supershotgun", 5, 40.0, 500.0, 0.0, 0.0, + 100, TRUE, 100, 2, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_AUTORIFLE, "tf_weapon_autorifle", 5, 0.0, 800.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_SHOTGUN, "tf_weapon_shotgun", 5, 40.0, 400.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {TF_WEAPON_NAILGUN, "tf_weapon_ng", 5, 40.0, 600.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + /* terminator */ + {0, "", 0, 0.0, 0.0, 0.0, 0.0, 0, TRUE, 0, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0} +}; + +bot_weapon_select_t cs_weapon_select[] = { + {CS_WEAPON_KNIFE, "weapon_knife", 5, 0.0, 50.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {CS_WEAPON_USP, "weapon_usp", 5, 0.0, 1200.0, 0.0, 1200.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {CS_WEAPON_GLOCK18, "weapon_glock18", 5, 0.0, 1200.0, 0.0, 1200.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + /* terminator */ + {0, "", 0, 0.0, 0.0, 0.0, 0.0, 0, TRUE, 0, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0} +}; + +bot_weapon_select_t gearbox_weapon_select[] = { + {GEARBOX_WEAPON_PIPEWRENCH, "weapon_pipewrench", 3, 0.0, 50.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_KNIFE, "weapon_knife", 4, 0.0, 50.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_CROWBAR, "weapon_crowbar", 2, 0.0, 50.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_DISPLACER, "weapon_displacer", 5, 100.0, 1000.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_SPORELAUNCHER, "weapon_sporelauncher", 5, 500.0, 1000.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_SHOCKRIFLE, "weapon_shockrifle", 5, 50.0, 800.0, 0.0, 0.0, + 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_SNIPERRIFLE, "weapon_sniperrifle", 5, 50.0, 1500.0, 0.0, 0.0, + 100, FALSE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_HANDGRENADE, "weapon_handgrenade", 5, 250.0, 750.0, 0.0, 0.0, + 30, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_SNARK, "weapon_snark", 5, 150.0, 500.0, 0.0, 0.0, + 50, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_EGON, "weapon_egon", 5, 0.0, 9999.0, 0.0, 0.0, + 100, FALSE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_GAUSS, "weapon_gauss", 5, 0.0, 9999.0, 0.0, 9999.0, + 100, FALSE, 80, 1, 10, FALSE, FALSE, FALSE, TRUE, 0.0, 0.8}, + {GEARBOX_WEAPON_M249, "weapon_m249", 5, 0.0, 400.0, 0.0, 0.0, + 100, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_SHOTGUN, "weapon_shotgun", 5, 30.0, 150.0, 30.0, 150.0, + 100, FALSE, 70, 1, 2, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_EAGLE, "weapon_eagle", 5, 0.0, 1200.0, 0.0, 0.0, + 100, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_PYTHON, "weapon_357", 5, 30.0, 700.0, 0.0, 0.0, + 100, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_HORNETGUN, "weapon_hornetgun", 5, 30.0, 1000.0, 30.0, 1000.0, + 100, TRUE, 50, 1, 4, FALSE, TRUE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_MP5, "weapon_9mmAR", 5, 0.0, 250.0, 300.0, 600.0, + 100, FALSE, 90, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_CROSSBOW, "weapon_crossbow", 5, 100.0, 1000.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_RPG, "weapon_rpg", 5, 300.0, 9999.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {GEARBOX_WEAPON_GLOCK, "weapon_9mmhandgun", 5, 0.0, 1200.0, 0.0, 1200.0, + 100, TRUE, 70, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + /* terminator */ + {0, "", 0, 0.0, 0.0, 0.0, 0.0, 0, TRUE, 0, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0} +}; + +bot_weapon_select_t frontline_weapon_select[] = { + {FLF_WEAPON_HEGRENADE, "weapon_hegrenade", 3, 200.0, 1000.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_FLASHBANG, "weapon_flashbang", 3, 100.0, 800.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, +// {FLF_WEAPON_KNIFE, "weapon_knife", 3, 0.0, 60.0, 0.0, 0.0, +// 100, TRUE, 100, 0, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_HK21, "weapon_hk21", 5, 0.0, 900.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_UMP45, "weapon_ump45", 5, 0.0, 900.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_FAMAS, "weapon_famas", 5, 0.0, 500.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_MSG90, "weapon_msg90", 5, 0.0, 2500.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_MP5A2, "weapon_mp5a2", 5, 0.0, 900.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_AK5, "weapon_ak5", 5, 0.0, 900.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_MP5SD, "weapon_mp5sd", 5, 0.0, 900.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_M4, "weapon_m4", 5, 0.0, 900.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_SPAS12, "weapon_spas12", 5, 0.0, 900.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_MAC10, "weapon_mac10", 5, 0.0, 500.0, 0.0, 0.0, + 100, TRUE, 100, 1, 0, TRUE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_BERETTA, "weapon_beretta", 5, 0.0, 1200.0, 0.0, 1200.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + {FLF_WEAPON_MK23, "weapon_mk23", 5, 0.0, 1200.0, 0.0, 1200.0, + 100, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + /* terminator */ + {0, "", 0, 0.0, 0.0, 0.0, 0.0, 0, TRUE, 0, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0} +}; + +//int iId; // the weapon ID value +//char weapon_name[64]; // name of the weapon when selecting it +//int skill_level; // bot skill must be less than or equal to this value +//float primary_min_distance; // 0 = no minimum +//float primary_max_distance; // 9999 = no maximum +//float secondary_min_distance; // 0 = no minimum +//float secondary_max_distance; // 9999 = no maximum +//int use_percent; // times out of 100 to use this weapon when available +//bool can_use_underwater; // can use this weapon underwater +//int primary_fire_percent; // times out of 100 to use primary fire +//int min_primary_ammo; // minimum ammout of primary ammo needed to fire +//int min_secondary_ammo; // minimum ammout of seconday ammo needed to fire +//bool primary_fire_hold; // hold down primary fire button to use? +//bool secondary_fire_hold; // hold down secondary fire button to use? +//bool primary_fire_charge; // charge weapon using primary fire? +//bool secondary_fire_charge; // charge weapon using secondary fire? +//float primary_charge_delay; // time to charge weapon +//float secondary_charge_delay; // time to charge weapon + +bot_weapon_select_t ns_weapon_select[] = { + {AVH_WEAPON_GRENADE_GUN, kwsGrenadeGun, 3, 120, kGGRange, 0.0, 0.0, 100, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_SONIC, kwsShotGun, 3, 0.0, kSGRange, 0.0, 0.0, 100, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_HMG, kwsHeavyMachineGun, 3, 0.0, kHMGRange, 0.0, 0.0, 100, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_MG, kwsMachineGun, 3, 0.0, kMGRange, 0.0, 0.0, 100, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_PISTOL, kwsPistol, 3, 0.0, kHGRange, 0.0, 0.0, 75, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_KNIFE, kwsKnife, 3, 0.0, kKNRange, 0.0, 0.0, 50, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + + // Base alien abilities + {AVH_WEAPON_PRIMALSCREAM, kwsPrimalScream, 3, 0.0, 300, 0.0, 0.0, 20, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_SWIPE, kwsSwipe, 3, 0.0, kSwipeRange, 0.0, 0.0, 75, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_SPORES, kwsSporeGun, 3, 0.0, kSporeRange, 0.0, 0.0, 75, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_SPIT, kwsSpitGun, 3, 0.0, kSpitGRange, 0.0, 0.0, 75, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_CLAWS, kwsClaws, 3, 0.0, kClawsRange, 0.0, 0.0, 75, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_BITE, kwsBiteGun, 3, 0.0, 60, 0.0, 0.0, 75, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_ABILITY_LEAP, kwsLeap, 3, 0.0, 600, 0.0, 0.0, 50, FALSE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, + {AVH_WEAPON_SPIKE, kwsSpikeGun, 3, 0.0, kSpikeRange, 0.0, 0.0, 75, TRUE, 100, 1, 0, FALSE, FALSE, FALSE, FALSE, 0.0f, 0.0f}, +}; + +// weapon firing delay based on skill (min and max delay for each weapon) +// THESE MUST MATCH THE SAME ORDER AS THE WEAPON SELECT ARRAY!!! + +bot_fire_delay_t valve_fire_delay[] = { + {VALVE_WEAPON_CROWBAR, + 0.3, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {VALVE_WEAPON_HANDGRENADE, + 0.1, {1.0, 2.0, 3.0, 4.0, 5.0}, {3.0, 4.0, 5.0, 6.0, 7.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {VALVE_WEAPON_SNARK, + 0.1, {0.0, 0.1, 0.2, 0.4, 0.6}, {0.1, 0.2, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {VALVE_WEAPON_EGON, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {VALVE_WEAPON_GAUSS, + 0.2, {0.0, 0.2, 0.3, 0.5, 1.0}, {0.1, 0.3, 0.5, 0.8, 1.2}, + 1.0, {0.2, 0.3, 0.5, 0.8, 1.2}, {0.5, 0.7, 1.0, 1.5, 2.0}}, + {VALVE_WEAPON_SHOTGUN, + 0.75, {0.0, 0.2, 0.4, 0.6, 0.8}, {0.25, 0.5, 0.8, 1.2, 2.0}, + 1.5, {0.0, 0.2, 0.4, 0.6, 0.8}, {0.25, 0.5, 0.8, 1.2, 2.0}}, + {VALVE_WEAPON_PYTHON, + 0.75, {0.0, 0.2, 0.4, 1.0, 1.5}, {0.25, 0.5, 0.8, 1.3, 2.2}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {VALVE_WEAPON_HORNETGUN, + 0.25, {0.0, 0.25, 0.4, 0.6, 1.0}, {0.1, 0.4, 0.7, 1.0, 1.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {VALVE_WEAPON_MP5, + 0.1, {0.0, 0.1, 0.25, 0.4, 0.5}, {0.1, 0.3, 0.45, 0.65, 0.8}, + 1.0, {0.0, 0.4, 0.7, 1.0, 1.4}, {0.3, 0.7, 1.0, 1.6, 2.0}}, + {VALVE_WEAPON_CROSSBOW, + 0.75, {0.0, 0.2, 0.5, 0.8, 1.0}, {0.25, 0.4, 0.7, 1.0, 1.3}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {VALVE_WEAPON_RPG, + 1.5, {1.0, 2.0, 3.0, 4.0, 5.0}, {3.0, 4.0, 5.0, 6.0, 7.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {VALVE_WEAPON_GLOCK, + 0.3, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.2, {0.0, 0.0, 0.1, 0.1, 0.2}, {0.1, 0.1, 0.2, 0.2, 0.4}}, + /* terminator */ + {0, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}} +}; + +bot_fire_delay_t tfc_fire_delay[] = { + {TF_WEAPON_AXE, + 0.3, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_KNIFE, + 0.3, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_SPANNER, + 0.3, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_MEDIKIT, + 0.3, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_SNIPERRIFLE, + 1.0, {0.0, 0.4, 0.7, 1.0, 1.4}, {0.3, 0.7, 1.0, 1.6, 2.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_FLAMETHROWER, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_AC, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_GL, + 0.6, {0.0, 0.2, 0.5, 0.8, 1.0}, {0.25, 0.4, 0.7, 1.0, 1.3}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_RPG, + 0.5, {0.0, 0.1, 0.3, 0.6, 1.0}, {0.1, 0.2, 0.7, 1.0, 2.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_IC, + 2.0, {1.0, 2.0, 3.0, 4.0, 5.0}, {3.0, 4.0, 5.0, 6.0, 7.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_TRANQ, + 1.5, {1.0, 2.0, 3.0, 4.0, 5.0}, {3.0, 4.0, 5.0, 6.0, 7.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_RAILGUN, + 0.4, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_SUPERNAILGUN, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_SUPERSHOTGUN, + 0.6, {0.0, 0.2, 0.5, 0.8, 1.0}, {0.25, 0.4, 0.7, 1.0, 1.3}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_AUTORIFLE, + 0.1, {0.0, 0.1, 0.2, 0.4, 0.6}, {0.1, 0.2, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_SHOTGUN, + 0.5, {0.0, 0.2, 0.4, 0.6, 0.8}, {0.25, 0.5, 0.8, 1.2, 2.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {TF_WEAPON_NAILGUN, + 0.1, {0.0, 0.1, 0.2, 0.4, 0.6}, {0.1, 0.2, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + /* terminator */ + {0, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}} +}; + +bot_fire_delay_t cs_fire_delay[] = { + {CS_WEAPON_KNIFE, + 0.3, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {CS_WEAPON_USP, + 0.3, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.2, {0.0, 0.0, 0.1, 0.1, 0.2}, {0.1, 0.1, 0.2, 0.2, 0.4}}, + {CS_WEAPON_GLOCK18, + 0.3, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.2, {0.0, 0.0, 0.1, 0.1, 0.2}, {0.1, 0.1, 0.2, 0.2, 0.4}}, + /* terminator */ + {0, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}} +}; + +bot_fire_delay_t gearbox_fire_delay[] = { + {GEARBOX_WEAPON_PIPEWRENCH, + 0.5, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_KNIFE, + 0.4, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_CROWBAR, + 0.3, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_DISPLACER, + 5.0, {0.0, 0.5, 0.8, 1.6, 2.5}, {0.3, 0.8, 1.4, 2.2, 3.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_SPORELAUNCHER, + 0.5, {0.0, 0.2, 0.3, 0.4, 0.6}, {0.1, 0.3, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_SHOCKRIFLE, + 0.1, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_SNIPERRIFLE, + 1.5, {0.0, 0.2, 0.4, 0.6, 0.8}, {0.25, 0.5, 0.8, 1.2, 2.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_HANDGRENADE, + 0.1, {1.0, 2.0, 3.0, 4.0, 5.0}, {3.0, 4.0, 5.0, 6.0, 7.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_SNARK, + 0.1, {0.0, 0.1, 0.2, 0.4, 0.6}, {0.1, 0.2, 0.5, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_EGON, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_GAUSS, + 0.2, {0.0, 0.2, 0.3, 0.5, 1.0}, {0.1, 0.3, 0.5, 0.8, 1.2}, + 1.0, {0.2, 0.3, 0.5, 0.8, 1.2}, {0.5, 0.7, 1.0, 1.5, 2.0}}, + {GEARBOX_WEAPON_M249, + 0.1, {0.0, 0.1, 0.25, 0.4, 0.5}, {0.1, 0.3, 0.45, 0.65, 0.8}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_SHOTGUN, + 0.75, {0.0, 0.2, 0.4, 0.6, 0.8}, {0.25, 0.5, 0.8, 1.2, 2.0}, + 1.5, {0.0, 0.2, 0.4, 0.6, 0.8}, {0.25, 0.5, 0.8, 1.2, 2.0}}, + {GEARBOX_WEAPON_EAGLE, + 0.25, {0.0, 0.1, 0.2, 0.3, 0.5}, {0.1, 0.25, 0.4, 0.7, 1.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_PYTHON, + 0.75, {0.0, 0.2, 0.4, 1.0, 1.5}, {0.25, 0.5, 0.8, 1.3, 2.2}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_HORNETGUN, + 0.25, {0.0, 0.25, 0.4, 0.6, 1.0}, {0.1, 0.4, 0.7, 1.0, 1.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_MP5, + 0.1, {0.0, 0.1, 0.25, 0.4, 0.5}, {0.1, 0.3, 0.45, 0.65, 0.8}, + 1.0, {0.0, 0.4, 0.7, 1.0, 1.4}, {0.3, 0.7, 1.0, 1.6, 2.0}}, + {GEARBOX_WEAPON_CROSSBOW, + 0.75, {0.0, 0.2, 0.5, 0.8, 1.0}, {0.25, 0.4, 0.7, 1.0, 1.3}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_RPG, + 1.5, {1.0, 2.0, 3.0, 4.0, 5.0}, {3.0, 4.0, 5.0, 6.0, 7.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {GEARBOX_WEAPON_GLOCK, + 0.3, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.2, {0.0, 0.0, 0.1, 0.1, 0.2}, {0.1, 0.1, 0.2, 0.2, 0.4}}, + /* terminator */ + {0, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}} +}; + +bot_fire_delay_t frontline_fire_delay[] = { + {FLF_WEAPON_HEGRENADE, + 0.3, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_FLASHBANG, + 0.3, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, +// {FLF_WEAPON_KNIFE, +// 0.3, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, +// 0.2, {0.0, 0.0, 0.1, 0.1, 0.2}, {0.1, 0.1, 0.2, 0.2, 0.4}}, + {FLF_WEAPON_HK21, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_UMP45, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_FAMAS, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_MSG90, + 1.2, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_MP5A2, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_AK5, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_MP5SD, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_M4, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_SPAS12, + 0.9, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_MAC10, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_BERETTA, + 0.4, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {FLF_WEAPON_MK23, + 0.4, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + /* terminator */ + {0, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}} +}; +bot_fire_delay_t ns_fire_delay[] = { + {AVH_WEAPON_GRENADE_GUN, 0.3f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.2, 0.3, 0.4, 0.5, 1.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_SONIC, 0.0f, {0.0, 0.0, 0.0, 0.1, 0.3}, {0.0, 0.0, 0.0, 0.2, 0.6}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_HMG, 0.0f, {0.0, 0.0, 0.0, 0.1, 0.3}, {0.0, 0.0, 0.0, 0.2, 0.6}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_MG, 0.0f, {0.0, 0.0, 0.0, 0.1, 0.3}, {0.0, 0.0, 0.0, 0.2, 0.6}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_PISTOL, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.1, 0.15, 0.2, 0.0, 0.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_KNIFE, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + + {AVH_WEAPON_PRIMALSCREAM, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_SWIPE, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_SPORES, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_SPIT, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_CLAWS, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.4, 0.5}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_BITE, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_ABILITY_LEAP, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, + {AVH_WEAPON_SPIKE, 0.0f, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}} +}; + +void BotCheckTeamplay(void) +{ + // is this TFC or Counter-Strike or OpFor teamplay or FrontLineForce? + if ((mod_id == TFC_DLL) || (mod_id == CSTRIKE_DLL) || + ((mod_id == GEARBOX_DLL) && (pent_info_ctfdetect != NULL)) || + (mod_id == FRONTLINE_DLL) || + (mod_id == AVH_DLL) ) + is_team_play = 1.0; + else + is_team_play = CVAR_GET_FLOAT("mp_teamplay"); // teamplay enabled? + + checked_teamplay = TRUE; +} + + +edict_t *BotFindEnemy( bot_t *pBot ) +{ + Vector vecEnd; + static bool flag=TRUE; + edict_t *pent = NULL; + edict_t *pNewEnemy; + float nearestdistance; + int i; + + edict_t *pEdict = pBot->pEdict; + + if(pBot->mBotPlayMode != PLAYMODE_PLAYING) + { + pBot->pBotEnemy = NULL; + } + + if (pBot->pBotEnemy != NULL) // does the bot already have an enemy? + { + vecEnd = pBot->pBotEnemy->v.origin + pBot->pBotEnemy->v.view_ofs; + + // if the enemy is dead? + if (!IsAlive(pBot->pBotEnemy)) // is the enemy dead?, assume bot killed it + { + // the enemy is dead, jump for joy about 10% of the time + if (RANDOM_LONG(1, 100) <= 10) + pEdict->v.button |= IN_JUMP; + + // Taunt sometimes after a kill + if(RANDOM_LONG(1, 5) == 1) + { + pBot->mTimeOfNextTaunt = gpGlobals->time + RANDOM_FLOAT(.3f, 4.0f); + } + + // don't have an enemy anymore so null out the pointer... + pBot->pBotEnemy = NULL; + } + else if (FInViewCone( &vecEnd, pEdict ) && + FVisible( vecEnd, pEdict )) + { + if ((mod_id == TFC_DLL) && + (pEdict->v.playerclass == TFC_CLASS_MEDIC)) + { + if (pBot->pBotEnemy->v.health >= pBot->pBotEnemy->v.max_health) + { + pBot->pBotEnemy = NULL; // player is healed, null out pointer + } + } + else + { + // if enemy is still visible and in field of view, keep it + + // face the enemy + Vector v_enemy = pBot->pBotEnemy->v.origin - pEdict->v.origin; + Vector bot_angles = UTIL_VecToAngles( v_enemy ); + + pEdict->v.ideal_yaw = bot_angles.y; + + BotFixIdealYaw(pEdict); + + // keep track of when we last saw an enemy + pBot->f_bot_see_enemy_time = gpGlobals->time; + + return (pBot->pBotEnemy); + } + } + } + + pent = NULL; + pNewEnemy = NULL; + nearestdistance = 1000; + + if (mod_id == TFC_DLL) + { + if (pEdict->v.playerclass == TFC_CLASS_MEDIC) + { + // search the world for players... + for (i = 1; i <= gpGlobals->maxClients; i++) + { + edict_t *pPlayer = INDEXENT(i); + + // skip invalid players and skip self (i.e. this bot) + if ((pPlayer) && (!pPlayer->free) && (pPlayer != pEdict)) + { + // skip this player if not alive (i.e. dead or dying) + if (!IsAlive(pPlayer)) + continue; + + if ((b_observer_mode) && !(pPlayer->v.flags & FL_FAKECLIENT)) + continue; + + int player_team = UTIL_GetTeam(pPlayer); + int bot_team = UTIL_GetTeam(pEdict); + + // don't target your enemies... + if ((bot_team != player_team) && + !(team_allies[bot_team] & (1<v.health / pPlayer->v.max_health) > 0.50) + continue; // health greater than 50% so ignore + + vecEnd = pPlayer->v.origin + pPlayer->v.view_ofs; + + // see if bot can see the player... + if (FInViewCone( &vecEnd, pEdict ) && + FVisible( vecEnd, pEdict )) + { + float distance = (pPlayer->v.origin - pEdict->v.origin).Length(); + + if (distance < nearestdistance) + { + nearestdistance = distance; + pNewEnemy = pPlayer; + + pBot->pBotUser = NULL; // don't follow user when enemy found + } + } + } + } + } + + if (pNewEnemy == NULL) + { + while ((pent = UTIL_FindEntityByClassname( pent, "building_sentrygun" )) != NULL) + { + int sentry_team = -1; + int bot_team = UTIL_GetTeam(pEdict); + + if (pent->v.colormap == 0xA096) + sentry_team = 0; // blue team's sentry + else if (pent->v.colormap == 0x04FA) + sentry_team = 1; // red team's sentry + else if (pent->v.colormap == 0x372D) + sentry_team = 2; // yellow team's sentry + else if (pent->v.colormap == 0x6E64) + sentry_team = 3; // green team's sentry + + // don't target your own team's sentry guns... + if (bot_team == sentry_team) + continue; + + // don't target your allie's sentry guns either... + if (team_allies[bot_team] & (1<v.origin + pent->v.view_ofs; + + // is this sentry gun visible? + if (FInViewCone( &vecEnd, pEdict ) && + FVisible( vecEnd, pEdict )) + { + float distance = (pent->v.origin - pEdict->v.origin).Length(); + + // is this the closest sentry gun? + if (distance < nearestdistance) + { + nearestdistance = distance; + pNewEnemy = pent; + + pBot->pBotUser = NULL; // don't follow user when enemy found + } + } + } + } + } + + if (pNewEnemy == NULL) + { + nearestdistance = 2500; + + // search the world for players...(and enemies) + //for (i = 1; i <= gpGlobals->maxClients; i++) + for (i = 1; i <= gpGlobals->maxEntities; i++) + { + edict_t *pEntity = INDEXENT(i); + + // skip invalid players and skip self (i.e. this bot) + if ((pEntity) && (!pEntity->free) && (pEntity != pEdict) && (FBitSet(pEntity->v.flags, FL_MONSTER) || FBitSet(pEntity->v.flags, FL_CLIENT))) + { + // Skip webs? + const char* theClassName = STRING(pEntity->v.classname); + + // Skip cloaked players +// if(pEntity->v.iuser4 & MASK_ALIEN_CLOAKED) +// continue; + + // skip this player if not alive (i.e. dead or dying) + if (!IsAlive(pEntity)) + continue; + + if ((b_observer_mode) && !(pEntity->v.flags & FL_FAKECLIENT)) + continue; + + if (!checked_teamplay) // check for team play... + BotCheckTeamplay(); + + // is team play enabled? + if (is_team_play > 0.0) + { + int player_team = UTIL_GetTeam(pEntity); + int bot_team = UTIL_GetTeam(pEdict); + + // don't target your teammates... + if (bot_team == player_team) + continue; + + if (mod_id == TFC_DLL) + { + // don't target your allies either... + if (team_allies[bot_team] & (1<v.origin + pEntity->v.view_ofs; + + float theDistance = (pEdict->v.origin - pEntity->v.origin).Length(); + + // see if bot can see the player... + if ((FInViewCone( &vecEnd, pEdict ) && + FVisible( vecEnd, pEdict )) || (theDistance < 32)) + { + float distance = (pEntity->v.origin - pEdict->v.origin).Length(); + if (distance < nearestdistance) + { + nearestdistance = distance; + pNewEnemy = pEntity; + + pBot->pBotUser = NULL; // don't follow user when enemy found + } + } + } + } + } + + if (pNewEnemy) + { + // face the enemy + Vector v_enemy = pNewEnemy->v.origin - pEdict->v.origin; + Vector bot_angles = UTIL_VecToAngles( v_enemy ); + + pEdict->v.ideal_yaw = bot_angles.y; + + BotFixIdealYaw(pEdict); + + // keep track of when we last saw an enemy + pBot->f_bot_see_enemy_time = gpGlobals->time; + } + + // has the bot NOT seen an ememy for at least 5 seconds (time to reload)? + if ((pBot->f_bot_see_enemy_time > 0) && + ((pBot->f_bot_see_enemy_time + 5.0) <= gpGlobals->time)) + { + pBot->f_bot_see_enemy_time = -1; // so we won't keep reloading + + if ((mod_id == VALVE_DLL) || (mod_id == GEARBOX_DLL) || (mod_id == AVH_DLL)) + { + pEdict->v.button |= IN_RELOAD; // press reload button + } + } + + return (pNewEnemy); +} + + +Vector BotBodyTarget( edict_t *pBotEnemy, bot_t *pBot ) +{ + Vector target; + float f_distance; + float f_scale; + int d_x = 0; + int d_y = 0; + int d_z = 0; + + edict_t *pEdict = pBot->pEdict; + + f_distance = (pBotEnemy->v.origin - pEdict->v.origin).Length(); + + if (f_distance > 1000) + f_scale = 1.0; + else if (f_distance > 100) + f_scale = f_distance / 1000.0; + else + f_scale = 0.1; + + switch (pBot->bot_skill) + { + case 0: + // VERY GOOD, same as from CBasePlayer::BodyTarget (in player.h) + target = pBotEnemy->v.origin + pBotEnemy->v.view_ofs * RANDOM_FLOAT( 0.5, 1.1 ); + d_x = 0; // no offset + d_y = 0; + d_z = 0; + break; + case 1: + // GOOD, offset a little for x, y, and z + target = pBotEnemy->v.origin + pBotEnemy->v.view_ofs; // aim for the head (if you can find it) + d_x = RANDOM_FLOAT(-5, 5) * f_scale; + d_y = RANDOM_FLOAT(-5, 5) * f_scale; + d_z = RANDOM_FLOAT(-10, 10) * f_scale; + break; + case 2: + // FAIR, offset somewhat for x, y, and z + target = pBotEnemy->v.origin; // aim for the body + d_x = RANDOM_FLOAT(-10, 10) * f_scale; + d_y = RANDOM_FLOAT(-10, 10) * f_scale; + d_z = RANDOM_FLOAT(-18, 18) * f_scale; + break; + case 3: + // POOR, offset for x, y, and z + target = pBotEnemy->v.origin; // aim for the body + d_x = RANDOM_FLOAT(-20, 20) * f_scale; + d_y = RANDOM_FLOAT(-20, 20) * f_scale; + d_z = RANDOM_FLOAT(-32, 32) * f_scale; + break; + case 4: + // BAD, offset lots for x, y, and z + target = pBotEnemy->v.origin; // aim for the body + d_x = RANDOM_FLOAT(-35, 35) * f_scale; + d_y = RANDOM_FLOAT(-35, 35) * f_scale; + d_z = RANDOM_FLOAT(-50, 50) * f_scale; + break; + } + + target = target + Vector(d_x, d_y, d_z); + + return target; +} + + +// specifing a weapon_choice allows you to choose the weapon the bot will +// use (assuming enough ammo exists for that weapon) +// BotFireWeapon will return TRUE if weapon was fired, FALSE otherwise + +bool BotFireWeapon( Vector v_enemy, bot_t *pBot, int weapon_choice) +{ + bot_weapon_select_t *pSelect = NULL; + bot_fire_delay_t *pDelay = NULL; + int select_index; + int iId; + bool use_primary; + bool use_secondary; + int use_percent; + int primary_percent; + + edict_t *pEdict = pBot->pEdict; + + float distance = v_enemy.Length(); // how far away is the enemy? + + if (mod_id == VALVE_DLL) + { + pSelect = &valve_weapon_select[0]; + pDelay = &valve_fire_delay[0]; + } + else if (mod_id == TFC_DLL) + { + pSelect = &tfc_weapon_select[0]; + pDelay = &tfc_fire_delay[0]; + } + else if (mod_id == CSTRIKE_DLL) + { + pSelect = &cs_weapon_select[0]; + pDelay = &cs_fire_delay[0]; + } + else if (mod_id == GEARBOX_DLL) + { + pSelect = &gearbox_weapon_select[0]; + pDelay = &gearbox_fire_delay[0]; + } + else if (mod_id == FRONTLINE_DLL) + { + pSelect = &frontline_weapon_select[0]; + pDelay = &frontline_fire_delay[0]; + } + else if (mod_id == AVH_DLL) + { + pSelect = &ns_weapon_select[0]; + pDelay = &ns_fire_delay[0]; + } + + if (pSelect) + { + // are we charging the primary fire? + if (pBot->f_primary_charging > 0) + { + iId = pBot->charging_weapon_id; + + if (mod_id == TFC_DLL) + { + if (iId == TF_WEAPON_SNIPERRIFLE) + { + pBot->f_move_speed = 0; // don't move while using sniper rifle + } + } + + // is it time to fire the charged weapon? + if (pBot->f_primary_charging <= gpGlobals->time) + { + // we DON'T set pEdict->v.button here to release the + // fire button which will fire the charged weapon + + pBot->f_primary_charging = -1; // -1 means not charging + + // find the correct fire delay for this weapon + select_index = 0; + + while ((pSelect[select_index].iId) && + (pSelect[select_index].iId != iId)) + select_index++; + + // set next time to shoot + int skill = pBot->bot_skill; + float base_delay, min_delay, max_delay; + + base_delay = pDelay[select_index].primary_base_delay; + min_delay = pDelay[select_index].primary_min_delay[skill]; + max_delay = pDelay[select_index].primary_max_delay[skill]; + + pBot->f_shoot_time = gpGlobals->time + base_delay + + RANDOM_FLOAT(min_delay, max_delay); + + return TRUE; + } + else + { + pEdict->v.button |= IN_ATTACK; // charge the weapon + pBot->f_shoot_time = gpGlobals->time; // keep charging + + return TRUE; + } + } + + // are we charging the secondary fire? + if (pBot->f_secondary_charging > 0) + { + iId = pBot->charging_weapon_id; + + // is it time to fire the charged weapon? + if (pBot->f_secondary_charging <= gpGlobals->time) + { + // we DON'T set pEdict->v.button here to release the + // fire button which will fire the charged weapon + + pBot->f_secondary_charging = -1; // -1 means not charging + + // find the correct fire delay for this weapon + select_index = 0; + + while ((pSelect[select_index].iId) && + (pSelect[select_index].iId != iId)) + select_index++; + + // set next time to shoot + int skill = pBot->bot_skill; + float base_delay, min_delay, max_delay; + + base_delay = pDelay[select_index].secondary_base_delay; + min_delay = pDelay[select_index].secondary_min_delay[skill]; + max_delay = pDelay[select_index].secondary_max_delay[skill]; + + pBot->f_shoot_time = gpGlobals->time + base_delay + + RANDOM_FLOAT(min_delay, max_delay); + + return TRUE; + } + else + { + pEdict->v.button |= IN_ATTACK2; // charge the weapon + pBot->f_shoot_time = gpGlobals->time; // keep charging + + return TRUE; + } + } + + select_index = 0; + + // loop through all the weapons until terminator is found... + while (pSelect[select_index].iId) + { + // was a weapon choice specified? (and if so do they NOT match?) + if ((weapon_choice != 0) && + (weapon_choice != pSelect[select_index].iId)) + { + select_index++; // skip to next weapon + continue; + } + + // is the bot NOT carrying this weapon? + if (!(pBot->bot_weapons & (1<bot_skill+1) > pSelect[select_index].skill_level) + { + select_index++; // skip to next weapon + continue; + } + + // is the bot underwater and does this weapon NOT work under water? + if ((pEdict->v.waterlevel == 3) && + !(pSelect[select_index].can_use_underwater)) + { + select_index++; // skip to next weapon + continue; + } + + use_percent = RANDOM_LONG(1, 100); + + // is use percent greater than weapon use percent? + if (use_percent > pSelect[select_index].use_percent) + { + select_index++; // skip to next weapon + continue; + } + + iId = pSelect[select_index].iId; + use_primary = FALSE; + use_secondary = FALSE; + primary_percent = RANDOM_LONG(1, 100); + + // is primary percent less than weapon primary percent AND + // no ammo required for this weapon OR + // enough ammo available to fire AND + // the bot is far enough away to use primary fire AND + // the bot is close enough to the enemy to use primary fire + + if ((primary_percent <= pSelect[select_index].primary_fire_percent) && + ((weapon_defs[iId].iAmmo1 == -1) || + (pBot->m_rgAmmo[weapon_defs[iId].iAmmo1] >= + pSelect[select_index].min_primary_ammo)) && + (distance >= pSelect[select_index].primary_min_distance) && + (distance <= pSelect[select_index].primary_max_distance)) + { + use_primary = TRUE; + } + + // otherwise see if there is enough secondary ammo AND + // the bot is far enough away to use secondary fire AND + // the bot is close enough to the enemy to use secondary fire + + else if (((weapon_defs[iId].iAmmo2 == -1) || + (pBot->m_rgAmmo[weapon_defs[iId].iAmmo2] >= + pSelect[select_index].min_secondary_ammo)) && + (distance >= pSelect[select_index].secondary_min_distance) && + (distance <= pSelect[select_index].secondary_max_distance)) + { + use_secondary = TRUE; + } + + // see if there wasn't enough ammo to fire the weapon... + if ((use_primary == FALSE) && (use_secondary == FALSE)) + { + select_index++; // skip to next weapon + continue; + } + + // select this weapon if it isn't already selected + if (pBot->current_weapon.iId != iId) + UTIL_SelectItem(pEdict, pSelect[select_index].weapon_name); + + if (pDelay[select_index].iId != iId) + { + char msg[80]; + sprintf(msg, "fire_delay mismatch for weapon id=%d\n",iId); + ALERT(at_console, msg); + + return FALSE; + } + + if (mod_id == TFC_DLL) + { + if (iId == TF_WEAPON_SNIPERRIFLE) + { + pBot->f_move_speed = 0; // don't move while using sniper rifle + + if (pEdict->v.velocity.Length() > 50) + { + return FALSE; // don't press attack key until velocity is < 50 + } + } + + if (pEdict->v.playerclass == TFC_CLASS_MEDIC) + { + int player_team = UTIL_GetTeam(pBot->pBotEnemy); + int bot_team = UTIL_GetTeam(pEdict); + + // only heal your teammates or allies... + if (((bot_team == player_team) || + (team_allies[bot_team] & (1<v.button |= IN_ATTACK; // use primary attack + + if (pSelect[select_index].primary_fire_charge) + { + pBot->charging_weapon_id = iId; + + // release primary fire after the appropriate delay... + pBot->f_primary_charging = gpGlobals->time + + pSelect[select_index].primary_charge_delay; + + pBot->f_shoot_time = gpGlobals->time; // keep charging + } + else + { + // set next time to shoot + if (pSelect[select_index].primary_fire_hold) + pBot->f_shoot_time = gpGlobals->time; // don't let button up + else + { + int skill = pBot->bot_skill; + float base_delay, min_delay, max_delay; + + base_delay = pDelay[select_index].primary_base_delay; + min_delay = pDelay[select_index].primary_min_delay[skill]; + max_delay = pDelay[select_index].primary_max_delay[skill]; + + pBot->f_shoot_time = gpGlobals->time + base_delay + + RANDOM_FLOAT(min_delay, max_delay); + } + } + } + else // MUST be use_secondary... + { + pEdict->v.button |= IN_ATTACK2; // use secondary attack + + if (pSelect[select_index].secondary_fire_charge) + { + pBot->charging_weapon_id = iId; + + // release secondary fire after the appropriate delay... + pBot->f_secondary_charging = gpGlobals->time + + pSelect[select_index].secondary_charge_delay; + + pBot->f_shoot_time = gpGlobals->time; // keep charging + } + else + { + // set next time to shoot + if (pSelect[select_index].secondary_fire_hold) + pBot->f_shoot_time = gpGlobals->time; // don't let button up + else + { + int skill = pBot->bot_skill; + float base_delay, min_delay, max_delay; + + base_delay = pDelay[select_index].secondary_base_delay; + min_delay = pDelay[select_index].secondary_min_delay[skill]; + max_delay = pDelay[select_index].secondary_max_delay[skill]; + + pBot->f_shoot_time = gpGlobals->time + base_delay + + RANDOM_FLOAT(min_delay, max_delay); + } + } + } + + return TRUE; // weapon was fired + } + } + + // didn't have any available weapons or ammo, return FALSE + return FALSE; +} + + +void BotShootAtEnemy( bot_t *pBot ) +{ + float f_distance; + + edict_t *pEdict = pBot->pEdict; + + // aim for the head and/or body + Vector v_enemy = BotBodyTarget( pBot->pBotEnemy, pBot ) - GetGunPosition(pEdict); + + pEdict->v.v_angle = UTIL_VecToAngles( v_enemy ); + + if (pEdict->v.v_angle.y > 180) + pEdict->v.v_angle.y -=360; + + // Paulo-La-Frite - START bot aiming bug fix + if (pEdict->v.v_angle.x > 180) + pEdict->v.v_angle.x -=360; + + // set the body angles to point the gun correctly + pEdict->v.angles.x = pEdict->v.v_angle.x / 3; + pEdict->v.angles.y = pEdict->v.v_angle.y; + pEdict->v.angles.z = 0; + + // adjust the view angle pitch to aim correctly (MUST be after body v.angles stuff) + pEdict->v.v_angle.x = -pEdict->v.v_angle.x; + // Paulo-La-Frite - END + + float x = pEdict->v.v_angle.y; + if (x > 180) x -= 360; + if (abs(pEdict->v.ideal_yaw - x) > 2.0) + fp = NULL; + + pEdict->v.ideal_yaw = pEdict->v.v_angle.y; + + BotFixIdealYaw(pEdict); + + + v_enemy.z = 0; // ignore z component (up & down) + + f_distance = v_enemy.Length(); // how far away is the enemy scum? + + if (f_distance > 200) // run if distance to enemy is far + pBot->f_move_speed = pBot->f_max_speed; + else if (f_distance > 20) // walk if distance is closer + pBot->f_move_speed = pBot->f_max_speed / 2; + else // don't move if close enough + pBot->f_move_speed = 0.0; + + + // is it time to shoot yet? + if (pBot->f_shoot_time <= gpGlobals->time) + { + // select the best weapon to use at this distance and fire... + BotFireWeapon(v_enemy, pBot, 0); + } +} + + +bool BotShootTripmine( bot_t *pBot ) +{ + edict_t *pEdict = pBot->pEdict; + + if (pBot->b_shoot_tripmine != TRUE) + return FALSE; + + // aim at the tripmine and fire the glock... + + Vector v_enemy = pBot->v_tripmine - GetGunPosition( pEdict ); + + pEdict->v.v_angle = UTIL_VecToAngles( v_enemy ); + + if (pEdict->v.v_angle.y > 180) + pEdict->v.v_angle.y -=360; + + // Paulo-La-Frite - START bot aiming bug fix + if (pEdict->v.v_angle.x > 180) + pEdict->v.v_angle.x -=360; + + // set the body angles to point the gun correctly + pEdict->v.angles.x = pEdict->v.v_angle.x / 3; + pEdict->v.angles.y = pEdict->v.v_angle.y; + pEdict->v.angles.z = 0; + + // adjust the view angle pitch to aim correctly (MUST be after body v.angles stuff) + pEdict->v.v_angle.x = -pEdict->v.v_angle.x; + // Paulo-La-Frite - END + + pEdict->v.ideal_yaw = pEdict->v.v_angle.y; + + BotFixIdealYaw(pEdict); + + return (BotFireWeapon( v_enemy, pBot, VALVE_WEAPON_GLOCK )); +} + diff --git a/main/source/HPB_bot/dlls/bot_func.h b/main/source/HPB_bot/dlls/bot_func.h new file mode 100644 index 00000000..c7427485 --- /dev/null +++ b/main/source/HPB_bot/dlls/bot_func.h @@ -0,0 +1,52 @@ +// +// HPB_bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// bot_func.h +// + +#ifndef BOT_FUNC_H +#define BOT_FUNC_H + + +//prototypes of bot functions... + +void BotSpawnInit( bot_t *pBot ); +void BotCreate( edict_t *pPlayer, const char *arg1, const char *arg2, + const char *arg3, const char *arg4 ); +void BotStartGame( bot_t *pBot ); +int BotInFieldOfView( bot_t *pBot, Vector dest ); +bool BotEntityIsVisible( bot_t *pBot, Vector dest ); +void BotFindItem( bot_t *pBot ); +void BotThink( bot_t *pBot ); + + +void BotFixIdealPitch( edict_t *pEdict ); +float BotChangePitch( bot_t *pBot, float speed ); +void BotFixIdealYaw( edict_t *pEdict ); +float BotChangeYaw( bot_t *pBot, float speed ); +bool BotFindWaypoint( bot_t *pBot ); +bool BotHeadTowardWaypoint( bot_t *pBot ); +void BotOnLadder( bot_t *pBot, float moved_distance ); +void BotUnderWater( bot_t *pBot ); +void BotUseLift( bot_t *pBot, float moved_distance ); +bool BotStuckInCorner( bot_t *pBot ); +void BotTurnAtWall( bot_t *pBot, TraceResult *tr ); +bool BotCantMoveForward( bot_t *pBot, TraceResult *tr ); +bool BotCanJumpUp( bot_t *pBot ); +bool BotCanDuckUnder( bot_t *pBot ); +void BotRandomTurn( bot_t *pBot ); +bool BotFollowUser( bot_t *pBot ); +bool BotCheckWallOnLeft( bot_t *pBot ); +bool BotCheckWallOnRight( bot_t *pBot ); + +edict_t *BotFindEnemy( bot_t *pBot ); +Vector BotBodyTarget( edict_t *pBotEnemy, bot_t *pBot ); +bool BotFireWeapon( Vector v_enemy, bot_t *pBot, int weapon_choice); +void BotShootAtEnemy( bot_t *pBot ); +bool BotShootTripmine( bot_t *pBot ); + + +#endif // BOT_FUNC_H + diff --git a/main/source/HPB_bot/dlls/bot_navigate.cpp b/main/source/HPB_bot/dlls/bot_navigate.cpp new file mode 100644 index 00000000..1f9672db --- /dev/null +++ b/main/source/HPB_bot/dlls/bot_navigate.cpp @@ -0,0 +1,1094 @@ +// +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// bot_navigate.cpp +// + +#include "extdll.h" +#include "util.h" +#include "cbase.h" + +#include "bot.h" +#include "bot_func.h" +#include "waypoint.h" + + +extern int mod_id; +extern WAYPOINT waypoints[MAX_WAYPOINTS]; +extern int num_waypoints; // number of waypoints currently in use +extern int team_allies[4]; +extern edict_t *pent_info_ctfdetect; +extern float is_team_play; +extern bool checked_teamplay; +extern FLAG_S flags[MAX_FLAGS]; +extern int num_flags; + +extern int flf_bug_fix; + +static FILE *fp; + + + +void BotFixIdealPitch(edict_t *pEdict) +{ + // check for wrap around of angle... + if (pEdict->v.idealpitch > 180) + pEdict->v.idealpitch -= 360; + + if (pEdict->v.idealpitch < -180) + pEdict->v.idealpitch += 360; +} + + +float BotChangePitch( bot_t *pBot, float speed ) +{ + edict_t *pEdict = pBot->pEdict; + float ideal; + float current; + float current_180; // current +/- 180 degrees + float diff; + + // turn from the current v_angle pitch to the idealpitch by selecting + // the quickest way to turn to face that direction + + current = pEdict->v.v_angle.x; + + ideal = pEdict->v.idealpitch; + + // find the difference in the current and ideal angle + diff = abs(current - ideal); + + // check if the bot is already facing the idealpitch direction... + if (diff <= 1) + return diff; // return number of degrees turned + + // check if difference is less than the max degrees per turn + if (diff < speed) + speed = diff; // just need to turn a little bit (less than max) + + // here we have four cases, both angle positive, one positive and + // the other negative, one negative and the other positive, or + // both negative. handle each case separately... + + if ((current >= 0) && (ideal >= 0)) // both positive + { + if (current > ideal) + current -= speed; + else + current += speed; + } + else if ((current >= 0) && (ideal < 0)) + { + current_180 = current - 180; + + if (current_180 > ideal) + current += speed; + else + current -= speed; + } + else if ((current < 0) && (ideal >= 0)) + { + current_180 = current + 180; + if (current_180 > ideal) + current += speed; + else + current -= speed; + } + else // (current < 0) && (ideal < 0) both negative + { + if (current > ideal) + current -= speed; + else + current += speed; + } + + // check for wrap around of angle... + if (current > 180) + current -= 360; + if (current < -180) + current += 360; + + pEdict->v.v_angle.x = current; + + return speed; // return number of degrees turned +} + + +void BotFixIdealYaw(edict_t *pEdict) +{ + // check for wrap around of angle... + if (pEdict->v.ideal_yaw > 180) + pEdict->v.ideal_yaw -= 360; + + if (pEdict->v.ideal_yaw < -180) + pEdict->v.ideal_yaw += 360; +} + + +float BotChangeYaw( bot_t *pBot, float speed ) +{ + edict_t *pEdict = pBot->pEdict; + float ideal; + float current; + float current_180; // current +/- 180 degrees + float diff; + + // turn from the current v_angle yaw to the ideal_yaw by selecting + // the quickest way to turn to face that direction + + current = pEdict->v.v_angle.y; + + ideal = pEdict->v.ideal_yaw; + + // find the difference in the current and ideal angle + diff = abs(current - ideal); + + // check if the bot is already facing the ideal_yaw direction... + if (diff <= 1) + return diff; // return number of degrees turned + + // check if difference is less than the max degrees per turn + if (diff < speed) + speed = diff; // just need to turn a little bit (less than max) + + // here we have four cases, both angle positive, one positive and + // the other negative, one negative and the other positive, or + // both negative. handle each case separately... + + if ((current >= 0) && (ideal >= 0)) // both positive + { + if (current > ideal) + current -= speed; + else + current += speed; + } + else if ((current >= 0) && (ideal < 0)) + { + current_180 = current - 180; + + if (current_180 > ideal) + current += speed; + else + current -= speed; + } + else if ((current < 0) && (ideal >= 0)) + { + current_180 = current + 180; + if (current_180 > ideal) + current += speed; + else + current -= speed; + } + else // (current < 0) && (ideal < 0) both negative + { + if (current > ideal) + current -= speed; + else + current += speed; + } + + // check for wrap around of angle... + if (current > 180) + current -= 360; + if (current < -180) + current += 360; + + pEdict->v.v_angle.y = current; + + return speed; // return number of degrees turned +} + + +bool BotFindWaypoint( bot_t *pBot ) +{ + // Do whatever you want here to find the next waypoint that the + // bot should head towards + + return FALSE; // couldn't find a waypoint +} + + +bool BotHeadTowardWaypoint( bot_t *pBot ) +{ + // You could do other stuff here if you needed to. + + // This would probably be a good place to check to see how close to a + // the current waypoint the bot is, and if the bot is close enough to + // the desired waypoint then call BotFindWaypoint to find the next one. + + if (BotFindWaypoint(pBot)) + return TRUE; + else + return FALSE; +} + + +void BotOnLadder( bot_t *pBot, float moved_distance ) +{ + Vector v_src, v_dest, view_angles; + TraceResult tr; + float angle = 0.0; + bool done = FALSE; + + edict_t *pEdict = pBot->pEdict; + + // check if the bot has JUST touched this ladder... + if (pBot->ladder_dir == LADDER_UNKNOWN) + { + // try to square up the bot on the ladder... + while ((!done) && (angle < 180.0)) + { + // try looking in one direction (forward + angle) + view_angles = pEdict->v.v_angle; + view_angles.y = pEdict->v.v_angle.y + angle; + + if (view_angles.y < 0.0) + view_angles.y += 360.0; + if (view_angles.y > 360.0) + view_angles.y -= 360.0; + + UTIL_MakeVectors( view_angles ); + + v_src = pEdict->v.origin + pEdict->v.view_ofs; + v_dest = v_src + gpGlobals->v_forward * 30; + + UTIL_TraceLine( v_src, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + if (tr.flFraction < 1.0) // hit something? + { + if (strcmp("func_wall", STRING(tr.pHit->v.classname)) == 0) + { + // square up to the wall... + view_angles = UTIL_VecToAngles(tr.vecPlaneNormal); + + // Normal comes OUT from wall, so flip it around... + view_angles.y += 180; + + if (view_angles.y > 180) + view_angles.y -= 360; + + pEdict->v.ideal_yaw = view_angles.y; + + BotFixIdealYaw(pEdict); + + done = TRUE; + } + } + else + { + // try looking in the other direction (forward - angle) + view_angles = pEdict->v.v_angle; + view_angles.y = pEdict->v.v_angle.y - angle; + + if (view_angles.y < 0.0) + view_angles.y += 360.0; + if (view_angles.y > 360.0) + view_angles.y -= 360.0; + + UTIL_MakeVectors( view_angles ); + + v_src = pEdict->v.origin + pEdict->v.view_ofs; + v_dest = v_src + gpGlobals->v_forward * 30; + + UTIL_TraceLine( v_src, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + if (tr.flFraction < 1.0) // hit something? + { + if (strcmp("func_wall", STRING(tr.pHit->v.classname)) == 0) + { + // square up to the wall... + view_angles = UTIL_VecToAngles(tr.vecPlaneNormal); + + // Normal comes OUT from wall, so flip it around... + view_angles.y += 180; + + if (view_angles.y > 180) + view_angles.y -= 360; + + pEdict->v.ideal_yaw = view_angles.y; + + BotFixIdealYaw(pEdict); + + done = TRUE; + } + } + } + + angle += 10; + } + + if (!done) // if didn't find a wall, just reset ideal_yaw... + { + // set ideal_yaw to current yaw (so bot won't keep turning) + pEdict->v.ideal_yaw = pEdict->v.v_angle.y; + + BotFixIdealYaw(pEdict); + } + } + + // moves the bot up or down a ladder. if the bot can't move + // (i.e. get's stuck with someone else on ladder), the bot will + // change directions and go the other way on the ladder. + + if (pBot->ladder_dir == LADDER_UP) // is the bot currently going up? + { + pEdict->v.v_angle.x = -60; // look upwards + + // check if the bot hasn't moved much since the last location... + if ((moved_distance <= 1) && (pBot->prev_speed >= 1.0)) + { + // the bot must be stuck, change directions... + + pEdict->v.v_angle.x = 60; // look downwards + pBot->ladder_dir = LADDER_DOWN; + } + } + else if (pBot->ladder_dir == LADDER_DOWN) // is the bot currently going down? + { + pEdict->v.v_angle.x = 60; // look downwards + + // check if the bot hasn't moved much since the last location... + if ((moved_distance <= 1) && (pBot->prev_speed >= 1.0)) + { + // the bot must be stuck, change directions... + + pEdict->v.v_angle.x = -60; // look upwards + pBot->ladder_dir = LADDER_UP; + } + } + else // the bot hasn't picked a direction yet, try going up... + { + pEdict->v.v_angle.x = -60; // look upwards + pBot->ladder_dir = LADDER_UP; + } + + // move forward (i.e. in the direction the bot is looking, up or down) + pEdict->v.button |= IN_FORWARD; +} + + +void BotUnderWater( bot_t *pBot ) +{ + bool found_waypoint = FALSE; + + edict_t *pEdict = pBot->pEdict; + + // are there waypoints in this level (and not trying to exit water)? + if ((num_waypoints > 0) && + (pBot->f_exit_water_time < gpGlobals->time)) + { + // head towards a waypoint + found_waypoint = BotHeadTowardWaypoint(pBot); + } + + if (found_waypoint == FALSE) + { + // handle movements under water. right now, just try to keep from + // drowning by swimming up towards the surface and look to see if + // there is a surface the bot can jump up onto to get out of the + // water. bots DON'T like water! + + Vector v_src, v_forward; + TraceResult tr; + int contents; + + // swim up towards the surface + pEdict->v.v_angle.x = -60; // look upwards + + // move forward (i.e. in the direction the bot is looking, up or down) + pEdict->v.button |= IN_FORWARD; + + // set gpGlobals angles based on current view angle (for TraceLine) + UTIL_MakeVectors( pEdict->v.v_angle ); + + // look from eye position straight forward (remember: the bot is looking + // upwards at a 60 degree angle so TraceLine will go out and up... + + v_src = pEdict->v.origin + pEdict->v.view_ofs; // EyePosition() + v_forward = v_src + gpGlobals->v_forward * 90; + + // trace from the bot's eyes straight forward... + UTIL_TraceLine( v_src, v_forward, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // check if the trace didn't hit anything (i.e. nothing in the way)... + if (tr.flFraction >= 1.0) + { + // find out what the contents is of the end of the trace... + contents = UTIL_PointContents( tr.vecEndPos ); + + // check if the trace endpoint is in open space... + if (contents == CONTENTS_EMPTY) + { + // ok so far, we are at the surface of the water, continue... + + v_src = tr.vecEndPos; + v_forward = v_src; + v_forward.z -= 90; + + // trace from the previous end point straight down... + UTIL_TraceLine( v_src, v_forward, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // check if the trace hit something... + if (tr.flFraction < 1.0) + { + contents = UTIL_PointContents( tr.vecEndPos ); + + // if contents isn't water then assume it's land, jump! + if (contents != CONTENTS_WATER) + { + pEdict->v.button |= IN_JUMP; + } + } + } + } + } +} + + +void BotUseLift( bot_t *pBot, float moved_distance ) +{ + edict_t *pEdict = pBot->pEdict; + + // just need to press the button once, when the flag gets set... + if (pBot->f_use_button_time == gpGlobals->time) + { + pEdict->v.button = IN_USE; + + // face opposite from the button + pEdict->v.ideal_yaw += 180; // rotate 180 degrees + + BotFixIdealYaw(pEdict); + } + + // check if the bot has waited too long for the lift to move... + if (((pBot->f_use_button_time + 2.0) < gpGlobals->time) && + (!pBot->b_lift_moving)) + { + // clear use button flag + pBot->b_use_button = FALSE; + + // bot doesn't have to set f_find_item since the bot + // should already be facing away from the button + + pBot->f_move_speed = pBot->f_max_speed; + } + + // check if lift has started moving... + if ((moved_distance > 1) && (!pBot->b_lift_moving)) + { + pBot->b_lift_moving = TRUE; + } + + // check if lift has stopped moving... + if ((moved_distance <= 1) && (pBot->b_lift_moving)) + { + TraceResult tr1, tr2; + Vector v_src, v_forward, v_right, v_left; + Vector v_down, v_forward_down, v_right_down, v_left_down; + + pBot->b_use_button = FALSE; + + // TraceLines in 4 directions to find which way to go... + + UTIL_MakeVectors( pEdict->v.v_angle ); + + v_src = pEdict->v.origin + pEdict->v.view_ofs; + v_forward = v_src + gpGlobals->v_forward * 90; + v_right = v_src + gpGlobals->v_right * 90; + v_left = v_src + gpGlobals->v_right * -90; + + v_down = pEdict->v.v_angle; + v_down.x = v_down.x + 45; // look down at 45 degree angle + + UTIL_MakeVectors( v_down ); + + v_forward_down = v_src + gpGlobals->v_forward * 100; + v_right_down = v_src + gpGlobals->v_right * 100; + v_left_down = v_src + gpGlobals->v_right * -100; + + // try tracing forward first... + UTIL_TraceLine( v_src, v_forward, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr1); + UTIL_TraceLine( v_src, v_forward_down, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr2); + + // check if we hit a wall or didn't find a floor... + if ((tr1.flFraction < 1.0) || (tr2.flFraction >= 1.0)) + { + // try tracing to the RIGHT side next... + UTIL_TraceLine( v_src, v_right, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr1); + UTIL_TraceLine( v_src, v_right_down, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr2); + + // check if we hit a wall or didn't find a floor... + if ((tr1.flFraction < 1.0) || (tr2.flFraction >= 1.0)) + { + // try tracing to the LEFT side next... + UTIL_TraceLine( v_src, v_left, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr1); + UTIL_TraceLine( v_src, v_left_down, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr2); + + // check if we hit a wall or didn't find a floor... + if ((tr1.flFraction < 1.0) || (tr2.flFraction >= 1.0)) + { + // only thing to do is turn around... + pEdict->v.ideal_yaw += 180; // turn all the way around + } + else + { + pEdict->v.ideal_yaw += 90; // turn to the LEFT + } + } + else + { + pEdict->v.ideal_yaw -= 90; // turn to the RIGHT + } + + BotFixIdealYaw(pEdict); + } + + BotChangeYaw( pBot, pEdict->v.yaw_speed ); + + pBot->f_move_speed = pBot->f_max_speed; + } +} + + +bool BotStuckInCorner( bot_t *pBot ) +{ + TraceResult tr; + Vector v_src, v_dest; + edict_t *pEdict = pBot->pEdict; + + UTIL_MakeVectors( pEdict->v.v_angle ); + + // trace 45 degrees to the right... + v_src = pEdict->v.origin; + v_dest = v_src + gpGlobals->v_forward*20 + gpGlobals->v_right*20; + + UTIL_TraceLine( v_src, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + if (tr.flFraction >= 1.0) + return FALSE; // no wall, so not in a corner + + // trace 45 degrees to the left... + v_src = pEdict->v.origin; + v_dest = v_src + gpGlobals->v_forward*20 - gpGlobals->v_right*20; + + UTIL_TraceLine( v_src, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + if (tr.flFraction >= 1.0) + return FALSE; // no wall, so not in a corner + + return TRUE; // bot is in a corner +} + + +void BotTurnAtWall( bot_t *pBot, TraceResult *tr ) +{ + edict_t *pEdict = pBot->pEdict; + Vector Normal; + float Y, Y1, Y2, D1, D2, Z; + + // Find the normal vector from the trace result. The normal vector will + // be a vector that is perpendicular to the surface from the TraceResult. + + Normal = UTIL_VecToAngles(tr->vecPlaneNormal); + + // Since the bot keeps it's view angle in -180 < x < 180 degrees format, + // and since TraceResults are 0 < x < 360, we convert the bot's view + // angle (yaw) to the same format at TraceResult. + + Y = pEdict->v.v_angle.y; + Y = Y + 180; + if (Y > 359) Y -= 360; + + // Turn the normal vector around 180 degrees (i.e. make it point towards + // the wall not away from it. That makes finding the angles that the + // bot needs to turn a little easier. + + Normal.y = Normal.y - 180; + if (Normal.y < 0) + Normal.y += 360; + + // Here we compare the bots view angle (Y) to the Normal - 90 degrees (Y1) + // and the Normal + 90 degrees (Y2). These two angles (Y1 & Y2) represent + // angles that are parallel to the wall surface, but heading in opposite + // directions. We want the bot to choose the one that will require the + // least amount of turning (saves time) and have the bot head off in that + // direction. + + Y1 = Normal.y - 90; + if (RANDOM_LONG(1, 100) <= 50) + { + Y1 = Y1 - RANDOM_FLOAT(5.0, 20.0); + } + if (Y1 < 0) Y1 += 360; + + Y2 = Normal.y + 90; + if (RANDOM_LONG(1, 100) <= 50) + { + Y2 = Y2 + RANDOM_FLOAT(5.0, 20.0); + } + if (Y2 > 359) Y2 -= 360; + + // D1 and D2 are the difference (in degrees) between the bot's current + // angle and Y1 or Y2 (respectively). + + D1 = abs(Y - Y1); + if (D1 > 179) D1 = abs(D1 - 360); + D2 = abs(Y - Y2); + if (D2 > 179) D2 = abs(D2 - 360); + + // If difference 1 (D1) is more than difference 2 (D2) then the bot will + // have to turn LESS if it heads in direction Y1 otherwise, head in + // direction Y2. I know this seems backwards, but try some sample angles + // out on some graph paper and go through these equations using a + // calculator, you'll see what I mean. + + if (D1 > D2) + Z = Y1; + else + Z = Y2; + + // convert from TraceResult 0 to 360 degree format back to bot's + // -180 to 180 degree format. + + if (Z > 180) + Z -= 360; + + // set the direction to head off into... + pEdict->v.ideal_yaw = Z; + + BotFixIdealYaw(pEdict); +} + + +bool BotCantMoveForward( bot_t *pBot, TraceResult *tr ) +{ + edict_t *pEdict = pBot->pEdict; + + // use some TraceLines to determine if anything is blocking the current + // path of the bot. + + Vector v_src, v_forward; + + UTIL_MakeVectors( pEdict->v.v_angle ); + + // first do a trace from the bot's eyes forward... + + v_src = pEdict->v.origin + pEdict->v.view_ofs; // EyePosition() + v_forward = v_src + gpGlobals->v_forward * 40; + + // trace from the bot's eyes straight forward... + UTIL_TraceLine( v_src, v_forward, dont_ignore_monsters, + pEdict->v.pContainingEntity, tr); + + // check if the trace hit something... + if (tr->flFraction < 1.0) + { + return TRUE; // bot's head will hit something + } + + // bot's head is clear, check at waist level... + + v_src = pEdict->v.origin; + v_forward = v_src + gpGlobals->v_forward * 40; + + // trace from the bot's waist straight forward... + UTIL_TraceLine( v_src, v_forward, dont_ignore_monsters, + pEdict->v.pContainingEntity, tr); + + // check if the trace hit something... + if (tr->flFraction < 1.0) + { + return TRUE; // bot's body will hit something + } + + return FALSE; // bot can move forward, return false +} + + +bool BotCanJumpUp( bot_t *pBot ) +{ + // What I do here is trace 3 lines straight out, one unit higher than + // the highest normal jumping distance. I trace once at the center of + // the body, once at the right side, and once at the left side. If all + // three of these TraceLines don't hit an obstruction then I know the + // area to jump to is clear. I then need to trace from head level, + // above where the bot will jump to, downward to see if there is anything + // blocking the jump. There could be a narrow opening that the body + // will not fit into. These horizontal and vertical TraceLines seem + // to catch most of the problems with falsely trying to jump on something + // that the bot can not get onto. + + // Make flier imitate flight + if(pBot->pEdict->v.iuser3 == AVH_USER3_ALIEN_PLAYER3) + { + if(RANDOM_LONG(0, 2) == 0) + { + return TRUE; + } + } + + TraceResult tr; + Vector v_jump, v_source, v_dest; + edict_t *pEdict = pBot->pEdict; + + // convert current view angle to vectors for TraceLine math... + + v_jump = pEdict->v.v_angle; + v_jump.x = 0; // reset pitch to 0 (level horizontally) + v_jump.z = 0; // reset roll to 0 (straight up and down) + + UTIL_MakeVectors( v_jump ); + + // use center of the body first... + + // maximum jump height is 45, so check one unit above that (46) + v_source = pEdict->v.origin + Vector(0, 0, -36 + 46); + v_dest = v_source + gpGlobals->v_forward * 24; + + // trace a line forward at maximum jump height... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace hit something, return FALSE + if (tr.flFraction < 1.0) + return FALSE; + + // now check same height to one side of the bot... + v_source = pEdict->v.origin + gpGlobals->v_right * 16 + Vector(0, 0, -36 + 46); + v_dest = v_source + gpGlobals->v_forward * 24; + + // trace a line forward at maximum jump height... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace hit something, return FALSE + if (tr.flFraction < 1.0) + return FALSE; + + // now check same height on the other side of the bot... + v_source = pEdict->v.origin + gpGlobals->v_right * -16 + Vector(0, 0, -36 + 46); + v_dest = v_source + gpGlobals->v_forward * 24; + + // trace a line forward at maximum jump height... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace hit something, return FALSE + if (tr.flFraction < 1.0) + return FALSE; + + // now trace from head level downward to check for obstructions... + + // start of trace is 24 units in front of bot, 72 units above head... + v_source = pEdict->v.origin + gpGlobals->v_forward * 24; + + // offset 72 units from top of head (72 + 36) + v_source.z = v_source.z + 108; + + // end point of trace is 99 units straight down from start... + // (99 is 108 minus the jump limit height which is 45 - 36 = 9) + v_dest = v_source + Vector(0, 0, -99); + + // trace a line straight down toward the ground... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace hit something, return FALSE + if (tr.flFraction < 1.0) + return FALSE; + + // now check same height to one side of the bot... + v_source = pEdict->v.origin + gpGlobals->v_right * 16 + gpGlobals->v_forward * 24; + v_source.z = v_source.z + 108; + v_dest = v_source + Vector(0, 0, -99); + + // trace a line straight down toward the ground... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace hit something, return FALSE + if (tr.flFraction < 1.0) + return FALSE; + + // now check same height on the other side of the bot... + v_source = pEdict->v.origin + gpGlobals->v_right * -16 + gpGlobals->v_forward * 24; + v_source.z = v_source.z + 108; + v_dest = v_source + Vector(0, 0, -99); + + // trace a line straight down toward the ground... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace hit something, return FALSE + if (tr.flFraction < 1.0) + return FALSE; + + return TRUE; +} + + +bool BotCanDuckUnder( bot_t *pBot ) +{ + // What I do here is trace 3 lines straight out, one unit higher than + // the ducking height. I trace once at the center of the body, once + // at the right side, and once at the left side. If all three of these + // TraceLines don't hit an obstruction then I know the area to duck to + // is clear. I then need to trace from the ground up, 72 units, to make + // sure that there is something blocking the TraceLine. Then we know + // we can duck under it. + + TraceResult tr; + Vector v_duck, v_source, v_dest; + edict_t *pEdict = pBot->pEdict; + + // convert current view angle to vectors for TraceLine math... + + v_duck = pEdict->v.v_angle; + v_duck.x = 0; // reset pitch to 0 (level horizontally) + v_duck.z = 0; // reset roll to 0 (straight up and down) + + UTIL_MakeVectors( v_duck ); + + // use center of the body first... + + // duck height is 36, so check one unit above that (37) + v_source = pEdict->v.origin + Vector(0, 0, -36 + 37); + v_dest = v_source + gpGlobals->v_forward * 24; + + // trace a line forward at duck height... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace hit something, return FALSE + if (tr.flFraction < 1.0) + return FALSE; + + // now check same height to one side of the bot... + v_source = pEdict->v.origin + gpGlobals->v_right * 16 + Vector(0, 0, -36 + 37); + v_dest = v_source + gpGlobals->v_forward * 24; + + // trace a line forward at duck height... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace hit something, return FALSE + if (tr.flFraction < 1.0) + return FALSE; + + // now check same height on the other side of the bot... + v_source = pEdict->v.origin + gpGlobals->v_right * -16 + Vector(0, 0, -36 + 37); + v_dest = v_source + gpGlobals->v_forward * 24; + + // trace a line forward at duck height... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace hit something, return FALSE + if (tr.flFraction < 1.0) + return FALSE; + + // now trace from the ground up to check for object to duck under... + + // start of trace is 24 units in front of bot near ground... + v_source = pEdict->v.origin + gpGlobals->v_forward * 24; + v_source.z = v_source.z - 35; // offset to feet + 1 unit up + + // end point of trace is 72 units straight up from start... + v_dest = v_source + Vector(0, 0, 72); + + // trace a line straight up in the air... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace didn't hit something, return FALSE + if (tr.flFraction >= 1.0) + return FALSE; + + // now check same height to one side of the bot... + v_source = pEdict->v.origin + gpGlobals->v_right * 16 + gpGlobals->v_forward * 24; + v_source.z = v_source.z - 35; // offset to feet + 1 unit up + v_dest = v_source + Vector(0, 0, 72); + + // trace a line straight up in the air... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace didn't hit something, return FALSE + if (tr.flFraction >= 1.0) + return FALSE; + + // now check same height on the other side of the bot... + v_source = pEdict->v.origin + gpGlobals->v_right * -16 + gpGlobals->v_forward * 24; + v_source.z = v_source.z - 35; // offset to feet + 1 unit up + v_dest = v_source + Vector(0, 0, 72); + + // trace a line straight up in the air... + UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // if trace didn't hit something, return FALSE + if (tr.flFraction >= 1.0) + return FALSE; + + return TRUE; +} + + +void BotRandomTurn( bot_t *pBot ) +{ + pBot->f_move_speed = 0; // don't move while turning + + if (RANDOM_LONG(1, 100) <= 10) + { + // 10 percent of the time turn completely around... + pBot->pEdict->v.ideal_yaw += 180; + } + else + { + // turn randomly between 30 and 60 degress + if (pBot->wander_dir == WANDER_LEFT) + pBot->pEdict->v.ideal_yaw += RANDOM_LONG(30, 60); + else + pBot->pEdict->v.ideal_yaw -= RANDOM_LONG(30, 60); + } + + BotFixIdealYaw(pBot->pEdict); +} + + +bool BotFollowUser( bot_t *pBot ) +{ + bool user_visible; + float f_distance; + edict_t *pEdict = pBot->pEdict; + + Vector vecEnd = pBot->pBotUser->v.origin + pBot->pBotUser->v.view_ofs; + + if (pBot->pEdict->v.waterlevel != 3) // is bot NOT under water? + pEdict->v.v_angle.x = 0; // reset pitch to 0 (level horizontally) + + pEdict->v.v_angle.z = 0; // reset roll to 0 (straight up and down) + + pEdict->v.angles.x = 0; + pEdict->v.angles.y = pEdict->v.v_angle.y; + pEdict->v.angles.z = 0; + + // Stop following when person crouches + if (!IsAlive( pBot->pBotUser ) || (pBot->pBotUser->v.flags & FL_DUCKING)) + { + // the bot's user is dead! + pBot->pBotUser = NULL; + return FALSE; + } + + user_visible = FInViewCone( &vecEnd, pEdict ) && + FVisible( vecEnd, pEdict ); + + // check if the "user" is still visible or if the user has been visible + // in the last 5 seconds (or the player just starting "using" the bot) + + if (user_visible || (pBot->f_bot_use_time + 5 > gpGlobals->time)) + { + if (user_visible) + pBot->f_bot_use_time = gpGlobals->time; // reset "last visible time" + + // face the user + Vector v_user = pBot->pBotUser->v.origin - pEdict->v.origin; + Vector bot_angles = UTIL_VecToAngles( v_user ); + + pEdict->v.ideal_yaw = bot_angles.y; + + BotFixIdealYaw(pEdict); + + f_distance = v_user.Length( ); // how far away is the "user"? + + if (f_distance > 200) // run if distance to enemy is far + pBot->f_move_speed = pBot->f_max_speed; + else if (f_distance > 50) // walk if distance is closer + pBot->f_move_speed = pBot->f_max_speed / 2; + else // don't move if close enough + pBot->f_move_speed = 0.0; + + return TRUE; + } + else + { + // person to follow has gone out of sight... + pBot->pBotUser = NULL; + + return FALSE; + } +} + + +bool BotCheckWallOnLeft( bot_t *pBot ) +{ + edict_t *pEdict = pBot->pEdict; + Vector v_src, v_left; + TraceResult tr; + + UTIL_MakeVectors( pEdict->v.v_angle ); + + // do a trace to the left... + + v_src = pEdict->v.origin; + v_left = v_src + gpGlobals->v_right * -40; // 40 units to the left + + UTIL_TraceLine( v_src, v_left, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // check if the trace hit something... + if (tr.flFraction < 1.0) + { + if (pBot->f_wall_on_left < 1.0) + pBot->f_wall_on_left = gpGlobals->time; + + return TRUE; + } + + return FALSE; +} + + +bool BotCheckWallOnRight( bot_t *pBot ) +{ + edict_t *pEdict = pBot->pEdict; + Vector v_src, v_right; + TraceResult tr; + + UTIL_MakeVectors( pEdict->v.v_angle ); + + // do a trace to the right... + + v_src = pEdict->v.origin; + v_right = v_src + gpGlobals->v_right * 40; // 40 units to the right + + UTIL_TraceLine( v_src, v_right, dont_ignore_monsters, + pEdict->v.pContainingEntity, &tr); + + // check if the trace hit something... + if (tr.flFraction < 1.0) + { + if (pBot->f_wall_on_right < 1.0) + pBot->f_wall_on_right = gpGlobals->time; + + return TRUE; + } + + return FALSE; +} + diff --git a/main/source/HPB_bot/dlls/bot_start.cpp b/main/source/HPB_bot/dlls/bot_start.cpp new file mode 100644 index 00000000..9e676b4a --- /dev/null +++ b/main/source/HPB_bot/dlls/bot_start.cpp @@ -0,0 +1,813 @@ +// +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// bot_start.cpp +// + +#include "extdll.h" +#include "util.h" +#include "cbase.h" + +#include "bot.h" +#include "bot_func.h" +#include "bot_weapons.h" +#include "mod/AvHMessage.h" + +extern int mod_id; +extern edict_t *pent_info_ctfdetect; + +extern int max_team_players[4]; +extern int team_class_limits[4]; +extern int max_teams; + + +void BotStartGame( bot_t *pBot ) +{ + char c_team[32]; + char c_class[32]; + char c_item[32]; + int index, count, retry_count; + edict_t *pPlayer; + int team; + int class_not_allowed; + + edict_t *pEdict = pBot->pEdict; + + //CBaseEntity* theEntity = CBaseEntity::Instance(pEdict); + //AvHPlayer* thePlayer = dynamic_cast(theEntity); + + if (mod_id == TFC_DLL) + { + if ((pBot->start_action == MSG_TFC_IDLE) && + (pBot->create_time + 3.0 <= gpGlobals->time)) + { + pBot->start_action = MSG_TFC_TEAM_SELECT; // force team selection + } + + // handle Team Fortress Classic stuff here... + + if (pBot->start_action == MSG_TFC_TEAM_SELECT) + { + pBot->start_action = MSG_TFC_IDLE; // switch back to idle + pBot->create_time = gpGlobals->time; // reset + + if ((pBot->bot_team != 1) && (pBot->bot_team != 2) && + (pBot->bot_team != 3) && (pBot->bot_team != 4) && + (pBot->bot_team != 5)) + pBot->bot_team = -1; + + if (pBot->bot_team == -1) + pBot->bot_team = RANDOM_LONG(1, max_teams); + + retry_count = 0; + + while ((retry_count < 4) && + (max_team_players[pBot->bot_team-1] > 0)) // not unlimited? + { + count = 0; + + // count number of players on this team... + for (index = 1; index <= gpGlobals->maxClients; index++) + { + pPlayer = INDEXENT(index); + + if (pPlayer && !pPlayer->free) + { + if (UTIL_GetTeam(pPlayer) == (pBot->bot_team - 1)) + count++; + } + } + + if (count < max_team_players[pBot->bot_team-1]) + break; // haven't reached limit yet, continue + else + { + pBot->bot_team++; + + if (pBot->bot_team > max_teams) + pBot->bot_team = 1; + + retry_count++; + } + } + + // select the team the bot wishes to join... + if (pBot->bot_team == 1) + strcpy(c_team, "1"); + else if (pBot->bot_team == 2) + strcpy(c_team, "2"); + else if (pBot->bot_team == 3) + strcpy(c_team, "3"); + else if (pBot->bot_team == 4) + strcpy(c_team, "4"); + else + strcpy(c_team, "5"); + + FakeClientCommand(pEdict, "jointeam", c_team, NULL); + + return; + } + + if (pBot->start_action == MSG_TFC_CLASS_SELECT) + { + pBot->start_action = MSG_TFC_IDLE; // switch back to idle + pBot->create_time = gpGlobals->time; // reset + + if ((pBot->bot_class < 0) || (pBot->bot_class > 10)) + pBot->bot_class = -1; + + if (pBot->bot_class == -1) + pBot->bot_class = RANDOM_LONG(1, 10); + + team = UTIL_GetTeam(pEdict); + + if (team_class_limits[team] == -1) // civilian only? + { + pBot->bot_class = 0; // civilian + } + else + { + if (pBot->bot_class == 10) + class_not_allowed = team_class_limits[team] & (1<<7); + else if (pBot->bot_class <= 7) + class_not_allowed = team_class_limits[team] & (1<<(pBot->bot_class-1)); + else + class_not_allowed = team_class_limits[team] & (1<<(pBot->bot_class)); + + while (class_not_allowed) + { + pBot->bot_class = RANDOM_LONG(1, 10); + + if (pBot->bot_class == 10) + class_not_allowed = team_class_limits[team] & (1<<7); + else if (pBot->bot_class <= 7) + class_not_allowed = team_class_limits[team] & (1<<(pBot->bot_class-1)); + else + class_not_allowed = team_class_limits[team] & (1<<(pBot->bot_class)); + } + } + + // select the class the bot wishes to use... + if (pBot->bot_class == 0) + strcpy(c_class, "civilian"); + else if (pBot->bot_class == 1) + strcpy(c_class, "scout"); + else if (pBot->bot_class == 2) + strcpy(c_class, "sniper"); + else if (pBot->bot_class == 3) + strcpy(c_class, "soldier"); + else if (pBot->bot_class == 4) + strcpy(c_class, "demoman"); + else if (pBot->bot_class == 5) + strcpy(c_class, "medic"); + else if (pBot->bot_class == 6) + strcpy(c_class, "hwguy"); + else if (pBot->bot_class == 7) + strcpy(c_class, "pyro"); + else if (pBot->bot_class == 8) + strcpy(c_class, "spy"); + else if (pBot->bot_class == 9) + strcpy(c_class, "engineer"); + else + strcpy(c_class, "randompc"); + + FakeClientCommand(pEdict, c_class, NULL, NULL); + + // bot has now joined the game (doesn't need to be started) + pBot->not_started = 0; + + return; + } + } + else if (mod_id == CSTRIKE_DLL) + { + // handle Counter-Strike stuff here... + + if (pBot->start_action == MSG_CS_TEAM_SELECT) + { + pBot->start_action = MSG_CS_IDLE; // switch back to idle + + if ((pBot->bot_team != 1) && (pBot->bot_team != 2) && + (pBot->bot_team != 5)) + pBot->bot_team = -1; + + if (pBot->bot_team == -1) + pBot->bot_team = RANDOM_LONG(1, 2); + + // select the team the bot wishes to join... + if (pBot->bot_team == 1) + strcpy(c_team, "1"); + else if (pBot->bot_team == 2) + strcpy(c_team, "2"); + else + strcpy(c_team, "5"); + + FakeClientCommand(pEdict, "menuselect", c_team, NULL); + + return; + } + + if (pBot->start_action == MSG_CS_CT_SELECT) // counter terrorist + { + pBot->start_action = MSG_CS_IDLE; // switch back to idle + + if ((pBot->bot_class < 1) || (pBot->bot_class > 4)) + pBot->bot_class = -1; // use random if invalid + + if (pBot->bot_class == -1) + pBot->bot_class = RANDOM_LONG(1, 4); + + // select the class the bot wishes to use... + if (pBot->bot_class == 1) + strcpy(c_class, "1"); + else if (pBot->bot_class == 2) + strcpy(c_class, "2"); + else if (pBot->bot_class == 3) + strcpy(c_class, "3"); + else if (pBot->bot_class == 4) + strcpy(c_class, "4"); + else + strcpy(c_class, "5"); // random + + FakeClientCommand(pEdict, "menuselect", c_class, NULL); + + // bot has now joined the game (doesn't need to be started) + pBot->not_started = 0; + + return; + } + + if (pBot->start_action == MSG_CS_T_SELECT) // terrorist select + { + pBot->start_action = MSG_CS_IDLE; // switch back to idle + + if ((pBot->bot_class < 1) || (pBot->bot_class > 4)) + pBot->bot_class = -1; // use random if invalid + + if (pBot->bot_class == -1) + pBot->bot_class = RANDOM_LONG(1, 4); + + // select the class the bot wishes to use... + if (pBot->bot_class == 1) + strcpy(c_class, "1"); + else if (pBot->bot_class == 2) + strcpy(c_class, "2"); + else if (pBot->bot_class == 3) + strcpy(c_class, "3"); + else if (pBot->bot_class == 4) + strcpy(c_class, "4"); + else + strcpy(c_class, "5"); // random + + FakeClientCommand(pEdict, "menuselect", c_class, NULL); + + // bot has now joined the game (doesn't need to be started) + pBot->not_started = 0; + + return; + } + } + else if ((mod_id == GEARBOX_DLL) && (pent_info_ctfdetect != NULL)) + { + // handle Opposing Force CTF stuff here... + + if (pBot->start_action == MSG_OPFOR_TEAM_SELECT) + { + pBot->start_action = MSG_OPFOR_IDLE; // switch back to idle + + if ((pBot->bot_team != 1) && (pBot->bot_team != 2) && + (pBot->bot_team != 3)) + pBot->bot_team = -1; + + if (pBot->bot_team == -1) + pBot->bot_team = RANDOM_LONG(1, 2); + + // select the team the bot wishes to join... + if (pBot->bot_team == 1) + strcpy(c_team, "1"); + else if (pBot->bot_team == 2) + strcpy(c_team, "2"); + else + strcpy(c_team, "3"); + + FakeClientCommand(pEdict, "jointeam", c_team, NULL); + + return; + } + + if (pBot->start_action == MSG_OPFOR_CLASS_SELECT) + { + pBot->start_action = MSG_OPFOR_IDLE; // switch back to idle + + if ((pBot->bot_class < 0) || (pBot->bot_class > 10)) + pBot->bot_class = -1; + + if (pBot->bot_class == -1) + pBot->bot_class = RANDOM_LONG(1, 10); + + // select the class the bot wishes to use... + if (pBot->bot_class == 1) + strcpy(c_class, "1"); + else if (pBot->bot_class == 2) + strcpy(c_class, "2"); + else if (pBot->bot_class == 3) + strcpy(c_class, "3"); + else if (pBot->bot_class == 4) + strcpy(c_class, "4"); + else if (pBot->bot_class == 5) + strcpy(c_class, "5"); + else if (pBot->bot_class == 6) + strcpy(c_class, "6"); + else + strcpy(c_class, "7"); + + FakeClientCommand(pEdict, "selectchar", c_class, NULL); + + // bot has now joined the game (doesn't need to be started) + pBot->not_started = 0; + + return; + } + } + else if (mod_id == FRONTLINE_DLL) + { + // handle FrontLineForce stuff here... + + if (pBot->start_action == MSG_FLF_TEAM_SELECT) + { + pBot->start_action = MSG_FLF_IDLE; // switch back to idle + + if ((pBot->bot_team != 1) && (pBot->bot_team != 2) && + (pBot->bot_team != 5)) + pBot->bot_team = -1; + + if (pBot->bot_team == -1) + pBot->bot_team = RANDOM_LONG(1, 2); + + // select the team the bot wishes to join... + if (pBot->bot_team == 1) + strcpy(c_team, "1"); + else if (pBot->bot_team == 2) + strcpy(c_team, "2"); + else + strcpy(c_team, "5"); + + FakeClientCommand(pEdict, "jointeam", c_team, NULL); + + return; + } + + if (pBot->start_action == MSG_FLF_CLASS_SELECT) + { + pBot->start_action = MSG_FLF_IDLE; // switch back to idle + + team = UTIL_GetTeam(pEdict); + + if (team == 0) // rebels + { + if ((pBot->bot_class < 0) || (pBot->bot_class > 3)) + pBot->bot_class = -1; + + if (pBot->bot_class == -1) + pBot->bot_class = RANDOM_LONG(1, 3); + + // select the class the bot wishes to use... + if (pBot->bot_class == 1) + strcpy(c_class, "rebelsrecon"); + else if (pBot->bot_class == 2) + strcpy(c_class, "rebelsassault"); + else + strcpy(c_class, "rebelssupport"); + } + else // commandos + { + if ((pBot->bot_class < 0) || (pBot->bot_class > 3)) + pBot->bot_class = -1; + + if (pBot->bot_class == -1) + pBot->bot_class = RANDOM_LONG(1, 3); + + // select the class the bot wishes to use... + if (pBot->bot_class == 1) + strcpy(c_class, "commandosrecon"); + else if (pBot->bot_class == 2) + strcpy(c_class, "commandosassault"); + else + strcpy(c_class, "commandossupport"); + } + + FakeClientCommand(pEdict, c_class, NULL, NULL); + + return; + } + + if (pBot->start_action == MSG_FLF_PISTOL_SELECT) + { + int prim_weapon_group, sec_weapon_group; + + pBot->start_action = MSG_FLF_IDLE; // switch back to idle + + int flf_class = UTIL_GetClass(pEdict); + + if (flf_class == 0) // recon + { + prim_weapon_group = RANDOM_LONG(1, 3); + + if (prim_weapon_group == 1) // shotguns + pBot->primary_weapon = FLF_WEAPON_SPAS12; + else if (prim_weapon_group == 2) // submachine + { + int weapon = RANDOM_LONG(1, 4); + + if (weapon == 1) + pBot->primary_weapon = FLF_WEAPON_MP5A2; + else if (weapon == 2) + pBot->primary_weapon = FLF_WEAPON_MP5SD; + else if (weapon == 3) + pBot->primary_weapon = FLF_WEAPON_MAC10; + else + pBot->primary_weapon = FLF_WEAPON_UMP45; + } + else // rifles + { + pBot->primary_weapon = FLF_WEAPON_MSG90; + } + + if (prim_weapon_group == 1) + sec_weapon_group = RANDOM_LONG(2, 3); + else if (prim_weapon_group == 3) + sec_weapon_group = RANDOM_LONG(1, 2); + else + { + if (RANDOM_LONG(1, 100) <= 50) + sec_weapon_group = 1; + else + sec_weapon_group = 3; + } + + if (sec_weapon_group == 1) // shotguns + pBot->secondary_weapon = FLF_WEAPON_SPAS12; + else if (sec_weapon_group == 2) // submachine + { + int weapon = RANDOM_LONG(1, 4); + + if (weapon == 1) + pBot->secondary_weapon = FLF_WEAPON_MP5A2; + else if (weapon == 2) + pBot->secondary_weapon = FLF_WEAPON_MP5SD; + else if (weapon == 3) + pBot->secondary_weapon = FLF_WEAPON_MAC10; + else + pBot->secondary_weapon = FLF_WEAPON_UMP45; + } + else // rifles + { + pBot->secondary_weapon = FLF_WEAPON_MSG90; + } + } + else if (flf_class == 1) // assault + { + prim_weapon_group = RANDOM_LONG(1, 3); + + if (prim_weapon_group == 1) // shotguns + pBot->primary_weapon = FLF_WEAPON_SPAS12; + else if (prim_weapon_group == 2) // submachine + { + int weapon = RANDOM_LONG(1, 4); + + if (weapon == 1) + pBot->primary_weapon = FLF_WEAPON_MP5A2; + else if (weapon == 2) + pBot->primary_weapon = FLF_WEAPON_MP5SD; + else if (weapon == 3) + pBot->primary_weapon = FLF_WEAPON_MAC10; + else + pBot->primary_weapon = FLF_WEAPON_UMP45; + } + else // rifles + { + int weapon = RANDOM_LONG(1, 3); + + if (weapon == 1) + pBot->primary_weapon = FLF_WEAPON_M4; + else if (weapon == 2) + pBot->primary_weapon = FLF_WEAPON_FAMAS; + else + pBot->primary_weapon = FLF_WEAPON_AK5; + } + + if (prim_weapon_group == 1) + sec_weapon_group = RANDOM_LONG(2, 3); + else if (prim_weapon_group == 2) + { + if (RANDOM_LONG(1, 100) <= 50) + sec_weapon_group = 1; + else + sec_weapon_group = 3; + } + else // prim == 3 + sec_weapon_group = RANDOM_LONG(1, 2); + + if (sec_weapon_group == 1) // shotguns + pBot->secondary_weapon = FLF_WEAPON_SPAS12; + else if (sec_weapon_group == 2) // submachine + { + int weapon = RANDOM_LONG(1, 4); + + if (weapon == 1) + pBot->secondary_weapon = FLF_WEAPON_MP5A2; + else if (weapon == 2) + pBot->secondary_weapon = FLF_WEAPON_MP5SD; + else if (weapon == 3) + pBot->secondary_weapon = FLF_WEAPON_MAC10; + else + pBot->secondary_weapon = FLF_WEAPON_UMP45; + } + else // rifles + { + int weapon = RANDOM_LONG(1, 3); + + if (weapon == 1) + pBot->secondary_weapon = FLF_WEAPON_M4; + else if (weapon == 2) + pBot->secondary_weapon = FLF_WEAPON_FAMAS; + else + pBot->secondary_weapon = FLF_WEAPON_AK5; + } + } + else // support + { + prim_weapon_group = RANDOM_LONG(1, 3); + + if (prim_weapon_group == 1) // shotguns + pBot->primary_weapon = FLF_WEAPON_SPAS12; + else if (prim_weapon_group == 2) // submachine + { + int weapon = RANDOM_LONG(1, 4); + + if (weapon == 1) + pBot->primary_weapon = FLF_WEAPON_MP5A2; + else if (weapon == 2) + pBot->primary_weapon = FLF_WEAPON_MP5SD; + else if (weapon == 3) + pBot->primary_weapon = FLF_WEAPON_MAC10; + else + pBot->primary_weapon = FLF_WEAPON_UMP45; + } + else if (prim_weapon_group == 3) // rifles & heavyweapons + { + if (RANDOM_LONG(1, 100) <= 50) + { + int weapon = RANDOM_LONG(1, 3); // rifles + + if (weapon == 1) + pBot->primary_weapon = FLF_WEAPON_M4; + else if (weapon == 2) + pBot->primary_weapon = FLF_WEAPON_FAMAS; + else + pBot->primary_weapon = FLF_WEAPON_AK5; + } + else // heavy weapons + { + pBot->primary_weapon = FLF_WEAPON_HK21; + } + } + + if (prim_weapon_group == 1) + sec_weapon_group = RANDOM_LONG(2, 3); + else if (prim_weapon_group == 2) + { + if (RANDOM_LONG(1, 100) <= 50) + sec_weapon_group = 1; + else + sec_weapon_group = 3; + } + else // prim == 3 + sec_weapon_group = RANDOM_LONG(1, 2); + + if (sec_weapon_group == 1) // shotguns + pBot->secondary_weapon = FLF_WEAPON_SPAS12; + else if (sec_weapon_group == 2) // submachine + { + int weapon = RANDOM_LONG(1, 4); + + if (weapon == 1) + pBot->secondary_weapon = FLF_WEAPON_MP5A2; + else if (weapon == 2) + pBot->secondary_weapon = FLF_WEAPON_MP5SD; + else if (weapon == 3) + pBot->secondary_weapon = FLF_WEAPON_MAC10; + else + pBot->secondary_weapon = FLF_WEAPON_UMP45; + } + else if (sec_weapon_group == 3) // rifles & heavyweapons + { + if (RANDOM_LONG(1, 100) <= 50) + { + int weapon = RANDOM_LONG(1, 3); // rifles + + if (weapon == 1) + pBot->secondary_weapon = FLF_WEAPON_M4; + else if (weapon == 2) + pBot->secondary_weapon = FLF_WEAPON_FAMAS; + else + pBot->secondary_weapon = FLF_WEAPON_AK5; + } + else // heavy weapons + { + pBot->secondary_weapon = FLF_WEAPON_HK21; + } + } + } + + int pistol = RANDOM_LONG(1, 2); + + if (pistol == 1) + strcpy(c_item, "26"); // mk23 + else + strcpy(c_item, "23"); // beretta + + FakeClientCommand(pEdict, "pistols", c_item, NULL); + + return; + } + + if (pBot->start_action == MSG_FLF_WEAPON_SELECT) + { + int weapon_class; + + pBot->start_action = MSG_FLF_IDLE; // switch back to idle + + if (pBot->primary_weapon) + weapon_class = pBot->primary_weapon; + else + weapon_class = pBot->secondary_weapon; + + if (weapon_class == FLF_WEAPON_SPAS12) // shotguns + strcpy(c_item, "shotgun"); + else if ((weapon_class == FLF_WEAPON_MP5A2) || // submachine + (weapon_class == FLF_WEAPON_MP5SD) || + (weapon_class == FLF_WEAPON_MAC10) || + (weapon_class == FLF_WEAPON_UMP45)) + strcpy(c_item, "submachine"); + else if ((weapon_class == FLF_WEAPON_M4) || + (weapon_class == FLF_WEAPON_FAMAS) || + (weapon_class == FLF_WEAPON_AK5) || + (weapon_class == FLF_WEAPON_MSG90)) + strcpy(c_item, "rifles"); + else + strcpy(c_item, "heavyweapons"); + + FakeClientCommand(pEdict, "wpnclass", c_item, NULL); + + return; + } + + if (pBot->start_action == MSG_FLF_SHOTGUN_SELECT) + { + int weapon_class; + + pBot->start_action = MSG_FLF_IDLE; // switch back to idle + + if (pBot->primary_weapon) + { + weapon_class = pBot->primary_weapon; + pBot->primary_weapon = 0; + } + else + { + weapon_class = pBot->secondary_weapon; + + // bot has now joined the game (doesn't need to be started) + pBot->not_started = 0; + } + + sprintf(c_item, "%d", weapon_class); + + FakeClientCommand(pEdict, "shotgun", c_item, NULL); + + return; + } + + if (pBot->start_action == MSG_FLF_SUBMACHINE_SELECT) + { + int weapon_class; + + pBot->start_action = MSG_FLF_IDLE; // switch back to idle + + if (pBot->primary_weapon) + { + weapon_class = pBot->primary_weapon; + pBot->primary_weapon = 0; + } + else + { + weapon_class = pBot->secondary_weapon; + + // bot has now joined the game (doesn't need to be started) + pBot->not_started = 0; + } + + sprintf(c_item, "%d", weapon_class); + + FakeClientCommand(pEdict, "submach", c_item, NULL); + + return; + } + + if (pBot->start_action == MSG_FLF_RIFLE_SELECT) + { + int weapon_class; + + pBot->start_action = MSG_FLF_IDLE; // switch back to idle + + if (pBot->primary_weapon) + { + weapon_class = pBot->primary_weapon; + pBot->primary_weapon = 0; + } + else + { + weapon_class = pBot->secondary_weapon; + + // bot has now joined the game (doesn't need to be started) + pBot->not_started = 0; + } + + sprintf(c_item, "%d", weapon_class); + + FakeClientCommand(pEdict, "rifles", c_item, NULL); + + return; + } + + if (pBot->start_action == MSG_FLF_HEAVYWEAPONS_SELECT) + { + int weapon_class; + + pBot->start_action = MSG_FLF_IDLE; // switch back to idle + + if (pBot->primary_weapon) + { + weapon_class = pBot->primary_weapon; + pBot->primary_weapon = 0; + } + else + { + weapon_class = pBot->secondary_weapon; + + // bot has now joined the game (doesn't need to be started) + pBot->not_started = 0; + } + + sprintf(c_item, "%d", weapon_class); + + FakeClientCommand(pEdict, "heavyweapons", c_item, NULL); + + return; + } + + } + else if (mod_id == AVH_DLL) + { +// if(pBot->mBotPlayMode == PLAYMODE_READYROOM) +// { +// // Look at desired team and head to nearest start entity +// AvHClassType theClassType = AVH_CLASS_TYPE_UNDEFINED; +//// if(pBot->mBotRole == ROLE_UNDEFINED) +//// { +//// // Choose a random team +//// theClassType = AvHClassType(RANDOM_LONG(1, 2)); +//// } +//// else +//// { +//// theClassType = (AvHClassType)pBot->mBotRole; +//// } +//// +//// // Now navigate to the nearest start entity +//// if(theClassType == AVH_CLASS_TYPE_MARINE) +//// { +// FakeClientCommand(pEdict, kcAutoAssign, c_item, NULL); +// //FakeClientCommand(pEdict, kcJoinTeamOne, c_item, NULL); +// +// // Try to become a squad leader if possible +//// pBot->pEdict->v.impulse = RANK_PROMOTE; +//// } +//// else if(theClassType == AVH_CLASS_TYPE_ALIEN) +//// { +//// FakeClientCommand(pEdict, kcJoinTeamTwo, c_item, NULL); +//// } +// +// // bot has now joined the game (doesn't need to be started) +// pBot->not_started = 0; +// } + } + else + { + // otherwise, don't need to do anything to start game... + pBot->not_started = 0; + } +} + diff --git a/main/source/HPB_bot/dlls/bot_weapons.h b/main/source/HPB_bot/dlls/bot_weapons.h new file mode 100644 index 00000000..1c47d9db --- /dev/null +++ b/main/source/HPB_bot/dlls/bot_weapons.h @@ -0,0 +1,158 @@ +// +// HPB_bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// bot_weapons.h +// + +#ifndef BOT_WEAPONS_H +#define BOT_WEAPONS_H + +// weapon ID values for Valve's Half-Life Deathmatch +#define VALVE_WEAPON_CROWBAR 1 +#define VALVE_WEAPON_GLOCK 2 +#define VALVE_WEAPON_PYTHON 3 +#define VALVE_WEAPON_MP5 4 +#define VALVE_WEAPON_CHAINGUN 5 +#define VALVE_WEAPON_CROSSBOW 6 +#define VALVE_WEAPON_SHOTGUN 7 +#define VALVE_WEAPON_RPG 8 +#define VALVE_WEAPON_GAUSS 9 +#define VALVE_WEAPON_EGON 10 +#define VALVE_WEAPON_HORNETGUN 11 +#define VALVE_WEAPON_HANDGRENADE 12 +#define VALVE_WEAPON_TRIPMINE 13 +#define VALVE_WEAPON_SATCHEL 14 +#define VALVE_WEAPON_SNARK 15 + +#define VALVE_MAX_NORMAL_BATTERY 100 +#define VALVE_HORNET_MAX_CARRY 8 + + +// weapon ID values for Valve's Team Fortress Classic & 1.5 +#define TF_WEAPON_UNKNOWN1 1 +#define TF_WEAPON_UNKNOWN2 2 +#define TF_WEAPON_MEDIKIT 3 +#define TF_WEAPON_SPANNER 4 +#define TF_WEAPON_AXE 5 +#define TF_WEAPON_SNIPERRIFLE 6 +#define TF_WEAPON_AUTORIFLE 7 +#define TF_WEAPON_SHOTGUN 8 +#define TF_WEAPON_SUPERSHOTGUN 9 +#define TF_WEAPON_NAILGUN 10 +#define TF_WEAPON_SUPERNAILGUN 11 +#define TF_WEAPON_GL 12 +#define TF_WEAPON_FLAMETHROWER 13 +#define TF_WEAPON_RPG 14 +#define TF_WEAPON_IC 15 +#define TF_WEAPON_UNKNOWN16 16 +#define TF_WEAPON_AC 17 +#define TF_WEAPON_UNKNOWN18 18 +#define TF_WEAPON_UNKNOWN19 19 +#define TF_WEAPON_TRANQ 20 +#define TF_WEAPON_RAILGUN 21 +#define TF_WEAPON_PL 22 +#define TF_WEAPON_KNIFE 23 + + +// weapon ID values for Counter-Strike +#define CS_WEAPON_P228 1 +#define CS_WEAPON_UNKNOWN2 2 +#define CS_WEAPON_SCOUT 3 +#define CS_WEAPON_HEGRENADE 4 +#define CS_WEAPON_XM1014 5 +#define CS_WEAPON_C4 6 +#define CS_WEAPON_MAC10 7 +#define CS_WEAPON_AUG 8 +#define CS_WEAPON_SMOKEGRENADE 9 +#define CS_WEAPON_ELITE 10 +#define CS_WEAPON_FIVESEVEN 11 +#define CS_WEAPON_UMP45 12 +#define CS_WEAPON_SG550 13 +#define CS_WEAPON_UNKNOWN14 14 +#define CS_WEAPON_UNKNOWN15 15 +#define CS_WEAPON_USP 16 +#define CS_WEAPON_GLOCK18 17 +#define CS_WEAPON_AWP 18 +#define CS_WEAPON_MP5NAVY 19 +#define CS_WEAPON_M249 20 +#define CS_WEAPON_M3 21 +#define CS_WEAPON_M4A1 22 +#define CS_WEAPON_TMP 23 +#define CS_WEAPON_G3SG1 24 +#define CS_WEAPON_FLASHBANG 25 +#define CS_WEAPON_DEAGLE 26 +#define CS_WEAPON_SG552 27 +#define CS_WEAPON_AK47 28 +#define CS_WEAPON_KNIFE 29 +#define CS_WEAPON_P90 30 + + +// weapon ID values for Gearbox's OpFor Deathmatch +#define GEARBOX_WEAPON_CROWBAR 1 +#define GEARBOX_WEAPON_GLOCK 2 +#define GEARBOX_WEAPON_PYTHON 3 +#define GEARBOX_WEAPON_MP5 4 +#define GEARBOX_WEAPON_CHAINGUN 5 +#define GEARBOX_WEAPON_CROSSBOW 6 +#define GEARBOX_WEAPON_SHOTGUN 7 +#define GEARBOX_WEAPON_RPG 8 +#define GEARBOX_WEAPON_GAUSS 9 +#define GEARBOX_WEAPON_EGON 10 +#define GEARBOX_WEAPON_HORNETGUN 11 +#define GEARBOX_WEAPON_HANDGRENADE 12 +#define GEARBOX_WEAPON_TRIPMINE 13 +#define GEARBOX_WEAPON_SATCHEL 14 +#define GEARBOX_WEAPON_SNARK 15 +#define GEARBOX_WEAPON_GRAPPLE 16 +#define GEARBOX_WEAPON_EAGLE 17 +#define GEARBOX_WEAPON_PIPEWRENCH 18 +#define GEARBOX_WEAPON_M249 19 +#define GEARBOX_WEAPON_DISPLACER 20 +#define GEARBOX_WEAPON_UNKNOWN21 21 +#define GEARBOX_WEAPON_SHOCKRIFLE 22 +#define GEARBOX_WEAPON_SPORELAUNCHER 23 +#define GEARBOX_WEAPON_SNIPERRIFLE 24 +#define GEARBOX_WEAPON_KNIFE 25 + + +// weapon ID values for FrontLineForce +#define FLF_WEAPON_AK5 10 +#define FLF_WEAPON_UNKNOWN11 11 +#define FLF_WEAPON_UNKNOWN12 12 +#define FLF_WEAPON_UNKNOWN13 13 +#define FLF_WEAPON_UNKNOWN14 14 +#define FLF_WEAPON_UNKNOWN15 15 +#define FLF_WEAPON_MP5SD 16 +#define FLF_WEAPON_M4 17 +#define FLF_WEAPON_FLASHBANG 18 +#define FLF_WEAPON_HEGRENADE 19 +#define FLF_WEAPON_MP5A2 20 +#define FLF_WEAPON_UMP45 21 +#define FLF_WEAPON_SPAS12 22 +#define FLF_WEAPON_BERETTA 23 +#define FLF_WEAPON_KNIFE 24 +#define FLF_WEAPON_MAC10 25 +#define FLF_WEAPON_MK23 26 +#define FLF_WEAPON_MSG90 27 +#define FLF_WEAPON_FAMAS 28 +#define FLF_WEAPON_HK21 29 + + +typedef struct +{ + char szClassname[64]; + int iAmmo1; // ammo index for primary ammo + int iAmmo1Max; // max primary ammo + int iAmmo2; // ammo index for secondary ammo + int iAmmo2Max; // max secondary ammo + int iSlot; // HUD slot (0 based) + int iPosition; // slot position + int iId; // weapon ID + int iFlags; // flags??? +} bot_weapon_t; + + +#endif // BOT_WEAPONS_H + diff --git a/main/source/HPB_bot/dlls/current_linux_makefile b/main/source/HPB_bot/dlls/current_linux_makefile new file mode 100644 index 00000000..3be8a029 --- /dev/null +++ b/main/source/HPB_bot/dlls/current_linux_makefile @@ -0,0 +1,44 @@ +# +# HPB_bot makefile for Linux +# +# created: 12/16/2000 botman (botman@mailandnews.com) +# + +# the following specifies the path to your MOD... +MOD_DIR = /usr/local/games/Half-life/hlds_l/ns + +CPP = egcs + +BASEFLAGS = -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -DAVH_SERVER -DLINUX + +CFLAGS=$(BASE_CFLAGS) -w -m486 -O2 -ffast-math -funroll-loops \ + -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ + -malign-jumps=2 -malign-functions=2 + +INCLUDEDIRS=-I. -I../../engine -I../../common -I../../mod -I../../game_shared -I../../lua/include -I../../pm_shared -I../.. -I../../dlls + +LDFLAGS=-lm -lstdc++ +#SHLIBCFLAGS=-fPIC +SHLIBLDFLAGS=-shared -static + +#CPPFLAGS = ${BASEFLAGS} -m486 -O2 -w -I../engine -I../common -I../pm_shared +CPPFLAGS = ${BASEFLAGS} -m486 -w -I../engine -I../../common -I../../pm_shared + +OBJ = bot.o bot_client.o bot_combat.o bot_navigate.o bot_start.o dll.o engine.o h_export.o linkfunc.o util.o waypoint.o + +#${CPP} $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ ${OBJ} -ldl + +HPB_bot_i386.so: ${OBJ} + ${CPP} $(CFLAGS) $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ ${OBJ} + cp -f HPB_bot_i386.so ${MOD_DIR}/dlls + +clean: + -rm -f *.o + -rm -f *.so + +%.o: %.cpp + ${CPP} ${CPPFLAGS} $(INCLUDEDIRS) -c $< -o $@ + +%.o: %.c + ${CPP} ${CPPFLAGS} $(INCLUDEDIRS) -c $< -o $@ + diff --git a/main/source/HPB_bot/dlls/dll.cpp b/main/source/HPB_bot/dlls/dll.cpp new file mode 100644 index 00000000..5ef6c468 --- /dev/null +++ b/main/source/HPB_bot/dlls/dll.cpp @@ -0,0 +1,1890 @@ +// +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// dll.cpp +// + +#include "extdll.h" +#include "enginecallback.h" +#include "util.h" +#include "cbase.h" +#include "entity_state.h" + +#include "bot.h" +#include "bot_func.h" +#include "waypoint.h" +#include "mod/AvHServerVariables.h" + +#define MENU_NONE 0 +#define MENU_1 1 +#define MENU_2 2 +#define MENU_3 3 + +extern GETENTITYAPI other_GetEntityAPI; +extern GETNEWDLLFUNCTIONS other_GetNewDLLFunctions; +extern enginefuncs_t g_engfuncs; +extern int debug_engine; +extern globalvars_t *gpGlobals; +extern char *g_argv; +extern bool g_waypoint_on; +extern bool g_auto_waypoint; +extern bool g_path_waypoint; +extern int num_waypoints; // number of waypoints currently in use +extern WAYPOINT waypoints[MAX_WAYPOINTS]; +extern float wp_display_time[MAX_WAYPOINTS]; +extern bot_t bots[32]; +extern bool b_observer_mode; +extern bool b_botdontshoot; +//char welcome_msg[] = "HPB bot - http://planethalflife.com/botman"; + +static FILE *fp; + +DLL_FUNCTIONS other_gFunctionTable; +DLL_GLOBAL const Vector g_vecZero = Vector(0,0,0); + +// AvH dll +int mod_id = AVH_DLL; +int m_spriteTexture = 0; +int default_bot_skill = 4; +int isFakeClientCommand = 0; +int fake_arg_count; +float bot_check_time = 30.0; +int min_bots = -1; +int max_bots = -1; +int num_bots = 0; +int prev_num_bots = 0; +bool g_GameRules = FALSE; +edict_t *clients[32]; +edict_t *listenserver_edict = NULL; +float welcome_time = 0.0; +bool welcome_sent = FALSE; +int g_menu_waypoint; +int g_menu_state = 0; + +float is_team_play = 0.0; +char team_names[MAX_TEAMS][MAX_TEAMNAME_LENGTH]; +int num_teams = 0; +bool checked_teamplay = FALSE; +edict_t *pent_info_tfdetect = NULL; +edict_t *pent_info_ctfdetect = NULL; +edict_t *pent_info_frontline = NULL; +edict_t *pent_item_tfgoal = NULL; +int max_team_players[4]; // for TFC +int team_class_limits[4]; // for TFC +int team_allies[4]; // TFC bit mapped allies BLUE, RED, YELLOW, and GREEN +int max_teams = 0; // for TFC +FLAG_S flags[MAX_FLAGS]; // for TFC +int num_flags = 0; // for TFC + +FILE *bot_cfg_fp = NULL; +bool need_to_open_cfg = TRUE; +float bot_cfg_pause_time = 0.0; +float respawn_time = 0.0; +bool spawn_time_reset = FALSE; + +int flf_bug_fix; // for FLF 1.1 capture point bug +int flf_bug_check; // for FLF 1.1 capture point bug + + +char bot_whine[MAX_BOT_WHINE][81]; +int whine_count; +int recent_bot_whine[5]; + +cvar_t sv_bot = {"bot",""}; +cvar_t sv_freezebots = {"freezebots","0"}; + +char *show_menu_1 = + {"Waypoint Tags\n\n1. Team Specific\n2. Wait for Lift\n3. Door\n4. Sniper Spot\n5. More..."}; +char *show_menu_2 = + {"Waypoint Tags\n\n1. Team 1\n2. Team 2\n3. Team 3\n4. Team 4\n5. CANCEL"}; +char *show_menu_2_flf = + {"Waypoint Tags\n\n1. Attackers\n2. Defenders\n\n5. CANCEL"}; +char *show_menu_3 = + {"Waypoint Tags\n\n1. Flag Location\n2. Flag Goal Location\n\n5. CANCEL"}; +char *show_menu_3_flf = + {"Waypoint Tags\n\n1. Capture Point\n2. Defend Point\n3. Prone\n\n5. CANCEL"}; + + +void BotNameInit(void); +void UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); +void ProcessBotCfgFile(void); + + +void GameDLLInit( void ) +{ + char filename[256]; + char buffer[256]; + int i, length; + FILE *bfp; + char *ptr; + + CVAR_REGISTER (&sv_bot); + CVAR_REGISTER (&sv_freezebots); + + for (i=0; i<32; i++) + clients[i] = NULL; + + whine_count = 0; + + // initialize the bots array of structures... + memset(bots, 0, sizeof(bots)); + + for (i=0; i < 5; i++) + recent_bot_whine[i] = -1; + + BotNameInit(); + + + UTIL_BuildFileName(filename, "bot_whine.txt", NULL); + + bfp = fopen(filename, "r"); + + if (bfp != NULL) + { + while ((whine_count < MAX_BOT_WHINE) && + (fgets(buffer, 80, bfp) != NULL)) + { + length = strlen(buffer); + + if (buffer[length-1] == '\n') + { + buffer[length-1] = 0; // remove '\n' + length--; + } + + if ((ptr = strstr(buffer, "%n")) != NULL) + { + *(ptr+1) = 's'; // change %n to %s + } + + if (length > 0) + { + strcpy(bot_whine[whine_count], buffer); + whine_count++; + } + } + + fclose(bfp); + } + + (*other_gFunctionTable.pfnGameInit)(); +} + +int DispatchSpawn( edict_t *pent ) +{ + int index; + + if (gpGlobals->deathmatch) + { + char *pClassname = (char *)STRING(pent->v.classname); + + if (debug_engine) + { + fp=fopen("bot.txt","a"); + fprintf(fp, "DispatchSpawn: %x %s\n",pent,pClassname); + if (pent->v.model != 0) + fprintf(fp, " model=%s\n",STRING(pent->v.model)); + fclose(fp); + } + + if (strcmp(pClassname, "worldspawn") == 0) + { + // do level initialization stuff here... + + WaypointInit(); + WaypointLoad(NULL); + + pent_info_tfdetect = NULL; + pent_info_ctfdetect = NULL; + pent_info_frontline = NULL; + pent_item_tfgoal = NULL; + + for (index=0; index < 4; index++) + { + max_team_players[index] = 0; // no player limit + team_class_limits[index] = 0; // no class limits + team_allies[index] = 0; + } + + max_teams = 0; + num_flags = 0; + + PRECACHE_SOUND("weapons/xbow_hit1.wav"); // waypoint add + PRECACHE_SOUND("weapons/mine_activate.wav"); // waypoint delete + PRECACHE_SOUND("common/wpn_hudoff.wav"); // path add/delete start + PRECACHE_SOUND("common/wpn_hudon.wav"); // path add/delete done + PRECACHE_SOUND("common/wpn_moveselect.wav"); // path add/delete cancel + PRECACHE_SOUND("common/wpn_denyselect.wav"); // path add/delete error + + m_spriteTexture = PRECACHE_MODEL( "sprites/lgtning.spr"); + + g_GameRules = TRUE; + + is_team_play = 0.0; + memset(team_names, 0, sizeof(team_names)); + num_teams = 0; + checked_teamplay = FALSE; + + bot_cfg_pause_time = 0.0; + respawn_time = 0.0; + spawn_time_reset = FALSE; + + prev_num_bots = num_bots; + num_bots = 0; + + flf_bug_fix = 0; + flf_bug_check = 0; + + bot_check_time = gpGlobals->time + 30.0; + } + } + + return (*other_gFunctionTable.pfnSpawn)(pent); +} + +void DispatchThink( edict_t *pent ) +{ + (*other_gFunctionTable.pfnThink)(pent); +} + +void DispatchUse( edict_t *pentUsed, edict_t *pentOther ) +{ + (*other_gFunctionTable.pfnUse)(pentUsed, pentOther); +} + +void DispatchTouch( edict_t *pentTouched, edict_t *pentOther ) +{ + (*other_gFunctionTable.pfnTouch)(pentTouched, pentOther); +} + +void DispatchBlocked( edict_t *pentBlocked, edict_t *pentOther ) +{ + (*other_gFunctionTable.pfnBlocked)(pentBlocked, pentOther); +} + +void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd ) +{ + static edict_t *temp_pent; + static int flag_index; + +// fp=fopen("bot.txt","a"); fprintf(fp, "DispatchKeyValue: %x %s=%s\n",pentKeyvalue,pkvd->szKeyName,pkvd->szValue); fclose(fp); + + if (mod_id == TFC_DLL) + { + if (pentKeyvalue == pent_info_tfdetect) + { + if (strcmp(pkvd->szKeyName, "ammo_medikit") == 0) // max BLUE players + max_team_players[0] = atoi(pkvd->szValue); + else if (strcmp(pkvd->szKeyName, "ammo_detpack") == 0) // max RED players + max_team_players[1] = atoi(pkvd->szValue); + else if (strcmp(pkvd->szKeyName, "maxammo_medikit") == 0) // max YELLOW players + max_team_players[2] = atoi(pkvd->szValue); + else if (strcmp(pkvd->szKeyName, "maxammo_detpack") == 0) // max GREEN players + max_team_players[3] = atoi(pkvd->szValue); + + else if (strcmp(pkvd->szKeyName, "maxammo_shells") == 0) // BLUE class limits + team_class_limits[0] = atoi(pkvd->szValue); + else if (strcmp(pkvd->szKeyName, "maxammo_nails") == 0) // RED class limits + team_class_limits[1] = atoi(pkvd->szValue); + else if (strcmp(pkvd->szKeyName, "maxammo_rockets") == 0) // YELLOW class limits + team_class_limits[2] = atoi(pkvd->szValue); + else if (strcmp(pkvd->szKeyName, "maxammo_cells") == 0) // GREEN class limits + team_class_limits[3] = atoi(pkvd->szValue); + + else if (strcmp(pkvd->szKeyName, "team1_allies") == 0) // BLUE allies + team_allies[0] = atoi(pkvd->szValue); + else if (strcmp(pkvd->szKeyName, "team2_allies") == 0) // RED allies + team_allies[1] = atoi(pkvd->szValue); + else if (strcmp(pkvd->szKeyName, "team3_allies") == 0) // YELLOW allies + team_allies[2] = atoi(pkvd->szValue); + else if (strcmp(pkvd->szKeyName, "team4_allies") == 0) // GREEN allies + team_allies[3] = atoi(pkvd->szValue); + } + else if (pent_info_tfdetect == NULL) + { + if ((strcmp(pkvd->szKeyName, "classname") == 0) && + (strcmp(pkvd->szValue, "info_tfdetect") == 0)) + { + pent_info_tfdetect = pentKeyvalue; + } + } + + if (pentKeyvalue == pent_item_tfgoal) + { + if (strcmp(pkvd->szKeyName, "team_no") == 0) + flags[flag_index].team_no = atoi(pkvd->szValue); + + if ((strcmp(pkvd->szKeyName, "mdl") == 0) && + ((strcmp(pkvd->szValue, "models/flag.mdl") == 0) || + (strcmp(pkvd->szValue, "models/keycard.mdl") == 0) || + (strcmp(pkvd->szValue, "models/ball.mdl") == 0))) + { + flags[flag_index].mdl_match = TRUE; + num_flags++; + } + } + else if (pent_item_tfgoal == NULL) + { + if ((strcmp(pkvd->szKeyName, "classname") == 0) && + (strcmp(pkvd->szValue, "item_tfgoal") == 0)) + { + if (num_flags < MAX_FLAGS) + { + pent_item_tfgoal = pentKeyvalue; + + flags[num_flags].mdl_match = FALSE; + flags[num_flags].team_no = 0; // any team unless specified + flags[num_flags].edict = pentKeyvalue; + + flag_index = num_flags; // in case the mdl comes before team_no + } + } + } + else + { + pent_item_tfgoal = NULL; // reset for non-flag item_tfgoal's + } + + if ((strcmp(pkvd->szKeyName, "classname") == 0) && + ((strcmp(pkvd->szValue, "info_player_teamspawn") == 0) || + (strcmp(pkvd->szValue, "i_p_t") == 0))) + { + temp_pent = pentKeyvalue; + } + else if (pentKeyvalue == temp_pent) + { + if (strcmp(pkvd->szKeyName, "team_no") == 0) + { + int value = atoi(pkvd->szValue); + + if (value > max_teams) + max_teams = value; + } + } + } + else if (mod_id == GEARBOX_DLL) + { + if (pent_info_ctfdetect == NULL) + { + if ((strcmp(pkvd->szKeyName, "classname") == 0) && + (strcmp(pkvd->szValue, "info_ctfdetect") == 0)) + { + pent_info_ctfdetect = pentKeyvalue; + } + } + } + + (*other_gFunctionTable.pfnKeyValue)(pentKeyvalue, pkvd); +} + +void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData ) +{ + (*other_gFunctionTable.pfnSave)(pent, pSaveData); +} + +int DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity ) +{ + return (*other_gFunctionTable.pfnRestore)(pent, pSaveData, globalEntity); +} + +void DispatchObjectCollsionBox( edict_t *pent ) +{ + (*other_gFunctionTable.pfnSetAbsBox)(pent); +} + +void SaveWriteFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) +{ + (*other_gFunctionTable.pfnSaveWriteFields)(pSaveData, pname, pBaseData, pFields, fieldCount); +} + +void SaveReadFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) +{ + (*other_gFunctionTable.pfnSaveReadFields)(pSaveData, pname, pBaseData, pFields, fieldCount); +} + +void SaveGlobalState( SAVERESTOREDATA *pSaveData ) +{ + (*other_gFunctionTable.pfnSaveGlobalState)(pSaveData); +} + +void RestoreGlobalState( SAVERESTOREDATA *pSaveData ) +{ + (*other_gFunctionTable.pfnRestoreGlobalState)(pSaveData); +} + +void ResetGlobalState( void ) +{ + (*other_gFunctionTable.pfnResetGlobalState)(); +} + +BOOL ClientConnect( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ) +{ + if (gpGlobals->deathmatch) + { + int i; + int count = 0; + + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp, "ClientConnect: pent=%x name=%s\n",pEntity,pszName); fclose(fp); } + + // check if this client is the listen server client + if (strcmp(pszAddress, "loopback") == 0) + { + // save the edict of the listen server client... + listenserver_edict = pEntity; + } + + // check if this is NOT a bot joining the server... + if (strcmp(pszAddress, "127.0.0.1") != 0) + { + // don't try to add bots for 60 seconds, give client time to get added + bot_check_time = gpGlobals->time + 60.0; + + for (i=0; i < 32; i++) + { + if (bots[i].is_used) // count the number of bots in use + count++; + } + + // if there are currently more than the minimum number of bots running + // then kick one of the bots off the server... + if ((count > min_bots) && (min_bots != -1)) + { + for (i=0; i < 32; i++) + { + if (bots[i].is_used) // is this slot used? + { + char cmd[80]; + + sprintf(cmd, "kick \"%s\"\n", bots[i].name); + + SERVER_COMMAND(cmd); // kick the bot using (kick "name") + + break; + } + } + } + } + } + + return (*other_gFunctionTable.pfnClientConnect)(pEntity, pszName, pszAddress, szRejectReason); +} + +void ClientDisconnect( edict_t *pEntity ) +{ + if (gpGlobals->deathmatch) + { + int i; + + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp, "ClientDisconnect: %x\n",pEntity); fclose(fp); } + + i = 0; + while ((i < 32) && (clients[i] != pEntity)) + i++; + + if (i < 32) + clients[i] = NULL; + + + for (i=0; i < 32; i++) + { + if (bots[i].pEdict == pEntity) + { + // someone kicked this bot off of the server... + + bots[i].is_used = FALSE; // this slot is now free to use + + bots[i].kick_time = gpGlobals->time; // save the kicked time + + break; + } + } + } + + (*other_gFunctionTable.pfnClientDisconnect)(pEntity); +} + +void ClientKill( edict_t *pEntity ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp, "ClientKill: %x\n",pEntity); fclose(fp); } + (*other_gFunctionTable.pfnClientKill)(pEntity); +} + +void ClientPutInServer( edict_t *pEntity ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp, "ClientPutInServer: %x\n",pEntity); fclose(fp); } + + int i = 0; + + while ((i < 32) && (clients[i] != NULL)) + i++; + + if (i < 32) + clients[i] = pEntity; // store this clients edict in the clients array + + (*other_gFunctionTable.pfnClientPutInServer)(pEntity); +} + +void ClientCommand( edict_t *pEntity ) +{ + // only allow custom commands if deathmatch mode and NOT dedicated server and + // client sending command is the listen server client... + + if ((gpGlobals->deathmatch) && /*(!IS_DEDICATED_SERVER()) &&*/ + (pEntity == listenserver_edict)) + { + const char *pcmd = Cmd_Argv(0); + const char *arg1 = Cmd_Argv(1); + const char *arg2 = Cmd_Argv(2); + const char *arg3 = Cmd_Argv(3); + const char *arg4 = Cmd_Argv(4); + char msg[80]; + + if (debug_engine) + { + fp=fopen("bot.txt","a"); fprintf(fp,"ClientCommand: %s",pcmd); + if ((arg1 != NULL) && (*arg1 != 0)) + fprintf(fp," %s", arg1); + if ((arg2 != NULL) && (*arg2 != 0)) + fprintf(fp," %s", arg2); + if ((arg3 != NULL) && (*arg3 != 0)) + fprintf(fp," %s", arg3); + if ((arg4 != NULL) && (*arg4 != 0)) + fprintf(fp," %s", arg4); + fprintf(fp, "\n"); + fclose(fp); + } + + if (FStrEq(pcmd, "addbot")) + { + BotCreate( pEntity, arg1, arg2, arg3, arg4 ); + + bot_check_time = gpGlobals->time + 5.0; + + return; + } + else if (FStrEq(pcmd, "observer")) + { + if ((arg1 != NULL) && (*arg1 != 0)) + { + int temp = atoi(arg1); + if (temp) + b_observer_mode = TRUE; + else + b_observer_mode = FALSE; + } + + if (b_observer_mode) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "observer mode ENABLED\n"); + else + ClientPrint(pEntity, HUD_PRINTNOTIFY, "observer mode DISABLED\n"); + + return; + } + else if (FStrEq(pcmd, "botskill")) + { + if ((arg1 != NULL) && (*arg1 != 0)) + { + int temp = atoi(arg1); + + if ((temp < 1) || (temp > 5)) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "invalid botskill value!\n"); + else + default_bot_skill = temp; + } + + sprintf(msg, "botskill is %d\n", default_bot_skill); + ClientPrint(pEntity, HUD_PRINTNOTIFY, msg); + + return; + } + else if (FStrEq(pcmd, "botdontshoot")) + { + if ((arg1 != NULL) && (*arg1 != 0)) + { + int temp = atoi(arg1); + if (temp) + b_botdontshoot = TRUE; + else + b_botdontshoot = FALSE; + } + + if (b_botdontshoot) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "botdontshoot ENABLED\n"); + else + ClientPrint(pEntity, HUD_PRINTNOTIFY, "botdontshoot DISABLED\n"); + + return; + } + else if (FStrEq(pcmd, "debug_engine")) + { + debug_engine = 1; + + ClientPrint(pEntity, HUD_PRINTNOTIFY, "debug_engine enabled!\n"); + + return; + } + else if (FStrEq(pcmd, "waypoint")) + { + if (FStrEq(arg1, "on")) + { + g_waypoint_on = TRUE; + + ClientPrint(pEntity, HUD_PRINTNOTIFY, "waypoints are ON\n"); + } + else if (FStrEq(arg1, "off")) + { + g_waypoint_on = FALSE; + + ClientPrint(pEntity, HUD_PRINTNOTIFY, "waypoints are OFF\n"); + } + else if (FStrEq(arg1, "add")) + { + if (!g_waypoint_on) + g_waypoint_on = TRUE; // turn waypoints on if off + + WaypointAdd(pEntity); + } + else if (FStrEq(arg1, "delete")) + { + if (!g_waypoint_on) + g_waypoint_on = TRUE; // turn waypoints on if off + + WaypointDelete(pEntity); + } + else if (FStrEq(arg1, "save")) + { + WaypointSave(); + + ClientPrint(pEntity, HUD_PRINTNOTIFY, "waypoints saved\n"); + } + else if (FStrEq(arg1, "load")) + { + if (WaypointLoad(pEntity)) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "waypoints loaded\n"); + } + else if (FStrEq(arg1, "menu")) + { + int index; + + if (num_waypoints < 1) + return; + + index = WaypointFindNearest(pEntity, 50.0, -1); + + if (index == -1) + return; + + g_menu_waypoint = index; + g_menu_state = MENU_1; + + UTIL_ShowMenu(pEntity, 0x1F, -1, FALSE, show_menu_1); + } + else if (FStrEq(arg1, "info")) + { + WaypointPrintInfo(pEntity); + } + else + { + if (g_waypoint_on) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "waypoints are ON\n"); + else + ClientPrint(pEntity, HUD_PRINTNOTIFY, "waypoints are OFF\n"); + } + + return; + } + else if (FStrEq(pcmd, "autowaypoint")) + { + if (FStrEq(arg1, "on")) + { + g_auto_waypoint = TRUE; + g_waypoint_on = TRUE; // turn this on just in case + } + else if (FStrEq(arg1, "off")) + { + g_auto_waypoint = FALSE; + } + + if (g_auto_waypoint) + sprintf(msg, "autowaypoint is ON\n"); + else + sprintf(msg, "autowaypoint is OFF\n"); + + ClientPrint(pEntity, HUD_PRINTNOTIFY, msg); + + return; + } + else if (FStrEq(pcmd, "pathwaypoint")) + { + if (FStrEq(arg1, "on")) + { + g_path_waypoint = TRUE; + g_waypoint_on = TRUE; // turn this on just in case + + ClientPrint(pEntity, HUD_PRINTNOTIFY, "pathwaypoint is ON\n"); + } + else if (FStrEq(arg1, "off")) + { + g_path_waypoint = FALSE; + + ClientPrint(pEntity, HUD_PRINTNOTIFY, "pathwaypoint is OFF\n"); + } + else if (FStrEq(arg1, "create1")) + { + WaypointCreatePath(pEntity, 1); + } + else if (FStrEq(arg1, "create2")) + { + WaypointCreatePath(pEntity, 2); + } + else if (FStrEq(arg1, "remove1")) + { + WaypointRemovePath(pEntity, 1); + } + else if (FStrEq(arg1, "remove2")) + { + WaypointRemovePath(pEntity, 2); + } + + return; + } + else if (FStrEq(pcmd, "menuselect") && (g_menu_state != MENU_NONE)) + { + if (g_menu_state == MENU_1) // main menu... + { + if (FStrEq(arg1, "1")) // team specific... + { + g_menu_state = MENU_2; // display team specific menu... + + if (mod_id == FRONTLINE_DLL) + UTIL_ShowMenu(pEntity, 0x13, -1, FALSE, show_menu_2_flf); + else + UTIL_ShowMenu(pEntity, 0x1F, -1, FALSE, show_menu_2); + + return; + } + else if (FStrEq(arg1, "2")) // wait for lift... + { + if (waypoints[g_menu_waypoint].flags & W_FL_LIFT) + waypoints[g_menu_waypoint].flags &= ~W_FL_LIFT; // off + else + waypoints[g_menu_waypoint].flags |= W_FL_LIFT; // on + } + else if (FStrEq(arg1, "3")) // door waypoint + { + if (waypoints[g_menu_waypoint].flags & W_FL_DOOR) + waypoints[g_menu_waypoint].flags &= ~W_FL_DOOR; // off + else + waypoints[g_menu_waypoint].flags |= W_FL_DOOR; // on + } + else if (FStrEq(arg1, "4")) // sniper spot + { + if (waypoints[g_menu_waypoint].flags & W_FL_SNIPER) + waypoints[g_menu_waypoint].flags &= ~W_FL_SNIPER; // off + else + { + waypoints[g_menu_waypoint].flags |= W_FL_SNIPER; // on + + // set the aiming waypoint... + + WaypointAddAiming(pEntity); + } + } + else if (FStrEq(arg1, "5")) // more... + { + g_menu_state = MENU_3; + + if (mod_id == FRONTLINE_DLL) + UTIL_ShowMenu(pEntity, 0x17, -1, FALSE, show_menu_3_flf); + else + UTIL_ShowMenu(pEntity, 0x13, -1, FALSE, show_menu_3); + + return; + } + } + else if (g_menu_state == MENU_2) // team specific menu + { + if (waypoints[g_menu_waypoint].flags & W_FL_TEAM_SPECIFIC) + { + waypoints[g_menu_waypoint].flags &= ~W_FL_TEAM; + waypoints[g_menu_waypoint].flags &= ~W_FL_TEAM_SPECIFIC; // off + } + else + { + int team = atoi(arg1); + + team--; // make 0 to 3 + + // this is kind of a kludge (team bits MUST be LSB!!!) + waypoints[g_menu_waypoint].flags |= team; + waypoints[g_menu_waypoint].flags |= W_FL_TEAM_SPECIFIC; // on + } + } + else if (g_menu_state == MENU_3) // second menu... + { + if (mod_id == FRONTLINE_DLL) + { + if (FStrEq(arg1, "1")) // capture point + { + if (waypoints[g_menu_waypoint].flags & W_FL_FLF_CAP) + waypoints[g_menu_waypoint].flags &= ~W_FL_FLF_CAP; // off + else + waypoints[g_menu_waypoint].flags |= W_FL_FLF_CAP; // on + } + else if (FStrEq(arg1, "2")) // defend point + { + if (waypoints[g_menu_waypoint].flags & W_FL_FLF_DEFEND) + waypoints[g_menu_waypoint].flags &= ~W_FL_FLF_DEFEND; // off + else + { + waypoints[g_menu_waypoint].flags |= W_FL_FLF_DEFEND; // on + + // set the aiming waypoint... + + WaypointAddAiming(pEntity); + } + } + else if (FStrEq(arg1, "3")) // go prone + { + if (waypoints[g_menu_waypoint].flags & W_FL_PRONE) + waypoints[g_menu_waypoint].flags &= ~W_FL_PRONE; // off + else + waypoints[g_menu_waypoint].flags |= W_FL_PRONE; // on + } + } + else + { + if (FStrEq(arg1, "1")) // flag location + { + if (waypoints[g_menu_waypoint].flags & W_FL_TFC_FLAG) + waypoints[g_menu_waypoint].flags &= ~W_FL_TFC_FLAG; // off + else + waypoints[g_menu_waypoint].flags |= W_FL_TFC_FLAG; // on + } + else if (FStrEq(arg1, "2")) // flag goal + { + if (waypoints[g_menu_waypoint].flags & W_FL_TFC_FLAG_GOAL) + waypoints[g_menu_waypoint].flags &= ~W_FL_TFC_FLAG_GOAL; // off + else + waypoints[g_menu_waypoint].flags |= W_FL_TFC_FLAG_GOAL; // on + } + } + } + + g_menu_state = MENU_NONE; + + return; + } + else if (FStrEq(pcmd, "search")) + { + edict_t *pent = NULL; + float radius = 50; + char str[80]; + + ClientPrint(pEntity, HUD_PRINTCONSOLE, "searching...\n"); + + while ((pent = UTIL_FindEntityInSphere( pent, pEntity->v.origin, radius )) != NULL) + { + sprintf(str, "Found %s at %5.2f %5.2f %5.2f\n", + STRING(pent->v.classname), + pent->v.origin.x, pent->v.origin.y, + pent->v.origin.z); + ClientPrint(pEntity, HUD_PRINTCONSOLE, str); + + FILE *fp=fopen("bot.txt", "a"); + fprintf(fp, "ClientCommmand: search %s", str); + fclose(fp); + } + + return; + } + } + + (*other_gFunctionTable.pfnClientCommand)(pEntity); +} + +void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer ) +{ + if (debug_engine) { fp=fopen("bot.txt", "a"); fprintf(fp, "ClientUserInfoChanged: pEntity=%x infobuffer=%s\n", pEntity, infobuffer); fclose(fp); } + + (*other_gFunctionTable.pfnClientUserInfoChanged)(pEntity, infobuffer); +} + +void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ) +{ + (*other_gFunctionTable.pfnServerActivate)(pEdictList, edictCount, clientMax); +} + +void ServerDeactivate( void ) +{ + (*other_gFunctionTable.pfnServerDeactivate)(); +} + +void PlayerPreThink( edict_t *pEntity ) +{ + (*other_gFunctionTable.pfnPlayerPreThink)(pEntity); +} + +void PlayerPostThink( edict_t *pEntity ) +{ + (*other_gFunctionTable.pfnPlayerPostThink)(pEntity); +} + +void StartFrame( void ) +{ + if (gpGlobals->deathmatch) + { + edict_t *pPlayer; + static float check_server_cmd = 0.0; + static int i, index, player_index, bot_index; + static float previous_time = -1.0; + static float client_update_time = 0.0; + clientdata_s cd; + char msg[256]; + int count; + + // if a new map has started then (MUST BE FIRST IN StartFrame)... + if ((gpGlobals->time + 0.1) < previous_time) + { + char filename[256]; + char mapname[64]; + + check_server_cmd = 0.0; // reset at start of map + + // check if mapname_bot.cfg file exists... + + strcpy(mapname, STRING(gpGlobals->mapname)); + strcat(mapname, "_bot.cfg"); + + UTIL_BuildFileName(filename, "maps", mapname); + + if ((bot_cfg_fp = fopen(filename, "r")) != NULL) + { + sprintf(msg, "Executing %s\n", filename); + ALERT( at_console, msg ); + + for (index = 0; index < 32; index++) + { + bots[index].is_used = FALSE; + bots[index].respawn_state = 0; + bots[index].kick_time = 0.0; + } + + if (IS_DEDICATED_SERVER()) + bot_cfg_pause_time = gpGlobals->time + 5.0; + else + bot_cfg_pause_time = gpGlobals->time + 20.0; + } + else + { + count = 0; + + // mark the bots as needing to be respawned... + for (index = 0; index < 32; index++) + { + if (count >= prev_num_bots) + { + bots[index].is_used = FALSE; + bots[index].respawn_state = 0; + bots[index].kick_time = 0.0; + } + + if (bots[index].is_used) // is this slot used? + { + bots[index].respawn_state = RESPAWN_NEED_TO_RESPAWN; + count++; + } + + // check for any bots that were very recently kicked... + if ((bots[index].kick_time + 5.0) > previous_time) + { + bots[index].respawn_state = RESPAWN_NEED_TO_RESPAWN; + count++; + } + else + bots[index].kick_time = 0.0; // reset to prevent false spawns later + } + + // set the respawn time + if (IS_DEDICATED_SERVER()) + respawn_time = gpGlobals->time + 5.0; + else + respawn_time = gpGlobals->time + 20.0; + } + + client_update_time = gpGlobals->time + 10.0; // start updating client data again + + bot_check_time = gpGlobals->time + 30.0; + } + + if (!IS_DEDICATED_SERVER()) + { + if ((listenserver_edict != NULL) && (welcome_sent == FALSE) && + (welcome_time < 1.0)) + { + // are they out of observer mode yet? + if (IsAlive(listenserver_edict)) + welcome_time = gpGlobals->time + 5.0; // welcome in 5 seconds + } + + if ((welcome_time > 0.0) && (welcome_time < gpGlobals->time) && + (welcome_sent == FALSE)) + { + // let's send a welcome message to this client... + //UTIL_SayText(welcome_msg, listenserver_edict); + + welcome_sent = TRUE; // clear this so we only do it once + } + } + + if (client_update_time <= gpGlobals->time) + { + client_update_time = gpGlobals->time + 1.0; + + for (i=0; i < 32; i++) + { + if (bots[i].is_used) + { + memset(&cd, 0, sizeof(cd)); + + UpdateClientData( bots[i].pEdict, 1, &cd ); + + // see if a weapon was dropped... + if (bots[i].bot_weapons != cd.weapons) + { + bots[i].bot_weapons = cd.weapons; + } + } + } + } + + count = 0; + + for (bot_index = 0; bot_index < gpGlobals->maxClients; bot_index++) + { + if ((bots[bot_index].is_used) && // is this slot used AND + (bots[bot_index].respawn_state == RESPAWN_IDLE)) // not respawning + { + BotThink(&bots[bot_index]); + + count++; + + if ((mod_id == FRONTLINE_DLL) && (flf_bug_check == 0)) + { + edict_t *pent = NULL; + int fix_flag = 0; + + flf_bug_check = 1; + + while ((pent = UTIL_FindEntityByClassname( pent, "capture_point" )) != NULL) + { + if (pent->v.skin != 0) // not blue skin? + { + flf_bug_fix = 1; // need to use bug fix code + } + } + } + } + } + + if (count > num_bots) + num_bots = count; + + for (player_index = 1; player_index <= gpGlobals->maxClients; player_index++) + { + pPlayer = INDEXENT(player_index); + + if (pPlayer && !pPlayer->free) + { + if ((g_waypoint_on) && FBitSet(pPlayer->v.flags, FL_CLIENT)) + { + WaypointThink(pPlayer); + } + + if ((mod_id == FRONTLINE_DLL) && (flf_bug_check == 0)) + { + edict_t *pent = NULL; + int fix_flag = 0; + + flf_bug_check = 1; + + while ((pent = UTIL_FindEntityByClassname( pent, "capture_point" )) != NULL) + { + if (pent->v.skin != 0) // not blue skin? + { + flf_bug_fix = 1; // need to use bug fix code + } + } + } + } + } + + // are we currently respawning bots and is it time to spawn one yet? + if ((respawn_time > 1.0) && (respawn_time <= gpGlobals->time)) + { + int index = 0; + + // find bot needing to be respawned... + while ((index < 32) && + (bots[index].respawn_state != RESPAWN_NEED_TO_RESPAWN)) + index++; + + if (index < 32) + { + bots[index].respawn_state = RESPAWN_IS_RESPAWNING; + bots[index].is_used = FALSE; // free up this slot + + // respawn 1 bot then wait a while (otherwise engine crashes) + if ((mod_id == VALVE_DLL) || + ((mod_id == GEARBOX_DLL) && (pent_info_ctfdetect == NULL))) + { + char c_skill[2]; + + sprintf(c_skill, "%d", bots[index].bot_skill); + + BotCreate(NULL, bots[index].skin, bots[index].name, c_skill, NULL); + } + else + { + char c_skill[2]; + char c_team[2]; + char c_class[3]; + + sprintf(c_skill, "%d", bots[index].bot_skill); + sprintf(c_team, "%d", bots[index].bot_team); + sprintf(c_class, "%d", bots[index].bot_class); + + if ((mod_id == TFC_DLL) || (mod_id == GEARBOX_DLL)) + BotCreate(NULL, NULL, NULL, bots[index].name, c_skill); + else + BotCreate(NULL, c_team, c_class, bots[index].name, c_skill); + } + + respawn_time = gpGlobals->time + 2.0; // set next respawn time + + bot_check_time = gpGlobals->time + 5.0; + } + else + { + respawn_time = 0.0; + } + } + + if (g_GameRules) + { + if (need_to_open_cfg) // have we open bot.cfg file yet? + { + char filename[256]; + char mapname[64]; + + need_to_open_cfg = FALSE; // only do this once!!! + + // check if mapname_bot.cfg file exists... + + strcpy(mapname, STRING(gpGlobals->mapname)); + strcat(mapname, "_bot.cfg"); + + UTIL_BuildFileName(filename, "maps", mapname); + + if ((bot_cfg_fp = fopen(filename, "r")) != NULL) + { + sprintf(msg, "Executing %s\n", filename); + ALERT( at_console, msg ); + } + else + { + UTIL_BuildFileName(filename, "bot.cfg", NULL); + + sprintf(msg, "Executing %s\n", filename); + ALERT( at_console, msg ); + + bot_cfg_fp = fopen(filename, "r"); + + if (bot_cfg_fp == NULL) + ALERT( at_console, "bot.cfg file not found\n" ); + } + + if (IS_DEDICATED_SERVER()) + bot_cfg_pause_time = gpGlobals->time + 5.0; + else + bot_cfg_pause_time = gpGlobals->time + 20.0; + } + + if (!IS_DEDICATED_SERVER() && !spawn_time_reset) + { + if (listenserver_edict != NULL) + { + if (IsAlive(listenserver_edict)) + { + spawn_time_reset = TRUE; + + if (respawn_time >= 1.0) + respawn_time = min(respawn_time, gpGlobals->time + (float)1.0); + + if (bot_cfg_pause_time >= 1.0) + bot_cfg_pause_time = min(bot_cfg_pause_time, gpGlobals->time + (float)1.0); + } + } + } + + if ((bot_cfg_fp) && + (bot_cfg_pause_time >= 1.0) && (bot_cfg_pause_time <= gpGlobals->time)) + { + // process bot.cfg file options... + ProcessBotCfgFile(); + } + + } + + // if time to check for server commands then do so... + if ((check_server_cmd <= gpGlobals->time) && IS_DEDICATED_SERVER()) + { + check_server_cmd = gpGlobals->time + 1.0; + + char *cvar_bot = (char *)CVAR_GET_STRING( "bot" ); + + if ( cvar_bot && cvar_bot[0] ) + { + char cmd_line[80]; + char *cmd, *arg1, *arg2, *arg3, *arg4; + + strcpy(cmd_line, cvar_bot); + + index = 0; + cmd = cmd_line; + arg1 = arg2 = arg3 = arg4 = NULL; + + // skip to blank or end of string... + while ((cmd_line[index] != ' ') && (cmd_line[index] != 0)) + index++; + + if (cmd_line[index] == ' ') + { + cmd_line[index++] = 0; + arg1 = &cmd_line[index]; + + // skip to blank or end of string... + while ((cmd_line[index] != ' ') && (cmd_line[index] != 0)) + index++; + + if (cmd_line[index] == ' ') + { + cmd_line[index++] = 0; + arg2 = &cmd_line[index]; + + // skip to blank or end of string... + while ((cmd_line[index] != ' ') && (cmd_line[index] != 0)) + index++; + + if (cmd_line[index] == ' ') + { + cmd_line[index++] = 0; + arg3 = &cmd_line[index]; + + // skip to blank or end of string... + while ((cmd_line[index] != ' ') && (cmd_line[index] != 0)) + index++; + + if (cmd_line[index] == ' ') + { + cmd_line[index++] = 0; + arg4 = &cmd_line[index]; + } + } + } + } + + if (strcmp(cmd, "addbot") == 0) + { + BotCreate( NULL, arg1, arg2, arg3, arg4 ); + + bot_check_time = gpGlobals->time + 5.0; + } + else if (strcmp(cmd, "min_bots") == 0) + { + min_bots = atoi( arg1 ); + + if ((min_bots < 0) || (min_bots > 31)) + min_bots = 1; + + sprintf(msg, "min_bots set to %d\n", min_bots); + printf(msg); + } + else if (strcmp(cmd, "max_bots") == 0) + { + max_bots = atoi( arg1 ); + + if ((max_bots < 0) || (max_bots > 31)) + max_bots = 1; + + sprintf(msg, "max_bots set to %d\n", max_bots); + printf(msg); + } + + CVAR_SET_STRING("bot", ""); + } + } + + // check if time to see if a bot needs to be created... + if (bot_check_time < gpGlobals->time) + { + int count = 0; + + bot_check_time = gpGlobals->time + 5.0; + + for (i = 0; i < 32; i++) + { + if (clients[i] != NULL) + count++; + } + + // if there are currently less than the maximum number of "players" + // then add another bot using the default skill level... + if ((count < max_bots) && (max_bots != -1)) + { + BotCreate( NULL, NULL, NULL, NULL, NULL ); + } + } + + previous_time = gpGlobals->time; + } + + (*other_gFunctionTable.pfnStartFrame)(); +} + +void ParmsNewLevel( void ) +{ + (*other_gFunctionTable.pfnParmsNewLevel)(); +} + +void ParmsChangeLevel( void ) +{ + (*other_gFunctionTable.pfnParmsChangeLevel)(); +} + +const char *GetGameDescription( void ) +{ + return (*other_gFunctionTable.pfnGetGameDescription)(); +} + +void PlayerCustomization( edict_t *pEntity, customization_t *pCust ) +{ + if (debug_engine) { fp=fopen("bot.txt", "a"); fprintf(fp, "PlayerCustomization: %x\n",pEntity); fclose(fp); } + + (*other_gFunctionTable.pfnPlayerCustomization)(pEntity, pCust); +} + +void SpectatorConnect( edict_t *pEntity ) +{ + (*other_gFunctionTable.pfnSpectatorConnect)(pEntity); +} + +void SpectatorDisconnect( edict_t *pEntity ) +{ + (*other_gFunctionTable.pfnSpectatorDisconnect)(pEntity); +} + +void SpectatorThink( edict_t *pEntity ) +{ + (*other_gFunctionTable.pfnSpectatorThink)(pEntity); +} + +void Sys_Error( const char *error_string ) +{ + (*other_gFunctionTable.pfnSys_Error)(error_string); +} + +void PM_Move ( struct playermove_s *ppmove, int server ) +{ + (*other_gFunctionTable.pfnPM_Move)(ppmove, server); +} + +void PM_Init ( struct playermove_s *ppmove ) +{ + (*other_gFunctionTable.pfnPM_Init)(ppmove); +} + +char PM_FindTextureType( char *name ) +{ + return (*other_gFunctionTable.pfnPM_FindTextureType)(name); +} + +void SetupVisibility( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas ) +{ + (*other_gFunctionTable.pfnSetupVisibility)(pViewEntity, pClient, pvs, pas); +} + +void UpdateClientData ( const struct edict_s *ent, int sendweapons, struct clientdata_s *cd ) +{ + (*other_gFunctionTable.pfnUpdateClientData)(ent, sendweapons, cd); +} + +int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet ) +{ + return (*other_gFunctionTable.pfnAddToFullPack)(state, e, ent, host, hostflags, player, pSet); +} + +void CreateBaseline( int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs ) +{ + (*other_gFunctionTable.pfnCreateBaseline)(player, eindex, baseline, entity, playermodelindex, player_mins, player_maxs); +} + +void RegisterEncoders( void ) +{ + (*other_gFunctionTable.pfnRegisterEncoders)(); +} + +int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) +{ + return (*other_gFunctionTable.pfnGetWeaponData)(player, info); +} + +void CmdStart( const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed ) +{ + (*other_gFunctionTable.pfnCmdStart)(player, cmd, random_seed); +} + +void CmdEnd ( const edict_t *player ) +{ + (*other_gFunctionTable.pfnCmdEnd)(player); +} + +int ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ) +{ + return (*other_gFunctionTable.pfnConnectionlessPacket)(net_from, args, response_buffer, response_buffer_size); +} + +int GetHullBounds( int hullnumber, float *mins, float *maxs ) +{ + return (*other_gFunctionTable.pfnGetHullBounds)(hullnumber, mins, maxs); +} + +void CreateInstancedBaselines( void ) +{ + (*other_gFunctionTable.pfnCreateInstancedBaselines)(); +} + +int InconsistentFile( const edict_t *player, const char *filename, char *disconnect_message ) +{ + if (debug_engine) { fp=fopen("bot.txt", "a"); fprintf(fp, "InconsistentFile: %x filename=%s\n",player,filename); fclose(fp); } + + return (*other_gFunctionTable.pfnInconsistentFile)(player, filename, disconnect_message); +} + +int AllowLagCompensation( void ) +{ + return (*other_gFunctionTable.pfnAllowLagCompensation)(); +} + + +DLL_FUNCTIONS gFunctionTable = +{ + GameDLLInit, //pfnGameInit + DispatchSpawn, //pfnSpawn + DispatchThink, //pfnThink + DispatchUse, //pfnUse + DispatchTouch, //pfnTouch + DispatchBlocked, //pfnBlocked + DispatchKeyValue, //pfnKeyValue + DispatchSave, //pfnSave + DispatchRestore, //pfnRestore + DispatchObjectCollsionBox, //pfnAbsBox + + SaveWriteFields, //pfnSaveWriteFields + SaveReadFields, //pfnSaveReadFields + + SaveGlobalState, //pfnSaveGlobalState + RestoreGlobalState, //pfnRestoreGlobalState + ResetGlobalState, //pfnResetGlobalState + + ClientConnect, //pfnClientConnect + ClientDisconnect, //pfnClientDisconnect + ClientKill, //pfnClientKill + ClientPutInServer, //pfnClientPutInServer + ClientCommand, //pfnClientCommand + ClientUserInfoChanged, //pfnClientUserInfoChanged + ServerActivate, //pfnServerActivate + ServerDeactivate, //pfnServerDeactivate + + PlayerPreThink, //pfnPlayerPreThink + PlayerPostThink, //pfnPlayerPostThink + + StartFrame, //pfnStartFrame + ParmsNewLevel, //pfnParmsNewLevel + ParmsChangeLevel, //pfnParmsChangeLevel + + GetGameDescription, //pfnGetGameDescription Returns string describing current .dll game. + PlayerCustomization, //pfnPlayerCustomization Notifies .dll of new customization for player. + + SpectatorConnect, //pfnSpectatorConnect Called when spectator joins server + SpectatorDisconnect, //pfnSpectatorDisconnect Called when spectator leaves the server + SpectatorThink, //pfnSpectatorThink Called when spectator sends a command packet (usercmd_t) + + Sys_Error, //pfnSys_Error Called when engine has encountered an error + + PM_Move, //pfnPM_Move + PM_Init, //pfnPM_Init Server version of player movement initialization + PM_FindTextureType, //pfnPM_FindTextureType + + SetupVisibility, //pfnSetupVisibility Set up PVS and PAS for networking for this client + UpdateClientData, //pfnUpdateClientData Set up data sent only to specific client + AddToFullPack, //pfnAddToFullPack + CreateBaseline, //pfnCreateBaseline Tweak entity baseline for network encoding, allows setup of player baselines, too. + RegisterEncoders, //pfnRegisterEncoders Callbacks for network encoding + GetWeaponData, //pfnGetWeaponData + CmdStart, //pfnCmdStart + CmdEnd, //pfnCmdEnd + ConnectionlessPacket, //pfnConnectionlessPacket + GetHullBounds, //pfnGetHullBounds + CreateInstancedBaselines, //pfnCreateInstancedBaselines + InconsistentFile, //pfnInconsistentFile + AllowLagCompensation, //pfnAllowLagCompensation +}; + +#ifdef __BORLANDC__ +int EXPORT GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion ) +#else +extern "C" EXPORT int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion ) +#endif +{ + // check if engine's pointer is valid and version is correct... + + if ( !pFunctionTable || interfaceVersion != INTERFACE_VERSION ) + return FALSE; + + // pass engine callback function table to engine... + memcpy( pFunctionTable, &gFunctionTable, sizeof( DLL_FUNCTIONS ) ); + + // pass other DLLs engine callbacks to function table... + if (!(*other_GetEntityAPI)(&other_gFunctionTable, INTERFACE_VERSION)) + { + return FALSE; // error initializing function table!!! + } + + return TRUE; +} + + +#ifdef __BORLANDC__ +int EXPORT GetNewDLLFunctions( NEW_DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ) +#else +extern "C" EXPORT int GetNewDLLFunctions( NEW_DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ) +#endif +{ + if (other_GetNewDLLFunctions == NULL) + return FALSE; + + // pass other DLLs engine callbacks to function table... + if (!(*other_GetNewDLLFunctions)(pFunctionTable, interfaceVersion)) + { + return FALSE; // error initializing function table!!! + } + + return TRUE; +} + + +void FakeClientCommand(edict_t *pBot, char *arg1, char *arg2, char *arg3) +{ + int length; + + memset(g_argv, 0, sizeof(g_argv)); + + isFakeClientCommand = 1; + + if ((arg1 == NULL) || (*arg1 == 0)) + return; + + if ((arg2 == NULL) || (*arg2 == 0)) + { + length = sprintf(&g_argv[0], "%s", arg1); + fake_arg_count = 1; + } + else if ((arg3 == NULL) || (*arg3 == 0)) + { + length = sprintf(&g_argv[0], "%s %s", arg1, arg2); + fake_arg_count = 2; + } + else + { + length = sprintf(&g_argv[0], "%s %s %s", arg1, arg2, arg3); + fake_arg_count = 3; + } + + g_argv[length] = 0; // null terminate just in case + + strcpy(&g_argv[64], arg1); + + if (arg2) + strcpy(&g_argv[128], arg2); + + if (arg3) + strcpy(&g_argv[192], arg3); + + // allow the MOD DLL to execute the ClientCommand... + ClientCommand(pBot); + + isFakeClientCommand = 0; +} + + +const char *Cmd_Args( void ) +{ + if (isFakeClientCommand) + { + return &g_argv[0]; + } + else + { + return (*g_engfuncs.pfnCmd_Args)(); + } +} + + +const char *Cmd_Argv( int argc ) +{ + if (isFakeClientCommand) + { + if (argc == 0) + { + return &g_argv[64]; + } + else if (argc == 1) + { + return &g_argv[128]; + } + else if (argc == 2) + { + return &g_argv[192]; + } + else + { + return NULL; + } + } + else + { + return (*g_engfuncs.pfnCmd_Argv)(argc); + } +} + + +int Cmd_Argc( void ) +{ + if (isFakeClientCommand) + { + return fake_arg_count; + } + else + { + return (*g_engfuncs.pfnCmd_Argc)(); + } +} + + +void ProcessBotCfgFile(void) +{ + int ch; + char cmd_line[256]; + int cmd_index; + static char server_cmd[80]; + char *cmd, *arg1, *arg2, *arg3, *arg4; + char msg[80]; + + if (bot_cfg_pause_time > gpGlobals->time) + return; + + if (bot_cfg_fp == NULL) + return; + + cmd_index = 0; + cmd_line[cmd_index] = 0; + + ch = fgetc(bot_cfg_fp); + + // skip any leading blanks + while (ch == ' ') + ch = fgetc(bot_cfg_fp); + + while ((ch != EOF) && (ch != '\r') && (ch != '\n')) + { + if (ch == '\t') // convert tabs to spaces + ch = ' '; + + cmd_line[cmd_index] = ch; + + ch = fgetc(bot_cfg_fp); + + // skip multiple spaces in input file + while ((cmd_line[cmd_index] == ' ') && + (ch == ' ')) + ch = fgetc(bot_cfg_fp); + + cmd_index++; + } + + if (ch == '\r') // is it a carriage return? + { + ch = fgetc(bot_cfg_fp); // skip the linefeed + } + + // if reached end of file, then close it + if (ch == EOF) + { + fclose(bot_cfg_fp); + + bot_cfg_fp = NULL; + + bot_cfg_pause_time = 0.0; + } + + cmd_line[cmd_index] = 0; // terminate the command line + + // copy the command line to a server command buffer... + strcpy(server_cmd, cmd_line); + strcat(server_cmd, "\n"); + + cmd_index = 0; + cmd = cmd_line; + arg1 = arg2 = arg3 = arg4 = NULL; + + // skip to blank or end of string... + while ((cmd_line[cmd_index] != ' ') && (cmd_line[cmd_index] != 0)) + cmd_index++; + + if (cmd_line[cmd_index] == ' ') + { + cmd_line[cmd_index++] = 0; + arg1 = &cmd_line[cmd_index]; + + // skip to blank or end of string... + while ((cmd_line[cmd_index] != ' ') && (cmd_line[cmd_index] != 0)) + cmd_index++; + + if (cmd_line[cmd_index] == ' ') + { + cmd_line[cmd_index++] = 0; + arg2 = &cmd_line[cmd_index]; + + // skip to blank or end of string... + while ((cmd_line[cmd_index] != ' ') && (cmd_line[cmd_index] != 0)) + cmd_index++; + + if (cmd_line[cmd_index] == ' ') + { + cmd_line[cmd_index++] = 0; + arg3 = &cmd_line[cmd_index]; + + // skip to blank or end of string... + while ((cmd_line[cmd_index] != ' ') && (cmd_line[cmd_index] != 0)) + cmd_index++; + + if (cmd_line[cmd_index] == ' ') + { + cmd_line[cmd_index++] = 0; + arg4 = &cmd_line[cmd_index]; + } + } + } + } + + if ((cmd_line[0] == '#') || (cmd_line[0] == 0)) + return; // return if comment or blank line + + if (strcmp(cmd, "addbot") == 0) + { + BotCreate( NULL, arg1, arg2, arg3, arg4 ); + + // have to delay here or engine gives "Tried to write to + // uninitialized sizebuf_t" error and crashes... + + bot_cfg_pause_time = gpGlobals->time + 2.0; + bot_check_time = gpGlobals->time + 5.0; + + return; + } + + if (strcmp(cmd, "botskill") == 0) + { + int temp = atoi(arg1); + + if ((temp >= 1) && (temp <= 5)) + default_bot_skill = atoi( arg1 ); // set default bot skill level + + return; + } + + if (strcmp(cmd, "observer") == 0) + { + int temp = atoi(arg1); + + if (temp) + b_observer_mode = TRUE; + else + b_observer_mode = FALSE; + + return; + } + + if (strcmp(cmd, "botdontshoot") == 0) + { + int temp = atoi(arg1); + + if (temp) + b_botdontshoot = TRUE; + else + b_botdontshoot = FALSE; + + return; + } + + if (strcmp(cmd, "min_bots") == 0) + { + min_bots = atoi( arg1 ); + + if ((min_bots < 0) || (min_bots > 31)) + min_bots = 1; + + if (IS_DEDICATED_SERVER()) + { + sprintf(msg, "min_bots set to %d\n", min_bots); + printf(msg); + } + + return; + } + + if (strcmp(cmd, "max_bots") == 0) + { + max_bots = atoi( arg1 ); + + if ((max_bots < 0) || (max_bots > 31)) + max_bots = 1; + + if (IS_DEDICATED_SERVER()) + { + sprintf(msg, "max_bots set to %d\n", max_bots); + printf(msg); + } + + return; + } + + if (strcmp(cmd, "pause") == 0) + { + bot_cfg_pause_time = gpGlobals->time + atoi( arg1 ); + + return; + } + + sprintf(msg, "executing server command: %s\n", server_cmd); + ALERT( at_console, msg ); + + if (IS_DEDICATED_SERVER()) + printf(msg); + + SERVER_COMMAND(server_cmd); +} + diff --git a/main/source/HPB_bot/dlls/engine.cpp b/main/source/HPB_bot/dlls/engine.cpp new file mode 100644 index 00000000..dbf32bc6 --- /dev/null +++ b/main/source/HPB_bot/dlls/engine.cpp @@ -0,0 +1,1233 @@ +// +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// engine.cpp +// + +#include "extdll.h" +#include "util.h" + +#include "bot.h" +#include "bot_client.h" +#include "HPB_bot/engine/engine.h" + + +extern enginefuncs_t g_engfuncs; +extern bot_t bots[32]; +extern int mod_id; + + +int debug_engine = 0; + +void (*botMsgFunction)(void *, int) = NULL; +void (*botMsgEndFunction)(void *, int) = NULL; +int botMsgIndex; + +// messages created in RegUserMsg which will be "caught" +int message_VGUI = 0; +int message_ShowMenu = 0; +int message_WeaponList = 0; +int message_CurWeapon = 0; +int message_AmmoX = 0; +int message_WeapPickup = 0; +int message_AmmoPickup = 0; +int message_ItemPickup = 0; +int message_Health = 0; +int message_Battery = 0; // Armor +int message_Damage = 0; +int message_Money = 0; // for Counter-Strike +int message_DeathMsg = 0; +int message_TextMsg = 0; +int message_WarmUp = 0; // for Front Line Force +int message_WinMessage = 0; // for Front Line Force +int message_ScreenFade = 0; + +// AvH messages +int message_SetPlayMode = 0; +int message_SetOrder = 0; +int message_SetResources = 0; + +static FILE *fp; + + +int pfnPrecacheModel(char* s) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPrecacheModel: %s\n",s); fclose(fp); } + return (*g_engfuncs.pfnPrecacheModel)(s); +} +int pfnPrecacheSound(char* s) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPrecacheSound: %s\n",s); fclose(fp); } + return (*g_engfuncs.pfnPrecacheSound)(s); +} +void pfnSetModel(edict_t *e, const char *m) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetModel: edict=%x %s\n",e,m); fclose(fp); } + (*g_engfuncs.pfnSetModel)(e, m); +} +int pfnModelIndex(const char *m) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnModelIndex: %s\n",m); fclose(fp); } + return (*g_engfuncs.pfnModelIndex)(m); +} +int pfnModelFrames(int modelIndex) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnModelFrames:\n"); fclose(fp); } + return (*g_engfuncs.pfnModelFrames)(modelIndex); +} +void pfnSetSize(edict_t *e, const float *rgflMin, const float *rgflMax) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetSize: %x\n",e); fclose(fp); } + (*g_engfuncs.pfnSetSize)(e, rgflMin, rgflMax); +} +void pfnChangeLevel(char* s1, char* s2) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnChangeLevel:\n"); fclose(fp); } + + // kick any bot off of the server after time/frag limit... + for (int index = 0; index < 32; index++) + { + if (bots[index].is_used) // is this slot used? + { + char cmd[40]; + + sprintf(cmd, "kick \"%s\"\n", bots[index].name); + + bots[index].respawn_state = RESPAWN_NEED_TO_RESPAWN; + + SERVER_COMMAND(cmd); // kick the bot using (kick "name") + } + } + + (*g_engfuncs.pfnChangeLevel)(s1, s2); +} +void pfnGetSpawnParms(edict_t *ent) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetSpawnParms:\n"); fclose(fp); } + (*g_engfuncs.pfnGetSpawnParms)(ent); +} +void pfnSaveSpawnParms(edict_t *ent) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSaveSpawnParms:\n"); fclose(fp); } + (*g_engfuncs.pfnSaveSpawnParms)(ent); +} +float pfnVecToYaw(const float *rgflVector) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnVecToYaw:\n"); fclose(fp); } + return (*g_engfuncs.pfnVecToYaw)(rgflVector); +} +void pfnVecToAngles(const float *rgflVectorIn, float *rgflVectorOut) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnVecToAngles:\n"); fclose(fp); } + (*g_engfuncs.pfnVecToAngles)(rgflVectorIn, rgflVectorOut); +} +void pfnMoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnMoveToOrigin:\n"); fclose(fp); } + (*g_engfuncs.pfnMoveToOrigin)(ent, pflGoal, dist, iMoveType); +} +void pfnChangeYaw(edict_t* ent) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnChangeYaw:\n"); fclose(fp); } + (*g_engfuncs.pfnChangeYaw)(ent); +} +void pfnChangePitch(edict_t* ent) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnChangePitch:\n"); fclose(fp); } + (*g_engfuncs.pfnChangePitch)(ent); +} +edict_t* pfnFindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnFindEntityByString: %s\n",pszValue); fclose(fp); } + return (*g_engfuncs.pfnFindEntityByString)(pEdictStartSearchAfter, pszField, pszValue); +} +int pfnGetEntityIllum(edict_t* pEnt) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetEntityIllum:\n"); fclose(fp); } + return (*g_engfuncs.pfnGetEntityIllum)(pEnt); +} +edict_t* pfnFindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnFindEntityInSphere:\n"); fclose(fp); } + return (*g_engfuncs.pfnFindEntityInSphere)(pEdictStartSearchAfter, org, rad); +} +edict_t* pfnFindClientInPVS(edict_t *pEdict) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnFindClientInPVS:\n"); fclose(fp); } + return (*g_engfuncs.pfnFindClientInPVS)(pEdict); +} +edict_t* pfnEntitiesInPVS(edict_t *pplayer) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnEntitiesInPVS:\n"); fclose(fp); } + return (*g_engfuncs.pfnEntitiesInPVS)(pplayer); +} +void pfnMakeVectors(const float *rgflVector) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnMakeVectors:\n"); fclose(fp); } + (*g_engfuncs.pfnMakeVectors)(rgflVector); +} +void pfnAngleVectors(const float *rgflVector, float *forward, float *right, float *up) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnAngleVectors:\n"); fclose(fp); } + (*g_engfuncs.pfnAngleVectors)(rgflVector, forward, right, up); +} +edict_t* pfnCreateEntity(void) +{ + edict_t *pent = (*g_engfuncs.pfnCreateEntity)(); + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCreateEntity: %x\n",pent); fclose(fp); } + return pent; +} +void pfnRemoveEntity(edict_t* e) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnRemoveEntity: %x\n",e); fclose(fp); } + if (debug_engine) + { + fp=fopen("bot.txt","a"); + fprintf(fp,"pfnRemoveEntity: %x\n",e); + if (e->v.model != 0) + fprintf(fp," model=%s\n", STRING(e->v.model)); + fclose(fp); + } + + (*g_engfuncs.pfnRemoveEntity)(e); +} +edict_t* pfnCreateNamedEntity(int className) +{ + edict_t *pent = (*g_engfuncs.pfnCreateNamedEntity)(className); + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCreateNamedEntity: edict=%x name=%s\n",pent,STRING(className)); fclose(fp); } + return pent; +} +void pfnMakeStatic(edict_t *ent) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnMakeStatic:\n"); fclose(fp); } + (*g_engfuncs.pfnMakeStatic)(ent); +} +int pfnEntIsOnFloor(edict_t *e) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnEntIsOnFloor:\n"); fclose(fp); } + return (*g_engfuncs.pfnEntIsOnFloor)(e); +} +int pfnDropToFloor(edict_t* e) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnDropToFloor:\n"); fclose(fp); } + return (*g_engfuncs.pfnDropToFloor)(e); +} +int pfnWalkMove(edict_t *ent, float yaw, float dist, int iMode) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnWalkMove:\n"); fclose(fp); } + return (*g_engfuncs.pfnWalkMove)(ent, yaw, dist, iMode); +} +void pfnSetOrigin(edict_t *e, const float *rgflOrigin) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetOrigin:\n"); fclose(fp); } + (*g_engfuncs.pfnSetOrigin)(e, rgflOrigin); +} +void pfnEmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnEmitSound:\n"); fclose(fp); } + (*g_engfuncs.pfnEmitSound)(entity, channel, sample, volume, attenuation, fFlags, pitch); +} +void pfnEmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnEmitAmbientSound:\n"); fclose(fp); } + (*g_engfuncs.pfnEmitAmbientSound)(entity, pos, samp, vol, attenuation, fFlags, pitch); +} +void pfnTraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnTraceLine:\n"); fclose(fp); } + (*g_engfuncs.pfnTraceLine)(v1, v2, fNoMonsters, pentToSkip, ptr); +} +void pfnTraceToss(edict_t* pent, edict_t* pentToIgnore, TraceResult *ptr) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnTraceToss:\n"); fclose(fp); } + (*g_engfuncs.pfnTraceToss)(pent, pentToIgnore, ptr); +} +int pfnTraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnTraceMonsterHull:\n"); fclose(fp); } + return (*g_engfuncs.pfnTraceMonsterHull)(pEdict, v1, v2, fNoMonsters, pentToSkip, ptr); +} +void pfnTraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnTraceHull:\n"); fclose(fp); } + (*g_engfuncs.pfnTraceHull)(v1, v2, fNoMonsters, hullNumber, pentToSkip, ptr); +} +void pfnTraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnTraceModel:\n"); fclose(fp); } + (*g_engfuncs.pfnTraceModel)(v1, v2, hullNumber, pent, ptr); +} +const char *pfnTraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnTraceTexture:\n"); fclose(fp); } + return (*g_engfuncs.pfnTraceTexture)(pTextureEntity, v1, v2); +} +void pfnTraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnTraceSphere:\n"); fclose(fp); } + (*g_engfuncs.pfnTraceSphere)(v1, v2, fNoMonsters, radius, pentToSkip, ptr); +} +void pfnGetAimVector(edict_t* ent, float speed, float *rgflReturn) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetAimVector:\n"); fclose(fp); } + (*g_engfuncs.pfnGetAimVector)(ent, speed, rgflReturn); +} +void pfnServerCommand(char* str) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnServerCommand: %s\n",str); fclose(fp); } + (*g_engfuncs.pfnServerCommand)(str); +} +void pfnServerExecute(void) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnServerExecute:\n"); fclose(fp); } + (*g_engfuncs.pfnServerExecute)(); +} +void pfnClientCommand(edict_t* pEdict, char* szFmt, ...) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnClientCommand=%s\n",szFmt); fclose(fp); } + return; +} +void pfnParticleEffect(const float *org, const float *dir, float color, float count) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnParticleEffect:\n"); fclose(fp); } + (*g_engfuncs.pfnParticleEffect)(org, dir, color, count); +} +void pfnLightStyle(int style, char* val) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnLightStyle:\n"); fclose(fp); } + (*g_engfuncs.pfnLightStyle)(style, val); +} +int pfnDecalIndex(const char *name) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnDecalIndex:\n"); fclose(fp); } + return (*g_engfuncs.pfnDecalIndex)(name); +} +int pfnPointContents(const float *rgflVector) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPointContents:\n"); fclose(fp); } + return (*g_engfuncs.pfnPointContents)(rgflVector); +} +void pfnMessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) +{ + if (gpGlobals->deathmatch) + { + int index = -1; + + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnMessageBegin: edict=%x dest=%d type=%d\n",ed,msg_dest,msg_type); fclose(fp); } + + if (ed) + { + index = UTIL_GetBotIndex(ed); + + // is this message for a bot? + if (index != -1) + { + botMsgFunction = NULL; // no msg function until known otherwise + botMsgEndFunction = NULL; // no msg end function until known otherwise + botMsgIndex = index; // index of bot receiving message + + if (mod_id == VALVE_DLL) + { + if (msg_type == message_WeaponList) + botMsgFunction = BotClient_Valve_WeaponList; + else if (msg_type == message_CurWeapon) + botMsgFunction = BotClient_Valve_CurrentWeapon; + else if (msg_type == message_AmmoX) + botMsgFunction = BotClient_Valve_AmmoX; + else if (msg_type == message_AmmoPickup) + botMsgFunction = BotClient_Valve_AmmoPickup; + else if (msg_type == message_WeapPickup) + botMsgFunction = BotClient_Valve_WeaponPickup; + else if (msg_type == message_ItemPickup) + botMsgFunction = BotClient_Valve_ItemPickup; + else if (msg_type == message_Health) + botMsgFunction = BotClient_Valve_Health; + else if (msg_type == message_Battery) + botMsgFunction = BotClient_Valve_Battery; + else if (msg_type == message_Damage) + botMsgFunction = BotClient_Valve_Damage; + else if (msg_type == message_ScreenFade) + botMsgFunction = BotClient_Valve_ScreenFade; + } + else if (mod_id == TFC_DLL) + { + if (msg_type == message_VGUI) + botMsgFunction = BotClient_TFC_VGUI; + else if (msg_type == message_WeaponList) + botMsgFunction = BotClient_TFC_WeaponList; + else if (msg_type == message_CurWeapon) + botMsgFunction = BotClient_TFC_CurrentWeapon; + else if (msg_type == message_AmmoX) + botMsgFunction = BotClient_TFC_AmmoX; + else if (msg_type == message_AmmoPickup) + botMsgFunction = BotClient_TFC_AmmoPickup; + else if (msg_type == message_WeapPickup) + botMsgFunction = BotClient_TFC_WeaponPickup; + else if (msg_type == message_ItemPickup) + botMsgFunction = BotClient_TFC_ItemPickup; + else if (msg_type == message_Health) + botMsgFunction = BotClient_TFC_Health; + else if (msg_type == message_Battery) + botMsgFunction = BotClient_TFC_Battery; + else if (msg_type == message_Damage) + botMsgFunction = BotClient_TFC_Damage; + else if (msg_type == message_ScreenFade) + botMsgFunction = BotClient_TFC_ScreenFade; + } + else if (mod_id == CSTRIKE_DLL) + { + if (msg_type == message_VGUI) + botMsgFunction = BotClient_CS_VGUI; + else if (msg_type == message_ShowMenu) + botMsgFunction = BotClient_CS_ShowMenu; + else if (msg_type == message_WeaponList) + botMsgFunction = BotClient_CS_WeaponList; + else if (msg_type == message_CurWeapon) + botMsgFunction = BotClient_CS_CurrentWeapon; + else if (msg_type == message_AmmoX) + botMsgFunction = BotClient_CS_AmmoX; + else if (msg_type == message_WeapPickup) + botMsgFunction = BotClient_CS_WeaponPickup; + else if (msg_type == message_AmmoPickup) + botMsgFunction = BotClient_CS_AmmoPickup; + else if (msg_type == message_ItemPickup) + botMsgFunction = BotClient_CS_ItemPickup; + else if (msg_type == message_Health) + botMsgFunction = BotClient_CS_Health; + else if (msg_type == message_Battery) + botMsgFunction = BotClient_CS_Battery; + else if (msg_type == message_Damage) + botMsgFunction = BotClient_CS_Damage; + else if (msg_type == message_Money) + botMsgFunction = BotClient_CS_Money; + else if (msg_type == message_ScreenFade) + botMsgFunction = BotClient_CS_ScreenFade; + } + else if (mod_id == GEARBOX_DLL) + { + if (msg_type == message_VGUI) + botMsgFunction = BotClient_Gearbox_VGUI; + else if (msg_type == message_WeaponList) + botMsgFunction = BotClient_Gearbox_WeaponList; + else if (msg_type == message_CurWeapon) + botMsgFunction = BotClient_Gearbox_CurrentWeapon; + else if (msg_type == message_AmmoX) + botMsgFunction = BotClient_Gearbox_AmmoX; + else if (msg_type == message_AmmoPickup) + botMsgFunction = BotClient_Gearbox_AmmoPickup; + else if (msg_type == message_WeapPickup) + botMsgFunction = BotClient_Gearbox_WeaponPickup; + else if (msg_type == message_ItemPickup) + botMsgFunction = BotClient_Gearbox_ItemPickup; + else if (msg_type == message_Health) + botMsgFunction = BotClient_Gearbox_Health; + else if (msg_type == message_Battery) + botMsgFunction = BotClient_Gearbox_Battery; + else if (msg_type == message_Damage) + botMsgFunction = BotClient_Gearbox_Damage; + else if (msg_type == message_ScreenFade) + botMsgFunction = BotClient_Gearbox_ScreenFade; + } + else if (mod_id == FRONTLINE_DLL) + { + if (msg_type == message_VGUI) + botMsgFunction = BotClient_FLF_VGUI; + else if (msg_type == message_WeaponList) + botMsgFunction = BotClient_FLF_WeaponList; + else if (msg_type == message_CurWeapon) + botMsgFunction = BotClient_FLF_CurrentWeapon; + else if (msg_type == message_AmmoX) + botMsgFunction = BotClient_FLF_AmmoX; + else if (msg_type == message_AmmoPickup) + botMsgFunction = BotClient_FLF_AmmoPickup; + else if (msg_type == message_WeapPickup) + botMsgFunction = BotClient_FLF_WeaponPickup; + else if (msg_type == message_ItemPickup) + botMsgFunction = BotClient_FLF_ItemPickup; + else if (msg_type == message_Health) + botMsgFunction = BotClient_FLF_Health; + else if (msg_type == message_Battery) + botMsgFunction = BotClient_FLF_Battery; + else if (msg_type == message_Damage) + botMsgFunction = BotClient_FLF_Damage; + else if (msg_type == message_TextMsg) + botMsgFunction = BotClient_FLF_TextMsg; + else if (msg_type == message_WarmUp) + botMsgFunction = BotClient_FLF_WarmUp; + else if (msg_type == message_ScreenFade) + botMsgFunction = BotClient_FLF_ScreenFade; + else if (msg_type == 23) // SVC_TEMPENTITY + { + botMsgFunction = BotClient_FLF_TempEntity; + botMsgEndFunction = BotClient_FLF_TempEntity; + } + } + else if (mod_id == AVH_DLL) + { + if (msg_type == message_SetPlayMode) + botMsgFunction = BotClient_AVH_SetPlayMode; + else if (msg_type == message_AmmoX) + botMsgFunction = BotClient_Valve_AmmoX; + else if (msg_type == message_AmmoPickup) + botMsgFunction = BotClient_Valve_AmmoPickup; + else if (msg_type == message_WeapPickup) + botMsgFunction = BotClient_Valve_WeaponPickup; + else if (msg_type == message_ItemPickup) + botMsgFunction = BotClient_Valve_ItemPickup; + else if (msg_type == message_WeaponList) + botMsgFunction = BotClient_Valve_WeaponList; + else if (msg_type == message_SetOrder) + botMsgFunction = BotClient_AVH_SetOrder; + else if (msg_type == message_SetResources) + botMsgFunction = BotClient_AVH_SetResources; + } + } + } + else if (msg_dest == MSG_ALL) + { + botMsgFunction = NULL; // no msg function until known otherwise + botMsgIndex = -1; // index of bot receiving message (none) + + if (mod_id == VALVE_DLL) + { + if (msg_type == message_DeathMsg) + botMsgFunction = BotClient_Valve_DeathMsg; + } + else if (mod_id == TFC_DLL) + { + if (msg_type == message_DeathMsg) + botMsgFunction = BotClient_TFC_DeathMsg; + } + else if (mod_id == CSTRIKE_DLL) + { + if (msg_type == message_DeathMsg) + botMsgFunction = BotClient_CS_DeathMsg; + } + else if (mod_id == GEARBOX_DLL) + { + if (msg_type == message_DeathMsg) + botMsgFunction = BotClient_Gearbox_DeathMsg; + } + else if (mod_id == FRONTLINE_DLL) + { + if (msg_type == message_DeathMsg) + botMsgFunction = BotClient_FLF_DeathMsg; + else if (msg_type == message_WarmUp) + botMsgFunction = BotClient_FLF_WarmUpAll; + else if (msg_type == message_WinMessage) + botMsgFunction = BotClient_FLF_WinMessage; + } + } + } + + (*g_engfuncs.pfnMessageBegin)(msg_dest, msg_type, pOrigin, ed); +} +void pfnMessageEnd(void) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnMessageEnd:\n"); fclose(fp); } + + if (botMsgEndFunction) + (*botMsgEndFunction)(NULL, botMsgIndex); // NULL indicated msg end + + // clear out the bot message function pointers... + botMsgFunction = NULL; + botMsgEndFunction = NULL; + } + + (*g_engfuncs.pfnMessageEnd)(); +} +void pfnWriteByte(int iValue) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnWriteByte: %d\n",iValue); fclose(fp); } + + // if this message is for a bot, call the client message function... + if (botMsgFunction) + (*botMsgFunction)((void *)&iValue, botMsgIndex); + } + + (*g_engfuncs.pfnWriteByte)(iValue); +} +void pfnWriteChar(int iValue) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnWriteChar: %d\n",iValue); fclose(fp); } + + // if this message is for a bot, call the client message function... + if (botMsgFunction) + (*botMsgFunction)((void *)&iValue, botMsgIndex); + } + + (*g_engfuncs.pfnWriteChar)(iValue); +} +void pfnWriteShort(int iValue) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnWriteShort: %d\n",iValue); fclose(fp); } + + // if this message is for a bot, call the client message function... + if (botMsgFunction) + (*botMsgFunction)((void *)&iValue, botMsgIndex); + } + + (*g_engfuncs.pfnWriteShort)(iValue); +} +void pfnWriteLong(int iValue) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnWriteLong: %d\n",iValue); fclose(fp); } + + // if this message is for a bot, call the client message function... + if (botMsgFunction) + (*botMsgFunction)((void *)&iValue, botMsgIndex); + } + + (*g_engfuncs.pfnWriteLong)(iValue); +} +void pfnWriteAngle(float flValue) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnWriteAngle: %f\n",flValue); fclose(fp); } + + // if this message is for a bot, call the client message function... + if (botMsgFunction) + (*botMsgFunction)((void *)&flValue, botMsgIndex); + } + + (*g_engfuncs.pfnWriteAngle)(flValue); +} +void pfnWriteCoord(float flValue) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnWriteCoord: %f\n",flValue); fclose(fp); } + + // if this message is for a bot, call the client message function... + if (botMsgFunction) + (*botMsgFunction)((void *)&flValue, botMsgIndex); + } + + (*g_engfuncs.pfnWriteCoord)(flValue); +} +void pfnWriteString(const char *sz) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnWriteString: %s\n",sz); fclose(fp); } + + // if this message is for a bot, call the client message function... + if (botMsgFunction) + (*botMsgFunction)((void *)sz, botMsgIndex); + } + + (*g_engfuncs.pfnWriteString)(sz); +} +void pfnWriteEntity(int iValue) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnWriteEntity: %d\n",iValue); fclose(fp); } + + // if this message is for a bot, call the client message function... + if (botMsgFunction) + (*botMsgFunction)((void *)&iValue, botMsgIndex); + } + + (*g_engfuncs.pfnWriteEntity)(iValue); +} +void pfnCVarRegister(cvar_t *pCvar) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCVarRegister:\n"); fclose(fp); } + (*g_engfuncs.pfnCVarRegister)(pCvar); +} +float pfnCVarGetFloat(const char *szVarName) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCVarGetFloat: %s\n",szVarName); fclose(fp); } + return (*g_engfuncs.pfnCVarGetFloat)(szVarName); +} +const char* pfnCVarGetString(const char *szVarName) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCVarGetString:\n"); fclose(fp); } + return (*g_engfuncs.pfnCVarGetString)(szVarName); +} +void pfnCVarSetFloat(const char *szVarName, float flValue) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCVarSetFloat:\n"); fclose(fp); } + (*g_engfuncs.pfnCVarSetFloat)(szVarName, flValue); +} +void pfnCVarSetString(const char *szVarName, const char *szValue) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCVarSetString:\n"); fclose(fp); } + (*g_engfuncs.pfnCVarSetString)(szVarName, szValue); +} +void* pfnPvAllocEntPrivateData(edict_t *pEdict, long cb) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPvAllocEntPrivateData:\n"); fclose(fp); } + return (*g_engfuncs.pfnPvAllocEntPrivateData)(pEdict, cb); +} +void* pfnPvEntPrivateData(edict_t *pEdict) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPvEntPrivateData:\n"); fclose(fp); } + return (*g_engfuncs.pfnPvEntPrivateData)(pEdict); +} +void pfnFreeEntPrivateData(edict_t *pEdict) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnFreeEntPrivateData:\n"); fclose(fp); } + (*g_engfuncs.pfnFreeEntPrivateData)(pEdict); +} +const char* pfnSzFromIndex(int iString) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSzFromIndex:\n"); fclose(fp); } + return (*g_engfuncs.pfnSzFromIndex)(iString); +} +int pfnAllocString(const char *szValue) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnAllocString:\n"); fclose(fp); } + return (*g_engfuncs.pfnAllocString)(szValue); +} +entvars_t* pfnGetVarsOfEnt(edict_t *pEdict) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetVarsOfEnt:\n"); fclose(fp); } + return (*g_engfuncs.pfnGetVarsOfEnt)(pEdict); +} +edict_t* pfnPEntityOfEntOffset(int iEntOffset) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPEntityOfEntOffset:\n"); fclose(fp); } + return (*g_engfuncs.pfnPEntityOfEntOffset)(iEntOffset); +} +int pfnEntOffsetOfPEntity(const edict_t *pEdict) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnEntOffsetOfPEntity: %x\n",pEdict); fclose(fp); } + return (*g_engfuncs.pfnEntOffsetOfPEntity)(pEdict); +} +int pfnIndexOfEdict(const edict_t *pEdict) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnIndexOfEdict: %x\n",pEdict); fclose(fp); } + return (*g_engfuncs.pfnIndexOfEdict)(pEdict); +} +edict_t* pfnPEntityOfEntIndex(int iEntIndex) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPEntityOfEntIndex:\n"); fclose(fp); } + return (*g_engfuncs.pfnPEntityOfEntIndex)(iEntIndex); +} +edict_t* pfnFindEntityByVars(entvars_t* pvars) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnFindEntityByVars:\n"); fclose(fp); } + return (*g_engfuncs.pfnFindEntityByVars)(pvars); +} +void* pfnGetModelPtr(edict_t* pEdict) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetModelPtr: %x\n",pEdict); fclose(fp); } + return (*g_engfuncs.pfnGetModelPtr)(pEdict); +} +int pfnRegUserMsg(const char *pszName, int iSize) +{ + int msg; + + msg = (*g_engfuncs.pfnRegUserMsg)(pszName, iSize); + + //if (gpGlobals->deathmatch) + //{ +#ifdef _DEBUG + fp=fopen("bot.txt","a"); fprintf(fp,"pfnRegUserMsg: pszName=%s msg=%d\n",pszName,msg); fclose(fp); +#endif + + if (mod_id == VALVE_DLL) + { + if (strcmp(pszName, "WeaponList") == 0) + message_WeaponList = msg; + else if (strcmp(pszName, "CurWeapon") == 0) + message_CurWeapon = msg; + else if (strcmp(pszName, "AmmoX") == 0) + message_AmmoX = msg; + else if (strcmp(pszName, "AmmoPickup") == 0) + message_AmmoPickup = msg; + else if (strcmp(pszName, "WeapPickup") == 0) + message_WeapPickup = msg; + else if (strcmp(pszName, "ItemPickup") == 0) + message_ItemPickup = msg; + else if (strcmp(pszName, "Health") == 0) + message_Health = msg; + else if (strcmp(pszName, "Battery") == 0) + message_Battery = msg; + else if (strcmp(pszName, "Damage") == 0) + message_Damage = msg; + else if (strcmp(pszName, "DeathMsg") == 0) + message_DeathMsg = msg; + else if (strcmp(pszName, "ScreenFade") == 0) + message_ScreenFade = msg; + } + else if (mod_id == TFC_DLL) + { + if (strcmp(pszName, "VGUIMenu") == 0) + message_VGUI = msg; + else if (strcmp(pszName, "WeaponList") == 0) + message_WeaponList = msg; + else if (strcmp(pszName, "CurWeapon") == 0) + message_CurWeapon = msg; + else if (strcmp(pszName, "AmmoX") == 0) + message_AmmoX = msg; + else if (strcmp(pszName, "AmmoPickup") == 0) + message_AmmoPickup = msg; + else if (strcmp(pszName, "WeapPickup") == 0) + message_WeapPickup = msg; + else if (strcmp(pszName, "ItemPickup") == 0) + message_ItemPickup = msg; + else if (strcmp(pszName, "Health") == 0) + message_Health = msg; + else if (strcmp(pszName, "Battery") == 0) + message_Battery = msg; + else if (strcmp(pszName, "Damage") == 0) + message_Damage = msg; + else if (strcmp(pszName, "DeathMsg") == 0) + message_DeathMsg = msg; + else if (strcmp(pszName, "ScreenFade") == 0) + message_ScreenFade = msg; + } + else if (mod_id == CSTRIKE_DLL) + { + if (strcmp(pszName, "VGUIMenu") == 0) + message_VGUI = msg; + else if (strcmp(pszName, "ShowMenu") == 0) + message_ShowMenu = msg; + else if (strcmp(pszName, "WeaponList") == 0) + message_WeaponList = msg; + else if (strcmp(pszName, "CurWeapon") == 0) + message_CurWeapon = msg; + else if (strcmp(pszName, "AmmoX") == 0) + message_AmmoX = msg; + else if (strcmp(pszName, "AmmoPickup") == 0) + message_AmmoPickup = msg; + else if (strcmp(pszName, "WeapPickup") == 0) + message_WeapPickup = msg; + else if (strcmp(pszName, "ItemPickup") == 0) + message_ItemPickup = msg; + else if (strcmp(pszName, "Health") == 0) + message_Health = msg; + else if (strcmp(pszName, "Battery") == 0) + message_Battery = msg; + else if (strcmp(pszName, "Damage") == 0) + message_Damage = msg; + else if (strcmp(pszName, "Money") == 0) + message_Money = msg; + else if (strcmp(pszName, "DeathMsg") == 0) + message_DeathMsg = msg; + else if (strcmp(pszName, "ScreenFade") == 0) + message_ScreenFade = msg; + } + else if (mod_id == GEARBOX_DLL) + { + if (strcmp(pszName, "VGUIMenu") == 0) + message_VGUI = msg; + else if (strcmp(pszName, "WeaponList") == 0) + message_WeaponList = msg; + else if (strcmp(pszName, "CurWeapon") == 0) + message_CurWeapon = msg; + else if (strcmp(pszName, "AmmoX") == 0) + message_AmmoX = msg; + else if (strcmp(pszName, "AmmoPickup") == 0) + message_AmmoPickup = msg; + else if (strcmp(pszName, "WeapPickup") == 0) + message_WeapPickup = msg; + else if (strcmp(pszName, "ItemPickup") == 0) + message_ItemPickup = msg; + else if (strcmp(pszName, "Health") == 0) + message_Health = msg; + else if (strcmp(pszName, "Battery") == 0) + message_Battery = msg; + else if (strcmp(pszName, "Damage") == 0) + message_Damage = msg; + else if (strcmp(pszName, "DeathMsg") == 0) + message_DeathMsg = msg; + else if (strcmp(pszName, "ScreenFade") == 0) + message_ScreenFade = msg; + } + else if (mod_id == FRONTLINE_DLL) + { + if (strcmp(pszName, "VGUIMenu") == 0) + message_VGUI = msg; + else if (strcmp(pszName, "WeaponList") == 0) + message_WeaponList = msg; + else if (strcmp(pszName, "CurWeapon") == 0) + message_CurWeapon = msg; + else if (strcmp(pszName, "AmmoX") == 0) + message_AmmoX = msg; + else if (strcmp(pszName, "AmmoPickup") == 0) + message_AmmoPickup = msg; + else if (strcmp(pszName, "WeapPickup") == 0) + message_WeapPickup = msg; + else if (strcmp(pszName, "ItemPickup") == 0) + message_ItemPickup = msg; + else if (strcmp(pszName, "Health") == 0) + message_Health = msg; + else if (strcmp(pszName, "Battery") == 0) + message_Battery = msg; + else if (strcmp(pszName, "Damage") == 0) + message_Damage = msg; + else if (strcmp(pszName, "DeathMsg") == 0) + message_DeathMsg = msg; + else if (strcmp(pszName, "TextMsg") == 0) + message_TextMsg = msg; + else if (strcmp(pszName, "WarmUp") == 0) + message_WarmUp = msg; + else if (strcmp(pszName, "WinMessage") == 0) + message_WinMessage = msg; + else if (strcmp(pszName, "ScreenFade") == 0) + message_ScreenFade = msg; + } + else if (mod_id == AVH_DLL) + { + if (strcmp(pszName, "SetPlayMode") == 0) + message_SetPlayMode = msg; + else if (strcmp(pszName, "AmmoX") == 0) + message_AmmoX = msg; + else if (strcmp(pszName, "AmmoPickup") == 0) + message_AmmoPickup = msg; + else if (strcmp(pszName, "WeapPickup") == 0) + message_WeapPickup = msg; + else if (strcmp(pszName, "ItemPickup") == 0) + message_ItemPickup = msg; + else if (strcmp(pszName, "WeaponList") == 0) + message_WeaponList = msg; + else if (strcmp(pszName, "SetOrder") == 0) + message_SetOrder = msg; + else if (strcmp(pszName, "SetRsrces") == 0) + message_SetResources = msg; + + } + //} + + return msg; +} +void pfnAnimationAutomove(const edict_t* pEdict, float flTime) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnAnimationAutomove:\n"); fclose(fp); } + (*g_engfuncs.pfnAnimationAutomove)(pEdict, flTime); +} +void pfnGetBonePosition(const edict_t* pEdict, int iBone, float *rgflOrigin, float *rgflAngles ) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetBonePosition:\n"); fclose(fp); } + (*g_engfuncs.pfnGetBonePosition)(pEdict, iBone, rgflOrigin, rgflAngles); +} +unsigned long pfnFunctionFromName( const char *pName ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnFunctionFromName:\n"); fclose(fp); } + return (*g_engfuncs.pfnFunctionFromName)(pName); +} +const char *pfnNameForFunction( unsigned long function ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnNameForFunction:\n"); fclose(fp); } + const char* theName = (*g_engfuncs.pfnNameForFunction)(function); + return theName; +} +void pfnClientPrintf( edict_t* pEdict, PRINT_TYPE ptype, const char *szMsg ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnClientPrintf:\n"); fclose(fp); } + (*g_engfuncs.pfnClientPrintf)(pEdict, ptype, szMsg); +} +void pfnServerPrint( const char *szMsg ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnServerPrint: %s\n",szMsg); fclose(fp); } + (*g_engfuncs.pfnServerPrint)(szMsg); +} +void pfnGetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetAttachment:\n"); fclose(fp); } + (*g_engfuncs.pfnGetAttachment)(pEdict, iAttachment, rgflOrigin, rgflAngles); +} +void pfnCRC32_Init(CRC32_t *pulCRC) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCRC32_Init:\n"); fclose(fp); } + (*g_engfuncs.pfnCRC32_Init)(pulCRC); +} +void pfnCRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCRC32_ProcessBuffer:\n"); fclose(fp); } + (*g_engfuncs.pfnCRC32_ProcessBuffer)(pulCRC, p, len); +} +void pfnCRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCRC32_ProcessByte:\n"); fclose(fp); } + (*g_engfuncs.pfnCRC32_ProcessByte)(pulCRC, ch); +} +CRC32_t pfnCRC32_Final(CRC32_t pulCRC) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCRC32_Final:\n"); fclose(fp); } + return (*g_engfuncs.pfnCRC32_Final)(pulCRC); +} +long pfnRandomLong(long lLow, long lHigh) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnRandomLong: lLow=%d lHigh=%d\n",lLow,lHigh); fclose(fp); } + return (*g_engfuncs.pfnRandomLong)(lLow, lHigh); +} +float pfnRandomFloat(float flLow, float flHigh) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnRandomFloat:\n"); fclose(fp); } + return (*g_engfuncs.pfnRandomFloat)(flLow, flHigh); +} +void pfnSetView(const edict_t *pClient, const edict_t *pViewent ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetView:\n"); fclose(fp); } + (*g_engfuncs.pfnSetView)(pClient, pViewent); +} +float pfnTime( void ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnTime:\n"); fclose(fp); } + return (*g_engfuncs.pfnTime)(); +} +void pfnCrosshairAngle(const edict_t *pClient, float pitch, float yaw) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCrosshairAngle:\n"); fclose(fp); } + (*g_engfuncs.pfnCrosshairAngle)(pClient, pitch, yaw); +} +byte *pfnLoadFileForMe(char *filename, int *pLength) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnLoadFileForMe: filename=%s\n",filename); fclose(fp); } + return (*g_engfuncs.pfnLoadFileForMe)(filename, pLength); +} +void pfnFreeFile(void *buffer) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnFreeFile:\n"); fclose(fp); } + (*g_engfuncs.pfnFreeFile)(buffer); +} +void pfnEndSection(const char *pszSectionName) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnEndSection:\n"); fclose(fp); } + (*g_engfuncs.pfnEndSection)(pszSectionName); +} +int pfnCompareFileTime(char *filename1, char *filename2, int *iCompare) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCompareFileTime:\n"); fclose(fp); } + return (*g_engfuncs.pfnCompareFileTime)(filename1, filename2, iCompare); +} +void pfnGetGameDir(char *szGetGameDir) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetGameDir:\n"); fclose(fp); } + (*g_engfuncs.pfnGetGameDir)(szGetGameDir); +} +void pfnCvar_RegisterVariable(cvar_t *variable) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCvar_RegisterVariable:\n"); fclose(fp); } + (*g_engfuncs.pfnCvar_RegisterVariable)(variable); +} +void pfnFadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnFadeClientVolume:\n"); fclose(fp); } + (*g_engfuncs.pfnFadeClientVolume)(pEdict, fadePercent, fadeOutSeconds, holdTime, fadeInSeconds); +} +void pfnSetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetClientMaxspeed: edict=%x %f\n",pEdict,fNewMaxspeed); fclose(fp); } + (*g_engfuncs.pfnSetClientMaxspeed)(pEdict, fNewMaxspeed); +} +edict_t * pfnCreateFakeClient(const char *netname) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCreateFakeClient:\n"); fclose(fp); } + return (*g_engfuncs.pfnCreateFakeClient)(netname); +} +void pfnRunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnRunPlayerMove:\n"); fclose(fp); } + (*g_engfuncs.pfnRunPlayerMove)(fakeclient, viewangles, forwardmove, sidemove, upmove, buttons, impulse, msec); +} +int pfnNumberOfEntities(void) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnNumberOfEntities:\n"); fclose(fp); } + return (*g_engfuncs.pfnNumberOfEntities)(); +} +char* pfnGetInfoKeyBuffer(edict_t *e) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetInfoKeyBuffer:\n"); fclose(fp); } + return (*g_engfuncs.pfnGetInfoKeyBuffer)(e); +} +char* pfnInfoKeyValue(char *infobuffer, char *key) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnInfoKeyValue: %s %s\n",infobuffer,key); fclose(fp); } + return (*g_engfuncs.pfnInfoKeyValue)(infobuffer, key); +} +void pfnSetKeyValue(char *infobuffer, char *key, char *value) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetKeyValue: %s %s\n",key,value); fclose(fp); } + (*g_engfuncs.pfnSetKeyValue)(infobuffer, key, value); +} +void pfnSetClientKeyValue(int clientIndex, char *infobuffer, char *key, char *value) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetClientKeyValue: %s %s\n",key,value); fclose(fp); } + (*g_engfuncs.pfnSetClientKeyValue)(clientIndex, infobuffer, key, value); +} +int pfnIsMapValid(char *filename) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnIsMapValid:\n"); fclose(fp); } + return (*g_engfuncs.pfnIsMapValid)(filename); +} +void pfnStaticDecal( const float *origin, int decalIndex, int entityIndex, int modelIndex ) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnStaticDecal:\n"); fclose(fp); } + (*g_engfuncs.pfnStaticDecal)(origin, decalIndex, entityIndex, modelIndex); +} +int pfnPrecacheGeneric(char* s) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPrecacheGeneric: %s\n",s); fclose(fp); } + return (*g_engfuncs.pfnPrecacheGeneric)(s); +} +int pfnGetPlayerUserId(edict_t *e ) +{ + if (gpGlobals->deathmatch) + { + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetPlayerUserId: %x\n",e); fclose(fp); } + + if (mod_id == GEARBOX_DLL) + { + // is this edict a bot? + if (UTIL_GetBotPointer( e )) + return 0; // don't return a valid index (so bot won't get kicked) + } + } + + return (*g_engfuncs.pfnGetPlayerUserId)(e); +} +void pfnBuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnBuildSoundMsg:\n"); fclose(fp); } + (*g_engfuncs.pfnBuildSoundMsg)(entity, channel, sample, volume, attenuation, fFlags, pitch, msg_dest, msg_type, pOrigin, ed); +} +int pfnIsDedicatedServer(void) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnIsDedicatedServer:\n"); fclose(fp); } + return (*g_engfuncs.pfnIsDedicatedServer)(); +} +cvar_t* pfnCVarGetPointer(const char *szVarName) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCVarGetPointer: %s\n",szVarName); fclose(fp); } + return (*g_engfuncs.pfnCVarGetPointer)(szVarName); +} +unsigned int pfnGetPlayerWONId(edict_t *e) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetPlayerWONId: %x\n",e); fclose(fp); } + return (*g_engfuncs.pfnGetPlayerWONId)(e); +} + + +// new stuff for SDK 2.0 + +void pfnInfo_RemoveKey(char *s, const char *key) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnInfo_RemoveKey:\n"); fclose(fp); } + (*g_engfuncs.pfnInfo_RemoveKey)(s, key); +} +const char *pfnGetPhysicsKeyValue(const edict_t *pClient, const char *key) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetPhysicsKeyValue:\n"); fclose(fp); } + return (*g_engfuncs.pfnGetPhysicsKeyValue)(pClient, key); +} +void pfnSetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetPhysicsKeyValue:\n"); fclose(fp); } + (*g_engfuncs.pfnSetPhysicsKeyValue)(pClient, key, value); +} +const char *pfnGetPhysicsInfoString(const edict_t *pClient) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetPhysicsInfoString:\n"); fclose(fp); } + return (*g_engfuncs.pfnGetPhysicsInfoString)(pClient); +} +unsigned short pfnPrecacheEvent(int type, const char *psz) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPrecacheEvent:\n"); fclose(fp); } + return (*g_engfuncs.pfnPrecacheEvent)(type, psz); +} +void pfnPlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, + float *origin, float *angles, float fparam1,float fparam2, int iparam1, int iparam2, int bparam1, int bparam2) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnPlaybackEvent:\n"); fclose(fp); } + (*g_engfuncs.pfnPlaybackEvent)(flags, pInvoker, eventindex, delay, origin, angles, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2); +} +unsigned char *pfnSetFatPVS(float *org) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetFatPVS:\n"); fclose(fp); } + return (*g_engfuncs.pfnSetFatPVS)(org); +} +unsigned char *pfnSetFatPAS(float *org) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetFatPAS:\n"); fclose(fp); } + return (*g_engfuncs.pfnSetFatPAS)(org); +} +int pfnCheckVisibility(const edict_t *entity, unsigned char *pset) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCheckVisibility:\n"); fclose(fp); } + return (*g_engfuncs.pfnCheckVisibility)(entity, pset); +} +void pfnDeltaSetField(struct delta_s *pFields, const char *fieldname) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnDeltaSetField:\n"); fclose(fp); } + (*g_engfuncs.pfnDeltaSetField)(pFields, fieldname); +} +void pfnDeltaUnsetField(struct delta_s *pFields, const char *fieldname) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnDeltaUnsetField:\n"); fclose(fp); } + (*g_engfuncs.pfnDeltaUnsetField)(pFields, fieldname); +} +void pfnDeltaAddEncoder(char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to)) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnDeltaAddEncoder:\n"); fclose(fp); } + (*g_engfuncs.pfnDeltaAddEncoder)(name, conditionalencode); +} +int pfnGetCurrentPlayer(void) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetCurrentPlayer:\n"); fclose(fp); } + return (*g_engfuncs.pfnGetCurrentPlayer)(); +} +int pfnCanSkipPlayer(const edict_t *player) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCanSkipPlayer:\n"); fclose(fp); } + return (*g_engfuncs.pfnCanSkipPlayer)(player); +} +int pfnDeltaFindField(struct delta_s *pFields, const char *fieldname) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnDeltaFindField:\n"); fclose(fp); } + return (*g_engfuncs.pfnDeltaFindField)(pFields, fieldname); +} +void pfnDeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnDeltaSetFieldByIndex:\n"); fclose(fp); } + (*g_engfuncs.pfnDeltaSetFieldByIndex)(pFields, fieldNumber); +} +void pfnDeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber) +{ +// if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnDeltaUnsetFieldByIndex:\n"); fclose(fp); } + (*g_engfuncs.pfnDeltaUnsetFieldByIndex)(pFields, fieldNumber); +} +void pfnSetGroupMask(int mask, int op) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnSetGroupMask:\n"); fclose(fp); } + (*g_engfuncs.pfnSetGroupMask)(mask, op); +} +int pfnCreateInstancedBaseline(int classname, struct entity_state_s *baseline) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCreateInstancedBaseline:\n"); fclose(fp); } + return (*g_engfuncs.pfnCreateInstancedBaseline)(classname, baseline); +} +void pfnCvar_DirectSet(struct cvar_s *var, char *value) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnCvar_DirectSet:\n"); fclose(fp); } + (*g_engfuncs.pfnCvar_DirectSet)(var, value); +} +void pfnForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnForceUnmodified:\n"); fclose(fp); } + (*g_engfuncs.pfnForceUnmodified)(type, mins, maxs, filename); +} +void pfnGetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss) +{ + if (debug_engine) { fp=fopen("bot.txt","a"); fprintf(fp,"pfnGetPlayerStats:\n"); fclose(fp); } + (*g_engfuncs.pfnGetPlayerStats)(pClient, ping, packet_loss); +} + diff --git a/main/source/HPB_bot/dlls/h_export.cpp b/main/source/HPB_bot/dlls/h_export.cpp new file mode 100644 index 00000000..cf3d458c --- /dev/null +++ b/main/source/HPB_bot/dlls/h_export.cpp @@ -0,0 +1,290 @@ +// +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// h_export.cpp +// + +#include "extdll.h" +#include "enginecallback.h" +#include "util.h" +#include "cbase.h" +#include "mod/AvHConstants.h" + +#include "bot.h" +#include "HPB_bot/engine/engine.h" +#include "types.h" + +#ifndef __linux__ + +HINSTANCE h_Library = NULL; +HGLOBAL h_global_argv = NULL; + +#else + +void *h_Library = NULL; +char h_global_argv[1024]; + +#endif + +enginefuncs_t g_engfuncs; +globalvars_t *gpGlobals; +char *g_argv; + +static FILE *fp; + + +GETENTITYAPI other_GetEntityAPI = NULL; +GETNEWDLLFUNCTIONS other_GetNewDLLFunctions = NULL; +GIVEFNPTRSTODLL other_GiveFnptrsToDll = NULL; + +extern int mod_id; + + +#ifndef __linux__ + +// Required DLL entry point +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + if (fdwReason == DLL_PROCESS_ATTACH) + { + } + else if (fdwReason == DLL_PROCESS_DETACH) + { + if (h_Library) + FreeLibrary(h_Library); + + if (h_global_argv) + { + GlobalUnlock(h_global_argv); + GlobalFree(h_global_argv); + } + } + + return TRUE; +} + +#endif + +#ifndef __linux__ +#ifdef __BORLANDC__ +extern "C" DLLEXPORT void EXPORT GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals) +#else +void DLLEXPORT GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) +#endif +#else +extern "C" DLLEXPORT GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) +#endif +{ + int pos; + char game_dir[256]; + char mod_name[32]; + +//#ifdef AVH_MAPPER_BUILD +//strcpy(mod_name, kModDirectory); +//#endif + + // get the engine functions from the engine... + + memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); + gpGlobals = pGlobals; + + // find the directory name of the currently running MOD... + (*g_engfuncs.pfnGetGameDir)(game_dir); + + pos = strlen(game_dir) - 1; + + // scan backwards till first directory separator... + while ((pos) && (game_dir[pos] != '/')) + pos--; + + if (pos == 0) + { + // Error getting directory name! + + ALERT( at_error, "HPB_bot - Error determining MOD directory name!" ); + } + + pos++; + strcpy(mod_name, &game_dir[pos]); + + mod_id = AVH_DLL; + + +#ifdef WIN32 + string theTempName = string(getModDirectory()) + "\\dlls\\ns.dll"; + h_Library = LoadLibrary(theTempName.c_str()); +// TODO: Add this in when supporting linux again +#else + printf("DLopening ns/dlls/HPB_bot_i386.so..."); + h_Library = dlopen("ns/dlls/HPB_bot_i386.so", RTLD_NOW); +#endif + + + if (h_Library == NULL) + { + // Directory error or Unsupported MOD! + + ALERT( at_error, "HPB_bot - MOD dll not found (or unsupported MOD)!" ); + } + + +#ifndef __linux__ + h_global_argv = GlobalAlloc(GMEM_SHARE, 1024); + g_argv = (char *)GlobalLock(h_global_argv); +#else + g_argv = (char *)h_global_argv; +#endif + + other_GetEntityAPI = (GETENTITYAPI)GetProcAddress(h_Library, "GetEntityAPI"); + + if (other_GetEntityAPI == NULL) + { + // Can't find GetEntityAPI! + + ALERT( at_error, "HPB_bot - Can't get MOD's GetEntityAPI!" ); + } + + other_GetNewDLLFunctions = (GETNEWDLLFUNCTIONS)GetProcAddress(h_Library, "GetNewDLLFunctions"); + +// if (other_GetNewDLLFunctions == NULL) +// { +// // Can't find GetNewDLLFunctions! +// +// ALERT( at_error, "HPB_bot - Can't get MOD's GetNewDLLFunctions!" ); +// } + + other_GiveFnptrsToDll = (GIVEFNPTRSTODLL)GetProcAddress(h_Library, "GiveFnptrsToDll"); + + if (other_GiveFnptrsToDll == NULL) + { + // Can't find GiveFnptrsToDll! + + ALERT( at_error, "HPB_bot - Can't get MOD's GiveFnptrsToDll!" ); + } + + pengfuncsFromEngine->pfnCmd_Args = Cmd_Args; + pengfuncsFromEngine->pfnCmd_Argv = Cmd_Argv; + pengfuncsFromEngine->pfnCmd_Argc = Cmd_Argc; + + pengfuncsFromEngine->pfnPrecacheModel = pfnPrecacheModel; + pengfuncsFromEngine->pfnPrecacheSound = pfnPrecacheSound; + pengfuncsFromEngine->pfnSetModel = pfnSetModel; + pengfuncsFromEngine->pfnModelIndex = pfnModelIndex; + pengfuncsFromEngine->pfnModelFrames = pfnModelFrames; + pengfuncsFromEngine->pfnSetSize = pfnSetSize; + pengfuncsFromEngine->pfnChangeLevel = pfnChangeLevel; + pengfuncsFromEngine->pfnGetSpawnParms = pfnGetSpawnParms; + pengfuncsFromEngine->pfnSaveSpawnParms = pfnSaveSpawnParms; + pengfuncsFromEngine->pfnVecToYaw = pfnVecToYaw; + pengfuncsFromEngine->pfnVecToAngles = pfnVecToAngles; + pengfuncsFromEngine->pfnMoveToOrigin = pfnMoveToOrigin; + pengfuncsFromEngine->pfnChangeYaw = pfnChangeYaw; + pengfuncsFromEngine->pfnChangePitch = pfnChangePitch; + pengfuncsFromEngine->pfnFindEntityByString = pfnFindEntityByString; + pengfuncsFromEngine->pfnGetEntityIllum = pfnGetEntityIllum; + pengfuncsFromEngine->pfnFindEntityInSphere = pfnFindEntityInSphere; + pengfuncsFromEngine->pfnFindClientInPVS = pfnFindClientInPVS; + pengfuncsFromEngine->pfnEntitiesInPVS = pfnEntitiesInPVS; + pengfuncsFromEngine->pfnMakeVectors = pfnMakeVectors; + pengfuncsFromEngine->pfnAngleVectors = pfnAngleVectors; + pengfuncsFromEngine->pfnCreateEntity = pfnCreateEntity; + pengfuncsFromEngine->pfnRemoveEntity = pfnRemoveEntity; + pengfuncsFromEngine->pfnCreateNamedEntity = pfnCreateNamedEntity; + pengfuncsFromEngine->pfnMakeStatic = pfnMakeStatic; + pengfuncsFromEngine->pfnEntIsOnFloor = pfnEntIsOnFloor; + pengfuncsFromEngine->pfnDropToFloor = pfnDropToFloor; + pengfuncsFromEngine->pfnWalkMove = pfnWalkMove; + pengfuncsFromEngine->pfnSetOrigin = pfnSetOrigin; + pengfuncsFromEngine->pfnEmitSound = pfnEmitSound; + pengfuncsFromEngine->pfnEmitAmbientSound = pfnEmitAmbientSound; + pengfuncsFromEngine->pfnTraceLine = pfnTraceLine; + pengfuncsFromEngine->pfnTraceToss = pfnTraceToss; + pengfuncsFromEngine->pfnTraceMonsterHull = pfnTraceMonsterHull; + pengfuncsFromEngine->pfnTraceHull = pfnTraceHull; + pengfuncsFromEngine->pfnTraceModel = pfnTraceModel; + pengfuncsFromEngine->pfnTraceTexture = pfnTraceTexture; + pengfuncsFromEngine->pfnTraceSphere = pfnTraceSphere; + pengfuncsFromEngine->pfnGetAimVector = pfnGetAimVector; + pengfuncsFromEngine->pfnServerCommand = pfnServerCommand; + pengfuncsFromEngine->pfnServerExecute = pfnServerExecute; + + pengfuncsFromEngine->pfnClientCommand = pfnClientCommand; + + pengfuncsFromEngine->pfnParticleEffect = pfnParticleEffect; + pengfuncsFromEngine->pfnLightStyle = pfnLightStyle; + pengfuncsFromEngine->pfnDecalIndex = pfnDecalIndex; + pengfuncsFromEngine->pfnPointContents = pfnPointContents; + pengfuncsFromEngine->pfnMessageBegin = pfnMessageBegin; + pengfuncsFromEngine->pfnMessageEnd = pfnMessageEnd; + pengfuncsFromEngine->pfnWriteByte = pfnWriteByte; + pengfuncsFromEngine->pfnWriteChar = pfnWriteChar; + pengfuncsFromEngine->pfnWriteShort = pfnWriteShort; + pengfuncsFromEngine->pfnWriteLong = pfnWriteLong; + pengfuncsFromEngine->pfnWriteAngle = pfnWriteAngle; + pengfuncsFromEngine->pfnWriteCoord = pfnWriteCoord; + pengfuncsFromEngine->pfnWriteString = pfnWriteString; + pengfuncsFromEngine->pfnWriteEntity = pfnWriteEntity; + pengfuncsFromEngine->pfnCVarRegister = pfnCVarRegister; + pengfuncsFromEngine->pfnCVarGetFloat = pfnCVarGetFloat; + pengfuncsFromEngine->pfnCVarGetString = pfnCVarGetString; + pengfuncsFromEngine->pfnCVarSetFloat = pfnCVarSetFloat; + pengfuncsFromEngine->pfnCVarSetString = pfnCVarSetString; + pengfuncsFromEngine->pfnPvAllocEntPrivateData = pfnPvAllocEntPrivateData; + pengfuncsFromEngine->pfnPvEntPrivateData = pfnPvEntPrivateData; + pengfuncsFromEngine->pfnFreeEntPrivateData = pfnFreeEntPrivateData; + pengfuncsFromEngine->pfnSzFromIndex = pfnSzFromIndex; + pengfuncsFromEngine->pfnAllocString = pfnAllocString; + pengfuncsFromEngine->pfnGetVarsOfEnt = pfnGetVarsOfEnt; + pengfuncsFromEngine->pfnPEntityOfEntOffset = pfnPEntityOfEntOffset; + pengfuncsFromEngine->pfnEntOffsetOfPEntity = pfnEntOffsetOfPEntity; + pengfuncsFromEngine->pfnIndexOfEdict = pfnIndexOfEdict; + pengfuncsFromEngine->pfnPEntityOfEntIndex = pfnPEntityOfEntIndex; + pengfuncsFromEngine->pfnFindEntityByVars = pfnFindEntityByVars; + pengfuncsFromEngine->pfnGetModelPtr = pfnGetModelPtr; + pengfuncsFromEngine->pfnRegUserMsg = pfnRegUserMsg; + pengfuncsFromEngine->pfnAnimationAutomove = pfnAnimationAutomove; + pengfuncsFromEngine->pfnGetBonePosition = pfnGetBonePosition; + pengfuncsFromEngine->pfnFunctionFromName = pfnFunctionFromName; + pengfuncsFromEngine->pfnNameForFunction = pfnNameForFunction; + pengfuncsFromEngine->pfnClientPrintf = pfnClientPrintf; + pengfuncsFromEngine->pfnServerPrint = pfnServerPrint; + pengfuncsFromEngine->pfnGetAttachment = pfnGetAttachment; + pengfuncsFromEngine->pfnCRC32_Init = pfnCRC32_Init; + pengfuncsFromEngine->pfnCRC32_ProcessBuffer = pfnCRC32_ProcessBuffer; + pengfuncsFromEngine->pfnCRC32_ProcessByte = pfnCRC32_ProcessByte; + pengfuncsFromEngine->pfnCRC32_Final = pfnCRC32_Final; + pengfuncsFromEngine->pfnRandomLong = pfnRandomLong; + pengfuncsFromEngine->pfnRandomFloat = pfnRandomFloat; + pengfuncsFromEngine->pfnSetView = pfnSetView; + pengfuncsFromEngine->pfnTime = pfnTime; + pengfuncsFromEngine->pfnCrosshairAngle = pfnCrosshairAngle; + pengfuncsFromEngine->pfnLoadFileForMe = pfnLoadFileForMe; + pengfuncsFromEngine->pfnFreeFile = pfnFreeFile; + pengfuncsFromEngine->pfnEndSection = pfnEndSection; + pengfuncsFromEngine->pfnCompareFileTime = pfnCompareFileTime; + pengfuncsFromEngine->pfnGetGameDir = pfnGetGameDir; + pengfuncsFromEngine->pfnCvar_RegisterVariable = pfnCvar_RegisterVariable; + pengfuncsFromEngine->pfnFadeClientVolume = pfnFadeClientVolume; + pengfuncsFromEngine->pfnSetClientMaxspeed = pfnSetClientMaxspeed; + pengfuncsFromEngine->pfnCreateFakeClient = pfnCreateFakeClient; + pengfuncsFromEngine->pfnRunPlayerMove = pfnRunPlayerMove; + pengfuncsFromEngine->pfnNumberOfEntities = pfnNumberOfEntities; + pengfuncsFromEngine->pfnGetInfoKeyBuffer = pfnGetInfoKeyBuffer; + pengfuncsFromEngine->pfnInfoKeyValue = pfnInfoKeyValue; + pengfuncsFromEngine->pfnSetKeyValue = pfnSetKeyValue; + pengfuncsFromEngine->pfnSetClientKeyValue = pfnSetClientKeyValue; + pengfuncsFromEngine->pfnIsMapValid = pfnIsMapValid; + pengfuncsFromEngine->pfnStaticDecal = pfnStaticDecal; + pengfuncsFromEngine->pfnPrecacheGeneric = pfnPrecacheGeneric; + pengfuncsFromEngine->pfnGetPlayerUserId = pfnGetPlayerUserId; + pengfuncsFromEngine->pfnBuildSoundMsg = pfnBuildSoundMsg; + pengfuncsFromEngine->pfnIsDedicatedServer = pfnIsDedicatedServer; + pengfuncsFromEngine->pfnCVarGetPointer = pfnCVarGetPointer; + pengfuncsFromEngine->pfnGetPlayerWONId = pfnGetPlayerWONId; + + // give the engine functions to the other DLL... + (*other_GiveFnptrsToDll)(pengfuncsFromEngine, pGlobals); +} + diff --git a/main/source/HPB_bot/dlls/linkfunc.cpp b/main/source/HPB_bot/dlls/linkfunc.cpp new file mode 100644 index 00000000..60d084e9 --- /dev/null +++ b/main/source/HPB_bot/dlls/linkfunc.cpp @@ -0,0 +1,689 @@ +// +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// linkfunc.cpp +// + +#include "extdll.h" +#include "util.h" +#include "cbase.h" + +#include "bot.h" + +// For some reason, including these and using them doesn't work. Has something to do with +// the preprocessor but I don't get it... +//#include "mod/AvHConstants.h" +//#include "mod/AvHMarineEquipmentConstants.h" + +#ifdef __BORLANDC__ +extern HINSTANCE _h_Library; +#elif _WIN32 +extern HINSTANCE h_Library; +#else +extern void *h_Library; +#endif + +#ifdef __BORLANDC__ + +#define LINK_ENTITY_TO_FUNC(mapClassName) \ + extern "C" EXPORT void mapClassName( entvars_t *pev ); \ + void mapClassName( entvars_t *pev ) { \ + static LINK_ENTITY_FUNC otherClassName = NULL; \ + static int skip_this = 0; \ + if (skip_this) return; \ + if (otherClassName == NULL) \ + otherClassName = (LINK_ENTITY_FUNC)GetProcAddress(_h_Library, #mapClassName); \ + if (otherClassName == NULL) { \ + skip_this = 1; return; \ + } \ + (*otherClassName)(pev); } + +#else + +#define LINK_ENTITY_TO_FUNC(mapClassName) \ + extern "C" EXPORT void mapClassName( entvars_t *pev ); \ + void mapClassName( entvars_t *pev ) { \ + static LINK_ENTITY_FUNC otherClassName = NULL; \ + static int skip_this = 0; \ + if (skip_this) return; \ + if (otherClassName == NULL) \ + otherClassName = (LINK_ENTITY_FUNC)GetProcAddress(h_Library, #mapClassName); \ + if (otherClassName == NULL) { \ + skip_this = 1; return; \ + } \ + (*otherClassName)(pev); } + +#endif + +// new stuff for 1.1.0.4 release +//LINK_ENTITY_TO_FUNC(CreateInterface); + +// entities for Valve's hl.dll and Standard SDK... +LINK_ENTITY_TO_FUNC(aiscripted_sequence); +LINK_ENTITY_TO_FUNC(ambient_generic); +LINK_ENTITY_TO_FUNC(ammo_357); +LINK_ENTITY_TO_FUNC(ammo_9mmAR); +LINK_ENTITY_TO_FUNC(ammo_9mmbox); +LINK_ENTITY_TO_FUNC(ammo_9mmclip); +LINK_ENTITY_TO_FUNC(ammo_ARgrenades); +LINK_ENTITY_TO_FUNC(ammo_buckshot); +LINK_ENTITY_TO_FUNC(ammo_crossbow); +LINK_ENTITY_TO_FUNC(ammo_egonclip); +LINK_ENTITY_TO_FUNC(ammo_gaussclip); +LINK_ENTITY_TO_FUNC(ammo_glockclip); +LINK_ENTITY_TO_FUNC(ammo_mp5clip); +LINK_ENTITY_TO_FUNC(ammo_mp5grenades); +LINK_ENTITY_TO_FUNC(ammo_rpgclip); +LINK_ENTITY_TO_FUNC(beam); +LINK_ENTITY_TO_FUNC(bmortar); +LINK_ENTITY_TO_FUNC(bodyque); +LINK_ENTITY_TO_FUNC(button_target); +LINK_ENTITY_TO_FUNC(cine_blood); +LINK_ENTITY_TO_FUNC(controller_energy_ball); +LINK_ENTITY_TO_FUNC(controller_head_ball); +LINK_ENTITY_TO_FUNC(crossbow_bolt); +LINK_ENTITY_TO_FUNC(cycler); +LINK_ENTITY_TO_FUNC(cycler_prdroid); +LINK_ENTITY_TO_FUNC(cycler_sprite); +LINK_ENTITY_TO_FUNC(cycler_weapon); +LINK_ENTITY_TO_FUNC(cycler_wreckage); +LINK_ENTITY_TO_FUNC(DelayedUse); +LINK_ENTITY_TO_FUNC(env_beam); +LINK_ENTITY_TO_FUNC(env_beverage); +LINK_ENTITY_TO_FUNC(env_blood); +LINK_ENTITY_TO_FUNC(env_bubbles); +LINK_ENTITY_TO_FUNC(env_debris); +LINK_ENTITY_TO_FUNC(env_explosion); +LINK_ENTITY_TO_FUNC(env_fade); +LINK_ENTITY_TO_FUNC(env_funnel); +LINK_ENTITY_TO_FUNC(env_global); +LINK_ENTITY_TO_FUNC(env_glow); +LINK_ENTITY_TO_FUNC(env_laser); +LINK_ENTITY_TO_FUNC(env_lightning); +LINK_ENTITY_TO_FUNC(env_message); +LINK_ENTITY_TO_FUNC(env_render); +LINK_ENTITY_TO_FUNC(env_shake); +LINK_ENTITY_TO_FUNC(env_shooter); +LINK_ENTITY_TO_FUNC(env_smoker); +LINK_ENTITY_TO_FUNC(env_sound); +LINK_ENTITY_TO_FUNC(env_spark); +LINK_ENTITY_TO_FUNC(env_sprite); +LINK_ENTITY_TO_FUNC(fireanddie); +LINK_ENTITY_TO_FUNC(func_breakable); +LINK_ENTITY_TO_FUNC(func_button); +LINK_ENTITY_TO_FUNC(func_conveyor); +LINK_ENTITY_TO_FUNC(func_door); +LINK_ENTITY_TO_FUNC(func_door_rotating); +LINK_ENTITY_TO_FUNC(func_friction); +LINK_ENTITY_TO_FUNC(func_guntarget); +LINK_ENTITY_TO_FUNC(func_healthcharger); +LINK_ENTITY_TO_FUNC(func_illusionary); +LINK_ENTITY_TO_FUNC(func_ladder); +LINK_ENTITY_TO_FUNC(func_monsterclip); +LINK_ENTITY_TO_FUNC(func_mortar_field); +LINK_ENTITY_TO_FUNC(func_pendulum); +LINK_ENTITY_TO_FUNC(func_plat); +LINK_ENTITY_TO_FUNC(func_platrot); +LINK_ENTITY_TO_FUNC(func_pushable); +LINK_ENTITY_TO_FUNC(func_recharge); +LINK_ENTITY_TO_FUNC(func_rot_button); +LINK_ENTITY_TO_FUNC(func_rotating); +LINK_ENTITY_TO_FUNC(func_tank); +LINK_ENTITY_TO_FUNC(func_tankcontrols); +LINK_ENTITY_TO_FUNC(func_tanklaser); +LINK_ENTITY_TO_FUNC(func_tankmortar); +LINK_ENTITY_TO_FUNC(func_tankrocket); +LINK_ENTITY_TO_FUNC(func_trackautochange); +LINK_ENTITY_TO_FUNC(func_trackchange); +LINK_ENTITY_TO_FUNC(func_tracktrain); +LINK_ENTITY_TO_FUNC(func_train); +LINK_ENTITY_TO_FUNC(func_traincontrols); +LINK_ENTITY_TO_FUNC(func_wall); +LINK_ENTITY_TO_FUNC(func_wall_toggle); +LINK_ENTITY_TO_FUNC(func_water); +LINK_ENTITY_TO_FUNC(game_counter); +LINK_ENTITY_TO_FUNC(game_counter_set); +LINK_ENTITY_TO_FUNC(game_end); +LINK_ENTITY_TO_FUNC(game_player_equip); +LINK_ENTITY_TO_FUNC(game_player_hurt); +LINK_ENTITY_TO_FUNC(game_player_team); +LINK_ENTITY_TO_FUNC(game_score); +LINK_ENTITY_TO_FUNC(game_team_master); +LINK_ENTITY_TO_FUNC(game_team_set); +LINK_ENTITY_TO_FUNC(game_text); +LINK_ENTITY_TO_FUNC(game_zone_player); +LINK_ENTITY_TO_FUNC(garg_stomp); +LINK_ENTITY_TO_FUNC(gibshooter); +LINK_ENTITY_TO_FUNC(grenade); +LINK_ENTITY_TO_FUNC(hornet); +LINK_ENTITY_TO_FUNC(hvr_rocket); +LINK_ENTITY_TO_FUNC(info_bigmomma); +LINK_ENTITY_TO_FUNC(info_intermission); +LINK_ENTITY_TO_FUNC(info_landmark); +LINK_ENTITY_TO_FUNC(info_node); +LINK_ENTITY_TO_FUNC(info_node_air); +LINK_ENTITY_TO_FUNC(info_null); +LINK_ENTITY_TO_FUNC(info_player_deathmatch); +LINK_ENTITY_TO_FUNC(info_player_start); +LINK_ENTITY_TO_FUNC(info_target); +LINK_ENTITY_TO_FUNC(info_teleport_destination); +LINK_ENTITY_TO_FUNC(infodecal); +LINK_ENTITY_TO_FUNC(item_airtank); +LINK_ENTITY_TO_FUNC(item_antidote); +LINK_ENTITY_TO_FUNC(item_battery); +LINK_ENTITY_TO_FUNC(item_healthkit); +LINK_ENTITY_TO_FUNC(item_longjump); +LINK_ENTITY_TO_FUNC(item_security); +LINK_ENTITY_TO_FUNC(item_sodacan); +LINK_ENTITY_TO_FUNC(item_suit); +LINK_ENTITY_TO_FUNC(laser_spot); +LINK_ENTITY_TO_FUNC(light); +LINK_ENTITY_TO_FUNC(light_environment); +LINK_ENTITY_TO_FUNC(light_spot); +LINK_ENTITY_TO_FUNC(momentary_door); +LINK_ENTITY_TO_FUNC(momentary_rot_button); +LINK_ENTITY_TO_FUNC(monstermaker); +LINK_ENTITY_TO_FUNC(monster_alien_controller); +LINK_ENTITY_TO_FUNC(monster_alien_grunt); +LINK_ENTITY_TO_FUNC(monster_alien_slave); +LINK_ENTITY_TO_FUNC(monster_apache); +LINK_ENTITY_TO_FUNC(monster_babycrab); +LINK_ENTITY_TO_FUNC(monster_barnacle); +LINK_ENTITY_TO_FUNC(monster_barney); +LINK_ENTITY_TO_FUNC(monster_barney_dead); +LINK_ENTITY_TO_FUNC(monster_bigmomma); +LINK_ENTITY_TO_FUNC(monster_bloater); +LINK_ENTITY_TO_FUNC(monster_bullchicken); +LINK_ENTITY_TO_FUNC(monster_cine2_hvyweapons); +LINK_ENTITY_TO_FUNC(monster_cine2_scientist); +LINK_ENTITY_TO_FUNC(monster_cine2_slave); +LINK_ENTITY_TO_FUNC(monster_cine3_barney); +LINK_ENTITY_TO_FUNC(monster_cine3_scientist); +LINK_ENTITY_TO_FUNC(monster_cine_barney); +LINK_ENTITY_TO_FUNC(monster_cine_panther); +LINK_ENTITY_TO_FUNC(monster_cine_scientist); +LINK_ENTITY_TO_FUNC(monster_cockroach); +LINK_ENTITY_TO_FUNC(monster_flyer); +LINK_ENTITY_TO_FUNC(monster_flyer_flock); +LINK_ENTITY_TO_FUNC(monster_furniture); +LINK_ENTITY_TO_FUNC(monster_gargantua); +LINK_ENTITY_TO_FUNC(monster_generic); +LINK_ENTITY_TO_FUNC(monster_gman); +LINK_ENTITY_TO_FUNC(monster_grunt_repel); +LINK_ENTITY_TO_FUNC(monster_headcrab); +LINK_ENTITY_TO_FUNC(monster_hevsuit_dead); +LINK_ENTITY_TO_FUNC(monster_hgrunt_dead); +LINK_ENTITY_TO_FUNC(monster_houndeye); +LINK_ENTITY_TO_FUNC(monster_human_assassin); +LINK_ENTITY_TO_FUNC(monster_human_grunt); +LINK_ENTITY_TO_FUNC(monster_ichthyosaur); +LINK_ENTITY_TO_FUNC(monster_leech); +LINK_ENTITY_TO_FUNC(monster_miniturret); +LINK_ENTITY_TO_FUNC(monster_mortar); +LINK_ENTITY_TO_FUNC(monster_nihilanth); +LINK_ENTITY_TO_FUNC(monster_osprey); +LINK_ENTITY_TO_FUNC(monster_rat); +LINK_ENTITY_TO_FUNC(monster_satchel); +LINK_ENTITY_TO_FUNC(monster_scientist); +LINK_ENTITY_TO_FUNC(monster_scientist_dead); +LINK_ENTITY_TO_FUNC(monster_sentry); +LINK_ENTITY_TO_FUNC(monster_sitting_scientist); +LINK_ENTITY_TO_FUNC(monster_snark); +LINK_ENTITY_TO_FUNC(monster_tentacle); +LINK_ENTITY_TO_FUNC(monster_tentaclemaw); +LINK_ENTITY_TO_FUNC(monster_tripmine); +LINK_ENTITY_TO_FUNC(monster_turret); +LINK_ENTITY_TO_FUNC(monster_vortigaunt); +LINK_ENTITY_TO_FUNC(monster_zombie); +LINK_ENTITY_TO_FUNC(multi_manager); +LINK_ENTITY_TO_FUNC(multisource); +LINK_ENTITY_TO_FUNC(nihilanth_energy_ball); +LINK_ENTITY_TO_FUNC(node_viewer); +LINK_ENTITY_TO_FUNC(node_viewer_fly); +LINK_ENTITY_TO_FUNC(node_viewer_human); +LINK_ENTITY_TO_FUNC(node_viewer_large); +LINK_ENTITY_TO_FUNC(path_corner); +LINK_ENTITY_TO_FUNC(path_track); +LINK_ENTITY_TO_FUNC(player); +LINK_ENTITY_TO_FUNC(player_loadsaved); +LINK_ENTITY_TO_FUNC(player_weaponstrip); +LINK_ENTITY_TO_FUNC(rpg_rocket); +LINK_ENTITY_TO_FUNC(scripted_sentence); +LINK_ENTITY_TO_FUNC(scripted_sequence); +LINK_ENTITY_TO_FUNC(soundent); +LINK_ENTITY_TO_FUNC(spark_shower); +LINK_ENTITY_TO_FUNC(speaker); +LINK_ENTITY_TO_FUNC(squidspit); +LINK_ENTITY_TO_FUNC(streak_spiral); +LINK_ENTITY_TO_FUNC(target_cdaudio); +LINK_ENTITY_TO_FUNC(test_effect); +LINK_ENTITY_TO_FUNC(testhull); +LINK_ENTITY_TO_FUNC(trigger); +LINK_ENTITY_TO_FUNC(trigger_auto); +LINK_ENTITY_TO_FUNC(trigger_autosave); +LINK_ENTITY_TO_FUNC(trigger_camera); +LINK_ENTITY_TO_FUNC(trigger_cdaudio); +LINK_ENTITY_TO_FUNC(trigger_changelevel); +LINK_ENTITY_TO_FUNC(trigger_changetarget); +LINK_ENTITY_TO_FUNC(trigger_counter); +LINK_ENTITY_TO_FUNC(trigger_endsection); +LINK_ENTITY_TO_FUNC(trigger_gravity); +LINK_ENTITY_TO_FUNC(trigger_hurt); +LINK_ENTITY_TO_FUNC(trigger_monsterjump); +LINK_ENTITY_TO_FUNC(trigger_multiple); +LINK_ENTITY_TO_FUNC(trigger_once); +LINK_ENTITY_TO_FUNC(trigger_push); +LINK_ENTITY_TO_FUNC(trigger_relay); +LINK_ENTITY_TO_FUNC(trigger_teleport); +LINK_ENTITY_TO_FUNC(trigger_transition); +LINK_ENTITY_TO_FUNC(weapon_357); +LINK_ENTITY_TO_FUNC(weapon_9mmAR); +LINK_ENTITY_TO_FUNC(weapon_9mmhandgun); +LINK_ENTITY_TO_FUNC(weapon_crossbow); +LINK_ENTITY_TO_FUNC(weapon_crowbar); +LINK_ENTITY_TO_FUNC(weapon_egon); +LINK_ENTITY_TO_FUNC(weapon_gauss); +LINK_ENTITY_TO_FUNC(weapon_glock); +LINK_ENTITY_TO_FUNC(weapon_handgrenade); +LINK_ENTITY_TO_FUNC(weapon_hornetgun); +LINK_ENTITY_TO_FUNC(weapon_mp5); +LINK_ENTITY_TO_FUNC(weapon_python); +LINK_ENTITY_TO_FUNC(weapon_rpg); +LINK_ENTITY_TO_FUNC(weapon_satchel); +//LINK_ENTITY_TO_FUNC(weapon_shotgun); +LINK_ENTITY_TO_FUNC(weapon_snark); +LINK_ENTITY_TO_FUNC(weapon_tripmine); +LINK_ENTITY_TO_FUNC(weaponbox); +LINK_ENTITY_TO_FUNC(world_items); +LINK_ENTITY_TO_FUNC(worldspawn); +LINK_ENTITY_TO_FUNC(xen_hair); +LINK_ENTITY_TO_FUNC(xen_hull); +LINK_ENTITY_TO_FUNC(xen_plantlight); +LINK_ENTITY_TO_FUNC(xen_spore_large); +LINK_ENTITY_TO_FUNC(xen_spore_medium); +LINK_ENTITY_TO_FUNC(xen_spore_small); +LINK_ENTITY_TO_FUNC(xen_tree); +LINK_ENTITY_TO_FUNC(xen_ttrigger); + +//// entities for Team Fortress 1.5 +//LINK_ENTITY_TO_FUNC(building_dispenser); +//LINK_ENTITY_TO_FUNC(building_sentrygun); +//LINK_ENTITY_TO_FUNC(building_sentrygun_base); +//LINK_ENTITY_TO_FUNC(detpack); +//LINK_ENTITY_TO_FUNC(dispenser_refill_timer); +//LINK_ENTITY_TO_FUNC(func_nobuild); +//LINK_ENTITY_TO_FUNC(func_nogrenades); +//LINK_ENTITY_TO_FUNC(ghost); +//LINK_ENTITY_TO_FUNC(i_p_t); +//LINK_ENTITY_TO_FUNC(i_t_g); +//LINK_ENTITY_TO_FUNC(i_t_t); +//LINK_ENTITY_TO_FUNC(info_areadef); +//LINK_ENTITY_TO_FUNC(info_player_teamspawn); +//LINK_ENTITY_TO_FUNC(info_tf_teamcheck); +//LINK_ENTITY_TO_FUNC(info_tf_teamset); +//LINK_ENTITY_TO_FUNC(info_tfdetect); +//LINK_ENTITY_TO_FUNC(info_tfgoal); +//LINK_ENTITY_TO_FUNC(info_tfgoal_timer); +//LINK_ENTITY_TO_FUNC(item_armor1); +//LINK_ENTITY_TO_FUNC(item_armor2); +//LINK_ENTITY_TO_FUNC(item_armor3); +//LINK_ENTITY_TO_FUNC(item_artifact_envirosuit); +//LINK_ENTITY_TO_FUNC(item_artifact_invisibility); +//LINK_ENTITY_TO_FUNC(item_artifact_invulnerability); +//LINK_ENTITY_TO_FUNC(item_artifact_super_damage); +//LINK_ENTITY_TO_FUNC(item_cells); +//LINK_ENTITY_TO_FUNC(item_health); +//LINK_ENTITY_TO_FUNC(item_rockets); +//LINK_ENTITY_TO_FUNC(item_shells); +//LINK_ENTITY_TO_FUNC(item_spikes); +//LINK_ENTITY_TO_FUNC(item_tfgoal); +//LINK_ENTITY_TO_FUNC(teledeath); +//LINK_ENTITY_TO_FUNC(tf_ammo_rpgclip); +//LINK_ENTITY_TO_FUNC(tf_flame); +//LINK_ENTITY_TO_FUNC(tf_flamethrower_burst); +//LINK_ENTITY_TO_FUNC(tf_gl_grenade); +//LINK_ENTITY_TO_FUNC(tf_ic_rocket); +//LINK_ENTITY_TO_FUNC(tf_nailgun_nail); +//LINK_ENTITY_TO_FUNC(tf_rpg_rocket); +//LINK_ENTITY_TO_FUNC(tf_weapon_ac); +//LINK_ENTITY_TO_FUNC(tf_weapon_autorifle); +//LINK_ENTITY_TO_FUNC(tf_weapon_axe); +//LINK_ENTITY_TO_FUNC(tf_weapon_caltrop); +//LINK_ENTITY_TO_FUNC(tf_weapon_caltropgrenade); +//LINK_ENTITY_TO_FUNC(tf_weapon_concussiongrenade); +//LINK_ENTITY_TO_FUNC(tf_weapon_empgrenade); +//LINK_ENTITY_TO_FUNC(tf_weapon_flamethrower); +//LINK_ENTITY_TO_FUNC(tf_weapon_gasgrenade); +//LINK_ENTITY_TO_FUNC(tf_weapon_genericprimedgrenade); +//LINK_ENTITY_TO_FUNC(tf_weapon_gl); +//LINK_ENTITY_TO_FUNC(tf_weapon_ic); +//LINK_ENTITY_TO_FUNC(tf_weapon_knife); +//LINK_ENTITY_TO_FUNC(tf_weapon_medikit); +//LINK_ENTITY_TO_FUNC(tf_weapon_mirvbomblet); +//LINK_ENTITY_TO_FUNC(tf_weapon_mirvgrenade); +//LINK_ENTITY_TO_FUNC(tf_weapon_nailgrenade); +//LINK_ENTITY_TO_FUNC(tf_weapon_napalmgrenade); +//LINK_ENTITY_TO_FUNC(tf_weapon_ng); +//LINK_ENTITY_TO_FUNC(tf_weapon_normalgrenade); +//LINK_ENTITY_TO_FUNC(tf_weapon_pl); +//LINK_ENTITY_TO_FUNC(tf_weapon_railgun); +//LINK_ENTITY_TO_FUNC(tf_weapon_rpg); +//LINK_ENTITY_TO_FUNC(tf_weapon_shotgun); +//LINK_ENTITY_TO_FUNC(tf_weapon_sniperrifle); +//LINK_ENTITY_TO_FUNC(tf_weapon_spanner); +//LINK_ENTITY_TO_FUNC(tf_weapon_superng); +//LINK_ENTITY_TO_FUNC(tf_weapon_supershotgun); +//LINK_ENTITY_TO_FUNC(tf_weapon_tranq); +//LINK_ENTITY_TO_FUNC(timer); +// +//// entities for Counter-Strike (Beta 6.5, 6.6, 7.0, 7.1) & 1.0 +//LINK_ENTITY_TO_FUNC(ammo_338magnum); +//LINK_ENTITY_TO_FUNC(ammo_357sig); +//LINK_ENTITY_TO_FUNC(ammo_45acp); +//LINK_ENTITY_TO_FUNC(ammo_50ae); +//LINK_ENTITY_TO_FUNC(ammo_556nato); +//LINK_ENTITY_TO_FUNC(ammo_556natobox); +//LINK_ENTITY_TO_FUNC(ammo_57mm); +//LINK_ENTITY_TO_FUNC(ammo_762nato); +//LINK_ENTITY_TO_FUNC(ammo_9mm); +//LINK_ENTITY_TO_FUNC(armoury_entity); +//LINK_ENTITY_TO_FUNC(env_bombglow); +//LINK_ENTITY_TO_FUNC(func_bomb_target); +//LINK_ENTITY_TO_FUNC(func_buyzone); +//LINK_ENTITY_TO_FUNC(func_escapezone); +//LINK_ENTITY_TO_FUNC(func_grencatch); +//LINK_ENTITY_TO_FUNC(func_hostage_rescue); +//LINK_ENTITY_TO_FUNC(func_vehicle); +//LINK_ENTITY_TO_FUNC(func_vehiclecontrols); +//LINK_ENTITY_TO_FUNC(func_vip_safetyzone); +//LINK_ENTITY_TO_FUNC(func_weaponcheck); +//LINK_ENTITY_TO_FUNC(hostage_entity); +//LINK_ENTITY_TO_FUNC(info_bomb_target); +//LINK_ENTITY_TO_FUNC(info_hostage_rescue); +//LINK_ENTITY_TO_FUNC(info_map_parameters); +//LINK_ENTITY_TO_FUNC(info_vip_start); +//LINK_ENTITY_TO_FUNC(item_assaultsuit); +//LINK_ENTITY_TO_FUNC(item_kevlar); +//LINK_ENTITY_TO_FUNC(item_thighpack); +//LINK_ENTITY_TO_FUNC(weapon_ak47); +//LINK_ENTITY_TO_FUNC(weapon_aug); +//LINK_ENTITY_TO_FUNC(weapon_awp); +//LINK_ENTITY_TO_FUNC(weapon_c4); +//LINK_ENTITY_TO_FUNC(weapon_deagle); +//LINK_ENTITY_TO_FUNC(weapon_elite); +//LINK_ENTITY_TO_FUNC(weapon_fiveseven); +//LINK_ENTITY_TO_FUNC(weapon_flashbang); +//LINK_ENTITY_TO_FUNC(weapon_g3sg1); +//LINK_ENTITY_TO_FUNC(weapon_glock18); +//LINK_ENTITY_TO_FUNC(weapon_hegrenade); +//LINK_ENTITY_TO_FUNC(weapon_knife); +//LINK_ENTITY_TO_FUNC(weapon_m249); +//LINK_ENTITY_TO_FUNC(weapon_m3); +//LINK_ENTITY_TO_FUNC(weapon_m4a1); +//LINK_ENTITY_TO_FUNC(weapon_mac10); +//LINK_ENTITY_TO_FUNC(weapon_mp5navy); +//LINK_ENTITY_TO_FUNC(weapon_p228); +//LINK_ENTITY_TO_FUNC(weapon_p90); +//LINK_ENTITY_TO_FUNC(weapon_scout); +//LINK_ENTITY_TO_FUNC(weapon_sg550); +//LINK_ENTITY_TO_FUNC(weapon_sg552); +//LINK_ENTITY_TO_FUNC(weapon_smokegrenade); +//LINK_ENTITY_TO_FUNC(weapon_tmp); +//LINK_ENTITY_TO_FUNC(weapon_usp); +//LINK_ENTITY_TO_FUNC(weapon_ump45); +//LINK_ENTITY_TO_FUNC(weapon_xm1014); +// +//// entities for Opposing Force +//LINK_ENTITY_TO_FUNC(ammo_556); +//LINK_ENTITY_TO_FUNC(ammo_762); +//LINK_ENTITY_TO_FUNC(ammo_eagleclip); +//LINK_ENTITY_TO_FUNC(ammo_spore); +//LINK_ENTITY_TO_FUNC(charged_bolt); +//LINK_ENTITY_TO_FUNC(displacer_ball); +//LINK_ENTITY_TO_FUNC(eagle_laser); +//LINK_ENTITY_TO_FUNC(env_blowercannon); +//LINK_ENTITY_TO_FUNC(env_electrified_wire); +//LINK_ENTITY_TO_FUNC(env_genewormcloud); +//LINK_ENTITY_TO_FUNC(env_genewormspawn); +//LINK_ENTITY_TO_FUNC(env_rope); +//LINK_ENTITY_TO_FUNC(env_spritetrain); +//LINK_ENTITY_TO_FUNC(func_op4mortarcontroller); +//LINK_ENTITY_TO_FUNC(func_tank_of); +//LINK_ENTITY_TO_FUNC(func_tankcontrols_of); +//LINK_ENTITY_TO_FUNC(func_tanklaser_of); +//LINK_ENTITY_TO_FUNC(func_tankmortar_of); +//LINK_ENTITY_TO_FUNC(func_tankrocket_of); +//LINK_ENTITY_TO_FUNC(gonomeguts); +//LINK_ENTITY_TO_FUNC(grapple_tip); +//LINK_ENTITY_TO_FUNC(hvr_blkop_rocket); +//LINK_ENTITY_TO_FUNC(info_ctfdetect); +//LINK_ENTITY_TO_FUNC(info_ctfspawn); +//LINK_ENTITY_TO_FUNC(info_ctfspawn_powerup); +//LINK_ENTITY_TO_FUNC(info_displacer_earth_target); +//LINK_ENTITY_TO_FUNC(info_displacer_xen_target); +//LINK_ENTITY_TO_FUNC(info_pitworm); +//LINK_ENTITY_TO_FUNC(info_pitworm_steam_lock); +//LINK_ENTITY_TO_FUNC(item_ctfaccelerator); +//LINK_ENTITY_TO_FUNC(item_ctfbackpack); +//LINK_ENTITY_TO_FUNC(item_ctfbase); +//LINK_ENTITY_TO_FUNC(item_ctfflag); +//LINK_ENTITY_TO_FUNC(item_ctflongjump); +//LINK_ENTITY_TO_FUNC(item_ctfportablehev); +//LINK_ENTITY_TO_FUNC(item_ctfregeneration); +//LINK_ENTITY_TO_FUNC(item_generic); +//LINK_ENTITY_TO_FUNC(item_nuclearbomb); +//LINK_ENTITY_TO_FUNC(item_nuclearbombbutton); +//LINK_ENTITY_TO_FUNC(item_nuclearbombtimer); +//LINK_ENTITY_TO_FUNC(item_vest); +//LINK_ENTITY_TO_FUNC(monster_ShockTrooper_dead); +//LINK_ENTITY_TO_FUNC(monster_alien_babyvoltigore); +//LINK_ENTITY_TO_FUNC(monster_alien_slave_dead); +//LINK_ENTITY_TO_FUNC(monster_alien_voltigore); +//LINK_ENTITY_TO_FUNC(monster_assassin_repel); +//LINK_ENTITY_TO_FUNC(monster_blkop_apache); +//LINK_ENTITY_TO_FUNC(monster_blkop_osprey); +//LINK_ENTITY_TO_FUNC(monster_cleansuit_scientist); +//LINK_ENTITY_TO_FUNC(monster_cleansuit_scientist_dead); +//LINK_ENTITY_TO_FUNC(monster_drillsergeant); +//LINK_ENTITY_TO_FUNC(monster_fgrunt_repel); +//LINK_ENTITY_TO_FUNC(monster_geneworm); +//LINK_ENTITY_TO_FUNC(monster_gonome); +//LINK_ENTITY_TO_FUNC(monster_gonome_dead); +//LINK_ENTITY_TO_FUNC(monster_grunt_ally_repel); +//LINK_ENTITY_TO_FUNC(monster_hfgrunt_dead); +//LINK_ENTITY_TO_FUNC(monster_houndeye_dead); +//LINK_ENTITY_TO_FUNC(monster_human_friendly_grunt); +//LINK_ENTITY_TO_FUNC(monster_human_grunt_ally); +//LINK_ENTITY_TO_FUNC(monster_human_grunt_ally_dead); +//LINK_ENTITY_TO_FUNC(monster_human_medic_ally); +//LINK_ENTITY_TO_FUNC(monster_human_torch_ally); +//LINK_ENTITY_TO_FUNC(monster_male_assassin); +//LINK_ENTITY_TO_FUNC(monster_massassin_dead); +//LINK_ENTITY_TO_FUNC(monster_medic_ally_repel); +//LINK_ENTITY_TO_FUNC(monster_op4loader); +//LINK_ENTITY_TO_FUNC(monster_otis); +//LINK_ENTITY_TO_FUNC(monster_otis_dead); +//LINK_ENTITY_TO_FUNC(monster_penguin); +//LINK_ENTITY_TO_FUNC(monster_pitdrone); +//LINK_ENTITY_TO_FUNC(monster_pitworm); +//LINK_ENTITY_TO_FUNC(monster_pitworm_up); +//LINK_ENTITY_TO_FUNC(monster_recruit); +//LINK_ENTITY_TO_FUNC(monster_shockroach); +//LINK_ENTITY_TO_FUNC(monster_shocktrooper); +//LINK_ENTITY_TO_FUNC(monster_shocktrooper_repel); +//LINK_ENTITY_TO_FUNC(monster_sitting_cleansuit_scientist); +//LINK_ENTITY_TO_FUNC(monster_skeleton_dead); +//LINK_ENTITY_TO_FUNC(monster_torch_ally_repel); +//LINK_ENTITY_TO_FUNC(monster_zombie_barney); +//LINK_ENTITY_TO_FUNC(monster_zombie_soldier); +//LINK_ENTITY_TO_FUNC(monster_zombie_soldier_dead); +//LINK_ENTITY_TO_FUNC(mortar_shell); +//LINK_ENTITY_TO_FUNC(op4mortar); +//LINK_ENTITY_TO_FUNC(pitdronespike); +//LINK_ENTITY_TO_FUNC(pitworm_gib); +//LINK_ENTITY_TO_FUNC(pitworm_gibshooter); +//LINK_ENTITY_TO_FUNC(rope_sample); +//LINK_ENTITY_TO_FUNC(rope_segment); +//LINK_ENTITY_TO_FUNC(shock_beam); +//LINK_ENTITY_TO_FUNC(spore); +//LINK_ENTITY_TO_FUNC(trigger_ctfgeneric); +//LINK_ENTITY_TO_FUNC(trigger_geneworm_hit); +//LINK_ENTITY_TO_FUNC(trigger_kill_nogib); +//LINK_ENTITY_TO_FUNC(trigger_playerfreeze); +//LINK_ENTITY_TO_FUNC(trigger_xen_return); +//LINK_ENTITY_TO_FUNC(weapon_displacer); +//LINK_ENTITY_TO_FUNC(weapon_eagle); +//LINK_ENTITY_TO_FUNC(weapon_grapple); +//LINK_ENTITY_TO_FUNC(weapon_penguin); +//LINK_ENTITY_TO_FUNC(weapon_pipewrench); +//LINK_ENTITY_TO_FUNC(weapon_shockrifle); +//LINK_ENTITY_TO_FUNC(weapon_shockroach); +//LINK_ENTITY_TO_FUNC(weapon_sniperrifle); +//LINK_ENTITY_TO_FUNC(weapon_sporelauncher); +// +//// entities for FrontLineForce (1.0) +//LINK_ENTITY_TO_FUNC(ammo_ak5); +//LINK_ENTITY_TO_FUNC(ammo_beretta); +//LINK_ENTITY_TO_FUNC(ammo_famas); +//LINK_ENTITY_TO_FUNC(ammo_hk21); +//LINK_ENTITY_TO_FUNC(ammo_m4); +//LINK_ENTITY_TO_FUNC(ammo_mac10); +//LINK_ENTITY_TO_FUNC(ammo_mk23); +//LINK_ENTITY_TO_FUNC(ammo_mp5a2); +//LINK_ENTITY_TO_FUNC(ammo_mp5sd); +//LINK_ENTITY_TO_FUNC(ammo_msg90); +//LINK_ENTITY_TO_FUNC(ammo_spas12); +//LINK_ENTITY_TO_FUNC(ammo_ump45); +//LINK_ENTITY_TO_FUNC(capture_point); +//LINK_ENTITY_TO_FUNC(info_frontline); +//LINK_ENTITY_TO_FUNC(info_player_attacker); +//LINK_ENTITY_TO_FUNC(info_player_defender); +//LINK_ENTITY_TO_FUNC(info_player_observer); +//LINK_ENTITY_TO_FUNC(weapon_ak5); +//LINK_ENTITY_TO_FUNC(weapon_beretta); +//LINK_ENTITY_TO_FUNC(weapon_famas); +//LINK_ENTITY_TO_FUNC(weapon_hk21); +//LINK_ENTITY_TO_FUNC(weapon_m4); +//LINK_ENTITY_TO_FUNC(weapon_mk23); +//LINK_ENTITY_TO_FUNC(weapon_mp5a2); +//LINK_ENTITY_TO_FUNC(weapon_mp5sd); +//LINK_ENTITY_TO_FUNC(weapon_msg90); +//LINK_ENTITY_TO_FUNC(weapon_spas12); + +// entities for Natural Selection +LINK_ENTITY_TO_FUNC(info_team_start); +LINK_ENTITY_TO_FUNC(info_spectate); +LINK_ENTITY_TO_FUNC(info_join_team); +LINK_ENTITY_TO_FUNC(info_leave_game); +LINK_ENTITY_TO_FUNC(info_join_autoassign); +LINK_ENTITY_TO_FUNC(info_mapinfo); +LINK_ENTITY_TO_FUNC(info_gameplay); + +LINK_ENTITY_TO_FUNC(env_fog); +LINK_ENTITY_TO_FUNC(env_gamma); +LINK_ENTITY_TO_FUNC(env_particles); +LINK_ENTITY_TO_FUNC(env_particles_custom); + +LINK_ENTITY_TO_FUNC(func_weldable); +LINK_ENTITY_TO_FUNC(func_seethrough); +LINK_ENTITY_TO_FUNC(func_seethroughdoor); +//LINK_ENTITY_TO_FUNC(func_waypoint); +LINK_ENTITY_TO_FUNC(func_nobuild); +LINK_ENTITY_TO_FUNC(func_resource); + +LINK_ENTITY_TO_FUNC(target_mp3audio); +LINK_ENTITY_TO_FUNC(trigger_random); +LINK_ENTITY_TO_FUNC(trigger_presence); +LINK_ENTITY_TO_FUNC(trigger_script); +LINK_ENTITY_TO_FUNC(info_location); + +LINK_ENTITY_TO_FUNC(team_hive); +LINK_ENTITY_TO_FUNC(team_command); +LINK_ENTITY_TO_FUNC(team_breach); +LINK_ENTITY_TO_FUNC(team_egg); +LINK_ENTITY_TO_FUNC(team_webstrand); + +// Marine weapons and equipment +LINK_ENTITY_TO_FUNC(weapon_knife); +LINK_ENTITY_TO_FUNC(weapon_grenade); +LINK_ENTITY_TO_FUNC(weapon_machinegun); +LINK_ENTITY_TO_FUNC(weapon_pistol); +LINK_ENTITY_TO_FUNC(weapon_flamegun); +LINK_ENTITY_TO_FUNC(weapon_heavymachinegun); +LINK_ENTITY_TO_FUNC(weapon_grenadegun); +LINK_ENTITY_TO_FUNC(weapon_shotgun); +LINK_ENTITY_TO_FUNC(weapon_nukegun); +LINK_ENTITY_TO_FUNC(weapon_mine); +LINK_ENTITY_TO_FUNC(weapon_welder); + +LINK_ENTITY_TO_FUNC(item_genericammo); +LINK_ENTITY_TO_FUNC(item_mine); +LINK_ENTITY_TO_FUNC(item_health); +LINK_ENTITY_TO_FUNC(item_catalyst); +LINK_ENTITY_TO_FUNC(item_heavyarmor); +LINK_ENTITY_TO_FUNC(item_jetpack); + +LINK_ENTITY_TO_FUNC(scan); +LINK_ENTITY_TO_FUNC(turret); +LINK_ENTITY_TO_FUNC(phasegate); +LINK_ENTITY_TO_FUNC(siegeturret); +LINK_ENTITY_TO_FUNC(nuke); + +// Marine buildings +LINK_ENTITY_TO_FUNC(resourcetower); +LINK_ENTITY_TO_FUNC(team_infportal); +LINK_ENTITY_TO_FUNC(team_turretfactory); +LINK_ENTITY_TO_FUNC(team_advturretfactory); +LINK_ENTITY_TO_FUNC(team_armory); +LINK_ENTITY_TO_FUNC(team_advarmory); +LINK_ENTITY_TO_FUNC(team_armslab); +LINK_ENTITY_TO_FUNC(team_prototypelab); +LINK_ENTITY_TO_FUNC(team_observatory); +LINK_ENTITY_TO_FUNC(team_chemlab); +LINK_ENTITY_TO_FUNC(team_medlab); +LINK_ENTITY_TO_FUNC(team_nukeplant); + +// Alien buildings +LINK_ENTITY_TO_FUNC(alienresourcetower); +LINK_ENTITY_TO_FUNC(defensechamber); +LINK_ENTITY_TO_FUNC(spikeprojectile); +LINK_ENTITY_TO_FUNC(offensechamber); +LINK_ENTITY_TO_FUNC(sensorychamber); +LINK_ENTITY_TO_FUNC(movementchamber); + +// Alien abilities that are technically weapons (along with their projectiles) +LINK_ENTITY_TO_FUNC(weapon_acidrocket); +LINK_ENTITY_TO_FUNC(weapon_acidrocketgun); +LINK_ENTITY_TO_FUNC(weapon_bilebomb); +LINK_ENTITY_TO_FUNC(weapon_bilebombgun); +LINK_ENTITY_TO_FUNC(weapon_bitegun); +LINK_ENTITY_TO_FUNC(weapon_blink); +LINK_ENTITY_TO_FUNC(weapon_claws); +LINK_ENTITY_TO_FUNC(weapon_devour); +LINK_ENTITY_TO_FUNC(weapon_divinewind); +LINK_ENTITY_TO_FUNC(weapon_healingspray); +LINK_ENTITY_TO_FUNC(weapon_metabolize); +LINK_ENTITY_TO_FUNC(weapon_parasite); +LINK_ENTITY_TO_FUNC(weapon_primalscream); +LINK_ENTITY_TO_FUNC(weapon_spikegun); +LINK_ENTITY_TO_FUNC(weapon_bite2gun); +LINK_ENTITY_TO_FUNC(weapon_spit); +LINK_ENTITY_TO_FUNC(weapon_spore); +LINK_ENTITY_TO_FUNC(weapon_stomp); +LINK_ENTITY_TO_FUNC(weapon_swipe); +LINK_ENTITY_TO_FUNC(weapon_umbra); +LINK_ENTITY_TO_FUNC(weapon_webspinner); + +// Alien abilities +LINK_ENTITY_TO_FUNC(weapon_leap); +LINK_ENTITY_TO_FUNC(weapon_charge); + +LINK_ENTITY_TO_FUNC(webgunprojectile); +LINK_ENTITY_TO_FUNC(spitgunprojectile); +LINK_ENTITY_TO_FUNC(stompprojectile); +LINK_ENTITY_TO_FUNC(sporegunprojectile); +LINK_ENTITY_TO_FUNC(umbracloud); +LINK_ENTITY_TO_FUNC(umbraprojectile); + diff --git a/main/source/HPB_bot/dlls/util.cpp b/main/source/HPB_bot/dlls/util.cpp new file mode 100644 index 00000000..5f2bb6ed --- /dev/null +++ b/main/source/HPB_bot/dlls/util.cpp @@ -0,0 +1,661 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ + +// +// HPB_bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// util.cpp +// + +#include "extdll.h" +#include "util.h" +#include "HPB_bot/engine/engine.h" +#include "dlls/cbase.h" +#include "dlls/player.h" + +#include "bot.h" +#include "bot_func.h" + + +extern int mod_id; +extern bot_t bots[32]; +extern edict_t *pent_info_ctfdetect; +extern char team_names[MAX_TEAMS][MAX_TEAMNAME_LENGTH]; +extern int num_teams; + +int gmsgTextMsg = 0; +int gmsgSayText = 0; +int gmsgShowMenu = 0; + + +Vector UTIL_VecToAngles( const Vector &vec ) +{ + float rgflVecOut[3]; + VEC_TO_ANGLES(vec, rgflVecOut); + return Vector(rgflVecOut); +} + + +// Overloaded to add IGNORE_GLASS +void UTIL_TraceLine( const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, IGNORE_GLASS ignoreGlass, edict_t *pentIgnore, TraceResult *ptr ) +{ + TRACE_LINE( vecStart, vecEnd, (igmon == ignore_monsters ? TRUE : FALSE) | (ignoreGlass?0x100:0), pentIgnore, ptr ); +} + + +void UTIL_TraceLine( const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, edict_t *pentIgnore, TraceResult *ptr ) +{ + TRACE_LINE( vecStart, vecEnd, (igmon == ignore_monsters ? TRUE : FALSE), pentIgnore, ptr ); +} + + +void UTIL_MakeVectors( const Vector &vecAngles ) +{ + MAKE_VECTORS( vecAngles ); +} + + +edict_t *UTIL_FindEntityInSphere( edict_t *pentStart, const Vector &vecCenter, float flRadius ) +{ + edict_t *pentEntity; + + pentEntity = FIND_ENTITY_IN_SPHERE( pentStart, vecCenter, flRadius); + + if (!FNullEnt(pentEntity)) + return pentEntity; + + return NULL; +} + + +edict_t *UTIL_FindEntityByString( edict_t *pentStart, const char *szKeyword, const char *szValue ) +{ + edict_t *pentEntity; + + pentEntity = FIND_ENTITY_BY_STRING( pentStart, szKeyword, szValue ); + + if (!FNullEnt(pentEntity)) + return pentEntity; + return NULL; +} + +edict_t *UTIL_FindEntityByClassname( edict_t *pentStart, const char *szName ) +{ + return UTIL_FindEntityByString( pentStart, "classname", szName ); +} + +edict_t *UTIL_FindEntityByTargetname( edict_t *pentStart, const char *szName ) +{ + return UTIL_FindEntityByString( pentStart, "targetname", szName ); +} + + +int UTIL_PointContents( const Vector &vec ) +{ + return POINT_CONTENTS(vec); +} + + +void UTIL_SetSize( entvars_t *pev, const Vector &vecMin, const Vector &vecMax ) +{ + SET_SIZE( ENT(pev), vecMin, vecMax ); +} + + +void UTIL_SetOrigin( entvars_t *pev, const Vector &vecOrigin ) +{ + SET_ORIGIN(ENT(pev), vecOrigin ); +} + + +void ClientPrint( edict_t *pEntity, int msg_dest, const char *msg_name) +{ +// if (gmsgTextMsg == 0) +// gmsgTextMsg = REG_USER_MSG( "TextMsg", -1 ); +// +// pfnMessageBegin( MSG_ONE, gmsgTextMsg, NULL, pEntity ); +// +// pfnWriteByte( msg_dest ); +// pfnWriteString( msg_name ); +// pfnMessageEnd(); +} + +void UTIL_SayText( const char *pText, edict_t *pEdict ) +{ +// if (gmsgSayText == 0) +// gmsgSayText = REG_USER_MSG( "SayText", -1 ); +// +// pfnMessageBegin( MSG_ONE, gmsgSayText, NULL, pEdict ); +// pfnWriteByte( ENTINDEX(pEdict) ); +// if (mod_id == FRONTLINE_DLL) +// pfnWriteShort(0); +// pfnWriteString( pText ); +// pfnMessageEnd(); +} + + +void UTIL_HostSay( edict_t *pEntity, int teamonly, char *message ) +{ +// int j; +// char text[128]; +// char *pc; +// int sender_team, player_team; +// edict_t *client; +// +// // make sure the text has content +// for ( pc = message; pc != NULL && *pc != 0; pc++ ) +// { +// if ( isprint( *pc ) && !isspace( *pc ) ) +// { +// pc = NULL; // we've found an alphanumeric character, so text is valid +// break; +// } +// } +// +// if ( pc != NULL ) +// return; // no character found, so say nothing +// +// // turn on color set 2 (color on, no sound) +// if ( teamonly ) +// sprintf( text, "%c(TEAM) %s: ", 2, STRING( pEntity->v.netname ) ); +// else +// sprintf( text, "%c%s: ", 2, STRING( pEntity->v.netname ) ); +// +// j = sizeof(text) - 2 - strlen(text); // -2 for /n and null terminator +// if ( (int)strlen(message) > j ) +// message[j] = 0; +// +// strcat( text, message ); +// strcat( text, "\n" ); +// +// // loop through all players +// // Start with the first player. +// // This may return the world in single player if the client types something between levels or during spawn +// // so check it, or it will infinite loop +// +// if (gmsgSayText == 0) +// gmsgSayText = REG_USER_MSG( "SayText", -1 ); +// +// sender_team = UTIL_GetTeam(pEntity); +// +// client = NULL; +// while ( ((client = UTIL_FindEntityByClassname( client, "player" )) != NULL) && +// (!FNullEnt(client)) ) +// { +// if ( client == pEntity ) // skip sender of message +// continue; +// +// player_team = UTIL_GetTeam(client); +// +// if ( teamonly && (sender_team != player_team) ) +// continue; +// +// pfnMessageBegin( MSG_ONE, gmsgSayText, NULL, client ); +// pfnWriteByte( ENTINDEX(pEntity) ); +// if (mod_id == FRONTLINE_DLL) +// pfnWriteShort(0); +// pfnWriteString( text ); +// pfnMessageEnd(); +// } +// +// // print to the sending client +// pfnMessageBegin( MSG_ONE, gmsgSayText, NULL, pEntity ); +// pfnWriteByte( ENTINDEX(pEntity) ); +// if (mod_id == FRONTLINE_DLL) +// pfnWriteShort(0); +// pfnWriteString( text ); +// pfnMessageEnd(); +// +// // echo to server console +// g_engfuncs.pfnServerPrint( text ); +} + + +#ifdef DEBUG +edict_t *DBG_EntOfVars( const entvars_t *pev ) +{ + if (pev->pContainingEntity != NULL) + return pev->pContainingEntity; + ALERT(at_console, "entvars_t pContainingEntity is NULL, calling into engine"); + edict_t* pent = (*g_engfuncs.pfnFindEntityByVars)((entvars_t*)pev); + if (pent == NULL) + ALERT(at_console, "DAMN! Even the engine couldn't FindEntityByVars!"); + ((entvars_t *)pev)->pContainingEntity = pent; + return pent; +} +#endif //DEBUG + + +// return team number 0 through 3 based what MOD uses for team numbers +int UTIL_GetTeam(edict_t *pEntity) +{ + if (mod_id == TFC_DLL) + { + return pEntity->v.team - 1; // TFC teams are 1-4 based + } + else if (mod_id == CSTRIKE_DLL) + { + char *infobuffer; + char model_name[32]; + + infobuffer = (*g_engfuncs.pfnGetInfoKeyBuffer)( pEntity ); + strcpy(model_name, (g_engfuncs.pfnInfoKeyValue(infobuffer, "model"))); + + if ((strcmp(model_name, "terror") == 0) || // Phoenix Connektion + (strcmp(model_name, "arab") == 0) || // old L337 Krew + (strcmp(model_name, "leet") == 0) || // L337 Krew + (strcmp(model_name, "artic") == 0) || // Artic Avenger + (strcmp(model_name, "guerilla") == 0)) // Gorilla Warfare + { + return 0; + } + else if ((strcmp(model_name, "urban") == 0) || // Seal Team 6 + (strcmp(model_name, "gsg9") == 0) || // German GSG-9 + (strcmp(model_name, "sas") == 0) || // UK SAS + (strcmp(model_name, "gign") == 0) || // French GIGN + (strcmp(model_name, "vip") == 0)) // VIP + { + return 1; + } + + return 0; // return zero if team is unknown + } + else if ((mod_id == GEARBOX_DLL) && (pent_info_ctfdetect != NULL)) + { + // OpFor CTF map... + + char *infobuffer; + char model_name[32]; + + infobuffer = (*g_engfuncs.pfnGetInfoKeyBuffer)( pEntity ); + strcpy(model_name, (g_engfuncs.pfnInfoKeyValue(infobuffer, "model"))); + + if ((strcmp(model_name, "ctf_barney") == 0) || + (strcmp(model_name, "cl_suit") == 0) || + (strcmp(model_name, "ctf_gina") == 0) || + (strcmp(model_name, "ctf_gordon") == 0) || + (strcmp(model_name, "otis") == 0) || + (strcmp(model_name, "ctf_scientist") == 0)) + { + return 0; + } + else if ((strcmp(model_name, "beret") == 0) || + (strcmp(model_name, "drill") == 0) || + (strcmp(model_name, "grunt") == 0) || + (strcmp(model_name, "recruit") == 0) || + (strcmp(model_name, "shephard") == 0) || + (strcmp(model_name, "tower") == 0)) + { + return 1; + } + + return 0; // return zero if team is unknown + } + else if (mod_id == FRONTLINE_DLL) + { + return pEntity->v.team - 1; // Front Line Force teams are 1-4 based + } + else if(mod_id == AVH_DLL) + { + return pEntity->v.team; + } + else // must be HL or OpFor deathmatch... + { + char *infobuffer; + char model_name[32]; + + if (team_names[0][0] == 0) + { + char *pName; + char teamlist[MAX_TEAMS*MAX_TEAMNAME_LENGTH]; + int i; + + num_teams = 0; + strcpy(teamlist, CVAR_GET_STRING("mp_teamlist")); + pName = teamlist; + pName = strtok(pName, ";"); + + while (pName != NULL && *pName) + { + // check that team isn't defined twice + for (i=0; i < num_teams; i++) + if (strcmp(pName, team_names[i]) == 0) + break; + if (i == num_teams) + { + strcpy(team_names[num_teams], pName); + num_teams++; + } + pName = strtok(NULL, ";"); + } + } + + infobuffer = (*g_engfuncs.pfnGetInfoKeyBuffer)( pEntity ); + strcpy(model_name, (g_engfuncs.pfnInfoKeyValue(infobuffer, "model"))); + + for (int index=0; index < num_teams; index++) + { + if (strcmp(model_name, team_names[index]) == 0) + return index; + } + + return 0; + } +} + + +// return class number 0 through N +int UTIL_GetClass(edict_t *pEntity) +{ + char *infobuffer; + char model_name[32]; + + infobuffer = (*g_engfuncs.pfnGetInfoKeyBuffer)( pEntity ); + strcpy(model_name, (g_engfuncs.pfnInfoKeyValue(infobuffer, "model"))); + + if (mod_id == FRONTLINE_DLL) + { + if ((strcmp(model_name, "natorecon") == 0) || + (strcmp(model_name, "axisrecon") == 0)) + { + return 0; // recon + } + else if ((strcmp(model_name, "natoassault") == 0) || + (strcmp(model_name, "axisassault") == 0)) + { + return 1; // assault + } + else if ((strcmp(model_name, "natosupport") == 0) || + (strcmp(model_name, "axissupport") == 0)) + { + return 2; // support + } + } + + return 0; +} + + +int UTIL_GetBotIndex(edict_t *pEdict) +{ + int index; + + for (index=0; index < 32; index++) + { + if (bots[index].pEdict == pEdict) + { + return index; + } + } + + return -1; // return -1 if edict is not a bot +} + + +bot_t *UTIL_GetBotPointer(edict_t *pEdict) +{ + int index; + + for (index=0; index < 32; index++) + { + if (bots[index].pEdict == pEdict) + { + break; + } + } + + if (index < 32) + return (&bots[index]); + + return NULL; // return NULL if edict is not a bot +} + + +bool IsAlive(edict_t *pEdict) +{ + return ((pEdict->v.deadflag == DEAD_NO) && + (pEdict->v.health > 0) && !(pEdict->v.flags & FL_NOTARGET)); +} + + +bool FInViewCone(Vector *pOrigin, edict_t *pEdict) +{ + Vector2D vec2LOS; + float flDot; + + UTIL_MakeVectors ( pEdict->v.angles ); + + vec2LOS = ( *pOrigin - pEdict->v.origin ).Make2D(); + vec2LOS = vec2LOS.Normalize(); + + flDot = DotProduct (vec2LOS , gpGlobals->v_forward.Make2D() ); + + if ( flDot > 0.50 ) // 60 degree field of view + { + return TRUE; + } + else + { + return FALSE; + } +} + + +bool FVisible( const Vector &vecOrigin, edict_t *pEdict ) +{ + TraceResult tr; + Vector vecLookerOrigin; + + // look through caller's eyes + vecLookerOrigin = pEdict->v.origin + pEdict->v.view_ofs; + + int bInWater = (UTIL_PointContents (vecOrigin) == CONTENTS_WATER); + int bLookerInWater = (UTIL_PointContents (vecLookerOrigin) == CONTENTS_WATER); + + // don't look through water + if (bInWater != bLookerInWater) + return FALSE; + + UTIL_TraceLine(vecLookerOrigin, vecOrigin, ignore_monsters, ignore_glass, pEdict, &tr); + + if (tr.flFraction != 1.0) + { + return FALSE; // Line of sight is not established + } + else + { + return TRUE; // line of sight is valid. + } +} + + +Vector GetGunPosition(edict_t *pEdict) +{ + return (pEdict->v.origin + pEdict->v.view_ofs); +} + + +void UTIL_SelectItem(edict_t *pEdict, char *item_name) +{ + FakeClientCommand(pEdict, item_name, NULL, NULL); +} + + +Vector VecBModelOrigin(edict_t *pEdict) +{ + return pEdict->v.absmin + (pEdict->v.size * 0.5); +} + + +bool UpdateSounds(edict_t *pEdict, edict_t *pPlayer) +{ + float distance; + static bool check_footstep_sounds = TRUE; + static float footstep_sounds_on; + float sensitivity = 1.0; + float volume; + + // update sounds made by this player, alert bots if they are nearby... + + if (check_footstep_sounds) + { + check_footstep_sounds = FALSE; + footstep_sounds_on = CVAR_GET_FLOAT("mp_footsteps"); + } + + if (footstep_sounds_on > 0.0) + { + CBasePlayer* thePlayer = (CBasePlayer*)CBaseEntity::Instance(pPlayer); + + // check if this player is moving fast enough to make sounds... + if (pPlayer->v.velocity.Length2D() > thePlayer->GetMaxWalkSpeed()) + { + volume = 500.0; // volume of sound being made (just pick something) + + Vector v_sound = pPlayer->v.origin - pEdict->v.origin; + + distance = v_sound.Length(); + + // is the bot close enough to hear this sound? + if (distance < (volume * sensitivity)) + { + Vector bot_angles = UTIL_VecToAngles( v_sound ); + + pEdict->v.ideal_yaw = bot_angles.y; + + BotFixIdealYaw(pEdict); + + return TRUE; + } + } + } + + return FALSE; +} + + +void UTIL_ShowMenu( edict_t *pEdict, int slots, int displaytime, bool needmore, char *pText ) +{ +// if (gmsgShowMenu == 0) +// gmsgShowMenu = REG_USER_MSG( "ShowMenu", -1 ); +// +// pfnMessageBegin( MSG_ONE, gmsgShowMenu, NULL, pEdict ); +// +// pfnWriteShort( slots ); +// pfnWriteChar( displaytime ); +// pfnWriteByte( needmore ); +// pfnWriteString( pText ); +// +// pfnMessageEnd(); +} + +void UTIL_BuildFileName(char *filename, char *arg1, char *arg2) +{ + + if (mod_id == VALVE_DLL) +#ifndef __linux__ + strcpy(filename, "valve\\"); +#else + strcpy(filename, "valve/"); +#endif + + else if (mod_id == TFC_DLL) +#ifndef __linux__ + strcpy(filename, "tfc\\"); +#else + strcpy(filename, "tfc/"); +#endif + + else if (mod_id == CSTRIKE_DLL) +#ifndef __linux__ + strcpy(filename, "cstrike\\"); +#else + strcpy(filename, "cstrike/"); +#endif + + else if (mod_id == GEARBOX_DLL) +#ifndef __linux__ + strcpy(filename, "gearbox\\"); +#else + strcpy(filename, "gearbox/"); +#endif + + else if (mod_id == FRONTLINE_DLL) +#ifndef __linux__ + strcpy(filename, "frontline\\"); +#else + strcpy(filename, "frontline/"); +#endif + + else if (mod_id == AVH_DLL) + { + string filenameString = string(getModDirectory()); +#ifndef __linux__ + filenameString += "\\"; +#else + filenameString += '/'; +#endif + strcpy(filename,filenameString.c_str()); + } + else + { + filename[0] = 0; + return; + } + + if ((arg1) && (*arg1) && (arg2) && (*arg2)) + { + strcat(filename, arg1); + +#ifndef __linux__ + strcat(filename, "\\"); +#else + strcat(filename, "/"); +#endif + + strcat(filename, arg2); + } + else if ((arg1) && (*arg1)) + { + strcat(filename, arg1); + } + + printf("UTIL_BuildFileName:"); + printf(filename); + printf("\n"); +} + +//========================================================= +// UTIL_LogPrintf - Prints a logged message to console. +// Preceded by LOG: ( timestamp ) < message > +//========================================================= +void UTIL_LogPrintf( char *fmt, ... ) +{ + va_list argptr; + static char string[1024]; + + va_start ( argptr, fmt ); + vsprintf ( string, fmt, argptr ); + va_end ( argptr ); + + // Print to server console + printf("UTIL_LogPrintf:"); + printf(string); + printf("\n"); + ALERT( at_logged, "%s", string ); +} + diff --git a/main/source/HPB_bot/dlls/waypoint.cpp b/main/source/HPB_bot/dlls/waypoint.cpp new file mode 100644 index 00000000..549cebd9 --- /dev/null +++ b/main/source/HPB_bot/dlls/waypoint.cpp @@ -0,0 +1,1938 @@ +// HPB bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// waypoint.cpp +// + +#ifndef __linux__ +#include +#endif +#include +#ifndef __linux__ +#include +#else +#include +#endif + +#include "extdll.h" +#include "enginecallback.h" +#include "util.h" +#include "cbase.h" + +#include "bot.h" +#include "waypoint.h" +//#include "mod/NetworkMeter.h" + +extern int mod_id; +extern int m_spriteTexture; + +// waypoints with information bits (flags) +WAYPOINT waypoints[MAX_WAYPOINTS]; + +// number of waypoints currently in use +int num_waypoints; + +// declare the array of head pointers to the path structures... +PATH *paths[MAX_WAYPOINTS]; + +// time that this waypoint was displayed (while editing) +float wp_display_time[MAX_WAYPOINTS]; + +bool g_waypoint_paths = FALSE; // have any paths been allocated? +bool g_waypoint_on = FALSE; +bool g_auto_waypoint = FALSE; +bool g_path_waypoint = FALSE; +Vector last_waypoint; +float f_path_time = 0.0; + +unsigned int route_num_waypoints; +unsigned short *shortest_path[4] = {NULL, NULL, NULL, NULL}; +unsigned short *from_to[4] = {NULL, NULL, NULL, NULL}; + +static FILE *fp; + + +void WaypointDebug(void) +{ + int y = 1, x = 1; + + fp=fopen("bot.txt","a"); + fprintf(fp,"WaypointDebug: LINKED LIST ERROR!!!\n"); + fclose(fp); + + x = x - 1; // x is zero + y = y / x; // cause an divide by zero exception + + return; +} + + +// free the linked list of waypoint path nodes... +void WaypointFree(void) +{ + for (int i=0; i < MAX_WAYPOINTS; i++) + { + int count = 0; + + if (paths[i]) + { + PATH *p = paths[i]; + PATH *p_next; + + while (p) // free the linked list + { + p_next = p->next; // save the link to next + free(p); + p = p_next; + +#ifdef _DEBUG + count++; + if (count > 1000) WaypointDebug(); +#endif + } + + paths[i] = NULL; + } + } +} + + +// initialize the waypoint structures... +void WaypointInit(void) +{ + int i; + + // have any waypoint path nodes been allocated yet? + if (g_waypoint_paths) + WaypointFree(); // must free previously allocated path memory + + for (i=0; i < 4; i++) + { + if (shortest_path[i] != NULL) + free(shortest_path[i]); + + if (from_to[i] != NULL) + free(from_to[i]); + } + + for (i=0; i < MAX_WAYPOINTS; i++) + { + waypoints[i].flags = 0; + waypoints[i].origin = Vector(0,0,0); + + wp_display_time[i] = 0.0; + + paths[i] = NULL; // no paths allocated yet + } + + f_path_time = 0.0; // reset waypoint path display time + + num_waypoints = 0; + + last_waypoint = Vector(0,0,0); + + for (i=0; i < 4; i++) + { + shortest_path[i] = NULL; + from_to[i] = NULL; + } +} + + +// add a path from one waypoint (add_index) to another (path_index)... +void WaypointAddPath(short int add_index, short int path_index) +{ + PATH *p, *prev; + int i; + int count = 0; + + p = paths[add_index]; + prev = NULL; + + // find an empty slot for new path_index... + while (p != NULL) + { + i = 0; + + while (i < MAX_PATH_INDEX) + { + if (p->index[i] == -1) + { + p->index[i] = path_index; + + return; + } + + i++; + } + + prev = p; // save the previous node in linked list + p = p->next; // go to next node in linked list + +#ifdef _DEBUG + count++; + if (count > 100) WaypointDebug(); +#endif + } + + p = (PATH *)malloc(sizeof(PATH)); + + if (p == NULL) + { + ALERT(at_error, "HPB_bot - Error allocating memory for path!"); + } + + p->index[0] = path_index; + p->index[1] = -1; + p->index[2] = -1; + p->index[3] = -1; + p->next = NULL; + + if (prev != NULL) + prev->next = p; // link new node into existing list + + if (paths[add_index] == NULL) + paths[add_index] = p; // save head point if necessary +} + + +// delete all paths to this waypoint index... +void WaypointDeletePath(short int del_index) +{ + PATH *p; + int index, i; + + // search all paths for this index... + for (index=0; index < num_waypoints; index++) + { + p = paths[index]; + + int count = 0; + + // search linked list for del_index... + while (p != NULL) + { + i = 0; + + while (i < MAX_PATH_INDEX) + { + if (p->index[i] == del_index) + { + p->index[i] = -1; // unassign this path + } + + i++; + } + + p = p->next; // go to next node in linked list + +#ifdef _DEBUG + count++; + if (count > 100) WaypointDebug(); +#endif + } + } +} + + +// delete a path from a waypoint (path_index) to another waypoint +// (del_index)... +void WaypointDeletePath(short int path_index, short int del_index) +{ + PATH *p; + int i; + int count = 0; + + p = paths[path_index]; + + // search linked list for del_index... + while (p != NULL) + { + i = 0; + + while (i < MAX_PATH_INDEX) + { + if (p->index[i] == del_index) + { + p->index[i] = -1; // unassign this path + } + + i++; + } + + p = p->next; // go to next node in linked list + +#ifdef _DEBUG + count++; + if (count > 100) WaypointDebug(); +#endif + } +} + + +// find a path from the current waypoint. (pPath MUST be NULL on the +// initial call. subsequent calls will return other paths if they exist.) +int WaypointFindPath(PATH **pPath, int *path_index, int waypoint_index, int team) +{ + int index; + int count = 0; + + if (*pPath == NULL) + { + *pPath = paths[waypoint_index]; + *path_index = 0; + } + + if (*path_index == MAX_PATH_INDEX) + { + *path_index = 0; + + *pPath = (*pPath)->next; // go to next node in linked list + } + + while (*pPath != NULL) + { + while (*path_index < MAX_PATH_INDEX) + { + if ((*pPath)->index[*path_index] != -1) // found a path? + { + // save the return value + index = (*pPath)->index[*path_index]; + + // skip this path if next waypoint is team specific and NOT this team + if ((team != -1) && (waypoints[index].flags & W_FL_TEAM_SPECIFIC) && + ((waypoints[index].flags & W_FL_TEAM) != team)) + { + (*path_index)++; + continue; + } + + // set up stuff for subsequent calls... + (*path_index)++; + + return index; + } + + (*path_index)++; + } + + *path_index = 0; + + *pPath = (*pPath)->next; // go to next node in linked list + +#ifdef _DEBUG + count++; + if (count > 100) WaypointDebug(); +#endif + } + + return -1; +} + + +// find the nearest waypoint to the player and return the index +// (-1 if not found)... +int WaypointFindNearest(edict_t *pEntity, float range, int team) +{ + int i, min_index; + float distance; + float min_distance; + TraceResult tr; + + if (num_waypoints < 1) + return -1; + + // find the nearest waypoint... + + min_index = -1; + min_distance = 9999.0; + + for (i=0; i < num_waypoints; i++) + { + if (waypoints[i].flags & W_FL_DELETED) + continue; // skip any deleted waypoints + + if (waypoints[i].flags & W_FL_AIMING) + continue; // skip any aiming waypoints + + // skip this waypoint if it's team specific and teams don't match... + if ((team != -1) && (waypoints[i].flags & W_FL_TEAM_SPECIFIC) && + ((waypoints[i].flags & W_FL_TEAM) != team)) + continue; + + distance = (waypoints[i].origin - pEntity->v.origin).Length(); + + if ((distance < min_distance) && (distance < range)) + { + // if waypoint is visible from current position (even behind head)... + UTIL_TraceLine( pEntity->v.origin + pEntity->v.view_ofs, waypoints[i].origin, + ignore_monsters, pEntity->v.pContainingEntity, &tr ); + + if (tr.flFraction >= 1.0) + { + min_index = i; + min_distance = distance; + } + } + } + + return min_index; +} + + +// find the nearest waypoint to the source postition and return the index +// of that waypoint... +int WaypointFindNearest(Vector v_src, edict_t *pEntity, float range, int team) +{ + int index, min_index; + float distance; + float min_distance; + TraceResult tr; + + if (num_waypoints < 1) + return -1; + + // find the nearest waypoint... + + min_index = -1; + min_distance = 9999.0; + + for (index=0; index < num_waypoints; index++) + { + if (waypoints[index].flags & W_FL_DELETED) + continue; // skip any deleted waypoints + + if (waypoints[index].flags & W_FL_AIMING) + continue; // skip any aiming waypoints + + // skip this waypoint if it's team specific and teams don't match... + if ((team != -1) && (waypoints[index].flags & W_FL_TEAM_SPECIFIC) && + ((waypoints[index].flags & W_FL_TEAM) != team)) + continue; + + distance = (waypoints[index].origin - v_src).Length(); + + if ((distance < min_distance) && (distance < range)) + { + // if waypoint is visible from source position... + UTIL_TraceLine( v_src, waypoints[index].origin, ignore_monsters, + pEntity->v.pContainingEntity, &tr ); + + if (tr.flFraction >= 1.0) + { + min_index = index; + min_distance = distance; + } + } + } + + return min_index; +} + + +// find the goal nearest to the player matching the "flags" bits and return +// the index of that waypoint... +int WaypointFindNearestGoal(edict_t *pEntity, int src, int team, int flags) +{ + int index, min_index; + int distance, min_distance; + + if (num_waypoints < 1) + return -1; + + // find the nearest waypoint with the matching flags... + + min_index = -1; + min_distance = 99999; + + for (index=0; index < num_waypoints; index++) + { + if (index == src) + continue; // skip the source waypoint + + if (waypoints[index].flags & W_FL_DELETED) + continue; // skip any deleted waypoints + + if (waypoints[index].flags & W_FL_AIMING) + continue; // skip any aiming waypoints + + // skip this waypoint if it's team specific and teams don't match... + if ((team != -1) && (waypoints[index].flags & W_FL_TEAM_SPECIFIC) && + ((waypoints[index].flags & W_FL_TEAM) != team)) + continue; + + if ((waypoints[index].flags & flags) != flags) + continue; // skip this waypoint if the flags don't match + + distance = WaypointDistanceFromTo(src, index, team); + + if (distance < min_distance) + { + min_index = index; + min_distance = distance; + } + } + + return min_index; +} + + +// find the goal nearest to the source position (v_src) matching the "flags" +// bits and return the index of that waypoint... +int WaypointFindNearestGoal(Vector v_src, edict_t *pEntity, float range, int team, int flags) +{ + int index, min_index; + int distance, min_distance; + + if (num_waypoints < 1) + return -1; + + // find the nearest waypoint with the matching flags... + + min_index = -1; + min_distance = 99999; + + for (index=0; index < num_waypoints; index++) + { + if (waypoints[index].flags & W_FL_DELETED) + continue; // skip any deleted waypoints + + if (waypoints[index].flags & W_FL_AIMING) + continue; // skip any aiming waypoints + + // skip this waypoint if it's team specific and teams don't match... + if ((team != -1) && (waypoints[index].flags & W_FL_TEAM_SPECIFIC) && + ((waypoints[index].flags & W_FL_TEAM) != team)) + continue; + + if ((waypoints[index].flags & flags) != flags) + continue; // skip this waypoint if the flags don't match + + distance = (waypoints[index].origin - v_src).Length(); + + if ((distance < range) && (distance < min_distance)) + { + min_index = index; + min_distance = distance; + } + } + + return min_index; +} + + +// find a random goal matching the "flags" bits and return the index of +// that waypoint... +int WaypointFindRandomGoal(edict_t *pEntity, int team, int flags) +{ + int index; + int indexes[50]; + int count = 0; + + if (num_waypoints < 1) + return -1; + + // find all the waypoints with the matching flags... + + for (index=0; index < num_waypoints; index++) + { + if (waypoints[index].flags & W_FL_DELETED) + continue; // skip any deleted waypoints + + if (waypoints[index].flags & W_FL_AIMING) + continue; // skip any aiming waypoints + + // skip this waypoint if it's team specific and teams don't match... + if ((team != -1) && (waypoints[index].flags & W_FL_TEAM_SPECIFIC) && + ((waypoints[index].flags & W_FL_TEAM) != team)) + continue; + + if ((waypoints[index].flags & flags) != flags) + continue; // skip this waypoint if the flags don't match + + if (count < 50) + { + indexes[count] = index; + + count++; + } + } + + if (count == 0) // no matching waypoints found + return -1; + + index = RANDOM_LONG(1, count) - 1; + + return indexes[index]; +} + + +// find a random goal within a range of a position (v_src) matching the +// "flags" bits and return the index of that waypoint... +int WaypointFindRandomGoal(Vector v_src, edict_t *pEntity, float range, int team, int flags) +{ + int index; + int indexes[50]; + int count = 0; + float distance; + + if (num_waypoints < 1) + return -1; + + // find all the waypoints with the matching flags... + + for (index=0; index < num_waypoints; index++) + { + if (waypoints[index].flags & W_FL_DELETED) + continue; // skip any deleted waypoints + + if (waypoints[index].flags & W_FL_AIMING) + continue; // skip any aiming waypoints + + // skip this waypoint if it's team specific and teams don't match... + if ((team != -1) && (waypoints[index].flags & W_FL_TEAM_SPECIFIC) && + ((waypoints[index].flags & W_FL_TEAM) != team)) + continue; + + if ((waypoints[index].flags & flags) != flags) + continue; // skip this waypoint if the flags don't match + + distance = (waypoints[index].origin - v_src).Length(); + + if ((distance < range) && (count < 50)) + { + indexes[count] = index; + + count++; + } + } + + if (count == 0) // no matching waypoints found + return -1; + + index = RANDOM_LONG(1, count) - 1; + + return indexes[index]; +} + + +// find the nearest "special" aiming waypoint (for sniper aiming)... +int WaypointFindNearestAiming(Vector v_origin) +{ + int index; + int min_index = -1; + int min_distance = 9999.0; + float distance; + + if (num_waypoints < 1) + return -1; + + // search for nearby aiming waypoint... + for (index=0; index < num_waypoints; index++) + { + if (waypoints[index].flags & W_FL_DELETED) + continue; // skip any deleted waypoints + + if ((waypoints[index].flags & W_FL_AIMING) == 0) + continue; // skip any NON aiming waypoints + + distance = (v_origin - waypoints[index].origin).Length(); + + if ((distance < min_distance) && (distance < 40)) + { + min_index = index; + min_distance = distance; + } + } + + return min_index; +} + + +void WaypointDrawBeam(edict_t *pEntity, Vector start, Vector end, int width, + int noise, int red, int green, int blue, int brightness, int speed) +{ +// MESSAGE_BEGIN(MSG_ONE, SVC_TEMPENTITY, NULL, pEntity); +// WRITE_BYTE( TE_BEAMPOINTS); +// WRITE_COORD(start.x); +// WRITE_COORD(start.y); +// WRITE_COORD(start.z); +// WRITE_COORD(end.x); +// WRITE_COORD(end.y); +// WRITE_COORD(end.z); +// WRITE_SHORT( m_spriteTexture ); +// WRITE_BYTE( 1 ); // framestart +// WRITE_BYTE( 10 ); // framerate +// WRITE_BYTE( 10 ); // life in 0.1's +// WRITE_BYTE( width ); // width +// WRITE_BYTE( noise ); // noise +// +// WRITE_BYTE( red ); // r, g, b +// WRITE_BYTE( green ); // r, g, b +// WRITE_BYTE( blue ); // r, g, b +// +// WRITE_BYTE( brightness ); // brightness +// WRITE_BYTE( speed ); // speed +// MESSAGE_END(); +} + + +void WaypointAdd(edict_t *pEntity) +{ + int index; + edict_t *pent = NULL; + float radius = 40; + char item_name[64]; + + if (num_waypoints >= MAX_WAYPOINTS) + return; + + index = 0; + + // find the next available slot for the new waypoint... + while (index < num_waypoints) + { + if (waypoints[index].flags & W_FL_DELETED) + break; + + index++; + } + + waypoints[index].flags = 0; + + // store the origin (location) of this waypoint (use entity origin) + waypoints[index].origin = pEntity->v.origin; + + // store the last used waypoint for the auto waypoint code... + last_waypoint = pEntity->v.origin; + + // set the time that this waypoint was originally displayed... + wp_display_time[index] = gpGlobals->time; + + + Vector start, end; + + start = pEntity->v.origin - Vector(0, 0, 34); + end = start + Vector(0, 0, 68); + + if ((pEntity->v.flags & FL_DUCKING) == FL_DUCKING) + { + waypoints[index].flags |= W_FL_CROUCH; // crouching waypoint + + start = pEntity->v.origin - Vector(0, 0, 17); + end = start + Vector(0, 0, 34); + } + + if (pEntity->v.movetype == MOVETYPE_FLY) + waypoints[index].flags |= W_FL_LADDER; // waypoint on a ladder + + + //******************************************************** + // look for lift, ammo, flag, health, armor, etc. + //******************************************************** + + while ((pent = UTIL_FindEntityInSphere( pent, pEntity->v.origin, radius )) != NULL) + { + strcpy(item_name, STRING(pent->v.classname)); + + if (strcmp("item_healthkit", item_name) == 0) + { + ClientPrint(pEntity, HUD_PRINTCONSOLE, "found a healthkit!\n"); + waypoints[index].flags = W_FL_HEALTH; + } + + if (strncmp("item_armor", item_name, 10) == 0) + { + ClientPrint(pEntity, HUD_PRINTCONSOLE, "found some armor!\n"); + waypoints[index].flags = W_FL_ARMOR; + } + + // ************* + // LOOK FOR AMMO + // ************* + + } + + // draw a blue waypoint + WaypointDrawBeam(pEntity, start, end, 30, 0, 0, 0, 255, 250, 5); + + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "weapons/xbow_hit1.wav", 1.0, + ATTN_NORM, 0, 100); + + // increment total number of waypoints if adding at end of array... + if (index == num_waypoints) + num_waypoints++; + + // calculate all the paths to this new waypoint + for (int i=0; i < num_waypoints; i++) + { + if (i == index) + continue; // skip the waypoint that was just added + + if (waypoints[i].flags & W_FL_AIMING) + continue; // skip any aiming waypoints + + // check if the waypoint is reachable from the new one (one-way) + if ( WaypointReachable(pEntity->v.origin, waypoints[i].origin, pEntity) ) + { + WaypointAddPath(index, i); + } + + // check if the new one is reachable from the waypoint (other way) + if ( WaypointReachable(waypoints[i].origin, pEntity->v.origin, pEntity) ) + { + WaypointAddPath(i, index); + } + } +} + + +void WaypointAddAiming(edict_t *pEntity) +{ + int index; + edict_t *pent = NULL; + + if (num_waypoints >= MAX_WAYPOINTS) + return; + + index = 0; + + // find the next available slot for the new waypoint... + while (index < num_waypoints) + { + if (waypoints[index].flags & W_FL_DELETED) + break; + + index++; + } + + waypoints[index].flags = W_FL_AIMING; // aiming waypoint + + Vector v_angle = pEntity->v.v_angle; + + v_angle.x = 0; // reset pitch to horizontal + v_angle.z = 0; // reset roll to level + + UTIL_MakeVectors(v_angle); + + // store the origin (location) of this waypoint (use entity origin) + waypoints[index].origin = pEntity->v.origin + gpGlobals->v_forward * 25; + + // set the time that this waypoint was originally displayed... + wp_display_time[index] = gpGlobals->time; + + + Vector start, end; + + start = pEntity->v.origin - Vector(0, 0, 10); + end = start + Vector(0, 0, 14); + + // draw a blue waypoint + WaypointDrawBeam(pEntity, start, end, 30, 0, 0, 0, 255, 250, 5); + + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "weapons/xbow_hit1.wav", 1.0, + ATTN_NORM, 0, 100); + + // increment total number of waypoints if adding at end of array... + if (index == num_waypoints) + num_waypoints++; +} + + +void WaypointDelete(edict_t *pEntity) +{ + int index; + int count = 0; + + if (num_waypoints < 1) + return; + + index = WaypointFindNearest(pEntity, 50.0, -1); + + if (index == -1) + return; + + if ((waypoints[index].flags & W_FL_SNIPER) || + ((mod_id == FRONTLINE_DLL) && (waypoints[index].flags & W_FL_FLF_DEFEND))) + { + int i; + int min_index = -1; + int min_distance = 9999.0; + float distance; + + // search for nearby aiming waypoint and delete it also... + for (i=0; i < num_waypoints; i++) + { + if (waypoints[i].flags & W_FL_DELETED) + continue; // skip any deleted waypoints + + if ((waypoints[i].flags & W_FL_AIMING) == 0) + continue; // skip any NON aiming waypoints + + distance = (waypoints[i].origin - waypoints[index].origin).Length(); + + if ((distance < min_distance) && (distance < 40)) + { + min_index = i; + min_distance = distance; + } + } + + if (min_index != -1) + { + waypoints[min_index].flags = W_FL_DELETED; // not being used + waypoints[min_index].origin = Vector(0,0,0); + + wp_display_time[min_index] = 0.0; + } + } + + // delete any paths that lead to this index... + WaypointDeletePath(index); + + // free the path for this index... + + if (paths[index] != NULL) + { + PATH *p = paths[index]; + PATH *p_next; + + while (p) // free the linked list + { + p_next = p->next; // save the link to next + free(p); + p = p_next; + +#ifdef _DEBUG + count++; + if (count > 100) WaypointDebug(); +#endif + } + + paths[index] = NULL; + } + + waypoints[index].flags = W_FL_DELETED; // not being used + waypoints[index].origin = Vector(0,0,0); + + wp_display_time[index] = 0.0; + + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "weapons/mine_activate.wav", 1.0, + ATTN_NORM, 0, 100); +} + + +// allow player to manually create a path from one waypoint to another +void WaypointCreatePath(edict_t *pEntity, int cmd) +{ + static int waypoint1 = -1; // initialized to unassigned + static int waypoint2 = -1; // initialized to unassigned + + if (cmd == 1) // assign source of path + { + waypoint1 = WaypointFindNearest(pEntity, 50.0, -1); + + if (waypoint1 == -1) + { + // play "cancelled" sound... + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "common/wpn_moveselect.wav", 1.0, + ATTN_NORM, 0, 100); + + return; + } + + // play "start" sound... + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "common/wpn_hudoff.wav", 1.0, + ATTN_NORM, 0, 100); + + return; + } + + if (cmd == 2) // assign dest of path and make path + { + waypoint2 = WaypointFindNearest(pEntity, 50.0, -1); + + if ((waypoint1 == -1) || (waypoint2 == -1)) + { + // play "error" sound... + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "common/wpn_denyselect.wav", 1.0, + ATTN_NORM, 0, 100); + + return; + } + + WaypointAddPath(waypoint1, waypoint2); + + // play "done" sound... + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "common/wpn_hudon.wav", 1.0, + ATTN_NORM, 0, 100); + } +} + + +// allow player to manually remove a path from one waypoint to another +void WaypointRemovePath(edict_t *pEntity, int cmd) +{ + static int waypoint1 = -1; // initialized to unassigned + static int waypoint2 = -1; // initialized to unassigned + + if (cmd == 1) // assign source of path + { + waypoint1 = WaypointFindNearest(pEntity, 50.0, -1); + + if (waypoint1 == -1) + { + // play "cancelled" sound... + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "common/wpn_moveselect.wav", 1.0, + ATTN_NORM, 0, 100); + + return; + } + + // play "start" sound... + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "common/wpn_hudoff.wav", 1.0, + ATTN_NORM, 0, 100); + + return; + } + + if (cmd == 2) // assign dest of path and make path + { + waypoint2 = WaypointFindNearest(pEntity, 50.0, -1); + + if ((waypoint1 == -1) || (waypoint2 == -1)) + { + // play "error" sound... + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "common/wpn_denyselect.wav", 1.0, + ATTN_NORM, 0, 100); + + return; + } + + WaypointDeletePath(waypoint1, waypoint2); + + // play "done" sound... + EMIT_SOUND_DYN2(pEntity, CHAN_WEAPON, "common/wpn_hudon.wav", 1.0, + ATTN_NORM, 0, 100); + } +} + + +bool WaypointLoad(edict_t *pEntity) +{ + char mapname[64]; + char filename[256]; + WAYPOINT_HDR header; + char msg[80]; + int index, i; + short int num; + short int path_index; + + strcpy(mapname, STRING(gpGlobals->mapname)); + strcat(mapname, ".wpt"); + + UTIL_BuildFileName(filename, "maps", mapname); + + if (IS_DEDICATED_SERVER()) + printf("loading waypoint file: %s\n", filename); + + FILE *bfp = fopen(filename, "rb"); + + // if file exists, read the waypoint structure from it + if (bfp != NULL) + { + fread(&header, sizeof(header), 1, bfp); + + header.filetype[7] = 0; + if (strcmp(header.filetype, "HPB_bot") == 0) + { + if (header.waypoint_file_version != WAYPOINT_VERSION) + { + if (pEntity) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "Incompatible HPB bot waypoint file version!\nWaypoints not loaded!\n"); + + fclose(bfp); + return FALSE; + } + + header.mapname[31] = 0; + + if (strcmp(header.mapname, STRING(gpGlobals->mapname)) == 0) + { + WaypointInit(); // remove any existing waypoints + + for (i=0; i < header.number_of_waypoints; i++) + { + fread(&waypoints[i], sizeof(waypoints[0]), 1, bfp); + num_waypoints++; + } + + // read and add waypoint paths... + for (index=0; index < num_waypoints; index++) + { + // read the number of paths from this node... + fread(&num, sizeof(num), 1, bfp); + + for (i=0; i < num; i++) + { + fread(&path_index, sizeof(path_index), 1, bfp); + + WaypointAddPath(index, path_index); + } + } + + g_waypoint_paths = TRUE; // keep track so path can be freed + } + else + { + if (pEntity) + { + sprintf(msg, "%s HPB bot waypoints are not for this map!\n", filename); + ClientPrint(pEntity, HUD_PRINTNOTIFY, msg); + } + + fclose(bfp); + return FALSE; + } + } + else + { + if (pEntity) + { + sprintf(msg, "%s is not a HPB bot waypoint file!\n", filename); + ClientPrint(pEntity, HUD_PRINTNOTIFY, msg); + } + + fclose(bfp); + return FALSE; + } + + fclose(bfp); + + WaypointRouteInit(); + } + else + { + if (pEntity) + { + sprintf(msg, "Waypoint file %s does not exist!\n", filename); + ClientPrint(pEntity, HUD_PRINTNOTIFY, msg); + } + + if (IS_DEDICATED_SERVER()) + printf("waypoint file %s not found!\n", filename); + + return FALSE; + } + + return TRUE; +} + + +void WaypointSave(void) +{ + char filename[256]; + char mapname[64]; + WAYPOINT_HDR header; + int index, i; + short int num; + PATH *p; + + strcpy(header.filetype, "HPB_bot"); + + header.waypoint_file_version = WAYPOINT_VERSION; + + header.waypoint_file_flags = 0; // not currently used + + header.number_of_waypoints = num_waypoints; + + memset(header.mapname, 0, sizeof(header.mapname)); + strncpy(header.mapname, STRING(gpGlobals->mapname), 31); + header.mapname[31] = 0; + + strcpy(mapname, STRING(gpGlobals->mapname)); + strcat(mapname, ".wpt"); + + UTIL_BuildFileName(filename, "maps", mapname); + + FILE *bfp = fopen(filename, "wb"); + + // write the waypoint header to the file... + fwrite(&header, sizeof(header), 1, bfp); + + // write the waypoint data to the file... + for (index=0; index < num_waypoints; index++) + { + fwrite(&waypoints[index], sizeof(waypoints[0]), 1, bfp); + } + + // save the waypoint paths... + for (index=0; index < num_waypoints; index++) + { + // count the number of paths from this node... + + p = paths[index]; + num = 0; + + while (p != NULL) + { + i = 0; + + while (i < MAX_PATH_INDEX) + { + if (p->index[i] != -1) + num++; // count path node if it's used + + i++; + } + + p = p->next; // go to next node in linked list + } + + fwrite(&num, sizeof(num), 1, bfp); // write the count + + // now write out each path index... + + p = paths[index]; + + while (p != NULL) + { + i = 0; + + while (i < MAX_PATH_INDEX) + { + if (p->index[i] != -1) // save path node if it's used + fwrite(&p->index[i], sizeof(p->index[0]), 1, bfp); + + i++; + } + + p = p->next; // go to next node in linked list + } + } + + fclose(bfp); +} + + +bool WaypointReachable(Vector v_src, Vector v_dest, edict_t *pEntity) +{ + TraceResult tr; + float curr_height, last_height; + + float distance = (v_dest - v_src).Length(); + + // is the destination close enough? + if (distance < REACHABLE_RANGE) + { + // check if this waypoint is "visible"... + + UTIL_TraceLine( v_src, v_dest, ignore_monsters, + pEntity->v.pContainingEntity, &tr ); + + // if waypoint is visible from current position (even behind head)... + if (tr.flFraction >= 1.0) + { + // check for special case of both waypoints being underwater... + if ((POINT_CONTENTS( v_src ) == CONTENTS_WATER) && + (POINT_CONTENTS( v_dest ) == CONTENTS_WATER)) + { + return TRUE; + } + + // check for special case of waypoint being suspended in mid-air... + + // is dest waypoint higher than src? (45 is max jump height) + if (v_dest.z > (v_src.z + 45.0)) + { + Vector v_new_src = v_dest; + Vector v_new_dest = v_dest; + + v_new_dest.z = v_new_dest.z - 50; // straight down 50 units + + UTIL_TraceLine(v_new_src, v_new_dest, dont_ignore_monsters, + pEntity->v.pContainingEntity, &tr); + + // check if we didn't hit anything, if not then it's in mid-air + if (tr.flFraction >= 1.0) + { + return FALSE; // can't reach this one + } + } + + // check if distance to ground increases more than jump height + // at points between source and destination... + + Vector v_direction = (v_dest - v_src).Normalize(); // 1 unit long + Vector v_check = v_src; + Vector v_down = v_src; + + v_down.z = v_down.z - 1000.0; // straight down 1000 units + + UTIL_TraceLine(v_check, v_down, ignore_monsters, + pEntity->v.pContainingEntity, &tr); + + last_height = tr.flFraction * 1000.0; // height from ground + + distance = (v_dest - v_check).Length(); // distance from goal + + while (distance > 10.0) + { + // move 10 units closer to the goal... + v_check = v_check + (v_direction * 10.0); + + v_down = v_check; + v_down.z = v_down.z - 1000.0; // straight down 1000 units + + UTIL_TraceLine(v_check, v_down, ignore_monsters, + pEntity->v.pContainingEntity, &tr); + + curr_height = tr.flFraction * 1000.0; // height from ground + + // is the difference in the last height and the current height + // higher that the jump height? + if ((last_height - curr_height) > 45.0) + { + // can't get there from here... + return FALSE; + } + + last_height = curr_height; + + distance = (v_dest - v_check).Length(); // distance from goal + } + + return TRUE; + } + } + + return FALSE; +} + + +// find the nearest reachable waypoint +int WaypointFindReachable(edict_t *pEntity, float range, int team) +{ + int i, min_index; + float distance; + float min_distance; + TraceResult tr; + + // find the nearest waypoint... + + min_distance = 9999.0; + + for (i=0; i < num_waypoints; i++) + { + if (waypoints[i].flags & W_FL_DELETED) + continue; // skip any deleted waypoints + + if (waypoints[i].flags & W_FL_AIMING) + continue; // skip any aiming waypoints + + // skip this waypoint if it's team specific and teams don't match... + if ((team != -1) && (waypoints[i].flags & W_FL_TEAM_SPECIFIC) && + ((waypoints[i].flags & W_FL_TEAM) != team)) + continue; + + distance = (waypoints[i].origin - pEntity->v.origin).Length(); + + if (distance < min_distance) + { + // if waypoint is visible from current position (even behind head)... + UTIL_TraceLine( pEntity->v.origin + pEntity->v.view_ofs, waypoints[i].origin, + ignore_monsters, pEntity->v.pContainingEntity, &tr ); + + if (tr.flFraction >= 1.0) + { + if (WaypointReachable(pEntity->v.origin, waypoints[i].origin, pEntity)) + { + min_index = i; + min_distance = distance; + } + } + } + } + + // if not close enough to a waypoint then just return + if (min_distance > range) + return -1; + + return min_index; + +} + + +void WaypointPrintInfo(edict_t *pEntity) +{ + char msg[80]; + int index; + int flags; + + // find the nearest waypoint... + index = WaypointFindNearest(pEntity, 50.0, -1); + + if (index == -1) + return; + + sprintf(msg,"Waypoint %d of %d total\n", index, num_waypoints); + ClientPrint(pEntity, HUD_PRINTNOTIFY, msg); + + flags = waypoints[index].flags; + + if (flags & W_FL_TEAM_SPECIFIC) + { + if (mod_id == FRONTLINE_DLL) + { + if ((flags & W_FL_TEAM) == 0) + strcpy(msg, "Waypoint is for Attackers\n"); + else if ((flags & W_FL_TEAM) == 1) + strcpy(msg, "Waypoint is for Defenders\n"); + } + else + { + if ((flags & W_FL_TEAM) == 0) + strcpy(msg, "Waypoint is for TEAM 1\n"); + else if ((flags & W_FL_TEAM) == 1) + strcpy(msg, "Waypoint is for TEAM 2\n"); + else if ((flags & W_FL_TEAM) == 2) + strcpy(msg, "Waypoint is for TEAM 3\n"); + else if ((flags & W_FL_TEAM) == 3) + strcpy(msg, "Waypoint is for TEAM 4\n"); + } + + ClientPrint(pEntity, HUD_PRINTNOTIFY, msg); + } + + if (flags & W_FL_LIFT) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "Bot will wait for lift before approaching\n"); + + if (flags & W_FL_LADDER) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "This waypoint is on a ladder\n"); + + if (flags & W_FL_DOOR) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "This is a door waypoint\n"); + + if (flags & W_FL_HEALTH) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "There is health near this waypoint\n"); + + if (flags & W_FL_ARMOR) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "There is armor near this waypoint\n"); + + if (flags & W_FL_AMMO) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "There is ammo near this waypoint\n"); + + if (flags & W_FL_SNIPER) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "This is a sniper waypoint\n"); + + if (flags & W_FL_TFC_FLAG) + { + if (mod_id == FRONTLINE_DLL) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "There is a capture point near this waypoint\n"); + else + ClientPrint(pEntity, HUD_PRINTNOTIFY, "There is a flag near this waypoint\n"); + } + + if (flags & W_FL_TFC_FLAG_GOAL) + { + if (mod_id == FRONTLINE_DLL) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "This is a defender location\n"); + else + ClientPrint(pEntity, HUD_PRINTNOTIFY, "There is a flag goal near this waypoint\n"); + } + + if (flags & W_FL_PRONE) + ClientPrint(pEntity, HUD_PRINTNOTIFY, "Bot will go prone here\n"); +} + + +void WaypointThink(edict_t *pEntity) +{ + float distance, min_distance; + Vector start, end; + int i, index; + + if (g_auto_waypoint) // is auto waypoint on? + { + // find the distance from the last used waypoint + distance = (last_waypoint - pEntity->v.origin).Length(); + + if (distance > 200) + { + min_distance = 9999.0; + + // check that no other reachable waypoints are nearby... + for (i=0; i < num_waypoints; i++) + { + if (waypoints[i].flags & W_FL_DELETED) + continue; + + if (waypoints[i].flags & W_FL_AIMING) + continue; + + if (WaypointReachable(pEntity->v.origin, waypoints[i].origin, pEntity)) + { + distance = (waypoints[i].origin - pEntity->v.origin).Length(); + + if (distance < min_distance) + min_distance = distance; + } + } + + // make sure nearest waypoint is far enough away... + if (min_distance >= 200) + WaypointAdd(pEntity); // place a waypoint here + } + } + + min_distance = 9999.0; + + if (g_waypoint_on) // display the waypoints if turned on... + { + for (i=0; i < num_waypoints; i++) + { + if ((waypoints[i].flags & W_FL_DELETED) == W_FL_DELETED) + continue; + + distance = (waypoints[i].origin - pEntity->v.origin).Length(); + + if (distance < 500) + { + if (distance < min_distance) + { + index = i; // store index of nearest waypoint + min_distance = distance; + } + + if ((wp_display_time[i] + 1.0) < gpGlobals->time) + { + if (waypoints[i].flags & W_FL_CROUCH) + { + start = waypoints[i].origin - Vector(0, 0, 17); + end = start + Vector(0, 0, 34); + } + else if (waypoints[i].flags & W_FL_AIMING) + { + start = waypoints[i].origin + Vector(0, 0, 10); + end = start + Vector(0, 0, 14); + } + else + { + start = waypoints[i].origin - Vector(0, 0, 34); + end = start + Vector(0, 0, 68); + } + + // draw a blue waypoint + WaypointDrawBeam(pEntity, start, end, 30, 0, 0, 0, 255, 250, 5); + + wp_display_time[i] = gpGlobals->time; + } + } + } + + // check if path waypointing is on... + if (g_path_waypoint) + { + // check if player is close enough to a waypoint and time to draw path... + if ((min_distance <= 50) && (f_path_time <= gpGlobals->time)) + { + PATH *p; + + f_path_time = gpGlobals->time + 1.0; + + p = paths[index]; + + while (p != NULL) + { + i = 0; + + while (i < MAX_PATH_INDEX) + { + if (p->index[i] != -1) + { + Vector v_src = waypoints[index].origin; + Vector v_dest = waypoints[p->index[i]].origin; + + // draw a white line to this index's waypoint + WaypointDrawBeam(pEntity, v_src, v_dest, 10, 2, 250, 250, 250, 200, 10); + } + + i++; + } + + p = p->next; // go to next node in linked list + } + } + } + } +} + + +// run Floyd's algorithm on the waypoint list to generate the least cost +// path matrix... +void WaypointFloyds(unsigned short *shortest_path, unsigned short *from_to) +{ + unsigned int x, y, z; + int changed = 1; + int distance; + + for (y=0; y < route_num_waypoints; y++) + { + for (z=0; z < route_num_waypoints; z++) + { + from_to[y * route_num_waypoints + z] = z; + } + } + + while (changed) + { + changed = 0; + + for (x=0; x < route_num_waypoints; x++) + { + for (y=0; y < route_num_waypoints; y++) + { + for (z=0; z < route_num_waypoints; z++) + { + if ((shortest_path[y * route_num_waypoints + x] == WAYPOINT_UNREACHABLE) || + (shortest_path[x * route_num_waypoints + z] == WAYPOINT_UNREACHABLE)) + continue; + + distance = shortest_path[y * route_num_waypoints + x] + + shortest_path[x * route_num_waypoints + z]; + + if (distance > WAYPOINT_MAX_DISTANCE) + distance = WAYPOINT_MAX_DISTANCE; + + if ((distance < shortest_path[y * route_num_waypoints + z]) || + (shortest_path[y * route_num_waypoints + z] == WAYPOINT_UNREACHABLE)) + { + shortest_path[y * route_num_waypoints + z] = distance; + from_to[y * route_num_waypoints + z] = from_to[y * route_num_waypoints + x]; + changed = 1; + } + } + } + } + } +} + + +// load the waypoint route files (.wp1, .wp2, etc.) or generate them if +// they don't exist... +void WaypointRouteInit(void) +{ + unsigned int index; + bool build_matrix[4]; + int matrix; + unsigned int array_size; + unsigned int row; + int i, offset; + unsigned int a, b; + float distance; + unsigned short *pShortestPath, *pFromTo; + char msg[80]; + unsigned int num_items; + FILE *bfp; + char filename[256]; + char filename2[256]; + char mapname[64]; + + if (num_waypoints == 0) + return; + + // save number of current waypoints in case waypoints get added later + route_num_waypoints = num_waypoints; + + strcpy(mapname, STRING(gpGlobals->mapname)); + strcat(mapname, ".wpt"); + + UTIL_BuildFileName(filename, "maps", mapname); + + build_matrix[0] = TRUE; // always build matrix 0 (non-team and team 1) + build_matrix[1] = FALSE; + build_matrix[2] = FALSE; + build_matrix[3] = FALSE; + + // find out how many route matrixes to create... + for (index=0; index < route_num_waypoints; index++) + { + if (waypoints[index].flags & W_FL_TEAM_SPECIFIC) + { + if ((waypoints[index].flags & W_FL_TEAM) == 0x01) // team 2? + build_matrix[1] = TRUE; + + if ((waypoints[index].flags & W_FL_TEAM) == 0x02) // team 3? + build_matrix[2] = TRUE; + + if ((waypoints[index].flags & W_FL_TEAM) == 0x03) // team 4? + build_matrix[3] = TRUE; + } + } + + array_size = route_num_waypoints * route_num_waypoints; + + for (matrix=0; matrix < 4; matrix++) + { + if (build_matrix[matrix]) + { + char ext_str[5]; // ".wpX\0" + int file1, file2; + struct stat stat1, stat2; + + sprintf(ext_str, ".wp%d", matrix+1); + + strcpy(mapname, STRING(gpGlobals->mapname)); + strcat(mapname, ext_str); + + UTIL_BuildFileName(filename2, "maps", mapname); + + if (access(filename2, 0) == 0) // does the .wpX file exist? + { + file1 = open(filename, O_RDONLY); + file2 = open(filename2, O_RDONLY); + + fstat(file1, &stat1); + fstat(file2, &stat2); + + close(file1); + close(file2); + + if (stat1.st_mtime < stat2.st_mtime) // is .wpt older than .wpX file? + { + sprintf(msg, "loading HPB bot waypoint paths for team %d\n", matrix+1); + ALERT(at_console, msg); + + shortest_path[matrix] = (unsigned short *)malloc(sizeof(unsigned short) * array_size); + + if (shortest_path[matrix] == NULL) + ALERT(at_error, "HPB_bot - Error allocating memory for shortest path!"); + + from_to[matrix] = (unsigned short *)malloc(sizeof(unsigned short) * array_size); + + if (from_to[matrix] == NULL) + ALERT(at_error, "HPB_bot - Error allocating memory for from to matrix!"); + + bfp = fopen(filename2, "rb"); + + if (bfp != NULL) + { + num_items = fread(shortest_path[matrix], sizeof(unsigned short), array_size, bfp); + + if (num_items != array_size) + { + // if couldn't read enough data, free memory to recalculate it + + ALERT(at_console, "error reading enough path items, recalculating...\n"); + + free(shortest_path[matrix]); + shortest_path[matrix] = NULL; + + free(from_to[matrix]); + from_to[matrix] = NULL; + } + else + { + num_items = fread(from_to[matrix], sizeof(unsigned short), array_size, bfp); + + if (num_items != array_size) + { + // if couldn't read enough data, free memory to recalculate it + + ALERT(at_console, "error reading enough path items, recalculating...\n"); + + free(shortest_path[matrix]); + shortest_path[matrix] = NULL; + + free(from_to[matrix]); + from_to[matrix] = NULL; + } + } + } + else + { + ALERT(at_console, "HPB_bot - Error reading waypoint paths!\n"); + + free(shortest_path[matrix]); + shortest_path[matrix] = NULL; + + free(from_to[matrix]); + from_to[matrix] = NULL; + } + + fclose(bfp); + } + } + + if (shortest_path[matrix] == NULL) + { + sprintf(msg, "calculating HPB bot waypoint paths for team %d...\n", matrix+1); + ALERT(at_console, msg); + + shortest_path[matrix] = (unsigned short *)malloc(sizeof(unsigned short) * array_size); + + if (shortest_path[matrix] == NULL) + ALERT(at_error, "HPB_bot - Error allocating memory for shortest path!"); + + from_to[matrix] = (unsigned short *)malloc(sizeof(unsigned short) * array_size); + + if (from_to[matrix] == NULL) + ALERT(at_error, "HPB_bot - Error allocating memory for from to matrix!"); + + pShortestPath = shortest_path[matrix]; + pFromTo = from_to[matrix]; + + for (index=0; index < array_size; index++) + pShortestPath[index] = WAYPOINT_UNREACHABLE; + + for (index=0; index < route_num_waypoints; index++) + pShortestPath[index * route_num_waypoints + index] = 0; // zero diagonal + + for (row=0; row < route_num_waypoints; row++) + { + if (paths[row] != NULL) + { + PATH *p = paths[row]; + + while (p) + { + i = 0; + + while (i < MAX_PATH_INDEX) + { + if (p->index[i] != -1) + { + index = p->index[i]; + + // check if this is NOT team specific OR matches this team + if (!(waypoints[index].flags & W_FL_TEAM_SPECIFIC) || + ((waypoints[index].flags & W_FL_TEAM) == matrix)) + { + distance = (waypoints[row].origin - waypoints[index].origin).Length(); + + if (distance > (float)WAYPOINT_MAX_DISTANCE) + distance = (float)WAYPOINT_MAX_DISTANCE; + + if (distance > REACHABLE_RANGE) + { + sprintf(msg, "Waypoint path distance > %4.1f at from %d to %d\n", + REACHABLE_RANGE, row, index); + ALERT(at_console, msg); + } + else + { + offset = row * route_num_waypoints + index; + + pShortestPath[offset] = (unsigned short)distance; + } + } + } + + i++; + } + + p = p->next; // go to next node in linked list + } + } + } + + // run Floyd's Algorithm to generate the from_to matrix... + WaypointFloyds(pShortestPath, pFromTo); + + for (a=0; a < route_num_waypoints; a++) + { + for (b=0; b < route_num_waypoints; b++) + if (pShortestPath[a * route_num_waypoints + b] == WAYPOINT_UNREACHABLE) + pFromTo[a * route_num_waypoints + b] = WAYPOINT_UNREACHABLE; + } + + bfp = fopen(filename2, "wb"); + + if (bfp != NULL) + { + num_items = fwrite(shortest_path[matrix], sizeof(unsigned short), array_size, bfp); + + if (num_items != array_size) + { + // if couldn't write enough data, close file and delete it + + fclose(bfp); + unlink(filename2); + } + else + { + num_items = fwrite(from_to[matrix], sizeof(unsigned short), array_size, bfp); + + fclose(bfp); + + if (num_items != array_size) + { + // if couldn't write enough data, delete file + unlink(filename2); + } + } + } + else + { + ALERT(at_console, "HPB_bot - Error writing waypoint paths!\n"); + } + + sprintf(msg, "HPB bot waypoint path calculations for team %d complete!\n",matrix+1); + ALERT(at_console, msg); + } + } + } + +} + + +// return the next waypoint index for a path from the Floyd matrix when +// going from a source waypoint index (src) to a destination waypoint +// index (dest)... +unsigned short WaypointRouteFromTo(int src, int dest, int team) +{ + unsigned short *pFromTo; + + if ((team < -1) || (team > 3)) + return -1; + + if (team == -1) // -1 means non-team play + team = 0; + + if (from_to[team] == NULL) // if no team specific waypoints use team 0 + team = 0; + + if (from_to[team] == NULL) // if no route information just return + return -1; + + pFromTo = from_to[team]; + + return pFromTo[src * route_num_waypoints + dest]; +} + + +// return the total distance (based on the Floyd matrix) of a path from +// the source waypoint index (src) to the destination waypoint index +// (dest)... +int WaypointDistanceFromTo(int src, int dest, int team) +{ + unsigned short *pShortestPath; + + if ((team < -1) || (team > 3)) + return -1; + + if (team == -1) // -1 means non-team play + team = 0; + + if (from_to[team] == NULL) // if no team specific waypoints use team 0 + team = 0; + + if (from_to[team] == NULL) // if no route information just return + return -1; + + pShortestPath = shortest_path[team]; + + return (int)(pShortestPath[src * route_num_waypoints + dest]); +} + diff --git a/main/source/HPB_bot/dlls/waypoint.h b/main/source/HPB_bot/dlls/waypoint.h new file mode 100644 index 00000000..dc84707c --- /dev/null +++ b/main/source/HPB_bot/dlls/waypoint.h @@ -0,0 +1,104 @@ +// +// HPB_bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// waypoint.h +// + +#ifndef WAYPOINT_H +#define WAYPOINT_H + +#include + +#define MAX_WAYPOINTS 1024 + +#define REACHABLE_RANGE 400.0 + +// defines for waypoint flags field (32 bits are available) +#define W_FL_TEAM ((1<<0) + (1<<1)) /* allow for 4 teams (0-3) */ +#define W_FL_TEAM_SPECIFIC (1<<2) /* waypoint only for specified team */ +#define W_FL_CROUCH (1<<3) /* must crouch to reach this waypoint */ +#define W_FL_LADDER (1<<4) /* waypoint on a ladder */ +#define W_FL_LIFT (1<<5) /* wait for lift to be down before approaching this waypoint */ +#define W_FL_DOOR (1<<6) /* wait for door to open */ +#define W_FL_HEALTH (1<<7) /* health kit (or wall mounted) location */ +#define W_FL_ARMOR (1<<8) /* armor (or HEV) location */ +#define W_FL_AMMO (1<<9) /* ammo location */ +#define W_FL_SNIPER (1<<10) /* sniper waypoint (a good sniper spot) */ + +#define W_FL_TFC_FLAG (1<<11) /* flag position (or hostage or president) */ +#define W_FL_FLF_CAP (1<<11) /* Front Line Force capture point */ + +#define W_FL_TFC_FLAG_GOAL (1<<12) /* flag return position (or rescue zone) */ +#define W_FL_FLF_DEFEND (1<<12) /* Front Line Force defend point */ + +#define W_FL_PRONE (1<<13) /* go prone (laying down) */ +#define W_FL_AIMING (1<<14) /* aiming waypoint */ + +#define W_FL_DELETED (1<<31) /* used by waypoint allocation code */ + + +#define WAYPOINT_VERSION 4 + +// define the waypoint file header structure... +typedef struct { + char filetype[8]; // should be "HPB_bot\0" + int waypoint_file_version; + int waypoint_file_flags; // not currently used + int number_of_waypoints; + char mapname[32]; // name of map for these waypoints +} WAYPOINT_HDR; + + +// define the structure for waypoints... +typedef struct { + int flags; // button, lift, flag, health, ammo, etc. + Vector origin; // location +} WAYPOINT; + + + +#define WAYPOINT_UNREACHABLE USHRT_MAX +#define WAYPOINT_MAX_DISTANCE (USHRT_MAX-1) + +#define MAX_PATH_INDEX 4 + +// define the structure for waypoint paths (paths are connections between +// two waypoint nodes that indicates the bot can get from point A to point B. +// note that paths DON'T have to be two-way. sometimes they are just one-way +// connections between two points. There is an array called "paths" that +// contains head pointers to these structures for each waypoint index. +typedef struct path { + short int index[MAX_PATH_INDEX]; // indexes of waypoints (index -1 means not used) + struct path *next; // link to next structure +} PATH; + + +// waypoint function prototypes... +void WaypointInit(void); +int WaypointFindPath(PATH **pPath, int *path_index, int waypoint_index, int team); +int WaypointFindNearest(edict_t *pEntity, float distance, int team); +int WaypointFindNearest(Vector v_src, edict_t *pEntity, float range, int team); +int WaypointFindNearestGoal(edict_t *pEntity, int src, int team, int flags); +int WaypointFindNearestGoal(Vector v_src, edict_t *pEntity, float range, int team, int flags); +int WaypointFindRandomGoal(edict_t *pEntity, int team, int flags); +int WaypointFindRandomGoal(Vector v_src, edict_t *pEntity, float range, int team, int flags); +int WaypointFindNearestAiming(Vector v_origin); +void WaypointAdd(edict_t *pEntity); +void WaypointAddAiming(edict_t *pEntity); +void WaypointDelete(edict_t *pEntity); +void WaypointCreatePath(edict_t *pEntity, int cmd); +void WaypointRemovePath(edict_t *pEntity, int cmd); +bool WaypointLoad(edict_t *pEntity); +void WaypointSave(void); +bool WaypointReachable(Vector v_srv, Vector v_dest, edict_t *pEntity); +int WaypointFindReachable(edict_t *pEntity, float range, int team); +void WaypointPrintInfo(edict_t *pEntity); +void WaypointThink(edict_t *pEntity); +void WaypointFloyds(short *shortest_path, short *from_to); +void WaypointRouteInit(void); +unsigned short WaypointRouteFromTo(int src, int dest, int team); +int WaypointDistanceFromTo(int src, int dest, int team); + +#endif // WAYPOINT_H diff --git a/main/source/HPB_bot/engine/engine.h b/main/source/HPB_bot/engine/engine.h new file mode 100644 index 00000000..02a2c4ee --- /dev/null +++ b/main/source/HPB_bot/engine/engine.h @@ -0,0 +1,156 @@ +// +// HPB_bot - botman's High Ping Bastard bot +// +// (http://planethalflife.com/botman/) +// +// engine.h +// + +#ifndef ENGINE_H +#define ENGINE_H + +// engine prototypes (from engine\eiface.h)... +int pfnPrecacheModel( char* s ); +int pfnPrecacheSound( char* s ); +void pfnSetModel( edict_t *e, const char *m ); +int pfnModelIndex( const char *m ); +int pfnModelFrames( int modelIndex ); +void pfnSetSize( edict_t *e, const float *rgflMin, const float *rgflMax ); +void pfnChangeLevel( char* s1, char* s2 ); +void pfnGetSpawnParms( edict_t *ent ); +void pfnSaveSpawnParms( edict_t *ent ); +float pfnVecToYaw( const float *rgflVector ); +void pfnVecToAngles( const float *rgflVectorIn, float *rgflVectorOut ); +void pfnMoveToOrigin( edict_t *ent, const float *pflGoal, float dist, int iMoveType ); +void pfnChangeYaw( edict_t* ent ); +void pfnChangePitch( edict_t* ent ); +edict_t* pfnFindEntityByString( edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue ); +int pfnGetEntityIllum( edict_t* pEnt ); +edict_t* pfnFindEntityInSphere( edict_t *pEdictStartSearchAfter, const float *org, float rad ); +edict_t* pfnFindClientInPVS( edict_t *pEdict ); +edict_t* pfnEntitiesInPVS( edict_t *pplayer ); +void pfnMakeVectors( const float *rgflVector ); +void pfnAngleVectors( const float *rgflVector, float *forward, float *right, float *up ); +edict_t* pfnCreateEntity( void ); +void pfnRemoveEntity( edict_t* e ); +edict_t* pfnCreateNamedEntity( int className ); +void pfnMakeStatic( edict_t *ent ); +int pfnEntIsOnFloor( edict_t *e ); +int pfnDropToFloor( edict_t* e ); +int pfnWalkMove( edict_t *ent, float yaw, float dist, int iMode ); +void pfnSetOrigin( edict_t *e, const float *rgflOrigin ); +void pfnEmitSound( edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch ); +void pfnEmitAmbientSound( edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch ); +void pfnTraceLine( const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr ); +void pfnTraceToss( edict_t* pent, edict_t* pentToIgnore, TraceResult *ptr ); +int pfnTraceMonsterHull( edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr ); +void pfnTraceHull( const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr ); +void pfnTraceModel( const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr ); +const char *pfnTraceTexture( edict_t *pTextureEntity, const float *v1, const float *v2 ); +void pfnTraceSphere( const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr ); +void pfnGetAimVector( edict_t* ent, float speed, float *rgflReturn ); +void pfnServerCommand( char* str ); +void pfnServerExecute( void ); +void pfnClientCommand( edict_t* pEdict, char* szFmt, ... ); +void pfnParticleEffect( const float *org, const float *dir, float color, float count ); +void pfnLightStyle( int style, char* val ); +int pfnDecalIndex( const char *name ); +int pfnPointContents( const float *rgflVector ); +void pfnMessageBegin( int msg_dest, int msg_type, const float *pOrigin, edict_t *ed ); +void pfnMessageEnd( void ); +void pfnWriteByte( int iValue ); +void pfnWriteChar( int iValue ); +void pfnWriteShort( int iValue ); +void pfnWriteLong( int iValue ); +void pfnWriteAngle( float flValue ); +void pfnWriteCoord( float flValue ); +void pfnWriteString( const char *sz ); +void pfnWriteEntity( int iValue ); +void pfnCVarRegister( cvar_t *pCvar ); +float pfnCVarGetFloat( const char *szVarName ); +const char* pfnCVarGetString( const char *szVarName ); +void pfnCVarSetFloat( const char *szVarName, float flValue ); +void pfnCVarSetString( const char *szVarName, const char *szValue ); +void pfnAlertMessage( ALERT_TYPE atype, char *szFmt, ... ); +void pfnEngineFprintf( FILE *pfile, char *szFmt, ... ); +void* pfnPvAllocEntPrivateData( edict_t *pEdict, long cb ); +void* pfnPvEntPrivateData( edict_t *pEdict ); +void pfnFreeEntPrivateData( edict_t *pEdict ); +const char* pfnSzFromIndex( int iString ); +int pfnAllocString( const char *szValue ); +struct entvars_s* pfnGetVarsOfEnt( edict_t *pEdict ); +edict_t* pfnPEntityOfEntOffset( int iEntOffset ); +int pfnEntOffsetOfPEntity( const edict_t *pEdict ); +int pfnIndexOfEdict( const edict_t *pEdict ); +edict_t* pfnPEntityOfEntIndex( int iEntIndex ); +edict_t* pfnFindEntityByVars( struct entvars_s* pvars ); +void* pfnGetModelPtr( edict_t* pEdict ); +int pfnRegUserMsg( const char *pszName, int iSize ); +void pfnAnimationAutomove( const edict_t* pEdict, float flTime ); +void pfnGetBonePosition( const edict_t* pEdict, int iBone, float *rgflOrigin, float *rgflAngles ); +unsigned long pfnFunctionFromName( const char *pName ); +const char *pfnNameForFunction( unsigned long function ); +void pfnClientPrintf( edict_t* pEdict, PRINT_TYPE ptype, const char *szMsg ); +void pfnServerPrint( const char *szMsg ); +const char *pfnCmd_Args( void ); +const char *pfnCmd_Argv( int argc ); +int pfnCmd_Argc( void ); +void pfnGetAttachment( const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); +void pfnCRC32_Init( CRC32_t *pulCRC ); +void pfnCRC32_ProcessBuffer( CRC32_t *pulCRC, void *p, int len ); +void pfnCRC32_ProcessByte( CRC32_t *pulCRC, unsigned char ch ); +CRC32_t pfnCRC32_Final( CRC32_t pulCRC ); +long pfnRandomLong( long lLow, long lHigh ); +float pfnRandomFloat( float flLow, float flHigh ); +void pfnSetView( const edict_t *pClient, const edict_t *pViewent ); +float pfnTime( void ); +void pfnCrosshairAngle( const edict_t *pClient, float pitch, float yaw ); +byte * pfnLoadFileForMe( char *filename, int *pLength ); +void pfnFreeFile( void *buffer ); +void pfnEndSection( const char *pszSectionName ); +int pfnCompareFileTime( char *filename1, char *filename2, int *iCompare ); +void pfnGetGameDir( char *szGetGameDir ); +void pfnCvar_RegisterVariable( cvar_t *variable ); +void pfnFadeClientVolume( const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds ); +void pfnSetClientMaxspeed( const edict_t *pEdict, float fNewMaxspeed ); +edict_t * pfnCreateFakeClient( const char *netname ); +void pfnRunPlayerMove( edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ); +int pfnNumberOfEntities( void ); +char* pfnGetInfoKeyBuffer( edict_t *e ); +char* pfnInfoKeyValue( char *infobuffer, char *key ); +void pfnSetKeyValue( char *infobuffer, char *key, char *value ); +void pfnSetClientKeyValue( int clientIndex, char *infobuffer, char *key, char *value ); +int pfnIsMapValid( char *filename ); +void pfnStaticDecal( const float *origin, int decalIndex, int entityIndex, int modelIndex ); +int pfnPrecacheGeneric( char* s ); +int pfnGetPlayerUserId( edict_t *e ); +void pfnBuildSoundMsg( edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed ); +int pfnIsDedicatedServer( void ); +cvar_t *pfnCVarGetPointer( const char *szVarName ); +unsigned int pfnGetPlayerWONId( edict_t *e ); + +void pfnInfo_RemoveKey( char *s, const char *key ); +const char *pfnGetPhysicsKeyValue( const edict_t *pClient, const char *key ); +void pfnSetPhysicsKeyValue( const edict_t *pClient, const char *key, const char *value ); +const char *pfnGetPhysicsInfoString( const edict_t *pClient ); +unsigned short pfnPrecacheEvent( int type, const char*psz ); +void pfnPlaybackEvent( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); +unsigned char *pfnSetFatPVS( float *org ); +unsigned char *pfnSetFatPAS( float *org ); +int pfnCheckVisibility ( const edict_t *entity, unsigned char *pset ); +void pfnDeltaSetField( struct delta_s *pFields, const char *fieldname ); +void pfnDeltaUnsetField( struct delta_s *pFields, const char *fieldname ); +void pfnDeltaAddEncoder( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); +int pfnGetCurrentPlayer( void ); +int pfnCanSkipPlayer( const edict_t *player ); +int pfnDeltaFindField( struct delta_s *pFields, const char *fieldname ); +void pfnDeltaSetFieldByIndex( struct delta_s *pFields, int fieldNumber ); +void pfnDeltaUnsetFieldByIndex( struct delta_s *pFields, int fieldNumber ); +void pfnSetGroupMask( int mask, int op ); +int pfnCreateInstancedBaseline( int classname, struct entity_state_s *baseline ); +void pfnCvar_DirectSet( struct cvar_s *var, char *value ); +void pfnForceUnmodified( FORCE_TYPE type, float *mins, float *maxs, const char *filename ); +void pfnGetPlayerStats( const edict_t *pClient, int *ping, int *packet_loss ); + +#endif // ENGINE_H + diff --git a/main/source/HPB_bot/exports/exports.c b/main/source/HPB_bot/exports/exports.c new file mode 100644 index 00000000..3de4c147 --- /dev/null +++ b/main/source/HPB_bot/exports/exports.c @@ -0,0 +1,419 @@ +// +// (http://planethalflife.com/botman/) +// +// exports.c +// + +#include +#include +#include +#include + + +#define DOS_SIGNATURE 0x5A4D /* MZ */ +#define NT_SIGNATURE 0x00004550 /* PE00 */ + + +// globals +WORD *p_Ordinals = NULL; +DWORD *p_Names = NULL; +DWORD *p_Functions = NULL; +int num_ordinals; + + +typedef struct { // DOS .EXE header + WORD e_magic; // Magic number + WORD e_cblp; // Bytes on last page of file + WORD e_cp; // Pages in file + WORD e_crlc; // Relocations + WORD e_cparhdr; // Size of header in paragraphs + WORD e_minalloc; // Minimum extra paragraphs needed + WORD e_maxalloc; // Maximum extra paragraphs needed + WORD e_ss; // Initial (relative) SS value + WORD e_sp; // Initial SP value + WORD e_csum; // Checksum + WORD e_ip; // Initial IP value + WORD e_cs; // Initial (relative) CS value + WORD e_lfarlc; // File address of relocation table + WORD e_ovno; // Overlay number + WORD e_res[4]; // Reserved words + WORD e_oemid; // OEM identifier (for e_oeminfo) + WORD e_oeminfo; // OEM information; e_oemid specific + WORD e_res2[10]; // Reserved words + LONG e_lfanew; // File address of new exe header + } DOS_HEADER, *P_DOS_HEADER; + +typedef struct { + WORD Machine; + WORD NumberOfSections; + DWORD TimeDateStamp; + DWORD PointerToSymbolTable; + DWORD NumberOfSymbols; + WORD SizeOfOptionalHeader; + WORD Characteristics; +} PE_HEADER, *P_PE_HEADER; + +#define SIZEOF_SHORT_NAME 8 + +typedef struct { + BYTE Name[SIZEOF_SHORT_NAME]; + union { + DWORD PhysicalAddress; + DWORD VirtualSize; + } Misc; + DWORD VirtualAddress; + DWORD SizeOfRawData; + DWORD PointerToRawData; + DWORD PointerToRelocations; + DWORD PointerToLinenumbers; + WORD NumberOfRelocations; + WORD NumberOfLinenumbers; + DWORD Characteristics; +} SECTION_HEADER, *P_SECTION_HEADER; + +typedef struct { + DWORD VirtualAddress; + DWORD Size; +} DATA_DIRECTORY, *P_DATA_DIRECTORY; + +#define NUMBEROF_DIRECTORY_ENTRIES 16 + +typedef struct { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + DWORD BaseOfData; + DWORD ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Win32VersionValue; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + DWORD SizeOfStackReserve; + DWORD SizeOfStackCommit; + DWORD SizeOfHeapReserve; + DWORD SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + DATA_DIRECTORY DataDirectory[NUMBEROF_DIRECTORY_ENTRIES]; +} OPTIONAL_HEADER, *P_OPTIONAL_HEADER; + +typedef struct { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD Name; + DWORD Base; + DWORD NumberOfFunctions; + DWORD NumberOfNames; + DWORD AddressOfFunctions; // RVA from base of image + DWORD AddressOfNames; // RVA from base of image + DWORD AddressOfNameOrdinals; // RVA from base of image +} EXPORT_DIRECTORY, *P_EXPORT_DIRECTORY; + + +void FreeNameFuncGlobals(void) +{ + if (p_Ordinals) + free(p_Ordinals); + if (p_Functions) + free(p_Functions); + if (p_Names) + free(p_Names); +} + + +void FgetString(char *str, FILE *bfp) +{ + char ch; + + while ((ch = fgetc(bfp)) != EOF) + { + *str++ = ch; + if (ch == 0) + break; + } +} + + +int main(int argc, char *argv[]) +{ + FILE *bfp; + char filename[80]; + BOOL extended = FALSE; + DOS_HEADER dos_header; + LONG nt_signature; + PE_HEADER pe_header; + SECTION_HEADER section_header; + BOOL edata_found; + OPTIONAL_HEADER optional_header; + LONG edata_offset; + LONG edata_delta; + EXPORT_DIRECTORY export_directory; + LONG name_offset; + LONG ordinal_offset; + LONG function_offset; + char function_name[256]; + int i, index; + BOOL error; + //char msg[80]; + + + if (argc < 2) + { + printf("usage: exports [-e] filename.dll\n"); + return -1; + } + + if (argc > 2) + { + if (argv[1][0] == '-') + { + if (argv[1][1] == 'e') + { + strcpy(filename, argv[2]); + extended = TRUE; + } + else + { + printf("unknown option \"%s\"\n\n", argv[1]); + printf("usage: exports [-e] filename.dll\n"); + return -1; + } + } + else + { + printf("usage: exports [-e] filename.dll\n"); + return -1; + } + } + else + strcpy(filename, argv[1]); + + if ((bfp=fopen(filename, "rb")) == NULL) + { + printf("DLL file %s not found!", filename); + return -1; + } + + if (fread(&dos_header, sizeof(dos_header), 1, bfp) != 1) + { + printf("%s is NOT a valid DLL file!", filename); + return -1; + } + + if (dos_header.e_magic != DOS_SIGNATURE) + { + printf("file does not have a valid DLL signature!"); + return -1; + } + + if (fseek(bfp, dos_header.e_lfanew, SEEK_SET) == -1) + { + printf("error seeking to new exe header!"); + return -1; + } + + if (fread(&nt_signature, sizeof(nt_signature), 1, bfp) != 1) + { + printf("file does not have a valid NT signature!"); + return -1; + } + + if (nt_signature != NT_SIGNATURE) + { + printf("file does not have a valid NT signature!"); + return -1; + } + + if (fread(&pe_header, sizeof(pe_header), 1, bfp) != 1) + { + printf("file does not have a valid PE header!"); + return -1; + } + + if (pe_header.SizeOfOptionalHeader == 0) + { + printf("file does not have an optional header!"); + return -1; + } + + if (fread(&optional_header, sizeof(optional_header), 1, bfp) != 1) + { + printf("file does not have a valid optional header!"); + return -1; + } + + edata_found = FALSE; + + for (i=0; i < pe_header.NumberOfSections; i++) + { + if (fread(§ion_header, sizeof(section_header), 1, bfp) != 1) + { + printf("error reading section header!"); + return -1; + } + + if (strcmp((char *)section_header.Name, ".edata") == 0) + { + edata_found = TRUE; + break; + } + } + + if (edata_found) + { + edata_offset = section_header.PointerToRawData; + edata_delta = section_header.VirtualAddress - section_header.PointerToRawData; + } + else + { + edata_offset = optional_header.DataDirectory[0].VirtualAddress; + edata_delta = 0L; + } + + + if (fseek(bfp, edata_offset, SEEK_SET) == -1) + { + printf("file does not have a valid exports section!"); + return -1; + } + + if (fread(&export_directory, sizeof(export_directory), 1, bfp) != 1) + { + printf("file does not have a valid optional header!"); + return -1; + } + + num_ordinals = export_directory.NumberOfNames; // also number of ordinals + + + ordinal_offset = export_directory.AddressOfNameOrdinals - edata_delta; + + if (fseek(bfp, ordinal_offset, SEEK_SET) == -1) + { + printf("file does not have a valid ordinals section!"); + return -1; + } + + if ((p_Ordinals = (WORD *)malloc(num_ordinals * sizeof(WORD))) == NULL) + { + printf("error allocating memory for ordinals section!"); + return -1; + } + + if (fread(p_Ordinals, num_ordinals * sizeof(WORD), 1, bfp) != 1) + { + FreeNameFuncGlobals(); + + printf("error reading ordinals table!"); + return -1; + } + + + function_offset = export_directory.AddressOfFunctions - edata_delta; + + if (fseek(bfp, function_offset, SEEK_SET) == -1) + { + FreeNameFuncGlobals(); + + printf("file does not have a valid export address section!"); + return -1; + } + + if ((p_Functions = (DWORD *)malloc(num_ordinals * sizeof(DWORD))) == NULL) + { + FreeNameFuncGlobals(); + + printf("error allocating memory for export address section!"); + return -1; + } + + if (fread(p_Functions, num_ordinals * sizeof(DWORD), 1, bfp) != 1) + { + FreeNameFuncGlobals(); + + printf("error reading export address section!"); + return -1; + } + + + name_offset = export_directory.AddressOfNames - edata_delta; + + if (fseek(bfp, name_offset, SEEK_SET) == -1) + { + FreeNameFuncGlobals(); + + printf("file does not have a valid names section!"); + return -1; + } + + if ((p_Names = (DWORD *)malloc(num_ordinals * sizeof(DWORD))) == NULL) + { + FreeNameFuncGlobals(); + + printf("error allocating memory for names section!"); + return -1; + } + + if (fread(p_Names, num_ordinals * sizeof(DWORD), 1, bfp) != 1) + { + FreeNameFuncGlobals(); + + printf("error reading names table!"); + return -1; + } + + error = FALSE; + + for (i=0; (i < num_ordinals) && (error==FALSE); i++) + { + name_offset = p_Names[i] - edata_delta; + + if (name_offset != 0) + { + if (fseek(bfp, name_offset, SEEK_SET) == -1) + { + printf("error in loading names section!\n"); + error = TRUE; + } + else + { + FgetString(function_name, bfp); + + if (extended) + { + index = p_Ordinals[i]; + + printf("ordinal=%3d addr=%08lX name=%s\n", + (p_Ordinals[i]+1), p_Functions[index], function_name); + } + else + printf("%s\n", function_name); + } + } + } + + FreeNameFuncGlobals(); + + fclose(bfp); + + return 0; +} + + diff --git a/main/source/HPB_bot/exports/exports.dsp b/main/source/HPB_bot/exports/exports.dsp new file mode 100644 index 00000000..65382224 --- /dev/null +++ b/main/source/HPB_bot/exports/exports.dsp @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="exports" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=exports - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "exports.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "exports.mak" CFG="exports - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "exports - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "exports - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "exports - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "exports - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "exports - Win32 Release" +# Name "exports - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\exports.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/main/source/Natural_Selection.ncb b/main/source/Natural_Selection.ncb new file mode 100644 index 00000000..4b03f3fc Binary files /dev/null and b/main/source/Natural_Selection.ncb differ diff --git a/main/source/Natural_Selection.sln b/main/source/Natural_Selection.sln new file mode 100644 index 00000000..d3f5c8bd --- /dev/null +++ b/main/source/Natural_Selection.sln @@ -0,0 +1,92 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HPB_bot", "HPB_bot\dlls\HPB_bot.vcproj", "{44018A66-3207-4CAB-BD27-3C6C59014E21}" + ProjectSection(ProjectDependencies) = postProject + {C57D57F4-74B2-401F-BE6A-30E2BF8146C2} = {C57D57F4-74B2-401F-BE6A-30E2BF8146C2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Textrep", "TEXTREP\Textrep.vcproj", "{CF72E070-32CA-408C-9890-2D92C6565DD9}" + ProjectSection(ProjectDependencies) = postProject + {C57D57F4-74B2-401F-BE6A-30E2BF8146C2} = {C57D57F4-74B2-401F-BE6A-30E2BF8146C2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Util", "UTIL\Util.vcproj", "{C57D57F4-74B2-401F-BE6A-30E2BF8146C2}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cl_dll", "cl_dll\cl_dll.vcproj", "{4F2D8BCB-E519-4BD6-9E90-F9BD279A7F81}" + ProjectSection(ProjectDependencies) = postProject + {788F4843-CF73-4980-9A99-FBF840C359E5} = {788F4843-CF73-4980-9A99-FBF840C359E5} + {CF72E070-32CA-408C-9890-2D92C6565DD9} = {CF72E070-32CA-408C-9890-2D92C6565DD9} + {F3B3C199-350B-40B1-A6A9-BE5E7BC457AB} = {F3B3C199-350B-40B1-A6A9-BE5E7BC457AB} + {C03B17AC-8484-4453-843B-B38EBA7C5775} = {C03B17AC-8484-4453-843B-B38EBA7C5775} + {C57D57F4-74B2-401F-BE6A-30E2BF8146C2} = {C57D57F4-74B2-401F-BE6A-30E2BF8146C2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curllib", "curl\lib\curllib.vcproj", "{788F4843-CF73-4980-9A99-FBF840C359E5}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hl", "dlls\hl.vcproj", "{FE9B1F1B-866D-4A5A-A303-FAEE34F90025}" + ProjectSection(ProjectDependencies) = postProject + {788F4843-CF73-4980-9A99-FBF840C359E5} = {788F4843-CF73-4980-9A99-FBF840C359E5} + {CF72E070-32CA-408C-9890-2D92C6565DD9} = {CF72E070-32CA-408C-9890-2D92C6565DD9} + {F3B3C199-350B-40B1-A6A9-BE5E7BC457AB} = {F3B3C199-350B-40B1-A6A9-BE5E7BC457AB} + {C03B17AC-8484-4453-843B-B38EBA7C5775} = {C03B17AC-8484-4453-843B-B38EBA7C5775} + {C57D57F4-74B2-401F-BE6A-30E2BF8146C2} = {C57D57F4-74B2-401F-BE6A-30E2BF8146C2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "particles", "particles\particles.vcproj", "{F3B3C199-350B-40B1-A6A9-BE5E7BC457AB}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua", "lua\lua.vcproj", "{C03B17AC-8484-4453-843B-B38EBA7C5775}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {44018A66-3207-4CAB-BD27-3C6C59014E21}.Debug.ActiveCfg = Debug|Win32 + {44018A66-3207-4CAB-BD27-3C6C59014E21}.Debug.Build.0 = Debug|Win32 + {44018A66-3207-4CAB-BD27-3C6C59014E21}.Release.ActiveCfg = Release|Win32 + {44018A66-3207-4CAB-BD27-3C6C59014E21}.Release.Build.0 = Release|Win32 + {CF72E070-32CA-408C-9890-2D92C6565DD9}.Debug.ActiveCfg = Debug|Win32 + {CF72E070-32CA-408C-9890-2D92C6565DD9}.Debug.Build.0 = Debug|Win32 + {CF72E070-32CA-408C-9890-2D92C6565DD9}.Release.ActiveCfg = Release|Win32 + {CF72E070-32CA-408C-9890-2D92C6565DD9}.Release.Build.0 = Release|Win32 + {C57D57F4-74B2-401F-BE6A-30E2BF8146C2}.Debug.ActiveCfg = Debug|Win32 + {C57D57F4-74B2-401F-BE6A-30E2BF8146C2}.Debug.Build.0 = Debug|Win32 + {C57D57F4-74B2-401F-BE6A-30E2BF8146C2}.Release.ActiveCfg = Release|Win32 + {C57D57F4-74B2-401F-BE6A-30E2BF8146C2}.Release.Build.0 = Release|Win32 + {4F2D8BCB-E519-4BD6-9E90-F9BD279A7F81}.Debug.ActiveCfg = Debug|Win32 + {4F2D8BCB-E519-4BD6-9E90-F9BD279A7F81}.Debug.Build.0 = Debug|Win32 + {4F2D8BCB-E519-4BD6-9E90-F9BD279A7F81}.Release.ActiveCfg = Release|Win32 + {4F2D8BCB-E519-4BD6-9E90-F9BD279A7F81}.Release.Build.0 = Release|Win32 + {788F4843-CF73-4980-9A99-FBF840C359E5}.Debug.ActiveCfg = Debug|Win32 + {788F4843-CF73-4980-9A99-FBF840C359E5}.Debug.Build.0 = Debug|Win32 + {788F4843-CF73-4980-9A99-FBF840C359E5}.Release.ActiveCfg = Release|Win32 + {788F4843-CF73-4980-9A99-FBF840C359E5}.Release.Build.0 = Release|Win32 + {FE9B1F1B-866D-4A5A-A303-FAEE34F90025}.Debug.ActiveCfg = Debug|Win32 + {FE9B1F1B-866D-4A5A-A303-FAEE34F90025}.Debug.Build.0 = Debug|Win32 + {FE9B1F1B-866D-4A5A-A303-FAEE34F90025}.Release.ActiveCfg = Release|Win32 + {FE9B1F1B-866D-4A5A-A303-FAEE34F90025}.Release.Build.0 = Release|Win32 + {F3B3C199-350B-40B1-A6A9-BE5E7BC457AB}.Debug.ActiveCfg = Debug|Win32 + {F3B3C199-350B-40B1-A6A9-BE5E7BC457AB}.Debug.Build.0 = Debug|Win32 + {F3B3C199-350B-40B1-A6A9-BE5E7BC457AB}.Release.ActiveCfg = Release|Win32 + {F3B3C199-350B-40B1-A6A9-BE5E7BC457AB}.Release.Build.0 = Release|Win32 + {C03B17AC-8484-4453-843B-B38EBA7C5775}.Debug.ActiveCfg = Debug|Win32 + {C03B17AC-8484-4453-843B-B38EBA7C5775}.Debug.Build.0 = Debug|Win32 + {C03B17AC-8484-4453-843B-B38EBA7C5775}.Release.ActiveCfg = Release|Win32 + {C03B17AC-8484-4453-843B-B38EBA7C5775}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionItems) = postSolution + ..\Balance.txt = ..\Balance.txt + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/main/source/Natural_Selection.suo b/main/source/Natural_Selection.suo new file mode 100644 index 00000000..4053953d Binary files /dev/null and b/main/source/Natural_Selection.suo differ diff --git a/main/source/build.h b/main/source/build.h new file mode 100644 index 00000000..6dd57dd1 --- /dev/null +++ b/main/source/build.h @@ -0,0 +1,107 @@ +//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. ========= +// +// The copyright to the contents herein is the property of Charles G. Cleveland. +// The contents may be used and/or copied only with the written permission of +// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: +// +// $Workfile: build.h $ +// $Date: 2002/11/22 22:09:10 $ +// +//------------------------------------------------------------------------------- +// $Log: build.h,v $ +// Revision 1.17 2002/11/22 22:09:10 Flayra +// - Updated version # +// +// Revision 1.16 2002/11/22 21:07:55 Flayra +// - Removed dev build, use DEBUG instead +// +// Revision 1.15 2002/11/15 19:09:57 Flayra +// - Reworked network metering to be easily toggleable +// +// Revision 1.14 2002/11/12 02:20:25 Flayra +// - Updated version number +// +// Revision 1.13 2002/11/06 01:37:07 Flayra +// - Regular update +// +// Revision 1.12 2002/11/03 04:54:45 Flayra +// - Regular update +// +// Revision 1.11 2002/10/24 21:09:04 Flayra +// - No longer needed +// +// Revision 1.10 2002/10/20 16:33:31 Flayra +// - Regular update +// +// Revision 1.9 2002/10/16 20:48:18 Flayra +// - Regular update +// +// Revision 1.8 2002/10/03 19:07:12 Flayra +// - Profiling switch +// - Regular game version update +// +// Revision 1.7 2002/09/23 21:51:39 Flayra +// - Regular update +// +// Revision 1.6 2002/09/09 19:38:34 Flayra +// - Tried implementing DirectX version of gamma ramp support +// +// Revision 1.5 2002/08/16 02:21:37 Flayra +// - Re-enabled selection +// +// Revision 1.4 2002/08/09 00:14:59 Flayra +// - Removed selection prediction +// +// Revision 1.3 2002/05/23 02:41:53 Flayra +// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development. +// +//=============================================================================== +#ifndef BUILD_H +#define BUILD_H + +// Build options +#define CLIENT_WEAPONS +#define AVH_PREDICT_SELECT + +// Build in code to help playtest. Choose neither, AVH_PLAYTEST_BUILD, or AVH_PLAYTEST_BUILD _and_ AVH_LAN_PLAYTEST_BUILD +#ifdef DEBUG +#define AVH_PLAYTEST_BUILD +//#define AVH_LAN_PLAYTEST_BUILD +#endif + +// Build in code for security. This forces the server to uplink and only allows authenticated players to join the server. +//#ifndef DEBUG +//#define AVH_SECURE_PRERELEASE_BUILD +//#endif + +// When you're doing a final secure build of your client .dll and you're ready to +// send the binary to Valve to be processed, you need to change this to 1 and rebuild +//#define FINAL_VAC_BUILD + +// Define this when debugging on a different machine in a "live" environment (ie, trying to catch crashes) +//#define AVH_EXTERNAL_BUILD + +//#define USE_DIRECTX_8 + +// May not be working completely +//#define SKULK_VIEW_ROTATION + +// Mapper build? +//#define AVH_MAPPER_BUILD + +// Sends profiling info to log +//#define PROFILE_BUILD + +// Use multiple weapons sounds for upgrades +//#define AVH_UPGRADE_SOUNDS + +// Define to track and meter network messages, don't define to use basic HL networking +//#define USE_NETWORK_METERING + +// Define to have server report server and player data to master server +//#define USE_UPP + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/CLabelHeader.h b/main/source/cl_dll/CLabelHeader.h new file mode 100644 index 00000000..259a79b3 --- /dev/null +++ b/main/source/cl_dll/CLabelHeader.h @@ -0,0 +1,193 @@ +#ifndef CLABELHEADER_H +#define CLABELHEADER_H + +#include +#include "cl_dll/vgui_TeamFortressViewport.h" + +class CTextImage2 : public Image +{ +public: + CTextImage2() + { + _image[0] = new TextImage(""); + _image[1] = new TextImage(""); + } + + ~CTextImage2() + { + delete _image[0]; + delete _image[1]; + } + + TextImage *GetImage(int image) + { + return _image[image]; + } + + void getSize(int &wide, int &tall) + { + int w1, w2, t1, t2; + _image[0]->getTextSize(w1, t1); + _image[1]->getTextSize(w2, t2); + + wide = w1 + w2; + tall = max(t1, t2); + setSize(wide, tall); + } + + void doPaint(Panel *panel) + { + _image[0]->doPaint(panel); + _image[1]->doPaint(panel); + } + + void setPos(int x, int y) + { + _image[0]->setPos(x, y); + + int swide, stall; + _image[0]->getSize(swide, stall); + + int wide, tall; + _image[1]->getSize(wide, tall); + _image[1]->setPos(x + wide, y + (stall * 0.9) - tall); + } + + void setColor(Color color) + { + _image[0]->setColor(color); + } + + void setColor2(Color color) + { + _image[1]->setColor(color); + } + +private: + TextImage *_image[2]; + +}; + +class CLabelHeader : public Label +{ +public: + CLabelHeader() : Label("") + { + _dualImage = new CTextImage2(); + _dualImage->setColor2(Color(255, 170, 0, 0)); + _row = -2; + _useFgColorAsImageColor = true; + _offset[0] = 0; + _offset[1] = 0; + } + + ~CLabelHeader() + { + delete _dualImage; + } + + void setRow(int row) + { + _row = row; + } + + void setFgColorAsImageColor(bool state) + { + _useFgColorAsImageColor = state; + } + + virtual void setText(int textBufferLen, const char* text) + { + _dualImage->GetImage(0)->setText(text); + + // calculate the text size + Font *font = _dualImage->GetImage(0)->getFont(); + _gap = 0; + for (const char *ch = text; *ch != 0; ch++) + { + int a, b, c; + font->getCharABCwide(*ch, a, b, c); + _gap += (a + b + c); + } + + _gap += XRES(5); + } + + virtual void setText(const char* text) + { + // strip any non-alnum characters from the end + char buf[512]; + strcpy(buf, text); + + int len = strlen(buf); + while (len && isspace(buf[--len])) + { + buf[len] = 0; + } + + CLabelHeader::setText(0, buf); + } + + void setText2(const char *text) + { + _dualImage->GetImage(1)->setText(text); + } + + void getTextSize(int &wide, int &tall) + { + _dualImage->getSize(wide, tall); + } + + void setFgColor(int r,int g,int b,int a) + { + Label::setFgColor(r,g,b,a); + Color color(r,g,b,a); + _dualImage->setColor(color); + _dualImage->setColor2(color); + if (_image && _useFgColorAsImageColor) + { + _image->setColor(color); + } + repaint(); + } + + void setFgColor(Scheme::SchemeColor sc) + { + int r, g, b, a; + Label::setFgColor(sc); + Label::getFgColor( r, g, b, a ); + + // Call the r,g,b,a version so it sets the color in the dualImage.. + setFgColor( r, g, b, a ); + } + + void setFont(Font *font) + { + _dualImage->GetImage(0)->setFont(font); + } + + void setFont2(Font *font) + { + _dualImage->GetImage(1)->setFont(font); + } + + // this adjust the absolute position of the text after alignment is calculated + void setTextOffset(int x, int y) + { + _offset[0] = x; + _offset[1] = y; + } + + void paint(); + void paintBackground(); + void calcAlignment(int iwide, int itall, int &x, int &y); + +private: + CTextImage2 *_dualImage; + int _row; + int _gap; + int _offset[2]; + bool _useFgColorAsImageColor; +}; + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/GameStudioModelRenderer.cpp b/main/source/cl_dll/GameStudioModelRenderer.cpp new file mode 100644 index 00000000..e5e9ebc0 --- /dev/null +++ b/main/source/cl_dll/GameStudioModelRenderer.cpp @@ -0,0 +1,116 @@ +#include +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "com_model.h" +#include "studio.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "dlight.h" +#include "triangleapi.h" + +#include +#include +#include +#include + +#include "studio_util.h" +#include "r_studioint.h" + +#include "StudioModelRenderer.h" +#include "GameStudioModelRenderer.h" + +#include "engine/APIProxy.h" +#include "cl_dll/Exports.h" + +// +// Override the StudioModelRender virtual member functions here to implement custom bone +// setup, blending, etc. +// + +// Global engine <-> studio model rendering code interface +extern engine_studio_api_t IEngineStudio; + +// The renderer object, created on the stack. +CGameStudioModelRenderer g_StudioRenderer; +/* +==================== +CGameStudioModelRenderer + +==================== +*/ +CGameStudioModelRenderer::CGameStudioModelRenderer( void ) +{ +} + +//////////////////////////////////// +// Hooks to class implementation +//////////////////////////////////// + +/* +==================== +R_StudioDrawPlayer + +==================== +*/ +int R_StudioDrawPlayer( int flags, entity_state_t *pplayer ) +{ + return g_StudioRenderer.StudioDrawPlayer( flags, pplayer ); +} + +/* +==================== +R_StudioDrawModel + +==================== +*/ +int R_StudioDrawModel( int flags ) +{ + return g_StudioRenderer.StudioDrawModel( flags ); +} + +/* +==================== +R_StudioInit + +==================== +*/ +void R_StudioInit( void ) +{ + g_StudioRenderer.Init(); +} + +// The simple drawing interface we'll pass back to the engine +r_studio_interface_t studio = +{ + STUDIO_INTERFACE_VERSION, + R_StudioDrawModel, + R_StudioDrawPlayer, +}; + +/* +==================== +HUD_GetStudioModelInterface + +Export this function for the engine to use the studio renderer class to render objects. +==================== +*/ +extern "C" int CL_DLLEXPORT HUD_GetStudioModelInterface( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio ) +{ + RecClStudioInterface(version, ppinterface, pstudio); + + if ( version != STUDIO_INTERFACE_VERSION ) + return 0; + + // Point the engine to our callbacks + *ppinterface = &studio; + + // Copy in engine helper functions + memcpy( &IEngineStudio, pstudio, sizeof( IEngineStudio ) ); + + // Initialize local variables, etc. + R_StudioInit(); + + // Success + return 1; +} diff --git a/main/source/cl_dll/GameStudioModelRenderer.h b/main/source/cl_dll/GameStudioModelRenderer.h new file mode 100644 index 00000000..92c596e6 --- /dev/null +++ b/main/source/cl_dll/GameStudioModelRenderer.h @@ -0,0 +1,19 @@ +#if !defined( GAMESTUDIOMODELRENDERER_H ) +#define GAMESTUDIOMODELRENDERER_H +#if defined( _WIN32 ) +#pragma once +#endif + +/* +==================== +CGameStudioModelRenderer + +==================== +*/ +class CGameStudioModelRenderer : public CStudioModelRenderer +{ +public: + CGameStudioModelRenderer( void ); +}; + +#endif // GAMESTUDIOMODELRENDERER_H \ No newline at end of file diff --git a/main/source/cl_dll/GameStudioModelRenderer_Sample.cpp b/main/source/cl_dll/GameStudioModelRenderer_Sample.cpp new file mode 100644 index 00000000..d9592b05 --- /dev/null +++ b/main/source/cl_dll/GameStudioModelRenderer_Sample.cpp @@ -0,0 +1,985 @@ +#include +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "com_model.h" +#include "studio.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "dlight.h" +#include "triangleapi.h" + +#include +#include +#include +#include + +#include "studio_util.h" +#include "r_studioint.h" + +#include "StudioModelRenderer.h" +#include "GameStudioModelRenderer.h" + +// Predicted values saved off in hl_weapons.cpp +void Game_GetSequence( int *seq, int *gaitseq ); +void Game_GetOrientation( float *o, float *a ); + +float g_flStartScaleTime; +int iPrevRenderState; +int iRenderStateChanged; + +// Global engine <-> studio model rendering code interface +extern engine_studio_api_t IEngineStudio; + +typedef struct +{ + vec3_t origin; + vec3_t angles; + + vec3_t realangles; + + float animtime; + float frame; + int sequence; + int gaitsequence; + float framerate; + + int m_fSequenceLoops; + int m_fSequenceFinished; + + byte controller[ 4 ]; + byte blending[ 2 ]; + + latchedvars_t lv; +} client_anim_state_t; + +static client_anim_state_t g_state; +static client_anim_state_t g_clientstate; + +// The renderer object, created on the stack. +CGameStudioModelRenderer g_StudioRenderer; +/* +==================== +CGameStudioModelRenderer + +==================== +*/ +CGameStudioModelRenderer::CGameStudioModelRenderer( void ) +{ + // If you want to predict animations locally, set this to TRUE + // NOTE: The animation code is somewhat broken, but gives you a sense for how + // to do client side animation of the predicted player in a third person game. + m_bLocal = false; +} + +/* +==================== +StudioSetupBones + +==================== +*/ +void CGameStudioModelRenderer::StudioSetupBones ( void ) +{ + int i; + double f; + + mstudiobone_t *pbones; + mstudioseqdesc_t *pseqdesc; + mstudioanim_t *panim; + + static float pos[MAXSTUDIOBONES][3]; + static vec4_t q[MAXSTUDIOBONES]; + float bonematrix[3][4]; + + static float pos2[MAXSTUDIOBONES][3]; + static vec4_t q2[MAXSTUDIOBONES]; + static float pos3[MAXSTUDIOBONES][3]; + static vec4_t q3[MAXSTUDIOBONES]; + static float pos4[MAXSTUDIOBONES][3]; + static vec4_t q4[MAXSTUDIOBONES]; + + // Use default bone setup for nonplayers + if ( !m_pCurrentEntity->player ) + { + CStudioModelRenderer::StudioSetupBones(); + return; + } + + // Bound sequence number. + if ( m_pCurrentEntity->curstate.sequence >= m_pStudioHeader->numseq ) + { + m_pCurrentEntity->curstate.sequence = 0; + } + + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pCurrentEntity->curstate.sequence; + + if ( m_pPlayerInfo && m_pPlayerInfo->gaitsequence != 0 ) + { + f = m_pPlayerInfo->gaitframe; + } + else + { + f = StudioEstimateFrame( pseqdesc ); + } + + // This game knows how to do three way blending + if ( pseqdesc->numblends == 3 ) + { + float s; + + // Get left anim + panim = StudioGetAnim( m_pRenderModel, pseqdesc ); + + // Blending is 0-127 == Left to Middle, 128 to 255 == Middle to right + if ( m_pCurrentEntity->curstate.blending[0] <= 127 ) + { + StudioCalcRotations( pos, q, pseqdesc, panim, f ); + + // Scale 0-127 blending up to 0-255 + s = m_pCurrentEntity->curstate.blending[0]; + s = ( s * 2.0 ); + } + else + { + + // Skip ahead to middle + panim += m_pStudioHeader->numbones; + + StudioCalcRotations( pos, q, pseqdesc, panim, f ); + + // Scale 127-255 blending up to 0-255 + s = m_pCurrentEntity->curstate.blending[0]; + s = 2.0 * ( s - 127.0 ); + } + + // Normalize interpolant + s /= 255.0; + + // Go to middle or right + panim += m_pStudioHeader->numbones; + + StudioCalcRotations( pos2, q2, pseqdesc, panim, f ); + + // Spherically interpolate the bones + StudioSlerpBones( q, pos, q2, pos2, s ); + } + else + { + panim = StudioGetAnim( m_pRenderModel, pseqdesc ); + StudioCalcRotations( pos, q, pseqdesc, panim, f ); + } + + // Are we in the process of transitioning from one sequence to another. + if ( m_fDoInterp && + m_pCurrentEntity->latched.sequencetime && + ( m_pCurrentEntity->latched.sequencetime + 0.2 > m_clTime ) && + ( m_pCurrentEntity->latched.prevsequence < m_pStudioHeader->numseq )) + { + // blend from last sequence + static float pos1b[MAXSTUDIOBONES][3]; + static vec4_t q1b[MAXSTUDIOBONES]; + float s; + + // Blending value into last sequence + unsigned char prevseqblending = m_pCurrentEntity->latched.prevseqblending[ 0 ]; + + // Point at previous sequenece + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pCurrentEntity->latched.prevsequence; + + // Know how to do three way blends + if ( pseqdesc->numblends == 3 ) + { + float s; + + // Get left animation + panim = StudioGetAnim( m_pRenderModel, pseqdesc ); + + if ( prevseqblending <= 127 ) + { + // Set up bones based on final frame of previous sequence + StudioCalcRotations( pos1b, q1b, pseqdesc, panim, m_pCurrentEntity->latched.prevframe ); + + s = prevseqblending; + s = ( s * 2.0 ); + } + else + { + // Skip to middle blend + panim += m_pStudioHeader->numbones; + + StudioCalcRotations( pos1b, q1b, pseqdesc, panim, m_pCurrentEntity->latched.prevframe ); + + s = prevseqblending; + s = 2.0 * ( s - 127.0 ); + } + + // Normalize + s /= 255.0; + + panim += m_pStudioHeader->numbones; + StudioCalcRotations( pos2, q2, pseqdesc, panim, m_pCurrentEntity->latched.prevframe ); + + // Interpolate bones + StudioSlerpBones( q1b, pos1b, q2, pos2, s ); + } + else + { + panim = StudioGetAnim( m_pRenderModel, pseqdesc ); + // clip prevframe + StudioCalcRotations( pos1b, q1b, pseqdesc, panim, m_pCurrentEntity->latched.prevframe ); + } + + // Now blend last frame of previous sequence with current sequence. + s = 1.0 - (m_clTime - m_pCurrentEntity->latched.sequencetime) / 0.2; + StudioSlerpBones( q, pos, q1b, pos1b, s ); + } + else + { + m_pCurrentEntity->latched.prevframe = f; + } + + // Now convert quaternions and bone positions into matrices + pbones = (mstudiobone_t *)((byte *)m_pStudioHeader + m_pStudioHeader->boneindex); + + for (i = 0; i < m_pStudioHeader->numbones; i++) + { + QuaternionMatrix( q[i], bonematrix ); + + bonematrix[0][3] = pos[i][0]; + bonematrix[1][3] = pos[i][1]; + bonematrix[2][3] = pos[i][2]; + + if (pbones[i].parent == -1) + { + if ( IEngineStudio.IsHardware() ) + { + ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_pbonetransform)[i]); + ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]); + } + else + { + ConcatTransforms ((*m_paliastransform), bonematrix, (*m_pbonetransform)[i]); + ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]); + } + + // Apply client-side effects to the transformation matrix + StudioFxTransform( m_pCurrentEntity, (*m_pbonetransform)[i] ); + } + else + { + ConcatTransforms ((*m_pbonetransform)[pbones[i].parent], bonematrix, (*m_pbonetransform)[i]); + ConcatTransforms ((*m_plighttransform)[pbones[i].parent], bonematrix, (*m_plighttransform)[i]); + } + } +} + +/* +==================== +StudioEstimateGait + +==================== +*/ +void CGameStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer ) +{ + float dt; + vec3_t est_velocity; + + dt = (m_clTime - m_clOldTime); + dt = max( 0.0, dt ); + dt = min( 1.0, dt ); + + if (dt == 0 || m_pPlayerInfo->renderframe == m_nFrameCount) + { + m_flGaitMovement = 0; + return; + } + + // VectorAdd( pplayer->velocity, pplayer->prediction_error, est_velocity ); + if ( m_fGaitEstimation ) + { + VectorSubtract( m_pCurrentEntity->origin, m_pPlayerInfo->prevgaitorigin, est_velocity ); + VectorCopy( m_pCurrentEntity->origin, m_pPlayerInfo->prevgaitorigin ); + m_flGaitMovement = Length( est_velocity ); + if (dt <= 0 || m_flGaitMovement / dt < 5) + { + m_flGaitMovement = 0; + est_velocity[0] = 0; + est_velocity[1] = 0; + } + } + else + { + VectorCopy( pplayer->velocity, est_velocity ); + m_flGaitMovement = Length( est_velocity ) * dt; + } + + if (est_velocity[1] == 0 && est_velocity[0] == 0) + { + float flYawDiff = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw; + flYawDiff = flYawDiff - (int)(flYawDiff / 360) * 360; + if (flYawDiff > 180) + flYawDiff -= 360; + if (flYawDiff < -180) + flYawDiff += 360; + + if (dt < 0.25) + flYawDiff *= dt * 4; + else + flYawDiff *= dt; + + m_pPlayerInfo->gaityaw += flYawDiff; + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - (int)(m_pPlayerInfo->gaityaw / 360) * 360; + + m_flGaitMovement = 0; + } + else + { + m_pPlayerInfo->gaityaw = (atan2(est_velocity[1], est_velocity[0]) * 180 / M_PI); + if (m_pPlayerInfo->gaityaw > 180) + m_pPlayerInfo->gaityaw = 180; + if (m_pPlayerInfo->gaityaw < -180) + m_pPlayerInfo->gaityaw = -180; + } + +} + +/* +==================== +StudioProcessGait + +==================== +*/ +void CGameStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer ) +{ + mstudioseqdesc_t *pseqdesc; + float dt; + float flYaw; // view direction relative to movement + + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pCurrentEntity->curstate.sequence; + + m_pCurrentEntity->angles[PITCH] = 0; + m_pCurrentEntity->latched.prevangles[PITCH] = m_pCurrentEntity->angles[PITCH]; + + dt = (m_clTime - m_clOldTime); + dt = max( 0.0, dt ); + dt = min( 1.0, dt ); + + StudioEstimateGait( pplayer ); + + // calc side to side turning + flYaw = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw; + + flYaw = fmod( flYaw, 360.0 ); + + if (flYaw < -180) + { + flYaw = flYaw + 360; + } + else if (flYaw > 180) + { + flYaw = flYaw - 360; + } + + float maxyaw = 120.0; + + if (flYaw > maxyaw) + { + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - 180; + m_flGaitMovement = -m_flGaitMovement; + flYaw = flYaw - 180; + } + else if (flYaw < -maxyaw) + { + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw + 180; + m_flGaitMovement = -m_flGaitMovement; + flYaw = flYaw + 180; + } + + float blend_yaw = ( flYaw / 90.0 ) * 128.0 + 127.0; + blend_yaw = min( 255.0, blend_yaw ); + blend_yaw = max( 0.0, blend_yaw ); + + blend_yaw = 255.0 - blend_yaw; + + m_pCurrentEntity->curstate.blending[0] = (int)(blend_yaw); + m_pCurrentEntity->latched.prevblending[0] = m_pCurrentEntity->curstate.blending[0]; + m_pCurrentEntity->latched.prevseqblending[0] = m_pCurrentEntity->curstate.blending[0]; + + m_pCurrentEntity->angles[YAW] = m_pPlayerInfo->gaityaw; + if (m_pCurrentEntity->angles[YAW] < -0) + { + m_pCurrentEntity->angles[YAW] += 360; + } + m_pCurrentEntity->latched.prevangles[YAW] = m_pCurrentEntity->angles[YAW]; + + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + pplayer->gaitsequence; + + // Calc gait frame + if (pseqdesc->linearmovement[0] > 0) + { + m_pPlayerInfo->gaitframe += (m_flGaitMovement / pseqdesc->linearmovement[0]) * pseqdesc->numframes; + } + else + { + m_pPlayerInfo->gaitframe += pseqdesc->fps * dt * m_pCurrentEntity->curstate.framerate; + } + + // Do modulo + m_pPlayerInfo->gaitframe = m_pPlayerInfo->gaitframe - (int)(m_pPlayerInfo->gaitframe / pseqdesc->numframes) * pseqdesc->numframes; + if (m_pPlayerInfo->gaitframe < 0) + { + m_pPlayerInfo->gaitframe += pseqdesc->numframes; + } +} + +/* +============================== +SavePlayerState + +For local player, in third person, we need to store real render data and then + setup for with fake/client side animation data +============================== +*/ +void CGameStudioModelRenderer::SavePlayerState( entity_state_t *pplayer ) +{ + client_anim_state_t *st; + cl_entity_t *ent = IEngineStudio.GetCurrentEntity(); + assert( ent ); + if ( !ent ) + return; + + st = &g_state; + + st->angles = ent->curstate.angles; + st->origin = ent->curstate.origin; + + st->realangles = ent->angles; + + st->sequence = ent->curstate.sequence; + st->gaitsequence = pplayer->gaitsequence; + st->animtime = ent->curstate.animtime; + st->frame = ent->curstate.frame; + st->framerate = ent->curstate.framerate; + memcpy( st->blending, ent->curstate.blending, 2 ); + memcpy( st->controller, ent->curstate.controller, 4 ); + + st->lv = ent->latched; +} + +void GetSequenceInfo( void *pmodel, client_anim_state_t *pev, float *pflFrameRate, float *pflGroundSpeed ) +{ + studiohdr_t *pstudiohdr; + + pstudiohdr = (studiohdr_t *)pmodel; + if (! pstudiohdr) + return; + + mstudioseqdesc_t *pseqdesc; + + if (pev->sequence >= pstudiohdr->numseq) + { + *pflFrameRate = 0.0; + *pflGroundSpeed = 0.0; + return; + } + + pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + (int)pev->sequence; + + if (pseqdesc->numframes > 1) + { + *pflFrameRate = 256 * pseqdesc->fps / (pseqdesc->numframes - 1); + *pflGroundSpeed = sqrt( pseqdesc->linearmovement[0]*pseqdesc->linearmovement[0]+ pseqdesc->linearmovement[1]*pseqdesc->linearmovement[1]+ pseqdesc->linearmovement[2]*pseqdesc->linearmovement[2] ); + *pflGroundSpeed = *pflGroundSpeed * pseqdesc->fps / (pseqdesc->numframes - 1); + } + else + { + *pflFrameRate = 256.0; + *pflGroundSpeed = 0.0; + } +} + +int GetSequenceFlags( void *pmodel, client_anim_state_t *pev ) +{ + studiohdr_t *pstudiohdr; + + pstudiohdr = (studiohdr_t *)pmodel; + if ( !pstudiohdr || pev->sequence >= pstudiohdr->numseq ) + return 0; + + mstudioseqdesc_t *pseqdesc; + pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + (int)pev->sequence; + + return pseqdesc->flags; +} + +float StudioFrameAdvance ( client_anim_state_t *st, float framerate, float flInterval ) +{ + if (flInterval == 0.0) + { + flInterval = (gEngfuncs.GetClientTime() - st->animtime); + if (flInterval <= 0.001) + { + st->animtime = gEngfuncs.GetClientTime(); + return 0.0; + } + } + if (!st->animtime) + flInterval = 0.0; + + st->frame += flInterval * framerate * st->framerate; + st->animtime = gEngfuncs.GetClientTime(); + + if (st->frame < 0.0 || st->frame >= 256.0) + { + if ( st->m_fSequenceLoops ) + st->frame -= (int)(st->frame / 256.0) * 256.0; + else + st->frame = (st->frame < 0.0) ? 0 : 255; + st->m_fSequenceFinished = TRUE; // just in case it wasn't caught in GetEvents + } + + return flInterval; +} + +/* +============================== +SetupClientAnimation + +Called to set up local player's animation values +============================== +*/ +void CGameStudioModelRenderer::SetupClientAnimation( entity_state_t *pplayer ) +{ + static double oldtime; + double curtime, dt; + + client_anim_state_t *st; + float fr, gs; + + cl_entity_t *ent = IEngineStudio.GetCurrentEntity(); + assert( ent ); + if ( !ent ) + return; + + curtime = gEngfuncs.GetClientTime(); + dt = curtime - oldtime; + dt = min( 1.0, max( 0.0, dt ) ); + + oldtime = curtime; + st = &g_clientstate; + + st->framerate = 1.0; + + int oldseq = st->sequence; + Game_GetSequence( &st->sequence, &st->gaitsequence ); //CVAR_GET_FLOAT( "sequence" ); + Game_GetOrientation( (float *)&st->origin, (float *)&st->angles ); + st->realangles = st->angles; + + if ( st->sequence != oldseq ) + { + st->frame = 0.0; + st->lv.prevsequence = oldseq; + st->lv.sequencetime = st->animtime; + + memcpy( st->lv.prevseqblending, st->blending, 2 ); + memcpy( st->lv.prevcontroller, st->controller, 4 ); + } + + void *pmodel = (studiohdr_t *)IEngineStudio.Mod_Extradata( ent->model ); + + GetSequenceInfo( pmodel, st, &fr, &gs ); + st->m_fSequenceLoops = ((GetSequenceFlags( pmodel, st ) & STUDIO_LOOPING) != 0); + StudioFrameAdvance( st, fr, dt ); + +// gEngfuncs.Con_Printf( "gs %i frame %f\n", st->gaitsequence, st->frame ); + + ent->angles = st->realangles; + ent->curstate.angles = st->angles; + ent->curstate.origin = st->origin; + + ent->curstate.sequence = st->sequence; + pplayer->gaitsequence = st->gaitsequence; + ent->curstate.animtime = st->animtime; + ent->curstate.frame = st->frame; + ent->curstate.framerate = st->framerate; + memcpy( ent->curstate.blending, st->blending, 2 ); + memcpy( ent->curstate.controller, st->controller, 4 ); + + ent->latched = st->lv; +} + +/* +============================== +RestorePlayerState + +Called to restore original player state information +============================== +*/ +void CGameStudioModelRenderer::RestorePlayerState( entity_state_t *pplayer ) +{ + client_anim_state_t *st; + cl_entity_t *ent = IEngineStudio.GetCurrentEntity(); + assert( ent ); + if ( !ent ) + return; + + st = &g_clientstate; + + st->angles = ent->curstate.angles; + st->origin = ent->curstate.origin; + st->realangles = ent->angles; + + st->sequence = ent->curstate.sequence; + st->gaitsequence = pplayer->gaitsequence; + st->animtime = ent->curstate.animtime; + st->frame = ent->curstate.frame; + st->framerate = ent->curstate.framerate; + memcpy( st->blending, ent->curstate.blending, 2 ); + memcpy( st->controller, ent->curstate.controller, 4 ); + + st->lv = ent->latched; + + st = &g_state; + + ent->curstate.angles = st->angles; + ent->curstate.origin = st->origin; + ent->angles = st->realangles; + + ent->curstate.sequence = st->sequence; + pplayer->gaitsequence = st->gaitsequence; + ent->curstate.animtime = st->animtime; + ent->curstate.frame = st->frame; + ent->curstate.framerate = st->framerate; + memcpy( ent->curstate.blending, st->blending, 2 ); + memcpy( ent->curstate.controller, st->controller, 4 ); + + ent->latched = st->lv; +} + +/* +============================== +StudioDrawPlayer + +============================== +*/ +int CGameStudioModelRenderer::StudioDrawPlayer( int flags, entity_state_t *pplayer ) +{ + int iret = 0; + + bool isLocalPlayer = false; + + // Set up for client? + if ( m_bLocal && IEngineStudio.GetCurrentEntity() == gEngfuncs.GetLocalPlayer() ) + { + isLocalPlayer = true; + } + + if ( isLocalPlayer ) + { + // Store original data + SavePlayerState( pplayer ); + + // Copy in client side animation data + SetupClientAnimation( pplayer ); + } + + // Call real draw function + iret = _StudioDrawPlayer( flags, pplayer ); + + // Restore for client? + if ( isLocalPlayer ) + { + // Restore the original data for the player + RestorePlayerState( pplayer ); + } + + return iret; +} + +/* +==================== +_StudioDrawPlayer + +==================== +*/ +int CGameStudioModelRenderer::_StudioDrawPlayer( int flags, entity_state_t *pplayer ) +{ + alight_t lighting; + vec3_t dir; + + m_pCurrentEntity = IEngineStudio.GetCurrentEntity(); + IEngineStudio.GetTimes( &m_nFrameCount, &m_clTime, &m_clOldTime ); + IEngineStudio.GetViewInfo( m_vRenderOrigin, m_vUp, m_vRight, m_vNormal ); + IEngineStudio.GetAliasScale( &m_fSoftwareXScale, &m_fSoftwareYScale ); + + m_nPlayerIndex = pplayer->number - 1; + + if (m_nPlayerIndex < 0 || m_nPlayerIndex >= gEngfuncs.GetMaxClients()) + return 0; + + m_pRenderModel = IEngineStudio.SetupPlayerModel( m_nPlayerIndex ); + if (m_pRenderModel == NULL) + return 0; + + m_pStudioHeader = (studiohdr_t *)IEngineStudio.Mod_Extradata (m_pRenderModel); + IEngineStudio.StudioSetHeader( m_pStudioHeader ); + IEngineStudio.SetRenderModel( m_pRenderModel ); + + if (pplayer->gaitsequence) + { + vec3_t orig_angles; + m_pPlayerInfo = IEngineStudio.PlayerInfo( m_nPlayerIndex ); + + VectorCopy( m_pCurrentEntity->angles, orig_angles ); + + StudioProcessGait( pplayer ); + + m_pPlayerInfo->gaitsequence = pplayer->gaitsequence; + m_pPlayerInfo = NULL; + + StudioSetUpTransform( 0 ); + VectorCopy( orig_angles, m_pCurrentEntity->angles ); + } + else + { + m_pCurrentEntity->curstate.controller[0] = 127; + m_pCurrentEntity->curstate.controller[1] = 127; + m_pCurrentEntity->curstate.controller[2] = 127; + m_pCurrentEntity->curstate.controller[3] = 127; + m_pCurrentEntity->latched.prevcontroller[0] = m_pCurrentEntity->curstate.controller[0]; + m_pCurrentEntity->latched.prevcontroller[1] = m_pCurrentEntity->curstate.controller[1]; + m_pCurrentEntity->latched.prevcontroller[2] = m_pCurrentEntity->curstate.controller[2]; + m_pCurrentEntity->latched.prevcontroller[3] = m_pCurrentEntity->curstate.controller[3]; + + m_pPlayerInfo = IEngineStudio.PlayerInfo( m_nPlayerIndex ); + m_pPlayerInfo->gaitsequence = 0; + + StudioSetUpTransform( 0 ); + } + + if (flags & STUDIO_RENDER) + { + // see if the bounding box lets us trivially reject, also sets + if (!IEngineStudio.StudioCheckBBox ()) + return 0; + + (*m_pModelsDrawn)++; + (*m_pStudioModelCount)++; // render data cache cookie + + if (m_pStudioHeader->numbodyparts == 0) + return 1; + } + + m_pPlayerInfo = IEngineStudio.PlayerInfo( m_nPlayerIndex ); + StudioSetupBones( ); + StudioSaveBones( ); + m_pPlayerInfo->renderframe = m_nFrameCount; + + m_pPlayerInfo = NULL; + + if (flags & STUDIO_EVENTS) + { + StudioCalcAttachments( ); + IEngineStudio.StudioClientEvents( ); + // copy attachments into global entity array + if ( m_pCurrentEntity->index > 0 ) + { + cl_entity_t *ent = gEngfuncs.GetEntityByIndex( m_pCurrentEntity->index ); + + memcpy( ent->attachment, m_pCurrentEntity->attachment, sizeof( vec3_t ) * 4 ); + } + } + + if (flags & STUDIO_RENDER) + { + /* + if (m_pCvarHiModels->value && m_pRenderModel != m_pCurrentEntity->model ) + { + // show highest resolution multiplayer model + m_pCurrentEntity->curstate.body = 255; + } + + if (!(m_pCvarDeveloper->value == 0 && gEngfuncs.GetMaxClients() == 1 ) && ( m_pRenderModel == m_pCurrentEntity->model ) ) + { + m_pCurrentEntity->curstate.body = 1; // force helmet + } + */ + + lighting.plightvec = dir; + IEngineStudio.StudioDynamicLight(m_pCurrentEntity, &lighting ); + + IEngineStudio.StudioEntityLight( &lighting ); + + // model and frame independant + IEngineStudio.StudioSetupLighting (&lighting); + + m_pPlayerInfo = IEngineStudio.PlayerInfo( m_nPlayerIndex ); + + // get remap colors + m_nTopColor = m_pPlayerInfo->topcolor; + if (m_nTopColor < 0) + m_nTopColor = 0; + if (m_nTopColor > 360) + m_nTopColor = 360; + m_nBottomColor = m_pPlayerInfo->bottomcolor; + if (m_nBottomColor < 0) + m_nBottomColor = 0; + if (m_nBottomColor > 360) + m_nBottomColor = 360; + + IEngineStudio.StudioSetRemapColors( m_nTopColor, m_nBottomColor ); + + StudioRenderModel( ); + m_pPlayerInfo = NULL; + + if (pplayer->weaponmodel) + { + cl_entity_t saveent = *m_pCurrentEntity; + + model_t *pweaponmodel = IEngineStudio.GetModelByIndex( pplayer->weaponmodel ); + + m_pStudioHeader = (studiohdr_t *)IEngineStudio.Mod_Extradata (pweaponmodel); + IEngineStudio.StudioSetHeader( m_pStudioHeader ); + + StudioMergeBones( pweaponmodel); + + IEngineStudio.StudioSetupLighting (&lighting); + + StudioRenderModel( ); + + StudioCalcAttachments( ); + + *m_pCurrentEntity = saveent; + } + } + + return 1; +} + +/* +==================== +Studio_FxTransform + +==================== +*/ +void CGameStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[3][4] ) +{ + switch( ent->curstate.renderfx ) + { + case kRenderFxDistort: + case kRenderFxHologram: + if ( gEngfuncs.pfnRandomLong(0,49) == 0 ) + { + int axis = gEngfuncs.pfnRandomLong(0,1); + if ( axis == 1 ) // Choose between x & z + axis = 2; + VectorScale( transform[axis], gEngfuncs.pfnRandomFloat(1,1.484), transform[axis] ); + } + else if ( gEngfuncs.pfnRandomLong(0,49) == 0 ) + { + float offset; + int axis = gEngfuncs.pfnRandomLong(0,1); + if ( axis == 1 ) // Choose between x & z + axis = 2; + offset = gEngfuncs.pfnRandomFloat(-10,10); + transform[gEngfuncs.pfnRandomLong(0,2)][3] += offset; + } + break; + case kRenderFxExplode: + { + if ( iRenderStateChanged ) + { + g_flStartScaleTime = m_clTime; + iRenderStateChanged = FALSE; + } + + // Make the Model continue to shrink + float flTimeDelta = m_clTime - g_flStartScaleTime; + if ( flTimeDelta > 0 ) + { + float flScale = 0.001; + // Goes almost all away + if ( flTimeDelta <= 2.0 ) + flScale = 1.0 - (flTimeDelta / 2.0); + + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + transform[i][j] *= flScale; + } + } + } + break; + } +} + +//////////////////////////////////// +// Hooks to class implementation +//////////////////////////////////// + +/* +==================== +R_StudioDrawPlayer + +==================== +*/ +int R_StudioDrawPlayer( int flags, entity_state_t *pplayer ) +{ + return g_StudioRenderer.StudioDrawPlayer( flags, pplayer ); +} + +/* +==================== +R_StudioDrawModel + +==================== +*/ +int R_StudioDrawModel( int flags ) +{ + return g_StudioRenderer.StudioDrawModel( flags ); +} + +/* +==================== +R_StudioInit + +==================== +*/ +void R_StudioInit( void ) +{ + g_StudioRenderer.Init(); +} + +// The simple drawing interface we'll pass back to the engine +r_studio_interface_t studio = +{ + STUDIO_INTERFACE_VERSION, + R_StudioDrawModel, + R_StudioDrawPlayer, +}; + +/* +==================== +HUD_GetStudioModelInterface + +Export this function for the engine to use the studio renderer class to render objects. +==================== +*/ +#define DLLEXPORT __declspec( dllexport ) +extern "C" int DLLEXPORT HUD_GetStudioModelInterface( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio ) +{ + if ( version != STUDIO_INTERFACE_VERSION ) + return 0; + + // Point the engine to our callbacks + *ppinterface = &studio; + + // Copy in engine helper functions + memcpy( &IEngineStudio, pstudio, sizeof( IEngineStudio ) ); + + // Initialize local variables, etc. + R_StudioInit(); + + // Success + return 1; +} diff --git a/main/source/cl_dll/GameStudioModelRenderer_Sample.h b/main/source/cl_dll/GameStudioModelRenderer_Sample.h new file mode 100644 index 00000000..3fe5ea5c --- /dev/null +++ b/main/source/cl_dll/GameStudioModelRenderer_Sample.h @@ -0,0 +1,48 @@ +#if !defined( GAMESTUDIOMODELRENDERER_H ) +#define GAMESTUDIOMODELRENDERER_H +#if defined( _WIN32 ) +#pragma once +#endif + +/* +==================== +CGameStudioModelRenderer + +==================== +*/ +class CGameStudioModelRenderer : public CStudioModelRenderer +{ +public: + CGameStudioModelRenderer( void ); + + // Set up model bone positions + virtual void StudioSetupBones ( void ); + + // Estimate gait frame for player + virtual void StudioEstimateGait ( entity_state_t *pplayer ); + + // Process movement of player + virtual void StudioProcessGait ( entity_state_t *pplayer ); + + // Player drawing code + virtual int StudioDrawPlayer( int flags, entity_state_t *pplayer ); + virtual int _StudioDrawPlayer( int flags, entity_state_t *pplayer ); + + // Apply special effects to transform matrix + virtual void StudioFxTransform( cl_entity_t *ent, float transform[3][4] ); + +private: + // For local player, in third person, we need to store real render data and then + // setup for with fake/client side animation data + void SavePlayerState( entity_state_t *pplayer ); + // Called to set up local player's animation values + void SetupClientAnimation( entity_state_t *pplayer ); + // Called to restore original player state information + void RestorePlayerState( entity_state_t *pplayer ); + +private: + // Private data + bool m_bLocal; +}; + +#endif // GAMESTUDIOMODELRENDERER_H \ No newline at end of file diff --git a/main/source/cl_dll/StudioModelRenderer.cpp b/main/source/cl_dll/StudioModelRenderer.cpp new file mode 100644 index 00000000..274429be --- /dev/null +++ b/main/source/cl_dll/StudioModelRenderer.cpp @@ -0,0 +1,1910 @@ +// studio_model.cpp +// routines for setting up to draw 3DStudio models + +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "com_model.h" +#include "studio.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "dlight.h" +#include "triangleapi.h" + +#include +#include +#include +#include + +#include "studio_util.h" +#include "r_studioint.h" + +#include "StudioModelRenderer.h" +#include "GameStudioModelRenderer.h" + +#include "util/MathUtil.h" + +// Global engine <-> studio model rendering code interface +engine_studio_api_t IEngineStudio; + +#include "mod/AvHSpecials.h" + +int GetRenderModeForModelName(int inRenderMode, char* inName) +{ + int theRenderMode = inRenderMode; + +// if(!strncmp("tcol", inName, 4)) +// { +// theRenderMode = kRenderTransColor; +// } + if(!strncmp("ttex", inName, 4)) + { + theRenderMode = kRenderTransTexture; + } + else if(!strncmp("glow", inName, 4)) + { + theRenderMode = kRenderGlow; + } + else if(!strncmp("talp", inName, 4)) + { + theRenderMode = kRenderTransAlpha; + } + else if(!strncmp("tadd", inName, 4)) + { + theRenderMode = kRenderTransAdd; + } + + return theRenderMode; +} + + +///////////////////// +// Implementation of CStudioModelRenderer.h + +/* +==================== +Init + +==================== +*/ +void CStudioModelRenderer::Init( void ) +{ + // Set up some variables shared with engine + m_pCvarHiModels = IEngineStudio.GetCvar( "cl_himodels" ); + m_pCvarDeveloper = IEngineStudio.GetCvar( "developer" ); + m_pCvarDrawEntities = IEngineStudio.GetCvar( "r_drawentities" ); + + m_pChromeSprite = IEngineStudio.GetChromeSprite(); + + IEngineStudio.GetModelCounters( &m_pStudioModelCount, &m_pModelsDrawn ); + + // Get pointers to engine data structures + m_pbonetransform = (float (*)[MAXSTUDIOBONES][3][4])IEngineStudio.StudioGetBoneTransform(); + m_plighttransform = (float (*)[MAXSTUDIOBONES][3][4])IEngineStudio.StudioGetLightTransform(); + m_paliastransform = (float (*)[3][4])IEngineStudio.StudioGetAliasTransform(); + m_protationmatrix = (float (*)[3][4])IEngineStudio.StudioGetRotationMatrix(); +} + +/* +==================== +CStudioModelRenderer + +==================== +*/ +CStudioModelRenderer::CStudioModelRenderer( void ) +{ + m_fDoInterp = 1; + m_fGaitEstimation = 1; + m_pCurrentEntity = NULL; + m_pCvarHiModels = NULL; + m_pCvarDeveloper = NULL; + m_pCvarDrawEntities = NULL; + m_pChromeSprite = NULL; + m_pStudioModelCount = NULL; + m_pModelsDrawn = NULL; + m_protationmatrix = NULL; + m_paliastransform = NULL; + m_pbonetransform = NULL; + m_plighttransform = NULL; + m_pStudioHeader = NULL; + m_pBodyPart = NULL; + m_pSubModel = NULL; + m_pPlayerInfo = NULL; + m_pRenderModel = NULL; +} + +/* +==================== +~CStudioModelRenderer + +==================== +*/ +CStudioModelRenderer::~CStudioModelRenderer( void ) +{ +} + +/* +==================== +StudioCalcBoneAdj + +==================== +*/ +void CStudioModelRenderer::StudioCalcBoneAdj( float dadt, float *adj, const byte *pcontroller1, const byte *pcontroller2, byte mouthopen ) +{ + int i, j; + float value; + mstudiobonecontroller_t *pbonecontroller; + + pbonecontroller = (mstudiobonecontroller_t *)((byte *)m_pStudioHeader + m_pStudioHeader->bonecontrollerindex); + + for (j = 0; j < m_pStudioHeader->numbonecontrollers; j++) + { + i = pbonecontroller[j].index; + if (i <= 3) + { + // check for 360% wrapping + if (pbonecontroller[j].type & STUDIO_RLOOP) + { + if (abs(pcontroller1[i] - pcontroller2[i]) > 128) + { + int a, b; + a = (pcontroller1[j] + 128) % 256; + b = (pcontroller2[j] + 128) % 256; + value = ((a * dadt) + (b * (1 - dadt)) - 128) * (360.0/256.0) + pbonecontroller[j].start; + } + else + { + value = ((pcontroller1[i] * dadt + (pcontroller2[i]) * (1.0 - dadt))) * (360.0/256.0) + pbonecontroller[j].start; + } + } + else + { + value = (pcontroller1[i] * dadt + pcontroller2[i] * (1.0 - dadt)) / 255.0; + if (value < 0) value = 0; + if (value > 1.0) value = 1.0; + value = (1.0 - value) * pbonecontroller[j].start + value * pbonecontroller[j].end; + } + // Con_DPrintf( "%d %d %f : %f\n", m_pCurrentEntity->curstate.controller[j], m_pCurrentEntity->latched.prevcontroller[j], value, dadt ); + } + else + { + value = mouthopen / 64.0; + if (value > 1.0) value = 1.0; + value = (1.0 - value) * pbonecontroller[j].start + value * pbonecontroller[j].end; + // Con_DPrintf("%d %f\n", mouthopen, value ); + } + switch(pbonecontroller[j].type & STUDIO_TYPES) + { + case STUDIO_XR: + case STUDIO_YR: + case STUDIO_ZR: + adj[j] = value * (M_PI / 180.0); + break; + case STUDIO_X: + case STUDIO_Y: + case STUDIO_Z: + adj[j] = value; + break; + } + } +} + + +/* +==================== +StudioCalcBoneQuaterion + +==================== +*/ +void CStudioModelRenderer::StudioCalcBoneQuaterion( int frame, float s, mstudiobone_t *pbone, mstudioanim_t *panim, float *adj, float *q ) +{ + int j, k; + vec4_t q1, q2; + vec3_t angle1, angle2; + mstudioanimvalue_t *panimvalue; + + for (j = 0; j < 3; j++) + { + if (panim->offset[j+3] == 0) + { + angle2[j] = angle1[j] = pbone->value[j+3]; // default; + } + else + { + panimvalue = (mstudioanimvalue_t *)((byte *)panim + panim->offset[j+3]); + k = frame; + // DEBUG + if (panimvalue->num.total < panimvalue->num.valid) + k = 0; + while (panimvalue->num.total <= k) + { + k -= panimvalue->num.total; + panimvalue += panimvalue->num.valid + 1; + // DEBUG + if (panimvalue->num.total < panimvalue->num.valid) + k = 0; + } + // Bah, missing blend! + if (panimvalue->num.valid > k) + { + angle1[j] = panimvalue[k+1].value; + + if (panimvalue->num.valid > k + 1) + { + angle2[j] = panimvalue[k+2].value; + } + else + { + if (panimvalue->num.total > k + 1) + angle2[j] = angle1[j]; + else + angle2[j] = panimvalue[panimvalue->num.valid+2].value; + } + } + else + { + angle1[j] = panimvalue[panimvalue->num.valid].value; + if (panimvalue->num.total > k + 1) + { + angle2[j] = angle1[j]; + } + else + { + angle2[j] = panimvalue[panimvalue->num.valid + 2].value; + } + } + angle1[j] = pbone->value[j+3] + angle1[j] * pbone->scale[j+3]; + angle2[j] = pbone->value[j+3] + angle2[j] * pbone->scale[j+3]; + } + + if (pbone->bonecontroller[j+3] != -1) + { + angle1[j] += adj[pbone->bonecontroller[j+3]]; + angle2[j] += adj[pbone->bonecontroller[j+3]]; + } + } + + if (!VectorCompare( angle1, angle2 )) + { + AngleQuaternion( angle1, q1 ); + AngleQuaternion( angle2, q2 ); + QuaternionSlerp( q1, q2, s, q ); + } + else + { + AngleQuaternion( angle1, q ); + } +} + +/* +==================== +StudioCalcBonePosition + +==================== +*/ +void CStudioModelRenderer::StudioCalcBonePosition( int frame, float s, mstudiobone_t *pbone, mstudioanim_t *panim, float *adj, float *pos ) +{ + int j, k; + mstudioanimvalue_t *panimvalue; + + for (j = 0; j < 3; j++) + { + pos[j] = pbone->value[j]; // default; + if (panim->offset[j] != 0) + { + panimvalue = (mstudioanimvalue_t *)((byte *)panim + panim->offset[j]); + /* + if (i == 0 && j == 0) + Con_DPrintf("%d %d:%d %f\n", frame, panimvalue->num.valid, panimvalue->num.total, s ); + */ + + k = frame; + // DEBUG + if (panimvalue->num.total < panimvalue->num.valid) + k = 0; + // find span of values that includes the frame we want + while (panimvalue->num.total <= k) + { + k -= panimvalue->num.total; + panimvalue += panimvalue->num.valid + 1; + // DEBUG + if (panimvalue->num.total < panimvalue->num.valid) + k = 0; + } + // if we're inside the span + if (panimvalue->num.valid > k) + { + // and there's more data in the span + if (panimvalue->num.valid > k + 1) + { + pos[j] += (panimvalue[k+1].value * (1.0 - s) + s * panimvalue[k+2].value) * pbone->scale[j]; + } + else + { + pos[j] += panimvalue[k+1].value * pbone->scale[j]; + } + } + else + { + // are we at the end of the repeating values section and there's another section with data? + if (panimvalue->num.total <= k + 1) + { + pos[j] += (panimvalue[panimvalue->num.valid].value * (1.0 - s) + s * panimvalue[panimvalue->num.valid + 2].value) * pbone->scale[j]; + } + else + { + pos[j] += panimvalue[panimvalue->num.valid].value * pbone->scale[j]; + } + } + } + if ( pbone->bonecontroller[j] != -1 && adj ) + { + pos[j] += adj[pbone->bonecontroller[j]]; + } + } +} + +/* +==================== +StudioSlerpBones + +==================== +*/ +void CStudioModelRenderer::StudioSlerpBones( vec4_t q1[], float pos1[][3], vec4_t q2[], float pos2[][3], float s ) +{ + int i; + vec4_t q3; + float s1; + + if (s < 0) s = 0; + else if (s > 1.0) s = 1.0; + + s1 = 1.0 - s; + + for (i = 0; i < m_pStudioHeader->numbones; i++) + { + QuaternionSlerp( q1[i], q2[i], s, q3 ); + q1[i][0] = q3[0]; + q1[i][1] = q3[1]; + q1[i][2] = q3[2]; + q1[i][3] = q3[3]; + pos1[i][0] = pos1[i][0] * s1 + pos2[i][0] * s; + pos1[i][1] = pos1[i][1] * s1 + pos2[i][1] * s; + pos1[i][2] = pos1[i][2] * s1 + pos2[i][2] * s; + } +} + +/* +==================== +StudioGetAnim + +==================== +*/ +mstudioanim_t *CStudioModelRenderer::StudioGetAnim( model_t *m_pSubModel, mstudioseqdesc_t *pseqdesc ) +{ + mstudioseqgroup_t *pseqgroup; + cache_user_t *paSequences; + + pseqgroup = (mstudioseqgroup_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqgroupindex) + pseqdesc->seqgroup; + + if (pseqdesc->seqgroup == 0) + { + return (mstudioanim_t *)((byte *)m_pStudioHeader + pseqgroup->data + pseqdesc->animindex); + } + + paSequences = (cache_user_t *)m_pSubModel->submodels; + + if (paSequences == NULL) + { + paSequences = (cache_user_t *)IEngineStudio.Mem_Calloc( 16, sizeof( cache_user_t ) ); // UNDONE: leak! + m_pSubModel->submodels = (dmodel_t *)paSequences; + } + + if (!IEngineStudio.Cache_Check( (struct cache_user_s *)&(paSequences[pseqdesc->seqgroup]))) + { + gEngfuncs.Con_DPrintf("loading %s\n", pseqgroup->name ); + IEngineStudio.LoadCacheFile( pseqgroup->name, (struct cache_user_s *)&paSequences[pseqdesc->seqgroup] ); + } + return (mstudioanim_t *)((byte *)paSequences[pseqdesc->seqgroup].data + pseqdesc->animindex); +} + +/* +==================== +StudioPlayerBlend + +==================== +*/ +void CStudioModelRenderer::StudioPlayerBlend( mstudioseqdesc_t *pseqdesc, int *pBlend, float *pPitch ) +{ + // calc up/down pointing + *pBlend = (*pPitch * 3); + if (*pBlend < pseqdesc->blendstart[0]) + { + *pPitch -= pseqdesc->blendstart[0] / 3.0; + *pBlend = 0; + } + else if (*pBlend > pseqdesc->blendend[0]) + { + *pPitch -= pseqdesc->blendend[0] / 3.0; + *pBlend = 255; + } + else + { + if (pseqdesc->blendend[0] - pseqdesc->blendstart[0] < 0.1) // catch qc error + *pBlend = 127; + else + *pBlend = 255 * (*pBlend - pseqdesc->blendstart[0]) / (pseqdesc->blendend[0] - pseqdesc->blendstart[0]); + *pPitch = 0; + } +} + +/* +==================== +StudioSetUpTransform + +==================== +*/ +void CStudioModelRenderer::StudioSetUpTransform (int trivial_accept) +{ + int i; + vec3_t angles; + vec3_t modelpos; + +// tweek model origin + //for (i = 0; i < 3; i++) + // modelpos[i] = m_pCurrentEntity->origin[i]; + + VectorCopy( m_pCurrentEntity->origin, modelpos ); + +// TODO: should really be stored with the entity instead of being reconstructed +// TODO: should use a look-up table +// TODO: could cache lazily, stored in the entity + angles[ROLL] = m_pCurrentEntity->curstate.angles[ROLL]; + angles[PITCH] = m_pCurrentEntity->curstate.angles[PITCH]; + angles[YAW] = m_pCurrentEntity->curstate.angles[YAW]; + + //Con_DPrintf("Angles %4.2f prev %4.2f for %i\n", angles[PITCH], m_pCurrentEntity->index); + //Con_DPrintf("movetype %d %d\n", m_pCurrentEntity->movetype, m_pCurrentEntity->aiment ); + + if (m_pCurrentEntity->curstate.movetype == MOVETYPE_STEP) + { + float f = 0; + float d; + + // don't do it if the goalstarttime hasn't updated in a while. + + // NOTE: Because we need to interpolate multiplayer characters, the interpolation time limit + // was increased to 1.0 s., which is 2x the max lag we are accounting for. + + if ( ( m_clTime < m_pCurrentEntity->curstate.animtime + 1.0f ) && + ( m_pCurrentEntity->curstate.animtime != m_pCurrentEntity->latched.prevanimtime ) ) + { + f = (m_clTime - m_pCurrentEntity->curstate.animtime) / (m_pCurrentEntity->curstate.animtime - m_pCurrentEntity->latched.prevanimtime); + //Con_DPrintf("%4.2f %.2f %.2f\n", f, m_pCurrentEntity->curstate.animtime, m_clTime); + } + + if (m_fDoInterp) + { + // ugly hack to interpolate angle, position. current is reached 0.1 seconds after being set + f = f - 1.0; + } + else + { + f = 0; + } + + for (i = 0; i < 3; i++) + { + modelpos[i] += (m_pCurrentEntity->origin[i] - m_pCurrentEntity->latched.prevorigin[i]) * f; + } + + // NOTE: Because multiplayer lag can be relatively large, we don't want to cap + // f at 1.5 anymore. + //if (f > -1.0 && f < 1.5) {} + +// Con_DPrintf("%.0f %.0f\n",m_pCurrentEntity->msg_angles[0][YAW], m_pCurrentEntity->msg_angles[1][YAW] ); + for (i = 0; i < 3; i++) + { + float ang1, ang2; + + ang1 = m_pCurrentEntity->angles[i]; + ang2 = m_pCurrentEntity->latched.prevangles[i]; + + d = ang1 - ang2; + if (d > 180) + { + d -= 360; + } + else if (d < -180) + { + d += 360; + } + + angles[i] += d * f; + } + //Con_DPrintf("%.3f \n", f ); + } + else if ( m_pCurrentEntity->curstate.movetype != MOVETYPE_NONE ) + { + VectorCopy( m_pCurrentEntity->angles, angles ); + } + + // Added by mmcguire. + + if (m_pCurrentEntity->curstate.iuser3 == AVH_USER3_ALIEN_PLAYER1) + { + + // Override the orientation with the values stored in vuser1. + + VectorCopy(m_pCurrentEntity->curstate.vuser1, angles); + + // The code that sets up the transformation negates the pitch + // for some reason, so compensate for that here. + + angles[PITCH] = -angles[PITCH]; + + } + + +// bool theIsWallSticking = GetHasUpgrade(m_pCurrentEntity->curstate.iuser4, MASK_WALLSTICKING); +// if(theIsWallSticking) +// { +// //RotateFloatValuesByVector(angles[ROLL], angles[YAW], angles[PITCH], m_pCurrentEntity->curstate.vuser1); +// //VectorCopy(m_pCurrentEntity->curstate.vuser1, angles); +// +// // Surface normal is in vuser1. Transform current forward to new forward +// vec3_t theCurrentForward; +// vec3_t theCurrentRight; +// vec3_t theCurrentUp; +// gEngfuncs.pfnAngleVectors(angles, theCurrentForward, theCurrentRight, theCurrentUp); +// +// vec3_t theWallUp = m_pCurrentEntity->curstate.vuser1; +// +// vec3_t theWallSide; +// CrossProduct(theWallUp, theCurrentForward, theWallSide); +// +// vec3_t theWallForward; +// //CrossProduct(theWallUp, theWallSide, theWallForward); +// VectorCopy(theCurrentForward, theWallForward); +// +// // Build matrix to transform current frame of reference to that of sticking to wall +// float theViewToWallMatrix[3][4]; +// theViewToWallMatrix[0][0] = theWallForward.x; +// theViewToWallMatrix[0][1] = theWallForward.y; +// theViewToWallMatrix[0][2] = theWallForward.z; +// +// theViewToWallMatrix[1][0] = theWallSide.x; +// theViewToWallMatrix[1][1] = theWallSide.y; +// theViewToWallMatrix[1][2] = theWallSide.z; +// +// theViewToWallMatrix[2][0] = theWallUp.x; +// theViewToWallMatrix[2][1] = theWallUp.y; +// theViewToWallMatrix[2][2] = theWallUp.z; +// +// vec3_t theNewForward; +// VectorTransform(theCurrentForward, theViewToWallMatrix, theNewForward); +// +// // Transform new forward to angles +// VectorAngles(theNewForward, angles); +// } + + //Con_DPrintf("%.0f %0.f %0.f\n", modelpos[0], modelpos[1], modelpos[2] ); + //Con_DPrintf("%.0f %0.f %0.f\n", angles[0], angles[1], angles[2] ); + + angles[PITCH] = -angles[PITCH]; + AngleMatrix (angles, (*m_protationmatrix)); + + if ( !IEngineStudio.IsHardware() ) + { + static float viewmatrix[3][4]; + + VectorCopy (m_vRight, viewmatrix[0]); + VectorCopy (m_vUp, viewmatrix[1]); + VectorInverse (viewmatrix[1]); + VectorCopy (m_vNormal, viewmatrix[2]); + + (*m_protationmatrix)[0][3] = modelpos[0] - m_vRenderOrigin[0]; + (*m_protationmatrix)[1][3] = modelpos[1] - m_vRenderOrigin[1]; + (*m_protationmatrix)[2][3] = modelpos[2] - m_vRenderOrigin[2]; + + ConcatTransforms (viewmatrix, (*m_protationmatrix), (*m_paliastransform)); + + // do the scaling up of x and y to screen coordinates as part of the transform + // for the unclipped case (it would mess up clipping in the clipped case). + // Also scale down z, so 1/z is scaled 31 bits for free, and scale down x and y + // correspondingly so the projected x and y come out right + // FIXME: make this work for clipped case too? + if (trivial_accept) + { + for (i=0 ; i<4 ; i++) + { + (*m_paliastransform)[0][i] *= m_fSoftwareXScale * + (1.0 / (ZISCALE * 0x10000)); + (*m_paliastransform)[1][i] *= m_fSoftwareYScale * + (1.0 / (ZISCALE * 0x10000)); + (*m_paliastransform)[2][i] *= 1.0 / (ZISCALE * 0x10000); + + } + } + } + + (*m_protationmatrix)[0][3] = modelpos[0]; + (*m_protationmatrix)[1][3] = modelpos[1]; + (*m_protationmatrix)[2][3] = modelpos[2]; +} + + +/* +==================== +StudioEstimateInterpolant + +==================== +*/ +float CStudioModelRenderer::StudioEstimateInterpolant( void ) +{ + float dadt = 1.0; + + if ( m_fDoInterp && ( m_pCurrentEntity->curstate.animtime >= m_pCurrentEntity->latched.prevanimtime + 0.01 ) ) + { + dadt = (m_clTime - m_pCurrentEntity->curstate.animtime) / 0.1; + if (dadt > 2.0) + { + dadt = 2.0; + } + } + return dadt; +} + +/* +==================== +StudioCalcRotations + +==================== +*/ +void CStudioModelRenderer::StudioCalcRotations ( float pos[][3], vec4_t *q, mstudioseqdesc_t *pseqdesc, mstudioanim_t *panim, float f ) +{ + int i; + int frame; + mstudiobone_t *pbone; + + float s; + float adj[MAXSTUDIOCONTROLLERS]; + float dadt; + + if (f > pseqdesc->numframes - 1) + { + f = 0; // bah, fix this bug with changing sequences too fast + } + // BUG ( somewhere else ) but this code should validate this data. + // This could cause a crash if the frame # is negative, so we'll go ahead + // and clamp it here + else if ( f < -0.01 ) + { + f = -0.01; + } + + frame = (int)f; + + //gEngfuncs.Con_DPrintf("%d %.4f %.4f %.4f %.4f %d\n", m_pCurrentEntity->curstate.sequence, m_clTime, m_pCurrentEntity->animtime, m_pCurrentEntity->frame, f, frame ); + + // gEngfuncs.Con_DPrintf( "%f %f %f\n", m_pCurrentEntity->angles[ROLL], m_pCurrentEntity->angles[PITCH], m_pCurrentEntity->angles[YAW] ); + + //gEngfuncs.Con_DPrintf("frame %d %d\n", frame1, frame2 ); + + + dadt = StudioEstimateInterpolant( ); + s = (f - frame); + + // add in programtic controllers + pbone = (mstudiobone_t *)((byte *)m_pStudioHeader + m_pStudioHeader->boneindex); + + StudioCalcBoneAdj( dadt, adj, m_pCurrentEntity->curstate.controller, m_pCurrentEntity->latched.prevcontroller, m_pCurrentEntity->mouth.mouthopen ); + + for (i = 0; i < m_pStudioHeader->numbones; i++, pbone++, panim++) + { + StudioCalcBoneQuaterion( frame, s, pbone, panim, adj, q[i] ); + + StudioCalcBonePosition( frame, s, pbone, panim, adj, pos[i] ); + // if (0 && i == 0) + // Con_DPrintf("%d %d %d %d\n", m_pCurrentEntity->curstate.sequence, frame, j, k ); + } + + if (pseqdesc->motiontype & STUDIO_X) + { + pos[pseqdesc->motionbone][0] = 0.0; + } + if (pseqdesc->motiontype & STUDIO_Y) + { + pos[pseqdesc->motionbone][1] = 0.0; + } + if (pseqdesc->motiontype & STUDIO_Z) + { + pos[pseqdesc->motionbone][2] = 0.0; + } + + //gEngfuncs.Con_Printf("framerate %f\n", m_pCurrentEntity->curstate.framerate); + + s = 0 * ((1.0 - (f - (int)(f))) / (pseqdesc->numframes)) * m_pCurrentEntity->curstate.framerate; + + if (pseqdesc->motiontype & STUDIO_LX) + { + pos[pseqdesc->motionbone][0] += s * pseqdesc->linearmovement[0]; + } + if (pseqdesc->motiontype & STUDIO_LY) + { + pos[pseqdesc->motionbone][1] += s * pseqdesc->linearmovement[1]; + } + if (pseqdesc->motiontype & STUDIO_LZ) + { + pos[pseqdesc->motionbone][2] += s * pseqdesc->linearmovement[2]; + } +} + +/* +==================== +Studio_FxTransform + +==================== +*/ +void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[3][4] ) +{ + switch( ent->curstate.renderfx ) + { + case kRenderFxDistort: + case kRenderFxHologram: + if ( gEngfuncs.pfnRandomLong(0,49) == 0 ) + { + int axis = gEngfuncs.pfnRandomLong(0,1); + if ( axis == 1 ) // Choose between x & z + axis = 2; + VectorScale( transform[axis], gEngfuncs.pfnRandomFloat(1,1.484), transform[axis] ); + } + else if ( gEngfuncs.pfnRandomLong(0,49) == 0 ) + { + float offset; + int axis = gEngfuncs.pfnRandomLong(0,1); + if ( axis == 1 ) // Choose between x & z + axis = 2; + offset = gEngfuncs.pfnRandomFloat(-10,10); + transform[gEngfuncs.pfnRandomLong(0,2)][3] += offset; + } + break; + case kRenderFxExplode: + { + float scale; + + scale = 1.0 + ( m_clTime - ent->curstate.animtime) * 10.0; + if ( scale > 2 ) // Don't blow up more than 200% + scale = 2; + transform[0][1] *= scale; + transform[1][1] *= scale; + transform[2][1] *= scale; + } + break; + + } +} + +/* +==================== +StudioEstimateFrame + +==================== +*/ +float CStudioModelRenderer::StudioEstimateFrame( mstudioseqdesc_t *pseqdesc ) +{ + double dfdt, f; + + if ( m_fDoInterp ) + { + if ( m_clTime < m_pCurrentEntity->curstate.animtime ) + { + dfdt = 0; + } + else + { + dfdt = (m_clTime - m_pCurrentEntity->curstate.animtime) * m_pCurrentEntity->curstate.framerate * pseqdesc->fps; + + } + } + else + { + dfdt = 0; + } + + if (pseqdesc->numframes <= 1) + { + f = 0; + } + else + { + f = (m_pCurrentEntity->curstate.frame * (pseqdesc->numframes - 1)) / 256.0; + } + + f += dfdt; + + if (pseqdesc->flags & STUDIO_LOOPING) + { + if (pseqdesc->numframes > 1) + { + f -= (int)(f / (pseqdesc->numframes - 1)) * (pseqdesc->numframes - 1); + } + if (f < 0) + { + f += (pseqdesc->numframes - 1); + } + } + else + { + if (f >= pseqdesc->numframes - 1.001) + { + f = pseqdesc->numframes - 1.001; + } + if (f < 0.0) + { + f = 0.0; + } + } + return f; +} + +bool GetDoesBoneHaveParent(int inMaybeBeneathBone, int inParentBone, mstudiobone_t* inBones) +{ + bool theSuccess = false; + + ASSERT(inMaybeBeneathBone < MAXSTUDIOBONES); + ASSERT(inParentBone < MAXSTUDIOBONES); + + int theCurrentParent = inBones[inMaybeBeneathBone].parent; + + if(theCurrentParent == inParentBone) + { + theSuccess = true; + } + else if(theCurrentParent != -1) + { + theSuccess = GetDoesBoneHaveParent(theCurrentParent, inParentBone, inBones); + } + + return theSuccess; +} + +/* +==================== +StudioSetupBones + +==================== +*/ +void CStudioModelRenderer::StudioSetupBones ( void ) +{ + int i; + double f; + + mstudiobone_t *pbones; + mstudioseqdesc_t *pseqdesc; + mstudioanim_t *panim; + + static float pos[MAXSTUDIOBONES][3]; + static vec4_t q[MAXSTUDIOBONES]; + float bonematrix[3][4]; + + static float pos2[MAXSTUDIOBONES][3]; + static vec4_t q2[MAXSTUDIOBONES]; + static float pos3[MAXSTUDIOBONES][3]; + static vec4_t q3[MAXSTUDIOBONES]; + static float pos4[MAXSTUDIOBONES][3]; + static vec4_t q4[MAXSTUDIOBONES]; + + if (m_pCurrentEntity->curstate.sequence >= m_pStudioHeader->numseq) + { + m_pCurrentEntity->curstate.sequence = 0; + } + else if (m_pCurrentEntity->curstate.sequence < 0) + { + m_pCurrentEntity->curstate.sequence = 0; + } + + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pCurrentEntity->curstate.sequence; + + f = StudioEstimateFrame( pseqdesc ); + + if (m_pCurrentEntity->latched.prevframe > f) + { + //Con_DPrintf("%f %f\n", m_pCurrentEntity->prevframe, f ); + } + + panim = StudioGetAnim( m_pRenderModel, pseqdesc ); + StudioCalcRotations( pos, q, pseqdesc, panim, f ); + + if (pseqdesc->numblends > 1) + { + float s; + float dadt; + + panim += m_pStudioHeader->numbones; + StudioCalcRotations( pos2, q2, pseqdesc, panim, f ); + + dadt = StudioEstimateInterpolant(); + s = (m_pCurrentEntity->curstate.blending[0] * dadt + m_pCurrentEntity->latched.prevblending[0] * (1.0 - dadt)) / 255.0; + + StudioSlerpBones( q, pos, q2, pos2, s ); + + if (pseqdesc->numblends == 4) + { + panim += m_pStudioHeader->numbones; + StudioCalcRotations( pos3, q3, pseqdesc, panim, f ); + + panim += m_pStudioHeader->numbones; + StudioCalcRotations( pos4, q4, pseqdesc, panim, f ); + + s = (m_pCurrentEntity->curstate.blending[0] * dadt + m_pCurrentEntity->latched.prevblending[0] * (1.0 - dadt)) / 255.0; + StudioSlerpBones( q3, pos3, q4, pos4, s ); + + s = (m_pCurrentEntity->curstate.blending[1] * dadt + m_pCurrentEntity->latched.prevblending[1] * (1.0 - dadt)) / 255.0; + StudioSlerpBones( q, pos, q3, pos3, s ); + } + } + + if (m_fDoInterp && + m_pCurrentEntity->latched.sequencetime && + ( m_pCurrentEntity->latched.sequencetime + 0.2 > m_clTime ) && + ( m_pCurrentEntity->latched.prevsequence < m_pStudioHeader->numseq )) + { + // blend from last sequence + static float pos1b[MAXSTUDIOBONES][3]; + static vec4_t q1b[MAXSTUDIOBONES]; + float s; + + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pCurrentEntity->latched.prevsequence; + panim = StudioGetAnim( m_pRenderModel, pseqdesc ); + // clip prevframe + StudioCalcRotations( pos1b, q1b, pseqdesc, panim, m_pCurrentEntity->latched.prevframe ); + + if (pseqdesc->numblends > 1) + { + panim += m_pStudioHeader->numbones; + StudioCalcRotations( pos2, q2, pseqdesc, panim, m_pCurrentEntity->latched.prevframe ); + + s = (m_pCurrentEntity->latched.prevseqblending[0]) / 255.0; + StudioSlerpBones( q1b, pos1b, q2, pos2, s ); + + if (pseqdesc->numblends == 4) + { + panim += m_pStudioHeader->numbones; + StudioCalcRotations( pos3, q3, pseqdesc, panim, m_pCurrentEntity->latched.prevframe ); + + panim += m_pStudioHeader->numbones; + StudioCalcRotations( pos4, q4, pseqdesc, panim, m_pCurrentEntity->latched.prevframe ); + + s = (m_pCurrentEntity->latched.prevseqblending[0]) / 255.0; + StudioSlerpBones( q3, pos3, q4, pos4, s ); + + s = (m_pCurrentEntity->latched.prevseqblending[1]) / 255.0; + StudioSlerpBones( q1b, pos1b, q3, pos3, s ); + } + } + + s = 1.0 - (m_clTime - m_pCurrentEntity->latched.sequencetime) / 0.2; + StudioSlerpBones( q, pos, q1b, pos1b, s ); + } + else + { + //Con_DPrintf("prevframe = %4.2f\n", f); + m_pCurrentEntity->latched.prevframe = f; + } + + pbones = (mstudiobone_t *)((byte *)m_pStudioHeader + m_pStudioHeader->boneindex); + + // calc gait animation + if (m_pPlayerInfo && (m_pPlayerInfo->gaitsequence != 0) && (m_pPlayerInfo->gaitsequence != 255)) + { + m_pPlayerInfo->gaitsequence = max(min(m_pPlayerInfo->gaitsequence, m_pStudioHeader->numseq-1), 0); + +// // Trim sequences within range (not sure why this is out of range though) +// int theIndex = min(max(0, m_pStudioHeader->seqindex), m_pStudioHeader->numseq - 1); +// if(theIndex != m_pStudioHeader->seqindex) +// { +// m_pStudioHeader->seqindex = theIndex; +// m_pPlayerInfo->gaitsequence = 0; +// } + + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pPlayerInfo->gaitsequence; + + panim = StudioGetAnim( m_pRenderModel, pseqdesc ); + StudioCalcRotations( pos2, q2, pseqdesc, panim, m_pPlayerInfo->gaitframe ); + +// Valve way +// for (i = 0; i < m_pStudioHeader->numbones; i++) +// { +// if (strcmp( pbones[i].name, "Bip01 Spine") == 0) +// break; +// memcpy( pos[i], pos2[i], sizeof( pos[i] )); +// memcpy( q[i], q2[i], sizeof( q[i] )); +// } + +// NS way + // Look up parent bone that defines the boundary for gaitsequence + int theNumParents = 0; + int theParents[MAXSTUDIOBONES]; + memset(theParents, -1, sizeof(int)*MAXSTUDIOBONES); + + for (i = 0; i < m_pStudioHeader->numbones; i++) + { + // Must contain "Thigh" + if(strstr(pbones[i].name, "Thigh")) + { + theParents[theNumParents++] = i; + } + } + // If this is firing, it means a model has a gaitsequence set but doesn't have a bone that defines which bones are used for that gaitsequence + //ASSERT(theNumParents > 0); + + // If there aren't any thighs, assume that the old HL way was used + if(theNumParents > 0) + { + int theNumBonesWithThisParent = 0; + int theBonesWithParent[MAXSTUDIOBONES]; + + // For each bone + for(i = 0; i < m_pStudioHeader->numbones; i++) + { + for(int j = 0; j < theNumParents; j++) + { + // Does bone have this parent bone? + int theParent = theParents[j]; + //if(/*(i == theParent) ||*/ GetDoesBoneHaveParent(i, theParent, pbones)) + char* theBoneName = pbones[i].name; + if(!strcmp(theBoneName, "Bip01") || (!strcmp(theBoneName, "Bip01 Pelvis")) || (i == theParent) || GetDoesBoneHaveParent(i, theParent, pbones)) + { + // If so, add it to the list and increment num bones + theBonesWithParent[theNumBonesWithThisParent++] = i; + break; + } + } + } + + for(int j = 0; j < theNumBonesWithThisParent; j++) + { + int i = theBonesWithParent[j]; + + // If the bone is in this list, use that bones data (gaitsequence) instead of the existing data (sequence) + memcpy( pos[i], pos2[i], sizeof( pos[i] )); + memcpy( q[i], q2[i], sizeof( q[i] )); + } + } + else + { + for (i = 0; i < m_pStudioHeader->numbones; i++) + { + if (strcmp( pbones[i].name, "Bip01 Spine") == 0) + break; + memcpy( pos[i], pos2[i], sizeof( pos[i] )); + memcpy( q[i], q2[i], sizeof( q[i] )); + } + } + + //gEngfuncs.Con_Printf("gait: %d, frame: %f\n", m_pPlayerInfo->gaitsequence, m_pPlayerInfo->gaitframe); + } + + + for (i = 0; i < m_pStudioHeader->numbones; i++) + { + QuaternionMatrix( q[i], bonematrix ); + + bonematrix[0][3] = pos[i][0]; + bonematrix[1][3] = pos[i][1]; + bonematrix[2][3] = pos[i][2]; + + if (pbones[i].parent == -1) + { + if ( IEngineStudio.IsHardware() ) + { + ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_pbonetransform)[i]); + // MatrixCopy should be faster... + //ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]); + MatrixCopy( (*m_pbonetransform)[i], (*m_plighttransform)[i] ); + } + else + { + ConcatTransforms ((*m_paliastransform), bonematrix, (*m_pbonetransform)[i]); + ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]); + } + + // Apply client-side effects to the transformation matrix + StudioFxTransform( m_pCurrentEntity, (*m_pbonetransform)[i] ); + } + else + { + ConcatTransforms ((*m_pbonetransform)[pbones[i].parent], bonematrix, (*m_pbonetransform)[i]); + ConcatTransforms ((*m_plighttransform)[pbones[i].parent], bonematrix, (*m_plighttransform)[i]); + } + } +} + + +/* +==================== +StudioSaveBones + +==================== +*/ +void CStudioModelRenderer::StudioSaveBones( void ) +{ + int i; + + mstudiobone_t *pbones; + pbones = (mstudiobone_t *)((byte *)m_pStudioHeader + m_pStudioHeader->boneindex); + + m_nCachedBones = m_pStudioHeader->numbones; + + for (i = 0; i < m_pStudioHeader->numbones; i++) + { + strcpy( m_nCachedBoneNames[i], pbones[i].name ); + MatrixCopy( (*m_pbonetransform)[i], m_rgCachedBoneTransform[i] ); + MatrixCopy( (*m_plighttransform)[i], m_rgCachedLightTransform[i] ); + } +} + + +/* +==================== +StudioMergeBones + +==================== +*/ +void CStudioModelRenderer::StudioMergeBones ( model_t *m_pSubModel ) +{ + int i, j; + double f; + int do_hunt = true; + + mstudiobone_t *pbones; + mstudioseqdesc_t *pseqdesc; + mstudioanim_t *panim; + + static float pos[MAXSTUDIOBONES][3]; + float bonematrix[3][4]; + static vec4_t q[MAXSTUDIOBONES]; + + if (m_pCurrentEntity->curstate.sequence >= m_pStudioHeader->numseq) + { + m_pCurrentEntity->curstate.sequence = 0; + } + + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pCurrentEntity->curstate.sequence; + + f = StudioEstimateFrame( pseqdesc ); + + if (m_pCurrentEntity->latched.prevframe > f) + { + //Con_DPrintf("%f %f\n", m_pCurrentEntity->prevframe, f ); + } + + panim = StudioGetAnim( m_pSubModel, pseqdesc ); + StudioCalcRotations( pos, q, pseqdesc, panim, f ); + + pbones = (mstudiobone_t *)((byte *)m_pStudioHeader + m_pStudioHeader->boneindex); + + + for (i = 0; i < m_pStudioHeader->numbones; i++) + { + for (j = 0; j < m_nCachedBones; j++) + { + if (stricmp(pbones[i].name, m_nCachedBoneNames[j]) == 0) + { + MatrixCopy( m_rgCachedBoneTransform[j], (*m_pbonetransform)[i] ); + MatrixCopy( m_rgCachedLightTransform[j], (*m_plighttransform)[i] ); + break; + } + } + if (j >= m_nCachedBones) + { + QuaternionMatrix( q[i], bonematrix ); + + bonematrix[0][3] = pos[i][0]; + bonematrix[1][3] = pos[i][1]; + bonematrix[2][3] = pos[i][2]; + + if (pbones[i].parent == -1) + { + if ( IEngineStudio.IsHardware() ) + { + ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_pbonetransform)[i]); + // MatrixCopy should be faster... + //ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]); + MatrixCopy( (*m_pbonetransform)[i], (*m_plighttransform)[i] ); + } + else + { + ConcatTransforms ((*m_paliastransform), bonematrix, (*m_pbonetransform)[i]); + ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]); + } + + // Apply client-side effects to the transformation matrix + StudioFxTransform( m_pCurrentEntity, (*m_pbonetransform)[i] ); + } + else + { + ConcatTransforms ((*m_pbonetransform)[pbones[i].parent], bonematrix, (*m_pbonetransform)[i]); + ConcatTransforms ((*m_plighttransform)[pbones[i].parent], bonematrix, (*m_plighttransform)[i]); + } + } + } +} + +/* +==================== +StudioDrawModel + +==================== +*/ +int CStudioModelRenderer::StudioDrawModel( int flags ) +{ + alight_t lighting; + vec3_t dir; + + m_pCurrentEntity = IEngineStudio.GetCurrentEntity(); + IEngineStudio.GetTimes( &m_nFrameCount, &m_clTime, &m_clOldTime ); + IEngineStudio.GetViewInfo( m_vRenderOrigin, m_vUp, m_vRight, m_vNormal ); + IEngineStudio.GetAliasScale( &m_fSoftwareXScale, &m_fSoftwareYScale ); + + // Horrible hack for preventing visual artifacts while being digested + if(gHUD.GetIsBeingDigested()) + { + return 0; + } + + /* + // Now render eyebeam if model is marine // + // If player is a marine + if(m_pCurrentEntity->curstate.iuser3 == AVH_USER3_MARINE_PLAYER) + { + // Get eyepiece attachment + vec3_t theEyepieceOrigin; + VectorCopy(m_pCurrentEntity->attachment[2], theEyepieceOrigin); + + // Build this line + + // Run a traceline along this line until it hits + + // Get endpoint + + // Draw red additive light along this line + //gEngfuncs.pEfxAPI->R_RocketTrail(); + } + */ + + if (m_pCurrentEntity->curstate.renderfx == kRenderFxDeadPlayer) + { + entity_state_t deadplayer; + + int result; + int save_interp; + + if (m_pCurrentEntity->curstate.renderamt <= 0 || m_pCurrentEntity->curstate.renderamt > gEngfuncs.GetMaxClients() ) + return 0; + + // get copy of player + deadplayer = *(IEngineStudio.GetPlayerState( m_pCurrentEntity->curstate.renderamt - 1 )); //cl.frames[cl.parsecount & CL_UPDATE_MASK].playerstate[m_pCurrentEntity->curstate.renderamt-1]; + + // clear weapon, movement state + deadplayer.number = m_pCurrentEntity->curstate.renderamt; + deadplayer.weaponmodel = 0; + deadplayer.gaitsequence = 0; + + deadplayer.movetype = MOVETYPE_NONE; + VectorCopy( m_pCurrentEntity->curstate.angles, deadplayer.angles ); + VectorCopy( m_pCurrentEntity->curstate.origin, deadplayer.origin ); + + save_interp = m_fDoInterp; + m_fDoInterp = 0; + + // draw as though it were a player + result = StudioDrawPlayer( flags, &deadplayer ); + + m_fDoInterp = save_interp; + return result; + } + + m_pRenderModel = m_pCurrentEntity->model; + m_pStudioHeader = (studiohdr_t *)IEngineStudio.Mod_Extradata (m_pRenderModel); + IEngineStudio.StudioSetHeader( m_pStudioHeader ); + IEngineStudio.SetRenderModel( m_pRenderModel ); + + StudioSetUpTransform( 0 ); + + if (flags & STUDIO_RENDER) + { + // see if the bounding box lets us trivially reject, also sets + if (!IEngineStudio.StudioCheckBBox ()) + return 0; + + (*m_pModelsDrawn)++; + (*m_pStudioModelCount)++; // render data cache cookie + + if (m_pStudioHeader->numbodyparts == 0) + return 1; + } + + if (m_pCurrentEntity->curstate.movetype == MOVETYPE_FOLLOW) + { + StudioMergeBones( m_pRenderModel ); + } + else + { + StudioSetupBones( ); + } + StudioSaveBones( ); + + if (flags & STUDIO_EVENTS) + { + StudioCalcAttachments( ); + IEngineStudio.StudioClientEvents( ); + // copy attachments into global entity array + if ( m_pCurrentEntity->index > 0 ) + { + cl_entity_t *ent = gEngfuncs.GetEntityByIndex( m_pCurrentEntity->index ); + + memcpy( ent->attachment, m_pCurrentEntity->attachment, sizeof( vec3_t ) * 4 ); + } + } + + if (flags & STUDIO_RENDER) + { + lighting.plightvec = dir; + IEngineStudio.StudioDynamicLight(m_pCurrentEntity, &lighting ); + + IEngineStudio.StudioEntityLight( &lighting ); + + // model and frame independant + IEngineStudio.StudioSetupLighting (&lighting); + + // get remap colors + m_nTopColor = m_pCurrentEntity->curstate.colormap & 0xFF; + m_nBottomColor = (m_pCurrentEntity->curstate.colormap & 0xFF00) >> 8; + + IEngineStudio.StudioSetRemapColors( m_nTopColor, m_nBottomColor ); + + StudioRenderModel(); + + // If this is the local player's view model, hook into HUD + char theModelName[MAX_MODEL_NAME]; + strcpy(theModelName, this->m_pCurrentEntity->model->name); + + gHUD.PostModelRender(theModelName); + } + + return 1; +} + +/* +==================== +StudioEstimateGait + +==================== +*/ +void CStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer ) +{ + float dt; + vec3_t est_velocity; + + dt = (m_clTime - m_clOldTime); + if (dt < 0) + dt = 0; + else if (dt > 1.0) + dt = 1; + + if (dt == 0 || m_pPlayerInfo->renderframe == m_nFrameCount) + { + m_flGaitMovement = 0; + return; + } + + // VectorAdd( pplayer->velocity, pplayer->prediction_error, est_velocity ); + if ( m_fGaitEstimation ) + { + VectorSubtract( m_pCurrentEntity->origin, m_pPlayerInfo->prevgaitorigin, est_velocity ); + VectorCopy( m_pCurrentEntity->origin, m_pPlayerInfo->prevgaitorigin ); + m_flGaitMovement = Length( est_velocity ); + if (dt <= 0 || m_flGaitMovement / dt < 5) + { + m_flGaitMovement = 0; + est_velocity[0] = 0; + est_velocity[1] = 0; + } + } + else + { + VectorCopy( pplayer->velocity, est_velocity ); + m_flGaitMovement = Length( est_velocity ) * dt; + } + + if (est_velocity[1] == 0 && est_velocity[0] == 0) + { + float flYawDiff = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw; + flYawDiff = flYawDiff - (int)(flYawDiff / 360) * 360; + if (flYawDiff > 180) + flYawDiff -= 360; + if (flYawDiff < -180) + flYawDiff += 360; + + if (dt < 0.25) + flYawDiff *= dt * 4; + else + flYawDiff *= dt; + + m_pPlayerInfo->gaityaw += flYawDiff; + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - (int)(m_pPlayerInfo->gaityaw / 360) * 360; + + m_flGaitMovement = 0; + } + else + { + m_pPlayerInfo->gaityaw = (atan2(est_velocity[1], est_velocity[0]) * 180 / M_PI); + if (m_pPlayerInfo->gaityaw > 180) + m_pPlayerInfo->gaityaw = 180; + if (m_pPlayerInfo->gaityaw < -180) + m_pPlayerInfo->gaityaw = -180; + } + +} + +/* +==================== +StudioProcessGait + +==================== +*/ +void CStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer ) +{ + mstudioseqdesc_t *pseqdesc; + float dt; + int iBlend; + float flYaw; // view direction relative to movement + + m_pCurrentEntity->curstate.sequence = max(min(m_pCurrentEntity->curstate.sequence, m_pStudioHeader->numseq-1), 0); + + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pCurrentEntity->curstate.sequence; + + StudioPlayerBlend( pseqdesc, &iBlend, &m_pCurrentEntity->angles[PITCH] ); + + m_pCurrentEntity->latched.prevangles[PITCH] = m_pCurrentEntity->angles[PITCH]; + m_pCurrentEntity->curstate.blending[0] = iBlend; + m_pCurrentEntity->latched.prevblending[0] = m_pCurrentEntity->curstate.blending[0]; + m_pCurrentEntity->latched.prevseqblending[0] = m_pCurrentEntity->curstate.blending[0]; + + // Con_DPrintf("%f %d\n", m_pCurrentEntity->angles[PITCH], m_pCurrentEntity->blending[0] ); + + dt = (m_clTime - m_clOldTime); + if (dt < 0) + dt = 0; + else if (dt > 1.0) + dt = 1; + + StudioEstimateGait( pplayer ); + + // Con_DPrintf("%f %f\n", m_pCurrentEntity->angles[YAW], m_pPlayerInfo->gaityaw ); + + // calc side to side turning + flYaw = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw; + flYaw = flYaw - (int)(flYaw / 360) * 360; + if (flYaw < -180) + flYaw = flYaw + 360; + if (flYaw > 180) + flYaw = flYaw - 360; + + if (flYaw > 120) + { + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - 180; + m_flGaitMovement = -m_flGaitMovement; + flYaw = flYaw - 180; + } + else if (flYaw < -120) + { + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw + 180; + m_flGaitMovement = -m_flGaitMovement; + flYaw = flYaw + 180; + } + + // adjust torso + m_pCurrentEntity->curstate.controller[0] = ((flYaw / 4.0) + 30) / (60.0 / 255.0); + m_pCurrentEntity->curstate.controller[1] = ((flYaw / 4.0) + 30) / (60.0 / 255.0); + m_pCurrentEntity->curstate.controller[2] = ((flYaw / 4.0) + 30) / (60.0 / 255.0); + m_pCurrentEntity->curstate.controller[3] = ((flYaw / 4.0) + 30) / (60.0 / 255.0); + m_pCurrentEntity->latched.prevcontroller[0] = m_pCurrentEntity->curstate.controller[0]; + m_pCurrentEntity->latched.prevcontroller[1] = m_pCurrentEntity->curstate.controller[1]; + m_pCurrentEntity->latched.prevcontroller[2] = m_pCurrentEntity->curstate.controller[2]; + m_pCurrentEntity->latched.prevcontroller[3] = m_pCurrentEntity->curstate.controller[3]; + + m_pCurrentEntity->angles[YAW] = m_pPlayerInfo->gaityaw; + if (m_pCurrentEntity->angles[YAW] < -0) + m_pCurrentEntity->angles[YAW] += 360; + m_pCurrentEntity->latched.prevangles[YAW] = m_pCurrentEntity->angles[YAW]; + + pplayer->gaitsequence = max(min(pplayer->gaitsequence, m_pStudioHeader->numseq-1), 0); + + pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + pplayer->gaitsequence; + + // calc gait frame + if (pseqdesc->linearmovement[0] > 0) + { + m_pPlayerInfo->gaitframe += (m_flGaitMovement / pseqdesc->linearmovement[0]) * pseqdesc->numframes; + } + else + { + m_pPlayerInfo->gaitframe += pseqdesc->fps * dt; + } + + // do modulo + m_pPlayerInfo->gaitframe = m_pPlayerInfo->gaitframe - (int)(m_pPlayerInfo->gaitframe / pseqdesc->numframes) * pseqdesc->numframes; + if (m_pPlayerInfo->gaitframe < 0) + m_pPlayerInfo->gaitframe += pseqdesc->numframes; +} + +/* +==================== +StudioDrawPlayer + +==================== +*/ +int CStudioModelRenderer::StudioDrawPlayer( int flags, entity_state_t *pplayer ) +{ + alight_t lighting; + vec3_t dir; + + m_pCurrentEntity = IEngineStudio.GetCurrentEntity(); + IEngineStudio.GetTimes( &m_nFrameCount, &m_clTime, &m_clOldTime ); + IEngineStudio.GetViewInfo( m_vRenderOrigin, m_vUp, m_vRight, m_vNormal ); + IEngineStudio.GetAliasScale( &m_fSoftwareXScale, &m_fSoftwareYScale ); + + // Horrible hack for preventing visual artifacts while being digested + if(gHUD.GetIsBeingDigested()) + { + return 0; + } + + // Con_DPrintf("DrawPlayer %d\n", m_pCurrentEntity->blending[0] ); + + // Con_DPrintf("DrawPlayer %d %d (%d)\n", m_nFrameCount, pplayer->player_index, m_pCurrentEntity->curstate.sequence ); + + // Con_DPrintf("Player %.2f %.2f %.2f\n", pplayer->velocity[0], pplayer->velocity[1], pplayer->velocity[2] ); + + m_nPlayerIndex = pplayer->number - 1; + + if (m_nPlayerIndex < 0 || m_nPlayerIndex >= gEngfuncs.GetMaxClients()) + return 0; + + //m_pRenderModel = IEngineStudio.SetupPlayerModel( m_nPlayerIndex ); + m_pRenderModel = m_pCurrentEntity->model; + if (m_pRenderModel == NULL) + return 0; + + m_pStudioHeader = (studiohdr_t *)IEngineStudio.Mod_Extradata (m_pRenderModel); + IEngineStudio.StudioSetHeader( m_pStudioHeader ); + IEngineStudio.SetRenderModel( m_pRenderModel ); + + if (pplayer->gaitsequence) + { + vec3_t orig_angles; + m_pPlayerInfo = IEngineStudio.PlayerInfo( m_nPlayerIndex ); + + VectorCopy( m_pCurrentEntity->angles, orig_angles ); + + StudioProcessGait( pplayer ); + + m_pPlayerInfo->gaitsequence = pplayer->gaitsequence; + m_pPlayerInfo = NULL; + + StudioSetUpTransform( 0 ); + VectorCopy( orig_angles, m_pCurrentEntity->angles ); + } + else + { + m_pCurrentEntity->curstate.controller[0] = 127; + m_pCurrentEntity->curstate.controller[1] = 127; + m_pCurrentEntity->curstate.controller[2] = 127; + m_pCurrentEntity->curstate.controller[3] = 127; + m_pCurrentEntity->latched.prevcontroller[0] = m_pCurrentEntity->curstate.controller[0]; + m_pCurrentEntity->latched.prevcontroller[1] = m_pCurrentEntity->curstate.controller[1]; + m_pCurrentEntity->latched.prevcontroller[2] = m_pCurrentEntity->curstate.controller[2]; + m_pCurrentEntity->latched.prevcontroller[3] = m_pCurrentEntity->curstate.controller[3]; + + m_pPlayerInfo = IEngineStudio.PlayerInfo( m_nPlayerIndex ); + m_pPlayerInfo->gaitsequence = 0; + + StudioSetUpTransform( 0 ); + } + + if (flags & STUDIO_RENDER) + { + // see if the bounding box lets us trivially reject, also sets + if (!IEngineStudio.StudioCheckBBox ()) + return 0; + + (*m_pModelsDrawn)++; + (*m_pStudioModelCount)++; // render data cache cookie + + if (m_pStudioHeader->numbodyparts == 0) + return 1; + } + + m_pPlayerInfo = IEngineStudio.PlayerInfo( m_nPlayerIndex ); + StudioSetupBones( ); + StudioSaveBones( ); + m_pPlayerInfo->renderframe = m_nFrameCount; + + m_pPlayerInfo = NULL; + + if (flags & STUDIO_EVENTS) + { + StudioCalcAttachments( ); + IEngineStudio.StudioClientEvents( ); + // copy attachments into global entity array + if ( m_pCurrentEntity->index > 0 ) + { + cl_entity_t *ent = gEngfuncs.GetEntityByIndex( m_pCurrentEntity->index ); + + memcpy( ent->attachment, m_pCurrentEntity->attachment, sizeof( vec3_t ) * 4 ); + } + } + + if (flags & STUDIO_RENDER) + { + /* + if (m_pCvarHiModels->value && m_pRenderModel != m_pCurrentEntity->model ) + { + // show highest resolution multiplayer model + m_pCurrentEntity->curstate.body = 255; + } + */ + + lighting.plightvec = dir; + IEngineStudio.StudioDynamicLight(m_pCurrentEntity, &lighting ); + + IEngineStudio.StudioEntityLight( &lighting ); + + // model and frame independant + IEngineStudio.StudioSetupLighting (&lighting); + + m_pPlayerInfo = IEngineStudio.PlayerInfo( m_nPlayerIndex ); + + // get remap colors + m_nTopColor = m_pPlayerInfo->topcolor; + m_nBottomColor = m_pPlayerInfo->bottomcolor; + if (m_nTopColor < 0) + m_nTopColor = 0; + if (m_nTopColor > 360) + m_nTopColor = 360; + if (m_nBottomColor < 0) + m_nBottomColor = 0; + if (m_nBottomColor > 360) + m_nBottomColor = 360; + + IEngineStudio.StudioSetRemapColors( m_nTopColor, m_nBottomColor ); + + StudioRenderModel( ); + m_pPlayerInfo = NULL; + + if (pplayer->weaponmodel) + { + cl_entity_t saveent = *m_pCurrentEntity; + + model_t *pweaponmodel = IEngineStudio.GetModelByIndex( pplayer->weaponmodel ); + + m_pStudioHeader = (studiohdr_t *)IEngineStudio.Mod_Extradata (pweaponmodel); + IEngineStudio.StudioSetHeader( m_pStudioHeader ); + + StudioMergeBones( pweaponmodel); + + IEngineStudio.StudioSetupLighting (&lighting); + + StudioRenderModel( ); + + StudioCalcAttachments( ); + + *m_pCurrentEntity = saveent; + } + } + + return 1; +} + +/* +==================== +StudioCalcAttachments + +==================== +*/ +void CStudioModelRenderer::StudioCalcAttachments( void ) +{ + int i; + mstudioattachment_t *pattachment; + + if ( m_pStudioHeader->numattachments > 4 ) + { + gEngfuncs.Con_DPrintf( "Too many attachments on %s\n", m_pCurrentEntity->model->name ); + exit( -1 ); + } + + // calculate attachment points + pattachment = (mstudioattachment_t *)((byte *)m_pStudioHeader + m_pStudioHeader->attachmentindex); + for (i = 0; i < m_pStudioHeader->numattachments; i++) + { + VectorTransform( pattachment[i].org, (*m_plighttransform)[pattachment[i].bone], m_pCurrentEntity->attachment[i] ); + } +} + +/* +==================== +StudioRenderModel + +==================== +*/ +void CStudioModelRenderer::StudioRenderModel( void ) +{ + IEngineStudio.SetChromeOrigin(); + IEngineStudio.SetForceFaceFlags( 0 ); + + if ( m_pCurrentEntity->curstate.renderfx == kRenderFxGlowShell ) + { + m_pCurrentEntity->curstate.renderfx = kRenderFxNone; + StudioRenderFinal( ); + + if ( !IEngineStudio.IsHardware() ) + { + gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd ); + } + + IEngineStudio.SetForceFaceFlags( STUDIO_NF_CHROME ); + + gEngfuncs.pTriAPI->SpriteTexture( m_pChromeSprite, 0 ); + m_pCurrentEntity->curstate.renderfx = kRenderFxGlowShell; + + StudioRenderFinal( ); + if ( !IEngineStudio.IsHardware() ) + { + gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); + } + } + else + { + StudioRenderFinal( ); + } +} + +/* +==================== +StudioRenderFinal_Software + +==================== +*/ +void CStudioModelRenderer::StudioRenderFinal_Software( void ) +{ + int i; + + // Note, rendermode set here has effect in SW + IEngineStudio.SetupRenderer( 0 ); + + // Put this in here? + //int theRenderMode = GetRenderModeForModelName(rendermode, m_pSubModel[i].name); + + if (m_pCvarDrawEntities->value == 2) + { + IEngineStudio.StudioDrawBones( ); + } + else if (m_pCvarDrawEntities->value == 3) + { + IEngineStudio.StudioDrawHulls( ); + } + else + { + for (i=0 ; i < m_pStudioHeader->numbodyparts ; i++) + { + IEngineStudio.StudioSetupModel( i, (void **)&m_pBodyPart, (void **)&m_pSubModel ); + IEngineStudio.StudioDrawPoints( ); + } + } + + if (m_pCvarDrawEntities->value == 4) + { + gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd ); + IEngineStudio.StudioDrawHulls( ); + gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); + } + + if (m_pCvarDrawEntities->value == 5) + { + IEngineStudio.StudioDrawAbsBBox( ); + } + + IEngineStudio.RestoreRenderer(); +} + +/* +==================== +StudioRenderFinal_Hardware + + ==================== +*/ +void CStudioModelRenderer::StudioRenderFinal_Hardware( void ) +{ + int i; + int rendermode; + + rendermode = IEngineStudio.GetForceFaceFlags() ? kRenderTransAdd : m_pCurrentEntity->curstate.rendermode; + IEngineStudio.SetupRenderer( rendermode ); + + if (m_pCvarDrawEntities->value == 2) + { + IEngineStudio.StudioDrawBones(); + } + else if (m_pCvarDrawEntities->value == 3) + { + IEngineStudio.StudioDrawHulls(); + } + else + { + for (i=0 ; i < m_pStudioHeader->numbodyparts ; i++) + { + IEngineStudio.StudioSetupModel( i, (void **)&m_pBodyPart, (void **)&m_pSubModel ); + if (m_fDoInterp) + { + // interpolation messes up bounding boxes. + m_pCurrentEntity->trivial_accept = 0; + } + + IEngineStudio.GL_SetRenderMode(rendermode); + +// mstudiobodyparts_t* pbodypart = (mstudiobodyparts_t *)((byte *)m_pStudioHeader + m_pStudioHeader->bodypartindex) + i; +// +// //int index = m_bodynum / pbodypart->base; +// //index = index % pbodypart->nummodels; +// +// mstudiomodel_t* theModel = (mstudiomodel_t *)((byte *)m_pStudioHeader + pbodypart->modelindex);// + index; +// ASSERT(theModel); +// +// int theModelRenderMode = rendermode;//GetRenderModeForModelName(rendermode, theModel->name); +// +// // This could be dangerous...how to find out? +// //IEngineStudio.SetupRenderer( theModelRenderMode ); +// +// IEngineStudio.GL_SetRenderMode( theModelRenderMode ); + + IEngineStudio.StudioDrawPoints(); + IEngineStudio.GL_StudioDrawShadow(); + } + } + + if ( m_pCvarDrawEntities->value == 4 ) + { + gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd ); + IEngineStudio.StudioDrawHulls( ); + gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); + } + + if (m_pCvarDrawEntities->value == 5) + { + IEngineStudio.StudioDrawAbsBBox( ); + } + + IEngineStudio.RestoreRenderer(); +} + +/* +==================== +StudioRenderFinal + +==================== +*/ +void CStudioModelRenderer::StudioRenderFinal(void) +{ + if ( IEngineStudio.IsHardware() ) + { + StudioRenderFinal_Hardware(); + } + else + { + StudioRenderFinal_Software(); + } +} + diff --git a/main/source/cl_dll/StudioModelRenderer.h b/main/source/cl_dll/StudioModelRenderer.h new file mode 100644 index 00000000..0220d448 --- /dev/null +++ b/main/source/cl_dll/StudioModelRenderer.h @@ -0,0 +1,182 @@ +#if !defined ( STUDIOMODELRENDERER_H ) +#define STUDIOMODELRENDERER_H +#if defined( _WIN32 ) +#pragma once +#endif + +/* +==================== +CStudioModelRenderer + +==================== +*/ +class CStudioModelRenderer +{ +public: + // Construction/Destruction + CStudioModelRenderer( void ); + virtual ~CStudioModelRenderer( void ); + + // Initialization + virtual void Init( void ); + +public: + // Public Interfaces + virtual int StudioDrawModel ( int flags ); + virtual int StudioDrawPlayer ( int flags, struct entity_state_s *pplayer ); + +public: + // Local interfaces + // + + // Look up animation data for sequence + virtual mstudioanim_t *StudioGetAnim ( model_t *m_pSubModel, mstudioseqdesc_t *pseqdesc ); + + // Interpolate model position and angles and set up matrices + virtual void StudioSetUpTransform (int trivial_accept); + + // Set up model bone positions + virtual void StudioSetupBones ( void ); + + // Find final attachment points + virtual void StudioCalcAttachments ( void ); + + // Save bone matrices and names + virtual void StudioSaveBones( void ); + + // Merge cached bones with current bones for model + virtual void StudioMergeBones ( model_t *m_pSubModel ); + + // Determine interpolation fraction + virtual float StudioEstimateInterpolant( void ); + + // Determine current frame for rendering + virtual float StudioEstimateFrame ( mstudioseqdesc_t *pseqdesc ); + + // Apply special effects to transform matrix + virtual void StudioFxTransform( cl_entity_t *ent, float transform[3][4] ); + + // Spherical interpolation of bones + virtual void StudioSlerpBones ( vec4_t q1[], float pos1[][3], vec4_t q2[], float pos2[][3], float s ); + + // Compute bone adjustments ( bone controllers ) + virtual void StudioCalcBoneAdj ( float dadt, float *adj, const byte *pcontroller1, const byte *pcontroller2, byte mouthopen ); + + // Get bone quaternions + virtual void StudioCalcBoneQuaterion ( int frame, float s, mstudiobone_t *pbone, mstudioanim_t *panim, float *adj, float *q ); + + // Get bone positions + virtual void StudioCalcBonePosition ( int frame, float s, mstudiobone_t *pbone, mstudioanim_t *panim, float *adj, float *pos ); + + // Compute rotations + virtual void StudioCalcRotations ( float pos[][3], vec4_t *q, mstudioseqdesc_t *pseqdesc, mstudioanim_t *panim, float f ); + + // Send bones and verts to renderer + virtual void StudioRenderModel ( void ); + + // Finalize rendering + virtual void StudioRenderFinal (void); + + // GL&D3D vs. Software renderer finishing functions + virtual void StudioRenderFinal_Software ( void ); + virtual void StudioRenderFinal_Hardware ( void ); + + // Player specific data + // Determine pitch and blending amounts for players + virtual void StudioPlayerBlend ( mstudioseqdesc_t *pseqdesc, int *pBlend, float *pPitch ); + + // Estimate gait frame for player + virtual void StudioEstimateGait ( entity_state_t *pplayer ); + + // Process movement of player + virtual void StudioProcessGait ( entity_state_t *pplayer ); + +public: + + // Client clock + double m_clTime; + // Old Client clock + double m_clOldTime; + + // Do interpolation? + int m_fDoInterp; + // Do gait estimation? + int m_fGaitEstimation; + + // Current render frame # + int m_nFrameCount; + + // Cvars that studio model code needs to reference + // + // Use high quality models? + cvar_t *m_pCvarHiModels; + // Developer debug output desired? + cvar_t *m_pCvarDeveloper; + // Draw entities bone hit boxes, etc? + cvar_t *m_pCvarDrawEntities; + + // The entity which we are currently rendering. + cl_entity_t *m_pCurrentEntity; + + // The model for the entity being rendered + model_t *m_pRenderModel; + + // Player info for current player, if drawing a player + player_info_t *m_pPlayerInfo; + + // The index of the player being drawn + int m_nPlayerIndex; + + // The player's gait movement + float m_flGaitMovement; + + // Pointer to header block for studio model data + studiohdr_t *m_pStudioHeader; + + // Pointers to current body part and submodel + mstudiobodyparts_t *m_pBodyPart; + mstudiomodel_t *m_pSubModel; + + // Palette substition for top and bottom of model + int m_nTopColor; + int m_nBottomColor; + + // + // Sprite model used for drawing studio model chrome + model_t *m_pChromeSprite; + + // Caching + // Number of bones in bone cache + int m_nCachedBones; + // Names of cached bones + char m_nCachedBoneNames[ MAXSTUDIOBONES ][ 32 ]; + // Cached bone & light transformation matrices + float m_rgCachedBoneTransform [ MAXSTUDIOBONES ][ 3 ][ 4 ]; + float m_rgCachedLightTransform[ MAXSTUDIOBONES ][ 3 ][ 4 ]; + + // Software renderer scale factors + float m_fSoftwareXScale, m_fSoftwareYScale; + + // Current view vectors and render origin + float m_vUp[ 3 ]; + float m_vRight[ 3 ]; + float m_vNormal[ 3 ]; + + float m_vRenderOrigin[ 3 ]; + + // Model render counters ( from engine ) + int *m_pStudioModelCount; + int *m_pModelsDrawn; + + // Matrices + // Model to world transformation + float (*m_protationmatrix)[ 3 ][ 4 ]; + // Model to view transformation + float (*m_paliastransform)[ 3 ][ 4 ]; + + // Concatenated bone and light transforms + float (*m_pbonetransform) [ MAXSTUDIOBONES ][ 3 ][ 4 ]; + float (*m_plighttransform)[ MAXSTUDIOBONES ][ 3 ][ 4 ]; +}; + +#endif // STUDIOMODELRENDERER_H \ No newline at end of file diff --git a/main/source/cl_dll/ammo.cpp b/main/source/cl_dll/ammo.cpp new file mode 100644 index 00000000..5498b293 --- /dev/null +++ b/main/source/cl_dll/ammo.cpp @@ -0,0 +1,1410 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// Ammo.cpp +// +// implementation of CHudAmmo class +// + +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" + +#include +#include + +#include "ammohistory.h" +#include "vgui_TeamFortressViewport.h" +#include "mod/AvHSharedUtil.h" +#include "mod/AvHScrollHandler.h" +#include "build.h" + +WEAPON *gpActiveSel; // NULL means off, 1 means just the menu bar, otherwise + // this points to the active weapon menu item +WEAPON *gpLastSel; // Last weapon menu selection + +bool HUD_GetWeaponEnabled(int inID); +client_sprite_t *GetSpriteList(client_sprite_t *pList, const char *psz, int iRes, int iCount); + +WeaponsResource gWR; + +int g_weaponselect = 0; + +//Equivalent to DECLARE_COMMAND(lastinv,LastInv) except we use gWR instead of gHud +void __CmdFunc_LastInv(void) +{ + gWR.UserCmd_LastInv(); +} + +void WeaponsResource::Init(void) +{ + memset( rgWeapons, 0, sizeof rgWeapons ); + lastWeapon = NULL; + HOOK_COMMAND("lastinv",LastInv); + Reset(); +} + +void WeaponsResource :: LoadAllWeaponSprites( void ) +{ + for (int i = 0; i < MAX_WEAPONS; i++) + { + if ( rgWeapons[i].iId ) + LoadWeaponSprites( &rgWeapons[i] ); + } +} + +int WeaponsResource :: CountAmmo( int iId ) +{ + if ( iId < 0 ) + return 0; + + return riAmmo[iId]; +} + +int WeaponsResource :: HasAmmo( WEAPON *p ) +{ + if ( !p ) + return FALSE; + + // weapons with no max ammo can always be selected + if ( p->iMax1 == -1 ) + return TRUE; + + return (p->iAmmoType == -1) || p->iClip > 0 || CountAmmo(p->iAmmoType) + || CountAmmo(p->iAmmo2Type) || ( p->iFlags & WEAPON_FLAGS_SELECTONEMPTY ); +} + +int WeaponsResource::IsEnabled(WEAPON* p) +{ + int theIsEnabled = FALSE; + // If weapon is enabled + if(HUD_GetWeaponEnabled(p->iId)) + { + theIsEnabled = this->HasAmmo(p); + } + return theIsEnabled; +} + +int WeaponsResource::IsSelectable(WEAPON* p) +{ + int theIsSelectable = FALSE; + if(p != NULL ) + { +// char msg[1024]; +// sprintf(msg, "Weapon %s: ", p->szName); +// ConsolePrint(msg); + if ( HUD_GetWeaponEnabled(p->iId)) + { + theIsSelectable = TRUE; +// ConsolePrint("Enabled\n"); + } + else + { +// ConsolePrint("Not Enabled\n"); + } + } +// else +// { +// ConsolePrint("Null Weapon\n"); +// } + return theIsSelectable; +} + +void WeaponsResource :: LoadWeaponSprites( WEAPON *pWeapon ) +{ + int i, iRes; + + if (ScreenWidth() < 640) + iRes = 320; + else + iRes = 640; + + char sz[128]; + + if ( !pWeapon ) + return; + + memset( &pWeapon->rcActive, 0, sizeof(wrect_t) ); + memset( &pWeapon->rcInactive, 0, sizeof(wrect_t) ); + memset( &pWeapon->rcAmmo, 0, sizeof(wrect_t) ); + memset( &pWeapon->rcAmmo2, 0, sizeof(wrect_t) ); + pWeapon->hInactive = 0; + pWeapon->hActive = 0; + pWeapon->hAmmo = 0; + pWeapon->hAmmo2 = 0; + + sprintf(sz, "sprites/%s.txt", pWeapon->szName); + client_sprite_t *pList = SPR_GetList(sz, &i); + + if (!pList) + { + ASSERT(pList); + return; + } + + client_sprite_t *p; + + p = GetSpriteList( pList, "crosshair", iRes, i ); + if (p) + { + sprintf(sz, "sprites/%s.spr", p->szSprite); + pWeapon->hCrosshair = Safe_SPR_Load(sz); + pWeapon->rcCrosshair = p->rc; + } + else + pWeapon->hCrosshair = NULL; + + p = GetSpriteList(pList, "autoaim", iRes, i); + if (p) + { + sprintf(sz, "sprites/%s.spr", p->szSprite); + pWeapon->hAutoaim = Safe_SPR_Load(sz); + pWeapon->rcAutoaim = p->rc; + } + else + pWeapon->hAutoaim = 0; + + p = GetSpriteList( pList, "zoom", iRes, i ); + if (p) + { + sprintf(sz, "sprites/%s.spr", p->szSprite); + pWeapon->hZoomedCrosshair = Safe_SPR_Load(sz); + pWeapon->rcZoomedCrosshair = p->rc; + } + else + { + pWeapon->hZoomedCrosshair = pWeapon->hCrosshair; //default to non-zoomed crosshair + pWeapon->rcZoomedCrosshair = pWeapon->rcCrosshair; + } + + p = GetSpriteList(pList, "zoom_autoaim", iRes, i); + if (p) + { + sprintf(sz, "sprites/%s.spr", p->szSprite); + pWeapon->hZoomedAutoaim = Safe_SPR_Load(sz); + pWeapon->rcZoomedAutoaim = p->rc; + } + else + { + pWeapon->hZoomedAutoaim = pWeapon->hZoomedCrosshair; //default to zoomed crosshair + pWeapon->rcZoomedAutoaim = pWeapon->rcZoomedCrosshair; + } + + p = GetSpriteList(pList, "weapon", iRes, i); + if (p) + { + sprintf(sz, "sprites/%s.spr", p->szSprite); + pWeapon->hInactive = Safe_SPR_Load(sz); + pWeapon->rcInactive = p->rc; + + gHR.iHistoryGap = max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); + } + else + pWeapon->hInactive = 0; + + p = GetSpriteList(pList, "weapon_s", iRes, i); + if (p) + { + sprintf(sz, "sprites/%s.spr", p->szSprite); + pWeapon->hActive = Safe_SPR_Load(sz); + pWeapon->rcActive = p->rc; + } + else + pWeapon->hActive = 0; + + p = GetSpriteList(pList, "ammo", iRes, i); + if (p) + { + sprintf(sz, "sprites/%s.spr", p->szSprite); + pWeapon->hAmmo = Safe_SPR_Load(sz); + pWeapon->rcAmmo = p->rc; + + gHR.iHistoryGap = max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); + } + else + pWeapon->hAmmo = 0; + + p = GetSpriteList(pList, "ammo2", iRes, i); + if (p) + { + sprintf(sz, "sprites/%s.spr", p->szSprite); + pWeapon->hAmmo2 = Safe_SPR_Load(sz); + pWeapon->rcAmmo2 = p->rc; + + gHR.iHistoryGap = max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); + } + else + pWeapon->hAmmo2 = 0; + +} + +// Returns the first weapon for a given slot. +WEAPON *WeaponsResource :: GetFirstPos( int iSlot ) +{ + WEAPON *pret = NULL; + + for (int i = 0; i < MAX_WEAPON_POSITIONS; i++) + { + if (this->IsSelectable(rgSlots[iSlot][i])) + { + pret = rgSlots[iSlot][i]; + break; + } + } + + return pret; +} + + +WEAPON* WeaponsResource :: GetNextActivePos( int iSlot, int iSlotPos ) +{ + if ( iSlotPos >= MAX_WEAPON_POSITIONS || iSlot >= MAX_WEAPON_SLOTS ) + return NULL; + + WEAPON *p = gWR.rgSlots[ iSlot ][ iSlotPos+1 ]; + + if (!this->IsSelectable(p)) + return GetNextActivePos( iSlot, iSlotPos + 1 ); + + return p; +} + +void WeaponsResource::SetCurrentWeapon(WEAPON* newWeapon) +{ + WEAPON* currentWeapon = this->GetWeapon(gHUD.GetCurrentWeaponID()); + // puzl: 497 - Because weapon state can get out of sync, we should allow this even if the weapons are the same + // && newWeapon != currentWeapon + if(newWeapon != NULL ) + { + lastWeapon = currentWeapon; + //if ( newWeapon != currentWeapon ) + ServerCmd(newWeapon->szName); + g_weaponselect = newWeapon->iId; + } +} + +void WeaponsResource::UserCmd_LastInv(void) +{ + if(this->IsSelectable(this->lastWeapon) && this->lastWeapon != this->GetWeapon(gHUD.GetCurrentWeaponID())) + { + this->SetCurrentWeapon(lastWeapon); + //voogru: Should a sound be played? + /*const char* theSound = AvHSHUGetCommonSoundName(gHUD.GetIsAlien(), WEAPON_SOUND_HUD_ON); + gHUD.PlayHUDSound(theSound, kHUDSoundVolume);*/ + } +} + +void WeaponsResource::SetValidWeapon(void) +{ + WEAPON* p = this->GetFirstPos(0); //alien attack 1 or primary marine weapon + if(gHUD.GetIsAlien()) + { + this->SetCurrentWeapon(p); + } + else + { + if(this->IsSelectable(p) && this->HasAmmo(p)) + { + this->SetCurrentWeapon(p); + } + else + { + p = this->GetFirstPos(1); //pistol slot + if(this->IsSelectable(p) && this->HasAmmo(p)) + { + this->SetCurrentWeapon(p); + } + else + { + p = this->GetFirstPos(2); //knife slot + this->SetCurrentWeapon(p); + } + } + } +} + +int giBucketHeight, giBucketWidth, giABHeight, giABWidth; // Ammo Bar width and height + +HSPRITE ghsprBuckets; // Sprite for top row of weapons menu + +DECLARE_MESSAGE(m_Ammo, CurWeapon ); // Current weapon and clip +DECLARE_MESSAGE(m_Ammo, WeaponList); // new weapon type +DECLARE_MESSAGE(m_Ammo, AmmoX); // update known ammo type's count +DECLARE_MESSAGE(m_Ammo, AmmoPickup); // flashes an ammo pickup record +DECLARE_MESSAGE(m_Ammo, WeapPickup); // flashes a weapon pickup record +DECLARE_MESSAGE(m_Ammo, HideWeapon); // hides the weapon, ammo, and crosshair displays temporarily +DECLARE_MESSAGE(m_Ammo, ItemPickup); + +DECLARE_COMMAND(m_Ammo, Slot1); +DECLARE_COMMAND(m_Ammo, Slot2); +DECLARE_COMMAND(m_Ammo, Slot3); +DECLARE_COMMAND(m_Ammo, Slot4); +DECLARE_COMMAND(m_Ammo, Slot5); +DECLARE_COMMAND(m_Ammo, Slot6); +DECLARE_COMMAND(m_Ammo, Slot7); +DECLARE_COMMAND(m_Ammo, Slot8); +DECLARE_COMMAND(m_Ammo, Slot9); +DECLARE_COMMAND(m_Ammo, Slot10); +DECLARE_COMMAND(m_Ammo, Close); +DECLARE_COMMAND(m_Ammo, NextWeapon); +DECLARE_COMMAND(m_Ammo, PrevWeapon); + +// width of ammo fonts +#define AMMO_SMALL_WIDTH 10 +#define AMMO_LARGE_WIDTH 20 + +#define HISTORY_DRAW_TIME "5" + +int CHudAmmo::Init(void) +{ + gHUD.AddHudElem(this); + + HOOK_MESSAGE(CurWeapon); + HOOK_MESSAGE(WeaponList); + HOOK_MESSAGE(AmmoPickup); + HOOK_MESSAGE(WeapPickup); + HOOK_MESSAGE(ItemPickup); + HOOK_MESSAGE(HideWeapon); + HOOK_MESSAGE(AmmoX); + + HOOK_COMMAND("slot1", Slot1); + HOOK_COMMAND("slot2", Slot2); + HOOK_COMMAND("slot3", Slot3); + HOOK_COMMAND("slot4", Slot4); + HOOK_COMMAND("slot5", Slot5); + HOOK_COMMAND("slot6", Slot6); + HOOK_COMMAND("slot7", Slot7); + HOOK_COMMAND("slot8", Slot8); + HOOK_COMMAND("slot9", Slot9); + HOOK_COMMAND("slot10", Slot10); + HOOK_COMMAND("cancelselect", Close); + HOOK_COMMAND("invnext", NextWeapon); + HOOK_COMMAND("invprev", PrevWeapon); + + Reset(); + + CVAR_CREATE( "hud_drawhistory_time", HISTORY_DRAW_TIME, 0 ); + CVAR_CREATE( "hud_fastswitch", "0", FCVAR_ARCHIVE ); // controls whether or not weapons can be selected in one keypress + + m_iFlags |= HUD_ACTIVE; //!!! + + gWR.Init(); + gHR.Init(); + + return 1; +}; + +void CHudAmmo::Reset(void) +{ + m_fFade = 0; + m_iFlags |= HUD_ACTIVE; //!!! + + gpActiveSel = NULL; + gHUD.m_iHideHUDDisplay = 0; + + gWR.Reset(); + gHR.Reset(); + + // VidInit(); + +} + +int CHudAmmo::VidInit(void) +{ + // Load sprites for buckets (top row of weapon menu) + m_HUD_bucket0 = gHUD.GetSpriteIndex( "bucket1" ); + m_HUD_selection = gHUD.GetSpriteIndex( "selection" ); + + ghsprBuckets = gHUD.GetSprite(m_HUD_bucket0); + giBucketWidth = gHUD.GetSpriteRect(m_HUD_bucket0).right - gHUD.GetSpriteRect(m_HUD_bucket0).left; + giBucketHeight = gHUD.GetSpriteRect(m_HUD_bucket0).bottom - gHUD.GetSpriteRect(m_HUD_bucket0).top; + + gHR.iHistoryGap = max( gHR.iHistoryGap, gHUD.GetSpriteRect(m_HUD_bucket0).bottom - gHUD.GetSpriteRect(m_HUD_bucket0).top); + + // If we've already loaded weapons, let's get new sprites + gWR.LoadAllWeaponSprites(); + + if (ScreenWidth() >= 640) + { + giABWidth = 20; + giABHeight = 4; + } + else + { + giABWidth = 10; + giABHeight = 2; + } + + return 1; +} + +// +// Think: +// Used for selection of weapon menu item. +// +void CHudAmmo::Think(void) +{ + if ( gHUD.m_fPlayerDead ) + return; + + if ( gHUD.m_iWeaponBits != gWR.iOldWeaponBits ) + { + gWR.iOldWeaponBits = gHUD.m_iWeaponBits; + bool droppedCurrent = false; + + for (int i = MAX_WEAPONS-1; i > 0; i-- ) + { + WEAPON *p = gWR.GetWeapon(i); + + if ( p ) + { + if ( gHUD.m_iWeaponBits & ( 1 << p->iId ) ) + gWR.PickupWeapon( p ); + else + gWR.DropWeapon( p ); + } + } + } + + //voogru: This probably isnt a good place to do this for some reason in release mode this crashes aliens. + /*if(gHUD.GetIsAlien()) //check for hive death causing loss of current weapon + { + WEAPON* currentWeapon = gWR.GetWeapon(gHUD.GetCurrentWeaponID()); + if(!gWR.IsSelectable(currentWeapon)) //current weapon isn't valid + { + gWR.SetValidWeapon(); //get best option + } + }*/ + + if (!gpActiveSel) + return; + + // has the player selected one? + if (gHUD.m_iKeyBits & IN_ATTACK) + { + if (gpActiveSel != (WEAPON *)1) + { + gWR.SetCurrentWeapon(gpActiveSel); + } + + gpLastSel = gpActiveSel; + gpActiveSel = NULL; + gHUD.m_iKeyBits &= ~IN_ATTACK; + + const char* theSound = AvHSHUGetCommonSoundName(gHUD.GetIsAlien(), WEAPON_SOUND_SELECT); + gHUD.PlayHUDSound(theSound, kHUDSoundVolume); + } +} + +// +// Helper function to return a Ammo pointer from id +// + +HSPRITE* WeaponsResource :: GetAmmoPicFromWeapon( int iAmmoId, wrect_t& rect ) +{ + for ( int i = 0; i < MAX_WEAPONS; i++ ) + { + if ( rgWeapons[i].iAmmoType == iAmmoId ) + { + rect = rgWeapons[i].rcAmmo; + return &rgWeapons[i].hAmmo; + } + else if ( rgWeapons[i].iAmmo2Type == iAmmoId ) + { + rect = rgWeapons[i].rcAmmo2; + return &rgWeapons[i].hAmmo2; + } + } + + return NULL; +} + + +// Menu Selection Code + +void WeaponsResource :: SelectSlot( int iSlot, int fAdvance, int iDirection ) +{ + if ( gHUD.m_Menu.m_fMenuDisplayed && (fAdvance == FALSE) && (iDirection == 1) ) + { // menu is overriding slot use commands + gHUD.m_Menu.SelectMenuItem( iSlot + 1 ); // slots are one off the key numbers + return; + } + + if ( iSlot > MAX_WEAPON_SLOTS ) + return; + + if ( gHUD.m_fPlayerDead || gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL ) ) + return; + + if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) )) //require suit + return; + + if ( ! ( gHUD.m_iWeaponBits & ~(1<<(WEAPON_SUIT)) )) //require something besides suit + return; + + WEAPON *p = NULL; + bool fastSwitch = CVAR_GET_FLOAT( "hud_fastswitch" ) != 0; + if ((gpActiveSel == NULL) || (gpActiveSel == (WEAPON *)1) || (iSlot != gpActiveSel->iSlot)) + { + p = GetFirstPos(iSlot); + const char* theSound = AvHSHUGetCommonSoundName(gHUD.GetIsAlien(), WEAPON_SOUND_HUD_ON); + gHUD.PlayHUDSound(theSound, kHUDSoundVolume); + + if (this->IsSelectable(p) && fastSwitch) //check to see if we can use fastSwitch + { + WEAPON *p2 = GetNextActivePos( p->iSlot, p->iSlotPos ); + if (!this->IsSelectable(p2)) //only one target in the bucket + { + this->SetCurrentWeapon(p); + return; + } + } + } + else + { + const char* theSound = AvHSHUGetCommonSoundName(gHUD.GetIsAlien(), WEAPON_SOUND_MOVE_SELECT); + gHUD.PlayHUDSound(theSound, kHUDSoundVolume); + + if ( gpActiveSel ) + p = GetNextActivePos( gpActiveSel->iSlot, gpActiveSel->iSlotPos ); + if ( !p ) + p = GetFirstPos( iSlot ); + } + + if (!this->IsSelectable(p)) // no valid selection found + { + // if fastSwitch is on, ignore, else turn on the menu + if ( !fastSwitch ) { + gpActiveSel = (WEAPON *)1; + } + else { + gpActiveSel = NULL; + } + } + else + { + gpActiveSel = p; + } +} + +//------------------------------------------------------------------------ +// Message Handlers +//------------------------------------------------------------------------ + +// +// AmmoX -- Update the count of a known type of ammo +// +int CHudAmmo::MsgFunc_AmmoX(const char *pszName, int iSize, void *pbuf) +{ + BEGIN_READ( pbuf, iSize ); + + int iIndex = READ_BYTE(); + int iCount = READ_BYTE(); + + gWR.SetAmmo( iIndex, abs(iCount) ); + + return 1; +} + +int CHudAmmo::MsgFunc_AmmoPickup( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + int iIndex = READ_BYTE(); + int iCount = READ_BYTE(); + + // Add ammo to the history + gHR.AddToHistory( HISTSLOT_AMMO, iIndex, abs(iCount) ); + + return 1; +} + +int CHudAmmo::MsgFunc_WeapPickup( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + int iIndex = READ_BYTE(); + + // Add the weapon to the history + gHR.AddToHistory( HISTSLOT_WEAP, iIndex ); + + return 1; +} + +int CHudAmmo::MsgFunc_ItemPickup( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + const char *szName = READ_STRING(); + + // Add the weapon to the history + gHR.AddToHistory( HISTSLOT_ITEM, szName ); + + return 1; +} + + +int CHudAmmo::MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + gHUD.m_iHideHUDDisplay = READ_BYTE(); + + if (gEngfuncs.IsSpectateOnly()) + return 1; + if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL ) ) + { + static wrect_t nullrc; + gpActiveSel = NULL; + gHUD.SetCurrentCrosshair( 0, nullrc, 0, 0, 0 ); + } + else + { + if ( m_pWeapon ) + gHUD.SetCurrentCrosshair( m_pWeapon->hCrosshair, m_pWeapon->rcCrosshair, 255, 255, 255 ); + } + + return 1; +} + +// +// CurWeapon: Update hud state with the current weapon and clip count. Ammo +// counts are updated with AmmoX. Server assures that the Weapon ammo type +// numbers match a real ammo type. +// +int CHudAmmo::MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf ) +{ + static wrect_t nullrc; + int fOnTarget = FALSE; + + BEGIN_READ( pbuf, iSize ); + + int iState = READ_BYTE(); + int iId = READ_CHAR(); + int iClip = READ_CHAR(); + // puzl: 497 read enable state from the server ( assign it below ) + int iEnabled = READ_BYTE(); + + // detect if we're also on target + if ( iState > 1 ) + { + fOnTarget = TRUE; + } + + if ( iId < 1 ) + { + gHUD.SetCurrentCrosshair(0, nullrc, 0, 0, 0); + return 0; + } + + if ( g_iUser1 != OBS_IN_EYE ) + { + // Is player dead??? + if ((iId == -1) && (iClip == -1)) + { + gHUD.m_fPlayerDead = TRUE; + gpActiveSel = NULL; + return 1; + } + gHUD.m_fPlayerDead = FALSE; + } + + WEAPON *pWeapon = gWR.GetWeapon( iId ); + + if ( !pWeapon ) + return 0; + + pWeapon->iEnabled=iEnabled; + + if ( iClip < -1 ) + pWeapon->iClip = abs(iClip); + else + pWeapon->iClip = iClip; + + + if ( iState == 0 ) // we're not the current weapon, so update no more + return 1; + + m_pWeapon = pWeapon; + + if ( !(gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL )) ) + { + if ( gHUD.m_iFOV >= 90 ) + { // normal crosshairs + if (fOnTarget && m_pWeapon->hAutoaim) + gHUD.SetCurrentCrosshair(m_pWeapon->hAutoaim, m_pWeapon->rcAutoaim, 255, 255, 255); + else + gHUD.SetCurrentCrosshair(m_pWeapon->hCrosshair, m_pWeapon->rcCrosshair, 255, 255, 255); + } + else + { // zoomed crosshairs + if (fOnTarget && m_pWeapon->hZoomedAutoaim) + gHUD.SetCurrentCrosshair(m_pWeapon->hZoomedAutoaim, m_pWeapon->rcZoomedAutoaim, 255, 255, 255); + else + gHUD.SetCurrentCrosshair(m_pWeapon->hZoomedCrosshair, m_pWeapon->rcZoomedCrosshair, 255, 255, 255); + } + } + + m_fFade = 200.0f; //!!! + m_iFlags |= HUD_ACTIVE; + + return 1; +} + +// +// WeaponList -- Tells the hud about a new weapon type. +// +int CHudAmmo::MsgFunc_WeaponList(const char *pszName, int iSize, void *pbuf ) +{ + + BEGIN_READ( pbuf, iSize ); + + WEAPON Weapon; + + strcpy( Weapon.szName, READ_STRING() ); + Weapon.iAmmoType = (int)READ_CHAR(); + + Weapon.iMax1 = READ_BYTE(); + if (Weapon.iMax1 == 255) + Weapon.iMax1 = -1; + + Weapon.iAmmo2Type = READ_CHAR(); + Weapon.iMax2 = READ_BYTE(); + if (Weapon.iMax2 == 255) + Weapon.iMax2 = -1; + + Weapon.iSlot = READ_CHAR(); + Weapon.iSlotPos = READ_CHAR(); + Weapon.iId = READ_CHAR(); + Weapon.iFlags = READ_BYTE(); + Weapon.iClip = 0; + // puzl: 497 - default value for enable state + Weapon.iEnabled = 0; + + gWR.AddWeapon( &Weapon ); + return 1; + +} + +//------------------------------------------------------------------------ +// Command Handlers +//------------------------------------------------------------------------ +// Slot button pressed +void CHudAmmo::SlotInput( int iSlot ) +{ + // Let the Viewport use it first, for menus + if ( gViewPort && gViewPort->SlotInput( iSlot ) ) + return; + + gWR.SelectSlot(iSlot, FALSE, 1); +} + +void CHudAmmo::UserCmd_Slot1(void) +{ + SlotInput( 0 ); +} + +void CHudAmmo::UserCmd_Slot2(void) +{ + SlotInput( 1 ); +} + +void CHudAmmo::UserCmd_Slot3(void) +{ + SlotInput( 2 ); +} + +void CHudAmmo::UserCmd_Slot4(void) +{ + SlotInput( 3 ); +} + +void CHudAmmo::UserCmd_Slot5(void) +{ + SlotInput( 4 ); +} + +void CHudAmmo::UserCmd_Slot6(void) +{ + SlotInput( 5 ); +} + +void CHudAmmo::UserCmd_Slot7(void) +{ + SlotInput( 6 ); +} + +void CHudAmmo::UserCmd_Slot8(void) +{ + SlotInput( 7 ); +} + +void CHudAmmo::UserCmd_Slot9(void) +{ + SlotInput( 8 ); +} + +void CHudAmmo::UserCmd_Slot10(void) +{ + SlotInput( 9 ); +} + +void CHudAmmo::UserCmd_Close(void) +{ + if (gpActiveSel) + { + gpLastSel = gpActiveSel; + gpActiveSel = NULL; + + const char* theSound = AvHSHUGetCommonSoundName(gHUD.GetIsAlien(), WEAPON_SOUND_HUD_OFF); + gHUD.PlayHUDSound(theSound, kHUDSoundVolume); + } + else + { + bool thePotentiallyEnableOptionsScreen = false; + bool theOptionsScreenEnabled = false; + + #ifdef DEBUG + thePotentiallyEnableOptionsScreen = true; + #endif + + #ifdef AVH_PLAYTEST_BUILD + thePotentiallyEnableOptionsScreen = true; + + if(thePotentiallyEnableOptionsScreen) + { + if(!gHUD.GetInTopDownMode()) + { + if(gHUD.GetBalanceInts().size() > 0) + { + theOptionsScreenEnabled = true; + } + } + } + #endif + + if(theOptionsScreenEnabled) + { + // Toggle game options menu + if(gViewPort->IsOptionsMenuVisible()) + { + gViewPort->HideOptionsMenu(); + } + else + { + gViewPort->ShowOptionsMenu(); + } + } + else + { + if(gHUD.GetInTopDownMode()) + { + gHUD.Cancel(); + } + else + { + ClientCmd("escape"); + } + } + } +} + + +// Selects the next item in the weapon menu +void CHudAmmo::UserCmd_NextWeapon(void) +{ + if(gHUD.GetInTopDownMode()) + { + AvHScrollHandler::ScrollHeightUp(); + } + + if ( gHUD.m_fPlayerDead || (gHUD.m_iHideHUDDisplay & (HIDEHUD_WEAPONS | HIDEHUD_ALL)) ) + return; + + if ( !gpActiveSel || gpActiveSel == (WEAPON*)1 ) + gpActiveSel = m_pWeapon; + + int pos = 0; + int slot = 0; + if ( gpActiveSel ) + { + pos = gpActiveSel->iSlotPos + 1; + slot = gpActiveSel->iSlot; + } + + for ( int loop = 0; loop <= 1; loop++ ) + { + for ( ; slot < MAX_WEAPON_SLOTS; slot++ ) + { + for ( ; pos < MAX_WEAPON_POSITIONS; pos++ ) + { + WEAPON *wsp = gWR.GetWeaponSlot( slot, pos ); + + if (gWR.IsSelectable(wsp)) + { + gpActiveSel = wsp; + return; + } + } + + pos = 0; + } + + slot = 0; // start looking from the first slot again + } + + gpActiveSel = NULL; +} + +// Selects the previous item in the menu +void CHudAmmo::UserCmd_PrevWeapon(void) +{ + if(gHUD.GetInTopDownMode()) + { + AvHScrollHandler::ScrollHeightDown(); + } + + if ( gHUD.m_fPlayerDead || (gHUD.m_iHideHUDDisplay & (HIDEHUD_WEAPONS | HIDEHUD_ALL)) ) + return; + + if ( !gpActiveSel || gpActiveSel == (WEAPON*)1 ) + gpActiveSel = m_pWeapon; + + int pos = MAX_WEAPON_POSITIONS-1; + int slot = MAX_WEAPON_SLOTS-1; + if ( gpActiveSel ) + { + pos = gpActiveSel->iSlotPos - 1; + slot = gpActiveSel->iSlot; + } + + for ( int loop = 0; loop <= 1; loop++ ) + { + for ( ; slot >= 0; slot-- ) + { + for ( ; pos >= 0; pos-- ) + { + WEAPON *wsp = gWR.GetWeaponSlot( slot, pos ); + + if (gWR.IsSelectable(wsp)) + { + gpActiveSel = wsp; + return; + } + } + + pos = MAX_WEAPON_POSITIONS-1; + } + + slot = MAX_WEAPON_SLOTS-1; + } + + gpActiveSel = NULL; +} + +void CHudAmmo::SetCurrentClip(int inClip) +{ + if(this->m_pWeapon) + { + this->m_pWeapon->iClip = inClip; + } +} + +//------------------------------------------------------------------------- +// Drawing code +//------------------------------------------------------------------------- + +int CHudAmmo::Draw(float flTime) +{ + int a, x, y, r, g, b; + int AmmoWidth; + + if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) )) + return 1; + + if (/*!gHUD.GetIsAlive() ||*/ (gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL )) ) + return 1; + + // Draw Weapon Menu + DrawWList(flTime); + + // Draw ammo pickup history + gHR.DrawAmmoHistory( flTime ); + + if (!(m_iFlags & HUD_ACTIVE)) + return 0; + + if (!m_pWeapon) + return 0; + + WEAPON *pw = m_pWeapon; // shorthand + + // SPR_Draw Ammo + if ((pw->iAmmoType < 0) && (pw->iAmmo2Type < 0)) + return 0; + + + int iFlags = DHN_DRAWZERO; // draw 0 values + + AmmoWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left; + + a = (int) max( MIN_ALPHA, m_fFade ); + + if (m_fFade > 0) + m_fFade -= (gHUD.m_flTimeDelta * 20); + + gHUD.GetPrimaryHudColor(r, g, b); + + ScaleColors(r, g, b, a ); + + int theViewport[4]; + gHUD.GetViewport(theViewport); + + // Does this weapon have a clip? + y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight/2; + + // Does weapon have any ammo at all? + if (m_pWeapon->iAmmoType > 0) + { + int iIconWidth = m_pWeapon->rcAmmo.right - m_pWeapon->rcAmmo.left; + + if (pw->iClip >= 0) + { + // room for the number and the '|' and the current ammo + + x = theViewport[0] + theViewport[2] - (8 * AmmoWidth) - iIconWidth; + x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, pw->iClip, r, g, b); + + wrect_t rc; + rc.top = 0; + rc.left = 0; + rc.right = AmmoWidth; + rc.bottom = 100; + + int iBarWidth = AmmoWidth/10; + + x += AmmoWidth/2; + + gHUD.GetPrimaryHudColor(r, g, b); + + // draw the | bar + FillRGBA(x, y, iBarWidth, gHUD.m_iFontHeight, r, g, b, a); + + x += iBarWidth + AmmoWidth/2;; + + // GL Seems to need this + ScaleColors(r, g, b, a ); + x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, gWR.CountAmmo(pw->iAmmoType), r, g, b); + + + } + else + { + // SPR_Draw a bullets only line + x = theViewport[0] + theViewport[2] - 4 * AmmoWidth - iIconWidth; + x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, gWR.CountAmmo(pw->iAmmoType), r, g, b); + } + + // Draw the ammo Icon + int iOffset = (m_pWeapon->rcAmmo.bottom - m_pWeapon->rcAmmo.top)/8; + SPR_Set(m_pWeapon->hAmmo, r, g, b); + SPR_DrawAdditive(0, x, y - iOffset, &m_pWeapon->rcAmmo); + } + + // Does weapon have seconday ammo? + if (pw->iAmmo2Type > 0) + { + int iIconWidth = m_pWeapon->rcAmmo2.right - m_pWeapon->rcAmmo2.left; + + // Do we have secondary ammo? + if ((pw->iAmmo2Type != 0) && (gWR.CountAmmo(pw->iAmmo2Type) > 0)) + { + y -= gHUD.m_iFontHeight + gHUD.m_iFontHeight/4; + x = theViewport[0] + theViewport[2] - 4 * AmmoWidth - iIconWidth; + x = gHUD.DrawHudNumber(x, y, iFlags|DHN_3DIGITS, gWR.CountAmmo(pw->iAmmo2Type), r, g, b); + + // Draw the ammo Icon + SPR_Set(m_pWeapon->hAmmo2, r, g, b); + int iOffset = (m_pWeapon->rcAmmo2.bottom - m_pWeapon->rcAmmo2.top)/8; + SPR_DrawAdditive(0, x, y - iOffset, &m_pWeapon->rcAmmo2); + } + } + return 1; +} + + +// +// Draws the ammo bar on the hud +// +int DrawBar(int x, int y, int width, int height, float f) +{ + int r, g, b; + + if (f < 0) + f = 0; + if (f > 1) + f = 1; + + if (f) + { + int w = f * width; + + // Always show at least one pixel if we have ammo. + if (w <= 0) + w = 1; + UnpackRGB(r, g, b, RGB_GREENISH); + FillRGBA(x, y, w, height, r, g, b, 255); + x += w; + width -= w; + } + + gHUD.GetPrimaryHudColor(r, g, b); + FillRGBA(x, y, width, height, r, g, b, 128); + + return (x + width); +} + + + +void DrawAmmoBar(WEAPON *p, int x, int y, int width, int height) +{ + if ( !p ) + return; + + if (p->iAmmoType != -1) + { + if (!gWR.CountAmmo(p->iAmmoType)) + return; + + float f = (float)gWR.CountAmmo(p->iAmmoType)/(float)p->iMax1; + + x = DrawBar(x, y, width, height, f); + + + // Do we have secondary ammo too? + + if (p->iAmmo2Type != -1) + { + f = (float)gWR.CountAmmo(p->iAmmo2Type)/(float)p->iMax2; + + x += 5; //!!! + + DrawBar(x, y, width, height, f); + } + } +} + + + + +// +// Draw Weapon Menu +// +int CHudAmmo::DrawWList(float flTime) +{ + int r,g,b,x,y,a,i; + + if ( !gpActiveSel ) + { + gHUD.SetSelectingWeaponID(-1); + return 0; + } + + int iActiveSlot; + + if ( gpActiveSel == (WEAPON *)1 ) + iActiveSlot = -1; // current slot has no weapons + else + iActiveSlot = gpActiveSel->iSlot; + + x = 10; //!!! + y = 10; //!!! + + + // Ensure that there are available choices in the active slot + if ( iActiveSlot > 0 ) + { + if ( !gWR.GetFirstPos( iActiveSlot ) ) + { + gpActiveSel = (WEAPON *)1; + iActiveSlot = -1; + } + } + + // Draw top line + for ( i = 0; i < MAX_WEAPON_SLOTS; i++ ) + { + int iWidth; + + gHUD.GetPrimaryHudColor(r, g, b); + + if ( iActiveSlot == i ) + a = 255; + else + a = 192; + + ScaleColors(r, g, b, 255); + SPR_Set(gHUD.GetSprite(m_HUD_bucket0 + i), r, g, b ); + + // make active slot wide enough to accomodate gun pictures + if ( i == iActiveSlot ) + { + WEAPON *p = gWR.GetFirstPos(iActiveSlot); + if ( p ) + iWidth = p->rcActive.right - p->rcActive.left; + else + iWidth = giBucketWidth; + } + else + iWidth = giBucketWidth; + + SPR_DrawAdditive(0, x, y, &gHUD.GetSpriteRect(m_HUD_bucket0 + i)); + + x += iWidth + 5; + } + + + a = 128; //!!! + x = 10; + + // Draw all of the buckets + for (i = 0; i < MAX_WEAPON_SLOTS; i++) + { + y = giBucketHeight + 10; + + // If this is the active slot, draw the bigger pictures, + // otherwise just draw boxes + if ( i == iActiveSlot ) + { + WEAPON *p = gWR.GetFirstPos( i ); + int iWidth = giBucketWidth; + if ( p ) + iWidth = p->rcActive.right - p->rcActive.left; + + for ( int iPos = 0; iPos < MAX_WEAPON_POSITIONS; iPos++ ) + { + p = gWR.GetWeaponSlot( i, iPos ); + + if ( !p || !p->iId ) + continue; + + // Preserve red/yellow depending on whether it has ammo or not + if(!gWR.IsEnabled(p)) + { + UnpackRGB(r,g,b, RGB_REDISH); + ScaleColors(r, g, b, 128); + } + else + { + gHUD.GetPrimaryHudColor(r, g, b); + ScaleColors(r, g, b, 192); + } + + if ( gpActiveSel == p ) + { + SPR_Set(p->hActive, r, g, b ); + SPR_DrawAdditive(0, x, y, &p->rcActive); + + SPR_Set(gHUD.GetSprite(m_HUD_selection), r, g, b ); + SPR_DrawAdditive(0, x, y, &gHUD.GetSpriteRect(m_HUD_selection)); + + // Lookup iID for helptext + gHUD.SetSelectingWeaponID(p->iId, r, g, b); + } + else + { + // Draw Weapon if Red if no ammo + + //if (gWR.IsSelectable(p)) + // ScaleColors(r, g, b, 192); + //else + //{ + // UnpackRGB(r,g,b, RGB_REDISH); + // ScaleColors(r, g, b, 128); + //} + + SPR_Set( p->hInactive, r, g, b ); + SPR_DrawAdditive( 0, x, y, &p->rcInactive ); + } + + // Draw Ammo Bar + + DrawAmmoBar(p, x + giABWidth/2, y, giABWidth, giABHeight); + + y += p->rcActive.bottom - p->rcActive.top + 5; + } + + x += iWidth + 5; + + } + else + { + // Draw Row of weapons. + gHUD.GetPrimaryHudColor(r, g, b); + + for ( int iPos = 0; iPos < MAX_WEAPON_POSITIONS; iPos++ ) + { + WEAPON *p = gWR.GetWeaponSlot( i, iPos ); + + if ( !p || !p->iId ) + continue; + + if ( gWR.IsEnabled(p) ) + { + gHUD.GetPrimaryHudColor(r, g, b); + a = 128; + } + else + { + UnpackRGB(r,g,b, RGB_REDISH); + a = 96; + } + + FillRGBA( x, y, giBucketWidth, giBucketHeight, r, g, b, a ); + + y += giBucketHeight + 5; + } + + x += giBucketWidth + 5; + } + } + + return 1; + +} + + +/* ================================= + GetSpriteList + +Finds and returns the matching +sprite name 'psz' and resolution 'iRes' +in the given sprite list 'pList' +iCount is the number of items in the pList +================================= */ +client_sprite_t *GetSpriteList(client_sprite_t *pList, const char *psz, int iRes, int iCount) +{ + if (!pList) + return NULL; + + int i = iCount; + client_sprite_t *p = pList; + + while(i--) + { + if ((!strcmp(psz, p->szName)) && (p->iRes == iRes)) + return p; + p++; + } + + return NULL; +} diff --git a/main/source/cl_dll/ammo.h b/main/source/cl_dll/ammo.h new file mode 100644 index 00000000..20bfa987 --- /dev/null +++ b/main/source/cl_dll/ammo.h @@ -0,0 +1,64 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ + +#ifndef __AMMO_H__ +#define __AMMO_H__ + +#define MAX_WEAPON_NAME 128 + + +#define WEAPON_FLAGS_SELECTONEMPTY 1 + +#define WEAPON_IS_ONTARGET 0x40 + +struct WEAPON +{ + char szName[MAX_WEAPON_NAME]; + int iAmmoType; + int iAmmo2Type; + int iMax1; + int iMax2; + int iSlot; + int iSlotPos; + int iFlags; + int iId; + int iClip; + // puzl: 497 - weapon enable state + int iEnabled; + + int iCount; // # of itesm in plist + + HSPRITE hActive; + wrect_t rcActive; + HSPRITE hInactive; + wrect_t rcInactive; + HSPRITE hAmmo; + wrect_t rcAmmo; + HSPRITE hAmmo2; + wrect_t rcAmmo2; + HSPRITE hCrosshair; + wrect_t rcCrosshair; + HSPRITE hAutoaim; + wrect_t rcAutoaim; + HSPRITE hZoomedCrosshair; + wrect_t rcZoomedCrosshair; + HSPRITE hZoomedAutoaim; + wrect_t rcZoomedAutoaim; +}; + +typedef int AMMO; + + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/ammo_secondary.cpp b/main/source/cl_dll/ammo_secondary.cpp new file mode 100644 index 00000000..8e1f835e --- /dev/null +++ b/main/source/cl_dll/ammo_secondary.cpp @@ -0,0 +1,159 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// ammo_secondary.cpp +// +// implementation of CHudAmmoSecondary class +// + +#include "hud.h" +#include "cl_util.h" +#include +#include +#include "parsemsg.h" + +DECLARE_MESSAGE( m_AmmoSecondary, SecAmmoVal ); +DECLARE_MESSAGE( m_AmmoSecondary, SecAmmoIcon ); + +int CHudAmmoSecondary :: Init( void ) +{ + HOOK_MESSAGE( SecAmmoVal ); + HOOK_MESSAGE( SecAmmoIcon ); + + gHUD.AddHudElem(this); + m_HUD_ammoicon = 0; + + for ( int i = 0; i < MAX_SEC_AMMO_VALUES; i++ ) + m_iAmmoAmounts[i] = -1; // -1 means don't draw this value + + Reset(); + + return 1; +} + +void CHudAmmoSecondary :: Reset( void ) +{ + m_fFade = 0; +} + +int CHudAmmoSecondary :: VidInit( void ) +{ + return 1; +} + +int CHudAmmoSecondary :: Draw(float flTime) +{ + if ( (gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL )) ) + return 1; + + // draw secondary ammo icons above normal ammo readout + int a, x, y, r, g, b, AmmoWidth; + gHUD.GetPrimaryHudColor(r, g, b); + a = (int) max( MIN_ALPHA, m_fFade ); + if (m_fFade > 0) + m_fFade -= (gHUD.m_flTimeDelta * 20); // slowly lower alpha to fade out icons + ScaleColors( r, g, b, a ); + + AmmoWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left; + + y = ScreenHeight() - (gHUD.m_iFontHeight*4); // this is one font height higher than the weapon ammo values + x = ScreenWidth() - AmmoWidth; + + if ( m_HUD_ammoicon ) + { + // Draw the ammo icon + x -= (gHUD.GetSpriteRect(m_HUD_ammoicon).right - gHUD.GetSpriteRect(m_HUD_ammoicon).left); + y -= (gHUD.GetSpriteRect(m_HUD_ammoicon).top - gHUD.GetSpriteRect(m_HUD_ammoicon).bottom); + + SPR_Set( gHUD.GetSprite(m_HUD_ammoicon), r, g, b ); + SPR_DrawAdditive( 0, x, y, &gHUD.GetSpriteRect(m_HUD_ammoicon) ); + } + else + { // move the cursor by the '0' char instead, since we don't have an icon to work with + x -= AmmoWidth; + y -= (gHUD.GetSpriteRect(gHUD.m_HUD_number_0).top - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).bottom); + } + + // draw the ammo counts, in reverse order, from right to left + for ( int i = MAX_SEC_AMMO_VALUES-1; i >= 0; i-- ) + { + if ( m_iAmmoAmounts[i] < 0 ) + continue; // negative ammo amounts imply that they shouldn't be drawn + + // half a char gap between the ammo number and the previous pic + x -= (AmmoWidth / 2); + + // draw the number, right-aligned + x -= (gHUD.GetNumWidth( m_iAmmoAmounts[i], DHN_DRAWZERO ) * AmmoWidth); + gHUD.DrawHudNumber( x, y, DHN_DRAWZERO, m_iAmmoAmounts[i], r, g, b ); + + if ( i != 0 ) + { + // draw the divider bar + x -= (AmmoWidth / 2); + FillRGBA(x, y, (AmmoWidth/10), gHUD.m_iFontHeight, r, g, b, a); + } + } + + return 1; +} + +// Message handler for Secondary Ammo Value +// accepts one value: +// string: sprite name +int CHudAmmoSecondary :: MsgFunc_SecAmmoIcon( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + m_HUD_ammoicon = gHUD.GetSpriteIndex( READ_STRING() ); + + return 1; +} + +// Message handler for Secondary Ammo Icon +// Sets an ammo value +// takes two values: +// byte: ammo index +// byte: ammo value +int CHudAmmoSecondary :: MsgFunc_SecAmmoVal( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + int index = READ_BYTE(); + if ( index < 0 || index >= MAX_SEC_AMMO_VALUES ) + return 1; + + m_iAmmoAmounts[index] = READ_BYTE(); + m_iFlags |= HUD_ACTIVE; + + // check to see if there is anything left to draw + int count = 0; + for ( int i = 0; i < MAX_SEC_AMMO_VALUES; i++ ) + { + count += max( 0, m_iAmmoAmounts[i] ); + } + + if ( count == 0 ) + { // the ammo fields are all empty, so turn off this hud area + m_iFlags &= ~HUD_ACTIVE; + return 1; + } + + // make the icons light up + m_fFade = 200.0f; + + return 1; +} + + diff --git a/main/source/cl_dll/ammohistory.cpp b/main/source/cl_dll/ammohistory.cpp new file mode 100644 index 00000000..76aec248 --- /dev/null +++ b/main/source/cl_dll/ammohistory.cpp @@ -0,0 +1,190 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// ammohistory.cpp +// + + +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" + +#include +#include + +#include "ammohistory.h" + +HistoryResource gHR; + +#define AMMO_PICKUP_GAP (gHR.iHistoryGap+5) +#define AMMO_PICKUP_PICK_HEIGHT (32 + (gHR.iHistoryGap * 2)) +#define AMMO_PICKUP_HEIGHT_MAX (ScreenHeight() - 100) + +#define MAX_ITEM_NAME 32 +int HISTORY_DRAW_TIME = 5; + +// keep a list of items +struct ITEM_INFO +{ + char szName[MAX_ITEM_NAME]; + HSPRITE spr; + wrect_t rect; +}; + +void HistoryResource :: AddToHistory( int iType, int iId, int iCount ) +{ + if ( iType == HISTSLOT_AMMO && !iCount ) + return; // no amount, so don't add + + if ( (((AMMO_PICKUP_GAP * iCurrentHistorySlot) + AMMO_PICKUP_PICK_HEIGHT) > AMMO_PICKUP_HEIGHT_MAX) || (iCurrentHistorySlot >= MAX_HISTORY) ) + { // the pic would have to be drawn too high + // so start from the bottom + iCurrentHistorySlot = 0; + } + + HIST_ITEM *freeslot = &rgAmmoHistory[iCurrentHistorySlot++]; // default to just writing to the first slot + HISTORY_DRAW_TIME = CVAR_GET_FLOAT( "hud_drawhistory_time" ); + + freeslot->type = iType; + freeslot->iId = iId; + freeslot->iCount = iCount; + freeslot->DisplayTime = gHUD.m_flTime + HISTORY_DRAW_TIME; +} + +void HistoryResource :: AddToHistory( int iType, const char *szName, int iCount ) +{ + if ( iType != HISTSLOT_ITEM ) + return; + + if ( (((AMMO_PICKUP_GAP * iCurrentHistorySlot) + AMMO_PICKUP_PICK_HEIGHT) > AMMO_PICKUP_HEIGHT_MAX) || (iCurrentHistorySlot >= MAX_HISTORY) ) + { // the pic would have to be drawn too high + // so start from the bottom + iCurrentHistorySlot = 0; + } + + HIST_ITEM *freeslot = &rgAmmoHistory[iCurrentHistorySlot++]; // default to just writing to the first slot + + // I am really unhappy with all the code in this file + + int i = gHUD.GetSpriteIndex( szName ); + if ( i == -1 ) + return; // unknown sprite name, don't add it to history + + freeslot->iId = i; + freeslot->type = iType; + freeslot->iCount = iCount; + + HISTORY_DRAW_TIME = CVAR_GET_FLOAT( "hud_drawhistory_time" ); + freeslot->DisplayTime = gHUD.m_flTime + HISTORY_DRAW_TIME; +} + + +void HistoryResource :: CheckClearHistory( void ) +{ + for ( int i = 0; i < MAX_HISTORY; i++ ) + { + if ( rgAmmoHistory[i].type ) + return; + } + + iCurrentHistorySlot = 0; +} + +// +// Draw Ammo pickup history +// +int HistoryResource :: DrawAmmoHistory( float flTime ) +{ + for ( int i = 0; i < MAX_HISTORY; i++ ) + { + if ( rgAmmoHistory[i].type ) + { + rgAmmoHistory[i].DisplayTime = min( rgAmmoHistory[i].DisplayTime, gHUD.m_flTime + HISTORY_DRAW_TIME ); + + if ( rgAmmoHistory[i].DisplayTime <= flTime ) + { // pic drawing time has expired + memset( &rgAmmoHistory[i], 0, sizeof(HIST_ITEM) ); + CheckClearHistory(); + } + else if ( rgAmmoHistory[i].type == HISTSLOT_AMMO ) + { + wrect_t rcPic; + HSPRITE *spr = gWR.GetAmmoPicFromWeapon( rgAmmoHistory[i].iId, rcPic ); + + int r, g, b; + gHUD.GetPrimaryHudColor(r, g, b); + float scale = (rgAmmoHistory[i].DisplayTime - flTime) * 80; + ScaleColors(r, g, b, min(scale, 255) ); + + // Draw the pic + int ypos = ScreenHeight() - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i)); + int xpos = ScreenWidth() - 24; + if ( spr && *spr ) // weapon isn't loaded yet so just don't draw the pic + { // the dll has to make sure it has sent info the weapons you need + SPR_Set( *spr, r, g, b ); + SPR_DrawAdditive( 0, xpos, ypos, &rcPic ); + } + + // Draw the number + gHUD.DrawHudNumberString( xpos - 10, ypos, xpos - 100, rgAmmoHistory[i].iCount, r, g, b ); + } + else if ( rgAmmoHistory[i].type == HISTSLOT_WEAP ) + { + WEAPON *weap = gWR.GetWeapon( rgAmmoHistory[i].iId ); + + if ( !weap ) + return 1; // we don't know about the weapon yet, so don't draw anything + + int r, g, b; + gHUD.GetPrimaryHudColor(r, g, b); + + if ( !gWR.HasAmmo( weap ) ) + UnpackRGB(r,g,b, RGB_REDISH); // if the weapon doesn't have ammo, display it as red + + float scale = (rgAmmoHistory[i].DisplayTime - flTime) * 80; + ScaleColors(r, g, b, min(scale, 255) ); + + int ypos = ScreenHeight() - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i)); + int xpos = ScreenWidth() - (weap->rcInactive.right - weap->rcInactive.left); + SPR_Set( weap->hInactive, r, g, b ); + SPR_DrawAdditive( 0, xpos, ypos, &weap->rcInactive ); + } + else if ( rgAmmoHistory[i].type == HISTSLOT_ITEM ) + { + int r, g, b; + + if ( !rgAmmoHistory[i].iId ) + continue; // sprite not loaded + + wrect_t rect = gHUD.GetSpriteRect( rgAmmoHistory[i].iId ); + + gHUD.GetPrimaryHudColor(r, g, b); + float scale = (rgAmmoHistory[i].DisplayTime - flTime) * 80; + ScaleColors(r, g, b, min(scale, 255) ); + + int ypos = ScreenHeight() - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i)); + int xpos = ScreenWidth() - (rect.right - rect.left) - 10; + + SPR_Set( gHUD.GetSprite( rgAmmoHistory[i].iId ), r, g, b ); + SPR_DrawAdditive( 0, xpos, ypos, &rect ); + } + } + } + + + return 1; +} + + diff --git a/main/source/cl_dll/ammohistory.h b/main/source/cl_dll/ammohistory.h new file mode 100644 index 00000000..0969f42c --- /dev/null +++ b/main/source/cl_dll/ammohistory.h @@ -0,0 +1,165 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +* Modified by Charles G. Cleveland +* +* $Workfile: ammohistory.h $ +* $Date: 2002/06/25 17:05:31 $ +* +*------------------------------------------------------------------------------- +* $Log: ammohistory.h,v $ +* Revision 1.3 2002/06/25 17:05:31 Flayra +* - Weapon enabling/disabling works differently now +* +*=============================================================================== +****/ +// +// ammohistory.h +// + +// this is the max number of items in each bucket +//#define MAX_WEAPON_POSITIONS MAX_WEAPON_SLOTS +#define MAX_WEAPON_POSITIONS 10 + +class WeaponsResource +{ +private: + // Information about weapons & ammo + WEAPON rgWeapons[MAX_WEAPONS]; // Weapons Array + + // counts of weapons * ammo + WEAPON* rgSlots[MAX_WEAPON_SLOTS+1][MAX_WEAPON_POSITIONS+1]; // The slots currently in use by weapons. The value is a pointer to the weapon; if it's NULL, no weapon is there + int riAmmo[MAX_AMMO_TYPES]; // count of each ammo type + + //client-side lastinv + WEAPON* lastWeapon; + +public: + void Init(void); + + void Reset( void ) + { + iOldWeaponBits = 0; + memset( rgSlots, 0, sizeof rgSlots ); + memset( riAmmo, 0, sizeof riAmmo ); + lastWeapon = NULL; + } + +///// WEAPON ///// + int iOldWeaponBits; + + WEAPON *GetWeapon( int iId ) { return &rgWeapons[iId]; } + void AddWeapon( WEAPON *wp ) + { + rgWeapons[ wp->iId ] = *wp; + LoadWeaponSprites( &rgWeapons[ wp->iId ] ); + } + + void PickupWeapon( WEAPON *wp ) + { + rgSlots[ wp->iSlot ][ wp->iSlotPos ] = wp; + } + + void DropWeapon( WEAPON *wp ) + { + rgSlots[ wp->iSlot ][ wp->iSlotPos ] = NULL; + if(lastWeapon == wp) //dropped last weapon, remove it from the list + { + lastWeapon = NULL; + } + } + + void DropAllWeapons( void ) + { + for ( int i = 0; i < MAX_WEAPONS; i++ ) + { + if ( rgWeapons[i].iId ) + DropWeapon( &rgWeapons[i] ); + } + } + + WEAPON* GetWeaponSlot( int slot, int pos ) { return rgSlots[slot][pos]; } + + void LoadWeaponSprites( WEAPON* wp ); + void LoadAllWeaponSprites( void ); + WEAPON* GetFirstPos( int iSlot ); + void SelectSlot( int iSlot, int fAdvance, int iDirection ); + WEAPON* GetNextActivePos( int iSlot, int iSlotPos ); + + void UserCmd_LastInv(void); + void SetValidWeapon(void); + void SetCurrentWeapon(WEAPON* wp); + int IsEnabled( WEAPON *p ); + int IsSelectable(WEAPON *p); + int HasAmmo( WEAPON *p ); + + +///// AMMO ///// + AMMO GetAmmo( int iId ) { return riAmmo[ iId ]; } + + void SetAmmo( int iId, int iCount ) { riAmmo[ iId ] = iCount; } + + int CountAmmo( int iId ); + + HSPRITE* GetAmmoPicFromWeapon( int iAmmoId, wrect_t& rect ); +}; + +extern WeaponsResource gWR; + + +#define MAX_HISTORY 12 +enum { + HISTSLOT_EMPTY, + HISTSLOT_AMMO, + HISTSLOT_WEAP, + HISTSLOT_ITEM, +}; + +class HistoryResource +{ +private: + struct HIST_ITEM { + int type; + float DisplayTime; // the time at which this item should be removed from the history + int iCount; + int iId; + }; + + HIST_ITEM rgAmmoHistory[MAX_HISTORY]; + +public: + + void Init( void ) + { + Reset(); + } + + void Reset( void ) + { + memset( rgAmmoHistory, 0, sizeof rgAmmoHistory ); + } + + int iHistoryGap; + int iCurrentHistorySlot; + + void AddToHistory( int iType, int iId, int iCount = 0 ); + void AddToHistory( int iType, const char *szName, int iCount = 0 ); + + void CheckClearHistory( void ); + int DrawAmmoHistory( float flTime ); +}; + +extern HistoryResource gHR; + + + diff --git a/main/source/cl_dll/battery.cpp b/main/source/cl_dll/battery.cpp new file mode 100644 index 00000000..c3fc6352 --- /dev/null +++ b/main/source/cl_dll/battery.cpp @@ -0,0 +1,156 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// battery.cpp +// +// implementation of CHudBattery class +// + +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" + +#include +#include +#include "mod/AvHPlayerUpgrade.h" +#include "mod/AvHHudConstants.h" + +DECLARE_MESSAGE(m_Battery, Battery) + +int CHudBattery::Init(void) +{ + m_iBat = 0; + m_fFade = 0; + m_iFlags = 0; + + HOOK_MESSAGE(Battery); + + gHUD.AddHudElem(this); + + return 1; +}; + + +int CHudBattery::VidInit(void) +{ + int HUD_suit_empty = gHUD.GetSpriteIndex( "suit_empty" ); + int HUD_suit_full = gHUD.GetSpriteIndex( "suit_full" ); + + m_hSprite1 = m_hSprite2 = 0; // delaying get sprite handles until we know the sprites are loaded + m_prc1 = &gHUD.GetSpriteRect( HUD_suit_empty ); + m_prc2 = &gHUD.GetSpriteRect( HUD_suit_full ); + m_iHeight = m_prc2->bottom - m_prc1->top; + m_fFade = 0; + return 1; +}; + +int CHudBattery:: MsgFunc_Battery(const char *pszName, int iSize, void *pbuf ) +{ + m_iFlags |= HUD_ACTIVE; + + + BEGIN_READ( pbuf, iSize ); + int x = READ_SHORT(); + + if (x != m_iBat) + { + // We're sent the health of the player we're observing as if it were our own + m_fFade = FADE_TIME; + m_iBat = x; + } + + return 1; +} + + +int CHudBattery::Draw(float flTime) +{ + + if ( gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH ) + return 1; + + int r, g, b, x, y, a; + wrect_t rc; + + rc = *m_prc2; + + int theMaxArmor = gHUD.GetHUDMaxArmor(); + float theScalar = 1.0f/theMaxArmor; + + rc.top += m_iHeight * ((float)(theMaxArmor-(min(theMaxArmor, m_iBat))) * theScalar); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1 + + gHUD.GetPrimaryHudColor(r, g, b); + + if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) )) + return 1; + + // Has health changed? Flash the health # + if (m_fFade) + { + if (m_fFade > FADE_TIME) + m_fFade = FADE_TIME; + + m_fFade -= (gHUD.m_flTimeDelta * 20); + if (m_fFade <= 0) + { + a = 128; + m_fFade = 0; + } + + // Fade the health number back to dim + + a = MIN_ALPHA + (m_fFade/FADE_TIME) * 128; + + } + else + a = MIN_ALPHA; + + ScaleColors(r, g, b, a ); + + int iOffset = (m_prc1->bottom - m_prc1->top)/6; + + int theInset = 0; + if(gHUD.GetIsAlien()) + { + theInset = ScreenWidth()*kResourceEnergyBarWidth; + } + + int theViewport[4]; + gHUD.GetViewport(theViewport); + + y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2; + x = theViewport[0] + theInset + kArmorLeftInset*ScreenWidth(); + + // make sure we have the right sprite handles + if ( !m_hSprite1 ) + m_hSprite1 = gHUD.GetSprite( gHUD.GetSpriteIndex( "suit_empty" ) ); + if ( !m_hSprite2 ) + m_hSprite2 = gHUD.GetSprite( gHUD.GetSpriteIndex( "suit_full" ) ); + + SPR_Set(m_hSprite1, r, g, b ); + SPR_DrawAdditive( 0, x, y - iOffset, m_prc1); + + if (rc.bottom > rc.top) + { + SPR_Set(m_hSprite2, r, g, b ); + SPR_DrawAdditive( 0, x, y - iOffset + (rc.top - m_prc2->top), &rc); + } + + x += (m_prc1->right - m_prc1->left); + x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iBat, r, g, b); + + return 1; + +} \ No newline at end of file diff --git a/main/source/cl_dll/camera.h b/main/source/cl_dll/camera.h new file mode 100644 index 00000000..7b7cd017 --- /dev/null +++ b/main/source/cl_dll/camera.h @@ -0,0 +1,17 @@ +// Camera.h -- defines and such for a 3rd person camera +// NOTE: must include quakedef.h first + +#ifndef _CAMERA_H_ +#define _CAMEA_H_ + +// pitch, yaw, dist +extern vec3_t cam_ofs; +// Using third person camera +extern int cam_thirdperson; + +void CAM_Init( void ); +void CAM_ClearStates( void ); +void CAM_StartMouseMove(void); +void CAM_EndMouseMove(void); + +#endif // _CAMERA_H_ diff --git a/main/source/cl_dll/cdll_int.cpp b/main/source/cl_dll/cdll_int.cpp new file mode 100644 index 00000000..15e3ba62 --- /dev/null +++ b/main/source/cl_dll/cdll_int.cpp @@ -0,0 +1,443 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// cdll_int.c +// +// this implementation handles the linking of the engine to the DLL +// + +#include "hud.h" +#include "cl_util.h" +#include "netadr.h" +#include "vgui_schememanager.h" +#include "particles/papi.h" + +//extern "C" +//{ +#include "pm_shared.h" +//} + +#include +#include "hud_servers.h" +#include "vgui_int.h" +#include "mod\AvHHud.h" +#include "mod\AvHUIFactory.h" +#include "mod\AvHParticleSystemManager.h" +#include "mod\AvHHulls.h" +#include "interface.h" +#include "ITrackerUser.h" + +#include "engine/APIProxy.h" +#include "cl_dll/Exports.h" + +cl_enginefunc_t gEngfuncs; + +// Instead of using default Half-life HUD, use more flexible one I've added +//CHud gHUD; +//UIHud gHUD("StratHL/ui.txt", new AvHUIFactory()); +AvHHud gHUD((string(getModDirectory()) + "/ui.txt").c_str(), new AvHUIFactory()); + +TeamFortressViewport *gViewPort = NULL; + +HINTERFACEMODULE g_hTrackerModule = NULL; +ITrackerUser *g_pTrackerUser = NULL; + +void InitInput (void); +void EV_HookEvents( void ); +void IN_Commands( void ); + +/* +================================ +HUD_GetHullBounds + + Engine calls this to enumerate player collision hulls, for prediction. Return 0 if the hullnumber doesn't exist. +================================ +*/ +int CL_DLLEXPORT HUD_GetHullBounds( int hullnumber, float *mins, float *maxs ) +{ + RecClGetHullBounds(hullnumber, mins, maxs); + + int iret = 0; + + switch ( hullnumber ) + { + case 0: // Human and level 4 alien, crouched level 5 + HULL0_MIN.CopyToArray(mins); + HULL0_MAX.CopyToArray(maxs); + iret = 1; + break; + + case 1: // Crouched human, level 2 alien, level 3, crouched level 3 and 4 + HULL1_MIN.CopyToArray(mins); + HULL1_MAX.CopyToArray(maxs); + iret = 1; + break; + + case 2: // Point based hull + HULL2_MIN.CopyToArray(mins); + HULL2_MAX.CopyToArray(maxs); + iret = 1; + break; + + case 3: // Huge alien + HULL3_MIN.CopyToArray(mins); + HULL3_MAX.CopyToArray(maxs); + iret = 1; + break; + } + + return iret; +} + +/* +================================ +HUD_ConnectionlessPacket + + Return 1 if the packet is valid. Set response_buffer_size if you want to send a response packet. Incoming, it holds the max + size of the response_buffer, so you must zero it out if you choose not to respond. +================================ +*/ +int CL_DLLEXPORT HUD_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ) +{ + RecClConnectionlessPacket(net_from, args, response_buffer, response_buffer_size); + + // Parse stuff from args + int max_buffer_size = *response_buffer_size; + + // Zero it out since we aren't going to respond. + // If we wanted to response, we'd write data into response_buffer + *response_buffer_size = 0; + + // Since we don't listen for anything here, just respond that it's a bogus message + // If we didn't reject the message, we'd return 1 for success instead. + return 0; +} + +void CL_DLLEXPORT HUD_PlayerMoveInit( struct playermove_s *ppmove ) +{ + RecClClientMoveInit(ppmove); + + PM_Init( ppmove ); +} + +char CL_DLLEXPORT HUD_PlayerMoveTexture( char *name ) +{ + RecClClientTextureType(name); + + return PM_FindTextureType( name ); +} + +void CL_DLLEXPORT HUD_PlayerMove( struct playermove_s *ppmove, int server ) +{ + RecClClientMove(ppmove, server); + + PM_Move( ppmove, server ); +} + +int CL_DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion ) +{ + gEngfuncs = *pEnginefuncs; + + RecClInitialize(pEnginefuncs, iVersion); + + if (iVersion != CLDLL_INTERFACE_VERSION) + return 0; + + memcpy(&gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t)); + + EV_HookEvents(); + // get tracker interface, if any + char szDir[512]; + if (!gEngfuncs.COM_ExpandFilename("Bin/TrackerUI.dll", szDir, sizeof(szDir))) + { + g_pTrackerUser = NULL; + g_hTrackerModule = NULL; + return 1; + } + + g_hTrackerModule = Sys_LoadModule(szDir); + CreateInterfaceFn trackerFactory = Sys_GetFactory(g_hTrackerModule); + if (!trackerFactory) + { + g_pTrackerUser = NULL; + g_hTrackerModule = NULL; + return 1; + } + + g_pTrackerUser = (ITrackerUser *)trackerFactory(TRACKERUSER_INTERFACE_VERSION, NULL); + return 1; +} + + +/* +========================== + HUD_VidInit + +Called when the game initializes +and whenever the vid_mode is changed +so the HUD can reinitialize itself. +========================== +*/ + +int CL_DLLEXPORT HUD_VidInit( void ) +{ + RecClHudVidInit(); + gHUD.VidInit(); + + VGui_Startup(); + + return 1; +} + +/* +========================== +HUD_Init + + Called whenever the client connects + to a server. Reinitializes all + the hud variables. + ========================== +*/ + +void CL_DLLEXPORT HUD_Init( void ) +{ + RecClHudInit(); + InitInput(); + gHUD.Init(); + Scheme_Init(); +} + + +void UIDrawVariableBarSpriteHoles(int inSprite, int inX, int inY, float inPercentage) +{ + // Assumes that frame 0 is the empty sprite, frame 1 is full sprite + const int kEmptyFrame = 0; + const int kFullFrame = 1; + + int theSpriteWidth = SPR_Width(inSprite, kFullFrame); + int theSpriteHeight = SPR_Height(inSprite, kFullFrame); + + int theColorComponent = 255; + + // Draw empty sprite + SPR_Set(inSprite, theColorComponent, theColorComponent, theColorComponent); + SPR_DrawHoles(kEmptyFrame, inX, inY, NULL); + + // Draw secondary level if specified, at half brightness + int theFilledHeight = theSpriteHeight*inPercentage; + theFilledHeight = theSpriteHeight*inPercentage; + + // Draw partially full sprite. Enable scissor so it's not all drawn. + SPR_EnableScissor(inX, inY + (theSpriteHeight - theFilledHeight), theSpriteWidth, theFilledHeight); + + SPR_Set(inSprite, theColorComponent, theColorComponent, theColorComponent); + SPR_DrawHoles(kFullFrame, inX, inY, NULL); + + SPR_DisableScissor(); +} + +// Demonstrates black lines around the edge of sprites (both using tri API and SPR_* calls) +// Demonstrates scissor not working properly +void Direct3DTest() +{ + static int theSprite = 0; + + if(!theSprite) + { + theSprite = Safe_SPR_Load("sprites/640a-energy.spr"); + } + + // Draw alien energy + if(theSprite) + { + int theFrame = 0; + + int theX = ScreenWidth() - SPR_Width(theSprite, theFrame); + int theY = ScreenHeight() - SPR_Height(theSprite, theFrame); + + // 0-1, depending how much to draw + float theFactor = .5f; + UIDrawVariableBarSpriteHoles(theSprite, theX, theY, theFactor); + } +} + +/* +========================== +HUD_Redraw + + called every screen frame to + redraw the HUD. + =========================== +*/ + +int CL_DLLEXPORT HUD_Redraw( float time, int intermission ) +{ + RecClHudRedraw(time, intermission); + + gHUD.Redraw( time, intermission ); + + //Direct3DTest(); + + //SoftwareTest(); + + return 1; +} + + +/* +========================== + HUD_UpdateClientData + +called every time shared client +dll/engine data gets changed, +and gives the cdll a chance +to modify the data. + +returns 1 if anything has been changed, 0 otherwise. +========================== +*/ + +int CL_DLLEXPORT HUD_UpdateClientData(client_data_t *pcldata, float flTime ) +{ + RecClHudUpdateClientData(pcldata, flTime); + + IN_Commands(); + + return gHUD.UpdateClientData(pcldata, flTime ); +} + +/* +========================== + HUD_Reset + +Called at start and end of demos to restore to "non"HUD state. +========================== +*/ + +void CL_DLLEXPORT HUD_Reset( void ) +{ + RecClHudReset(); + + gHUD.VidInit(); + AvHParticleSystemManager::Instance()->Reset(); +} + +/* +========================== +HUD_Frame + + Called by engine every frame that client .dll is loaded + ========================== +*/ + +void CL_DLLEXPORT HUD_Frame( double time ) +{ + RecClHudFrame(time); + + ServersThink( time ); + + GetClientVoiceMgr()->Frame(time); +} + + +/* +========================== +HUD_VoiceStatus + + Called when a player starts or stops talking. + ========================== +*/ + +void CL_DLLEXPORT HUD_VoiceStatus(int entindex, qboolean bTalking) +{ + RecClVoiceStatus(entindex, bTalking); + + GetClientVoiceMgr()->UpdateSpeakerStatus(entindex, bTalking); +} + +/* +========================== +HUD_DirectorEvent + + Called when a director event message was received + ========================== +*/ + +void CL_DLLEXPORT HUD_DirectorMessage( int iSize, void *pbuf ) +{ + RecClDirectorMessage(iSize, pbuf); + gHUD.m_Spectator.DirectorMessage( iSize, pbuf ); +} + + + +#if defined( FINAL_VAC_BUILD ) + +cldll_func_dst_t *g_pcldstAddrs; + +extern "C" void __declspec( dllexport ) F(void *pv) +{ + cldll_func_t *pcldll_func = (cldll_func_t *)pv; + + g_pcldstAddrs = ((cldll_func_dst_t *)pcldll_func->pHudVidInitFunc); + + cldll_func_t cldll_func = + { + Initialize, + HUD_Init, + HUD_VidInit, + HUD_Redraw, + HUD_UpdateClientData, + HUD_Reset, + HUD_PlayerMove, + HUD_PlayerMoveInit, + HUD_PlayerMoveTexture, + IN_ActivateMouse, + IN_DeactivateMouse, + IN_MouseEvent, + IN_ClearStates, + IN_Accumulate, + CL_CreateMove, + CL_IsThirdPerson, + CL_CameraOffset, + KB_Find, + CAM_Think, + V_CalcRefdef, + HUD_AddEntity, + HUD_CreateEntities, + HUD_DrawNormalTriangles, + HUD_DrawTransparentTriangles, + HUD_StudioEvent, + HUD_PostRunCmd, + HUD_Shutdown, + HUD_TxferLocalOverrides, + HUD_ProcessPlayerState, + HUD_TxferPredictionData, + Demo_ReadBuffer, + HUD_ConnectionlessPacket, + HUD_GetHullBounds, + HUD_Frame, + HUD_Key_Event, + HUD_TempEntUpdate, + HUD_GetUserEntity, + HUD_VoiceStatus, + HUD_DirectorMessage, + HUD_GetStudioModelInterface, + }; + + *pcldll_func = cldll_func; +} + +#endif // FINAL_VAC_BUILD \ No newline at end of file diff --git a/main/source/cl_dll/chud.h b/main/source/cl_dll/chud.h new file mode 100644 index 00000000..aa00f392 --- /dev/null +++ b/main/source/cl_dll/chud.h @@ -0,0 +1,127 @@ +#ifndef CHUD_H +#define CHUD_H + +#include "cl_dll/chudmisc.h" +#include "cl_dll/hud_spectator.h" +#include "mod/AvHFont.h" + + +class CHud +{ +private: + HUDLIST *m_pHudList; + HSPRITE m_hsprLogo; + int m_iLogo; + client_sprite_t *m_pSpriteList; + int m_iSpriteCount; + int m_iSpriteCountAllRes; + float m_flMouseSensitivity; + int m_iConcussionEffect; + +public: + + HSPRITE m_hsprCursor; + float m_flTime; // the current client time + float m_fOldTime; // the time at which the HUD was last redrawn + double m_flTimeDelta; // the difference between flTime and fOldTime + Vector m_vecOrigin; + Vector m_vecAngles; + int m_iKeyBits; + int m_iHideHUDDisplay; + int m_iFOV; + int m_Teamplay; + int m_iRes; + cvar_t *m_pCvarStealMouse; + cvar_t *m_pCvarDraw; + + int m_iFontHeight; + int DrawHudNumber(int x, int y, int iFlags, int iNumber, int r, int g, int b ); + int DrawHudStringCentered(int x, int y, int iMaxX, const char *szString, int r, int g, int b ); + int DrawHudString(int x, int y, int iMaxX, const char *szString, int r, int g, int b ); + int GetHudStringHeight(); + int GetHudStringWidth(const char* szIt); + int DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b ); + int DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int r, int g, int b ); + int GetNumWidth(int iNumber, int iFlags); + +private: + // the memory for these arrays are allocated in the first call to CHud::VidInit(), when the hud.txt and associated sprites are loaded. + // freed in ~CHud() + HSPRITE *m_rghSprites; /*[HUD_SPRITE_COUNT]*/ // the sprites loaded from hud.txt + wrect_t *m_rgrcRects; /*[HUD_SPRITE_COUNT]*/ + char *m_rgszSpriteNames; /*[HUD_SPRITE_COUNT][MAX_SPRITE_NAME_LENGTH]*/ + + struct cvar_s *default_fov; + + +public: + HSPRITE GetSprite( int index ) + { + return (index < 0) ? 0 : m_rghSprites[index]; + } + + wrect_t& GetSpriteRect( int index ) + { + return m_rgrcRects[index]; + } + + + int GetSpriteIndex( const char *SpriteName ); // gets a sprite index, for use in the m_rghSprites[] array + + CHudAmmo m_Ammo; + CHudHealth m_Health; + CHudSpectator m_Spectator; + CHudGeiger m_Geiger; + CHudBattery m_Battery; + CHudTrain m_Train; + CHudFlashlight m_Flash; + CHudMessage m_Message; + CHudStatusBar m_StatusBar; + CHudDeathNotice m_DeathNotice; + CHudSayText m_SayText; + CHudMenu m_Menu; + CHudAmmoSecondary m_AmmoSecondary; + CHudTextMessage m_TextMessage; + CHudStatusIcons m_StatusIcons; + + AvHFont mFont; + AvHFont mSmallFont; + + void Init( void ); + void VidInit( void ); + void Think(void); + int Redraw( float flTime, int intermission ); + int UpdateClientData( client_data_t *cdata, float time ); + + CHud() : m_iSpriteCount(0), m_pHudList(NULL) {} + ~CHud(); // destructor, frees allocated memory + + // user messages + int _cdecl MsgFunc_Damage(const char *pszName, int iSize, void *pbuf ); + int _cdecl MsgFunc_GameMode(const char *pszName, int iSize, void *pbuf ); + int _cdecl MsgFunc_Logo(const char *pszName, int iSize, void *pbuf); + int _cdecl MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf); + void _cdecl MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf ); + void _cdecl MsgFunc_ViewMode( const char *pszName, int iSize, void *pbuf ); + int _cdecl MsgFunc_SetFOV(const char *pszName, int iSize, void *pbuf); + int _cdecl MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf ); + + // Screen information + SCREENINFO m_scrinfo; + + int m_iWeaponBits; + int m_fPlayerDead; + int m_iIntermission; + + // sprite indexes + int m_HUD_number_0; + + void AddHudElem(CHudBase *p); + + float GetSensitivity(); + +}; + + + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/chudmisc.h b/main/source/cl_dll/chudmisc.h new file mode 100644 index 00000000..6e0dcd94 --- /dev/null +++ b/main/source/cl_dll/chudmisc.h @@ -0,0 +1,556 @@ +#ifndef CHUDMISC_H +#define CHUDMISC_H + +#define RGB_YELLOWISH 0x00FFA000 //255,160,0 +#define RGB_REDISH 0x00FF1010 //255,160,0 +#define RGB_GREENISH 0x0000A000 //0,160,0 +#define RGB_MARINE_BLUE 0x000099FF //0 153 255 +#define RGB_MARINE_SELECTED 0x006EE6FF //110, 230, 255 +#define RGB_MARINE_PARASITED 0x00E3F03D //227, 240, 61 + +#include "wrect.h" +#include "cl_dll.h" +#include "ammo.h" +#include "game_shared/teamconst.h" + +#define DHN_DRAWZERO 1 +#define DHN_2DIGITS 2 +#define DHN_3DIGITS 4 +#define MIN_ALPHA 100 + +#define HUDELEM_ACTIVE 1 + +typedef struct { + int x, y; +} POSITION; + +typedef struct { + unsigned char r,g,b,a; +} RGBA; + +typedef struct cvar_s cvar_t; + + +#define HUD_ACTIVE 1 +#define HUD_INTERMISSION 2 + +#define MAX_PLAYER_NAME_LENGTH 32 + +#define MAX_MOTD_LENGTH 1536 + +// +//----------------------------------------------------- +// +class CHudBase +{ +public: + POSITION m_pos; + int m_type; + int m_iFlags; // active, moving, + virtual ~CHudBase() {} + virtual int Init( void ) {return 0;} + virtual int VidInit( void ) {return 0;} + virtual int Draw(float flTime) {return 0;} + virtual void Think(void) {return;} + virtual void Reset(void) {return;} + virtual void InitHUDData( void ) {} // called every time a server is connected to + +}; + +struct HUDLIST { + CHudBase *p; + HUDLIST *pNext; +}; + + + +// +//----------------------------------------------------- +// +#include "..\game_shared\voice_status.h" +#include "hud_spectator.h" + + +// +//----------------------------------------------------- +// +class CHudAmmo: public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + int Draw(float flTime); + void Think(void); + void Reset(void); + int DrawWList(float flTime); + int MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf); + int MsgFunc_WeaponList(const char *pszName, int iSize, void *pbuf); + int MsgFunc_AmmoX(const char *pszName, int iSize, void *pbuf); + int MsgFunc_AmmoPickup( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_WeapPickup( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_ItemPickup( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf ); + + void SlotInput( int iSlot ); + void _cdecl UserCmd_Slot1( void ); + void _cdecl UserCmd_Slot2( void ); + void _cdecl UserCmd_Slot3( void ); + void _cdecl UserCmd_Slot4( void ); + void _cdecl UserCmd_Slot5( void ); + void _cdecl UserCmd_Slot6( void ); + void _cdecl UserCmd_Slot7( void ); + void _cdecl UserCmd_Slot8( void ); + void _cdecl UserCmd_Slot9( void ); + void _cdecl UserCmd_Slot10( void ); + void _cdecl UserCmd_Close( void ); + void _cdecl UserCmd_NextWeapon( void ); + void _cdecl UserCmd_PrevWeapon( void ); + + void SetCurrentClip(int inClip); +private: + float m_fFade; + RGBA m_rgba; + WEAPON *m_pWeapon; + int m_HUD_bucket0; + int m_HUD_selection; + +}; + + + +// +//----------------------------------------------------- +// +class CHudAmmoSecondary: public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + void Reset( void ); + int Draw(float flTime); + + int MsgFunc_SecAmmoVal( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_SecAmmoIcon( const char *pszName, int iSize, void *pbuf ); + +private: + enum { + MAX_SEC_AMMO_VALUES = 4 + }; + + int m_HUD_ammoicon; // sprite indices + int m_iAmmoAmounts[MAX_SEC_AMMO_VALUES]; + float m_fFade; +}; + + +#include "health.h" + + +#define FADE_TIME 100 + + + + +// +//----------------------------------------------------- +// +class CHudGeiger: public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + int Draw(float flTime); + int MsgFunc_Geiger(const char *pszName, int iSize, void *pbuf); + +private: + int m_iGeigerRange; + +}; + +// +//----------------------------------------------------- +// +class CHudTrain: public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + int Draw(float flTime); + int MsgFunc_Train(const char *pszName, int iSize, void *pbuf); + +private: + HSPRITE m_hSprite; + int m_iPos; + +}; + +// +//----------------------------------------------------- +// +// REMOVED: Vgui has replaced this. +// +/* +class CHudMOTD : public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + int Draw( float flTime ); + void Reset( void ); + + int MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ); + +protected: + static int MOTD_DISPLAY_TIME; + char m_szMOTD[ MAX_MOTD_LENGTH ]; + float m_flActiveRemaining; + int m_iLines; +}; +*/ + +// +//----------------------------------------------------- +// +class CHudStatusBar : public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + int Draw( float flTime ); + const char* GetStatusString() const; + void Reset( void ); + void ParseStatusString( int line_num ); + + int MsgFunc_StatusText( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_StatusValue( const char *pszName, int iSize, void *pbuf ); + +protected: + void ReparseStringIfNeeded(); + + enum { + MAX_STATUSTEXT_LENGTH = 128, + MAX_STATUSBAR_VALUES = 8, + MAX_STATUSBAR_LINES = 2, + }; + + char m_szStatusText[MAX_STATUSBAR_LINES][MAX_STATUSTEXT_LENGTH]; // a text string describing how the status bar is to be drawn + char m_szStatusBar[MAX_STATUSBAR_LINES][MAX_STATUSTEXT_LENGTH]; // the constructed bar that is drawn + int m_iStatusValues[MAX_STATUSBAR_VALUES]; // an array of values for use in the status bar + + int m_bReparseString; // set to TRUE whenever the m_szStatusBar needs to be recalculated + + // an array of colors...one color for each line + float *m_pflNameColors[MAX_STATUSBAR_LINES]; +}; + + +// +//----------------------------------------------------- +// +// REMOVED: Vgui has replaced this. +// +/* +class CHudScoreboard: public CHudBase +{ +public: + int Init( void ); + void InitHUDData( void ); + int VidInit( void ); + int Draw( float flTime ); + int DrawPlayers( int xoffset, float listslot, int nameoffset = 0, char *team = NULL ); // returns the ypos where it finishes drawing + void UserCmd_ShowScores( void ); + void UserCmd_HideScores( void ); + int MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamScore( const char *pszName, int iSize, void *pbuf ); + void DeathMsg( int killer, int victim ); + + int m_iNumTeams; + + int m_iLastKilledBy; + int m_fLastKillTime; + int m_iPlayerNum; + int m_iShowscoresHeld; + + void GetAllPlayersInfo( void ); +private: + struct cvar_s *cl_showpacketloss; + +}; +*/ + +#define CUSTOM_ICON_LENGTH 32 + +struct extra_player_info_t +{ + short score; + short lastScore; + float timeOfLastScoreChange; + + short frags; + short deaths; + short playerclass; + short teamnumber; + char teamname[MAX_TEAM_NAME]; + short auth; + short color; + char customicon[CUSTOM_ICON_LENGTH + 3]; //last 3 characters is the color. +}; + +struct team_info_t +{ + char name[MAX_TEAM_NAME]; + short score; + short frags; + short deaths; + short ping; + short packetloss; + short ownteam; + short players; + int already_drawn; + int scores_overriden; + int teamnumber; +}; + +extern hud_player_info_t g_PlayerInfoList[MAX_PLAYERS+1]; // player info from the engine +extern extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS+1]; // additional player info sent directly to the client dll +extern team_info_t g_TeamInfo[MAX_TEAMS+1]; +extern int g_IsSpectator[MAX_PLAYERS+1]; + + +// +//----------------------------------------------------- +// +class CHudDeathNotice : public CHudBase +{ +public: + int Init( void ); + void InitHUDData( void ); + int VidInit( void ); + int Draw( float flTime ); + int MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbuf ); + +private: + int m_HUD_d_skull; // sprite index of skull icon +}; + + +// +//----------------------------------------------------- +// +class CHudMenu : public CHudBase +{ +public: + int Init( void ); + void InitHUDData( void ); + int VidInit( void ); + void Reset( void ); + int Draw( float flTime ); + int MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf ); + + void SelectMenuItem( int menu_item ); + + int m_fMenuDisplayed; + int m_bitsValidSlots; + float m_flShutoffTime; + int m_fWaitingForMore; +}; + + +// +//----------------------------------------------------- +// +class CHudSayText : public CHudBase +{ +public: + int Init( void ); + void InitHUDData( void ); + int VidInit( void ); + int Draw( float flTime ); + int MsgFunc_SayText( const char *pszName, int iSize, void *pbuf ); + void SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex = -1 ); + void EnsureTextFitsInOneLineAndWrapIfHaveTo( int line ); +friend class CHud; +friend class CHudSpectator; + +private: + + struct cvar_s * m_HUD_saytext; + struct cvar_s * m_HUD_saytext_time; +}; + + +// +//----------------------------------------------------- +// +class CHudBattery: public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + int Draw(float flTime); + int MsgFunc_Battery(const char *pszName, int iSize, void *pbuf ); + +private: + HSPRITE m_hSprite1; + HSPRITE m_hSprite2; + wrect_t *m_prc1; + wrect_t *m_prc2; + int m_iBat; + float m_fFade; + int m_iHeight; // width of the battery innards +}; + + + +// +//----------------------------------------------------- +// +class CHudFlashlight: public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + int Draw(float flTime); + void Reset( void ); + int MsgFunc_Flashlight(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_FlashBat(const char *pszName, int iSize, void *pbuf ); + +private: + HSPRITE m_hSprite1; + HSPRITE m_hSprite2; + HSPRITE m_hBeam; + wrect_t *m_prc1; + wrect_t *m_prc2; + wrect_t *m_prcBeam; + float m_flBat; + int m_iBat; + int m_fOn; + float m_fFade; + int m_iWidth; // width of the battery innards +}; + + +// +//----------------------------------------------------- +// +const int maxHUDMessages = 16; +struct message_parms_t +{ + client_textmessage_t *pMessage; + float time; + int x, y; + int totalWidth, totalHeight; + int width; + int lines; + int lineLength; + int length; + int r, g, b; + int text; + int fadeBlend; + float charTime; + float fadeTime; +}; + + +// +//----------------------------------------------------- +// +class CHudTextMessage: public CHudBase +{ +public: + int Init( void ); + static char *LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size ); + static char *BufferedLocaliseTextString( const char *msg ); + char *LookupString( const char *msg_name, int *msg_dest = NULL ); + int MsgFunc_TextMsg(const char *pszName, int iSize, void *pbuf); +}; + + +// +//----------------------------------------------------- +// + +class CHudMessage: public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + int Draw(float flTime); + int MsgFunc_HudText(const char *pszName, int iSize, void *pbuf); + int MsgFunc_HudText2(const char *pszName, int iSize, void *pbuf); + int MsgFunc_GameTitle(const char *pszName, int iSize, void *pbuf); + + float FadeBlend( float fadein, float fadeout, float hold, float localTime ); + int XPosition( float x, int width, int lineWidth ); + int YPosition( float y, int height ); + + void MessageAddPlayerID(const char* pName, bool inEnemy); + + void MessageAdd( const char *pName, float time ); + bool MessageRemove( const char *pName ); + void MessageDrawScan( client_textmessage_t *pMessage, float time ); + void MessageScanStart( void ); + void MessageScanNextChar( void ); + void Reset( void ); + +private: + bool DrawMessage(client_textmessage_t* inMessage, float inStartTime, float inCurrentTime); + void SetPlayerIDPosition(); + + client_textmessage_t *m_pMessages[maxHUDMessages]; + float m_startTime[maxHUDMessages]; + message_parms_t m_parms; + float m_gameTitleTime; + client_textmessage_t *m_pGameTitle; + + client_textmessage_t mPlayerIDMessage; + float mPlayerIDTime; + char* mPlayerID; + + int m_HUD_title_life; + int m_HUD_title_half; +}; + +// +//----------------------------------------------------- +// +#define MAX_SPRITE_NAME_LENGTH 24 + +class CHudStatusIcons: public CHudBase +{ +public: + int Init( void ); + int VidInit( void ); + void Reset( void ); + int Draw(float flTime); + int MsgFunc_StatusIcon(const char *pszName, int iSize, void *pbuf); + + enum { + MAX_ICONSPRITENAME_LENGTH = MAX_SPRITE_NAME_LENGTH, + MAX_ICONSPRITES = 4, + }; + + + //had to make these public so CHud could access them (to enable concussion icon) + //could use a friend declaration instead... + void EnableIcon( char *pszIconName, unsigned char red, unsigned char green, unsigned char blue ); + void DisableIcon( char *pszIconName ); + +private: + + typedef struct + { + char szSpriteName[MAX_ICONSPRITENAME_LENGTH]; + HSPRITE spr; + wrect_t rc; + unsigned char r, g, b; + } icon_sprite_t; + + icon_sprite_t m_IconList[MAX_ICONSPRITES]; + +}; + +typedef struct cvar_s cvar_t; + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/cl_dll.h b/main/source/cl_dll/cl_dll.h new file mode 100644 index 00000000..cbadc147 --- /dev/null +++ b/main/source/cl_dll/cl_dll.h @@ -0,0 +1,38 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// cl_dll.h +// + +// 4-23-98 JOHN + +// +// This DLL is linked by the client when they first initialize. +// This DLL is responsible for the following tasks: +// - Loading the HUD graphics upon initialization +// - Drawing the HUD graphics every frame +// - Handling the custum HUD-update packets +// +typedef unsigned char byte; +typedef unsigned short word; +typedef float vec_t; +typedef int (*pfnUserMsgHook)(const char *pszName, int iSize, void *pbuf); + +#include "util_vector.h" + +#include "../engine/cdll_int.h" +#include "../dlls/cdll_dll.h" + +extern cl_enginefunc_t gEngfuncs; diff --git a/main/source/cl_dll/cl_dll.vcproj b/main/source/cl_dll/cl_dll.vcproj new file mode 100644 index 00000000..8f65fa20 --- /dev/null +++ b/main/source/cl_dll/cl_dll.vcproj @@ -0,0 +1,3423 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/source/cl_dll/cl_util.cpp b/main/source/cl_dll/cl_util.cpp new file mode 100644 index 00000000..0a77c5d6 --- /dev/null +++ b/main/source/cl_dll/cl_util.cpp @@ -0,0 +1,64 @@ +#include "hud.h" +#include "cl_dll/cl_util.h" + +float gTextR = 1; +float gTextG = 1; +float gTextB = 1; + +void DrawSetTextColor(float r, float g, float b ) +{ + gTextR = r; + gTextG = g; + gTextB = b; + gEngfuncs.pfnDrawSetTextColor(r, g, b); +} + +int DrawConsoleString( int x, int y, const char *string ) +{ + //return gEngfuncs.pfnDrawConsoleString( x, y, (char*) string ); + + if (string[0] == 2) + { + ++string; + } + + int result = gHUD.GetSmallFont().DrawString(x, y, string, gTextR * 255, gTextG * 255, gTextB * 255, kRenderTransAdd); + DrawSetTextColor(1, 1, 1); + + return result; + +} + +void GetConsoleStringSize( const char *string, int *width, int *height ) +{ + + //gEngfuncs.pfnDrawConsoleStringLen( string, width, height ); + + if (string[0] == 2) + { + ++string; + } + + *width = gHUD.GetSmallFont().GetStringWidth(string); + *height = gHUD.GetSmallFont().GetStringHeight(); + +} + +int ConsoleStringLen( const char *string ) +{ + int _width, _height; + GetConsoleStringSize( string, &_width, &_height ); + return _width; +} + +void ConsolePrint( const char *string ) +{ + // TODO Max: implement this + gEngfuncs.pfnConsolePrint( string ); +} + +void CenterPrint( const char *string ) +{ + // TODO Max: implement this + gEngfuncs.pfnCenterPrint( string ); +} \ No newline at end of file diff --git a/main/source/cl_dll/cl_util.h b/main/source/cl_dll/cl_util.h new file mode 100644 index 00000000..8aabc79a --- /dev/null +++ b/main/source/cl_dll/cl_util.h @@ -0,0 +1,147 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// cl_util.h +// +#ifndef CL_UTIL_H +#define CL_UTIL_H + +#include "cvardef.h" +#include "common/vector_util.h" +#include "vgui_Panel.h" +#include "types.h" +#include "cl_dll/cl_dll.h" +#include "cl_dll/hud.h" + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +// Macros to hook function calls into the HUD object +#define HOOK_MESSAGE(x) gEngfuncs.pfnHookUserMsg(#x, __MsgFunc_##x ); + +#define DECLARE_MESSAGE(y, x) int __MsgFunc_##x(const char *pszName, int iSize, void *pbuf) \ + { \ + return gHUD.##y.MsgFunc_##x(pszName, iSize, pbuf ); \ + } + + +#define HOOK_COMMAND(x, y) gEngfuncs.pfnAddCommand( x, __CmdFunc_##y ); +#define DECLARE_COMMAND(y, x) void __CmdFunc_##x( void ) \ + { \ + gHUD.##y.UserCmd_##x( ); \ + } + +inline float CVAR_GET_FLOAT( const char *x ) { return gEngfuncs.pfnGetCvarFloat( (char*)x ); } +inline char* CVAR_GET_STRING( const char *x ) { return gEngfuncs.pfnGetCvarString( (char*)x ); } +inline struct cvar_s *CVAR_CREATE( const char *cv, const char *val, const int flags ) { return gEngfuncs.pfnRegisterVariable( (char*)cv, (char*)val, flags ); } + +//#define SPR_Load (*gEngfuncs.pfnSPR_Load) +HSPRITE Safe_SPR_Load(const char* inSpriteName); +#define SPR_Set (*gEngfuncs.pfnSPR_Set) +#define SPR_Frames (*gEngfuncs.pfnSPR_Frames) +#define SPR_GetList (*gEngfuncs.pfnSPR_GetList) + +// SPR_Draw draws a the current sprite as solid +#define SPR_Draw (*gEngfuncs.pfnSPR_Draw) +// SPR_DrawHoles draws the current sprites, with color index255 not drawn (transparent) +#define SPR_DrawHoles (*gEngfuncs.pfnSPR_DrawHoles) +// SPR_DrawAdditive adds the sprites RGB values to the background (additive transulency) +#define SPR_DrawAdditive (*gEngfuncs.pfnSPR_DrawAdditive) + +// SPR_EnableScissor sets a clipping rect for HUD sprites. (0,0) is the top-left hand corner of the screen. +#define SPR_EnableScissor (*gEngfuncs.pfnSPR_EnableScissor) +// SPR_DisableScissor disables the clipping rect +#define SPR_DisableScissor (*gEngfuncs.pfnSPR_DisableScissor) + +void CreatePickingRay( int mousex, int mousey, Vector& outVecPickingRay); + +// +#define FillRGBA (*gEngfuncs.pfnFillRGBA) + +int ScreenHeight(); +int ScreenWidth(); + +// Use this to set any co-ords in 640x480 space +#define XRES(x) ((int)(float(x) * ((float)ScreenWidth() / 640.0f) + 0.5f)) +#define YRES(y) ((int)(float(y) * ((float)ScreenHeight() / 480.0f) + 0.5f)) + +// use this to project world coordinates to screen coordinates +#define XPROJECT(x) ( (1.0f+(x))*ScreenWidth()*0.5f ) +#define YPROJECT(y) ( (1.0f-(y))*ScreenHeight()*0.5f ) + +#define GetScreenInfo (*gEngfuncs.pfnGetScreenInfo) +#define ServerCmd (*gEngfuncs.pfnServerCmd) +#define ClientCmd (*gEngfuncs.pfnClientCmd) +#define SetCrosshair (*gEngfuncs.pfnSetCrosshair) +#define AngleVectors (*gEngfuncs.pfnAngleVectors) + + +// Gets the height & width of a sprite, at the specified frame +inline int SPR_Height( HSPRITE x, int f ) { return gEngfuncs.pfnSPR_Height(x, f); } +inline int SPR_Width( HSPRITE x, int f ) { return gEngfuncs.pfnSPR_Width(x, f); } + +inline client_textmessage_t *TextMessageGet( const char *pName ) { return gEngfuncs.pfnTextMessageGet( pName ); } +inline int TextMessageDrawChar( int x, int y, int number, int r, int g, int b ) +{ + return gEngfuncs.pfnDrawCharacter( x, y, number, r, g, b ); +} + +void DrawSetTextColor(float r, float g, float b ); + + +int DrawConsoleString( int x, int y, const char *string ); + +void GetConsoleStringSize( const char *string, int *width, int *height ); +int ConsoleStringLen( const char *string ); + +void ConsolePrint( const char *string ); +void CenterPrint( const char *string ); + +// returns the players name of entity no. +#define GetPlayerInfo (*gEngfuncs.pfnGetPlayerInfo) + +// sound functions +//inline void PlaySound( char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); } +//inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); } + +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#define fabs(x) ((x) > 0 ? (x) : 0 - (x)) + +void ScaleColors( int &r, int &g, int &b, int a ); + +// disable 'possible loss of data converting float to int' warning message +#pragma warning( disable: 4244 ) +// disable 'truncation from 'const double' to 'float' warning message +#pragma warning( disable: 4305 ) + +inline void UnpackRGB(int &r, int &g, int &b, unsigned long ulRGB)\ +{\ + r = (ulRGB & 0xFF0000) >>16;\ + g = (ulRGB & 0xFF00) >> 8;\ + b = ulRGB & 0xFF;\ +} + +void FillRGBAClipped(vgui::Panel* inPanel, int inStartX, int inStartY, int inWidth, int inHeight, int r, int g, int b, int a); + +HSPRITE LoadSprite(const char *pszName); + +//bool LocalizeString(const char* inMessage, char* outBuffer, int inBufferSize); +bool LocalizeString(const char* inMessage, string& outputString); + + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/com_weapons.cpp b/main/source/cl_dll/com_weapons.cpp new file mode 100644 index 00000000..f7270654 --- /dev/null +++ b/main/source/cl_dll/com_weapons.cpp @@ -0,0 +1,278 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ + +// Com_Weapons.cpp +// Shared weapons common/shared functions +#include +#include "hud.h" +#include "cl_util.h" +#include "com_weapons.h" + +#include "const.h" +#include "entity_state.h" +#include "r_efx.h" + +// g_runfuncs is true if this is the first time we've "predicated" a particular movement/firing +// command. If it is 1, then we should play events/sounds etc., otherwise, we just will be +// updating state info, but not firing events +int g_runfuncs = 0; + +// During our weapon prediction processing, we'll need to reference some data that is part of +// the final state passed into the postthink functionality. We'll set this pointer and then +// reset it to NULL as appropriate +struct local_state_s *g_finalstate = NULL; + +/* +==================== +COM_Log + +Log debug messages to file ( appends ) +==================== +*/ +void COM_Log( char *pszFile, char *fmt, ...) +{ + va_list argptr; + char string[1024]; + FILE *fp; + char *pfilename; + + if ( !pszFile ) + { + pfilename = "c:\\hllog.txt"; + } + else + { + pfilename = pszFile; + } + + va_start (argptr,fmt); + vsprintf (string, fmt,argptr); + va_end (argptr); + + fp = fopen( pfilename, "a+t"); + if (fp) + { + fprintf(fp, "%s", string); + fclose(fp); + } +} + +// remember the current animation for the view model, in case we get out of sync with +// server. +static int g_currentanim; + +/* +===================== +HUD_SendWeaponAnim + +Change weapon model animation +===================== +*/ +void HUD_SendWeaponAnim( int iAnim, int body, int force ) +{ + if(iAnim >= 0) + { + // Don't actually change it. + if ( !g_runfuncs && !force ) + return; + + g_currentanim = iAnim; + + // Tell animation system new info + gEngfuncs.pfnWeaponAnim( iAnim, body ); + } +} + +/* +===================== +HUD_GetWeaponAnim + +Retrieve current predicted weapon animation +===================== +*/ +int HUD_GetWeaponAnim( void ) +{ + return g_currentanim; +} + +/* +===================== +HUD_PlaySound + +Play a sound, if we are seeing this command for the first time +===================== +*/ +void HUD_PlaySound( char *sound, float volume ) +{ + if ( !g_runfuncs || !g_finalstate ) + return; + + gEngfuncs.pfnPlaySoundByNameAtLocation( sound, volume, (float *)&g_finalstate->playerstate.origin ); +} + +/* +===================== +HUD_PlaybackEvent + +Directly queue up an event on the client +===================== +*/ +void HUD_PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, + float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ) +{ + vec3_t org; + vec3_t ang; + + if ( !g_runfuncs || !g_finalstate ) + return; + + // Weapon prediction events are assumed to occur at the player's origin + org = g_finalstate->playerstate.origin; + ang = v_angles; + gEngfuncs.pfnPlaybackEvent( flags, pInvoker, eventindex, delay, (float *)&org, (float *)&ang, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2 ); +} + +/* +===================== +HUD_SetMaxSpeed + +===================== +*/ +void HUD_SetMaxSpeed( const edict_t *ed, float speed ) +{ +} + + +/* +===================== +UTIL_WeaponTimeBase + +Always 0.0 on client, even if not predicting weapons ( won't get called + in that case ) +===================== +*/ +float UTIL_WeaponTimeBase( void ) +{ + return 0.0; +} + +static unsigned int glSeed = 0; + +unsigned int seed_table[ 256 ] = +{ + 28985, 27138, 26457, 9451, 17764, 10909, 28790, 8716, 6361, 4853, 17798, 21977, 19643, 20662, 10834, 20103, + 27067, 28634, 18623, 25849, 8576, 26234, 23887, 18228, 32587, 4836, 3306, 1811, 3035, 24559, 18399, 315, + 26766, 907, 24102, 12370, 9674, 2972, 10472, 16492, 22683, 11529, 27968, 30406, 13213, 2319, 23620, 16823, + 10013, 23772, 21567, 1251, 19579, 20313, 18241, 30130, 8402, 20807, 27354, 7169, 21211, 17293, 5410, 19223, + 10255, 22480, 27388, 9946, 15628, 24389, 17308, 2370, 9530, 31683, 25927, 23567, 11694, 26397, 32602, 15031, + 18255, 17582, 1422, 28835, 23607, 12597, 20602, 10138, 5212, 1252, 10074, 23166, 19823, 31667, 5902, 24630, + 18948, 14330, 14950, 8939, 23540, 21311, 22428, 22391, 3583, 29004, 30498, 18714, 4278, 2437, 22430, 3439, + 28313, 23161, 25396, 13471, 19324, 15287, 2563, 18901, 13103, 16867, 9714, 14322, 15197, 26889, 19372, 26241, + 31925, 14640, 11497, 8941, 10056, 6451, 28656, 10737, 13874, 17356, 8281, 25937, 1661, 4850, 7448, 12744, + 21826, 5477, 10167, 16705, 26897, 8839, 30947, 27978, 27283, 24685, 32298, 3525, 12398, 28726, 9475, 10208, + 617, 13467, 22287, 2376, 6097, 26312, 2974, 9114, 21787, 28010, 4725, 15387, 3274, 10762, 31695, 17320, + 18324, 12441, 16801, 27376, 22464, 7500, 5666, 18144, 15314, 31914, 31627, 6495, 5226, 31203, 2331, 4668, + 12650, 18275, 351, 7268, 31319, 30119, 7600, 2905, 13826, 11343, 13053, 15583, 30055, 31093, 5067, 761, + 9685, 11070, 21369, 27155, 3663, 26542, 20169, 12161, 15411, 30401, 7580, 31784, 8985, 29367, 20989, 14203, + 29694, 21167, 10337, 1706, 28578, 887, 3373, 19477, 14382, 675, 7033, 15111, 26138, 12252, 30996, 21409, + 25678, 18555, 13256, 23316, 22407, 16727, 991, 9236, 5373, 29402, 6117, 15241, 27715, 19291, 19888, 19847 +}; + +unsigned int U_Random( void ) +{ + glSeed *= 69069; + glSeed += seed_table[ glSeed & 0xff ]; + + return ( ++glSeed & 0x0fffffff ); +} + +void U_Srand( unsigned int seed ) +{ + glSeed = seed_table[ seed & 0xff ]; +} + +/* +===================== +UTIL_SharedRandomLong +===================== +*/ +int UTIL_SharedRandomLong( unsigned int seed, int low, int high ) +{ + unsigned int range; + + U_Srand( (int)seed + low + high ); + + range = high - low + 1; + if ( !(range - 1) ) + { + return low; + } + else + { + int offset; + int rnum; + + rnum = U_Random(); + + offset = rnum % range; + + return (low + offset); + } +} + +/* +===================== +UTIL_SharedRandomFloat +===================== +*/ +float UTIL_SharedRandomFloat( unsigned int seed, float low, float high ) +{ + + U_Srand( (int)seed + *(int *)&low + *(int *)&high ); + + U_Random(); + U_Random(); + + float range = high - low; + if ( !range ) + { + return low; + } + else + { + int tensixrand; + float offset; + + tensixrand = U_Random() & 65535; + + offset = (float)tensixrand / 65536.0; + + return (low + offset * range ); + } +} + +/* +====================== +stub_* + +stub functions for such things as precaching. So we don't have to modify weapons code that + is compiled into both game and client .dlls. +====================== +*/ +int stub_PrecacheModel ( char* s ) { return 0; } +int stub_PrecacheSound ( char* s ) { return 0; } +unsigned short stub_PrecacheEvent ( int type, const char *s ) { return 0; } +const char *stub_NameForFunction ( unsigned long function ) { return "func"; } +void stub_SetModel ( edict_t *e, const char *m ) {} diff --git a/main/source/cl_dll/com_weapons.h b/main/source/cl_dll/com_weapons.h new file mode 100644 index 00000000..aa58ba77 --- /dev/null +++ b/main/source/cl_dll/com_weapons.h @@ -0,0 +1,49 @@ +//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// com_weapons.h +// Shared weapons common function prototypes +#if !defined( COM_WEAPONSH ) +#define COM_WEAPONSH +#ifdef _WIN32 +#pragma once +#endif + +#include "hud_iface.h" + +// TODO: Remove this? Insert this? +//extern "C" +//{ +// void DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed ); +//} + +void COM_Log( char *pszFile, char *fmt, ...); +int CL_IsDead( void ); + +float UTIL_SharedRandomFloat( unsigned int seed, float low, float high ); +int UTIL_SharedRandomLong( unsigned int seed, int low, int high ); + +int HUD_GetWeaponAnim( void ); +void HUD_SendWeaponAnim( int iAnim, int body, int force ); +void HUD_PlaySound( char *sound, float volume ); +void HUD_PlaybackEvent( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); +void HUD_SetMaxSpeed( const struct edict_s *ed, float speed ); +int stub_PrecacheModel( char* s ); +int stub_PrecacheSound( char* s ); +unsigned short stub_PrecacheEvent( int type, const char *s ); +const char *stub_NameForFunction ( unsigned long function ); +void stub_SetModel ( struct edict_s *e, const char *m ); + + +extern cvar_t *cl_lw; + +extern int g_runfuncs; +extern vec3_t v_angles; +extern float g_lastFOV; +extern struct local_state_s *g_finalstate; + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/death.cpp b/main/source/cl_dll/death.cpp new file mode 100644 index 00000000..ddfdee45 --- /dev/null +++ b/main/source/cl_dll/death.cpp @@ -0,0 +1,329 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// death notice +// +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" + +#include +#include + +#include "vgui_TeamFortressViewport.h" +#include "mod/AvHHudConstants.h" +#include "pm_shared/pm_shared.h" + +DECLARE_MESSAGE( m_DeathNotice, DeathMsg ); + +struct DeathNoticeItem { + char szKiller[MAX_PLAYER_NAME_LENGTH*2]; + char szVictim[MAX_PLAYER_NAME_LENGTH*2]; + int iId; // the index number of the associated sprite + int iSuicide; + int iTeamKill; + int iNonPlayerKill; + float flDisplayTime; + float *KillerColor; + float *VictimColor; +}; + +#define MAX_DEATHNOTICES 4 +static int DEATHNOTICE_DISPLAY_TIME = 6; + +#define DEATHNOTICE_TOP 20 + +DeathNoticeItem rgDeathNoticeList[ MAX_DEATHNOTICES + 1 ]; + +// Changing these? Change them in vgui_TeamFortressViewport::iTeamColors as well +float g_ColorWhite[3] = { 1.0, 1.0f, 1.0 }; +float g_ColorBlue[3] = { .49, .65, .82 }; +float g_ColorOrange[3] = { 1.0, .66, 0.0 }; +float g_ColorGreen[3] = { .56, .84, .55 }; +float g_ColorRed[3] = { .78, .35, .27 }; + +float g_ColorYellow[3] = { 1.0, .96, .39 }; + +float* GetClientColor(int clientIndex) +{ + int theTeamNumber = g_PlayerExtraInfo[clientIndex].teamnumber; + return kFTeamColors[theTeamNumber]; +// outColor[0] = kTeamColors[theTeamNumber][0]; +// outColor[1] = kTeamColors[theTeamNumber][1]; +// outColor[2] = kTeamColors[theTeamNumber][2]; +} + +int CHudDeathNotice :: Init( void ) +{ + gHUD.AddHudElem( this ); + + HOOK_MESSAGE( DeathMsg ); + + CVAR_CREATE( "hud_deathnotice_time", "6", 0 ); + + return 1; +} + + +void CHudDeathNotice :: InitHUDData( void ) +{ + memset( rgDeathNoticeList, 0, sizeof(rgDeathNoticeList) ); +} + + +int CHudDeathNotice :: VidInit( void ) +{ + m_HUD_d_skull = gHUD.GetSpriteIndex( "d_skull" ); + + return 1; +} + +int CHudDeathNotice :: Draw( float flTime ) +{ + int x, y, r, g, b; + + for ( int i = 0; i < MAX_DEATHNOTICES; i++ ) + { + if ( rgDeathNoticeList[i].iId == 0 ) + break; // we've gone through them all + + if ( rgDeathNoticeList[i].flDisplayTime < flTime ) + { // display time has expired + // remove the current item from the list + memmove( &rgDeathNoticeList[i], &rgDeathNoticeList[i+1], sizeof(DeathNoticeItem) * (MAX_DEATHNOTICES - i) ); + i--; // continue on the next item; stop the counter getting incremented + continue; + } + + rgDeathNoticeList[i].flDisplayTime = min( rgDeathNoticeList[i].flDisplayTime, gHUD.m_flTime + DEATHNOTICE_DISPLAY_TIME ); + + // Only draw if the viewport will let me + if ( gViewPort && gViewPort->AllowedToPrintText() ) + { + // Draw the death notice + //y = DEATHNOTICE_TOP + (20 * i); //!!! + int theBaseY = DEATHNOTICE_TOP; + + // Bring down death messages when in top down or when we're drawing letter box + if(gHUD.m_Spectator.IsInOverviewMode()) + { + // No HUD elements to compensate for + } + else if(gHUD.GetInTopDownMode()) + { + theBaseY = .10*ScreenHeight(); + } + else if(gHUD.GetIsMarine()) + { + theBaseY = .26*ScreenHeight(); + } + else if(gHUD.GetIsAlien()) + { + theBaseY = kHiveNormScreenY*ScreenHeight() + (kMaxHives-1)*((kHiveNormScreenHeight + kHiveNormScreenVerticalSpacing)*ScreenHeight()); + } + + // Lower death messages more when spectating so they don't overlap (due to letterbox) + if(g_iUser1 != OBS_NONE) + { + theBaseY += .06*ScreenHeight(); + } + + y = theBaseY + (20 * i); //!!! + + int id = (rgDeathNoticeList[i].iId == -1) ? m_HUD_d_skull : rgDeathNoticeList[i].iId; + x = ScreenWidth() - ConsoleStringLen(rgDeathNoticeList[i].szVictim) - (gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left); + + if ( !rgDeathNoticeList[i].iSuicide ) + { + x -= (5 + ConsoleStringLen( rgDeathNoticeList[i].szKiller ) ); + + // Draw killers name + if ( rgDeathNoticeList[i].KillerColor ) + DrawSetTextColor( rgDeathNoticeList[i].KillerColor[0], rgDeathNoticeList[i].KillerColor[1], rgDeathNoticeList[i].KillerColor[2] ); + x = 5 + DrawConsoleString( x, y, rgDeathNoticeList[i].szKiller ); + } + + r = 255; g = 80; b = 0; + if ( rgDeathNoticeList[i].iTeamKill ) + { + r = 10; g = 240; b = 10; // display it in sickly green + } + + // Draw death weapon + SPR_Set( gHUD.GetSprite(id), r, g, b ); + SPR_DrawAdditive( 0, x, y, &gHUD.GetSpriteRect(id) ); + + x += (gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left); + + // Draw victims name (if it was a player that was killed) + if (rgDeathNoticeList[i].iNonPlayerKill == FALSE) + { + if ( rgDeathNoticeList[i].VictimColor ) + DrawSetTextColor( rgDeathNoticeList[i].VictimColor[0], rgDeathNoticeList[i].VictimColor[1], rgDeathNoticeList[i].VictimColor[2] ); + x = DrawConsoleString( x, y, rgDeathNoticeList[i].szVictim ); + } + } + } + + return 1; +} + +// This message handler may be better off elsewhere +int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbuf ) +{ + m_iFlags |= HUD_ACTIVE; + + BEGIN_READ( pbuf, iSize ); + + int killer = READ_BYTE(); + int victim = READ_BYTE(); + + char killedwith[32]; + strcpy( killedwith, "d_" ); + strncat( killedwith, READ_STRING(), 32 ); + + if (gViewPort) + gViewPort->DeathMsg( killer, victim ); + + gHUD.m_Spectator.DeathMessage(victim); + + for ( int i = 0; i < MAX_DEATHNOTICES; i++ ) + { + if ( rgDeathNoticeList[i].iId == 0 ) + break; + } + if ( i == MAX_DEATHNOTICES ) + { // move the rest of the list forward to make room for this item + memmove( rgDeathNoticeList, rgDeathNoticeList+1, sizeof(DeathNoticeItem) * MAX_DEATHNOTICES ); + i = MAX_DEATHNOTICES - 1; + } + + if (gViewPort) + gViewPort->GetAllPlayersInfo(); + + // Get the Killer's name + char *killer_name = g_PlayerInfoList[ killer ].name; + if ( !killer_name ) + { + killer_name = ""; + rgDeathNoticeList[i].szKiller[0] = 0; + } + else + { + rgDeathNoticeList[i].KillerColor = GetClientColor( killer); + strncpy( rgDeathNoticeList[i].szKiller, killer_name, MAX_PLAYER_NAME_LENGTH ); + rgDeathNoticeList[i].szKiller[MAX_PLAYER_NAME_LENGTH-1] = 0; + } + + // Get the Victim's name + char *victim_name = NULL; + // If victim is -1, the killer killed a specific, non-player object (like a sentrygun) + if ( ((char)victim) != -1 ) + victim_name = g_PlayerInfoList[ victim ].name; + if ( !victim_name ) + { + victim_name = ""; + rgDeathNoticeList[i].szVictim[0] = 0; + } + else + { + rgDeathNoticeList[i].VictimColor = GetClientColor(victim); + strncpy( rgDeathNoticeList[i].szVictim, victim_name, MAX_PLAYER_NAME_LENGTH ); + rgDeathNoticeList[i].szVictim[MAX_PLAYER_NAME_LENGTH-1] = 0; + } + + // Is it a non-player object kill? + if ( ((char)victim) == -1 ) + { + rgDeathNoticeList[i].iNonPlayerKill = TRUE; + + // Store the object's name in the Victim slot (skip the d_ bit) + strcpy( rgDeathNoticeList[i].szVictim, killedwith+2 ); + } + else + { + if ( killer == victim || killer == 0 ) + rgDeathNoticeList[i].iSuicide = TRUE; + + if ( !strcmp( killedwith, "d_teammate" ) ) + rgDeathNoticeList[i].iTeamKill = TRUE; + } + + // Find the sprite in the list + int spr = gHUD.GetSpriteIndex( killedwith ); + + rgDeathNoticeList[i].iId = spr; + + DEATHNOTICE_DISPLAY_TIME = CVAR_GET_FLOAT( "hud_deathnotice_time" ); + rgDeathNoticeList[i].flDisplayTime = gHUD.m_flTime + DEATHNOTICE_DISPLAY_TIME; + + if (rgDeathNoticeList[i].iNonPlayerKill) + { + ConsolePrint( rgDeathNoticeList[i].szKiller ); + ConsolePrint( " killed a " ); + ConsolePrint( rgDeathNoticeList[i].szVictim ); + ConsolePrint( "\n" ); + } + else + { + // record the death notice in the console + if ( rgDeathNoticeList[i].iSuicide ) + { + ConsolePrint( rgDeathNoticeList[i].szVictim ); + + if ( !strcmp( killedwith, "d_world" ) ) + { + ConsolePrint( " died" ); + } + else + { + ConsolePrint( " killed self" ); + } + } + else if ( rgDeathNoticeList[i].iTeamKill ) + { + ConsolePrint( rgDeathNoticeList[i].szKiller ); + ConsolePrint( " killed his teammate " ); + ConsolePrint( rgDeathNoticeList[i].szVictim ); + } + else + { + ConsolePrint( rgDeathNoticeList[i].szKiller ); + ConsolePrint( " killed " ); + ConsolePrint( rgDeathNoticeList[i].szVictim ); + } + + if ( killedwith && *killedwith && (*killedwith > 13 ) && strcmp( killedwith, "d_world" ) && !rgDeathNoticeList[i].iTeamKill ) + { + ConsolePrint( " with " ); + + // replace the code names with the 'real' names + if ( !strcmp( killedwith+2, "egon" ) ) + strcpy( killedwith, "d_gluon gun" ); + if ( !strcmp( killedwith+2, "gauss" ) ) + strcpy( killedwith, "d_tau cannon" ); + + ConsolePrint( killedwith+2 ); // skip over the "d_" part + } + + ConsolePrint( "\n" ); + } + + return 1; +} + + + + diff --git a/main/source/cl_dll/demo.cpp b/main/source/cl_dll/demo.cpp new file mode 100644 index 00000000..0039e87a --- /dev/null +++ b/main/source/cl_dll/demo.cpp @@ -0,0 +1,273 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#include "hud.h" +#include "cl_util.h" +#include "demo.h" +#include "demo_api.h" +#include + +#include "engine/APIProxy.h" +#include "Exports.h" +#include "mod/AvHParticleTemplateClient.h" +#include "cl_dll/view.h" + +extern AvHParticleTemplateListClient gParticleTemplateList; + +int g_demosniper = 0; +int g_demosniperdamage = 0; +float g_demosniperorg[3]; +float g_demosniperangles[3]; +float g_demozoom; +vec3_t gPlaybackViewOrigin; + +int ScorePanel_InitializeDemoPlayback(int inSize, unsigned char* inBuffer); +void ScorePanel_InitializeDemoRecording(); + +float gNormMouseX = 0; +float gNormMouseY = 0; + +// FIXME: There should be buffer helper functions to avoid all of the *(int *)& crap. + +void Demo_WriteByte(int inType, unsigned char inByte) +{ + Demo_WriteBuffer(inType, sizeof(unsigned char), &inByte); +} + +void Demo_WriteVector(int inType, vec3_t inVector) +{ + float theFloatArray[3]; + + theFloatArray[0] = inVector.x; + theFloatArray[1] = inVector.y; + theFloatArray[2] = inVector.z; + + Demo_WriteBuffer(inType, 3*sizeof(float), (unsigned char*)theFloatArray); +} + +void Demo_WriteFloat(int inType, float inFloat) +{ + Demo_WriteBuffer(inType, sizeof(float), (unsigned char*)&inFloat); +} + +void Demo_WriteInt(int inType, int inInt) +{ + Demo_WriteBuffer(inType, sizeof(int), (unsigned char*)&inInt); +} + +/* +===================== +Demo_WriteBuffer + +Write some data to the demo stream +===================== +*/ +void Demo_WriteBuffer( int type, int size, unsigned char *buffer ) +{ + int pos = 0; + unsigned char buf[ 32 * 1024 ]; + *( int * )&buf[pos] = type; + pos+=sizeof( int ); + + memcpy( &buf[pos], buffer, size ); + + // Write full buffer out + gEngfuncs.pDemoAPI->WriteBuffer( size + sizeof( int ), buf ); +} + +/* +===================== +Demo_ReadBuffer + +Engine wants us to parse some data from the demo stream +===================== +*/ +void CL_DLLEXPORT Demo_ReadBuffer( int size, unsigned char *buffer ) +{ + RecClReadDemoBuffer(size, buffer); + + int type; + int i = 0; + bool theMouseVisibility = false; + + type = *( int * )buffer; + i += sizeof( int ); + switch ( type ) + { + case TYPE_SNIPERDOT: + g_demosniper = *(int * )&buffer[ i ]; + i += sizeof( int ); + + if ( g_demosniper ) + { + g_demosniperdamage = *( int * )&buffer[ i ]; + i += sizeof( int ); + + g_demosniperangles[ 0 ] = *(float *)&buffer[i]; + i += sizeof( float ); + g_demosniperangles[ 1 ] = *(float *)&buffer[i]; + i += sizeof( float ); + g_demosniperangles[ 2 ] = *(float *)&buffer[i]; + i += sizeof( float ); + g_demosniperorg[ 0 ] = *(float *)&buffer[i]; + i += sizeof( float ); + g_demosniperorg[ 1 ] = *(float *)&buffer[i]; + i += sizeof( float ); + g_demosniperorg[ 2 ] = *(float *)&buffer[i]; + i += sizeof( float ); + } + break; + case TYPE_ZOOM: + g_demozoom = *(float * )&buffer[ i ]; + i += sizeof( float ); + break; + + case TYPE_BASESTATE: + i += gHUD.InitializeDemoPlayback(size, (unsigned char *)&buffer[i]); + break; + + case TYPE_MOUSEVIS: + //theMouseVisibility = *(unsigned char * )&buffer[ i ]; + //gHUD.GetManager().SetMouseVisibility(theMouseVisibility); + i += sizeof(unsigned char); + break; + + case TYPE_MOUSEX: + //gNormMouseX = *(float * )&buffer[ i ]; + i += sizeof( float ); + break; + + case TYPE_MOUSEY: + //gNormMouseY = *(float * )&buffer[ i ]; + i += sizeof( float ); + break; + + case TYPE_VIEWANGLES: + v_angles[0] = *(float * )&buffer[ i ]; + i += sizeof( float ); + + v_angles[1] = *(float * )&buffer[ i ]; + i += sizeof( float ); + + v_angles[2] = *(float * )&buffer[ i ]; + i += sizeof( float ); + break; + + case TYPE_VIEWORIGIN: + v_origin[0] = *(float * )&buffer[ i ]; + i += sizeof( float ); + + v_origin[1] = *(float * )&buffer[ i ]; + i += sizeof( float ); + + v_origin[2] = *(float * )&buffer[ i ]; + i += sizeof( float ); + break; + + case TYPE_PARTICLES: + i += gParticleTemplateList.InitializeDemoPlayback(size, (unsigned char*)&buffer[i]); + break; + + case TYPE_BASESTATE2: + i += gHUD.InitializeDemoPlayback2(size, (unsigned char *)&buffer[i]); + break; + + case TYPE_PLAYERINFO: + i += ScorePanel_InitializeDemoPlayback(size, (unsigned char *)&buffer[i]); + break; + + case TYPE_WEAPONINFO: + i += gHUD.InitializeWeaponInfoPlayback(size, (unsigned char *)&buffer[i]); + break; + + default: + gEngfuncs.Con_DPrintf( "Unknown demo buffer type, skipping.\n" ); + break; + } +} + +// Returns num bytes needed to save/restore a string +int GetDataSize(const string& inString) +{ + // String length + int theSize = sizeof(int); + + // String data + theSize += inString.length(); + + return theSize; +} + +void LoadData(void* inBuffer, const unsigned char* inData, int inSizeToCopy, int& inSizeVariable) +{ + memcpy(inBuffer, inData + inSizeVariable, inSizeToCopy); + inSizeVariable += inSizeToCopy; +} + +void LoadStringData(string& outString, const unsigned char* inData, int& inBytesRead) +{ + // Read in string length (could be 0) + int theStringLength = 0; + memcpy(&theStringLength, inData + inBytesRead, sizeof(int)); + inBytesRead += sizeof(int); + + // Read in string, if greater then 0 + if(theStringLength > 0) + { + char* theStringData = new char[theStringLength+1]; + memcpy(theStringData, inData + inBytesRead, theStringLength); + theStringData[theStringLength] = '\0'; + inBytesRead += theStringLength; + + outString = string(theStringData); + + delete [] theStringData; + theStringData = NULL; + } +} + +void LoadVectorData(float* outData, const unsigned char* inData, int& inBytesRead) +{ + int theSize = 3*sizeof(float); + memcpy(outData, inData + inBytesRead, theSize); + inBytesRead += theSize; +} + +void SaveData(unsigned char* inBuffer, const void* inData, int inSizeToCopy, int& inSizeVariable) +{ + memcpy(inBuffer + inSizeVariable, inData, inSizeToCopy); + inSizeVariable += inSizeToCopy; +} + +// Save out string, works for empty strings +void SaveStringData(unsigned char* inBuffer, const string& inString, int& inSizeVariable) +{ + int theStringLength = inString.length(); + + // Write out string length + memcpy(inBuffer + inSizeVariable, &theStringLength, sizeof(int)); + inSizeVariable += sizeof(int); + + // Write out string data, if any + memcpy(inBuffer + inSizeVariable, inString.c_str(), theStringLength); + inSizeVariable += theStringLength; +} + +void SaveVectorData(unsigned char* inBuffer, float* inData, int& inSizeVariable) +{ + int theLength = 3*sizeof(float); + + memcpy(inBuffer + inSizeVariable, inData, theLength); + inSizeVariable += theLength; +} diff --git a/main/source/cl_dll/demo.h b/main/source/cl_dll/demo.h new file mode 100644 index 00000000..6ca80533 --- /dev/null +++ b/main/source/cl_dll/demo.h @@ -0,0 +1,56 @@ +#if !defined( DEMOH ) +#define DEMOH +#pragma once + +// Types of demo messages we can write/parse +enum +{ + TYPE_SNIPERDOT = 0, + TYPE_ZOOM, + + TYPE_BASESTATE, + TYPE_MOUSEVIS, + TYPE_MOUSEX, + TYPE_MOUSEY, + TYPE_VIEWORIGIN, + TYPE_VIEWANGLES, + TYPE_PARTICLES, + + // More base state that wasn't originally saved (made a separate type for backwards-compatibility) + TYPE_BASESTATE2, + TYPE_PLAYERINFO, + TYPE_WEAPONINFO, +}; + +void Demo_WriteVector(int inType, vec3_t inVector); +void Demo_WriteByte(int inType, unsigned char inByte); +void Demo_WriteFloat(int inType, float inFloat); +void Demo_WriteInt(int inType, int inInt); +void Demo_WriteBuffer( int type, int size, unsigned char *buffer ); +#define LOAD_DATA(x) LoadData(&x, inBuffer, sizeof(x), theBytesRead); +#define SAVE_DATA(x) SaveData(theCharArray, &x, sizeof(x), theCounter); + +int GetDataSize(const string& inString); + +void LoadData(void* inBuffer, const unsigned char* inData, int inSizeToCopy, int& inSizeVariable); +void LoadStringData(string& outString, const unsigned char* inData, int& inBytesRead); +void LoadVectorData(float* outData, const unsigned char* inData, int& inBytesRead); + +void SaveData(unsigned char* inBuffer, const void* inData, int inSizeToCopy, int& inSizeVariable); +void SaveStringData(unsigned char* inBuffer, const string& inString, int& inSizeVariable); +void SaveVectorData(unsigned char* inBuffer, float* inData, int& inSizeVariable); + +extern int g_demosniper; +extern int g_demosniperdamage; +extern float g_demosniperorg[3]; +extern float g_demosniperangles[3]; +extern float g_demozoom; + +extern float gNormMouseX; +extern float gNormMouseY; + +extern int gVisibleMouse; +extern vec3_t v_angles; +extern vec3_t v_origin; + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/entity.cpp b/main/source/cl_dll/entity.cpp new file mode 100644 index 00000000..4194d9e6 --- /dev/null +++ b/main/source/cl_dll/entity.cpp @@ -0,0 +1,1046 @@ +// Client side entity management functions + +#include + +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "entity_types.h" +#include "studio_event.h" // def. of mstudioevent_t +#include "r_efx.h" +#include "event_api.h" +#include "pm_defs.h" +#include "pmtrace.h" +#include "pm_shared/pm_shared.h" +#include "mod/AvHParticleSystemManager.h" +#include "mod/AvHSpecials.h" + +#include "engine/APIProxy.h" +#include "Exports.h" + +void Game_AddObjects( void ); + +extern vec3_t v_origin; +double gClientTimeLastUpdate; +int g_iAlive = 1; + +bool gTempEntClearAllFlag = false; + +/* +======================== +HUD_AddEntity + Return 0 to filter entity from visible list for rendering +======================== +*/ +int CL_DLLEXPORT HUD_AddEntity( int type, struct cl_entity_s *ent, const char *modelname ) +{ + RecClAddEntity(type, ent, modelname); + + if(ent->curstate.iuser3 == AVH_USER3_MARINE_PLAYER) + { + int a = 0; + } + + gHUD.ClientProcessEntity(&ent->curstate); + + // Particle entities have a model so they will be forced through this function, + // but we don't want to draw them. + int theSpecialState = ent->curstate.iuser3; + if( (theSpecialState == AVH_USER3_PARTICLE_ON) || + (theSpecialState == AVH_USER3_PARTICLE_OFF) || + (theSpecialState == AVH_USER3_AUDIO_ON) || + (theSpecialState == AVH_USER3_AUDIO_OFF) || + (theSpecialState == AVH_USER3_NOBUILD)) + { + return 0; + } + + switch ( type ) + { + case ET_NORMAL: + case ET_PLAYER: + case ET_BEAM: + case ET_TEMPENTITY: + case ET_FRAGMENTED: + default: + break; + } + + if ( g_iUser1 == OBS_IN_EYE && ent->index == g_iUser2 ) + { + // Don't draw the player we are following in eye + return 0; + } + + return 1; + +} + +/* +========================= +HUD_TxferLocalOverrides + +The server sends us our origin with extra precision as part of the clientdata structure, not during the normal +playerstate update in entity_state_t. In order for these overrides to eventually get to the appropriate playerstate +structure, we need to copy them into the state structure at this point. +========================= +*/ +void CL_DLLEXPORT HUD_TxferLocalOverrides( struct entity_state_s *state, const struct clientdata_s *client ) +{ + RecClTxferLocalOverrides(state, client); + + VectorCopy( client->origin, state->origin ); + + // Spectator + state->iuser1 = client->iuser1; + state->iuser2 = client->iuser2; + state->iuser3 = client->iuser3; + state->iuser4 = client->iuser4; + + state->fuser1 = client->fuser1; + state->fuser2 = client->fuser2; + state->fuser3 = client->fuser3; + state->fuser4 = client->fuser4; + + state->vuser1 = client->vuser1; + //state->vuser2 = client->vuser2; + //state->vuser3 = client->vuser3; + state->vuser4 = client->vuser4; +} + +/* +========================= +HUD_ProcessPlayerState + +We have received entity_state_t for this player over the network. We need to copy appropriate fields to the +playerstate structure +========================= +*/ +void CL_DLLEXPORT HUD_ProcessPlayerState( struct entity_state_s *dst, const struct entity_state_s *src ) +{ + RecClProcessPlayerState(dst, src); + + // Copy in network data + VectorCopy( src->origin, dst->origin ); + VectorCopy( src->angles, dst->angles ); + + VectorCopy( src->velocity, dst->velocity ); + + dst->frame = src->frame; + dst->modelindex = src->modelindex; + dst->skin = src->skin; + dst->effects = src->effects; + dst->weaponmodel = src->weaponmodel; + dst->movetype = src->movetype; + dst->sequence = src->sequence; + dst->animtime = src->animtime; + + dst->solid = src->solid; + + dst->rendermode = src->rendermode; + dst->renderamt = src->renderamt; + dst->rendercolor.r = src->rendercolor.r; + dst->rendercolor.g = src->rendercolor.g; + dst->rendercolor.b = src->rendercolor.b; + dst->renderfx = src->renderfx; + + dst->framerate = src->framerate; + dst->body = src->body; + + memcpy( &dst->controller[0], &src->controller[0], 4 * sizeof( byte ) ); + memcpy( &dst->blending[0], &src->blending[0], 2 * sizeof( byte ) ); + + VectorCopy( src->basevelocity, dst->basevelocity ); + + dst->friction = src->friction; + dst->gravity = src->gravity; + dst->gaitsequence = src->gaitsequence; + dst->spectator = src->spectator; + dst->usehull = src->usehull; + dst->playerclass = src->playerclass; + dst->team = src->team; + dst->colormap = src->colormap; + + // Save off some data so other areas of the Client DLL can get to it + cl_entity_t *player = gEngfuncs.GetLocalPlayer(); // Get the local player's index + if ( dst->number == player->index ) + { + g_iPlayerClass = dst->playerclass; + g_iTeamNumber = dst->team; + + g_iUser1 = src->iuser1; + g_iUser2 = src->iuser2; + g_iUser3 = src->iuser3; + + } + + // AvH + // Copy special movement mode...is this needed? + dst->iuser1 = src->iuser1; + dst->iuser2 = src->iuser2; + dst->iuser3 = src->iuser3; + dst->iuser4 = src->iuser4; + + dst->fuser1 = src->fuser1; + dst->fuser2 = src->fuser2; + dst->fuser3 = src->fuser3; + dst->fuser4 = src->fuser4; + + dst->vuser1 = src->vuser1; + //dst->vuser2 = src->vuser2; + //dst->vuser3 = src->vuser3; + dst->vuser4 = src->vuser4; +} + +/* +========================= +HUD_TxferPredictionData + +Because we can predict an arbitrary number of frames before the server responds with an update, we need to be able to copy client side prediction data in + from the state that the server ack'd receiving, which can be anywhere along the predicted frame path ( i.e., we could predict 20 frames into the future and the server ack's + up through 10 of those frames, so we need to copy persistent client-side only state from the 10th predicted frame to the slot the server + update is occupying. +========================= +*/ +void CL_DLLEXPORT HUD_TxferPredictionData ( struct entity_state_s *ps, const struct entity_state_s *pps, struct clientdata_s *pcd, const struct clientdata_s *ppcd, struct weapon_data_s *wd, const struct weapon_data_s *pwd ) +{ + RecClTxferPredictionData(ps, pps, pcd, ppcd, wd, pwd); + + ps->oldbuttons = pps->oldbuttons; + ps->flFallVelocity = pps->flFallVelocity; + ps->iStepLeft = pps->iStepLeft; + ps->playerclass = pps->playerclass; + + pcd->viewmodel = ppcd->viewmodel; + pcd->m_iId = ppcd->m_iId; + pcd->ammo_shells = ppcd->ammo_shells; + pcd->ammo_nails = ppcd->ammo_nails; + pcd->ammo_cells = ppcd->ammo_cells; + pcd->ammo_rockets = ppcd->ammo_rockets; + pcd->m_flNextAttack = ppcd->m_flNextAttack; + pcd->fov = ppcd->fov; + pcd->weaponanim = ppcd->weaponanim; + pcd->tfstate = ppcd->tfstate; + pcd->maxspeed = ppcd->maxspeed; + + pcd->deadflag = ppcd->deadflag; + + // Spectating or not dead == get control over view angles. + g_iAlive = ( ppcd->iuser1 || ( pcd->deadflag == DEAD_NO ) ) ? 1 : 0; + + // Spectator + pcd->iuser1 = ppcd->iuser1; + pcd->iuser2 = ppcd->iuser2; + pcd->iuser3 = ppcd->iuser3; + pcd->iuser4 = ppcd->iuser4; + + pcd->fuser1 = ppcd->fuser1; + pcd->fuser2 = ppcd->fuser2; + pcd->fuser3 = ppcd->fuser3; + pcd->fuser4 = ppcd->fuser4; + + if( gEngfuncs.IsSpectateOnly() ) + { + // in specator mode we tell the engine who we want to spectate and how + // iuser3 is not used for duck prevention (since the spectator can't duck at all) + pcd->iuser1 = g_iUser1; // observer mode + pcd->iuser2 = g_iUser2; // first target + pcd->iuser3 = g_iUser3; // second target + + } + + VectorCopy( ppcd->vuser1, pcd->vuser1 ); + //VectorCopy( ppcd->vuser2, pcd->vuser2 ); + //VectorCopy( ppcd->vuser3, pcd->vuser3 ); + VectorCopy( ppcd->vuser4, pcd->vuser4 ); + + memcpy( wd, pwd, 32 * sizeof( weapon_data_t ) ); +} + +/* +//#define TEST_IT +#if defined( TEST_IT ) + +cl_entity_t mymodel[9]; + +void MoveModel( void ) +{ + cl_entity_t *player; + int i, j; + int modelindex; + struct model_s *mod; + + // Load it up with some bogus data + player = gEngfuncs.GetLocalPlayer(); + if ( !player ) + return; + + mod = gEngfuncs.CL_LoadModel( "models/sentry3.mdl", &modelindex ); + for ( i = 0; i < 3; i++ ) + { + for ( j = 0; j < 3; j++ ) + { + // Don't draw over ourself... + if ( ( i == 1 ) && ( j == 1 ) ) + continue; + + mymodel[ i * 3 + j ] = *player; + + mymodel[ i * 3 + j ].player = 0; + + mymodel[ i * 3 + j ].model = mod; + mymodel[ i * 3 + j ].curstate.modelindex = modelindex; + + // Move it out a bit + mymodel[ i * 3 + j ].origin[0] = player->origin[0] + 50 * ( 1 - i ); + mymodel[ i * 3 + j ].origin[1] = player->origin[1] + 50 * ( 1 - j ); + + gEngfuncs.CL_CreateVisibleEntity( ET_NORMAL, &mymodel[i*3+j] ); + } + } + +} + +#endif + +//#define TRACE_TEST +#if defined( TRACE_TEST ) + +extern int hitent; + +cl_entity_t hit; + +void TraceModel( void ) +{ + cl_entity_t *ent; + + if ( hitent <= 0 ) + return; + + // Load it up with some bogus data + ent = gEngfuncs.GetEntityByIndex( hitent ); + if ( !ent ) + return; + + hit = *ent; + //hit.curstate.rendermode = kRenderTransTexture; + //hit.curstate.renderfx = kRenderFxGlowShell; + //hit.curstate.renderamt = 100; + + hit.origin[2] += 40; + + gEngfuncs.CL_CreateVisibleEntity( ET_NORMAL, &hit ); +} + +#endif +*/ + +/* +void ParticleCallback( struct particle_s *particle, float frametime ) +{ + int i; + + for ( i = 0; i < 3; i++ ) + { + particle->org[ i ] += particle->vel[ i ] * frametime; + } +} + +cvar_t *color = NULL; +void Particles( void ) +{ + static float lasttime; + float curtime; + + curtime = gEngfuncs.GetClientTime(); + + if ( ( curtime - lasttime ) < 2.0 ) + return; + + if ( !color ) + { + color = gEngfuncs.pfnRegisterVariable ( "color","255 0 0", 0 ); + } + + lasttime = curtime; + + // Create a few particles + particle_t *p; + int i, j; + + for ( i = 0; i < 1000; i++ ) + { + int r, g, b; + p = gEngfuncs.pEfxAPI->R_AllocParticle( ParticleCallback ); + if ( !p ) + break; + + for ( j = 0; j < 3; j++ ) + { + p->org[ j ] = v_origin[ j ] + gEngfuncs.pfnRandomFloat( -32.0, 32.0 );; + p->vel[ j ] = gEngfuncs.pfnRandomFloat( -100.0, 100.0 ); + } + + if ( color ) + { + sscanf( color->string, "%i %i %i", &r, &g, &b ); + } + else + { + r = 192; + g = 0; + b = 0; + } + + p->color = gEngfuncs.pEfxAPI->R_LookupColor( r, g, b ); + gEngfuncs.pEfxAPI->R_GetPackedColor( &p->packedColor, p->color ); + + // p->die is set to current time so all you have to do is add an additional time to it + p->die += 3.0; + } +} +*/ + +/* +void TempEntCallback ( struct tempent_s *ent, float frametime, float currenttime ) +{ + int i; + + for ( i = 0; i < 3; i++ ) + { + ent->entity.curstate.origin[ i ] += ent->entity.baseline.origin[ i ] * frametime; + } +} + +void TempEnts( void ) +{ + static float lasttime; + float curtime; + + curtime = gEngfuncs.GetClientTime(); + + if ( ( curtime - lasttime ) < 10.0 ) + return; + + lasttime = curtime; + + TEMPENTITY *p; + int i, j; + struct model_s *mod; + vec3_t origin; + int index; + + mod = gEngfuncs.CL_LoadModel( "sprites/laserdot.spr", &index ); + + for ( i = 0; i < 100; i++ ) + { + for ( j = 0; j < 3; j++ ) + { + origin[ j ] = v_origin[ j ]; + if ( j != 2 ) + { + origin[ j ] += 75; + } + } + + p = gEngfuncs.pEfxAPI->CL_TentEntAllocCustom( (float *)&origin, mod, 0, TempEntCallback ); + if ( !p ) + break; + + for ( j = 0; j < 3; j++ ) + { + p->entity.curstate.origin[ j ] = origin[ j ]; + + // Store velocity in baseline origin + p->entity.baseline.origin[ j ] = gEngfuncs.pfnRandomFloat( -100, 100 ); + } + + // p->die is set to current time so all you have to do is add an additional time to it + p->die += 10.0; + } +} +*/ + +#if defined( BEAM_TEST ) +// Note can't index beam[ 0 ] in Beam callback, so don't use that index +// Room for 1 beam ( 0 can't be used ) +static cl_entity_t beams[ 2 ]; + +void BeamEndModel( void ) +{ + cl_entity_t *player, *model; + int modelindex; + struct model_s *mod; + + // Load it up with some bogus data + player = gEngfuncs.GetLocalPlayer(); + if ( !player ) + return; + + mod = gEngfuncs.CL_LoadModel( "models/sentry3.mdl", &modelindex ); + if ( !mod ) + return; + + // Slot 1 + model = &beams[ 1 ]; + + *model = *player; + model->player = 0; + model->model = mod; + model->curstate.modelindex = modelindex; + + // Move it out a bit + model->origin[0] = player->origin[0] - 100; + model->origin[1] = player->origin[1]; + + model->attachment[0] = model->origin; + model->attachment[1] = model->origin; + model->attachment[2] = model->origin; + model->attachment[3] = model->origin; + + gEngfuncs.CL_CreateVisibleEntity( ET_NORMAL, model ); +} + +void Beams( void ) +{ + static float lasttime; + float curtime; + struct model_s *mod; + int index; + + BeamEndModel(); + + curtime = gEngfuncs.GetClientTime(); + float end[ 3 ]; + + if ( ( curtime - lasttime ) < 10.0 ) + return; + + mod = gEngfuncs.CL_LoadModel( "sprites/laserbeam.spr", &index ); + if ( !mod ) + return; + + lasttime = curtime; + + end [ 0 ] = v_origin.x + 100; + end [ 1 ] = v_origin.y + 100; + end [ 2 ] = v_origin.z; + + BEAM *p1; + p1 = gEngfuncs.pEfxAPI->R_BeamEntPoint( -1, end, index, + 10.0, 2.0, 0.3, 1.0, 5.0, 0.0, 1.0, 1.0, 1.0, 1.0 ); +} +#endif + +/* +========================= +HUD_CreateEntities + +Gives us a chance to add additional entities to the render this frame +========================= +*/ +void CL_DLLEXPORT HUD_CreateEntities( void ) +{ + RecClCreateEntities(); + + // e.g., create a persistent cl_entity_t somewhere. + // Load an appropriate model into it ( gEngfuncs.CL_LoadModel ) + // Call gEngfuncs.CL_CreateVisibleEntity to add it to the visedicts list +/* +#if defined( TEST_IT ) + MoveModel(); +#endif + +#if defined( TRACE_TEST ) + TraceModel(); +#endif +*/ +/* + Particles(); +*/ +/* + TempEnts(); +*/ + +#if defined( BEAM_TEST ) + Beams(); +#endif + + // Add in any game specific objects + Game_AddObjects(); + + GetClientVoiceMgr()->CreateEntities(); +} + +/* +========================= +HUD_StudioEvent + +The entity's studio model description indicated an event was +fired during this frame, handle the event by it's tag ( e.g., muzzleflash, sound ) +========================= +*/ +void CL_DLLEXPORT HUD_StudioEvent( const struct mstudioevent_s *event, const struct cl_entity_s *entity ) +{ + RecClStudioEvent(event, entity); + + switch( event->event ) + { + case 5001: + gEngfuncs.pEfxAPI->R_MuzzleFlash( (float *)&entity->attachment[0], atoi( event->options) ); + break; + case 5011: + gEngfuncs.pEfxAPI->R_MuzzleFlash( (float *)&entity->attachment[1], atoi( event->options) ); + break; + case 5021: + gEngfuncs.pEfxAPI->R_MuzzleFlash( (float *)&entity->attachment[2], atoi( event->options) ); + break; + case 5031: + gEngfuncs.pEfxAPI->R_MuzzleFlash( (float *)&entity->attachment[3], atoi( event->options) ); + break; + case 5002: + gEngfuncs.pEfxAPI->R_SparkEffect( (float *)&entity->attachment[0], atoi( event->options), -100, 100 ); + break; + // Client side sound + case 5004: + gEngfuncs.pfnPlaySoundByNameAtLocation( (char *)event->options, 1.0, (float *)&entity->attachment[0] ); + break; + + // Particles! + case 7000: + AvHParticleSystemManager::Instance()->CreateParticleSystem(string(event->options), entity->attachment[0]); + break; + + case 7010: + AvHParticleSystemManager::Instance()->CreateParticleSystem(string(event->options), entity->attachment[1]); + break; + + case 7020: + AvHParticleSystemManager::Instance()->CreateParticleSystem(string(event->options), entity->attachment[2]); + break; + + case 7030: + AvHParticleSystemManager::Instance()->CreateParticleSystem(string(event->options), entity->attachment[3]); + break; + + default: + break; + } +} + +/* +================= +CL_UpdateTEnts + +Simulation and cleanup of temporary entities +================= +*/ +void CL_DLLEXPORT HUD_TempEntUpdate ( + double frametime, // Simulation time + double client_time, // Absolute time on client + double cl_gravity, // True gravity on client + TEMPENTITY **ppTempEntFree, // List of freed temporary ents + TEMPENTITY **ppTempEntActive, // List + int ( *Callback_AddVisibleEntity )( cl_entity_t *pEntity ), + void ( *Callback_TempEntPlaySound )( TEMPENTITY *pTemp, float damp ) ) +{ + RecClTempEntUpdate(frametime, client_time, cl_gravity, ppTempEntFree, ppTempEntActive, Callback_AddVisibleEntity, Callback_TempEntPlaySound); + + static int gTempEntFrame = 0; + int i; + TEMPENTITY *pTemp, *pnext, *pprev; + float freq, gravity, gravitySlow, life, fastFreq; + + // don't simulate when we're paused + if(gClientTimeLastUpdate != client_time) + { + gClientTimeLastUpdate = client_time; + + // Nothing to simulate + if ( *ppTempEntActive ) + { + // in order to have tents collide with players, we have to run the player prediction code so + // that the client has the player list. We run this code once when we detect any COLLIDEALL + // tent, then set this BOOL to true so the code doesn't get run again if there's more than + // one COLLIDEALL ent for this update. (often are). + gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction( false, true ); + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( -1 ); + + // !!!BUGBUG -- This needs to be time based + gTempEntFrame = (gTempEntFrame+1) & 31; + + pTemp = *ppTempEntActive; + + bool theIsDone = false; + + // !!! Don't simulate while paused.... This is sort of a hack, revisit. + if ( frametime <= 0 ) + { + while ( pTemp ) + { + if ( !(pTemp->flags & FTENT_NOMODEL ) ) + { + Callback_AddVisibleEntity( &pTemp->entity ); + } + pTemp = pTemp->next; + } + //goto finish; + + theIsDone = true; + } + + if(!theIsDone) + { + pprev = NULL; + freq = client_time * 0.01; + fastFreq = client_time * 5.5; + gravity = -frametime * cl_gravity; + gravitySlow = gravity * 0.5; + + while ( pTemp ) + { + int active; + + active = 1; + + life = pTemp->die - client_time; + pnext = pTemp->next; + if ( life < 0 ) + { + if ( pTemp->flags & FTENT_FADEOUT ) + { + if (pTemp->entity.curstate.rendermode == kRenderNormal) + pTemp->entity.curstate.rendermode = kRenderTransTexture; + pTemp->entity.curstate.renderamt = pTemp->entity.baseline.renderamt * ( 1 + life * pTemp->fadeSpeed ); + if ( pTemp->entity.curstate.renderamt <= 0 ) + active = 0; + + } + else + active = 0; + } + if ( !active ) // Kill it + { + pTemp->next = *ppTempEntFree; + *ppTempEntFree = pTemp; + if ( !pprev ) // Deleting at head of list + *ppTempEntActive = pnext; + else + pprev->next = pnext; + } + else + { + pprev = pTemp; + + VectorCopy( pTemp->entity.origin, pTemp->entity.prevstate.origin ); + + if ( pTemp->flags & FTENT_SPARKSHOWER ) + { + // Adjust speed if it's time + // Scale is next think time + if ( client_time > pTemp->entity.baseline.scale ) + { + // Show Sparks + gEngfuncs.pEfxAPI->R_SparkEffect( pTemp->entity.origin, 8, -200, 200 ); + + // Reduce life + pTemp->entity.baseline.framerate -= 0.1; + + if ( pTemp->entity.baseline.framerate <= 0.0 ) + { + pTemp->die = client_time; + } + else + { + // So it will die no matter what + pTemp->die = client_time + 0.5; + + // Next think + pTemp->entity.baseline.scale = client_time + 0.1; + } + } + } + else if ( pTemp->flags & FTENT_PLYRATTACHMENT ) + { + cl_entity_t *pClient; + + pClient = gEngfuncs.GetEntityByIndex( pTemp->clientIndex ); + + VectorAdd( pClient->origin, pTemp->tentOffset, pTemp->entity.origin ); + } + else if ( pTemp->flags & FTENT_SINEWAVE ) + { + pTemp->x += pTemp->entity.baseline.origin[0] * frametime; + pTemp->y += pTemp->entity.baseline.origin[1] * frametime; + + pTemp->entity.origin[0] = pTemp->x + sin( pTemp->entity.baseline.origin[2] + client_time * pTemp->entity.prevstate.frame ) * (10*pTemp->entity.curstate.framerate); + pTemp->entity.origin[1] = pTemp->y + sin( pTemp->entity.baseline.origin[2] + fastFreq + 0.7 ) * (8*pTemp->entity.curstate.framerate); + pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime; + } + else if ( pTemp->flags & FTENT_SPIRAL ) + { + float s, c; + s = sin( pTemp->entity.baseline.origin[2] + fastFreq ); + c = cos( pTemp->entity.baseline.origin[2] + fastFreq ); + + pTemp->entity.origin[0] += pTemp->entity.baseline.origin[0] * frametime + 8 * sin( client_time * 20 + (int)pTemp ); + pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * frametime + 4 * sin( client_time * 30 + (int)pTemp ); + pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime; + } + + else + { + for ( i = 0; i < 3; i++ ) + pTemp->entity.origin[i] += pTemp->entity.baseline.origin[i] * frametime; + } + + if ( pTemp->flags & FTENT_SPRANIMATE ) + { + pTemp->entity.curstate.frame += frametime * pTemp->entity.curstate.framerate; + if ( pTemp->entity.curstate.frame >= pTemp->frameMax ) + { + pTemp->entity.curstate.frame = pTemp->entity.curstate.frame - (int)(pTemp->entity.curstate.frame); + + if ( !(pTemp->flags & FTENT_SPRANIMATELOOP) ) + { + // this animating sprite isn't set to loop, so destroy it. + pTemp->die = client_time; + pTemp = pnext; + continue; + } + } + } + else if ( pTemp->flags & FTENT_SPRCYCLE ) + { + pTemp->entity.curstate.frame += frametime * 10; + if ( pTemp->entity.curstate.frame >= pTemp->frameMax ) + { + pTemp->entity.curstate.frame = pTemp->entity.curstate.frame - (int)(pTemp->entity.curstate.frame); + } + } + // Experiment +#if 0 + if ( pTemp->flags & FTENT_SCALE ) + pTemp->entity.curstate.framerate += 20.0 * (frametime / pTemp->entity.curstate.framerate); +#endif + + if ( pTemp->flags & FTENT_ROTATE ) + { + pTemp->entity.angles[0] += pTemp->entity.baseline.angles[0] * frametime; + pTemp->entity.angles[1] += pTemp->entity.baseline.angles[1] * frametime; + pTemp->entity.angles[2] += pTemp->entity.baseline.angles[2] * frametime; + + VectorCopy( pTemp->entity.angles, pTemp->entity.latched.prevangles ); + } + + if ( pTemp->flags & (FTENT_COLLIDEALL | FTENT_COLLIDEWORLD) ) + { + vec3_t traceNormal; + float traceFraction = 1; + + if ( pTemp->flags & FTENT_COLLIDEALL ) + { + pmtrace_t pmtrace; + physent_t *pe; + + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + + gEngfuncs.pEventAPI->EV_PlayerTrace( pTemp->entity.prevstate.origin, pTemp->entity.origin, PM_STUDIO_BOX, -1, &pmtrace ); + + + if ( pmtrace.fraction != 1 ) + { + pe = gEngfuncs.pEventAPI->EV_GetPhysent( pmtrace.ent ); + + if ( !pmtrace.ent || ( pe->info != pTemp->clientIndex ) ) + { + traceFraction = pmtrace.fraction; + VectorCopy( pmtrace.plane.normal, traceNormal ); + + if ( pTemp->hitcallback ) + { + (*pTemp->hitcallback)( pTemp, &pmtrace ); + } + } + } + } + else if ( pTemp->flags & FTENT_COLLIDEWORLD ) + { + pmtrace_t pmtrace; + + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + + gEngfuncs.pEventAPI->EV_PlayerTrace( pTemp->entity.prevstate.origin, pTemp->entity.origin, PM_STUDIO_BOX | PM_WORLD_ONLY, -1, &pmtrace ); + + if ( pmtrace.fraction != 1 ) + { + traceFraction = pmtrace.fraction; + VectorCopy( pmtrace.plane.normal, traceNormal ); + + if ( pTemp->flags & FTENT_SPARKSHOWER ) + { + // Chop spark speeds a bit more + // + VectorScale( pTemp->entity.baseline.origin, 0.6, pTemp->entity.baseline.origin ); + + if ( Length( pTemp->entity.baseline.origin ) < 10 ) + { + pTemp->entity.baseline.framerate = 0.0; + } + } + + if ( pTemp->hitcallback ) + { + (*pTemp->hitcallback)( pTemp, &pmtrace ); + } + } + } + + if ( traceFraction != 1 ) // Decent collision now, and damping works + { + float proj, damp; + + // Place at contact point + VectorMA( pTemp->entity.prevstate.origin, traceFraction*frametime, pTemp->entity.baseline.origin, pTemp->entity.origin ); + // Damp velocity + damp = pTemp->bounceFactor; + if ( pTemp->flags & (FTENT_GRAVITY|FTENT_SLOWGRAVITY) ) + { + damp *= 0.5; + if ( traceNormal[2] > 0.9 ) // Hit floor? + { + if ( pTemp->entity.baseline.origin[2] <= 0 && pTemp->entity.baseline.origin[2] >= gravity*3 ) + { + damp = 0; // Stop + pTemp->flags &= ~(FTENT_ROTATE|FTENT_GRAVITY|FTENT_SLOWGRAVITY|FTENT_COLLIDEWORLD|FTENT_SMOKETRAIL); + pTemp->entity.angles[0] = 0; + pTemp->entity.angles[2] = 0; + } + } + } + + if (pTemp->hitSound) + { + Callback_TempEntPlaySound(pTemp, damp); + } + + if (pTemp->flags & FTENT_COLLIDEKILL) + { + // die on impact + pTemp->flags &= ~FTENT_FADEOUT; + pTemp->die = client_time; + } + else + { + // Reflect velocity + if ( damp != 0 ) + { + proj = DotProduct( pTemp->entity.baseline.origin, traceNormal ); + VectorMA( pTemp->entity.baseline.origin, -proj*2, traceNormal, pTemp->entity.baseline.origin ); + // Reflect rotation (fake) + + pTemp->entity.angles[1] = -pTemp->entity.angles[1]; + } + + if ( damp != 1 ) + { + + VectorScale( pTemp->entity.baseline.origin, damp, pTemp->entity.baseline.origin ); + VectorScale( pTemp->entity.angles, 0.9, pTemp->entity.angles ); + } + } + } + } + + + if ( (pTemp->flags & FTENT_FLICKER) && gTempEntFrame == pTemp->entity.curstate.effects ) + { + dlight_t *dl = gEngfuncs.pEfxAPI->CL_AllocDlight (0); + VectorCopy (pTemp->entity.origin, dl->origin); + dl->radius = 60; + dl->color.r = 255; + dl->color.g = 120; + dl->color.b = 0; + dl->die = client_time + 0.01; + } + + if ( pTemp->flags & FTENT_SMOKETRAIL ) + { + gEngfuncs.pEfxAPI->R_RocketTrail (pTemp->entity.prevstate.origin, pTemp->entity.origin, 1); + } + + if ( pTemp->flags & FTENT_GRAVITY ) + pTemp->entity.baseline.origin[2] += gravity; + else if ( pTemp->flags & FTENT_SLOWGRAVITY ) + pTemp->entity.baseline.origin[2] += gravitySlow; + + if ( pTemp->flags & FTENT_CLIENTCUSTOM ) + { + if ( pTemp->callback ) + { + ( *pTemp->callback )( pTemp, frametime, client_time ); + } + } + + // Cull to PVS (not frustum cull, just PVS) + if ( !(pTemp->flags & FTENT_NOMODEL ) ) + { + if ( !Callback_AddVisibleEntity( &pTemp->entity ) ) + { + if ( !(pTemp->flags & FTENT_PERSIST) ) + { + pTemp->die = client_time; // If we can't draw it this frame, just dump it. + pTemp->flags &= ~FTENT_FADEOUT; // Don't fade out, just die + } + } + } + } + pTemp = pnext; + } + } + + // Restore state info + gEngfuncs.pEventAPI->EV_PopPMStates(); + } + } + +//finish: +// // Restore state info +// gEngfuncs.pEventAPI->EV_PopPMStates(); +} + +/* +================= +HUD_GetUserEntity + +If you specify negative numbers for beam start and end point entities, then + the engine will call back into this function requesting a pointer to a cl_entity_t + object that describes the entity to attach the beam onto. + +Indices must start at 1, not zero. +================= +*/ +cl_entity_t CL_DLLEXPORT *HUD_GetUserEntity( int index ) +{ + RecClGetUserEntity(index); + +#if defined( BEAM_TEST ) + // None by default, you would return a valic pointer if you create a client side + // beam and attach it to a client side entity. + if ( index > 0 && index <= 1 ) + { + return &beams[ index ]; + } + else + { + return NULL; + } +#else + return NULL; +#endif +} diff --git a/main/source/cl_dll/ev_common.cpp b/main/source/cl_dll/ev_common.cpp new file mode 100644 index 00000000..f60a59d3 --- /dev/null +++ b/main/source/cl_dll/ev_common.cpp @@ -0,0 +1,216 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// shared event functions +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" + +#include "r_efx.h" + +#include "eventscripts.h" +#include "event_api.h" +#include "pm_shared.h" + +#define IS_FIRSTPERSON_SPEC ( g_iUser1 == OBS_IN_EYE) +/* +================= +GetEntity + +Return's the requested cl_entity_t +================= +*/ +struct cl_entity_s *GetEntity( int idx ) +{ + return gEngfuncs.GetEntityByIndex( idx ); +} + +/* +================= +GetViewEntity + +Return's the current weapon/view model +================= +*/ +struct cl_entity_s *GetViewEntity( void ) +{ + return gEngfuncs.GetViewModel(); +} + +physent_t* GetPhysEntity(int inPhysIndex) +{ + return gEngfuncs.pEventAPI->EV_GetPhysent( inPhysIndex ); +} + +void DoCenterPrint(char* inString) +{ + CenterPrint(inString); +} + + +/* +================= +EV_CreateTracer + +Creates a tracer effect +================= +*/ +void EV_CreateTracer( float *start, float *end ) +{ + gEngfuncs.pEfxAPI->R_TracerEffect( start, end ); +} + +/* +================= +EV_IsPlayer + +Is the entity's index in the player range? +================= +*/ +qboolean EV_IsPlayer( int idx ) +{ + if ( idx >= 1 && idx <= gEngfuncs.GetMaxClients() ) + return true; + + return false; +} + +/* +================= +EV_IsLocal + +Is the entity == the local player +================= +*/ +qboolean EV_IsLocal( int idx ) +{ + // check if we are in some way in first person spec mode + if ( IS_FIRSTPERSON_SPEC ) + return (g_iUser2 == idx); + else + return gEngfuncs.pEventAPI->EV_IsLocal( idx - 1 ) ? true : false; +} + +/* +================= +EV_GetGunPosition + +Figure out the height of the gun +================= +*/ +void EV_GetGunPosition( event_args_t *args, float *pos, float *origin ) +{ + int idx; + vec3_t view_ofs; + + idx = args->entindex; + + VectorClear( view_ofs ); + view_ofs[2] = DEFAULT_VIEWHEIGHT; + + if ( EV_IsPlayer( idx ) ) + { + // in spec mode use entity viewheigh, not own + if ( EV_IsLocal( idx ) && !IS_FIRSTPERSON_SPEC ) + { + // Grab predicted result for local player + gEngfuncs.pEventAPI->EV_LocalPlayerViewheight( view_ofs ); + } + else if ( args->ducking == 1 ) + { + view_ofs[2] = VEC_DUCK_VIEW; + } + } + + VectorAdd( origin, view_ofs, pos ); +} + +/* +================= +EV_EjectBrass + +Bullet shell casings +================= +*/ +void EV_EjectBrass( float *origin, float *velocity, float rotation, int model, int soundtype ) +{ + vec3_t endpos; + VectorClear( endpos ); + endpos[1] = rotation; + gEngfuncs.pEfxAPI->R_TempModel( origin, velocity, endpos, 2.5, model, soundtype ); +} + +/* +================= +EV_GetDefaultShellInfo + +Determine where to eject shells from +================= +*/ +void EV_GetDefaultShellInfo( event_args_t *args, float *origin, float *velocity, float *ShellVelocity, float *ShellOrigin, float *forward, float *right, float *up, float forwardScale, float upScale, float rightScale ) +{ + int i; + vec3_t view_ofs; + float fR, fU; + + int idx; + + idx = args->entindex; + + VectorClear( view_ofs ); + view_ofs[2] = DEFAULT_VIEWHEIGHT; + + if ( EV_IsPlayer( idx ) ) + { + if ( EV_IsLocal( idx ) ) + { + gEngfuncs.pEventAPI->EV_LocalPlayerViewheight( view_ofs ); + } + else if ( args->ducking == 1 ) + { + view_ofs[2] = VEC_DUCK_VIEW; + } + } + + fR = gEngfuncs.pfnRandomFloat( 50, 70 ); + fU = gEngfuncs.pfnRandomFloat( 100, 150 ); + + for ( i = 0; i < 3; i++ ) + { + ShellVelocity[i] = velocity[i] + right[i] * fR + up[i] * fU + forward[i] * 25; + ShellOrigin[i] = origin[i] + view_ofs[i] + up[i] * upScale + forward[i] * forwardScale + right[i] * rightScale; + } +} + +/* +================= +EV_MuzzleFlash + +Flag weapon/view model for muzzle flash +================= +*/ +void EV_MuzzleFlash( void ) +{ + // Add muzzle flash to current weapon model + cl_entity_t *ent = GetViewEntity(); + if ( !ent ) + { + return; + } + + // Or in the muzzle flash + ent->curstate.effects |= EF_MUZZLEFLASH; +} \ No newline at end of file diff --git a/main/source/cl_dll/ev_hldm.cpp b/main/source/cl_dll/ev_hldm.cpp new file mode 100644 index 00000000..45f01f19 --- /dev/null +++ b/main/source/cl_dll/ev_hldm.cpp @@ -0,0 +1,1966 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +//#include "hud.h" +#include "mod/AvHHud.h" +#include "cl_util.h" +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "entity_types.h" +#include "usercmd.h" +#include "pm_defs.h" +#include "pm_materials.h" + +#include "eventscripts.h" +#include "ev_hldm.h" + +#include "r_efx.h" +#include "event_api.h" +#include "event_args.h" +#include "in_defs.h" +#include "mod/AvHBasePlayerWeaponConstants.h" +#include "mod/AvHMarineWeaponConstants.h" +#include "mod/AvHAlienWeaponConstants.h" +#include + +static int tracerCount[ 32 ]; +extern AvHHud gHUD; + +#include "r_studioint.h" +#include "com_model.h" + +extern engine_studio_api_t IEngineStudio; + +//extern "C" char PM_FindTextureType( char *name ); +char PM_FindTextureType( char *name ); + +void V_PunchAxis( int axis, float punch ); +void VectorAngles( const float *forward, float *angles ); +Vector UTIL_GetRandomSpreadDir(unsigned int inSeed, int inShotNumber, const Vector& inBaseDirection, const Vector& inRight, const Vector& inUp, const Vector& inSpread); + +extern "C" +{ + +// HLDM +void EV_FireGlock1( struct event_args_s *args ); +void EV_FireGlock2( struct event_args_s *args ); +void EV_FireShotGunSingle( struct event_args_s *args ); +void EV_FireShotGunDouble( struct event_args_s *args ); +void EV_FireMP5( struct event_args_s *args ); +void EV_FireMP52( struct event_args_s *args ); +void EV_FirePython( struct event_args_s *args ); +void EV_FireGauss( struct event_args_s *args ); +void EV_SpinGauss( struct event_args_s *args ); +void EV_Crowbar( struct event_args_s *args ); +void EV_FireCrossbow( struct event_args_s *args ); +void EV_FireCrossbow2( struct event_args_s *args ); +void EV_FireRpg( struct event_args_s *args ); +void EV_EgonFire( struct event_args_s *args ); +void EV_EgonStop( struct event_args_s *args ); +void EV_HornetGunFire( struct event_args_s *args ); +void EV_TripmineFire( struct event_args_s *args ); +void EV_SnarkFire( struct event_args_s *args ); + + +void EV_TrainPitchAdjust( struct event_args_s *args ); +} + +#define VECTOR_CONE_1DEGREES Vector( 0.00873, 0.00873, 0.00873 ) +#define VECTOR_CONE_2DEGREES Vector( 0.01745, 0.01745, 0.01745 ) +#define VECTOR_CONE_3DEGREES Vector( 0.02618, 0.02618, 0.02618 ) +#define VECTOR_CONE_4DEGREES Vector( 0.03490, 0.03490, 0.03490 ) +#define VECTOR_CONE_5DEGREES Vector( 0.04362, 0.04362, 0.04362 ) +#define VECTOR_CONE_6DEGREES Vector( 0.05234, 0.05234, 0.05234 ) +#define VECTOR_CONE_7DEGREES Vector( 0.06105, 0.06105, 0.06105 ) +#define VECTOR_CONE_8DEGREES Vector( 0.06976, 0.06976, 0.06976 ) +#define VECTOR_CONE_9DEGREES Vector( 0.07846, 0.07846, 0.07846 ) +#define VECTOR_CONE_10DEGREES Vector( 0.08716, 0.08716, 0.08716 ) +#define VECTOR_CONE_15DEGREES Vector( 0.13053, 0.13053, 0.13053 ) +#define VECTOR_CONE_20DEGREES Vector( 0.17365, 0.17365, 0.17365 ) + +// play a strike sound based on the texture that was hit by the attack traceline. VecSrc/VecEnd are the +// original traceline endpoints used by the attacker, iBulletType is the type of bullet that hit the texture. +// returns volume of strike instrument (crowbar) to play +float EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *vecEnd, int iBulletType, int inSoundProbability) +{ + // hit the world, try to play sound based on texture material type + char chTextureType = CHAR_TEX_CONCRETE; + float fvol; + float fvolbar = 0.0f; + char *rgsz[4]; + int cnt; + float fattn = ATTN_NORM; + int entity; + char *pTextureName; + char texname[ 64 ]; + char szbuffer[ 64 ]; + + if(gEngfuncs.pfnRandomLong(1, inSoundProbability) == 1) + { + + entity = gEngfuncs.pEventAPI->EV_IndexFromTrace( ptr ); + + // FIXME check if playtexture sounds movevar is set + // + + chTextureType = 0; + + // Player + if ( entity >= 1 && entity <= gEngfuncs.GetMaxClients() ) + { + // hit body + chTextureType = CHAR_TEX_FLESH; + } + else if ( entity == 0 ) + { + // get texture from entity or world (world is ent(0)) + pTextureName = (char *)gEngfuncs.pEventAPI->EV_TraceTexture( ptr->ent, vecSrc, vecEnd ); + + if ( pTextureName ) + { + strcpy( texname, pTextureName ); + pTextureName = texname; + + // strip leading '-0' or '+0~' or '{' or '!' + if (*pTextureName == '-' || *pTextureName == '+') + { + pTextureName += 2; + } + + if (*pTextureName == '{' || *pTextureName == '!' || *pTextureName == '~' || *pTextureName == ' ') + { + pTextureName++; + } + + // '}}' + strcpy( szbuffer, pTextureName ); + szbuffer[ CBTEXTURENAMEMAX - 1 ] = 0; + + // get texture type + chTextureType = PM_FindTextureType( szbuffer ); + } + } + + switch (chTextureType) + { + default: + case CHAR_TEX_CONCRETE: fvol = 0.3; fvolbar = 0.6; + rgsz[0] = "weapons/ric_conc-1.wav"; + rgsz[1] = "weapons/ric_conc-2.wav"; + cnt = 2; + break; + case CHAR_TEX_METAL: fvol = 0.3; fvolbar = 0.3; + rgsz[0] = "weapons/ric_metal-1.wav"; + rgsz[1] = "weapons/ric_metal-2.wav"; + cnt = 2; + break; + case CHAR_TEX_DIRT: fvol = 0.9; fvolbar = 0.1; + rgsz[0] = "player/pl_dirt1.wav"; + rgsz[1] = "player/pl_dirt2.wav"; + rgsz[2] = "player/pl_dirt3.wav"; + cnt = 3; + break; + case CHAR_TEX_VENT: fvol = 0.5; fvolbar = 0.3; + rgsz[0] = "player/pl_duct1.wav"; + rgsz[1] = "player/pl_duct1.wav"; + cnt = 2; + break; + case CHAR_TEX_GRATE: fvol = 0.9; fvolbar = 0.5; + rgsz[0] = "player/pl_grate1.wav"; + rgsz[1] = "player/pl_grate4.wav"; + cnt = 2; + break; + case CHAR_TEX_TILE: fvol = 0.8; fvolbar = 0.2; + rgsz[0] = "player/pl_tile1.wav"; + rgsz[1] = "player/pl_tile3.wav"; + rgsz[2] = "player/pl_tile2.wav"; + rgsz[3] = "player/pl_tile4.wav"; + cnt = 4; + break; + case CHAR_TEX_SLOSH: fvol = 0.9; fvolbar = 0.0; + rgsz[0] = "player/pl_slosh1.wav"; + rgsz[1] = "player/pl_slosh3.wav"; + rgsz[2] = "player/pl_slosh2.wav"; + rgsz[3] = "player/pl_slosh4.wav"; + cnt = 4; + break; + case CHAR_TEX_WOOD: fvol = 0.9; fvolbar = 0.2; + rgsz[0] = "debris/wood1.wav"; + rgsz[1] = "debris/wood2.wav"; + rgsz[2] = "debris/wood3.wav"; + cnt = 3; + break; + case CHAR_TEX_GLASS: + case CHAR_TEX_COMPUTER: + fvol = 0.8; fvolbar = 0.2; + rgsz[0] = "debris/glass1.wav"; + rgsz[1] = "debris/glass2.wav"; + rgsz[2] = "debris/glass3.wav"; + cnt = 3; + break; + case CHAR_TEX_FLESH: + if (iBulletType == BULLET_PLAYER_CROWBAR) + return 0.0; // crowbar already makes this sound + fvol = 1.0; fvolbar = 0.2; + rgsz[0] = "weapons/bullet_hit1.wav"; + rgsz[1] = "weapons/bullet_hit2.wav"; + fattn = 1.0; + cnt = 2; + break; + } + + if(iBulletType == BULLET_MONSTER_9MM) + { + fvol = 0.3; + fvolbar = 0.6; + rgsz[0] = "weapons/a_ric1.wav"; + rgsz[1] = "weapons/a_ric2.wav"; + rgsz[2] = "weapons/a_ric3.wav"; + cnt = 3; + } + + // play material hit sound + gEngfuncs.pEventAPI->EV_PlaySound( 0, ptr->endpos, CHAN_STATIC, rgsz[gEngfuncs.pfnRandomLong(0,cnt-1)], fvol, fattn, 0, 96 + gEngfuncs.pfnRandomLong(0,0xf) ); + } + + return fvolbar; +} + +char *EV_HLDM_DamageDecal( physent_t *pe ) +{ + static char decalname[ 32 ]; + int idx; + + if ( pe->classnumber == 1 ) + { + idx = gEngfuncs.pfnRandomLong( 0, 2 ); + sprintf( decalname, "{break%i", idx + 1 ); + } + else if ( pe->rendermode != kRenderNormal ) + { + sprintf( decalname, "{bproof1" ); + } + else + { + idx = gEngfuncs.pfnRandomLong( 0, 4 ); + sprintf( decalname, "{shot%i", idx + 1 ); + } + return decalname; +} + +void EV_HLDM_GunshotDecalTrace( pmtrace_t *pTrace, char *decalName, int inChanceOfSound) +{ + int iRand; + physent_t *pe; + + gEngfuncs.pEfxAPI->R_BulletImpactParticles( pTrace->endpos ); + + iRand = gEngfuncs.pfnRandomLong(1, inChanceOfSound); + if ( iRand == 1)// not every bullet makes a sound. + { + const float kRicochetVolume = .2f; + int theRandomSound = gEngfuncs.pfnRandomLong(0, 4); + switch(theRandomSound) + { + case 0: gEngfuncs.pEventAPI->EV_PlaySound( -1, pTrace->endpos, 0, "weapons/ric1.wav", kRicochetVolume, ATTN_NORM, 0, PITCH_NORM ); break; + case 1: gEngfuncs.pEventAPI->EV_PlaySound( -1, pTrace->endpos, 0, "weapons/ric2.wav", kRicochetVolume, ATTN_NORM, 0, PITCH_NORM ); break; + case 2: gEngfuncs.pEventAPI->EV_PlaySound( -1, pTrace->endpos, 0, "weapons/ric3.wav", kRicochetVolume, ATTN_NORM, 0, PITCH_NORM ); break; + case 3: gEngfuncs.pEventAPI->EV_PlaySound( -1, pTrace->endpos, 0, "weapons/ric4.wav", kRicochetVolume, ATTN_NORM, 0, PITCH_NORM ); break; + case 4: gEngfuncs.pEventAPI->EV_PlaySound( -1, pTrace->endpos, 0, "weapons/ric5.wav", kRicochetVolume, ATTN_NORM, 0, PITCH_NORM ); break; + } + } + + pe = gEngfuncs.pEventAPI->EV_GetPhysent( pTrace->ent ); + + // Only decal brush models such as the world etc. + if ( decalName && decalName[0] && pe && ( pe->solid == SOLID_BSP || pe->movetype == MOVETYPE_PUSHSTEP ) ) + { + if ( CVAR_GET_FLOAT( "r_decals" ) ) + { + gEngfuncs.pEfxAPI->R_DecalShoot( + gEngfuncs.pEfxAPI->Draw_DecalIndex( gEngfuncs.pEfxAPI->Draw_DecalIndexFromName( decalName ) ), + gEngfuncs.pEventAPI->EV_IndexFromTrace( pTrace ), 0, pTrace->endpos, 0 ); + } + } +} + +void EV_HLDM_DecalGunshot( pmtrace_t *pTrace, int iBulletType, int inSoundProbability) +{ + physent_t *pe; + + pe = gEngfuncs.pEventAPI->EV_GetPhysent( pTrace->ent ); + + if ( pe && pe->solid == SOLID_BSP ) + { + EV_HLDM_GunshotDecalTrace( pTrace, EV_HLDM_DamageDecal( pe ), inSoundProbability); + } +} + +int EV_HLDM_CheckTracer( int idx, float *vecSrc, float *end, float *forward, float *right, int iBulletType, int iTracerFreq, int *tracerCount ) +{ + int tracer = 0; + int i; + qboolean player = idx >= 1 && idx <= gEngfuncs.GetMaxClients() ? true : false; + + if ( iTracerFreq != 0 && ( (*tracerCount)++ % iTracerFreq) == 0 ) + { + vec3_t vecTracerSrc; + + if ( player ) + { + vec3_t offset( 0, 0, -4 ); + + // adjust tracer position for player + for ( i = 0; i < 3; i++ ) + { + vecTracerSrc[ i ] = vecSrc[ i ] + offset[ i ] + right[ i ] * 2 + forward[ i ] * 16; + } + } + else + { + VectorCopy( vecSrc, vecTracerSrc ); + } + + if ( iTracerFreq != 1 ) // guns that always trace also always decal + tracer = 1; + + switch( iBulletType ) + { + case BULLET_PLAYER_MP5: + case BULLET_MONSTER_MP5: + case BULLET_MONSTER_9MM: + case BULLET_MONSTER_12MM: + default: + EV_CreateTracer( vecTracerSrc, end ); + break; + } + } + + return tracer; +} + + +/* +================ +FireBullets + +Go to the trouble of combining multiple pellets into a single damage call. +================ +*/ +//void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int cShots, float *vecSrc, float *vecDirShooting, float flDistance, int iBulletType, int iTracerFreq, int *tracerCount, float flSpreadX, float flSpreadY ) +//{ +// int i; +// int iShot; +// int tracer; +// +// // Store off the old count +// gEngfuncs.pEventAPI->EV_PushPMStates(); +// +// gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction(false, true); +// +// // Now add in all of the players. +// gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); +// +// gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); +// +// for ( iShot = 1; iShot <= cShots; iShot++ ) +// { +// vec3_t vecDir, vecEnd; +// +// float x, y, z; +// //We randomize for the Shotgun. +// if ( iBulletType == BULLET_PLAYER_BUCKSHOT ) +// { +// do { +// x = gEngfuncs.pfnRandomFloat(-0.5,0.5) + gEngfuncs.pfnRandomFloat(-0.5,0.5); +// y = gEngfuncs.pfnRandomFloat(-0.5,0.5) + gEngfuncs.pfnRandomFloat(-0.5,0.5); +// z = x*x+y*y; +// } while (z > 1); +// +// for ( i = 0 ; i < 3; i++ ) +// { +// vecDir[i] = vecDirShooting[i] + x * flSpreadX * right[ i ] + y * flSpreadY * up [ i ]; +// vecEnd[i] = vecSrc[ i ] + flDistance * vecDir[ i ]; +// } +// }//But other guns already have their spread randomized in the synched spread. +// else +// { +// +// for ( i = 0 ; i < 3; i++ ) +// { +// vecDir[i] = vecDirShooting[i] + flSpreadX * right[ i ] + flSpreadY * up [ i ]; +// vecEnd[i] = vecSrc[ i ] + flDistance * vecDir[ i ]; +// } +// } +// +// // For debugging +// //gEngfuncs.pEfxAPI->R_TracerEffect(vecSrc, vecEnd); +// +// pmtrace_t tr; +// gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr ); +// +// //gEngfuncs.pEfxAPI->R_BulletImpactParticles(tr.endpos); +// +// tracer = EV_HLDM_CheckTracer( idx, vecSrc, tr.endpos, forward, right, iBulletType, iTracerFreq, tracerCount ); +// +// physent_t *pe = gEngfuncs.pEventAPI->EV_GetPhysent( tr.ent ); +// bool thePlayBulletHitEffect = /*true;//*/!tr.inwater && pe && !pe->player; +// +// // do damage, paint decals +// if ( tr.fraction != 1.0 ) +// { +// switch(iBulletType) +// { +// default: +// case BULLET_PLAYER_9MM: +// +// //EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType ); +// EV_HLDM_DecalGunshot( &tr, iBulletType ); +// +// break; +// case BULLET_PLAYER_MP5: +// +// if ( !tracer ) +// { +// //EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType ); +// EV_HLDM_DecalGunshot( &tr, iBulletType ); +// +// // Only play weapon effects if we hit the +// if(thePlayBulletHitEffect) +// { +// //int theSprite = gEngfuncs.pEventAPI->EV_FindModelIndex(kGenericWallpuff); +// //TEMPENTITY* theTempEntity = gEngfuncs.pEfxAPI->R_TempSprite(tr.endpos, vec3_origin, .6f, theSprite, kRenderGlow, kRenderFxNoDissipation, .5, 1.0, FTENT_COLLIDEALL | FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP | FTENT_PERSIST); +// //theTempEntity->entity.curstate.framerate = 30; +// +// gEngfuncs.pEfxAPI->R_SparkEffect(tr.endpos, 6, 10, 100); +// } +// } +// break; +// case BULLET_PLAYER_BUCKSHOT: +// if ( !tracer ) +// { +// EV_HLDM_DecalGunshot( &tr, iBulletType ); +// +// // Add cool shotgun effect here +// //gEngfuncs.pEfxAPI->R_RocketTrail(vecSrc, tr.endpos, 1); +// gEngfuncs.pEfxAPI->R_BulletImpactParticles(tr.endpos); +// +// //if(thePlayBulletHitEffect) +// //{ +// // int theSprite = gEngfuncs.pEventAPI->EV_FindModelIndex(kGenericWallpuff); +// // TEMPENTITY* theTempEntity = gEngfuncs.pEfxAPI->R_TempSprite(tr.endpos, vec3_origin, 1.0f, theSprite, kRenderGlow, kRenderFxNoDissipation, .5, 1.0, FTENT_COLLIDEALL | FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP | FTENT_PERSIST); +// // theTempEntity->entity.curstate.framerate = 30; +// //} +// +// gEngfuncs.pEfxAPI->R_SparkEffect(tr.endpos, 5, 100, 200); +// } +// break; +// case BULLET_PLAYER_357: +// if ( !tracer ) +// { +// //EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType ); +// EV_HLDM_DecalGunshot( &tr, iBulletType ); +// +// if(thePlayBulletHitEffect) +// { +// // Make the smoke stick out of the target or wall just a little bit to avoid crappy sprite-in-wall effect +// Vector theEndPos = tr.endpos - 20*vecDir; +// int theSprite = gEngfuncs.pEventAPI->EV_FindModelIndex(kGenericWallpuff); +// Vector theUp(0, 0, 30); +// TEMPENTITY* theTempEntity = gEngfuncs.pEfxAPI->R_TempSprite(theEndPos, theUp, .3f, theSprite, kRenderTransAdd, kRenderFxFadeSlow, .3, 0.6, FTENT_COLLIDEALL | FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP | FTENT_PERSIST); +// if(theTempEntity) +// { +// theTempEntity->entity.curstate.framerate = 50; +// } +// +// //// Create rising area of smoke above gun wielder +// //if(gEngfuncs.pfnRandomLong(0, 3) == 0) +// //{ +// // vec3_t theSource; +// // VectorCopy(vecSrc, theSource); +// // theSource.z += 60; +// // theSource.z += 60; +// // +// // theTempEntity = gEngfuncs.pEfxAPI->R_TempSprite(vecSrc, vec3_origin, 1.0f, theSprite, kRenderGlow, kRenderFxNoDissipation, .3, 3.0, FTENT_COLLIDEALL | FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP | FTENT_PERSIST); +// // theTempEntity->entity.curstate.framerate = 30; +// //} +// +// // TODO: Add more here like splinters of wall and plaster +// gEngfuncs.pEfxAPI->R_SparkEffect(tr.endpos, 12, 100, 200); +// } +// } +// break; +// case BULLET_MONSTER_9MM: +// break; +// } +// } +// } +// +// gEngfuncs.pEventAPI->EV_PopPMStates(); +//} + +/* +================ +EV_HLDM_FireBulletsPlayer + +Client-side prediction friendly version of EV_HLDM_FireBullets +================ +*/ +void EV_HLDM_FireBulletsPlayer( int idx, float *forward, float *right, float *up, int cShots, float *vecSrc, float *vecDirShooting, float flDistance, int iBulletType, int iTracerFreq, int *tracerCount, Vector& inSpread, int inRandomSeed) +{ +// int i; + int iShot; + int tracer; + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction(false, true); + + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); + + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + + for ( iShot = 1; iShot <= cShots; iShot++ ) + { + vec3_t vecDir, vecEnd; + +// float x, y, z; +// //We randomize for the Shotgun. +// if ( iBulletType == BULLET_PLAYER_BUCKSHOT ) +// { +// do { +// x = gEngfuncs.pfnRandomFloat(-0.5,0.5) + gEngfuncs.pfnRandomFloat(-0.5,0.5); +// y = gEngfuncs.pfnRandomFloat(-0.5,0.5) + gEngfuncs.pfnRandomFloat(-0.5,0.5); +// z = x*x+y*y; +// } while (z > 1); +// +// for ( i = 0 ; i < 3; i++ ) +// { +// vecDir[i] = vecDirShooting[i] + x * flSpreadX * right[ i ] + y * flSpreadY * up [ i ]; +// vecEnd[i] = vecSrc[ i ] + flDistance * vecDir[ i ]; +// } +// }//But other guns already have their spread randomized in the synched spread. +// else +// { + + //for ( i = 0 ; i < 3; i++ ) + //{ + // vecDir[i] = vecDirShooting[i] + flSpreadX * right[ i ] + flSpreadY * up [ i ]; + // vecEnd[i] = vecSrc[ i ] + flDistance * vecDir[ i ]; + //} + vecDir = UTIL_GetRandomSpreadDir(inRandomSeed, iShot, vecDirShooting, right, up, inSpread); + VectorMA(vecSrc, flDistance, vecDir, vecEnd); + //vecEnd = vecSrc + flDistance*vecDir; +// } + + // For debugging + //gEngfuncs.pEfxAPI->R_TracerEffect(vecSrc, vecEnd); + + pmtrace_t tr; + gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr ); + + //gEngfuncs.pEfxAPI->R_BulletImpactParticles(tr.endpos); + + tracer = EV_HLDM_CheckTracer( idx, vecSrc, tr.endpos, forward, right, iBulletType, iTracerFreq, tracerCount ); + + physent_t *pe = gEngfuncs.pEventAPI->EV_GetPhysent( tr.ent ); + bool thePlayBulletHitEffect = /*true;//*/!tr.inwater && pe && !pe->player; + int theSoundProbability = 2; + + // do damage, paint decals + if ( tr.fraction != 1.0 ) + { + switch(iBulletType) + { + default: + case BULLET_PLAYER_9MM: + EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType, theSoundProbability); + EV_HLDM_DecalGunshot( &tr, iBulletType, theSoundProbability); + break; + + case BULLET_PLAYER_MP5: + + if ( !tracer ) + { + EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType, theSoundProbability); + + theSoundProbability = 8; + EV_HLDM_DecalGunshot( &tr, iBulletType, theSoundProbability); + + // Only play weapon effects if we hit the + if(thePlayBulletHitEffect) + { + // Make the smoke stick out of the target or wall just a little bit to avoid crappy sprite-in-wall effect + Vector theEndPos = tr.endpos - 20*vecDir; + int theSprite = gEngfuncs.pEventAPI->EV_FindModelIndex(kGenericWallpuff); + Vector theUp(0, 0, 30); + TEMPENTITY* theTempEntity = gEngfuncs.pEfxAPI->R_TempSprite(theEndPos, theUp, .3f, theSprite, kRenderTransAdd, kRenderFxFadeSlow, .1, 0.6, FTENT_COLLIDEALL | FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP | FTENT_PERSIST); + if(theTempEntity) + { + theTempEntity->entity.curstate.framerate = 50; + } + + gEngfuncs.pEfxAPI->R_SparkEffect(tr.endpos, 6, 10, 100); + } + } + break; + case BULLET_PLAYER_BUCKSHOT: + if ( !tracer ) + { + theSoundProbability = BALANCE_IVAR(kSGBulletsPerShot)/2; + EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType, theSoundProbability); + + theSoundProbability = BALANCE_IVAR(kSGBulletsPerShot)/2; + EV_HLDM_DecalGunshot( &tr, iBulletType, theSoundProbability); + + if(thePlayBulletHitEffect) + { + // Add cool shotgun effect here + //gEngfuncs.pEfxAPI->R_RocketTrail(vecSrc, tr.endpos, 1); + gEngfuncs.pEfxAPI->R_BulletImpactParticles(tr.endpos); + + //if(thePlayBulletHitEffect) + //{ + // int theSprite = gEngfuncs.pEventAPI->EV_FindModelIndex(kGenericWallpuff); + // TEMPENTITY* theTempEntity = gEngfuncs.pEfxAPI->R_TempSprite(tr.endpos, vec3_origin, 1.0f, theSprite, kRenderGlow, kRenderFxNoDissipation, .5, 1.0, FTENT_COLLIDEALL | FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP | FTENT_PERSIST); + // theTempEntity->entity.curstate.framerate = 30; + //} + + gEngfuncs.pEfxAPI->R_SparkEffect(tr.endpos, 5, 100, 200); + } + } + break; + case BULLET_PLAYER_357: + if ( !tracer ) + { + theSoundProbability = 1; + EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType, theSoundProbability); + EV_HLDM_DecalGunshot( &tr, iBulletType, theSoundProbability); + + if(thePlayBulletHitEffect) + { + // Make the smoke stick out of the target or wall just a little bit to avoid crappy sprite-in-wall effect + Vector theEndPos = tr.endpos - 20*vecDir; + int theSprite = gEngfuncs.pEventAPI->EV_FindModelIndex(kGenericWallpuff); + Vector theUp(0, 0, 30); + TEMPENTITY* theTempEntity = gEngfuncs.pEfxAPI->R_TempSprite(theEndPos, theUp, .3f, theSprite, kRenderTransAdd, kRenderFxFadeSlow, .15, 0.6, FTENT_COLLIDEALL | FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP | FTENT_PERSIST); + if(theTempEntity) + { + theTempEntity->entity.curstate.framerate = 50; + } + + //// Create rising area of smoke above gun wielder + //if(gEngfuncs.pfnRandomLong(0, 3) == 0) + //{ + // vec3_t theSource; + // VectorCopy(vecSrc, theSource); + // theSource.z += 60; + // theSource.z += 60; + // + // theTempEntity = gEngfuncs.pEfxAPI->R_TempSprite(vecSrc, vec3_origin, 1.0f, theSprite, kRenderGlow, kRenderFxNoDissipation, .3, 3.0, FTENT_COLLIDEALL | FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP | FTENT_PERSIST); + // theTempEntity->entity.curstate.framerate = 30; + //} + + // TODO: Add more here like splinters of wall and plaster + gEngfuncs.pEfxAPI->R_SparkEffect(tr.endpos, 12, 100, 200); + } + } + break; + case BULLET_MONSTER_9MM: + if(!tracer) + { + EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType, theSoundProbability); + //EV_HLDM_DecalGunshot( &tr, iBulletType, theSoundProbability); + + // Only play weapon effects if we hit the + if(thePlayBulletHitEffect) + { + int theSprite = gEngfuncs.pEventAPI->EV_FindModelIndex(kSpikeGunHitSprite); + TEMPENTITY* theTempEntity = gEngfuncs.pEfxAPI->R_TempSprite(tr.endpos, vec3_origin, .6f, theSprite, kRenderTransAdd, kRenderFxNoDissipation, .5f, .4f, FTENT_COLLIDEALL | FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP | FTENT_PERSIST); + if(theTempEntity) + { + theTempEntity->entity.curstate.framerate = 30; + } + } + } + break; + } + } + } + + gEngfuncs.pEventAPI->EV_PopPMStates(); +} + + + +//====================== +// GLOCK START +//====================== +//void EV_FireGlock1( event_args_t *args ) +//{ +// int idx; +// vec3_t origin; +// vec3_t angles; +// vec3_t velocity; +// int empty; +// +// vec3_t ShellVelocity; +// vec3_t ShellOrigin; +// int shell; +// vec3_t vecSrc, vecAiming; +// vec3_t up, right, forward; +// +// idx = args->entindex; +// VectorCopy( args->origin, origin ); +// VectorCopy( args->angles, angles ); +// VectorCopy( args->velocity, velocity ); +// +// empty = args->bparam1; +// AngleVectors( angles, forward, right, up ); +// +// shell = gEngfuncs.pEventAPI->EV_FindModelIndex ("models/shell.mdl");// brass shell +// +// if ( EV_IsLocal( idx ) ) +// { +// EV_MuzzleFlash(); +// gEngfuncs.pEventAPI->EV_WeaponAnimation( empty ? GLOCK_SHOOT_EMPTY : GLOCK_SHOOT, 2 ); +// +// V_PunchAxis( 0, -2.0 ); +// } +// +// EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20, -12, 4 ); +// +// EV_EjectBrass ( ShellOrigin, ShellVelocity, angles[ YAW ], shell, TE_BOUNCE_SHELL ); +// +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/pl_gun3.wav", gEngfuncs.pfnRandomFloat(0.92, 1.0), ATTN_NORM, 0, 98 + gEngfuncs.pfnRandomLong( 0, 3 ) ); +// +// EV_GetGunPosition( args, vecSrc, origin ); +// +// VectorCopy( forward, vecAiming ); +// +// EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_9MM, 0, 0, args->fparam1, args->fparam2); +//} + +//void EV_FireGlock2( event_args_t *args ) +//{ +// int idx; +// vec3_t origin; +// vec3_t angles; +// vec3_t velocity; +// +// vec3_t ShellVelocity; +// vec3_t ShellOrigin; +// int shell; +// vec3_t vecSrc, vecAiming; +// vec3_t vecSpread; +// vec3_t up, right, forward; +// +// idx = args->entindex; +// VectorCopy( args->origin, origin ); +// VectorCopy( args->angles, angles ); +// VectorCopy( args->velocity, velocity ); +// +// AngleVectors( angles, forward, right, up ); +// +// shell = gEngfuncs.pEventAPI->EV_FindModelIndex ("models/shell.mdl");// brass shell +// +// if ( EV_IsLocal( idx ) ) +// { +// // Add muzzle flash to current weapon model +// EV_MuzzleFlash(); +// gEngfuncs.pEventAPI->EV_WeaponAnimation( GLOCK_SHOOT, 2 ); +// +// V_PunchAxis( 0, -2.0 ); +// } +// +// EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20, -12, 4 ); +// +// EV_EjectBrass ( ShellOrigin, ShellVelocity, angles[ YAW ], shell, TE_BOUNCE_SHELL ); +// +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/pl_gun3.wav", gEngfuncs.pfnRandomFloat(0.92, 1.0), ATTN_NORM, 0, 98 + gEngfuncs.pfnRandomLong( 0, 3 ) ); +// +// EV_GetGunPosition( args, vecSrc, origin ); +// +// VectorCopy( forward, vecAiming ); +// +// EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_9MM, 0, &tracerCount[idx-1], args->fparam1, args->fparam2 ); +// +//} +//====================== +// GLOCK END +//====================== + +//====================== +// SHOTGUN START +//====================== +//void EV_FireShotGunDouble( event_args_t *args ) +//{ +// int idx; +// vec3_t origin; +// vec3_t angles; +// vec3_t velocity; +// +// int j; +// vec3_t ShellVelocity; +// vec3_t ShellOrigin; +// int shell; +// vec3_t vecSrc, vecAiming; +// vec3_t vecSpread; +// vec3_t up, right, forward; +// float flSpread = 0.01; +// +// idx = args->entindex; +// VectorCopy( args->origin, origin ); +// VectorCopy( args->angles, angles ); +// VectorCopy( args->velocity, velocity ); +// +// AngleVectors( angles, forward, right, up ); +// +// shell = gEngfuncs.pEventAPI->EV_FindModelIndex ("models/shotgunshell.mdl");// brass shell +// +// if ( EV_IsLocal( idx ) ) +// { +// // Add muzzle flash to current weapon model +// EV_MuzzleFlash(); +// gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE2, 2 ); +// V_PunchAxis( 0, -10.0 ); +// } +// +// for ( j = 0; j < 2; j++ ) +// { +// EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 32, -12, 6 ); +// +// EV_EjectBrass ( ShellOrigin, ShellVelocity, angles[ YAW ], shell, TE_BOUNCE_SHOTSHELL ); +// } +// +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/dbarrel1.wav", gEngfuncs.pfnRandomFloat(0.98, 1.0), ATTN_NORM, 0, 85 + gEngfuncs.pfnRandomLong( 0, 0x1f ) ); +// +// EV_GetGunPosition( args, vecSrc, origin ); +// VectorCopy( forward, vecAiming ); +// +// if ( gEngfuncs.GetMaxClients() > 1 ) +// { +// EV_HLDM_FireBullets( idx, forward, right, up, 8, vecSrc, vecAiming, 2048, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx-1], 0.17365, 0.04362 ); +// } +// else +// { +// EV_HLDM_FireBullets( idx, forward, right, up, 12, vecSrc, vecAiming, 2048, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx-1], 0.08716, 0.08716 ); +// } +// +// if ( EV_IsLocal( idx ) ) +// { +// V_PunchAxis( 0, -10.0 ); +// } +//} + +//void EV_FireShotGunSingle( event_args_t *args ) +//{ +// int idx; +// vec3_t origin; +// vec3_t angles; +// vec3_t velocity; +// +// vec3_t ShellVelocity; +// vec3_t ShellOrigin; +// int shell; +// vec3_t vecSrc, vecAiming; +// vec3_t vecSpread; +// vec3_t up, right, forward; +// float flSpread = 0.01; +// +// idx = args->entindex; +// VectorCopy( args->origin, origin ); +// VectorCopy( args->angles, angles ); +// VectorCopy( args->velocity, velocity ); +// +// AngleVectors( angles, forward, right, up ); +// +// shell = gEngfuncs.pEventAPI->EV_FindModelIndex ("models/shotgunshell.mdl");// brass shell +// +// if ( EV_IsLocal( idx ) ) +// { +// // Add muzzle flash to current weapon model +// EV_MuzzleFlash(); +// gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE, 2 ); +// +// V_PunchAxis( 0, -5.0 ); +// } +// +// EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 32, -12, 6 ); +// +// EV_EjectBrass ( ShellOrigin, ShellVelocity, angles[ YAW ], shell, TE_BOUNCE_SHOTSHELL ); +// +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/sbarrel1.wav", gEngfuncs.pfnRandomFloat(0.95, 1.0), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0x1f ) ); +// +// EV_GetGunPosition( args, vecSrc, origin ); +// VectorCopy( forward, vecAiming ); +// +// if ( gEngfuncs.GetMaxClients() > 1 ) +// { +// EV_HLDM_FireBullets( idx, forward, right, up, 4, vecSrc, vecAiming, 2048, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx-1], 0.08716, 0.04362 ); +// } +// else +// { +// EV_HLDM_FireBullets( idx, forward, right, up, 6, vecSrc, vecAiming, 2048, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx-1], 0.08716, 0.08716 ); +// } +//} +//====================== +// SHOTGUN END +//====================== + +//====================== +// MP5 START +//====================== +//void EV_FireMP5( event_args_t *args ) +//{ +// int idx; +// vec3_t origin; +// vec3_t angles; +// vec3_t velocity; +// +// vec3_t ShellVelocity; +// vec3_t ShellOrigin; +// int shell; +// vec3_t vecSrc, vecAiming; +// vec3_t up, right, forward; +// float flSpread = 0.01; +// +// idx = args->entindex; +// VectorCopy( args->origin, origin ); +// VectorCopy( args->angles, angles ); +// VectorCopy( args->velocity, velocity ); +// +// AngleVectors( angles, forward, right, up ); +// +// shell = gEngfuncs.pEventAPI->EV_FindModelIndex ("models/shell.mdl");// brass shell +// +// if ( EV_IsLocal( idx ) ) +// { +// // Add muzzle flash to current weapon model +// EV_MuzzleFlash(); +// gEngfuncs.pEventAPI->EV_WeaponAnimation( MG_FIRE1 + gEngfuncs.pfnRandomLong(0,2), 2 ); +// } +// +// EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20, -12, 4 ); +// +// EV_EjectBrass ( ShellOrigin, ShellVelocity, angles[ YAW ], shell, TE_BOUNCE_SHELL ); +// +// switch( gEngfuncs.pfnRandomLong( 0, 1 ) ) +// { +// case 0: +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/hks1.wav", 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ) ); +// break; +// case 1: +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/hks2.wav", 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ) ); +// break; +// } +// +// EV_GetGunPosition( args, vecSrc, origin ); +// VectorCopy( forward, vecAiming ); +// +// if ( gEngfuncs.GetMaxClients() > 1 ) +// { +// EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_MP5, 2, &tracerCount[idx-1], args->fparam1, args->fparam2 ); +// } +// else +// { +// EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_MP5, 2, &tracerCount[idx-1], args->fparam1, args->fparam2 ); +// } +//} + +// We only predict the animation and sound +// The grenade is still launched from the server. +//void EV_FireMP52( event_args_t *args ) +//{ +// int idx; +// vec3_t origin; +// +// idx = args->entindex; +// VectorCopy( args->origin, origin ); +// +// if ( EV_IsLocal( idx ) ) +// { +// // NOTE: Put this back in if needed <<< cgc >>> +// //gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_LAUNCH, 2 ); +// //V_PunchAxis( 0, -10 ); +// } +// +// switch( gEngfuncs.pfnRandomLong( 0, 1 ) ) +// { +// case 0: +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/glauncher.wav", 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ) ); +// break; +// case 1: +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/glauncher2.wav", 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ) ); +// break; +// } +//} +//====================== +// MP5 END +//====================== + +//====================== +// PHYTON START +// ( .357 ) +//====================== +//void EV_FirePython( event_args_t *args ) +//{ +// int idx; +// vec3_t origin; +// vec3_t angles; +// vec3_t velocity; +// +// vec3_t vecSrc, vecAiming; +// vec3_t up, right, forward; +// float flSpread = 0.01; +// +// idx = args->entindex; +// VectorCopy( args->origin, origin ); +// VectorCopy( args->angles, angles ); +// VectorCopy( args->velocity, velocity ); +// +// AngleVectors( angles, forward, right, up ); +// +// if ( EV_IsLocal( idx ) ) +// { +// // Python uses different body in multiplayer versus single player +// int multiplayer = gEngfuncs.GetMaxClients() == 1 ? 0 : 1; +// +// // Add muzzle flash to current weapon model +// EV_MuzzleFlash(); +// gEngfuncs.pEventAPI->EV_WeaponAnimation( PYTHON_FIRE1, multiplayer ? 1 : 0 ); +// +// V_PunchAxis( 0, -10.0 ); +// } +// +// switch( gEngfuncs.pfnRandomLong( 0, 1 ) ) +// { +// case 0: +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/357_shot1.wav", gEngfuncs.pfnRandomFloat(0.8, 0.9), ATTN_NORM, 0, PITCH_NORM ); +// break; +// case 1: +// gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/357_shot2.wav", gEngfuncs.pfnRandomFloat(0.8, 0.9), ATTN_NORM, 0, PITCH_NORM ); +// break; +// } +// +// EV_GetGunPosition( args, vecSrc, origin ); +// +// VectorCopy( forward, vecAiming ); +// +// EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_357, 0, 0, args->fparam1, args->fparam2 ); +//} +//====================== +// PHYTON END +// ( .357 ) +//====================== + +//====================== +// GAUSS START +//====================== +#define SND_CHANGE_PITCH (1<<7) // duplicated in protocol.h change sound pitch + +void EV_SpinGauss( event_args_t *args ) +{ + int idx; + vec3_t origin; + vec3_t angles; + vec3_t velocity; + int iSoundState = 0; + + int pitch; + + idx = args->entindex; + VectorCopy( args->origin, origin ); + VectorCopy( args->angles, angles ); + VectorCopy( args->velocity, velocity ); + + pitch = args->iparam1; + + iSoundState = args->bparam1 ? SND_CHANGE_PITCH : 0; + + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "ambience/pulsemachine.wav", 1.0, ATTN_NORM, iSoundState, pitch ); +} + +/* +============================== +EV_StopPreviousGauss + +============================== +*/ +void EV_StopPreviousGauss( int idx ) +{ + // Make sure we don't have a gauss spin event in the queue for this guy + gEngfuncs.pEventAPI->EV_KillEvents( idx, "events/gaussspin.sc" ); + gEngfuncs.pEventAPI->EV_StopSound( idx, CHAN_WEAPON, "ambience/pulsemachine.wav" ); +} + +void EV_FireGauss( event_args_t *args ) +{ + int idx; + vec3_t origin; + vec3_t angles; + vec3_t velocity; + float flDamage = args->fparam1; + int primaryfire = args->bparam1; + + int m_fPrimaryFire = args->bparam1; + int m_iWeaponVolume = GAUSS_PRIMARY_FIRE_VOLUME; + vec3_t vecSrc; + vec3_t vecDest; + edict_t *pentIgnore; + pmtrace_t tr, beam_tr; + float flMaxFrac = 1.0; + int nTotal = 0; + int fHasPunched = 0; + int fFirstBeam = 1; + int nMaxHits = 10; + physent_t *pEntity; + int m_iBeam, m_iGlow, m_iBalls; + vec3_t up, right, forward; + + idx = args->entindex; + VectorCopy( args->origin, origin ); + VectorCopy( args->angles, angles ); + VectorCopy( args->velocity, velocity ); + + if ( args->bparam2 ) + { + EV_StopPreviousGauss( idx ); + return; + } + +// Con_Printf( "Firing gauss with %f\n", flDamage ); + EV_GetGunPosition( args, vecSrc, origin ); + + m_iBeam = gEngfuncs.pEventAPI->EV_FindModelIndex( "sprites/smoke.spr" ); + m_iBalls = m_iGlow = gEngfuncs.pEventAPI->EV_FindModelIndex( "sprites/hotglow.spr" ); + + AngleVectors( angles, forward, right, up ); + + VectorMA( vecSrc, 8192, forward, vecDest ); + + if ( EV_IsLocal( idx ) ) + { + V_PunchAxis( 0, -2.0 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 2 ); + } + + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/gauss2.wav", 0.5 + flDamage * (1.0 / 400.0), ATTN_NORM, 0, 85 + gEngfuncs.pfnRandomLong( 0, 0x1f ) ); + + while (flDamage > 10 && nMaxHits > 0) + { + nMaxHits--; + + gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction( false, true ); + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); + + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecDest, PM_STUDIO_BOX, -1, &tr ); + + gEngfuncs.pEventAPI->EV_PopPMStates(); + + if ( tr.allsolid ) + break; + + if (fFirstBeam) + { + if ( EV_IsLocal( idx ) ) + { + // Add muzzle flash to current weapon model + EV_MuzzleFlash(); + } + fFirstBeam = 0; + + gEngfuncs.pEfxAPI->R_BeamEntPoint( + idx | 0x1000, + tr.endpos, + m_iBeam, + 0.1, + m_fPrimaryFire ? 1.0 : 2.5, + 0.0, + m_fPrimaryFire ? 128.0 : flDamage, + 0, + 0, + 0, + m_fPrimaryFire ? 255 : 255, + m_fPrimaryFire ? 128 : 255, + m_fPrimaryFire ? 0 : 255 + ); + } + else + { + gEngfuncs.pEfxAPI->R_BeamPoints( vecSrc, + tr.endpos, + m_iBeam, + 0.1, + m_fPrimaryFire ? 1.0 : 2.5, + 0.0, + m_fPrimaryFire ? 128.0 : flDamage, + 0, + 0, + 0, + m_fPrimaryFire ? 255 : 255, + m_fPrimaryFire ? 128 : 255, + m_fPrimaryFire ? 0 : 255 + ); + } + + pEntity = gEngfuncs.pEventAPI->EV_GetPhysent( tr.ent ); + if ( pEntity == NULL ) + break; + + if ( pEntity->solid == SOLID_BSP ) + { + float n; + + pentIgnore = NULL; + + n = -DotProduct( tr.plane.normal, forward ); + + if (n < 0.5) // 60 degrees + { + // ALERT( at_console, "reflect %f\n", n ); + // reflect + vec3_t r; + + VectorMA( forward, 2.0 * n, tr.plane.normal, r ); + + flMaxFrac = flMaxFrac - tr.fraction; + + VectorCopy( r, forward ); + + VectorMA( tr.endpos, 8.0, forward, vecSrc ); + VectorMA( vecSrc, 8192.0, forward, vecDest ); + + gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage * n / 255.0, flDamage * n * 0.5 * 0.1, FTENT_FADEOUT ); + + vec3_t fwd; + VectorAdd( tr.endpos, tr.plane.normal, fwd ); + + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100, + 255, 100 ); + + // lose energy + if ( n == 0 ) + { + n = 0.1; + } + + flDamage = flDamage * (1 - n); + + } + else + { + // tunnel + EV_HLDM_DecalGunshot( &tr, BULLET_MONSTER_12MM ); + + gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 1.0, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0, 6.0, FTENT_FADEOUT ); + + // limit it to one hole punch + if (fHasPunched) + { + break; + } + fHasPunched = 1; + + // try punching through wall if secondary attack (primary is incapable of breaking through) + if ( !m_fPrimaryFire ) + { + vec3_t start; + + VectorMA( tr.endpos, 8.0, forward, start ); + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); + + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + gEngfuncs.pEventAPI->EV_PlayerTrace( start, vecDest, PM_STUDIO_BOX, -1, &beam_tr ); + + if ( !beam_tr.allsolid ) + { + vec3_t delta; + float n; + + // trace backwards to find exit point + + gEngfuncs.pEventAPI->EV_PlayerTrace( beam_tr.endpos, tr.endpos, PM_STUDIO_BOX, -1, &beam_tr ); + + VectorSubtract( beam_tr.endpos, tr.endpos, delta ); + + n = Length( delta ); + + if (n < flDamage) + { + if (n == 0) + n = 1; + flDamage -= n; + + // absorption balls + { + vec3_t fwd; + VectorSubtract( tr.endpos, forward, fwd ); + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100, + 255, 100 ); + } + + //////////////////////////////////// WHAT TO DO HERE + // CSoundEnt::InsertSound ( bits_SOUND_COMBAT, pev->origin, NORMAL_EXPLOSION_VOLUME, 3.0 ); + + EV_HLDM_DecalGunshot( &beam_tr, BULLET_MONSTER_12MM ); + + gEngfuncs.pEfxAPI->R_TempSprite( beam_tr.endpos, vec3_origin, 0.1, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0, 6.0, FTENT_FADEOUT ); + + // balls + { + vec3_t fwd; + VectorSubtract( beam_tr.endpos, forward, fwd ); + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, beam_tr.endpos, fwd, m_iBalls, (int)(flDamage * 0.3), 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 200, + 255, 40 ); + } + + VectorAdd( beam_tr.endpos, forward, vecSrc ); + } + } + else + { + flDamage = 0; + } + + gEngfuncs.pEventAPI->EV_PopPMStates(); + } + else + { + if ( m_fPrimaryFire ) + { + // slug doesn't punch through ever with primary + // fire, so leave a little glowy bit and make some balls + gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, 200.0 / 255.0, 0.3, FTENT_FADEOUT ); + + { + vec3_t fwd; + VectorAdd( tr.endpos, tr.plane.normal, fwd ); + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 8, 0.6, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100, + 255, 200 ); + } + } + + flDamage = 0; + } + } + } + else + { + VectorAdd( tr.endpos, forward, vecSrc ); + } + } +} +//====================== +// GAUSS END +//====================== + +//====================== +// CROWBAR START +//====================== + +enum crowbar_e { + CROWBAR_IDLE = 0, + CROWBAR_DRAW, + CROWBAR_HOLSTER, + CROWBAR_ATTACK1HIT, + CROWBAR_ATTACK1MISS, + CROWBAR_ATTACK2MISS, + CROWBAR_ATTACK2HIT, + CROWBAR_ATTACK3MISS, + CROWBAR_ATTACK3HIT +}; + +int g_iSwing; + +//Only predict the miss sounds, hit sounds are still played +//server side, so players don't get the wrong idea. +void EV_Crowbar( event_args_t *args ) +{ + int idx; + vec3_t origin; + vec3_t angles; + vec3_t velocity; + + idx = args->entindex; + VectorCopy( args->origin, origin ); + + //Play Swing sound + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/cbar_miss1.wav", 1, ATTN_NORM, 0, PITCH_NORM); + + if ( EV_IsLocal( idx ) ) + { + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK1MISS, 1 ); + + switch( (g_iSwing++) % 3 ) + { + case 0: + gEngfuncs.pEventAPI->EV_WeaponAnimation ( CROWBAR_ATTACK1MISS, 1 ); break; + case 1: + gEngfuncs.pEventAPI->EV_WeaponAnimation ( CROWBAR_ATTACK2MISS, 1 ); break; + case 2: + gEngfuncs.pEventAPI->EV_WeaponAnimation ( CROWBAR_ATTACK3MISS, 1 ); break; + } + } +} +//====================== +// CROWBAR END +//====================== + +//====================== +// CROSSBOW END +//====================== +enum crossbow_e { + CROSSBOW_IDLE1 = 0, // full + CROSSBOW_IDLE2, // empty + CROSSBOW_FIDGET1, // full + CROSSBOW_FIDGET2, // empty + CROSSBOW_FIRE1, // full + CROSSBOW_FIRE2, // reload + CROSSBOW_FIRE3, // empty + CROSSBOW_RELOAD, // from empty + CROSSBOW_DRAW1, // full + CROSSBOW_DRAW2, // empty + CROSSBOW_HOLSTER1, // full + CROSSBOW_HOLSTER2, // empty +}; + +//===================== +// EV_BoltCallback +// This function is used to correct the origin and angles +// of the bolt, so it looks like it's stuck on the wall. +//===================== +void EV_BoltCallback ( struct tempent_s *ent, float frametime, float currenttime ) +{ + ent->entity.origin = ent->entity.baseline.vuser1; + ent->entity.angles = ent->entity.baseline.vuser2; +} + +void EV_FireCrossbow2( event_args_t *args ) +{ + vec3_t vecSrc, vecEnd; + vec3_t up, right, forward; + pmtrace_t tr; + + int idx; + vec3_t origin; + vec3_t angles; + vec3_t velocity; + + idx = args->entindex; + VectorCopy( args->origin, origin ); + VectorCopy( args->angles, angles ); + + VectorCopy( args->velocity, velocity ); + + AngleVectors( angles, forward, right, up ); + + EV_GetGunPosition( args, vecSrc, origin ); + + VectorMA( vecSrc, 8192, forward, vecEnd ); + + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1, ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong(0,0xF) ); + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat(0.95, 1.0), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong(0,0xF) ); + + if ( EV_IsLocal( idx ) ) + { + if ( args->iparam1 ) + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 ); + else if ( args->iparam2 ) + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); + } + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr ); + + //We hit something + if ( tr.fraction < 1.0 ) + { + physent_t *pe = gEngfuncs.pEventAPI->EV_GetPhysent( tr.ent ); + + //Not the world, let's assume we hit something organic ( dog, cat, uncle joe, etc ). + if ( pe->solid != SOLID_BSP ) + { + switch( gEngfuncs.pfnRandomLong(0,1) ) + { + case 0: + gEngfuncs.pEventAPI->EV_PlaySound( idx, tr.endpos, CHAN_BODY, "weapons/xbow_hitbod1.wav", 1, ATTN_NORM, 0, PITCH_NORM ); break; + case 1: + gEngfuncs.pEventAPI->EV_PlaySound( idx, tr.endpos, CHAN_BODY, "weapons/xbow_hitbod2.wav", 1, ATTN_NORM, 0, PITCH_NORM ); break; + } + } + //Stick to world but don't stick to glass, it might break and leave the bolt floating. It can still stick to other non-transparent breakables though. + else if ( pe->rendermode == kRenderNormal ) + { + gEngfuncs.pEventAPI->EV_PlaySound( 0, tr.endpos, CHAN_BODY, "weapons/xbow_hit1.wav", gEngfuncs.pfnRandomFloat(0.95, 1.0), ATTN_NORM, 0, PITCH_NORM ); + + //Not underwater, do some sparks... + if ( gEngfuncs.PM_PointContents( tr.endpos, NULL ) != CONTENTS_WATER) + gEngfuncs.pEfxAPI->R_SparkShower( tr.endpos ); + + vec3_t vBoltAngles; + int iModelIndex = gEngfuncs.pEventAPI->EV_FindModelIndex( "models/crossbow_bolt.mdl" ); + + VectorAngles( forward, vBoltAngles ); + + TEMPENTITY *bolt = gEngfuncs.pEfxAPI->R_TempModel( tr.endpos - forward * 10, Vector( 0, 0, 0), vBoltAngles , 5, iModelIndex, TE_BOUNCE_NULL ); + + if ( bolt ) + { + bolt->flags |= ( FTENT_CLIENTCUSTOM ); //So it calls the callback function. + bolt->entity.baseline.vuser1 = tr.endpos - forward * 10; // Pull out a little bit + bolt->entity.baseline.vuser2 = vBoltAngles; //Look forward! + bolt->callback = EV_BoltCallback; //So we can set the angles and origin back. (Stick the bolt to the wall) + } + } + } + + gEngfuncs.pEventAPI->EV_PopPMStates(); +} + +//TODO: Fully predict the fliying bolt. +void EV_FireCrossbow( event_args_t *args ) +{ + int idx; + vec3_t origin; + + idx = args->entindex; + VectorCopy( args->origin, origin ); + + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1, ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong(0,0xF) ); + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat(0.95, 1.0), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong(0,0xF) ); + + //Only play the weapon anims if I shot it. + if ( EV_IsLocal( idx ) ) + { + if ( args->iparam1 ) + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 ); + else if ( args->iparam2 ) + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); + + V_PunchAxis( 0, -2.0 ); + } +} +//====================== +// CROSSBOW END +//====================== + +//====================== +// RPG START +//====================== +enum rpg_e { + RPG_IDLE = 0, + RPG_FIDGET, + RPG_RELOAD, // to reload + RPG_FIRE2, // to empty + RPG_HOLSTER1, // loaded + RPG_DRAW1, // loaded + RPG_HOLSTER2, // unloaded + RPG_DRAW_UL, // unloaded + RPG_IDLE_UL, // unloaded idle + RPG_FIDGET_UL, // unloaded fidget +}; + +void EV_FireRpg( event_args_t *args ) +{ + int idx; + vec3_t origin; + + idx = args->entindex; + VectorCopy( args->origin, origin ); + + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/rocketfire1.wav", 0.9, ATTN_NORM, 0, PITCH_NORM ); + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/glauncher.wav", 0.7, ATTN_NORM, 0, PITCH_NORM ); + + //Only play the weapon anims if I shot it. + if ( EV_IsLocal( idx ) ) + { + gEngfuncs.pEventAPI->EV_WeaponAnimation( RPG_FIRE2, 1 ); + + V_PunchAxis( 0, -5.0 ); + } +} +//====================== +// RPG END +//====================== + +//====================== +// EGON END +//====================== +enum egon_e { + EGON_IDLE1 = 0, + EGON_FIDGET1, + EGON_ALTFIREON, + EGON_ALTFIRECYCLE, + EGON_ALTFIREOFF, + EGON_FIRE1, + EGON_FIRE2, + EGON_FIRE3, + EGON_FIRE4, + EGON_DRAW, + EGON_HOLSTER +}; + +int g_fireAnims1[] = { EGON_FIRE1, EGON_FIRE2, EGON_FIRE3, EGON_FIRE4 }; +int g_fireAnims2[] = { EGON_ALTFIRECYCLE }; + +enum EGON_FIRESTATE { FIRE_OFF, FIRE_CHARGE }; +enum EGON_FIREMODE { FIRE_NARROW, FIRE_WIDE}; + +#define EGON_PRIMARY_VOLUME 450 +#define EGON_BEAM_SPRITE "sprites/xbeam1.spr" +#define EGON_FLARE_SPRITE "sprites/XSpark1.spr" +#define EGON_SOUND_OFF "weapons/egon_off1.wav" +#define EGON_SOUND_RUN "weapons/egon_run3.wav" +#define EGON_SOUND_STARTUP "weapons/egon_windup2.wav" + +#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0])) + +BEAM *pBeam; +BEAM *pBeam2; + +void EV_EgonFire( event_args_t *args ) +{ + int idx, iFireState, iFireMode; + vec3_t origin; + + idx = args->entindex; + VectorCopy( args->origin, origin ); + iFireState = args->iparam1; + iFireMode = args->iparam2; + int iStartup = args->bparam1; + + + if ( iStartup ) + { + if ( iFireMode == FIRE_WIDE ) + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, EGON_SOUND_STARTUP, 0.98, ATTN_NORM, 0, 125 ); + else + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, EGON_SOUND_STARTUP, 0.9, ATTN_NORM, 0, 100 ); + } + else + { + if ( iFireMode == FIRE_WIDE ) + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_STATIC, EGON_SOUND_RUN, 0.98, ATTN_NORM, 0, 125 ); + else + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_STATIC, EGON_SOUND_RUN, 0.9, ATTN_NORM, 0, 100 ); + } + + //Only play the weapon anims if I shot it. + if ( EV_IsLocal( idx ) ) + gEngfuncs.pEventAPI->EV_WeaponAnimation ( g_fireAnims1[ gEngfuncs.pfnRandomLong( 0, 3 ) ], 1 ); + + if ( iStartup == 1 && EV_IsLocal( idx ) && !pBeam && !pBeam2 ) + { + vec3_t vecSrc, vecEnd, origin, angles, forward, right, up; + pmtrace_t tr; + + cl_entity_t *pl = gEngfuncs.GetEntityByIndex( idx ); + + if ( pl ) + { + VectorCopy( gHUD.m_vecAngles, angles ); + + AngleVectors( angles, forward, right, up ); + + EV_GetGunPosition( args, vecSrc, pl->origin ); + + VectorMA( vecSrc, 2048, forward, vecEnd ); + + gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction( false, true ); + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); + + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr ); + + gEngfuncs.pEventAPI->EV_PopPMStates(); + + int iBeamModelIndex = gEngfuncs.pEventAPI->EV_FindModelIndex( EGON_BEAM_SPRITE ); + + float r = 50.0f; + float g = 50.0f; + float b = 125.0f; + + if ( IEngineStudio.IsHardware() ) + { + r /= 100.0f; + g /= 100.0f; + } + + + pBeam = gEngfuncs.pEfxAPI->R_BeamEntPoint ( idx | 0x1000, tr.endpos, iBeamModelIndex, 99999, 3.5, 0.2, 0.7, 55, 0, 0, r, g, b ); + + if ( pBeam ) + pBeam->flags |= ( FBEAM_SINENOISE ); + + pBeam2 = gEngfuncs.pEfxAPI->R_BeamEntPoint ( idx | 0x1000, tr.endpos, iBeamModelIndex, 99999, 5.0, 0.08, 0.7, 25, 0, 0, r, g, b ); + } + } +} + +void EV_EgonStop( event_args_t *args ) +{ + int idx; + vec3_t origin; + + idx = args->entindex; + VectorCopy ( args->origin, origin ); + + gEngfuncs.pEventAPI->EV_StopSound( idx, CHAN_STATIC, EGON_SOUND_RUN ); + + if ( args->iparam1 ) + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, EGON_SOUND_OFF, 0.98, ATTN_NORM, 0, 100 ); + + if ( EV_IsLocal( idx ) ) + { + if ( pBeam ) + { + pBeam->die = 0.0; + pBeam = NULL; + } + + + if ( pBeam2 ) + { + pBeam2->die = 0.0; + pBeam2 = NULL; + } + } +} +//====================== +// EGON END +//====================== + +//====================== +// HORNET START +//====================== +enum hgun_e { + HGUN_IDLE1 = 0, + HGUN_FIDGETSWAY, + HGUN_FIDGETSHAKE, + HGUN_DOWN, + HGUN_UP, + HGUN_SHOOT +}; + +void EV_HornetGunFire( event_args_t *args ) +{ + int idx, iFireMode; + vec3_t origin, angles, vecSrc, forward, right, up; + + idx = args->entindex; + VectorCopy( args->origin, origin ); + VectorCopy( args->angles, angles ); + iFireMode = args->iparam1; + + //Only play the weapon anims if I shot it. + if ( EV_IsLocal( idx ) ) + { + V_PunchAxis( 0, gEngfuncs.pfnRandomLong ( 0, 2 ) ); + gEngfuncs.pEventAPI->EV_WeaponAnimation ( HGUN_SHOOT, 1 ); + } + + switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) ) + { + case 0: gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "agrunt/ag_fire1.wav", 1, ATTN_NORM, 0, 100 ); break; + case 1: gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "agrunt/ag_fire2.wav", 1, ATTN_NORM, 0, 100 ); break; + case 2: gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "agrunt/ag_fire3.wav", 1, ATTN_NORM, 0, 100 ); break; + } +} +//====================== +// HORNET END +//====================== + +//====================== +// TRIPMINE START +//====================== +enum tripmine_e { + TRIPMINE_IDLE1 = 0, + TRIPMINE_IDLE2, + TRIPMINE_ARM1, + TRIPMINE_ARM2, + TRIPMINE_FIDGET, + TRIPMINE_HOLSTER, + TRIPMINE_DRAW, + TRIPMINE_WORLD, + TRIPMINE_GROUND, +}; + +//We only check if it's possible to put a trip mine +//and if it is, then we play the animation. Server still places it. +void EV_TripmineFire( event_args_t *args ) +{ + int idx; + vec3_t vecSrc, angles, view_ofs, forward; + pmtrace_t tr; + + idx = args->entindex; + VectorCopy( args->origin, vecSrc ); + VectorCopy( args->angles, angles ); + + AngleVectors ( angles, forward, NULL, NULL ); + + if ( !EV_IsLocal ( idx ) ) + return; + + // Grab predicted result for local player + gEngfuncs.pEventAPI->EV_LocalPlayerViewheight( view_ofs ); + + vecSrc = vecSrc + view_ofs; + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128, PM_NORMAL, -1, &tr ); + + //Hit something solid + if ( tr.fraction < 1.0 ) + gEngfuncs.pEventAPI->EV_WeaponAnimation ( TRIPMINE_DRAW, 0 ); + + gEngfuncs.pEventAPI->EV_PopPMStates(); +} +//====================== +// TRIPMINE END +//====================== + +//====================== +// SQUEAK START +//====================== +enum squeak_e { + SQUEAK_IDLE1 = 0, + SQUEAK_FIDGETFIT, + SQUEAK_FIDGETNIP, + SQUEAK_DOWN, + SQUEAK_UP, + SQUEAK_THROW +}; + +#define VEC_HULL_MIN Vector(-16, -16, -36) +#define VEC_DUCK_HULL_MIN Vector(-16, -16, -18 ) + +void EV_SnarkFire( event_args_t *args ) +{ + int idx; + vec3_t vecSrc, angles, view_ofs, forward; + pmtrace_t tr; + + idx = args->entindex; + VectorCopy( args->origin, vecSrc ); + VectorCopy( args->angles, angles ); + + AngleVectors ( angles, forward, NULL, NULL ); + + if ( !EV_IsLocal ( idx ) ) + return; + + if ( args->ducking ) + vecSrc = vecSrc - ( VEC_HULL_MIN - VEC_DUCK_HULL_MIN ); + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc + forward * 20, vecSrc + forward * 64, PM_NORMAL, -1, &tr ); + + //Find space to drop the thing. + if ( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25 ) + gEngfuncs.pEventAPI->EV_WeaponAnimation ( SQUEAK_THROW, 0 ); + + gEngfuncs.pEventAPI->EV_PopPMStates(); +} +//====================== +// SQUEAK END +//====================== + +void EV_TrainPitchAdjust( event_args_t *args ) +{ + int idx; + vec3_t origin; + + unsigned short us_params; + int noise; + float m_flVolume; + int pitch; + int stop; + + char sz[ 256 ]; + + idx = args->entindex; + + VectorCopy( args->origin, origin ); + + us_params = (unsigned short)args->iparam1; + stop = args->bparam1; + + m_flVolume = (float)(us_params & 0x003f)/40.0; + noise = (int)(((us_params) >> 12 ) & 0x0007); + pitch = (int)( 10.0 * (float)( ( us_params >> 6 ) & 0x003f ) ); + + switch ( noise ) + { + case 1: strcpy( sz, "plats/ttrain1.wav"); break; + case 2: strcpy( sz, "plats/ttrain2.wav"); break; + case 3: strcpy( sz, "plats/ttrain3.wav"); break; + case 4: strcpy( sz, "plats/ttrain4.wav"); break; + case 5: strcpy( sz, "plats/ttrain6.wav"); break; + case 6: strcpy( sz, "plats/ttrain7.wav"); break; + default: + // no sound + strcpy( sz, "" ); + return; + } + + if ( stop ) + { + gEngfuncs.pEventAPI->EV_StopSound( idx, CHAN_STATIC, sz ); + } + else + { + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_STATIC, sz, m_flVolume, ATTN_NORM, SND_CHANGE_PITCH, pitch ); + } +} + +int EV_TFC_IsAllyTeam( int iTeam1, int iTeam2 ) +{ + return 0; +} diff --git a/main/source/cl_dll/ev_hldm.h b/main/source/cl_dll/ev_hldm.h new file mode 100644 index 00000000..eaf13adc --- /dev/null +++ b/main/source/cl_dll/ev_hldm.h @@ -0,0 +1,73 @@ +#if !defined ( EV_HLDMH ) +#define EV_HLDMH + +#include "common/bullettypes.h" + +enum glock_e { + GLOCK_IDLE1 = 0, + GLOCK_IDLE2, + GLOCK_IDLE3, + GLOCK_SHOOT, + GLOCK_SHOOT_EMPTY, + GLOCK_RELOAD, + GLOCK_RELOAD_NOT_EMPTY, + GLOCK_DRAW, + GLOCK_HOLSTER, + GLOCK_ADD_SILENCER +}; + +enum shotgun_e { + SHOTGUN_IDLE = 0, + SHOTGUN_FIRE, + SHOTGUN_FIRE2, + SHOTGUN_RELOAD, + SHOTGUN_PUMP, + SHOTGUN_START_RELOAD, + SHOTGUN_DRAW, + SHOTGUN_HOLSTER, + SHOTGUN_IDLE4, + SHOTGUN_IDLE_DEEP +}; + +//enum mp5_e +enum avhmg_e +{ + MG_LONGIDLE = 0, + MG_IDLE1, + MG_LAUNCH, + MG_RELOAD, + MG_DEPLOY, + MG_FIRE1, + MG_FIRE2, + MG_FIRE3, +}; + +enum python_e { + PYTHON_IDLE1 = 0, + PYTHON_FIDGET, + PYTHON_FIRE1, + PYTHON_RELOAD, + PYTHON_HOLSTER, + PYTHON_DRAW, + PYTHON_IDLE2, + PYTHON_IDLE3 +}; + +#define GAUSS_PRIMARY_CHARGE_VOLUME 256// how loud gauss is while charging +#define GAUSS_PRIMARY_FIRE_VOLUME 450// how loud gauss is when discharged + +enum gauss_e { + GAUSS_IDLE = 0, + GAUSS_IDLE2, + GAUSS_FIDGET, + GAUSS_SPINUP, + GAUSS_SPIN, + GAUSS_FIRE, + GAUSS_FIRE2, + GAUSS_HOLSTER, + GAUSS_DRAW +}; + +#include "common/hldm.h" + +#endif // EV_HLDMH \ No newline at end of file diff --git a/main/source/cl_dll/events.cpp b/main/source/cl_dll/events.cpp new file mode 100644 index 00000000..60061f1f --- /dev/null +++ b/main/source/cl_dll/events.cpp @@ -0,0 +1,16 @@ +#include "hud.h" +#include "cl_util.h" + +void Game_HookEvents( void ); + +/* +=================== +EV_HookEvents + +See if game specific code wants to hook any events. +=================== +*/ +void EV_HookEvents( void ) +{ + Game_HookEvents(); +} \ No newline at end of file diff --git a/main/source/cl_dll/eventscripts.h b/main/source/cl_dll/eventscripts.h new file mode 100644 index 00000000..0e169ed8 --- /dev/null +++ b/main/source/cl_dll/eventscripts.h @@ -0,0 +1,33 @@ +// eventscripts.h +#if !defined ( EVENTSCRIPTSH ) +#define EVENTSCRIPTSH + +#include "common/const.h" + +// defaults for clientinfo messages +#define DEFAULT_VIEWHEIGHT 28 + +#ifndef VEC_DUCK_VIEW +#define VEC_DUCK_VIEW 12 +#endif + +#define FTENT_FADEOUT 0x00000080 + +#include "common/damagetypes.h" +#include "pm_shared/pm_defs.h" + +// Some of these are HL/TFC specific? +void EV_EjectBrass( float *origin, float *velocity, float rotation, int model, int soundtype ); +void EV_GetGunPosition( struct event_args_s *args, float *pos, float *origin ); +void EV_GetDefaultShellInfo( struct event_args_s *args, float *origin, float *velocity, float *ShellVelocity, float *ShellOrigin, float *forward, float *right, float *up, float forwardScale, float upScale, float rightScale ); +qboolean EV_IsLocal( int idx ); +qboolean EV_IsPlayer( int idx ); +void EV_CreateTracer( float *start, float *end ); + +struct cl_entity_s *GetEntity( int idx ); +struct cl_entity_s *GetViewEntity( void ); +physent_t* GetPhysEntity(int inPhysIndex); +void DoCenterPrint(char* inString); +void EV_MuzzleFlash( void ); + +#endif // EVENTSCRIPTSH diff --git a/main/source/cl_dll/exports.h b/main/source/cl_dll/exports.h new file mode 100644 index 00000000..070e1a2a --- /dev/null +++ b/main/source/cl_dll/exports.h @@ -0,0 +1,165 @@ + +#include "build.h" + +#if defined( FINAL_VAC_BUILD ) +#define CL_DLLEXPORT +#else +#define CL_DLLEXPORT __declspec( dllexport ) +#endif // FINAL_VAC_BUILD + + +extern "C" +{ + // From hl_weapons + void CL_DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed ); + + // From cdll_int + int CL_DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion ); + int CL_DLLEXPORT HUD_VidInit( void ); + void CL_DLLEXPORT HUD_Init( void ); + int CL_DLLEXPORT HUD_Redraw( float flTime, int intermission ); + int CL_DLLEXPORT HUD_UpdateClientData( client_data_t *cdata, float flTime ); + void CL_DLLEXPORT HUD_Reset ( void ); + void CL_DLLEXPORT HUD_PlayerMove( struct playermove_s *ppmove, int server ); + void CL_DLLEXPORT HUD_PlayerMoveInit( struct playermove_s *ppmove ); + char CL_DLLEXPORT HUD_PlayerMoveTexture( char *name ); + int CL_DLLEXPORT HUD_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ); + int CL_DLLEXPORT HUD_GetHullBounds( int hullnumber, float *mins, float *maxs ); + void CL_DLLEXPORT HUD_Frame( double time ); + void CL_DLLEXPORT HUD_VoiceStatus(int entindex, qboolean bTalking); + void CL_DLLEXPORT HUD_DirectorMessage( int iSize, void *pbuf ); + + // From demo + void CL_DLLEXPORT Demo_ReadBuffer( int size, unsigned char *buffer ); + + // From entity + int CL_DLLEXPORT HUD_AddEntity( int type, struct cl_entity_s *ent, const char *modelname ); + void CL_DLLEXPORT HUD_CreateEntities( void ); + void CL_DLLEXPORT HUD_StudioEvent( const struct mstudioevent_s *event, const struct cl_entity_s *entity ); + void CL_DLLEXPORT HUD_TxferLocalOverrides( struct entity_state_s *state, const struct clientdata_s *client ); + void CL_DLLEXPORT HUD_ProcessPlayerState( struct entity_state_s *dst, const struct entity_state_s *src ); + void CL_DLLEXPORT HUD_TxferPredictionData ( struct entity_state_s *ps, const struct entity_state_s *pps, struct clientdata_s *pcd, const struct clientdata_s *ppcd, struct weapon_data_s *wd, const struct weapon_data_s *pwd ); + void CL_DLLEXPORT HUD_TempEntUpdate( double frametime, double client_time, double cl_gravity, struct tempent_s **ppTempEntFree, struct tempent_s **ppTempEntActive, int ( *Callback_AddVisibleEntity )( struct cl_entity_s *pEntity ), void ( *Callback_TempEntPlaySound )( struct tempent_s *pTemp, float damp ) ); + struct cl_entity_s CL_DLLEXPORT *HUD_GetUserEntity( int index ); + + // From in_camera + void CL_DLLEXPORT CAM_Think( void ); + int CL_DLLEXPORT CL_IsThirdPerson( void ); + void CL_DLLEXPORT CL_CameraOffset( float *ofs ); + + // From input + struct kbutton_s CL_DLLEXPORT *KB_Find( const char *name ); + void CL_DLLEXPORT CL_CreateMove ( float frametime, struct usercmd_s *cmd, int active ); + void CL_DLLEXPORT HUD_Shutdown( void ); + int CL_DLLEXPORT HUD_Key_Event( int eventcode, int keynum, const char *pszCurrentBinding ); + + // From inputw32 + void CL_DLLEXPORT IN_ActivateMouse( void ); + void CL_DLLEXPORT IN_DeactivateMouse( void ); + void CL_DLLEXPORT IN_MouseEvent (int mstate); + void CL_DLLEXPORT IN_Accumulate (void); + void CL_DLLEXPORT IN_ClearStates (void); + + // From tri + void CL_DLLEXPORT HUD_DrawNormalTriangles( void ); + void CL_DLLEXPORT HUD_DrawTransparentTriangles( void ); + + // From view + void CL_DLLEXPORT V_CalcRefdef( struct ref_params_s *pparams ); + + // From GameStudioModelRenderer + int CL_DLLEXPORT HUD_GetStudioModelInterface( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio ); +} + + + +#if defined( FINAL_VAC_BUILD ) + +extern cldll_func_dst_t *g_pcldstAddrs; + +// Macros for the client receiving calls from the engine +#define RecClInitialize(a, b) (g_pcldstAddrs->pInitFunc(&a, &b)) +#define RecClHudInit() (g_pcldstAddrs->pHudInitFunc()) +#define RecClHudVidInit() (g_pcldstAddrs->pHudVidInitFunc()) +#define RecClHudRedraw(a, b) (g_pcldstAddrs->pHudRedrawFunc(&a, &b)) +#define RecClHudUpdateClientData(a, b) (g_pcldstAddrs->pHudUpdateClientDataFunc(&a, &b)) +#define RecClHudReset() (g_pcldstAddrs->pHudResetFunc()) +#define RecClClientMove(a, b) (g_pcldstAddrs->pClientMove(&a, &b)) +#define RecClClientMoveInit(a) (g_pcldstAddrs->pClientMoveInit(&a)) +#define RecClClientTextureType(a) (g_pcldstAddrs->pClientTextureType(&a)) +#define RecClIN_ActivateMouse() (g_pcldstAddrs->pIN_ActivateMouse()) +#define RecClIN_DeactivateMouse() (g_pcldstAddrs->pIN_DeactivateMouse()) +#define RecClIN_MouseEvent(a) (g_pcldstAddrs->pIN_MouseEvent(&a)) +#define RecClIN_ClearStates() (g_pcldstAddrs->pIN_ClearStates()) +#define RecClIN_Accumulate() (g_pcldstAddrs->pIN_Accumulate()) +#define RecClCL_CreateMove(a, b, c) (g_pcldstAddrs->pCL_CreateMove(&a, &b, &c)) +#define RecClCL_IsThirdPerson() (g_pcldstAddrs->pCL_IsThirdPerson()) +#define RecClCL_GetCameraOffsets(a) (g_pcldstAddrs->pCL_GetCameraOffsets(&a)) +#define RecClFindKey(a) (g_pcldstAddrs->pFindKey(&a)) +#define RecClCamThink() (g_pcldstAddrs->pCamThink()) +#define RecClCalcRefdef(a) (g_pcldstAddrs->pCalcRefdef(&a)) +#define RecClAddEntity(a, b, c) (g_pcldstAddrs->pAddEntity(&a, &b, &c)) +#define RecClCreateEntities() (g_pcldstAddrs->pCreateEntities()) +#define RecClDrawNormalTriangles() (g_pcldstAddrs->pDrawNormalTriangles()) +#define RecClDrawTransparentTriangles() (g_pcldstAddrs->pDrawTransparentTriangles()) +#define RecClStudioEvent(a, b) (g_pcldstAddrs->pStudioEvent(&a, &b)) +#define RecClPostRunCmd(a, b, c, d, e, f) (g_pcldstAddrs->pPostRunCmd(&a, &b, &c, &d, &e, &f)) +#define RecClShutdown() (g_pcldstAddrs->pShutdown()) +#define RecClTxferLocalOverrides(a, b) (g_pcldstAddrs->pTxferLocalOverrides(&a, &b)) +#define RecClProcessPlayerState(a, b) (g_pcldstAddrs->pProcessPlayerState(&a, &b)) +#define RecClTxferPredictionData(a, b, c, d, e, f) (g_pcldstAddrs->pTxferPredictionData(&a, &b, &c, &d, &e, &f)) +#define RecClReadDemoBuffer(a, b) (g_pcldstAddrs->pReadDemoBuffer(&a, &b)) +#define RecClConnectionlessPacket(a, b, c, d) (g_pcldstAddrs->pConnectionlessPacket(&a, &b, &c, &d)) +#define RecClGetHullBounds(a, b, c) (g_pcldstAddrs->pGetHullBounds(&a, &b, &c)) +#define RecClHudFrame(a) (g_pcldstAddrs->pHudFrame(&a)) +#define RecClKeyEvent(a, b, c) (g_pcldstAddrs->pKeyEvent(&a, &b, &c)) +#define RecClTempEntUpdate(a, b, c, d, e, f, g) (g_pcldstAddrs->pTempEntUpdate(&a, &b, &c, &d, &e, &f, &g)) +#define RecClGetUserEntity(a) (g_pcldstAddrs->pGetUserEntity(&a)) +#define RecClVoiceStatus(a, b) (g_pcldstAddrs->pVoiceStatus(&a, &b)) +#define RecClDirectorMessage(a, b) (g_pcldstAddrs->pDirectorMessage(&a, &b)) +#define RecClStudioInterface(a, b, c) (g_pcldstAddrs->pStudioInterface(&a, &b, &c)) + +#else + +#define RecClInitialize(a, b) +#define RecClHudInit() +#define RecClHudVidInit() +#define RecClHudRedraw(a, b) +#define RecClHudUpdateClientData(a, b) +#define RecClHudReset() +#define RecClClientMove(a, b) +#define RecClClientMoveInit(a) +#define RecClClientTextureType(a) +#define RecClIN_ActivateMouse() +#define RecClIN_DeactivateMouse() +#define RecClIN_MouseEvent(a) +#define RecClIN_ClearStates() +#define RecClIN_Accumulate() +#define RecClCL_CreateMove(a, b, c) +#define RecClCL_IsThirdPerson() +#define RecClCL_GetCameraOffsets(a) +#define RecClFindKey(a) +#define RecClCamThink() +#define RecClCalcRefdef(a) +#define RecClAddEntity(a, b, c) +#define RecClCreateEntities() +#define RecClDrawNormalTriangles() +#define RecClDrawTransparentTriangles() +#define RecClStudioEvent(a, b) +#define RecClPostRunCmd(a, b, c, d, e, f) +#define RecClShutdown() +#define RecClTxferLocalOverrides(a, b) +#define RecClProcessPlayerState(a, b) +#define RecClTxferPredictionData(a, b, c, d, e, f) +#define RecClReadDemoBuffer(a, b) +#define RecClConnectionlessPacket(a, b, c, d) +#define RecClGetHullBounds(a, b, c) +#define RecClHudFrame(a) +#define RecClKeyEvent(a, b, c) +#define RecClTempEntUpdate(a, b, c, d, e, f, g) +#define RecClGetUserEntity(a) +#define RecClVoiceStatus(a, b) +#define RecClDirectorMessage(a, b) +#define RecClStudioInterface(a, b, c) + +#endif // FINAL_VAC_BUILD diff --git a/main/source/cl_dll/flashlight.cpp b/main/source/cl_dll/flashlight.cpp new file mode 100644 index 00000000..0f604b85 --- /dev/null +++ b/main/source/cl_dll/flashlight.cpp @@ -0,0 +1,151 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// flashlight.cpp +// +// implementation of CHudFlashlight class +// + +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" + +#include +#include + + + +DECLARE_MESSAGE(m_Flash, FlashBat) +DECLARE_MESSAGE(m_Flash, Flashlight) + +#define BAT_NAME "sprites/%d_Flashlight.spr" + +int CHudFlashlight::Init(void) +{ + m_fFade = 0; + m_fOn = 0; + + HOOK_MESSAGE(Flashlight); + HOOK_MESSAGE(FlashBat); + + m_iFlags |= HUD_ACTIVE; + + //gHUD.AddHudElem(this); + + return 1; +}; + +void CHudFlashlight::Reset(void) +{ + m_fFade = 0; + m_fOn = 0; +} + +int CHudFlashlight::VidInit(void) +{ + int HUD_flash_empty = gHUD.GetSpriteIndex( "flash_empty" ); + int HUD_flash_full = gHUD.GetSpriteIndex( "flash_full" ); + int HUD_flash_beam = gHUD.GetSpriteIndex( "flash_beam" ); + + m_hSprite1 = gHUD.GetSprite(HUD_flash_empty); + m_hSprite2 = gHUD.GetSprite(HUD_flash_full); + m_hBeam = gHUD.GetSprite(HUD_flash_beam); + m_prc1 = &gHUD.GetSpriteRect(HUD_flash_empty); + m_prc2 = &gHUD.GetSpriteRect(HUD_flash_full); + m_prcBeam = &gHUD.GetSpriteRect(HUD_flash_beam); + m_iWidth = m_prc2->right - m_prc2->left; + + return 1; +}; + +int CHudFlashlight:: MsgFunc_FlashBat(const char *pszName, int iSize, void *pbuf ) +{ + + + BEGIN_READ( pbuf, iSize ); + int x = READ_BYTE(); + m_iBat = x; + m_flBat = ((float)x)/100.0; + + return 1; +} + +int CHudFlashlight:: MsgFunc_Flashlight(const char *pszName, int iSize, void *pbuf ) +{ + + BEGIN_READ( pbuf, iSize ); + m_fOn = READ_BYTE(); + int x = READ_BYTE(); + m_iBat = x; + m_flBat = ((float)x)/100.0; + + return 1; +} + +int CHudFlashlight::Draw(float flTime) +{ + if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_FLASHLIGHT | HIDEHUD_ALL ) ) + return 1; + + int r, g, b, x, y, a; + wrect_t rc; + + if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) )) + return 1; + + if (m_fOn) + a = 225; + else + a = MIN_ALPHA; + + if (m_flBat < 0.20) + UnpackRGB(r,g,b, RGB_REDISH); + else + { + gHUD.GetPrimaryHudColor(r, g, b); + } + + ScaleColors(r, g, b, a); + + y = (m_prc1->bottom - m_prc2->top)/2; + x = ScreenWidth() - m_iWidth - m_iWidth/2 ; + + // Draw the flashlight casing + SPR_Set(m_hSprite1, r, g, b ); + SPR_DrawAdditive( 0, x, y, m_prc1); + + if ( m_fOn ) + { // draw the flashlight beam + x = ScreenWidth() - m_iWidth/2; + + SPR_Set( m_hBeam, r, g, b ); + SPR_DrawAdditive( 0, x, y, m_prcBeam ); + } + + // draw the flashlight energy level + x = ScreenWidth() - m_iWidth - m_iWidth/2 ; + int iOffset = m_iWidth * (1.0 - m_flBat); + if (iOffset < m_iWidth) + { + rc = *m_prc2; + rc.left += iOffset; + + SPR_Set(m_hSprite2, r, g, b ); + SPR_DrawAdditive( 0, x + iOffset, y, &rc); + } + + + return 1; +} \ No newline at end of file diff --git a/main/source/cl_dll/geiger.cpp b/main/source/cl_dll/geiger.cpp new file mode 100644 index 00000000..9d31d438 --- /dev/null +++ b/main/source/cl_dll/geiger.cpp @@ -0,0 +1,184 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// Geiger.cpp +// +// implementation of CHudAmmo class +// + +#include "hud.h" +#include "cl_util.h" +#include +#include +#include + +#include "parsemsg.h" + +DECLARE_MESSAGE(m_Geiger, Geiger ) + +int CHudGeiger::Init(void) +{ + HOOK_MESSAGE( Geiger ); + + m_iGeigerRange = 0; + m_iFlags = 0; + + //gHUD.AddHudElem(this); + + srand( (unsigned)time( NULL ) ); + + return 1; +}; + +int CHudGeiger::VidInit(void) +{ + return 1; +}; + +int CHudGeiger::MsgFunc_Geiger(const char *pszName, int iSize, void *pbuf) +{ + + BEGIN_READ( pbuf, iSize ); + + // update geiger data + m_iGeigerRange = READ_BYTE(); + m_iGeigerRange = m_iGeigerRange << 2; + + m_iFlags |= HUD_ACTIVE; + + return 1; +} + +int CHudGeiger::Draw (float flTime) +{ + /* + int pct; + float flvol; + int rg[3]; + int i; + + if (m_iGeigerRange < 1000 && m_iGeigerRange > 0) + { + // peicewise linear is better than continuous formula for this + if (m_iGeigerRange > 800) + { + pct = 0; //Con_Printf ( "range > 800\n"); + } + else if (m_iGeigerRange > 600) + { + pct = 2; + flvol = 0.4; //Con_Printf ( "range > 600\n"); + rg[0] = 1; + rg[1] = 1; + i = 2; + } + else if (m_iGeigerRange > 500) + { + pct = 4; + flvol = 0.5; //Con_Printf ( "range > 500\n"); + rg[0] = 1; + rg[1] = 2; + i = 2; + } + else if (m_iGeigerRange > 400) + { + pct = 8; + flvol = 0.6; //Con_Printf ( "range > 400\n"); + rg[0] = 1; + rg[1] = 2; + rg[2] = 3; + i = 3; + } + else if (m_iGeigerRange > 300) + { + pct = 8; + flvol = 0.7; //Con_Printf ( "range > 300\n"); + rg[0] = 2; + rg[1] = 3; + rg[2] = 4; + i = 3; + } + else if (m_iGeigerRange > 200) + { + pct = 28; + flvol = 0.78; //Con_Printf ( "range > 200\n"); + rg[0] = 2; + rg[1] = 3; + rg[2] = 4; + i = 3; + } + else if (m_iGeigerRange > 150) + { + pct = 40; + flvol = 0.80; //Con_Printf ( "range > 150\n"); + rg[0] = 3; + rg[1] = 4; + rg[2] = 5; + i = 3; + } + else if (m_iGeigerRange > 100) + { + pct = 60; + flvol = 0.85; //Con_Printf ( "range > 100\n"); + rg[0] = 3; + rg[1] = 4; + rg[2] = 5; + i = 3; + } + else if (m_iGeigerRange > 75) + { + pct = 80; + flvol = 0.9; //Con_Printf ( "range > 75\n"); + //gflGeigerDelay = cl.time + GEIGERDELAY * 0.75; + rg[0] = 4; + rg[1] = 5; + rg[2] = 6; + i = 3; + } + else if (m_iGeigerRange > 50) + { + pct = 90; + flvol = 0.95; //Con_Printf ( "range > 50\n"); + rg[0] = 5; + rg[1] = 6; + i = 2; + } + else + { + pct = 95; + flvol = 1.0; //Con_Printf ( "range < 50\n"); + rg[0] = 5; + rg[1] = 6; + i = 2; + } + + flvol = (flvol * ((rand() & 127)) / 255) + 0.25; // UTIL_RandomFloat(0.25, 0.5); + + if ((rand() & 127) < pct || (rand() & 127) < pct) + { + //S_StartDynamicSound (-1, 0, rgsfx[rand() % i], r_origin, flvol, 1.0, 0, 100); + char sz[256]; + + int j = rand() & 1; + if (i > 2) + j += rand() & 1; + + sprintf(sz, "player/geiger%d.wav", j + 1); + //PlaySound(sz, flvol); + } + } + */ + return 1; +} diff --git a/main/source/cl_dll/health.cpp b/main/source/cl_dll/health.cpp new file mode 100644 index 00000000..78451bd6 --- /dev/null +++ b/main/source/cl_dll/health.cpp @@ -0,0 +1,524 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// Health.cpp +// +// implementation of CHudHealth class +// + +#include "STDIO.H" +#include "STDLIB.H" +#include "MATH.H" + +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" +#include +#include "mod/AvHHudConstants.h" +#include "mod/AvHPlayerUpgrade.h" + +DECLARE_MESSAGE(m_Health, Health ) +DECLARE_MESSAGE(m_Health, Damage ) +//DECLARE_MESSAGE(m_Health, ClCorpse ); + +#define PAIN_NAME "sprites/%d_pain.spr" +#define DAMAGE_NAME "sprites/%d_dmg.spr" + +int giDmgHeight, giDmgWidth; + +int giDmgFlags[NUM_DMG_TYPES] = +{ + DMG_POISON, + DMG_ACID, + DMG_FREEZE|DMG_SLOWFREEZE, + DMG_DROWN, + DMG_BURN|DMG_SLOWBURN, + DMG_NERVEGAS, + DMG_RADIATION, + DMG_SHOCK, + DMG_CALTROP, + DMG_TRANQ, + DMG_CONCUSS, + DMG_HALLUC +}; + +int CHudHealth::Init(void) +{ + HOOK_MESSAGE(Health); + HOOK_MESSAGE(Damage); + //HOOK_MESSAGE(ClCorpse); + + m_iHealth = 100; + m_fFade = 0; + m_iFlags = 0; + m_bitsDamage = 0; + m_fAttackFront = m_fAttackRear = m_fAttackRight = m_fAttackLeft = 0; + giDmgHeight = 0; + giDmgWidth = 0; + + memset(m_dmg, 0, sizeof(DAMAGE_IMAGE) * NUM_DMG_TYPES); + + + gHUD.AddHudElem(this); + return 1; +} + +void CHudHealth::Reset( void ) +{ + // make sure the pain compass is cleared when the player respawns + m_fAttackFront = m_fAttackRear = m_fAttackRight = m_fAttackLeft = 0; + + + // force all the flashing damage icons to expire + m_bitsDamage = 0; + for ( int i = 0; i < NUM_DMG_TYPES; i++ ) + { + m_dmg[i].fExpire = 0; + } +} + +int CHudHealth::VidInit(void) +{ + m_hSprite = 0; + + m_HUD_dmg_bio = gHUD.GetSpriteIndex( "dmg_bio" ) + 1; + m_HUD_cross = gHUD.GetSpriteIndex( "cross" ); + + giDmgHeight = gHUD.GetSpriteRect(m_HUD_dmg_bio).right - gHUD.GetSpriteRect(m_HUD_dmg_bio).left; + giDmgWidth = gHUD.GetSpriteRect(m_HUD_dmg_bio).bottom - gHUD.GetSpriteRect(m_HUD_dmg_bio).top; + return 1; +} + +int CHudHealth:: MsgFunc_Health(const char *pszName, int iSize, void *pbuf ) +{ + int theBytesRead = 0; + + // TODO: update local health data + BEGIN_READ( pbuf, iSize ); + int x = READ_SHORT(); + theBytesRead += 2; + + m_iFlags |= HUD_ACTIVE; + + // Only update the fade if we've changed health + if (x != m_iHealth) + { + // We're sent the health of the player we're observing as if it were our own + m_fFade = FADE_TIME; + m_iHealth = x; + } + + return theBytesRead; +} + + +int CHudHealth:: MsgFunc_Damage(const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + int armor = READ_BYTE(); // armor + int damageTaken = READ_BYTE(); // health + long bitsDamage = READ_LONG(); // damage bits + + vec3_t vecFrom; + + for ( int i = 0 ; i < 3 ; i++) + vecFrom[i] = READ_COORD(); + + UpdateTiles(gHUD.m_flTime, bitsDamage); + + // Actually took damage? + if ( damageTaken > 0 || armor > 0 ) + CalcDamageDirection(vecFrom); + + return 1; +} + + +// Returns back a color from the +// Green <-> Yellow <-> Red ramp +void CHudHealth::GetPainColor( int &r, int &g, int &b ) +{ + int theMaxHealth = gHUD.GetHUDMaxHealth(); + + if (m_iHealth > theMaxHealth/4) + { + gHUD.GetPrimaryHudColor(r, g, b); + } + else + { + r = 250; + g = 0; + b = 0; + } +} + +int CHudHealth::Draw(float flTime) +{ + int r, g, b; + int a = 0, x, y; + int HealthWidth; + + if ( /*!gHUD.GetIsAlive() ||*/ (gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH) /*|| gEngfuncs.IsSpectateOnly()*/ ) + return 1; + + if ( !m_hSprite ) + m_hSprite = LoadSprite(PAIN_NAME); + + // Has health changed? Flash the health # + if (m_fFade) + { + m_fFade -= (gHUD.m_flTimeDelta * 20); + if (m_fFade <= 0) + { + a = MIN_ALPHA; + m_fFade = 0; + } + + // Fade the health number back to dim + + a = MIN_ALPHA + (m_fFade/FADE_TIME) * 128; + + } + else + a = MIN_ALPHA; + + // Potentially se upgrades and health of spectator target + int theUpgrades = gHUD.GetHUDUpgrades(); + + // If health is getting low, make it bright red + int theMaxHealth = gHUD.GetHUDMaxHealth(); + if (m_iHealth <= theMaxHealth/10) + { + a = 255; + } + + GetPainColor( r, g, b ); + ScaleColors(r, g, b, a ); + + int theViewport[4]; + gHUD.GetViewport(theViewport); + + // Only draw health if we have the suit. + if (gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT))) + { + HealthWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left; + int CrossWidth = gHUD.GetSpriteRect(m_HUD_cross).right - gHUD.GetSpriteRect(m_HUD_cross).left; + + y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2; + + x = theViewport[0] + CrossWidth /2; + + int theInset = 0; + if(gHUD.GetIsAlien() && !gHUD.GetIsCombatMode()) + { + theInset = ScreenWidth()*kResourceEnergyBarWidth; + } + x += theInset;// + kHealthLeftInset*ScreenWidth; + + SPR_Set(gHUD.GetSprite(m_HUD_cross), r, g, b); + SPR_DrawAdditive(0, x, y, &gHUD.GetSpriteRect(m_HUD_cross)); + + x += CrossWidth + HealthWidth / 2; + + x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iHealth, r, g, b); + + x += HealthWidth/2; + + gHUD.GetPrimaryHudColor(r, g, b); + + int iHeight = gHUD.m_iFontHeight; + int iWidth = HealthWidth/10; + FillRGBA(x, y, iWidth, iHeight, r, g, b, a); + } + + DrawDamage(flTime); + return DrawPain(flTime); +} + +void CHudHealth::CalcDamageDirection(vec3_t vecFrom) +{ + vec3_t forward, right, up; + float side, front; + vec3_t vecOrigin, vecAngles; + + if (!vecFrom[0] && !vecFrom[1] && !vecFrom[2]) + { + m_fAttackFront = m_fAttackRear = m_fAttackRight = m_fAttackLeft = 0; + return; + } + + + memcpy(vecOrigin, gHUD.m_vecOrigin, sizeof(vec3_t)); + memcpy(vecAngles, gHUD.m_vecAngles, sizeof(vec3_t)); + + + VectorSubtract (vecFrom, vecOrigin, vecFrom); + + float flDistToTarget = vecFrom.Length(); + + vecFrom = vecFrom.Normalize(); + AngleVectors (vecAngles, forward, right, up); + + front = DotProduct (vecFrom, right); + side = DotProduct (vecFrom, forward); + + if (flDistToTarget <= 50) + { + m_fAttackFront = m_fAttackRear = m_fAttackRight = m_fAttackLeft = 1; + } + else + { + if (side > 0) + { + if (side > 0.3) + m_fAttackFront = max(m_fAttackFront, side); + } + else + { + float f = fabs(side); + if (f > 0.3) + m_fAttackRear = max(m_fAttackRear, f); + } + + if (front > 0) + { + if (front > 0.3) + m_fAttackRight = max(m_fAttackRight, front); + } + else + { + float f = fabs(front); + if (f > 0.3) + m_fAttackLeft = max(m_fAttackLeft, f); + } + } +} + +int CHudHealth::DrawPain(float flTime) +{ + if (!(m_fAttackFront || m_fAttackRear || m_fAttackLeft || m_fAttackRight)) + return 1; + + int r, g, b; + int x, y, a, shade; + + // TODO: get the shift value of the health + a = 255; // max brightness until then + + float fFade = gHUD.m_flTimeDelta * 2; + + // SPR_Draw top + if (m_fAttackFront > 0.4) + { + GetPainColor(r,g,b); + shade = a * max( m_fAttackFront, 0.5 ); + ScaleColors(r, g, b, shade); + SPR_Set(m_hSprite, r, g, b ); + + x = ScreenWidth()/2 - SPR_Width(m_hSprite, 0)/2; + y = ScreenHeight()/2 - SPR_Height(m_hSprite,0) * 3; + SPR_DrawAdditive(0, x, y, NULL); + m_fAttackFront = max( 0, m_fAttackFront - fFade ); + } else + m_fAttackFront = 0; + + if (m_fAttackRight > 0.4) + { + GetPainColor(r,g,b); + shade = a * max( m_fAttackRight, 0.5 ); + ScaleColors(r, g, b, shade); + SPR_Set(m_hSprite, r, g, b ); + + x = ScreenWidth()/2 + SPR_Width(m_hSprite, 1) * 2; + y = ScreenHeight()/2 - SPR_Height(m_hSprite,1)/2; + SPR_DrawAdditive(1, x, y, NULL); + m_fAttackRight = max( 0, m_fAttackRight - fFade ); + } else + m_fAttackRight = 0; + + if (m_fAttackRear > 0.4) + { + GetPainColor(r,g,b); + shade = a * max( m_fAttackRear, 0.5 ); + ScaleColors(r, g, b, shade); + SPR_Set(m_hSprite, r, g, b ); + + x = ScreenWidth()/2 - SPR_Width(m_hSprite, 2)/2; + y = ScreenHeight()/2 + SPR_Height(m_hSprite,2) * 2; + SPR_DrawAdditive(2, x, y, NULL); + m_fAttackRear = max( 0, m_fAttackRear - fFade ); + } else + m_fAttackRear = 0; + + if (m_fAttackLeft > 0.4) + { + GetPainColor(r,g,b); + shade = a * max( m_fAttackLeft, 0.5 ); + ScaleColors(r, g, b, shade); + SPR_Set(m_hSprite, r, g, b ); + + x = ScreenWidth()/2 - SPR_Width(m_hSprite, 3) * 3; + y = ScreenHeight()/2 - SPR_Height(m_hSprite,3)/2; + SPR_DrawAdditive(3, x, y, NULL); + + m_fAttackLeft = max( 0, m_fAttackLeft - fFade ); + } else + m_fAttackLeft = 0; + + return 1; +} + +int CHudHealth::DrawDamage(float flTime) +{ + int r, g, b, a; + DAMAGE_IMAGE *pdmg; + + if (!m_bitsDamage) + return 1; + + gHUD.GetPrimaryHudColor(r, g, b); + a = (int)( fabs(sin(flTime*2)) * 256.0); + + ScaleColors(r, g, b, a); + + // Draw all the items + for (int i = 0; i < NUM_DMG_TYPES; i++) + { + if (m_bitsDamage & giDmgFlags[i]) + { + pdmg = &m_dmg[i]; + SPR_Set(gHUD.GetSprite(m_HUD_dmg_bio + i), r, g, b ); + SPR_DrawAdditive(0, pdmg->x, pdmg->y, &gHUD.GetSpriteRect(m_HUD_dmg_bio + i)); + } + } + + + // check for bits that should be expired + for ( i = 0; i < NUM_DMG_TYPES; i++ ) + { + DAMAGE_IMAGE *pdmg = &m_dmg[i]; + + if ( m_bitsDamage & giDmgFlags[i] ) + { + pdmg->fExpire = min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire ); + + if ( pdmg->fExpire <= flTime // when the time has expired + && a < 40 ) // and the flash is at the low point of the cycle + { + pdmg->fExpire = 0; + + int y = pdmg->y; + pdmg->x = pdmg->y = 0; + + // move everyone above down + for (int j = 0; j < NUM_DMG_TYPES; j++) + { + pdmg = &m_dmg[j]; + if ((pdmg->y) && (pdmg->y < y)) + pdmg->y += giDmgHeight; + + } + + m_bitsDamage &= ~giDmgFlags[i]; // clear the bits + } + } + } + + return 1; +} + + +void CHudHealth::UpdateTiles(float flTime, long bitsDamage) +{ + DAMAGE_IMAGE *pdmg; + + // Which types are new? + long bitsOn = ~m_bitsDamage & bitsDamage; + + for (int i = 0; i < NUM_DMG_TYPES; i++) + { + pdmg = &m_dmg[i]; + + // Is this one already on? + if (m_bitsDamage & giDmgFlags[i]) + { + pdmg->fExpire = flTime + DMG_IMAGE_LIFE; // extend the duration + if (!pdmg->fBaseline) + pdmg->fBaseline = flTime; + } + + // Are we just turning it on? + if (bitsOn & giDmgFlags[i]) + { + // put this one at the bottom + pdmg->x = giDmgWidth/8; + pdmg->y = ScreenHeight() - giDmgHeight * 2; + pdmg->fExpire=flTime + DMG_IMAGE_LIFE; + + // move everyone else up + for (int j = 0; j < NUM_DMG_TYPES; j++) + { + if (j == i) + continue; + + pdmg = &m_dmg[j]; + if (pdmg->y) + pdmg->y -= giDmgHeight; + + } + pdmg = &m_dmg[i]; + } + } + + // damage bits are only turned on here; they are turned off when the draw time has expired (in DrawDamage()) + m_bitsDamage |= bitsDamage; +} + + +void CreateCorpse ( Vector vOrigin, Vector vAngles, const char *pModel, float flAnimTime, int iSequence, int iBody ); + +//int CHudHealth::MsgFunc_ClCorpse( const char *pszName, int iSize, void *pbuf ) +//{ +// BEGIN_READ( pbuf, iSize ); +// +// char szModel[64]; +// Vector vOrigin; +// Vector vAngles; +// float flAnimTime = 0; +// int iSequence = 0; +// int iBody = 0; +// +// char *pModel = READ_STRING(); +// +// sprintf ( szModel, "models/player/%s/%s.mdl", pModel, pModel ); +// +// vOrigin.x = READ_LONG(); vOrigin.x /= 128.0f; +// vOrigin.y = READ_LONG(); vOrigin.y /= 128.0f; +// vOrigin.z = READ_LONG(); vOrigin.z /= 128.0f; +// +// vAngles.x = READ_COORD(); +// vAngles.y = READ_COORD(); +// vAngles.z = READ_COORD(); +// +// flAnimTime = ((float)READ_LONG()/100.0f) + gEngfuncs.GetClientTime(); +// +// iSequence = READ_BYTE(); +// iBody = READ_BYTE(); +// +// CreateCorpse ( vOrigin, vAngles, szModel, flAnimTime, iSequence, iBody ); +// +// return 1; +//} diff --git a/main/source/cl_dll/health.h b/main/source/cl_dll/health.h new file mode 100644 index 00000000..ad9db1ed --- /dev/null +++ b/main/source/cl_dll/health.h @@ -0,0 +1,118 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ + +#ifndef HEALTH_H +#define HEALTH_H + +#define DMG_IMAGE_LIFE 2 // seconds that image is up + +#define DMG_IMAGE_POISON 0 +#define DMG_IMAGE_ACID 1 +#define DMG_IMAGE_COLD 2 +#define DMG_IMAGE_DROWN 3 +#define DMG_IMAGE_BURN 4 +#define DMG_IMAGE_NERVE 5 +#define DMG_IMAGE_RAD 6 +#define DMG_IMAGE_SHOCK 7 +//tf defines +#define DMG_IMAGE_CALTROP 8 +#define DMG_IMAGE_TRANQ 9 +#define DMG_IMAGE_CONCUSS 10 +#define DMG_IMAGE_HALLUC 11 +#define NUM_DMG_TYPES 12 +// instant damage + +//// time-based damage +////mask off TF-specific stuff too +//#define DMG_TIMEBASED (~(0xff003fff)) // mask for time-based damage +// +// +//#define DMG_DROWN (1 << 14) // Drowning +//#define DMG_FIRSTTIMEBASED DMG_DROWN +// +//#define DMG_PARALYZE (1 << 15) // slows affected creature down +//#define DMG_NERVEGAS (1 << 16) // nerve toxins, very bad +//#define DMG_POISON (1 << 17) // blood poisioning +//#define DMG_RADIATION (1 << 18) // radiation exposure +//#define DMG_DROWNRECOVER (1 << 19) // drowning recovery +//#define DMG_ACID (1 << 20) // toxic chemicals or acid burns +//#define DMG_SLOWBURN (1 << 21) // in an oven +//#define DMG_SLOWFREEZE (1 << 22) // in a subzero freezer +//#define DMG_MORTAR (1 << 23) // Hit by air raid (done to distinguish grenade from mortar) +// +////TF ADDITIONS +//#define DMG_IGNITE (1 << 24) // Players hit by this begin to burn +//#define DMG_RADIUS_MAX (1 << 25) // Radius damage with this flag doesn't decrease over distance +//#define DMG_RADIUS_QUAKE (1 << 26) // Radius damage is done like Quake. 1/2 damage at 1/2 radius. +//#define DMG_IGNOREARMOR (1 << 27) // Damage ignores target's armor +//#define DMG_AIMED (1 << 28) // Does Hit location damage +//#define DMG_WALLPIERCING (1 << 29) // Blast Damages ents through walls +// +//#define DMG_CALTROP (1<<30) +//#define DMG_HALLUC (1<<31) +#include "common/damagetypes.h" + +// TF Healing Additions for TakeHealth +#define DMG_IGNORE_MAXHEALTH DMG_IGNITE +// TF Redefines since we never use the originals +#define DMG_NAIL DMG_SLASH +#define DMG_NOT_SELF DMG_FREEZE + + +#define DMG_TRANQ DMG_MORTAR +#define DMG_CONCUSS DMG_SONIC + + + +typedef struct +{ + float fExpire; + float fBaseline; + int x, y; +} DAMAGE_IMAGE; + +// +//----------------------------------------------------- +// +class CHudHealth: public CHudBase +{ +public: + virtual int Init( void ); + virtual int VidInit( void ); + virtual int Draw(float fTime); + virtual void Reset( void ); + //int MsgFunc_ClCorpse(const char *pszName, int iSize, void *pbuf); + int MsgFunc_Health(const char *pszName, int iSize, void *pbuf); + int MsgFunc_Damage(const char *pszName, int iSize, void *pbuf); + int m_iHealth; + int m_HUD_dmg_bio; + int m_HUD_cross; + float m_fAttackFront, m_fAttackRear, m_fAttackLeft, m_fAttackRight; + void GetPainColor( int &r, int &g, int &b ); + float m_fFade; + +private: + HSPRITE m_hSprite; + HSPRITE m_hDamage; + + DAMAGE_IMAGE m_dmg[NUM_DMG_TYPES]; + int m_bitsDamage; + int DrawPain(float fTime); + int DrawDamage(float fTime); + void CalcDamageDirection(vec3_t vecFrom); + void UpdateTiles(float fTime, long bits); +}; + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/hl/hl_baseentity.cpp b/main/source/cl_dll/hl/hl_baseentity.cpp new file mode 100644 index 00000000..27b9f244 --- /dev/null +++ b/main/source/cl_dll/hl/hl_baseentity.cpp @@ -0,0 +1,295 @@ +/*** +* +* Copyright (c) 1996-2002, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ + +/* +========================== +This file contains "stubs" of class member implementations so that we can predict certain + weapons client side. From time to time you might find that you need to implement part of the + these functions. If so, cut it from here, paste it in hl_weapons.cpp or somewhere else and + add in the functionality you need. +========================== +*/ +#include "extdll.h" +#include "util.h" +#include "cbase.h" +#include "player.h" +#include "weapons.h" +#include "nodes.h" +#include "soundent.h" +#include "skill.h" + +// Globals used by game logic +const Vector g_vecZero = Vector( 0, 0, 0 ); +int gmsgWeapPickup = 0; +enginefuncs_t g_engfuncs; +globalvars_t *gpGlobals; + +ItemInfo CBasePlayerItem::ItemInfoArray[MAX_WEAPONS]; + +void EMIT_SOUND_DYN(edict_t *entity, int channel, const char *sample, float volume, float attenuation, int flags, int pitch) { } + +// CBaseEntity Stubs +int CBaseEntity :: TakeHealth( float flHealth, int bitsDamageType ) { return 1; } +int CBaseEntity :: TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType ) { return 1; } +CBaseEntity *CBaseEntity::GetNextTarget( void ) { return NULL; } +int CBaseEntity::Save( CSave &save ) { return 1; } +int CBaseEntity::Restore( CRestore &restore ) { return 1; } +void CBaseEntity::SetObjectCollisionBox( void ) { } +int CBaseEntity :: Intersects( CBaseEntity *pOther ) { return 0; } +void CBaseEntity :: MakeDormant( void ) { } +int CBaseEntity :: IsDormant( void ) { return 0; } +BOOL CBaseEntity :: IsInWorld( void ) { return TRUE; } +int CBaseEntity::ShouldToggle( USE_TYPE useType, BOOL currentState ) { return 0; } +int CBaseEntity :: DamageDecal( int bitsDamageType ) { return -1; } +CBaseEntity * CBaseEntity::Create( const char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner ) { return NULL; } +void CBaseEntity::SUB_Remove( void ) { } +void CBaseEntity::AddChecksum(Checksum& inChecksum) {} +void CBaseEntity::UpdateOnRemove() {} + +// CBaseDelay Stubs +void CBaseDelay :: KeyValue( struct KeyValueData_s * ) { } +int CBaseDelay::Restore( class CRestore & ) { return 1; } +int CBaseDelay::Save( class CSave & ) { return 1; } + +// CBaseAnimating Stubs +int CBaseAnimating::Restore( class CRestore & ) { return 1; } +int CBaseAnimating::Save( class CSave & ) { return 1; } + +// DEBUG Stubs +edict_t *DBG_EntOfVars( const entvars_t *pev ) { return NULL; } +// Now in AvHAssert.cpp +//void DBG_AssertFunction(bool fExpr, const char* szExpr, const char* szFile, int szLine, const char* szMessage) { } + +// UTIL_* Stubs +void UTIL_PrecacheOther( const char *szClassname ) { } +void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color, int amount ) { } +void UTIL_DecalTrace( TraceResult *pTrace, int decalNumber ) { } +void UTIL_GunshotDecalTrace( TraceResult *pTrace, int decalNumber ) { } +void UTIL_MakeVectors( const Vector &vecAngles ) { } +BOOL UTIL_IsValidEntity( edict_t *pent ) { return TRUE; } +void UTIL_SetOrigin( entvars_t *, const Vector &org ) { } +BOOL UTIL_GetNextBestWeapon( CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon ) { return TRUE; } +void UTIL_LogPrintf(char *,...) { } +void UTIL_ClientPrintAll( int,char const *,char const *,char const *,char const *,char const *) { } +void ClientPrint( entvars_t *client, int msg_dest, const char *msg_name, const char *param1, const char *param2, const char *param3, const char *param4 ) { } + +// CBaseToggle Stubs +int CBaseToggle::Restore( class CRestore & ) { return 1; } +int CBaseToggle::Save( class CSave & ) { return 1; } +void CBaseToggle :: KeyValue( struct KeyValueData_s * ) { } +void CBaseToggle::SaveDataForReset() {} +void CBaseToggle::ResetEntity() {} + +// CGrenade Stubs +void CGrenade::BounceSound( void ) { } +void CGrenade::Explode( Vector, Vector ) { } +void CGrenade::Explode( TraceResult *, int ) { } +void CGrenade::Killed( entvars_t *, int ) { } +void CGrenade::Spawn( void ) { } +CGrenade * CGrenade:: ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time ){ return 0; } +CGrenade *CGrenade::ShootContact( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity ){ return 0; } +void CGrenade::DetonateUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ){ } + +void UTIL_Remove( CBaseEntity *pEntity ){ } +struct skilldata_t gSkillData; +void UTIL_SetSize( entvars_t *pev, const Vector &vecMin, const Vector &vecMax ){ } +CBaseEntity *UTIL_FindEntityInSphere( CBaseEntity *pStartEntity, const Vector &vecCenter, float flRadius ){ return 0;} + +Vector UTIL_VecToAngles( const Vector &vec ){ return 0; } +CSprite *CSprite::SpriteCreate( const char *pSpriteName, const Vector &origin, BOOL animate ) { return 0; } +void CBeam::PointEntInit( const Vector &start, int endIndex ) { } +CBeam *CBeam::BeamCreate( const char *pSpriteName, int width ) { return NULL; } +void CSprite::Expand( float scaleSpeed, float fadeSpeed ) { } + + +CBaseEntity* CBaseMonster :: CheckTraceHullAttack( float flDist, float& ioDamage, int iDmgType ) { return NULL; } +int CBaseMonster::GetHull() const { return head_hull; } +void CBaseMonster :: Look ( int iDistance ) { } +float CBaseAnimating :: StudioFrameAdvance ( float flInterval ) { return 0.0; } +int CBaseMonster::IRelationship ( CBaseEntity *pTarget ) { return 0; } +CBaseEntity *CBaseMonster :: BestVisibleEnemy ( void ) { return NULL; } +BOOL CBaseMonster :: FInViewCone ( CBaseEntity *pEntity ) { return FALSE; } +BOOL CBaseMonster :: FInViewCone ( Vector *pOrigin ) { return FALSE; } +BOOL CBaseEntity :: FVisible ( CBaseEntity *pEntity ) { return FALSE; } +BOOL CBaseEntity :: FVisible ( const Vector &vecOrigin ) { return FALSE; } +void CBaseMonster :: MakeIdealYaw( Vector vecTarget ) { } +float CBaseMonster::ChangeYaw ( int yawSpeed ) { return 0; } +int CBaseAnimating :: LookupActivity ( int activity ) { return 0; } +int CBaseAnimating :: LookupActivityHeaviest ( int activity ) { return 0; } +int CBaseAnimating :: LookupSequence ( const char *label ) { return 0; } +void CBaseAnimating :: ResetSequenceInfo ( ) { } +BOOL CBaseAnimating :: GetSequenceFlags( ) { return FALSE; } +void CBaseAnimating :: DispatchAnimEvents ( float flInterval ) { } +float CBaseAnimating :: SetBoneController ( int iController, float flValue ) { return 0.0; } +void CBaseAnimating :: InitBoneControllers ( void ) { } +float CBaseAnimating :: SetBlending ( int iBlender, float flValue ) { return 0; } +void CBaseAnimating :: GetBonePosition ( int iBone, Vector &origin, Vector &angles ) { } +void CBaseAnimating :: GetAttachment ( int iAttachment, Vector &origin, Vector &angles ) { } +int CBaseAnimating :: FindTransition( int iEndingSequence, int iGoalSequence, int *piDir ) { return -1; } +void CBaseAnimating :: GetAutomovement( Vector &origin, Vector &angles, float flInterval ) { } +void CBaseAnimating :: SetBodygroup( int iGroup, int iValue ) { } +int CBaseAnimating :: GetBodygroup( int iGroup ) { return 0; } +void CBaseEntity::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { } +void CBaseEntity::FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker, int inDamageType ) { } +void CBaseEntity :: TraceBleed( float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType ) { } +void CBaseMonster :: MakeDamageBloodDecal ( int cCount, float flNoise, TraceResult *ptr, const Vector &vecDir ) { } +void CBaseMonster::ReportAIState( void ) { } +void CBaseMonster :: KeyValue( KeyValueData *pkvd ) { } +BOOL CBaseMonster :: FCheckAITrigger ( void ) { return FALSE; } +void CBaseMonster::CorpseFallThink( void ) { } +void CBaseMonster :: MonsterInitDead( void ) { } +void CBaseMonster :: TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { } +BOOL CBaseMonster :: ShouldFadeOnDeath( void ) { return FALSE; } +void CBaseMonster :: RadiusDamage(entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { } +void CBaseMonster :: RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { } +void CBaseMonster::FadeMonster( void ) { } +void CBaseMonster :: GibMonster( void ) { } +BOOL CBaseMonster :: HasHumanGibs( void ) { return FALSE; } +BOOL CBaseMonster :: HasAlienGibs( void ) { return FALSE; } +Activity CBaseMonster :: GetDeathActivity ( void ) { return ACT_DIE_HEADSHOT; } +void CBaseMonster::BecomeDead( void ) {} +void CBaseMonster :: Killed( entvars_t *pevAttacker, int iGib ) {} +int CBaseMonster :: TakeHealth (float flHealth, int bitsDamageType) { return 0; } +int CBaseMonster :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) { return 0; } + +int TrainSpeed(int iSpeed, int iMax) { return 0; } +void CBasePlayer :: DeathSound( void ) { } +int CBasePlayer :: TakeHealth( float flHealth, int bitsDamageType ) { return 0; } +void CBasePlayer :: TabulateAmmo() { } +void CBasePlayer :: TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { } +int CBasePlayer :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) { return 0; } +void CBasePlayer::PackDeadPlayerItems( void ) { } +void CBasePlayer::RemoveAllItems( BOOL removeSuit ) { } +void CBasePlayer::SetAnimation( PLAYER_ANIM playerAnim ) { } +void CBasePlayer::WaterMove() { } +void CBasePlayer :: InitPlayerFromSpawn(edict_t* inSpawn) {} +BOOL CBasePlayer::IsOnLadder( void ) { return FALSE; } +BOOL CBasePlayer::IsAlive() const { return FALSE; } +BOOL CBasePlayer::IsAlive(bool) const { return FALSE; } +void CBasePlayer::PlayerDeathThink(void) { } +void CBasePlayer::StartDeathCam( void ) { } +void CBasePlayer::StartObserver( Vector vecPosition, Vector vecViewAngle ) { } +void CBasePlayer::StopObserver() { } +void CBasePlayer::PlayerUse ( void ) { } +void CBasePlayer::Jump() { } +void CBasePlayer::Duck( ) { } +int CBasePlayer::Classify ( void ) { return 0; } +void CBasePlayer::PreThink(void) { } +void CBasePlayer::CheckTimeBasedDamage() { } +void CBasePlayer :: UpdateGeigerCounter( void ) { } +void CBasePlayer::CheckSuitUpdate() { } +void CBasePlayer::SetSuitUpdate(char *name, int fgroup, int iNoRepeatTime) { } +void CBasePlayer :: UpdatePlayerSound ( void ) { } +void CBasePlayer::PostThink() { } +void CBasePlayer::EffectivePlayerClassChanged() {} +void CBasePlayer::NeedsTeamUpdate() {} +void CBasePlayer::SendTeamUpdate() {} +void CBasePlayer::Suicide() {} +void CBasePlayer :: Precache( void ) { } +int CBasePlayer::Save( CSave &save ) { return 0; } +void CBasePlayer::RenewItems(void) { } +int CBasePlayer::Restore( CRestore &restore ) { return 0; } +void CBasePlayer::SelectNextItem( int iItem ) { } +BOOL CBasePlayer::HasWeapons( void ) { return FALSE; } +void CBasePlayer::SelectPrevItem( int iItem ) { } +CBaseEntity *FindEntityForward( CBaseEntity *pMe ) { return NULL; } +BOOL CBasePlayer :: FlashlightIsOn( void ) { return FALSE; } +void CBasePlayer :: FlashlightTurnOn( void ) { } +void CBasePlayer :: FlashlightTurnOff( void ) { } +void CBasePlayer :: ForceClientDllUpdate( void ) { } +void CBasePlayer::ImpulseCommands( ) { } +void CBasePlayer::CheatImpulseCommands( int iImpulse ) { } +int CBasePlayer::AddPlayerItem( CBasePlayerItem *pItem ) { return FALSE; } +int CBasePlayer::RemovePlayerItem( CBasePlayerItem *pItem ) { return FALSE; } +void CBasePlayer::ItemPreFrame() { } +void CBasePlayer::ItemPostFrame() { } +int CBasePlayer::AmmoInventory( int iAmmoIndex ) { return -1; } +int CBasePlayer::GetAmmoIndex(const char *psz) { return -1; } +int CBasePlayer::GetMaxWalkSpeed() const { return 220; } +void CBasePlayer::SendAmmoUpdate(void) { } +void CBasePlayer::SendWeaponUpdate() {} +void CBasePlayer :: UpdateClientData( void ) { } +BOOL CBasePlayer :: FBecomeProne ( void ) { return TRUE; } +void CBasePlayer :: BarnacleVictimBitten ( entvars_t *pevBarnacle ) { } +void CBasePlayer :: BarnacleVictimReleased ( void ) { } +int CBasePlayer :: Illumination( void ) { return 0; } +void CBasePlayer :: EnableControl(BOOL fControl) { } +Vector CBasePlayer :: GetAutoaimVector( float flDelta ) { return g_vecZero; } +Vector CBasePlayer :: AutoaimDeflection( Vector &vecSrc, float flDist, float flDelta ) { return g_vecZero; } +void CBasePlayer :: ResetAutoaim( ) { } +void CBasePlayer :: SetCustomDecalFrames( int nFrames ) { } +int CBasePlayer :: GetCustomDecalFrames( void ) { return -1; } +void CBasePlayer::DropPlayerItem ( char *pszItemName ) { } +BOOL CBasePlayer::HasPlayerItem( CBasePlayerItem *pCheckItem ) { return FALSE; } +BOOL CBasePlayer :: SwitchWeapon( CBasePlayerItem *pWeapon ) { return FALSE; } +Vector CBasePlayer :: GetGunPosition( void ) { return g_vecZero; } +char *CBasePlayer::TeamID( void ) { return ""; } +void CBasePlayer::SetTeamID(const char* inTeamID) {}; +int CBasePlayer :: GiveAmmo( int iCount, char *szName, int iMax ) { return 0; } +void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore ) { } +void CBasePlayer::AddPointsToTeam( int score, BOOL bAllowNegativeScore ) { } +void CBasePlayer::GiveNamedItem(const char* szName, bool inSendMessage) { } + +void ClearMultiDamage(void) { } +void ApplyMultiDamage(entvars_t *pevInflictor, entvars_t *pevAttacker ) { } +void AddMultiDamage( entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType) { } +void SpawnBlood(Vector vecSpot, int bloodColor, float flDamage) { } +int DamageDecal( CBaseEntity *pEntity, int bitsDamageType ) { return 0; } +void DecalGunshot( TraceResult *pTrace, int iBulletType ) { } +void EjectBrass ( const Vector &vecOrigin, const Vector &vecVelocity, float rotation, int model, int soundtype ) { } +void AddAmmoNameToAmmoRegistry( const char *szAmmoname ) { } + +BOOL CBasePlayerItem::CanDeploy( void ) { return TRUE; } +BOOL CBasePlayerItem::CanHolster( void ) { return TRUE; } +BOOL CBasePlayerItem::Deploy( ) { return TRUE; } +BOOL CBasePlayerItem::IsUseable( void ) { return TRUE; } +void CBasePlayerItem::Spawn() {} + +int CBasePlayerItem::Restore( class CRestore & ) { return 1; } +int CBasePlayerItem::Save( class CSave & ) { return 1; } +int CBasePlayerWeapon::Restore( class CRestore & ) { return 1; } +int CBasePlayerWeapon::Save( class CSave & ) { return 1; } +void CBasePlayerItem :: SetObjectCollisionBox( void ) { } +void CBasePlayerItem :: FallInit( void ) { } +void CBasePlayerItem::FallThink ( void ) { } +void CBasePlayerItem::Materialize( void ) { } +void CBasePlayerItem::AttemptToMaterialize( void ) { } +void CBasePlayerItem :: CheckRespawn ( void ) { } +CBaseEntity* CBasePlayerItem::Respawn( void ) { return NULL; } +void CBasePlayerItem::DefaultTouch( CBaseEntity *pOther ) { } +void CBasePlayerItem::DestroyItem( void ) { } +void CBasePlayerItem::VirtualDestroyItem( void ) { } +int CBasePlayerItem::AddToPlayer( CBasePlayer *pPlayer ) { return TRUE; } +void CBasePlayerItem::Drop( void ) { } +void CBasePlayerItem::Kill( void ) { } +void CBasePlayerItem::Holster( int skiplocal ) { } +void CBasePlayerItem::AttachToPlayer ( CBasePlayer *pPlayer ) { } +int CBasePlayerWeapon::AddDuplicate( CBasePlayerItem *pOriginal ) { return 0; } +int CBasePlayerWeapon::AddToPlayer( CBasePlayer *pPlayer ) { return FALSE; } +int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer ) { return 0; } +BOOL CBasePlayerWeapon :: AddPrimaryAmmo( int iCount, char *szName, int iMaxClip, int iMaxCarry ) { return TRUE; } +BOOL CBasePlayerWeapon :: AddSecondaryAmmo( int iCount, char *szName, int iMax ) { return TRUE; } +BOOL CBasePlayerWeapon :: IsUseable( void ) { return TRUE; } +int CBasePlayerWeapon::PrimaryAmmoIndex( void ) { return -1; } +int CBasePlayerWeapon::SecondaryAmmoIndex( void ) { return -1; } +void CBasePlayerAmmo::Spawn( void ) { } +CBaseEntity* CBasePlayerAmmo::Respawn( void ) { return this; } +void CBasePlayerAmmo::Materialize( void ) { } +void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther ) { } +int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon ) { return 0; } +int CBasePlayerWeapon::ExtractClipAmmo( CBasePlayerWeapon *pWeapon ) { return 0; } +void CBasePlayerWeapon::RetireWeapon( void ) { } +void CSoundEnt::InsertSound ( int iType, const Vector &vecOrigin, int iVolume, float flDuration ) {} +void RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType ){} \ No newline at end of file diff --git a/main/source/cl_dll/hl/hl_events.cpp b/main/source/cl_dll/hl/hl_events.cpp new file mode 100644 index 00000000..ec8d77f5 --- /dev/null +++ b/main/source/cl_dll/hl/hl_events.cpp @@ -0,0 +1,99 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#include "../hud.h" +#include "../cl_util.h" +#include "event_api.h" +#include "mod/AvHMarineWeaponConstants.h" +#include "mod/AvHAlienWeaponConstants.h" + +extern "C" +{ +// HLDM +void EV_FireGlock1( struct event_args_s *args ); +void EV_FireGlock2( struct event_args_s *args ); +void EV_FireShotGunSingle( struct event_args_s *args ); +void EV_FireShotGunDouble( struct event_args_s *args ); +void EV_FireMP5( struct event_args_s *args ); +void EV_FireMP52( struct event_args_s *args ); +void EV_FirePython( struct event_args_s *args ); +void EV_FireGauss( struct event_args_s *args ); +void EV_SpinGauss( struct event_args_s *args ); +void EV_Crowbar( struct event_args_s *args ); +void EV_FireCrossbow( struct event_args_s *args ); +void EV_FireCrossbow2( struct event_args_s *args ); +void EV_FireRpg( struct event_args_s *args ); +void EV_EgonFire( struct event_args_s *args ); +void EV_EgonStop( struct event_args_s *args ); +void EV_HornetGunFire( struct event_args_s *args ); +void EV_TripmineFire( struct event_args_s *args ); +void EV_SnarkFire( struct event_args_s *args ); + + + +void EV_TrainPitchAdjust( struct event_args_s *args ); +} + +/* +====================== +Game_HookEvents + +Associate script file name with callback functions. Callback's must be extern "C" so + the engine doesn't get confused about name mangling stuff. Note that the format is + always the same. Of course, a clever mod team could actually embed parameters, behavior + into the actual .sc files and create a .sc file parser and hook their functionality through + that.. i.e., a scripting system. + +That was what we were going to do, but we ran out of time...oh well. +====================== +*/ + +#define AVH_HOOK_EVENT(s) gEngfuncs.pfnHookEvent("events/"#s".dsc", EV_#s) + +void Game_HookEvents( void ) +{ +// gEngfuncs.pfnHookEvent( "events/glock1.sc", EV_FireGlock1 ); +// gEngfuncs.pfnHookEvent( "events/glock2.sc", EV_FireGlock2 ); +// gEngfuncs.pfnHookEvent( "events/shotgun1.sc", EV_FireShotGunSingle ); +// gEngfuncs.pfnHookEvent( "events/shotgun2.sc", EV_FireShotGunDouble ); +// gEngfuncs.pfnHookEvent( "events/mp5.sc", EV_FireMP5 ); +// gEngfuncs.pfnHookEvent( "events/python.sc", EV_FirePython ); +// gEngfuncs.pfnHookEvent( "events/gauss.sc", EV_FireGauss ); +// gEngfuncs.pfnHookEvent( "events/gaussspin.sc", EV_SpinGauss ); +// gEngfuncs.pfnHookEvent( "events/train.sc", EV_TrainPitchAdjust ); + + // Hook marine weapons + AVH_HOOK_EVENT(kMGEventName); + +// gEngfuncs.pfnHookEvent("events/train.sc", EV_TrainPitchAdjust); +// gEngfuncs.pfnHookEvent( "events/glock1.sc", EV_FireGlock1 ); +// gEngfuncs.pfnHookEvent( "events/glock2.sc", EV_FireGlock2 ); +// gEngfuncs.pfnHookEvent( "events/shotgun1.sc", EV_FireShotGunSingle ); +// gEngfuncs.pfnHookEvent( "events/shotgun2.sc", EV_FireShotGunDouble ); +// gEngfuncs.pfnHookEvent( "events/mp5.sc", EV_FireMP5 ); +// gEngfuncs.pfnHookEvent( "events/mp52.sc", EV_FireMP52 ); +// gEngfuncs.pfnHookEvent( "events/python.sc", EV_FirePython ); +// gEngfuncs.pfnHookEvent( "events/gauss.sc", EV_FireGauss ); +// gEngfuncs.pfnHookEvent( "events/gaussspin.sc", EV_SpinGauss ); +// gEngfuncs.pfnHookEvent( "events/train.sc", EV_TrainPitchAdjust ); +// gEngfuncs.pfnHookEvent( "events/crowbar.sc", EV_Crowbar ); +// gEngfuncs.pfnHookEvent( "events/crossbow1.sc", EV_FireCrossbow ); +// gEngfuncs.pfnHookEvent( "events/crossbow2.sc", EV_FireCrossbow2 ); +// gEngfuncs.pfnHookEvent( "events/rpg.sc", EV_FireRpg ); +// gEngfuncs.pfnHookEvent( "events/egon_fire.sc", EV_EgonFire ); +// gEngfuncs.pfnHookEvent( "events/egon_stop.sc", EV_EgonStop ); +// gEngfuncs.pfnHookEvent( "events/firehornet.sc", EV_HornetGunFire ); +// gEngfuncs.pfnHookEvent( "events/tripfire.sc", EV_TripmineFire ); +// gEngfuncs.pfnHookEvent( "events/snarkfire.sc", EV_SnarkFire ); +} diff --git a/main/source/cl_dll/hl/hl_objects.cpp b/main/source/cl_dll/hl/hl_objects.cpp new file mode 100644 index 00000000..e84762b8 --- /dev/null +++ b/main/source/cl_dll/hl/hl_objects.cpp @@ -0,0 +1,89 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#include "../hud.h" +#include "../cl_util.h" +#include "../demo.h" + +#include "demo_api.h" +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" + +#include "pm_defs.h" +#include "event_api.h" +#include "entity_types.h" +#include "r_efx.h" + +extern BEAM *pBeam; +extern BEAM *pBeam2; +void HUD_GetLastOrg( float *org ); + +void UpdateBeams ( void ) +{ + vec3_t forward, vecSrc, vecEnd, origin, angles, right, up; + vec3_t view_ofs; + pmtrace_t tr; + cl_entity_t *pthisplayer = gEngfuncs.GetLocalPlayer(); + int idx = pthisplayer->index; + + // Get our exact viewangles from engine + gEngfuncs.GetViewAngles( (float *)angles ); + + // Determine our last predicted origin + HUD_GetLastOrg( (float *)&origin ); + + AngleVectors( angles, forward, right, up ); + + VectorCopy( origin, vecSrc ); + VectorMA( vecSrc, 2048, forward, vecEnd ); + + gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction( false, true ); + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); + + gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); + gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr ); + + gEngfuncs.pEventAPI->EV_PopPMStates(); + + if ( pBeam ) + { + pBeam->target = tr.endpos; + pBeam->die = gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit forward in the future, just in case. + } + + if ( pBeam2 ) + { + pBeam2->target = tr.endpos; + pBeam2->die = gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit forward in the future, just in case. + } +} + +/* +===================== +Game_AddObjects + +Add game specific, client-side objects here +===================== +*/ +void Game_AddObjects( void ) +{ + if ( pBeam && pBeam2 ) + UpdateBeams(); +} diff --git a/main/source/cl_dll/hl/hl_weapons.cpp b/main/source/cl_dll/hl/hl_weapons.cpp new file mode 100644 index 00000000..be1c478b --- /dev/null +++ b/main/source/cl_dll/hl/hl_weapons.cpp @@ -0,0 +1,1434 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +* Modified by Charlie Cleveland: +* +* $Workfile: hl_weapons.cpp $ +* $Date: 2002/10/24 21:11:52 $ +* +* ------------------------------------------------------------------------------- +* $Log: hl_weapons.cpp,v $ +* Revision 1.31 2002/10/24 21:11:52 Flayra +* - Updated jetpack effect because it was really buggy this old way +* +* Revision 1.30 2002/10/16 02:12:10 Flayra +* - Valve anti-cheat integrated! +* +* Revision 1.29 2002/10/16 00:36:40 Flayra +* - Removed blink fail +* +* Revision 1.28 2002/08/31 18:01:59 Flayra +* - Work at VALVe +* +* Revision 1.27 2002/07/08 16:09:03 Flayra +* - Removed unneeded code here, so random numbers were generated properly on both client and server +* +* Revision 1.26 2002/07/01 20:56:31 Flayra +* - Added babbler gun +* +* Revision 1.25 2002/06/25 17:03:01 Flayra +* - Removed old weapons, added new weapons, fixed mines, iuser3 enables and disables weapons +* +* =============================================================================== +****/ +#include "../hud.h" +#include "../cl_util.h" +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "../demo.h" +#include "common/usercmd.h" +#include "common/event_flags.h" +#include "common/event_api.h" +#include "cl_dll/com_weapons.h" +#include "cl_dll/ammo.h" +#include "cl_dll/ammohistory.h" +#include "extdll.h" +#include "util.h" +#include "cbase.h" +#include "monsters.h" +#include "weapons.h" +#include "nodes.h" +#include "player.h" +#include "mod/AvHEvents.h" + +#include "extdll.h" +#include "util.h" +#include "cbase.h" +#include "monsters.h" +#include "weapons.h" +#include "nodes.h" +#include "player.h" + +#include "usercmd.h" +#include "entity_state.h" +#include "demo_api.h" +#include "pm_defs.h" +#include "event_api.h" +#include "r_efx.h" + +#include "../hud_iface.h" +#include "../com_weapons.h" + +#include "mod/AvHMarineWeapons.h" +#include "mod/AvHSpecials.h" +#include "mod/AvHAlienWeapons.h" +#include "mod/AvHAlienAbilities.h" +#include "mod/AvHAlienWeaponConstants.h" +#include "mod/AvHMovementUtil.h" + +#include "engine/APIProxy.h" +#include "cl_dll/Exports.h" + +extern globalvars_t *gpGlobals; +extern bool gIsJetpacking; + +// Pool of client side entities/entvars_t +static entvars_t ev[ 32 ]; +static int num_ents = 0; + +// The entity we'll use to represent the local client +static CBasePlayer player; + +// Local version of game .dll global variables ( time, etc. ) +static globalvars_t Globals; + +static CBasePlayerWeapon *g_pWpns[ 32 ]; + +vec3_t previousorigin; + +// HLDM Weapon placeholder entities. +//CGlock g_Glock; + +// NS weapons +AvHKnife gKnife; +AvHMachineGun gMachineGun; +AvHPistol gPistol; +AvHSonicGun gSonicGun; +AvHHeavyMachineGun gHeavyMachineGun; +AvHGrenadeGun gGrenadeGun; +AvHGrenade gGrenade; +AvHWelder gWelder; +AvHMine gMine; +AvHSpitGun gSpitGun; +AvHClaws gClaws; +AvHSpore gSpores; +AvHBite gBite; +AvHBite2 gBite2; +AvHSpikeGun gSpikeGun; +AvHSwipe gSwipe; +AvHWebSpinner gWebSpinner; +AvHPrimalScream gPrimalScream; +AvHParasiteGun gParasite; +AvHUmbraGun gUmbra; +AvHBlinkGun gBlink; +AvHDivineWind gDivineWind; +//AvHParalysisGun gParalysisGun; +AvHBileBombGun gBileBomb; +AvHAcidRocketGun gAcidRocket; +AvHHealingSpray gHealingSpray; +AvHMetabolize gMetabolize; +AvHDevour gDevour; +AvHStomp gStomp; + +// Alien abilities +AvHLeap gLeap; +AvHCharge gCharge; + +// Jetpack events +int gJetpackEventID; +//int gWallJumpEventID; +//int gFlightEventID; +int gTeleportEventID; +int gPhaseInEventID; +int gSiegeHitEventID; +int gSiegeViewHitEventID; +int gCommanderPointsAwardedEventID; +int gBlinkEffectSuccessEventID; + +//bool gPlayingJetpack = false; +//CGlock g_Glock; +//CCrowbar g_Crowbar; +//CPython g_Python; +//CMP5 g_Mp5; +//CCrossbow g_Crossbow; +//CShotgun g_Shotgun; +//CRpg g_Rpg; +//CGauss g_Gauss; +//CEgon g_Egon; +//CHgun g_HGun; +//CHandGrenade g_HandGren; +//CSatchel g_Satchel; +//CTripmine g_Tripmine; +//CSqueak g_Snark; + +/* +====================== +AlertMessage + +Print debug messages to console +====================== +*/ +void AlertMessage( ALERT_TYPE atype, char *szFmt, ... ) +{ + va_list argptr; + static char string[1024]; + + va_start (argptr, szFmt); + vsprintf (string, szFmt,argptr); + va_end (argptr); + + gEngfuncs.Con_Printf( "cl: " ); + gEngfuncs.Con_Printf( string ); +} + +// Client-side effects for jetpack +void CheckJetpack() +{ + // if local player is jetpacking, play effects immediately +// if(gIsJetpacking && !gPlayingJetpack) +// { +// cl_entity_t* thePlayer; +// thePlayer = gEngfuncs.GetLocalPlayer(); +// ASSERT(thePlayer); +// +// // Play event locally, server will tell everyone else to play event +// gEngfuncs.pEventAPI->EV_PlaybackEvent(0, NULL, gJetpackEventID, 0, thePlayer->origin, (float *)&g_vecZero, 0.0, 0.0, /*theWeaponIndex*/ 0, 0, 0, 0 ); +// +// //gPlayingJetpack = true; +// } + // Check to turn it off too (in case there's a network anomaly or the game resets or something, just trying to be safe) + //else if(!gIsJetpacking && (gPlayingJetpack)) + //{ + // gEngfuncs.pEventAPI->EV_PlaybackEvent(0, NULL, gEndJetpackEventID, 0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, /*theWeaponIndex*/ 0, 0, 0, 0 ); + // + // gPlayingJetpack = false; + //} +} + +//Returns if it's multiplayer. +//Mostly used by the client side weapons. +bool bIsMultiplayer ( void ) +{ + return gEngfuncs.GetMaxClients() == 1 ? 0 : 1; +} +//Just loads a v_ model. +void LoadVModel ( char *szViewModel, CBasePlayer *m_pPlayer ) +{ + gEngfuncs.CL_LoadModel( szViewModel, &m_pPlayer->pev->viewmodel ); +} + +/* +===================== +HUD_PrepEntity + +Links the raw entity to an entvars_s holder. If a player is passed in as the owner, then +we set up the m_pPlayer field. +===================== +*/ +void HUD_PrepEntity( CBaseEntity *pEntity, CBasePlayer *pWeaponOwner ) +{ + typedef vector IDListType; + static IDListType sIDList; + + memset( &ev[ num_ents ], 0, sizeof( entvars_t ) ); + pEntity->pev = &ev[ num_ents++ ]; + + pEntity->Precache(); + pEntity->Spawn(); + + if ( pWeaponOwner ) + { + ItemInfo info; + + ((CBasePlayerWeapon *)pEntity)->m_pPlayer = pWeaponOwner; + + ((CBasePlayerWeapon *)pEntity)->GetItemInfo( &info ); + + // ASSERT that a weapon with this id isn't in the list + int theNewID = info.iId; + IDListType::iterator theIter = std::find(sIDList.begin(), sIDList.end(), theNewID); + ASSERT(theIter == sIDList.end()); + + // Insert id into our list + sIDList.push_back(theNewID); + + g_pWpns[ theNewID ] = (CBasePlayerWeapon *)pEntity; + } +} + +/* +===================== +CBaseEntity :: Killed + +If weapons code "kills" an entity, just set its effects to EF_NODRAW +===================== +*/ +void CBaseEntity :: Killed( entvars_t *pevAttacker, int iGib ) +{ + pev->effects |= EF_NODRAW; +} + +/* +===================== +CBasePlayerWeapon :: DefaultReload +===================== +*/ +BOOL CBasePlayerWeapon :: DefaultReload( int iClipSize, int iAnim, float fDelay, int body ) +{ + + if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0) + return FALSE; + + int j = min(iClipSize - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]); + + if (j == 0) + return FALSE; + + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + fDelay; + + //!!UNDONE -- reload sound goes here !!! + //SendWeaponAnim( iAnim, UseDecrement(), body ); + + m_fInReload = TRUE; + + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + kDeployIdleInterval; + return TRUE; +} + +/* +===================== +CBasePlayerWeapon :: CanDeploy +===================== +*/ +BOOL CBasePlayerWeapon :: CanDeploy( void ) +{ + BOOL bHasAmmo = 0; + + if ( !pszAmmo1() ) + { + // this weapon doesn't use ammo, can always deploy. + return TRUE; + } + + if ( pszAmmo1() ) + { + bHasAmmo |= (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] != 0); + } + if ( pszAmmo2() ) + { + bHasAmmo |= (m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType] != 0); + } + if (m_iClip > 0) + { + bHasAmmo |= 1; + } + if (!bHasAmmo) + { + return FALSE; + } + + return TRUE; +} + +/* +===================== +CBasePlayerWeapon :: DefaultDeploy + +===================== +*/ +BOOL CBasePlayerWeapon :: DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal, int body ) +{ + if ( !CanDeploy() ) + return FALSE; + + gEngfuncs.CL_LoadModel( szViewModel, &m_pPlayer->pev->viewmodel ); + + SendWeaponAnim( iAnim, skiplocal, body ); + + m_pPlayer->m_flNextAttack = this->GetDeployTime(); + m_flTimeWeaponIdle = this->GetDeployTime() + kDeployIdleInterval; + return TRUE; +} + +/* +===================== +CBasePlayerWeapon :: PlayEmptySound + +===================== +*/ +BOOL CBasePlayerWeapon :: PlayEmptySound( void ) +{ + if (m_iPlayEmptySound) + { + HUD_PlaySound( "weapons/357_cock1.wav", 0.8 ); + m_iPlayEmptySound = 0; + return 0; + } + return 0; +} + +/* +===================== +CBasePlayerWeapon :: ResetEmptySound + +===================== +*/ +void CBasePlayerWeapon :: ResetEmptySound( void ) +{ + m_iPlayEmptySound = 1; +} + +/* +===================== +CBasePlayerWeapon::Holster + +Put away weapon +===================== +*/ +void CBasePlayerWeapon::Holster( int skiplocal /* = 0 */ ) +{ + m_fInReload = FALSE; // cancel any reload in progress. + m_pPlayer->pev->viewmodel = 0; +} + +/* +===================== +CBasePlayerWeapon::SendWeaponAnim + +Animate weapon model +===================== +*/ +void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body ) +{ + m_pPlayer->pev->weaponanim = iAnim; + + HUD_SendWeaponAnim( iAnim, body, 0 ); +} + +/* +===================== +CBaseEntity::FireBulletsPlayer + +Only produces random numbers to match the server ones. +===================== +*/ +Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker, int shared_rand ) +{ + //float x, y, z; + Vector theShotDirection; + + theShotDirection.x = theShotDirection.y = theShotDirection.z = 0; + +// for ( ULONG iShot = 1; iShot <= cShots; iShot++ ) +// { +// if ( pevAttacker == NULL ) +// { +// // get circular gaussian spread +// do { +// x = RANDOM_FLOAT(-0.5, 0.5) + RANDOM_FLOAT(-0.5, 0.5); +// y = RANDOM_FLOAT(-0.5, 0.5) + RANDOM_FLOAT(-0.5, 0.5); +// z = x*x+y*y; +// } while (z > 1); +// } +// else +// { +// //Use player's random seed. +// // get circular gaussian spread +// x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5, 0.5 ); +// y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5, 0.5 ); +// z = x * x + y * y; +// } +// +// UTIL_GetRandomSpreadDir(shared_rand, iShot, vecDirShooting) +// } + +// return Vector ( (float)(x * vecSpread.x), (float)(y * vecSpread.y), 0.0f ); + return theShotDirection; +} + + +bool GetCanUseWeapon() +{ + // This mirrors the functionality of AvHPlayer::GetCanUseWeapon. + return !gHUD.GetIsInTopDownMode() && !gHUD.GetIsBeingDigested() && !gHUD.GetIsEnsnared() && !gHUD.GetIsStunned() && gEngfuncs.GetViewModel() != NULL; +} + +/* +===================== +CBasePlayerWeapon::ItemPostFrame + +Handles weapon firing, reloading, etc. +===================== +*/ +void CBasePlayerWeapon::ItemPostFrame( void ) +{ + + if ((m_fInReload) && (m_pPlayer->m_flNextAttack <= 0.0)) + { +/////////////////////////////////////////////////////////////////////////////////////////////////////// +// Put code in here to predict reloads (ie, have the ammo on screen update before we get a response) // +/////////////////////////////////////////////////////////////////////////////////////////////////////// +//#if 0 // FIXME, need ammo on client to make this work right +// // complete the reload. +// int j = min( iMaxClip() - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]); +// +// // Add them to the clip +// m_iClip += j; +// m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] -= j; +//#else +// m_iClip += 10; +//#endif + m_fInReload = FALSE; + } + + if ((m_pPlayer->pev->button & IN_ATTACK2) && (m_flNextSecondaryAttack <= 0.0)) + { + if (GetCanUseWeapon()) + { + if ( pszAmmo2() && !m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] ) + { + m_fFireOnEmpty = TRUE; + } + + SecondaryAttack(); + m_pPlayer->pev->button &= ~IN_ATTACK2; + } + } + else if ( (m_pPlayer->pev->button & IN_ATTACK) && (m_flNextPrimaryAttack <= 0.0) ) + { + if (GetCanUseWeapon()) + { + if ( (m_iClip == 0 && pszAmmo1()) || + (iMaxClip() == -1 && !m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] ) ) + { + m_fFireOnEmpty = TRUE; + } + + //#ifdef AVH_CLIENT + //if((m_iClip == 0) && ? + //#endif + + PrimaryAttack(); + } + } + else if ( m_pPlayer->pev->button & IN_RELOAD && iMaxClip() != WEAPON_NOCLIP && !m_fInReload ) + { + if (GetCanUseWeapon()) + { + // reload when reload is pressed, or if no buttons are down and weapon is empty. + Reload(); + } + } + else if ( !(m_pPlayer->pev->button & (IN_ATTACK|IN_ATTACK2) ) ) + { + if (GetCanUseWeapon()) + { + + // no fire buttons down + + m_fFireOnEmpty = FALSE; + + // weapon is useable. Reload if empty and weapon has waited as long as it has to after firing + if ( m_iClip == 0 && !(iFlags() & ITEM_FLAG_NOAUTORELOAD) && m_flNextPrimaryAttack < 0.0 ) + { + // << CGC >> Only reload if we have more ammo to reload with + if(m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] > 0) + { + Reload(); + return; + } + } + + WeaponIdle( ); + } + return; + } + + // catch all + if ( ShouldWeaponIdle() ) + { + WeaponIdle(); + } +} + +/* +===================== +CBasePlayer::SelectItem + + Switch weapons +===================== +*/ +void CBasePlayer::SelectItem(const char *pstr) +{ + if (!pstr) + return; + + CBasePlayerItem *pItem = NULL; + + if (!pItem) + return; + + + if (pItem == m_pActiveItem) + return; + + if (m_pActiveItem) + m_pActiveItem->Holster( ); + + m_pLastItem = m_pActiveItem; + m_pActiveItem = pItem; + + if (m_pActiveItem) + { + m_pActiveItem->Deploy( ); + } +} + +/* +===================== +CBasePlayer::SelectLastItem + +===================== +*/ +void CBasePlayer::SelectLastItem(void) +{ + if (!m_pLastItem) + { + return; + } + + if ( m_pActiveItem && !m_pActiveItem->CanHolster() ) + { + return; + } + + if (m_pActiveItem) + m_pActiveItem->Holster( ); + + CBasePlayerItem *pTemp = m_pActiveItem; + m_pActiveItem = m_pLastItem; + m_pLastItem = pTemp; + m_pActiveItem->Deploy( ); +} + +/* +===================== +CBasePlayer::Killed + +===================== +*/ +void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib ) +{ + // Holster weapon immediately, to allow it to cleanup + if ( m_pActiveItem ) + m_pActiveItem->Holster( ); +} + +/* +===================== +CBasePlayer::Spawn + +===================== +*/ +void CBasePlayer::Spawn( void ) +{ + if (m_pActiveItem) + m_pActiveItem->Deploy( ); +} + +/* +===================== +UTIL_TraceLine + +Don't actually trace, but act like the trace didn't hit anything. +===================== +*/ +void UTIL_TraceLine( const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, edict_t *pentIgnore, TraceResult *ptr ) +{ + memset( ptr, 0, sizeof( *ptr ) ); + ptr->flFraction = 1.0; +} + +/* +===================== +UTIL_ParticleBox + +For debugging, draw a box around a player made out of particles +===================== +*/ +void UTIL_ParticleBox( CBasePlayer *player, float *mins, float *maxs, float life, unsigned char r, unsigned char g, unsigned char b ) +{ + int i; + vec3_t mmin, mmax; + + for ( i = 0; i < 3; i++ ) + { + mmin[ i ] = player->pev->origin[ i ] + mins[ i ]; + mmax[ i ] = player->pev->origin[ i ] + maxs[ i ]; + } + + gEngfuncs.pEfxAPI->R_ParticleBox( (float *)&mmin, (float *)&mmax, 5.0, 0, 255, 0 ); +} + +/* +===================== +UTIL_ParticleBoxes + +For debugging, draw boxes for other collidable players +===================== +*/ +void UTIL_ParticleBoxes( void ) +{ + int idx; + physent_t *pe; + cl_entity_t *player; + vec3_t mins, maxs; + + gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction( false, true ); + + // Store off the old count + gEngfuncs.pEventAPI->EV_PushPMStates(); + + player = gEngfuncs.GetLocalPlayer(); + // Now add in all of the players. + gEngfuncs.pEventAPI->EV_SetSolidPlayers ( player->index - 1 ); + + for ( idx = 1; idx < 100; idx++ ) + { + pe = gEngfuncs.pEventAPI->EV_GetPhysent( idx ); + if ( !pe ) + break; + + if ( pe->info >= 1 && pe->info <= gEngfuncs.GetMaxClients() ) + { + mins = pe->origin + pe->mins; + maxs = pe->origin + pe->maxs; + + gEngfuncs.pEfxAPI->R_ParticleBox( (float *)&mins, (float *)&maxs, 0, 0, 255, 2.0 ); + } + } + + gEngfuncs.pEventAPI->EV_PopPMStates(); +} + +/* +===================== +UTIL_ParticleLine + +For debugging, draw a line made out of particles +===================== +*/ +void UTIL_ParticleLine( CBasePlayer *player, float *start, float *end, float life, unsigned char r, unsigned char g, unsigned char b ) +{ + gEngfuncs.pEfxAPI->R_ParticleLine( start, end, r, g, b, life ); +} + +/* +===================== +CBasePlayerWeapon::PrintState + +For debugging, print out state variables to log file +===================== +*/ +void CBasePlayerWeapon::PrintState( void ) +{ + COM_Log( "c:\\hl.log", "%.4f ", gpGlobals->time ); + COM_Log( "c:\\hl.log", "%.4f ", m_pPlayer->m_flNextAttack ); + COM_Log( "c:\\hl.log", "%.4f ", m_flNextPrimaryAttack ); + COM_Log( "c:\\hl.log", "%.4f ", m_flTimeWeaponIdle - gpGlobals->time); + COM_Log( "c:\\hl.log", "%i ", m_iClip ); + COM_Log( "c:\\hl.log", "\r\n"); +} + +/* +===================== +HUD_InitClientWeapons + +Set up weapons, player and functions needed to run weapons code client-side. +===================== +*/ +void HUD_InitClientWeapons( void ) +{ + static int initialized = 0; + if ( initialized ) + return; + + initialized = 1; + + // Set up pointer ( dummy object ) + gpGlobals = &Globals; + + // Fill in current time ( probably not needed ) + gpGlobals->time = gEngfuncs.GetClientTime(); + + // Fake functions + g_engfuncs.pfnPrecacheModel = stub_PrecacheModel; + g_engfuncs.pfnPrecacheSound = stub_PrecacheSound; + g_engfuncs.pfnPrecacheEvent = stub_PrecacheEvent; + g_engfuncs.pfnNameForFunction = stub_NameForFunction; + g_engfuncs.pfnSetModel = stub_SetModel; + g_engfuncs.pfnSetClientMaxspeed = HUD_SetMaxSpeed; + + // Handled locally + g_engfuncs.pfnPlaybackEvent = HUD_PlaybackEvent; + g_engfuncs.pfnAlertMessage = AlertMessage; + + // Pass through to engine + g_engfuncs.pfnPrecacheEvent = gEngfuncs.pfnPrecacheEvent; + g_engfuncs.pfnRandomFloat = gEngfuncs.pfnRandomFloat; + g_engfuncs.pfnRandomLong = gEngfuncs.pfnRandomLong; + + // Allocate a slot for the local player + HUD_PrepEntity( &player , NULL ); + + + // Allocate slot(s) for each weapon that we are going to be predicting + //HUD_PrepEntity( &g_Glock, &player ); + HUD_PrepEntity( &gKnife, &player); + HUD_PrepEntity( &gMachineGun, &player); + HUD_PrepEntity( &gPistol, &player); + HUD_PrepEntity( &gSonicGun, &player); + HUD_PrepEntity( &gHeavyMachineGun, &player); + HUD_PrepEntity( &gGrenadeGun, &player); + HUD_PrepEntity( &gGrenade, &player); + HUD_PrepEntity( &gWelder, &player); + HUD_PrepEntity( &gMine, &player); + HUD_PrepEntity( &gSpitGun, &player); + HUD_PrepEntity( &gClaws, &player); + HUD_PrepEntity( &gSpores, &player); + HUD_PrepEntity( &gSpikeGun, &player); + HUD_PrepEntity( &gBite, &player); + HUD_PrepEntity( &gBite2, &player); + HUD_PrepEntity( &gSwipe, &player); + HUD_PrepEntity( &gWebSpinner, &player); + HUD_PrepEntity( &gPrimalScream, &player); + //HUD_PrepEntity( &gParalysisGun, &player); + + HUD_PrepEntity( &gBlink, &player); + HUD_PrepEntity( &gParasite, &player); + HUD_PrepEntity( &gUmbra, &player); + HUD_PrepEntity( &gDivineWind, &player); + HUD_PrepEntity( &gBileBomb, &player); + HUD_PrepEntity( &gAcidRocket, &player); + HUD_PrepEntity( &gHealingSpray, &player); + HUD_PrepEntity( &gMetabolize, &player); + HUD_PrepEntity( &gStomp, &player); + HUD_PrepEntity( &gDevour, &player); + + HUD_PrepEntity( &gLeap, &player); + HUD_PrepEntity( &gCharge, &player); + + gJetpackEventID = PRECACHE_EVENT(1, kJetpackEvent); + //gWallJumpEventID = PRECACHE_EVENT(1, kWallJumpEvent); + //gFlightEventID = PRECACHE_EVENT(1, kFlightEvent); + gTeleportEventID = PRECACHE_EVENT(1, kTeleportEvent); + gPhaseInEventID = PRECACHE_EVENT(1, kPhaseInEvent); + gSiegeHitEventID = PRECACHE_EVENT(1, kSiegeHitEvent); + gSiegeViewHitEventID = PRECACHE_EVENT(1, kSiegeViewHitEvent); + gCommanderPointsAwardedEventID = PRECACHE_EVENT(1, kCommanderPointsAwardedEvent); + gBlinkEffectSuccessEventID = PRECACHE_EVENT(1, kBlinkEffectSuccessEventName); +} + +/* +===================== +======= + HUD_PrepEntity( &g_Glock , &player ); + HUD_PrepEntity( &g_Crowbar , &player ); + HUD_PrepEntity( &g_Python , &player ); + HUD_PrepEntity( &g_Mp5 , &player ); + HUD_PrepEntity( &g_Crossbow , &player ); + HUD_PrepEntity( &g_Shotgun , &player ); + HUD_PrepEntity( &g_Rpg , &player ); + HUD_PrepEntity( &g_Gauss , &player ); + HUD_PrepEntity( &g_Egon , &player ); + HUD_PrepEntity( &g_HGun , &player ); + HUD_PrepEntity( &g_HandGren , &player ); + HUD_PrepEntity( &g_Satchel , &player ); + HUD_PrepEntity( &g_Tripmine , &player ); + HUD_PrepEntity( &g_Snark , &player ); +} + +/* +===================== +HUD_GetLastOrg + +Retruns the last position that we stored for egon beam endpoint. +===================== +*/ +void HUD_GetLastOrg( float *org ) +{ + int i; + + // Return last origin + for ( i = 0; i < 3; i++ ) + { + org[i] = previousorigin[i]; + } +} + +/* +===================== +HUD_SetLastOrg + +Remember our exact predicted origin so we can draw the egon to the right position. +===================== +*/ +void HUD_SetLastOrg( void ) +{ + int i; + + // Offset final origin by view_offset + for ( i = 0; i < 3; i++ ) + { + previousorigin[i] = g_finalstate->playerstate.origin[i] + g_finalstate->client.view_ofs[ i ]; + } +} + + +CBasePlayerWeapon* HUD_GetWeaponForID(int inID) +{ + CBasePlayerWeapon* pWeapon = NULL; + + switch(inID) + { +// case WEAPON_GLOCK: +// pWeapon = &g_Glock; +// break; + case AVH_WEAPON_KNIFE: + pWeapon = &gKnife; + break; + case AVH_WEAPON_MG: + pWeapon = &gMachineGun; + break; + case AVH_WEAPON_PISTOL: + pWeapon = &gPistol; + break; + case AVH_WEAPON_SONIC: + pWeapon = &gSonicGun; + break; + case AVH_WEAPON_HMG: + pWeapon = &gHeavyMachineGun; + break; + case AVH_WEAPON_GRENADE_GUN: + pWeapon = &gGrenadeGun; + break; + case AVH_WEAPON_GRENADE: + pWeapon = &gGrenade; + break; + case AVH_WEAPON_WELDER: + pWeapon = &gWelder; + break; + case AVH_WEAPON_MINE: + pWeapon = &gMine; + break; + case AVH_WEAPON_SPIT: + pWeapon = &gSpitGun; + break; + case AVH_WEAPON_CLAWS: + pWeapon = &gClaws; + break; + case AVH_WEAPON_SPORES: + pWeapon = &gSpores; + break; + case AVH_WEAPON_SPIKE: + pWeapon = &gSpikeGun; + break; + case AVH_WEAPON_BITE: + pWeapon = &gBite; + break; + case AVH_WEAPON_BITE2: + pWeapon = &gBite2; + break; + case AVH_WEAPON_SWIPE: + pWeapon = &gSwipe; + break; + case AVH_WEAPON_WEBSPINNER: + pWeapon = &gWebSpinner; + break; + case AVH_WEAPON_PRIMALSCREAM: + pWeapon = &gPrimalScream; + break; + case AVH_WEAPON_PARASITE: + pWeapon = &gParasite; + break; + case AVH_WEAPON_UMBRA: + pWeapon = &gUmbra; + break; + case AVH_WEAPON_BLINK: + pWeapon = &gBlink; + break; + case AVH_WEAPON_DIVINEWIND: + pWeapon = &gDivineWind; + break; +// case AVH_WEAPON_PARALYSIS: +// pWeapon = &gParalysisGun; +// break; + case AVH_WEAPON_BILEBOMB: + pWeapon = &gBileBomb; + break; + case AVH_WEAPON_ACIDROCKET: + pWeapon = &gAcidRocket; + break; + case AVH_WEAPON_HEALINGSPRAY: + pWeapon = &gHealingSpray; + break; + case AVH_WEAPON_METABOLIZE: + pWeapon = &gMetabolize; + break; + case AVH_WEAPON_STOMP: + pWeapon = &gStomp; + break; + case AVH_WEAPON_DEVOUR: + pWeapon = &gDevour; + break; + + // Abilities + case AVH_ABILITY_LEAP: + pWeapon = &gLeap; + break; + case AVH_ABILITY_CHARGE: + pWeapon = &gCharge; + break; + } + + return pWeapon; +} + + +bool HUD_GetWeaponEnabled(int inID) +{ + ASSERT(inID >= 0); + ASSERT(inID < 32); + + // puzl: 497 - use the enabled state in the associated WEAPON instead of the CBasePlayerWeapon's iuser3 + bool theWeaponEnabled = false; + CBasePlayerWeapon* theWeapon = g_pWpns[inID]; + if(theWeapon) + { + ItemInfo theItemInfo; + theWeapon->GetItemInfo(&theItemInfo); + WEAPON *pWeapon = gWR.GetWeapon( theItemInfo.iId ); + if ( pWeapon != 0 ) { + theWeaponEnabled = (pWeapon->iEnabled == 1); + } + } + + return theWeaponEnabled; +} + +/* +===================== +HUD_WeaponsPostThink + +Run Weapon firing code on client +===================== +*/ +void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cmd, double time, unsigned int random_seed ) +{ + int i; + int buttonsChanged; + CBasePlayerWeapon* pCurrent = NULL; + weapon_data_t nulldata, *pfrom, *pto; + static int lasthealth; + + memset( &nulldata, 0, sizeof( nulldata ) ); + + HUD_InitClientWeapons(); + + // Get current clock + gpGlobals->time = time; + + // Fill in data based on selected weapon + // FIXME, make this a method in each weapon? where you pass in an entity_state_t *? + // Store pointer to our destination entity_state_t so we can get our origin, etc. from it + CBasePlayerWeapon* pWeapon = HUD_GetWeaponForID(from->client.m_iId); + + // for setting up events on the client + g_finalstate = to; + + // If we are running events/etc. go ahead and see if we + // managed to die between last frame and this one + // If so, run the appropriate player killed or spawn function + if ( g_runfuncs ) + { + if ( to->client.health <= 0 && lasthealth > 0 ) + { + player.Killed( NULL, 0 ); + + } + else if ( to->client.health > 0 && lasthealth <= 0 ) + { + player.Spawn(); + } + + lasthealth = to->client.health; + } + + // We are not predicting the current weapon, just bow out here. + if ( !pWeapon ) + return; + + for ( i = 0; i < 32; i++ ) + { + pCurrent = g_pWpns[ i ]; + if ( !pCurrent ) + { + continue; + } + + pfrom = &from->weapondata[ i ]; + + pCurrent->m_fInReload = pfrom->m_fInReload; + pCurrent->m_fInSpecialReload = pfrom->m_fInSpecialReload; +// pCurrent->m_flPumpTime = pfrom->m_flPumpTime; + pCurrent->m_iClip = pfrom->m_iClip; + pCurrent->m_flNextPrimaryAttack = pfrom->m_flNextPrimaryAttack; + pCurrent->m_flNextSecondaryAttack = pfrom->m_flNextSecondaryAttack; + pCurrent->m_flTimeWeaponIdle = pfrom->m_flTimeWeaponIdle; + if(pWeapon && (pWeapon->m_iId == pfrom->m_iId)) + { + // Predict clip + gHUD.m_Ammo.SetCurrentClip(pfrom->m_iClip); + + AvHBasePlayerWeapon* theWeapon = dynamic_cast(pWeapon); + if(theWeapon) + { + gHUD.SetCurrentWeaponData(pWeapon->m_iId, theWeapon->GetEnabledState()); + } + + //gHUD.SetClientDebugCSP(pfrom, from->client.m_flNextAttack); + } + + // Tell HUD what energy level is needed to use weapon, so alien HUD can indicate this + float theEnergyLevel = 0.0f; + AvHMUGetEnergyCost((AvHWeaponID)(pWeapon->m_iId), theEnergyLevel); + gHUD.SetCurrentUseableEnergyLevel(theEnergyLevel); + +// New SDK stuff...needed? +// pCurrent->pev->fuser1 = pfrom->fuser1; + pCurrent->m_flStartThrow = pfrom->fuser2; + pCurrent->m_flReleaseThrow = pfrom->fuser3; +// pCurrent->m_chargeReady = pfrom->iuser1; +// pCurrent->m_fInAttack = pfrom->iuser2; + pCurrent->pev->iuser3 = pfrom->iuser3; + +// pCurrent->m_iSecondaryAmmoType = (int)from->client.vuser3[2]; + pCurrent->m_iPrimaryAmmoType = (int)from->client.vuser4[0]; +// player.m_rgAmmo[ pCurrent->m_iPrimaryAmmoType ] = (int)from->client.vuser4[1]; +// player.m_rgAmmo[ pCurrent->m_iSecondaryAmmoType ] = (int)from->client.vuser4[2]; + } + + // For random weapon events, use this seed to seed random # generator + player.random_seed = random_seed; + + // Get old buttons from previous state. + player.m_afButtonLast = from->playerstate.oldbuttons; + + // Which buttsons chave changed + buttonsChanged = (player.m_afButtonLast ^ cmd->buttons); // These buttons have changed this frame + + // Debounced button codes for pressed/released + // The changed ones still down are "pressed" + player.m_afButtonPressed = buttonsChanged & cmd->buttons; + // The ones not down are "released" + player.m_afButtonReleased = buttonsChanged & (~cmd->buttons); + + // Set player variables that weapons code might check/alter + player.pev->button = cmd->buttons; + + player.pev->velocity = from->client.velocity; + player.pev->flags = from->client.flags; + + player.pev->deadflag = from->client.deadflag; + player.pev->waterlevel = from->client.waterlevel; + player.pev->maxspeed = from->client.maxspeed; + player.pev->fov = from->client.fov; + player.pev->weaponanim = from->client.weaponanim; + player.pev->viewmodel = from->client.viewmodel; + player.m_flNextAttack = from->client.m_flNextAttack; + //player.m_flNextAmmoBurn = from->client.fuser2; + //player.m_flAmmoStartCharge = from->client.fuser3; + + // Removed this because NS uses vuser1 and vuser2 (and the HL weapons aren't used) + ////Stores all our ammo info, so the client side weapons can use them. + //player.ammo_9mm = (int)from->client.vuser1[0]; + //player.ammo_357 = (int)from->client.vuser1[1]; + //player.ammo_argrens = (int)from->client.vuser1[2]; + //player.ammo_bolts = (int)from->client.ammo_nails; //is an int anyways... + //player.ammo_buckshot = (int)from->client.ammo_shells; + //player.ammo_uranium = (int)from->client.ammo_cells; + //player.ammo_hornets = (int)from->client.vuser2[0]; + //player.ammo_rockets = (int)from->client.ammo_rockets; + + + // Point to current weapon object + if ( from->client.m_iId ) + { + player.m_pActiveItem = g_pWpns[ from->client.m_iId ]; + } + + if ( player.m_pActiveItem->m_iId == WEAPON_RPG ) + { + ( ( CRpg * )player.m_pActiveItem)->m_fSpotActive = (int)from->client.vuser2[ 1 ]; + ( ( CRpg * )player.m_pActiveItem)->m_cActiveRockets = (int)from->client.vuser2[ 2 ]; + } + + // Don't go firing anything if we have died. + // Or if we don't have a weapon model deployed + if ( ( player.pev->deadflag != ( DEAD_DISCARDBODY + 1 ) ) && !CL_IsDead() && player.pev->viewmodel && !g_iUser1 ) + { + + if ( player.m_flNextAttack <= 0 ) + { + pWeapon->ItemPostFrame(); + } +// if ( g_runfuncs ) +// { +// pWeapon->PrintState(); +// } + } + + // Assume that we are not going to switch weapons + to->client.m_iId = from->client.m_iId; + + // Now see if we issued a changeweapon command ( and we're not dead ) + if ( cmd->weaponselect && ( player.pev->deadflag != ( DEAD_DISCARDBODY + 1 ) ) ) + { + // Switched to a different weapon? + if ( from->weapondata[ cmd->weaponselect ].m_iId == cmd->weaponselect ) + { + ASSERT(cmd->weaponselect >= 0); + ASSERT(cmd->weaponselect < 32); + + CBasePlayerWeapon *pNew = g_pWpns[ cmd->weaponselect ]; + if ( pNew && ( pNew != pWeapon ) && player.m_pActiveItem && player.m_pActiveItem->CanHolster()) + { + // Put away old weapon + if (player.m_pActiveItem) + player.m_pActiveItem->Holster( ); + + player.m_pLastItem = player.m_pActiveItem; + player.m_pActiveItem = pNew; + + // Deploy new weapon + if (player.m_pActiveItem) + { + player.m_pActiveItem->Deploy( ); + } + + // Update weapon id so we can predict things correctly. + to->client.m_iId = cmd->weaponselect; + } + } + } + + // Copy in results of prediction code + to->client.viewmodel = player.pev->viewmodel; + to->client.fov = player.pev->fov; + to->client.weaponanim = player.pev->weaponanim; + to->client.m_flNextAttack = player.m_flNextAttack; + //to->client.fuser2 = player.m_flNextAmmoBurn; + //to->client.fuser3 = player.m_flAmmoStartCharge; + to->client.maxspeed = player.pev->maxspeed; + +// Removed this because NS uses vuser1 and vuser2 (and the HL weapons aren't used) +// //HL Weapons +// to->client.vuser1[0] = player.ammo_9mm; +// to->client.vuser1[1] = player.ammo_357; +// to->client.vuser1[2] = player.ammo_argrens; +// +// to->client.ammo_nails = player.ammo_bolts; +// to->client.ammo_shells = player.ammo_buckshot; +// to->client.ammo_cells = player.ammo_uranium; +// to->client.vuser2[0] = player.ammo_hornets; +// to->client.ammo_rockets = player.ammo_rockets; + + if ( player.m_pActiveItem->m_iId == WEAPON_RPG ) + { + from->client.vuser2[ 1 ] = ( ( CRpg * )player.m_pActiveItem)->m_fSpotActive; + from->client.vuser2[ 2 ] = ( ( CRpg * )player.m_pActiveItem)->m_cActiveRockets; + } + + // Make sure that weapon animation matches what the game .dll is telling us + // over the wire ( fixes some animation glitches ) + if ( g_runfuncs && ( HUD_GetWeaponAnim() != to->client.weaponanim ) ) + { + int body = 2; + + //Pop the model to body 0. + //if ( pWeapon == &g_Tripmine ) + // body = 0; + + // Force a fixed anim down to viewmodel + HUD_SendWeaponAnim( to->client.weaponanim, body, 1 ); + } + + for ( i = 0; i < 32; i++ ) + { + pCurrent = g_pWpns[ i ]; + + pto = &to->weapondata[ i ]; + + if ( !pCurrent ) + { + memset( pto, 0, sizeof( weapon_data_t ) ); + continue; + } + + pto->m_fInReload = pCurrent->m_fInReload; + pto->m_fInSpecialReload = pCurrent->m_fInSpecialReload; +// pto->m_flPumpTime = pCurrent->m_flPumpTime; + pto->m_iClip = pCurrent->m_iClip; + pto->m_flNextPrimaryAttack = pCurrent->m_flNextPrimaryAttack; + pto->m_flNextSecondaryAttack = pCurrent->m_flNextSecondaryAttack; + pto->m_flTimeWeaponIdle = pCurrent->m_flTimeWeaponIdle; +// pto->fuser1 = pCurrent->pev->fuser1; +// pto->fuser2 = pCurrent->m_flStartThrow; +// pto->fuser3 = pCurrent->m_flReleaseThrow; +// pto->iuser1 = pCurrent->m_chargeReady; +// pto->iuser2 = pCurrent->m_fInAttack; + pto->iuser3 = pCurrent->pev->iuser3; + + // Decrement weapon counters, server does this at same time ( during post think, after doing everything else ) + pto->m_flNextReload -= cmd->msec / 1000.0; + pto->m_fNextAimBonus -= cmd->msec / 1000.0; + pto->m_flNextPrimaryAttack -= cmd->msec / 1000.0; + pto->m_flNextSecondaryAttack -= cmd->msec / 1000.0; + pto->m_flTimeWeaponIdle -= cmd->msec / 1000.0; + pto->fuser1 -= cmd->msec / 1000.0; + + to->client.vuser3[2] = pCurrent->m_iSecondaryAmmoType; + to->client.vuser4 = pCurrent->pev->vuser4; +// to->client.vuser4[0] = pCurrent->m_iPrimaryAmmoType; +// to->client.vuser4[1] = player.m_rgAmmo[ pCurrent->m_iPrimaryAmmoType ]; +// to->client.vuser4[2] = player.m_rgAmmo[ pCurrent->m_iSecondaryAmmoType ]; + +/* if ( pto->m_flPumpTime != -9999 ) + { + pto->m_flPumpTime -= cmd->msec / 1000.0; + if ( pto->m_flPumpTime < -0.001 ) + pto->m_flPumpTime = -0.001; + }*/ + + if ( pto->m_fNextAimBonus < -1.0 ) + { + pto->m_fNextAimBonus = -1.0; + } + + if ( pto->m_flNextPrimaryAttack < -1.0 ) + { + pto->m_flNextPrimaryAttack = -1.0; + } + + if ( pto->m_flNextSecondaryAttack < -0.001 ) + { + pto->m_flNextSecondaryAttack = -0.001; + } + + if ( pto->m_flTimeWeaponIdle < -0.001 ) + { + pto->m_flTimeWeaponIdle = -0.001; + } + + if ( pto->m_flNextReload < -0.001 ) + { + pto->m_flNextReload = -0.001; + } + + if ( pto->fuser1 < -0.001 ) + { + pto->fuser1 = -0.001; + } + } + + // m_flNextAttack is now part of the weapons, but is part of the player instead + to->client.m_flNextAttack -= cmd->msec / 1000.0; + if ( to->client.m_flNextAttack < -0.001 ) + { + to->client.m_flNextAttack = -0.001; + } + + to->client.fuser2 -= cmd->msec / 1000.0; + if ( to->client.fuser2 < -0.001 ) + { + to->client.fuser2 = -0.001; + } + + to->client.fuser3 -= cmd->msec / 1000.0; + if ( to->client.fuser3 < -0.001 ) + { + to->client.fuser3 = -0.001; + } + + // Store off the last position from the predicted state. + HUD_SetLastOrg(); + + // Wipe it so we can't use it after this frame + g_finalstate = NULL; +} + + +/* +===================== +HUD_PostRunCmd + +Client calls this during prediction, after it has moved the player and updated any info changed into to-> +time is the current client clock based on prediction +cmd is the command that caused the movement, etc +runfuncs is 1 if this is the first time we've predicted this command. If so, sounds and effects should play, otherwise, they should +be ignored +===================== +*/ +void CL_DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed ) +{ + RecClPostRunCmd(from, to, cmd, runfuncs, time, random_seed); + + g_runfuncs = runfuncs; + +#if defined( CLIENT_WEAPONS ) + +// if(from->client.m_iId != WEAPON_GLOCK) +// { +// int a = 0; +// } + + if ( cl_lw && cl_lw->value ) + { + HUD_WeaponsPostThink( from, to, cmd, time, random_seed ); + } + else +#endif + { + to->client.fov = g_lastFOV; + } + + // Check to see whether too play local jetpack effects + if(runfuncs) + { + static sLastTime = 0; + float theTimePassed = time - sLastTime; + + //CheckJetpack(); + + //UpdateJetpackLights(); + + sLastTime = time; + } + + // All games can use FOV state + g_lastFOV = to->client.fov; +} + + + diff --git a/main/source/cl_dll/hud.cpp b/main/source/cl_dll/hud.cpp new file mode 100644 index 00000000..81a0e5fb --- /dev/null +++ b/main/source/cl_dll/hud.cpp @@ -0,0 +1,736 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// hud.cpp +// +// implementation of CHud class +// + +#include "hud.h" +#include "cl_util.h" +#include +#include +#include "parsemsg.h" +#include "hud_servers.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_int.h" + +#include "demo.h" +#include "demo_api.h" +#include "ui/UIComponent.h" +#include "vgui_scorepanel.h" + +#include "mod/ChatPanel.h" + +class CHLVoiceStatusHelper : public IVoiceStatusHelper +{ +public: + virtual void GetPlayerTextColor(int entindex, int color[3]) + { + color[0] = color[1] = color[2] = 255; + + if( entindex >= 0 && entindex < sizeof(g_PlayerExtraInfo)/sizeof(g_PlayerExtraInfo[0]) ) + { + int iTeam = g_PlayerExtraInfo[entindex].teamnumber; + + if ( iTeam < 0 ) + { + iTeam = 0; + } + + iTeam = iTeam % iNumberOfTeamColors; + + color[0] = kTeamColors[iTeam][0]; + color[1] = kTeamColors[iTeam][1]; + color[2] = kTeamColors[iTeam][2]; + + // Draw commander voice differently + short thePlayerClass = g_PlayerExtraInfo[entindex].playerclass; + switch(thePlayerClass) + { + case PLAYERCLASS_COMMANDER: + color[0] = color[1] = color[2] = 255; + break; + } + } + } + + virtual void UpdateCursorState() + { + gViewPort->UpdateCursorState(); + } + + virtual int GetAckIconHeight() + { + return ScreenHeight() - gHUD.m_iFontHeight*3 - 6; + } + + virtual bool CanShowSpeakerLabels() + { + if( gViewPort && gViewPort->m_pScoreBoard ) + return !gViewPort->m_pScoreBoard->isVisible(); + else + return false; + } +}; +static CHLVoiceStatusHelper g_VoiceStatusHelper; + + +extern client_sprite_t *GetSpriteList(client_sprite_t *pList, const char *psz, int iRes, int iCount); +//CImageLabel* gTestLabel = NULL; +//extern Label* gTestLabel; + +extern cvar_t *sensitivity; +cvar_t *cl_lw = NULL; + +void ShutdownInput (void); + +//DECLARE_MESSAGE(m_Logo, Logo) +int __MsgFunc_Logo(const char *pszName, int iSize, void *pbuf) +{ + return gHUD.MsgFunc_Logo(pszName, iSize, pbuf ); +} + +//DECLARE_MESSAGE(m_Logo, Logo) +int __MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf) +{ + return gHUD.MsgFunc_ResetHUD(pszName, iSize, pbuf ); +} + +int __MsgFunc_InitHUD(const char *pszName, int iSize, void *pbuf) +{ + gHUD.MsgFunc_InitHUD( pszName, iSize, pbuf ); + return 1; +} + +int __MsgFunc_ViewMode(const char *pszName, int iSize, void *pbuf) +{ + gHUD.MsgFunc_ViewMode( pszName, iSize, pbuf ); + return 1; +} + +int __MsgFunc_SetFOV(const char *pszName, int iSize, void *pbuf) +{ + return gHUD.MsgFunc_SetFOV( pszName, iSize, pbuf ); +} + +int __MsgFunc_Concuss(const char *pszName, int iSize, void *pbuf) +{ + return gHUD.MsgFunc_Concuss( pszName, iSize, pbuf ); +} + +int __MsgFunc_GameMode(const char *pszName, int iSize, void *pbuf ) +{ + return gHUD.MsgFunc_GameMode( pszName, iSize, pbuf ); +} + +// TFFree Command Menu +void __CmdFunc_OpenCommandMenu(void) +{ + if ( gViewPort ) + { + gViewPort->ShowCommandMenu(gViewPort->m_StandardMenu); + } +} + +// TFC "special" command +void __CmdFunc_InputPlayerSpecial(void) +{ + if ( gViewPort ) + { + gViewPort->InputPlayerSpecial(); + } +} + +void __CmdFunc_CloseCommandMenu(void) +{ + if ( gViewPort ) + { + gViewPort->InputSignalHideCommandMenu(); + } +} + +void __CmdFunc_ForceCloseCommandMenu( void ) +{ + if ( gViewPort ) + { + gViewPort->HideCommandMenu(); + } +} + +void __CmdFunc_ToggleServerBrowser( void ) +{ + if ( gViewPort ) + { + gViewPort->ToggleServerBrowser(); + } +} + +void __CmdFunc_NSMessageMode(void) +{ + if(gEngfuncs.Cmd_Argc() >= 2) + { + if(gViewPort) + { + ChatPanel *theChatPanel = gViewPort->GetChatPanel(); + + if(theChatPanel) + { + theChatPanel->setVisible(true); + theChatPanel->requestFocus(); + theChatPanel->SetChatMode( (string)gEngfuncs.Cmd_Argv(1) ); + } + } + } +} + +void __CmdFunc_SpecialDummy(void) +{ + return; +} + +// TFFree Command Menu Message Handlers +int __MsgFunc_ValClass(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_ValClass( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_TeamNames(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_TeamNames( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_Feign(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_Feign( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_Detpack(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_Detpack( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_VGUIMenu(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_VGUIMenu( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_MOTD(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_MOTD( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_BuildSt(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_BuildSt( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_RandomPC(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_RandomPC( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_ServerName(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_ServerName( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_ScoreInfo(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_ScoreInfo( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_TeamScore(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_TeamScore( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_TeamInfo(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_TeamInfo( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_Spectator(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_Spectator( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_AllowSpec(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_AllowSpec( pszName, iSize, pbuf ); + return 0; +} + +// This is called every time the DLL is loaded +void CHud :: Init( void ) +{ + HOOK_MESSAGE( Logo ); + HOOK_MESSAGE( ResetHUD ); + HOOK_MESSAGE( GameMode ); + HOOK_MESSAGE( InitHUD ); + HOOK_MESSAGE( ViewMode ); + HOOK_MESSAGE( SetFOV ); + HOOK_MESSAGE( Concuss ); + + // TFFree CommandMenu + HOOK_COMMAND( "+commandmenu", OpenCommandMenu ); + HOOK_COMMAND( "-commandmenu", CloseCommandMenu ); + HOOK_COMMAND( "ForceCloseCommandMenu", ForceCloseCommandMenu ); + HOOK_COMMAND( "special", InputPlayerSpecial ); + HOOK_COMMAND( "togglebrowser", ToggleServerBrowser ); + HOOK_COMMAND( "nsmessagemode", NSMessageMode); + HOOK_COMMAND( "_special", SpecialDummy); + + + HOOK_MESSAGE( ValClass ); + HOOK_MESSAGE( TeamNames ); + HOOK_MESSAGE( Feign ); + HOOK_MESSAGE( Detpack ); + HOOK_MESSAGE( MOTD ); + HOOK_MESSAGE( BuildSt ); + HOOK_MESSAGE( RandomPC ); + HOOK_MESSAGE( ServerName ); + HOOK_MESSAGE( ScoreInfo ); + HOOK_MESSAGE( TeamScore ); + HOOK_MESSAGE( TeamInfo ); + + HOOK_MESSAGE( Spectator ); + HOOK_MESSAGE( AllowSpec ); + + // VGUI Menus + HOOK_MESSAGE( VGUIMenu ); + + CVAR_CREATE( "hud_classautokill", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); // controls whether or not to suicide immediately on TF class switch + CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round + +#ifdef DEBUG + CVAR_CREATE( "hud_hideview", "0", FCVAR_ARCHIVE ); +#endif + + m_iLogo = 0; + m_iFOV = 0; + + CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); + default_fov = CVAR_CREATE( "default_fov", "90", 0 ); + m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); + m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); + cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); + + CVAR_CREATE( "cl_showspeed", "0", 0); + + m_pSpriteList = NULL; + + // Clear any old HUD list + if ( m_pHudList ) + { + HUDLIST *pList; + while ( m_pHudList ) + { + pList = m_pHudList; + m_pHudList = m_pHudList->pNext; + free( pList ); + } + m_pHudList = NULL; + } + + // In case we get messages before the first update -- time will be valid + m_flTime = 1.0; + + m_Ammo.Init(); + m_Health.Init(); + m_Spectator.Init(); + m_SayText.Init(); + m_Geiger.Init(); + m_Train.Init(); + m_Battery.Init(); + m_Flash.Init(); + m_Message.Init(); + m_StatusBar.Init(); + m_DeathNotice.Init(); + m_AmmoSecondary.Init(); + m_TextMessage.Init(); + m_StatusIcons.Init(); + + m_Spectator.m_chatEnabled = (m_SayText.m_HUD_saytext->value!=0); + + GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort); + + m_Menu.Init(); + + ServersInit(); + + MsgFunc_ResetHUD(0, 0, NULL ); +} + +// CHud destructor +// cleans up memory allocated for m_rg* arrays +CHud :: ~CHud() +{ + delete [] m_rghSprites; + delete [] m_rgrcRects; + delete [] m_rgszSpriteNames; + + if ( m_pHudList ) + { + HUDLIST *pList; + while ( m_pHudList ) + { + pList = m_pHudList; + m_pHudList = m_pHudList->pNext; + free( pList ); + } + m_pHudList = NULL; + } + + ServersShutdown(); +} + +// GetSpriteIndex() +// searches through the sprite list loaded from hud.txt for a name matching SpriteName +// returns an index into the gHUD.m_rghSprites[] array +// returns 0 if sprite not found +int CHud :: GetSpriteIndex( const char *SpriteName ) +{ + // look through the loaded sprite name list for SpriteName + for ( int i = 0; i < m_iSpriteCount; i++ ) + { + if ( strncmp( SpriteName, m_rgszSpriteNames + (i * MAX_SPRITE_NAME_LENGTH), MAX_SPRITE_NAME_LENGTH ) == 0 ) + return i; + } + + return -1; // invalid sprite +} + +void CHud :: VidInit( void ) +{ + m_scrinfo.iSize = sizeof(m_scrinfo); + GetScreenInfo(&m_scrinfo); + + // The NS viewport isn't set up yet + int theViewPort[4]; + theViewPort[0] = theViewPort[1] = 0; + theViewPort[2] = this->m_scrinfo.iWidth; + theViewPort[3] = this->m_scrinfo.iHeight; + + gHUD.SetViewport(theViewPort); + + mFont.Load("sprites/font_arial"); + mSmallFont.Load("sprites/font_arialsmall"); + + // ---------- + // Load Sprites + // --------- +// m_hsprFont = LoadSprite("sprites/%d_font.spr"); + + m_hsprLogo = 0; + m_hsprCursor = 0; + + if (ScreenWidth() < 640) + m_iRes = 320; + else + m_iRes = 640; + + // Only load this once + if ( !m_pSpriteList ) + { + // we need to load the hud.txt, and all sprites within + m_pSpriteList = SPR_GetList("sprites/hud.txt", &m_iSpriteCountAllRes); + + if (m_pSpriteList) + { + // count the number of sprites of the appropriate res + m_iSpriteCount = 0; + client_sprite_t *p = m_pSpriteList; + for ( int j = 0; j < m_iSpriteCountAllRes; j++ ) + { + if ( p->iRes == m_iRes ) + m_iSpriteCount++; + p++; + } + + // allocated memory for sprite handle arrays + m_rghSprites = new HSPRITE[m_iSpriteCount]; + m_rgrcRects = new wrect_t[m_iSpriteCount]; + m_rgszSpriteNames = new char[m_iSpriteCount * MAX_SPRITE_NAME_LENGTH]; + + p = m_pSpriteList; + int index = 0; + for ( j = 0; j < m_iSpriteCountAllRes; j++ ) + { + if ( p->iRes == m_iRes ) + { + char sz[256]; + sprintf(sz, "sprites/%s.spr", p->szSprite); + m_rghSprites[index] = Safe_SPR_Load(sz); + m_rgrcRects[index] = p->rc; + strncpy( &m_rgszSpriteNames[index * MAX_SPRITE_NAME_LENGTH], p->szName, MAX_SPRITE_NAME_LENGTH ); + + index++; + } + + p++; + } + } + } + else + { + // we have already have loaded the sprite reference from hud.txt, but + // we need to make sure all the sprites have been loaded (we've gone through a transition, or loaded a save game) + client_sprite_t *p = m_pSpriteList; + int index = 0; + for ( int j = 0; j < m_iSpriteCountAllRes; j++ ) + { + if ( p->iRes == m_iRes ) + { + char sz[256]; + sprintf( sz, "sprites/%s.spr", p->szSprite ); + m_rghSprites[index] = Safe_SPR_Load(sz); + index++; + } + + p++; + } + } + + // assumption: number_1, number_2, etc, are all listed and loaded sequentially + m_HUD_number_0 = GetSpriteIndex( "number_0" ); + + m_iFontHeight = m_rgrcRects[m_HUD_number_0].bottom - m_rgrcRects[m_HUD_number_0].top; + + m_Ammo.VidInit(); + m_Health.VidInit(); + m_Spectator.VidInit(); + m_Geiger.VidInit(); + m_Train.VidInit(); + m_Battery.VidInit(); + m_Flash.VidInit(); + m_Message.VidInit(); + m_StatusBar.VidInit(); + m_DeathNotice.VidInit(); + m_SayText.VidInit(); + m_Menu.VidInit(); + m_AmmoSecondary.VidInit(); + m_TextMessage.VidInit(); + m_StatusIcons.VidInit(); + GetClientVoiceMgr()->VidInit(); +} + +int CHud::MsgFunc_Logo(const char *pszName, int iSize, void *pbuf) +{ + BEGIN_READ( pbuf, iSize ); + + // update Train data + m_iLogo = READ_BYTE(); + + return 1; +} + +float g_lastFOV = 0.0; + +/* +============ +COM_FileBase +============ +*/ +// Extracts the base name of a file (no path, no extension, assumes '/' as path separator) +void COM_FileBase ( const char *in, char *out) +{ + int len, start, end; + + len = strlen( in ); + + // scan backward for '.' + end = len - 1; + while ( end && in[end] != '.' && in[end] != '/' && in[end] != '\\' ) + end--; + + if ( in[end] != '.' ) // no '.', copy to end + end = len-1; + else + end--; // Found ',', copy to left of '.' + + + // Scan backward for '/' + start = len-1; + while ( start >= 0 && in[start] != '/' && in[start] != '\\' ) + start--; + + if ( in[start] != '/' && in[start] != '\\' ) + start = 0; + else + start++; + + // Length of new sting + len = end - start + 1; + + // Copy partial string + strncpy( out, &in[start], len ); + // Terminate it + out[len] = 0; +} + +/* +================= +HUD_IsGame + +================= +*/ +int HUD_IsGame( const char *game ) +{ + const char *gamedir; + char gd[ 1024 ]; + + gamedir = gEngfuncs.pfnGetGameDirectory(); + if ( gamedir && gamedir[0] ) + { + COM_FileBase( gamedir, gd ); + if ( !stricmp( gd, game ) ) + return 1; + } + return 0; +} + +/* +===================== +HUD_GetFOV + +Returns last FOV +===================== +*/ +float HUD_GetFOV( void ) +{ + if ( gEngfuncs.pDemoAPI->IsRecording() ) + { + // Write it + int i = 0; + unsigned char buf[ 100 ]; + + // Active + *( float * )&buf[ i ] = g_lastFOV; + i += sizeof( float ); + + Demo_WriteBuffer( TYPE_ZOOM, i, buf ); + } + + if ( gEngfuncs.pDemoAPI->IsPlayingback() ) + { + g_lastFOV = g_demozoom; + } + return g_lastFOV; +} + +int CHud::MsgFunc_SetFOV(const char *pszName, int iSize, void *pbuf) +{ + BEGIN_READ( pbuf, iSize ); + + int newfov = READ_BYTE(); + int def_fov = CVAR_GET_FLOAT( "default_fov" ); + + //Weapon prediction already takes care of changing the fog. ( g_lastFOV ). + if ( cl_lw && cl_lw->value ) + return 1; + + g_lastFOV = newfov; + + if ( newfov == 0 ) + { + m_iFOV = def_fov; + } + else + { + m_iFOV = newfov; + } + + // the clients fov is actually set in the client data update section of the hud + + // Set a new sensitivity + if ( m_iFOV == def_fov ) + { + // reset to saved sensitivity + m_flMouseSensitivity = 0; + } + else + { + // set a new sensitivity that is proportional to the change from the FOV default + m_flMouseSensitivity = sensitivity->value * ((float)newfov / (float)def_fov) * CVAR_GET_FLOAT("zoom_sensitivity_ratio"); + } + + return 1; +} + + +void CHud::AddHudElem(CHudBase *phudelem) +{ + HUDLIST *pdl, *ptemp; + +//phudelem->Think(); + + if (!phudelem) + return; + + pdl = (HUDLIST *)malloc(sizeof(HUDLIST)); + if (!pdl) + return; + + memset(pdl, 0, sizeof(HUDLIST)); + pdl->p = phudelem; + + if (!m_pHudList) + { + m_pHudList = pdl; + return; + } + + ptemp = m_pHudList; + + while (ptemp->pNext) + ptemp = ptemp->pNext; + + ptemp->pNext = pdl; +} + +float CHud::GetSensitivity( void ) +{ + return m_flMouseSensitivity; +} + + diff --git a/main/source/cl_dll/hud.h b/main/source/cl_dll/hud.h new file mode 100644 index 00000000..3cb759d4 --- /dev/null +++ b/main/source/cl_dll/hud.h @@ -0,0 +1,86 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// hud.h +// +// class CHud declaration +// +// CHud handles the message, calculation, and drawing the HUD +// + +#ifndef HL_HUD_H +#define HL_HUD_H + +#include "CHud.h" + +class TeamFortressViewport; + +class AvHHud; +#include "mod/AvHHud.h" +extern AvHHud gHUD; + +#include "wrect.h" +#include "cl_dll.h" +#include "ammo.h" +#include "cl_dll/chudmisc.h" + +#include "..\game_shared\voice_status.h" +#include "hud_spectator.h" + +/* +class CHudScoreboard: public CHudBase +{ +public: + int Init( void ); + void InitHUDData( void ); + int VidInit( void ); + int Draw( float flTime ); + int DrawPlayers( int xoffset, float listslot, int nameoffset = 0, char *team = NULL ); // returns the ypos where it finishes drawing + void UserCmd_ShowScores( void ); + void UserCmd_HideScores( void ); + int MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamScore( const char *pszName, int iSize, void *pbuf ); + void DeathMsg( int killer, int victim ); + + int m_iNumTeams; + + int m_iLastKilledBy; + int m_fLastKillTime; + int m_iPlayerNum; + int m_iShowscoresHeld; + + void GetAllPlayersInfo( void ); +private: + struct cvar_s *cl_showpacketloss; + +}; +*/ + +// +//----------------------------------------------------- +// + +#include "cl_dll/chud.h" + +extern TeamFortressViewport *gViewPort; + +extern int g_iPlayerClass; +extern int g_iTeamNumber; +extern int g_iUser1; +extern int g_iUser2; +extern int g_iUser3; + +#endif diff --git a/main/source/cl_dll/hud_iface.h b/main/source/cl_dll/hud_iface.h new file mode 100644 index 00000000..eb232271 --- /dev/null +++ b/main/source/cl_dll/hud_iface.h @@ -0,0 +1,12 @@ +#if !defined( HUD_IFACEH ) +#define HUD_IFACEH +#pragma once + +#define EXPORT _declspec( dllexport ) + +typedef int (*pfnUserMsgHook)(const char *pszName, int iSize, void *pbuf); +#include "wrect.h" +#include "../engine/cdll_int.h" +extern cl_enginefunc_t gEngfuncs; + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/hud_msg.cpp b/main/source/cl_dll/hud_msg.cpp new file mode 100644 index 00000000..ebdea784 --- /dev/null +++ b/main/source/cl_dll/hud_msg.cpp @@ -0,0 +1,123 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// hud_msg.cpp +// + +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" +#include "r_efx.h" + +#define MAX_CLIENTS 32 + +#if !defined( _TFC ) +extern BEAM *pBeam; +extern BEAM *pBeam2; +#endif +/// USER-DEFINED SERVER MESSAGE HANDLERS + +int CHud :: MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf ) +{ + /* <<< cgc >>> Removed this, the receiving message is expecting a size of zero and is asserting. Why was this broken, I didn't change it? >>> */ + /*ASSERT( iSize == 0 );*/ + int theByteRead = READ_BYTE(); + + // clear all hud data + HUDLIST *pList = m_pHudList; + + while ( pList ) + { + if ( pList->p ) + pList->p->Reset(); + pList = pList->pNext; + } + + // reset sensitivity + m_flMouseSensitivity = 0; + + // reset concussion effect + m_iConcussionEffect = 0; + + return 1; +} + +void CAM_ToFirstPerson(void); +void CHud :: MsgFunc_ViewMode( const char *pszName, int iSize, void *pbuf ) +{ + CAM_ToFirstPerson(); +} + +void CHud :: MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf ) +{ + // prepare all hud data + HUDLIST *pList = m_pHudList; + + while (pList) + { + if ( pList->p ) + pList->p->InitHUDData(); + pList = pList->pNext; + } +#if !defined( _TFC ) + //Probably not a good place to put this. + pBeam = pBeam2 = NULL; +#endif +} + + +int CHud :: MsgFunc_GameMode(const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + m_Teamplay = READ_BYTE(); + + return 1; +} + + +int CHud :: MsgFunc_Damage(const char *pszName, int iSize, void *pbuf ) +{ + int armor, blood; + Vector from; + int i; + float count; + + BEGIN_READ( pbuf, iSize ); + armor = READ_BYTE(); + blood = READ_BYTE(); + + for (i=0 ; i<3 ; i++) + from[i] = READ_COORD(); + + count = (blood * 0.5) + (armor * 0.5); + + if (count < 10) + count = 10; + + // TODO: kick viewangles, show damage visually + + return 1; +} + +int CHud :: MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + m_iConcussionEffect = READ_BYTE(); + if (m_iConcussionEffect) + this->m_StatusIcons.EnableIcon("dmg_concuss",255,160,0); + else + this->m_StatusIcons.DisableIcon("dmg_concuss"); + return 1; +} diff --git a/main/source/cl_dll/hud_redraw.cpp b/main/source/cl_dll/hud_redraw.cpp new file mode 100644 index 00000000..a768562f --- /dev/null +++ b/main/source/cl_dll/hud_redraw.cpp @@ -0,0 +1,411 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// hud_redraw.cpp +// +#include +#include "hud.h" +#include "cl_util.h" +#include "mod/AvHFont.h" + +#include "vgui_TeamFortressViewport.h" + +#define MAX_LOGO_FRAMES 56 + +int grgLogoFrame[MAX_LOGO_FRAMES] = +{ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13, 13, 12, 11, 10, 9, 8, 14, 15, + 16, 17, 18, 19, 20, 20, 20, 20, 20, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 29, 29, 29, 29, 29, 28, 27, 26, 25, 24, 30, 31 +}; + + +extern int g_iVisibleMouse; + +float HUD_GetFOV( void ); + +extern cvar_t *sensitivity; +extern cvar_t *cl_forcedefaultfov; + +// Think +void CHud::Think(void) +{ + int newfov; + HUDLIST *pList = m_pHudList; + + while (pList) + { + if (pList->p->m_iFlags & HUD_ACTIVE) + pList->p->Think(); + pList = pList->pNext; + } + + newfov = HUD_GetFOV(); + if ( newfov == 0 ) + { + m_iFOV = default_fov->value; + } + else + { + m_iFOV = newfov; + } + + if(cl_forcedefaultfov->value) + { + m_iFOV = 90; + } + + // the clients fov is actually set in the client data update section of the hud + + // Set a new sensitivity + if ( m_iFOV == default_fov->value ) + { + // reset to saved sensitivity + m_flMouseSensitivity = 0; + } + else + { + // set a new sensitivity that is proportional to the change from the FOV default + m_flMouseSensitivity = sensitivity->value * ((float)newfov / (float)default_fov->value) * CVAR_GET_FLOAT("zoom_sensitivity_ratio"); + } + + // think about default fov + if ( m_iFOV == 0 ) + { // only let players adjust up in fov, and only if they are not overriden by something else + m_iFOV = max( default_fov->value, 90 ); + } +} + +// Redraw +// step through the local data, placing the appropriate graphics & text as appropriate +// returns 1 if they've changed, 0 otherwise +int CHud :: Redraw( float flTime, int intermission ) +{ + m_fOldTime = m_flTime; // save time of previous redraw + m_flTime = flTime; + m_flTimeDelta = (double)m_flTime - m_fOldTime; + static m_flShotTime = 0; + + // Clock was reset, reset delta + if ( m_flTimeDelta < 0 ) + m_flTimeDelta = 0; + + // Bring up the scoreboard during intermission + if (gViewPort) + { + if ( m_iIntermission && !intermission ) + { + // Have to do this here so the scoreboard goes away + m_iIntermission = intermission; + gViewPort->HideCommandMenu(); + gViewPort->HideScoreBoard(); + gViewPort->UpdateSpectatorPanel(); + } + else if ( !m_iIntermission && intermission ) + { + m_iIntermission = intermission; + gViewPort->HideCommandMenu(); + gViewPort->HideVGUIMenu(); + gViewPort->ShowScoreBoard(); + gViewPort->UpdateSpectatorPanel(); + + // Take a screenshot if the client's got the cvar set + if ( CVAR_GET_FLOAT( "hud_takesshots" ) != 0 ) + m_flShotTime = flTime + 1.0; // Take a screenshot in a second + } + } + + if (m_flShotTime && m_flShotTime < flTime) + { + gEngfuncs.pfnClientCmd("snapshot\n"); + m_flShotTime = 0; + } + + m_iIntermission = intermission; + + // if no redrawing is necessary + // return 0; + + + if ( m_pCvarDraw->value) + { + HUDLIST *pList = m_pHudList; + + while (pList) + { + if ( !intermission ) + { + if ( (pList->p->m_iFlags & HUD_ACTIVE) && (!(m_iHideHUDDisplay & HIDEHUD_CHAT) && !(m_iHideHUDDisplay & HIDEHUD_ALL)) ) + pList->p->Draw(flTime); + } + else + { // it's an intermission, so only draw hud elements that are set to draw during intermissions + if ( pList->p->m_iFlags & HUD_INTERMISSION ) + pList->p->Draw( flTime ); + } + + pList = pList->pNext; + } + } + + // are we in demo mode? do we need to draw the logo in the top corner? + if (m_iLogo) + { + int x, y, i; + + if (m_hsprLogo == 0) + m_hsprLogo = LoadSprite("sprites/%d_logo.spr"); + + SPR_Set(m_hsprLogo, 250, 250, 250 ); + + x = SPR_Width(m_hsprLogo, 0); + x = ScreenWidth() - x; + y = SPR_Height(m_hsprLogo, 0)/2; + + // Draw the logo at 20 fps + int iFrame = (int)(flTime * 20) % MAX_LOGO_FRAMES; + i = grgLogoFrame[iFrame] - 1; + + SPR_DrawAdditive(i, x, y, NULL); + } + + /* + if ( g_iVisibleMouse ) + { + void IN_GetMousePos( int *mx, int *my ); + int mx, my; + + IN_GetMousePos( &mx, &my ); + + if (m_hsprCursor == 0) + { + char sz[256]; + sprintf( sz, "sprites/cursor.spr" ); + m_hsprCursor = SPR_Load( sz ); + } + + SPR_Set(m_hsprCursor, 250, 250, 250 ); + + // Draw the logo at 20 fps + SPR_DrawAdditive( 0, mx, my, NULL ); + } + */ + + return 1; +} + +void ScaleColors( int &r, int &g, int &b, int a ) +{ + float x = (float)a / 255; + r = (int)(r * x); + g = (int)(g * x); + b = (int)(b * x); +} + +int CHud::GetHudStringHeight() +{ + + /* + int theHeight = 0; + theHeight = gHUD.m_scrinfo.iCharHeight; + return theHeight; + */ + + return mFont.GetStringHeight(); + +} + +int CHud::GetHudStringWidth(const char* szIt) +{ + /* + int theWidth = 0; + + // draw the string until we hit the null character or a newline character + for ( ; *szIt != 0 && *szIt != '\n'; szIt++ ) + { + theWidth += gHUD.m_scrinfo.charWidths[ *szIt ]; + } + + return theWidth; + */ + + return mFont.GetStringWidth(szIt); + +} + +int CHud::DrawHudStringCentered(int x, int y, int iMaxX, const char *szString, int r, int g, int b ) +{ + int theStringWidth = this->GetHudStringWidth(szString); + return this->DrawHudString(x - theStringWidth/2, y, iMaxX, szString, r, g, b); +} + +int CHud :: DrawHudString(int xpos, int ypos, int iMaxX, const char *szIt, int r, int g, int b ) +{ + /* + // Try to prevent software-mode crash + int theStringHeight = this->GetHudStringHeight(); + + if((ypos + theStringHeight) < ScreenHeight()) + { + // draw the string until we hit the null character or a newline character + for ( ; *szIt != 0 && *szIt != '\n'; szIt++ ) + { + int next = xpos + gHUD.m_scrinfo.charWidths[ *szIt ]; // variable-width fonts look cool + if ( next > iMaxX ) + return xpos; + + TextMessageDrawChar( xpos, ypos, *szIt, r, g, b ); + xpos = next; + } + } + + return xpos; + */ + + return mFont.DrawString(xpos, ypos, szIt, r, g, b); + +} + +int CHud :: DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int r, int g, int b ) +{ + char szString[32]; + sprintf( szString, "%d", iNumber ); + return DrawHudStringReverse( xpos, ypos, iMinX, szString, r, g, b ); + +} + +// draws a string from right to left (right-aligned) +int CHud :: DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b ) +{ + + /* + // find the end of the string + for ( char *szIt = szString; *szIt != 0; szIt++ ) + { // we should count the length? + } + + // iterate throug the string in reverse + for ( szIt--; szIt != (szString-1); szIt-- ) + { + int next = xpos - gHUD.m_scrinfo.charWidths[ *szIt ]; // variable-width fonts look cool + if ( next < iMinX ) + return xpos; + xpos = next; + + TextMessageDrawChar( xpos, ypos, *szIt, r, g, b ); + } + + return xpos; + */ + + return mFont.DrawStringReverse(xpos, ypos, szString, r, g, b); + +} + +int CHud :: DrawHudNumber( int x, int y, int iFlags, int iNumber, int r, int g, int b) +{ + int iWidth = GetSpriteRect(m_HUD_number_0).right - GetSpriteRect(m_HUD_number_0).left; + int k; + + if (iNumber > 0) + { + // SPR_Draw 100's + if (iNumber >= 100) + { + k = iNumber/100; + SPR_Set(GetSprite(m_HUD_number_0 + k), r, g, b ); + SPR_DrawAdditive( 0, x, y, &GetSpriteRect(m_HUD_number_0 + k)); + x += iWidth; + } + else if (iFlags & (DHN_3DIGITS)) + { + //SPR_DrawAdditive( 0, x, y, &rc ); + x += iWidth; + } + + // SPR_Draw 10's + if (iNumber >= 10) + { + k = (iNumber % 100)/10; + SPR_Set(GetSprite(m_HUD_number_0 + k), r, g, b ); + SPR_DrawAdditive( 0, x, y, &GetSpriteRect(m_HUD_number_0 + k)); + x += iWidth; + } + else if (iFlags & (DHN_3DIGITS | DHN_2DIGITS)) + { + //SPR_DrawAdditive( 0, x, y, &rc ); + x += iWidth; + } + + // SPR_Draw ones + k = iNumber % 10; + SPR_Set(GetSprite(m_HUD_number_0 + k), r, g, b ); + SPR_DrawAdditive(0, x, y, &GetSpriteRect(m_HUD_number_0 + k)); + x += iWidth; + } + else if (iFlags & DHN_DRAWZERO) + { + SPR_Set(GetSprite(m_HUD_number_0), r, g, b ); + + // SPR_Draw 100's + if (iFlags & (DHN_3DIGITS)) + { + //SPR_DrawAdditive( 0, x, y, &rc ); + x += iWidth; + } + + if (iFlags & (DHN_3DIGITS | DHN_2DIGITS)) + { + //SPR_DrawAdditive( 0, x, y, &rc ); + x += iWidth; + } + + // SPR_Draw ones + + SPR_DrawAdditive( 0, x, y, &GetSpriteRect(m_HUD_number_0)); + x += iWidth; + } + + return x; +} + + +int CHud::GetNumWidth( int iNumber, int iFlags ) +{ + if (iFlags & (DHN_3DIGITS)) + return 3; + + if (iFlags & (DHN_2DIGITS)) + return 2; + + if (iNumber <= 0) + { + if (iFlags & (DHN_DRAWZERO)) + return 1; + else + return 0; + } + + if (iNumber < 10) + return 1; + + if (iNumber < 100) + return 2; + + return 3; + +} + + diff --git a/main/source/cl_dll/hud_servers.cpp b/main/source/cl_dll/hud_servers.cpp new file mode 100644 index 00000000..c3c64da3 --- /dev/null +++ b/main/source/cl_dll/hud_servers.cpp @@ -0,0 +1,1223 @@ +// hud_servers.cpp +#include "hud.h" +#include "cl_util.h" +#include "hud_servers_priv.h" +#include "hud_servers.h" +#include "net_api.h" +#include +#include + +static int context_id; + +// Default master server address in case we can't read any from woncomm.lst file +#define VALVE_MASTER_ADDRESS "half-life.east.won.net" +#define PORT_MASTER 27010 +#define PORT_SERVER 27015 + +// File where we really should look for master servers +#define MASTER_PARSE_FILE "woncomm.lst" + +#define MAX_QUERIES 20 + +#define NET_API gEngfuncs.pNetAPI + +static CHudServers *g_pServers = NULL; + +/* +=================== +ListResponse + +Callback from engine +=================== +*/ +void NET_CALLBACK ListResponse( struct net_response_s *response ) +{ + if ( g_pServers ) + { + g_pServers->ListResponse( response ); + } +} + +/* +=================== +ServerResponse + +Callback from engine +=================== +*/ +void NET_CALLBACK ServerResponse( struct net_response_s *response ) +{ + if ( g_pServers ) + { + g_pServers->ServerResponse( response ); + } +} + +/* +=================== +PingResponse + +Callback from engine +=================== +*/ +void NET_CALLBACK PingResponse( struct net_response_s *response ) +{ + if ( g_pServers ) + { + g_pServers->PingResponse( response ); + } +} + +/* +=================== +RulesResponse + +Callback from engine +=================== +*/ +void NET_CALLBACK RulesResponse( struct net_response_s *response ) +{ + if ( g_pServers ) + { + g_pServers->RulesResponse( response ); + } +} +/* +=================== +PlayersResponse + +Callback from engine +=================== +*/ +void NET_CALLBACK PlayersResponse( struct net_response_s *response ) +{ + if ( g_pServers ) + { + g_pServers->PlayersResponse( response ); + } +} +/* +=================== +ListResponse + +=================== +*/ +void CHudServers::ListResponse( struct net_response_s *response ) +{ + request_t *list; + request_t *p; + int c = 0; + + if ( !( response->error == NET_SUCCESS ) ) + return; + + if ( response->type != NETAPI_REQUEST_SERVERLIST ) + return; + + if ( response->response ) + { + list = ( request_t * ) response->response; + while ( list ) + { + c++; + + //if ( c < 40 ) + { + // Copy from parsed stuff + p = new request_t; + p->context = -1; + p->remote_address = list->remote_address; + p->next = m_pServerList; + m_pServerList = p; + } + + // Move on + list = list->next; + } + } + + gEngfuncs.Con_Printf( "got list\n" ); + + m_nQuerying = 1; + m_nActiveQueries = 0; +} + +/* +=================== +ServerResponse + +=================== +*/ +void CHudServers::ServerResponse( struct net_response_s *response ) +{ + char *szresponse; + request_t *p; + server_t *browser; + int len; + char sz[ 32 ]; + + // Remove from active list + p = FindRequest( response->context, m_pActiveList ); + if ( p ) + { + RemoveServerFromList( &m_pActiveList, p ); + m_nActiveQueries--; + } + + if ( response->error != NET_SUCCESS ) + return; + + switch ( response->type ) + { + case NETAPI_REQUEST_DETAILS: + if ( response->response ) + { + szresponse = (char *)response->response; + len = strlen( szresponse ) + 100 + 1; + sprintf( sz, "%i", (int)( 1000.0 * response->ping ) ); + + browser = new server_t; + browser->remote_address = response->remote_address; + browser->info = new char[ len ]; + browser->ping = (int)( 1000.0 * response->ping ); + strcpy( browser->info, szresponse ); + + NET_API->SetValueForKey( browser->info, "address", gEngfuncs.pNetAPI->AdrToString( &response->remote_address ), len ); + NET_API->SetValueForKey( browser->info, "ping", sz, len ); + + AddServer( &m_pServers, browser ); + } + break; + default: + break; + } +} + +/* +=================== +PingResponse + +=================== +*/ +void CHudServers::PingResponse( struct net_response_s *response ) +{ + char sz[ 32 ]; + + if ( response->error != NET_SUCCESS ) + return; + + switch ( response->type ) + { + case NETAPI_REQUEST_PING: + sprintf( sz, "%.2f", 1000.0 * response->ping ); + + gEngfuncs.Con_Printf( "ping == %s\n", sz ); + break; + default: + break; + } +} + +/* +=================== +RulesResponse + +=================== +*/ +void CHudServers::RulesResponse( struct net_response_s *response ) +{ + char *szresponse; + + if ( response->error != NET_SUCCESS ) + return; + + switch ( response->type ) + { + case NETAPI_REQUEST_RULES: + if ( response->response ) + { + szresponse = (char *)response->response; + + gEngfuncs.Con_Printf( "rules %s\n", szresponse ); + } + break; + default: + break; + } +} + +/* +=================== +PlayersResponse + +=================== +*/ +void CHudServers::PlayersResponse( struct net_response_s *response ) +{ + char *szresponse; + + if ( response->error != NET_SUCCESS ) + return; + + switch ( response->type ) + { + case NETAPI_REQUEST_PLAYERS: + if ( response->response ) + { + szresponse = (char *)response->response; + + gEngfuncs.Con_Printf( "players %s\n", szresponse ); + } + break; + default: + break; + } +} + +/* +=================== +CompareServers + +Return 1 if p1 is "less than" p2, 0 otherwise +=================== +*/ +int CHudServers::CompareServers( server_t *p1, server_t *p2 ) +{ + const char *n1, *n2; + + if ( p1->ping < p2->ping ) + return 1; + + if ( p1->ping == p2->ping ) + { + // Pings equal, sort by second key: hostname + if ( p1->info && p2->info ) + { + n1 = NET_API->ValueForKey( p1->info, "hostname" ); + n2 = NET_API->ValueForKey( p2->info, "hostname" ); + + if ( n1 && n2 ) + { + if ( stricmp( n1, n2 ) < 0 ) + return 1; + } + } + } + + return 0; +} + +/* +=================== +AddServer + +=================== +*/ +void CHudServers::AddServer( server_t **ppList, server_t *p ) +{ +server_t *list; + + if ( !ppList || ! p ) + return; + + m_nServerCount++; + + // What sort key? Ping? + list = *ppList; + + // Head of list? + if ( !list ) + { + p->next = NULL; + *ppList = p; + return; + } + + // Put on head of list + if ( CompareServers( p, list ) ) + { + p->next = *ppList; + *ppList = p; + } + else + { + while ( list->next ) + { + // Insert before list next + if ( CompareServers( p, list->next ) ) + { + p->next = list->next->next; + list->next = p; + return; + } + + list = list->next; + } + + // Just add at end + p->next = NULL; + list->next = p; + } +} + +/* +=================== +Think + +=================== +*/ +void CHudServers::Think( double time ) +{ + m_fElapsed += time; + + if ( !m_nRequesting ) + return; + + if ( !m_nQuerying ) + return; + + QueryThink(); + + if ( ServerListSize() > 0 ) + return; + + m_dStarted = 0.0; + m_nRequesting = 0; + m_nDone = 0; + m_nQuerying = 0; + m_nActiveQueries = 0; +} + +/* +=================== +QueryThink + +=================== +*/ +void CHudServers::QueryThink( void ) +{ + request_t *p; + + if ( !m_nRequesting || m_nDone ) + return; + + if ( !m_nQuerying ) + return; + + if ( m_nActiveQueries > MAX_QUERIES ) + return; + + // Nothing left + if ( !m_pServerList ) + return; + + while ( 1 ) + { + p = m_pServerList; + + // No more in list? + if ( !p ) + break; + + // Move to next + m_pServerList = m_pServerList->next; + + // Setup context_id + p->context = context_id; + + // Start up query on this one + NET_API->SendRequest( context_id++, NETAPI_REQUEST_DETAILS, 0, 2.0, &p->remote_address, ::ServerResponse ); + + // Increment active list + m_nActiveQueries++; + + // Add to active list + p->next = m_pActiveList; + m_pActiveList = p; + + // Too many active? + if ( m_nActiveQueries > MAX_QUERIES ) + break; + } +} + +/* +================== +ServerListSize + +# of servers in active query and in pending to be queried lists +================== +*/ +int CHudServers::ServerListSize( void ) +{ + int c = 0; + request_t *p; + + p = m_pServerList; + while ( p ) + { + c++; + p = p->next; + } + + p = m_pActiveList; + while ( p ) + { + c++; + p = p->next; + } + + return c; +} + +/* +=================== +FindRequest + +Look up a request by context id +=================== +*/ +CHudServers::request_t *CHudServers::FindRequest( int context, request_t *pList ) +{ + request_t *p; + p = pList; + while ( p ) + { + if ( context == p->context ) + return p; + + p = p->next; + } + return NULL; +} + +/* +=================== +RemoveServerFromList + +Remote, but don't delete, item from *ppList +=================== +*/ +void CHudServers::RemoveServerFromList( request_t **ppList, request_t *item ) +{ + request_t *p, *n; + request_t *newlist = NULL; + + if ( !ppList ) + return; + + p = *ppList; + while ( p ) + { + n = p->next; + if ( p != item ) + { + p->next = newlist; + newlist = p; + } + p = n; + } + *ppList = newlist; +} + +/* +=================== +ClearRequestList + +=================== +*/ +void CHudServers::ClearRequestList( request_t **ppList ) +{ + request_t *p, *n; + + if ( !ppList ) + return; + + p = *ppList; + while ( p ) + { + n = p->next; + delete p; + p = n; + } + *ppList = NULL; +} + +/* +=================== +ClearServerList + +=================== +*/ +void CHudServers::ClearServerList( server_t **ppList ) +{ + server_t *p, *n; + + if ( !ppList ) + return; + + p = *ppList; + while ( p ) + { + n = p->next; + delete[] p->info; + delete p; + p = n; + } + *ppList = NULL; +} + +int CompareField( CHudServers::server_t *p1, CHudServers::server_t *p2, const char *fieldname, int iSortOrder ) +{ + const char *sz1, *sz2; + float fv1, fv2; + + sz1 = NET_API->ValueForKey( p1->info, fieldname ); + sz2 = NET_API->ValueForKey( p2->info, fieldname ); + + fv1 = atof( sz1 ); + fv2 = atof( sz2 ); + + if ( fv1 && fv2 ) + { + if ( fv1 > fv2 ) + return iSortOrder; + else if ( fv1 < fv2 ) + return -iSortOrder; + else + return 0; + } + + // String compare + return stricmp( sz1, sz2 ); +} + +int CALLBACK ServerListCompareFunc( CHudServers::server_t *p1, CHudServers::server_t *p2, const char *fieldname ) +{ + if (!p1 || !p2) // No meaningful comparison + return 0; + + int iSortOrder = 1; + + int retval = 0; + + retval = CompareField( p1, p2, fieldname, iSortOrder ); + + return retval; +} + +static char g_fieldname[ 256 ]; +int __cdecl FnServerCompare(const void *elem1, const void *elem2 ) +{ + CHudServers::server_t *list1, *list2; + + list1 = *(CHudServers::server_t **)elem1; + list2 = *(CHudServers::server_t **)elem2; + + return ServerListCompareFunc( list1, list2, g_fieldname ); +} + +void CHudServers::SortServers( const char *fieldname ) +{ + server_t *p; + // Create a list + if ( !m_pServers ) + return; + + strcpy( g_fieldname, fieldname ); + + int i; + int c = 0; + + p = m_pServers; + while ( p ) + { + c++; + p = p->next; + } + + server_t **pSortArray; + + pSortArray = new server_t *[ c ]; + memset( pSortArray, 0, c * sizeof( server_t * ) ); + + // Now copy the list into the pSortArray: + p = m_pServers; + i = 0; + while ( p ) + { + pSortArray[ i++ ] = p; + p = p->next; + } + + // Now do that actual sorting. + size_t nCount = c; + size_t nSize = sizeof( server_t * ); + + qsort( + pSortArray, + (size_t)nCount, + (size_t)nSize, + FnServerCompare + ); + + // Now rebuild the list. + m_pServers = pSortArray[0]; + for ( i = 0; i < c - 1; i++ ) + { + pSortArray[ i ]->next = pSortArray[ i + 1 ]; + } + pSortArray[ c - 1 ]->next = NULL; + + // Clean Up. + delete[] pSortArray; +} + +/* +=================== +GetServer + +Return particular server +=================== +*/ +CHudServers::server_t *CHudServers::GetServer( int server ) +{ + int c = 0; + server_t *p; + + p = m_pServers; + while ( p ) + { + if ( c == server ) + return p; + + c++; + p = p->next; + } + return NULL; +} + +/* +=================== +GetServerInfo + +Return info ( key/value ) string for particular server +=================== +*/ +char *CHudServers::GetServerInfo( int server ) +{ + server_t *p = GetServer( server ); + if ( p ) + { + return p->info; + } + return NULL; +} + +/* +=================== +CancelRequest + +Kill all pending requests in engine +=================== +*/ +void CHudServers::CancelRequest( void ) +{ + m_nRequesting = 0; + m_nQuerying = 0; + m_nDone = 1; + + NET_API->CancelAllRequests(); +} + +/* +================== +LoadMasterAddresses + +Loads the master server addresses from file and into the passed in array +================== +*/ +int CHudServers::LoadMasterAddresses( int maxservers, int *count, netadr_t *padr ) +{ + int i; + char szMaster[ 256 ]; + char szMasterFile[256]; + char *pbuffer = NULL; + char *pstart = NULL ; + netadr_t adr; + char szAdr[64]; + int nPort; + int nCount = 0; + bool bIgnore; + int nDefaultPort; + + // Assume default master and master file + strcpy( szMaster, VALVE_MASTER_ADDRESS ); // IP:PORT string + strcpy( szMasterFile, MASTER_PARSE_FILE ); + + // See if there is a command line override + i = gEngfuncs.CheckParm( "-comm", &pstart ); + if ( i && pstart ) + { + strcpy (szMasterFile, pstart ); + } + + // Read them in from proper file + pbuffer = (char *)gEngfuncs.COM_LoadFile( szMasterFile, 5, NULL ); // Use malloc + if ( !pbuffer ) + { + goto finish_master; + } + + pstart = pbuffer; + + while ( nCount < maxservers ) + { + pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); + + if ( strlen(m_szToken) <= 0) + break; + + bIgnore = true; + + if ( !stricmp( m_szToken, "Master" ) ) + { + nDefaultPort = PORT_MASTER; + bIgnore = FALSE; + } + + // Now parse all addresses between { } + pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); + if ( strlen(m_szToken) <= 0 ) + break; + + if ( stricmp ( m_szToken, "{" ) ) + break; + + // Parse addresses until we get to "}" + while ( nCount < maxservers ) + { + char base[256]; + + // Now parse all addresses between { } + pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); + + if (strlen(m_szToken) <= 0) + break; + + if ( !stricmp ( m_szToken, "}" ) ) + break; + + sprintf( base, "%s", m_szToken ); + + pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); + + if (strlen(m_szToken) <= 0) + break; + + if ( stricmp( m_szToken, ":" ) ) + break; + + pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); + + if (strlen(m_szToken) <= 0) + break; + + nPort = atoi ( m_szToken ); + if ( !nPort ) + nPort = nDefaultPort; + + sprintf( szAdr, "%s:%i", base, nPort ); + + // Can we resolve it any better + if ( !NET_API->StringToAdr( szAdr, &adr ) ) + bIgnore = true; + + if ( !bIgnore ) + { + padr[ nCount++ ] = adr; + } + } + } + +finish_master: + if ( !nCount ) + { + sprintf( szMaster, VALVE_MASTER_ADDRESS ); // IP:PORT string + + // Convert to netadr_t + if ( NET_API->StringToAdr ( szMaster, &adr ) ) + { + + padr[ nCount++ ] = adr; + } + } + + *count = nCount; + + if ( pbuffer ) + { + gEngfuncs.COM_FreeFile( pbuffer ); + } + + return ( nCount > 0 ) ? 1 : 0; +} + +/* +=================== +RequestList + +Request list of game servers from master +=================== +*/ +void CHudServers::RequestList( void ) +{ + m_nRequesting = 1; + m_nDone = 0; + m_dStarted = m_fElapsed; + + int count = 0; + netadr_t adr; + + if ( !LoadMasterAddresses( 1, &count, &adr ) ) + { + gEngfuncs.Con_DPrintf( "SendRequest: Unable to read master server addresses\n" ); + return; + } + + ClearRequestList( &m_pActiveList ); + ClearRequestList( &m_pServerList ); + ClearServerList( &m_pServers ); + + m_nServerCount = 0; + + // Make sure networking system has started. + NET_API->InitNetworking(); + + // Kill off left overs if any + NET_API->CancelAllRequests(); + + // Request Server List from master + NET_API->SendRequest( context_id++, NETAPI_REQUEST_SERVERLIST, 0, 5.0, &adr, ::ListResponse ); +} + +void CHudServers::RequestBroadcastList( int clearpending ) +{ + m_nRequesting = 1; + m_nDone = 0; + m_dStarted = m_fElapsed; + + netadr_t adr; + memset( &adr, 0, sizeof( adr ) ); + + if ( clearpending ) + { + ClearRequestList( &m_pActiveList ); + ClearRequestList( &m_pServerList ); + ClearServerList( &m_pServers ); + + m_nServerCount = 0; + } + + // Make sure to byte swap server if necessary ( using "host" to "net" conversion + adr.port = htons( PORT_SERVER ); + + // Make sure networking system has started. + NET_API->InitNetworking(); + + if ( clearpending ) + { + // Kill off left overs if any + NET_API->CancelAllRequests(); + } + + adr.type = NA_BROADCAST; + + // Request Servers from LAN via IP + NET_API->SendRequest( context_id++, NETAPI_REQUEST_DETAILS, FNETAPI_MULTIPLE_RESPONSE, 5.0, &adr, ::ServerResponse ); + + adr.type = NA_BROADCAST_IPX; + + // Request Servers from LAN via IPX ( if supported ) + NET_API->SendRequest( context_id++, NETAPI_REQUEST_DETAILS, FNETAPI_MULTIPLE_RESPONSE, 5.0, &adr, ::ServerResponse ); +} + +void CHudServers::ServerPing( int server ) +{ + server_t *p; + + p = GetServer( server ); + if ( !p ) + return; + + // Make sure networking system has started. + NET_API->InitNetworking(); + + // Request Server List from master + NET_API->SendRequest( context_id++, NETAPI_REQUEST_PING, 0, 5.0, &p->remote_address, ::PingResponse ); +} + +void CHudServers::ServerRules( int server ) +{ + server_t *p; + + p = GetServer( server ); + if ( !p ) + return; + + // Make sure networking system has started. + NET_API->InitNetworking(); + + // Request Server List from master + NET_API->SendRequest( context_id++, NETAPI_REQUEST_RULES, 0, 5.0, &p->remote_address, ::RulesResponse ); +} + +void CHudServers::ServerPlayers( int server ) +{ + server_t *p; + + p = GetServer( server ); + if ( !p ) + return; + + // Make sure networking system has started. + NET_API->InitNetworking(); + + // Request Server List from master + NET_API->SendRequest( context_id++, NETAPI_REQUEST_PLAYERS, 0, 5.0, &p->remote_address, ::PlayersResponse ); +} + +int CHudServers::isQuerying() +{ + return m_nRequesting ? 1 : 0; +} + + +/* +=================== +GetServerCount + +Return number of servers in browser list +=================== +*/ +int CHudServers::GetServerCount( void ) +{ + return m_nServerCount; +} + +/* +=================== +CHudServers + +=================== +*/ +CHudServers::CHudServers( void ) +{ + m_nRequesting = 0; + m_dStarted = 0.0; + m_nDone = 0; + m_pServerList = NULL; + m_pServers = NULL; + m_pActiveList = NULL; + m_nQuerying = 0; + m_nActiveQueries = 0; + + m_fElapsed = 0.0; + + + m_pPingRequest = NULL; + m_pRulesRequest = NULL; + m_pPlayersRequest = NULL; +} + +/* +=================== +~CHudServers + +=================== +*/ +CHudServers::~CHudServers( void ) +{ + ClearRequestList( &m_pActiveList ); + ClearRequestList( &m_pServerList ); + ClearServerList( &m_pServers ); + + m_nServerCount = 0; + + if ( m_pPingRequest ) + { + delete m_pPingRequest; + m_pPingRequest = NULL; + + } + + if ( m_pRulesRequest ) + { + delete m_pRulesRequest; + m_pRulesRequest = NULL; + } + + if ( m_pPlayersRequest ) + { + delete m_pPlayersRequest; + m_pPlayersRequest = NULL; + } +} + +/////////////////////////////// +// +// PUBLIC APIs +// +/////////////////////////////// + +/* +=================== +ServersGetCount + +=================== +*/ +int ServersGetCount( void ) +{ + if ( g_pServers ) + { + return g_pServers->GetServerCount(); + } + return 0; +} + +int ServersIsQuerying( void ) +{ + if ( g_pServers ) + { + return g_pServers->isQuerying(); + } + return 0; +} + +/* +=================== +ServersGetInfo + +=================== +*/ +const char *ServersGetInfo( int server ) +{ + if ( g_pServers ) + { + return g_pServers->GetServerInfo( server ); + } + + return NULL; +} + +void SortServers( const char *fieldname ) +{ + if ( g_pServers ) + { + g_pServers->SortServers( fieldname ); + } +} + +/* +=================== +ServersShutdown + +=================== +*/ +void ServersShutdown( void ) +{ + if ( g_pServers ) + { + delete g_pServers; + g_pServers = NULL; + } +} + +/* +=================== +ServersInit + +=================== +*/ +void ServersInit( void ) +{ + // Kill any previous instance + ServersShutdown(); + + g_pServers = new CHudServers(); +} + +/* +=================== +ServersThink + +=================== +*/ +void ServersThink( double time ) +{ + if ( g_pServers ) + { + g_pServers->Think( time ); + } +} + +/* +=================== +ServersCancel + +=================== +*/ +void ServersCancel( void ) +{ + if ( g_pServers ) + { + g_pServers->CancelRequest(); + } +} + +// Requests +/* +=================== +ServersList + +=================== +*/ +void ServersList( void ) +{ + if ( g_pServers ) + { + g_pServers->RequestList(); + } +} + +void BroadcastServersList( int clearpending ) +{ + if ( g_pServers ) + { + g_pServers->RequestBroadcastList( clearpending ); + } +} + +void ServerPing( int server ) +{ + if ( g_pServers ) + { + g_pServers->ServerPing( server ); + } +} + +void ServerRules( int server ) +{ + if ( g_pServers ) + { + g_pServers->ServerRules( server ); + } +} + +void ServerPlayers( int server ) +{ + if ( g_pServers ) + { + g_pServers->ServerPlayers( server ); + } +} \ No newline at end of file diff --git a/main/source/cl_dll/hud_servers.h b/main/source/cl_dll/hud_servers.h new file mode 100644 index 00000000..cb8a725b --- /dev/null +++ b/main/source/cl_dll/hud_servers.h @@ -0,0 +1,34 @@ +#if !defined( HUD_SERVERSH ) +#define HUD_SERVERSH +#pragma once + +#define NET_CALLBACK /* */ + +// Dispatchers +void NET_CALLBACK ListResponse( struct net_response_s *response ); +void NET_CALLBACK ServerResponse( struct net_response_s *response ); +void NET_CALLBACK PingResponse( struct net_response_s *response ); +void NET_CALLBACK RulesResponse( struct net_response_s *response ); +void NET_CALLBACK PlayersResponse( struct net_response_s *response ); + +void ServersInit( void ); +void ServersShutdown( void ); +void ServersThink( double time ); +void ServersCancel( void ); + +// Get list and get server info from each +void ServersList( void ); + +// Query for IP / IPX LAN servers +void BroadcastServersList( int clearpending ); + +void ServerPing( int server ); +void ServerRules( int server ); +void ServerPlayers( int server ); + +int ServersGetCount( void ); +const char *ServersGetInfo( int server ); +int ServersIsQuerying( void ); +void SortServers( const char *fieldname ); + +#endif // HUD_SERVERSH \ No newline at end of file diff --git a/main/source/cl_dll/hud_servers_priv.h b/main/source/cl_dll/hud_servers_priv.h new file mode 100644 index 00000000..a571f2d8 --- /dev/null +++ b/main/source/cl_dll/hud_servers_priv.h @@ -0,0 +1,91 @@ +#if !defined( HUD_SERVERS_PRIVH ) +#define HUD_SERVERS_PRIVH +#pragma once + +#include "netadr.h" + +class CHudServers +{ +public: + typedef struct request_s + { + struct request_s *next; + netadr_t remote_address; + int context; + } request_t; + + typedef struct server_s + { + struct server_s *next; + netadr_t remote_address; + char *info; + int ping; + } server_t; + + CHudServers(); + ~CHudServers(); + + void Think( double time ); + void QueryThink( void ); + int isQuerying( void ); + + int LoadMasterAddresses( int maxservers, int *count, netadr_t *padr ); + + void RequestList( void ); + void RequestBroadcastList( int clearpending ); + + void ServerPing( int server ); + void ServerRules( int server ); + void ServerPlayers( int server ); + + void CancelRequest( void ); + + int CompareServers( server_t *p1, server_t *p2 ); + + void ClearServerList( server_t **ppList ); + void ClearRequestList( request_t **ppList ); + + void AddServer( server_t **ppList, server_t *p ); + + void RemoveServerFromList( request_t **ppList, request_t *item ); + + request_t *FindRequest( int context, request_t *pList ); + + int ServerListSize( void ); + char *GetServerInfo( int server ); + int GetServerCount( void ); + void SortServers( const char *fieldname ); + + void ListResponse( struct net_response_s *response ); + void ServerResponse( struct net_response_s *response ); + void PingResponse( struct net_response_s *response ); + void RulesResponse( struct net_response_s *response ); + void PlayersResponse( struct net_response_s *response ); +private: + + server_t *GetServer( int server ); + + // + char m_szToken[ 1024 ]; + int m_nRequesting; + int m_nDone; + + double m_dStarted; + + request_t *m_pServerList; + request_t *m_pActiveList; + + server_t *m_pServers; + + int m_nServerCount; + + int m_nActiveQueries; + int m_nQuerying; + double m_fElapsed; + + request_t *m_pPingRequest; + request_t *m_pRulesRequest; + request_t *m_pPlayersRequest; +}; + +#endif // HUD_SERVERS_PRIVH \ No newline at end of file diff --git a/main/source/cl_dll/hud_spectator.cpp b/main/source/cl_dll/hud_spectator.cpp new file mode 100644 index 00000000..a084082f --- /dev/null +++ b/main/source/cl_dll/hud_spectator.cpp @@ -0,0 +1,1972 @@ +//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#include "hud.h" +#include "cl_util.h" +#include "cl_entity.h" +#include "triangleapi.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_SpectatorPanel.h" +#include "hltv.h" + +#include "pm_shared.h" +#include "pm_defs.h" +#include "pmtrace.h" +#include "parsemsg.h" +#include "entity_types.h" + +// these are included for the math functions +#include "com_model.h" +#include "demo_api.h" +#include "event_api.h" +#include "studio_util.h" +#include "screenfade.h" +#include "util/STLUtil.h" +#include "mod/AvHTitles.h" +#include "mod/AvHSprites.h" + +#pragma warning(disable: 4244) + +extern int iJumpSpectator; +extern float vJumpOrigin[3]; +extern float vJumpAngles[3]; + +extern void V_GetInEyePos(int entity, float * origin, float * angles ); +extern void V_ResetChaseCam(); +extern void V_GetChasePos(int target, float * cl_angles, float * origin, float * angles); +extern void VectorAngles( const float *forward, float *angles ); +extern "C" void NormalizeAngles( float *angles ); +extern float * GetClientColor( int clientIndex ); + +extern vec3_t v_origin; // last view origin +extern vec3_t v_angles; // last view angle +extern vec3_t v_cl_angles; // last client/mouse angle +extern vec3_t v_sim_org; // last sim origin + +void SpectatorMode(void) +{ + + if ( gEngfuncs.Cmd_Argc() <= 1 ) + { + gEngfuncs.Con_Printf( "usage: spec_mode \n" ); + return; + } + + // SetModes() will decide if command is executed on server or local + if ( gEngfuncs.Cmd_Argc() == 2 ) + gHUD.m_Spectator.SetMode( atoi( gEngfuncs.Cmd_Argv(1) )); + + //else if ( gEngfuncs.Cmd_Argc() == 3 ) + // gHUD.m_Spectator.SetMode( atoi( gEngfuncs.Cmd_Argv(1) ), atoi( gEngfuncs.Cmd_Argv(2) ) ); +} + +void SpectatorSpray(void) +{ + vec3_t forward; + char string[128]; + + if ( !gEngfuncs.IsSpectateOnly() ) + return; + + AngleVectors(v_angles,forward,NULL,NULL); + VectorScale(forward, 128, forward); + VectorAdd(forward, v_origin, forward); + pmtrace_t * trace = gEngfuncs.PM_TraceLine( v_origin, forward, PM_TRACELINE_PHYSENTSONLY, 2, -1 ); + if ( trace->fraction != 1.0 ) + { + sprintf(string, "drc_spray %.2f %.2f %.2f %i", + trace->endpos[0], trace->endpos[1], trace->endpos[2], trace->ent ); + gEngfuncs.pfnServerCmd(string); + } + +} +void SpectatorHelp(void) +{ + if ( gViewPort ) + { + gViewPort->ShowVGUIMenu( MENU_SPECHELP ); + } + else + { + char *text = CHudTextMessage::BufferedLocaliseTextString( "#Spec_Help_Text" ); + + if ( text ) + { + while ( *text ) + { + if ( *text != 13 ) + gEngfuncs.Con_Printf( "%c", *text ); + text++; + } + } + } +} + +void SpectatorMenu( void ) +{ + if ( gEngfuncs.Cmd_Argc() <= 1 ) + { + gEngfuncs.Con_Printf( "usage: spec_menu <0|1>\n" ); + return; + } + + gViewPort->m_pSpectatorPanel->ShowMenu( atoi( gEngfuncs.Cmd_Argv(1))!=0 ); +} + +void ToggleScores( void ) +{ + if ( gViewPort ) + { + if (gViewPort->IsScoreBoardVisible() ) + { + gViewPort->HideScoreBoard(); + } + else + { + gViewPort->ShowScoreBoard(); + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +int CHudSpectator::Init() +{ + gHUD.AddHudElem(this); + + m_iFlags |= HUD_ACTIVE; + m_flNextObserverInput = 0.0f; + m_zoomDelta = 0.0f; + m_moveDelta = 0.0f; + iJumpSpectator = 0; + + memset( &m_OverviewData, 0, sizeof(m_OverviewData)); + memset( &m_OverviewEntities, 0, sizeof(m_OverviewEntities)); + m_lastPrimaryObject = m_lastSecondaryObject = 0; + + gEngfuncs.pfnAddCommand ("spec_mode", SpectatorMode ); + gEngfuncs.pfnAddCommand ("spec_decal", SpectatorSpray ); + gEngfuncs.pfnAddCommand ("spec_help", SpectatorHelp ); + gEngfuncs.pfnAddCommand ("spec_menu", SpectatorMenu ); + gEngfuncs.pfnAddCommand ("togglescores", ToggleScores ); + + m_drawnames = gEngfuncs.pfnRegisterVariable("spec_drawnames","1",0); + m_drawcone = gEngfuncs.pfnRegisterVariable("spec_drawcone","1",0); + m_drawstatus = gEngfuncs.pfnRegisterVariable("spec_drawstatus","1",0); + m_autoDirector = gEngfuncs.pfnRegisterVariable("spec_autodirector","1",0); + + // Removed by mmcguire. + m_overviewMode = false; + //m_overview = gEngfuncs.pfnRegisterVariable("spec_overview","1",0); + //m_pip = gEngfuncs.pfnRegisterVariable("spec_pip","1",0); + + if ( !m_drawnames || !m_drawcone || !m_drawstatus || !m_autoDirector /*|| !m_pip*/) + { + gEngfuncs.Con_Printf("ERROR! Couldn't register all spectator variables.\n"); + return 0; + } + + return 1; +} + + +//----------------------------------------------------------------------------- +// UTIL_StringToVector originally from ..\dlls\util.cpp, slightly changed +//----------------------------------------------------------------------------- + +void UTIL_StringToVector( float * pVector, const char *pString ) +{ + char *pstr, *pfront, tempString[128]; + int j; + + strcpy( tempString, pString ); + pstr = pfront = tempString; + + for ( j = 0; j < 3; j++ ) + { + pVector[j] = atof( pfront ); + + while ( *pstr && *pstr != ' ' ) + pstr++; + if (!*pstr) + break; + pstr++; + pfront = pstr; + } + + if (j < 2) + { + for (j = j+1;j < 3; j++) + pVector[j] = 0; + } +} + +int UTIL_FindEntityInMap(char * name, float * origin, float * angle) +{ + int n,found = 0; + char keyname[256]; + char token[1024]; + + cl_entity_t * pEnt = gEngfuncs.GetEntityByIndex( 0 ); // get world model + + if ( !pEnt ) return 0; + + if ( !pEnt->model ) return 0; + + char * data = pEnt->model->entities; + + while (data) + { + data = gEngfuncs.COM_ParseFile(data, token); + + if ( (token[0] == '}') || (token[0]==0) ) + break; + + if (!data) + { + gEngfuncs.Con_DPrintf("UTIL_FindEntityInMap: EOF without closing brace\n"); + return 0; + } + + if (token[0] != '{') + { + gEngfuncs.Con_DPrintf("UTIL_FindEntityInMap: expected {\n"); + return 0; + } + + // we parse the first { now parse entities properties + + while ( 1 ) + { + // parse key + data = gEngfuncs.COM_ParseFile(data, token); + if (token[0] == '}') + break; // finish parsing this entity + + if (!data) + { + gEngfuncs.Con_DPrintf("UTIL_FindEntityInMap: EOF without closing brace\n"); + return 0; + }; + + strcpy (keyname, token); + + // another hack to fix keynames with trailing spaces + n = strlen(keyname); + while (n && keyname[n-1] == ' ') + { + keyname[n-1] = 0; + n--; + } + + // parse value + data = gEngfuncs.COM_ParseFile(data, token); + if (!data) + { + gEngfuncs.Con_DPrintf("UTIL_FindEntityInMap: EOF without closing brace\n"); + return 0; + }; + + if (token[0] == '}') + { + gEngfuncs.Con_DPrintf("UTIL_FindEntityInMap: closing brace without data"); + return 0; + } + + if (!strcmp(keyname,"classname")) + { + if (!strcmp(token, name )) + { + found = 1; // thats our entity + } + }; + + if( !strcmp( keyname, "angle" ) ) + { + float y = atof( token ); + + if (y >= 0) + { + angle[0] = 0.0f; + angle[1] = y; + } + else if ((int)y == -1) + { + angle[0] = -90.0f; + angle[1] = 0.0f;; + } + else + { + angle[0] = 90.0f; + angle[1] = 0.0f; + } + + angle[2] = 0.0f; + } + + if( !strcmp( keyname, "angles" ) ) + { + UTIL_StringToVector(angle, token); + } + + if (!strcmp(keyname,"origin")) + { + UTIL_StringToVector(origin, token); + + }; + + } // while (1) + + if (found) + return 1; + + } + + return 0; // we search all entities, but didn't found the correct + +} + +//----------------------------------------------------------------------------- +// SetSpectatorStartPosition(): +// Get valid map position and 'beam' spectator to this position +//----------------------------------------------------------------------------- + +void CHudSpectator::SetSpectatorStartPosition() +{ + // search for info_player start + if ( UTIL_FindEntityInMap( "trigger_camera", m_cameraOrigin, m_cameraAngles ) ) + iJumpSpectator = 1; + + else if ( UTIL_FindEntityInMap( "info_player_start", m_cameraOrigin, m_cameraAngles ) ) + iJumpSpectator = 1; + + else if ( UTIL_FindEntityInMap( "info_player_deathmatch", m_cameraOrigin, m_cameraAngles ) ) + iJumpSpectator = 1; + + else if ( UTIL_FindEntityInMap( "info_player_coop", m_cameraOrigin, m_cameraAngles ) ) + iJumpSpectator = 1; + else + { + // jump to 0,0,0 if no better position was found + VectorCopy(vec3_origin, m_cameraOrigin); + VectorCopy(vec3_origin, m_cameraAngles); + } + + VectorCopy(m_cameraOrigin, vJumpOrigin); + VectorCopy(m_cameraAngles, vJumpAngles); + + iJumpSpectator = 1; // jump anyway +} + +//----------------------------------------------------------------------------- +// Purpose: Loads new icons +//----------------------------------------------------------------------------- +int CHudSpectator::VidInit() +{ + m_hsprPlayerMarine = Safe_SPR_Load("sprites/iplayerm.spr"); + m_hsprPlayerAlien = Safe_SPR_Load("sprites/iplayera.spr"); + m_hsprPlayerDead = Safe_SPR_Load("sprites/iplayerdead.spr"); + m_hsprUnkownMap = Safe_SPR_Load("sprites/tile.spr"); + //m_hsprBeam = Safe_SPR_Load("sprites/laserbeam.spr"); + //m_hsprCamera = Safe_SPR_Load("sprites/camera.spr"); + m_hCrosshair = Safe_SPR_Load("sprites/crosshairs.spr"); + m_hsprWhite = Safe_SPR_Load(kWhiteSprite); + + return 1; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : flTime - +// intermission - +//----------------------------------------------------------------------------- +int CHudSpectator::Draw(float flTime) +{ + + // draw only in spectator mode + if ( !g_iUser1 ) + return 0; + + // Removed by mmcguire. + /* + // if user pressed zoom, aplly changes + if ( (m_zoomDelta != 0.0f) && ( g_iUser1 == OBS_MAP_FREE ) ) + { + m_mapZoom += m_zoomDelta; + + if ( m_mapZoom > 3.0f ) + m_mapZoom = 3.0f; + + if ( m_mapZoom < 0.5f ) + m_mapZoom = 0.5f; + } + + // if user moves in map mode, change map origin + if ( (m_moveDelta != 0.0f) && (g_iUser1 != OBS_ROAMING) ) + { + vec3_t right; + AngleVectors(v_angles, NULL, right, NULL); + VectorNormalize(right); + VectorScale(right, m_moveDelta, right ); + + VectorAdd( m_mapOrigin, right, m_mapOrigin ) + + } + */ + + //DrawOverviewMap(); + +/* + if (!IsInOverviewMode()) + { + return 0; + } + + if (m_hsprWhite != NULL) + { + + float bgColor[] = { 0.1, 0.1, 0.1, 1 }; + float borderColor[] = { 1, 1, 1, 1 }; + + gEngfuncs.pTriAPI->RenderMode(kRenderNormal); + gEngfuncs.pTriAPI->CullFace(TRI_NONE); + + gEngfuncs.pTriAPI->SpriteTexture((struct model_s*)(gEngfuncs.GetSpritePointer(m_hsprWhite)), 0); + + float gammaScale = 1.0f / gHUD.GetGammaSlope(); + + // Draw the border on the overview map and the inset view. + + gEngfuncs.pTriAPI->RenderMode(kRenderNormal); + gEngfuncs.pTriAPI->CullFace(TRI_NONE); + + gEngfuncs.pTriAPI->SpriteTexture((struct model_s*)(gEngfuncs.GetSpritePointer(m_hsprWhite)), 0); + gEngfuncs.pTriAPI->Color4f(gammaScale * borderColor[0], gammaScale * borderColor[1], gammaScale * borderColor[2], borderColor[3]); + + gEngfuncs.pTriAPI->Begin(TRI_LINES); + + int insetX1 = XRES(m_OverviewData.insetWindowX); + int insetY1 = YRES(m_OverviewData.insetWindowY); + int insetX2 = insetX1 + XRES(m_OverviewData.insetWindowWidth); + int insetY2 = insetY1 + YRES(m_OverviewData.insetWindowHeight); + + gEngfuncs.pTriAPI->Vertex3f(insetX1, insetY1, 1); + gEngfuncs.pTriAPI->Vertex3f(insetX2, insetY1, 1); + + gEngfuncs.pTriAPI->Vertex3f(insetX2, insetY1, 1); + gEngfuncs.pTriAPI->Vertex3f(insetX2, insetY2, 1); + + gEngfuncs.pTriAPI->Vertex3f(insetX2, insetY2, 1); + gEngfuncs.pTriAPI->Vertex3f(insetX1, insetY2, 1); + + gEngfuncs.pTriAPI->Vertex3f(insetX1, insetY2, 1); + gEngfuncs.pTriAPI->Vertex3f(insetX1, insetY1, 1); + + gEngfuncs.pTriAPI->End(); + + }*/ + + + + /* + // Only draw the icon names only if map mode is in Main Mode + if ( g_iUser1 < OBS_MAP_FREE ) + return 1; + + if ( !m_drawnames->value ) + return 1; + + // make sure we have player info + gViewPort->GetAllPlayersInfo(); + */ + + return 1; + +} + +bool CHudSpectator::IsInOverviewMode() const +{ + return g_iUser1 && m_overviewMode && gHUD.GetIsNSMode(); +} + +void CHudSpectator::SetOverviewMode(bool overviewMode) +{ + m_overviewMode = overviewMode; +} + +void CHudSpectator::DrawOverviewMap() +{ + + // draw only in spectator mode + if (!IsInOverviewMode()) + { + return; + } + + AvHOverviewMap& theOverviewMap = gHUD.GetOverviewMap(); + + AvHOverviewMap::DrawInfo theDrawInfo; + + theDrawInfo.mX = XRES(m_OverviewData.insetWindowX + m_OverviewData.insetWindowWidth + 4); + theDrawInfo.mY = YRES(SPECTATOR_PANEL_HEIGHT + 4); + theDrawInfo.mWidth = ScreenWidth() - theDrawInfo.mX - XRES(4); + theDrawInfo.mHeight = ScreenHeight() - YRES(SPECTATOR_PANEL_HEIGHT + 4) - theDrawInfo.mY; + + AvHMapExtents theMapExtents; + theOverviewMap.GetMapExtents(theMapExtents); + + theDrawInfo.mFullScreen = true; + + float worldWidth = theMapExtents.GetMaxMapX() - theMapExtents.GetMinMapX(); + float worldHeight = theMapExtents.GetMaxMapY() - theMapExtents.GetMinMapY(); + + float xScale; + float yScale; + + float aspect1 = worldWidth / worldHeight; + float aspect2 = ((float)theDrawInfo.mWidth) / theDrawInfo.mHeight; + + if (aspect1 > aspect2) + { + xScale = 1; + yScale = 1 / aspect2; + } + else + { + xScale = aspect2; + yScale = 1; + } + + float centerX = (theMapExtents.GetMinMapX() + theMapExtents.GetMaxMapX()) / 2; + float centerY = (theMapExtents.GetMinMapY() + theMapExtents.GetMaxMapY()) / 2; + + theDrawInfo.mViewWorldMinX = centerX - worldWidth * xScale * 0.5; + theDrawInfo.mViewWorldMinY = centerY - worldHeight * yScale * 0.5; + theDrawInfo.mViewWorldMaxX = centerX + worldWidth * xScale * 0.5; + theDrawInfo.mViewWorldMaxY = centerY + worldHeight * yScale * 0.5; + + if (m_hsprWhite != NULL) + { + + float bgColor[] = { 0.1, 0.1, 0.1, 1 }; + float borderColor[] = { 1, 1, 1, 1 }; + + gEngfuncs.pTriAPI->RenderMode(kRenderNormal); + gEngfuncs.pTriAPI->CullFace(TRI_NONE); + + gEngfuncs.pTriAPI->SpriteTexture((struct model_s*)(gEngfuncs.GetSpritePointer(m_hsprWhite)), 0); + + float gammaScale = 1.0f / gHUD.GetGammaSlope(); + + // Draw the background. + + gEngfuncs.pTriAPI->Color4f(gammaScale * bgColor[0], gammaScale * bgColor[1], gammaScale * bgColor[2], bgColor[3]); + + gEngfuncs.pTriAPI->Begin(TRI_QUADS); + + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX, theDrawInfo.mY, 1); + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX, theDrawInfo.mY + theDrawInfo.mHeight, 1); + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX + theDrawInfo.mWidth, theDrawInfo.mY + theDrawInfo.mHeight, 1); + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX + theDrawInfo.mWidth, theDrawInfo.mY, 1); + + gEngfuncs.pTriAPI->End(); + + // Draw the overview map. + + theOverviewMap.Draw(theDrawInfo); + + // Draw the border on the overview map and the inset view. + + gEngfuncs.pTriAPI->RenderMode(kRenderNormal); + gEngfuncs.pTriAPI->CullFace(TRI_NONE); + + gEngfuncs.pTriAPI->SpriteTexture((struct model_s*)(gEngfuncs.GetSpritePointer(m_hsprWhite)), 0); + gEngfuncs.pTriAPI->Color4f(gammaScale * borderColor[0], gammaScale * borderColor[1], gammaScale * borderColor[2], borderColor[3]); + + gEngfuncs.pTriAPI->Begin(TRI_LINES); + + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX, theDrawInfo.mY, 1); + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX, theDrawInfo.mY + theDrawInfo.mHeight, 1); + + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX, theDrawInfo.mY + theDrawInfo.mHeight, 1); + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX + theDrawInfo.mWidth, theDrawInfo.mY + theDrawInfo.mHeight, 1); + + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX + theDrawInfo.mWidth, theDrawInfo.mY + theDrawInfo.mHeight, 1); + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX + theDrawInfo.mWidth, theDrawInfo.mY, 1); + + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX + theDrawInfo.mWidth, theDrawInfo.mY, 1); + gEngfuncs.pTriAPI->Vertex3f(theDrawInfo.mX, theDrawInfo.mY, 1); + + int insetX1 = XRES(m_OverviewData.insetWindowX); + int insetY1 = YRES(m_OverviewData.insetWindowY); + int insetX2 = insetX1 + XRES(m_OverviewData.insetWindowWidth); + int insetY2 = insetY1 + YRES(m_OverviewData.insetWindowHeight); + + gEngfuncs.pTriAPI->Vertex3f(insetX1, insetY1, 1); + gEngfuncs.pTriAPI->Vertex3f(insetX2, insetY1, 1); + + gEngfuncs.pTriAPI->Vertex3f(insetX2, insetY1, 1); + gEngfuncs.pTriAPI->Vertex3f(insetX2, insetY2, 1); + + gEngfuncs.pTriAPI->Vertex3f(insetX2, insetY2, 1); + gEngfuncs.pTriAPI->Vertex3f(insetX1, insetY2, 1); + + gEngfuncs.pTriAPI->Vertex3f(insetX1, insetY2, 1); + gEngfuncs.pTriAPI->Vertex3f(insetX1, insetY1, 1); + + gEngfuncs.pTriAPI->End(); + + } + + +} + + +void CHudSpectator::DirectorMessage( int iSize, void *pbuf ) +{ + float value; + char * string; + + BEGIN_READ( pbuf, iSize ); + + int cmd = READ_BYTE(); + + switch ( cmd ) // director command byte + { + case DRC_CMD_START : + // now we have to do some things clientside, since the proxy doesn't know our mod + g_iPlayerClass = 0; + g_iTeamNumber = 0; + + // fake a InitHUD & ResetHUD message + gHUD.MsgFunc_InitHUD(NULL,0, NULL); + gHUD.MsgFunc_ResetHUD(NULL, 0, NULL); + + break; + + case DRC_CMD_EVENT : + m_lastPrimaryObject = READ_WORD(); + m_lastSecondaryObject = READ_WORD(); + m_iObserverFlags = READ_LONG(); + + if ( m_autoDirector->value ) + { + if ( (g_iUser2 != m_lastPrimaryObject) || (g_iUser3 != m_lastSecondaryObject) ) + V_ResetChaseCam(); + + g_iUser2 = m_lastPrimaryObject; + g_iUser3 = m_lastSecondaryObject; + } + + // gEngfuncs.Con_Printf("Director Camera: %i %i\n", firstObject, secondObject); + break; + + case DRC_CMD_MODE : + if ( m_autoDirector->value ) + { + SetMode( READ_BYTE()); + } + break; + + case DRC_CMD_CAMERA : + if ( m_autoDirector->value ) + { + vJumpOrigin[0] = READ_COORD(); // position + vJumpOrigin[1] = READ_COORD(); + vJumpOrigin[2] = READ_COORD(); + + vJumpAngles[0] = READ_COORD(); // view angle + vJumpAngles[1] = READ_COORD(); + vJumpAngles[2] = READ_COORD(); + + gEngfuncs.SetViewAngles( vJumpAngles ); + + iJumpSpectator = 1; + } + break; + + case DRC_CMD_MESSAGE: + { + client_textmessage_t * msg = &m_HUDMessages[m_lastHudMessage]; + + msg->effect = READ_BYTE(); // effect + + UnpackRGB( (int&)msg->r1, (int&)msg->g1, (int&)msg->b1, READ_LONG() ); // color + msg->r2 = msg->r1; + msg->g2 = msg->g1; + msg->b2 = msg->b1; + msg->a2 = msg->a1 = 0xFF; // not transparent + + msg->x = READ_FLOAT(); // x pos + msg->y = READ_FLOAT(); // y pos + + msg->fadein = READ_FLOAT(); // fadein + msg->fadeout = READ_FLOAT(); // fadeout + msg->holdtime = READ_FLOAT(); // holdtime + msg->fxtime = READ_FLOAT(); // fxtime; + + strncpy( m_HUDMessageText[m_lastHudMessage], READ_STRING(), 128 ); + m_HUDMessageText[m_lastHudMessage][127]=0; // text + + msg->pMessage = m_HUDMessageText[m_lastHudMessage]; + msg->pName = "HUD_MESSAGE"; + + gHUD.m_Message.MessageAdd( msg->pName, gHUD.m_flTime); + + m_lastHudMessage++; + m_lastHudMessage %= MAX_SPEC_HUD_MESSAGES; + + } + + break; + + case DRC_CMD_SOUND : + string = READ_STRING(); + value = READ_FLOAT(); + + // gEngfuncs.Con_Printf("DRC_CMD_FX_SOUND: %s %.2f\n", string, value ); + gEngfuncs.pEventAPI->EV_PlaySound(0, v_origin, CHAN_BODY, string, value, ATTN_NORM, 0, PITCH_NORM ); + + break; + + case DRC_CMD_TIMESCALE : + value = READ_FLOAT(); + break; + + + + case DRC_CMD_STATUS: + READ_LONG(); // total number of spectator slots + m_iSpectatorNumber = READ_LONG(); // total number of spectator + READ_WORD(); // total number of relay proxies + + gViewPort->UpdateSpectatorPanel(); + break; + + case DRC_CMD_BANNER: + // gEngfuncs.Con_DPrintf("GUI: Banner %s\n",READ_STRING() ); // name of banner tga eg gfx/temp/7454562234563475.tga + gViewPort->m_pSpectatorPanel->m_TopBanner->LoadImage( READ_STRING() ); + gViewPort->UpdateSpectatorPanel(); + break; + + case DRC_CMD_FADE: + /*{ + screenfade_t sf; + + sf.fader = 255; + sf.fadeg = 0; + sf.fadeb = 0; + sf.fadealpha = 128; + sf.fadeFlags = FFADE_STAYOUT | FFADE_OUT; + + // gHUD.m_flTime = cl.time + + stream->ReadFloat(); // duration + sf.stream->ReadFloat(); // holdTime + sf.fadeFlags = READ_SHORT(); // flags + stream->ReadLong(); // color RGB + + CallEnghudSetScreenFade( &sf ); + }*/ + break; + + case DRC_CMD_STUFFTEXT: + ClientCmd( READ_STRING() ); + break; + + default : gEngfuncs.Con_DPrintf("CHudSpectator::DirectorMessage: unknown command %i.\n", cmd ); + } +} + +void CHudSpectator::FindNextPlayer(bool bReverse) +{ + // MOD AUTHORS: Modify the logic of this function if you want to restrict the observer to watching + // only a subset of the players. e.g. Make it check the target's team. + + int iStart; + cl_entity_t * pEnt = NULL; + + // if we are NOT in HLTV mode, spectator targets are set on server + if ( !gEngfuncs.IsSpectateOnly() ) + { + char cmdstring[32]; + // forward command to server + sprintf(cmdstring,"follownext %i",bReverse?1:0); + gEngfuncs.pfnServerCmd(cmdstring); + return; + } + + if ( g_iUser2 ) + iStart = g_iUser2; + else + iStart = 1; + + g_iUser2 = 0; + + int iCurrent = iStart; + + int iDir = bReverse ? -1 : 1; + + // make sure we have player info + gViewPort->GetAllPlayersInfo(); + + + do + { + iCurrent += iDir; + + // Loop through the clients + if (iCurrent > MAX_PLAYERS) + iCurrent = 1; + if (iCurrent < 1) + iCurrent = MAX_PLAYERS; + + pEnt = gEngfuncs.GetEntityByIndex( iCurrent ); + + if ( !IsActivePlayer( pEnt ) ) + continue; + + // MOD AUTHORS: Add checks on target here. + + g_iUser2 = iCurrent; + break; + + } while ( iCurrent != iStart ); + + // Did we find a target? + if ( !g_iUser2 ) + { + gEngfuncs.Con_DPrintf( "No observer targets.\n" ); + // take save camera position + VectorCopy(m_cameraOrigin, vJumpOrigin); + VectorCopy(m_cameraAngles, vJumpAngles); + } + else + { + // use new entity position for roaming + VectorCopy ( pEnt->origin, vJumpOrigin ); + VectorCopy ( pEnt->angles, vJumpAngles ); + } + iJumpSpectator = 1; +} + +void CHudSpectator::HandleButtonsDown( int ButtonPressed ) +{ + if ( !gViewPort ) + return; + + //Not in intermission. + if ( gHUD.m_iIntermission ) + return; + + if ( !g_iUser1 ) + return; // dont do anything if not in spectator mode + + // don't handle buttons during normal demo playback + if ( gEngfuncs.pDemoAPI->IsPlayingback() && !gEngfuncs.IsSpectateOnly() ) + return; + + int theNewMainMode = g_iUser1; + + // Jump changes main window modes + if ( ButtonPressed & IN_JUMP ) + { + bool theFirstPerson = (g_iUser1 == OBS_IN_EYE); + bool theInOverviewMode = gHUD.m_Spectator.IsInOverviewMode(); + + // NS + if(gHUD.GetIsNSMode()) + { + // First-person full -> chase camera full -> firstperson with overview -> chase camera with overview + if(theFirstPerson && !theInOverviewMode) + { + gHUD.m_Spectator.SetMode(OBS_CHASE_LOCKED); + //gHUD.m_Spectator.SetOverviewMode(false); + } + else if(!theFirstPerson && !theInOverviewMode) + { + gHUD.m_Spectator.SetMode(OBS_IN_EYE); + gHUD.m_Spectator.SetOverviewMode(true); + } + else if(theFirstPerson && theInOverviewMode) + { + gHUD.m_Spectator.SetMode(OBS_CHASE_LOCKED); + //gHUD.m_Spectator.SetOverviewMode(true); + } + else if(!theFirstPerson && theInOverviewMode) + { + gHUD.m_Spectator.SetMode(OBS_IN_EYE); + gHUD.m_Spectator.SetOverviewMode(false); + } + } + // Combat + else + { + // First-person full -> chase camera full + if(theFirstPerson) + { + gHUD.m_Spectator.SetMode(OBS_CHASE_LOCKED); + gHUD.m_Spectator.SetOverviewMode(false); + } + else + { + gHUD.m_Spectator.SetMode(OBS_IN_EYE); + gHUD.m_Spectator.SetOverviewMode(false); + } + } + } + + //g_iUser1 = theNewMainMode; + + // Attack moves to the next player + if ( ButtonPressed & (IN_MOVELEFT | IN_MOVERIGHT) ) + { + FindNextPlayer( (ButtonPressed & IN_MOVELEFT) ? true:false ); + +// if ( g_iUser1 == OBS_ROAMING ) +// { +// gEngfuncs.SetViewAngles( vJumpAngles ); +// iJumpSpectator = 1; +// +// } + + // lease directed mode if player want to see another player + m_autoDirector->value = 0.0f; + } + +/* + double time = gEngfuncs.GetClientTime(); + + int newMainMode = g_iUser1; + int newInsetMode = m_pip->value; + + // gEngfuncs.Con_Printf(" HandleButtons:%i\n", ButtonPressed ); + if ( !gViewPort ) + return; + + //Not in intermission. + if ( gHUD.m_iIntermission ) + return; + + if ( !g_iUser1 ) + return; // dont do anything if not in spectator mode + + // don't handle buttons during normal demo playback + if ( gEngfuncs.pDemoAPI->IsPlayingback() && !gEngfuncs.IsSpectateOnly() ) + return; + // Slow down mouse clicks. + if ( m_flNextObserverInput > time ) + return; + + // enable spectator screen + if ( ButtonPressed & IN_DUCK ) + { + gViewPort->m_pSpectatorPanel->ShowMenu(!gViewPort->m_pSpectatorPanel->m_menuVisible); + } + + // 'Use' changes inset window mode + if ( ButtonPressed & IN_USE ) + { + newInsetMode = ToggleInset(true); + } + + // if not in HLTV mode, buttons are handled server side + if ( gEngfuncs.IsSpectateOnly() ) + { + // changing target or chase mode not in overviewmode without inset window + + // Jump changes main window modes + if ( ButtonPressed & IN_JUMP ) + { + if ( g_iUser1 == OBS_CHASE_LOCKED ) + newMainMode = OBS_CHASE_FREE; + + else if ( g_iUser1 == OBS_CHASE_FREE ) + newMainMode = OBS_IN_EYE; + + else if ( g_iUser1 == OBS_IN_EYE ) + newMainMode = OBS_ROAMING; + + else if ( g_iUser1 == OBS_ROAMING ) + newMainMode = OBS_MAP_FREE; + + else if ( g_iUser1 == OBS_MAP_FREE ) + newMainMode = OBS_MAP_CHASE; + + else + newMainMode = OBS_CHASE_FREE; // don't use OBS_CHASE_LOCKED anymore + } + + // Attack moves to the next player + if ( ButtonPressed & (IN_ATTACK | IN_ATTACK2) ) + { + FindNextPlayer( (ButtonPressed & IN_ATTACK2) ? true:false ); + + if ( g_iUser1 == OBS_ROAMING ) + { + gEngfuncs.SetViewAngles( vJumpAngles ); + iJumpSpectator = 1; + + } + // lease directed mode if player want to see another player + m_autoDirector->value = 0.0f; + } + } + + SetModes(newMainMode, newInsetMode); + + if ( g_iUser1 == OBS_MAP_FREE ) + { + if ( ButtonPressed & IN_FORWARD ) + m_zoomDelta = 0.01f; + + if ( ButtonPressed & IN_BACK ) + m_zoomDelta = -0.01f; + + if ( ButtonPressed & IN_MOVELEFT ) + m_moveDelta = -12.0f; + + if ( ButtonPressed & IN_MOVERIGHT ) + m_moveDelta = 12.0f; + } + + m_flNextObserverInput = time + 0.2; +*/ + +} + +void CHudSpectator::HandleButtonsUp( int ButtonPressed ) +{ + if ( !gViewPort ) + return; + + if ( !gViewPort->m_pSpectatorPanel->isVisible() ) + return; // dont do anything if not in spectator mode + + if ( ButtonPressed & (IN_FORWARD | IN_BACK) ) + m_zoomDelta = 0.0f; + + if ( ButtonPressed & (IN_MOVELEFT | IN_MOVERIGHT) ) + m_moveDelta = 0.0f; +} + +void CHudSpectator::SetMode(int iNewMainMode) +{ + // if value == -1 keep old value + if ( iNewMainMode == -1 ) + iNewMainMode = g_iUser1; + + // main modes ettings will override inset window settings + if ( iNewMainMode != g_iUser1 ) + { + // if we are NOT in HLTV mode, main spectator mode is set on server + if ( !gEngfuncs.IsSpectateOnly() ) + { + char cmdstring[32]; + // forward command to server + sprintf(cmdstring,"specmode %i",iNewMainMode ); + gEngfuncs.pfnServerCmd(cmdstring); + return; + } + else + { + if ( !g_iUser2 && (iNewMainMode !=OBS_ROAMING ) ) // make sure we have a target + { + // choose last Director object if still available + if ( IsActivePlayer( gEngfuncs.GetEntityByIndex( m_lastPrimaryObject ) ) ) + { + g_iUser2 = m_lastPrimaryObject; + g_iUser3 = m_lastSecondaryObject; + } + else + { + FindNextPlayer(false); // find any target + } + } + + switch ( iNewMainMode ) + { + case OBS_CHASE_LOCKED: + g_iUser1 = OBS_CHASE_LOCKED; + break; + + case OBS_CHASE_FREE: + g_iUser1 = OBS_CHASE_FREE; + break; + + case OBS_ROAMING : // jump to current vJumpOrigin/angle + g_iUser1 = OBS_ROAMING; + if ( g_iUser2 ) + { + V_GetChasePos( g_iUser2, v_cl_angles, vJumpOrigin, vJumpAngles ); + gEngfuncs.SetViewAngles( vJumpAngles ); + iJumpSpectator = 1; + } + break; + + case OBS_IN_EYE: + g_iUser1 = OBS_IN_EYE; + break; + + /* + case OBS_MAP_FREE : g_iUser1 = OBS_MAP_FREE; + // reset user values + m_mapZoom = m_OverviewData.zoom; + m_mapOrigin = m_OverviewData.origin; + break; + + case OBS_MAP_CHASE : g_iUser1 = OBS_MAP_CHASE; + // reset user values + m_mapZoom = m_OverviewData.zoom; + m_mapOrigin = m_OverviewData.origin; + break; + */ + } + + if ( (g_iUser1 == OBS_IN_EYE) || (g_iUser1 == OBS_ROAMING) ) + { + m_crosshairRect.left = 24; + m_crosshairRect.top = 0; + m_crosshairRect.right = 48; + m_crosshairRect.bottom = 24; + + gHUD.SetCurrentCrosshair( m_hCrosshair, m_crosshairRect, 255, 255, 255 ); + } + else + { + memset( &m_crosshairRect,0,sizeof(m_crosshairRect) ); + gHUD.SetCurrentCrosshair( 0, m_crosshairRect, 0, 0, 0 ); + } + + //char string[128]; + //sprintf(string, "#Spec_Mode%d", g_iUser1 ); + //sprintf(string, "%c%s", HUD_PRINTCENTER, CHudTextMessage::BufferedLocaliseTextString( string )); + //gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, strlen(string)+1, string ); + } + } + + gViewPort->UpdateSpectatorPanel(); +} + +bool CHudSpectator::IsActivePlayer(cl_entity_t * ent) +{ + return ( ent && + ent->player && + ent->curstate.solid != SOLID_NOT && + ent != gEngfuncs.GetLocalPlayer() && + g_PlayerInfoList[ent->index].name != NULL + ); +} + + +bool CHudSpectator::ParseOverviewFile( ) +{ + //char filename[255]; + //char levelname[255]; + //char token[1024]; + //float height; + + char *pfile = NULL; + + memset( &m_OverviewData, 0, sizeof(m_OverviewData)); + + // fill in standrd values + m_OverviewData.insetWindowX = 4; // upper left corner + m_OverviewData.insetWindowY = 4 + SPECTATOR_PANEL_HEIGHT; + m_OverviewData.insetWindowHeight = 180; + m_OverviewData.insetWindowWidth = 240; + m_OverviewData.origin[0] = 0.0f; + m_OverviewData.origin[1] = 0.0f; + m_OverviewData.origin[2] = 0.0f; + m_OverviewData.zoom = 1.0f; + m_OverviewData.layers = 0; + m_OverviewData.layersHeights[0] = 0.0f; + strcpy( m_OverviewData.map, gEngfuncs.pfnGetLevelName() ); + + if ( strlen( m_OverviewData.map ) == 0 ) + return false; // not active yet + + /* + strcpy(levelname, m_OverviewData.map + 5); + levelname[strlen(levelname)-4] = 0; + + sprintf(filename, "overviews/%s.txt", levelname ); + + pfile = (char *)gEngfuncs.COM_LoadFile( filename, 5, NULL); + + if (!pfile) + { + gEngfuncs.Con_Printf("Couldn't open file %s. Using default values for overiew mode.\n", filename ); + return false; + } + + while (true) + { + pfile = gEngfuncs.COM_ParseFile(pfile, token); + + if (!pfile) + break; + + if ( !stricmp( token, "global" ) ) + { + // parse the global data + pfile = gEngfuncs.COM_ParseFile(pfile, token); + if ( stricmp( token, "{" ) ) + { + gEngfuncs.Con_Printf("Error parsing overview file %s. (expected { )\n", filename ); + return false; + } + + pfile = gEngfuncs.COM_ParseFile(pfile,token); + + while (stricmp( token, "}") ) + { + if ( !stricmp( token, "zoom" ) ) + { + pfile = gEngfuncs.COM_ParseFile(pfile,token); + m_OverviewData.zoom = atof( token ); + } + else if ( !stricmp( token, "origin" ) ) + { + pfile = gEngfuncs.COM_ParseFile(pfile, token); + m_OverviewData.origin[0] = atof( token ); + pfile = gEngfuncs.COM_ParseFile(pfile,token); + m_OverviewData.origin[1] = atof( token ); + pfile = gEngfuncs.COM_ParseFile(pfile, token); + m_OverviewData.origin[2] = atof( token ); + } + else if ( !stricmp( token, "rotated" ) ) + { + pfile = gEngfuncs.COM_ParseFile(pfile,token); + m_OverviewData.rotated = atoi( token ); + } + else if ( !stricmp( token, "inset" ) ) + { + + // Removed by mmcguire. + // This isn't supported anymore. + pfile = gEngfuncs.COM_ParseFile(pfile,token); + //m_OverviewData.insetWindowX = atof( token ); + pfile = gEngfuncs.COM_ParseFile(pfile,token); + //m_OverviewData.insetWindowY = atof( token ); + pfile = gEngfuncs.COM_ParseFile(pfile,token); + //m_OverviewData.insetWindowWidth = atof( token ); + pfile = gEngfuncs.COM_ParseFile(pfile,token); + //m_OverviewData.insetWindowHeight = atof( token ); + + } + else + { + gEngfuncs.Con_Printf("Error parsing overview file %s. (%s unkown)\n", filename, token ); + return false; + } + + pfile = gEngfuncs.COM_ParseFile(pfile,token); // parse next token + + } + } + else if ( !stricmp( token, "layer" ) ) + { + // parse a layer data + + if ( m_OverviewData.layers == OVERVIEW_MAX_LAYERS ) + { + gEngfuncs.Con_Printf("Error parsing overview file %s. ( too many layers )\n", filename ); + return false; + } + + pfile = gEngfuncs.COM_ParseFile(pfile,token); + + + if ( stricmp( token, "{" ) ) + { + gEngfuncs.Con_Printf("Error parsing overview file %s. (expected { )\n", filename ); + return false; + } + + pfile = gEngfuncs.COM_ParseFile(pfile,token); + + while (stricmp( token, "}") ) + { + if ( !stricmp( token, "image" ) ) + { + pfile = gEngfuncs.COM_ParseFile(pfile,token); + strcpy(m_OverviewData.layersImages[ m_OverviewData.layers ], token); + + + } + else if ( !stricmp( token, "height" ) ) + { + pfile = gEngfuncs.COM_ParseFile(pfile,token); + height = atof(token); + m_OverviewData.layersHeights[ m_OverviewData.layers ] = height; + } + else + { + gEngfuncs.Con_Printf("Error parsing overview file %s. (%s unkown)\n", filename, token ); + return false; + } + + pfile = gEngfuncs.COM_ParseFile(pfile,token); // parse next token + } + + m_OverviewData.layers++; + + } + } + + gEngfuncs.COM_FreeFile( pfile ); + */ + + m_mapZoom = m_OverviewData.zoom; + m_mapOrigin = m_OverviewData.origin; + + return true; + +} + +void CHudSpectator::LoadMapSprites() +{ + // right now only support for one map layer + if (m_OverviewData.layers > 0 ) + { + m_MapSprite = gEngfuncs.LoadMapSprite( m_OverviewData.layersImages[0] ); + } + else + m_MapSprite = NULL; // the standard "unkown map" sprite will be used instead +} + +void CHudSpectator::DrawOverviewLayer() +{ + float screenaspect, xs, ys, xStep, yStep, x,y,z; + int ix,iy,i,xTiles,yTiles,frame; + + qboolean hasMapImage = m_MapSprite?TRUE:FALSE; + model_t * dummySprite = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprUnkownMap); + + if ( hasMapImage) + { + i = m_MapSprite->numframes / (4*3); + i = sqrt((float)i); + xTiles = i*4; + yTiles = i*3; + } + else + { + xTiles = 8; + yTiles = 6; + } + + + screenaspect = 4.0f/3.0f; + + + xs = m_OverviewData.origin[0]; + ys = m_OverviewData.origin[1]; + z = ( 90.0f - v_angles[0] ) / 90.0f; + z *= m_OverviewData.layersHeights[0]; // gOverviewData.z_min - 32; + + // i = r_overviewTexture + ( layer*OVERVIEW_X_TILES*OVERVIEW_Y_TILES ); + + gEngfuncs.pTriAPI->RenderMode( kRenderTransTexture ); + gEngfuncs.pTriAPI->CullFace( TRI_NONE ); + gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, 1.0 ); + + frame = 0; + + + // rotated view ? + if ( m_OverviewData.rotated ) + { + xStep = (2*4096.0f / m_OverviewData.zoom ) / xTiles; + yStep = -(2*4096.0f / (m_OverviewData.zoom* screenaspect) ) / yTiles; + + y = ys + (4096.0f / (m_OverviewData.zoom * screenaspect)); + + for (iy = 0; iy < yTiles; iy++) + { + x = xs - (4096.0f / (m_OverviewData.zoom)); + + for (ix = 0; ix < xTiles; ix++) + { + if (hasMapImage) + gEngfuncs.pTriAPI->SpriteTexture( m_MapSprite, frame ); + else + gEngfuncs.pTriAPI->SpriteTexture( dummySprite, 0 ); + + gEngfuncs.pTriAPI->Begin( TRI_QUADS ); + gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); + gEngfuncs.pTriAPI->Vertex3f (x, y, z); + + gEngfuncs.pTriAPI->TexCoord2f( 1, 0 ); + gEngfuncs.pTriAPI->Vertex3f (x+xStep ,y, z); + + gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); + gEngfuncs.pTriAPI->Vertex3f (x+xStep, y+yStep, z); + + gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); + gEngfuncs.pTriAPI->Vertex3f (x, y+yStep, z); + gEngfuncs.pTriAPI->End(); + + frame++; + x+= xStep; + } + + y+=yStep; + } + } + else + { + xStep = -(2*4096.0f / m_OverviewData.zoom ) / xTiles; + yStep = -(2*4096.0f / (m_OverviewData.zoom* screenaspect) ) / yTiles; + + + x = xs + (4096.0f / (m_OverviewData.zoom * screenaspect )); + + + + for (ix = 0; ix < yTiles; ix++) + { + + y = ys + (4096.0f / (m_OverviewData.zoom)); + + for (iy = 0; iy < xTiles; iy++) + { + if (hasMapImage) + gEngfuncs.pTriAPI->SpriteTexture( m_MapSprite, frame ); + else + gEngfuncs.pTriAPI->SpriteTexture( dummySprite, 0 ); + + gEngfuncs.pTriAPI->Begin( TRI_QUADS ); + gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); + gEngfuncs.pTriAPI->Vertex3f (x, y, z); + + gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); + gEngfuncs.pTriAPI->Vertex3f (x+xStep ,y, z); + + gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); + gEngfuncs.pTriAPI->Vertex3f (x+xStep, y+yStep, z); + + gEngfuncs.pTriAPI->TexCoord2f( 1, 0 ); + gEngfuncs.pTriAPI->Vertex3f (x, y+yStep, z); + gEngfuncs.pTriAPI->End(); + + frame++; + + y+=yStep; + } + + x+= xStep; + + } + } +} + +void CHudSpectator::DrawOverviewEntities() +{ + /* + int i,ir,ig,ib; + struct model_s *hSpriteModel; + vec3_t origin, angles, point, forward, right, left, up, world, screen, offset; + float x,y,z, r,g,b, sizeScale = 4.0f; + cl_entity_t * ent; + float rmatrix[3][4]; // transformation matrix + + float zScale = (90.0f - v_angles[0] ) / 90.0f; + + + z = m_OverviewData.layersHeights[0] * zScale; + // get yellow/brown HUD color + //UnpackRGB(ir,ig,ib, RGB_YELLOWISH); + gHUD.GetPrimaryHudColor(ir, ig, ib); + r = (float)ir/255.0f; + g = (float)ig/255.0f; + b = (float)ib/255.0f; + + gEngfuncs.pTriAPI->CullFace( TRI_NONE ); + + for (i=0; i < MAX_PLAYERS; i++ ) + m_vPlayerPos[i][2] = -1; // mark as invisible + + // draw all players + + float depthOffset = 0; + + for (i=MAX_OVERVIEW_ENTITIES - 1; i >= 0; i--) + { + if ( !m_OverviewEntities[i].hSprite ) + continue; + + hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_OverviewEntities[i].hSprite ); + ent = m_OverviewEntities[i].entity; + + int theSpriteFrame = m_OverviewEntities[i].mFrame; + gEngfuncs.pTriAPI->SpriteTexture( hSpriteModel, theSpriteFrame); + + gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd); + + // see R_DrawSpriteModel + // draws players sprite + + AngleVectors(ent->angles, right, up, NULL ); + + VectorCopy(ent->origin,origin); + + // Set origin of blip to just above map height, so blips are all drawn on map + origin.z = m_OverviewData.layersHeights[0] + kOverviewEntityZHeight + depthOffset; + + gEngfuncs.pTriAPI->Begin( TRI_QUADS ); + + float gammaSlope = gHUD.GetGammaSlope(); + + gEngfuncs.pTriAPI->Color4f( + m_OverviewEntities[i].mColorR / gammaSlope, + m_OverviewEntities[i].mColorG / gammaSlope, + m_OverviewEntities[i].mColorB / gammaSlope, + 1); + + gEngfuncs.pTriAPI->TexCoord2f (1, 0); + VectorMA (origin, 16.0f * sizeScale, up, point); + VectorMA (point, 16.0f * sizeScale, right, point); + point[2] *= zScale; + gEngfuncs.pTriAPI->Vertex3fv (point); + + gEngfuncs.pTriAPI->TexCoord2f (0, 0); + + VectorMA (origin, 16.0f * sizeScale, up, point); + VectorMA (point, -16.0f * sizeScale, right, point); + point[2] *= zScale; + gEngfuncs.pTriAPI->Vertex3fv (point); + + gEngfuncs.pTriAPI->TexCoord2f (0,1); + VectorMA (origin, -16.0f * sizeScale, up, point); + VectorMA (point, -16.0f * sizeScale, right, point); + point[2] *= zScale; + gEngfuncs.pTriAPI->Vertex3fv (point); + + gEngfuncs.pTriAPI->TexCoord2f (1,1); + VectorMA (origin, -16.0f * sizeScale, up, point); + VectorMA (point, 16.0f * sizeScale, right, point); + point[2] *= zScale; + gEngfuncs.pTriAPI->Vertex3fv (point); + + gEngfuncs.pTriAPI->End (); + + + if ( !ent->player) + continue; + // draw line under player icons + origin[2] *= zScale; + + gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd ); + + hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprBeam ); + gEngfuncs.pTriAPI->SpriteTexture( hSpriteModel, 0 ); + + gEngfuncs.pTriAPI->Color4f(r, g, b, 0.3); + + gEngfuncs.pTriAPI->Begin ( TRI_QUADS ); + gEngfuncs.pTriAPI->TexCoord2f (1, 0); + gEngfuncs.pTriAPI->Vertex3f (origin[0]+4, origin[1]+4, origin[2]-zScale); + gEngfuncs.pTriAPI->TexCoord2f (0, 0); + gEngfuncs.pTriAPI->Vertex3f (origin[0]-4, origin[1]-4, origin[2]-zScale); + gEngfuncs.pTriAPI->TexCoord2f (0, 1); + gEngfuncs.pTriAPI->Vertex3f (origin[0]-4, origin[1]-4,z); + gEngfuncs.pTriAPI->TexCoord2f (1, 1); + gEngfuncs.pTriAPI->Vertex3f (origin[0]+4, origin[1]+4,z); + gEngfuncs.pTriAPI->End (); + + gEngfuncs.pTriAPI->Begin ( TRI_QUADS ); + gEngfuncs.pTriAPI->TexCoord2f (1, 0); + gEngfuncs.pTriAPI->Vertex3f (origin[0]-4, origin[1]+4, origin[2]-zScale); + gEngfuncs.pTriAPI->TexCoord2f (0, 0); + gEngfuncs.pTriAPI->Vertex3f (origin[0]+4, origin[1]-4, origin[2]-zScale); + gEngfuncs.pTriAPI->TexCoord2f (0, 1); + gEngfuncs.pTriAPI->Vertex3f (origin[0]+4, origin[1]-4,z); + gEngfuncs.pTriAPI->TexCoord2f (1, 1); + gEngfuncs.pTriAPI->Vertex3f (origin[0]-4, origin[1]+4,z); + gEngfuncs.pTriAPI->End (); + + // calculate screen position for name and infromation in hud::draw() + if ( gEngfuncs.pTriAPI->WorldToScreen(origin,screen) ) + continue; // object is behind viewer + + screen[0] = XPROJECT(screen[0]); + screen[1] = YPROJECT(screen[1]); + screen[2] = 0.0f; + + // calculate some offset under the icon + origin[0]+=32.0f; + origin[1]+=32.0f; + + gEngfuncs.pTriAPI->WorldToScreen(origin,offset); + + offset[0] = XPROJECT(offset[0]); + offset[1] = YPROJECT(offset[1]); + offset[2] = 0.0f; + + VectorSubtract(offset, screen, offset ); + + int playerNum = ent->index - 1; + + m_vPlayerPos[playerNum][0] = screen[0]; + m_vPlayerPos[playerNum][1] = screen[1] + Length(offset); + m_vPlayerPos[playerNum][2] = 1; // mark player as visible + + + } + + if ( !m_pip || !m_drawcone->value ) + return; + + // get current camera position and angle + + if ( m_pip == INSET_IN_EYE || g_iUser1 == OBS_IN_EYE ) + { + V_GetInEyePos( g_iUser2, origin, angles ); + } + else if ( m_pip == INSET_CHASE_FREE || g_iUser1 == OBS_CHASE_FREE ) + { + V_GetChasePos( g_iUser2, v_cl_angles, origin, angles ); + } + else if ( g_iUser1 == OBS_ROAMING ) + { + VectorCopy( v_sim_org, origin ); + VectorCopy( v_cl_angles, angles ); + } + else + V_GetChasePos( g_iUser2, NULL, origin, angles ); + + + // draw camera sprite + + x = origin[0]; + y = origin[1]; + z = origin[2]; + + // Set origin of cone to just above map height, so blips are all drawn on map + z = m_OverviewData.layersHeights[0] + kOverviewEntityZHeight; + + angles[0] = 0; // always show horizontal camera sprite + + hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprCamera ); + gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd ); + gEngfuncs.pTriAPI->SpriteTexture( hSpriteModel, 0 ); + + + gEngfuncs.pTriAPI->Color4f( r, g, b, 1.0 ); + + AngleVectors(angles, forward, NULL, NULL ); + VectorScale (forward, 512.0f, forward); + + offset[0] = 0.0f; + offset[1] = 45.0f; + offset[2] = 0.0f; + + AngleMatrix(offset, rmatrix ); + VectorTransform(forward, rmatrix , right ); + + offset[1]= -45.0f; + AngleMatrix(offset, rmatrix ); + VectorTransform(forward, rmatrix , left ); + + gEngfuncs.pTriAPI->Begin (TRI_TRIANGLES); + gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); + gEngfuncs.pTriAPI->Vertex3f (x+right[0], y+right[1], (z+right[2]) * zScale); + + gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); + gEngfuncs.pTriAPI->Vertex3f (x, y, z * zScale); + + gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); + gEngfuncs.pTriAPI->Vertex3f (x+left[0], y+left[1], (z+left[2]) * zScale); + gEngfuncs.pTriAPI->End (); + */ + +} + + + +void CHudSpectator::DrawOverview() +{ + /* + // draw only in sepctator mode + if ( !g_iUser1 ) + return; + + // Only draw the overview if Map Mode is selected for this view + if ( m_iDrawCycle == 0 && ( (g_iUser1 != OBS_MAP_FREE) && (g_iUser1 != OBS_MAP_CHASE) ) ) + return; + + if ( m_iDrawCycle == 1 && m_pip->value < INSET_MAP_FREE ) + return; + + DrawOverviewLayer(); + DrawOverviewEntities(); + CheckOverviewEntities(); + */ + +} + + + +void CHudSpectator::CheckOverviewEntities() +{ + double time = gEngfuncs.GetClientTime(); + + // removes old entities from list + for ( int i = 0; i< MAX_OVERVIEW_ENTITIES; i++ ) + { + // remove entity from list if it is too old + if ( m_OverviewEntities[i].killTime < time ) + { + memset( &m_OverviewEntities[i], 0, sizeof (overviewEntity_t) ); + } + } +} + +bool CHudSpectator::AddOverviewEntity( int type, struct cl_entity_s *ent, const char *modelname) +{ + HSPRITE hSprite = 0; + double duration = -1.0f; // duration -1 means show it only this frame; + int theFrame = 0; + bool theSuccess = false; + int theRenderMode; + + if ( ent ) + { + + if (ent->curstate.solid != SOLID_NOT) + { + gHUD.GetSpriteForUser3(AvHUser3(ent->curstate.iuser3), hSprite, theFrame, theRenderMode); + } + + /* + if ( type == ET_PLAYER ) + { + if ( ent->curstate.solid != SOLID_NOT) + { + int thePlayerClass = g_PlayerExtraInfo[ent->index].playerclass; + switch(thePlayerClass) + { + case PLAYERCLASS_ALIVE_MARINE: + hSprite = this->m_hsprPlayerMarine; + theFrame = 0; + break; + case PLAYERCLASS_ALIVE_HEAVY_MARINE: + hSprite = this->m_hsprPlayerMarine; + theFrame = 1; + break; + case PLAYERCLASS_COMMANDER: + hSprite = this->m_hsprPlayerMarine; + theFrame = 2; + break; + case PLAYERCLASS_ALIVE_LEVEL1: + hSprite = this->m_hsprPlayerAlien; + theFrame = 0; + break; + case PLAYERCLASS_ALIVE_LEVEL2: + hSprite = this->m_hsprPlayerAlien; + theFrame = 1; + break; + case PLAYERCLASS_ALIVE_LEVEL3: + hSprite = this->m_hsprPlayerAlien; + theFrame = 2; + break; + case PLAYERCLASS_ALIVE_LEVEL4: + hSprite = this->m_hsprPlayerAlien; + theFrame = 3; + break; + case PLAYERCLASS_ALIVE_LEVEL5: + hSprite = this->m_hsprPlayerAlien; + theFrame = 4; + break; + case PLAYERCLASS_ALIVE_GESTATING: + hSprite = this->m_hsprPlayerAlien; + theFrame = 5; + break; + + case PLAYERCLASS_ALIVE_DIGESTING: + break; + } + } + else + { + // it's an spectator + } + } + else if (type == ET_NORMAL) + { + // Now help icons + if(hSprite == 0) + { + AvHUser3 theUser3 = AvHUser3(ent->curstate.iuser3); + theFrame = gHUD.GetHelpIconFrameFromUser3(theUser3); + if(theFrame != -1) + { + hSprite = gHUD.GetHelpSprite(); + } + } + } + */ + } + + if(hSprite > 0) + { + + int theTeam = ent->curstate.team; + + float theR = kFTeamColors[theTeam][0]; + float theG = kFTeamColors[theTeam][1]; + float theB = kFTeamColors[theTeam][2]; + + theSuccess = AddOverviewEntityToList(hSprite, ent, gEngfuncs.GetClientTime() + duration, theFrame, theRenderMode, theR, theG, theB); + + } + + return theSuccess; +} + +void CHudSpectator::DeathMessage(int victim) +{ + // find out where the victim is + cl_entity_t *pl = gEngfuncs.GetEntityByIndex(victim); + + if (pl && pl->player) + AddOverviewEntityToList(m_hsprPlayerDead, pl, gEngfuncs.GetClientTime() + 2.0f, 0, kRenderTransTexture, 1, 1, 1); +} + +bool CHudSpectator::AddOverviewEntityToList(HSPRITE sprite, cl_entity_t *ent, double killTime, int inFrame, int inRenderMode, float r, float g, float b) +{ + for ( int i = 0; i< MAX_OVERVIEW_ENTITIES; i++ ) + { + // find empty entity slot + if ( m_OverviewEntities[i].entity == NULL) + { + m_OverviewEntities[i].entity = ent; + m_OverviewEntities[i].hSprite = sprite; + m_OverviewEntities[i].killTime = killTime; + m_OverviewEntities[i].mFrame = inFrame; + m_OverviewEntities[i].mRenderMode = inRenderMode; + m_OverviewEntities[i].mColorR = r; + m_OverviewEntities[i].mColorG = g; + m_OverviewEntities[i].mColorB = b; + return true; + } + } + + return false; // maximum overview entities reached +} +void CHudSpectator::CheckSettings() +{ + // disallow same inset mode as main mode: + + //m_pip->value = floor(m_pip->value); + + // Removed by mmcguire. + /* + if ( ( g_iUser1 < OBS_MAP_FREE ) && ( m_pip->value == INSET_CHASE_LOCKED || m_pip->value == INSET_IN_EYE ) ) + { + // otherwise both would show in World picures + m_pip->value = INSET_OFF; + } + + // disble in intermission screen + if ( gHUD.m_iIntermission ) + m_pip->value = INSET_OFF; + */ + + // check chat mode + if ( m_chatEnabled != (gHUD.m_SayText.m_HUD_saytext->value!=0) ) + { + // hud_saytext changed + m_chatEnabled = (gHUD.m_SayText.m_HUD_saytext->value!=0); + + if ( gEngfuncs.IsSpectateOnly() ) + { + // tell proxy our new chat mode + char chatcmd[32]; + sprintf(chatcmd, "ignoremsg %i", m_chatEnabled?0:1 ); + gEngfuncs.pfnServerCmd(chatcmd); + } + } + + // HL/TFC has no oberserver corsshair, so set it client side + if ( g_iUser1 == OBS_IN_EYE ) + { + m_crosshairRect.left = 24; + m_crosshairRect.top = 0; + m_crosshairRect.right = 48; + m_crosshairRect.bottom = 24; + + gHUD.SetCurrentCrosshair( m_hCrosshair, m_crosshairRect, 255, 255, 255 ); + } + else + { + memset( &m_crosshairRect,0,sizeof(m_crosshairRect) ); + gHUD.SetCurrentCrosshair( 0, m_crosshairRect, 0, 0, 0 ); + } + + // Removed by mmcguire. + /* + // if we are a real player on server don't allow inset window + // in First Person mode since this is our resticted forcecamera mode 2 + // team number 3 = SPECTATOR see player.h + + if ( ( (g_iTeamNumber == 1) || (g_iTeamNumber == 2)) && (g_iUser1 == OBS_IN_EYE) ) + m_pip->value = INSET_OFF; + */ + + // draw small border around inset view, adjust upper black bar + //gViewPort->m_pSpectatorPanel->EnableInsetView( m_pip->value != INSET_OFF ); + gViewPort->m_pSpectatorPanel->EnableInsetView( IsInOverviewMode() ); + +} + + +void CHudSpectator::Reset() +{ + // Reset HUD + if ( strcmp( m_OverviewData.map, gEngfuncs.pfnGetLevelName() ) ) + { + // update level overview if level changed + ParseOverviewFile(); + LoadMapSprites(); + } + + memset( &m_OverviewEntities, 0, sizeof(m_OverviewEntities)); + + SetSpectatorStartPosition(); +} + +void CHudSpectator::InitHUDData() +{ + m_lastPrimaryObject = m_lastSecondaryObject = 0; + m_flNextObserverInput = 0.0f; + m_lastHudMessage = 0; + m_iSpectatorNumber = 0; + iJumpSpectator = 0; + g_iUser1 = g_iUser2 = 0; + + memset( &m_OverviewData, 0, sizeof(m_OverviewData)); + memset( &m_OverviewEntities, 0, sizeof(m_OverviewEntities)); + + if ( gEngfuncs.IsSpectateOnly() || gEngfuncs.pDemoAPI->IsPlayingback() ) + m_autoDirector->value = 1.0f; + else + m_autoDirector->value = 0.0f; + + Reset(); + + SetMode( OBS_CHASE_FREE); + + g_iUser2 = 0; // fake not target until first camera command + + // reset HUD FOV + gHUD.m_iFOV = CVAR_GET_FLOAT("default_fov"); +} + diff --git a/main/source/cl_dll/hud_spectator.h b/main/source/cl_dll/hud_spectator.h new file mode 100644 index 00000000..91816a17 --- /dev/null +++ b/main/source/cl_dll/hud_spectator.h @@ -0,0 +1,143 @@ +//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef SPECTATOR_H +#define SPECTATOR_H +#pragma once + +#include "cl_entity.h" + +// Removed by mmcguire. +/* +#define INSET_OFF 0 +#define INSET_CHASE_LOCKED 1 +#define INSET_IN_EYE 2 +*/ + +#define MAX_SPEC_HUD_MESSAGES 8 + + + +#define OVERVIEW_TILE_SIZE 128 // don't change this +#define OVERVIEW_MAX_LAYERS 1 + +//----------------------------------------------------------------------------- +// Purpose: Handles the drawing of the spectator stuff (camera & top-down map and all the things on it ) +//----------------------------------------------------------------------------- + +typedef struct overviewInfo_s { + char map[64]; // cl.levelname or empty + vec3_t origin; // center of map + float zoom; // zoom of map images + int layers; // how may layers do we have + float layersHeights[OVERVIEW_MAX_LAYERS]; + char layersImages[OVERVIEW_MAX_LAYERS][255]; + qboolean rotated; // are map images rotated (90 degrees) ? + + int insetWindowX; + int insetWindowY; + int insetWindowHeight; + int insetWindowWidth; +} overviewInfo_t; + +typedef struct overviewEntity_s { + + HSPRITE hSprite; + struct cl_entity_s * entity; + double killTime; + int mFrame; + int mRenderMode; + float mColorR; + float mColorG; + float mColorB; +} overviewEntity_t; + +#define MAX_OVERVIEW_ENTITIES 256 +const int kOverviewEntityZHeight = 100; + +class CHudSpectator : public CHudBase +{ +public: + void Reset(); + void CheckSettings(); + void InitHUDData( void ); + bool AddOverviewEntityToList( HSPRITE sprite, cl_entity_t * ent, double killTime, int inFrame, int inRenderMode, float r, float g, float b); + void DeathMessage(int victim); + bool AddOverviewEntity( int type, struct cl_entity_s *ent, const char *modelname ); + void CheckOverviewEntities(); + void DrawOverview(); + void DrawOverviewEntities(); + void GetMapPosition( float * returnvec ); + void DrawOverviewLayer(); + void LoadMapSprites(); + bool ParseOverviewFile(); + bool IsActivePlayer(cl_entity_t * ent); + void SetMode(int iMainMode); + void HandleButtonsDown(int ButtonPressed); + void HandleButtonsUp(int ButtonPressed); + void FindNextPlayer( bool bReverse ); + void DirectorMessage( int iSize, void *pbuf ); + void SetSpectatorStartPosition(); + int Init(); + int VidInit(); + + bool IsInOverviewMode() const; + void SetOverviewMode(bool overviewMode); + + int Draw(float flTime); + void DrawOverviewMap(); + + int m_iDrawCycle; + client_textmessage_t m_HUDMessages[MAX_SPEC_HUD_MESSAGES]; + char m_HUDMessageText[MAX_SPEC_HUD_MESSAGES][128]; + int m_lastHudMessage; + overviewInfo_t m_OverviewData; + overviewEntity_t m_OverviewEntities[MAX_OVERVIEW_ENTITIES]; + int m_iObserverFlags; + int m_iSpectatorNumber; + + float m_mapZoom; // zoom the user currently uses + vec3_t m_mapOrigin; // origin where user rotates around + cvar_t * m_drawnames; + cvar_t * m_drawcone; + cvar_t * m_drawstatus; + cvar_t * m_autoDirector; + + // Removed by mmcguire. + bool m_overviewMode; + //cvar_t * m_overview; + //cvar_t * m_pip; + + + qboolean m_chatEnabled; + + vec3_t m_cameraOrigin; // a help camera + vec3_t m_cameraAngles; // and it's angles + +private: + vec3_t m_vPlayerPos[MAX_PLAYERS]; + HSPRITE m_hsprPlayerMarine; + HSPRITE m_hsprPlayerAlien; + HSPRITE m_hsprCamera; + HSPRITE m_hsprPlayerDead; + HSPRITE m_hsprViewcone; + HSPRITE m_hsprUnkownMap; + HSPRITE m_hsprBeam; + HSPRITE m_hCrosshair; + HSPRITE m_hsprWhite; + + wrect_t m_crosshairRect; + + struct model_s * m_MapSprite; // each layer image is saved in one sprite, where each tile is a sprite frame + float m_flNextObserverInput; + float m_zoomDelta; + float m_moveDelta; + int m_lastPrimaryObject; + int m_lastSecondaryObject; +}; + +#endif // SPECTATOR_H diff --git a/main/source/cl_dll/hud_update.cpp b/main/source/cl_dll/hud_update.cpp new file mode 100644 index 00000000..c8ccbac2 --- /dev/null +++ b/main/source/cl_dll/hud_update.cpp @@ -0,0 +1,54 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// hud_update.cpp +// + +#include +#include "hud.h" +#include "cl_util.h" +#include +#include + +int CL_ButtonBits( int ); +void CL_ResetButtonBits( int bits ); + +extern float v_idlescale; +float in_fov; +extern void HUD_SetCmdBits( int bits ); + +int CHud::UpdateClientData(client_data_t *cdata, float time) +{ + memcpy(m_vecOrigin, cdata->origin, sizeof(vec3_t)); + memcpy(m_vecAngles, cdata->viewangles, sizeof(vec3_t)); + + m_iKeyBits = CL_ButtonBits( 0 ); + m_iWeaponBits = cdata->iWeaponBits; + + in_fov = cdata->fov; + + Think(); + + cdata->fov = m_iFOV; + + v_idlescale = m_iConcussionEffect; + + CL_ResetButtonBits( m_iKeyBits ); + + // return 1 if in anything in the client_data struct has been changed, 0 otherwise + return 1; +} + + diff --git a/main/source/cl_dll/in_camera.cpp b/main/source/cl_dll/in_camera.cpp new file mode 100644 index 00000000..7a7b3d08 --- /dev/null +++ b/main/source/cl_dll/in_camera.cpp @@ -0,0 +1,645 @@ +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" + +#include "APIProxy.h" +#include "Exports.h" + +#include "windows.h" +#include "build.h" + +float CL_KeyState (kbutton_t *key); +extern "C" +{ + void CL_DLLEXPORT CAM_Think( void ); + int CL_DLLEXPORT CL_IsThirdPerson( void ); + void CL_DLLEXPORT CL_CameraOffset( float *ofs ); +} + +extern cl_enginefunc_t gEngfuncs; + +//-------------------------------------------------- Constants + +#define CAM_DIST_DELTA 1.0 +#define CAM_ANGLE_DELTA 2.5 +#define CAM_ANGLE_SPEED 2.5 +#define CAM_MIN_DIST 30.0 +#define CAM_ANGLE_MOVE .5 +#define MAX_ANGLE_DIFF 10.0 +#define PITCH_MAX 90.0 +#define PITCH_MIN 0 +#define YAW_MAX 135.0 +#define YAW_MIN -135.0 + +enum ECAM_Command +{ + CAM_COMMAND_NONE = 0, + CAM_COMMAND_TOTHIRDPERSON = 1, + CAM_COMMAND_TOFIRSTPERSON = 2 +}; + +//-------------------------------------------------- Global Variables + +cvar_t *cam_command; +cvar_t *cam_snapto; +cvar_t *cam_idealyaw; +cvar_t *cam_idealpitch; +cvar_t *cam_idealdist; +cvar_t *cam_contain; + +cvar_t *c_maxpitch; +cvar_t *c_minpitch; +cvar_t *c_maxyaw; +cvar_t *c_minyaw; +cvar_t *c_maxdistance; +cvar_t *c_mindistance; + +// pitch, yaw, dist +vec3_t cam_ofs; + + +// In third person +int cam_thirdperson; +int cam_mousemove; //true if we are moving the cam with the mouse, False if not +int iMouseInUse=0; +int cam_distancemove; +extern int mouse_x, mouse_y; //used to determine what the current x and y values are +int cam_old_mouse_x, cam_old_mouse_y; //holds the last ticks mouse movement +POINT cam_mouse; +//-------------------------------------------------- Local Variables + +static kbutton_t cam_pitchup, cam_pitchdown, cam_yawleft, cam_yawright; +static kbutton_t cam_in, cam_out, cam_move; + +//-------------------------------------------------- Prototypes + +void CAM_ToThirdPerson(void); +void CAM_ToFirstPerson(void); +void CAM_StartDistance(void); +void CAM_EndDistance(void); + + +//-------------------------------------------------- Local Functions + +float MoveToward( float cur, float goal, float maxspeed ) +{ + if( cur != goal ) + { + if( abs( cur - goal ) > 180.0 ) + { + if( cur < goal ) + cur += 360.0; + else + cur -= 360.0; + } + + if( cur < goal ) + { + if( cur < goal - 1.0 ) + cur += ( goal - cur ) / 4.0; + else + cur = goal; + } + else + { + if( cur > goal + 1.0 ) + cur -= ( cur - goal ) / 4.0; + else + cur = goal; + } + } + + + // bring cur back into range + if( cur < 0 ) + cur += 360.0; + else if( cur >= 360 ) + cur -= 360; + + return cur; +} + + +//-------------------------------------------------- Gobal Functions + +typedef struct +{ + vec3_t boxmins, boxmaxs;// enclose the test object along entire move + float *mins, *maxs; // size of the moving object + vec3_t mins2, maxs2; // size when clipping against mosnters + float *start, *end; + trace_t trace; + int type; + edict_t *passedict; + qboolean monsterclip; +} moveclip_t; + +extern trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end); + +void CL_DLLEXPORT CAM_Think( void ) +{ + RecClCamThink(); + +#ifdef HL_CAMERA + vec3_t origin; + vec3_t ext, pnt, camForward, camRight, camUp; + moveclip_t clip; + float dist; + vec3_t camAngles; + float flSensitivity; +#ifdef LATER + int i; +#endif + vec3_t viewangles; + + switch( (int) cam_command->value ) + { + case CAM_COMMAND_TOTHIRDPERSON: + CAM_ToThirdPerson(); + break; + + case CAM_COMMAND_TOFIRSTPERSON: + CAM_ToFirstPerson(); + break; + + case CAM_COMMAND_NONE: + default: + break; + } + + if( !cam_thirdperson ) + return; + +#ifdef LATER + if ( cam_contain->value ) + { + gEngfuncs.GetClientOrigin( origin ); + ext[0] = ext[1] = ext[2] = 0.0; + } +#endif + + camAngles[ PITCH ] = cam_idealpitch->value; + camAngles[ YAW ] = cam_idealyaw->value; + dist = cam_idealdist->value; + // + //movement of the camera with the mouse + // + if (cam_mousemove) + { + //get windows cursor position + GetCursorPos (&cam_mouse); + //check for X delta values and adjust accordingly + //eventually adjust YAW based on amount of movement + //don't do any movement of the cam using YAW/PITCH if we are zooming in/out the camera + if (!cam_distancemove) + { + + //keep the camera within certain limits around the player (ie avoid certain bad viewing angles) + if (cam_mouse.x>gEngfuncs.GetWindowCenterX()) + { + //if ((camAngles[YAW]>=225.0)||(camAngles[YAW]<135.0)) + if (camAngles[YAW]value) + { + camAngles[ YAW ] += (CAM_ANGLE_MOVE)*((cam_mouse.x-gEngfuncs.GetWindowCenterX())/2); + } + if (camAngles[YAW]>c_maxyaw->value) + { + + camAngles[YAW]=c_maxyaw->value; + } + } + else if (cam_mouse.x225.0)) + if (camAngles[YAW]>c_minyaw->value) + { + camAngles[ YAW ] -= (CAM_ANGLE_MOVE)* ((gEngfuncs.GetWindowCenterX()-cam_mouse.x)/2); + + } + if (camAngles[YAW]value) + { + camAngles[YAW]=c_minyaw->value; + + } + } + + //check for y delta values and adjust accordingly + //eventually adjust PITCH based on amount of movement + //also make sure camera is within bounds + if (cam_mouse.y>gEngfuncs.GetWindowCenterY()) + { + if(camAngles[PITCH]value) + { + camAngles[PITCH] +=(CAM_ANGLE_MOVE)* ((cam_mouse.y-gEngfuncs.GetWindowCenterY())/2); + } + if (camAngles[PITCH]>c_maxpitch->value) + { + camAngles[PITCH]=c_maxpitch->value; + } + } + else if (cam_mouse.yc_minpitch->value) + { + camAngles[PITCH] -= (CAM_ANGLE_MOVE)*((gEngfuncs.GetWindowCenterY()-cam_mouse.y)/2); + } + if (camAngles[PITCH]value) + { + camAngles[PITCH]=c_minpitch->value; + } + } + + //set old mouse coordinates to current mouse coordinates + //since we are done with the mouse + + if ( ( flSensitivity = gHUD.GetSensitivity() ) != 0 ) + { + cam_old_mouse_x=cam_mouse.x*flSensitivity; + cam_old_mouse_y=cam_mouse.y*flSensitivity; + } + else + { + cam_old_mouse_x=cam_mouse.x; + cam_old_mouse_y=cam_mouse.y; + } + SetCursorPos (gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + } + } + + //Nathan code here + if( CL_KeyState( &cam_pitchup ) ) + camAngles[ PITCH ] += CAM_ANGLE_DELTA; + else if( CL_KeyState( &cam_pitchdown ) ) + camAngles[ PITCH ] -= CAM_ANGLE_DELTA; + + if( CL_KeyState( &cam_yawleft ) ) + camAngles[ YAW ] -= CAM_ANGLE_DELTA; + else if( CL_KeyState( &cam_yawright ) ) + camAngles[ YAW ] += CAM_ANGLE_DELTA; + + if( CL_KeyState( &cam_in ) ) + { + dist -= CAM_DIST_DELTA; + if( dist < CAM_MIN_DIST ) + { + // If we go back into first person, reset the angle + camAngles[ PITCH ] = 0; + camAngles[ YAW ] = 0; + dist = CAM_MIN_DIST; + } + + } + else if( CL_KeyState( &cam_out ) ) + dist += CAM_DIST_DELTA; + + if (cam_distancemove) + { + if (cam_mouse.y>gEngfuncs.GetWindowCenterY()) + { + if(distvalue) + { + dist +=CAM_DIST_DELTA * ((cam_mouse.y-gEngfuncs.GetWindowCenterY())/2); + } + if (dist>c_maxdistance->value) + { + dist=c_maxdistance->value; + } + } + else if (cam_mouse.yc_mindistance->value) + { + dist -= (CAM_DIST_DELTA)*((gEngfuncs.GetWindowCenterY()-cam_mouse.y)/2); + } + if (distvalue) + { + dist=c_mindistance->value; + } + } + //set old mouse coordinates to current mouse coordinates + //since we are done with the mouse + cam_old_mouse_x=cam_mouse.x*gHUD.GetSensitivity(); + cam_old_mouse_y=cam_mouse.y*gHUD.GetSensitivity(); + SetCursorPos (gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + } +#ifdef LATER + if( cam_contain->value ) + { + // check new ideal + VectorCopy( origin, pnt ); + AngleVectors( camAngles, camForward, camRight, camUp ); + for (i=0 ; i<3 ; i++) + pnt[i] += -dist*camForward[i]; + + // check line from r_refdef.vieworg to pnt + memset ( &clip, 0, sizeof ( moveclip_t ) ); + clip.trace = SV_ClipMoveToEntity( sv.edicts, r_refdef.vieworg, ext, ext, pnt ); + if( clip.trace.fraction == 1.0 ) + { + // update ideal + cam_idealpitch->value = camAngles[ PITCH ]; + cam_idealyaw->value = camAngles[ YAW ]; + cam_idealdist->value = dist; + } + } + else +#endif + { + // update ideal + cam_idealpitch->value = camAngles[ PITCH ]; + cam_idealyaw->value = camAngles[ YAW ]; + cam_idealdist->value = dist; + } + + // Move towards ideal + VectorCopy( cam_ofs, camAngles ); + + gEngfuncs.GetViewAngles( (float *)viewangles ); + + if( cam_snapto->value ) + { + camAngles[ YAW ] = cam_idealyaw->value + viewangles[ YAW ]; + camAngles[ PITCH ] = cam_idealpitch->value + viewangles[ PITCH ]; + camAngles[ 2 ] = cam_idealdist->value; + } + else + { + if( camAngles[ YAW ] - viewangles[ YAW ] != cam_idealyaw->value ) + camAngles[ YAW ] = MoveToward( camAngles[ YAW ], cam_idealyaw->value + viewangles[ YAW ], CAM_ANGLE_SPEED ); + + if( camAngles[ PITCH ] - viewangles[ PITCH ] != cam_idealpitch->value ) + camAngles[ PITCH ] = MoveToward( camAngles[ PITCH ], cam_idealpitch->value + viewangles[ PITCH ], CAM_ANGLE_SPEED ); + + if( abs( camAngles[ 2 ] - cam_idealdist->value ) < 2.0 ) + camAngles[ 2 ] = cam_idealdist->value; + else + camAngles[ 2 ] += ( cam_idealdist->value - camAngles[ 2 ] ) / 4.0; + } +#ifdef LATER + if( cam_contain->value ) + { + // Test new position + dist = camAngles[ ROLL ]; + camAngles[ ROLL ] = 0; + + VectorCopy( origin, pnt ); + AngleVectors( camAngles, camForward, camRight, camUp ); + for (i=0 ; i<3 ; i++) + pnt[i] += -dist*camForward[i]; + + // check line from r_refdef.vieworg to pnt + memset ( &clip, 0, sizeof ( moveclip_t ) ); + ext[0] = ext[1] = ext[2] = 0.0; + clip.trace = SV_ClipMoveToEntity( sv.edicts, r_refdef.vieworg, ext, ext, pnt ); + if( clip.trace.fraction != 1.0 ) + return; + } +#endif + cam_ofs[ 0 ] = camAngles[ 0 ]; + cam_ofs[ 1 ] = camAngles[ 1 ]; + cam_ofs[ 2 ] = dist; + +// HL_CAMERA +#endif +} + +extern void KeyDown (kbutton_t *b); // HACK +extern void KeyUp (kbutton_t *b); // HACK + +void CAM_PitchUpDown(void) { KeyDown( &cam_pitchup ); } +void CAM_PitchUpUp(void) { KeyUp( &cam_pitchup ); } +void CAM_PitchDownDown(void) { KeyDown( &cam_pitchdown ); } +void CAM_PitchDownUp(void) { KeyUp( &cam_pitchdown ); } +void CAM_YawLeftDown(void) { KeyDown( &cam_yawleft ); } +void CAM_YawLeftUp(void) { KeyUp( &cam_yawleft ); } +void CAM_YawRightDown(void) { KeyDown( &cam_yawright ); } +void CAM_YawRightUp(void) { KeyUp( &cam_yawright ); } +void CAM_InDown(void) { KeyDown( &cam_in ); } +void CAM_InUp(void) { KeyUp( &cam_in ); } +void CAM_OutDown(void) { KeyDown( &cam_out ); } +void CAM_OutUp(void) { KeyUp( &cam_out ); } + +void CAM_ToThirdPerson(void) +{ + vec3_t viewangles; + +#if !defined( DEBUG ) + if ( gEngfuncs.GetMaxClients() > 1 ) + { + // no thirdperson in multiplayer. + return; + } +#endif + + gEngfuncs.GetViewAngles( (float *)viewangles ); + + if( !cam_thirdperson ) + { + cam_thirdperson = 1; + + cam_ofs[ YAW ] = viewangles[ YAW ]; + cam_ofs[ PITCH ] = viewangles[ PITCH ]; + cam_ofs[ 2 ] = CAM_MIN_DIST; + } + + gEngfuncs.Cvar_SetValue( "cam_command", 0 ); +} + +void CAM_ToFirstPerson(void) +{ + cam_thirdperson = 0; + + gEngfuncs.Cvar_SetValue( "cam_command", 0 ); +} + +void CAM_ToggleSnapto( void ) +{ + cam_snapto->value = !cam_snapto->value; +} + +void CAM_Toggle( void ) +{ + int a = 0; + +#ifdef DEBUG + if(cam_thirdperson) + { + CAM_ToFirstPerson(); + } + else + { + CAM_ToThirdPerson(); + } +#endif +} + +void CAM_Init( void ) +{ + gEngfuncs.pfnAddCommand( "+campitchup", CAM_PitchUpDown ); + gEngfuncs.pfnAddCommand( "-campitchup", CAM_PitchUpUp ); + gEngfuncs.pfnAddCommand( "+campitchdown", CAM_PitchDownDown ); + gEngfuncs.pfnAddCommand( "-campitchdown", CAM_PitchDownUp ); + gEngfuncs.pfnAddCommand( "+camyawleft", CAM_YawLeftDown ); + gEngfuncs.pfnAddCommand( "-camyawleft", CAM_YawLeftUp ); + gEngfuncs.pfnAddCommand( "+camyawright", CAM_YawRightDown ); + gEngfuncs.pfnAddCommand( "-camyawright", CAM_YawRightUp ); + gEngfuncs.pfnAddCommand( "+camin", CAM_InDown ); + gEngfuncs.pfnAddCommand( "-camin", CAM_InUp ); + gEngfuncs.pfnAddCommand( "+camout", CAM_OutDown ); + gEngfuncs.pfnAddCommand( "-camout", CAM_OutUp ); + gEngfuncs.pfnAddCommand( "thirdperson", CAM_ToThirdPerson ); + gEngfuncs.pfnAddCommand( "firstperson", CAM_ToFirstPerson ); + gEngfuncs.pfnAddCommand( "+cammousemove",CAM_StartMouseMove); + gEngfuncs.pfnAddCommand( "-cammousemove",CAM_EndMouseMove); + gEngfuncs.pfnAddCommand( "+camdistance", CAM_StartDistance ); + gEngfuncs.pfnAddCommand( "-camdistance", CAM_EndDistance ); + gEngfuncs.pfnAddCommand( "snapto", CAM_ToggleSnapto ); +#ifdef DEBUG + gEngfuncs.pfnAddCommand( "camtoggle", CAM_Toggle ); +#endif + + cam_command = gEngfuncs.pfnRegisterVariable ( "cam_command", "0", 0 ); // tells camera to go to thirdperson + cam_snapto = gEngfuncs.pfnRegisterVariable ( "cam_snapto", "0", 0 ); // snap to thirdperson view + cam_idealyaw = gEngfuncs.pfnRegisterVariable ( "cam_idealyaw", "90", 0 ); // thirdperson yaw + cam_idealpitch = gEngfuncs.pfnRegisterVariable ( "cam_idealpitch", "0", 0 ); // thirperson pitch + cam_idealdist = gEngfuncs.pfnRegisterVariable ( "cam_idealdist", "64", 0 ); // thirdperson distance + cam_contain = gEngfuncs.pfnRegisterVariable ( "cam_contain", "0", 0 ); // contain camera to world + + c_maxpitch = gEngfuncs.pfnRegisterVariable ( "c_maxpitch", "90.0", 0 ); + c_minpitch = gEngfuncs.pfnRegisterVariable ( "c_minpitch", "0.0", 0 ); + c_maxyaw = gEngfuncs.pfnRegisterVariable ( "c_maxyaw", "135.0", 0 ); + c_minyaw = gEngfuncs.pfnRegisterVariable ( "c_minyaw", "-135.0", 0 ); + c_maxdistance = gEngfuncs.pfnRegisterVariable ( "c_maxdistance", "200.0", 0 ); + c_mindistance = gEngfuncs.pfnRegisterVariable ( "c_mindistance", "30.0", 0 ); +} + +void CAM_ClearStates( void ) +{ + vec3_t viewangles; + + gEngfuncs.GetViewAngles( (float *)viewangles ); + + cam_pitchup.state = 0; + cam_pitchdown.state = 0; + cam_yawleft.state = 0; + cam_yawright.state = 0; + cam_in.state = 0; + cam_out.state = 0; + + cam_thirdperson = 0; + cam_command->value = 0; + cam_mousemove=0; + + cam_snapto->value = 0; + cam_distancemove = 0; + + cam_ofs[ 0 ] = 0.0; + cam_ofs[ 1 ] = 0.0; + cam_ofs[ 2 ] = CAM_MIN_DIST; + + cam_idealpitch->value = viewangles[ PITCH ]; + cam_idealyaw->value = viewangles[ YAW ]; + cam_idealdist->value = CAM_MIN_DIST; +} + +void CAM_StartMouseMove(void) +{ + float flSensitivity; + + //only move the cam with mouse if we are in third person. + if (cam_thirdperson) + { + //set appropriate flags and initialize the old mouse position + //variables for mouse camera movement + if (!cam_mousemove) + { + cam_mousemove=1; + iMouseInUse=1; + GetCursorPos (&cam_mouse); + + if ( ( flSensitivity = gHUD.GetSensitivity() ) != 0 ) + { + cam_old_mouse_x=cam_mouse.x*flSensitivity; + cam_old_mouse_y=cam_mouse.y*flSensitivity; + } + else + { + cam_old_mouse_x=cam_mouse.x; + cam_old_mouse_y=cam_mouse.y; + } + } + } + //we are not in 3rd person view..therefore do not allow camera movement + else + { + cam_mousemove=0; + iMouseInUse=0; + } +} + +//the key has been released for camera movement +//tell the engine that mouse camera movement is off +void CAM_EndMouseMove(void) +{ + cam_mousemove=0; + iMouseInUse=0; +} + + +//---------------------------------------------------------- +//routines to start the process of moving the cam in or out +//using the mouse +//---------------------------------------------------------- +void CAM_StartDistance(void) +{ + //only move the cam with mouse if we are in third person. + if (cam_thirdperson) + { + //set appropriate flags and initialize the old mouse position + //variables for mouse camera movement + if (!cam_distancemove) + { + cam_distancemove=1; + cam_mousemove=1; + iMouseInUse=1; + GetCursorPos (&cam_mouse); + cam_old_mouse_x=cam_mouse.x*gHUD.GetSensitivity(); + cam_old_mouse_y=cam_mouse.y*gHUD.GetSensitivity(); + } + } + //we are not in 3rd person view..therefore do not allow camera movement + else + { + cam_distancemove=0; + cam_mousemove=0; + iMouseInUse=0; + } +} + +//the key has been released for camera movement +//tell the engine that mouse camera movement is off +void CAM_EndDistance(void) +{ + cam_distancemove=0; + cam_mousemove=0; + iMouseInUse=0; +} + +int CL_DLLEXPORT CL_IsThirdPerson( void ) +{ + RecClCL_IsThirdPerson(); + return (cam_thirdperson ? 1 : 0) || (g_iUser1 && (g_iUser2 == gEngfuncs.GetLocalPlayer()->index) ); +} + +void CL_DLLEXPORT CL_CameraOffset( float *ofs ) +{ + RecClCL_GetCameraOffsets(ofs); + + VectorCopy( cam_ofs, ofs ); +} \ No newline at end of file diff --git a/main/source/cl_dll/in_defs.h b/main/source/cl_dll/in_defs.h new file mode 100644 index 00000000..60d99feb --- /dev/null +++ b/main/source/cl_dll/in_defs.h @@ -0,0 +1,12 @@ +#if !defined( IN_DEFSH ) +#define IN_DEFSH +#pragma once + +// up / down +#define PITCH 0 +// left / right +#define YAW 1 +// fall over +#define ROLL 2 + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/input.cpp b/main/source/cl_dll/input.cpp new file mode 100644 index 00000000..1cb43583 --- /dev/null +++ b/main/source/cl_dll/input.cpp @@ -0,0 +1,1654 @@ +//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. ========= +// +// The copyright to the contents herein is the property of Charles G. Cleveland. +// The contents may be used and/or copied only with the written permission of +// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: +// +// $Workfile: input.cpp $ +// $Date: 2002/10/16 02:12:21 $ +// +//------------------------------------------------------------------------------- +// $Log: input.cpp,v $ +// Revision 1.28 2002/10/16 02:12:21 Flayra +// - Valve anti-cheat integrated! +// +// Revision 1.27 2002/08/09 00:13:04 Flayra +// - Removed explicitly allowing specific commands. I can't remember why this was needed, but it doesn't appear to be anymore. +// +// Revision 1.26 2002/08/02 21:39:03 Flayra +// - Refactored variable names +// +// Revision 1.25 2002/07/08 16:13:31 Flayra +// - Fixed bug where command was able to switch weapons via mousewheel (bug #239) +// +//=============================================================================== +// cl.input.c -- builds an intended movement command to send to the server + +//xxxxxx Move bob and pitch drifting code here and other stuff from view if needed + +// Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All +// rights reserved. +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +extern "C" +{ +#include "kbutton.h" +} +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "view.h" +#include +#include +#include "engine/keydefs.h" + +#include "vgui_TeamFortressViewport.h" +#include "mod/AvHServerVariables.h"// should we go ahead and just make a SharedVariables.h instead? +#include "mod/AvHClientVariables.h" +#include "mod/AvHMessage.h" +#include "fmod.h" +#include "mod/AvHScriptManager.h" +#include "mod/AvHScrollHandler.h" +#include "mod/AvHCommanderModeHandler.h" +#include "Util/Mat3.h" + +#include "APIProxy.h" +#include "Exports.h" + +extern int g_iAlive; + +extern int g_weaponselect; +extern cl_enginefunc_t gEngfuncs; +bool gResetViewAngles = false; +vec3_t gViewAngles; +extern AvHCommanderModeHandler gCommanderHandler; + +/////////////////////////////// +// Begin Max's Code +/////////////////////////////// + +float gPlayerAngles[3] = { 0, 0, 0 }; +float gTargetPlayerAngles[3] = { 0, 0, 0 }; +float gWorldViewAngles[3] = { 0, 0, 0 }; + +/////////////////////////////// +// End Max's Code +/////////////////////////////// + +// Defined in pm_math.c +//extern "C" float anglemod( float a ); +float anglemod( float a ); + +void IN_Init (void); +void IN_Move ( float frametime, float ioRotationDeltas[3], float ioTranslationDeltas[3]); +void IN_Shutdown( void ); +void V_Init( void ); +void VectorAngles( const float *forward, float *angles ); +int CL_ButtonBits( int ); + +// xxx need client dll function to get and clear impuse +extern cvar_t *in_joystick; + +int in_impulse = 0; +int in_cancel = 0; + +cvar_t *m_pitch; +cvar_t *m_yaw; +cvar_t *m_forward; +cvar_t *m_side; + +cvar_t *lookstrafe; +cvar_t *lookspring; +//cvar_t *cl_pitchup; +//cvar_t *cl_pitchdown; +cvar_t *cl_upspeed; +cvar_t *cl_movespeedkey; +cvar_t *cl_yawspeed; +cvar_t *cl_pitchspeed; +cvar_t *cl_anglespeedkey; +cvar_t *cl_vsmoothing; +cvar_t *cl_autohelp; +cvar_t *cl_centerentityid; +cvar_t *cl_musicenabled; +cvar_t *cl_musicdelay; +cvar_t *cl_musicvolume; +cvar_t *cl_musicdir; +cvar_t *cl_quickselecttime; +cvar_t *cl_highdetail; +cvar_t *cl_cmhotkeys; +cvar_t *cl_forcedefaultfov; +cvar_t *cl_dynamiclights; +cvar_t *cl_buildmessages; +cvar_t *cl_particleinfo; + +/* +=============================================================================== + +KEY BUTTONS + +Continuous button event tracking is complicated by the fact that two different +input sources (say, mouse button 1 and the control key) can both press the +same button, but the button should only be released when both of the +pressing key have been released. + +When a key event issues a button command (+forward, +attack, etc), it appends +its key number as a parameter to the command so it can be matched up with +the release. + +state bit 0 is the current state of the key +state bit 1 is edge triggered on the up to down transition +state bit 2 is edge triggered on the down to up transition + +=============================================================================== +*/ + + +kbutton_t in_mlook; +kbutton_t in_klook; +kbutton_t in_jlook; +kbutton_t in_left; +kbutton_t in_right; +kbutton_t in_forward; +kbutton_t in_back; +kbutton_t in_lookup; +kbutton_t in_lookdown; +kbutton_t in_moveleft; +kbutton_t in_moveright; +kbutton_t in_strafe; +kbutton_t in_speed; +kbutton_t in_use; +kbutton_t in_jump; +kbutton_t in_attack; +kbutton_t in_attack2; +kbutton_t in_up; +kbutton_t in_down; +kbutton_t in_duck; +kbutton_t in_reload; +kbutton_t in_alt1; +kbutton_t in_score; +kbutton_t in_break; +kbutton_t in_graph; // Display the netgraph + +typedef struct kblist_s +{ + struct kblist_s *next; + kbutton_t *pkey; + char name[32]; +} kblist_t; + +kblist_t *g_kbkeys = NULL; + +vector< pair > g_PrevCmds; + +/* +============ +KB_ConvertString + +Removes references to +use and replaces them with the keyname in the output string. If + a binding is unfound, then the original text is retained. +NOTE: Only works for text with +word in it. +============ +*/ +int KB_ConvertString( char *in, char **ppout ) +{ + char sz[ 4096 ]; + char binding[ 64 ]; + char *p; + char *pOut; + char *pEnd; + const char *pBinding; + + if ( !ppout ) + return 0; + + *ppout = NULL; + p = in; + pOut = sz; + while ( *p ) + { + if ( *p == '+' ) + { + pEnd = binding; + while ( *p && ( isalnum( *p ) || ( pEnd == binding ) ) && ( ( pEnd - binding ) < 63 ) ) + { + *pEnd++ = *p++; + } + + *pEnd = '\0'; + + pBinding = NULL; + if ( strlen( binding + 1 ) > 0 ) + { + // See if there is a binding for binding? + pBinding = gEngfuncs.Key_LookupBinding( binding + 1 ); + } + + if ( pBinding ) + { + *pOut++ = '['; + pEnd = (char *)pBinding; + } + else + { + pEnd = binding; + } + + while ( *pEnd ) + { + *pOut++ = *pEnd++; + } + + if ( pBinding ) + { + *pOut++ = ']'; + } + } + else + { + *pOut++ = *p++; + } + } + + *pOut = '\0'; + + pOut = ( char * )malloc( strlen( sz ) + 1 ); + strcpy( pOut, sz ); + *ppout = pOut; + + return 1; +} + +/* +============ +KB_Find + +Allows the engine to get a kbutton_t directly ( so it can check +mlook state, etc ) for saving out to .cfg files +============ +*/ +struct kbutton_s CL_DLLEXPORT *KB_Find( const char *name ) +{ + RecClFindKey(name); + + kblist_t *p; + p = g_kbkeys; + while ( p ) + { + if ( !stricmp( name, p->name ) ) + return p->pkey; + + p = p->next; + } + return NULL; +} + +/* +============ +KB_Add + +Add a kbutton_t * to the list of pointers the engine can retrieve via KB_Find +============ +*/ +void KB_Add( const char *name, kbutton_t *pkb ) +{ + kblist_t *p; + kbutton_t *kb; + + kb = KB_Find( name ); + + if ( kb ) + return; + + p = ( kblist_t * )malloc( sizeof( kblist_t ) ); + memset( p, 0, sizeof( *p ) ); + + strcpy( p->name, name ); + p->pkey = pkb; + + p->next = g_kbkeys; + g_kbkeys = p; +} + +/* +============ +KB_Init + +Add kbutton_t definitions that the engine can query if needed +============ +*/ +void KB_Init( void ) +{ + g_kbkeys = NULL; + + KB_Add( "in_graph", &in_graph ); + KB_Add( "in_mlook", &in_mlook ); + KB_Add( "in_jlook", &in_jlook ); +} + +/* +============ +KB_Shutdown + +Clear kblist +============ +*/ +void KB_Shutdown( void ) +{ + kblist_t *p, *n; + p = g_kbkeys; + while ( p ) + { + n = p->next; + free( p ); + p = n; + } + g_kbkeys = NULL; +} + +void KeyDown (kbutton_t *b); +void KeyUp (kbutton_t *b); + +/* +============ +KeyDown +============ +*/ +void KeyDown (kbutton_t *b) +{ + int k; + char *c; + + c = gEngfuncs.Cmd_Argv(1); + if (c[0]) + k = atoi(c); + else + k = -1; // typed manually at the console for continuous down + + int theBlockScripts = (int)gHUD.GetServerVariableFloat(kvBlockScripts); + + char *pCmd = gEngfuncs.Cmd_Argv(0); + + if(theBlockScripts && pCmd) + { + bool bFound = false; + + //Check thier last few commands (this prevents false positives if a player is hits several keys real fast) + for (int i = 0; i < g_PrevCmds.size(); i++) + { + //Check both the key pressed and the command it executed. + if(k == g_PrevCmds[i].first && !strcmp(pCmd, g_PrevCmds[i].second.c_str())) + { + bFound = true; + break; + } + } + +// //If they used mwheeldown/mwheelup to activate repeating command, make sure they didnt use +attack or +jump to prevent exploits. +// if(k == K_MWHEELDOWN || k == K_MWHEELUP && theBlockScripts == 2) +// { +// if(strstr(pCmd, "+"))//I could also do pCmd[0] == '+', but that could possibly be bypassed. +// bFound = false; +// } + + + if(!bFound + && strcmp(pCmd, "+mlook") + && strcmp(pCmd, "+jlook") + && strcmp(pCmd, "+showscores") + && strcmp(pCmd, "+use")) + { + gEngfuncs.pfnCenterPrint("Scripting is not allowed on this server."); + b->down[0] = b->down[1] = 0; + b->state = 4; // impulse up + return; + } + } + + if (k == b->down[0] || k == b->down[1]) + return; // repeating key + + if (!b->down[0]) + b->down[0] = k; + else if (!b->down[1]) + b->down[1] = k; + else + { + gEngfuncs.Con_DPrintf ("Three keys down for a button '%c' '%c' '%c'!\n", b->down[0], b->down[1], c); + return; + } + + if (b->state & 1) + return; // still down + b->state |= 1 + 2; // down + impulse down +} + +/* +============ +KeyUp +============ +*/ +void KeyUp (kbutton_t *b) +{ + int k; + char *c; + + c = gEngfuncs.Cmd_Argv(1); + if (c[0]) + k = atoi(c); + else + { // typed manually at the console, assume for unsticking, so clear all + b->down[0] = b->down[1] = 0; + b->state = 4; // impulse up + return; + } + + if (b->down[0] == k) + b->down[0] = 0; + else if (b->down[1] == k) + b->down[1] = 0; + else + return; // key up without coresponding down (menu pass through) + if (b->down[0] || b->down[1]) + { + //Con_Printf ("Keys down for button: '%c' '%c' '%c' (%d,%d,%d)!\n", b->down[0], b->down[1], c, b->down[0], b->down[1], c); + return; // some other key is still holding it down + } + + if (!(b->state & 1)) + return; // still up (this should not happen) + + b->state &= ~1; // now up + b->state |= 4; // impulse up +} + + +bool AvHContainsBlockedCommands(const char* inInput) +{ + if (inInput == NULL) + { + return false; + } + + const char* kBlockedCommand[] = + { + "exec", + "wait", + "special", + "_special" + }; + + // Check for a ; indicating multiple commands. + + if (strchr(inInput, ';') != NULL) + { + return true; + } + + // Check if any of the blocked commands are being used. + + const char* theCommandEnd = strpbrk(inInput, " \t"); + + int theCommandLength; + + if (theCommandEnd == NULL) + { + theCommandLength = strlen(inInput); + } + else + { + theCommandLength = theCommandEnd - inInput; + } + + for (int i = 0; i < sizeof(kBlockedCommand) / sizeof(const char*); ++i) + { + if ((int)strlen(kBlockedCommand[i]) == theCommandLength && + strncmp(inInput, kBlockedCommand[i], theCommandLength) == 0) + { + return true; + } + } + return false; +} + +/* +============ +HUD_Key_Event + +Return 1 to allow engine to process the key, otherwise, act on it as needed +============ +*/ +int CL_DLLEXPORT HUD_Key_Event( int down, int keynum, const char *pszCurrentBinding ) +{ + RecClKeyEvent(down, keynum, pszCurrentBinding); + + // Check to see if the event has any outlawed commands in it. + float theBlockScripts = gHUD.GetServerVariableFloat(kvBlockScripts); + + if (theBlockScripts && AvHContainsBlockedCommands(pszCurrentBinding)) + { + if(down)//voogru: only show when going down. + gEngfuncs.pfnCenterPrint("Scripting is not allowed on this server.\n"); + return 0; + } + + if(pszCurrentBinding) + { + if(g_PrevCmds.size() >= 5) + g_PrevCmds.erase(g_PrevCmds.begin());//remove the oldest command + + g_PrevCmds.push_back(make_pair(keynum, (string)pszCurrentBinding)); + } + + int theProcessKeyBinding = 1; + +// char theKeyBinding[256] = "none"; +// if(pszCurrentBinding) +// { +// sprintf(theKeyBinding, pszCurrentBinding); +// } +// +// char theMessage[512]; +// sprintf(theMessage, "%s (down: %d, keynum %d)", theKeyBinding, down, keynum); +// CenterPrint(theMessage); + + if(gViewPort /*&& gViewPort->IsOptionsMenuVisible()*/) + { + + theProcessKeyBinding = gViewPort->KeyInput(down, keynum, pszCurrentBinding); + + if(pszCurrentBinding && (!strcmp(pszCurrentBinding, "toggleconsole") || !strcmp(pszCurrentBinding, "cancelselect"))) + { + theProcessKeyBinding = 1; + } + } + + + // Process topdown commands with precedence first + if(theProcessKeyBinding && gHUD.GetInTopDownMode()) + { + if((keynum != 0) && down/*&& pszCurrentBinding*/) + { + AvHMessageID theMessageID = gHUD.HotKeyHit(keynum); + if((theMessageID != MESSAGE_NULL) || (keynum == K_ESCAPE)) + { + // If ESC or cancel was hit, cancel ghost building + if((keynum == K_ESCAPE) || (theMessageID == MESSAGE_CANCEL)) + { + gHUD.SetGhostBuildingMode(MESSAGE_NULL); + } + + theProcessKeyBinding = 0; + } + +// // Else look for hotkey commands +// int thePrefixLength = strlen(kHotKeyPrefix); +// if(down && !strncmp(pszCurrentBinding, kHotKeyPrefix, thePrefixLength)) +// { +// // Strip out number, pass it to HUD +// char theNumberString[8]; +// memset(theNumberString, 0, 8); +// int theBindingLength = strlen(pszCurrentBinding); +// ASSERT(theBindingLength > thePrefixLength); +// strncpy(theNumberString, pszCurrentBinding + thePrefixLength, theBindingLength - thePrefixLength); +// +// int theBuildTech = MakeIntFromString(string(theNumberString)); +// +// gHUD.HotKeyHit(theBuildTech); +// +// theProcessKeyBinding = 0; +// } +// else +// { +// // Look for top down only commands, like scrolling +// if(!strcmp("+forward", pszCurrentBinding)) +// { +// AvHScrollHandler::ScrollUp(); +// theProcessKeyBinding = 0; +// } +// else if(!strcmp("-forward", pszCurrentBinding)) +// { +// AvHScrollHandler::StopScroll(); +// theProcessKeyBinding = 0; +// } +// else if(!strcmp("+back", pszCurrentBinding)) +// { +// AvHScrollHandler::ScrollDown(); +// theProcessKeyBinding = 0; +// } +// else if(!strcmp("-back", pszCurrentBinding)) +// { +// AvHScrollHandler::StopScroll(); +// theProcessKeyBinding = 0; +// } +// else if(!strcmp("+moveleft", pszCurrentBinding)) +// { +// AvHScrollHandler::ScrollLeft(); +// theProcessKeyBinding = 0; +// } +// else if(!strcmp("-moveleft", pszCurrentBinding)) +// { +// AvHScrollHandler::StopScroll(); +// theProcessKeyBinding = 0; +// } +// else if(!strcmp("+moveright", pszCurrentBinding)) +// { +// AvHScrollHandler::ScrollRight(); +// theProcessKeyBinding = 0; +// } +// else if(!strcmp("-moveright", pszCurrentBinding)) +// { +// AvHScrollHandler::StopScroll(); +// theProcessKeyBinding = 0; +// } +// } + } + } + + if(theProcessKeyBinding) + { + // Process only a couple keybindings in top down mode +// if(!gHUD.GetInTopDownMode() || (pszCurrentBinding && +// +// // Misc. commands +// (!strcmp(pszCurrentBinding, "toggleconsole") || !strcmp(pszCurrentBinding, "cancelselect") || !strcmp(pszCurrentBinding, "+showscores") || !strcmp(pszCurrentBinding, "-showscores") || !strcmp(pszCurrentBinding, "messagemode") || !strcmp(pszCurrentBinding, "messagemode2") || !strcmp(pszCurrentBinding, "snapshot") || !strcmp(pszCurrentBinding, "screenshot") || !strcmp(pszCurrentBinding, "+jump") || !strcmp(pszCurrentBinding, "addbot") || !strcmp(pszCurrentBinding, "+voicerecord") || !strcmp(pszCurrentBinding, "-voicerecord") || +// +// // Movement commands +// !strcmp(pszCurrentBinding, "testevent") /*|| !strcmp(pszCurrentBinding, "invnext") || !strcmp(pszCurrentBinding, "invprev")*/ || !strcmp(pszCurrentBinding, "+moveleft") || !strcmp(pszCurrentBinding, "-moveleft") || !strcmp(pszCurrentBinding, "+moveright") || !strcmp(pszCurrentBinding, "-moveright") || !strcmp(pszCurrentBinding, "+moveup") || !strcmp(pszCurrentBinding, "-moveup") || !strcmp(pszCurrentBinding, "+movedown") || !strcmp(pszCurrentBinding, "-movedown") || +// +// // For selecting groups +// !strcmp(pszCurrentBinding, "slot1") || !strcmp(pszCurrentBinding, "slot2") || !strcmp(pszCurrentBinding, "slot3") || !strcmp(pszCurrentBinding, "slot4") || !strcmp(pszCurrentBinding, "slot5") || +// +// // For creating groups +// !strcmp(pszCurrentBinding, "+duck") || !strcmp(pszCurrentBinding, "-duck") || +// +// // For testing ease +// !strcmp(pszCurrentBinding, "givepoints") +// +// ))) +// { + if (gViewPort) + theProcessKeyBinding = gViewPort->KeyInput(down, keynum, pszCurrentBinding); + +// // Don't +// if(!strcmp(pszCurrentBinding, "+jump") && gHUD.GetInTopDownMode()) +// { +// gHUD.GotoAlert(); +// } + +// } + } + + return theProcessKeyBinding; +} + +void IN_BreakDown( void ) { KeyDown( &in_break );}; +void IN_BreakUp( void ) { KeyUp( &in_break ); }; +void IN_KLookDown (void) {KeyDown(&in_klook);} +void IN_KLookUp (void) {KeyUp(&in_klook);} +void IN_JLookDown (void) {KeyDown(&in_jlook);} +void IN_JLookUp (void) {KeyUp(&in_jlook);} +void IN_MLookDown (void) {KeyDown(&in_mlook);} +void IN_UpDown(void) {KeyDown(&in_up);} +void IN_UpUp(void) {KeyUp(&in_up);} +void IN_DownDown(void) {KeyDown(&in_down);} +void IN_DownUp(void) {KeyUp(&in_down);} +void IN_LeftDown(void) {KeyDown(&in_left);} +void IN_LeftUp(void) {KeyUp(&in_left);} +void IN_RightDown(void) {KeyDown(&in_right);} +void IN_RightUp(void) {KeyUp(&in_right);} + +void IN_ForwardDown(void) +{ + KeyDown(&in_forward); + gHUD.m_Spectator.HandleButtonsDown( IN_FORWARD ); +} + +void IN_ForwardUp(void) +{ + KeyUp(&in_forward); + gHUD.m_Spectator.HandleButtonsUp( IN_FORWARD ); +} + +void IN_BackDown(void) +{ + KeyDown(&in_back); + gHUD.m_Spectator.HandleButtonsDown( IN_BACK ); +} + +void IN_BackUp(void) +{ + KeyUp(&in_back); + gHUD.m_Spectator.HandleButtonsUp( IN_BACK ); +} +void IN_LookupDown(void) {KeyDown(&in_lookup);} +void IN_LookupUp(void) {KeyUp(&in_lookup);} +void IN_LookdownDown(void) {KeyDown(&in_lookdown);} +void IN_LookdownUp(void) {KeyUp(&in_lookdown);} +void IN_MoveleftDown(void) +{ + KeyDown(&in_moveleft); + gHUD.m_Spectator.HandleButtonsDown( IN_MOVELEFT ); +} + +void IN_MoveleftUp(void) +{ + KeyUp(&in_moveleft); + gHUD.m_Spectator.HandleButtonsUp( IN_MOVELEFT ); +} + +void IN_MoverightDown(void) +{ + KeyDown(&in_moveright); + gHUD.m_Spectator.HandleButtonsDown( IN_MOVERIGHT ); +} + +void IN_MoverightUp(void) +{ + KeyUp(&in_moveright); + gHUD.m_Spectator.HandleButtonsUp( IN_MOVERIGHT ); +} +void IN_SpeedDown(void) {KeyDown(&in_speed);} +void IN_SpeedUp(void) {KeyUp(&in_speed);} +void IN_StrafeDown(void) {KeyDown(&in_strafe);} +void IN_StrafeUp(void) {KeyUp(&in_strafe);} + +// needs capture by hud/vgui also +extern void __CmdFunc_InputPlayerSpecial(void); + +void IN_Attack2Down(void) +{ + KeyDown(&in_attack2); + __CmdFunc_InputPlayerSpecial(); + //gHUD.m_Spectator.HandleButtonsDown( IN_ATTACK2 ); +} + +void IN_Attack2Up(void) {KeyUp(&in_attack2);} +void IN_UseDown (void) +{ + KeyDown(&in_use); + gHUD.m_Spectator.HandleButtonsDown( IN_USE ); +} +void IN_UseUp (void) {KeyUp(&in_use);} +void IN_JumpDown (void) +{ + KeyDown(&in_jump); + + if(gHUD.GetInTopDownMode()) + { + //gHUD.GotoAlert(); + } + + gHUD.m_Spectator.HandleButtonsDown( IN_JUMP ); + +} + +void IN_JumpUp (void) +{ + KeyUp(&in_jump); + gHUD.m_Spectator.HandleButtonsUp( IN_JUMP ); +} + +void IN_DuckDown(void) +{ + KeyDown(&in_duck); + gHUD.m_Spectator.HandleButtonsDown( IN_DUCK ); +} + +void IN_DuckUp(void) {KeyUp(&in_duck);} +void IN_ReloadDown(void) {KeyDown(&in_reload);} +void IN_ReloadUp(void) {KeyUp(&in_reload);} +void IN_Alt1Down(void) {KeyDown(&in_alt1);} +void IN_Alt1Up(void) {KeyUp(&in_alt1);} +void IN_GraphDown(void) {KeyDown(&in_graph);} +void IN_GraphUp(void) {KeyUp(&in_graph);} + +void IN_AttackDown(void) +{ + KeyDown( &in_attack ); + gHUD.m_Spectator.HandleButtonsDown( IN_ATTACK ); +} + +void IN_AttackUp(void) +{ + KeyUp( &in_attack ); + in_cancel = 0; +} + +// Special handling +void IN_Cancel(void) +{ + in_cancel = 1; +} + +void IN_Impulse (void) +{ + in_impulse = atoi( gEngfuncs.Cmd_Argv(1) ); +} + +void IN_ScoreDown(void) +{ + KeyDown(&in_score); + + if ( gViewPort ) + { + //if(gHUD.SwitchUIMode(SCOREBOARD_MODE)) + //{ + gViewPort->ShowScoreBoard(); + //} + } +} + +void IN_ScoreUp(void) +{ + KeyUp(&in_score); + + // Removed because it was getting called and hiding mouse <<< cgc >>> + if ( gViewPort ) + { + //if(gHUD.SwitchUIMode(MAIN_MODE)) + //{ + gViewPort->HideScoreBoard(); + //} + } +} + +void IN_MLookUp (void) +{ + KeyUp( &in_mlook ); + if ( !( in_mlook.state & 1 ) && lookspring->value ) + { + V_StartPitchDrift(); + } +} + +/* +=============== +CL_KeyState + +Returns 0.25 if a key was pressed and released during the frame, +0.5 if it was pressed and held +0 if held then released, and +1.0 if held for the entire time +=============== +*/ +float CL_KeyState (kbutton_t *key) +{ + float val = 0.0; + int impulsedown, impulseup, down; + + impulsedown = key->state & 2; + impulseup = key->state & 4; + down = key->state & 1; + + if ( impulsedown && !impulseup ) + { + // pressed and held this frame? + val = down ? 0.5 : 0.0; + } + + if ( impulseup && !impulsedown ) + { + // released this frame? + val = down ? 0.0 : 0.0; + } + + if ( !impulsedown && !impulseup ) + { + // held the entire frame? + val = down ? 1.0 : 0.0; + } + + if ( impulsedown && impulseup ) + { + if ( down ) + { + // released and re-pressed this frame + val = 0.75; + } + else + { + // pressed and released this frame + val = 0.25; + } + } + + // clear impulses + key->state &= 1; + return val; +} + +/* +================ +CL_AdjustAngles + +Moves the local angle positions +================ +*/ +void CL_AdjustAngles ( float frametime, float *viewangles ) +{ + float speed; + float up, down; + + if (in_speed.state & 1) + { + speed = frametime * cl_anglespeedkey->value; + } + else + { + speed = frametime; + } + + if (!(in_strafe.state & 1)) + { + viewangles[YAW] -= speed*cl_yawspeed->value*CL_KeyState (&in_right); + viewangles[YAW] += speed*cl_yawspeed->value*CL_KeyState (&in_left); + viewangles[YAW] = anglemod(viewangles[YAW]); + } + if (in_klook.state & 1) + { + V_StopPitchDrift (); + viewangles[PITCH] -= speed*cl_pitchspeed->value * CL_KeyState (&in_forward); + viewangles[PITCH] += speed*cl_pitchspeed->value * CL_KeyState (&in_back); + } + + up = CL_KeyState (&in_lookup); + down = CL_KeyState(&in_lookdown); + + viewangles[PITCH] -= speed*cl_pitchspeed->value * up; + viewangles[PITCH] += speed*cl_pitchspeed->value * down; + + if (up || down) + V_StopPitchDrift (); + + if (viewangles[PITCH] > 89) + viewangles[PITCH] = 89; + if (viewangles[PITCH] < -89) + viewangles[PITCH] = -89; + + if (viewangles[ROLL] > 50) + viewangles[ROLL] = 50; + if (viewangles[ROLL] < -50) + viewangles[ROLL] = -50; +} + +/* +================ +CL_CreateMove + +Send the intended movement message to the server +if active == 1 then we are 1) not playing back demos ( where our commands are ignored ) and +2 ) we have finished signing on to server +================ +*/ +void CL_DLLEXPORT CL_CreateMove ( float frametime, struct usercmd_s *cmd, int active ) +{ + RecClCL_CreateMove(frametime, cmd, active); + + float spd; + vec3_t viewangles; + static vec3_t oldangles; + + if ( active && (!gViewPort || !gViewPort->IsOptionsMenuVisible()) /*&& !gHUD.GetShowingMap()*/) + { + int theButtonState = CL_ButtonBits( 1 ); + + memset (cmd, 0, sizeof(*cmd)); + + float theRotationDeltas[3] = {0,0,0}; + float theTranslationDeltas[3] = {0,0,0}; + + IN_Move(frametime,theRotationDeltas,theTranslationDeltas); + + if(gResetViewAngles) + { + VectorCopy(gViewAngles,viewangles); + gResetViewAngles = false; + } + else + { + gEngfuncs.GetViewAngles( (float *)viewangles ); + } + VectorAdd(viewangles,theRotationDeltas,viewangles); + CL_AdjustAngles ( frametime, viewangles ); + +#ifdef SKULK_VIEW_ROTATION + //note : this code uses an older view angle tracking system + //and won't compile without changes + cl_entity_t* ent = gEngfuncs.GetLocalPlayer(); + if (ent->curstate.iuser3 == AVH_USER3_ALIEN_PLAYER1) + { + + // Transform the view angles from the local space of the entity into + // the world space. + + Mat3 objectMatrix(gPlayerAngles); + Mat3 viewMatrix(gPlayerViewAngles); + + (objectMatrix * viewMatrix).GetEulerAngles(viewangles); + + // Since we've updated the local coordinate frame to align with the view, + // reset the local view angles. + + gPlayerViewAngles[YAW] = 90; + gPlayerViewAngles[ROLL] = 0; + + } + else +#endif + + gEngfuncs.SetViewAngles( (float *)viewangles ); + VectorCopy (viewangles,gWorldViewAngles); + + // If we're in topdown mode + bool theProcessedMove = false; + bool theIsSendingSpecialEvent = false; + bool theOverrideImpulse = false; + float theWorldX, theWorldY; + int theScriptImpulse = 0; + + AvHMessageID theAlienAbility = MESSAGE_NULL; + AvHMessageID theGroupMessage = MESSAGE_NULL; + + //int theUpgradeVar = gEngfuncs.GetLocalPlayer()->curstate.iuser4; + //bool theIsParalyzed = GetHasUpgrade(theUpgradeVar, PLAYER_PARALYZED); + if(AvHScriptManager::Instance()->GetClientMove(theButtonState, theScriptImpulse)) + { + if(theScriptImpulse) + { + theOverrideImpulse = true; + } + //theProcessedMove = true; + + // TODO: Pass theButtonState to override all CL_KeyState() calls + } + else if(gHUD.GetInTopDownMode()) + { + cmd->upmove = cmd->sidemove = cmd->forwardmove = 0; + + // If a button was JUST pressed or released + vec3_t theMouseNormPos; + AvHMessageID theTechEvent = MESSAGE_NULL; + if(gCommanderHandler.GetMoveToWorldPosition(theWorldX, theWorldY)) + { + // Commander wants to scroll to an area of the mini-map + cmd->impulse = COMMANDER_MOVETO; + cmd->upmove = theWorldX/kWorldPosNetworkConstant; + cmd->sidemove = theWorldY/kWorldPosNetworkConstant; + gCommanderHandler.ClearMoveToPosition(); + gHUD.ClearTrackingEntity(); + + theIsSendingSpecialEvent = true; + theProcessedMove = true; + } + else if(gCommanderHandler.GetDefaultOrderPosition(theWorldX, theWorldY)) + { + // Commander wants to scroll to an area of the mini-map + cmd->impulse = COMMANDER_DEFAULTORDER; + cmd->upmove = theWorldX/kWorldPosNetworkConstant; + cmd->sidemove = theWorldY/kWorldPosNetworkConstant; + gCommanderHandler.ClearDefaultOrderPosition(); + gHUD.ClearTrackingEntity(); + + theIsSendingSpecialEvent = true; + theProcessedMove = true; + } + else if(gHUD.GetAndClearTechEvent(theTechEvent)) + { + cmd->impulse = theTechEvent; + theProcessedMove = true; + theIsSendingSpecialEvent = true; + gHUD.ClearTrackingEntity(); + + } + // else scroll + else + { + // Scroll the view if the HUD tells us to, otherwise use normal key presses + int theScrollX = 0, theScrollY = 0, theScrollZ = 0; + gHUD.GetAndClearTopDownScrollAmount(theScrollX, theScrollY, theScrollZ); + + if(theScrollX || theScrollY || theScrollZ) + { + // Commander move speed + float kCommanderMoveSpeed = 1000; + cmd->upmove += kCommanderMoveSpeed * theScrollY; + cmd->sidemove += kCommanderMoveSpeed * theScrollX; + cmd->forwardmove += kCommanderMoveSpeed * theScrollZ; + if(theScrollZ != 0) + { + int a = 0; + } + //cmd->forwardmove += 0;//cl_forwardspeed->value * theScrollZ; + + cmd->impulse = COMMANDER_SCROLL; + theOverrideImpulse = true; + + gHUD.ClearTrackingEntity(); + + //theIsSendingSpecialEvent = true; + theProcessedMove = true; + } + else if(gHUD.GetAndClearGroupEvent(theGroupMessage)) + { + cmd->impulse = theGroupMessage; + theIsSendingSpecialEvent = true; + theProcessedMove = true; + + gHUD.SetLastHotkeySelectionEvent(theGroupMessage); + } +// else if(gHUD.GetTrackingEntity() > 0) +// { +// int theTrackingEntity = gHUD.GetTrackingEntity(); +// cmd->upmove = theTrackingEntity*kHotKeyNetworkFactor; +// cmd->impulse = COMMANDER_TRACKENTITY; +// +// theIsSendingSpecialEvent = true; +// theProcessedMove = true; +// } + else if(in_impulse != 0) + { + bool theProcessImpulse = false; + switch(in_impulse) + { + case COMMANDER_SELECTALL: + case COMMANDER_NEXTIDLE: + case COMMANDER_NEXTAMMO: + case COMMANDER_NEXTHEALTH: + theProcessImpulse = true; + break; + } + + if(theProcessImpulse) + { + cmd->impulse = in_impulse; + in_impulse = 0; + + theProcessedMove = true; + theIsSendingSpecialEvent = true; + } + } + + if(!theProcessedMove && gHUD.GetAndClearSelectionEvent(theMouseNormPos, theTechEvent)) + { + // Store world position x,y in upmove,sidemove + cmd->upmove = theMouseNormPos.x*kSelectionNetworkConstant; + cmd->sidemove = theMouseNormPos.y*kSelectionNetworkConstant; + cmd->forwardmove = theMouseNormPos.z*kSelectionNetworkConstant; + + // Set impulse indicating this + //cmd->impulse = COMMANDER_MOUSECOORD; + + // This could be COMMANDER_MOUSECOORD or BUILD_TURRET or one of the other BUILD_ events + // They are all sent the same way + cmd->impulse = theTechEvent; + + // Order mode isn't currently used but may be in the future + //cmd->weaponselect = gHUD.GetOrderMode(); + + // Set buttons. Attack gets turned off when we're in mouse mode (apparently) + // so we need to set the buttons manually + cmd->buttons = theButtonState; + if(gHUD.GetMouseOneDown()) + { + cmd->buttons |= IN_ATTACK; + } + if(gHUD.GetMouseTwoDown()) + { + cmd->buttons |= IN_ATTACK2; + } + + gHUD.ClearTrackingEntity(); + + theIsSendingSpecialEvent = true; + theProcessedMove = true; + } + } + } + else if(gHUD.GetAndClearAlienAbility(theAlienAbility)) + { + cmd->impulse = theAlienAbility; + + // Added by mmcguire. + // 255 signifies that the impulse came from us and not from the console. + cmd->weaponselect = 255; + + theProcessedMove = true; + theIsSendingSpecialEvent = true; + + } + + // else process move normally + if(!theProcessedMove) + { + if ( in_strafe.state & 1 ) + { + cmd->sidemove += kSideSpeed * CL_KeyState (&in_right); + cmd->sidemove -= kSideSpeed * CL_KeyState (&in_left); + } + + cmd->sidemove += kSideSpeed * CL_KeyState (&in_moveright); + cmd->sidemove -= kSideSpeed * CL_KeyState (&in_moveleft); + + cmd->upmove += cl_upspeed->value * CL_KeyState (&in_up); + cmd->upmove -= cl_upspeed->value * CL_KeyState (&in_down); + + if ( !(in_klook.state & 1 ) ) + { + cmd->forwardmove += kForwardSpeed * CL_KeyState (&in_forward); + cmd->forwardmove -= kBackSpeed * CL_KeyState (&in_back); + } + } + + if(!theIsSendingSpecialEvent) + { + // adjust for speed key + if ( in_speed.state & 1 ) + { + cmd->forwardmove *= cl_movespeedkey->value; + cmd->sidemove *= cl_movespeedkey->value; + cmd->upmove *= cl_movespeedkey->value; + } + + // clip to maxspeed + spd = gEngfuncs.GetClientMaxspeed(); + + if ( spd != 0.0 ) + { + // scale the 3 speeds so that the total velocity is not > cl.maxspeed + float fmov = sqrt( (cmd->forwardmove*cmd->forwardmove) + (cmd->sidemove*cmd->sidemove) + (cmd->upmove*cmd->upmove) ); + + if ( fmov > spd ) + { + float fratio = spd / fmov; + cmd->forwardmove *= fratio; + cmd->sidemove *= fratio; + cmd->upmove *= fratio; + } + } + + // Allow mice and other controllers to add their inputs + cmd->forwardmove += theTranslationDeltas[0]; + cmd->sidemove += theTranslationDeltas[1]; + cmd->upmove += theTranslationDeltas[2]; + + if(!theOverrideImpulse) + { + cmd->impulse = in_impulse; + in_impulse = 0; + } + + cmd->weaponselect = g_weaponselect; + g_weaponselect = 0; + + // + // set button and flag bits + // + cmd->buttons = theButtonState; + + // If they're in a modal dialog, or we're stunned, ignore the attack button. + int theLocalUpgrades = gHUD.GetLocalUpgrades(); + if( GetClientVoiceMgr()->IsInSquelchMode() ) + { + cmd->buttons &= ~IN_ATTACK; + } + + // Using joystick? + if ( in_joystick->value ) + { + if ( cmd->forwardmove > 0 ) + { + cmd->buttons |= IN_FORWARD; + } + else if ( cmd->forwardmove < 0 ) + { + cmd->buttons |= IN_BACK; + } + } + } + } + + /////////////////////////////// + // Begin Max's Code + /////////////////////////////// + + // If the entity is a Skulk then transform the move from local space to + // world space. + + +#ifdef SKULK_VIEW_ROTATION + cl_entity_t* ent = gEngfuncs.GetLocalPlayer(); + if (ent->curstate.iuser3 == AVH_USER3_ALIEN_PLAYER1 && cl_rotateview->value != 0) + { + + vec3_t forward; + vec3_t right; + vec3_t up; + + AngleVectors(gWorldViewAngles, forward, right, up); + + VectorScale(forward, cmd->forwardmove, forward); + VectorScale(right, cmd->sidemove, right); + VectorScale(up, cmd->upmove, up); + + vec3_t normalForward; + vec3_t normalRight; + vec3_t normalUp; + + AngleVectors(ent->angles, normalForward, normalRight, normalUp); + + cmd->forwardmove = DotProduct(normalForward, forward) + + DotProduct(normalForward, right) + + DotProduct(normalForward, up); + + cmd->sidemove = DotProduct(normalRight, forward) + + DotProduct(normalRight, right) + + DotProduct(normalRight, up); + + cmd->upmove = DotProduct(normalUp, forward) + + DotProduct(normalUp, right) + + DotProduct(normalUp, up); + + } + +#endif + + /////////////////////////////// + // End Max's Code + /////////////////////////////// + + gEngfuncs.GetViewAngles( (float *)viewangles ); + + // Set current view angles but not if frozen (this still allows you to rotate in first-person, but player model won't change) + int theUser4 = gHUD.GetLocalUpgrades(); + bool theIsFrozen = GetHasUpgrade(theUser4, MASK_PLAYER_STUNNED) || GetHasUpgrade(theUser4, MASK_ALIEN_EMBRYO); + + if ( g_iAlive && !theIsFrozen) + { + VectorCopy( viewangles, cmd->viewangles ); + VectorCopy( viewangles, oldangles ); + } + else + { + VectorCopy( oldangles, cmd->viewangles ); + } +} + +/* +============ +CL_IsDead + +Returns 1 if health is <= 0 +============ +*/ +int CL_IsDead( void ) +{ + return ( gHUD.m_Health.m_iHealth <= 0 ) ? 1 : 0; +} + +/* +============ +CL_ButtonBits + +Returns appropriate button info for keyboard and mouse state +Set bResetState to 1 to clear old state info +============ +*/ +int CL_ButtonBits( int bResetState ) +{ + int bits = 0; + + if ( in_attack.state & 3 ) + { + bits |= IN_ATTACK; + } + + if (in_duck.state & 3) + { + bits |= IN_DUCK; + } + + if (in_jump.state & 3) + { + bits |= IN_JUMP; + } + + if ( in_forward.state & 3 ) + { + bits |= IN_FORWARD; + } + + if (in_back.state & 3) + { + bits |= IN_BACK; + } + + if (in_use.state & 3) + { + bits |= IN_USE; + } + + if (in_cancel) + { + bits |= IN_CANCEL; + } + + if ( in_left.state & 3 ) + { + bits |= IN_LEFT; + } + + if (in_right.state & 3) + { + bits |= IN_RIGHT; + } + + if ( in_moveleft.state & 3 ) + { + bits |= IN_MOVELEFT; + } + + if (in_moveright.state & 3) + { + bits |= IN_MOVERIGHT; + } + + if (in_attack2.state & 3) + { + bits |= IN_ATTACK2; + } + + if (in_reload.state & 3) + { + bits |= IN_RELOAD; + } + + if (in_alt1.state & 3) + { + bits |= IN_ALT1; + } + + if ( in_score.state & 3 ) + { + bits |= IN_SCORE; + } + + // Dead or in intermission? Shore scoreboard, too + if ( CL_IsDead() || gHUD.m_iIntermission ) + { + bits |= IN_SCORE; + } + + if ( bResetState ) + { + in_attack.state &= ~2; + in_duck.state &= ~2; + in_jump.state &= ~2; + in_forward.state &= ~2; + in_back.state &= ~2; + in_use.state &= ~2; + in_left.state &= ~2; + in_right.state &= ~2; + in_moveleft.state &= ~2; + in_moveright.state &= ~2; + in_attack2.state &= ~2; + in_reload.state &= ~2; + in_alt1.state &= ~2; + in_score.state &= ~2; + } + + return bits; +} + +/* +============ +CL_ResetButtonBits + +============ +*/ +void CL_ResetButtonBits( int bits ) +{ + int bitsNew = CL_ButtonBits( 0 ) ^ bits; + + // Has the attack button been changed + if ( bitsNew & IN_ATTACK ) + { + // Was it pressed? or let go? + if ( bits & IN_ATTACK ) + { + KeyDown( &in_attack ); + } + else + { + // totally clear state + in_attack.state &= ~7; + } + } +} + +/* +============ +InitInput +============ +*/ +void InitInput (void) +{ + gEngfuncs.pfnAddCommand ("+moveup",IN_UpDown); + gEngfuncs.pfnAddCommand ("-moveup",IN_UpUp); + gEngfuncs.pfnAddCommand ("+movedown",IN_DownDown); + gEngfuncs.pfnAddCommand ("-movedown",IN_DownUp); + gEngfuncs.pfnAddCommand ("+left",IN_LeftDown); + gEngfuncs.pfnAddCommand ("-left",IN_LeftUp); + gEngfuncs.pfnAddCommand ("+right",IN_RightDown); + gEngfuncs.pfnAddCommand ("-right",IN_RightUp); + gEngfuncs.pfnAddCommand ("+forward",IN_ForwardDown); + gEngfuncs.pfnAddCommand ("-forward",IN_ForwardUp); + gEngfuncs.pfnAddCommand ("+back",IN_BackDown); + gEngfuncs.pfnAddCommand ("-back",IN_BackUp); + gEngfuncs.pfnAddCommand ("+lookup", IN_LookupDown); + gEngfuncs.pfnAddCommand ("-lookup", IN_LookupUp); + gEngfuncs.pfnAddCommand ("+lookdown", IN_LookdownDown); + gEngfuncs.pfnAddCommand ("-lookdown", IN_LookdownUp); + gEngfuncs.pfnAddCommand ("+strafe", IN_StrafeDown); + gEngfuncs.pfnAddCommand ("-strafe", IN_StrafeUp); + gEngfuncs.pfnAddCommand ("+moveleft", IN_MoveleftDown); + gEngfuncs.pfnAddCommand ("-moveleft", IN_MoveleftUp); + gEngfuncs.pfnAddCommand ("+moveright", IN_MoverightDown); + gEngfuncs.pfnAddCommand ("-moveright", IN_MoverightUp); + gEngfuncs.pfnAddCommand ("+speed", IN_SpeedDown); + gEngfuncs.pfnAddCommand ("-speed", IN_SpeedUp); + gEngfuncs.pfnAddCommand ("+attack", IN_AttackDown); + gEngfuncs.pfnAddCommand ("-attack", IN_AttackUp); + gEngfuncs.pfnAddCommand ("+attack2", IN_Attack2Down); + gEngfuncs.pfnAddCommand ("-attack2", IN_Attack2Up); + gEngfuncs.pfnAddCommand ("+use", IN_UseDown); + gEngfuncs.pfnAddCommand ("-use", IN_UseUp); + gEngfuncs.pfnAddCommand ("+jump", IN_JumpDown); + gEngfuncs.pfnAddCommand ("-jump", IN_JumpUp); + gEngfuncs.pfnAddCommand ("impulse", IN_Impulse); + gEngfuncs.pfnAddCommand ("+klook", IN_KLookDown); + gEngfuncs.pfnAddCommand ("-klook", IN_KLookUp); + gEngfuncs.pfnAddCommand ("+mlook", IN_MLookDown); + gEngfuncs.pfnAddCommand ("-mlook", IN_MLookUp); + gEngfuncs.pfnAddCommand ("+jlook", IN_JLookDown); + gEngfuncs.pfnAddCommand ("-jlook", IN_JLookUp); + gEngfuncs.pfnAddCommand ("+duck", IN_DuckDown); + gEngfuncs.pfnAddCommand ("-duck", IN_DuckUp); + gEngfuncs.pfnAddCommand ("+reload", IN_ReloadDown); + gEngfuncs.pfnAddCommand ("-reload", IN_ReloadUp); + gEngfuncs.pfnAddCommand ("+alt1", IN_Alt1Down); + gEngfuncs.pfnAddCommand ("-alt1", IN_Alt1Up); + gEngfuncs.pfnAddCommand ("+score", IN_ScoreDown); + gEngfuncs.pfnAddCommand ("-score", IN_ScoreUp); + gEngfuncs.pfnAddCommand ("+showscores", IN_ScoreDown); + gEngfuncs.pfnAddCommand ("-showscores", IN_ScoreUp); + gEngfuncs.pfnAddCommand ("+graph", IN_GraphDown); + gEngfuncs.pfnAddCommand ("-graph", IN_GraphUp); + gEngfuncs.pfnAddCommand ("+break",IN_BreakDown); + gEngfuncs.pfnAddCommand ("-break",IN_BreakUp); + + lookstrafe = gEngfuncs.pfnRegisterVariable ( "lookstrafe", "0", FCVAR_ARCHIVE ); + lookspring = gEngfuncs.pfnRegisterVariable ( "lookspring", "0", FCVAR_ARCHIVE ); + cl_anglespeedkey = gEngfuncs.pfnRegisterVariable ( "cl_anglespeedkey", "0.67", 0 ); + cl_yawspeed = gEngfuncs.pfnRegisterVariable ( "cl_yawspeed", "210", 0 ); + cl_pitchspeed = gEngfuncs.pfnRegisterVariable ( "cl_pitchspeed", "225", 0 ); + cl_upspeed = gEngfuncs.pfnRegisterVariable ( "cl_upspeed", "320", 0 ); + cl_movespeedkey = gEngfuncs.pfnRegisterVariable ( "cl_movespeedkey", "0.3", 0 ); + //cl_pitchup = gEngfuncs.pfnRegisterVariable ( "cl_pitchup", "89", 0 ); + //cl_pitchdown = gEngfuncs.pfnRegisterVariable ( "cl_pitchdown", "89", 0 ); + + cl_vsmoothing = gEngfuncs.pfnRegisterVariable ( "cl_vsmoothing", "0.05", FCVAR_ARCHIVE ); + + m_pitch = gEngfuncs.pfnRegisterVariable ( "m_pitch","0.022", FCVAR_ARCHIVE ); + m_yaw = gEngfuncs.pfnRegisterVariable ( "m_yaw","0.022", FCVAR_ARCHIVE ); + m_forward = gEngfuncs.pfnRegisterVariable ( "m_forward","1", FCVAR_ARCHIVE ); + m_side = gEngfuncs.pfnRegisterVariable ( "m_side","0.8", FCVAR_ARCHIVE ); + + cl_autohelp = gEngfuncs.pfnRegisterVariable ( kvAutoHelp, "1.0", FCVAR_ARCHIVE ); + cl_centerentityid = gEngfuncs.pfnRegisterVariable ( kvCenterEntityID, "0.0", FCVAR_ARCHIVE ); + cl_musicenabled = gEngfuncs.pfnRegisterVariable ( kvMusicEnabled, "1.0", FCVAR_ARCHIVE ); + cl_musicvolume = gEngfuncs.pfnRegisterVariable ( kvMusicVolume, "155", FCVAR_ARCHIVE ); + cl_musicdir = gEngfuncs.pfnRegisterVariable ( kvMusicDirectory, "", FCVAR_ARCHIVE); + cl_musicdelay = gEngfuncs.pfnRegisterVariable ( kvMusicDelay, "90", FCVAR_ARCHIVE); + cl_forcedefaultfov = gEngfuncs.pfnRegisterVariable ( kvForceDefaultFOV, "0", FCVAR_ARCHIVE ); + cl_dynamiclights = gEngfuncs.pfnRegisterVariable ( kvDynamicLights, "1", FCVAR_ARCHIVE ); + cl_buildmessages = gEngfuncs.pfnRegisterVariable ( kvBuildMessages, "1", FCVAR_ARCHIVE); + cl_quickselecttime = gEngfuncs.pfnRegisterVariable ( kvQuickSelectTime, ".15", FCVAR_ARCHIVE ); + cl_highdetail = gEngfuncs.pfnRegisterVariable ( kvHighDetail, "1", FCVAR_ARCHIVE ); + cl_cmhotkeys = gEngfuncs.pfnRegisterVariable ( kvCMHotkeys, "qwerasdfzxcv", FCVAR_ARCHIVE ); + cl_forcedefaultfov = gEngfuncs.pfnRegisterVariable ( kvForceDefaultFOV, "0", FCVAR_ARCHIVE ); + cl_particleinfo = gEngfuncs.pfnRegisterVariable ( kvParticleInfo, "0", FCVAR_ARCHIVE ); + + // Initialize third person camera controls. + CAM_Init(); + // Initialize inputs + IN_Init(); + // Initialize keyboard + KB_Init(); + // Initialize view system + V_Init(); +} + +/* +============ +ShutdownInput +============ +*/ +void ShutdownInput (void) +{ + IN_Shutdown(); + KB_Shutdown(); +} + +void CL_DLLEXPORT HUD_Shutdown( void ) +{ + RecClShutdown(); + + ShutdownInput(); + + gHUD.Shutdown(); +} diff --git a/main/source/cl_dll/inputw32.cpp b/main/source/cl_dll/inputw32.cpp new file mode 100644 index 00000000..ad082523 --- /dev/null +++ b/main/source/cl_dll/inputw32.cpp @@ -0,0 +1,1031 @@ +// in_win.c -- windows 95 mouse and joystick code +// 02/21/97 JCB Added extended DirectInput code to support external controllers. + +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "../engine/keydefs.h" +#include "view.h" +#include "windows.h" +#include "mod/ChatPanel.h" + +#include "APIProxy.h" +#include "Exports.h" + +#define MOUSE_BUTTON_COUNT 5 + +// Set this to 1 to show mouse cursor. Experimental +int g_iVisibleMouse = 0; + +extern cl_enginefunc_t gEngfuncs; + +extern int iMouseInUse; + +extern kbutton_t in_strafe; +extern kbutton_t in_mlook; +extern kbutton_t in_speed; +extern kbutton_t in_jlook; + +extern cvar_t *m_pitch; +extern cvar_t *m_yaw; +extern cvar_t *m_forward; +extern cvar_t *m_side; + +extern cvar_t *lookstrafe; +extern cvar_t *lookspring; +extern cvar_t *cl_yawspeed; +extern cvar_t *cl_pitchspeed; +extern cvar_t *cl_movespeedkey; + +// mouse variables +cvar_t *m_filter; +cvar_t *sensitivity; + +int mouse_buttons; +int mouse_oldbuttonstate; +POINT current_pos; +int mouse_x, mouse_y, old_mouse_x, old_mouse_y, mx_accum, my_accum; + +static int restore_spi; +static int originalmouseparms[3], newmouseparms[3] = {0, 0, 1}; +static int mouseactive; +int mouseinitialized; +static int mouseparmsvalid; +static int mouseshowtoggle = 1; + +HHOOK gKeyboardHook = NULL; + +/////////////////////////////// +// Begin Max's Code +/////////////////////////////// + +extern float gPlayerViewAngles[3]; + +/////////////////////////////// +// End Max's Code +/////////////////////////////// + +// joystick defines and variables +// where should defines be moved? +#define JOY_ABSOLUTE_AXIS 0x00000000 // control like a joystick +#define JOY_RELATIVE_AXIS 0x00000010 // control like a mouse, spinner, trackball +#define JOY_MAX_AXES 6 // X, Y, Z, R, U, V +#define JOY_AXIS_X 0 +#define JOY_AXIS_Y 1 +#define JOY_AXIS_Z 2 +#define JOY_AXIS_R 3 +#define JOY_AXIS_U 4 +#define JOY_AXIS_V 5 + +enum _ControlList +{ + AxisNada = 0, + AxisForward, + AxisLook, + AxisSide, + AxisTurn +}; + +DWORD dwAxisFlags[JOY_MAX_AXES] = +{ + JOY_RETURNX, + JOY_RETURNY, + JOY_RETURNZ, + JOY_RETURNR, + JOY_RETURNU, + JOY_RETURNV +}; + +DWORD dwAxisMap[ JOY_MAX_AXES ]; +DWORD dwControlMap[ JOY_MAX_AXES ]; +PDWORD pdwRawValue[ JOY_MAX_AXES ]; + +// none of these cvars are saved over a session +// this means that advanced controller configuration needs to be executed +// each time. this avoids any problems with getting back to a default usage +// or when changing from one controller to another. this way at least something +// works. +cvar_t *in_joystick; +cvar_t *joy_name; +cvar_t *joy_advanced; +cvar_t *joy_advaxisx; +cvar_t *joy_advaxisy; +cvar_t *joy_advaxisz; +cvar_t *joy_advaxisr; +cvar_t *joy_advaxisu; +cvar_t *joy_advaxisv; +cvar_t *joy_forwardthreshold; +cvar_t *joy_sidethreshold; +cvar_t *joy_pitchthreshold; +cvar_t *joy_yawthreshold; +cvar_t *joy_forwardsensitivity; +cvar_t *joy_sidesensitivity; +cvar_t *joy_pitchsensitivity; +cvar_t *joy_yawsensitivity; +cvar_t *joy_wwhack1; +cvar_t *joy_wwhack2; + +int joy_avail, joy_advancedinit, joy_haspov; +DWORD joy_oldbuttonstate, joy_oldpovstate; + +int joy_id; +DWORD joy_flags; +DWORD joy_numbuttons; + +static JOYINFOEX ji; + +/* +=========== +Force_CenterView_f +=========== +*/ +void Force_CenterView_f (void) +{ + vec3_t viewangles; + + if (!iMouseInUse) + { + gEngfuncs.GetViewAngles( (float *)viewangles ); + viewangles[PITCH] = 0; + gEngfuncs.SetViewAngles( (float *)viewangles ); + } +} + +bool gLostFocus = true; +bool gSteamUIActive = true; + +/* +=========== +IN_ActivateMouse +=========== +*/ +void CL_DLLEXPORT IN_ActivateMouse (void) +{ + + RecClIN_ActivateMouse(); + + if (gLostFocus) + { + gLostFocus = false; + } + else + { + + gSteamUIActive = false; + + int count; + + do + { + count = ShowCursor(FALSE); + } + while (count >= 0); + + } + + if (!gSteamUIActive) + { + + if (mouseinitialized) + { + if (mouseparmsvalid) + { + restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0); + } + mouseactive = 1; + } + + gHUD.OnDeactivateSteamUI(); + + } + +} + +/* +=========== +IN_DeactivateMouse +=========== +*/ +void CL_DLLEXPORT IN_DeactivateMouse (void) +{ + + RecClIN_DeactivateMouse(); + + if (GetActiveWindow() != GetFocus()) + { + gLostFocus = true; + gHUD.OnLostFocus(); + } + else + { + + gSteamUIActive = true; + + int count; + + do + { + count = ShowCursor(TRUE); + } + while (count < 0); + + } + + if (mouseinitialized) + { + if (restore_spi) + { + SystemParametersInfo (SPI_SETMOUSE, 0, originalmouseparms, 0); + } + + mouseactive = 0; + } + + if (gSteamUIActive) + { + gHUD.OnActivateSteamUI(); + } + +} + +/* +=========== +IN_StartupMouse +=========== +*/ +void IN_StartupMouse (void) +{ + if ( gEngfuncs.CheckParm ("-nomouse", NULL ) ) + return; + + mouseinitialized = 1; + mouseparmsvalid = SystemParametersInfo (SPI_GETMOUSE, 0, originalmouseparms, 0); + + if (mouseparmsvalid) + { + if ( gEngfuncs.CheckParm ("-noforcemspd", NULL ) ) + newmouseparms[2] = originalmouseparms[2]; + + if ( gEngfuncs.CheckParm ("-noforcemaccel", NULL ) ) + { + newmouseparms[0] = originalmouseparms[0]; + newmouseparms[1] = originalmouseparms[1]; + } + + if ( gEngfuncs.CheckParm ("-noforcemparms", NULL ) ) + { + newmouseparms[0] = originalmouseparms[0]; + newmouseparms[1] = originalmouseparms[1]; + newmouseparms[2] = originalmouseparms[2]; + } + } + + mouse_buttons = MOUSE_BUTTON_COUNT; + +} + +/* +=========== +IN_GetMousePos + +Ask for mouse position from engine +=========== +*/ +void IN_GetMousePos( int *mx, int *my ) +{ + gEngfuncs.GetMousePosition( mx, my ); +} + +/* +=========== +IN_ResetMouse + +FIXME: Call through to engine? +=========== +*/ +void IN_ResetMouse( void ) +{ + SetCursorPos ( gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY() ); +} + +/* +=========== +IN_MouseEvent +=========== +*/ +void CL_DLLEXPORT IN_MouseEvent (int mstate) +{ + RecClIN_MouseEvent(mstate); + + int i; + + if ( iMouseInUse || g_iVisibleMouse ) + return; + + // perform button actions + for (i=0 ; ivalue) + { + mouse_x = (mx + old_mouse_x) * 0.5; + mouse_y = (my + old_mouse_y) * 0.5; + } + else + { + mouse_x = mx; + mouse_y = my; + } + + old_mouse_x = mx; + old_mouse_y = my; + + if ( gHUD.GetSensitivity() != 0 ) + { + mouse_x *= gHUD.GetSensitivity(); + mouse_y *= gHUD.GetSensitivity(); + } + else + { + mouse_x *= sensitivity->value; + mouse_y *= sensitivity->value; + } + + // add mouse X/Y movement to cmd + if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) )) + ioTranslationDeltas[1] += m_side->value * mouse_x; + else + ioRotationDeltas[YAW] -= m_yaw->value * mouse_x; + + if ( (in_mlook.state & 1) && !(in_strafe.state & 1)) + { + ioRotationDeltas[PITCH] += m_pitch->value * mouse_y; + } + else + { + if ((in_strafe.state & 1) && gEngfuncs.IsNoClipping() ) + { + ioTranslationDeltas[2] -= m_forward->value * mouse_y; + } + else + { + ioTranslationDeltas[0] -= m_forward->value * mouse_y; + } + } + + // if the mouse has moved, force it to the center, so there's room to move + if ( mx || my ) + { + IN_ResetMouse(); + } + } + +/* +//#define TRACE_TEST +#if defined( TRACE_TEST ) + { + int mx, my; + void V_Move( int mx, int my ); + IN_GetMousePos( &mx, &my ); + V_Move( mx, my ); + } +#endif +*/ +} + +/* +=========== +IN_Accumulate +=========== +*/ +void CL_DLLEXPORT IN_Accumulate (void) +{ + RecClIN_Accumulate(); + + //only accumulate mouse if we are not moving the camera with the mouse + if ( !iMouseInUse && !g_iVisibleMouse ) + { + if (mouseactive) + { + GetCursorPos (¤t_pos); + + mx_accum += current_pos.x - gEngfuncs.GetWindowCenterX(); + my_accum += current_pos.y - gEngfuncs.GetWindowCenterY(); + + // force the mouse to the center, so there's room to move + IN_ResetMouse(); + } + } + +} + +/* +=================== +IN_ClearStates +=================== +*/ +void CL_DLLEXPORT IN_ClearStates (void) +{ + RecClIN_ClearStates(); + + if ( !mouseactive ) + return; + + mx_accum = 0; + my_accum = 0; + mouse_oldbuttonstate = 0; +} + +/* +=============== +IN_StartupJoystick +=============== +*/ +void IN_StartupJoystick (void) +{ + int numdevs; + JOYCAPS jc; + MMRESULT mmr; + + // assume no joystick + joy_avail = 0; + + // abort startup if user requests no joystick + if ( gEngfuncs.CheckParm ("-nojoy", NULL ) ) + return; + + // verify joystick driver is present + if ((numdevs = joyGetNumDevs ()) == 0) + { + gEngfuncs.Con_DPrintf ("joystick not found -- driver not present\n\n"); + return; + } + + // cycle through the joystick ids for the first valid one + for (joy_id=0 ; joy_idvalue == 0.0) + { + // default joystick initialization + // 2 axes only with joystick control + dwAxisMap[JOY_AXIS_X] = AxisTurn; + // dwControlMap[JOY_AXIS_X] = JOY_ABSOLUTE_AXIS; + dwAxisMap[JOY_AXIS_Y] = AxisForward; + // dwControlMap[JOY_AXIS_Y] = JOY_ABSOLUTE_AXIS; + } + else + { + if ( strcmp ( joy_name->string, "joystick") != 0 ) + { + // notify user of advanced controller + gEngfuncs.Con_Printf ("\n%s configured\n\n", joy_name->string); + } + + // advanced initialization here + // data supplied by user via joy_axisn cvars + dwTemp = (DWORD) joy_advaxisx->value; + dwAxisMap[JOY_AXIS_X] = dwTemp & 0x0000000f; + dwControlMap[JOY_AXIS_X] = dwTemp & JOY_RELATIVE_AXIS; + dwTemp = (DWORD) joy_advaxisy->value; + dwAxisMap[JOY_AXIS_Y] = dwTemp & 0x0000000f; + dwControlMap[JOY_AXIS_Y] = dwTemp & JOY_RELATIVE_AXIS; + dwTemp = (DWORD) joy_advaxisz->value; + dwAxisMap[JOY_AXIS_Z] = dwTemp & 0x0000000f; + dwControlMap[JOY_AXIS_Z] = dwTemp & JOY_RELATIVE_AXIS; + dwTemp = (DWORD) joy_advaxisr->value; + dwAxisMap[JOY_AXIS_R] = dwTemp & 0x0000000f; + dwControlMap[JOY_AXIS_R] = dwTemp & JOY_RELATIVE_AXIS; + dwTemp = (DWORD) joy_advaxisu->value; + dwAxisMap[JOY_AXIS_U] = dwTemp & 0x0000000f; + dwControlMap[JOY_AXIS_U] = dwTemp & JOY_RELATIVE_AXIS; + dwTemp = (DWORD) joy_advaxisv->value; + dwAxisMap[JOY_AXIS_V] = dwTemp & 0x0000000f; + dwControlMap[JOY_AXIS_V] = dwTemp & JOY_RELATIVE_AXIS; + } + + // compute the axes to collect from DirectInput + joy_flags = JOY_RETURNCENTERED | JOY_RETURNBUTTONS | JOY_RETURNPOV; + for (i = 0; i < JOY_MAX_AXES; i++) + { + if (dwAxisMap[i] != AxisNada) + { + joy_flags |= dwAxisFlags[i]; + } + } +} + + +/* +=========== +IN_Commands +=========== +*/ +void IN_Commands (void) +{ + int i, key_index; + DWORD buttonstate, povstate; + + if (!joy_avail) + { + return; + } + + + // loop through the joystick buttons + // key a joystick event or auxillary event for higher number buttons for each state change + buttonstate = ji.dwButtons; + for (i=0 ; i < (int)joy_numbuttons ; i++) + { + if ( (buttonstate & (1<value != 0.0) + { + ji.dwUpos += 100; + } + return 1; + } + else + { + // read error occurred + // turning off the joystick seems too harsh for 1 read error,\ + // but what should be done? + // Con_Printf ("IN_ReadJoystick: no response\n"); + // joy_avail = 0; + return 0; + } +} + + +/* +=========== +IN_JoyMove +=========== +*/ +void IN_JoyMove ( float frametime, float ioRotationDeltas[3], float ioTranslationDeltas[3]) +{ + float speed, aspeed; + float fAxisValue, fTemp; + int i; + + // complete initialization if first time in + // this is needed as cvars are not available at initialization time + if( joy_advancedinit != 1 ) + { + Joy_AdvancedUpdate_f(); + joy_advancedinit = 1; + } + + // verify joystick is available and that the user wants to use it + if (!joy_avail || !in_joystick->value) + { + return; + } + + // collect the joystick data, if possible + if (IN_ReadJoystick () != 1) + { + return; + } + + if (in_speed.state & 1) + speed = cl_movespeedkey->value; + else + speed = 1; + + aspeed = speed * frametime; + + // loop through the axes + for (i = 0; i < JOY_MAX_AXES; i++) + { + // get the floating point zero-centered, potentially-inverted data for the current axis + fAxisValue = (float) *pdwRawValue[i]; + // move centerpoint to zero + fAxisValue -= 32768.0; + + if (joy_wwhack2->value != 0.0) + { + if (dwAxisMap[i] == AxisTurn) + { + // this is a special formula for the Logitech WingMan Warrior + // y=ax^b; where a = 300 and b = 1.3 + // also x values are in increments of 800 (so this is factored out) + // then bounds check result to level out excessively high spin rates + fTemp = 300.0 * pow(abs(fAxisValue) / 800.0, 1.3); + if (fTemp > 14000.0) + fTemp = 14000.0; + // restore direction information + fAxisValue = (fAxisValue > 0.0) ? fTemp : -fTemp; + } + } + + // convert range from -32768..32767 to -1..1 + fAxisValue /= 32768.0; + + switch (dwAxisMap[i]) + { + case AxisForward: + if ((joy_advanced->value == 0.0) && (in_jlook.state & 1)) + { + // user wants forward control to become look control + if (fabs(fAxisValue) > joy_pitchthreshold->value) + { + // if mouse invert is on, invert the joystick pitch value + // only absolute control support here (joy_advanced is 0) + if (m_pitch->value < 0.0) + { + ioRotationDeltas[PITCH] -= (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value; + } + else + { + ioRotationDeltas[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value; + } + V_StopPitchDrift(); + } + else + { + // no pitch movement + // disable pitch return-to-center unless requested by user + // *** this code can be removed when the lookspring bug is fixed + // *** the bug always has the lookspring feature on + if(lookspring->value == 0.0) + { + V_StopPitchDrift(); + } + } + } + else + { + // user wants forward control to be forward control + if (fabs(fAxisValue) > joy_forwardthreshold->value) + { + ioTranslationDeltas[0] += (fAxisValue * joy_forwardsensitivity->value) * speed * kForwardSpeed; + } + } + break; + + case AxisSide: + if (fabs(fAxisValue) > joy_sidethreshold->value) + { + ioTranslationDeltas[1] += (fAxisValue * joy_sidesensitivity->value) * speed * kSideSpeed; + } + break; + + case AxisTurn: + if ((in_strafe.state & 1) || (lookstrafe->value && (in_jlook.state & 1))) + { + // user wants turn control to become side control + if (fabs(fAxisValue) > joy_sidethreshold->value) + { + ioTranslationDeltas[1] -= (fAxisValue * joy_sidesensitivity->value) * speed * kSideSpeed; + } + } + else + { + // user wants turn control to be turn control + if (fabs(fAxisValue) > joy_yawthreshold->value) + { + if(dwControlMap[i] == JOY_ABSOLUTE_AXIS) + { + ioRotationDeltas[YAW] += (fAxisValue * joy_yawsensitivity->value) * aspeed * cl_yawspeed->value; + } + else + { + ioRotationDeltas[YAW] += (fAxisValue * joy_yawsensitivity->value) * speed * 180.0; + } + + } + } + break; + + case AxisLook: + if (in_jlook.state & 1) + { + if (fabs(fAxisValue) > joy_pitchthreshold->value) + { + // pitch movement detected and pitch movement desired by user + if(dwControlMap[i] == JOY_ABSOLUTE_AXIS) + { + ioRotationDeltas[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value; + } + else + { + ioRotationDeltas[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * speed * 180.0; + } + V_StopPitchDrift(); + } + else + { + // no pitch movement + // disable pitch return-to-center unless requested by user + // *** this code can be removed when the lookspring bug is fixed + // *** the bug always has the lookspring feature on + if( lookspring->value == 0.0 ) + { + V_StopPitchDrift(); + } + } + } + break; + + default: + break; + } + } +} + +/* +=========== +IN_Move +=========== +*/ +void IN_Move ( float frametime, float ioRotationDeltas[3], float ioTranslationDeltas[3]) +{ + if ( !iMouseInUse && mouseactive ) + { + IN_MouseMove ( frametime, ioRotationDeltas, ioTranslationDeltas); + } + + IN_JoyMove ( frametime, ioRotationDeltas, ioTranslationDeltas); +} + +LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) +{ + + UINT virtualKey = wParam; + UINT scanCode = (lParam & 0xFF0000) >> 16; + bool pressed = (lParam & 0x80000000) == 0; + + if (gHUD.OnKeyEvent(virtualKey, scanCode, pressed)) + { + // Don't let Half-Life get the key. + return 1; + } + + return 0; + +} + +/* +=========== +IN_Init +=========== +*/ +void IN_Init (void) +{ + m_filter = gEngfuncs.pfnRegisterVariable ( "m_filter","0", FCVAR_ARCHIVE ); + sensitivity = gEngfuncs.pfnRegisterVariable ( "sensitivity","3", FCVAR_ARCHIVE ); // user mouse sensitivity setting. + + in_joystick = gEngfuncs.pfnRegisterVariable ( "joystick","0", FCVAR_ARCHIVE ); + joy_name = gEngfuncs.pfnRegisterVariable ( "joyname", "joystick", 0 ); + joy_advanced = gEngfuncs.pfnRegisterVariable ( "joyadvanced", "0", 0 ); + joy_advaxisx = gEngfuncs.pfnRegisterVariable ( "joyadvaxisx", "0", 0 ); + joy_advaxisy = gEngfuncs.pfnRegisterVariable ( "joyadvaxisy", "0", 0 ); + joy_advaxisz = gEngfuncs.pfnRegisterVariable ( "joyadvaxisz", "0", 0 ); + joy_advaxisr = gEngfuncs.pfnRegisterVariable ( "joyadvaxisr", "0", 0 ); + joy_advaxisu = gEngfuncs.pfnRegisterVariable ( "joyadvaxisu", "0", 0 ); + joy_advaxisv = gEngfuncs.pfnRegisterVariable ( "joyadvaxisv", "0", 0 ); + joy_forwardthreshold = gEngfuncs.pfnRegisterVariable ( "joyforwardthreshold", "0.15", 0 ); + joy_sidethreshold = gEngfuncs.pfnRegisterVariable ( "joysidethreshold", "0.15", 0 ); + joy_pitchthreshold = gEngfuncs.pfnRegisterVariable ( "joypitchthreshold", "0.15", 0 ); + joy_yawthreshold = gEngfuncs.pfnRegisterVariable ( "joyyawthreshold", "0.15", 0 ); + joy_forwardsensitivity = gEngfuncs.pfnRegisterVariable ( "joyforwardsensitivity", "-1.0", 0 ); + joy_sidesensitivity = gEngfuncs.pfnRegisterVariable ( "joysidesensitivity", "-1.0", 0 ); + joy_pitchsensitivity = gEngfuncs.pfnRegisterVariable ( "joypitchsensitivity", "1.0", 0 ); + joy_yawsensitivity = gEngfuncs.pfnRegisterVariable ( "joyyawsensitivity", "-1.0", 0 ); + joy_wwhack1 = gEngfuncs.pfnRegisterVariable ( "joywwhack1", "0.0", 0 ); + joy_wwhack2 = gEngfuncs.pfnRegisterVariable ( "joywwhack2", "0.0", 0 ); + + gEngfuncs.pfnAddCommand ("force_centerview", Force_CenterView_f); + gEngfuncs.pfnAddCommand ("joyadvancedupdate", Joy_AdvancedUpdate_f); + + IN_StartupMouse (); + IN_StartupJoystick (); + + // Install a keyboard hook so we can trap ESC before Steam gets it. + + DWORD threadID = GetCurrentThreadId(); + gKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardHookProc, GetModuleHandle(NULL), threadID); + + if (gKeyboardHook == NULL) + { + ConsolePrint("Unable to install keyboard hook\n"); + } + +} + + +/* +=========== +IN_Shutdown +=========== +*/ +void IN_Shutdown (void) +{ + + IN_DeactivateMouse (); + + if (gKeyboardHook != NULL) + { + UnhookWindowsHookEx(gKeyboardHook); + } + +} diff --git a/main/source/cl_dll/kbutton.h b/main/source/cl_dll/kbutton.h new file mode 100644 index 00000000..c3a7c138 --- /dev/null +++ b/main/source/cl_dll/kbutton.h @@ -0,0 +1,11 @@ +#if !defined( KBUTTONH ) +#define KBUTTONH +#pragma once + +typedef struct kbutton_s +{ + int down[2]; // key nums holding it down + int state; // low bit is down state +} kbutton_t; + +#endif // !KBUTTONH \ No newline at end of file diff --git a/main/source/cl_dll/menu.cpp b/main/source/cl_dll/menu.cpp new file mode 100644 index 00000000..aced9538 --- /dev/null +++ b/main/source/cl_dll/menu.cpp @@ -0,0 +1,187 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// menu.cpp +// +// generic menu handler +// +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" + +#include +#include + +#include "vgui_TeamFortressViewport.h" + +#define MAX_MENU_STRING 512 +char g_szMenuString[MAX_MENU_STRING]; +char g_szPrelocalisedMenuString[MAX_MENU_STRING]; + +int KB_ConvertString( char *in, char **ppout ); + +DECLARE_MESSAGE( m_Menu, ShowMenu ); + +int CHudMenu :: Init( void ) +{ + gHUD.AddHudElem( this ); + + HOOK_MESSAGE( ShowMenu ); + + InitHUDData(); + + return 1; +} + +void CHudMenu :: InitHUDData( void ) +{ + m_fMenuDisplayed = 0; + m_bitsValidSlots = 0; + Reset(); +} + +void CHudMenu :: Reset( void ) +{ + g_szPrelocalisedMenuString[0] = 0; + m_fWaitingForMore = FALSE; +} + +int CHudMenu :: VidInit( void ) +{ + return 1; +} + +int CHudMenu :: Draw( float flTime ) +{ + // check for if menu is set to disappear + if ( m_flShutoffTime > 0 ) + { + if ( m_flShutoffTime <= gHUD.m_flTime ) + { // times up, shutoff + m_fMenuDisplayed = 0; + m_iFlags &= ~HUD_ACTIVE; + return 1; + } + } + + // don't draw the menu if the scoreboard is being shown + if ( gViewPort && gViewPort->IsScoreBoardVisible() ) + return 1; + + // draw the menu, along the left-hand side of the screen + + // count the number of newlines + int nlc = 0; + for ( int i = 0; i < MAX_MENU_STRING && g_szMenuString[i] != '\0'; i++ ) + { + if ( g_szMenuString[i] == '\n' ) + nlc++; + } + + // center it + int y = (ScreenHeight()/2) - ((nlc/2)*12) - 40; // make sure it is above the say text + int x = 20; + + i = 0; + while ( i < MAX_MENU_STRING && g_szMenuString[i] != '\0' ) + { + gHUD.DrawHudString( x, y, 320, g_szMenuString + i, 255, 255, 255 ); + y += 12; + + while ( i < MAX_MENU_STRING && g_szMenuString[i] != '\0' && g_szMenuString[i] != '\n' ) + i++; + if ( g_szMenuString[i] == '\n' ) + i++; + } + + return 1; +} + +// selects an item from the menu +void CHudMenu :: SelectMenuItem( int menu_item ) +{ + // if menu_item is in a valid slot, send a menuselect command to the server + if ( (menu_item > 0) && (m_bitsValidSlots & (1 << (menu_item-1))) ) + { + char szbuf[32]; + sprintf( szbuf, "menuselect %d\n", menu_item ); + ClientCmd( szbuf ); + + // remove the menu + m_fMenuDisplayed = 0; + m_iFlags &= ~HUD_ACTIVE; + } +} + + +// Message handler for ShowMenu message +// takes four values: +// short: a bitfield of keys that are valid input +// char : the duration, in seconds, the menu should stay up. -1 means is stays until something is chosen. +// byte : a boolean, TRUE if there is more string yet to be received before displaying the menu, FALSE if it's the last string +// string: menu string to display +// if this message is never received, then scores will simply be the combined totals of the players. +int CHudMenu :: MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf ) +{ + char *temp = NULL; + + BEGIN_READ( pbuf, iSize ); + + m_bitsValidSlots = READ_SHORT(); + int DisplayTime = READ_CHAR(); + int NeedMore = READ_BYTE(); + + if ( DisplayTime > 0 ) + m_flShutoffTime = DisplayTime + gHUD.m_flTime; + else + m_flShutoffTime = -1; + + if ( m_bitsValidSlots ) + { + if ( !m_fWaitingForMore ) // this is the start of a new menu + { + strncpy( g_szPrelocalisedMenuString, READ_STRING(), MAX_MENU_STRING ); + } + else + { // append to the current menu string + strncat( g_szPrelocalisedMenuString, READ_STRING(), MAX_MENU_STRING - strlen(g_szPrelocalisedMenuString) ); + } + g_szPrelocalisedMenuString[MAX_MENU_STRING-1] = 0; // ensure null termination (strncat/strncpy does not) + + if ( !NeedMore ) + { // we have the whole string, so we can localise it now + strcpy( g_szMenuString, gHUD.m_TextMessage.BufferedLocaliseTextString( g_szPrelocalisedMenuString ) ); + + // Swap in characters + if ( KB_ConvertString( g_szMenuString, &temp ) ) + { + strcpy( g_szMenuString, temp ); + free( temp ); + } + } + + m_fMenuDisplayed = 1; + m_iFlags |= HUD_ACTIVE; + } + else + { + m_fMenuDisplayed = 0; // no valid slots means that the menu should be turned off + m_iFlags &= ~HUD_ACTIVE; + } + + m_fWaitingForMore = NeedMore; + + return 1; +} diff --git a/main/source/cl_dll/message.cpp b/main/source/cl_dll/message.cpp new file mode 100644 index 00000000..cdbfa887 --- /dev/null +++ b/main/source/cl_dll/message.cpp @@ -0,0 +1,700 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// Message.cpp +// +// implementation of CHudMessage class +// + +#include "hud.h" +#include "cl_util.h" +#include +#include +#include "parsemsg.h" +#include "mod/AvHClientVariables.h" + +DECLARE_MESSAGE( m_Message, HudText ) +DECLARE_MESSAGE( m_Message, HudText2 ) +DECLARE_MESSAGE( m_Message, GameTitle ) + +// 1 Global client_textmessage_t for custom messages that aren't in the titles.txt +client_textmessage_t g_pCustomMessage; +char *g_pCustomName = "Custom"; +char g_pCustomText[1024]; + +int CHudMessage::Init(void) +{ + HOOK_MESSAGE( HudText ); + HOOK_MESSAGE( HudText2 ); + HOOK_MESSAGE( GameTitle ); + + gHUD.AddHudElem(this); + + Reset(); + + return 1; +}; + +int CHudMessage::VidInit( void ) +{ + m_HUD_title_half = gHUD.GetSpriteIndex( "title_half" ); + m_HUD_title_life = gHUD.GetSpriteIndex( "title_life" ); + + return 1; +}; + +const int kDefaultRComp = 25; +const int kDefaultGComp = 255; +const int kDefaultBComp = 25; + +const int kEnemyRComp = 255; +const int kEnemyGComp = 25; +const int kEnemyBComp = 25; + +void CHudMessage::Reset( void ) +{ + memset( m_pMessages, 0, sizeof( m_pMessages[0] ) * maxHUDMessages ); + memset( m_startTime, 0, sizeof( m_startTime[0] ) * maxHUDMessages ); + + m_gameTitleTime = 0; + m_pGameTitle = NULL; + + // Player id stuff + this->mPlayerIDTime = 0; + this->mPlayerID = NULL; + + this->mPlayerIDMessage.effect = 1; + this->mPlayerIDMessage.r1 = kDefaultRComp; + this->mPlayerIDMessage.g1 = kDefaultGComp; + this->mPlayerIDMessage.b1 = kDefaultBComp; + this->mPlayerIDMessage.a1 = 255; + + this->mPlayerIDMessage.g2 = 255; + this->mPlayerIDMessage.r2 = this->mPlayerIDMessage.b2 = 25; + this->mPlayerIDMessage.a2 = 255; + + this->SetPlayerIDPosition(); + + this->mPlayerIDMessage.fadein = 0.04; + this->mPlayerIDMessage.fadeout = 0.5; + this->mPlayerIDMessage.fxtime = 0.25; + this->mPlayerIDMessage.holdtime = 5; + this->mPlayerIDMessage.pName = NULL; + this->mPlayerIDMessage.pMessage = NULL; +} + +void CHudMessage::SetPlayerIDPosition() +{ + if(gEngfuncs.pfnGetCvarFloat(kvCenterEntityID) || gHUD.GetInTopDownMode()) + { + this->mPlayerIDMessage.x = -1; // Centered + this->mPlayerIDMessage.y = -1; // Centered + } + else + { + this->mPlayerIDMessage.x = .3; + this->mPlayerIDMessage.y = .9; + } +} + +float CHudMessage::FadeBlend( float fadein, float fadeout, float hold, float localTime ) +{ + float fadeTime = fadein + hold; + float fadeBlend; + + if ( localTime < 0 ) + return 0; + + if ( localTime < fadein ) + { + fadeBlend = 1 - ((fadein - localTime) / fadein); + } + else if ( localTime > fadeTime ) + { + if ( fadeout > 0 ) + fadeBlend = 1 - ((localTime - fadeTime) / fadeout); + else + fadeBlend = 0; + } + else + fadeBlend = 1; + + return fadeBlend; +} + + +int CHudMessage::XPosition( float x, int width, int totalWidth ) +{ + int xPos; + + if ( x == -1 ) + { + xPos = (ScreenWidth() - width) / 2; + } + else + { + if ( x < 0 ) + xPos = (1.0 + x) * ScreenWidth() - totalWidth; // Alight right + else + xPos = x * ScreenWidth(); + } + + if ( xPos + width > ScreenWidth() ) + xPos = ScreenWidth() - width; + else if ( xPos < 0 ) + xPos = 0; + + return xPos; +} + + +int CHudMessage::YPosition( float y, int height ) +{ + int yPos; + + if ( y == -1 ) // Centered? + yPos = (ScreenHeight() - height) * 0.5; + else + { + // Alight bottom? + if ( y < 0 ) + yPos = (1.0 + y) * ScreenHeight() - height; // Alight bottom + else // align top + yPos = y * ScreenHeight(); + } + + if ( yPos + height > ScreenHeight() ) + yPos = ScreenHeight() - height; + else if ( yPos < 0 ) + yPos = 0; + + return yPos; +} + + +void CHudMessage::MessageScanNextChar( void ) +{ + int srcRed, srcGreen, srcBlue, destRed, destGreen, destBlue; + int blend; + + srcRed = m_parms.pMessage->r1; + srcGreen = m_parms.pMessage->g1; + srcBlue = m_parms.pMessage->b1; + blend = 0; // Pure source + + switch( m_parms.pMessage->effect ) + { + // Fade-in / Fade-out + case 0: + case 1: + destRed = destGreen = destBlue = 0; + blend = m_parms.fadeBlend; + break; + + case 2: + m_parms.charTime += m_parms.pMessage->fadein; + if ( m_parms.charTime > m_parms.time ) + { + srcRed = srcGreen = srcBlue = 0; + blend = 0; // pure source + } + else + { + float deltaTime = m_parms.time - m_parms.charTime; + + destRed = destGreen = destBlue = 0; + if ( m_parms.time > m_parms.fadeTime ) + { + blend = m_parms.fadeBlend; + } + else if ( deltaTime > m_parms.pMessage->fxtime ) + blend = 0; // pure dest + else + { + destRed = m_parms.pMessage->r2; + destGreen = m_parms.pMessage->g2; + destBlue = m_parms.pMessage->b2; + blend = 255 - (deltaTime * (1.0/m_parms.pMessage->fxtime) * 255.0 + 0.5); + } + } + break; + } + if ( blend > 255 ) + blend = 255; + else if ( blend < 0 ) + blend = 0; + + m_parms.r = ((srcRed * (255-blend)) + (destRed * blend)) >> 8; + m_parms.g = ((srcGreen * (255-blend)) + (destGreen * blend)) >> 8; + m_parms.b = ((srcBlue * (255-blend)) + (destBlue * blend)) >> 8; + + if ( m_parms.pMessage->effect == 1 && m_parms.charTime != 0 ) + { + if ( m_parms.x >= 0 && m_parms.y >= 0 && (m_parms.x + gHUD.m_scrinfo.charWidths[ m_parms.text ]) <= ScreenWidth() ) + TextMessageDrawChar( m_parms.x, m_parms.y, m_parms.text, m_parms.pMessage->r2, m_parms.pMessage->g2, m_parms.pMessage->b2 ); + } +} + + +void CHudMessage::MessageScanStart( void ) +{ + switch( m_parms.pMessage->effect ) + { + // Fade-in / out with flicker + case 1: + case 0: + m_parms.fadeTime = m_parms.pMessage->fadein + m_parms.pMessage->holdtime; + + + if ( m_parms.time < m_parms.pMessage->fadein ) + { + m_parms.fadeBlend = ((m_parms.pMessage->fadein - m_parms.time) * (1.0/m_parms.pMessage->fadein) * 255); + } + else if ( m_parms.time > m_parms.fadeTime ) + { + if ( m_parms.pMessage->fadeout > 0 ) + m_parms.fadeBlend = (((m_parms.time - m_parms.fadeTime) / m_parms.pMessage->fadeout) * 255); + else + m_parms.fadeBlend = 255; // Pure dest (off) + } + else + m_parms.fadeBlend = 0; // Pure source (on) + m_parms.charTime = 0; + + if ( m_parms.pMessage->effect == 1 && (rand()%100) < 10 ) + m_parms.charTime = 1; + break; + + case 2: + m_parms.fadeTime = (m_parms.pMessage->fadein * m_parms.length) + m_parms.pMessage->holdtime; + + if ( m_parms.time > m_parms.fadeTime && m_parms.pMessage->fadeout > 0 ) + m_parms.fadeBlend = (((m_parms.time - m_parms.fadeTime) / m_parms.pMessage->fadeout) * 255); + else + m_parms.fadeBlend = 0; + break; + } +} + + +void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time ) +{ + int i, j, length, width; + const char *pText; + //unsigned char line[80]; + unsigned char line[256]; + + pText = pMessage->pMessage; + ASSERT(pText != NULL); + + // Count lines + m_parms.lines = 1; + m_parms.time = time; + m_parms.pMessage = pMessage; + length = 0; + width = 0; + m_parms.totalWidth = 0; + while ( *pText ) + { + if ( *pText == '\n' ) + { + m_parms.lines++; + if ( width > m_parms.totalWidth ) + m_parms.totalWidth = width; + width = 0; + } + else + width += gHUD.m_scrinfo.charWidths[*pText]; + pText++; + length++; + } + m_parms.length = length; + m_parms.totalHeight = (m_parms.lines * gHUD.m_scrinfo.iCharHeight); + + + m_parms.y = YPosition( pMessage->y, m_parms.totalHeight ); + pText = pMessage->pMessage; + + m_parms.charTime = 0; + + MessageScanStart(); + + for ( i = 0; i < m_parms.lines; i++ ) + { + m_parms.lineLength = 0; + m_parms.width = 0; + while ( *pText && *pText != '\n' ) + { + unsigned char c = *pText; + line[m_parms.lineLength] = c; + m_parms.width += gHUD.m_scrinfo.charWidths[c]; + m_parms.lineLength++; + pText++; + } + pText++; // Skip LF + line[m_parms.lineLength] = 0; + + m_parms.x = XPosition( pMessage->x, m_parms.width, m_parms.totalWidth ); + + for ( j = 0; j < m_parms.lineLength; j++ ) + { + m_parms.text = line[j]; + int next = m_parms.x + gHUD.m_scrinfo.charWidths[ m_parms.text ]; + MessageScanNextChar(); + + if ( m_parms.x >= 0 && m_parms.y >= 0 && next <= ScreenWidth() ) + TextMessageDrawChar( m_parms.x, m_parms.y, m_parms.text, m_parms.r, m_parms.g, m_parms.b ); + m_parms.x = next; + } + + m_parms.y += gHUD.m_scrinfo.iCharHeight; + } +} + + +int CHudMessage::Draw( float fTime ) +{ + int i, drawn; + client_textmessage_t *pMessage; + + drawn = 0; + + if ( m_gameTitleTime > 0 ) + { + float localTime = gHUD.m_flTime - m_gameTitleTime; + float brightness; + + // Maybe timer isn't set yet + if ( m_gameTitleTime > gHUD.m_flTime ) + m_gameTitleTime = gHUD.m_flTime; + + if ( localTime > (m_pGameTitle->fadein + m_pGameTitle->holdtime + m_pGameTitle->fadeout) ) + m_gameTitleTime = 0; + else + { + brightness = FadeBlend( m_pGameTitle->fadein, m_pGameTitle->fadeout, m_pGameTitle->holdtime, localTime ); + + int halfWidth = gHUD.GetSpriteRect(m_HUD_title_half).right - gHUD.GetSpriteRect(m_HUD_title_half).left; + int fullWidth = halfWidth + gHUD.GetSpriteRect(m_HUD_title_life).right - gHUD.GetSpriteRect(m_HUD_title_life).left; + int fullHeight = gHUD.GetSpriteRect(m_HUD_title_half).bottom - gHUD.GetSpriteRect(m_HUD_title_half).top; + + int x = XPosition( m_pGameTitle->x, fullWidth, fullWidth ); + int y = YPosition( m_pGameTitle->y, fullHeight ); + + + SPR_Set( gHUD.GetSprite(m_HUD_title_half), brightness * m_pGameTitle->r1, brightness * m_pGameTitle->g1, brightness * m_pGameTitle->b1 ); + SPR_DrawAdditive( 0, x, y, &gHUD.GetSpriteRect(m_HUD_title_half) ); + + SPR_Set( gHUD.GetSprite(m_HUD_title_life), brightness * m_pGameTitle->r1, brightness * m_pGameTitle->g1, brightness * m_pGameTitle->b1 ); + SPR_DrawAdditive( 0, x + halfWidth, y, &gHUD.GetSpriteRect(m_HUD_title_life) ); + + drawn++; + } + } + + // Draw player id +// if(this->mPlayerIDTime > 0) +// { +// float localTime = gHUD.m_flTime - this->mPlayerIDTime; +// //float brightness; +// +// // Maybe timer isn't set yet +// if ( this->mPlayerIDTime > gHUD.m_flTime ) +// this->mPlayerIDTime = gHUD.m_flTime; +// +// if ( localTime > (this->mPlayerIDMessage.fadein + this->mPlayerIDMessage.holdtime + this->mPlayerIDMessage.fadeout) ) +// { +// this->mPlayerIDTime = 0; +// this->mPlayerIDMessage.pName = NULL; +// this->mPlayerIDMessage.pMessage = NULL; +// } +// else +// { +// drawn++; +// } +// } + + // Fixup level transitions + for ( i = 0; i < maxHUDMessages; i++ ) + { + // Assume m_parms.time contains last time + if ( m_pMessages[i] ) + { + pMessage = m_pMessages[i]; + if ( m_startTime[i] > gHUD.m_flTime ) + m_startTime[i] = gHUD.m_flTime + m_parms.time - m_startTime[i] + 0.2; // Server takes 0.2 seconds to spawn, adjust for this + } + } + + for ( i = 0; i < maxHUDMessages; i++ ) + { + client_textmessage_t* theMessage = this->m_pMessages[i]; + if(theMessage) + { + if(this->DrawMessage(theMessage, this->m_startTime[i], fTime)) + { + drawn++; + } + else + { + // The message is over + this->m_pMessages[i] = NULL; + } + } + } + + if(this->DrawMessage(&this->mPlayerIDMessage, this->mPlayerIDTime, fTime)) + { + drawn++; + } + else + { + this->mPlayerIDMessage.pName = NULL; + this->mPlayerIDMessage.pMessage = NULL; + } + + + // Remember the time -- to fix up level transitions + m_parms.time = gHUD.m_flTime; + // Don't call until we get another message + if ( !drawn ) + m_iFlags &= ~HUD_ACTIVE; + + return 1; +} + +bool CHudMessage::DrawMessage(client_textmessage_t* inMessage, float inStartTime, float inCurrentTime) +{ + ASSERT(inMessage); + bool theDrewMessage = false; + + if(inMessage->pMessage) + { + float endTime; + + // This is when the message is over + switch( inMessage->effect ) + { + case 0: + case 1: + endTime = inStartTime + inMessage->fadein + inMessage->fadeout + inMessage->holdtime; + break; + + // Fade in is per character in scanning messages + case 2: + endTime = inStartTime + (inMessage->fadein * strlen( inMessage->pMessage )) + inMessage->fadeout + inMessage->holdtime; + break; + } + + if ( inCurrentTime <= endTime ) + { + float messageTime = inCurrentTime - inStartTime; + + // Draw the message + // effect 0 is fade in/fade out + // effect 1 is flickery credits + // effect 2 is write out (training room) + MessageDrawScan( inMessage, messageTime ); + theDrewMessage = true; + } + } + + return theDrewMessage; +} + +void CHudMessage::MessageAdd( const char *pName, float time ) +{ + int i,j; + client_textmessage_t *tempMessage; + + for ( i = 0; i < maxHUDMessages; i++ ) + { + if ( !m_pMessages[i] ) + { + // Trim off a leading # if it's there + if ( pName[0] == '#' ) + tempMessage = TextMessageGet( pName+1 ); + else + tempMessage = TextMessageGet( pName ); + // If we couldnt find it in the titles.txt, just create it + if ( !tempMessage ) + { + g_pCustomMessage.effect = 2; + g_pCustomMessage.r1 = g_pCustomMessage.g1 = g_pCustomMessage.b1 = g_pCustomMessage.a1 = 100; + g_pCustomMessage.r2 = 240; + g_pCustomMessage.g2 = 110; + g_pCustomMessage.b2 = 0; + g_pCustomMessage.a2 = 0; + g_pCustomMessage.x = -1; // Centered + g_pCustomMessage.y = 0.7; + g_pCustomMessage.fadein = 0.01; + g_pCustomMessage.fadeout = 1.5; + g_pCustomMessage.fxtime = 0.25; + g_pCustomMessage.holdtime = 5; + g_pCustomMessage.pName = g_pCustomName; + strcpy( g_pCustomText, pName ); + g_pCustomMessage.pMessage = g_pCustomText; + + tempMessage = &g_pCustomMessage; + } + + for ( j = 0; j < maxHUDMessages; j++ ) + { + if ( m_pMessages[j] ) + { + // is this message already in the list + if ( !strcmp( tempMessage->pMessage, m_pMessages[j]->pMessage ) ) + { + return; + } + + // get rid of any other messages in same location (only one displays at a time) + if ( fabs( tempMessage->y - m_pMessages[j]->y ) < 0.0001 ) + { + if ( fabs( tempMessage->x - m_pMessages[j]->x ) < 0.0001 ) + { + m_pMessages[j] = NULL; + } + } + } + } + + m_pMessages[i] = tempMessage; + m_startTime[i] = time; + return; + } + } +} + +void CHudMessage::MessageAddPlayerID(const char* inName, bool inEnemy) +{ + // If we're already drawing this, extend the time + //if(inName && this->mPlayerIDMessage.pMessage && !strcmp(inName, this->mPlayerIDMessage.pMessage)) + //{ + // //this->mPlayerIDMessage.holdtime = + //} + //else + //{ + // else add this message + this->mPlayerIDMessage.pMessage = inName; + + //strcpy( g_pCustomText, pName ); + //this->mPlayerIDMessage.pMessage = g_pCustomText; + this->mPlayerIDTime = gHUD.m_flTime; + + // Set color depending on if friend or enemy + if(inEnemy) + { + this->mPlayerIDMessage.r1 = kEnemyRComp; + this->mPlayerIDMessage.g1 = kEnemyGComp; + this->mPlayerIDMessage.b1 = kEnemyBComp; + } + else + { + this->mPlayerIDMessage.r1 = kDefaultRComp; + this->mPlayerIDMessage.g1 = kDefaultGComp; + this->mPlayerIDMessage.b1 = kDefaultBComp; + } + + this->SetPlayerIDPosition(); + + // Turn on drawing + if(inName) + { + if ( !(m_iFlags & HUD_ACTIVE) ) + m_iFlags |= HUD_ACTIVE; + } + + //} +} + +bool CHudMessage::MessageRemove(const char *pName) +{ + const char* theMessage = pName; + bool theSuccess = false; + bool theNeedsTranslation = (pName[0] == '#'); + + // Trim off a leading # if it's there + if(theNeedsTranslation) + { + client_textmessage_t* tempMessage = TextMessageGet(pName + 1); + if(tempMessage) + { + theMessage = tempMessage->pMessage; + } + } + + if(theMessage) + { + for (int j = 0; j < maxHUDMessages; j++ ) + { + if ( m_pMessages[j] ) + { + // is this message already in the list + if (!strcmp(theMessage, m_pMessages[j]->pMessage)) + { + m_startTime[j] = -1; + theSuccess = true; + } + } + } + } + return theSuccess; +} + +int CHudMessage::MsgFunc_HudText( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + char *pString = READ_STRING(); + + MessageAdd( pString, gHUD.m_flTime ); + + // Remember the time -- to fix up level transitions + m_parms.time = gHUD.m_flTime; + + // Turn on drawing + if ( !(m_iFlags & HUD_ACTIVE) ) + m_iFlags |= HUD_ACTIVE; + + return 1; +} + +int CHudMessage::MsgFunc_HudText2( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + char *pString = READ_STRING(); + bool theIsAutoHelp = READ_BYTE(); + + gHUD.AddTooltip(pString, theIsAutoHelp); + + return 2; +} + +int CHudMessage::MsgFunc_GameTitle( const char *pszName, int iSize, void *pbuf ) +{ + m_pGameTitle = TextMessageGet( "GAMETITLE" ); + if ( m_pGameTitle != NULL ) + { + m_gameTitleTime = gHUD.m_flTime; + + // Turn on drawing + if ( !(m_iFlags & HUD_ACTIVE) ) + m_iFlags |= HUD_ACTIVE; + } + + return 1; +} diff --git a/main/source/cl_dll/overview.cpp b/main/source/cl_dll/overview.cpp new file mode 100644 index 00000000..95aec524 --- /dev/null +++ b/main/source/cl_dll/overview.cpp @@ -0,0 +1,160 @@ +//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#include "hud.h" +#include "cl_util.h" +#include "cl_entity.h" +#include "triangleapi.h" +#include "vgui_TeamFortressViewport.h" + +// these are included for the math functions +#include "com_model.h" +#include "studio_util.h" + +#pragma warning(disable: 4244) + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +int CHudOverview::Init() +{ + gHUD.AddHudElem(this); + + m_iFlags |= HUD_ACTIVE; + + return 1; +} + +//----------------------------------------------------------------------------- +// Purpose: Loads new icons +//----------------------------------------------------------------------------- +int CHudOverview::VidInit() +{ + m_hsprPlayer = Safe_SPR_Load("sprites/ring.spr"); + m_hsprViewcone = Safe_SPR_Load("sprites/camera.spr"); + + return 1; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : flTime - +// intermission - +//----------------------------------------------------------------------------- +int CHudOverview::Draw(float flTime) +{ + // only draw in overview mode + if (!gEngfuncs.Overview_GetOverviewState()) + return 1; + + // make sure we have player info + gViewPort->GetAllPlayersInfo(); + + // calculate player size on the overview + int x1, y1, x2, y2; + float v0[3]={0,0,0}, v1[3]={64,64,0}; + gEngfuncs.Overview_WorldToScreen(v0, &x1, &y1); + gEngfuncs.Overview_WorldToScreen(v1, &x2, &y2); + float scale = abs(x2 - x1); + + // loop through all the players and draw them on the map + for (int i = 1; i <= MAX_PLAYERS; i++) + { + cl_entity_t *pl = gEngfuncs.GetEntityByIndex(i); + + if (pl && pl->player && pl->curstate.health > 0 && pl->curstate.solid != SOLID_NOT) + { + int x, y, z = 0; + float v[3]={pl->origin[0], pl->origin[1], 0}; + gEngfuncs.Overview_WorldToScreen(v, &x, &y); + + // hack in some team colors + float r, g, bc; + if (g_PlayerExtraInfo[i].teamnumber == 1) + { + r = 0.0f; g = 0.0f; bc = 1.0f; + } + else if (g_PlayerExtraInfo[i].teamnumber == 2) + { + r = 1.0f; g = 0.0f; bc = 0.0f; + } + else + { + // just use the default orange color if the team isn't set + r = 1.0f; g = 0.7f; bc = 0.0f; + } + + // set the current texture + gEngfuncs.pTriAPI->SpriteTexture((struct model_s *)gEngfuncs.GetSpritePointer(m_hsprPlayer), 0); + + // additive render mode + gEngfuncs.pTriAPI->RenderMode(kRenderTransAdd); + + // no culling + gEngfuncs.pTriAPI->CullFace(TRI_NONE); + + // draw a square + gEngfuncs.pTriAPI->Begin(TRI_QUADS); + + // set the color to be that of the team + gEngfuncs.pTriAPI->Color4f(r, g, bc, 1.0f); + + // calculate rotational matrix + vec3_t a, b, angles; + float rmatrix[3][4]; // transformation matrix + VectorCopy(pl->angles, angles); + angles[0] = 0.0f; + angles[1] += 90.f; + angles[1] = -angles[1]; + angles[2] = 0.0f; + AngleMatrix(angles, rmatrix); + a[2] = 0; + + a[0] = -scale; a[1] = -scale; + VectorTransform(a, rmatrix , b ); + gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); + gEngfuncs.pTriAPI->Vertex3f(x + b[0], y + b[1], z); + + a[0]=-scale; a[1] = scale; + VectorTransform(a, rmatrix , b ); + gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); + gEngfuncs.pTriAPI->Vertex3f (x + b[0], y + b[1], z); + + a[0]=scale; a[1] = scale; + VectorTransform(a, rmatrix , b ); + gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); + gEngfuncs.pTriAPI->Vertex3f (x + b[0], y + b[1], z); + + a[0]=scale; a[1] = -scale; + VectorTransform(a, rmatrix , b ); + gEngfuncs.pTriAPI->TexCoord2f( 1, 0 ); + gEngfuncs.pTriAPI->Vertex3f (x + b[0], y + b[1], z); + + // finish up + gEngfuncs.pTriAPI->End(); + gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); + + // draw the players name and health underneath + char string[256]; + sprintf(string, "%s (%i%%)", g_PlayerInfoList[i].name, pl->curstate.health); + DrawConsoleString(x, y + (1.1 * scale), string); + } + } + + return 1; +} + +//----------------------------------------------------------------------------- +// Purpose: called every time a server is connected to +//----------------------------------------------------------------------------- +void CHudOverview::InitHUDData() +{ +// this block would force the spectator view to be on +// gEngfuncs.Overview_SetDrawOverview( 1 ); +// gEngfuncs.Overview_SetDrawInset( 0 ); +} + diff --git a/main/source/cl_dll/overview.h b/main/source/cl_dll/overview.h new file mode 100644 index 00000000..e87de10d --- /dev/null +++ b/main/source/cl_dll/overview.h @@ -0,0 +1,31 @@ +//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef OVERVIEW_H +#define OVERVIEW_H +#pragma once + + +//----------------------------------------------------------------------------- +// Purpose: Handles the drawing of the top-down map and all the things on it +//----------------------------------------------------------------------------- +class CHudOverview : public CHudBase +{ +public: + int Init(); + int VidInit(); + + int Draw(float flTime); + void InitHUDData( void ); + +private: + HSPRITE m_hsprPlayer; + HSPRITE m_hsprViewcone; +}; + + +#endif // OVERVIEW_H diff --git a/main/source/cl_dll/parsemsg.cpp b/main/source/cl_dll/parsemsg.cpp new file mode 100644 index 00000000..d7070de5 --- /dev/null +++ b/main/source/cl_dll/parsemsg.cpp @@ -0,0 +1,166 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// parsemsg.cpp +// +typedef unsigned char byte; +#define true 1 + +static byte *gpBuf; +static int giSize; +static int giRead; +static int giBadRead; + +void BEGIN_READ( void *buf, int size ) +{ + giRead = 0; + giBadRead = 0; + giSize = size; + gpBuf = (byte*)buf; +} + + +int READ_CHAR( void ) +{ + int c; + + if (giRead + 1 > giSize) + { + giBadRead = true; + return -1; + } + + c = (signed char)gpBuf[giRead]; + giRead++; + + return c; +} + +int READ_BYTE( void ) +{ + int c; + + if (giRead+1 > giSize) + { + giBadRead = true; + return -1; + } + + c = (unsigned char)gpBuf[giRead]; + giRead++; + + return c; +} + +int READ_SHORT( void ) +{ + int c; + + if (giRead+2 > giSize) + { + giBadRead = true; + return -1; + } + + c = (short)( gpBuf[giRead] + ( gpBuf[giRead+1] << 8 ) ); + + giRead += 2; + + return c; +} + +int READ_WORD( void ) +{ + return READ_SHORT(); +} + + +int READ_LONG( void ) +{ + int c; + + if (giRead+4 > giSize) + { + giBadRead = true; + return -1; + } + + c = gpBuf[giRead] + (gpBuf[giRead + 1] << 8) + (gpBuf[giRead + 2] << 16) + (gpBuf[giRead + 3] << 24); + + giRead += 4; + + return c; +} + +float READ_FLOAT( void ) +{ + union + { + byte b[4]; + float f; + int l; + } dat; + + dat.b[0] = gpBuf[giRead]; + dat.b[1] = gpBuf[giRead+1]; + dat.b[2] = gpBuf[giRead+2]; + dat.b[3] = gpBuf[giRead+3]; + giRead += 4; + +// dat.l = LittleLong (dat.l); + + return dat.f; +} + +char* READ_STRING( void ) +{ + static char string[2048]; + int l,c; + + string[0] = 0; + + l = 0; + do + { + if ( giRead+1 > giSize ) + break; // no more characters + + c = READ_CHAR(); + if (c == -1 || c == 0) + break; + string[l] = c; + l++; + } while (l < sizeof(string)-1); + + string[l] = 0; + + return string; +} + +float READ_COORD( void ) +{ + return (float)(READ_SHORT() * (1.0/8)); +} + +float READ_ANGLE( void ) +{ + return (float)(READ_CHAR() * (360.0/256)); +} + +float READ_HIRESANGLE( void ) +{ + return (float)(READ_SHORT() * (360.0/65536)); +} + diff --git a/main/source/cl_dll/parsemsg.h b/main/source/cl_dll/parsemsg.h new file mode 100644 index 00000000..382ac58a --- /dev/null +++ b/main/source/cl_dll/parsemsg.h @@ -0,0 +1,40 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// parsemsg.h +// + +//#define ASSERT( x ) + +void BEGIN_READ( void *buf, int size ); +int READ_CHAR( void ); +int READ_BYTE( void ); +int READ_SHORT( void ); +int READ_WORD( void ); +int READ_LONG( void ); +float READ_FLOAT( void ); +char* READ_STRING( void ); +float READ_COORD( void ); +float READ_ANGLE( void ); +float READ_HIRESANGLE( void ); + + + + + + + + + diff --git a/main/source/cl_dll/r_studioint.h b/main/source/cl_dll/r_studioint.h new file mode 100644 index 00000000..973ae182 --- /dev/null +++ b/main/source/cl_dll/r_studioint.h @@ -0,0 +1,108 @@ +#if !defined( R_STUDIOINT_H ) +#define R_STUDIOINT_H +#if defined( _WIN32 ) +#pragma once +#endif + +#define STUDIO_INTERFACE_VERSION 1 + +typedef struct engine_studio_api_s +{ + // Allocate number*size bytes and zero it + void *( *Mem_Calloc ) ( int number, size_t size ); + // Check to see if pointer is in the cache + void *( *Cache_Check ) ( struct cache_user_s *c ); + // Load file into cache ( can be swapped out on demand ) + void ( *LoadCacheFile ) ( char *path, struct cache_user_s *cu ); + // Retrieve model pointer for the named model + struct model_s *( *Mod_ForName ) ( const char *name, int crash_if_missing ); + // Retrieve pointer to studio model data block from a model + void *( *Mod_Extradata ) ( struct model_s *mod ); + // Retrieve indexed model from client side model precache list + struct model_s *( *GetModelByIndex ) ( int index ); + // Get entity that is set for rendering + struct cl_entity_s * ( *GetCurrentEntity ) ( void ); + // Get referenced player_info_t + struct player_info_s *( *PlayerInfo ) ( int index ); + // Get most recently received player state data from network system + struct entity_state_s *( *GetPlayerState ) ( int index ); + // Get viewentity + struct cl_entity_s * ( *GetViewEntity ) ( void ); + // Get current frame count, and last two timestampes on client + void ( *GetTimes ) ( int *framecount, double *current, double *old ); + // Get a pointer to a cvar by name + struct cvar_s *( *GetCvar ) ( const char *name ); + // Get current render origin and view vectors ( up, right and vpn ) + void ( *GetViewInfo ) ( float *origin, float *upv, float *rightv, float *vpnv ); + // Get sprite model used for applying chrome effect + struct model_s *( *GetChromeSprite ) ( void ); + // Get model counters so we can incement instrumentation + void ( *GetModelCounters ) ( int **s, int **a ); + // Get software scaling coefficients + void ( *GetAliasScale ) ( float *x, float *y ); + + // Get bone, light, alias, and rotation matrices + float ****( *StudioGetBoneTransform ) ( void ); + float ****( *StudioGetLightTransform )( void ); + float ***( *StudioGetAliasTransform ) ( void ); + float ***( *StudioGetRotationMatrix ) ( void ); + + // Set up body part, and get submodel pointers + void ( *StudioSetupModel ) ( int bodypart, void **ppbodypart, void **ppsubmodel ); + // Check if entity's bbox is in the view frustum + int ( *StudioCheckBBox ) ( void ); + // Apply lighting effects to model + void ( *StudioDynamicLight ) ( struct cl_entity_s *ent, struct alight_s *plight ); + void ( *StudioEntityLight ) ( struct alight_s *plight ); + void ( *StudioSetupLighting ) ( struct alight_s *plighting ); + + // Draw mesh vertices + void ( *StudioDrawPoints ) ( void ); + + // Draw hulls around bones + void ( *StudioDrawHulls ) ( void ); + // Draw bbox around studio models + void ( *StudioDrawAbsBBox ) ( void ); + // Draws bones + void ( *StudioDrawBones ) ( void ); + // Loads in appropriate texture for model + void ( *StudioSetupSkin ) ( void *ptexturehdr, int index ); + // Sets up for remapped colors + void ( *StudioSetRemapColors ) ( int top, int bottom ); + // Set's player model and returns model pointer + struct model_s *( *SetupPlayerModel ) ( int index ); + // Fires any events embedded in animation + void ( *StudioClientEvents ) ( void ); + // Retrieve/set forced render effects flags + int ( *GetForceFaceFlags ) ( void ); + void ( *SetForceFaceFlags ) ( int flags ); + // Tell engine the value of the studio model header + void ( *StudioSetHeader ) ( void *header ); + // Tell engine which model_t * is being renderered + void ( *SetRenderModel ) ( struct model_s *model ); + + // Final state setup and restore for rendering + void ( *SetupRenderer ) ( int rendermode ); + void ( *RestoreRenderer ) ( void ); + + // Set render origin for applying chrome effect + void ( *SetChromeOrigin ) ( void ); + + // True if using D3D/OpenGL + int ( *IsHardware ) ( void ); + + // Only called by hardware interface + void ( *GL_StudioDrawShadow ) ( void ); + void ( *GL_SetRenderMode ) ( int mode ); +} engine_studio_api_t; + +typedef struct r_studio_interface_s +{ + int version; + int ( *StudioDrawModel ) ( int flags ); + int ( *StudioDrawPlayer ) ( int flags, struct entity_state_s *pplayer ); +} r_studio_interface_t; + +extern r_studio_interface_t *pStudioAPI; + +#endif // R_STUDIOINT_H \ No newline at end of file diff --git a/main/source/cl_dll/saytext.cpp b/main/source/cl_dll/saytext.cpp new file mode 100644 index 00000000..885efb1b --- /dev/null +++ b/main/source/cl_dll/saytext.cpp @@ -0,0 +1,383 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// saytext.cpp +// +// implementation of CHudSayText class +// + +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" + +#include +#include + +#include "vgui_TeamFortressViewport.h" +#include "mod/AvHClientUtil.h" +#include "mod/ChatPanel.h" + +float* GetClientColor(int clientIndex); + +#define MAX_LINES 5 +#define MAX_CHARS_PER_LINE 256 /* it can be less than this, depending on char size */ + +// allow 20 pixels on either side of the text +#define MAX_LINE_WIDTH ( ScreenWidth() - 40 ) +#define LINE_START 10 +static float SCROLL_SPEED = 5; + +static char g_szLineBuffer[ MAX_LINES + 1 ][ MAX_CHARS_PER_LINE ]; +static float *g_pflNameColors[ MAX_LINES + 1 ]; +static int g_iNameLengths[ MAX_LINES + 1 ]; +static float flScrollTime = 0; // the time at which the lines next scroll up + +static int Y_START = 0; +static int line_height = 0; + +DECLARE_MESSAGE( m_SayText, SayText ); + +int CHudSayText :: Init( void ) +{ + gHUD.AddHudElem( this ); + + HOOK_MESSAGE( SayText ); + + InitHUDData(); + + m_HUD_saytext = gEngfuncs.pfnRegisterVariable( "hud_saytext", "1", 0 ); + m_HUD_saytext_time = gEngfuncs.pfnRegisterVariable( "hud_saytext_time", "5", 0 ); + + m_iFlags |= HUD_INTERMISSION; // is always drawn during an intermission + + return 1; +} + + +void CHudSayText :: InitHUDData( void ) +{ + memset( g_szLineBuffer, 0, sizeof g_szLineBuffer ); + memset( g_pflNameColors, 0, sizeof g_pflNameColors ); + memset( g_iNameLengths, 0, sizeof g_iNameLengths ); +} + +int CHudSayText :: VidInit( void ) +{ + return 1; +} + + +int ScrollTextUp( void ) +{ + ConsolePrint( g_szLineBuffer[0] ); // move the first line into the console buffer + g_szLineBuffer[MAX_LINES][0] = 0; + memmove( g_szLineBuffer[0], g_szLineBuffer[1], sizeof(g_szLineBuffer) - sizeof(g_szLineBuffer[0]) ); // overwrite the first line + memmove( &g_pflNameColors[0], &g_pflNameColors[1], sizeof(g_pflNameColors) - sizeof(g_pflNameColors[0]) ); + memmove( &g_iNameLengths[0], &g_iNameLengths[1], sizeof(g_iNameLengths) - sizeof(g_iNameLengths[0]) ); + g_szLineBuffer[MAX_LINES-1][0] = 0; + + if ( g_szLineBuffer[0][0] == ' ' ) // also scroll up following lines + { + g_szLineBuffer[0][0] = 2; + return 1 + ScrollTextUp(); + } + + return 1; +} + +int CHudSayText :: Draw( float flTime ) +{ + int y = Y_START; + + if ( ( gViewPort && gViewPort->AllowedToPrintText() == FALSE) || !m_HUD_saytext->value ) + return 1; + + // make sure the scrolltime is within reasonable bounds, to guard against the clock being reset + flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value ); + + // make sure the scrolltime is within reasonable bounds, to guard against the clock being reset + flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value ); + + if ( flScrollTime <= flTime ) + { + if ( *g_szLineBuffer[0] ) + { + flScrollTime = flTime + m_HUD_saytext_time->value; + // push the console up + ScrollTextUp(); + } + else + { // buffer is empty, just disable drawing of this section + m_iFlags &= ~HUD_ACTIVE; + } + } + + for ( int i = 0; i < MAX_LINES; i++ ) + { + if ( *g_szLineBuffer[i] ) + { + if ( *g_szLineBuffer[i] == 2 && g_pflNameColors[i] ) + { + // it's a saytext string + static char buf[MAX_PLAYER_NAME_LENGTH+32]; + + // draw the first x characters in the player color + strncpy( buf, g_szLineBuffer[i], min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH+32) ); + buf[ min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH+31) ] = 0; + DrawSetTextColor( g_pflNameColors[i][0], g_pflNameColors[i][1], g_pflNameColors[i][2] ); + + // If we're an alien, move chat over a bit so it doesn't overlap energy bar + int theDrawX = LINE_START; + //if(gHUD.GetIsAlien()) + //{ + // theDrawX += .07f*ScreenWidth; + //} + int x = DrawConsoleString(theDrawX, y, buf ); + + // color is reset after each string draw + DrawConsoleString( x, y, g_szLineBuffer[i] + g_iNameLengths[i] ); + } + else + { + // normal draw + DrawConsoleString( LINE_START, y, g_szLineBuffer[i] ); + } + } + + y += line_height; + } + + + return 1; +} + +int CHudSayText :: MsgFunc_SayText( const char *pszName, int iSize, void *pbuf ) +{ + + BEGIN_READ( pbuf, iSize ); + + // Read client who spoke the message + int client_index = READ_BYTE(); + + // Read message + const char* inString = READ_STRING(); + string theChatMessage(inString); + + // Read location of player when he spoke this (" " if nowhere) + const char* theLocation = READ_STRING(); + + string theTranslatedLocation; + if(LocalizeString(theLocation, theTranslatedLocation)) + { + // If player is on our team, add location + cl_entity_s* theEntity = gEngfuncs.GetEntityByIndex(client_index); + cl_entity_s* theLocalPlayer = gEngfuncs.GetLocalPlayer(); + + if(theEntity && theLocalPlayer && (theEntity->curstate.team == theLocalPlayer->curstate.team)) + { + // Search for first : so we can insert location + int theColonIndex = theChatMessage.find_first_of(":"); + if((theColonIndex > 0) && (theColonIndex < (int)theChatMessage.length())) + { + AvHCUTrimExtraneousLocationText(theTranslatedLocation); + + // Insert location + string theNewMessage = theChatMessage.substr(0, theColonIndex); + theNewMessage += " ("; + + theNewMessage += theTranslatedLocation; + theNewMessage += ")"; + theNewMessage += theChatMessage.substr(theColonIndex/*, theChatMessage.length()*/); + + // Replace the message with new one + theChatMessage = theNewMessage; + } + } + } + + SayTextPrint(theChatMessage.c_str(), theChatMessage.length(), client_index ); + + return 1; +} + +void CHudSayText :: SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex ) +{ + if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) + { + // Print it straight to the console + ConsolePrint( pszBuf ); + return; + } + + // find an empty string slot + for ( int i = 0; i < MAX_LINES; i++ ) + { + if ( ! *g_szLineBuffer[i] ) + break; + } + if ( i == MAX_LINES ) + { + // force scroll buffer up + ScrollTextUp(); + i = MAX_LINES - 1; + } + + g_iNameLengths[i] = 0; + g_pflNameColors[i] = NULL; + + // if it's a say message, search for the players name in the string + if ( *pszBuf == 2 && clientIndex > 0 ) + { + GetPlayerInfo( clientIndex, &g_PlayerInfoList[clientIndex] ); + const char *pName = g_PlayerInfoList[clientIndex].name; + + if ( pName ) + { + const char *nameInString = strstr( pszBuf, pName ); + + if ( nameInString ) + { + g_iNameLengths[i] = strlen( pName ) + (nameInString - pszBuf); + g_pflNameColors[i] = GetClientColor(clientIndex); + } + } + } + + strncpy( g_szLineBuffer[i], pszBuf, max(iBufSize -1, MAX_CHARS_PER_LINE-1) ); + + // make sure the text fits in one line + EnsureTextFitsInOneLineAndWrapIfHaveTo( i ); + + // Set scroll time + if ( i == 0 ) + { + flScrollTime = gHUD.m_flTime + m_HUD_saytext_time->value; + } + + m_iFlags |= HUD_ACTIVE; + //PlaySound( "misc/talk.wav", 1 ); + gHUD.PlayHUDSound("misc/talk.wav", 1); + + Y_START = ScreenHeight()*.7f; + + ChatPanel* theChatPanel = gViewPort->GetChatPanel(); + + if (theChatPanel != NULL) + { + + int theX; + int theY; + int theWidth; + int theHeight; + + gViewPort->GetChatPanel()->getPos(theX, theY); + gViewPort->GetChatPanel()->getSize(theWidth, theHeight); + + //Y_START = theY + theHeight + 5; //voogru: this is too high imo. + Y_START = ScreenHeight()*.5f; + } + +} + +void CHudSayText :: EnsureTextFitsInOneLineAndWrapIfHaveTo( int line ) +{ + int line_width = 0; + GetConsoleStringSize( g_szLineBuffer[line], &line_width, &line_height ); + + if ( (line_width + LINE_START) > MAX_LINE_WIDTH ) + { // string is too long to fit on line + // scan the string until we find what word is too long, and wrap the end of the sentence after the word + int length = LINE_START; + int tmp_len = 0; + char *last_break = NULL; + for ( char *x = g_szLineBuffer[line]; *x != 0; x++ ) + { + // check for a color change, if so skip past it + if ( x[0] == '/' && x[1] == '(' ) + { + x += 2; + // skip forward until past mode specifier + while ( *x != 0 && *x != ')' ) + x++; + + if ( *x != 0 ) + x++; + + if ( *x == 0 ) + break; + } + + char buf[2]; + buf[1] = 0; + + if ( *x == ' ' && x != g_szLineBuffer[line] ) // store each line break, except for the very first character + last_break = x; + + buf[0] = *x; // get the length of the current character + GetConsoleStringSize( buf, &tmp_len, &line_height ); + length += tmp_len; + + if ( length > MAX_LINE_WIDTH ) + { // needs to be broken up + if ( !last_break ) + last_break = x-1; + + x = last_break; + + // find an empty string slot + int j; + do + { + for ( j = 0; j < MAX_LINES; j++ ) + { + if ( ! *g_szLineBuffer[j] ) + break; + } + if ( j == MAX_LINES ) + { + // need to make more room to display text, scroll stuff up then fix the pointers + int linesmoved = ScrollTextUp(); + line -= linesmoved; + last_break = last_break - (sizeof(g_szLineBuffer[0]) * linesmoved); + } + } + while ( j == MAX_LINES ); + + // copy remaining string into next buffer, making sure it starts with a space character + if ( (char)*last_break == (char)' ' ) + { + int linelen = strlen(g_szLineBuffer[j]); + int remaininglen = strlen(last_break); + + if ( (linelen - remaininglen) <= MAX_CHARS_PER_LINE ) + strcat( g_szLineBuffer[j], last_break ); + } + else + { + if ( (strlen(g_szLineBuffer[j]) - strlen(last_break) - 2) < MAX_CHARS_PER_LINE ) + { + strcat( g_szLineBuffer[j], " " ); + strcat( g_szLineBuffer[j], last_break ); + } + } + + *last_break = 0; // cut off the last string + + EnsureTextFitsInOneLineAndWrapIfHaveTo( j ); + break; + } + } + } +} \ No newline at end of file diff --git a/main/source/cl_dll/soundsystem.cpp b/main/source/cl_dll/soundsystem.cpp new file mode 100644 index 00000000..f04fa695 --- /dev/null +++ b/main/source/cl_dll/soundsystem.cpp @@ -0,0 +1,168 @@ +//======== (C) Copyright 1999, 2000 Valve, L.L.C. All rights reserved. ======== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: +// +// $Workfile: $ +// $Date: 2001/09/13 22:28:00 $ +// +//----------------------------------------------------------------------------- +// $Log: soundsystem.cpp,v $ +// Revision 1.2 2001/09/13 22:28:00 Charlie +// - Updated NS with new Half-life 1108 patch in preparation for voice support and spectator mode +// +// Revision 1.1.2.1 2001/09/13 14:42:29 Charlie +// - HL1108 +// +// +// $NoKeywords: $ +//============================================================================= +#include +#include +#include +#include "r_studioint.h" + +extern engine_studio_api_t IEngineStudio; + +#define RENDERTYPE_UNDEFINED 0 +#define RENDERTYPE_SOFTWARE 1 +#define RENDERTYPE_HARDWARE 2 + +#define ENGINE_LAUNCHER_API_VERSION 1 + +LPDIRECTSOUND lpDS = NULL; +LPDIRECTSOUNDBUFFER lpDSBuf = NULL; +LPHWAVEOUT lpHW = NULL; + +static HMODULE hEngine = 0; + +typedef struct engine_api_s +{ + int version; + int rendertype; + int size; + + // Functions + void ( *unused1 ) ( void ); + void ( *unused2 ) ( void ); + void ( *unused3 ) ( void ); + void ( *unused4 ) ( void ); + void ( *unused5 ) ( void ); + void ( *unused6 ) ( void ); + void ( *unused7 ) ( void ); + void ( *unused8 ) ( void ); + void ( *unused9 ) ( void ); + void ( *unused10 ) ( void ); + void ( *unused11 ) ( void ); + void ( *unused12 ) ( void ); + void ( *unused13 ) ( void ); + void ( *unused14 ) ( void ); + void ( *unused15 ) ( void ); + void ( *unused16 ) ( void ); + void ( *unused17 ) ( void ); + void ( *unused18 ) ( void ); + void ( *unused19 ) ( void ); + void ( *unused20 ) ( void ); + void ( *unused21 ) ( void ); + void ( *unused22 ) ( void ); + void ( *unused23 ) ( void ); + void ( *unused24 ) ( void ); + void ( *unused25 ) ( void ); + void ( *unused26 ) ( void ); + void ( *unused27 ) ( void ); + void ( *unused28 ) ( void ); + void ( *unused29 ) ( void ); + void ( *unused30 ) ( void ); + void ( *unused31 ) ( void ); + void ( *unused32 ) ( void ); + void ( *unused33 ) ( void ); + void ( *unused34 ) ( void ); + + void ( *S_GetDSPointer ) ( struct IDirectSound **lpDS, struct IDirectSoundBuffer **lpDSBuf ); + void *( *S_GetWAVPointer ) ( void ); + + void ( *unused35 ) ( void ); + void ( *unused36 ) ( void ); + void ( *unused37 ) ( void ); + void ( *unused38 ) ( void ); + void ( *unused39 ) ( void ); + void ( *unused40 ) ( void ); + void ( *unused41 ) ( void ); + void ( *unused42 ) ( void ); + void ( *unused43 ) ( void ); + void ( *unused44 ) ( void ); + void ( *unused45 ) ( void ); + void ( *unused46 ) ( void ); + void ( *unused47 ) ( void ); + void ( *unused48 ) ( void ); + void ( *unused49 ) ( void ); + void ( *unused50 ) ( void ); + void ( *unused51 ) ( void ); + void ( *unused52 ) ( void ); + void ( *unused53 ) ( void ); + void ( *unused54 ) ( void ); + void ( *unused55 ) ( void ); +} engine_api_t; + +static engine_api_t engineapi; + +typedef int (*engine_api_func)( int version, int size, struct engine_api_s *api ); + +//----------------------------------------------------------------------------- +// Purpose: Get launcher/engine interface from engine module +// Input : hMod - +// Output : int +//----------------------------------------------------------------------------- +int Eng_LoadFunctions( HMODULE hMod ) +{ + engine_api_func pfnEngineAPI; + + pfnEngineAPI = ( engine_api_func )GetProcAddress( hMod, "Sys_EngineAPI" ); + if ( !pfnEngineAPI ) + return 0; + + if ( !(*pfnEngineAPI)( ENGINE_LAUNCHER_API_VERSION, sizeof( engine_api_t ), &engineapi ) ) + return 0; + + // All is okay + return 1; +} + +//----------------------------------------------------------------------------- +// Purpose: Load proper engine .dll and get pointer to either DSound and primary buffer or HWAVEOUT ( NT 4.0, e.g. ) +//----------------------------------------------------------------------------- +void LoadSoundAPIs( void ) +{ + hEngine = ::LoadLibrary( IEngineStudio.IsHardware() ? "hw.dll" : "sw.dll" ); + if ( hEngine ) + { + if ( Eng_LoadFunctions( hEngine ) ) + { + if ( engineapi.S_GetDSPointer && engineapi.S_GetWAVPointer ) + { + engineapi.S_GetDSPointer(&lpDS, &lpDSBuf); + lpHW = (HWAVEOUT FAR *)engineapi.S_GetWAVPointer(); + } + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Close engine library, release sound pointers +//----------------------------------------------------------------------------- +void ShutdownSoundAPIs( void ) +{ + if( hEngine ) + { + FreeLibrary( hEngine ); + hEngine = 0; + } + + lpDS = 0; + lpDSBuf = 0; + lpHW = 0; +} diff --git a/main/source/cl_dll/status_icons.cpp b/main/source/cl_dll/status_icons.cpp new file mode 100644 index 00000000..2d9aeecc --- /dev/null +++ b/main/source/cl_dll/status_icons.cpp @@ -0,0 +1,162 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// status_icons.cpp +// +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" +#include +#include +#include "parsemsg.h" +#include "event_api.h" + +DECLARE_MESSAGE( m_StatusIcons, StatusIcon ); + +int CHudStatusIcons::Init( void ) +{ + HOOK_MESSAGE( StatusIcon ); + + gHUD.AddHudElem( this ); + + Reset(); + + return 1; +} + +int CHudStatusIcons::VidInit( void ) +{ + + return 1; +} + +void CHudStatusIcons::Reset( void ) +{ + memset( m_IconList, 0, sizeof m_IconList ); + m_iFlags &= ~HUD_ACTIVE; +} + +// Draw status icons along the left-hand side of the screen +int CHudStatusIcons::Draw( float flTime ) +{ + if (gEngfuncs.IsSpectateOnly()) + return 1; + // find starting position to draw from, along right-hand side of screen + int x = 5; + int y = ScreenHeight() / 2; + + // loop through icon list, and draw any valid icons drawing up from the middle of screen + for ( int i = 0; i < MAX_ICONSPRITES; i++ ) + { + if ( m_IconList[i].spr ) + { + y -= ( m_IconList[i].rc.bottom - m_IconList[i].rc.top ) + 5; + + SPR_Set( m_IconList[i].spr, m_IconList[i].r, m_IconList[i].g, m_IconList[i].b ); + SPR_DrawAdditive( 0, x, y, &m_IconList[i].rc ); + } + } + + return 1; +} + +// Message handler for StatusIcon message +// accepts five values: +// byte : TRUE = ENABLE icon, FALSE = DISABLE icon +// string : the sprite name to display +// byte : red +// byte : green +// byte : blue +int CHudStatusIcons::MsgFunc_StatusIcon( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + int ShouldEnable = READ_BYTE(); + char *pszIconName = READ_STRING(); + if ( ShouldEnable ) + { + int r = READ_BYTE(); + int g = READ_BYTE(); + int b = READ_BYTE(); + EnableIcon( pszIconName, r, g, b ); + m_iFlags |= HUD_ACTIVE; + } + else + { + DisableIcon( pszIconName ); + } + + return 1; +} + +// add the icon to the icon list, and set it's drawing color +void CHudStatusIcons::EnableIcon( char *pszIconName, unsigned char red, unsigned char green, unsigned char blue ) +{ + // check to see if the sprite is in the current list + for ( int i = 0; i < MAX_ICONSPRITES; i++ ) + { + if ( !stricmp( m_IconList[i].szSpriteName, pszIconName ) ) + break; + } + + if ( i == MAX_ICONSPRITES ) + { + // icon not in list, so find an empty slot to add to + for ( i = 0; i < MAX_ICONSPRITES; i++ ) + { + if ( !m_IconList[i].spr ) + break; + } + } + + // if we've run out of space in the list, overwrite the first icon + if ( i == MAX_ICONSPRITES ) + { + i = 0; + } + + // Load the sprite and add it to the list + // the sprite must be listed in hud.txt + int spr_index = gHUD.GetSpriteIndex( pszIconName ); + m_IconList[i].spr = gHUD.GetSprite( spr_index ); + m_IconList[i].rc = gHUD.GetSpriteRect( spr_index ); + m_IconList[i].r = red; + m_IconList[i].g = green; + m_IconList[i].b = blue; + strcpy( m_IconList[i].szSpriteName, pszIconName ); + + // Hack: Play Timer sound when a grenade icon is played (in 0.8 seconds) + if ( strstr(m_IconList[i].szSpriteName, "grenade") ) + { + cl_entity_t *pthisplayer = gEngfuncs.GetLocalPlayer(); + gEngfuncs.pEventAPI->EV_PlaySound( pthisplayer->index, pthisplayer->origin, CHAN_STATIC, "weapons/timer.wav", 1.0, ATTN_NORM, 0, PITCH_NORM ); + } +} + +void CHudStatusIcons::DisableIcon( char *pszIconName ) +{ + // find the sprite is in the current list + for ( int i = 0; i < MAX_ICONSPRITES; i++ ) + { + if ( !stricmp( m_IconList[i].szSpriteName, pszIconName ) ) + { + // clear the item from the list + memset( &m_IconList[i], 0, sizeof icon_sprite_t ); + return; + } + } +} diff --git a/main/source/cl_dll/statusbar.cpp b/main/source/cl_dll/statusbar.cpp new file mode 100644 index 00000000..c2615511 --- /dev/null +++ b/main/source/cl_dll/statusbar.cpp @@ -0,0 +1,300 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// statusbar.cpp +// +// generic text status bar, set by game dll +// runs across bottom of screen +// + +#include "hud.h" +#include "cl_util.h" +#include "parsemsg.h" + +#include +#include + +DECLARE_MESSAGE( m_StatusBar, StatusText ); +DECLARE_MESSAGE( m_StatusBar, StatusValue ); + +#define STATUSBAR_ID_LINE 1 + +float *GetClientColor( int clientIndex ); +extern float g_ColorYellow[3]; + +int CHudStatusBar :: Init( void ) +{ + //gHUD.AddHudElem( this ); + + HOOK_MESSAGE( StatusText ); + HOOK_MESSAGE( StatusValue ); + + Reset(); + + CVAR_CREATE( "hud_centerid", "0", FCVAR_ARCHIVE ); + + return 1; +} + +int CHudStatusBar :: VidInit( void ) +{ + // Load sprites here + + return 1; +} + +void CHudStatusBar :: Reset( void ) +{ + int i = 0; + + m_iFlags &= ~HUD_ACTIVE; // start out inactive + for ( i = 0; i < MAX_STATUSBAR_LINES; i++ ) + { + m_szStatusText[i][0] = 0; + m_iStatusValues[i] = -1; + } + + //memset( m_iStatusValues, 0, sizeof m_iStatusValues ); + + m_iStatusValues[0] = 1; // 0 is the special index, which always returns true + + // reset our colors for the status bar lines (yellow is default) + for ( i = 0; i < MAX_STATUSBAR_LINES; i++ ) + m_pflNameColors[i] = g_ColorYellow; +} + +const char* CHudStatusBar::GetStatusString() const +{ + static char kStatusString[1024]; + + memset(kStatusString, 0, 1024); + + for(int i = 0; i < MAX_STATUSBAR_LINES; i++) + { + const char* theCurrentString = m_szStatusBar[i]; + if(strlen(theCurrentString) > 0) + { + strcat(kStatusString, theCurrentString); + } + } + + return kStatusString; +} + +void CHudStatusBar :: ParseStatusString( int line_num ) +{ + // localise string first + char szBuffer[MAX_STATUSTEXT_LENGTH]; + memset( szBuffer, 0, sizeof szBuffer ); + gHUD.m_TextMessage.LocaliseTextString( m_szStatusText[line_num], szBuffer, MAX_STATUSTEXT_LENGTH ); + + // parse m_szStatusText & m_iStatusValues into m_szStatusBar + memset( m_szStatusBar[line_num], 0, MAX_STATUSTEXT_LENGTH ); + char *src = szBuffer; + char *dst = m_szStatusBar[line_num]; + + char *src_start = src, *dst_start = dst; + + while ( *src != 0 ) + { + while ( *src == '\n' ) + src++; // skip over any newlines + + if ( ((src - src_start) >= MAX_STATUSTEXT_LENGTH) || ((dst - dst_start) >= MAX_STATUSTEXT_LENGTH) ) + break; + + int index = atoi( src ); + // should we draw this line? + if ( (index >= 0 && index < MAX_STATUSBAR_VALUES) && (m_iStatusValues[index] != -1)) + { // parse this line and append result to the status bar + while ( *src >= '0' && *src <= '9' ) + src++; + + if ( *src == '\n' || *src == 0 ) + continue; // no more left in this text line + + // copy the text, char by char, until we hit a % or a \n + while ( *src != '\n' && *src != 0 ) + { + if ( *src != '%' ) + { // just copy the character + *dst = *src; + dst++, src++; + } + else + { + // get the descriptor + char valtype = *(++src); // move over % + + // if it's a %, draw a % sign + if ( valtype == '%' ) + { + *dst = valtype; + dst++, src++; + continue; + } + + // move over descriptor, then get and move over the index + index = atoi( ++src ); + while ( *src >= '0' && *src <= '9' ) + src++; + + if ( index >= 0 && index < MAX_STATUSBAR_VALUES ) + { + int indexval = m_iStatusValues[index]; + + // get the string to substitute in place of the %XX + char szRepString[MAX_PLAYER_NAME_LENGTH]; + switch ( valtype ) + { + case 'p': // player name + GetPlayerInfo( indexval, &g_PlayerInfoList[indexval] ); + if ( g_PlayerInfoList[indexval].name != NULL ) + { + strncpy( szRepString, g_PlayerInfoList[indexval].name, MAX_PLAYER_NAME_LENGTH ); + m_pflNameColors[line_num] = GetClientColor( indexval ); + } + else + { + strcpy( szRepString, "******" ); + } + + break; + case 'i': // number + sprintf( szRepString, "%d", indexval ); + break; + default: + szRepString[0] = 0; + } + + for ( char *cp = szRepString; *cp != 0 && ((dst - dst_start) < MAX_STATUSTEXT_LENGTH); cp++, dst++ ) + *dst = *cp; + } + } + } + } + else + { + // skip to next line of text + while ( *src != 0 && *src != '\n' ) + src++; + } + } +} + +void CHudStatusBar::ReparseStringIfNeeded() +{ + if ( m_bReparseString ) + { + for ( int i = 0; i < MAX_STATUSBAR_LINES; i++ ) + { + m_pflNameColors[i] = g_ColorYellow; + ParseStatusString( i ); + } + m_bReparseString = FALSE; + } + +} + +int CHudStatusBar :: Draw( float fTime ) +{ + + this->ReparseStringIfNeeded(); + + // Draw the status bar lines + for ( int i = 0; i < MAX_STATUSBAR_LINES; i++ ) + { + int TextHeight, TextWidth; + GetConsoleStringSize( m_szStatusBar[i], &TextWidth, &TextHeight ); + + int Y_START; + if ( ScreenHeight() >= 480 ) + Y_START = ScreenHeight() - 55; + else + Y_START = ScreenHeight() - 45; + + int x = 5; + int y = Y_START - ( TextHeight * i ); // draw along bottom of screen + + // let user set status ID bar centering + if ( (i == STATUSBAR_ID_LINE) && CVAR_GET_FLOAT("hud_centerid") ) + { + x = max( 0, max(2, (ScreenWidth() - TextWidth)) / 2 ); + y = (ScreenHeight() / 2) + (TextHeight*CVAR_GET_FLOAT("hud_centerid")); + } + + if ( m_pflNameColors[i] ) + DrawSetTextColor( m_pflNameColors[i][0], m_pflNameColors[i][1], m_pflNameColors[i][2] ); + + DrawConsoleString( x, y, m_szStatusBar[i] ); + } + + return 1; +} + +// Message handler for StatusText message +// accepts two values: +// byte: line number of status bar text +// string: status bar text +// this string describes how the status bar should be drawn +// a semi-regular expression: +// ( slotnum ([a..z] [%pX] [%iX])*)* +// where slotnum is an index into the Value table (see below) +// if slotnum is 0, the string is always drawn +// if StatusValue[slotnum] != 0, the following string is drawn, upto the next newline - otherwise the text is skipped upto next newline +// %pX, where X is an integer, will substitute a player name here, getting the player index from StatusValue[X] +// %iX, where X is an integer, will substitute a number here, getting the number from StatusValue[X] +int CHudStatusBar :: MsgFunc_StatusText( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + int line = READ_BYTE(); + + if ( line < 0 || line >= MAX_STATUSBAR_LINES ) + return 1; + + strncpy( m_szStatusText[line], READ_STRING(), MAX_STATUSTEXT_LENGTH ); + m_szStatusText[line][MAX_STATUSTEXT_LENGTH-1] = 0; // ensure it's null terminated ( strncpy() won't null terminate if read string too long) + + if ( m_szStatusText[0] == 0 ) + m_iFlags &= ~HUD_ACTIVE; + else + m_iFlags |= HUD_ACTIVE; // we have status text, so turn on the status bar + + m_bReparseString = TRUE; + this->ReparseStringIfNeeded(); + + return 1; +} + +// Message handler for StatusText message +// accepts two values: +// byte: index into the status value array +// short: value to store +int CHudStatusBar :: MsgFunc_StatusValue( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + int index = READ_BYTE(); + if ( index < 1 || index >= MAX_STATUSBAR_VALUES ) + return 1; // index out of range + + m_iStatusValues[index] = READ_SHORT(); + + m_bReparseString = TRUE; + this->ReparseStringIfNeeded(); + + return 1; +} \ No newline at end of file diff --git a/main/source/cl_dll/studio_util.cpp b/main/source/cl_dll/studio_util.cpp new file mode 100644 index 00000000..87fc4471 --- /dev/null +++ b/main/source/cl_dll/studio_util.cpp @@ -0,0 +1,244 @@ +#include +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "com_model.h" +#include "studio_util.h" + +/* +==================== +AngleMatrix + +==================== +*/ +void AngleMatrix (const float *angles, float (*matrix)[4] ) +{ + float angle; + float sr, sp, sy, cr, cp, cy; + + angle = angles[YAW] * (M_PI*2 / 360); + sy = sin(angle); + cy = cos(angle); + angle = angles[PITCH] * (M_PI*2 / 360); + sp = sin(angle); + cp = cos(angle); + angle = angles[ROLL] * (M_PI*2 / 360); + sr = sin(angle); + cr = cos(angle); + + // matrix = (YAW * PITCH) * ROLL + matrix[0][0] = cp*cy; + matrix[1][0] = cp*sy; + matrix[2][0] = -sp; + matrix[0][1] = sr*sp*cy+cr*-sy; + matrix[1][1] = sr*sp*sy+cr*cy; + matrix[2][1] = sr*cp; + matrix[0][2] = (cr*sp*cy+-sr*-sy); + matrix[1][2] = (cr*sp*sy+-sr*cy); + matrix[2][2] = cr*cp; + matrix[0][3] = 0.0; + matrix[1][3] = 0.0; + matrix[2][3] = 0.0; +} + +/* +==================== +VectorCompare + +==================== +*/ +int VectorCompare (const float *v1, const float *v2) +{ + int i; + + for (i=0 ; i<3 ; i++) + if (v1[i] != v2[i]) + return 0; + + return 1; +} + +/* +==================== +CrossProduct + +==================== +*/ +void CrossProduct (const float *v1, const float *v2, float *cross) +{ + cross[0] = v1[1]*v2[2] - v1[2]*v2[1]; + cross[1] = v1[2]*v2[0] - v1[0]*v2[2]; + cross[2] = v1[0]*v2[1] - v1[1]*v2[0]; +} + +/* +==================== +VectorTransform + +==================== +*/ +void VectorTransform (const float *in1, float in2[3][4], float *out) +{ + out[0] = DotProduct(in1, in2[0]) + in2[0][3]; + out[1] = DotProduct(in1, in2[1]) + in2[1][3]; + out[2] = DotProduct(in1, in2[2]) + in2[2][3]; +} + +/* +================ +ConcatTransforms + +================ +*/ +void ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]) +{ + out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + + in1[0][2] * in2[2][0]; + out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + + in1[0][2] * in2[2][1]; + out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + + in1[0][2] * in2[2][2]; + out[0][3] = in1[0][0] * in2[0][3] + in1[0][1] * in2[1][3] + + in1[0][2] * in2[2][3] + in1[0][3]; + out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + + in1[1][2] * in2[2][0]; + out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + + in1[1][2] * in2[2][1]; + out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + + in1[1][2] * in2[2][2]; + out[1][3] = in1[1][0] * in2[0][3] + in1[1][1] * in2[1][3] + + in1[1][2] * in2[2][3] + in1[1][3]; + out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + + in1[2][2] * in2[2][0]; + out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + + in1[2][2] * in2[2][1]; + out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + + in1[2][2] * in2[2][2]; + out[2][3] = in1[2][0] * in2[0][3] + in1[2][1] * in2[1][3] + + in1[2][2] * in2[2][3] + in1[2][3]; +} + +// angles index are not the same as ROLL, PITCH, YAW + +/* +==================== +AngleQuaternion + +==================== +*/ +void AngleQuaternion( float *angles, vec4_t quaternion ) +{ + float angle; + float sr, sp, sy, cr, cp, cy; + + // FIXME: rescale the inputs to 1/2 angle + angle = angles[2] * 0.5; + sy = sin(angle); + cy = cos(angle); + angle = angles[1] * 0.5; + sp = sin(angle); + cp = cos(angle); + angle = angles[0] * 0.5; + sr = sin(angle); + cr = cos(angle); + + quaternion[0] = sr*cp*cy-cr*sp*sy; // X + quaternion[1] = cr*sp*cy+sr*cp*sy; // Y + quaternion[2] = cr*cp*sy-sr*sp*cy; // Z + quaternion[3] = cr*cp*cy+sr*sp*sy; // W +} + +/* +==================== +QuaternionSlerp + +==================== +*/ +void QuaternionSlerp( vec4_t p, vec4_t q, float t, vec4_t qt ) +{ + int i; + float omega, cosom, sinom, sclp, sclq; + + // decide if one of the quaternions is backwards + float a = 0; + float b = 0; + + for (i = 0; i < 4; i++) + { + a += (p[i]-q[i])*(p[i]-q[i]); + b += (p[i]+q[i])*(p[i]+q[i]); + } + if (a > b) + { + for (i = 0; i < 4; i++) + { + q[i] = -q[i]; + } + } + + cosom = p[0]*q[0] + p[1]*q[1] + p[2]*q[2] + p[3]*q[3]; + + if ((1.0 + cosom) > 0.000001) + { + if ((1.0 - cosom) > 0.000001) + { + omega = acos( cosom ); + sinom = sin( omega ); + sclp = sin( (1.0 - t)*omega) / sinom; + sclq = sin( t*omega ) / sinom; + } + else + { + sclp = 1.0 - t; + sclq = t; + } + for (i = 0; i < 4; i++) { + qt[i] = sclp * p[i] + sclq * q[i]; + } + } + else + { + qt[0] = -q[1]; + qt[1] = q[0]; + qt[2] = -q[3]; + qt[3] = q[2]; + sclp = sin( (1.0 - t) * (0.5 * M_PI)); + sclq = sin( t * (0.5 * M_PI)); + for (i = 0; i < 3; i++) + { + qt[i] = sclp * p[i] + sclq * qt[i]; + } + } +} + +/* +==================== +QuaternionMatrix + +==================== +*/ +void QuaternionMatrix( vec4_t quaternion, float (*matrix)[4] ) +{ + matrix[0][0] = 1.0 - 2.0 * quaternion[1] * quaternion[1] - 2.0 * quaternion[2] * quaternion[2]; + matrix[1][0] = 2.0 * quaternion[0] * quaternion[1] + 2.0 * quaternion[3] * quaternion[2]; + matrix[2][0] = 2.0 * quaternion[0] * quaternion[2] - 2.0 * quaternion[3] * quaternion[1]; + + matrix[0][1] = 2.0 * quaternion[0] * quaternion[1] - 2.0 * quaternion[3] * quaternion[2]; + matrix[1][1] = 1.0 - 2.0 * quaternion[0] * quaternion[0] - 2.0 * quaternion[2] * quaternion[2]; + matrix[2][1] = 2.0 * quaternion[1] * quaternion[2] + 2.0 * quaternion[3] * quaternion[0]; + + matrix[0][2] = 2.0 * quaternion[0] * quaternion[2] + 2.0 * quaternion[3] * quaternion[1]; + matrix[1][2] = 2.0 * quaternion[1] * quaternion[2] - 2.0 * quaternion[3] * quaternion[0]; + matrix[2][2] = 1.0 - 2.0 * quaternion[0] * quaternion[0] - 2.0 * quaternion[1] * quaternion[1]; +} + +/* +==================== +MatrixCopy + +==================== +*/ +void MatrixCopy( float in[3][4], float out[3][4] ) +{ + memcpy( out, in, sizeof( float ) * 3 * 4 ); +} \ No newline at end of file diff --git a/main/source/cl_dll/studio_util.h b/main/source/cl_dll/studio_util.h new file mode 100644 index 00000000..df472ee6 --- /dev/null +++ b/main/source/cl_dll/studio_util.h @@ -0,0 +1,33 @@ +#if !defined( STUDIO_UTIL_H ) +#define STUDIO_UTIL_H +#if defined( WIN32 ) +#pragma once +#endif + +#ifndef M_PI +#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h +#endif + +#ifndef PITCH +// MOVEMENT INFO +// up / down +#define PITCH 0 +// left / right +#define YAW 1 +// fall over +#define ROLL 2 +#endif + +#define FDotProduct( a, b ) (fabs((a[0])*(b[0])) + fabs((a[1])*(b[1])) + fabs((a[2])*(b[2]))) + +void AngleMatrix (const float *angles, float (*matrix)[4] ); +int VectorCompare (const float *v1, const float *v2); +void CrossProduct (const float *v1, const float *v2, float *cross); +void VectorTransform (const float *in1, float in2[3][4], float *out); +void ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]); +void MatrixCopy( float in[3][4], float out[3][4] ); +void QuaternionMatrix( vec4_t quaternion, float (*matrix)[4] ); +void QuaternionSlerp( vec4_t p, vec4_t q, float t, vec4_t qt ); +void AngleQuaternion( float *angles, vec4_t quaternion ); + +#endif // STUDIO_UTIL_H \ No newline at end of file diff --git a/main/source/cl_dll/text_message.cpp b/main/source/cl_dll/text_message.cpp new file mode 100644 index 00000000..277f8b0c --- /dev/null +++ b/main/source/cl_dll/text_message.cpp @@ -0,0 +1,213 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// text_message.cpp +// +// implementation of CHudTextMessage class +// +// this class routes messages through titles.txt for localisation +// + +#include "hud.h" +#include "cl_util.h" +#include +#include +#include "parsemsg.h" + +#include "vgui_TeamFortressViewport.h" + +DECLARE_MESSAGE( m_TextMessage, TextMsg ); + +int CHudTextMessage::Init(void) +{ + HOOK_MESSAGE( TextMsg ); + + gHUD.AddHudElem( this ); + + Reset(); + + return 1; +}; + +// Searches through the string for any msg names (indicated by a '#') +// any found are looked up in titles.txt and the new message substituted +// the new value is pushed into dst_buffer +char *CHudTextMessage::LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size ) +{ + char *dst = dst_buffer; + for ( char *src = (char*)msg; *src != 0 && buffer_size > 0; buffer_size-- ) + { + if ( *src == '#' ) + { + // cut msg name out of string + static char word_buf[255]; + char *wdst = word_buf, *word_start = src; + for ( ++src ; (*src >= 'A' && *src <= 'z') || (*src >= '0' && *src <= '9'); wdst++, src++ ) + { + *wdst = *src; + } + *wdst = 0; + + // lookup msg name in titles.txt + client_textmessage_t *clmsg = TextMessageGet( word_buf ); + if ( !clmsg || !(clmsg->pMessage) ) + { + src = word_start; + *dst = *src; + dst++, src++; + continue; + } + + // copy string into message over the msg name + for ( char *wsrc = (char*)clmsg->pMessage; *wsrc != 0; wsrc++, dst++ ) + { + *dst = *wsrc; + } + *dst = 0; + } + else + { + *dst = *src; + dst++, src++; + *dst = 0; + } + } + + dst_buffer[buffer_size-1] = 0; // ensure null termination + return dst_buffer; +} + +// As above, but with a local static buffer +char *CHudTextMessage::BufferedLocaliseTextString( const char *msg ) +{ + static char dst_buffer[1024]; + LocaliseTextString( msg, dst_buffer, 1024 ); + return dst_buffer; +} + +// Simplified version of LocaliseTextString; assumes string is only one word +char *CHudTextMessage::LookupString( const char *msg, int *msg_dest ) +{ + if ( !msg ) + return ""; + + // '#' character indicates this is a reference to a string in titles.txt, and not the string itself + if ( msg[0] == '#' ) + { + // this is a message name, so look up the real message + client_textmessage_t *clmsg = TextMessageGet( msg+1 ); + + if ( !clmsg || !(clmsg->pMessage) ) + return (char*)msg; // lookup failed, so return the original string + + if ( msg_dest ) + { + // check to see if titles.txt info overrides msg destination + // if clmsg->effect is less than 0, then clmsg->effect holds -1 * message_destination + if ( clmsg->effect < 0 ) // + *msg_dest = -clmsg->effect; + } + + return (char*)clmsg->pMessage; + } + else + { // nothing special about this message, so just return the same string + return (char*)msg; + } +} + +void StripEndNewlineFromString( char *str ) +{ + int s = strlen( str ) - 1; + if ( str[s] == '\n' || str[s] == '\r' ) + str[s] = 0; +} + +// converts all '\r' characters to '\n', so that the engine can deal with the properly +// returns a pointer to str +char* ConvertCRtoNL( char *str ) +{ + for ( char *ch = str; *ch != 0; ch++ ) + if ( *ch == '\r' ) + *ch = '\n'; + return str; +} + +// Message handler for text messages +// displays a string, looking them up from the titles.txt file, which can be localised +// parameters: +// byte: message direction ( HUD_PRINTCONSOLE, HUD_PRINTNOTIFY, HUD_PRINTCENTER, HUD_PRINTTALK ) +// string: message +// optional parameters: +// string: message parameter 1 +// string: message parameter 2 +// string: message parameter 3 +// string: message parameter 4 +// any string that starts with the character '#' is a message name, and is used to look up the real message in titles.txt +// the next (optional) one to four strings are parameters for that string (which can also be message names if they begin with '#') +int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + int msg_dest = READ_BYTE(); + + static char szBuf[6][128]; + char *msg_text = LookupString( READ_STRING(), &msg_dest ); + msg_text = strcpy( szBuf[0], msg_text ); + + // keep reading strings and using C format strings for subsituting the strings into the localised text string + char *sstr1 = LookupString( READ_STRING() ); + sstr1 = strcpy( szBuf[1], sstr1 ); + StripEndNewlineFromString( sstr1 ); // these strings are meant for subsitution into the main strings, so cull the automatic end newlines + char *sstr2 = LookupString( READ_STRING() ); + sstr2 = strcpy( szBuf[2], sstr2 ); + StripEndNewlineFromString( sstr2 ); + char *sstr3 = LookupString( READ_STRING() ); + sstr3 = strcpy( szBuf[3], sstr3 ); + StripEndNewlineFromString( sstr3 ); + char *sstr4 = LookupString( READ_STRING() ); + sstr4 = strcpy( szBuf[4], sstr4 ); + StripEndNewlineFromString( sstr4 ); + char *psz = szBuf[5]; + + if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) + return 1; + + switch ( msg_dest ) + { + case HUD_PRINTCENTER: + sprintf( psz, msg_text, sstr1, sstr2, sstr3, sstr4 ); + CenterPrint( ConvertCRtoNL( psz ) ); + break; + + case HUD_PRINTNOTIFY: + psz[0] = 1; // mark this message to go into the notify buffer + sprintf( psz+1, msg_text, sstr1, sstr2, sstr3, sstr4 ); + ConsolePrint( ConvertCRtoNL( psz ) ); + break; + + case HUD_PRINTTALK: + sprintf( psz, msg_text, sstr1, sstr2, sstr3, sstr4 ); + gHUD.m_SayText.SayTextPrint( ConvertCRtoNL( psz ), 128 ); + break; + + case HUD_PRINTCONSOLE: + sprintf( psz, msg_text, sstr1, sstr2, sstr3, sstr4 ); + ConsolePrint( ConvertCRtoNL( psz ) ); + break; + } + + return 1; +} diff --git a/main/source/cl_dll/tf_defs.h b/main/source/cl_dll/tf_defs.h new file mode 100644 index 00000000..2e0ead56 --- /dev/null +++ b/main/source/cl_dll/tf_defs.h @@ -0,0 +1,1387 @@ +/*** +* +* Copyright (c) 1996-2002, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +****/ + +#ifndef __TF_DEFS_H +#define __TF_DEFS_H + +//=========================================================================== +// OLD OPTIONS.QC +//=========================================================================== +#define DEFAULT_AUTOZOOM FALSE +#define WEINER_SNIPER // autoaiming for sniper rifle +#define FLAME_MAXWORLDNUM 20 // maximum number of flames in the world. DO NOT PUT BELOW 20. + +//#define MAX_WORLD_PIPEBOMBS 15 // This is divided between teams - this is the most you should have on a net server +#define MAX_PLAYER_PIPEBOMBS 8 // maximum number of pipebombs any 1 player can have active +#define MAX_PLAYER_AMMOBOXES 3 // maximum number of ammoboxes any 1 player can have active + +//#define MAX_WORLD_FLARES 9 // This is the total number of flares allowed in the world at one time +//#define MAX_WORLD_AMMOBOXES 20 // This is divided between teams - this is the most you should have on a net server +#define GR_TYPE_MIRV_NO 4 // Number of Mirvs a Mirv Grenade breaks into +#define GR_TYPE_NAPALM_NO 8 // Number of flames napalm grenade breaks into (unused if net server) +#define MEDIKIT_IS_BIOWEAPON // Medikit acts as a bioweapon against enemies + +#define TEAM_HELP_RATE 60 // used only if teamplay bit 64 (help team with lower score) is set. + // 60 is a mild setting, and won't make too much difference + // increasing it _decreases_ the amount of help the losing team gets + // Minimum setting is 1, which would really help the losing team + +#define DISPLAY_CLASS_HELP TRUE // Change this to #OFF if you don't want the class help to + // appear whenever a player connects +#define NEVER_TEAMFRAGS FALSE // teamfrags options always off +#define ALWAYS_TEAMFRAGS FALSE // teamfrags options always on +#define CHECK_SPEEDS TRUE // makes sure players aren't moving too fast +#define SNIPER_RIFLE_RELOAD_TIME 1.5 // seconds + +#define MAPBRIEFING_MAXTEXTLENGTH 512 +#define PLAYER_PUSH_VELOCITY 50 // Players push teammates if they're moving under this speed + +// Debug Options +//#define MAP_DEBUG // Debug for Map code. I suggest running in a hi-res + // mode and/or piping the output from the server to a file. +#ifdef MAP_DEBUG + #define MDEBUG(x) x +#else + #define MDEBUG(x) +#endif +//#define VERBOSE // Verbose Debugging on/off + +//=========================================================================== +// OLD QUAKE Defs +//=========================================================================== +// items +#define IT_AXE 4096 +#define IT_SHOTGUN 1 +#define IT_SUPER_SHOTGUN 2 +#define IT_NAILGUN 4 +#define IT_SUPER_NAILGUN 8 +#define IT_GRENADE_LAUNCHER 16 +#define IT_ROCKET_LAUNCHER 32 +#define IT_LIGHTNING 64 +#define IT_EXTRA_WEAPON 128 + +#define IT_SHELLS 256 +#define IT_NAILS 512 +#define IT_ROCKETS 1024 +#define IT_CELLS 2048 + +#define IT_ARMOR1 8192 +#define IT_ARMOR2 16384 +#define IT_ARMOR3 32768 +#define IT_SUPERHEALTH 65536 + +#define IT_KEY1 131072 +#define IT_KEY2 262144 + +#define IT_INVISIBILITY 524288 +#define IT_INVULNERABILITY 1048576 +#define IT_SUIT 2097152 +#define IT_QUAD 4194304 +#define IT_HOOK 8388608 + +#define IT_KEY3 16777216 // Stomp invisibility +#define IT_KEY4 33554432 // Stomp invulnerability + +//=========================================================================== +// TEAMFORTRESS Defs +//=========================================================================== +// TeamFortress State Flags +#define TFSTATE_GRENPRIMED 1 // Whether the player has a primed grenade +#define TFSTATE_RELOADING 2 // Whether the player is reloading +#define TFSTATE_ALTKILL 4 // #TRUE if killed with a weapon not in self.weapon: NOT USED ANYMORE +#define TFSTATE_RANDOMPC 8 // Whether Playerclass is random, new one each respawn +#define TFSTATE_INFECTED 16 // set when player is infected by the bioweapon +#define TFSTATE_INVINCIBLE 32 // Player has permanent Invincibility (Usually by GoalItem) +#define TFSTATE_INVISIBLE 64 // Player has permanent Invisibility (Usually by GoalItem) +#define TFSTATE_QUAD 128 // Player has permanent Quad Damage (Usually by GoalItem) +#define TFSTATE_RADSUIT 256 // Player has permanent Radsuit (Usually by GoalItem) +#define TFSTATE_BURNING 512 // Is on fire +#define TFSTATE_GRENTHROWING 1024 // is throwing a grenade +#define TFSTATE_AIMING 2048 // is using the laser sight +#define TFSTATE_ZOOMOFF 4096 // doesn't want the FOV changed when zooming +#define TFSTATE_RESPAWN_READY 8192 // is waiting for respawn, and has pressed fire +#define TFSTATE_HALLUCINATING 16384 // set when player is hallucinating +#define TFSTATE_TRANQUILISED 32768 // set when player is tranquilised +#define TFSTATE_CANT_MOVE 65536 // set when player is setting a detpack +#define TFSTATE_RESET_FLAMETIME 131072 // set when the player has to have his flames increased in health + +// Defines used by TF_T_Damage (see combat.qc) +#define TF_TD_IGNOREARMOUR 1 // Bypasses the armour of the target +#define TF_TD_NOTTEAM 2 // Doesn't damage a team member (indicates direct fire weapon) +#define TF_TD_NOTSELF 4 // Doesn't damage self + +#define TF_TD_OTHER 0 // Ignore armorclass +#define TF_TD_SHOT 1 // Bullet damage +#define TF_TD_NAIL 2 // Nail damage +#define TF_TD_EXPLOSION 4 // Explosion damage +#define TF_TD_ELECTRICITY 8 // Electric damage +#define TF_TD_FIRE 16 // Fire damage +#define TF_TD_NOSOUND 256 // Special damage. Makes no sound/painframe, etc + +/*==================================================*/ +/* Toggleable Game Settings */ +/*==================================================*/ +#define TF_RESPAWNDELAY1 5 // seconds of waiting before player can respawn +#define TF_RESPAWNDELAY2 10 // seconds of waiting before player can respawn +#define TF_RESPAWNDELAY3 20 // seconds of waiting before player can respawn + +#define TEAMPLAY_NORMAL 1 +#define TEAMPLAY_HALFDIRECT 2 +#define TEAMPLAY_NODIRECT 4 +#define TEAMPLAY_HALFEXPLOSIVE 8 +#define TEAMPLAY_NOEXPLOSIVE 16 +#define TEAMPLAY_LESSPLAYERSHELP 32 +#define TEAMPLAY_LESSSCOREHELP 64 +#define TEAMPLAY_HALFDIRECTARMOR 128 +#define TEAMPLAY_NODIRECTARMOR 256 +#define TEAMPLAY_HALFEXPARMOR 512 +#define TEAMPLAY_NOEXPARMOR 1024 +#define TEAMPLAY_HALFDIRMIRROR 2048 +#define TEAMPLAY_FULLDIRMIRROR 4096 +#define TEAMPLAY_HALFEXPMIRROR 8192 +#define TEAMPLAY_FULLEXPMIRROR 16384 + +#define TEAMPLAY_TEAMDAMAGE (TEAMPLAY_NODIRECT | TEAMPLAY_HALFDIRECT | TEAMPLAY_HALFEXPLOSIVE | TEAMPLAY_NOEXPLOSIVE) +// FortressMap stuff +#define TEAM1_CIVILIANS 1 +#define TEAM2_CIVILIANS 2 +#define TEAM3_CIVILIANS 4 +#define TEAM4_CIVILIANS 8 + +// Defines for the playerclass +#define PC_UNDEFINED 0 + +#define PC_SCOUT 1 +#define PC_SNIPER 2 +#define PC_SOLDIER 3 +#define PC_DEMOMAN 4 +#define PC_MEDIC 5 +#define PC_HVYWEAP 6 +#define PC_PYRO 7 +#define PC_SPY 8 +#define PC_ENGINEER 9 + +// Insert new class definitions here + +// PC_RANDOM _MUST_ be the third last class +#define PC_RANDOM 10 // Random playerclass +#define PC_CIVILIAN 11 // Civilians are a special class. They cannot + // be chosen by players, only enforced by maps +#define PC_LASTCLASS 12 // Use this as the high-boundary for any loops + // through the playerclass. + +#define SENTRY_COLOR 10 // will be in the PC_RANDOM slot for team colors +// These are just for the scanner +#define SCAN_SENTRY 13 +#define SCAN_GOALITEM 14 + +// Values returned by CheckArea +enum +{ + CAREA_CLEAR, + CAREA_BLOCKED, + CAREA_NOBUILD +}; + +/*==================================================*/ +/* Impulse Defines */ +/*==================================================*/ +// Alias check to see whether they already have the aliases +#define TF_ALIAS_CHECK 13 + +// CTF Support Impulses +#define HOOK_IMP1 22 +#define FLAG_INFO 23 +#define HOOK_IMP2 39 + +// Axe +#define AXE_IMP 40 + +// Camera Impulse +#define TF_CAM_TARGET 50 +#define TF_CAM_ZOOM 51 +#define TF_CAM_ANGLE 52 +#define TF_CAM_VEC 53 +#define TF_CAM_PROJECTILE 54 +#define TF_CAM_PROJECTILE_Z 55 +#define TF_CAM_REVANGLE 56 +#define TF_CAM_OFFSET 57 +#define TF_CAM_DROP 58 +#define TF_CAM_FADETOBLACK 59 +#define TF_CAM_FADEFROMBLACK 60 +#define TF_CAM_FADETOWHITE 61 +#define TF_CAM_FADEFROMWHITE 62 + +// Last Weapon impulse +#define TF_LAST_WEAPON 69 + +// Status Bar Resolution Settings. Same as CTF to maintain ease of use. +#define TF_STATUSBAR_RES_START 71 +#define TF_STATUSBAR_RES_END 81 + +// Clan Messages +#define TF_MESSAGE_1 82 +#define TF_MESSAGE_2 83 +#define TF_MESSAGE_3 84 +#define TF_MESSAGE_4 85 +#define TF_MESSAGE_5 86 + +#define TF_CHANGE_CLASS 99 // Bring up the Class Change menu + +// Added to PC_??? to get impulse to use if this clashes with your +// own impulses, just change this value, not the PC_?? +#define TF_CHANGEPC 100 +// The next few impulses are all the class selections +//PC_SCOUT 101 +//PC_SNIPER 102 +//PC_SOLDIER 103 +//PC_DEMOMAN 104 +//PC_MEDIC 105 +//PC_HVYWEAP 106 +//PC_PYRO 107 +//PC_RANDOM 108 +//PC_CIVILIAN 109 // Cannot be used +//PC_SPY 110 +//PC_ENGINEER 111 + +// Help impulses +#define TF_DISPLAYLOCATION 118 +#define TF_STATUS_QUERY 119 + +#define TF_HELP_MAP 131 + +// Information impulses +#define TF_INVENTORY 135 +#define TF_SHOWTF 136 +#define TF_SHOWLEGALCLASSES 137 + +// Team Impulses +#define TF_TEAM_1 140 // Join Team 1 +#define TF_TEAM_2 141 // Join Team 2 +#define TF_TEAM_3 142 // Join Team 3 +#define TF_TEAM_4 143 // Join Team 4 +#define TF_TEAM_CLASSES 144 // Impulse to display team classes +#define TF_TEAM_SCORES 145 // Impulse to display team scores +#define TF_TEAM_LIST 146 // Impulse to display the players in each team. + +// Grenade Impulses +#define TF_GRENADE_1 150 // Prime grenade type 1 +#define TF_GRENADE_2 151 // Prime grenade type 2 +#define TF_GRENADE_T 152 // Throw primed grenade + +// Impulses for new items +//#define TF_SCAN 159 // Scanner Pre-Impulse +#define TF_AUTO_SCAN 159 // Scanner On/Off +#define TF_SCAN_ENEMY 160 // Impulses to toggle scanning of enemies +#define TF_SCAN_FRIENDLY 161 // Impulses to toggle scanning of friendlies +//#define TF_SCAN_10 162 // Scan using 10 enery (1 cell) +#define TF_SCAN_SOUND 162 // Scanner sounds on/off +#define TF_SCAN_30 163 // Scan using 30 energy (2 cells) +#define TF_SCAN_100 164 // Scan using 100 energy (5 cells) +#define TF_DETPACK_5 165 // Detpack set to 5 seconds +#define TF_DETPACK_20 166 // Detpack set to 20 seconds +#define TF_DETPACK_50 167 // Detpack set to 50 seconds +#define TF_DETPACK 168 // Detpack Pre-Impulse +#define TF_DETPACK_STOP 169 // Impulse to stop setting detpack +#define TF_PB_DETONATE 170 // Detonate Pipebombs + +// Special skill +#define TF_SPECIAL_SKILL 171 + +// Ammo Drop impulse +#define TF_DROP_AMMO 172 + +// Reload impulse +#define TF_RELOAD 173 + +// auto-zoom toggle +#define TF_AUTOZOOM 174 + +// drop/pass commands +#define TF_DROPKEY 175 + +// Select Medikit +#define TF_MEDIKIT 176 + +// Spy Impulses +#define TF_SPY_SPY 177 // On net, go invisible, on LAN, change skin/color +#define TF_SPY_DIE 178 // Feign Death + +// Engineer Impulses +#define TF_ENGINEER_BUILD 179 +#define TF_ENGINEER_SANDBAG 180 + +// Medic +#define TF_MEDIC_HELPME 181 + +// Status bar +#define TF_STATUSBAR_ON 182 +#define TF_STATUSBAR_OFF 183 + +// Discard impulse +#define TF_DISCARD 184 + +// ID Player impulse +#define TF_ID 185 + +// Clan Battle impulses +#define TF_SHOWIDS 186 + +// More Engineer Impulses +#define TF_ENGINEER_DETDISP 187 +#define TF_ENGINEER_DETSENT 188 + +// Admin Commands +#define TF_ADMIN_DEAL_CYCLE 189 +#define TF_ADMIN_KICK 190 +#define TF_ADMIN_BAN 191 +#define TF_ADMIN_COUNTPLAYERS 192 +#define TF_ADMIN_CEASEFIRE 193 + +// Drop Goal Items +#define TF_DROPGOALITEMS 194 + +// More Admin Commands +#define TF_ADMIN_NEXT 195 + +// More Engineer Impulses +#define TF_ENGINEER_DETEXIT 196 +#define TF_ENGINEER_DETENTRANCE 197 + +// Yet MORE Admin Commands +#define TF_ADMIN_LISTIPS 198 + +// Silent Spy Feign +#define TF_SPY_SILENTDIE 199 + + +/*==================================================*/ +/*==================================================*/ +#define TEAM1_COLOR 150 +#define TEAM2_COLOR 250 +#define TEAM3_COLOR 45 +#define TEAM4_COLOR 100 + +/*==================================================*/ +/* Defines for the ENGINEER's Building ability */ +/*==================================================*/ +// Ammo costs +#define AMMO_COST_SHELLS 2 // Metal needed to make 1 shell +#define AMMO_COST_NAILS 1 +#define AMMO_COST_ROCKETS 2 +#define AMMO_COST_CELLS 2 + +// Building types +#define BUILD_DISPENSER 1 +#define BUILD_SENTRYGUN 2 +#define BUILD_MORTAR 3 +#define BUILD_TELEPORTER_ENTRANCE 4 +#define BUILD_TELEPORTER_EXIT 5 + +// Building metal costs +#define BUILD_COST_DISPENSER 100 // Metal needed to built +#define BUILD_COST_SENTRYGUN 130 +#define BUILD_COST_MORTAR 150 +#define BUILD_COST_TELEPORTER 125 + +#define BUILD_COST_SANDBAG 20 // Built with a separate alias + +// Building times +#define BUILD_TIME_DISPENSER 2 // seconds to build +#define BUILD_TIME_SENTRYGUN 5 +#define BUILD_TIME_MORTAR 5 +#define BUILD_TIME_TELEPORTER 4 + +// Building health levels +#define BUILD_HEALTH_DISPENSER 150 // Health of the building +#define BUILD_HEALTH_SENTRYGUN 150 +#define BUILD_HEALTH_MORTAR 200 +#define BUILD_HEALTH_TELEPORTER 80 + +// Dispenser's maximum carrying capability +#define BUILD_DISPENSER_MAX_SHELLS 400 +#define BUILD_DISPENSER_MAX_NAILS 600 +#define BUILD_DISPENSER_MAX_ROCKETS 300 +#define BUILD_DISPENSER_MAX_CELLS 400 +#define BUILD_DISPENSER_MAX_ARMOR 500 + +// Build state sent down to client +#define BS_BUILDING (1<<0) +#define BS_HAS_DISPENSER (1<<1) +#define BS_HAS_SENTRYGUN (1<<2) +#define BS_CANB_DISPENSER (1<<3) +#define BS_CANB_SENTRYGUN (1<<4) +/*==================================================*/ +/* Ammo quantities for dropping & dispenser use */ +/*==================================================*/ +#define DROP_SHELLS 20 +#define DROP_NAILS 20 +#define DROP_ROCKETS 10 +#define DROP_CELLS 10 +#define DROP_ARMOR 40 + +/*==================================================*/ +/* Team Defines */ +/*==================================================*/ +#define TM_MAX_NO 4 // Max number of teams. Simply changing this value isn't enough. + // A new global to hold new team colors is needed, and more flags + // in the spawnpoint spawnflags may need to be used. + // Basically, don't change this unless you know what you're doing :) + +/*==================================================*/ +/* New Weapon Defines */ +/*==================================================*/ +#define WEAP_HOOK 1 +#define WEAP_BIOWEAPON 2 +#define WEAP_MEDIKIT 4 +#define WEAP_SPANNER 8 +#define WEAP_AXE 16 +#define WEAP_SNIPER_RIFLE 32 +#define WEAP_AUTO_RIFLE 64 +#define WEAP_SHOTGUN 128 +#define WEAP_SUPER_SHOTGUN 256 +#define WEAP_NAILGUN 512 +#define WEAP_SUPER_NAILGUN 1024 +#define WEAP_GRENADE_LAUNCHER 2048 +#define WEAP_FLAMETHROWER 4096 +#define WEAP_ROCKET_LAUNCHER 8192 +#define WEAP_INCENDIARY 16384 +#define WEAP_ASSAULT_CANNON 32768 +#define WEAP_LIGHTNING 65536 +#define WEAP_DETPACK 131072 +#define WEAP_TRANQ 262144 +#define WEAP_LASER 524288 +// still room for 12 more weapons +// but we can remove some by giving the weapons +// a weapon mode (like the rifle) + +// HL-compatible weapon numbers +#define WEAPON_HOOK 1 +#define WEAPON_BIOWEAPON (WEAPON_HOOK+1) +#define WEAPON_MEDIKIT (WEAPON_HOOK+2) +#define WEAPON_SPANNER (WEAPON_HOOK+3) +#define WEAPON_AXE (WEAPON_HOOK+4) +#define WEAPON_SNIPER_RIFLE (WEAPON_HOOK+5) +#define WEAPON_AUTO_RIFLE (WEAPON_HOOK+6) +#define WEAPON_TF_SHOTGUN (WEAPON_HOOK+7) +#define WEAPON_SUPER_SHOTGUN (WEAPON_HOOK+8) +#define WEAPON_NAILGUN (WEAPON_HOOK+9) +#define WEAPON_SUPER_NAILGUN (WEAPON_HOOK+10) +#define WEAPON_GRENADE_LAUNCHER (WEAPON_HOOK+11) +#define WEAPON_FLAMETHROWER (WEAPON_HOOK+12) +#define WEAPON_ROCKET_LAUNCHER (WEAPON_HOOK+13) +#define WEAPON_INCENDIARY (WEAPON_HOOK+14) +#define WEAPON_ASSAULT_CANNON (WEAPON_HOOK+16) +#define WEAPON_LIGHTNING (WEAPON_HOOK+17) +#define WEAPON_DETPACK (WEAPON_HOOK+18) +#define WEAPON_TRANQ (WEAPON_HOOK+19) +#define WEAPON_LASER (WEAPON_HOOK+20) +#define WEAPON_PIPEBOMB_LAUNCHER (WEAPON_HOOK+21) +#define WEAPON_KNIFE (WEAPON_HOOK+22) +#define WEAPON_BENCHMARK (WEAPON_HOOK+23) + +/*==================================================*/ +/* New Weapon Related Defines */ +/*==================================================*/ +// shots per reload +#define RE_SHOTGUN 8 +#define RE_SUPER_SHOTGUN 16 // 8 shots +#define RE_GRENADE_LAUNCHER 6 +#define RE_ROCKET_LAUNCHER 4 + +// reload times +#define RE_SHOTGUN_TIME 2 +#define RE_SUPER_SHOTGUN_TIME 3 +#define RE_GRENADE_LAUNCHER_TIME 4 +#define RE_ROCKET_LAUNCHER_TIME 5 + +// Maximum velocity you can move and fire the Sniper Rifle +#define WEAP_SNIPER_RIFLE_MAX_MOVE 50 + +// Medikit +#define WEAP_MEDIKIT_HEAL 200 // Amount medikit heals per hit +#define WEAP_MEDIKIT_OVERHEAL 50 // Amount of superhealth over max_health the medikit will dispense + +// Spanner +#define WEAP_SPANNER_REPAIR 10 + +// Detpack +#define WEAP_DETPACK_DISARMTIME 3 // Time it takes to disarm a Detpack +#define WEAP_DETPACK_SETTIME 3 // Time it takes to set a Detpack +#define WEAP_DETPACK_SIZE 700 // Explosion Size +#define WEAP_DETPACK_GOAL_SIZE 1500 // Explosion Size for goal triggering +#define WEAP_DETPACK_BITS_NO 12 // Bits that detpack explodes into + +// Tranquiliser Gun +#define TRANQ_TIME 15 + +// Grenades +#define GR_PRIMETIME 3 +#define GR_CALTROP_PRIME 0.5 +#define GR_TYPE_NONE 0 +#define GR_TYPE_NORMAL 1 +#define GR_TYPE_CONCUSSION 2 +#define GR_TYPE_NAIL 3 +#define GR_TYPE_MIRV 4 +#define GR_TYPE_NAPALM 5 +//#define GR_TYPE_FLARE 6 +#define GR_TYPE_GAS 7 +#define GR_TYPE_EMP 8 +#define GR_TYPE_CALTROP 9 +//#define GR_TYPE_FLASH 10 + +// Defines for WeaponMode +#define GL_NORMAL 0 +#define GL_PIPEBOMB 1 + +// Defines for OLD Concussion Grenade +#define GR_OLD_CONCUSS_TIME 5 +#define GR_OLD_CONCUSS_DEC 20 + +// Defines for Concussion Grenade +#define GR_CONCUSS_TIME 0.25 +#define GR_CONCUSS_DEC 10 +#define MEDIUM_PING 150 +#define HIGH_PING 200 + +// Defines for the Gas Grenade +#define GR_HALLU_TIME 0.3 +#define GR_OLD_HALLU_TIME 0.5 +#define GR_HALLU_DEC 2.5 + +// Defines for the BioInfection +#define BIO_JUMP_RADIUS 128 // The distance the bioinfection can jump between players + +/*==================================================*/ +/* New Items */ +/*==================================================*/ +#define NIT_SCANNER 1 + +#define NIT_SILVER_DOOR_OPENED #IT_KEY1 // 131072 +#define NIT_GOLD_DOOR_OPENED #IT_KEY2 // 262144 + +/*==================================================*/ +/* New Item Flags */ +/*==================================================*/ +#define NIT_SCANNER_ENEMY 1 // Detect enemies +#define NIT_SCANNER_FRIENDLY 2 // Detect friendlies (team members) +#define NIT_SCANNER_SOUND 4 // Motion detection. Only report moving entities. + +/*==================================================*/ +/* New Item Related Defines */ +/*==================================================*/ +#define NIT_SCANNER_POWER 25 // The amount of power spent on a scan with the scanner + // is multiplied by this to get the scanrange. +#define NIT_SCANNER_MAXCELL 50 // The maximum number of cells than can be used in one scan +#define NIT_SCANNER_MIN_MOVEMENT 50 // The minimum velocity an entity must have to be detected + // by scanners that only detect movement + +/*==================================================*/ +/* Variables used for New Weapons and Reloading */ +/*==================================================*/ +// Armor Classes : Bitfields. Use the "armorclass" of armor for the Armor Type. +#define AT_SAVESHOT 1 // Kevlar : Reduces bullet damage by 15% +#define AT_SAVENAIL 2 // Wood :) : Reduces nail damage by 15% +#define AT_SAVEEXPLOSION 4 // Blast : Reduces explosion damage by 15% +#define AT_SAVEELECTRICITY 8 // Shock : Reduces electricity damage by 15% +#define AT_SAVEFIRE 16 // Asbestos : Reduces fire damage by 15% + +/*==========================================================================*/ +/* TEAMFORTRESS CLASS DETAILS */ +/*==========================================================================*/ +// Class Details for SCOUT +#define PC_SCOUT_SKIN 4 // Skin for this class when Classkin is on. +#define PC_SCOUT_MAXHEALTH 75 // Maximum Health Level +#define PC_SCOUT_MAXSPEED 400 // Maximum movement speed +#define PC_SCOUT_MAXSTRAFESPEED 400 // Maximum strafing movement speed +#define PC_SCOUT_MAXARMOR 50 // Maximum Armor Level, of any armor class +#define PC_SCOUT_INITARMOR 25 // Armor level when respawned +#define PC_SCOUT_MAXARMORTYPE 0.3 // Maximum level of Armor absorption +#define PC_SCOUT_INITARMORTYPE 0.3 // Absorption Level of armor when respawned +#define PC_SCOUT_ARMORCLASSES 3 // #AT_SAVESHOT | #AT_SAVENAIL <-Armor Classes allowed for this class +#define PC_SCOUT_INITARMORCLASS 0 // Armorclass worn when respawned +#define PC_SCOUT_WEAPONS WEAP_AXE | WEAP_SHOTGUN | WEAP_NAILGUN +#define PC_SCOUT_MAXAMMO_SHOT 50 // Maximum amount of shot ammo this class can carry +#define PC_SCOUT_MAXAMMO_NAIL 200 // Maximum amount of nail ammo this class can carry +#define PC_SCOUT_MAXAMMO_CELL 100 // Maximum amount of cell ammo this class can carry +#define PC_SCOUT_MAXAMMO_ROCKET 25 // Maximum amount of rocket ammo this class can carry +#define PC_SCOUT_INITAMMO_SHOT 25 // Amount of shot ammo this class has when respawned +#define PC_SCOUT_INITAMMO_NAIL 100 // Amount of nail ammo this class has when respawned +#define PC_SCOUT_INITAMMO_CELL 50 // Amount of cell ammo this class has when respawned +#define PC_SCOUT_INITAMMO_ROCKET 0 // Amount of rocket ammo this class has when respawned +#define PC_SCOUT_GRENADE_TYPE_1 GR_TYPE_CALTROP // <- 1st Type of Grenade this class has +#define PC_SCOUT_GRENADE_TYPE_2 GR_TYPE_CONCUSSION // <- 2nd Type of Grenade this class has +#define PC_SCOUT_GRENADE_INIT_1 2 // Number of grenades of Type 1 this class has when respawned +#define PC_SCOUT_GRENADE_INIT_2 3 // Number of grenades of Type 2 this class has when respawned +#define PC_SCOUT_TF_ITEMS NIT_SCANNER // <- TeamFortress Items this class has + +#define PC_SCOUT_MOTION_MIN_I 0.5 // < Short range +#define PC_SCOUT_MOTION_MIN_MOVE 50 // Minimum vlen of player velocity to be picked up by motion detector +#define PC_SCOUT_SCAN_TIME 2 // # of seconds between each scan pulse +#define PC_SCOUT_SCAN_RANGE 100 // Default scanner range +#define PC_SCOUT_SCAN_COST 2 // Default scanner cell useage per scan + +// Class Details for SNIPER +#define PC_SNIPER_SKIN 5 +#define PC_SNIPER_MAXHEALTH 90 +#define PC_SNIPER_MAXSPEED 300 +#define PC_SNIPER_MAXSTRAFESPEED 300 +#define PC_SNIPER_MAXARMOR 50 +#define PC_SNIPER_INITARMOR 0 +#define PC_SNIPER_MAXARMORTYPE 0.3 +#define PC_SNIPER_INITARMORTYPE 0.3 +#define PC_SNIPER_ARMORCLASSES 3 // #AT_SAVESHOT | #AT_SAVENAIL +#define PC_SNIPER_INITARMORCLASS 0 +#define PC_SNIPER_WEAPONS WEAP_SNIPER_RIFLE | WEAP_AUTO_RIFLE | WEAP_AXE | WEAP_NAILGUN +#define PC_SNIPER_MAXAMMO_SHOT 75 +#define PC_SNIPER_MAXAMMO_NAIL 100 +#define PC_SNIPER_MAXAMMO_CELL 50 +#define PC_SNIPER_MAXAMMO_ROCKET 25 +#define PC_SNIPER_INITAMMO_SHOT 60 +#define PC_SNIPER_INITAMMO_NAIL 50 +#define PC_SNIPER_INITAMMO_CELL 0 +#define PC_SNIPER_INITAMMO_ROCKET 0 +#define PC_SNIPER_GRENADE_TYPE_1 GR_TYPE_NORMAL +#define PC_SNIPER_GRENADE_TYPE_2 GR_TYPE_NONE +#define PC_SNIPER_GRENADE_INIT_1 2 +#define PC_SNIPER_GRENADE_INIT_2 0 +#define PC_SNIPER_TF_ITEMS 0 + +// Class Details for SOLDIER +#define PC_SOLDIER_SKIN 6 +#define PC_SOLDIER_MAXHEALTH 100 +#define PC_SOLDIER_MAXSPEED 240 +#define PC_SOLDIER_MAXSTRAFESPEED 240 +#define PC_SOLDIER_MAXARMOR 200 +#define PC_SOLDIER_INITARMOR 100 +#define PC_SOLDIER_MAXARMORTYPE 0.8 +#define PC_SOLDIER_INITARMORTYPE 0.8 +#define PC_SOLDIER_ARMORCLASSES 31 // ALL +#define PC_SOLDIER_INITARMORCLASS 0 +#define PC_SOLDIER_WEAPONS WEAP_AXE | WEAP_SHOTGUN | WEAP_SUPER_SHOTGUN | WEAP_ROCKET_LAUNCHER +#define PC_SOLDIER_MAXAMMO_SHOT 100 +#define PC_SOLDIER_MAXAMMO_NAIL 100 +#define PC_SOLDIER_MAXAMMO_CELL 50 +#define PC_SOLDIER_MAXAMMO_ROCKET 50 +#define PC_SOLDIER_INITAMMO_SHOT 50 +#define PC_SOLDIER_INITAMMO_NAIL 0 +#define PC_SOLDIER_INITAMMO_CELL 0 +#define PC_SOLDIER_INITAMMO_ROCKET 10 +#define PC_SOLDIER_GRENADE_TYPE_1 GR_TYPE_NORMAL +#define PC_SOLDIER_GRENADE_TYPE_2 GR_TYPE_NAIL +#define PC_SOLDIER_GRENADE_INIT_1 2 +#define PC_SOLDIER_GRENADE_INIT_2 1 +#define PC_SOLDIER_TF_ITEMS 0 + +#define MAX_NAIL_GRENS 2 // Can only have 2 Nail grens active +#define MAX_NAPALM_GRENS 2 // Can only have 2 Napalm grens active +#define MAX_GAS_GRENS 2 // Can only have 2 Gas grenades active +#define MAX_MIRV_GRENS 2 // Can only have 2 Mirv's +#define MAX_CONCUSSION_GRENS 3 +#define MAX_CALTROP_CANS 3 + +// Class Details for DEMOLITION MAN +#define PC_DEMOMAN_SKIN 1 +#define PC_DEMOMAN_MAXHEALTH 90 +#define PC_DEMOMAN_MAXSPEED 280 +#define PC_DEMOMAN_MAXSTRAFESPEED 280 +#define PC_DEMOMAN_MAXARMOR 120 +#define PC_DEMOMAN_INITARMOR 50 +#define PC_DEMOMAN_MAXARMORTYPE 0.6 +#define PC_DEMOMAN_INITARMORTYPE 0.6 +#define PC_DEMOMAN_ARMORCLASSES 31 // ALL +#define PC_DEMOMAN_INITARMORCLASS 0 +#define PC_DEMOMAN_WEAPONS WEAP_AXE | WEAP_SHOTGUN | WEAP_GRENADE_LAUNCHER | WEAP_DETPACK +#define PC_DEMOMAN_MAXAMMO_SHOT 75 +#define PC_DEMOMAN_MAXAMMO_NAIL 50 +#define PC_DEMOMAN_MAXAMMO_CELL 50 +#define PC_DEMOMAN_MAXAMMO_ROCKET 50 +#define PC_DEMOMAN_MAXAMMO_DETPACK 1 +#define PC_DEMOMAN_INITAMMO_SHOT 30 +#define PC_DEMOMAN_INITAMMO_NAIL 0 +#define PC_DEMOMAN_INITAMMO_CELL 0 +#define PC_DEMOMAN_INITAMMO_ROCKET 20 +#define PC_DEMOMAN_INITAMMO_DETPACK 1 +#define PC_DEMOMAN_GRENADE_TYPE_1 GR_TYPE_NORMAL +#define PC_DEMOMAN_GRENADE_TYPE_2 GR_TYPE_MIRV +#define PC_DEMOMAN_GRENADE_INIT_1 2 +#define PC_DEMOMAN_GRENADE_INIT_2 2 +#define PC_DEMOMAN_TF_ITEMS 0 + +// Class Details for COMBAT MEDIC +#define PC_MEDIC_SKIN 3 +#define PC_MEDIC_MAXHEALTH 90 +#define PC_MEDIC_MAXSPEED 320 +#define PC_MEDIC_MAXSTRAFESPEED 320 +#define PC_MEDIC_MAXARMOR 100 +#define PC_MEDIC_INITARMOR 50 +#define PC_MEDIC_MAXARMORTYPE 0.6 +#define PC_MEDIC_INITARMORTYPE 0.3 +#define PC_MEDIC_ARMORCLASSES 11 // ALL except EXPLOSION +#define PC_MEDIC_INITARMORCLASS 0 +#define PC_MEDIC_WEAPONS WEAP_BIOWEAPON | WEAP_MEDIKIT | WEAP_SHOTGUN | WEAP_SUPER_SHOTGUN | WEAP_SUPER_NAILGUN +#define PC_MEDIC_MAXAMMO_SHOT 75 +#define PC_MEDIC_MAXAMMO_NAIL 150 +#define PC_MEDIC_MAXAMMO_CELL 50 +#define PC_MEDIC_MAXAMMO_ROCKET 25 +#define PC_MEDIC_MAXAMMO_MEDIKIT 100 +#define PC_MEDIC_INITAMMO_SHOT 50 +#define PC_MEDIC_INITAMMO_NAIL 50 +#define PC_MEDIC_INITAMMO_CELL 0 +#define PC_MEDIC_INITAMMO_ROCKET 0 +#define PC_MEDIC_INITAMMO_MEDIKIT 50 +#define PC_MEDIC_GRENADE_TYPE_1 GR_TYPE_NORMAL +#define PC_MEDIC_GRENADE_TYPE_2 GR_TYPE_CONCUSSION +#define PC_MEDIC_GRENADE_INIT_1 2 +#define PC_MEDIC_GRENADE_INIT_2 2 +#define PC_MEDIC_TF_ITEMS 0 +#define PC_MEDIC_REGEN_TIME 3 // Number of seconds between each regen. +#define PC_MEDIC_REGEN_AMOUNT 2 // Amount of health regenerated each regen. + +// Class Details for HVYWEAP +#define PC_HVYWEAP_SKIN 2 +#define PC_HVYWEAP_MAXHEALTH 100 +#define PC_HVYWEAP_MAXSPEED 230 +#define PC_HVYWEAP_MAXSTRAFESPEED 230 +#define PC_HVYWEAP_MAXARMOR 300 +#define PC_HVYWEAP_INITARMOR 150 +#define PC_HVYWEAP_MAXARMORTYPE 0.8 +#define PC_HVYWEAP_INITARMORTYPE 0.8 +#define PC_HVYWEAP_ARMORCLASSES 31 // ALL +#define PC_HVYWEAP_INITARMORCLASS 0 +#define PC_HVYWEAP_WEAPONS WEAP_ASSAULT_CANNON | WEAP_AXE | WEAP_SHOTGUN | WEAP_SUPER_SHOTGUN +#define PC_HVYWEAP_MAXAMMO_SHOT 200 +#define PC_HVYWEAP_MAXAMMO_NAIL 200 +#define PC_HVYWEAP_MAXAMMO_CELL 50 +#define PC_HVYWEAP_MAXAMMO_ROCKET 25 +#define PC_HVYWEAP_INITAMMO_SHOT 200 +#define PC_HVYWEAP_INITAMMO_NAIL 0 +#define PC_HVYWEAP_INITAMMO_CELL 30 +#define PC_HVYWEAP_INITAMMO_ROCKET 0 +#define PC_HVYWEAP_GRENADE_TYPE_1 GR_TYPE_NORMAL +#define PC_HVYWEAP_GRENADE_TYPE_2 GR_TYPE_MIRV +#define PC_HVYWEAP_GRENADE_INIT_1 2 +#define PC_HVYWEAP_GRENADE_INIT_2 1 +#define PC_HVYWEAP_TF_ITEMS 0 +#define PC_HVYWEAP_CELL_USAGE 7 // Amount of cells spent to power up assault cannon + + + +// Class Details for PYRO +#define PC_PYRO_SKIN 21 +#define PC_PYRO_MAXHEALTH 100 +#define PC_PYRO_MAXSPEED 300 +#define PC_PYRO_MAXSTRAFESPEED 300 +#define PC_PYRO_MAXARMOR 150 +#define PC_PYRO_INITARMOR 50 +#define PC_PYRO_MAXARMORTYPE 0.6 +#define PC_PYRO_INITARMORTYPE 0.6 +#define PC_PYRO_ARMORCLASSES 27 // ALL except EXPLOSION +#define PC_PYRO_INITARMORCLASS 16 // #AT_SAVEFIRE +#define PC_PYRO_WEAPONS WEAP_INCENDIARY | WEAP_FLAMETHROWER | WEAP_AXE | WEAP_SHOTGUN +#define PC_PYRO_MAXAMMO_SHOT 40 +#define PC_PYRO_MAXAMMO_NAIL 50 +#define PC_PYRO_MAXAMMO_CELL 200 +#define PC_PYRO_MAXAMMO_ROCKET 20 +#define PC_PYRO_INITAMMO_SHOT 20 +#define PC_PYRO_INITAMMO_NAIL 0 +#define PC_PYRO_INITAMMO_CELL 120 +#define PC_PYRO_INITAMMO_ROCKET 5 +#define PC_PYRO_GRENADE_TYPE_1 GR_TYPE_NORMAL +#define PC_PYRO_GRENADE_TYPE_2 GR_TYPE_NAPALM +#define PC_PYRO_GRENADE_INIT_1 2 +#define PC_PYRO_GRENADE_INIT_2 4 +#define PC_PYRO_TF_ITEMS 0 +#define PC_PYRO_ROCKET_USAGE 3 // Number of rockets per incendiary cannon shot + +// Class Details for SPY +#define PC_SPY_SKIN 22 +#define PC_SPY_MAXHEALTH 90 +#define PC_SPY_MAXSPEED 300 +#define PC_SPY_MAXSTRAFESPEED 300 +#define PC_SPY_MAXARMOR 100 +#define PC_SPY_INITARMOR 25 +#define PC_SPY_MAXARMORTYPE 0.6 // Was 0.3 +#define PC_SPY_INITARMORTYPE 0.6 // Was 0.3 +#define PC_SPY_ARMORCLASSES 27 // ALL except EXPLOSION +#define PC_SPY_INITARMORCLASS 0 +#define PC_SPY_WEAPONS WEAP_AXE | WEAP_TRANQ | WEAP_SUPER_SHOTGUN | WEAP_NAILGUN +#define PC_SPY_MAXAMMO_SHOT 40 +#define PC_SPY_MAXAMMO_NAIL 100 +#define PC_SPY_MAXAMMO_CELL 30 +#define PC_SPY_MAXAMMO_ROCKET 15 +#define PC_SPY_INITAMMO_SHOT 40 +#define PC_SPY_INITAMMO_NAIL 50 +#define PC_SPY_INITAMMO_CELL 10 +#define PC_SPY_INITAMMO_ROCKET 0 +#define PC_SPY_GRENADE_TYPE_1 GR_TYPE_NORMAL +#define PC_SPY_GRENADE_TYPE_2 GR_TYPE_GAS +#define PC_SPY_GRENADE_INIT_1 2 +#define PC_SPY_GRENADE_INIT_2 2 +#define PC_SPY_TF_ITEMS 0 +#define PC_SPY_CELL_REGEN_TIME 5 +#define PC_SPY_CELL_REGEN_AMOUNT 1 +#define PC_SPY_CELL_USAGE 3 // Amount of cells spent while invisible +#define PC_SPY_GO_UNDERCOVER_TIME 4 // Time it takes to go undercover + +// Class Details for ENGINEER +#define PC_ENGINEER_SKIN 22 // Not used anymore +#define PC_ENGINEER_MAXHEALTH 80 +#define PC_ENGINEER_MAXSPEED 300 +#define PC_ENGINEER_MAXSTRAFESPEED 300 +#define PC_ENGINEER_MAXARMOR 50 +#define PC_ENGINEER_INITARMOR 25 +#define PC_ENGINEER_MAXARMORTYPE 0.6 +#define PC_ENGINEER_INITARMORTYPE 0.3 +#define PC_ENGINEER_ARMORCLASSES 31 // ALL +#define PC_ENGINEER_INITARMORCLASS 0 +#define PC_ENGINEER_WEAPONS WEAP_SPANNER | WEAP_LASER | WEAP_SUPER_SHOTGUN +#define PC_ENGINEER_MAXAMMO_SHOT 50 +#define PC_ENGINEER_MAXAMMO_NAIL 50 +#define PC_ENGINEER_MAXAMMO_CELL 200 // synonymous with metal +#define PC_ENGINEER_MAXAMMO_ROCKET 30 +#define PC_ENGINEER_INITAMMO_SHOT 20 +#define PC_ENGINEER_INITAMMO_NAIL 25 +#define PC_ENGINEER_INITAMMO_CELL 100 // synonymous with metal +#define PC_ENGINEER_INITAMMO_ROCKET 0 +#define PC_ENGINEER_GRENADE_TYPE_1 GR_TYPE_NORMAL +#define PC_ENGINEER_GRENADE_TYPE_2 GR_TYPE_EMP +#define PC_ENGINEER_GRENADE_INIT_1 2 +#define PC_ENGINEER_GRENADE_INIT_2 2 +#define PC_ENGINEER_TF_ITEMS 0 + +// Class Details for CIVILIAN +#define PC_CIVILIAN_SKIN 22 +#define PC_CIVILIAN_MAXHEALTH 50 +#define PC_CIVILIAN_MAXSPEED 240 +#define PC_CIVILIAN_MAXSTRAFESPEED 240 +#define PC_CIVILIAN_MAXARMOR 0 +#define PC_CIVILIAN_INITARMOR 0 +#define PC_CIVILIAN_MAXARMORTYPE 0 +#define PC_CIVILIAN_INITARMORTYPE 0 +#define PC_CIVILIAN_ARMORCLASSES 0 +#define PC_CIVILIAN_INITARMORCLASS 0 +#define PC_CIVILIAN_WEAPONS WEAP_AXE +#define PC_CIVILIAN_MAXAMMO_SHOT 0 +#define PC_CIVILIAN_MAXAMMO_NAIL 0 +#define PC_CIVILIAN_MAXAMMO_CELL 0 +#define PC_CIVILIAN_MAXAMMO_ROCKET 0 +#define PC_CIVILIAN_INITAMMO_SHOT 0 +#define PC_CIVILIAN_INITAMMO_NAIL 0 +#define PC_CIVILIAN_INITAMMO_CELL 0 +#define PC_CIVILIAN_INITAMMO_ROCKET 0 +#define PC_CIVILIAN_GRENADE_TYPE_1 0 +#define PC_CIVILIAN_GRENADE_TYPE_2 0 +#define PC_CIVILIAN_GRENADE_INIT_1 0 +#define PC_CIVILIAN_GRENADE_INIT_2 0 +#define PC_CIVILIAN_TF_ITEMS 0 + + +/*==========================================================================*/ +/* TEAMFORTRESS GOALS */ +/*==========================================================================*/ +// For all these defines, see the tfortmap.txt that came with the zip +// for complete descriptions. +// Defines for Goal Activation types : goal_activation (in goals) +#define TFGA_TOUCH 1 // Activated when touched +#define TFGA_TOUCH_DETPACK 2 // Activated when touched by a detpack explosion +#define TFGA_REVERSE_AP 4 // Activated when AP details are _not_ met +#define TFGA_SPANNER 8 // Activated when hit by an engineer's spanner +#define TFGA_DROPTOGROUND 2048 // Drop to Ground when spawning + +// Defines for Goal Effects types : goal_effect +#define TFGE_AP 1 // AP is affected. Default. +#define TFGE_AP_TEAM 2 // All of the AP's team. +#define TFGE_NOT_AP_TEAM 4 // All except AP's team. +#define TFGE_NOT_AP 8 // All except AP. +#define TFGE_WALL 16 // If set, walls stop the Radius effects +#define TFGE_SAME_ENVIRONMENT 32 // If set, players in a different environment to the Goal are not affected +#define TFGE_TIMER_CHECK_AP 64 // If set, Timer Goals check their critera for all players fitting their effects + +// Defines for Goal Result types : goal_result +#define TFGR_SINGLE 1 // Goal can only be activated once +#define TFGR_ADD_BONUSES 2 // Any Goals activated by this one give their bonuses +#define TFGR_ENDGAME 4 // Goal fires Intermission, displays scores, and ends level +#define TFGR_NO_ITEM_RESULTS 8 // GoalItems given by this Goal don't do results +#define TFGR_REMOVE_DISGUISE 16 // Prevent/Remove undercover from any Spy +#define TFGR_FORCE_RESPAWN 32 // Forces the player to teleport to a respawn point +#define TFGR_DESTROY_BUILDINGS 64 // Destroys this player's buildings, if anys + +// Defines for Goal Group Result types : goal_group +// None! +// But I'm leaving this variable in there, since it's fairly likely +// that some will show up sometime. + +// Defines for Goal Item types, : goal_activation (in items) +#define TFGI_GLOW 1 // Players carrying this GoalItem will glow +#define TFGI_SLOW 2 // Players carrying this GoalItem will move at half-speed +#define TFGI_DROP 4 // Players dying with this item will drop it +#define TFGI_RETURN_DROP 8 // Return if a player with it dies +#define TFGI_RETURN_GOAL 16 // Return if a player with it has it removed by a goal's activation +#define TFGI_RETURN_REMOVE 32 // Return if it is removed by TFGI_REMOVE +#define TFGI_REVERSE_AP 64 // Only pickup if the player _doesn't_ match AP Details +#define TFGI_REMOVE 128 // Remove if left untouched for 2 minutes after being dropped +#define TFGI_KEEP 256 // Players keep this item even when they die +#define TFGI_ITEMGLOWS 512 // Item glows when on the ground +#define TFGI_DONTREMOVERES 1024 // Don't remove results when the item is removed +#define TFGI_DROPTOGROUND 2048 // Drop To Ground when spawning +#define TFGI_CANBEDROPPED 4096 // Can be voluntarily dropped by players +#define TFGI_SOLID 8192 // Is solid... blocks bullets, etc + +// Defines for methods of GoalItem returning +#define GI_RET_DROP_DEAD 0 // Dropped by a dead player +#define GI_RET_DROP_LIVING 1 // Dropped by a living player +#define GI_RET_GOAL 2 // Returned by a Goal +#define GI_RET_TIME 3 // Returned due to timeout + +// Defines for TeamSpawnpoints : goal_activation (in teamspawns) +#define TFSP_MULTIPLEITEMS 1 // Give out the GoalItem multiple times +#define TFSP_MULTIPLEMSGS 2 // Display the message multiple times + +// Defines for TeamSpawnpoints : goal_effects (in teamspawns) +#define TFSP_REMOVESELF 1 // Remove itself after being spawned on + +// Defines for Goal States +#define TFGS_ACTIVE 1 +#define TFGS_INACTIVE 2 +#define TFGS_REMOVED 3 +#define TFGS_DELAYED 4 + +// Defines for GoalItem Removing from Player Methods +#define GI_DROP_PLAYERDEATH 0 // Dropped by a dying player +#define GI_DROP_REMOVEGOAL 1 // Removed by a Goal +#define GI_DROP_PLAYERDROP 2 // Dropped by a player + +// Legal Playerclass Handling +#define TF_ILL_SCOUT 1 +#define TF_ILL_SNIPER 2 +#define TF_ILL_SOLDIER 4 +#define TF_ILL_DEMOMAN 8 +#define TF_ILL_MEDIC 16 +#define TF_ILL_HVYWEP 32 +#define TF_ILL_PYRO 64 +#define TF_ILL_RANDOMPC 128 +#define TF_ILL_SPY 256 +#define TF_ILL_ENGINEER 512 + +// Addition classes +#define CLASS_TFGOAL 128 +#define CLASS_TFGOAL_TIMER 129 +#define CLASS_TFGOAL_ITEM 130 +#define CLASS_TFSPAWN 131 + +/*==========================================================================*/ +/* Flamethrower */ +/*==========================================================================*/ +#define FLAME_PLYRMAXTIME 5.0 // lifetime in seconds of a flame on a player +#define FLAME_MAXBURNTIME 8 // lifetime in seconds of a flame on the world (big ones) +#define NAPALM_MAXBURNTIME 20 // lifetime in seconds of flame from a napalm grenade +#define FLAME_MAXPLYRFLAMES 4 // maximum number of flames on a player +#define FLAME_NUMLIGHTS 1 // maximum number of light flame +#define FLAME_BURNRATIO 0.3 // the chance of a flame not 'sticking' +#define GR_TYPE_FLAMES_NO 15 // number of flames spawned when a grenade explode +#define FLAME_DAMAGE_TIME 1 // Interval between damage burns from flames +#define FLAME_EFFECT_TIME 0.2 // frequency at which we display flame effects. +#define FLAME_THINK_TIME 0.1 // Seconds between times the flame checks burn +#define PER_FLAME_DAMAGE 2 // Damage taken per second per flame by burning players + +/*==================================================*/ +/* CTF Support defines */ +/*==================================================*/ +#define CTF_FLAG1 1 +#define CTF_FLAG2 2 +#define CTF_DROPOFF1 3 +#define CTF_DROPOFF2 4 +#define CTF_SCORE1 5 +#define CTF_SCORE2 6 + +//.float hook_out; + +/*==================================================*/ +/* Camera defines */ +/*==================================================*/ +/* +float live_camera; +.float camdist; +.vector camangle; +.entity camera_list; +*/ + +/*==================================================*/ +/* QuakeWorld defines */ +/*==================================================*/ +/* +float already_chosen_map; + +// grappling hook variables +.entity hook; +.float on_hook; +.float fire_held_down;// flag - TRUE if player is still holding down the + // fire button after throwing a hook. +*/ +/*==================================================*/ +/* Server Settings */ +/*==================================================*/ +// Admin modes +#define ADMIN_MODE_NONE 0 +#define ADMIN_MODE_DEAL 1 + +/*==================================================*/ +/* Death Message defines */ +/*==================================================*/ +#define DMSG_SHOTGUN 1 +#define DMSG_SSHOTGUN 2 +#define DMSG_NAILGUN 3 +#define DMSG_SNAILGUN 4 +#define DMSG_GRENADEL 5 +#define DMSG_ROCKETL 6 +#define DMSG_LIGHTNING 7 +#define DMSG_GREN_HAND 8 +#define DMSG_GREN_NAIL 9 +#define DMSG_GREN_MIRV 10 +#define DMSG_GREN_PIPE 11 +#define DMSG_DETPACK 12 +#define DMSG_BIOWEAPON 13 +#define DMSG_BIOWEAPON_ATT 14 +#define DMSG_FLAME 15 +#define DMSG_DETPACK_DIS 16 +#define DMSG_AXE 17 +#define DMSG_SNIPERRIFLE 18 +#define DMSG_AUTORIFLE 19 +#define DMSG_ASSAULTCANNON 20 +#define DMSG_HOOK 21 +#define DMSG_BACKSTAB 22 +#define DMSG_MEDIKIT 23 +#define DMSG_GREN_GAS 24 +#define DMSG_TRANQ 25 +#define DMSG_LASERBOLT 26 +#define DMSG_SENTRYGUN_BULLET 27 +#define DMSG_SNIPERLEGSHOT 28 +#define DMSG_SNIPERHEADSHOT 29 +#define DMSG_GREN_EMP 30 +#define DMSG_GREN_EMP_AMMO 31 +#define DMSG_SPANNER 32 +#define DMSG_INCENDIARY 33 +#define DMSG_SENTRYGUN_ROCKET 34 +#define DMSG_GREN_FLASH 35 +#define DMSG_TRIGGER 36 +#define DMSG_MIRROR 37 +#define DMSG_SENTRYDEATH 38 +#define DMSG_DISPENSERDEATH 39 +#define DMSG_GREN_AIRPIPE 40 +#define DMSG_CALTROP 41 + +/*==================================================*/ +// TOGGLEFLAGS +/*==================================================*/ +// Some of the toggleflags aren't used anymore, but the bits are still +// there to provide compatability with old maps +#define TFLAG_CLASS_PERSIST (1 << 0) // Persistent Classes Bit +#define TFLAG_CHEATCHECK (1 << 1) // Cheatchecking Bit +#define TFLAG_RESPAWNDELAY (1 << 2) // RespawnDelay bit +//#define TFLAG_UN (1 << 3) // NOT USED ANYMORE +#define TFLAG_OLD_GRENS (1 << 3) // Use old concussion grenade and flash grenade +#define TFLAG_UN2 (1 << 4) // NOT USED ANYMORE +#define TFLAG_UN3 (1 << 5) // NOT USED ANYMORE +#define TFLAG_UN4 (1 << 6) // NOT USED ANYMORE: Was Autoteam. CVAR tfc_autoteam used now. +#define TFLAG_TEAMFRAGS (1 << 7) // Individual Frags, or Frags = TeamScore +#define TFLAG_FIRSTENTRY (1 << 8) // Used to determine the first time toggleflags is set + // In a map. Cannot be toggled by players. +#define TFLAG_SPYINVIS (1 << 9) // Spy invisible only +#define TFLAG_GRAPPLE (1 << 10) // Grapple on/off +//#define TFLAG_FULLTEAMSCORE (1 << 11) // Each Team's score is TeamScore + Frags +#define TFLAG_FLAGEMULATION (1 << 12) // Flag emulation on for old TF maps +#define TFLAG_USE_STANDARD (1 << 13) // Use the TF War standard for Flag emulation + +#define TFLAG_FRAGSCORING (1 << 14) // Use frag scoring only + +/*======================*/ +// Menu stuff // +/*======================*/ + +#define MENU_DEFAULT 1 +#define MENU_TEAM 2 +#define MENU_CLASS 3 +#define MENU_MAPBRIEFING 4 +#define MENU_INTRO 5 +#define MENU_CLASSHELP 6 +#define MENU_CLASSHELP2 7 +#define MENU_REPEATHELP 8 + +#define MENU_SPECHELP 9 + + +#define MENU_SPY 12 +#define MENU_SPY_SKIN 13 +#define MENU_SPY_COLOR 14 +#define MENU_ENGINEER 15 +#define MENU_ENGINEER_FIX_DISPENSER 16 +#define MENU_ENGINEER_FIX_SENTRYGUN 17 +#define MENU_ENGINEER_FIX_MORTAR 18 +#define MENU_DISPENSER 19 +#define MENU_CLASS_CHANGE 20 +#define MENU_TEAM_CHANGE 21 + +#define MENU_REFRESH_RATE 25 + +#define MENU_VOICETWEAK 50 + +//============================ +// Timer Types +#define TF_TIMER_ANY 0 +#define TF_TIMER_CONCUSSION 1 +#define TF_TIMER_INFECTION 2 +#define TF_TIMER_HALLUCINATION 3 +#define TF_TIMER_TRANQUILISATION 4 +#define TF_TIMER_ROTHEALTH 5 +#define TF_TIMER_REGENERATION 6 +#define TF_TIMER_GRENPRIME 7 +#define TF_TIMER_CELLREGENERATION 8 +#define TF_TIMER_DETPACKSET 9 +#define TF_TIMER_DETPACKDISARM 10 +#define TF_TIMER_BUILD 11 +#define TF_TIMER_CHECKBUILDDISTANCE 12 +#define TF_TIMER_DISGUISE 13 +#define TF_TIMER_DISPENSERREFILL 14 + +// Non Player timers +#define TF_TIMER_RETURNITEM 100 +#define TF_TIMER_DELAYEDGOAL 101 +#define TF_TIMER_ENDROUND 102 + +//============================ +// Teamscore printing +#define TS_PRINT_SHORT 1 +#define TS_PRINT_LONG 2 +#define TS_PRINT_LONG_TO_ALL 3 + +#ifndef TF_DEFS_ONLY +typedef struct +{ + int topColor; + int bottomColor; +} team_color_t; +/*==================================================*/ +/* GLOBAL VARIABLES */ +/*==================================================*/ +// FortressMap stuff +extern float number_of_teams; // number of teams supported by the map +extern int illegalclasses[5]; // Illegal playerclasses for all teams +extern int civilianteams; // Bitfield holding Civilian teams +extern Vector rgbcolors[5]; // RGB colors for each of the 4 teams + +extern team_color_t teamcolors[5][PC_LASTCLASS]; // Colors for each of the 4 teams +extern int teamscores[5]; // Goal Score of each team +extern int g_iOrderedTeams[5]; // Teams ordered into order of winners->losers +extern int teamfrags[5]; // Total Frags for each team +extern int teamlives[5]; // Number of lives each team's players have +extern int teammaxplayers[5]; // Max number of players allowed in each team +extern float teamadvantage[5]; // only used if the teamplay equalisation bits are set + // stores the damage ratio players take/give +extern int teamallies[5]; // Keeps track of which teams are allied +extern string_t team_names[5]; + +extern BOOL CTF_Map; +extern BOOL birthday; +extern BOOL christmas; + +extern float num_world_flames; + +// Clan Battle stuff +extern float clan_scores_dumped; +extern float cb_prematch_time; +extern float fOldPrematch; +extern float fOldCeaseFire; +extern float cb_ceasefire_time; +extern float last_id; +extern float spy_off; +extern float old_grens; +extern float flagem_checked; +extern float flNextEqualisationCalc; +extern BOOL cease_fire; +extern BOOL no_cease_fire_text; +extern BOOL initial_cease_fire; +extern BOOL last_cease_fire; +// Autokick stuff +extern float autokick_kills; + +extern float deathmsg; // Global, which is set before every T_Damage, to indicate + // the death message that should be used. + +extern char *sTeamSpawnNames[]; +extern char *sClassNames[]; +extern char *sNewClassModelFiles[]; +extern char *sOldClassModelFiles[]; +extern char *sClassModels[]; +extern char *sClassCfgs[]; +extern char *sGrenadeNames[]; +extern string_t team_menu_string; + +extern int toggleflags; // toggleable flags + +extern BOOL g_bFirstClient; + +extern float g_fNextPrematchAlert; + +typedef struct +{ + int ip; + edict_t *pEdict; +} ip_storage_t; + +extern ip_storage_t g_IpStorage[32]; + +class CGhost; +/*==========================================================================*/ +BOOL ClassIsRestricted(float tno, int pc); +char* GetTeamName(int tno); +int TeamFortress_GetNoPlayers(); +void DestroyBuilding(CBaseEntity *eng, char *bld); +void teamsprint( int tno, CBaseEntity *ignore, int msg_dest, const char *st, const char *param1 = NULL, const char *param2 = NULL, const char *param3 = NULL ); +float anglemod( float v ); + +// Team Funcs +BOOL TeamFortress_TeamIsCivilian(float tno); +void TeamFortress_TeamShowScores(BOOL bLong, CBasePlayer *pPlayer); +BOOL TeamFortress_TeamPutPlayerInTeam(); +void TeamFortress_TeamSetColor(int tno); +void TeamFortress_TeamIncreaseScore(int tno, int scoretoadd); +int TeamFortress_TeamGetScoreFrags(int tno); +int TeamFortress_TeamGetNoPlayers(int tno); +float TeamEqualiseDamage(CBaseEntity *targ, CBaseEntity *attacker, float damage); +BOOL IsSpawnPointValid( Vector &pos ); +BOOL TeamFortress_SortTeams( void ); +void DumpClanScores( void ); +void CalculateTeamEqualiser(); + +// mapscript funcs +void ParseTFServerSettings(); +void ParseTFMapSettings(); +CBaseEntity* Finditem(int ino); +CBaseEntity* Findgoal(int gno); +CBaseEntity* Findteamspawn(int gno); +void RemoveGoal(CBaseEntity *Goal); +void tfgoalitem_GiveToPlayer(CBaseEntity *Item, CBasePlayer *AP, CBaseEntity *Goal); +void dremove( CBaseEntity *te ); +void tfgoalitem_RemoveFromPlayer(CBaseEntity *Item, CBasePlayer *AP, int iMethod); +void tfgoalitem_drop(CBaseEntity *Item, BOOL PAlive, CBasePlayer *P); +void DisplayItemStatus(CBaseEntity *Goal, CBasePlayer *Player, CBaseEntity *Item); +void tfgoalitem_checkgoalreturn(CBaseEntity *Item); +void DoGoalWork(CBaseEntity *Goal, CBasePlayer *AP); +void DoResults(CBaseEntity *Goal, CBasePlayer *AP, BOOL bAddBonuses); +void DoGroupWork(CBaseEntity *Goal, CBasePlayer *AP); +// hooks into the mapscript for all entities +BOOL ActivateDoResults(CBaseEntity *Goal, CBasePlayer *AP, CBaseEntity *ActivatingGoal); +BOOL ActivationSucceeded(CBaseEntity *Goal, CBasePlayer *AP, CBaseEntity *ActivatingGoal); + +// prematch & ceasefire +void Display_Prematch(); +void Check_Ceasefire(); + +// admin +void KickPlayer( CBaseEntity *pTarget ); +void BanPlayer( CBaseEntity *pTarget ); +CGhost *FindGhost( int iGhostID ); +int GetBattleID( edict_t *pEntity ); + +extern cvar_t tfc_spam_penalty1;// the initial gag penalty for a spammer (seconds) +extern cvar_t tfc_spam_penalty2;// incremental gag penalty (seconds) for each time gagged spammer continues to speak. +extern cvar_t tfc_spam_limit; // at this many points, gag the spammer +extern cvar_t tfc_clanbattle, tfc_clanbattle_prematch, tfc_prematch, tfc_clanbattle_ceasefire, tfc_balance_teams, tfc_balance_scores; +extern cvar_t tfc_clanbattle_locked, tfc_birthday, tfc_autokick_kills, tfc_fragscoring, tfc_autokick_time, tfc_adminpwd; +extern cvar_t weaponstay, footsteps, flashlight, aimcrosshair, falldamage, teamplay; +extern cvar_t allow_spectators; + +/*==========================================================================*/ +class CTFFlame : public CBaseMonster +{ +public: + void Spawn( void ); + void Precache( void ); + void EXPORT FlameThink( void ); + static CTFFlame *FlameSpawn( CBaseEntity *pOwner, CBaseEntity *pTarget ); + void FlameDestroy( void ); + + float m_flNextDamageTime; +}; + +/*==========================================================================*/ +// MAPSCRIPT CLASSES +class CTFGoal : public CBaseAnimating +{ +public: + void Spawn( void ); + void StartGoal( void ); + void EXPORT PlaceGoal( void ); + void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); + int Classify ( void ) { return CLASS_TFGOAL; } + + void SetObjectCollisionBox( void ); +}; + +class CTFGoalItem : public CTFGoal +{ +public: + void Spawn( void ); + void StartItem( void ); + void EXPORT PlaceItem( void ); + int Classify ( void ) { return CLASS_TFGOAL_ITEM; } + + float m_flDroppedAt; +}; + +class CTFTimerGoal : public CTFGoal +{ +public: + void Spawn( void ); + int Classify ( void ) { return CLASS_TFGOAL_TIMER; } +}; + +class CTFSpawn : public CBaseEntity +{ +public: + void Spawn( void ); + void Activate( void ); + int Classify ( void ) { return CLASS_TFSPAWN; } + BOOL CheckTeam( int iTeamNo ); + EHANDLE m_pTeamCheck; +}; + +class CTFDetect : public CBaseEntity +{ +public: + void Spawn( void ); + int Classify ( void ) { return CLASS_TFGOAL; } +}; + +class CTelefragDeath : public CBaseEntity +{ +public: + void Spawn( void ); + void EXPORT DeathTouch( CBaseEntity *pOther ); +}; + +class CTeamCheck : public CBaseDelay +{ +public: + void Spawn( void ); + void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); + BOOL TeamMatches( int iTeam ); +}; +class CTeamSet : public CBaseDelay +{ +public: + void Spawn( void ); + void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); +}; +#endif // TF_DEFS_ONLY +#endif // __TF_DEFS_H + + diff --git a/main/source/cl_dll/train.cpp b/main/source/cl_dll/train.cpp new file mode 100644 index 00000000..2c133ce6 --- /dev/null +++ b/main/source/cl_dll/train.cpp @@ -0,0 +1,85 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// Train.cpp +// +// implementation of CHudAmmo class +// + +#include "hud.h" +#include "cl_util.h" +#include +#include +#include "parsemsg.h" + +DECLARE_MESSAGE(m_Train, Train ) + + +int CHudTrain::Init(void) +{ + HOOK_MESSAGE( Train ); + + m_iPos = 0; + m_iFlags = 0; + //gHUD.AddHudElem(this); + + return 1; +}; + +int CHudTrain::VidInit(void) +{ + m_hSprite = 0; + + return 1; +}; + +int CHudTrain::Draw(float fTime) +{ + if ( !m_hSprite ) + m_hSprite = LoadSprite("sprites/%d_train.spr"); + + if (m_iPos) + { + int r, g, b, x, y; + + gHUD.GetPrimaryHudColor(r, g, b); + SPR_Set(m_hSprite, r, g, b ); + + // This should show up to the right and part way up the armor number + y = ScreenHeight() - SPR_Height(m_hSprite,0) - gHUD.m_iFontHeight; + x = ScreenWidth()/3 + SPR_Width(m_hSprite,0)/4; + + SPR_DrawAdditive( m_iPos - 1, x, y, NULL); + + } + + return 1; +} + + +int CHudTrain::MsgFunc_Train(const char *pszName, int iSize, void *pbuf) +{ + BEGIN_READ( pbuf, iSize ); + + // update Train data + m_iPos = READ_BYTE(); + + if (m_iPos) + m_iFlags |= HUD_ACTIVE; + else + m_iFlags &= ~HUD_ACTIVE; + + return 1; +} diff --git a/main/source/cl_dll/tri.cpp b/main/source/cl_dll/tri.cpp new file mode 100644 index 00000000..634fde28 --- /dev/null +++ b/main/source/cl_dll/tri.cpp @@ -0,0 +1,455 @@ +// Triangle rendering, if any + +#include "hud.h" +#include "cl_util.h" +#include "cl_dll/in_defs.h" +#include "cl_dll/demo.h" + +// Triangle rendering apis are in gEngfuncs.pTriAPI + +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "triangleapi.h" +#include "APIProxy.h" +#include "Exports.h" +#include "particles/p_vector.h" +#include "particles/papi.h" +#include "mod/AvHParticleSystemManager.h" + +#include "pm_defs.h" +#include "pm_shared.h" +#include "pm_movevars.h" +#include "mod/AvHEvents.h" +#include "mod/AvHScriptManager.h" +#include "mod/AvHClientVariables.h" + +#include "common/com_model.h" +#include "mod/CollisionUtil.h" + + +extern playermove_t *pmove; + +extern vec3_t v_origin; +extern vec3_t gLastCommanderViewpoint; + +// A fountain +/* +================= +Draw_Triangles + + Example routine. Draws a sprite offset from the player origin. + ================= +*/ +//void Draw_Triangles( void ) +//{ +// cl_entity_t *player; +// vec3_t org; +// +// // Load it up with some bogus data +// player = gEngfuncs.GetLocalPlayer(); +// if ( !player ) +// return; +// +// org = player->origin; +// +// org.x += 0; +// org.y += 0; +// +// pVector theView(player->angles.x, player->angles.y, player->angles.z); +// theView.normalize(); +// pVector theUp(0.0f, 0.0f, 1.0f); +// pVector theBase(org.x, org.y, org.z); +// +// // Do what the particles do. +// ComputeParticles(theBase); +// +// // Create a triangle, sigh +// //gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); +// gEngfuncs.pTriAPI->CullFace( TRI_NONE ); +// +// gEngfuncs.pTriAPI->Brightness( 1 ); +// +// if (gHUD.m_hsprCursor == 0) +// { +// char sz[256]; +// //sprintf( sz, "sprites/cursor.spr" ); +// //sprintf( sz, "sprites/myrain.spr" ); +// sprintf( sz, "sprites/haze2.spr" ); +// gHUD.m_hsprCursor = SPR_Load( sz ); +// } +// +// if ( !gEngfuncs.pTriAPI->SpriteTexture( (struct model_s *)gEngfuncs.GetSpritePointer( gHUD.m_hsprCursor ), 0 )) +// { +// return; +// } +// +// gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd ); +// gEngfuncs.pTriAPI->Color4f(1.0f, 1.0f, 1.0f, .5f); +// gEngfuncs.pTriAPI->CullFace( TRI_NONE ); +// DrawGroupTriSplat(theView, theUp, 70, true, true, true); +// +// //// Create a triangle, sigh +// //gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); +// // +// //gEngfuncs.pTriAPI->Begin( TRI_QUADS ); +// //// Overload p->color with index into tracer palette, p->packedColor with brightness +// //gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, 1.0 ); +// //// UNDONE: This gouraud shading causes tracers to disappear on some cards (permedia2) +// //gEngfuncs.pTriAPI->Brightness( 1 ); +// //gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); +// //gEngfuncs.pTriAPI->Vertex3f( org.x, org.y, org.z ); +// // +// //gEngfuncs.pTriAPI->Brightness( 1 ); +// //gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); +// //gEngfuncs.pTriAPI->Vertex3f( org.x, org.y + 50, org.z ); +// // +// //gEngfuncs.pTriAPI->Brightness( 1 ); +// //gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); +// //gEngfuncs.pTriAPI->Vertex3f( org.x + 50, org.y + 50, org.z ); +// // +// //gEngfuncs.pTriAPI->Brightness( 1 ); +// //gEngfuncs.pTriAPI->TexCoord2f( 1, 0 ); +// //gEngfuncs.pTriAPI->Vertex3f( org.x + 50, org.y, org.z ); +// +// +// gEngfuncs.pTriAPI->End(); +// gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); +//} + +//#endif + +void AngleMatrix (const vec3_t angles, float (*matrix)[4] ) +{ + float angle; + float sr, sp, sy, cr, cp, cy; + + angle = angles[2] * (M_PI*2 / 360); + sy = sin(angle); + cy = cos(angle); + angle = angles[1] * (M_PI*2 / 360); + sp = sin(angle); + cp = cos(angle); + angle = angles[0] * (M_PI*2 / 360); + sr = sin(angle); + cr = cos(angle); + + // matrix = (Z * Y) * X + matrix[0][0] = cp*cy; + matrix[1][0] = cp*sy; + matrix[2][0] = -sp; + matrix[0][1] = sr*sp*cy+cr*-sy; + matrix[1][1] = sr*sp*sy+cr*cy; + matrix[2][1] = sr*cp; + matrix[0][2] = (cr*sp*cy+-sr*-sy); + matrix[1][2] = (cr*sp*sy+-sr*cy); + matrix[2][2] = cr*cp; + matrix[0][3] = 0.0; + matrix[1][3] = 0.0; + matrix[2][3] = 0.0; +} + +void VectorRotate (const vec3_t in1, const float in2[3][4], vec3_t& out) +{ + out[0] = DotProduct(in1, in2[0]); + out[1] = DotProduct(in1, in2[1]); + out[2] = DotProduct(in1, in2[2]); +} + +/* +================= +HUD_DrawNormalTriangles + + Non-transparent triangles-- add them here + ================= +*/ +void CL_DLLEXPORT HUD_DrawNormalTriangles( void ) +{ + RecClDrawNormalTriangles(); + + // pVector theView; + // cl_entity_t* thePlayer; + // + // thePlayer = gEngfuncs.GetLocalPlayer(); + // if(thePlayer) + // { + // pVector theView(thePlayer->angles.x, thePlayer->angles.y, thePlayer->angles.z); + // theView.normalize(); + // + // //AvHParticleSystemManager::Instance()->Draw(theView); + // static int theAngle = 0; + // //static HSPRITE theSprite = 0; + // DrawCircleOnGroundAtPoint(thePlayer->origin, 6, theAngle++, 100, .5f, .5f, 1.0f, .5f); + // } + + gHUD.PreRenderFrame(); + + //gHUD.m_Spectator.DrawOverview(); + +#if defined( TEST_IT ) + // Draw_Triangles(); +#endif +} + + +void DrawHitBox(const OBBox& inBox) +{ + + HSPRITE sprite = Safe_SPR_Load("sprites/white.spr"); + + vec3_t theBoxPoint[8]; + + for (int i = 0; i < 8; ++i) + { + + vec3_t xAmount; + vec3_t yAmount; + vec3_t zAmount; + + if (i & 1) + { + VectorScale(inBox.mAxis[0], inBox.mExtents[0], xAmount); + } + else + { + VectorScale(inBox.mAxis[0], -inBox.mExtents[0], xAmount); + } + + if (i & 2) + { + VectorScale(inBox.mAxis[1], inBox.mExtents[1], yAmount); + } + else + { + VectorScale(inBox.mAxis[1], -inBox.mExtents[1], yAmount); + } + + if (i & 4) + { + VectorScale(inBox.mAxis[2], inBox.mExtents[2], zAmount); + } + else + { + VectorScale(inBox.mAxis[2], -inBox.mExtents[2], zAmount); + } + + VectorAdd(inBox.mOrigin, xAmount, theBoxPoint[i]); + VectorAdd(theBoxPoint[i], yAmount, theBoxPoint[i]); + VectorAdd(theBoxPoint[i], zAmount, theBoxPoint[i]); + + } + + struct model_s* spritePtr = (struct model_s*)(gEngfuncs.GetSpritePointer(sprite)); + gEngfuncs.pTriAPI->SpriteTexture(spritePtr, 0); + + gEngfuncs.pTriAPI->Begin(TRI_LINES); + + gEngfuncs.pTriAPI->Color4f(1, 1, 1, 1); + + // Bottom. + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[0]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[1]); + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[1]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[3]); + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[3]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[2]); + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[2]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[0]); + + // Top. + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[4]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[6]); + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[6]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[7]); + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[7]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[5]); + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[5]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[4]); + + // Sides. + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[0]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[4]); + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[2]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[6]); + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[3]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[7]); + + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[1]); + gEngfuncs.pTriAPI->Vertex3fv(theBoxPoint[5]); + + gEngfuncs.pTriAPI->End(); + +} + + +void DrawHitBoxes() +{ + + extern int cam_thirdperson; + + for (int j = 1; j < 512; ++j) + { + + cl_entity_t* entity = gEngfuncs.GetEntityByIndex(j); + + if (entity == gEngfuncs.GetLocalPlayer() && !cam_thirdperson) + { + continue; + } + + if (entity->curstate.effects & EF_NODRAW) + { + continue; + } + + if (entity != NULL && entity->model != NULL && entity->model->type == mod_studio) + { + + int theEntityIndex = j; + + OBBox theBox[256]; + int theNumBoxes; + + NS_GetHitBoxesForEntity(theEntityIndex, 256, theBox, theNumBoxes, gEngfuncs.GetClientTime()); + + for (int i = 0; i < theNumBoxes; ++i) + { + DrawHitBox(theBox[i]); + } + + } + + } + +} + + + +/* + + ================= + HUD_DrawTransparentTriangles + + Render any triangles with transparent rendermode needs here + ================= +*/ +void CL_DLLEXPORT HUD_DrawTransparentTriangles( void ) +{ + RecClDrawTransparentTriangles(); + + cl_entity_t* thePlayer; + + if (gHUD.GetParticlesVisible() && gHUD.GetSafeForSpriteDrawing()) + { + // get local player + thePlayer = gEngfuncs.GetLocalPlayer(); + if(thePlayer) + { + //pVector theView(thePlayer->angles.x, thePlayer->angles.y, thePlayer->angles.z); + //pVector theView(viewangles[0], viewangles[1], viewangles[2]); + //theView.normalize(); + + vec3_t angles, up, right, forward; + // gEngfuncs.pfnAngleVectors(thePlayer->angles, forward, right, up); + + // This view doesn't take pitch into account. Pitch is stored in x. While yaw goes from -180 to 180, + // pitch goes from -10 (looking up) to 10 (looking down). Alter forward[YAW} (forward[0]) so + // the particles can billboard themselves correctly. + + // float thePitch = thePlayer->angles[PITCH]; + // float theNormAngle = thePitch/-10.0f; + // int theAngle = theNormAngle*90; + // //float theYaw = thePlayer->angles[YAW]; + // + // vec3_t theRotationAngles; + // theRotationAngles[0] = theAngle; + // theRotationAngles[1] = 0; + // theRotationAngles[2] = 0; + // + // float theMatrix[3][4]; + // AngleMatrix(theRotationAngles, theMatrix); + // + // vec3_t theOut; + // VectorRotate(forward, theMatrix, theOut); + // pVector theRealView(theOut[0], theOut[1], theOut[2]); + + pVector theRealView; + gEngfuncs.pfnAngleVectors(v_angles, forward, right, up); + + theRealView.x = forward[0]; + theRealView.y = forward[1]; + theRealView.z = forward[2]; + + // Disable fog + float theFogColor[3]; + theFogColor[0] = theFogColor[1] = theFogColor[2] = 0.0f; + gEngfuncs.pTriAPI->Fog(theFogColor, 0, 0, 0); + + // Draw particles via tri API, without z-buffering, unless we're debugging + //if(cl_particleinfo->value == 0) + //{ + AvHParticleSystemManager::Instance()->Draw(theRealView); + //} + + //DrawOrdersForPlayers(gHUD.GetDrawPlayerOrders()); + + //DrawRangeIndicator(); + + //DrawBlips(theRealView); + + //DrawMarineLights(theRealView); + + AvHScriptManager::Instance()->DrawTransparent(); + + //DrawDebugEffects(); + + //static int theAngle = 0; + //DrawCircleOnGroundAtPoint(thePlayer->origin, 6, theAngle++, 100, 1.0f, 1.0f, 1.0f, .2f); + } + + // Draw the hitboxes for all of the objects. + +/* +#ifdef AVH_PLAYTEST_BUILD + if (CVAR_GET_FLOAT("sv_cheats") != 0 && CVAR_GET_FLOAT("cl_drawhitboxes") != 0) + { + DrawHitBoxes(); + } +#endif +*/ + // Assumes that the only time players don't have view models is when they are commanding, gestating, cocooned + // or when they aren't playing. See the end of StudioModelRenderer::StudioDrawModel(). + //if((gHUD.GetRole() == ROLE_COMMANDER) || (gHUD.GetRole() == ROLE_GESTATING) || (gHUD.GetRole() == ROLE_COCOONED) || (gHUD.GetPlayMode() != PLAYMODE_PLAYING)) + cl_entity_t* theViewEntity = gEngfuncs.GetViewModel(); + if(!theViewEntity || !theViewEntity->model) + { + // This should always be rendered with the commander viewpoint +// vec3_t theCurrentOrigin = v_origin; +// +// if(gHUD.GetInTopDownMode()) +// { +// v_origin = gLastCommanderViewpoint; +// } + + gHUD.RenderNoZBuffering(); + +// if(gHUD.GetInTopDownMode()) +// { +// v_origin = theCurrentOrigin; +// } + } + + gHUD.PostRenderFrame(); + } +} \ No newline at end of file diff --git a/main/source/cl_dll/util.cpp b/main/source/cl_dll/util.cpp new file mode 100644 index 00000000..b44b04eb --- /dev/null +++ b/main/source/cl_dll/util.cpp @@ -0,0 +1,314 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// +// util.cpp +// +// implementation of class-less helper functions +// + +#include "STDIO.H" +#include "STDLIB.H" +#include "MATH.H" + +#include "hud.h" +#include "cl_util.h" +#include "common/cl_entity.h" +#include +#ifndef M_PI +#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h +#endif + +#include "pm_defs.h" +#include "pm_shared.h" +#include "pm_movevars.h" +extern playermove_t *pmove; + +extern float HUD_GetFOV( void ); +vec3_t vec3_origin( 0, 0, 0 ); +extern vec3_t v_angles; +//double sqrt(double x); +// +//float Length(const float *v) +//{ +// int i; +// float length; +// +// length = 0; +// for (i=0 ; i< 3 ; i++) +// length += v[i]*v[i]; +// length = sqrt (length); // FIXME +// +// return length; +//} +// +//void VectorAngles( const float *forward, float *angles ) +//{ +// float tmp, yaw, pitch; +// +// if (forward[1] == 0 && forward[0] == 0) +// { +// yaw = 0; +// if (forward[2] > 0) +// pitch = 90; +// else +// pitch = 270; +// } +// else +// { +// yaw = (atan2(forward[1], forward[0]) * 180 / M_PI); +// if (yaw < 0) +// yaw += 360; +// +// tmp = sqrt (forward[0]*forward[0] + forward[1]*forward[1]); +// pitch = (atan2(forward[2], tmp) * 180 / M_PI); +// if (pitch < 0) +// pitch += 360; +// } +// +// angles[0] = pitch; +// angles[1] = yaw; +// angles[2] = 0; +//} +// +//float VectorNormalize (float *v) +//{ +// float length, ilength; +// +// length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; +// length = sqrt (length); // FIXME +// +// if (length) +// { +// ilength = 1/length; +// v[0] *= ilength; +// v[1] *= ilength; +// v[2] *= ilength; +// } +// +// return length; +// +//} +// +//void VectorInverse ( float *v ) +//{ +// v[0] = -v[0]; +// v[1] = -v[1]; +// v[2] = -v[2]; +//} +// +//void VectorScale (const float *in, float scale, float *out) +//{ +// out[0] = in[0]*scale; +// out[1] = in[1]*scale; +// out[2] = in[2]*scale; +//} +// +//void VectorMA (const float *veca, float scale, const float *vecb, float *vecc) +//{ +// vecc[0] = veca[0] + scale*vecb[0]; +// vecc[1] = veca[1] + scale*vecb[1]; +// vecc[2] = veca[2] + scale*vecb[2]; +//} + +int ScreenHeight() +{ + // CGC: Replace code when ready to fix overview map + //int theViewport[4]; + //gHUD.GetViewport(theViewport); + //return theViewport[3]; + return gHUD.m_scrinfo.iHeight; +} + +// ScreenWidth returns the width of the screen, in pixels +//#define ScreenWidth ( int theViewport[4]; gHUD.GetViewport(theViewport); return theViewport[2]; ) +int ScreenWidth() +{ + //int theViewport[4]; + //gHUD.GetViewport(theViewport); + //return theViewport[2]; + return gHUD.m_scrinfo.iWidth; +} + + +HSPRITE Safe_SPR_Load(const char* inSpriteName) +{ + HSPRITE theSpriteHandle = gEngfuncs.pfnSPR_Load(inSpriteName); + + // Check for "Can't allocate 128 HUD sprites" crash + ASSERT(theSpriteHandle < 128); + + return theSpriteHandle; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Given a field of view and mouse/screen positions as well as the current +// render origin and angles, returns a unit vector through the mouse position +// that can be used to trace into the world under the mouse click pixel. +// Input : fov - +// mousex - +// mousey - +// screenwidth - +// screenheight - +// vecRenderAngles - +// c_x - +// vpn - +// vup - +// 360.0 - +//----------------------------------------------------------------------------- +void CreatePickingRay( int mousex, int mousey, Vector& outVecPickingRay ) +{ + float dx, dy; + float c_x, c_y; + float dist; + Vector vpn, vup, vright; + +// char gDebugMessage[256]; + + float fovDegrees = gHUD.m_iFOV; + + //cl_entity_s* theLocalEntity = gEngfuncs.GetLocalPlayer(); + //Vector vecRenderOrigin = theLocalEntity->origin; + //Vector vecRenderAngles = theLocalEntity->angles; + //Vector vecRenderAngles; + vec3_t vecRenderAngles; + //gEngfuncs.GetViewAngles((float*)vecRenderAngles); + VectorCopy(v_angles, vecRenderAngles); + + //vec3_t theForward, theRight, theUp; + //AngleVectors(v_angles, theForward, theRight, theUp); + + //ASSERT(v_angles.x == vecRenderAngles.x); + //ASSERT(v_angles.y == vecRenderAngles.y); + //ASSERT(v_angles.z == vecRenderAngles.z); + + c_x = ScreenWidth() / 2; + c_y = ScreenHeight() / 2; + + + dx = (float)mousex - c_x; + // Invert Y + dy = c_y - (float)mousey; + +// sprintf(gDebugMessage, "inMouseX/Y: %d/%d, dx/dy = %d/%d", (int)mousex, (int)mousey, (int)dx, (int)dy); +// CenterPrint(gDebugMessage); + + // Convert view plane distance + dist = c_x / tan( M_PI * fovDegrees / 360.0 ); + + + // Decompose view angles + AngleVectors( vecRenderAngles, vpn, vright, vup ); + + + // Offset forward by view plane distance, and then by pixel offsets + outVecPickingRay = vpn * dist + vright * ( dx ) + vup * ( dy ); + + //sprintf(gDebugMessage, "outVecPickingRay: %.0f, %.0f, %.0f", outVecPickingRay.x, outVecPickingRay.y, outVecPickingRay.z); + //CenterPrint(gDebugMessage); + + // Convert to unit vector + VectorNormalize( outVecPickingRay ); +} + +void FillRGBAClipped(vgui::Panel* inPanel, int inStartX, int inStartY, int inWidth, int inHeight, int r, int g, int b, int a) +{ + int thePanelXPos, thePanelYPos; + inPanel->getPos(thePanelXPos, thePanelYPos); + + int thePanelWidth, thePanelHeight; + inPanel->getSize(thePanelWidth, thePanelHeight); + + // Clip starting point + inStartX = min(max(0, inStartX), thePanelWidth-1); + inStartY = min(max(0, inStartY), thePanelHeight-1); + + // Clip width if it goes too far + ASSERT(inWidth >= 0); + ASSERT(inHeight >= 0); + + if(inStartX + inWidth >= thePanelWidth) + { + inWidth = max(0, thePanelWidth - inStartX); + } + if(inStartY + inHeight >= thePanelHeight) + { + inHeight = max(0, thePanelHeight - inStartY); + } + + // Now we can draw + FillRGBA(inStartX, inStartY, inWidth, inHeight, r, g, b, a); + +} + + +HSPRITE LoadSprite(const char *pszName) +{ + int i; + char sz[256]; + + if (ScreenWidth() < 640) + i = 320; + else + i = 640; + + sprintf(sz, pszName, i); + + return Safe_SPR_Load(sz); +} + +bool LocalizeString(const char* inMessage, string& outputString) +{ + #define kMaxLocalizedStringLength 1024 + + bool theSuccess = false; + char theInputString[kMaxLocalizedStringLength]; + char theOutputString[kMaxLocalizedStringLength]; + + // Don't localize empty strings + if(strcmp(inMessage, "")) + { + if(*inMessage != '#') + { + sprintf(theInputString, "#%s", inMessage); + } + else + { + sprintf(theInputString, "%s", inMessage); + } + + if((CHudTextMessage::LocaliseTextString(theInputString, theOutputString, kMaxLocalizedStringLength) != NULL)) + { + outputString = theOutputString; + + if(theOutputString[0] != '#') + { + theSuccess = true; + } + else + { + string theTempString = theOutputString; + theTempString = theTempString.substr(1, theTempString.length()); + outputString = theTempString; + } + } + else + { + outputString = string("err: ") + theInputString; + } + } + + return theSuccess; +} \ No newline at end of file diff --git a/main/source/cl_dll/util_vector.h b/main/source/cl_dll/util_vector.h new file mode 100644 index 00000000..801ef250 --- /dev/null +++ b/main/source/cl_dll/util_vector.h @@ -0,0 +1,38 @@ +/*** +* +* Copyright (c) 1999, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// Vector.h +// A subset of the extdll.h in the project HL Entity DLL +// +#ifndef UTIL_VECTOR_H +#define UTIL_VECTOR_H + +// Misc C-runtime library headers +#include "STDIO.H" +#include "STDLIB.H" +#include "MATH.H" + +// Header file containing definition of globalvars_t and entvars_t +typedef int func_t; // +typedef int string_t; // from engine's pr_comp.h; +typedef float vec_t; // needed before including progdefs.h + +#include "common/vectorclasses.h" + +#ifndef THEVECTOR3T +#define THEVECTOR3T +#define vec3_t Vector +#endif + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/vgui_ClassMenu.cpp b/main/source/cl_dll/vgui_ClassMenu.cpp new file mode 100644 index 00000000..d8cbf579 --- /dev/null +++ b/main/source/cl_dll/vgui_ClassMenu.cpp @@ -0,0 +1,441 @@ +//=========== (C) Copyright 1999 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: TFC Class Menu +// +// $Workfile: $ +// $Date: 2002/07/08 16:15:13 $ +// +//----------------------------------------------------------------------------- +// $Log: vgui_ClassMenu.cpp,v $ +// Revision 1.3 2002/07/08 16:15:13 Flayra +// - Refactored team color management +// +// Revision 1.2 2001/09/13 22:28:00 Charlie +// - Updated NS with new Half-life 1108 patch in preparation for voice support and spectator mode +// +// Revision 1.1.1.1.2.1 2001/09/13 14:42:29 Charlie +// - HL1108 +// +// +// $NoKeywords: $ +//============================================================================= + +#include "VGUI_Font.h" +#include + +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "parsemsg.h" + +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_ServerBrowser.h" + +// Class Menu Dimensions +#define CLASSMENU_TITLE_X XRES(40) +#define CLASSMENU_TITLE_Y YRES(32) +#define CLASSMENU_TOPLEFT_BUTTON_X XRES(40) +#define CLASSMENU_TOPLEFT_BUTTON_Y YRES(80) +#define CLASSMENU_BUTTON_SIZE_X XRES(124) +#define CLASSMENU_BUTTON_SIZE_Y YRES(24) +#define CLASSMENU_BUTTON_SPACER_Y YRES(8) +#define CLASSMENU_WINDOW_X XRES(176) +#define CLASSMENU_WINDOW_Y YRES(80) +#define CLASSMENU_WINDOW_SIZE_X XRES(424) +#define CLASSMENU_WINDOW_SIZE_Y YRES(312) +#define CLASSMENU_WINDOW_TEXT_X XRES(150) +#define CLASSMENU_WINDOW_TEXT_Y YRES(80) +#define CLASSMENU_WINDOW_NAME_X XRES(150) +#define CLASSMENU_WINDOW_NAME_Y YRES(8) +#define CLASSMENU_WINDOW_PLAYERS_Y YRES(42) + +// Creation +CClassMenuPanel::CClassMenuPanel(int iTrans, int iRemoveMe, int x,int y,int wide,int tall) : CMenuPanel(iTrans, iRemoveMe, x,y,wide,tall) +{ + // don't show class graphics at below 640x480 resolution + bool bShowClassGraphic = true; + if ( ScreenWidth() < 640 ) + { + bShowClassGraphic = false; + } + + memset( m_pClassImages, 0, sizeof(m_pClassImages) ); + + // Get the scheme used for the Titles + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + + // schemes + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" ); + SchemeHandle_t hClassWindowText = pSchemes->getSchemeHandle( "Briefing Text" ); + + // color schemes + int r, g, b, a; + + // Create the title + Label *pLabel = new Label( "", CLASSMENU_TITLE_X, CLASSMENU_TITLE_Y ); + pLabel->setParent( this ); + pLabel->setFont( pSchemes->getFont(hTitleScheme) ); + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + pLabel->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + pLabel->setBgColor( r, g, b, a ); + pLabel->setContentAlignment( vgui::Label::a_west ); + pLabel->setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Title_SelectYourClass")); + + // Create the Scroll panel + m_pScrollPanel = new CTFScrollPanel( CLASSMENU_WINDOW_X, CLASSMENU_WINDOW_Y, CLASSMENU_WINDOW_SIZE_X, CLASSMENU_WINDOW_SIZE_Y ); + m_pScrollPanel->setParent(this); + //force the scrollbars on, so after the validate clientClip will be smaller + m_pScrollPanel->setScrollBarAutoVisible(false, false); + m_pScrollPanel->setScrollBarVisible(true, true); + m_pScrollPanel->setBorder( new LineBorder( Color(255 * 0.7,170 * 0.7,0,0) ) ); + m_pScrollPanel->validate(); + + int clientWide=m_pScrollPanel->getClient()->getWide(); + + //turn scrollpanel back into auto show scrollbar mode and validate + m_pScrollPanel->setScrollBarAutoVisible(false,true); + m_pScrollPanel->setScrollBarVisible(false,false); + m_pScrollPanel->validate(); + + // Create the Class buttons + for (int i = 0; i <= PC_RANDOM; i++) + { + char sz[256]; + int iYPos = CLASSMENU_TOPLEFT_BUTTON_Y + ( (CLASSMENU_BUTTON_SIZE_Y + CLASSMENU_BUTTON_SPACER_Y) * i ); + + ActionSignal *pASignal = new CMenuHandler_StringCommandClassSelect( sTFClassSelection[i], true ); + + // Class button + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString( sLocalisedClasses[i] ) ); + m_pButtons[i] = new ClassButton( i, sz, CLASSMENU_TOPLEFT_BUTTON_X, iYPos, CLASSMENU_BUTTON_SIZE_X, CLASSMENU_BUTTON_SIZE_Y, true); + // RandomPC uses '0' + if ( i >= 1 && i <= 9 ) + { + sprintf(sz,"%d",i); + } + else + { + sprintf(sz,"0"); + } + m_pButtons[i]->setBoundKey( sz[0] ); + m_pButtons[i]->setContentAlignment( vgui::Label::a_west ); + m_pButtons[i]->addActionSignal( pASignal ); + m_pButtons[i]->addInputSignal( new CHandler_MenuButtonOver(this, i) ); + m_pButtons[i]->setParent( this ); + + // Create the Class Info Window + //m_pClassInfoPanel[i] = new CTransparentPanel( 255, CLASSMENU_WINDOW_X, CLASSMENU_WINDOW_Y, CLASSMENU_WINDOW_SIZE_X, CLASSMENU_WINDOW_SIZE_Y ); + m_pClassInfoPanel[i] = new CTransparentPanel( 255, 0, 0, clientWide, CLASSMENU_WINDOW_SIZE_Y ); + m_pClassInfoPanel[i]->setParent( m_pScrollPanel->getClient() ); + //m_pClassInfoPanel[i]->setVisible( false ); + + // don't show class pic in lower resolutions + int textOffs = XRES(8); + + if ( bShowClassGraphic ) + { + textOffs = CLASSMENU_WINDOW_NAME_X; + } + + // Create the Class Name Label + sprintf(sz, "#Title_%s", sTFClassSelection[i]); + char* localName=CHudTextMessage::BufferedLocaliseTextString( sz ); + Label *pNameLabel = new Label( "", textOffs, CLASSMENU_WINDOW_NAME_Y ); + pNameLabel->setFont( pSchemes->getFont(hTitleScheme) ); + pNameLabel->setParent( m_pClassInfoPanel[i] ); + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + pNameLabel->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + pNameLabel->setBgColor( r, g, b, a ); + pNameLabel->setContentAlignment( vgui::Label::a_west ); + //pNameLabel->setBorder(new LineBorder()); + pNameLabel->setText(localName); + + // Create the Class Image + if ( bShowClassGraphic ) + { + for ( int team = 0; team < 2; team++ ) + { + if ( team == 1 ) + { + sprintf( sz, "%sred", sTFClassSelection[i] ); + } + else + { + sprintf( sz, "%sblue", sTFClassSelection[i] ); + } + + m_pClassImages[team][i] = new CImageLabel( sz, 0, 0, CLASSMENU_WINDOW_TEXT_X, CLASSMENU_WINDOW_TEXT_Y ); + + CImageLabel *pLabel = m_pClassImages[team][i]; + pLabel->setParent( m_pClassInfoPanel[i] ); + //pLabel->setBorder(new LineBorder()); + + if ( team != 1 ) + { + pLabel->setVisible( false ); + } + + // Reposition it based upon it's size + int xOut, yOut; + pNameLabel->getTextSize( xOut, yOut ); + pLabel->setPos( (CLASSMENU_WINDOW_TEXT_X - pLabel->getWide()) / 2, yOut /2 ); + } + } + + // Create the Player count string + gHUD.m_TextMessage.LocaliseTextString( "#Title_CurrentlyOnYourTeam", m_sPlayersOnTeamString, STRLENMAX_PLAYERSONTEAM ); + m_pPlayers[i] = new Label( "", textOffs, CLASSMENU_WINDOW_PLAYERS_Y ); + m_pPlayers[i]->setParent( m_pClassInfoPanel[i] ); + m_pPlayers[i]->setBgColor( 0, 0, 0, 255 ); + m_pPlayers[i]->setContentAlignment( vgui::Label::a_west ); + m_pPlayers[i]->setFont( pSchemes->getFont(hClassWindowText) ); + + // Open up the Class Briefing File + sprintf(sz, "classes/short_%s.txt", sTFClassSelection[i]); + char *cText = "Class Description not available."; + char *pfile = (char *)gEngfuncs.COM_LoadFile( sz, 5, NULL ); + if (pfile) + { + cText = pfile; + } + + // Create the Text info window + TextPanel *pTextWindow = new TextPanel(cText, textOffs, CLASSMENU_WINDOW_TEXT_Y, (CLASSMENU_WINDOW_SIZE_X - textOffs)-5, CLASSMENU_WINDOW_SIZE_Y - CLASSMENU_WINDOW_TEXT_Y); + pTextWindow->setParent( m_pClassInfoPanel[i] ); + pTextWindow->setFont( pSchemes->getFont(hClassWindowText) ); + pSchemes->getFgColor( hClassWindowText, r, g, b, a ); + pTextWindow->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hClassWindowText, r, g, b, a ); + pTextWindow->setBgColor( r, g, b, a ); + + // Resize the Info panel to fit it all + int wide,tall; + pTextWindow->getTextImage()->getTextSizeWrapped( wide,tall); + pTextWindow->setSize(wide,tall); + + int xx,yy; + pTextWindow->getPos(xx,yy); + int maxX=xx+wide; + int maxY=yy+tall; + + //check to see if the image goes lower than the text + //just use the red teams [0] images + if(m_pClassImages[0][i]!=null) + { + m_pClassImages[0][i]->getPos(xx,yy); + if((yy+m_pClassImages[0][i]->getTall())>maxY) + { + maxY=yy+m_pClassImages[0][i]->getTall(); + } + } + + m_pClassInfoPanel[i]->setSize( maxX , maxY ); + if (pfile) gEngfuncs.COM_FreeFile( pfile ); + //m_pClassInfoPanel[i]->setBorder(new LineBorder()); + + } + + // Create the Cancel button + m_pCancelButton = new CommandButton( gHUD.m_TextMessage.BufferedLocaliseTextString( "#Menu_Cancel" ), CLASSMENU_TOPLEFT_BUTTON_X, 0, CLASSMENU_BUTTON_SIZE_X, CLASSMENU_BUTTON_SIZE_Y); + m_pCancelButton->setParent( this ); + m_pCancelButton->addActionSignal( new CMenuHandler_TextWindow(HIDE_TEXTWINDOW) ); + + m_iCurrentInfo = 0; + +} + + +// Update +void CClassMenuPanel::Update() +{ + // Don't allow the player to join a team if they're not in a team + if (!g_iTeamNumber) + return; + + int iYPos = CLASSMENU_TOPLEFT_BUTTON_Y; + + // Cycle through the rest of the buttons + for (int i = 0; i <= PC_RANDOM; i++) + { + bool bCivilian = (gViewPort->GetValidClasses(g_iTeamNumber) == -1); + + if ( bCivilian ) + { + // If this team can only be civilians, only the civilian button's visible + if (i == 0) + { + m_pButtons[0]->setVisible( true ); + SetActiveInfo( 0 ); + iYPos += CLASSMENU_BUTTON_SIZE_Y + CLASSMENU_BUTTON_SPACER_Y; + } + else + { + m_pButtons[i]->setVisible( false ); + } + } + else + { + if ( m_pButtons[i]->IsNotValid() || i == 0 ) + { + m_pButtons[i]->setVisible( false ); + } + else + { + m_pButtons[i]->setVisible( true ); + m_pButtons[i]->setPos( CLASSMENU_TOPLEFT_BUTTON_X, iYPos ); + iYPos += CLASSMENU_BUTTON_SIZE_Y + CLASSMENU_BUTTON_SPACER_Y; + + // Start with the first option up + if (!m_iCurrentInfo) + SetActiveInfo( i ); + } + } + + // Now count the number of teammembers of this class + int iTotal = 0; + for ( int j = 1; j <= MAX_PLAYERS; j++ ) + { + if ( g_PlayerInfoList[j].name == NULL ) + continue; // empty player slot, skip + if ( g_PlayerExtraInfo[j].teamname[0] == 0 ) + continue; // skip over players who are not in a team + if ( g_PlayerInfoList[j].thisplayer ) + continue; // skip this player + if ( g_PlayerExtraInfo[j].teamnumber != g_iTeamNumber ) + continue; // skip over players in other teams + + // If this team is forced to be civilians, just count the number of teammates + if ( g_PlayerExtraInfo[j].playerclass != i && !bCivilian ) + continue; + + iTotal++; + } + + char sz[256]; + sprintf(sz, m_sPlayersOnTeamString, iTotal); + m_pPlayers[i]->setText( sz ); + + // Set the text color to the teamcolor + m_pPlayers[i]->setFgColor( kTeamColors[g_iTeamNumber % iNumberOfTeamColors][0], + kTeamColors[g_iTeamNumber % iNumberOfTeamColors][1], + kTeamColors[g_iTeamNumber % iNumberOfTeamColors][2], + 0 ); + + // set the graphic to be the team pick + for ( int team = 0; team < MAX_TEAMS; team++ ) + { + // unset all the other images + if ( m_pClassImages[team][i] ) + { + m_pClassImages[team][i]->setVisible( false ); + } + + // set the current team image + if ( m_pClassImages[g_iTeamNumber-1][i] != NULL ) + { + m_pClassImages[g_iTeamNumber-1][i]->setVisible( true ); + } + else if ( m_pClassImages[0][i] ) + { + m_pClassImages[0][i]->setVisible( true ); + } + } + } + + // If the player already has a class, make the cancel button visible + if ( g_iPlayerClass ) + { + m_pCancelButton->setPos( CLASSMENU_TOPLEFT_BUTTON_X, iYPos ); + m_pCancelButton->setVisible( true ); + } + else + { + m_pCancelButton->setVisible( false ); + } +} + +//====================================== +// Key inputs for the Class Menu +bool CClassMenuPanel::SlotInput( int iSlot ) +{ + if ( (iSlot < 0) || (iSlot > 9) ) + return false; + if ( !m_pButtons[ iSlot ] ) + return false; + + // Is the button pushable? (0 is special case) + if (iSlot == 0) + { + // Selects Civilian and RandomPC + if ( gViewPort->GetValidClasses(g_iTeamNumber) == -1 ) + { + m_pButtons[ 0 ]->fireActionSignal(); + return true; + } + + // Select RandomPC + iSlot = 10; + } + + if ( !(m_pButtons[ iSlot ]->IsNotValid()) ) + { + m_pButtons[ iSlot ]->fireActionSignal(); + return true; + } + + return false; +} + +//====================================== +// Update the Class menu before opening it +void CClassMenuPanel::Open( void ) +{ + Update(); + CMenuPanel::Open(); +} + +//----------------------------------------------------------------------------- +// Purpose: Called each time a new level is started. +//----------------------------------------------------------------------------- +void CClassMenuPanel::Initialize( void ) +{ + setVisible( false ); + m_pScrollPanel->setScrollValue( 0, 0 ); +} + +//====================================== +// Mouse is over a class button, bring up the class info +void CClassMenuPanel::SetActiveInfo( int iInput ) +{ + // Remove all the Info panels and bring up the specified one + for (int i = 0; i <= PC_RANDOM; i++) + { + m_pButtons[i]->setArmed( false ); + m_pClassInfoPanel[i]->setVisible( false ); + } + + if ( iInput > PC_RANDOM || iInput < 0 ) + iInput = 0; + + m_pButtons[iInput]->setArmed( true ); + m_pClassInfoPanel[iInput]->setVisible( true ); + m_iCurrentInfo = iInput; + + m_pScrollPanel->setScrollValue(0,0); + m_pScrollPanel->validate(); +} + diff --git a/main/source/cl_dll/vgui_ConsolePanel.cpp b/main/source/cl_dll/vgui_ConsolePanel.cpp new file mode 100644 index 00000000..bb8f9cff --- /dev/null +++ b/main/source/cl_dll/vgui_ConsolePanel.cpp @@ -0,0 +1,95 @@ + +#include"vgui_ConsolePanel.h" +#include"hud.h" +#include +#include +#include +#include +#include + +using namespace vgui; + + +namespace +{ + +class Handler : public ActionSignal +{ +private: + + ConsolePanel* _consolePanel; + +public: + + Handler(ConsolePanel* consolePanel) + { + _consolePanel=consolePanel; + } + +public: + + virtual void actionPerformed(Panel* panel) + { + _consolePanel->doExecCommand(); + } + +}; + +} + + + +ConsolePanel::ConsolePanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) +{ + setBorder(new EtchedBorder()); + + _textGrid=new TextGrid(80,21,5,5,200,100); + _textGrid->setBorder(new LoweredBorder()); + _textGrid->setParent(this); + + _textEntry=new TextEntry("",5,5,200,20); + _textEntry->setParent(this); + _textEntry->addActionSignal(new Handler(this)); +} + +int ConsolePanel::print(const char* text) +{ + return _textGrid->printf("%s",text); +} + +int ConsolePanel::vprintf(const char* format,va_list argList) +{ + return _textGrid->vprintf(format,argList); +} + +int ConsolePanel::printf(const char* format,...) +{ + va_list argList; + va_start(argList,format); + int ret=vprintf(format,argList); + va_end(argList); + return ret; +} + +void ConsolePanel::doExecCommand() +{ + char buf[2048]; + _textEntry->getText(0,buf,2048); + _textEntry->setText(null,0); + gEngfuncs.pfnClientCmd(buf); +} + +void ConsolePanel::setSize(int wide,int tall) +{ + Panel::setSize(wide,tall); + + getPaintSize(wide,tall); + + _textGrid->setBounds(5,5,wide-10,tall-35); + _textEntry->setBounds(5,tall-25,wide-10,20); +} + + + + + diff --git a/main/source/cl_dll/vgui_ConsolePanel.h b/main/source/cl_dll/vgui_ConsolePanel.h new file mode 100644 index 00000000..8edfc035 --- /dev/null +++ b/main/source/cl_dll/vgui_ConsolePanel.h @@ -0,0 +1,32 @@ + +#ifndef CONSOLEPANEL_H +#define CONSOLEPANEL_H + +#include +#include + +namespace vgui +{ +class TextGrid; +class TextEntry; +} + + +class ConsolePanel : public vgui::Panel +{ +private: + vgui::TextGrid* _textGrid; + vgui::TextEntry* _textEntry; +public: + ConsolePanel(int x,int y,int wide,int tall); +public: + virtual void setSize(int wide,int tall); + virtual int print(const char* text); + virtual int vprintf(const char* format,va_list argList); + virtual int printf(const char* format,...); + virtual void doExecCommand(); +}; + + + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/vgui_ControlConfigPanel.cpp b/main/source/cl_dll/vgui_ControlConfigPanel.cpp new file mode 100644 index 00000000..2abe1fb2 --- /dev/null +++ b/main/source/cl_dll/vgui_ControlConfigPanel.cpp @@ -0,0 +1,206 @@ + +#include +#include"vgui_ControlConfigPanel.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace vgui; + +namespace +{ +class FooTablePanel : public TablePanel +{ +private: + Label* _label; + TextEntry* _textEntry; + ControlConfigPanel* _controlConfigPanel; +public: + FooTablePanel(ControlConfigPanel* controlConfigPanel,int x,int y,int wide,int tall,int columnCount) : TablePanel(x,y,wide,tall,columnCount) + { + _controlConfigPanel=controlConfigPanel; + _label=new Label("You are a dumb monkey",0,0,100,20); + _label->setBgColor(Scheme::sc_primary3); + _label->setFgColor(Scheme::sc_primary1); + _label->setFont(Scheme::sf_primary3); + + _textEntry=new TextEntry("",0,0,100,20); + //_textEntry->setFont(Scheme::sf_primary3); + } +public: + virtual int getRowCount() + { + return _controlConfigPanel->GetCVarCount(); + } + virtual int getCellTall(int row) + { + return 12; + } + virtual Panel* getCellRenderer(int column,int row,bool columnSelected,bool rowSelected,bool cellSelected) + { + char cvar[128],desc[128],bind[128],bindAlt[128]; + _controlConfigPanel->GetCVar(row,cvar,128,desc,128); + + if(cellSelected) + { + _label->setBgColor(Scheme::sc_primary1); + _label->setFgColor(Scheme::sc_primary3); + } + else + if(rowSelected) + { + _label->setBgColor(Scheme::sc_primary2); + _label->setFgColor(Scheme::sc_primary1); + } + else + { + _label->setBgColor(Scheme::sc_primary3); + _label->setFgColor(Scheme::sc_primary1); + } + + switch(column) + { + case 0: + { + _label->setText(desc); + _label->setContentAlignment(Label::a_west); + break; + } + case 1: + { + _controlConfigPanel->GetCVarBind(cvar,bind,128,bindAlt,128); + _label->setText(bind); + _label->setContentAlignment(Label::a_center); + break; + } + case 2: + { + _controlConfigPanel->GetCVarBind(cvar,bind,128,bindAlt,128); + _label->setText(bindAlt); + _label->setContentAlignment(Label::a_center); + break; + } + default: + { + _label->setText(""); + break; + } + } + + return _label; + } + virtual Panel* startCellEditing(int column,int row) + { + _textEntry->setText("Goat",strlen("Goat")); + _textEntry->requestFocus(); + return _textEntry; + } +}; +} + +ControlConfigPanel::ControlConfigPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) +{ + setPaintBorderEnabled(false); + setPaintBackgroundEnabled(false); + setPaintEnabled(false); + + _actionLabel=new Label("Action"); + _actionLabel->setBgColor(Scheme::sc_primary3); + _actionLabel->setFgColor(Scheme::sc_primary3); + + _keyButtonLabel=new Label("Key / Button"); + _keyButtonLabel->setBgColor(Scheme::sc_primary3); + _keyButtonLabel->setFgColor(Scheme::sc_primary3); + + _alternateLabel=new Label("Alternate"); + _alternateLabel->setBgColor(Scheme::sc_primary3); + _alternateLabel->setFgColor(Scheme::sc_primary3); + + _headerPanel=new HeaderPanel(0,0,wide,20); + _headerPanel->setParent(this); + + _headerPanel->addSectionPanel(_actionLabel); + _headerPanel->addSectionPanel(_keyButtonLabel); + _headerPanel->addSectionPanel(_alternateLabel); + + _headerPanel->setSliderPos( 0, wide/2 ); + _headerPanel->setSliderPos( 1, (wide/2) + (wide/4) ); + _headerPanel->setSliderPos( 2, wide ); + + _scrollPanel=new ScrollPanel(0,20,wide,tall-20); + _scrollPanel->setParent(this); + _scrollPanel->setPaintBorderEnabled(false); + _scrollPanel->setPaintBackgroundEnabled(false); + _scrollPanel->setPaintEnabled(false); + _scrollPanel->getClient()->setPaintBorderEnabled(false); + _scrollPanel->getClient()->setPaintBackgroundEnabled(false); + _scrollPanel->getClient()->setPaintEnabled(false); + _scrollPanel->setScrollBarVisible(false,true); + + _tablePanel=new FooTablePanel(this,0,0,_scrollPanel->getClient()->getWide(),800, 3); + _tablePanel->setParent(_scrollPanel->getClient()); + _tablePanel->setHeaderPanel(_headerPanel); + _tablePanel->setBgColor(Color(200,0,0,255)); + _tablePanel->setFgColor(Color(Scheme::sc_primary2)); + _tablePanel->setGridVisible(true,true); + _tablePanel->setGridSize(1,1); +} + +void ControlConfigPanel::AddCVar(const char* cvar,const char* desc) +{ + _cvarDar.addElement(vgui_strdup(cvar)); + _descDar.addElement(vgui_strdup(desc)); +} + +int ControlConfigPanel::GetCVarCount() +{ + return _cvarDar.getCount(); +} + +void ControlConfigPanel::GetCVar(int index,char* cvar,int cvarLen,char* desc,int descLen) +{ + vgui_strcpy(cvar,cvarLen,_cvarDar[index]); + vgui_strcpy(desc,descLen,_descDar[index]); +} + +void ControlConfigPanel::AddCVarFromInputStream(InputStream* is) +{ + if(is==null) + { + return; + } + + DataInputStream dis(is); + + bool success; + + while(1) + { + char buf[256],cvar[128],desc[128]; + dis.readLine(buf,256,success); + if(!success) + { + break; + } + if(sscanf(buf,"\"%[^\"]\" \"%[^\"]\"",cvar,desc)==2) + { + AddCVar(cvar,desc); + } + } +} + +void ControlConfigPanel::GetCVarBind(const char* cvar,char* bind,int bindLen,char* bindAlt,int bindAltLen) +{ + sprintf(bind,"%s : Bind",cvar); + sprintf(bindAlt,"%s : BindAlt",cvar); +} + +void ControlConfigPanel::SetCVarBind(const char* cvar,const char* bind,const char* bindAlt) +{ +} + diff --git a/main/source/cl_dll/vgui_ControlConfigPanel.h b/main/source/cl_dll/vgui_ControlConfigPanel.h new file mode 100644 index 00000000..9a5a41f5 --- /dev/null +++ b/main/source/cl_dll/vgui_ControlConfigPanel.h @@ -0,0 +1,41 @@ + +#ifndef CONTROLCONFIGPANEL_H +#define CONTROLCONFIGPANEL_H + +#include +#include + +namespace vgui +{ +class HeaderPanel; +class TablePanel; +class ScrollPanel; +class InputStream; +class Label; +} + +class ControlConfigPanel : public vgui::Panel +{ +private: + vgui::HeaderPanel* _headerPanel; + vgui::TablePanel* _tablePanel; + vgui::ScrollPanel* _scrollPanel; + vgui::Dar _cvarDar; + vgui::Dar _descDar; + vgui::Label* _actionLabel; + vgui::Label* _keyButtonLabel; + vgui::Label* _alternateLabel; +public: + ControlConfigPanel(int x,int y,int wide,int tall); +public: + void AddCVar(const char* cvar,const char* desc); + void AddCVarFromInputStream(vgui::InputStream* is); + int GetCVarCount(); + void GetCVar(int index,char* cvar,int cvarLen,char* desc,int descLen); + void GetCVarBind(const char* cvar,char* bind,int bindLen,char* bindAlt,int bindAltLen); + void SetCVarBind(const char* cvar,const char* bind,const char* bindAlt); +}; + + + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/vgui_CustomObjects.cpp b/main/source/cl_dll/vgui_CustomObjects.cpp new file mode 100644 index 00000000..4f834569 --- /dev/null +++ b/main/source/cl_dll/vgui_CustomObjects.cpp @@ -0,0 +1,540 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: Contains implementation of various VGUI-derived objects +// +// $Workfile: $ +// $Date: 2001/09/13 22:28:00 $ +// +//----------------------------------------------------------------------------- +// $Log: vgui_CustomObjects.cpp,v $ +// Revision 1.2 2001/09/13 22:28:00 Charlie +// - Updated NS with new Half-life 1108 patch in preparation for voice support and spectator mode +// +// Revision 1.1.1.1.2.1 2001/09/13 14:42:29 Charlie +// - HL1108 +// +// +// $NoKeywords: $ +//============================================================================= + +#include "VGUI_Font.h" + +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "parsemsg.h" + +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_ServerBrowser.h" +#include "..\game_shared\vgui_LoadTGA.h" + +// Arrow filenames +char *sArrowFilenames[] = +{ + "arrowup", + "arrowdn", + "arrowlt", + "arrowrt", +}; + +// Get the name of TGA file, without a gamedir +char *GetTGANameForRes(const char *pszName) +{ + int i; + char sz[256]; + static char gd[256]; + if (ScreenWidth() < 640) + i = 320; + else + i = 640; + sprintf(sz, pszName, i); + sprintf(gd, "gfx/vgui/%s.tga", sz); + return gd; +} + +//----------------------------------------------------------------------------- +// Purpose: Loads a .tga file and returns a pointer to the VGUI tga object +//----------------------------------------------------------------------------- +BitmapTGA *LoadTGAForRes( const char* pImageName ) +{ + BitmapTGA *pTGA; + + char sz[256]; + sprintf(sz, "%%d_%s", pImageName); + pTGA = vgui_LoadTGA(GetTGANameForRes(sz)); + + return pTGA; +} + +//=========================================================== +// All TFC Hud buttons are derived from this one. +CommandButton::CommandButton( const char* text,int x,int y,int wide,int tall, bool bNoHighlight) : Button("",x,y,wide,tall) +{ + m_iPlayerClass = 0; + m_bNoHighlight = bNoHighlight; + m_bFlat = false; + Init(); + setText( text ); +} + +CommandButton::CommandButton( int iPlayerClass, const char* text,int x,int y,int wide,int tall, bool bFlat) : Button("",x,y,wide,tall) +{ + m_iPlayerClass = iPlayerClass; + m_bNoHighlight = false; + m_bFlat = bFlat; + Init(); + setText( text ); +} +CommandButton::CommandButton(const char *text, int x, int y, int wide, int tall, bool bNoHighlight, bool bFlat) : Button("",x,y,wide,tall) +{ + m_iPlayerClass = 0; + m_bFlat = bFlat; + m_bNoHighlight = bNoHighlight; + Init(); + setText( text ); +} + +void CommandButton::Init( void ) +{ + m_pSubMenu = NULL; + m_pSubLabel = NULL; + m_pParentMenu = NULL; + + // Set text color to orange + setFgColor(Scheme::sc_primary1); + + // left align + setContentAlignment( vgui::Label::a_west ); + + // Add the Highlight signal + if (!m_bNoHighlight) + addInputSignal( new CHandler_CommandButtonHighlight(this) ); + + // not bound to any button yet + m_cBoundKey = 0; +} + +//----------------------------------------------------------------------------- +// Purpose: Prepends the button text with the current bound key +// if no bound key, then a clear space ' ' instead +//----------------------------------------------------------------------------- +void CommandButton::RecalculateText( void ) +{ + char szBuf[128]; + + if ( m_cBoundKey != 0 ) + { + if ( m_cBoundKey == (char)255 ) + { + strcpy( szBuf, m_sMainText ); + } + else + { + sprintf( szBuf, " %c %s", m_cBoundKey, m_sMainText ); + } + szBuf[MAX_BUTTON_SIZE-1] = 0; + } + else + { + // just draw a space if no key bound + sprintf( szBuf, " %s", m_sMainText ); + szBuf[MAX_BUTTON_SIZE-1] = 0; + } + + Button::setText( szBuf ); +} + +void CommandButton::setText( const char *text ) +{ + strncpy( m_sMainText, text, MAX_BUTTON_SIZE ); + m_sMainText[MAX_BUTTON_SIZE-1] = 0; + + RecalculateText(); +} + +void CommandButton::setBoundKey( char boundKey ) +{ + m_cBoundKey = boundKey; + RecalculateText(); +} + +char CommandButton::getBoundKey( void ) +{ + return m_cBoundKey; +} + +void CommandButton::AddSubMenu( CCommandMenu *pNewMenu ) +{ + m_pSubMenu = pNewMenu; + + // Prevent this button from being pushed + setMouseClickEnabled( MOUSE_LEFT, false ); +} + +void CommandButton::UpdateSubMenus( int iAdjustment ) +{ + if ( m_pSubMenu ) + m_pSubMenu->RecalculatePositions( iAdjustment ); +} + +void CommandButton::paint() +{ + // Make the sub label paint the same as the button + if ( m_pSubLabel ) + { + if ( isSelected() ) + m_pSubLabel->PushDown(); + else + m_pSubLabel->PushUp(); + } + + // draw armed button text in white + if ( isArmed() ) + { + setFgColor( Scheme::sc_secondary2 ); + } + else + { + setFgColor( Scheme::sc_primary1 ); + } + + Button::paint(); +} + +void CommandButton::paintBackground() +{ + if ( m_bFlat ) + { + if ( isArmed() ) + { + // Orange Border + drawSetColor( Scheme::sc_secondary1 ); + drawOutlinedRect(0,0,_size[0],_size[1]); + } + } + else + { + if ( isArmed() ) + { + // Orange highlight background + drawSetColor( Scheme::sc_primary2 ); + drawFilledRect(0,0,_size[0],_size[1]); + } + + // Orange Border + drawSetColor( Scheme::sc_secondary1 ); + drawOutlinedRect(0,0,_size[0],_size[1]); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Highlights the current button, and all it's parent menus +//----------------------------------------------------------------------------- +void CommandButton::cursorEntered( void ) +{ + // unarm all the other buttons in this menu + CCommandMenu *containingMenu = getParentMenu(); + if ( containingMenu ) + { + containingMenu->ClearButtonsOfArmedState(); + + // make all our higher buttons armed + CCommandMenu *pCParent = containingMenu->GetParentMenu(); + if ( pCParent ) + { + CommandButton *pParentButton = pCParent->FindButtonWithSubmenu( containingMenu ); + + pParentButton->cursorEntered(); + } + } + + // arm ourselves + setArmed( true ); +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CommandButton::cursorExited( void ) +{ + // only clear ourselves if we have do not have a containing menu + // only stay armed if we have a sub menu + // the buttons only unarm themselves when another button is armed instead + if ( !getParentMenu() || !GetSubMenu() ) + { + setArmed( false ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Returns the command menu that the button is part of, if any +// Output : CCommandMenu * +//----------------------------------------------------------------------------- +CCommandMenu *CommandButton::getParentMenu( void ) +{ + return m_pParentMenu; +} + +//----------------------------------------------------------------------------- +// Purpose: Sets the menu that contains this button +// Input : *pParentMenu - +//----------------------------------------------------------------------------- +void CommandButton::setParentMenu( CCommandMenu *pParentMenu ) +{ + m_pParentMenu = pParentMenu; +} + + +//=========================================================== +int ClassButton::IsNotValid() +{ + // If this is the main ChangeClass button, remove it if the player's only able to be civilians + if ( m_iPlayerClass == -1 ) + { + if (gViewPort->GetValidClasses(g_iTeamNumber) == -1) + return true; + + return false; + } + + // Is it an illegal class? + if ((gViewPort->GetValidClasses(0) & sTFValidClassInts[ m_iPlayerClass ]) || (gViewPort->GetValidClasses(g_iTeamNumber) & sTFValidClassInts[ m_iPlayerClass ])) + return true; + + // Only check current class if they've got autokill on + bool bAutoKill = CVAR_GET_FLOAT( "hud_classautokill" ) != 0; + if ( bAutoKill ) + { + // Is it the player's current class? + if ( (gViewPort->IsRandomPC() && m_iPlayerClass == PC_RANDOM) || (!gViewPort->IsRandomPC() && (m_iPlayerClass == g_iPlayerClass)) ) + return true; + } + + return false; +} + +//=========================================================== +// Button with Class image beneath it +CImageLabel::CImageLabel( const char* pImageName,int x,int y ) : Label( "", x,y ) +{ + setContentFitted(true); + m_pTGA = LoadTGAForRes(pImageName); + setImage( m_pTGA ); +} + +CImageLabel::CImageLabel( const char* pImageName,int x,int y,int wide,int tall ) : Label( "", x,y,wide,tall ) +{ + setContentFitted(true); + m_pTGA = LoadTGAForRes(pImageName); + setImage( m_pTGA ); +} + +//=========================================================== +// Image size +int CImageLabel::getImageWide( void ) +{ + if( m_pTGA ) + { + int iXSize, iYSize; + m_pTGA->getSize( iXSize, iYSize ); + return iXSize; + } + else + { + return 1; + } +} + +int CImageLabel::getImageTall( void ) +{ + if( m_pTGA ) + { + int iXSize, iYSize; + m_pTGA->getSize( iXSize, iYSize ); + return iYSize; + } + else + { + return 1; + } +} + +void CImageLabel::LoadImage(const char * pImageName) +{ + if ( m_pTGA ) + delete m_pTGA; + + // Load the Image + m_pTGA = LoadTGAForRes(pImageName); + + if ( m_pTGA == NULL ) + { + // we didn't find a matching image file for this resolution + // try to load file resolution independent + + char sz[256]; + sprintf(sz, "%s/%s",gEngfuncs.pfnGetGameDirectory(), pImageName ); + FileInputStream* fis = new FileInputStream( sz, false ); + m_pTGA = new BitmapTGA(fis,true); + fis->close(); + } + + if ( m_pTGA == NULL ) + return; // unable to load image + + int w,t; + + m_pTGA->getSize( w, t ); + + setSize( XRES (w),YRES (t) ); + setImage( m_pTGA ); +} +//=========================================================== +// Various overloaded paint functions for Custom VGUI objects +void CCommandMenu::paintBackground() +{ + // Transparent black background + + if ( m_iSpectCmdMenu ) + drawSetColor( 0, 0, 0, 64 ); + else + drawSetColor(Scheme::sc_primary3); + + drawFilledRect(0,0,_size[0],_size[1]); +} + +//================================================================================= +// CUSTOM SCROLLPANEL +//================================================================================= +CTFScrollButton::CTFScrollButton(int iArrow, const char* text,int x,int y,int wide,int tall) : CommandButton(text,x,y,wide,tall) +{ + // Set text color to orange + setFgColor(Scheme::sc_primary1); + + // Load in the arrow + m_pTGA = LoadTGAForRes( sArrowFilenames[iArrow] ); + setImage( m_pTGA ); + + // Highlight signal + InputSignal *pISignal = new CHandler_CommandButtonHighlight(this); + addInputSignal(pISignal); +} + +void CTFScrollButton::paint( void ) +{ + if (!m_pTGA) + return; + + // draw armed button text in white + if ( isArmed() ) + { + m_pTGA->setColor( Color(255,255,255, 0) ); + } + else + { + m_pTGA->setColor( Color(255,255,255, 128) ); + } + + m_pTGA->doPaint(this); +} + +void CTFScrollButton::paintBackground( void ) +{ +/* + if ( isArmed() ) + { + // Orange highlight background + drawSetColor( Scheme::sc_primary2 ); + drawFilledRect(0,0,_size[0],_size[1]); + } + + // Orange Border + drawSetColor( Scheme::sc_secondary1 ); + drawOutlinedRect(0,0,_size[0]-1,_size[1]); +*/ +} + +void CTFSlider::paintBackground( void ) +{ + int wide,tall,nobx,noby; + getPaintSize(wide,tall); + getNobPos(nobx,noby); + + // Border + drawSetColor( Scheme::sc_secondary1 ); + drawOutlinedRect( 0,0,wide,tall ); + + if( isVertical() ) + { + // Nob Fill + drawSetColor( Scheme::sc_primary2 ); + drawFilledRect( 0,nobx,wide,noby ); + + // Nob Outline + drawSetColor( Scheme::sc_primary1 ); + drawOutlinedRect( 0,nobx,wide,noby ); + } + else + { + // Nob Fill + drawSetColor( Scheme::sc_primary2 ); + drawFilledRect( nobx,0,noby,tall ); + + // Nob Outline + drawSetColor( Scheme::sc_primary1 ); + drawOutlinedRect( nobx,0,noby,tall ); + } +} + +CTFScrollPanel::CTFScrollPanel(int x,int y,int wide,int tall) : ScrollPanel(x,y,wide,tall) +{ + ScrollBar *pScrollBar = getVerticalScrollBar(); + pScrollBar->setButton( new CTFScrollButton( ARROW_UP, "", 0,0,16,16 ), 0 ); + pScrollBar->setButton( new CTFScrollButton( ARROW_DOWN, "", 0,0,16,16 ), 1 ); + pScrollBar->setSlider( new CTFSlider(0,wide-1,wide,(tall-(wide*2))+2,true) ); + pScrollBar->setPaintBorderEnabled(false); + pScrollBar->setPaintBackgroundEnabled(false); + pScrollBar->setPaintEnabled(false); + + pScrollBar = getHorizontalScrollBar(); + pScrollBar->setButton( new CTFScrollButton( ARROW_LEFT, "", 0,0,16,16 ), 0 ); + pScrollBar->setButton( new CTFScrollButton( ARROW_RIGHT, "", 0,0,16,16 ), 1 ); + pScrollBar->setSlider( new CTFSlider(tall,0,wide-(tall*2),tall,false) ); + pScrollBar->setPaintBorderEnabled(false); + pScrollBar->setPaintBackgroundEnabled(false); + pScrollBar->setPaintEnabled(false); +} + + +//================================================================================= +// CUSTOM HANDLERS +//================================================================================= +void CHandler_MenuButtonOver::cursorEntered(Panel *panel) +{ + if ( gViewPort && m_pMenuPanel ) + { + m_pMenuPanel->SetActiveInfo( m_iButton ); + } +} + +void CMenuHandler_StringCommandClassSelect::actionPerformed(Panel* panel) +{ + CMenuHandler_StringCommand::actionPerformed( panel ); + + bool bAutoKill = CVAR_GET_FLOAT( "hud_classautokill" ) != 0; + if ( bAutoKill && g_iPlayerClass != 0 ) + gEngfuncs.pfnClientCmd("kill"); +} + diff --git a/main/source/cl_dll/vgui_MOTDWindow.cpp b/main/source/cl_dll/vgui_MOTDWindow.cpp new file mode 100644 index 00000000..6bd550b6 --- /dev/null +++ b/main/source/cl_dll/vgui_MOTDWindow.cpp @@ -0,0 +1,168 @@ +//=========== (C) Copyright 1999 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: +// +// $Workfile: $ +// $Date: 2001/09/13 22:28:00 $ +// +//----------------------------------------------------------------------------- +// $Log: vgui_MOTDWindow.cpp,v $ +// Revision 1.3 2001/09/13 22:28:00 Charlie +// - Updated NS with new Half-life 1108 patch in preparation for voice support and spectator mode +// +// Revision 1.2 2001/04/09 19:31:35 charlie +// - Quick hacky tests to try out menus for team/class picking...yuck +// Revision 1.1.1.1.2.1 2001/09/13 14:42:29 Charlie +// - HL1108 +// +// Revision 1.1.1.1 2000/06/17 14:12:45 charlie +// Final version of new HL SDK. May not compile. +// Previous versions of my MSVC project files and utility .bat files. +// This is my starting point; there is no mod-specific code in here. +// +// +// $NoKeywords: $ +//============================================================================= + +#include "VGUI_Font.h" +#include "VGUI_ScrollPanel.h" +#include "VGUI_TextImage.h" + +#include + +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "const.h" + +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_ServerBrowser.h" + +#define MOTD_TITLE_X XRES(16) +#define MOTD_TITLE_Y YRES(16) + +#define MOTD_WINDOW_X XRES(112) +#define MOTD_WINDOW_Y YRES(80) +#define MOTD_WINDOW_SIZE_X XRES(424) +#define MOTD_WINDOW_SIZE_Y YRES(312) + +//----------------------------------------------------------------------------- +// Purpose: Displays the MOTD and basic server information +//----------------------------------------------------------------------------- +class CMessageWindowPanel : public CMenuPanel +{ +public: + CMessageWindowPanel( const char *szMOTD, const char *szTitle, int iShadeFullScreen, int iRemoveMe, int x, int y, int wide, int tall ); + +private: + CTransparentPanel *m_pBackgroundPanel; + +}; + +//----------------------------------------------------------------------------- +// Purpose: Creates a new CMessageWindowPanel +// Output : CMenuPanel - interface to the panel +//----------------------------------------------------------------------------- +CMenuPanel *CMessageWindowPanel_Create( const char *szMOTD, const char *szTitle, int iShadeFullscreen, int iRemoveMe, int x, int y, int wide, int tall ) +{ + return new CMessageWindowPanel( szMOTD, szTitle, iShadeFullscreen, iRemoveMe, x, y, wide, tall ); +} + +//----------------------------------------------------------------------------- +// Purpose: Constructs a message panel +//----------------------------------------------------------------------------- +CMessageWindowPanel::CMessageWindowPanel( const char *szMOTD, const char *szTitle, int iShadeFullscreen, int iRemoveMe, int x, int y, int wide, int tall ) : CMenuPanel( iShadeFullscreen ? 100 : 255, iRemoveMe, x, y, wide, tall ) +{ + // Get the scheme used for the Titles + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + + // schemes + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" ); + SchemeHandle_t hMOTDText = pSchemes->getSchemeHandle( "Briefing Text" ); + + // color schemes + int r, g, b, a; + + // Create the window + m_pBackgroundPanel = new CTransparentPanel( iShadeFullscreen ? 255 : 100, MOTD_WINDOW_X, MOTD_WINDOW_Y, MOTD_WINDOW_SIZE_X, MOTD_WINDOW_SIZE_Y ); + m_pBackgroundPanel->setParent( this ); + m_pBackgroundPanel->setBorder( new LineBorder( Color(255 * 0.7,170 * 0.7,0,0)) ); + m_pBackgroundPanel->setVisible( true ); + + int iXSize,iYSize,iXPos,iYPos; + m_pBackgroundPanel->getPos( iXPos,iYPos ); + m_pBackgroundPanel->getSize( iXSize,iYSize ); + + // Create the title + Label *pLabel = new Label( "", iXPos + MOTD_TITLE_X, iYPos + MOTD_TITLE_Y ); + pLabel->setParent( this ); + pLabel->setFont( pSchemes->getFont(hTitleScheme) ); + pLabel->setFont( Scheme::sf_primary1 ); + + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + pLabel->setFgColor( r, g, b, a ); + pLabel->setFgColor( Scheme::sc_primary1 ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + pLabel->setBgColor( r, g, b, a ); + pLabel->setContentAlignment( vgui::Label::a_west ); + pLabel->setText(szTitle); + + // Create the Scroll panel + ScrollPanel *pScrollPanel = new CTFScrollPanel( iXPos + XRES(16), iYPos + MOTD_TITLE_Y*2 + YRES(16), iXSize - XRES(32), iYSize - (YRES(48) + BUTTON_SIZE_Y*2) ); + pScrollPanel->setParent(this); + + //force the scrollbars on so clientClip will take them in account after the validate + pScrollPanel->setScrollBarAutoVisible(false, false); + pScrollPanel->setScrollBarVisible(true, true); + pScrollPanel->validate(); + + // Create the text panel + TextPanel *pText = new TextPanel( "", 0,0, 64,64); + pText->setParent( pScrollPanel->getClient() ); + + // get the font and colors from the scheme + pText->setFont( pSchemes->getFont(hMOTDText) ); + pSchemes->getFgColor( hMOTDText, r, g, b, a ); + pText->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hMOTDText, r, g, b, a ); + pText->setBgColor( r, g, b, a ); + pText->setText(szMOTD); + + // Get the total size of the MOTD text and resize the text panel + int iScrollSizeX, iScrollSizeY; + + // First, set the size so that the client's wdith is correct at least because the + // width is critical for getting the "wrapped" size right. + // You'll see a horizontal scroll bar if there is a single word that won't wrap in the + // specified width. + pText->getTextImage()->setSize(pScrollPanel->getClientClip()->getWide(), pScrollPanel->getClientClip()->getTall()); + pText->getTextImage()->getTextSizeWrapped( iScrollSizeX, iScrollSizeY ); + + // Now resize the textpanel to fit the scrolled size + pText->setSize( iScrollSizeX , iScrollSizeY ); + + //turn the scrollbars back into automode + pScrollPanel->setScrollBarAutoVisible(true, true); + pScrollPanel->setScrollBarVisible(false, false); + + pScrollPanel->validate(); + + CommandButton *pButton = new CommandButton( CHudTextMessage::BufferedLocaliseTextString( "#Menu_OK" ), iXPos + XRES(16), iYPos + iYSize - YRES(16) - BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_TextWindow(HIDE_TEXTWINDOW)); + pButton->addActionSignal(new CMenuHandler_TextWindow(SHOW_CLASSDESC)); + pButton->setParent(this); + +} + + + + + + diff --git a/main/source/cl_dll/vgui_SchemeManager.cpp b/main/source/cl_dll/vgui_SchemeManager.cpp new file mode 100644 index 00000000..3ba3b08f --- /dev/null +++ b/main/source/cl_dll/vgui_SchemeManager.cpp @@ -0,0 +1,560 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: +// +// $Workfile: $ +// $Date: 2001/09/13 15:01:48 $ +// +//----------------------------------------------------------------------------- +// $Log: vgui_SchemeManager.cpp,v $ +// Revision 1.3 2001/09/13 15:01:48 Charlie +// - Merging with 1108 +// +// Revision 1.2 2001/09/12 16:34:26 Charlie +// - Slightly better error checking +// Revision 1.1.1.1.2.2 2001/09/13 14:42:30 Charlie +// - HL1108 +// +// Revision 1.1.1.1 2000/06/17 14:12:45 charlie +// Final version of new HL SDK. May not compile. +// Previous versions of my MSVC project files and utility .bat files. +// This is my starting point; there is no mod-specific code in here. +// +// +// $NoKeywords: $ +//============================================================================= + +#include "hud.h" +#include "vgui_SchemeManager.h" +#include "cvardef.h" + +#include + + +cvar_t *g_CV_BitmapFonts; + + +void Scheme_Init() +{ + g_CV_BitmapFonts = gEngfuncs.pfnRegisterVariable("bitmapfonts", "1", 0); +} + + + +//----------------------------------------------------------------------------- +// Purpose: Scheme managers data container +//----------------------------------------------------------------------------- +class CSchemeManager::CScheme +{ +public: + enum { + SCHEME_NAME_LENGTH = 32, + FONT_NAME_LENGTH = 48, + FONT_FILENAME_LENGTH = 64, + }; + + // name + char schemeName[SCHEME_NAME_LENGTH]; + + // font + char fontName[FONT_NAME_LENGTH]; + + int fontSize; + int fontWeight; + + vgui::Font *font; + int ownFontPointer; // true if the font is ours to delete + + // scheme + byte fgColor[4]; + byte bgColor[4]; + byte armedFgColor[4]; + byte armedBgColor[4]; + byte mousedownFgColor[4]; + byte mousedownBgColor[4]; + byte borderColor[4]; + + // construction/destruction + CScheme(); + ~CScheme(); +}; + +CSchemeManager::CScheme::CScheme() +{ + schemeName[0] = 0; + fontName[0] = 0; + fontSize = 0; + fontWeight = 0; + font = NULL; + ownFontPointer = false; +} + +CSchemeManager::CScheme::~CScheme() +{ + // only delete our font pointer if we own it + if ( ownFontPointer ) + { + delete font; + } +} + +//----------------------------------------------------------------------------- +// Purpose: resolution information +// !! needs to be shared out +//----------------------------------------------------------------------------- +static int g_ResArray[] = +{ + 320, + 400, + 512, + 640, + 800, + 1024, + 1152, + 1280, + 1600 +}; +static int g_NumReses = sizeof(g_ResArray) / sizeof(int); + +static byte *LoadFileByResolution( const char *filePrefix, int xRes, const char *filePostfix ) +{ + // find our resolution in the res array + int resNum = g_NumReses - 1; + while ( g_ResArray[resNum] > xRes ) + { + resNum--; + + if ( resNum < 0 ) + return NULL; + } + + // try open the file + byte *pFile = NULL; + while ( 1 ) + { + + // try load + char fname[256]; + sprintf( fname, "%s%d%s", filePrefix, g_ResArray[resNum], filePostfix ); + pFile = gEngfuncs.COM_LoadFile( fname, 5, NULL ); + + if ( pFile ) + break; + + if ( resNum == 0 ) + return NULL; + + resNum--; + }; + + return pFile; +} + +static void ParseRGBAFromString( byte colorArray[4], const char *colorVector ) +{ + int r, g, b, a; + sscanf( colorVector, "%d %d %d %d", &r, &g, &b, &a ); + colorArray[0] = r; + colorArray[1] = g; + colorArray[2] = b; + colorArray[3] = a; +} + +//----------------------------------------------------------------------------- +// Purpose: initializes the scheme manager +// loading the scheme files for the current resolution +// Input : xRes - +// yRes - dimensions of output window +//----------------------------------------------------------------------------- +CSchemeManager::CSchemeManager( int xRes, int yRes ) +{ + // basic setup + m_pSchemeList = NULL; + m_iNumSchemes = 0; + + // find the closest matching scheme file to our resolution + char token[1024]; + char *pFile = (char*)LoadFileByResolution( "", xRes, "_textscheme.txt" ); + m_xRes = xRes; + + char *pFileStart = pFile; + + byte *pFontData; + int fontFileLength; + char fontFilename[512]; + + // + // Read the scheme descriptions from the text file, into a temporary array + // format is simply: + // = + // + // a of "SchemeName" signals a new scheme is being described + // + + const static int numTmpSchemes = 64; + static CScheme tmpSchemes[numTmpSchemes]; + memset( tmpSchemes, 0, sizeof(tmpSchemes) ); + int currentScheme = -1; + CScheme *pScheme = NULL; + + if ( !pFile ) + { + gEngfuncs.Con_DPrintf( "Unable to find *_textscheme.txt\n"); + goto buildDefaultFont; + } + + // record what has been entered so we can create defaults from the different values + bool hasFgColor, hasBgColor, hasArmedFgColor, hasArmedBgColor, hasMouseDownFgColor, hasMouseDownBgColor; + + pFile = gEngfuncs.COM_ParseFile( pFile, token ); + while ( strlen(token) > 0 && (currentScheme < numTmpSchemes) ) + { + // get the paramName name + static const int tokenSize = 64; + char paramName[tokenSize], paramValue[tokenSize]; + + strncpy( paramName, token, tokenSize ); + paramName[tokenSize-1] = 0; // ensure null termination + + // get the '=' character + pFile = gEngfuncs.COM_ParseFile( pFile, token ); + if ( stricmp( token, "=" ) ) + { + if ( currentScheme < 0 ) + { + gEngfuncs.Con_Printf( "error parsing font scheme text file at file start - expected '=', found '%s''\n", token ); + } + else + { + gEngfuncs.Con_Printf( "error parsing font scheme text file at scheme '%s' - expected '=', found '%s''\n", tmpSchemes[currentScheme].schemeName, token ); + } + break; + } + + // get paramValue + pFile = gEngfuncs.COM_ParseFile( pFile, token ); + strncpy( paramValue, token, tokenSize ); + paramValue[tokenSize-1] = 0; // ensure null termination + + // is this a new scheme? + if ( !stricmp(paramName, "SchemeName") ) + { + // setup the defaults for the current scheme + if ( pScheme ) + { + // foreground color defaults (normal -> armed -> mouse down) + if ( !hasFgColor ) + { + pScheme->fgColor[0] = pScheme->fgColor[1] = pScheme->fgColor[2] = pScheme->fgColor[3] = 255; + } + if ( !hasArmedFgColor ) + { + memcpy( pScheme->armedFgColor, pScheme->fgColor, sizeof(pScheme->armedFgColor) ); + } + if ( !hasMouseDownFgColor ) + { + memcpy( pScheme->mousedownFgColor, pScheme->armedFgColor, sizeof(pScheme->mousedownFgColor) ); + } + + // background color (normal -> armed -> mouse down) + if ( !hasBgColor ) + { + pScheme->bgColor[0] = pScheme->bgColor[1] = pScheme->bgColor[2] = pScheme->bgColor[3] = 0; + } + if ( !hasArmedBgColor ) + { + memcpy( pScheme->armedBgColor, pScheme->bgColor, sizeof(pScheme->armedBgColor) ); + } + if ( !hasMouseDownBgColor ) + { + memcpy( pScheme->mousedownBgColor, pScheme->armedBgColor, sizeof(pScheme->mousedownBgColor) ); + } + + // font size + if ( !pScheme->fontSize ) + { + pScheme->fontSize = 17; + } + if ( !pScheme->fontName[0] ) + { + strcpy( pScheme->fontName, "Arial" ); + } + } + + // create the new scheme + currentScheme++; + pScheme = &tmpSchemes[currentScheme]; + hasFgColor = hasBgColor = hasArmedFgColor = hasArmedBgColor = hasMouseDownFgColor = hasMouseDownBgColor = false; + + strncpy( pScheme->schemeName, paramValue, CScheme::SCHEME_NAME_LENGTH ); + pScheme->schemeName[CScheme::SCHEME_NAME_LENGTH-1] = '\0'; // ensure null termination of string + } + + if ( !pScheme ) + { + gEngfuncs.Con_Printf( "font scheme text file MUST start with a 'SchemeName'\n"); + break; + } + + // pull the data out into the scheme + if ( !stricmp(paramName, "FontName") ) + { + strncpy( pScheme->fontName, paramValue, CScheme::FONT_NAME_LENGTH ); + pScheme->fontName[CScheme::FONT_NAME_LENGTH-1] = 0; + } + else if ( !stricmp(paramName, "FontSize") ) + { + pScheme->fontSize = atoi( paramValue ); + } + else if ( !stricmp(paramName, "FontWeight") ) + { + pScheme->fontWeight = atoi( paramValue ); + } + else if ( !stricmp(paramName, "FgColor") ) + { + ParseRGBAFromString( pScheme->fgColor, paramValue ); + hasFgColor = true; + } + else if ( !stricmp(paramName, "BgColor") ) + { + ParseRGBAFromString( pScheme->bgColor, paramValue ); + hasBgColor = true; + } + else if ( !stricmp(paramName, "FgColorArmed") ) + { + ParseRGBAFromString( pScheme->armedFgColor, paramValue ); + hasArmedFgColor = true; + } + else if ( !stricmp(paramName, "BgColorArmed") ) + { + ParseRGBAFromString( pScheme->armedBgColor, paramValue ); + hasArmedBgColor = true; + } + else if ( !stricmp(paramName, "FgColorMousedown") ) + { + ParseRGBAFromString( pScheme->mousedownFgColor, paramValue ); + hasMouseDownFgColor = true; + } + else if ( !stricmp(paramName, "BgColorMousedown") ) + { + ParseRGBAFromString( pScheme->mousedownBgColor, paramValue ); + hasMouseDownBgColor = true; + } + else if ( !stricmp(paramName, "BorderColor") ) + { + ParseRGBAFromString( pScheme->borderColor, paramValue ); + hasMouseDownBgColor = true; + } + + // get the new token last, so we now if the loop needs to be continued or not + pFile = gEngfuncs.COM_ParseFile( pFile, token ); + } + + // free the file + gEngfuncs.COM_FreeFile( pFileStart ); + + +buildDefaultFont: + + // make sure we have at least 1 valid font + if ( currentScheme < 0 ) + { + currentScheme = 0; + strcpy( tmpSchemes[0].schemeName, "Default Scheme" ); + strcpy( tmpSchemes[0].fontName, "Arial" ); + tmpSchemes[0].fontSize = 0; + tmpSchemes[0].fgColor[0] = tmpSchemes[0].fgColor[1] = tmpSchemes[0].fgColor[2] = tmpSchemes[0].fgColor[3] = 255; + tmpSchemes[0].armedFgColor[0] = tmpSchemes[0].armedFgColor[1] = tmpSchemes[0].armedFgColor[2] = tmpSchemes[0].armedFgColor[3] = 255; + tmpSchemes[0].mousedownFgColor[0] = tmpSchemes[0].mousedownFgColor[1] = tmpSchemes[0].mousedownFgColor[2] = tmpSchemes[0].mousedownFgColor[3] = 255; + } + + // we have the full list of schemes in the tmpSchemes array + // now allocate the correct sized list + m_iNumSchemes = currentScheme + 1; // 0-based index + m_pSchemeList = new CScheme[ m_iNumSchemes ]; + + // copy in the data + memcpy( m_pSchemeList, tmpSchemes, sizeof(CScheme) * m_iNumSchemes ); + + // create the fonts + for ( int i = 0; i < m_iNumSchemes; i++ ) + { + m_pSchemeList[i].font = NULL; + + // see if the current font values exist in a previously loaded font + for ( int j = 0; j < i; j++ ) + { + // check if the font name, size, and weight are the same + if ( !stricmp(m_pSchemeList[i].fontName, m_pSchemeList[j].fontName) + && m_pSchemeList[i].fontSize == m_pSchemeList[j].fontSize + && m_pSchemeList[i].fontWeight == m_pSchemeList[j].fontWeight ) + { + // copy the pointer, but mark i as not owning it + m_pSchemeList[i].font = m_pSchemeList[j].font; + m_pSchemeList[i].ownFontPointer = false; + } + } + + // if we haven't found the font already, load it ourselves + if ( !m_pSchemeList[i].font ) + { + fontFileLength = -1; + pFontData = NULL; + + if(g_CV_BitmapFonts && g_CV_BitmapFonts->value) + { + sprintf(fontFilename, "gfx\\vgui\\fonts\\%d_%s.tga", m_xRes, m_pSchemeList[i].schemeName); + pFontData = gEngfuncs.COM_LoadFile( fontFilename, 5, &fontFileLength ); + if(!pFontData) + gEngfuncs.Con_Printf("Missing bitmap font: %s\n", fontFilename); + } + + m_pSchemeList[i].font = new vgui::Font( + m_pSchemeList[i].fontName, + pFontData, + fontFileLength, + m_pSchemeList[i].fontSize, + 0, + 0, + m_pSchemeList[i].fontWeight, + false, + false, + false, + false); + + m_pSchemeList[i].ownFontPointer = true; + } + + // fix up alpha values; VGUI uses 1-A (A=0 being solid, A=255 transparent) + m_pSchemeList[i].fgColor[3] = 255 - m_pSchemeList[i].fgColor[3]; + m_pSchemeList[i].bgColor[3] = 255 - m_pSchemeList[i].bgColor[3]; + m_pSchemeList[i].armedFgColor[3] = 255 - m_pSchemeList[i].armedFgColor[3]; + m_pSchemeList[i].armedBgColor[3] = 255 - m_pSchemeList[i].armedBgColor[3]; + m_pSchemeList[i].mousedownFgColor[3] = 255 - m_pSchemeList[i].mousedownFgColor[3]; + m_pSchemeList[i].mousedownBgColor[3] = 255 - m_pSchemeList[i].mousedownBgColor[3]; + } +} + +//----------------------------------------------------------------------------- +// Purpose: frees all the memory used by the scheme manager +//----------------------------------------------------------------------------- +CSchemeManager::~CSchemeManager() +{ + delete [] m_pSchemeList; + m_iNumSchemes = 0; +} + +//----------------------------------------------------------------------------- +// Purpose: Finds a scheme in the list, by name +// Input : char *schemeName - string name of the scheme +// Output : SchemeHandle_t handle to the scheme +//----------------------------------------------------------------------------- +SchemeHandle_t CSchemeManager::getSchemeHandle( const char *schemeName ) +{ + // iterate through the list + for ( int i = 0; i < m_iNumSchemes; i++ ) + { + if ( !stricmp(schemeName, m_pSchemeList[i].schemeName) ) + return i; + } + + return 0; +} + +//----------------------------------------------------------------------------- +// Purpose: always returns a valid scheme handle +// Input : schemeHandle - +// Output : CScheme +//----------------------------------------------------------------------------- +CSchemeManager::CScheme *CSchemeManager::getSafeScheme( SchemeHandle_t schemeHandle ) +{ + ASSERT(schemeHandle >= 0); + ASSERT(schemeHandle < m_iNumSchemes); + + if ( schemeHandle < m_iNumSchemes ) + return m_pSchemeList + schemeHandle; + + return m_pSchemeList; +} + + +//----------------------------------------------------------------------------- +// Purpose: Returns the schemes pointer to a font +// Input : schemeHandle - +// Output : vgui::Font +//----------------------------------------------------------------------------- +vgui::Font *CSchemeManager::getFont( SchemeHandle_t schemeHandle ) +{ + return getSafeScheme( schemeHandle )->font; +} + +void CSchemeManager::getFgColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->fgColor[0]; + g = pScheme->fgColor[1]; + b = pScheme->fgColor[2]; + a = pScheme->fgColor[3]; +} + +void CSchemeManager::getBgColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->bgColor[0]; + g = pScheme->bgColor[1]; + b = pScheme->bgColor[2]; + a = pScheme->bgColor[3]; +} + +void CSchemeManager::getFgArmedColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->armedFgColor[0]; + g = pScheme->armedFgColor[1]; + b = pScheme->armedFgColor[2]; + a = pScheme->armedFgColor[3]; +} + +void CSchemeManager::getBgArmedColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->armedBgColor[0]; + g = pScheme->armedBgColor[1]; + b = pScheme->armedBgColor[2]; + a = pScheme->armedBgColor[3]; +} + +void CSchemeManager::getFgMousedownColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->mousedownFgColor[0]; + g = pScheme->mousedownFgColor[1]; + b = pScheme->mousedownFgColor[2]; + a = pScheme->mousedownFgColor[3]; +} + +void CSchemeManager::getBgMousedownColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->mousedownBgColor[0]; + g = pScheme->mousedownBgColor[1]; + b = pScheme->mousedownBgColor[2]; + a = pScheme->mousedownBgColor[3]; +} + +void CSchemeManager::getBorderColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->borderColor[0]; + g = pScheme->borderColor[1]; + b = pScheme->borderColor[2]; + a = pScheme->borderColor[3]; +} + + + diff --git a/main/source/cl_dll/vgui_SchemeManager.h b/main/source/cl_dll/vgui_SchemeManager.h new file mode 100644 index 00000000..6fed4cc4 --- /dev/null +++ b/main/source/cl_dll/vgui_SchemeManager.h @@ -0,0 +1,51 @@ +#ifndef VGUI_SCHEMEMANAGER_H +#define VGUI_SCHEMEMANAGER_H + +#include + + +// handle to an individual scheme +typedef int SchemeHandle_t; + + +// Register console variables, etc.. +void Scheme_Init(); + + +//----------------------------------------------------------------------------- +// Purpose: Handles the loading of text scheme description from disk +// supports different font/color/size schemes at different resolutions +//----------------------------------------------------------------------------- +class CSchemeManager +{ +public: + // initialization + CSchemeManager( int xRes, int yRes ); + virtual ~CSchemeManager(); + + // scheme handling + SchemeHandle_t getSchemeHandle( const char *schemeName ); + + // getting info from schemes + vgui::Font *getFont( SchemeHandle_t schemeHandle ); + void getFgColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getBgColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getFgArmedColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getBgArmedColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getFgMousedownColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getBgMousedownColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getBorderColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + +private: + class CScheme; + CScheme *m_pSchemeList; + int m_iNumSchemes; + + // Resolution we were initted at. + int m_xRes; + + CScheme *getSafeScheme( SchemeHandle_t schemeHandle ); +}; + + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/vgui_ScorePanel.cpp b/main/source/cl_dll/vgui_ScorePanel.cpp new file mode 100644 index 00000000..d7f27b0e --- /dev/null +++ b/main/source/cl_dll/vgui_ScorePanel.cpp @@ -0,0 +1,1626 @@ +//=========== (C) Copyright 1999 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: VGUI scoreboard +// +// $Workfile: $ +// $Date: 2002/10/24 21:13:15 $ +// +//----------------------------------------------------------------------------- +// $Log: vgui_ScorePanel.cpp,v $ +// Revision 1.15 2002/10/24 21:13:15 Flayra +// - Fixed gamma correction for auth icons +// +// Revision 1.14 2002/10/18 22:13:48 Flayra +// - Gamma-correction for auth icons +// +// Revision 1.13 2002/10/16 00:37:33 Flayra +// - Added support for authentication in scoreboard +// +// Revision 1.12 2002/09/09 19:42:55 Flayra +// - Fixed problem where scores were sometimes displayed for marines +// +// Revision 1.11 2002/08/31 18:02:11 Flayra +// - Work at VALVe +// +// Revision 1.10 2002/08/09 00:11:33 Flayra +// - Fixed scoreboard +// +// Revision 1.9 2002/07/08 16:15:13 Flayra +// - Refactored team color management +// +// Revision 1.8 2002/06/25 17:06:48 Flayra +// - Removed memory overwrite from hlcoder list +// +// Revision 1.7 2002/06/03 16:12:21 Flayra +// - Show player status for players on your team (LEV1, GEST, COMM, etc.) +// +// Revision 1.6 2002/04/16 19:30:21 Charlie +// - Fixed crash when holding tab right when joining server, added "REIN" status +// +// Revision 1.5 2002/03/27 21:17:18 Charlie +// - Scoreboard now shows alien scores, and doesn't show marine scores. Also draws DEAD and COMM indicators, and scoring is handled properly for aliens (points for kills, buildings) +// +// Revision 1.4 2002/03/08 02:37:52 Charlie +// - Refactored crappy-ass score panel. It's not perfect, but it's better. Removed TFC code, added DEAD and COMM tags to scoreboard. +// +// Revision 1.3 2001/11/13 17:51:02 Charlie +// - Increased max teams, changed team colors (allow aliens vs. aliens and fronts vs. fronts), general scoreboard support +// +// Revision 1.2 2001/09/13 22:28:01 Charlie +// - Updated NS with new Half-life 1108 patch in preparation for voice support and spectator mode +// +// Revision 1.1.1.1.2.1 2001/09/13 14:42:30 Charlie +// - HL1108 +// +// +// $NoKeywords: $ +//============================================================================= + + +#include + +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_ScorePanel.h" +#include "..\game_shared\vgui_helpers.h" +#include "..\game_shared\vgui_loadtga.h" +#include "mod/AvHConstants.h" +#include "mod/AvHTitles.h" +#include "vgui_SpectatorPanel.h" +#include "cl_dll/demo.h" +#include "mod/AvHServerVariables.h" +#include "util\STLUtil.h" + +#include "ITrackerUser.h" +extern ITrackerUser *g_pTrackerUser; + +hud_player_info_t g_PlayerInfoList[MAX_PLAYERS+1]; // player info from the engine +extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS+1]; // additional player info sent directly to the client dll +team_info_t g_TeamInfo[MAX_TEAMS+1]; +int g_IsSpectator[MAX_PLAYERS+1]; + +int HUD_IsGame( const char *game ); +int EV_TFC_IsAllyTeam( int iTeam1, int iTeam2 ); + +// Scoreboard dimensions +#define SBOARD_TITLE_SIZE_Y YRES(22) + +#define X_BORDER XRES(4) + +void LoadData(void* inBuffer, const unsigned char* inData, int inSizeToCopy, int& inSizeVariable); +void SaveData(unsigned char* inBuffer, const void* inData, int inSizeToCopy, int& inSizeVariable); + +int ScorePanel_InitializeDemoPlayback(int inSize, unsigned char* inBuffer) +{ + int theBytesRead = 0; + + LoadData(&g_PlayerInfoList, inBuffer, (MAX_PLAYERS+1)*sizeof(hud_player_info_t), theBytesRead); + LoadData(&g_PlayerExtraInfo, inBuffer, (MAX_PLAYERS+1)*sizeof(extra_player_info_t), theBytesRead); + LoadData(&g_TeamInfo, inBuffer, (MAX_PLAYERS+1)*sizeof(team_info_t), theBytesRead); + LoadData(&g_IsSpectator, inBuffer, (MAX_PLAYERS+1)*sizeof(int), theBytesRead); + + return theBytesRead; +} + +void ScorePanel_InitializeDemoRecording() +{ + // Now save out team info + int theTotalSize = (MAX_PLAYERS + 1)*(sizeof(hud_player_info_t) + sizeof(extra_player_info_t) + sizeof(team_info_t) + sizeof(int)); + unsigned char* theCharArray = new unsigned char[theTotalSize]; + if(theCharArray) + { + int theCounter = 0; + SaveData(theCharArray, &g_PlayerInfoList, (MAX_PLAYERS+1)*sizeof(hud_player_info_t), theCounter); + SaveData(theCharArray, &g_PlayerExtraInfo, (MAX_PLAYERS+1)*sizeof(extra_player_info_t), theCounter); + SaveData(theCharArray, &g_TeamInfo, (MAX_PLAYERS+1)*sizeof(team_info_t), theCounter); + SaveData(theCharArray, &g_IsSpectator, (MAX_PLAYERS+1)*sizeof(int), theCounter); + + Demo_WriteBuffer(TYPE_PLAYERINFO, theTotalSize, theCharArray); + } +} + +// Column sizes +class SBColumnInfo +{ +public: + char *m_pTitle; // If null, ignore, if starts with #, it's localized, otherwise use the string directly. + int m_Width; // Based on 640 width. Scaled to fit other resolutions. + Label::Alignment m_Alignment; +}; + +// grid size is marked out for 640x480 screen + +SBColumnInfo g_ColumnInfo[NUM_COLUMNS] = +{ + {NULL, 24, Label::a_east}, // tracker column + {NULL, 24, Label::a_east}, // status icons + {NULL, 150, Label::a_east}, // name + {NULL, 56, Label::a_east}, // class + {"#SCORE", 40, Label::a_east}, // score + {"#KILLS", 40, Label::a_east}, // kills + {"#DEATHS", 40, Label::a_east}, // deaths + {"#LATENCY", 40, Label::a_east}, // ping + {"#VOICE", 40, Label::a_east}, + {NULL, 2, Label::a_east}, // blank column to take up the slack +}; + + +#define TEAM_NO 0 +#define TEAM_YES 1 +#define TEAM_SPECTATORS 2 +#define TEAM_BLANK 3 + +Color BuildColor(int inR, int inG, int inB, float inScalar) +{ + Color theColor = Color((int)(inR/inScalar), (int)(inG/inScalar), (int)(inB/inScalar), 0); + return theColor; +} + + +//----------------------------------------------------------------------------- +// ScorePanel::HitTestPanel. +//----------------------------------------------------------------------------- + +void ScorePanel::HitTestPanel::internalMousePressed(MouseCode code) +{ + for(int i=0;i<_inputSignalDar.getCount();i++) + { + _inputSignalDar[i]->mousePressed(code,this); + } +} + + + +//----------------------------------------------------------------------------- +// Purpose: Create the ScoreBoard panel +//----------------------------------------------------------------------------- +ScorePanel::ScorePanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) +{ + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle("Scoreboard Title Text"); + SchemeHandle_t hSmallScheme = pSchemes->getSchemeHandle("Scoreboard Small Text"); + SchemeHandle_t hTinyScheme = pSchemes->getSchemeHandle("Scoreboard Tiny Text"); + Font *tfont = pSchemes->getFont(hTitleScheme); + Font *smallfont = pSchemes->getFont(hSmallScheme); + Font *tinyfont = pSchemes->getFont(hTinyScheme); + + setBgColor(0, 0, 0, 96); + m_pCurrentHighlightLabel = NULL; + m_iHighlightRow = -1; + + m_pTrackerIcon = NULL; + m_pDevIcon = NULL; + m_pPTIcon = NULL; + m_pGuideIcon = NULL; + m_pServerOpIcon = NULL; + m_pContribIcon = NULL; + m_pCheatingDeathIcon = NULL; + m_pVeteranIcon = NULL; + + m_pTrackerIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardtracker.tga"); + m_pDevIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboarddev.tga"); + m_pPTIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardpt.tga"); + m_pGuideIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardguide.tga"); + m_pServerOpIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardserverop.tga"); + m_pContribIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardcontrib.tga"); + m_pCheatingDeathIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardcd.tga"); + m_pVeteranIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardveteran.tga"); + + // Initialize the top title. + m_TitleLabel.setFont(tfont); + m_TitleLabel.setText(""); + m_TitleLabel.setBgColor( 0, 0, 0, 255 ); + m_TitleLabel.setFgColor( Scheme::sc_primary1 ); + m_TitleLabel.setContentAlignment( vgui::Label::a_west ); + + LineBorder *border = new LineBorder(Color(60, 60, 60, 128)); + setBorder(border); + setPaintBorderEnabled(true); + + int xpos = g_ColumnInfo[0].m_Width + 3; + if (ScreenWidth() >= 640) + { + // only expand column size for res greater than 640 + xpos = XRES(xpos); + } + m_TitleLabel.setBounds(xpos, 4, wide, SBOARD_TITLE_SIZE_Y); + m_TitleLabel.setContentFitted(false); + m_TitleLabel.setParent(this); + + // Setup the header (labels like "name", "class", etc..). + m_HeaderGrid.SetDimensions(NUM_COLUMNS, 1); + m_HeaderGrid.SetSpacing(0, 0); + + for(int i=0; i < NUM_COLUMNS; i++) + { + if (g_ColumnInfo[i].m_pTitle && g_ColumnInfo[i].m_pTitle[0] == '#') + m_HeaderLabels[i].setText(CHudTextMessage::BufferedLocaliseTextString(g_ColumnInfo[i].m_pTitle)); + else if(g_ColumnInfo[i].m_pTitle) + m_HeaderLabels[i].setText(g_ColumnInfo[i].m_pTitle); + + int xwide = g_ColumnInfo[i].m_Width; + if (ScreenWidth() >= 640) + { + xwide = XRES(xwide); + } + else if (ScreenWidth() == 400) + { + // hack to make 400x300 resolution scoreboard fit + if (i == 1) + { + // reduces size of player name cell + xwide -= 28; + } + else if (i == 0) + { + // tracker icon cell + xwide -= 8; + } + } + + m_HeaderGrid.SetColumnWidth(i, xwide); + m_HeaderGrid.SetEntry(i, 0, &m_HeaderLabels[i]); + + m_HeaderLabels[i].setBgColor(0,0,0,255); + m_HeaderLabels[i].setBgColor(0,0,0,255); + + int theColorIndex = 0; + Color gammaAdjustedTeamColor = BuildColor(kTeamColors[theColorIndex][0], kTeamColors[theColorIndex][1], kTeamColors[theColorIndex][2], gHUD.GetGammaSlope()); + int theR, theG, theB, theA; + gammaAdjustedTeamColor.getColor(theR, theG, theB, theA); + m_HeaderLabels[i].setFgColor(theR, theG, theB, theA); + + m_HeaderLabels[i].setFont(smallfont); + m_HeaderLabels[i].setContentAlignment(g_ColumnInfo[i].m_Alignment); + + int yres = 12; + if (ScreenHeight() >= 480) + { + yres = YRES(yres); + } + m_HeaderLabels[i].setSize(50, yres); + } + + // Set the width of the last column to be the remaining space. + int ex, ey, ew, eh; + m_HeaderGrid.GetEntryBox(NUM_COLUMNS - 2, 0, ex, ey, ew, eh); + m_HeaderGrid.SetColumnWidth(NUM_COLUMNS - 1, (wide - X_BORDER) - (ex + ew)); + + m_HeaderGrid.AutoSetRowHeights(); + m_HeaderGrid.setBounds(X_BORDER, SBOARD_TITLE_SIZE_Y, wide - X_BORDER*2, m_HeaderGrid.GetRowHeight(0)); + m_HeaderGrid.setParent(this); + m_HeaderGrid.setBgColor(0,0,0,255); + + + // Now setup the listbox with the actual player data in it. + int headerX, headerY, headerWidth, headerHeight; + m_HeaderGrid.getBounds(headerX, headerY, headerWidth, headerHeight); + m_PlayerList.setBounds(headerX, headerY+headerHeight, headerWidth, tall - headerY - headerHeight - 6); + m_PlayerList.setBgColor(0,0,0,255); + m_PlayerList.setParent(this); + + for(int row=0; row < NUM_ROWS; row++) + { + CGrid *pGridRow = &m_PlayerGrids[row]; + + pGridRow->SetDimensions(NUM_COLUMNS, 1); + + for(int col=0; col < NUM_COLUMNS; col++) + { + m_PlayerEntries[col][row].setContentFitted(false); + m_PlayerEntries[col][row].setRow(row); + m_PlayerEntries[col][row].addInputSignal(this); + pGridRow->SetEntry(col, 0, &m_PlayerEntries[col][row]); + } + + pGridRow->setBgColor(0,0,0,255); +// pGridRow->SetSpacing(2, 0);f + pGridRow->SetSpacing(0, 0); + pGridRow->CopyColumnWidths(&m_HeaderGrid); + pGridRow->AutoSetRowHeights(); + pGridRow->setSize(PanelWidth(pGridRow), pGridRow->CalcDrawHeight()); + pGridRow->RepositionContents(); + + m_PlayerList.AddItem(pGridRow); + } + + + // Add the hit test panel. It is invisible and traps mouse clicks so we can go into squelch mode. + m_HitTestPanel.setBgColor(0,0,0,255); + m_HitTestPanel.setParent(this); + m_HitTestPanel.setBounds(0, 0, wide, tall); + m_HitTestPanel.addInputSignal(this); + + m_pCloseButton = new CommandButton( "x", wide-XRES(12 + 4), YRES(2), XRES( 12 ) , YRES( 12 ) ); + m_pCloseButton->setParent( this ); + m_pCloseButton->addActionSignal( new CMenuHandler_StringCommandWatch( "-showscores", true ) ); + m_pCloseButton->setBgColor(0,0,0,255); + m_pCloseButton->setFgColor( 255, 255, 255, 0 ); + m_pCloseButton->setFont(tfont); + m_pCloseButton->setBoundKey( (char)255 ); + m_pCloseButton->setContentAlignment(Label::a_center); + Initialize(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Called each time a new level is started. +//----------------------------------------------------------------------------- +void ScorePanel::Initialize( void ) +{ + // Clear out scoreboard data + m_iLastKilledBy = 0; + m_fLastKillTime = 0; + m_iPlayerNum = 0; + m_iNumTeams = 0; + memset( g_PlayerExtraInfo, 0, sizeof g_PlayerExtraInfo ); + memset( g_TeamInfo, 0, sizeof g_TeamInfo ); +} + +bool HACK_GetPlayerUniqueID( int iPlayer, char playerID[16] ) +{ + return !!gEngfuncs.GetPlayerUniqueID( iPlayer, playerID ); +} +//----------------------------------------------------------------------------- +// Purpose: Recalculate the internal scoreboard data +//----------------------------------------------------------------------------- +void ScorePanel::Update() +{ + // Set the title + string theTitleName; + + if (gViewPort->m_szServerName) + { + char sz[MAX_SERVERNAME_LENGTH + MAX_MAPNAME_LENGTH + 256]; + sprintf(sz, "%s", gViewPort->m_szServerName ); + string theServerName = string(sz); + if(theServerName.length() > MAX_SERVERNAME_LENGTH) //string wasn't terminated + { theServerName.resize(MAX_SERVERNAME_LENGTH); } + theTitleName += theServerName; + } + + string theMapName = gHUD.GetMapName(); + if(theMapName != "") + { + //sprintf(sz, "%s : %s", gViewPort->m_szServerName, theMapName.c_str()); + if(theTitleName != "") + { + theTitleName += " "; + } + + theTitleName += "("; + theTitleName += theMapName; + theTitleName += ")"; + } + + m_TitleLabel.setText(theTitleName.c_str()); + + int theColorIndex = 0; + + // Set gamma-correct title color + Color gammaAdjustedTeamColor = BuildColor(kTeamColors[theColorIndex][0], kTeamColors[theColorIndex][1], kTeamColors[theColorIndex][2], gHUD.GetGammaSlope()); + + int theR, theG, theB, theA; + gammaAdjustedTeamColor.getColor(theR, theG, theB, theA); + + m_TitleLabel.setFgColor(theR, theG, theB, theA); + + m_iRows = 0; + gViewPort->GetAllPlayersInfo(); + + // Clear out sorts + int i = 0; + for (i = 0; i < NUM_ROWS; i++) + { + m_iSortedRows[i] = 0; + m_iIsATeam[i] = TEAM_IND; + } + + // Fix for memory overrun bug + for (i = 0; i < MAX_PLAYERS; i++) + { + m_bHasBeenSorted[i] = false; + } + + // If it's not teamplay, sort all the players. Otherwise, sort the teams. + if ( !gHUD.m_Teamplay ) + SortPlayers( 0, NULL ); + else + SortTeams(); + + // set scrollbar range + m_PlayerList.SetScrollRange(m_iRows); + + FillGrid(); + if ( gViewPort->m_pSpectatorPanel->m_menuVisible ) + { + m_pCloseButton->setVisible ( true ); + } + else + { + m_pCloseButton->setVisible ( false ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Sort all the teams +//----------------------------------------------------------------------------- +void ScorePanel::SortTeams() +{ + // clear out team scores + float theCurrentTime = gHUD.GetTimeOfLastUpdate(); + + for ( int i = 1; i <= m_iNumTeams; i++ ) + { + if ( !g_TeamInfo[i].scores_overriden ) + g_TeamInfo[i].score = g_TeamInfo[i].frags = g_TeamInfo[i].deaths = 0; + g_TeamInfo[i].ping = g_TeamInfo[i].packetloss = 0; + } + + // recalc the team scores, then draw them + for ( i = 1; i <= MAX_PLAYERS; i++ ) + { + if ( g_PlayerInfoList[i].name == NULL ) + continue; // empty player slot, skip + + if ( g_PlayerExtraInfo[i].teamname[0] == 0 ) + continue; // skip over players who are not in a team + + // find what team this player is in + for ( int j = 1; j <= m_iNumTeams; j++ ) + { + if ( !stricmp( g_PlayerExtraInfo[i].teamname, g_TeamInfo[j].name ) ) + break; + } + if ( j > m_iNumTeams ) // player is not in a team, skip to the next guy + continue; + + if ( !g_TeamInfo[j].scores_overriden ) + { + g_TeamInfo[j].score += g_PlayerExtraInfo[i].score; + g_TeamInfo[j].frags += g_PlayerExtraInfo[i].frags; + g_TeamInfo[j].deaths += g_PlayerExtraInfo[i].deaths; + } + + g_TeamInfo[j].ping += g_PlayerInfoList[i].ping; + g_TeamInfo[j].packetloss += g_PlayerInfoList[i].packetloss; + + if ( g_PlayerInfoList[i].thisplayer ) + g_TeamInfo[j].ownteam = TRUE; + else + g_TeamInfo[j].ownteam = FALSE; + + // Set the team's number (used for team colors) + g_TeamInfo[j].teamnumber = g_PlayerExtraInfo[i].teamnumber; + } + + // find team ping/packetloss averages + for ( i = 1; i <= m_iNumTeams; i++ ) + //for ( i = 0; i <= m_iNumTeams; i++ ) + { + g_TeamInfo[i].already_drawn = FALSE; + + if ( g_TeamInfo[i].players > 0 ) + { + g_TeamInfo[i].ping /= g_TeamInfo[i].players; // use the average ping of all the players in the team as the teams ping + g_TeamInfo[i].packetloss /= g_TeamInfo[i].players; // use the average ping of all the players in the team as the teams ping + } + } + + // Draw the teams + // while ( 1 ) + // { + // int highest_frags = -99999; int lowest_deaths = 99999; + // int best_team = 0; + // + // for ( i = 1; i <= m_iNumTeams; i++ ) + // { + // if ( g_TeamInfo[i].players < 1 ) + // continue; + // + // // Spectator team can't be the best team if there are others + // if ( !g_TeamInfo[i].already_drawn && g_TeamInfo[i].frags >= highest_frags ) + // { + // if ( g_TeamInfo[i].frags > highest_frags || g_TeamInfo[i].deaths < lowest_deaths ) + // { + // best_team = i; + // lowest_deaths = g_TeamInfo[i].deaths; + // highest_frags = g_TeamInfo[i].frags; + // } + // } + // } + // + // // draw the best team on the scoreboard + // if ( !best_team ) + // break; +// for(i = 1 ; i <= m_iNumTeams; i++) +// { +// int best_team = i; +// +// // Put this team in the sorted list +// m_iSortedRows[ m_iRows ] = best_team; +// m_iIsATeam[ m_iRows ] = TEAM_YES; +// g_TeamInfo[best_team].already_drawn = TRUE; // set the already_drawn to be TRUE, so this team won't get sorted again +// m_iRows++; +// +// // Now sort all the players on this team +// SortPlayers( 0, g_TeamInfo[best_team].name ); +// } + + // Sort the teams by numerical order, skipping spectators + // for(i = 1; i < m_iNumTeams; i++) + // { + // SortPlayers(0, g_TeamInfo[i].name); + // } + + SortActivePlayers(kMarine1Team); + SortActivePlayers(kAlien1Team); + SortActivePlayers(kMarine2Team); + SortActivePlayers(kAlien2Team); + SortActivePlayers(kSpectatorTeam); + SortActivePlayers(kUndefinedTeam); + + // Add all the players who aren't in a team yet into spectators + //SortPlayers( TEAM_SPECTATORS, NULL ); +} + +void ScorePanel::SortActivePlayers(char* inTeam, bool inSortByEntityIndex) +{ + for(int i = 1; i <= m_iNumTeams; i++) + { + if(!strcmp(g_TeamInfo[i].name, inTeam)) + { + int best_team = i; + + // Put this team in the sorted list + m_iSortedRows[ m_iRows ] = best_team; + m_iIsATeam[ m_iRows ] = TEAM_YES; + g_TeamInfo[best_team].already_drawn = TRUE; // set the already_drawn to be TRUE, so this team won't get sorted again + m_iRows++; + + // Now sort all the players on this team + SortPlayers(0, g_TeamInfo[best_team].name, inSortByEntityIndex); + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Sort a list of players +//----------------------------------------------------------------------------- +void ScorePanel::SortPlayers( int iTeam, char *team, bool inSortByEntityIndex) +{ + bool bCreatedTeam = false; + + // draw the players, in order, and restricted to team if set + while ( 1 ) + { + // Find the top ranking player + int theBestTotalScore = -99999; + int theBestDeaths = 0; + int theBestPlayer = 0; + + for ( int i = 1; i <= MAX_PLAYERS; i++ ) + { + if ( m_bHasBeenSorted[i] == false && g_PlayerInfoList[i].name /*&& g_PlayerExtraInfo[i].frags >= theBestTotalScore*/ ) + { + cl_entity_t *ent = gEngfuncs.GetEntityByIndex( i ); + + if ( ent && !(team && stricmp(g_PlayerExtraInfo[i].teamname, team)) ) + { + extra_player_info_t *pl_info = &g_PlayerExtraInfo[i]; + + // Sort by player index to mask marine status + if(inSortByEntityIndex) + { + if((theBestPlayer == 0) || (i < theBestPlayer)) + { + theBestPlayer = i; + } + } + else + { + // overall rank = score + kills (with least deaths breaking ties) + int thePlayerScore = pl_info->score;// + pl_info->frags - pl_info->deaths; + int thePlayerDeaths = pl_info->deaths; + if((thePlayerScore > theBestTotalScore) || ((thePlayerScore == theBestTotalScore) && (pl_info->deaths < theBestDeaths))) + { + theBestPlayer = i; + theBestTotalScore = thePlayerScore; + theBestDeaths = thePlayerDeaths; + } + } + } + } + } + + if ( !theBestPlayer ) + break; + + // If we haven't created the Team yet, do it first + if (!bCreatedTeam && iTeam) + { + m_iIsATeam[ m_iRows ] = iTeam; + m_iRows++; + + bCreatedTeam = true; + } + + // Put this player in the sorted list + m_iSortedRows[ m_iRows ] = theBestPlayer; + m_bHasBeenSorted[ theBestPlayer ] = true; + m_iRows++; + } + + if (team) + { + m_iIsATeam[m_iRows++] = TEAM_BLANK; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Recalculate the existing teams in the match +//----------------------------------------------------------------------------- +void ScorePanel::RebuildTeams() +{ + // clear out player counts from teams + for ( int i = 1; i <= m_iNumTeams; i++ ) + { + g_TeamInfo[i].players = 0; + } + + // rebuild the team list + gViewPort->GetAllPlayersInfo(); + m_iNumTeams = 0; + for ( i = 1; i <= MAX_PLAYERS; i++ ) + { + if ( g_PlayerInfoList[i].name == NULL ) + continue; + + if ( g_PlayerExtraInfo[i].teamname[0] == 0 ) + continue; // skip over players who are not in a team + + // is this player in an existing team? + for ( int j = 1; j <= m_iNumTeams; j++ ) + { + if ( g_TeamInfo[j].name[0] == '\0' ) + break; + + if ( !stricmp( g_PlayerExtraInfo[i].teamname, g_TeamInfo[j].name ) ) + break; + } + + if ( j > m_iNumTeams ) + { // they aren't in a listed team, so make a new one + // search through for an empty team slot + for ( int j = 1; j <= m_iNumTeams; j++ ) + { + if ( g_TeamInfo[j].name[0] == '\0' ) + break; + } + m_iNumTeams = max( j, m_iNumTeams ); + + strncpy( g_TeamInfo[j].name, g_PlayerExtraInfo[i].teamname, MAX_TEAM_NAME ); + g_TeamInfo[j].players = 0; + } + + g_TeamInfo[j].players++; + } + + // clear out any empty teams + for ( i = 1; i <= m_iNumTeams; i++ ) + { + if ( g_TeamInfo[i].players < 1 ) + memset( &g_TeamInfo[i], 0, sizeof(team_info_t) ); + } + + // Update the scoreboard + Update(); +} + + +void ScorePanel::FillGrid() +{ + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + SchemeHandle_t hScheme = pSchemes->getSchemeHandle("Scoreboard Text"); + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle("Scoreboard Title Text"); + SchemeHandle_t hSmallScheme = pSchemes->getSchemeHandle("Scoreboard Small Text"); + SchemeHandle_t hTinyScheme = pSchemes->getSchemeHandle("Scoreboard Tiny Text"); + + Font *sfont = pSchemes->getFont(hScheme); + Font *tfont = pSchemes->getFont(hTitleScheme); + Font *smallfont = pSchemes->getFont(hSmallScheme); + Font *tinyfont = pSchemes->getFont(hTinyScheme); + + // update highlight position + int x, y; + getApp()->getCursorPos(x, y); + cursorMoved(x, y, this); + + // remove highlight row if we're not in squelch mode + if (!GetClientVoiceMgr()->IsInSquelchMode()) + { + m_iHighlightRow = -1; + } + + bool bNextRowIsGap = false; + + for(int row=0; row < NUM_ROWS; row++) + { + CGrid *pGridRow = &m_PlayerGrids[row]; + pGridRow->SetRowUnderline(0, false, 0, 0, 0, 0, 0); + + if(row >= m_iRows) + { + for(int col=0; col < NUM_COLUMNS; col++) + m_PlayerEntries[col][row].setVisible(false); + + continue; + } + + bool bRowIsGap = false; + if (bNextRowIsGap) + { + bNextRowIsGap = false; + bRowIsGap = true; + } + + // Get the player's data + int theSortedRow = m_iSortedRows[row]; + hud_player_info_t* pl_info = &g_PlayerInfoList[theSortedRow]; + extra_player_info_t* theExtraPlayerInfo = &g_PlayerExtraInfo[theSortedRow]; + int thePlayerClass = theExtraPlayerInfo->playerclass; + short thePlayerAuthentication = theExtraPlayerInfo->auth; + int theIconColor = theExtraPlayerInfo->color; + bool thePlayerIsDead = (thePlayerClass == (int)(PLAYERCLASS_DEAD_MARINE)) || (thePlayerClass == (int)(PLAYERCLASS_DEAD_ALIEN)) || (thePlayerClass == (int)(PLAYERCLASS_REINFORCING)); + short theTeamNumber = theExtraPlayerInfo->teamnumber; + string theCustomIcon = (string)theExtraPlayerInfo->customicon; + + // Code to test DEBUG +#if 0 + #ifdef DEBUG + extern int gGlobalDebugAuth; + thePlayerAuthentication = 1; + thePlayerAuthentication <<= gGlobalDebugAuth; + #endif +#endif + + team_info_t* team_info = &g_TeamInfo[m_iSortedRows[row]]; + int theColorIndex = theTeamNumber % iNumberOfTeamColors; + + int theLocalPlayerTeam = 0; + if(gEngfuncs.GetLocalPlayer()) + { + theLocalPlayerTeam = gEngfuncs.GetLocalPlayer()->curstate.team; + } + + for(int col=0; col < NUM_COLUMNS; col++) + { + CLabelHeader *pLabel = &m_PlayerEntries[col][row]; + + pLabel->setVisible(true); + pLabel->setText2(""); + pLabel->setImage(NULL); + pLabel->setFont(sfont); + pLabel->setTextOffset(0, 0); + + int rowheight = 13; + if (ScreenHeight() > 480) + { + rowheight = YRES(rowheight); + } + else + { + // more tweaking, make sure icons fit at low res + rowheight = 15; + } + pLabel->setSize(pLabel->getWide(), rowheight); + pLabel->setBgColor(0, 0, 0, 255); + + char sz[128]; + + // This could be zero if the player hits tab before getting the first message from the server + //ASSERT(this->m_iNumTeams > 0); + + // Get the team's data +// team_info_t* team_info = &g_TeamInfo[0]; +// for(int i = 0; i < this->m_iNumTeams; i++) +// { +// team_info_t* theCurrentTeam = &g_TeamInfo[i+1]; +// if(theCurrentTeam->teamnumber == theTeamNumber) +// { +// team_info = theCurrentTeam; +// break; +// } +// } + + Color gammaAdjustedTeamColor = BuildColor(kTeamColors[theColorIndex][0], kTeamColors[theColorIndex][1], kTeamColors[theColorIndex][2], gHUD.GetGammaSlope()); + pLabel->setFgColor(gammaAdjustedTeamColor[0], gammaAdjustedTeamColor[1], gammaAdjustedTeamColor[2], 0); + + if (m_iIsATeam[row] == TEAM_BLANK) + { + pLabel->setText(" "); + continue; + } + else if ( m_iIsATeam[row] == TEAM_YES ) + { + theColorIndex = team_info->teamnumber % iNumberOfTeamColors; + + // team color text for team names + + + + // different height for team header rows + rowheight = 20; + if (ScreenHeight() >= 480) + { + rowheight = YRES(rowheight); + } + pLabel->setSize(pLabel->getWide(), rowheight); + pLabel->setFont(tfont); + + pGridRow->SetRowUnderline( 0, + true, + YRES(3), + gammaAdjustedTeamColor[0], + gammaAdjustedTeamColor[1], + gammaAdjustedTeamColor[2], + 0 ); + } + else if ( m_iIsATeam[row] == TEAM_SPECTATORS ) + { + // grey text for spectators + pLabel->setFgColor(100, 100, 100, 0); + + // different height for team header rows + rowheight = 20; + if (ScreenHeight() >= 480) + { + rowheight = YRES(rowheight); + } + pLabel->setSize(pLabel->getWide(), rowheight); + pLabel->setFont(tfont); + + pGridRow->SetRowUnderline(0, true, YRES(3), 100, 100, 100, 0); + } + else + { + if(thePlayerIsDead) + { + pLabel->setFgColor(255, 0, 0, 0); + } + else + { + // team color text for player names + pLabel->setFgColor(gammaAdjustedTeamColor[0], gammaAdjustedTeamColor[1], gammaAdjustedTeamColor[2], 0); + } + + // Set background color + if ( pl_info && pl_info->thisplayer ) // if it is their name, draw it a different color + { + // Highlight this player + pLabel->setFgColor(Scheme::sc_white); + pLabel->setBgColor(gammaAdjustedTeamColor[0], gammaAdjustedTeamColor[1], gammaAdjustedTeamColor[2], 196 ); + } + else if ( theSortedRow == m_iLastKilledBy && m_fLastKillTime && m_fLastKillTime > gHUD.m_flTime ) + { + // Killer's name + pLabel->setBgColor( 255,0,0, 255 - ((float)15 * (float)(m_fLastKillTime - gHUD.m_flTime)) ); + } + } + + // Align + switch(col) + { + case COLUMN_NAME: + case COLUMN_CLASS: + pLabel->setContentAlignment( vgui::Label::a_west ); + break; + + case COLUMN_TRACKER: + case COLUMN_RANK_ICON: + case COLUMN_VOICE: + pLabel->setContentAlignment( vgui::Label::a_center ); + break; + + case COLUMN_SCORE: + case COLUMN_KILLS: + case COLUMN_DEATHS: + case COLUMN_LATENCY: + default: + pLabel->setContentAlignment( vgui::Label::a_east ); + break; + } + + // Fill out with the correct data + strcpy(sz, ""); + if ( m_iIsATeam[row] ) + { + char sz2[128]; + + switch (col) + { + case COLUMN_NAME: + if ( m_iIsATeam[row] == TEAM_SPECTATORS ) + { + sprintf( sz2, CHudTextMessage::BufferedLocaliseTextString( "#Spectators" ) ); + } + else + { + if(team_info) + { + sprintf( sz2, gViewPort->GetTeamName(team_info->teamnumber) ); + } + } + + strcpy(sz, sz2); + + // Append the number of players + if ( m_iIsATeam[row] == TEAM_YES && team_info) + { + if (team_info->players == 1) + { + sprintf(sz2, "(%d %s)", team_info->players, CHudTextMessage::BufferedLocaliseTextString( "#Player" ) ); + } + else + { + sprintf(sz2, "(%d %s)", team_info->players, CHudTextMessage::BufferedLocaliseTextString( "#Player_plural" ) ); + } + + pLabel->setText2(sz2); + pLabel->setFont2(smallfont); + } + break; + case COLUMN_VOICE: + break; + case COLUMN_CLASS: + break; + case COLUMN_SCORE: + // Don't show score for enemies unless spectating or in RR + if ((m_iIsATeam[row] == TEAM_YES) && team_info && ((theLocalPlayerTeam == 0) || (theLocalPlayerTeam == team_info->teamnumber))) + sprintf(sz, "%d", team_info->score); + break; + case COLUMN_KILLS: + if ((m_iIsATeam[row] == TEAM_YES) && team_info) + sprintf(sz, "%d", team_info->frags ); + break; + case COLUMN_DEATHS: + if ((m_iIsATeam[row] == TEAM_YES) && team_info) + sprintf(sz, "%d", team_info->deaths ); + break; + case COLUMN_LATENCY: + if ((m_iIsATeam[row] == TEAM_YES) && team_info) + sprintf(sz, "%d", team_info->ping ); + break; + default: + break; + } + } + else + { + // Are these stats for an enemy? Score and other stats shouldn't be drawn for enemies. + bool theIsForEnemy = false; + + int theLocalPlayerTeam = 0; + if(gEngfuncs.GetLocalPlayer()) + { + theLocalPlayerTeam = gEngfuncs.GetLocalPlayer()->curstate.team; + } + + if((theLocalPlayerTeam != 0) && (theExtraPlayerInfo->teamnumber != theLocalPlayerTeam)) + { + theIsForEnemy = true; + } + + switch (col) + { + case COLUMN_NAME: + + if (g_pTrackerUser) + { + int playerSlot = m_iSortedRows[row]; + int trackerID = gEngfuncs.GetTrackerIDForPlayer(playerSlot); + const char *trackerName = g_pTrackerUser->GetUserName(trackerID); + if (trackerName && *trackerName) + { + sprintf(sz, " (%s)", trackerName); + pLabel->setText2(sz); + } + } + + if(pl_info) + { + sprintf(sz, "%s ", pl_info->name); + } + break; + case COLUMN_VOICE: + sz[0] = 0; + // in HLTV mode allow spectator to turn on/off commentator voice + if (pl_info && (!pl_info->thisplayer || gEngfuncs.IsSpectateOnly())) + { + GetClientVoiceMgr()->UpdateSpeakerImage(pLabel, theSortedRow); + } + break; + case COLUMN_CLASS: + // No class for other team's members (unless allied or spectator, and make sure player is on our team) + strcpy(sz, ""); + + if(team_info && ((theLocalPlayerTeam == theTeamNumber) || (gHUD.GetPlayMode() == PLAYMODE_OBSERVER))) + { + switch(thePlayerClass) + { + case (int)(PLAYERCLASS_DEAD_MARINE): + case (int)(PLAYERCLASS_DEAD_ALIEN): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassDead)); + break; + case (int)(PLAYERCLASS_REINFORCING): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassReinforcing)); + break; + case (int)(PLAYERCLASS_REINFORCINGCOMPLETE): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassReinforcingComplete)); + break; + case (int)(PLAYERCLASS_ALIVE_JETPACK_MARINE): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassJetpackMarine)); + break; + case (int)(PLAYERCLASS_ALIVE_HEAVY_MARINE): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassHeavyMarine)); + break; + case (int)(PLAYERCLASS_COMMANDER): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassCommander)); + break; + case (int)(PLAYERCLASS_ALIVE_LEVEL1): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassLevel1)); + break; + case (int)(PLAYERCLASS_ALIVE_LEVEL2): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassLevel2)); + break; + case (int)(PLAYERCLASS_ALIVE_LEVEL3): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassLevel3)); + break; + case (int)(PLAYERCLASS_ALIVE_LEVEL4): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassLevel4)); + break; + case (int)(PLAYERCLASS_ALIVE_LEVEL5): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassLevel5)); + break; + case (int)(PLAYERCLASS_ALIVE_DIGESTING): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassDigesting)); + break; + case (int)(PLAYERCLASS_ALIVE_GESTATING): + sprintf(sz, "%s", CHudTextMessage::BufferedLocaliseTextString(kClassGestating)); + break; + default: + break; + } + } + break; + + case COLUMN_RANK_ICON: + if(thePlayerAuthentication & PLAYERAUTH_UPP_MODE) + { + if(g_pTrackerUser) + { + int playerSlot = theSortedRow; + int trackerID = gEngfuncs.GetTrackerIDForPlayer(playerSlot); + + if (g_pTrackerUser->IsFriend(trackerID) && trackerID != g_pTrackerUser->GetTrackerID()) + { + pLabel->setImage(m_pTrackerIcon); + pLabel->setFgColorAsImageColor(false); + m_pTrackerIcon->setColor(Color(255, 255, 255, 0)); + } + } + else + { + //find the filename + short theIconNameBytes = (thePlayerAuthentication & ~PLAYERAUTH_UPP_MODE); + string theIconName; + MakeHexPairsFromBytes((unsigned char*)&theIconNameBytes,theIconName,2); + theIconName = string("gfx/vgui/icons/") + theIconName + string(".tga"); + + //find the color - 2 bits apiece for R,G,B + int theColor[3] = {0,0,0}; + theColor[0] = ((theIconColor >> 6) & 0x03) * 64; //Red + theColor[1] = ((theIconColor >> 4) & 0x03) * 64; //Green + theColor[2] = ((theIconColor >> 2) & 0x03) * 64; //Blue + + //remaining two bits are fine granularity brightness shift for all three colors + int brightness_shift = (theIconColor & 0x03) * 16; + float max = max(theColor[0],max(theColor[1],theColor[2])); + theColor[0] += ((int)(theColor[0]/max))*brightness_shift; + theColor[1] += ((int)(theColor[1]/max))*brightness_shift; + theColor[2] += ((int)(theColor[2]/max))*brightness_shift; + + vgui::BitmapTGA *pIcon = GetIconPointer(theIconName); + + //Icon hasnt been loaded, load it now and add it to list of icons. + if(pIcon == NULL) + { + pIcon = vgui_LoadTGANoInvertAlpha(theIconName.c_str()); + + if(pIcon) + m_CustomIconList.push_back( make_pair(pIcon, theIconName) ); + } + + //set the icon + color + if(pIcon) + { + pLabel->setImage(pIcon); + pLabel->setFgColorAsImageColor(false); + pIcon->setColor(BuildColor(theColor[0],theColor[1],theColor[2], gHUD.GetGammaSlope())); + } + } + } + else //NOT UPP + { + // Check if we have authority. Right now these override the tracker icons. Listed in increasing order of "importance". + if(thePlayerAuthentication & PLAYERAUTH_CHEATINGDEATH) + { + // Red + pLabel->setImage(m_pCheatingDeathIcon); + pLabel->setFgColorAsImageColor(false); + m_pCheatingDeathIcon->setColor(BuildColor(255, 69, 9, gHUD.GetGammaSlope())); + } + if(thePlayerAuthentication & PLAYERAUTH_VETERAN) + { + // Yellow + pLabel->setImage(m_pVeteranIcon); + pLabel->setFgColorAsImageColor(false); + m_pVeteranIcon->setColor(BuildColor(248, 252, 0, gHUD.GetGammaSlope())); + } + if(thePlayerAuthentication & PLAYERAUTH_BETASERVEROP) + { + // Whitish + pLabel->setImage(m_pServerOpIcon); + pLabel->setFgColorAsImageColor(false); + m_pServerOpIcon->setColor(BuildColor(220, 220, 220, gHUD.GetGammaSlope())); + } + if(thePlayerAuthentication & PLAYERAUTH_CONTRIBUTOR) + { + // Light blue + pLabel->setImage(m_pContribIcon); + pLabel->setFgColorAsImageColor(false); + m_pContribIcon->setColor(BuildColor(117, 214, 241, gHUD.GetGammaSlope())); + } + if(thePlayerAuthentication & PLAYERAUTH_GUIDE) + { + // Magenta + pLabel->setImage(m_pGuideIcon); + pLabel->setFgColorAsImageColor(false); + m_pGuideIcon->setColor(BuildColor(208, 16, 190, gHUD.GetGammaSlope())); + } + if(thePlayerAuthentication & PLAYERAUTH_PLAYTESTER) + { + // Orange + pLabel->setImage(m_pPTIcon); + pLabel->setFgColorAsImageColor(false); + m_pPTIcon->setColor(BuildColor(255, 167, 54, gHUD.GetGammaSlope())); + } + if(thePlayerAuthentication & PLAYERAUTH_DEVELOPER) + { + // TSA blue + pLabel->setImage(m_pDevIcon); + pLabel->setFgColorAsImageColor(false); + m_pDevIcon->setColor(BuildColor(100, 215, 255, gHUD.GetGammaSlope())); + } + + if(thePlayerAuthentication & PLAYERAUTH_SERVEROP) + { + // Bright green + pLabel->setImage(m_pServerOpIcon); + pLabel->setFgColorAsImageColor(false); + m_pServerOpIcon->setColor(BuildColor(0, 255, 0, gHUD.GetGammaSlope())); + } + + // Allow custom icons to override other general icons + if(thePlayerAuthentication & PLAYERAUTH_CUSTOM) + { + if(theCustomIcon != "") + { + string theIconName = theCustomIcon.substr(0, strlen(theCustomIcon.c_str()) - 3); + string theFullCustomIconString = string("gfx/vgui/640_") + theIconName + string(".tga"); + + vgui::BitmapTGA *pIcon = GetIconPointer(theCustomIcon); + + //Icon hasnt been loaded, load it now and add it to list of icons. + if(pIcon == NULL) + { + pIcon = vgui_LoadTGANoInvertAlpha(theFullCustomIconString.c_str()); + + if(pIcon) + m_CustomIconList.push_back( make_pair(pIcon, theCustomIcon) ); + } + + if(pIcon) + { + pLabel->setImage(pIcon); + pLabel->setFgColorAsImageColor(false); + + // Parse color (last 3 bytes are the RGB values 1-9) + string theColor = theCustomIcon.substr( strlen(theCustomIcon.c_str())-3, 3); + int theRed = (MakeIntFromString(theColor.substr(0, 1))/9.0f)*255; + int theGreen = (MakeIntFromString(theColor.substr(1, 1))/9.0f)*255; + int theBlue = (MakeIntFromString(theColor.substr(2, 1))/9.0f)*255; + + pIcon->setColor(BuildColor(theRed, theGreen, theBlue, gHUD.GetGammaSlope())); + } + } + } + + if(g_pTrackerUser) + { + int playerSlot = theSortedRow; + int trackerID = gEngfuncs.GetTrackerIDForPlayer(playerSlot); + + if (g_pTrackerUser->IsFriend(trackerID) && trackerID != g_pTrackerUser->GetTrackerID()) + { + pLabel->setImage(m_pTrackerIcon); + pLabel->setFgColorAsImageColor(false); + m_pTrackerIcon->setColor(Color(255, 255, 255, 0)); + } + } + } + break; + case COLUMN_SCORE: + if(!theIsForEnemy) + { + const float kDeltaDisplayTime = 3.0f; + float theTimeSinceChange = gHUD.GetTimeOfLastUpdate() - theExtraPlayerInfo->timeOfLastScoreChange; + if((theExtraPlayerInfo->score > theExtraPlayerInfo->lastScore) && (theTimeSinceChange > 0) && (theTimeSinceChange < kDeltaDisplayTime) && (theExtraPlayerInfo->teamnumber != 0)) + { + // draw score with change + int theDelta = (theExtraPlayerInfo->score - theExtraPlayerInfo->lastScore); + sprintf(sz, "(+%d) %d", theDelta, theExtraPlayerInfo->score); + } + else + { + sprintf(sz, "%d", theExtraPlayerInfo->score); + } + + } + break; + + case COLUMN_KILLS: + sprintf(sz, "%d", theExtraPlayerInfo->frags); + break; + + case COLUMN_DEATHS: + sprintf(sz, "%d", theExtraPlayerInfo->deaths); + break; + case COLUMN_LATENCY: + if(pl_info) + { + sprintf(sz, "%d", pl_info->ping ); + } + break; + default: + break; + } + } + + pLabel->setText(sz); + } + } + + for(row=0; row < NUM_ROWS; row++) + { + CGrid *pGridRow = &m_PlayerGrids[row]; + + pGridRow->AutoSetRowHeights(); + pGridRow->setSize(PanelWidth(pGridRow), pGridRow->CalcDrawHeight()); + pGridRow->RepositionContents(); + } + + // hack, for the thing to resize + m_PlayerList.getSize(x, y); + m_PlayerList.setSize(x, y); +} + + +//----------------------------------------------------------------------------- +// Purpose: Setup highlights for player names in scoreboard +//----------------------------------------------------------------------------- +void ScorePanel::DeathMsg( int killer, int victim ) +{ + // if we were the one killed, or the world killed us, set the scoreboard to indicate suicide + if ( victim == m_iPlayerNum || killer == 0 ) + { + m_iLastKilledBy = killer ? killer : m_iPlayerNum; + m_fLastKillTime = gHUD.m_flTime + 10; // display who we were killed by for 10 seconds + + if ( killer == m_iPlayerNum ) + m_iLastKilledBy = m_iPlayerNum; + } +} + + +void ScorePanel::Open( void ) +{ + RebuildTeams(); + setVisible(true); + m_HitTestPanel.setVisible(true); +} + +bool ScorePanel::SetSquelchMode(bool inMode) +{ + bool theSuccess = false; + + if(inMode && !GetClientVoiceMgr()->IsInSquelchMode()) + { + GetClientVoiceMgr()->StartSquelchMode(); + m_HitTestPanel.setVisible(false); + theSuccess = true; + } + else if(!inMode && GetClientVoiceMgr()->IsInSquelchMode()) + { + GetClientVoiceMgr()->StopSquelchMode(); + theSuccess = true; + } + + return theSuccess; +} + +void ScorePanel::mousePressed(MouseCode code, Panel* panel) +{ + if(gHUD.m_iIntermission) + return; + + if (!GetClientVoiceMgr()->IsInSquelchMode()) + { + //GetClientVoiceMgr()->StartSquelchMode(); + //m_HitTestPanel.setVisible(false); + this->SetSquelchMode(true); + } + else if (m_iHighlightRow >= 0) + { + // mouse has been pressed, toggle mute state + int iPlayer = m_iSortedRows[m_iHighlightRow]; + if (iPlayer > 0) + { + // print text message + hud_player_info_t *pl_info = &g_PlayerInfoList[iPlayer]; + + if (pl_info && pl_info->name && pl_info->name[0]) + { + char string[256]; + if (GetClientVoiceMgr()->IsPlayerBlocked(iPlayer)) + { + char string1[1024]; + + // remove mute + GetClientVoiceMgr()->SetPlayerBlockedState(iPlayer, false); + + sprintf( string1, CHudTextMessage::BufferedLocaliseTextString( "#Unmuted" ), pl_info->name ); + sprintf( string, "%c** %s\n", HUD_PRINTTALK, string1 ); + + gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, strlen(string)+1, string ); + } + else + { + char string1[1024]; + char string2[1024]; + + // mute the player + GetClientVoiceMgr()->SetPlayerBlockedState(iPlayer, true); + + sprintf( string1, CHudTextMessage::BufferedLocaliseTextString( "#Muted" ), pl_info->name ); + sprintf( string2, CHudTextMessage::BufferedLocaliseTextString( "#No_longer_hear_that_player" ) ); + sprintf( string, "%c** %s %s\n", HUD_PRINTTALK, string1, string2 ); + + gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, strlen(string)+1, string ); + } + } + } + } +} + +void ScorePanel::cursorMoved(int x, int y, Panel *panel) +{ + if (GetClientVoiceMgr()->IsInSquelchMode()) + { + // look for which cell the mouse is currently over + for (int i = 0; i < NUM_ROWS; i++) + { + int row, col; + if (m_PlayerGrids[i].getCellAtPoint(x, y, row, col)) + { + MouseOverCell(i, col); + return; + } + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Handles mouse movement over a cell +// Input : row - +// col - +//----------------------------------------------------------------------------- +void ScorePanel::MouseOverCell(int row, int col) +{ + CLabelHeader *label = &m_PlayerEntries[col][row]; + + // clear the previously highlighted label + if (m_pCurrentHighlightLabel != label) + { + m_pCurrentHighlightLabel = NULL; + m_iHighlightRow = -1; + } + if (!label) + return; + + // don't act on teams + if (m_iIsATeam[row] != TEAM_IND) + return; + + // don't act on disconnected players or ourselves + hud_player_info_t *pl_info = &g_PlayerInfoList[ m_iSortedRows[row] ]; + if (!pl_info->name || !pl_info->name[0]) + return; + + if (pl_info->thisplayer && !gEngfuncs.IsSpectateOnly() ) + return; + + // only act on audible players + if (!GetClientVoiceMgr()->IsPlayerAudible(m_iSortedRows[row])) + return; + + // setup the new highlight + m_pCurrentHighlightLabel = label; + m_iHighlightRow = row; +} + +//----------------------------------------------------------------------------- +// Purpose: Label paint functions - take into account current highligh status +//----------------------------------------------------------------------------- +void CLabelHeader::paintBackground() +{ + Color oldBg; + getBgColor(oldBg); + + if (gViewPort->GetScoreBoard()->m_iHighlightRow == _row) + { + setBgColor(134, 91, 19, 0); + } + + Panel::paintBackground(); + + setBgColor(oldBg); +} + + +//----------------------------------------------------------------------------- +// Purpose: Label paint functions - take into account current highligh status +//----------------------------------------------------------------------------- +void CLabelHeader::paint() +{ + Color oldFg; + getFgColor(oldFg); + + if (gViewPort->GetScoreBoard()->m_iHighlightRow == _row) + { + setFgColor(255, 255, 255, 0); + } + + // draw text + int x, y, iwide, itall; + getTextSize(iwide, itall); + calcAlignment(iwide, itall, x, y); + _dualImage->setPos(x, y); + + int x1, y1; + _dualImage->GetImage(1)->getPos(x1, y1); + _dualImage->GetImage(1)->setPos(_gap, y1); + + _dualImage->doPaint(this); + + // get size of the panel and the image + if (_image) + { + Color imgColor; + getFgColor( imgColor ); + if( _useFgColorAsImageColor ) + { + _image->setColor( imgColor ); + } + _image->getSize(iwide, itall); + calcAlignment(iwide, itall, x, y); + _image->setPos(x, y); + _image->doPaint(this); + } + + setFgColor(oldFg[0], oldFg[1], oldFg[2], oldFg[3]); +} + + +void CLabelHeader::calcAlignment(int iwide, int itall, int &x, int &y) +{ + // calculate alignment ourselves, since vgui is so broken + int wide, tall; + getSize(wide, tall); + + x = 0, y = 0; + + // align left/right + switch (_contentAlignment) + { + // left + case Label::a_northwest: + case Label::a_west: + case Label::a_southwest: + { + x = 0; + break; + } + + // center + case Label::a_north: + case Label::a_center: + case Label::a_south: + { + x = (wide - iwide) / 2; + break; + } + + // right + case Label::a_northeast: + case Label::a_east: + case Label::a_southeast: + { + x = wide - iwide; + break; + } + } + + // top/down + switch (_contentAlignment) + { + // top + case Label::a_northwest: + case Label::a_north: + case Label::a_northeast: + { + y = 0; + break; + } + + // center + case Label::a_west: + case Label::a_center: + case Label::a_east: + { + y = (tall - itall) / 2; + break; + } + + // south + case Label::a_southwest: + case Label::a_south: + case Label::a_southeast: + { + y = tall - itall; + break; + } + } + +// don't clip to Y +// if (y < 0) +// { +// y = 0; +// } + if (x < 0) + { + x = 0; + } + + x += _offset[0]; + y += _offset[1]; +} diff --git a/main/source/cl_dll/vgui_ScorePanel.h b/main/source/cl_dll/vgui_ScorePanel.h new file mode 100644 index 00000000..a865da93 --- /dev/null +++ b/main/source/cl_dll/vgui_ScorePanel.h @@ -0,0 +1,166 @@ + +#ifndef SCOREPANEL_H +#define SCOREPANEL_H + +#include +#include +#include +#include +#include +#include +#include "..\game_shared\vgui_listbox.h" + +#include + +#define MAX_SCORES 10 +#define MAX_SCOREBOARD_TEAMS 5 + +// Scoreboard cells +#define COLUMN_TRACKER 0 +#define COLUMN_RANK_ICON 1 +#define COLUMN_NAME 2 +#define COLUMN_CLASS 3 +#define COLUMN_SCORE 4 +#define COLUMN_KILLS 5 +#define COLUMN_DEATHS 6 +#define COLUMN_LATENCY 7 +#define COLUMN_VOICE 8 +#define COLUMN_BLANK 9 +#define NUM_COLUMNS 10 +#define NUM_ROWS (MAX_PLAYERS + (MAX_SCOREBOARD_TEAMS * 2)) + +using namespace vgui; + +#include "cl_dll/CLabelHeader.h" + +class ScoreTablePanel; + +#include "..\game_shared\vgui_grid.h" +#include "..\game_shared\vgui_defaultinputsignal.h" + +//----------------------------------------------------------------------------- +// Purpose: Scoreboard back panel +//----------------------------------------------------------------------------- +class ScorePanel : public Panel, public vgui::CDefaultInputSignal +{ +private: + // Default panel implementation doesn't forward mouse messages when there is no cursor and we need them. + class HitTestPanel : public Panel + { + public: + virtual void internalMousePressed(MouseCode code); + }; + + +private: + + Label m_TitleLabel; + + // Here is how these controls are arranged hierarchically. + // m_HeaderGrid + // m_HeaderLabels + + // m_PlayerGridScroll + // m_PlayerGrid + // m_PlayerEntries + + CGrid m_HeaderGrid; + CLabelHeader m_HeaderLabels[NUM_COLUMNS]; // Labels above the + CLabelHeader *m_pCurrentHighlightLabel; + int m_iHighlightRow; + + vgui::CListBox m_PlayerList; + CGrid m_PlayerGrids[NUM_ROWS]; // The grid with player and team info. + CLabelHeader m_PlayerEntries[NUM_COLUMNS][NUM_ROWS]; // Labels for the grid entries. + + ScorePanel::HitTestPanel m_HitTestPanel; + CommandButton *m_pCloseButton; + CLabelHeader* GetPlayerEntry(int x, int y) {return &m_PlayerEntries[x][y];} + + vgui::BitmapTGA *m_pTrackerIcon; + + vgui::BitmapTGA *m_pDevIcon; + vgui::BitmapTGA *m_pPTIcon; + vgui::BitmapTGA *m_pGuideIcon; + vgui::BitmapTGA *m_pServerOpIcon; + vgui::BitmapTGA *m_pContribIcon; + vgui::BitmapTGA *m_pCheatingDeathIcon; + vgui::BitmapTGA *m_pVeteranIcon; + vector< pair > m_CustomIconList; + +public: + + int m_iNumTeams; + int m_iPlayerNum; + int m_iShowscoresHeld; + + int m_iRows; + int m_iSortedRows[NUM_ROWS]; + int m_iIsATeam[NUM_ROWS]; + bool m_bHasBeenSorted[MAX_PLAYERS]; + int m_iLastKilledBy; + int m_fLastKillTime; +public: + + ScorePanel(int x,int y,int wide,int tall); + + void Update( void ); + + void SortTeams( void ); + void SortActivePlayers(char* inTeam, bool inSortByEntityIndex = false); + void SortPlayers( int iTeam, char *team, bool inSortByEntityIndex = false); + void RebuildTeams( void ); + bool SetSquelchMode(bool inMode); + + void FillGrid(); + + void DeathMsg( int killer, int victim ); + + void Initialize( void ); + + void Open( void ); + + void MouseOverCell(int row, int col); + +// InputSignal overrides. +public: + + virtual void mousePressed(MouseCode code, Panel* panel); + virtual void cursorMoved(int x, int y, Panel *panel); + + vgui::BitmapTGA *GetIconPointer(string inIconName) + { + vgui::BitmapTGA *pIcon = NULL; + + for (int i = 0; i < m_CustomIconList.size(); i++) + { + if(inIconName == m_CustomIconList[i].second) + { + if(m_CustomIconList[i].first) + { + pIcon = m_CustomIconList[i].first; + break; + } + } + } + return pIcon; + } + + void DeleteCustomIcons( void ) + { + for (int i = 0; i < m_CustomIconList.size(); i++) + { + if(m_CustomIconList[i].first) + delete m_CustomIconList[i].first; + + m_CustomIconList[i].first = NULL; + m_CustomIconList[i].second = ""; + } + + m_CustomIconList.clear(); + }; + + friend CLabelHeader; +}; + +#endif diff --git a/main/source/cl_dll/vgui_ServerBrowser.cpp b/main/source/cl_dll/vgui_ServerBrowser.cpp new file mode 100644 index 00000000..0db0d4c5 --- /dev/null +++ b/main/source/cl_dll/vgui_ServerBrowser.cpp @@ -0,0 +1,617 @@ + +#include +#include +#include +#include +#include +#include + +#include "hud.h" +#include "cl_util.h" +#include "hud_servers.h" +#include "net_api.h" + +#include "vgui_TeamFortressViewport.h" +#include "vgui_ServerBrowser.h" + +using namespace vgui; + +namespace +{ + +#define MAX_SB_ROWS 24 + +#define NUM_COLUMNS 5 + +#define HEADER_SIZE_Y YRES(18) + +// Column sizes +#define CSIZE_ADDRESS XRES(200) +#define CSIZE_SERVER XRES(400) +#define CSIZE_MAP XRES(500) +#define CSIZE_CURRENT XRES(570) +#define CSIZE_PING XRES(640) + +#define CELL_HEIGHT YRES(15) + +class ServerBrowserTablePanel; + +class CBrowser_InputSignal : public InputSignal +{ +private: + ServerBrowserTablePanel *m_pBrowser; +public: + CBrowser_InputSignal( ServerBrowserTablePanel *pBrowser ) + { + m_pBrowser = pBrowser; + } + + virtual void cursorMoved(int x,int y,Panel* panel) {}; + virtual void cursorEntered(Panel* panel){}; + virtual void cursorExited(Panel* Panel) {}; + + virtual void mousePressed(MouseCode code,Panel* panel); + + virtual void mouseDoublePressed(MouseCode code,Panel* panel); + virtual void mouseReleased(MouseCode code,Panel* panel) {}; + virtual void mouseWheeled(int delta,Panel* panel) {}; + virtual void keyPressed(KeyCode code,Panel* panel) {}; + virtual void keyTyped(KeyCode code,Panel* panel) {}; + virtual void keyReleased(KeyCode code,Panel* panel) {}; + virtual void keyFocusTicked(Panel* panel) {}; +}; + +class ServerBrowserTablePanel : public TablePanel +{ +private: + Label *m_pLabel; + int m_nMouseOverRow; + +public: + + ServerBrowserTablePanel( int x,int y,int wide,int tall,int columnCount) : TablePanel( x,y,wide,tall,columnCount) + { + m_pLabel = new Label( "", 0, 0 /*,wide, tall*/ ); + + m_nMouseOverRow = 0; + } + +public: + void setMouseOverRow( int row ) + { + m_nMouseOverRow = row; + } + + void DoSort( char *sortkey ) + { + // Request server list and refresh servers... + SortServers( sortkey ); + } + + void DoRefresh( void ) + { + // Request server list and refresh servers... + ServersList(); + BroadcastServersList( 0 ); + } + + void DoBroadcastRefresh( void ) + { + // Request server list and refresh servers... + BroadcastServersList( 1 ); + } + + void DoStop( void ) + { + // Stop requesting + ServersCancel(); + } + + void DoCancel( void ) + { + ClientCmd( "togglebrowser\n" ); + } + + void DoConnect( void ) + { + const char *info; + const char *address; + char sz[ 256 ]; + + info = ServersGetInfo( m_nMouseOverRow ); + if ( !info ) + return; + + address = gEngfuncs.pNetAPI->ValueForKey( info, "address" ); + //gEngfuncs.Con_Printf( "Connecting to %s\n", address ); + + sprintf( sz, "connect %s\n", address ); + + ClientCmd( sz ); + + DoCancel(); + } + + void DoPing( void ) + { + ServerPing( 0 ); + ServerRules( 0 ); + ServerPlayers( 0 ); + } + + virtual int getRowCount() + { + int rowcount; + int height, width; + + getSize( width, height ); + + // Space for buttons + height -= YRES(20); + height = max( 0, height ); + + rowcount = height / CELL_HEIGHT; + + return rowcount; + } + + virtual int getCellTall(int row) + { + return CELL_HEIGHT - 2; + } + + virtual Panel* getCellRenderer(int column,int row,bool columnSelected,bool rowSelected,bool cellSelected) + { + const char *info; + const char *val, *val2; + char sz[ 32 ]; + + info = ServersGetInfo( row ); + + if ( row == m_nMouseOverRow ) + { + m_pLabel->setFgColor( 200, 240, 63, 100 ); + } + else + { + m_pLabel->setFgColor( 255, 255, 255, 0 ); + } + m_pLabel->setBgColor( 0, 0, 0, 200 ); + m_pLabel->setContentAlignment( vgui::Label::a_west ); + m_pLabel->setFont( Scheme::sf_primary2 ); + + if ( info ) + { + // Fill out with the correct data + switch ( column ) + { + case 0: + val = gEngfuncs.pNetAPI->ValueForKey( info, "address" ); + if ( val ) + { + strncpy( sz, val, 31 ); + sz[ 31 ] = '\0'; + // Server Name; + m_pLabel->setText( sz ); + } + break; + case 1: + val = gEngfuncs.pNetAPI->ValueForKey( info, "hostname" ); + if ( val ) + { + strncpy( sz, val, 31 ); + sz[ 31 ] = '\0'; + // Server Map; + m_pLabel->setText( sz ); + } + break; + case 2: + val = gEngfuncs.pNetAPI->ValueForKey( info, "map" ); + if ( val ) + { + strncpy( sz, val, 31 ); + sz[ 31 ] = '\0'; + // Server Name; + m_pLabel->setText( sz ); + } + break; + case 3: + val = gEngfuncs.pNetAPI->ValueForKey( info, "current" ); + val2 = gEngfuncs.pNetAPI->ValueForKey( info, "max" ); + if ( val && val2 ) + { + sprintf( sz, "%s/%s", val, val2 ); + sz[ 31 ] = '\0'; + // Server Map; + m_pLabel->setText( sz ); + } + break; + case 4: + val = gEngfuncs.pNetAPI->ValueForKey( info, "ping" ); + if ( val ) + { + strncpy( sz, val, 31 ); + sz[ 31 ] = '\0'; + // Server Name; + m_pLabel->setText( sz ); + } + break; + default: + break; + } + } + else + { + if ( !row && !column ) + { + if ( ServersIsQuerying() ) + { + m_pLabel->setText( "Waiting for servers to respond..." ); + } + else + { + m_pLabel->setText( "Press 'Refresh' to search for servers..." ); + } + } + else + { + m_pLabel->setText( "" ); + } + } + + return m_pLabel; + } + + virtual Panel* startCellEditing(int column,int row) + { + return null; + } + +}; + +class ConnectHandler : public ActionSignal +{ +private: + ServerBrowserTablePanel *m_pBrowser; + +public: + ConnectHandler( ServerBrowserTablePanel *browser ) + { + m_pBrowser = browser; + } + + virtual void actionPerformed( Panel *panel ) + { + m_pBrowser->DoConnect(); + } +}; + +class RefreshHandler : public ActionSignal +{ +private: + ServerBrowserTablePanel *m_pBrowser; + +public: + RefreshHandler( ServerBrowserTablePanel *browser ) + { + m_pBrowser = browser; + } + + virtual void actionPerformed( Panel *panel ) + { + m_pBrowser->DoRefresh(); + } +}; + +class BroadcastRefreshHandler : public ActionSignal +{ +private: + ServerBrowserTablePanel *m_pBrowser; + +public: + BroadcastRefreshHandler( ServerBrowserTablePanel *browser ) + { + m_pBrowser = browser; + } + + virtual void actionPerformed( Panel *panel ) + { + m_pBrowser->DoBroadcastRefresh(); + } +}; + +class StopHandler : public ActionSignal +{ +private: + ServerBrowserTablePanel *m_pBrowser; + +public: + StopHandler( ServerBrowserTablePanel *browser ) + { + m_pBrowser = browser; + } + + virtual void actionPerformed( Panel *panel ) + { + m_pBrowser->DoStop(); + } +}; + +class CancelHandler : public ActionSignal +{ +private: + ServerBrowserTablePanel *m_pBrowser; + +public: + CancelHandler( ServerBrowserTablePanel *browser ) + { + m_pBrowser = browser; + } + + virtual void actionPerformed( Panel *panel ) + { + m_pBrowser->DoCancel(); + } +}; + +class PingHandler : public ActionSignal +{ +private: + ServerBrowserTablePanel *m_pBrowser; + +public: + PingHandler( ServerBrowserTablePanel *browser ) + { + m_pBrowser = browser; + } + + virtual void actionPerformed( Panel *panel ) + { + m_pBrowser->DoPing(); + } +}; + +class SortHandler : public ActionSignal +{ +private: + ServerBrowserTablePanel *m_pBrowser; + +public: + SortHandler( ServerBrowserTablePanel *browser ) + { + m_pBrowser = browser; + } + + virtual void actionPerformed( Panel *panel ) + { + m_pBrowser->DoSort( "map" ); + } +}; + +} + +class LabelSortInputHandler : public InputSignal +{ +private: + ServerBrowserTablePanel *m_pBrowser; + char m_szSortKey[ 64 ]; + +public: + LabelSortInputHandler( ServerBrowserTablePanel *pBrowser, char *name ) + { + m_pBrowser = pBrowser; + strcpy( m_szSortKey, name ); + } + + virtual void cursorMoved(int x,int y,Panel* panel) {}; + virtual void cursorEntered(Panel* panel){}; + virtual void cursorExited(Panel* Panel) {}; + + virtual void mousePressed(MouseCode code,Panel* panel) + { + m_pBrowser->DoSort( m_szSortKey ); + } + + virtual void mouseDoublePressed(MouseCode code,Panel* panel) + { + m_pBrowser->DoSort( m_szSortKey ); + } + + virtual void mouseReleased(MouseCode code,Panel* panel) {}; + virtual void mouseWheeled(int delta,Panel* panel) {}; + virtual void keyPressed(KeyCode code,Panel* panel) {}; + virtual void keyTyped(KeyCode code,Panel* panel) {}; + virtual void keyReleased(KeyCode code,Panel* panel) {}; + virtual void keyFocusTicked(Panel* panel) {}; +}; + +class CSBLabel : public Label +{ + +private: + char m_szSortKey[ 64 ]; + ServerBrowserTablePanel *m_pBrowser; + +public: + CSBLabel( char *name, char *sortkey ) : Label( name ) + { + m_pBrowser = NULL; + + strcpy( m_szSortKey, sortkey ); + + int label_bg_r = 120, + label_bg_g = 75, + label_bg_b = 32, + label_bg_a = 200; + + int label_fg_r = 255, + label_fg_g = 0, + label_fg_b = 0, + label_fg_a = 0; + + setContentAlignment( vgui::Label::a_west ); + setFgColor( label_fg_r, label_fg_g, label_fg_b, label_fg_a ); + setBgColor( label_bg_r, label_bg_g, label_bg_b, label_bg_a ); + setFont( Scheme::sf_primary2 ); + + } + + void setTable( ServerBrowserTablePanel *browser ) + { + m_pBrowser = browser; + + addInputSignal( new LabelSortInputHandler( (ServerBrowserTablePanel * )m_pBrowser, m_szSortKey ) ); + } +}; + +ServerBrowser::ServerBrowser(int x,int y,int wide,int tall) : CTransparentPanel( 100, x,y,wide,tall ) +{ + int i; + + _headerPanel = new HeaderPanel(0,0,wide,HEADER_SIZE_Y); + _headerPanel->setParent(this); + _headerPanel->setFgColor( 100,100,100, 100 ); + _headerPanel->setBgColor( 0, 0, 0, 100 ); + + CSBLabel *pLabel[5]; + + pLabel[0] = new CSBLabel( "Address", "address" ); + pLabel[1] = new CSBLabel( "Server", "hostname" ); + pLabel[2] = new CSBLabel( "Map", "map" ); + pLabel[3] = new CSBLabel( "Current", "current" ); + pLabel[4] = new CSBLabel( "Latency", "ping" ); + + for ( i = 0; i < 5; i++ ) + { + _headerPanel->addSectionPanel( pLabel[i] ); + } + + // _headerPanel->setFont( Scheme::sf_primary1 ); + + _headerPanel->setSliderPos( 0, CSIZE_ADDRESS ); + _headerPanel->setSliderPos( 1, CSIZE_SERVER ); + _headerPanel->setSliderPos( 2, CSIZE_MAP ); + _headerPanel->setSliderPos( 3, CSIZE_CURRENT ); + _headerPanel->setSliderPos( 4, CSIZE_PING ); + + _tablePanel = new ServerBrowserTablePanel( 0, HEADER_SIZE_Y, wide, tall - HEADER_SIZE_Y, NUM_COLUMNS ); + _tablePanel->setParent(this); + _tablePanel->setHeaderPanel(_headerPanel); + _tablePanel->setFgColor( 100,100,100, 100 ); + _tablePanel->setBgColor( 0, 0, 0, 100 ); + + _tablePanel->addInputSignal( new CBrowser_InputSignal( (ServerBrowserTablePanel *)_tablePanel ) ); + + for ( i = 0; i < 5; i++ ) + { + pLabel[i]->setTable( (ServerBrowserTablePanel * )_tablePanel ); + } + + int bw = 80, bh = 15; + int by = tall - HEADER_SIZE_Y; + + int btnx = 10; + + _connectButton = new CommandButton( "Connect", btnx, by, bw, bh ); + _connectButton->setParent( this ); + _connectButton->addActionSignal( new ConnectHandler( (ServerBrowserTablePanel * )_tablePanel ) ); + + btnx += bw; + + _refreshButton = new CommandButton( "Refresh", btnx, by, bw, bh ); + _refreshButton->setParent( this ); + _refreshButton->addActionSignal( new RefreshHandler( (ServerBrowserTablePanel * )_tablePanel ) ); + + /* + btnx += bw; + + _broadcastRefreshButton = new CommandButton( "LAN", btnx, by, bw, bh ); + _broadcastRefreshButton->setParent( this ); + _broadcastRefreshButton->addActionSignal( new BroadcastRefreshHandler( (ServerBrowserTablePanel * )_tablePanel ) ); + */ + + btnx += bw; + + _stopButton = new CommandButton( "Stop", btnx, by, bw, bh ); + _stopButton->setParent( this ); + _stopButton->addActionSignal( new StopHandler( (ServerBrowserTablePanel * )_tablePanel ) ); + + /* + btnx += bw; + + _pingButton = new CommandButton( "Test", btnx, by, bw, bh ); + _pingButton->setParent( this ); + _pingButton->addActionSignal( new PingHandler( (ServerBrowserTablePanel * )_tablePanel ) ); + + btnx += bw; + + _sortButton = new CommandButton( "Sort", btnx, by, bw, bh ); + _sortButton->setParent( this ); + _sortButton->addActionSignal( new SortHandler( (ServerBrowserTablePanel * )_tablePanel ) ); + */ + + btnx += bw; + + _cancelButton = new CommandButton( "Close", btnx, by, bw, bh ); + _cancelButton->setParent( this ); + _cancelButton->addActionSignal( new CancelHandler( (ServerBrowserTablePanel * )_tablePanel ) ); + + setPaintBorderEnabled(false); + setPaintBackgroundEnabled(false); + setPaintEnabled(false); + +} + +void ServerBrowser::setSize(int wide,int tall) +{ + Panel::setSize(wide,tall); + + _headerPanel->setBounds(0,0,wide,HEADER_SIZE_Y); + _tablePanel->setBounds(0,HEADER_SIZE_Y,wide,tall - HEADER_SIZE_Y); + + _connectButton->setBounds( 5, tall - HEADER_SIZE_Y, 75, 15 ); + _refreshButton->setBounds( 85, tall - HEADER_SIZE_Y, 75, 15 ); + /* + _broadcastRefreshButton->setBounds( 165, tall - HEADER_SIZE_Y, 75, 15 ); + */ + _stopButton->setBounds( 165, tall - HEADER_SIZE_Y, 75, 15 ); + /* + _pingButton->setBounds( 325, tall - HEADER_SIZE_Y, 75, 15 ); + */ + _cancelButton->setBounds( 245, tall - HEADER_SIZE_Y, 75, 15 ); +} + +void CBrowser_InputSignal::mousePressed(MouseCode code,Panel* panel) +{ + int x, y; + int therow = 2; + + if ( code != MOUSE_LEFT ) + return; + + panel->getApp()->getCursorPos(x,y); + panel->screenToLocal( x, y ); + + therow = y / CELL_HEIGHT; + + // Figure out which row it's on + m_pBrowser->setMouseOverRow( therow ); +} + +void CBrowser_InputSignal::mouseDoublePressed(MouseCode code,Panel* panel) +{ + int x, y; + int therow = 2; + + if ( code != MOUSE_LEFT ) + return; + + panel->getApp()->getCursorPos(x,y); + panel->screenToLocal( x, y ); + + therow = y / CELL_HEIGHT; + + // Figure out which row it's on + m_pBrowser->setMouseOverRow( therow ); + m_pBrowser->DoConnect(); +} diff --git a/main/source/cl_dll/vgui_ServerBrowser.h b/main/source/cl_dll/vgui_ServerBrowser.h new file mode 100644 index 00000000..7dc819aa --- /dev/null +++ b/main/source/cl_dll/vgui_ServerBrowser.h @@ -0,0 +1,44 @@ + +#ifndef ServerBrowser_H +#define ServerBrowser_H + +#include + +namespace vgui +{ +class Button; +class TablePanel; +class HeaderPanel; +} + +class CTransparentPanel; +class CommandButton; + +// Scoreboard positions +#define SB_X_INDENT (20 * ((float)ScreenHeight / 640)) +#define SB_Y_INDENT (20 * ((float)ScreenHeight / 480)) + +class ServerBrowser : public CTransparentPanel +{ +private: + HeaderPanel * _headerPanel; + TablePanel* _tablePanel; + + CommandButton* _connectButton; + CommandButton* _refreshButton; + CommandButton* _broadcastRefreshButton; + CommandButton* _stopButton; + CommandButton* _sortButton; + CommandButton* _cancelButton; + + CommandButton* _pingButton; + +public: + ServerBrowser(int x,int y,int wide,int tall); +public: + virtual void setSize(int wide,int tall); +}; + + + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/vgui_SpectatorPanel.cpp b/main/source/cl_dll/vgui_SpectatorPanel.cpp new file mode 100644 index 00000000..7008972f --- /dev/null +++ b/main/source/cl_dll/vgui_SpectatorPanel.cpp @@ -0,0 +1,443 @@ +//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// vgui_SpectatorPanel.cpp: implementation of the SpectatorPanel class. +// +////////////////////////////////////////////////////////////////////// + +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "pm_shared.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_SpectatorPanel.h" +#include "vgui_scorepanel.h" +#include "mod/AvHOverviewControl.h" + + +#define BANNER_WIDTH 256 +#define BANNER_HEIGHT 64 + + +#define OPTIONS_BUTTON_X 96 +#define CAMOPTIONS_BUTTON_X 200 + + +class Spectator_CheckButtonHandler : public ICheckButton2Handler +{ + +public: + + Spectator_CheckButtonHandler(SpectatorPanel * panel) + { + m_pFather = panel; + } + + virtual void StateChanged(CCheckButton2* pButton) + { + m_pFather->StateChanged(pButton); + } + +private: + + SpectatorPanel * m_pFather; + +}; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +SpectatorPanel::SpectatorPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) +{ + m_overviewButton = NULL; + m_autoDirectorButton = NULL; + m_firstPersonButton = NULL; + m_overviewControl = NULL; +} + +SpectatorPanel::~SpectatorPanel() +{ + +} + +void SpectatorPanel::StateChanged(CCheckButton2* pButton) +{ + bool theOverviewMode = false; + if(m_overviewButton) + { + theOverviewMode = m_overviewButton->IsChecked(); + } + gHUD.m_Spectator.SetOverviewMode(theOverviewMode); + + int theMode = OBS_NONE; + + if (m_firstPersonButton->IsChecked()) + { + theMode = OBS_IN_EYE; + } + else + { + theMode = OBS_CHASE_LOCKED; + } + + gHUD.m_Spectator.SetMode(theMode); + + if (m_autoDirectorButton != NULL) + { + if (m_autoDirectorButton->IsChecked()) + { + gEngfuncs.Cvar_SetValue("spec_autodirector", 1); + } + else + { + gEngfuncs.Cvar_SetValue("spec_autodirector", 0); + } + } + + Update(); // Update so that the components reflect the new state. + +} + +void SpectatorPanel::ActionSignal(int cmd) +{ + + switch (cmd) + { + /* + case SPECTATOR_PANEL_CMD_NONE : break; + */ + + case SPECTATOR_PANEL_CMD_PLAYERS : + gViewPort->UpdatePlayerMenu(); + gViewPort->ShowCommandMenu(gViewPort->m_SpectatorPlayerMenu); + break; + + case SPECTATOR_PANEL_CMD_NEXTPLAYER : gHUD.m_Spectator.FindNextPlayer(true); + break; + + case SPECTATOR_PANEL_CMD_PREVPLAYER : gHUD.m_Spectator.FindNextPlayer(false); + break; + + /* + case SPECTATOR_PANEL_CMD_HIDEMENU : ShowMenu(false); + break; + + case SPECTATOR_PANEL_CMD_CAMERA : gViewPort->ShowCommandMenu( gViewPort->m_SpectatorCameraMenu ); + break; + + */ + default : gEngfuncs.Con_DPrintf("Unknown SpectatorPanel ActionSingal %i.\n",cmd); break; + } + +} + + +void SpectatorPanel::Initialize() +{ + int x,y,wide,tall; + + getBounds(x,y,wide,tall); + + CSchemeManager * pSchemes = gViewPort->GetSchemeManager(); + + + int colorR = 128 / gHUD.GetGammaSlope(); + int colorG = 128 / gHUD.GetGammaSlope(); + int colorB = 128 / gHUD.GetGammaSlope(); + + int armedColorR = 255 / gHUD.GetGammaSlope(); + int armedColorG = 255 / gHUD.GetGammaSlope(); + int armedColorB = 255 / gHUD.GetGammaSlope(); + + + SchemeHandle_t hSmallScheme = pSchemes->getSchemeHandle( /*"Team Info Text"*/ "PieMenuScheme" ); + Font* font = pSchemes->getFont(hSmallScheme); + + //m_TopBorder = new CTransparentPanel(64, 0, 0, ScreenWidth, YRES(PANEL_HEIGHT)); + m_TopBorder = new CTransparentPanel(1, 0, ScreenHeight() - YRES(32), ScreenWidth(), YRES(SPECTATOR_PANEL_HEIGHT)); + m_TopBorder->setParent(this); + + m_BottomBorder = new CTransparentPanel(1, 0, ScreenHeight() - YRES(32), ScreenWidth(), YRES(SPECTATOR_PANEL_HEIGHT)); + m_BottomBorder->setParent(this); + + setPaintBackgroundEnabled(false); + + m_ExtraInfo = new Label( "Extra Info", 0, 0, wide, YRES(SPECTATOR_PANEL_HEIGHT) ); + m_ExtraInfo->setParent(m_TopBorder); + m_ExtraInfo->setFont( font ); + + m_ExtraInfo->setPaintBackgroundEnabled(false); + m_ExtraInfo->setFgColor( 143, 143, 54, 0 ); + m_ExtraInfo->setContentAlignment( vgui::Label::a_west ); + + + + m_TimerImage = new CImageLabel( "timer", 0, 0, 14, 14 ); + m_TimerImage->setParent(m_TopBorder); + + m_TopBanner = new CImageLabel( "banner", 0, 0, XRES(BANNER_WIDTH), YRES(BANNER_HEIGHT) ); + m_TopBanner->setParent(this); + + m_CurrentTime = new Label( "00:00", 0, 0, wide, YRES(SPECTATOR_PANEL_HEIGHT) ); + m_CurrentTime->setParent(m_TopBorder); + m_CurrentTime->setFont( pSchemes->getFont(hSmallScheme) ); + m_CurrentTime->setPaintBackgroundEnabled(false); + m_CurrentTime->setFgColor( 143, 143, 54, 0 ); + m_CurrentTime->setContentAlignment( vgui::Label::a_west ); + + m_Separator = new Panel( 0, 0, XRES( 64 ), YRES( 96 )); + m_Separator->setParent( m_TopBorder ); + m_Separator->setFgColor( 59, 58, 34, 48 ); + m_Separator->setBgColor( 59, 58, 34, 48 ); + + for ( int j= 0; j < TEAM_NUMBER; j++ ) + { + m_TeamScores[j] = new Label( " ", 0, 0, wide, YRES(SPECTATOR_PANEL_HEIGHT) ); + m_TeamScores[j]->setParent( m_TopBorder ); + m_TeamScores[j]->setFont( pSchemes->getFont(hSmallScheme) ); + m_TeamScores[j]->setPaintBackgroundEnabled(false); + m_TeamScores[j]->setFgColor( 143, 143, 54, 0 ); + m_TeamScores[j]->setContentAlignment( vgui::Label::a_west ); + m_TeamScores[j]->setVisible ( false ); + } + + + m_PrevPlayerButton= new ColorButton("<", XRES(390 - 20 - 4), YRES(6), XRES(20), YRES(20), false, false ); + m_PrevPlayerButton->setParent( m_BottomBorder ); + m_PrevPlayerButton->setContentAlignment( vgui::Label::a_center ); + m_PrevPlayerButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name + m_PrevPlayerButton->addActionSignal( new CSpectatorHandler_Command(this,SPECTATOR_PANEL_CMD_PREVPLAYER) ); + m_PrevPlayerButton->setUnArmedBorderColor ( colorR, colorG, colorB, 0 ); + m_PrevPlayerButton->setArmedBorderColor ( armedColorR, armedColorR, armedColorR, 0); + m_PrevPlayerButton->setUnArmedColor ( colorR, colorG, colorB, 0 ); + m_PrevPlayerButton->setArmedColor ( armedColorR, armedColorR, armedColorR, 0); + + m_NextPlayerButton= new ColorButton(">", XRES(390 + 200 + 4), YRES(6), XRES(20), YRES(20), false, false ); + m_NextPlayerButton->setParent( m_BottomBorder ); + m_NextPlayerButton->setContentAlignment( vgui::Label::a_center ); + m_NextPlayerButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name + m_NextPlayerButton->addActionSignal( new CSpectatorHandler_Command(this,SPECTATOR_PANEL_CMD_NEXTPLAYER) ); + m_NextPlayerButton->setUnArmedBorderColor ( colorR, colorG, colorB, 0 ); + m_NextPlayerButton->setArmedBorderColor ( armedColorR, armedColorR, armedColorR, 0); + m_NextPlayerButton->setUnArmedColor ( colorR, colorG, colorB, 0); + m_NextPlayerButton->setArmedColor ( armedColorR, armedColorR, armedColorR, 0); + + // Initialize the bottom title. + + m_BottomMainLabel = new ColorButton( "Spectator Bottom", XRES(390), YRES(6), XRES(200), YRES(20), false, false ); + m_BottomMainLabel->setFont(font); + m_BottomMainLabel->setParent(m_BottomBorder); + m_BottomMainLabel->setContentAlignment( vgui::Label::a_center ); + m_BottomMainLabel->addActionSignal( new CSpectatorHandler_Command(this,SPECTATOR_PANEL_CMD_PLAYERS) ); + + m_BottomMainLabel->setUnArmedBorderColor ( colorR, colorG, colorB, 0); + m_BottomMainLabel->setArmedBorderColor ( armedColorR, armedColorR, armedColorR, 0); + m_BottomMainLabel->setUnArmedColor ( colorR, colorG, colorB, 0); + m_BottomMainLabel->setArmedColor ( armedColorR, armedColorR, armedColorR, 0); + + + + m_menuVisible = true; + + m_insetVisible = false; + + m_ExtraInfo->setVisible( false ); + m_Separator->setVisible( false ); + m_TimerImage->setVisible( false ); + + m_TopBorder->setVisible(true); + m_BottomBorder->setVisible( true ); + + m_overviewButton = new CCheckButton2(); + m_overviewButton->setFont(font); + m_overviewButton->setParent( m_BottomBorder ); + m_overviewButton->SetText("Overview"); + m_overviewButton->setPos(XRES(10), YRES(6)); + m_overviewButton->setSize(XRES(100), YRES(20)); + m_overviewButton->SetImages("gfx/vgui/640_checkset.tga", "gfx/vgui/640_checkunset.tga"); + m_overviewButton->SetHandler(new Spectator_CheckButtonHandler(this)); + m_overviewButton->SetTextColor(colorR, colorG, colorB, 0); + + m_firstPersonButton = new CCheckButton2(); + m_firstPersonButton->setFont(font); + m_firstPersonButton->setParent( m_BottomBorder ); + m_firstPersonButton->SetText("First person"); + m_firstPersonButton->setPos(XRES(10 + 100), YRES(6)); + m_firstPersonButton->setSize(XRES(100), YRES(20)); + m_firstPersonButton->SetImages("gfx/vgui/640_checkset.tga", "gfx/vgui/640_checkunset.tga"); + m_firstPersonButton->SetHandler(new Spectator_CheckButtonHandler(this)); + m_firstPersonButton->SetTextColor(colorR, colorG, colorB, 0); + + m_autoDirectorButton = new CCheckButton2(); + m_autoDirectorButton->setFont(font); + m_autoDirectorButton->setParent( m_BottomBorder ); + m_autoDirectorButton->SetText("Auto-director"); + m_autoDirectorButton->setPos(XRES(10 + 200), YRES(6)); + m_autoDirectorButton->setSize(XRES(100), YRES(20)); + m_autoDirectorButton->SetImages("gfx/vgui/640_checkset.tga", "gfx/vgui/640_checkunset.tga"); + m_autoDirectorButton->SetHandler(new Spectator_CheckButtonHandler(this)); + m_autoDirectorButton->SetTextColor(colorR, colorG, colorB, 0); + + +/* + m_OverviewData.insetWindowX = 4; // upper left corner + m_OverviewData.insetWindowY = 4 + SPECTATOR_PANEL_HEIGHT; + m_OverviewData.insetWindowHeight = 180; + m_OverviewData.insetWindowWidth = 240; + + + theDrawInfo.mX = XRES(m_OverviewData.insetWindowX + m_OverviewData.insetWindowWidth + 4); + theDrawInfo.mY = YRES(SPECTATOR_PANEL_HEIGHT + 4); + theDrawInfo.mWidth = ScreenWidth() - theDrawInfo.mX - XRES(4); + theDrawInfo.mHeight = ScreenHeight() - YRES(SPECTATOR_PANEL_HEIGHT + 4) - theDrawInfo.mY; +*/ + + int theX = XRES(4 + 240 + 4); + int theY = YRES(SPECTATOR_PANEL_HEIGHT + 4); + int theWidth = ScreenWidth() - theX - XRES(4); + int theHeight = ScreenHeight() - YRES(SPECTATOR_PANEL_HEIGHT + 4) - theY; + + m_overviewControl = new AvHOverviewControl; + m_overviewControl->setPos(theX, theY); + m_overviewControl->setSize(theWidth, theHeight); + m_overviewControl->setParent(this); + +} + +void SpectatorPanel::ShowMenu(bool isVisible) +{ + + if ( !isVisible ) + { + gViewPort->HideCommandMenu(); + } + + m_menuVisible = isVisible; + + gViewPort->UpdateCursorState(); + +} + + +void SpectatorPanel::EnableInsetView(bool isEnabled) +{ + + + int x = gHUD.m_Spectator.m_OverviewData.insetWindowX; + int y = gHUD.m_Spectator.m_OverviewData.insetWindowY; + int wide = gHUD.m_Spectator.m_OverviewData.insetWindowWidth; + int tall = gHUD.m_Spectator.m_OverviewData.insetWindowHeight; + int offset = x + wide + 2; + + if ( isEnabled ) + { + // short black bar to see full inset + m_TopBorder->setBounds( XRES(offset), 0, XRES(640 - offset ), YRES(SPECTATOR_PANEL_HEIGHT) ); + + if ( gEngfuncs.IsSpectateOnly() ) + { + m_TopBanner->setVisible( true ); + m_TopBanner->setPos( XRES(offset), 0 ); + } + else + m_TopBanner->setVisible( false ); + + } + else + { + // full black bar, no inset border + // show banner only in real HLTV mode + if ( gEngfuncs.IsSpectateOnly() ) + { + m_TopBanner->setVisible( true ); + m_TopBanner->setPos( 0,0 ); + } + else + m_TopBanner->setVisible( false ); + + m_TopBorder->setBounds( 0, 0, ScreenWidth(), YRES(SPECTATOR_PANEL_HEIGHT) ); + + } + + m_insetVisible = isEnabled; + + Update(); + +} + + +void SpectatorPanel::Update() +{ + + // Update the check boxes. + m_overviewButton->SetChecked(gHUD.m_Spectator.IsInOverviewMode()); + m_overviewButton->setVisible(gHUD.GetIsNSMode()); + + m_firstPersonButton->SetChecked(g_iUser1 == OBS_IN_EYE); + + m_autoDirectorButton->SetChecked(CVAR_GET_FLOAT("spec_autodirector") != 0); + m_autoDirectorButton->setVisible(gEngfuncs.IsSpectateOnly()); + + m_overviewControl->setVisible(gHUD.m_Spectator.IsInOverviewMode()); + + int iTextWidth, iTextHeight; + int iTimeHeight, iTimeWidth; + int offset,j; + + // TODO Max: Figure out what this is for. + + if ( m_insetVisible ) + offset = gHUD.m_Spectator.m_OverviewData.insetWindowX + gHUD.m_Spectator.m_OverviewData.insetWindowWidth + 2; + else + offset = 0; + + //bool visible = gHUD.m_Spectator.m_drawstatus->value != 0; + bool visible = true; + + m_ExtraInfo->setVisible( visible ); + m_TimerImage->setVisible( visible ); + m_CurrentTime->setVisible( visible ); + m_Separator->setVisible( visible ); + + for ( j= 0; j < TEAM_NUMBER; j++ ) + m_TeamScores[j]->setVisible( visible ); + + if ( !visible ) + return; + + m_ExtraInfo->getTextSize( iTextWidth, iTextHeight ); + m_CurrentTime->getTextSize( iTimeWidth, iTimeHeight ); + + iTimeWidth += XRES ( 14 ); // +timer icon + iTimeWidth += ( 4-(iTimeWidth%4) ); + + if ( iTimeWidth > iTextWidth ) + iTextWidth = iTimeWidth; + + int xPos = ScreenWidth() - ( iTextWidth + XRES ( 4 + offset ) ); + + m_ExtraInfo->setBounds( xPos, YRES( 1 ), iTextWidth, iTextHeight ); + + m_TimerImage->setBounds( xPos, YRES( 2 ) + iTextHeight , XRES(14), YRES(14) ); + + m_CurrentTime->setBounds( xPos + XRES ( 14 + 1 ), YRES( 2 ) + iTextHeight , iTimeWidth, iTimeHeight ); + + m_Separator->setPos( ScreenWidth() - ( iTextWidth + XRES ( 4+2+4+offset ) ) , YRES( 1 ) ); + m_Separator->setSize( XRES( 4 ), YRES( SPECTATOR_PANEL_HEIGHT - 2 ) ); + + for ( j= 0; j < TEAM_NUMBER; j++ ) + { + int iwidth, iheight; + + m_TeamScores[j]->getTextSize( iwidth, iheight ); + m_TeamScores[j]->setBounds( ScreenWidth() - ( iTextWidth + XRES ( 4+2+4+2+offset ) + iwidth ), YRES( 1 ) + ( iheight * j ), iwidth, iheight ); + } + +} diff --git a/main/source/cl_dll/vgui_SpectatorPanel.h b/main/source/cl_dll/vgui_SpectatorPanel.h new file mode 100644 index 00000000..008fa5fc --- /dev/null +++ b/main/source/cl_dll/vgui_SpectatorPanel.h @@ -0,0 +1,115 @@ +//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// vgui_SpectatorPanel.h: interface for the SpectatorPanel class. +// +////////////////////////////////////////////////////////////////////// + +#ifndef SPECTATORPANEL_H +#define SPECTATORPANEL_H + +#include +#include +#include + +using namespace vgui; + +#define SPECTATOR_PANEL_CMD_NONE 0 + +#define SPECTATOR_PANEL_CMD_OPTIONS 1 +#define SPECTATOR_PANEL_CMD_PREVPLAYER 2 +#define SPECTATOR_PANEL_CMD_NEXTPLAYER 3 +#define SPECTATOR_PANEL_CMD_HIDEMENU 4 +#define SPECTATOR_PANEL_CMD_TOGGLE_INSET 5 +#define SPECTATOR_PANEL_CMD_CAMERA 6 +#define SPECTATOR_PANEL_CMD_PLAYERS 7 + + +#define SPECTATOR_PANEL_HEIGHT 32 // Height of the letter box strips. + + +#define TEAM_NUMBER 2 + +class AvHOverviewControl; + +class SpectatorPanel : public Panel //, public vgui::CDefaultInputSignal +{ + +public: + SpectatorPanel(int x,int y,int wide,int tall); + virtual ~SpectatorPanel(); + + void ActionSignal(int cmd); + void StateChanged(CCheckButton2* pButton); + + // InputSignal overrides. +public: + void Initialize(); + void Update(); + + + +public: + + void EnableInsetView(bool isEnabled); + void ShowMenu(bool isVisible); + + + //ColorButton * m_OptionButton; + ColorButton * m_PrevPlayerButton; + ColorButton * m_NextPlayerButton; + //ColorButton * m_CamButton; + + CTransparentPanel * m_TopBorder; + CTransparentPanel * m_BottomBorder; + + ColorButton *m_BottomMainLabel; + CImageLabel *m_TimerImage; + Label *m_CurrentTime; + Label *m_ExtraInfo; + Panel *m_Separator; + + Label *m_TeamScores[TEAM_NUMBER]; + + CImageLabel *m_TopBanner; + + bool m_menuVisible; + bool m_insetVisible; + + // Added by mmcguire. + CCheckButton2* m_overviewButton; + CCheckButton2* m_autoDirectorButton; + CCheckButton2* m_firstPersonButton; + + AvHOverviewControl* m_overviewControl; + +}; + + + +class CSpectatorHandler_Command : public ActionSignal +{ + +private: + SpectatorPanel * m_pFather; + int m_cmd; + +public: + CSpectatorHandler_Command( SpectatorPanel * panel, int cmd ) + { + m_pFather = panel; + m_cmd = cmd; + } + + virtual void actionPerformed( Panel * panel ) + { + m_pFather->ActionSignal(m_cmd); + } +}; + + +#endif // !defined SPECTATORPANEL_H diff --git a/main/source/cl_dll/vgui_TeamFortressViewport.cpp b/main/source/cl_dll/vgui_TeamFortressViewport.cpp new file mode 100644 index 00000000..7dc48f81 --- /dev/null +++ b/main/source/cl_dll/vgui_TeamFortressViewport.cpp @@ -0,0 +1,3225 @@ +//=========== (C) Copyright 1999 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: Client DLL VGUI Viewport +// +// $Workfile: $ +// $Date: 2002/10/28 20:32:17 $ +// +//----------------------------------------------------------------------------- +// $Log: vgui_TeamFortressViewport.cpp,v $ +// Revision 1.12 2002/10/28 20:32:17 Flayra +// - Don't display disconcerting error message +// +// Revision 1.11 2002/10/16 00:37:33 Flayra +// - Added support for authentication in scoreboard +// +// Revision 1.10 2002/07/08 16:15:13 Flayra +// - Refactored team color management +// +// Revision 1.9 2002/04/16 19:32:07 Charlie +// - Removed crappy way of handling pop-up menu changes, removed pressing enter to go back to RR (was getting in way of chat, now just use "readyroom" - F4 -) +// +// Revision 1.8 2002/02/25 20:35:41 Charlie +// - Added hotgrouping of units and buildings, moving to units or buildings when double-tapping, and camera tracking +// +// Revision 1.7 2002/01/30 18:34:32 Charlie +// - Fixed doubled-cursor problem with scoreboard (only show sprite cursor, not Windows cursor) +// +// Revision 1.6 2001/11/13 17:51:02 Charlie +// - Increased max teams, changed team colors (allow aliens vs. aliens and fronts vs. fronts), general scoreboard support +// +// Revision 1.5 2001/10/22 19:26:32 Charlie +// - Changes to make scoreboard work in commander mode +// +// Revision 1.4 2001/09/13 15:01:02 Charlie +// - Merging with 1108 +// +// Revision 1.3 2001/06/02 14:26:47 charlie +// - Commented out UpdateCursorState because it was causing problems (look into this) +// Revision 1.1.1.1.2.1 2001/09/13 14:42:30 Charlie +// - HL1108 +// +// Revision 1.2 2001/04/09 19:31:35 charlie +// - Quick hacky tests to try out menus for team/class picking...yuck +// +// Revision 1.1.1.1 2000/06/17 14:12:45 charlie +// Final version of new HL SDK. May not compile. +// Previous versions of my MSVC project files and utility .bat files. +// This is my starting point; there is no mod-specific code in here. +// +// +// $NoKeywords: $ +//============================================================================= +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "parsemsg.h" +#include "pm_shared.h" +#include "../engine/keydefs.h" +#include "demo.h" +#include "demo_api.h" + +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_ServerBrowser.h" +#include "vgui_ScorePanel.h" +#include "vgui_SpectatorPanel.h" +#include "game_shared\vgui_loadtga.h" +#include "mod/AvHConstants.h" +#include "mod/AvHTitles.h" +#include "mod/AvHPieMenuHandler.h" +#include "mod/AvHSharedUtil.h" +#include "mod/AvHCommandConstants.h" +#include "mod/AvHBalanceAnalysis.h" +#include "mod/ChatPanel.h" + +extern int g_iVisibleMouse; +class CCommandMenu; +int g_iPlayerClass; +int g_iTeamNumber; +int g_iUser1; +int g_iUser2; +int g_iUser3; + +// Scoreboard positions +#define SBOARD_INDENT_X XRES(75) +#define SBOARD_INDENT_Y YRES(40) + +// low-res scoreboard indents +#define SBOARD_INDENT_X_512 30 +#define SBOARD_INDENT_Y_512 30 + +#define SBOARD_INDENT_X_400 0 +#define SBOARD_INDENT_Y_400 20 + + +const int kPlayerMenuWidth = 200; + +void IN_ResetMouse( void ); +extern CMenuPanel *CMessageWindowPanel_Create( const char *szMOTD, const char *szTitle, int iShadeFullscreen, int iRemoveMe, int x, int y, int wide, int tall ); +extern float * GetClientColor( int clientIndex ); + +using namespace vgui; + + +class PlayerButton : public CommandButton +{ + +public: + + PlayerButton(int inPlayerNumber, const char* text,int x,int y,int wide,int tall, bool bNoHighlight, bool bFlat ) + : CommandButton(text, x, y, wide, tall, bNoHighlight, bFlat) + { + mPlayerNumber = inPlayerNumber; + } + + void paint() + { + + // Set the color of the button based on the team color (or red if the player is dead). + + int theTeamNumber = g_PlayerExtraInfo[mPlayerNumber].teamnumber % iNumberOfTeamColors; + int r, g, b; + + switch (g_PlayerExtraInfo[mPlayerNumber].playerclass) + { + + case PLAYERCLASS_DEAD_MARINE: + case PLAYERCLASS_DEAD_ALIEN: + case PLAYERCLASS_REINFORCING: + r = 255 / gHUD.GetGammaSlope(); + g = 0 / gHUD.GetGammaSlope(); + b = 0 / gHUD.GetGammaSlope(); + break; + + default: + r = kTeamColors[theTeamNumber][0] / gHUD.GetGammaSlope(); + g = kTeamColors[theTeamNumber][1] / gHUD.GetGammaSlope(); + b = kTeamColors[theTeamNumber][2] / gHUD.GetGammaSlope(); + break; + + } + + setFgColor(r, g, b, 0); + + Button::paint(); + + } + + void paintBackground() + { + if ( isArmed() ) + { + // Orange Border + drawSetColor(255, 255, 255, 0); + drawOutlinedRect(0,0,_size[0],_size[1]); + } + } + +private: + + int mPlayerNumber; + +}; + + +// Used for Class specific buttons +char *sTFClasses[] = +{ + "", + "SCOUT", + "SNIPER", + "SOLDIER", + "DEMOMAN", + "MEDIC", + "HWGUY", + "PYRO", + "SPY", + "ENGINEER", + "CIVILIAN", +}; + +char *sLocalisedClasses[] = +{ + "#Civilian", + "#Scout", + "#Sniper", + "#Soldier", + "#Demoman", + "#Medic", + "#HWGuy", + "#Pyro", + "#Spy", + "#Engineer", + "#Random", + "#Civilian", +}; + +char *sTFClassSelection[] = +{ + "civilian", + "scout", + "sniper", + "soldier", + "demoman", + "medic", + "hwguy", + "pyro", + "spy", + "engineer", + "randompc", + "civilian", +}; + +const int kNumOptionsButtons = 4; + +char* kOptionsButtons[kNumOptionsButtons*2] = +{ + "#Menu_Marine1Team", "jointeamone", + "#Menu_Alien1Team", "jointeamtwo", + "#Menu_ReadyRoom", "readyroom", + "#Menu_LeaveGame", "escape", +}; + +int iBuildingCosts[] = +{ + BUILD_COST_DISPENSER, + BUILD_COST_SENTRYGUN +}; + +// This maps class numbers to the Invalid Class bit. +// This is needed for backwards compatability in maps that were finished before +// all the classes were in TF. Hence the wacky sequence. +int sTFValidClassInts[] = +{ + 0, + TF_ILL_SCOUT, + TF_ILL_SNIPER, + TF_ILL_SOLDIER, + TF_ILL_DEMOMAN, + TF_ILL_MEDIC, + TF_ILL_HVYWEP, + TF_ILL_PYRO, + TF_ILL_SPY, + TF_ILL_ENGINEER, + TF_ILL_RANDOMPC, +}; + +// Get the name of TGA file, based on GameDir +char* GetVGUITGAName(const char *pszName) +{ + int i; + char sz[256]; + static char gd[256]; + const char *gamedir; + + if (ScreenWidth() < 640) + i = 320; + else + i = 640; + sprintf(sz, pszName, i); + + gamedir = gEngfuncs.pfnGetGameDirectory(); + sprintf(gd, "%s/gfx/vgui/%s.tga",gamedir,sz); + + return gd; +} + +//================================================================ +// COMMAND MENU +//================================================================ +void CCommandMenu::AddButton( CommandButton *pButton ) +{ + if (m_iButtons >= MAX_BUTTONS) + return; + + m_aButtons[m_iButtons] = pButton; + m_iButtons++; + pButton->setParent( this ); + pButton->setFont( Scheme::sf_primary3 ); + + // give the button a default key binding + if ( m_iButtons < 10 ) + { + pButton->setBoundKey( m_iButtons + '0' ); + } + else if ( m_iButtons == 10 ) + { + pButton->setBoundKey( '0' ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Tries to find a button that has a key bound to the input, and +// presses the button if found +// Input : keyNum - the character number of the input key +// Output : Returns true if the command menu should close, false otherwise +//----------------------------------------------------------------------------- +bool CCommandMenu::KeyInput( int keyNum ) +{ + // loop through all our buttons looking for one bound to keyNum + for ( int i = 0; i < m_iButtons; i++ ) + { + if ( !m_aButtons[i]->IsNotValid() ) + { + if ( m_aButtons[i]->getBoundKey() == keyNum ) + { + // hit the button + if ( m_aButtons[i]->GetSubMenu() ) + { + // open the sub menu + gViewPort->SetCurrentCommandMenu( m_aButtons[i]->GetSubMenu() ); + return false; + } + else + { + // run the bound command + m_aButtons[i]->fireActionSignal(); + return true; + } + } + } + } + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: clears the current menus buttons of any armed (highlighted) +// state, and all their sub buttons +//----------------------------------------------------------------------------- +void CCommandMenu::ClearButtonsOfArmedState( void ) +{ + for ( int i = 0; i < GetNumButtons(); i++ ) + { + m_aButtons[i]->setArmed( false ); + + if ( m_aButtons[i]->GetSubMenu() ) + { + m_aButtons[i]->GetSubMenu()->ClearButtonsOfArmedState(); + } + } +} + +void CCommandMenu::RemoveAllButtons() +{ + + for ( int i = 0; i < GetNumButtons(); i++ ) + { + + if ( m_aButtons[i]->GetSubMenu() ) + { + m_aButtons[i]->GetSubMenu()->RemoveAllButtons(); + } + + removeChild(m_aButtons[i]); + + delete m_aButtons[i]; + m_aButtons[i] = NULL; + + } + + m_iButtons = 0; + +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : *pSubMenu - +// Output : CommandButton +//----------------------------------------------------------------------------- +CommandButton *CCommandMenu::FindButtonWithSubmenu( CCommandMenu *pSubMenu ) +{ + for ( int i = 0; i < GetNumButtons(); i++ ) + { + if ( m_aButtons[i]->GetSubMenu() == pSubMenu ) + return m_aButtons[i]; + } + + return NULL; +} + +// Recalculate the visible buttons +bool CCommandMenu::RecalculateVisibles( int iYOffset, bool bHideAll ) +{ + int i, iCurrentY = 0; + int iVisibleButtons = 0; + + // Cycle through all the buttons in this menu, and see which will be visible + for (i = 0; i < m_iButtons; i++) + { + int iClass = m_aButtons[i]->GetPlayerClass(); + if ( (iClass && iClass != g_iPlayerClass ) || ( m_aButtons[i]->IsNotValid() ) || bHideAll ) + { + m_aButtons[i]->setVisible( false ); + if ( m_aButtons[i]->GetSubMenu() != NULL ) + { + (m_aButtons[i]->GetSubMenu())->RecalculateVisibles( 0, true ); + } + } + else + { + // If it's got a submenu, force it to check visibilities + if ( m_aButtons[i]->GetSubMenu() != NULL ) + { + if ( !(m_aButtons[i]->GetSubMenu())->RecalculateVisibles( 0 , false ) ) + { + // The submenu had no visible buttons, so don't display this button + m_aButtons[i]->setVisible( false ); + continue; + } + } + + m_aButtons[i]->setVisible( true ); + iVisibleButtons++; + } + } + + // Set Size + setSize( _size[0], (iVisibleButtons * (m_flButtonSizeY-1)) + 1 ); + + if ( iYOffset ) + { + m_iYOffset = iYOffset; + } + + for (i = 0; i < m_iButtons; i++) + { + if ( m_aButtons[i]->isVisible() ) + { + if ( m_aButtons[i]->GetSubMenu() != NULL ) + (m_aButtons[i]->GetSubMenu())->RecalculateVisibles( iCurrentY + m_iYOffset, false ); + + + // Make sure it's at the right Y position + // m_aButtons[i]->getPos( iXPos, iYPos ); + + if ( m_iDirection ) + { + m_aButtons[i]->setPos( 0, (iVisibleButtons-1) * (m_flButtonSizeY-1) - iCurrentY ); + } + else + { + m_aButtons[i]->setPos( 0, iCurrentY ); + } + + iCurrentY += (m_flButtonSizeY-1); + } + } + + return iVisibleButtons?true:false; +} + +// Make sure all submenus can fit on the screen +void CCommandMenu::RecalculatePositions( int iYOffset ) +{ + int iTop; + int iAdjust = 0; + + m_iYOffset+= iYOffset; + if ( m_iDirection ) + iTop = ScreenHeight() - (m_iYOffset + _size[1] ); + else + iTop = m_iYOffset; + + if ( iTop < 0 ) + iTop = 0; + // Calculate if this is going to fit onscreen, and shuffle it up if it won't + int iBottom = iTop + _size[1]; + if ( iBottom > ScreenHeight() ) + { + // Move in increments of button sizes + while (iAdjust < (iBottom - ScreenHeight())) + { + iAdjust += m_flButtonSizeY - 1; + } + iTop -= iAdjust; + + // Make sure it doesn't move off the top of the screen (the menu's too big to fit it all) + if ( iTop < 0 ) + { + iAdjust -= (0 - iTop); + iTop = 0; + } + } + + setPos( _pos[0], iTop ); + // We need to force all menus below this one to update their positions now, because they + // might have submenus riding off buttons in this menu that have just shifted. + for (int i = 0; i < m_iButtons; i++) + m_aButtons[i]->UpdateSubMenus( iAdjust ); +} + + +// Make this menu and all menus above it in the chain visible +void CCommandMenu::MakeVisible( CCommandMenu *pChildMenu ) +{ +/* + // Push down the button leading to the child menu + for (int i = 0; i < m_iButtons; i++) + { + if ( (pChildMenu != NULL) && (m_aButtons[i]->GetSubMenu() == pChildMenu) ) + { + m_aButtons[i]->setArmed( true ); + } + else + { + m_aButtons[i]->setArmed( false ); + } + } +*/ + + setVisible(true); + if (m_pParentMenu) + m_pParentMenu->MakeVisible( this ); +} + +//================================================================ +// CreateSubMenu +CCommandMenu *TeamFortressViewport::CreateSubMenu( CommandButton *pButton, CCommandMenu *pParentMenu, int iYOffset, int iXOffset ) +{ + int iXPos = 0; + int iYPos = 0; + int iWide = CMENU_SIZE_X; + int iTall = 0; + int iDirection = 0; + + if (pParentMenu) + { + iXPos = m_pCurrentCommandMenu->GetXOffset() + (CMENU_SIZE_X - 1) + iXOffset; + iYPos = m_pCurrentCommandMenu->GetYOffset() + iYOffset; + iDirection = pParentMenu->GetDirection(); + } + + CCommandMenu *pMenu = new CCommandMenu(pParentMenu, iDirection, iXPos, iYPos, iWide, iTall ); + pMenu->setParent(this); + pButton->AddSubMenu( pMenu ); + pButton->setFont( Scheme::sf_primary3 ); + pMenu->m_flButtonSizeY = m_pCurrentCommandMenu->m_flButtonSizeY; + + // Create the Submenu-open signal + InputSignal *pISignal = new CMenuHandler_PopupSubMenuInput(pButton, pMenu); + pButton->addInputSignal(pISignal); + + // Put a > to show it's a submenu + CImageLabel *pLabel = new CImageLabel( "arrow", CMENU_SIZE_X - SUBMENU_SIZE_X, SUBMENU_SIZE_Y ); + pLabel->setParent(pButton); + pLabel->addInputSignal(pISignal); + + // Reposition + pLabel->getPos( iXPos, iYPos ); + pLabel->setPos( CMENU_SIZE_X - pLabel->getImageWide(), (BUTTON_SIZE_Y - pLabel->getImageTall()) / 2 ); + + // Create the mouse off signal for the Label too + if (!pButton->m_bNoHighlight) + pLabel->addInputSignal( new CHandler_CommandButtonHighlight(pButton) ); + + return pMenu; +} + +//----------------------------------------------------------------------------- +// Purpose: Makes sure the memory allocated for TeamFortressViewport is nulled out +// Input : stAllocateBlock - +// Output : void * +//----------------------------------------------------------------------------- +void *TeamFortressViewport::operator new( size_t stAllocateBlock ) +{ +// void *mem = Panel::operator new( stAllocateBlock ); + void *mem = ::operator new( stAllocateBlock ); + memset( mem, 0, stAllocateBlock ); + return mem; +} + +//----------------------------------------------------------------------------- +// Purpose: InputSignal handler for the main viewport +//----------------------------------------------------------------------------- +class CViewPortInputHandler : public InputSignal +{ +public: + bool bPressed; + + CViewPortInputHandler() + { + } + + virtual void cursorMoved(int x,int y,Panel* panel) {} + virtual void cursorEntered(Panel* panel) {} + virtual void cursorExited(Panel* panel) {} + virtual void mousePressed(MouseCode code,Panel* panel) + { + if ( code != MOUSE_LEFT ) + { + // send a message to close the command menu + // this needs to be a message, since a direct call screws the timing + gEngfuncs.pfnClientCmd( "ForceCloseCommandMenu\n" ); + } + } + virtual void mouseReleased(MouseCode code,Panel* panel) + { + } + + virtual void mouseDoublePressed(MouseCode code,Panel* panel) {} + virtual void mouseWheeled(int delta,Panel* panel) {} + virtual void keyPressed(KeyCode code,Panel* panel) {} + virtual void keyTyped(KeyCode code,Panel* panel) {} + virtual void keyReleased(KeyCode code,Panel* panel) {} + virtual void keyFocusTicked(Panel* panel) {} +}; + + +//================================================================ +TeamFortressViewport::TeamFortressViewport(int x,int y,int wide,int tall) : Panel(x,y,wide,tall), m_SchemeManager(wide,tall) +{ + gViewPort = this; + m_iInitialized = false; + m_pTeamMenu = NULL; + m_pClassMenu = NULL; + m_pScoreBoard = NULL; + mOptionsScreen = NULL; + mOptionsButtons = new CommandButton*[kNumOptionsButtons]; + + #ifdef AVH_PLAYTEST_BUILD + mPlaytestVariables = new CListBox(); + memset(this->mOptionsButtons, NULL, sizeof(CommandButton*)*kNumOptionsButtons); + mPlaytestAnalysis = new CListBox(); + #endif + + m_pSpectatorPanel = NULL; + m_pCurrentMenu = NULL; + m_pCurrentCommandMenu = NULL; + + Initialize(); + addInputSignal( new CViewPortInputHandler ); + + int r, g, b, a; + + Scheme* pScheme = App::getInstance()->getScheme(); + + // primary text color + // Get the colors + //!! two different types of scheme here, need to integrate + SchemeHandle_t hPrimaryScheme = m_SchemeManager.getSchemeHandle( "Primary Button Text" ); + { + // font + pScheme->setFont( Scheme::sf_primary1, m_SchemeManager.getFont(hPrimaryScheme) ); + + // text color + m_SchemeManager.getFgColor( hPrimaryScheme, r, g, b, a ); + pScheme->setColor(Scheme::sc_primary1, r, g, b, a ); // sc_primary1 is non-transparent orange + + // background color (transparent black) + m_SchemeManager.getBgColor( hPrimaryScheme, r, g, b, a ); + pScheme->setColor(Scheme::sc_primary3, r, g, b, a ); + + // armed foreground color + m_SchemeManager.getFgArmedColor( hPrimaryScheme, r, g, b, a ); + pScheme->setColor(Scheme::sc_secondary2, r, g, b, a ); + + // armed background color + m_SchemeManager.getBgArmedColor( hPrimaryScheme, r, g, b, a ); + pScheme->setColor(Scheme::sc_primary2, r, g, b, a ); + + //!! need to get this color from scheme file + // used for orange borders around buttons + m_SchemeManager.getBorderColor( hPrimaryScheme, r, g, b, a ); + // pScheme->setColor(Scheme::sc_secondary1, r, g, b, a ); + pScheme->setColor(Scheme::sc_secondary1, 255*0.7, 170*0.7, 0, 0); + } + + // Change the second primary font (used in the scoreboard) + SchemeHandle_t hScoreboardScheme = m_SchemeManager.getSchemeHandle( "Scoreboard Text" ); + { + pScheme->setFont(Scheme::sf_primary2, m_SchemeManager.getFont(hScoreboardScheme) ); + } + + // Change the third primary font (used in command menu) + SchemeHandle_t hCommandMenuScheme = m_SchemeManager.getSchemeHandle( "CommandMenu Text" ); + { + pScheme->setFont(Scheme::sf_primary3, m_SchemeManager.getFont(hCommandMenuScheme) ); + } + + App::getInstance()->setScheme(pScheme); + + // VGUI MENUS + CreateTeamMenu(); + CreateClassMenu(); + CreateSpectatorMenu(); + CreateScoreBoard(); + CreateOptionsMenu(); + // Init command menus + m_iNumMenus = 0; + m_iCurrentTeamNumber = m_iUser1 = m_iUser2 = m_iUser3 = 0; + + m_StandardMenu = CreateCommandMenu("commandmenu.txt", 0, CMENU_TOP, false, CMENU_SIZE_X, BUTTON_SIZE_Y, 0 ); + m_SpectatorOptionsMenu = CreateCommandMenu("spectatormenu.txt", 1, YRES(32), true, CMENU_SIZE_X, BUTTON_SIZE_Y / 2, 0 ); // above bottom bar, flat design + m_SpectatorCameraMenu = CreateCommandMenu("spectcammenu.txt", 1, YRES(32), true, XRES( 200 ), BUTTON_SIZE_Y / 2, ScreenWidth() - ( XRES ( 200 ) + 15 ) ); // above bottom bar, flat design + + CreatePlayerMenu(); + + CreateServerBrowser(); + + m_chatPanel = new ChatPanel(10, (ScreenHeight() * 0.75 - 30) / 2, ScreenWidth() - 20, 30); + m_chatPanel->setParent(this); + m_chatPanel->setVisible(false); + +} + +//----------------------------------------------------------------------------- +// Purpose: Called everytime a new level is started. Viewport clears out it's data. +//----------------------------------------------------------------------------- +void TeamFortressViewport::Initialize( void ) +{ + // Force each menu to Initialize + if (m_pTeamMenu) + { + m_pTeamMenu->Initialize(); + } + if (m_pClassMenu) + { + m_pClassMenu->Initialize(); + } + if (m_pScoreBoard) + { + m_pScoreBoard->Initialize(); + HideScoreBoard(); + } +// if(mOptionsScreen) +// { +// mOptionsScreen->Initialize(); +// } + if (m_pSpectatorPanel) + { + // Spectator menu doesn't need initializing + m_pSpectatorPanel->setVisible( false ); + } + + // Make sure all menus are hidden + HideVGUIMenu(); + HideCommandMenu(); + + // Clear out some data + m_iGotAllMOTD = true; + m_iRandomPC = false; + m_flScoreBoardLastUpdated = 0; + m_flSpectatorPanelLastUpdated = 0; + + // reset player info + g_iPlayerClass = 0; + g_iTeamNumber = 0; + + memset(this->m_sMapName, 0, MAX_MAPNAME_LENGTH); + memset(this->m_szServerName, 0, MAX_SERVERNAME_LENGTH); + for (int i = 0; i < 5; i++) + { + m_iValidClasses[i] = 0; + strcpy(m_sTeamNames[i], ""); + } + + #ifdef AVH_PLAYTEST_BUILD + this->mBalanceChanged = false; + #endif + + App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::SchemeCursor::scu_none) ); +} + +class CException; +//----------------------------------------------------------------------------- +// Purpose: Read the Command Menu structure from the txt file and create the menu. +// Returns Index of menu in m_pCommandMenus +//----------------------------------------------------------------------------- +int TeamFortressViewport::CreateCommandMenu( char * menuFile, int direction, int yOffset, bool flatDesign, float flButtonSizeX, float flButtonSizeY, int xOffset ) +{ + // COMMAND MENU + // Create the root of this new Command Menu + + int newIndex = m_iNumMenus; + + m_pCommandMenus[newIndex] = new CCommandMenu(NULL, direction, xOffset, yOffset, flButtonSizeX, 300); // This will be resized once we know how many items are in it + m_pCommandMenus[newIndex]->setParent(this); + m_pCommandMenus[newIndex]->setVisible(false); + m_pCommandMenus[newIndex]->m_flButtonSizeY = flButtonSizeY; + m_pCommandMenus[newIndex]->m_iSpectCmdMenu = direction; + + m_iNumMenus++; + + // Read Command Menu from the txt file + char token[1024]; + char *pfile = (char*)gEngfuncs.COM_LoadFile( menuFile, 5, NULL); + if (!pfile) + { + gEngfuncs.Con_DPrintf( "Unable to open %s\n", menuFile); + SetCurrentCommandMenu( NULL ); + return newIndex; + } + +try +{ + // First, read in the localisation strings + + // Detpack strings + gHUD.m_TextMessage.LocaliseTextString( "#DetpackSet_For5Seconds", m_sDetpackStrings[0], MAX_BUTTON_SIZE ); + gHUD.m_TextMessage.LocaliseTextString( "#DetpackSet_For20Seconds", m_sDetpackStrings[1], MAX_BUTTON_SIZE ); + gHUD.m_TextMessage.LocaliseTextString( "#DetpackSet_For50Seconds", m_sDetpackStrings[2], MAX_BUTTON_SIZE ); + + // Now start parsing the menu structure + m_pCurrentCommandMenu = m_pCommandMenus[newIndex]; + char szLastButtonText[32] = "file start"; + pfile = gEngfuncs.COM_ParseFile(pfile, token); + while ( ( strlen ( token ) > 0 ) && ( m_iNumMenus < MAX_MENUS ) ) + { + // Keep looping until we hit the end of this menu + while ( token[0] != '}' && ( strlen( token ) > 0 ) ) + { + char cText[32] = ""; + char cBoundKey[32] = ""; + char cCustom[32] = ""; + static const int cCommandLength = 128; + char cCommand[cCommandLength] = ""; + char szMap[MAX_MAPNAME] = ""; + int iPlayerClass = 0; + int iCustom = false; + int iTeamOnly = -1; + int iToggle = 0; + int iButtonY; + bool bGetExtraToken = true; + CommandButton *pButton = NULL; + + // We should never be here without a Command Menu + if (!m_pCurrentCommandMenu) + { + gEngfuncs.Con_Printf("Error in %s file after '%s'.\n",menuFile, szLastButtonText ); + m_iInitialized = false; + return newIndex; + } + + // token should already be the bound key, or the custom name + strncpy( cCustom, token, 32 ); + cCustom[31] = '\0'; + + // See if it's a custom button + if (!strcmp(cCustom, "CUSTOM") ) + { + iCustom = true; + + // Get the next token + pfile = gEngfuncs.COM_ParseFile(pfile, token); + } + // See if it's a map + else if (!strcmp(cCustom, "MAP") ) + { + // Get the mapname + pfile = gEngfuncs.COM_ParseFile(pfile, token); + strncpy( szMap, token, MAX_MAPNAME ); + szMap[MAX_MAPNAME-1] = '\0'; + + // Get the next token + pfile = gEngfuncs.COM_ParseFile(pfile, token); + } + else if ( !strncmp(cCustom, "TEAM", 4) ) // TEAM1, TEAM2, TEAM3, TEAM4 + { + // make it a team only button + iTeamOnly = atoi( cCustom + 4 ); + + // Get the next token + pfile = gEngfuncs.COM_ParseFile(pfile, token); + } + else if ( !strncmp(cCustom, "TOGGLE", 6) ) + { + iToggle = true; + // Get the next token + pfile = gEngfuncs.COM_ParseFile(pfile, token); + } + else + { + // See if it's a Class + for (int i = 1; i <= PC_ENGINEER; i++) + { + if ( !strcmp(token, sTFClasses[i]) ) + { + // Save it off + iPlayerClass = i; + + // Get the button text + pfile = gEngfuncs.COM_ParseFile(pfile, token); + break; + } + } + } + + // Get the button bound key + strncpy( cBoundKey, token, 32 ); + cText[31] = '\0'; + + // Get the button text + pfile = gEngfuncs.COM_ParseFile(pfile, token); + strncpy( cText, token, 32 ); + cText[31] = '\0'; + + // save off the last button text we've come across (for error reporting) + strcpy( szLastButtonText, cText ); + + // Get the button command + pfile = gEngfuncs.COM_ParseFile(pfile, token); + strncpy( cCommand, token, cCommandLength ); + cCommand[cCommandLength - 1] = '\0'; + + iButtonY = (BUTTON_SIZE_Y-1) * m_pCurrentCommandMenu->GetNumButtons(); + // Custom button handling + if ( iCustom ) + { + pButton = CreateCustomButton( cText, cCommand, iButtonY ); + + // Get the next token to see if we're a menu + pfile = gEngfuncs.COM_ParseFile(pfile, token); + + if ( token[0] == '{' ) + { + strcpy( cCommand, token ); + } + else + { + bGetExtraToken = false; + } + } + else if ( szMap[0] != '\0' ) + { + // create a map button + pButton = new MapButton(szMap, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY ); + } + else if ( iTeamOnly != -1) + { + // button that only shows up if the player is on team iTeamOnly + pButton = new TeamOnlyCommandButton( iTeamOnly, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign ); + } + else if ( iToggle && direction == 0 ) + { + pButton = new ToggleCommandButton( cCommand, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign ); + } + else if ( direction == 1 ) + { + if ( iToggle ) + pButton = new SpectToggleButton( cCommand, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign ); + else + pButton = new SpectButton( iPlayerClass, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY ); + } + else + { + // normal button + pButton = new CommandButton( iPlayerClass, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign ); + } + + // add the button into the command menu + if ( pButton ) + { + m_pCurrentCommandMenu->AddButton( pButton ); + pButton->setBoundKey( cBoundKey[0] ); + pButton->setParentMenu( m_pCurrentCommandMenu ); + + // Override font in CommandMenu + pButton->setFont( Scheme::sf_primary3 ); + } + + // Find out if it's a submenu or a button we're dealing with + if ( cCommand[0] == '{' ) + { + if ( m_iNumMenus >= MAX_MENUS ) + { + gEngfuncs.Con_Printf( "Too many menus in %s past '%s'\n",menuFile, szLastButtonText ); + } + else + { + // Create the menu + m_pCommandMenus[m_iNumMenus] = CreateSubMenu(pButton, m_pCurrentCommandMenu, iButtonY ); + m_pCurrentCommandMenu = m_pCommandMenus[m_iNumMenus]; + m_iNumMenus++; + } + } + else if ( !iCustom ) + { + // Create the button and attach it to the current menu + if ( iToggle ) + pButton->addActionSignal(new CMenuHandler_ToggleCvar(cCommand)); + else + pButton->addActionSignal(new CMenuHandler_StringCommand(cCommand)); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + + // Get the next token + if ( bGetExtraToken ) + { + pfile = gEngfuncs.COM_ParseFile(pfile, token); + } + } + + // Move back up a menu + m_pCurrentCommandMenu = m_pCurrentCommandMenu->GetParentMenu(); + + pfile = gEngfuncs.COM_ParseFile(pfile, token); + } +} +catch( CException *e ) +{ + e; + //e->Delete(); + e = NULL; + m_iInitialized = false; + return newIndex; +} + + SetCurrentMenu( NULL ); + SetCurrentCommandMenu( NULL ); + gEngfuncs.COM_FreeFile( pfile ); + + m_iInitialized = true; + return newIndex; +} + +//----------------------------------------------------------------------------- +// Purpose: Creates all the class choices under a spy's disguise menus, and +// maps a command to them +// Output : CCommandMenu +//----------------------------------------------------------------------------- +CCommandMenu *TeamFortressViewport::CreateDisguiseSubmenu( CommandButton *pButton, CCommandMenu *pParentMenu, const char *commandText, int iYOffset, int iXOffset ) +{ + // create the submenu, under which the class choices will be listed + CCommandMenu *pMenu = CreateSubMenu( pButton, pParentMenu, iYOffset, iXOffset ); + m_pCommandMenus[m_iNumMenus] = pMenu; + m_iNumMenus++; + + // create the class choice buttons + for ( int i = PC_SCOUT; i <= PC_ENGINEER; i++ ) + { + CommandButton *pDisguiseButton = new CommandButton( CHudTextMessage::BufferedLocaliseTextString( sLocalisedClasses[i] ), 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + + char sz[256]; + sprintf(sz, "%s %d", commandText, i ); + pDisguiseButton->addActionSignal(new CMenuHandler_StringCommand(sz)); + + pMenu->AddButton( pDisguiseButton ); + } + + return pMenu; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : *pButtonText - +// *pButtonName - +// Output : CommandButton +//----------------------------------------------------------------------------- +CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char *pButtonName, int iYOffset ) +{ + CommandButton *pButton = NULL; + CCommandMenu *pMenu = NULL; + + // ChangeTeam + if ( !strcmp( pButtonName, "!CHANGETEAM" ) ) + { + // ChangeTeam Submenu + pButton = new CommandButton(pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + + // Create the submenu + pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu, iYOffset ); + m_pCommandMenus[m_iNumMenus] = pMenu; + m_iNumMenus++; + + // ChangeTeam buttons + for (int i = 0; i < 4; i++) + { + char sz[256]; + sprintf(sz, "jointeam %d", i+1); + m_pTeamButtons[i] = new TeamButton(i+1, "teamname", 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + m_pTeamButtons[i]->addActionSignal(new CMenuHandler_StringCommandWatch( sz )); + pMenu->AddButton( m_pTeamButtons[i] ); + } + + // Auto Assign button + m_pTeamButtons[4] = new TeamButton(5, gHUD.m_TextMessage.BufferedLocaliseTextString( "#Team_AutoAssign" ), 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + m_pTeamButtons[4]->addActionSignal(new CMenuHandler_StringCommand( "jointeam 5" )); + pMenu->AddButton( m_pTeamButtons[4] ); + + // Spectate button + m_pTeamButtons[5] = new SpectateButton( CHudTextMessage::BufferedLocaliseTextString( "#Menu_Spectate" ), 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y, false); + m_pTeamButtons[5]->addActionSignal(new CMenuHandler_StringCommand( "spectate" )); + pMenu->AddButton( m_pTeamButtons[5] ); + } + // ChangeClass + else if ( !strcmp( pButtonName, "!CHANGECLASS" ) ) + { + // Create the Change class menu + pButton = new ClassButton(-1, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y, false); + + // ChangeClass Submenu + pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu, iYOffset ); + m_pCommandMenus[m_iNumMenus] = pMenu; + m_iNumMenus++; + + for (int i = PC_SCOUT; i <= PC_RANDOM; i++ ) + { + char sz[256]; + + // ChangeClass buttons + CHudTextMessage::LocaliseTextString( sLocalisedClasses[i], sz, 256 ); + ClassButton *pClassButton = new ClassButton( i, sz, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y, false); + + sprintf(sz, "%s", sTFClassSelection[i]); + pClassButton->addActionSignal(new CMenuHandler_StringCommandClassSelect(sz)); + pMenu->AddButton( pClassButton ); + } + } + // Map Briefing + else if ( !strcmp( pButtonName, "!MAPBRIEFING" ) ) + { + pButton = new CommandButton(pButtonText, 0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_TextWindow(MENU_MAPBRIEFING)); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + // Class Descriptions + else if ( !strcmp( pButtonName, "!CLASSDESC" ) ) + { + pButton = new ClassButton(0, pButtonText, 0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y, false); + pButton->addActionSignal(new CMenuHandler_TextWindow(MENU_CLASSHELP)); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!SERVERINFO" ) ) + { + pButton = new ClassButton(0, pButtonText, 0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y, false); + pButton->addActionSignal(new CMenuHandler_TextWindow(MENU_INTRO)); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + // Spy abilities + else if ( !strcmp( pButtonName, "!SPY" ) ) + { + pButton = new DisguiseButton( 0, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + } + // Feign + else if ( !strcmp( pButtonName, "!FEIGN" ) ) + { + pButton = new FeignButton(FALSE, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand( "feign" )); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + // Feign Silently + else if ( !strcmp( pButtonName, "!FEIGNSILENT" ) ) + { + pButton = new FeignButton(FALSE, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand( "sfeign" )); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + // Stop Feigning + else if ( !strcmp( pButtonName, "!FEIGNSTOP" ) ) + { + pButton = new FeignButton(TRUE, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand( "feign" )); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + // Disguise + else if ( !strcmp( pButtonName, "!DISGUISEENEMY" ) ) + { + // Create the disguise enemy button, which active only if there are 2 teams + pButton = new DisguiseButton(DISGUISE_TEAM2, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_enemy", iYOffset); + } + else if ( !strcmp( pButtonName, "!DISGUISEFRIENDLY" ) ) + { + // Create the disguise friendly button, which active only if there are 1 or 2 teams + pButton = new DisguiseButton(DISGUISE_TEAM1 | DISGUISE_TEAM2, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_friendly", iYOffset ); + } + else if ( !strcmp( pButtonName, "!DISGUISE" ) ) + { + // Create the Disguise button + pButton = new DisguiseButton( DISGUISE_TEAM3 | DISGUISE_TEAM4, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + CCommandMenu *pDisguiseMenu = CreateSubMenu( pButton, m_pCurrentCommandMenu, iYOffset ); + m_pCommandMenus[m_iNumMenus] = pDisguiseMenu; + m_iNumMenus++; + + // Disguise Enemy submenu buttons + for ( int i = 1; i <= 4; i++ ) + { + // only show the 4th disguise button if we have 4 teams + m_pDisguiseButtons[i] = new DisguiseButton( ((i < 4) ? DISGUISE_TEAM3 : 0) | DISGUISE_TEAM4, "Disguise", 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + + pDisguiseMenu->AddButton( m_pDisguiseButtons[i] ); + m_pDisguiseButtons[i]->setParentMenu( pDisguiseMenu ); + + char sz[256]; + sprintf( sz, "disguise %d", i ); + CreateDisguiseSubmenu( m_pDisguiseButtons[i], pDisguiseMenu, sz, iYOffset, CMENU_SIZE_X - 1 ); + } + } + // Start setting a Detpack + else if ( !strcmp( pButtonName, "!DETPACKSTART" ) ) + { + // Detpack Submenu + pButton = new DetpackButton(2, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + + // Create the submenu + pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu, iYOffset ); + m_pCommandMenus[m_iNumMenus] = pMenu; + m_iNumMenus++; + + // Set detpack buttons + CommandButton *pDetButton; + pDetButton = new CommandButton(m_sDetpackStrings[0], 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + pDetButton->addActionSignal(new CMenuHandler_StringCommand("detstart 5")); + pMenu->AddButton( pDetButton ); + pDetButton = new CommandButton(m_sDetpackStrings[1], 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + pDetButton->addActionSignal(new CMenuHandler_StringCommand("detstart 20")); + pMenu->AddButton( pDetButton ); + pDetButton = new CommandButton(m_sDetpackStrings[2], 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + pDetButton->addActionSignal(new CMenuHandler_StringCommand("detstart 50")); + pMenu->AddButton( pDetButton ); + } + // Stop setting a Detpack + else if ( !strcmp( pButtonName, "!DETPACKSTOP" ) ) + { + pButton = new DetpackButton(1, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand( "detstop" )); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + // Engineer building + else if ( !strcmp( pButtonName, "!BUILD" ) ) + { + // only appears if the player is an engineer, and either they have built something or have enough metal to build + pButton = new BuildButton( BUILDSTATE_BASE, 0, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + } + else if ( !strcmp( pButtonName, "!BUILDSENTRY" ) ) + { + pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("build 2")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!BUILDDISPENSER" ) ) + { + pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::DISPENSER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("build 1")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!ROTATESENTRY180" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("rotatesentry180")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!ROTATESENTRY" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("rotatesentry")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!DISMANTLEDISPENSER" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::DISPENSER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("dismantle 1")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!DISMANTLESENTRY" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("dismantle 2")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!DETONATEDISPENSER" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::DISPENSER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("detdispenser")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!DETONATESENTRY" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("detsentry")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + // Stop building + else if ( !strcmp( pButtonName, "!BUILDSTOP" ) ) + { + pButton = new BuildButton( BUILDSTATE_BUILDING, 0, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("build")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + + return pButton; +} + +void TeamFortressViewport::ToggleServerBrowser() +{ + if (!m_iInitialized) + return; + + if ( !m_pServerBrowser ) + return; + + if ( m_pServerBrowser->isVisible() ) + { + m_pServerBrowser->setVisible( false ); + } + else + { + m_pServerBrowser->setVisible( true ); + } + + UpdateCursorState(); +} + +//======================================================================= +void TeamFortressViewport::ShowCommandMenu(int menuIndex) +{ + if (!m_iInitialized) + return; + + //Already have a menu open. + if ( m_pCurrentMenu ) + return; + + // is the command menu open? + if ( m_pCurrentCommandMenu == m_pCommandMenus[menuIndex] ) + { + HideCommandMenu(); + return; + } + + // Not visible while in intermission + if ( gHUD.m_iIntermission ) + return; + + // Recalculate visible menus + UpdateCommandMenu( menuIndex ); + HideVGUIMenu(); + + SetCurrentCommandMenu( m_pCommandMenus[menuIndex] ); + m_flMenuOpenTime = gHUD.m_flTime; + UpdateCursorState(); + + // get command menu parameters + for ( int i = 2; i < gEngfuncs.Cmd_Argc(); i++ ) + { + const char *param = gEngfuncs.Cmd_Argv( i - 1 ); + if ( param ) + { + if ( m_pCurrentCommandMenu->KeyInput(param[0]) ) + { + // kill the menu open time, since the key input is final + HideCommandMenu(); + } + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Handles the key input of "-commandmenu" +// Input : +//----------------------------------------------------------------------------- +void TeamFortressViewport::InputSignalHideCommandMenu() +{ + if (!m_iInitialized) + return; + + // if they've just tapped the command menu key, leave it open + if ( (m_flMenuOpenTime + 0.3) > gHUD.m_flTime ) + return; + + HideCommandMenu(); +} + +//----------------------------------------------------------------------------- +// Purpose: Hides the command menu +//----------------------------------------------------------------------------- +void TeamFortressViewport::HideCommandMenu() +{ + if (!m_iInitialized) + return; + + if ( m_pCommandMenus[m_StandardMenu] ) + { + m_pCommandMenus[m_StandardMenu]->ClearButtonsOfArmedState(); + } + + if ( m_pCommandMenus[m_SpectatorOptionsMenu] ) + { + m_pCommandMenus[m_SpectatorOptionsMenu]->ClearButtonsOfArmedState(); + } + + if ( m_pCommandMenus[m_SpectatorCameraMenu] ) + { + m_pCommandMenus[m_SpectatorCameraMenu]->ClearButtonsOfArmedState(); + } + + m_flMenuOpenTime = 0.0f; + SetCurrentCommandMenu( NULL ); + UpdateCursorState(); +} + +//----------------------------------------------------------------------------- +// Purpose: Bring up the scoreboard +//----------------------------------------------------------------------------- +void TeamFortressViewport::ShowScoreBoard( void ) +{ + if (m_pScoreBoard) + { + // No Scoreboard in single-player + if ( gEngfuncs.GetMaxClients() > 1 ) + { + if(gHUD.SwitchUIMode(SCOREBOARD_MODE)) + { + m_pScoreBoard->Open(); + + // TODO: HLSDK 2.3 requires this? + //UpdateCursorState(); + + // If cursor is visible, set squelch mode automatically (used for commander) + if(gHUD.GetIsInTopDownMode()) + { + m_pScoreBoard->SetSquelchMode(true); + } + } + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Returns true if the scoreboard is up +//----------------------------------------------------------------------------- +bool TeamFortressViewport::IsScoreBoardVisible( void ) +{ + if (m_pScoreBoard) + return m_pScoreBoard->isVisible(); + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Hide the scoreboard +//----------------------------------------------------------------------------- +const float kButtonWidth = .15f; +const float kButtonHeight = .08f; +const float kButtonHorizontalSpacing = .15f; +const float kButtonVerticalSpacing = .05f; +const float xInset = .05f; +const float yInset = .07f; + +void TeamFortressViewport::HideScoreBoard( void ) +{ + // Prevent removal of scoreboard during intermission + if ( gHUD.m_iIntermission ) + return; + + if (m_pScoreBoard && m_pScoreBoard->isVisible()) + { + // Hide other components + if(gHUD.SwitchUIMode(MAIN_MODE)) + { + m_pScoreBoard->setVisible(false); + + //GetClientVoiceMgr()->StopSquelchMode(); + m_pScoreBoard->SetSquelchMode(false); + + //UpdateCursorState(); + } + } +} + +void TeamFortressViewport::ShowOptionsMenu() +{ + if(this->mOptionsScreen) + { + const char* theSound = AvHSHUGetCommonSoundName(gHUD.GetIsAlien(), WEAPON_SOUND_HUD_ON); + gHUD.PlayHUDSound(theSound, kHUDSoundVolume); + + this->mOptionsScreen->setVisible(true); + + for(int i = 0; i < kNumOptionsButtons; i++) + { + if(this->mOptionsButtons[i]) + { + this->mOptionsButtons[i]->setVisible(true); + } + } + + #ifdef AVH_PLAYTEST_BUILD + this->mNSLogoLabel->setVisible(true); + + // Only create control if server sent them down + const BalanceIntListType& theBalanceInts = gHUD.GetBalanceInts(); + int theNumBalanceInts = theBalanceInts.size(); + if(this->mPlaytestVariables && (theNumBalanceInts > 0)) + { + // Clear out existing entries + this->mPlaytestVariables->Init(); + + // Populate playtest info + this->mPlaytestVariableRow = 0; + for(BalanceIntListType::const_iterator theIter = theBalanceInts.begin(); theIter != theBalanceInts.end(); theIter++) + { + this->AddBalanceVariable(theIter->first); + } + + const BalanceFloatListType& theBalanceFloats = gHUD.GetBalanceFloats(); + for(BalanceFloatListType::const_iterator theFloatIter = theBalanceFloats.begin(); theFloatIter != theBalanceFloats.end(); theFloatIter++) + { + this->AddBalanceVariable(theFloatIter->first); + } + + this->mPlaytestVariables->setSize(this->mPlaytestVariableWidth, this->mPlaytestVariableHeight); + this->mPlaytestVariables->setVisible(true); + } + + if(this->mPlaytestAnalysis) + { + this->mPlaytestAnalysis->setSize(this->mPlaytestAnalysisWidth, this->mPlaytestAnalysisHeight); + this->mPlaytestAnalysis->setVisible(true); + } + + this->mPlaytestVariableValue->addInputSignal(&this->mPlaytestInputSignal); + this->mPlaytestVariableValue->setSize(kButtonWidth*ScreenWidth(), kButtonHeight*ScreenHeight()); + this->mPlaytestVariableValue->setParent(this->mOptionsScreen); +// this->mPlaytestVariableValue->setFont(Scheme::sf_primary1); + this->mPlaytestVariableValue->setVisible(true); + this->mPlaytestVariableValue->setText(this->mPlaytestVariableValueBeforeHide.c_str(), this->mPlaytestVariableValueBeforeHide.length()); + + this->mPlaytestVariableName.setVisible(true); + #endif + + //this->mOptionsEscapeButton->setVisible(true); + gHUD.GetManager().SetMouseVisibility(true); + } +} + +#ifdef AVH_PLAYTEST_BUILD + +Color kPlaytestEntryLabelBGColor(0, 0, 0, 50); +Color kPlaytestEntryLabelFGColor(255, 255, 255, 70); +Color kPlaytestEntryLabelSelectedBGColor(0, 0, 0, 50); +Color kPlaytestEntryLabelSelectedFGColor(255, 255, 255, 0); + +void TeamFortressViewport::AddAnalysisLine(const string& inAnalysisLine) +{ + // Add entry + vgui::Label* theCurrentLabel = this->mPlaytestAnalysisLabels + this->mPlaytestAnalysisRow; + string theLabelText = inAnalysisLine; + theCurrentLabel->setText(theLabelText.c_str()); + theCurrentLabel->setVisible(true); + theCurrentLabel->setSize(this->mPlaytestAnalysisWidth, kButtonHeight*ScreenHeight()); + theCurrentLabel->setParent(this->mOptionsScreen); + //theCurrentLabel->addInputSignal(&this->mPlaytestInputSignal); + + int theR, theG, theB, theA; + kPlaytestEntryLabelFGColor.getColor(theR, theG, theB, theA); + theCurrentLabel->setFgColor(theR, theG, theB, theA); + theCurrentLabel->setBgColor(kPlaytestEntryLabelBGColor); + + theCurrentLabel->setFont(Scheme::sf_primary1); + theCurrentLabel->setContentAlignment(vgui::Label::a_west); + + this->mPlaytestAnalysis->AddItem(this->mPlaytestAnalysisLabels + this->mPlaytestAnalysisRow); + + this->mPlaytestAnalysisRow++; +} + +void TeamFortressViewport::RecomputeAnalysis() +{ + if(this->mPlaytestAnalysis) + { + //this->mPlaytestAnalysis->setVisible(false); + + this->mPlaytestAnalysis->Init(); + this->mPlaytestAnalysisRow = 0; + + // Fetch list of balance strings + StringList theBalanceAnalyses; + AvHBAComputeAnalysis(theBalanceAnalyses); + + // Add them + for(StringList::const_iterator theIter = theBalanceAnalyses.begin(); theIter != theBalanceAnalyses.end(); theIter++) + { + this->AddAnalysisLine(*theIter); + } + + //this->mPlaytestAnalysis->setVisible(true); + } +} + + +void TeamFortressViewport::AddBalanceVariable(const string& inVariableName) +{ + // Add entry + vgui::Label* theCurrentLabel = this->mPlaytestEntryLabels + this->mPlaytestVariableRow; + string theLabelText = inVariableName; + theCurrentLabel->setText(theLabelText.c_str()); + theCurrentLabel->setVisible(true); + theCurrentLabel->setSize(this->mPlaytestVariableWidth, kButtonHeight*ScreenHeight()); + theCurrentLabel->setParent(this->mOptionsScreen); + theCurrentLabel->addInputSignal(&this->mPlaytestInputSignal); + + int theR, theG, theB, theA; + kPlaytestEntryLabelFGColor.getColor(theR, theG, theB, theA); + theCurrentLabel->setFgColor(theR, theG, theB, theA); + theCurrentLabel->setBgColor(kPlaytestEntryLabelBGColor); + + theCurrentLabel->setFont(Scheme::sf_primary1); + theCurrentLabel->setContentAlignment(vgui::Label::a_west); + + this->mPlaytestVariables->AddItem(this->mPlaytestEntryLabels + this->mPlaytestVariableRow); + + this->mPlaytestVariableRow++; +} + +// Input signal for playtest labels in options menu +void OptionsScreenInputSignal::SelectLabel(Panel* inPanel) +{ + SmartLabel* theLabel = dynamic_cast(inPanel); + + if(theLabel) + { + // Look up variable name + string theString = theLabel->getText(); + + float theValue = 0.0f; + bool theFoundValue = false; + bool theFoundFloat = false; + + const BalanceIntListType& theBalanceInts = gHUD.GetBalanceInts(); + for(BalanceIntListType::const_iterator theIter = theBalanceInts.begin(); theIter != theBalanceInts.end(); theIter++) + { + if(theIter->first == theString) + { + theValue = theIter->second; + theFoundValue = true; + break; + } + } + + if(!theFoundValue) + { + const BalanceFloatListType& theBalanceFloats = gHUD.GetBalanceFloats(); + for(BalanceFloatListType::const_iterator theIter = theBalanceFloats.begin(); theIter != theBalanceFloats.end(); theIter++) + { + if(theIter->first == theString) + { + theValue = theIter->second; + theFoundValue = true; + theFoundFloat = true; + break; + } + } + } + + if(theFoundValue) + { + const char* theSound = AvHSHUGetCommonSoundName(gHUD.GetIsAlien(), WEAPON_SOUND_MOVE_SELECT); + gHUD.PlayHUDSound(theSound, kHUDSoundVolume); + + // Read value from this label + gViewPort->mPlaytestVariableName.setText(theString.length(), theString.c_str()); + + // Set text entry value + char theReadableValue[1024]; + if(theFoundFloat) + { + sprintf(theReadableValue, "%.2f", theValue); + } + else + { + sprintf(theReadableValue, "%d", (int)theValue); + } + + gViewPort->mPlaytestVariableValue->setText(theReadableValue, strlen(theReadableValue)); + } + } +} + + +void OptionsScreenInputSignal::cursorMoved(int x,int y,Panel* panel) +{ +} + +void OptionsScreenInputSignal::cursorEntered(Panel* inPanel) +{ + SmartLabel* theCurrentLabel = dynamic_cast(inPanel); + if(theCurrentLabel) + { + int theR, theG, theB, theA; + kPlaytestEntryLabelSelectedFGColor.getColor(theR, theG, theB, theA); + theCurrentLabel->setFgColor(theR, theG, theB, theA); + + theCurrentLabel->setBgColor(kPlaytestEntryLabelSelectedBGColor); + } +} + +void OptionsScreenInputSignal::cursorExited(Panel* inPanel) +{ + SmartLabel* theCurrentLabel = dynamic_cast(inPanel); + if(theCurrentLabel) + { + int theR, theG, theB, theA; + kPlaytestEntryLabelFGColor.getColor(theR, theG, theB, theA); + theCurrentLabel->setFgColor(theR, theG, theB, theA); + + theCurrentLabel->setBgColor(kPlaytestEntryLabelBGColor); + } +} + +void OptionsScreenInputSignal::mousePressed(MouseCode code,Panel* panel) +{ + if(code == MOUSE_LEFT) + { + this->SelectLabel(panel); + } +} + +void OptionsScreenInputSignal::mouseDoublePressed(MouseCode code,Panel* panel) +{ +} + +void OptionsScreenInputSignal::mouseReleased(MouseCode code,Panel* panel) +{ +} + +void OptionsScreenInputSignal::mouseWheeled(int delta,Panel* panel) +{ +} + +void OptionsScreenInputSignal::keyPressed(KeyCode code,Panel* panel) +{ +} + +void OptionsScreenInputSignal::keyTyped(KeyCode code, Panel* panel) +{ + if((panel == gViewPort->mPlaytestVariableValue) && (code == KEY_ENTER)) + { + // Read variable name + string theVariableName = gViewPort->mPlaytestVariableName.getText(); + + // Read variable value out of text entry + char theBuff[256]; + gViewPort->mPlaytestVariableValue->getText(0, theBuff, 256); + string theValue(theBuff); + + // Emit console command to change this value + string theConsoleCommand = string(kcSetBalanceVar) + " " + theVariableName + " " + theValue; + + char theBuff2[256]; + sprintf(theBuff2, "%s", theConsoleCommand.c_str()); + gEngfuncs.pfnClientCmd(theBuff2); + } +} + +void OptionsScreenInputSignal::keyReleased(KeyCode code,Panel* panel) +{ +} + +void OptionsScreenInputSignal::keyFocusTicked(Panel* panel) +{ +} +#endif + + + +void TeamFortressViewport::HideOptionsMenu() +{ + if(this->mOptionsScreen) + { + const char* theSound = AvHSHUGetCommonSoundName(gHUD.GetIsAlien(), WEAPON_SOUND_HUD_OFF); + gHUD.PlayHUDSound(theSound, kHUDSoundVolume); + + this->mOptionsScreen->setVisible(false); + for(int i = 0; i < kNumOptionsButtons; i++) + { + if(this->mOptionsButtons[i]) + { + this->mOptionsButtons[i]->setVisible(false); + } + } + + #ifdef AVH_PLAYTEST_BUILD + this->mNSLogoLabel->setVisible(false); + + if(this->mPlaytestVariables) + { + this->mPlaytestVariables->setVisible(false); + this->mPlaytestVariables->setBgColor(128, 128, 128, 10); + this->mPlaytestVariables->setFgColor(128, 128, 128, 40); + } + + if(this->mPlaytestAnalysis) + { + this->mPlaytestAnalysis->setVisible(false); + this->mPlaytestAnalysis->setBgColor(128, 128, 128, 10); + this->mPlaytestAnalysis->setFgColor(128, 128, 128, 40); + } + + this->mPlaytestVariableValue->setVisible(false); + this->mPlaytestVariableValue->removeInputSignal(&this->mPlaytestInputSignal); + + // Save text of the value so we can restore it when the screen comes back up (can't figure out way to turn off input) + char theText[1024]; + this->mPlaytestVariableValue->getText(0, theText, 1024); + this->mPlaytestVariableValueBeforeHide = ""; + if(theText[0] != '\0') + { + this->mPlaytestVariableValueBeforeHide = string(theText); + } + + this->mPlaytestVariableValue->requestFocusNext(); + + this->mPlaytestVariableName.setVisible(false); + #endif + + gHUD.GetManager().SetMouseVisibility(false); + + gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + } +} + +bool TeamFortressViewport::IsOptionsMenuVisible() +{ + bool theIsVisible = false; + + if(this->mOptionsScreen) + { + theIsVisible = this->mOptionsScreen->isVisible(); + } + + return theIsVisible; +} + + +//----------------------------------------------------------------------------- +// Purpose: Activate's the player special ability +// called when the player hits their "special" key +//----------------------------------------------------------------------------- +void TeamFortressViewport::InputPlayerSpecial( void ) +{ + if (!m_iInitialized) + return; + + if ( g_iPlayerClass == PC_ENGINEER || g_iPlayerClass == PC_SPY ) + { + ShowCommandMenu( gViewPort->m_StandardMenu ); + + if ( m_pCurrentCommandMenu ) + { + m_pCurrentCommandMenu->KeyInput( '7' ); + } + } + else + { + // if it's any other class, just send the command down to the server + ClientCmd( "_special" ); + } +} + +// Set the submenu of the Command Menu +void TeamFortressViewport::SetCurrentCommandMenu( CCommandMenu *pNewMenu ) +{ + for (int i = 0; i < m_iNumMenus; i++) + m_pCommandMenus[i]->setVisible(false); + + m_pCurrentCommandMenu = pNewMenu; + + if (m_pCurrentCommandMenu) + m_pCurrentCommandMenu->MakeVisible( NULL ); +} + +void TeamFortressViewport::UpdateCommandMenu(int menuIndex) +{ + m_pCommandMenus[menuIndex]->RecalculateVisibles( 0, false ); + m_pCommandMenus[menuIndex]->RecalculatePositions( 0 ); +} + +void COM_FileBase ( const char *in, char *out); + +void TeamFortressViewport::UpdateSpectatorPanel() +{ + m_iUser1 = g_iUser1; + m_iUser2 = g_iUser2; + m_iUser3 = g_iUser3; + + if (!m_pSpectatorPanel) + return; + + if ( g_iUser1 && gHUD.m_pCvarDraw->value && !gHUD.m_iIntermission) // don't draw in dev_overview mode + { + char bottomText[128]; + char helpString2[128]; + char * name; + int player = 0; + + // check if spectator combinations are still valid + gHUD.m_Spectator.CheckSettings(); + + if ( !m_pSpectatorPanel->isVisible() ) + { + m_pSpectatorPanel->setVisible( true ); // show spectator panel, but + m_pSpectatorPanel->ShowMenu( true ); + + // Removed by mmcguire. + // This text isn't applicable anymore. + + /* + char tempString[128]; + + _snprintf( tempString, sizeof( tempString ) - 1, "%c%s", HUD_PRINTCENTER, CHudTextMessage::BufferedLocaliseTextString( "#Spec_Duck" ) ); + tempString[ sizeof( tempString ) - 1 ] = '\0'; + + gHUD.m_TextMessage.MsgFunc_TextMsg( NULL, strlen( tempString ) + 1, tempString ); + */ + } + + sprintf(bottomText,"#Spec_Mode%d", g_iUser1 ); + sprintf(helpString2,"#Spec_Mode%d", g_iUser1 ); + + if ( gEngfuncs.IsSpectateOnly() ) + strcat(helpString2, " - HLTV"); + + // check if we're locked onto a target, show the player's name + if ( (g_iUser2 > 0) && (g_iUser2 <= gEngfuncs.GetMaxClients()) && (g_iUser1 != OBS_ROAMING) ) + { + player = g_iUser2; + } + + name = g_PlayerInfoList[player].name; + + // create player & health string + if ( player && name ) + { + strcpy( bottomText, name ); + } +/* + // in first person mode colorize player names + if ( (g_iUser1 == OBS_IN_EYE) && player ) + { + float * color = GetClientColor( player ); + int r = color[0]*255; + int g = color[1]*255; + int b = color[2]*255; + + // set team color, a bit transparent + m_pSpectatorPanel->m_BottomMainLabel->setFgColor(r,g,b,0); + } + else + { // restore GUI color + m_pSpectatorPanel->m_BottomMainLabel->setFgColor( 143, 143, 54, 0 ); + } +*/ + // add sting auto if we are in auto directed mode + if ( CVAR_GET_FLOAT("spec_autodirector") != 0 ) + { + char tempString[128]; + sprintf(tempString, "#Spec_Auto %s", helpString2); + strcpy( helpString2, tempString ); + } + + m_pSpectatorPanel->m_BottomMainLabel->setText( CHudTextMessage::BufferedLocaliseTextString( bottomText ) ); + + + // update extra info field + char szText[64]; + + if ( gEngfuncs.IsSpectateOnly() ) + { + // in HLTV mode show number of spectators + _snprintf( szText, 63, "%s: %d", CHudTextMessage::BufferedLocaliseTextString( "#Spectators" ), gHUD.m_Spectator.m_iSpectatorNumber ); + } + else + { + // otherwise show map name + char szMapName[64]; + COM_FileBase( gEngfuncs.pfnGetLevelName(), szMapName ); + + _snprintf ( szText, 63, "%s: %s",CHudTextMessage::BufferedLocaliseTextString( "#Spec_Map" ), szMapName ); + } + + szText[63] = 0; + + m_pSpectatorPanel->m_ExtraInfo->setText ( szText ); + + /* + int timer = (int)( gHUD.m_roundTimer.m_flTimeEnd - gHUD.m_flTime ); + + if ( timer < 0 ) + timer = 0; + + _snprintf ( szText, 63, "%d:%02d\n", (timer / 60), (timer % 60) ); + + szText[63] = 0; + + m_pSpectatorPanel->m_CurrentTime->setText( szText ); */ + int theTimeToDisplay = gHUD.GetGameTime(); + _snprintf ( szText, 63, "%d:%02d\n", (theTimeToDisplay / 60), (theTimeToDisplay % 60) ); + szText[63] = 0; + m_pSpectatorPanel->m_CurrentTime->setText( szText ); + + // update spectator panel + gViewPort->m_pSpectatorPanel->Update(); + } + else + { + if ( m_pSpectatorPanel->isVisible() ) + { + m_pSpectatorPanel->setVisible( false ); + } + if (m_pSpectatorPanel->m_menuVisible) + { + m_pSpectatorPanel->ShowMenu( false ); // dsiable all menus/buttons + } + + } + + // If balance has changed, recompute balance + #ifdef AVH_PLAYTEST_BUILD + if(this->mBalanceChanged && this->IsOptionsMenuVisible()) + { + this->RecomputeAnalysis(); + this->mBalanceChanged = false; + } + #endif + + m_flSpectatorPanelLastUpdated = gHUD.m_flTime + 1.0; // update every seconds +} + +//====================================================================== +void TeamFortressViewport::CreateScoreBoard( void ) +{ + int xdent = SBOARD_INDENT_X; + int ydent = SBOARD_INDENT_Y; + if (ScreenWidth() == 512) + { + xdent = SBOARD_INDENT_X_512; + ydent = SBOARD_INDENT_Y_512; + } + else if (ScreenWidth() == 400) + { + xdent = SBOARD_INDENT_X_400; + ydent = SBOARD_INDENT_Y_400; + } + + m_pScoreBoard = new ScorePanel(xdent, ydent, ScreenWidth() - (xdent * 2), ScreenHeight() - (ydent * 2)); + m_pScoreBoard->setParent(this); + m_pScoreBoard->setVisible(false); +} + +void TeamFortressViewport::CreateOptionsMenu() +{ + //this->mOptionsScreen = new ColoredPanel(0, 0, ScreenWidth, ScreenHeight); + this->mOptionsScreen = new CTransparentPanel(128, 0, 0, ScreenWidth(), ScreenHeight()); + this->mOptionsScreen->setBorder( new LineBorder( Color(255*0.7,170*0.7,0,0 )) ); + this->mOptionsScreen->setParent(this); + this->mOptionsScreen->setBgColor(128, 128, 128, 40); + this->mOptionsScreen->setVisible(false); + + int theScreenWidth = ScreenWidth(); + int theScreenHeight = ScreenHeight(); + + // Populate playtest info + #ifdef AVH_PLAYTEST_BUILD + this->mPlaytestVariables->setVisible(false); + this->mPlaytestVariables->setParent(this->mOptionsScreen); + int thePlaytestX = (xInset /*+ kButtonWidth + kButtonHorizontalSpacing*/)*ScreenWidth(); + int thePlaytestY = yInset*ScreenHeight(); + this->mPlaytestVariables->setPos(thePlaytestX, thePlaytestY); + + this->mPlaytestVariableWidth = kButtonWidth*2.1f*ScreenWidth(); + this->mPlaytestVariableHeight = kButtonHeight*10.0f*ScreenHeight(); + int theColumnTwoX = thePlaytestX + this->mPlaytestVariableWidth + xInset*ScreenWidth(); + + this->mPlaytestAnalysis->setVisible(false); + this->mPlaytestAnalysis->setParent(this->mOptionsScreen); + this->mPlaytestAnalysis->setPos(.4f*ScreenWidth(), .6*ScreenHeight()); + this->mPlaytestAnalysisWidth = .4*ScreenWidth(); + this->mPlaytestAnalysisHeight = .3*ScreenHeight(); + + this->mNSLogoBitmap = vgui_LoadTGANoInvertAlpha("gfx/vgui/ns-logo.tga"); + this->mNSLogoBitmap->setColor(Color(255, 255, 255, 0)); + int theBitmapWidth, theBitmapHeight; + this->mNSLogoBitmap->getSize(theBitmapWidth, theBitmapHeight); + this->mNSLogoLabel = new vgui::Label("", theColumnTwoX, thePlaytestY, theBitmapWidth, theBitmapHeight); + this->mNSLogoLabel->setParent(this->mOptionsScreen); + this->mNSLogoLabel->setImage(this->mNSLogoBitmap); + //this->mNSLogoLabel->setFgColorAsImageColor(false); + + Color thePlaytestBGColor(0, 0, 0, 0); + Color thePlaytestFGColor(128, 128, 128, 128); + + this->mPlaytestVariableName.setParent(this); + int thePlaytestVariableNameY = thePlaytestY + theBitmapHeight + yInset*ScreenHeight(); + this->mPlaytestVariableName.setPos(theColumnTwoX, thePlaytestVariableNameY);//= new vgui::Label("", kPlaytestVariableXOffset*theScreenWidth, kPlaytestVariableYOffset*theScreenHeight, kButtonWidth, kButtonHeight); + this->mPlaytestVariableName.setSize(kButtonWidth, kButtonHeight); + this->mPlaytestVariableName.setBgColor(thePlaytestBGColor); + this->mPlaytestVariableName.setFgColor(Scheme::sc_white); + + this->mPlaytestVariableValue = new TextEntry("", theColumnTwoX, thePlaytestVariableNameY + yInset*theScreenHeight, kButtonWidth, kButtonHeight/2.0f); + this->mPlaytestVariableValue->setBgColor(thePlaytestBGColor); + this->mPlaytestVariableValue->setFgColor(Scheme::sc_white); + + for(int i = 0; i < kNumOptionsButtons; i++) + { + const char* theLabel = kOptionsButtons[i*2]; + char* theCommand = kOptionsButtons[i*2 + 1]; + //CommandButton* theCurrentCommandButton = this->mOptionsButtons[i]; + + this->mOptionsButtons[i] = new CommandButton(CHudTextMessage::BufferedLocaliseTextString(theLabel), theColumnTwoX + theBitmapWidth + xInset*theScreenWidth, yInset*theScreenHeight + (float)i*(kButtonHeight+kButtonVerticalSpacing)*ScreenHeight(), kButtonWidth*theScreenWidth, kButtonHeight*theScreenHeight); + this->mOptionsButtons[i]->setParent(this->mOptionsScreen); + this->mOptionsButtons[i]->setBgColor(128, 128, 128, 40); + this->mOptionsButtons[i]->addActionSignal(new COptionsScreen_StringCommand(theCommand)); + this->mOptionsButtons[i]->setVisible(false); + this->mOptionsButtons[i]->setFont(Scheme::sf_primary1); + } + #endif +} + +void TeamFortressViewport::CreateServerBrowser( void ) +{ + m_pServerBrowser = new ServerBrowser( 0, 0, ScreenWidth(), ScreenHeight() ); + m_pServerBrowser->setParent(this); + m_pServerBrowser->setVisible(false); +} + +void TeamFortressViewport::CreatePlayerMenu() +{ + + int newIndex = m_iNumMenus; + + m_pCommandMenus[newIndex] = new CCommandMenu(NULL, 1, XRES(390), YRES(32), XRES(kPlayerMenuWidth), YRES(300)); // This will be resized once we know how many items are in it + + m_pCommandMenus[newIndex]->setParent(this); + m_pCommandMenus[newIndex]->setVisible(false); + m_pCommandMenus[newIndex]->m_flButtonSizeY = BUTTON_SIZE_Y / 2; + m_pCommandMenus[newIndex]->m_iSpectCmdMenu = 1; + + m_iNumMenus++; + + m_SpectatorPlayerMenu = newIndex; + +} + +void TeamFortressViewport::UpdatePlayerMenu() +{ + + CCommandMenu* pMenu = m_pCommandMenus[m_SpectatorPlayerMenu]; + + int xOffset = 0; + + float flButtonSizeX = XRES(kPlayerMenuWidth); + float flButtonSizeY = BUTTON_SIZE_Y / 2; + + // Create a menu item for each of the players. + + pMenu->ClearButtonsOfArmedState(); + pMenu->RemoveAllButtons(); + + // Make sure we have player info + gViewPort->GetAllPlayersInfo(); + + for (int team = 0; team < 4; ++team) + { + + if (gHUD.GetPlayMode() != PLAYMODE_OBSERVER) + { + // Filter out players who aren't on our team. + + int theLocalPlayerTeam = 0; + + if (gEngfuncs.GetLocalPlayer()) + { + theLocalPlayerTeam = gEngfuncs.GetLocalPlayer()->curstate.team; + } + + if (theLocalPlayerTeam != team) + { + continue; + } + + } + + for (int i = 1; i <= MAX_PLAYERS; ++i) + { + + if ( g_PlayerInfoList[i].name == NULL ) + continue; // empty player slot, skip + + if ( g_PlayerExtraInfo[i].teamname[0] == 0 ) + continue; // skip over players who are not in a team + + if ( g_PlayerExtraInfo[i].teamnumber != team) + continue; + + switch(g_PlayerExtraInfo[i].playerclass) + { + case PLAYERCLASS_SPECTATOR: + case PLAYERCLASS_COMMANDER: + case PLAYERCLASS_REINFORCING: + continue; + } + + int iButtonY = (BUTTON_SIZE_Y-1) * pMenu->GetNumButtons(); + + PlayerButton* pButton = new PlayerButton(i, g_PlayerInfoList[i].name, 0, iButtonY, flButtonSizeX, flButtonSizeY, false, true); + + //pButton->setArmedColor(teamR, teamG, teamB, 0); + //pButton->setUnArmedColor(teamR, teamG, teamB, 0); + //pButton->setArmedBorderColor(255 / gHUD.GetGammaSlope(), 255 / gHUD.GetGammaSlope(), 255 / gHUD.GetGammaSlope(), 0); + + if ( pButton ) + { + pMenu->AddButton( pButton ); + pButton->setParentMenu( pMenu ); + pButton->setFont( Scheme::sf_primary3 ); + + char command[MAX_COMMAND_SIZE]; + sprintf(command, "follow %d", i); + + pButton->addActionSignal(new CMenuHandler_StringCommand(command)); + + } + + } + } + +} + +//====================================================================== +// Set the VGUI Menu +void TeamFortressViewport::SetCurrentMenu( CMenuPanel *pMenu ) +{ + m_pCurrentMenu = pMenu; + if ( m_pCurrentMenu ) + { + // Don't open menus in demo playback + if ( gEngfuncs.pDemoAPI->IsPlayingback() ) + return; + + m_pCurrentMenu->Open(); + } +} + +//================================================================ +// Text Window +CMenuPanel* TeamFortressViewport::CreateTextWindow( int iTextToShow ) +{ + char sz[256]; + char *cText; + char *pfile = NULL; + static const int MAX_TITLE_LENGTH = 32; + char cTitle[MAX_TITLE_LENGTH]; + + if ( iTextToShow == SHOW_MOTD ) + { + if (!m_szServerName || !m_szServerName[0]) + strcpy( cTitle, kAvHGameName ); + else + strncpy( cTitle, m_szServerName, MAX_TITLE_LENGTH ); + cTitle[MAX_TITLE_LENGTH-1] = 0; + cText = m_szMOTD; + } + else if ( iTextToShow == SHOW_MAPBRIEFING ) + { + // Get the current mapname, and open it's map briefing text + if (m_sMapName && m_sMapName[0]) + { + strcpy( sz, "maps/"); + strcat( sz, m_sMapName ); + strcat( sz, ".txt" ); + } + else + { + const char *level = gEngfuncs.pfnGetLevelName(); + if (!level) + return NULL; + + strcpy( sz, level ); + char *ch = strchr( sz, '.' ); + *ch = '\0'; + strcat( sz, ".txt" ); + + // pull out the map name + strcpy( m_sMapName, level ); + ch = strchr( m_sMapName, '.' ); + if ( ch ) + { + *ch = 0; + } + + ch = strchr( m_sMapName, '/' ); + if ( ch ) + { + // move the string back over the '/' + memmove( m_sMapName, ch+1, strlen(ch)+1 ); + } + } + + pfile = (char*)gEngfuncs.COM_LoadFile( sz, 5, NULL ); + + if (!pfile) + return NULL; + + cText = pfile; + + strncpy( cTitle, m_sMapName, MAX_TITLE_LENGTH ); + cTitle[MAX_TITLE_LENGTH-1] = 0; + } + else if ( iTextToShow == SHOW_CLASSDESC ) + { + switch ( g_iPlayerClass ) + { + case PC_SCOUT: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_scout" ); + CHudTextMessage::LocaliseTextString( "#Title_scout", cTitle, MAX_TITLE_LENGTH ); break; + case PC_SNIPER: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_sniper" ); + CHudTextMessage::LocaliseTextString( "#Title_sniper", cTitle, MAX_TITLE_LENGTH ); break; + case PC_SOLDIER: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_soldier" ); + CHudTextMessage::LocaliseTextString( "#Title_soldier", cTitle, MAX_TITLE_LENGTH ); break; + case PC_DEMOMAN: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_demoman" ); + CHudTextMessage::LocaliseTextString( "#Title_demoman", cTitle, MAX_TITLE_LENGTH ); break; + case PC_MEDIC: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_medic" ); + CHudTextMessage::LocaliseTextString( "#Title_medic", cTitle, MAX_TITLE_LENGTH ); break; + case PC_HVYWEAP: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_hwguy" ); + CHudTextMessage::LocaliseTextString( "#Title_hwguy", cTitle, MAX_TITLE_LENGTH ); break; + case PC_PYRO: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_pyro" ); + CHudTextMessage::LocaliseTextString( "#Title_pyro", cTitle, MAX_TITLE_LENGTH ); break; + case PC_SPY: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_spy" ); + CHudTextMessage::LocaliseTextString( "#Title_spy", cTitle, MAX_TITLE_LENGTH ); break; + case PC_ENGINEER: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_engineer" ); + CHudTextMessage::LocaliseTextString( "#Title_engineer", cTitle, MAX_TITLE_LENGTH ); break; + case PC_CIVILIAN: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_civilian" ); + CHudTextMessage::LocaliseTextString( "#Title_civilian", cTitle, MAX_TITLE_LENGTH ); break; + default: + return NULL; + } + + if ( g_iPlayerClass == PC_CIVILIAN ) + { + sprintf(sz, "classes/long_civilian.txt"); + } + else + { + sprintf(sz, "classes/long_%s.txt", sTFClassSelection[ g_iPlayerClass ]); + } + char *pfile = (char*)gEngfuncs.COM_LoadFile( sz, 5, NULL ); + if (pfile) + { + cText = pfile; + } + } + else if ( iTextToShow == SHOW_SPECHELP ) + { + CHudTextMessage::LocaliseTextString( "#Spec_Help_Title", cTitle, MAX_TITLE_LENGTH ); + cTitle[MAX_TITLE_LENGTH-1] = 0; + + char *pfile = CHudTextMessage::BufferedLocaliseTextString( "#Spec_Help_Text" ); + if ( pfile ) + { + cText = pfile; + } + } + + // if we're in the game (ie. have selected a class), flag the menu to be only grayed in the dialog box, instead of full screen + CMenuPanel *pMOTDPanel = CMessageWindowPanel_Create( cText, cTitle, g_iPlayerClass == PC_UNDEFINED, false, 0, 0, ScreenWidth(), ScreenHeight() ); + pMOTDPanel->setParent( this ); + + if ( pfile ) + gEngfuncs.COM_FreeFile( pfile ); + + return pMOTDPanel; +} + +char* TeamFortressViewport::GetTeamName( int iTeam ) +{ + return m_sTeamNames[iTeam]; +} + +//================================================================ +// VGUI Menus +void TeamFortressViewport::ShowVGUIMenu( int iMenu ) +{ + CMenuPanel *pNewMenu = NULL; + + gHUD.SetUsingVGUI(true); + + // Don't open menus in demo playback + if ( gEngfuncs.pDemoAPI->IsPlayingback() ) + return; + + // Don't open any menus except the MOTD during intermission + // MOTD needs to be accepted because it's sent down to the client + // after map change, before intermission's turned off + if ( gHUD.m_iIntermission && iMenu != MENU_INTRO ) + return; + + // Don't create one if it's already in the list + if (m_pCurrentMenu) + { + CMenuPanel *pMenu = m_pCurrentMenu; + while (pMenu != NULL) + { + if (pMenu->GetMenuID() == iMenu) + return; + pMenu = pMenu->GetNextMenu(); + } + } + + switch ( iMenu ) + { + case MENU_TEAM: + pNewMenu = ShowTeamMenu(); + break; + + // Map Briefing removed now that it appears in the team menu + case MENU_MAPBRIEFING: + pNewMenu = CreateTextWindow( SHOW_MAPBRIEFING ); + break; + + case MENU_INTRO: + pNewMenu = CreateTextWindow( SHOW_MOTD ); + break; + + case MENU_CLASSHELP: + pNewMenu = CreateTextWindow( SHOW_CLASSDESC ); + break; + + case MENU_SPECHELP: + pNewMenu = CreateTextWindow( SHOW_SPECHELP ); + break; + case MENU_CLASS: + pNewMenu = ShowClassMenu(); + break; + + default: + break; + } + + if (!pNewMenu) + return; + + // Close the Command Menu if it's open + HideCommandMenu(); + + pNewMenu->SetMenuID( iMenu ); + pNewMenu->SetActive( true ); + pNewMenu->setParent(this); + + // See if another menu is visible, and if so, cache this one for display once the other one's finished + if (m_pCurrentMenu) + { + if ( m_pCurrentMenu->GetMenuID() == MENU_CLASS && iMenu == MENU_TEAM ) + { + CMenuPanel *temp = m_pCurrentMenu; + m_pCurrentMenu->Close(); + m_pCurrentMenu = pNewMenu; + m_pCurrentMenu->SetNextMenu( temp ); + m_pCurrentMenu->Open(); + UpdateCursorState(); + } + else + { + m_pCurrentMenu->SetNextMenu( pNewMenu ); + } + } + else + { + m_pCurrentMenu = pNewMenu; + m_pCurrentMenu->Open(); + UpdateCursorState(); + } +} + +// Removes all VGUI Menu's onscreen +void TeamFortressViewport::HideVGUIMenu() +{ + while (m_pCurrentMenu) + { + HideTopMenu(); + } + gHUD.SetUsingVGUI(false); +} + +// Remove the top VGUI menu, and bring up the next one +void TeamFortressViewport::HideTopMenu() +{ + if (m_pCurrentMenu) + { + // Close the top one + m_pCurrentMenu->Close(); + + // Bring up the next one + gViewPort->SetCurrentMenu( m_pCurrentMenu->GetNextMenu() ); + } + + UpdateCursorState(); +} + +// Return TRUE if the HUD's allowed to print text messages +bool TeamFortressViewport::AllowedToPrintText( void ) +{ + // Prevent text messages when fullscreen menus are up + if ( m_pCurrentMenu && g_iPlayerClass == 0 ) + { + int iId = m_pCurrentMenu->GetMenuID(); + if ( iId == MENU_TEAM || iId == MENU_CLASS || iId == MENU_INTRO || iId == MENU_CLASSHELP ) + return FALSE; + } + + return TRUE; +} + +//====================================================================================== +// TEAM MENU +//====================================================================================== +// Bring up the Team selection Menu +CMenuPanel* TeamFortressViewport::ShowTeamMenu() +{ + // Don't open menus in demo playback + if ( gEngfuncs.pDemoAPI->IsPlayingback() ) + return NULL; + + m_pTeamMenu->Reset(); + return m_pTeamMenu; +} + +void TeamFortressViewport::CreateTeamMenu() +{ + // Create the panel + m_pTeamMenu = new CTeamMenuPanel(100, false, 0, 0, ScreenWidth(), ScreenHeight()); + m_pTeamMenu->setParent( this ); + m_pTeamMenu->setVisible( false ); +} + +//====================================================================================== +// CLASS MENU +//====================================================================================== +// Bring up the Class selection Menu +CMenuPanel* TeamFortressViewport::ShowClassMenu() +{ + // Don't open menus in demo playback + if ( gEngfuncs.pDemoAPI->IsPlayingback() ) + return NULL; + + m_pClassMenu->Reset(); + return m_pClassMenu; +} + +void TeamFortressViewport::CreateClassMenu() +{ + // Create the panel + m_pClassMenu = new CClassMenuPanel(100, false, 0, 0, ScreenWidth(), ScreenHeight()); + m_pClassMenu->setParent(this); + m_pClassMenu->setVisible( false ); +} + +//====================================================================================== +//====================================================================================== +// SPECTATOR MENU +//====================================================================================== +// Spectator "Menu" explaining the Spectator buttons +void TeamFortressViewport::CreateSpectatorMenu() +{ + // Create the Panel + m_pSpectatorPanel = new SpectatorPanel(0, 0, ScreenWidth(), ScreenHeight()); + m_pSpectatorPanel->setParent(this); + m_pSpectatorPanel->setVisible(false); + m_pSpectatorPanel->Initialize(); +} + +//====================================================================================== +// UPDATE HUD SECTIONS +//====================================================================================== +// We've got an update on player info +// Recalculate any menus that use it. +void TeamFortressViewport::UpdateOnPlayerInfo() +{ + if (m_pTeamMenu) + m_pTeamMenu->Update(); + if (m_pClassMenu) + m_pClassMenu->Update(); + if (m_pScoreBoard) + m_pScoreBoard->Update(); +} + +void TeamFortressViewport::UpdateCursorState() +{ + + if (gHUD.GetInTopDownMode() || m_pSpectatorPanel->isVisible() || GetClientVoiceMgr()->IsInSquelchMode()) + { + gHUD.GetManager().SetMouseVisibility(true); + } + else + { + + // Don't reset mouse in demo playback + if ( !gEngfuncs.pDemoAPI->IsPlayingback() ) + { + IN_ResetMouse(); + } + + gHUD.GetManager().SetMouseVisibility(false); + + } + + /* + if(!gHUD.GetInTopDownMode()) + { + // Need cursor if any VGUI window is up + if ( m_pSpectatorPanel->m_menuVisible || m_pCurrentMenu || m_pTeamMenu->isVisible() || m_pServerBrowser->isVisible() || GetClientVoiceMgr()->IsInSquelchMode() ) + { + gHUD.GetManager().SetMouseVisibility(true); + //g_iVisibleMouse = true; + //App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::SchemeCursor::scu_arrow) ); + return; + } + else if ( m_pCurrentCommandMenu ) + { + // commandmenu doesn't have cursor if hud_capturemouse is turned off + if ( gHUD.m_pCvarStealMouse->value != 0.0f ) + { + gHUD.GetManager().SetMouseVisibility(true); + //g_iVisibleMouse = true; + //App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::SchemeCursor::scu_arrow) ); + return; + } + } + + // Don't reset mouse in demo playback + if ( !gEngfuncs.pDemoAPI->IsPlayingback() ) + { + IN_ResetMouse(); + } + + gHUD.GetManager().SetMouseVisibility(false); + //g_iVisibleMouse = false; + //App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::SchemeCursor::scu_none) ); + } + */ + +} + +void TeamFortressViewport::UpdateHighlights() +{ + if (m_pCurrentCommandMenu) + m_pCurrentCommandMenu->MakeVisible( NULL ); +} + +void TeamFortressViewport::GetAllPlayersInfo( void ) +{ + for ( int i = 1; i <= MAX_PLAYERS; i++ ) + { + GetPlayerInfo( i, &g_PlayerInfoList[i] ); + + if ( g_PlayerInfoList[i].thisplayer ) + m_pScoreBoard->m_iPlayerNum = i; // !!!HACK: this should be initialized elsewhere... maybe gotten from the engine + } +} + +void TeamFortressViewport::paintBackground() +{ + if (m_pScoreBoard) + { + int x, y; + getApp()->getCursorPos(x, y); + m_pScoreBoard->cursorMoved(x, y, m_pScoreBoard); + } + + // See if the command menu is visible and needs recalculating due to some external change + if ( g_iTeamNumber != m_iCurrentTeamNumber ) + { + UpdateCommandMenu( m_StandardMenu ); + + if ( m_pClassMenu ) + { + m_pClassMenu->Update(); + } + + m_iCurrentTeamNumber = g_iTeamNumber; + } + + if ( g_iPlayerClass != m_iCurrentPlayerClass ) + { + UpdateCommandMenu( m_StandardMenu ); + + m_iCurrentPlayerClass = g_iPlayerClass; + } + + // See if the Spectator Menu needs to be update + if ( ( g_iUser1 != m_iUser1 || g_iUser2 != m_iUser2 ) || + ( m_flSpectatorPanelLastUpdated < gHUD.m_flTime ) ) + { + UpdateSpectatorPanel(); + } + + // Update the Scoreboard, if it's visible + if ( m_pScoreBoard->isVisible() && (m_flScoreBoardLastUpdated < gHUD.m_flTime) ) + { + m_pScoreBoard->Update(); + m_flScoreBoardLastUpdated = gHUD.m_flTime + 0.5; + } + + int extents[4]; + getAbsExtents(extents[0],extents[1],extents[2],extents[3]); + VGui_ViewportPaintBackground(extents); +} + +//================================================================ +// Input Handler for Drag N Drop panels +void CDragNDropHandler::cursorMoved(int x,int y,Panel* panel) +{ + if(m_bDragging) + { + App::getInstance()->getCursorPos(x,y); + m_pPanel->setPos(m_iaDragOrgPos[0]+(x-m_iaDragStart[0]),m_iaDragOrgPos[1]+(y-m_iaDragStart[1])); + + if(m_pPanel->getParent()!=null) + { + m_pPanel->getParent()->repaint(); + } + } +} + +void CDragNDropHandler::mousePressed(MouseCode code,Panel* panel) +{ + int x,y; + App::getInstance()->getCursorPos(x,y); + m_bDragging=true; + m_iaDragStart[0]=x; + m_iaDragStart[1]=y; + m_pPanel->getPos(m_iaDragOrgPos[0],m_iaDragOrgPos[1]); + App::getInstance()->setMouseCapture(panel); + + m_pPanel->setDragged(m_bDragging); + m_pPanel->requestFocus(); +} + +void CDragNDropHandler::mouseReleased(MouseCode code,Panel* panel) +{ + m_bDragging=false; + m_pPanel->setDragged(m_bDragging); + App::getInstance()->setMouseCapture(null); +} + +//================================================================ +// Number Key Input +bool TeamFortressViewport::SlotInput( int iSlot ) +{ + // If there's a menu up, give it the input + if ( m_pCurrentMenu ) + return m_pCurrentMenu->SlotInput( iSlot ); + + if(gHUD.SlotInput(iSlot)) + { + return TRUE; + } + + return FALSE; +} + +// Direct Key Input +int TeamFortressViewport::KeyInput( int down, int keynum, const char *pszCurrentBinding ) +{ + + if (m_chatPanel->isVisible()) + { + // Don't let the game handle the input while the user is typing in the + // chat window. + return 0; + } + + if (down && pszCurrentBinding && !strcmp(pszCurrentBinding, kcGlobalChat)) + { + m_chatPanel->setVisible(true); + m_chatPanel->requestFocus(); + m_chatPanel->SetChatMode("say"); + return 0; + } + else if (down && pszCurrentBinding && !strcmp(pszCurrentBinding, kcTeamChat)) + { + m_chatPanel->setVisible(true); + m_chatPanel->requestFocus(); + m_chatPanel->SetChatMode("say_team"); + return 0; + } + + + // Enter gets out of Spectator Mode by bringing up the Team Menu +// if (m_iUser1 && gEngfuncs.Con_IsVisible() == false ) +// { +// //if ( down && (keynum == K_ENTER || keynum == K_KP_ENTER) ) +// if ( down && keynum == K_F1 ) +// { +// //ShowVGUIMenu( MENU_TEAM ); +// gEngfuncs.pfnClientCmd(kcReadyRoom); +// } +// } + + // Open Text Window? + if (m_pCurrentMenu && gEngfuncs.Con_IsVisible() == false) + { + int iMenuID = m_pCurrentMenu->GetMenuID(); + + // Get number keys as Input for Team/Class menus + if (iMenuID == MENU_TEAM || iMenuID == MENU_CLASS) + { + // Escape gets you out of Team/Class menus if the Cancel button is visible + if ( keynum == K_ESCAPE ) + { + if ( (iMenuID == MENU_TEAM && g_iTeamNumber) || (iMenuID == MENU_CLASS && g_iPlayerClass) ) + { + HideTopMenu(); + return 0; + } + } + + for (int i = '0'; i <= '9'; i++) + { + if ( down && (keynum == i) ) + { + SlotInput( i - '0' ); + return 0; + } + } + } + + // Grab enter keys to close TextWindows + if ( down && (keynum == K_ENTER || keynum == K_KP_ENTER || keynum == K_SPACE || keynum == K_ESCAPE) ) + { + if ( iMenuID == MENU_MAPBRIEFING || iMenuID == MENU_INTRO || iMenuID == MENU_CLASSHELP ) + { + HideTopMenu(); + return 0; + } + } + + // Grab jump key on Team Menu as autoassign + if ( pszCurrentBinding && down && !strcmp(pszCurrentBinding, "+jump") ) + { + if (iMenuID == MENU_TEAM) + { + m_pTeamMenu->SlotInput(5); + return 0; + } + } + + } + + // if we're in a command menu, try hit one of it's buttons + if ( down && m_pCurrentCommandMenu ) + { + // Escape hides the command menu + if ( keynum == K_ESCAPE ) + { + HideCommandMenu(); + return 0; + } + + // only trap the number keys + if ( keynum >= '0' && keynum <= '9' ) + { + if ( m_pCurrentCommandMenu->KeyInput(keynum) ) + { + // a final command has been issued, so close the command menu + HideCommandMenu(); + } + + return 0; + } + } + + return 1; +} + +ChatPanel* TeamFortressViewport::GetChatPanel() +{ + return m_chatPanel; +} + +//================================================================ +// Message Handlers +int TeamFortressViewport::MsgFunc_ValClass(const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + for (int i = 0; i < 5; i++) + m_iValidClasses[i] = READ_SHORT(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_TeamNames(const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iNumberOfTeams = READ_BYTE(); + + for (int i = 0; i < m_iNumberOfTeams; i++) + { + //int teamNum = i + 1; + int teamNum = i; + + // Build team title + gHUD.m_TextMessage.LocaliseTextString( READ_STRING(), m_sTeamNames[teamNum], MAX_TEAMNAME_SIZE ); + + // Don't append "Team: 0" or "Team: Spectators", only for higher teams + if((i >= 1) && (i < m_iNumberOfTeams-1)) + { + char theTeamTranslation[128]; + strcpy(theTeamTranslation, gHUD.m_TextMessage.LookupString(kTeamTitle)); + + char theFullTeamName[256]; + sprintf(theFullTeamName, "%s %d: %s", theTeamTranslation, i, m_sTeamNames[teamNum]); + + strcpy(m_sTeamNames[teamNum], theFullTeamName); + } + + // Set the team name buttons + if (m_pTeamButtons[i]) + m_pTeamButtons[i]->setText( m_sTeamNames[teamNum] ); + + // range check this value...m_pDisguiseButtons[5]; + if ( teamNum < 5 ) + { + // Set the disguise buttons + if ( m_pDisguiseButtons[teamNum] ) + m_pDisguiseButtons[teamNum]->setText( m_sTeamNames[teamNum] ); + } + } + + // Update the Team Menu + if (m_pTeamMenu) + m_pTeamMenu->Update(); + + return 1; +} + +int TeamFortressViewport::MsgFunc_Feign(const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iIsFeigning = READ_BYTE(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_Detpack(const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iIsSettingDetpack = READ_BYTE(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_VGUIMenu(const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + int iMenu = READ_BYTE(); + + // Map briefing includes the name of the map (because it's sent down before the client knows what map it is) + if (iMenu == MENU_MAPBRIEFING) + { + strncpy( m_sMapName, READ_STRING(), sizeof(m_sMapName) ); + m_sMapName[ sizeof(m_sMapName) - 1 ] = '\0'; + } + + // Bring up the menu6 + ShowVGUIMenu( iMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ) +{ + if (m_iGotAllMOTD) + m_szMOTD[0] = 0; + + BEGIN_READ( pbuf, iSize ); + + m_iGotAllMOTD = READ_BYTE(); + + int roomInArray = sizeof(m_szMOTD) - strlen(m_szMOTD) - 1; + + strncat( m_szMOTD, READ_STRING(), roomInArray >= 0 ? roomInArray : 0 ); + m_szMOTD[ sizeof(m_szMOTD)-1 ] = '\0'; + + // don't show MOTD for HLTV spectators + if ( m_iGotAllMOTD && !gEngfuncs.IsSpectateOnly() ) + { + //ShowVGUIMenu( MENU_INTRO ); + //gHUD.GetManager().SetMouseVisibility(true); + //ShowOptionsMenu(); +// gHUD.AddTooltip(m_szMOTD, false, kMOTDToolTipMaxWidth); + } + + return 1; +} + +int TeamFortressViewport::MsgFunc_BuildSt( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iBuildState = READ_BYTE(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_RandomPC( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iRandomPC = READ_BYTE(); + + return 1; +} + +int TeamFortressViewport::MsgFunc_ServerName( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + memset(this->m_szServerName, 0, MAX_SERVERNAME_LENGTH); + + strncpy( m_szServerName, READ_STRING(), MAX_SERVERNAME_LENGTH ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + short cl = READ_BYTE(); + short score = READ_SHORT(); + short frags = READ_SHORT(); + short deaths = READ_SHORT(); + short playerclass = READ_BYTE(); + short auth = READ_SHORT(); + bool is_upp = (auth & PLAYERAUTH_UPP_MODE); + short teamnumber = READ_SHORT(); + short color = 0; + + if(is_upp) + { + color = READ_BYTE(); + } + else if(auth & PLAYERAUTH_CUSTOM) + { + //clear the string (I dont think this array is reset anywhere else (since everything is set when the score info message is sent anyways) + //so just memset it here to prevent any possible problems. + memset(&g_PlayerExtraInfo[cl].customicon, 0, sizeof(g_PlayerExtraInfo[cl].customicon)); + + // Read custom icon + char* theString = READ_STRING(); + + if(theString && strlen(theString) >= 4 && strlen(theString) <= CUSTOM_ICON_LENGTH+2)//make sure the string is within the right size. + strncpy(g_PlayerExtraInfo[cl].customicon, theString, sizeof(g_PlayerExtraInfo[cl].customicon)-1); + } + + if ( cl > 0 && cl <= MAX_PLAYERS ) + { + // Update score, but show + or - indicator on scoreboard when it changes + g_PlayerExtraInfo[cl].lastScore = g_PlayerExtraInfo[cl].score; + g_PlayerExtraInfo[cl].score = score; + if(g_PlayerExtraInfo[cl].score != g_PlayerExtraInfo[cl].lastScore) + { + g_PlayerExtraInfo[cl].timeOfLastScoreChange = gHUD.GetTimeOfLastUpdate(); + } + + // Update other info + g_PlayerExtraInfo[cl].frags = frags; + g_PlayerExtraInfo[cl].deaths = deaths; + g_PlayerExtraInfo[cl].playerclass = playerclass; + g_PlayerExtraInfo[cl].teamnumber = teamnumber; + g_PlayerExtraInfo[cl].auth = auth; + g_PlayerExtraInfo[cl].color = color; + + // Don't go below 0! + if ( g_PlayerExtraInfo[cl].teamnumber < 0 ) + g_PlayerExtraInfo[cl].teamnumber = 0; + + UpdateOnPlayerInfo(); + } + + return 1; +} + +// Message handler for TeamScore message +// accepts three values: +// string: team name +// short: teams kills +// short: teams deaths +// if this message is never received, then scores will simply be the combined totals of the players. +int TeamFortressViewport::MsgFunc_TeamScore( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + char *TeamName = READ_STRING(); + + // find the team matching the name + for ( int i = 1; i <= m_pScoreBoard->m_iNumTeams; i++ ) + { + if ( !stricmp( TeamName, g_TeamInfo[i].name ) ) + break; + } + + if ( i > m_pScoreBoard->m_iNumTeams ) + return 1; + + // use this new score data instead of combined player scoresw + g_TeamInfo[i].scores_overriden = TRUE; + g_TeamInfo[i].frags = READ_SHORT(); + g_TeamInfo[i].deaths = READ_SHORT(); + + return 1; +} + +// Message handler for TeamInfo message +// accepts two values: +// byte: client number +// string: client team name +int TeamFortressViewport::MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf ) +{ + if (!m_pScoreBoard) + return 1; + + BEGIN_READ( pbuf, iSize ); + short cl = READ_BYTE(); + + if ( cl > 0 && cl <= MAX_PLAYERS ) + { + // set the players team + strncpy( g_PlayerExtraInfo[cl].teamname, READ_STRING(), MAX_TEAM_NAME ); + } + + // rebuild the list of teams + m_pScoreBoard->RebuildTeams(); + + return 1; +} + +void TeamFortressViewport::DeathMsg( int killer, int victim ) +{ + m_pScoreBoard->DeathMsg(killer,victim); +} + +int TeamFortressViewport::MsgFunc_Spectator( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + short cl = READ_BYTE(); + if ( cl > 0 && cl <= MAX_PLAYERS ) + { + g_IsSpectator[cl] = READ_BYTE(); + } + + return 1; +} + +int TeamFortressViewport::MsgFunc_AllowSpec( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iAllowSpectators = READ_BYTE(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + // If the team menu is up, update it too + if (m_pTeamMenu) + m_pTeamMenu->Update(); + + return 1; +} + diff --git a/main/source/cl_dll/vgui_TeamFortressViewport.h b/main/source/cl_dll/vgui_TeamFortressViewport.h new file mode 100644 index 00000000..54edbaff --- /dev/null +++ b/main/source/cl_dll/vgui_TeamFortressViewport.h @@ -0,0 +1,1825 @@ + +#ifndef TEAMFORTRESSVIEWPORT_H +#define TEAMFORTRESSVIEWPORT_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "cl_dll/CLabelHeader.h" +#include "build.h" +#include "game_shared/VGUI_Grid.h" + + +// custom scheme handling +#include "vgui_SchemeManager.h" + +#define TF_DEFS_ONLY +#include "tf_defs.h" + +using namespace vgui; + +class Cursor; +class ScorePanel; +class SpectatorPanel; +class CCommandMenu; +class CommandLabel; +class CommandButton; +class BuildButton; +class ClassButton; +class CMenuPanel; +class ServerBrowser; +class DragNDropPanel; +class CTransparentPanel; +class CClassMenuPanel; +class CTeamMenuPanel; +class ChatPanel; + +char* GetVGUITGAName(const char *pszName); +BitmapTGA *LoadTGAForRes(const char* pImageName); +void ScaleColors( int &r, int &g, int &b, int a ); +extern char *sTFClassSelection[]; +extern int sTFValidClassInts[]; +extern char *sLocalisedClasses[]; + +#define MAX_SERVERNAME_LENGTH 32 +#define MAX_MAPNAME_LENGTH 32 + +// Command Menu positions +#define MAX_MENUS 80 +#define MAX_BUTTONS 100 + +#define BUTTON_SIZE_Y YRES(30) +#define CMENU_SIZE_X XRES(160) + +#define SUBMENU_SIZE_X (CMENU_SIZE_X / 8) +#define SUBMENU_SIZE_Y (BUTTON_SIZE_Y / 6) + +#define CMENU_TOP (BUTTON_SIZE_Y * 4) + +#define MAX_TEAMNAME_SIZE 64 +#define MAX_BUTTON_SIZE 32 + +// Map Briefing Window +#define MAPBRIEF_INDENT 30 + +// Team Menu +#define TMENU_INDENT_X (30 * ((float)ScreenHeight / 640)) +#define TMENU_HEADER 100 +#define TMENU_SIZE_X (ScreenWidth - (TMENU_INDENT_X * 2)) +#define TMENU_SIZE_Y (TMENU_HEADER + BUTTON_SIZE_Y * 7) +#define TMENU_PLAYER_INDENT (((float)TMENU_SIZE_X / 3) * 2) +#define TMENU_INDENT_Y (((float)ScreenHeight - TMENU_SIZE_Y) / 2) + +// Class Menu +#define CLMENU_INDENT_X (30 * ((float)ScreenHeight / 640)) +#define CLMENU_HEADER 100 +#define CLMENU_SIZE_X (ScreenWidth - (CLMENU_INDENT_X * 2)) +#define CLMENU_SIZE_Y (CLMENU_HEADER + BUTTON_SIZE_Y * 11) +#define CLMENU_PLAYER_INDENT (((float)CLMENU_SIZE_X / 3) * 2) +#define CLMENU_INDENT_Y (((float)ScreenHeight - CLMENU_SIZE_Y) / 2) + +// Arrows +enum +{ + ARROW_UP, + ARROW_DOWN, + ARROW_LEFT, + ARROW_RIGHT, +}; + +//============================================================================== +// VIEWPORT PIECES +//============================================================ +// Wrapper for an Image Label without a background +class CImageLabel : public Label +{ +public: + BitmapTGA *m_pTGA; + +public: + void LoadImage(const char * pImageName); + CImageLabel( const char* pImageName,int x,int y ); + CImageLabel( const char* pImageName,int x,int y,int wide,int tall ); + + virtual int getImageTall(); + virtual int getImageWide(); + + virtual void paintBackground() + { + // Do nothing, so the background's left transparent. + } +}; + +// Command Label +// Overridden label so we can darken it when submenus open +class CommandLabel : public Label +{ +private: + int m_iState; + +public: + CommandLabel(const char* text,int x,int y,int wide,int tall) : Label(text,x,y,wide,tall) + { + m_iState = false; + } + + void PushUp() + { + m_iState = false; + repaint(); + } + + void PushDown() + { + m_iState = true; + repaint(); + } +}; + +//============================================================ +// Command Buttons +class CommandButton : public Button +{ +private: + int m_iPlayerClass; + bool m_bFlat; + + // Submenus under this button + CCommandMenu *m_pSubMenu; + CCommandMenu *m_pParentMenu; + CommandLabel *m_pSubLabel; + + char m_sMainText[MAX_BUTTON_SIZE]; + char m_cBoundKey; + + SchemeHandle_t m_hTextScheme; + + void RecalculateText( void ); + +public: + bool m_bNoHighlight; + +public: + CommandButton(const char* text,int x,int y,int wide,int tall, bool bNoHighlight, bool bFlat); + // Constructors + CommandButton( const char* text,int x,int y,int wide,int tall, bool bNoHighlight = false); + CommandButton( int iPlayerClass, const char* text,int x,int y,int wide,int tall, bool bFlat ); + + void Init( void ); + + // Menu Handling + void AddSubMenu( CCommandMenu *pNewMenu ); + void AddSubLabel( CommandLabel *pSubLabel ) + { + m_pSubLabel = pSubLabel; + } + + virtual int IsNotValid( void ) + { + return false; + } + + void UpdateSubMenus( int iAdjustment ); + int GetPlayerClass() { return m_iPlayerClass; }; + CCommandMenu *GetSubMenu() { return m_pSubMenu; }; + + CCommandMenu *getParentMenu( void ); + void setParentMenu( CCommandMenu *pParentMenu ); + + // Overloaded vgui functions + virtual void paint(); + virtual void setText( const char *text ); + virtual void paintBackground(); + + void cursorEntered( void ); + void cursorExited( void ); + + void setBoundKey( char boundKey ); + char getBoundKey( void ); +}; + +class ColorButton : public CommandButton +{ +private: + + Color *ArmedColor; + Color *UnArmedColor; + + Color *ArmedBorderColor; + Color *UnArmedBorderColor; + +public: + ColorButton( const char* text,int x,int y,int wide,int tall, bool bNoHighlight, bool bFlat ) : + CommandButton( text, x, y, wide, tall, bNoHighlight, bFlat ) + { + ArmedColor = NULL; + UnArmedColor = NULL; + ArmedBorderColor = NULL; + UnArmedBorderColor = NULL; + } + + + virtual void paintBackground() + { + int r, g, b, a; + Color bgcolor; + + if ( isArmed() ) + { + // Highlight background + /* getBgColor(bgcolor); + bgcolor.getColor(r, g, b, a); + drawSetColor( r,g,b,a ); + drawFilledRect(0,0,_size[0],_size[1]);*/ + + if ( ArmedBorderColor ) + { + ArmedBorderColor->getColor( r, g, b, a); + drawSetColor( r, g, b, a ); + drawOutlinedRect(0,0,_size[0],_size[1]); + } + } + else + { + if ( UnArmedBorderColor ) + { + UnArmedBorderColor->getColor( r, g, b, a); + drawSetColor( r, g, b, a ); + drawOutlinedRect(0,0,_size[0],_size[1]); + } + } + } + void paint() + { + int r, g, b, a; + if ( isArmed() ) + { + if (ArmedColor) + { + ArmedColor->getColor(r, g, b, a); + setFgColor(r, g, b, a); + } + else + setFgColor( Scheme::sc_secondary2 ); + } + else + { + if (UnArmedColor) + { + UnArmedColor->getColor(r, g, b, a); + setFgColor(r, g, b, a); + } + else + setFgColor( Scheme::sc_primary1 ); + } + + Button::paint(); + } + + void setArmedColor ( int r, int g, int b, int a ) + { + ArmedColor = new Color( r, g, b, a ); + } + + void setUnArmedColor ( int r, int g, int b, int a ) + { + UnArmedColor = new Color( r, g, b, a ); + } + + void setArmedBorderColor ( int r, int g, int b, int a ) + { + ArmedBorderColor = new Color( r, g, b, a ); + } + + void setUnArmedBorderColor ( int r, int g, int b, int a ) + { + UnArmedBorderColor = new Color( r, g, b, a ); + } +}; + +class SpectButton : public CommandButton +{ +private: + +public: + SpectButton( int iPlayerClass, const char* text,int x,int y,int wide,int tall ) : + CommandButton( text, x, y, wide, tall, false) + { + Init(); + + setText( text ); + } + + virtual void paintBackground() + { + if ( isArmed()) + { + drawSetColor( 143,143, 54, 125 ); + drawFilledRect( 5, 0,_size[0] - 5,_size[1]); + } + } + + virtual void paint() + { + + if ( isArmed() ) + { + setFgColor( 194, 202, 54, 0 ); + } + else + { + setFgColor( 143, 143, 54, 15 ); + } + + Button::paint(); + } +}; +//============================================================ +// Command Menus +class CCommandMenu : public Panel +{ +private: + CCommandMenu *m_pParentMenu; + int m_iXOffset; + int m_iYOffset; + + // Buttons in this menu + CommandButton *m_aButtons[ MAX_BUTTONS ]; + int m_iButtons; + + // opens menu from top to bottom (0 = default), or from bottom to top (1)? + int m_iDirection; +public: + CCommandMenu( CCommandMenu *pParentMenu, int x,int y,int wide,int tall ) : Panel(x,y,wide,tall) + { + m_pParentMenu = pParentMenu; + m_iXOffset = x; + m_iYOffset = y; + m_iButtons = 0; + m_iDirection = 0; + } + + CCommandMenu( CCommandMenu *pParentMenu, int direction, int x,int y,int wide,int tall ) : Panel(x,y,wide,tall) + { + m_pParentMenu = pParentMenu; + m_iXOffset = x; + m_iYOffset = y; + m_iButtons = 0; + m_iDirection = direction; + } + + float m_flButtonSizeY; + int m_iSpectCmdMenu; + void AddButton( CommandButton *pButton ); + bool RecalculateVisibles( int iNewYPos, bool bHideAll ); + void RecalculatePositions( int iYOffset ); + void MakeVisible( CCommandMenu *pChildMenu ); + + CCommandMenu *GetParentMenu() { return m_pParentMenu; }; + int GetXOffset() { return m_iXOffset; }; + int GetYOffset() { return m_iYOffset; }; + int GetDirection() { return m_iDirection; }; + int GetNumButtons() { return m_iButtons; }; + CommandButton *FindButtonWithSubmenu( CCommandMenu *pSubMenu ); + + void ClearButtonsOfArmedState( void ); + void RemoveAllButtons(); + + bool KeyInput( int keyNum ); + + virtual void paintBackground(); +}; + +#ifdef AVH_PLAYTEST_BUILD +class OptionsScreenInputSignal : public InputSignal +{ +public: + virtual void cursorMoved(int x,int y,Panel* panel); + virtual void cursorEntered(Panel* panel); + virtual void cursorExited(Panel* panel); + virtual void mousePressed(MouseCode code,Panel* panel); + virtual void mouseDoublePressed(MouseCode code,Panel* panel); + virtual void mouseReleased(MouseCode code,Panel* panel); + virtual void mouseWheeled(int delta,Panel* panel); + virtual void keyPressed(KeyCode code,Panel* panel); + virtual void keyTyped(KeyCode code,Panel* panel); + virtual void keyReleased(KeyCode code,Panel* panel); + virtual void keyFocusTicked(Panel* panel); + +private: + void SelectLabel(Panel* inPanel); +}; +#endif + +class SmartLabel : public vgui::Label +{ +public: + virtual void setText(int inTextBufferLen, const char* inText) + { + Label::setText(inTextBufferLen, inText); + this->mString = string(inText); + } + + virtual string getText() const + { + return this->mString; + } + +private: + string mString; +}; + +//============================================================================== +class TeamFortressViewport : public Panel +{ +private: + vgui::Cursor* _cursorNone; + vgui::Cursor* _cursorArrow; + + int m_iInitialized; + + CCommandMenu *m_pCommandMenus[ MAX_MENUS ]; + CCommandMenu *m_pCurrentCommandMenu; + float m_flMenuOpenTime; + float m_flScoreBoardLastUpdated; + float m_flSpectatorPanelLastUpdated; + int m_iNumMenus; + int m_iCurrentTeamNumber; + int m_iCurrentPlayerClass; + int m_iUser1; + int m_iUser2; + int m_iUser3; + + // VGUI Menus + void CreateTeamMenu( void ); + CMenuPanel* ShowTeamMenu( void ); + void CreateClassMenu( void ); + CMenuPanel* ShowClassMenu( void ); + void CreateSpectatorMenu( void ); + + // Scheme handler + CSchemeManager m_SchemeManager; + + // MOTD + int m_iGotAllMOTD; + char m_szMOTD[ MAX_MOTD_LENGTH ]; + + // Command Menu Team buttons + CommandButton *m_pTeamButtons[6]; + CommandButton *m_pDisguiseButtons[5]; + BuildButton *m_pBuildButtons[3]; + BuildButton *m_pBuildActiveButtons[3]; + + // Server Browser + ServerBrowser *m_pServerBrowser; + + // Spectator "menu" + CTransparentPanel *m_pSpectatorMenu; + Label *m_pSpectatorLabel; + Label *m_pSpectatorHelpLabel; + int m_iAllowSpectators; + + ChatPanel* m_chatPanel; + + // Data for specific sections of the Command Menu + int m_iValidClasses[5]; + int m_iIsFeigning; + int m_iIsSettingDetpack; + int m_iNumberOfTeams; + int m_iBuildState; + int m_iRandomPC; + char m_sTeamNames[5][MAX_TEAMNAME_SIZE]; + + // Localisation strings + char m_sDetpackStrings[3][MAX_BUTTON_SIZE]; + + char m_sMapName[MAX_MAPNAME_LENGTH]; +public: + TeamFortressViewport(int x,int y,int wide,int tall); + void Initialize( void ); + + int CreateCommandMenu( char * menuFile, int direction, int yOffset, bool flatDesign, float flButtonSizeX, float flButtonSizeY, int xOffset ); + void CreateScoreBoard( void ); + void CreateOptionsMenu(); + + void CreatePlayerMenu(); + void UpdatePlayerMenu(); + + void CreateServerBrowser( void ); + CommandButton * CreateCustomButton( char *pButtonText, char * pButtonName, int iYOffset ); + CCommandMenu * CreateDisguiseSubmenu( CommandButton *pButton, CCommandMenu *pParentMenu, const char *commandText, int iYOffset, int iXOffset = 0 ); + + void UpdateCursorState( void ); + void UpdateCommandMenu(int menuIndex); + void UpdateOnPlayerInfo( void ); + void UpdateHighlights( void ); + void UpdateSpectatorPanel( void ); + + int KeyInput( int down, int keynum, const char *pszCurrentBinding ); + void InputPlayerSpecial( void ); + void GetAllPlayersInfo( void ); + void DeathMsg( int killer, int victim ); + + ChatPanel* GetChatPanel(); + + void ShowCommandMenu(int menuIndex); + void InputSignalHideCommandMenu( void ); + void HideCommandMenu( void ); + void SetCurrentCommandMenu( CCommandMenu *pNewMenu ); + void SetCurrentMenu( CMenuPanel *pMenu ); + + void ShowScoreBoard( void ); + void HideScoreBoard( void ); + bool IsScoreBoardVisible( void ); + + void ShowOptionsMenu(); + void HideOptionsMenu(); + bool IsOptionsMenuVisible(); + + bool AllowedToPrintText( void ); + + void ShowVGUIMenu( int iMenu ); + void HideVGUIMenu( void ); + void HideTopMenu( void ); + + void ToggleServerBrowser( void ); + + CMenuPanel* CreateTextWindow( int iTextToShow ); + + CCommandMenu *CreateSubMenu( CommandButton *pButton, CCommandMenu *pParentMenu, int iYOffset, int iXOffset = 0 ); + + // Data Handlers + int GetValidClasses(int iTeam) { return m_iValidClasses[iTeam]; }; + int GetNumberOfTeams() { return m_iNumberOfTeams; }; + int GetIsFeigning() { return m_iIsFeigning; }; + int GetIsSettingDetpack() { return m_iIsSettingDetpack; }; + int GetBuildState() { return m_iBuildState; }; + int IsRandomPC() { return m_iRandomPC; }; + char *GetTeamName( int iTeam ); + int GetAllowSpectators() { return m_iAllowSpectators; }; + + // Message Handlers + int MsgFunc_ValClass(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamNames(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_Feign(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_Detpack(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_VGUIMenu(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_BuildSt( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_RandomPC( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_ServerName( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamScore( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_Spectator( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_AllowSpec( const char *pszName, int iSize, void *pbuf ); + + // Input + bool SlotInput( int iSlot ); + + virtual void paintBackground(); + + CSchemeManager *GetSchemeManager( void ) { return &m_SchemeManager; } + ScorePanel *GetScoreBoard( void ) { return m_pScoreBoard; } + + void *operator new( size_t stAllocateBlock ); + +public: + // VGUI Menus + CMenuPanel *m_pCurrentMenu; + CTeamMenuPanel *m_pTeamMenu; + int m_StandardMenu; // indexs in m_pCommandMenus + int m_SpectatorOptionsMenu; + int m_SpectatorCameraMenu; + int m_SpectatorPlayerMenu; + CClassMenuPanel *m_pClassMenu; + ScorePanel *m_pScoreBoard; + CTransparentPanel* mOptionsScreen; + CommandButton** mOptionsButtons; + + #ifdef AVH_PLAYTEST_BUILD + void AddAnalysisLine(const string& inAnalysisLine); + void AddBalanceVariable(const string& inVariableName); + + #define kMaxPlaytestVariables 2048 + + CListBox* mPlaytestVariables; + SmartLabel mPlaytestEntryLabels[kMaxPlaytestVariables]; + int mPlaytestVariableRow; + + CListBox* mPlaytestAnalysis; + SmartLabel mPlaytestAnalysisLabels[kMaxPlaytestVariables]; + int mPlaytestAnalysisRow; + bool mBalanceChanged; + void RecomputeAnalysis(); + + OptionsScreenInputSignal mPlaytestInputSignal; + SmartLabel mPlaytestVariableName; + TextEntry* mPlaytestVariableValue; + string mPlaytestVariableValueBeforeHide; + int mPlaytestVariableWidth; + int mPlaytestVariableHeight; + int mPlaytestAnalysisWidth; + int mPlaytestAnalysisHeight; + vgui::BitmapTGA* mNSLogoBitmap; + vgui::Label* mNSLogoLabel; + #endif + + SpectatorPanel *m_pSpectatorPanel; + char m_szServerName[ MAX_SERVERNAME_LENGTH ]; +}; + +//============================================================ +// Command Menu Button Handlers +#define MAX_COMMAND_SIZE 256 + +class CMenuHandler_StringCommand : public ActionSignal +{ +protected: + char m_pszCommand[MAX_COMMAND_SIZE]; + int m_iCloseVGUIMenu; +public: + CMenuHandler_StringCommand( char *pszCommand ) + { + strncpy( m_pszCommand, pszCommand, MAX_COMMAND_SIZE); + m_pszCommand[MAX_COMMAND_SIZE-1] = '\0'; + m_iCloseVGUIMenu = false; + } + + CMenuHandler_StringCommand( char *pszCommand, int iClose ) + { + strncpy( m_pszCommand, pszCommand, MAX_COMMAND_SIZE); + m_pszCommand[MAX_COMMAND_SIZE-1] = '\0'; + m_iCloseVGUIMenu = true; + } + + virtual void actionPerformed(Panel* panel) + { + gEngfuncs.pfnClientCmd(m_pszCommand); + + if (m_iCloseVGUIMenu) + gViewPort->HideTopMenu(); + else + gViewPort->HideCommandMenu(); + } +}; + +class COptionsScreen_StringCommand : public CMenuHandler_StringCommand +{ +public: + COptionsScreen_StringCommand( char *pszCommand ) : CMenuHandler_StringCommand(pszCommand) + { + } + + virtual void actionPerformed(Panel* panel) + { + CMenuHandler_StringCommand::actionPerformed(panel); + + gViewPort->HideOptionsMenu(); + } +}; + + + +// This works the same as CMenuHandler_StringCommand, except it watches the string command +// for specific commands, and modifies client vars based upon them. +class CMenuHandler_StringCommandWatch : public CMenuHandler_StringCommand +{ +private: +public: + CMenuHandler_StringCommandWatch( char *pszCommand ) : CMenuHandler_StringCommand( pszCommand ) + { + } + + CMenuHandler_StringCommandWatch( char *pszCommand, int iClose ) : CMenuHandler_StringCommand( pszCommand, iClose ) + { + } + + virtual void actionPerformed(Panel* panel) + { + CMenuHandler_StringCommand::actionPerformed( panel ); + + // Try to guess the player's new team (it'll be corrected if it's wrong) + if ( !strcmp( m_pszCommand, "jointeam 1" ) ) + g_iTeamNumber = 1; + else if ( !strcmp( m_pszCommand, "jointeam 2" ) ) + g_iTeamNumber = 2; + else if ( !strcmp( m_pszCommand, "jointeam 3" ) ) + g_iTeamNumber = 3; + else if ( !strcmp( m_pszCommand, "jointeam 4" ) ) + g_iTeamNumber = 4; + } +}; + +// Used instead of CMenuHandler_StringCommand for Class Selection buttons. +// Checks the state of hud_classautokill and kills the player if set +class CMenuHandler_StringCommandClassSelect : public CMenuHandler_StringCommand +{ +private: +public: + CMenuHandler_StringCommandClassSelect( char *pszCommand ) : CMenuHandler_StringCommand( pszCommand ) + { + } + + CMenuHandler_StringCommandClassSelect( char *pszCommand, int iClose ) : CMenuHandler_StringCommand( pszCommand, iClose ) + { + } + + virtual void actionPerformed(Panel* panel); +}; + +class CMenuHandler_PopupSubMenuInput : public InputSignal +{ +private: + CCommandMenu *m_pSubMenu; + Button *m_pButton; +public: + CMenuHandler_PopupSubMenuInput( Button *pButton, CCommandMenu *pSubMenu ) + { + m_pSubMenu = pSubMenu; + m_pButton = pButton; + } + + virtual void cursorMoved(int x,int y,Panel* panel) + { + //gViewPort->SetCurrentCommandMenu( m_pSubMenu ); + } + + virtual void cursorEntered(Panel* panel) + { + gViewPort->SetCurrentCommandMenu( m_pSubMenu ); + + if (m_pButton) + m_pButton->setArmed(true); + }; + virtual void cursorExited(Panel* Panel) {}; + virtual void mousePressed(MouseCode code,Panel* panel) {}; + virtual void mouseDoublePressed(MouseCode code,Panel* panel) {}; + virtual void mouseReleased(MouseCode code,Panel* panel) {}; + virtual void mouseWheeled(int delta,Panel* panel) {}; + virtual void keyPressed(KeyCode code,Panel* panel) {}; + virtual void keyTyped(KeyCode code,Panel* panel) {}; + virtual void keyReleased(KeyCode code,Panel* panel) {}; + virtual void keyFocusTicked(Panel* panel) {}; +}; + +class CMenuHandler_LabelInput : public InputSignal +{ +private: + ActionSignal *m_pActionSignal; +public: + CMenuHandler_LabelInput( ActionSignal *pSignal ) + { + m_pActionSignal = pSignal; + } + + virtual void mousePressed(MouseCode code,Panel* panel) + { + m_pActionSignal->actionPerformed( panel ); + } + + virtual void mouseReleased(MouseCode code,Panel* panel) {}; + virtual void cursorEntered(Panel* panel) {}; + virtual void cursorExited(Panel* Panel) {}; + virtual void cursorMoved(int x,int y,Panel* panel) {}; + virtual void mouseDoublePressed(MouseCode code,Panel* panel) {}; + virtual void mouseWheeled(int delta,Panel* panel) {}; + virtual void keyPressed(KeyCode code,Panel* panel) {}; + virtual void keyTyped(KeyCode code,Panel* panel) {}; + virtual void keyReleased(KeyCode code,Panel* panel) {}; + virtual void keyFocusTicked(Panel* panel) {}; +}; + +#define HIDE_TEXTWINDOW 0 +#define SHOW_MAPBRIEFING 1 +#define SHOW_CLASSDESC 2 +#define SHOW_MOTD 3 +#define SHOW_SPECHELP 4 + +class CMenuHandler_TextWindow : public ActionSignal +{ +private: + int m_iState; +public: + CMenuHandler_TextWindow( int iState ) + { + m_iState = iState; + } + + virtual void actionPerformed(Panel* panel) + { + if (m_iState == HIDE_TEXTWINDOW) + { + gViewPort->HideTopMenu(); + } + else + { + gViewPort->HideCommandMenu(); + gViewPort->ShowVGUIMenu( m_iState ); + } + } +}; + +class CMenuHandler_ToggleCvar : public ActionSignal +{ +private: + struct cvar_s * m_cvar; + +public: + CMenuHandler_ToggleCvar( char * cvarname ) + { + m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname ); + } + + virtual void actionPerformed(Panel* panel) + { + if ( m_cvar->value ) + m_cvar->value = 0.0f; + else + m_cvar->value = 1.0f; + + gViewPort->UpdateSpectatorPanel(); + } + + +}; +class CDragNDropHandler : public InputSignal +{ +private: + DragNDropPanel* m_pPanel; + bool m_bDragging; + int m_iaDragOrgPos[2]; + int m_iaDragStart[2]; + +public: + CDragNDropHandler(DragNDropPanel* pPanel) + { + m_pPanel = pPanel; + m_bDragging = false; + } + + void cursorMoved(int x,int y,Panel* panel); + void mousePressed(MouseCode code,Panel* panel); + void mouseReleased(MouseCode code,Panel* panel); + + void mouseDoublePressed(MouseCode code,Panel* panel) {}; + void cursorEntered(Panel* panel) {}; + void cursorExited(Panel* panel) {}; + void mouseWheeled(int delta,Panel* panel) {}; + void keyPressed(KeyCode code,Panel* panel) {}; + void keyTyped(KeyCode code,Panel* panel) {}; + void keyReleased(KeyCode code,Panel* panel) {}; + void keyFocusTicked(Panel* panel) {}; +}; + +class CHandler_MenuButtonOver : public InputSignal +{ +private: + int m_iButton; + CMenuPanel *m_pMenuPanel; +public: + CHandler_MenuButtonOver( CMenuPanel *pPanel, int iButton ) + { + m_iButton = iButton; + m_pMenuPanel = pPanel; + } + + void cursorEntered(Panel *panel); + + void cursorMoved(int x,int y,Panel* panel) {}; + void mousePressed(MouseCode code,Panel* panel) {}; + void mouseReleased(MouseCode code,Panel* panel) {}; + void mouseDoublePressed(MouseCode code,Panel* panel) {}; + void cursorExited(Panel* panel) {}; + void mouseWheeled(int delta,Panel* panel) {}; + void keyPressed(KeyCode code,Panel* panel) {}; + void keyTyped(KeyCode code,Panel* panel) {}; + void keyReleased(KeyCode code,Panel* panel) {}; + void keyFocusTicked(Panel* panel) {}; +}; + +class CHandler_ButtonHighlight : public InputSignal +{ +private: + Button *m_pButton; +public: + CHandler_ButtonHighlight( Button *pButton ) + { + m_pButton = pButton; + } + + virtual void cursorEntered(Panel* panel) + { + m_pButton->setArmed(true); + }; + virtual void cursorExited(Panel* Panel) + { + m_pButton->setArmed(false); + }; + virtual void mousePressed(MouseCode code,Panel* panel) {}; + virtual void mouseReleased(MouseCode code,Panel* panel) {}; + virtual void cursorMoved(int x,int y,Panel* panel) {}; + virtual void mouseDoublePressed(MouseCode code,Panel* panel) {}; + virtual void mouseWheeled(int delta,Panel* panel) {}; + virtual void keyPressed(KeyCode code,Panel* panel) {}; + virtual void keyTyped(KeyCode code,Panel* panel) {}; + virtual void keyReleased(KeyCode code,Panel* panel) {}; + virtual void keyFocusTicked(Panel* panel) {}; +}; + +//----------------------------------------------------------------------------- +// Purpose: Special handler for highlighting of command menu buttons +//----------------------------------------------------------------------------- +class CHandler_CommandButtonHighlight : public CHandler_ButtonHighlight +{ +private: + CommandButton *m_pCommandButton; +public: + CHandler_CommandButtonHighlight( CommandButton *pButton ) : CHandler_ButtonHighlight( pButton ) + { + m_pCommandButton = pButton; + } + + virtual void cursorEntered( Panel *panel ) + { + m_pCommandButton->cursorEntered(); + } + + virtual void cursorExited( Panel *panel ) + { + m_pCommandButton->cursorExited(); + } +}; + + +//================================================================ +// Overidden Command Buttons for special visibilities +class ClassButton : public CommandButton +{ +protected: + int m_iPlayerClass; + +public: + ClassButton( int iClass, const char* text,int x,int y,int wide,int tall, bool bNoHighlight ) : CommandButton( text,x,y,wide,tall, bNoHighlight) + { + m_iPlayerClass = iClass; + } + + virtual int IsNotValid(); +}; + +class TeamButton : public CommandButton +{ +private: + int m_iTeamNumber; +public: + TeamButton( int iTeam, const char* text,int x,int y,int wide,int tall ) : CommandButton( text,x,y,wide,tall) + { + m_iTeamNumber = iTeam; + } + + virtual int IsNotValid() + { + int iTeams = gViewPort->GetNumberOfTeams(); + // Never valid if there's only 1 team + if (iTeams == 1) + return true; + + // Auto Team's always visible + if (m_iTeamNumber == 5) + return false; + + if (iTeams >= m_iTeamNumber && m_iTeamNumber != g_iTeamNumber) + return false; + + return true; + } +}; + +class FeignButton : public CommandButton +{ +private: + int m_iFeignState; +public: + FeignButton( int iState, const char* text,int x,int y,int wide,int tall ) : CommandButton( text,x,y,wide,tall) + { + m_iFeignState = iState; + } + + virtual int IsNotValid() + { + // Only visible for spies + if (g_iPlayerClass != PC_SPY) + return true; + + if (m_iFeignState == gViewPort->GetIsFeigning()) + return false; + + return true; + } +}; + +class SpectateButton : public CommandButton +{ +public: + SpectateButton( const char* text,int x,int y,int wide,int tall, bool bNoHighlight ) : CommandButton( text,x,y,wide,tall, bNoHighlight) + { + } + + virtual int IsNotValid() + { + // Only visible if the server allows it + if ( gViewPort->GetAllowSpectators() != 0 ) + return false; + + return true; + } +}; + +#define DISGUISE_TEAM1 (1<<0) +#define DISGUISE_TEAM2 (1<<1) +#define DISGUISE_TEAM3 (1<<2) +#define DISGUISE_TEAM4 (1<<3) + +class DisguiseButton : public CommandButton +{ +private: + int m_iValidTeamsBits; + int m_iThisTeam; +public: + DisguiseButton( int iValidTeamNumsBits, const char* text,int x,int y,int wide,int tall ) : CommandButton( text,x,y,wide,tall,false ) + { + m_iValidTeamsBits = iValidTeamNumsBits; + } + + virtual int IsNotValid() + { + // Only visible for spies + if ( g_iPlayerClass != PC_SPY ) + return true; + + // if it's not tied to a specific team, then always show (for spies) + if ( !m_iValidTeamsBits ) + return false; + + // if we're tied to a team make sure we can change to that team + int iTmp = 1 << (gViewPort->GetNumberOfTeams() - 1); + if ( m_iValidTeamsBits & iTmp ) + return false; + + return true; + } +}; + +class DetpackButton : public CommandButton +{ +private: + int m_iDetpackState; +public: + DetpackButton( int iState, const char* text,int x,int y,int wide,int tall ) : CommandButton( text,x,y,wide,tall) + { + m_iDetpackState = iState; + } + + virtual int IsNotValid() + { + // Only visible for demomen + if (g_iPlayerClass != PC_DEMOMAN) + return true; + + if (m_iDetpackState == gViewPort->GetIsSettingDetpack()) + return false; + + return true; + } +}; + +extern int iBuildingCosts[]; +#define BUILDSTATE_HASBUILDING (1<<0) // Data is building ID (1 = Dispenser, 2 = Sentry) +#define BUILDSTATE_BUILDING (1<<1) +#define BUILDSTATE_BASE (1<<2) +#define BUILDSTATE_CANBUILD (1<<3) // Data is building ID (0 = Dispenser, 1 = Sentry) + +class BuildButton : public CommandButton +{ +private: + int m_iBuildState; + int m_iBuildData; + +public: + enum Buildings + { + DISPENSER = 0, + SENTRYGUN = 1, + }; + + BuildButton( int iState, int iData, const char* text,int x,int y,int wide,int tall ) : CommandButton( text,x,y,wide,tall) + { + m_iBuildState = iState; + m_iBuildData = iData; + } + + virtual int IsNotValid() + { + // Only visible for engineers + if (g_iPlayerClass != PC_ENGINEER) + return true; + + // If this isn't set, it's only active when they're not building + if (m_iBuildState & BUILDSTATE_BUILDING) + { + // Make sure the player's building + if ( !(gViewPort->GetBuildState() & BS_BUILDING) ) + return true; + } + else + { + // Make sure the player's not building + if ( gViewPort->GetBuildState() & BS_BUILDING ) + return true; + } + + if (m_iBuildState & BUILDSTATE_BASE) + { + // Only appear if we've got enough metal to build something, or something already built + if ( gViewPort->GetBuildState() & (BS_HAS_SENTRYGUN | BS_HAS_DISPENSER | BS_CANB_SENTRYGUN | BS_CANB_DISPENSER) ) + return false; + + return true; + } + + // Must have a building + if (m_iBuildState & BUILDSTATE_HASBUILDING) + { + if ( m_iBuildData == BuildButton::DISPENSER && !(gViewPort->GetBuildState() & BS_HAS_DISPENSER) ) + return true; + if ( m_iBuildData == BuildButton::SENTRYGUN && !(gViewPort->GetBuildState() & BS_HAS_SENTRYGUN) ) + return true; + } + + // Can build something + if (m_iBuildState & BUILDSTATE_CANBUILD) + { + // Make sure they've got the ammo and don't have one already + if ( m_iBuildData == BuildButton::DISPENSER && (gViewPort->GetBuildState() & BS_CANB_DISPENSER) ) + return false; + if ( m_iBuildData == BuildButton::SENTRYGUN && (gViewPort->GetBuildState() & BS_CANB_SENTRYGUN) ) + return false; + + return true; + } + + return false; + } +}; + +#define MAX_MAPNAME 256 + +class MapButton : public CommandButton +{ +private: + char m_szMapName[ MAX_MAPNAME ]; + +public: + MapButton( const char *pMapName, const char* text,int x,int y,int wide,int tall ) : CommandButton( text,x,y,wide,tall) + { + sprintf( m_szMapName, "maps/%s.bsp", pMapName ); + } + + virtual int IsNotValid() + { + const char *level = gEngfuncs.pfnGetLevelName(); + if (!level) + return true; + + // Does it match the current map name? + if ( strcmp(m_szMapName, level) ) + return true; + + return false; + } +}; + +//----------------------------------------------------------------------------- +// Purpose: CommandButton which is only displayed if the player is on team X +//----------------------------------------------------------------------------- +class TeamOnlyCommandButton : public CommandButton +{ +private: + int m_iTeamNum; + +public: + TeamOnlyCommandButton( int iTeamNum, const char* text,int x,int y,int wide,int tall, bool flat ) : + CommandButton( text, x, y, wide, tall, false, flat ), m_iTeamNum(iTeamNum) {} + + virtual int IsNotValid() + { + if ( g_iTeamNumber != m_iTeamNum ) + return true; + + return CommandButton::IsNotValid(); + } + + virtual void paintBackground() + { + if ( isArmed() ) + { + drawSetColor( 143,143, 54, 125 ); + drawFilledRect( 5, 0,_size[0] - 5,_size[1]); + } + } + + virtual void paint( void ) + { + if ( isArmed() ) + { + setFgColor( 194, 202, 54, 0 ); + } + else + { + setFgColor( 143, 143, 54, 15 ); + } + + Button::paint(); + } +}; + +//----------------------------------------------------------------------------- +// Purpose: CommandButton which is only displayed if the player is on team X +//----------------------------------------------------------------------------- +class ToggleCommandButton : public CommandButton, public InputSignal +{ +private: + struct cvar_s * m_cvar; + CImageLabel * pLabelOn; + CImageLabel * pLabelOff; + + +public: + ToggleCommandButton( const char* cvarname, const char* text,int x,int y,int wide,int tall, bool flat ) : + CommandButton( text, x, y, wide, tall, false, flat ) + { + m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname ); + + // Put a > to show it's a submenu + pLabelOn = new CImageLabel( "checked", 0, 0 ); + pLabelOn->setParent(this); + pLabelOn->addInputSignal(this); + + pLabelOff = new CImageLabel( "unchecked", 0, 0 ); + pLabelOff->setParent(this); + pLabelOff->setEnabled(true); + pLabelOff->addInputSignal(this); + + int textwide, texttall; + getTextSize( textwide, texttall); + + // Reposition + pLabelOn->setPos( textwide, (tall - pLabelOn->getTall()) / 2 ); + + pLabelOff->setPos( textwide, (tall - pLabelOff->getTall()) / 2 ); + + // Set text color to orange + setFgColor(Scheme::sc_primary1); + } + + virtual void cursorEntered(Panel* panel) + { + CommandButton::cursorEntered(); + } + + virtual void cursorExited(Panel* panel) + { + CommandButton::cursorExited(); + } + + virtual void mousePressed(MouseCode code,Panel* panel) + { + doClick(); + }; + + virtual void cursorMoved(int x,int y,Panel* panel) {}; + + virtual void mouseDoublePressed(MouseCode code,Panel* panel) {}; + virtual void mouseReleased(MouseCode code,Panel* panel) {}; + virtual void mouseWheeled(int delta,Panel* panel) {}; + virtual void keyPressed(KeyCode code,Panel* panel) {}; + virtual void keyTyped(KeyCode code,Panel* panel) {}; + virtual void keyReleased(KeyCode code,Panel* panel) {}; + virtual void keyFocusTicked(Panel* panel) {}; + + virtual void paint( void ) + { + if ( !m_cvar ) + { + pLabelOff->setVisible(false); + pLabelOn->setVisible(false); + } + else if ( m_cvar->value ) + { + pLabelOff->setVisible(false); + pLabelOn->setVisible(true); + } + else + { + pLabelOff->setVisible(true); + pLabelOn->setVisible(false); + } + + CommandButton::paint(); + + } +}; +class SpectToggleButton : public CommandButton, public InputSignal +{ +private: + struct cvar_s * m_cvar; + CImageLabel * pLabelOn; + +public: + SpectToggleButton( const char* cvarname, const char* text,int x,int y,int wide,int tall, bool flat ) : + CommandButton( text, x, y, wide, tall, false, flat ) + { + m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname ); + + // Put a > to show it's a submenu + pLabelOn = new CImageLabel( "checked", 0, 0 ); + pLabelOn->setParent(this); + pLabelOn->addInputSignal(this); + + + int textwide, texttall; + getTextSize( textwide, texttall); + + // Reposition + pLabelOn->setPos( textwide, (tall - pLabelOn->getTall()) / 2 ); + } + + virtual void cursorEntered(Panel* panel) + { + CommandButton::cursorEntered(); + } + + virtual void cursorExited(Panel* panel) + { + CommandButton::cursorExited(); + } + + virtual void mousePressed(MouseCode code,Panel* panel) + { + doClick(); + }; + + virtual void cursorMoved(int x,int y,Panel* panel) {}; + + virtual void mouseDoublePressed(MouseCode code,Panel* panel) {}; + virtual void mouseReleased(MouseCode code,Panel* panel) {}; + virtual void mouseWheeled(int delta,Panel* panel) {}; + virtual void keyPressed(KeyCode code,Panel* panel) {}; + virtual void keyTyped(KeyCode code,Panel* panel) {}; + virtual void keyReleased(KeyCode code,Panel* panel) {}; + virtual void keyFocusTicked(Panel* panel) {}; + + virtual void paintBackground() + { + if ( isArmed() ) + { + drawSetColor( 143,143, 54, 125 ); + drawFilledRect( 5, 0,_size[0] - 5,_size[1]); + } + } + + virtual void paint( void ) + { + if ( isArmed() ) + { + setFgColor( 194, 202, 54, 0 ); + } + else + { + setFgColor( 143, 143, 54, 15 ); + } + + if ( !m_cvar ) + { + pLabelOn->setVisible(false); + } + else if ( m_cvar->value ) + { + pLabelOn->setVisible(true); + } + else + { + pLabelOn->setVisible(false); + } + + Button::paint(); + } +}; + +/* +class SpectToggleButton : public ToggleCommandButton +{ +private: + struct cvar_s * m_cvar; + CImageLabel * pLabelOn; + CImageLabel * pLabelOff; + +public: + + SpectToggleButton( const char* cvarname, const char* text,int x,int y,int wide,int tall, bool flat ) : + ToggleCommandButton( cvarname, text, x, y, wide, tall, flat, TRUE ) + { + m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname ); + + // Put a > to show it's a submenu + pLabelOn = new CImageLabel( "checked", 0, 0 ); + pLabelOn->setParent(this); + pLabelOn->addInputSignal(this); + + pLabelOff = new CImageLabel( "unchecked", 0, 0 ); + pLabelOff->setParent(this); + pLabelOff->setEnabled(true); + pLabelOff->addInputSignal(this); + + int textwide, texttall; + getTextSize( textwide, texttall); + + // Reposition + pLabelOn->setPos( textwide, (tall - pLabelOn->getTall()) / 2 ); + + pLabelOff->setPos( textwide, (tall - pLabelOff->getTall()) / 2 ); + + // Set text color to orange + setFgColor(Scheme::sc_primary1); + } + + virtual void paintBackground() + { + if ( isArmed()) + { + drawSetColor( 143,143, 54, 125 ); + drawFilledRect( 5, 0,_size[0] - 5,_size[1]); + } + } + + virtual void paint() + { + + if ( isArmed() ) + { + setFgColor( 194, 202, 54, 0 ); + } + else + { + setFgColor( 143, 143, 54, 15 ); + } + + if ( !m_cvar ) + { + pLabelOff->setVisible(false); + pLabelOn->setVisible(false); + } + else if ( m_cvar->value ) + { + pLabelOff->setVisible(false); + pLabelOn->setVisible(true); + } + else + { + pLabelOff->setVisible(true); + pLabelOn->setVisible(false); + } + + Button::paint(); + } +}; +*/ +//============================================================ +// Panel that can be dragged around +class DragNDropPanel : public Panel +{ +private: + bool m_bBeingDragged; + LineBorder *m_pBorder; +public: + DragNDropPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) + { + m_bBeingDragged = false; + + // Create the Drag Handler + addInputSignal( new CDragNDropHandler(this) ); + + // Create the border (for dragging) + m_pBorder = new LineBorder(); + } + + virtual void setDragged( bool bState ) + { + m_bBeingDragged = bState; + + if (m_bBeingDragged) + setBorder(m_pBorder); + else + setBorder(NULL); + } +}; + +//================================================================ +// Panel that draws itself with a transparent black background +class CTransparentPanel : public Panel +{ +private: + int m_iTransparency; +public: + CTransparentPanel(int iTrans, int x,int y,int wide,int tall) : Panel(x,y,wide,tall) + { + m_iTransparency = iTrans; + } + + void SetTransparency(int inTransparency) + { + m_iTransparency = inTransparency; + } + + virtual void paintBackground() + { + if (m_iTransparency) + { + // Transparent black background + drawSetColor( 0,0,0, m_iTransparency ); + drawFilledRect(0,0,_size[0],_size[1]); + } + } +}; + +//================================================================ +// Menu Panel that supports buffering of menus +class CMenuPanel : public CTransparentPanel +{ +private: + CMenuPanel *m_pNextMenu; + int m_iMenuID; + int m_iRemoveMe; + int m_iIsActive; + float m_flOpenTime; +public: + CMenuPanel(int iRemoveMe, int x,int y,int wide,int tall) : CTransparentPanel(100, x,y,wide,tall) + { + Reset(); + m_iRemoveMe = iRemoveMe; + } + + CMenuPanel(int iTrans, int iRemoveMe, int x,int y,int wide,int tall) : CTransparentPanel(iTrans, x,y,wide,tall) + { + Reset(); + m_iRemoveMe = iRemoveMe; + } + + virtual void Reset( void ) + { + m_pNextMenu = NULL; + m_iIsActive = false; + m_flOpenTime = 0; + } + + void SetNextMenu( CMenuPanel *pNextPanel ) + { + if (m_pNextMenu) + m_pNextMenu->SetNextMenu( pNextPanel ); + else + m_pNextMenu = pNextPanel; + } + + void SetMenuID( int iID ) + { + m_iMenuID = iID; + } + + void SetActive( int iState ) + { + m_iIsActive = iState; + } + + virtual void Open( void ) + { + setVisible( true ); + + // Note the open time, so we can delay input for a bit + m_flOpenTime = gHUD.m_flTime; + } + + virtual void Close( void ) + { + setVisible( false ); + m_iIsActive = false; + + if ( m_iRemoveMe ) + gViewPort->removeChild( this ); + + // This MenuPanel has now been deleted. Don't append code here. + } + + int ShouldBeRemoved() { return m_iRemoveMe; }; + CMenuPanel* GetNextMenu() { return m_pNextMenu; }; + int GetMenuID() { return m_iMenuID; }; + int IsActive() { return m_iIsActive; }; + float GetOpenTime() { return m_flOpenTime; }; + + // Numeric input + virtual bool SlotInput( int iSlot ) { return false; }; + virtual void SetActiveInfo( int iInput ) {}; +}; + +//================================================================ +// Custom drawn scroll bars +class CTFScrollButton : public CommandButton +{ +private: + BitmapTGA *m_pTGA; + +public: + CTFScrollButton(int iArrow, const char* text,int x,int y,int wide,int tall); + + virtual void paint( void ); + virtual void paintBackground( void ); +}; + +// Custom drawn slider bar +class CTFSlider : public Slider +{ +public: + CTFSlider(int x,int y,int wide,int tall,bool vertical) : Slider(x,y,wide,tall,vertical) + { + }; + + virtual void paintBackground( void ); +}; + +// Custom drawn scrollpanel +class CTFScrollPanel : public ScrollPanel +{ +public: + CTFScrollPanel(int x,int y,int wide,int tall); +}; + +//================================================================ +// Menu Panels that take key input +//============================================================ +class CClassMenuPanel : public CMenuPanel +{ +private: + CTransparentPanel *m_pClassInfoPanel[PC_LASTCLASS]; + Label *m_pPlayers[PC_LASTCLASS]; + ClassButton *m_pButtons[PC_LASTCLASS]; + CommandButton *m_pCancelButton; + ScrollPanel *m_pScrollPanel; + + CImageLabel *m_pClassImages[MAX_TEAMS][PC_LASTCLASS]; + + int m_iCurrentInfo; + + enum { STRLENMAX_PLAYERSONTEAM = 128 }; + char m_sPlayersOnTeamString[STRLENMAX_PLAYERSONTEAM]; + +public: + CClassMenuPanel(int iTrans, int iRemoveMe, int x,int y,int wide,int tall); + + virtual bool SlotInput( int iSlot ); + virtual void Open( void ); + virtual void Update( void ); + virtual void SetActiveInfo( int iInput ); + virtual void Initialize( void ); + + virtual void Reset( void ) + { + CMenuPanel::Reset(); + m_iCurrentInfo = 0; + } +}; + +class CTeamMenuPanel : public CMenuPanel +{ +public: + ScrollPanel *m_pScrollPanel; + CTransparentPanel *m_pTeamWindow; + Label *m_pMapTitle; + TextPanel *m_pBriefing; + TextPanel *m_pTeamInfoPanel[6]; + CommandButton *m_pButtons[6]; + bool m_bUpdatedMapName; + CommandButton *m_pCancelButton; + CommandButton *m_pSpectateButton; + + int m_iCurrentInfo; + +public: + CTeamMenuPanel(int iTrans, int iRemoveMe, int x,int y,int wide,int tall); + + virtual bool SlotInput( int iSlot ); + virtual void Open( void ); + virtual void Update( void ); + virtual void SetActiveInfo( int iInput ); + virtual void paintBackground( void ); + + virtual void Initialize( void ); + + virtual void Reset( void ) + { + CMenuPanel::Reset(); + m_iCurrentInfo = 0; + } +}; + +//========================================================= +// Specific Menus to handle old HUD sections +class CHealthPanel : public DragNDropPanel +{ +private: + BitmapTGA *m_pHealthTGA; + Label *m_pHealthLabel; +public: + CHealthPanel(int x,int y,int wide,int tall) : DragNDropPanel(x,y,wide,tall) + { + // Load the Health icon + FileInputStream* fis = new FileInputStream( GetVGUITGAName("%d_hud_health"), false); + m_pHealthTGA = new BitmapTGA(fis,true); + fis->close(); + + // Create the Health Label + int iXSize,iYSize; + m_pHealthTGA->getSize(iXSize,iYSize); + m_pHealthLabel = new Label("",0,0,iXSize,iYSize); + m_pHealthLabel->setImage(m_pHealthTGA); + m_pHealthLabel->setParent(this); + + // Set panel dimension + // Shouldn't be needed once Billy's fized setImage not recalculating the size + //setSize( iXSize + 100, gHUD.m_iFontHeight + 10 ); + //m_pHealthLabel->setPos( 10, (getTall() - iYSize) / 2 ); + } + + virtual void paintBackground() + { + } + + void paint() + { + // Get the paint color + int r,g,b,a; + // Has health changed? Flash the health # + if (gHUD.m_Health.m_fFade) + { + gHUD.m_Health.m_fFade -= (gHUD.m_flTimeDelta * 20); + if (gHUD.m_Health.m_fFade <= 0) + { + a = MIN_ALPHA; + gHUD.m_Health.m_fFade = 0; + } + + // Fade the health number back to dim + a = MIN_ALPHA + (gHUD.m_Health.m_fFade/FADE_TIME) * 128; + } + else + a = MIN_ALPHA; + + gHUD.m_Health.GetPainColor( r, g, b ); + ScaleColors(r, g, b, a ); + + // If health is getting low, make it bright red + if (gHUD.m_Health.m_iHealth <= 15) + a = 255; + + int iXSize,iYSize, iXPos, iYPos; + m_pHealthTGA->getSize(iXSize,iYSize); + m_pHealthTGA->getPos(iXPos, iYPos); + + // Paint the player's health + int x = gHUD.DrawHudNumber( iXPos + iXSize + 5, iYPos + 5, DHN_3DIGITS | DHN_DRAWZERO, gHUD.m_Health.m_iHealth, r, g, b); + + // Draw the vertical line + int HealthWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left; + x += HealthWidth / 2; + FillRGBA(x, iYPos + 5, HealthWidth / 10, gHUD.m_iFontHeight, 255, 160, 0, a); + } +}; + +#endif diff --git a/main/source/cl_dll/vgui_int.cpp b/main/source/cl_dll/vgui_int.cpp new file mode 100644 index 00000000..b854690f --- /dev/null +++ b/main/source/cl_dll/vgui_int.cpp @@ -0,0 +1,132 @@ + +#include"vgui_int.h" +#include +#include +#include +#include +#include +#include +#include +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_ControlConfigPanel.h" + +//Label *gTestLabel = NULL; +//CImageLabel* gTestLabel; + +namespace +{ + +class TexturePanel : public Panel , public ActionSignal +{ +private: + int _bindIndex; + TextEntry* _textEntry; +public: + TexturePanel() : Panel(0,0,256,276) + { + _bindIndex=2700; + _textEntry=new TextEntry("2700",0,0,128,20); + _textEntry->setParent(this); + _textEntry->addActionSignal(this); + } +public: + virtual bool isWithin(int x,int y) + { + return _textEntry->isWithin(x,y); + } +public: + virtual void actionPerformed(Panel* panel) + { + char buf[256]; + _textEntry->getText(0,buf,256); + sscanf(buf,"%d",&_bindIndex); + } +protected: + virtual void paintBackground() + { + Panel::paintBackground(); + + int wide,tall; + getPaintSize(wide,tall); + + drawSetColor(0,0,255,0); + drawSetTexture(_bindIndex); + drawTexturedRect(0,19,257,257); + } + +}; + +} + +using namespace vgui; + +void VGui_ViewportPaintBackground(int extents[4]) +{ + gEngfuncs.VGui_ViewportPaintBackground(extents); +} + +void* VGui_GetPanel() +{ + return (Panel*)gEngfuncs.VGui_GetPanel(); +} + +void VGui_Startup() +{ + Panel* root=(Panel*)VGui_GetPanel(); + root->setBgColor(128,128,0,0); + //root->setNonPainted(false); + //root->setBorder(new LineBorder()); + root->setLayout(new BorderLayout(0)); + + //root->getSurfaceBase()->setEmulatedCursorVisible(true); + + if (gViewPort != NULL) + { +// root->removeChild(gViewPort); + + // free the memory +// delete gViewPort; +// gViewPort = NULL; + + gViewPort->Initialize(); + } + else + { + gViewPort = new TeamFortressViewport(0,0,root->getWide(),root->getTall()); + gViewPort->setParent(root); + +// //gTestLabel = new Label( "TestLabel", 125, 125, 200, 50 ); +// gTestLabel = new CImageLabel( "arrowdn", 125, 125, 200, 50 ); +// gTestLabel->setParent( root ); +// +// //gTestLabel->setFgColor(0, 255, 0, 128); +// //gTestLabel->setBgColor( 0, 0, 0, 128); +// +// gTestLabel->m_pTGA->setColor( vgui::Color(0, 255, 0, 128) ); + } + + // Comment this out when not debugging + //TexturePanel* texturePanel=new TexturePanel(); + //texturePanel->setParent(gViewPort); + +} + +void VGui_Shutdown() +{ + delete gViewPort; + gViewPort = NULL; +} + + + + + diff --git a/main/source/cl_dll/vgui_int.h b/main/source/cl_dll/vgui_int.h new file mode 100644 index 00000000..1ba0da2f --- /dev/null +++ b/main/source/cl_dll/vgui_int.h @@ -0,0 +1,16 @@ + +#ifndef VGUI_INT_H +#define VGUI_INT_H + +extern "C" +{ +void VGui_Startup(); +void VGui_Shutdown(); +void* VGui_GetPanel(); + +//Only safe to call from inside subclass of Panel::paintBackground +void VGui_ViewportPaintBackground(int extents[4]); +} + + +#endif \ No newline at end of file diff --git a/main/source/cl_dll/vgui_teammenu.cpp b/main/source/cl_dll/vgui_teammenu.cpp new file mode 100644 index 00000000..f339647a --- /dev/null +++ b/main/source/cl_dll/vgui_teammenu.cpp @@ -0,0 +1,402 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: TFC Team Menu +// +// $Workfile: $ +// $Date: 2002/07/08 16:15:13 $ +// +//----------------------------------------------------------------------------- +// $Log: vgui_teammenu.cpp,v $ +// Revision 1.3 2002/07/08 16:15:13 Flayra +// - Refactored team color management +// +// Revision 1.2 2001/09/13 22:28:01 Charlie +// - Updated NS with new Half-life 1108 patch in preparation for voice support and spectator mode +// +// Revision 1.1.1.1.2.1 2001/09/13 14:42:30 Charlie +// - HL1108 +// +// +// $NoKeywords: $ +//============================================================================= + +#include "vgui_int.h" +#include "VGUI_Font.h" +#include "VGUI_ScrollPanel.h" +#include "VGUI_TextImage.h" + +#include "hud.h" +#include "cl_util.h" +#include "vgui_TeamFortressViewport.h" + +// Team Menu Dimensions +#define TEAMMENU_TITLE_X XRES(40) +#define TEAMMENU_TITLE_Y YRES(32) +#define TEAMMENU_TOPLEFT_BUTTON_X XRES(40) +#define TEAMMENU_TOPLEFT_BUTTON_Y YRES(80) +#define TEAMMENU_BUTTON_SIZE_X XRES(124) +#define TEAMMENU_BUTTON_SIZE_Y YRES(24) +#define TEAMMENU_BUTTON_SPACER_Y YRES(8) +#define TEAMMENU_WINDOW_X XRES(176) +#define TEAMMENU_WINDOW_Y YRES(80) +#define TEAMMENU_WINDOW_SIZE_X XRES(424) +#define TEAMMENU_WINDOW_SIZE_Y YRES(312) +#define TEAMMENU_WINDOW_TITLE_X XRES(16) +#define TEAMMENU_WINDOW_TITLE_Y YRES(16) +#define TEAMMENU_WINDOW_TEXT_X XRES(16) +#define TEAMMENU_WINDOW_TEXT_Y YRES(48) +#define TEAMMENU_WINDOW_TEXT_SIZE_Y YRES(178) +#define TEAMMENU_WINDOW_INFO_X XRES(16) +#define TEAMMENU_WINDOW_INFO_Y YRES(234) + +// Creation +CTeamMenuPanel::CTeamMenuPanel(int iTrans, int iRemoveMe, int x,int y,int wide,int tall) : CMenuPanel(iTrans, iRemoveMe, x,y,wide,tall) +{ + // Get the scheme used for the Titles + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + + // schemes + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" ); + SchemeHandle_t hTeamWindowText = pSchemes->getSchemeHandle( "Briefing Text" ); + SchemeHandle_t hTeamInfoText = pSchemes->getSchemeHandle( "Team Info Text" ); + + // get the Font used for the Titles + Font *pTitleFont = pSchemes->getFont( hTitleScheme ); + int r, g, b, a; + + // Create the title + Label *pLabel = new Label( "", TEAMMENU_TITLE_X, TEAMMENU_TITLE_Y ); + pLabel->setParent( this ); + pLabel->setFont( pTitleFont ); + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + pLabel->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + pLabel->setBgColor( r, g, b, a ); + pLabel->setContentAlignment( vgui::Label::a_west ); + pLabel->setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Title_SelectYourTeam")); + + // Create the Info Window + m_pTeamWindow = new CTransparentPanel( 255, TEAMMENU_WINDOW_X, TEAMMENU_WINDOW_Y, TEAMMENU_WINDOW_SIZE_X, TEAMMENU_WINDOW_SIZE_Y ); + m_pTeamWindow->setParent( this ); + m_pTeamWindow->setBorder( new LineBorder( Color(255*0.7,170*0.7,0,0 )) ); + + // Create the Map Name Label + m_pMapTitle = new Label( "", TEAMMENU_WINDOW_TITLE_X, TEAMMENU_WINDOW_TITLE_Y ); + m_pMapTitle->setFont( pTitleFont ); + m_pMapTitle->setParent( m_pTeamWindow ); + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + m_pMapTitle->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + m_pMapTitle->setBgColor( r, g, b, a ); + m_pMapTitle->setContentAlignment( vgui::Label::a_west ); + + // Create the Scroll panel + m_pScrollPanel = new CTFScrollPanel( TEAMMENU_WINDOW_TEXT_X, TEAMMENU_WINDOW_TEXT_Y, TEAMMENU_WINDOW_SIZE_X - (TEAMMENU_WINDOW_TEXT_X * 2), TEAMMENU_WINDOW_TEXT_SIZE_Y ); + m_pScrollPanel->setParent(m_pTeamWindow); + m_pScrollPanel->setScrollBarVisible(false, false); + + // Create the Map Briefing panel + m_pBriefing = new TextPanel("", 0,0, TEAMMENU_WINDOW_SIZE_X - TEAMMENU_WINDOW_TEXT_X, TEAMMENU_WINDOW_TEXT_SIZE_Y ); + m_pBriefing->setParent( m_pScrollPanel->getClient() ); + m_pBriefing->setFont( pSchemes->getFont(hTeamWindowText) ); + pSchemes->getFgColor( hTeamWindowText, r, g, b, a ); + m_pBriefing->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTeamWindowText, r, g, b, a ); + m_pBriefing->setBgColor( r, g, b, a ); + + m_pBriefing->setText( gHUD.m_TextMessage.BufferedLocaliseTextString("#Map_Description_not_available") ); + + // Team Menu buttons + for (int i = 1; i <= 5; i++) + { + char sz[256]; + + int iYPos = TEAMMENU_TOPLEFT_BUTTON_Y + ( (TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y) * i ); + + // Team button + m_pButtons[i] = new CommandButton( "", TEAMMENU_TOPLEFT_BUTTON_X, iYPos, TEAMMENU_BUTTON_SIZE_X, TEAMMENU_BUTTON_SIZE_Y, true); + m_pButtons[i]->setParent( this ); + m_pButtons[i]->setContentAlignment( vgui::Label::a_west ); + m_pButtons[i]->setVisible( false ); + + // AutoAssign button uses special case + if (i == 5) + { + m_pButtons[5]->setBoundKey( '5' ); + m_pButtons[5]->setText( gHUD.m_TextMessage.BufferedLocaliseTextString("#Team_AutoAssign") ); + m_pButtons[5]->setVisible( true ); + } + + // Create the Signals + sprintf(sz, "jointeam %d", i); + m_pButtons[i]->addActionSignal( new CMenuHandler_StringCommandWatch( sz, true ) ); + m_pButtons[i]->addInputSignal( new CHandler_MenuButtonOver(this, i) ); + + // Create the Team Info panel + m_pTeamInfoPanel[i] = new TextPanel("", TEAMMENU_WINDOW_INFO_X, TEAMMENU_WINDOW_INFO_Y, TEAMMENU_WINDOW_SIZE_X - TEAMMENU_WINDOW_INFO_X, TEAMMENU_WINDOW_SIZE_X - TEAMMENU_WINDOW_INFO_Y ); + m_pTeamInfoPanel[i]->setParent( m_pTeamWindow ); + m_pTeamInfoPanel[i]->setFont( pSchemes->getFont(hTeamInfoText) ); + m_pTeamInfoPanel[i]->setFgColor( kTeamColors[i % iNumberOfTeamColors][0], + kTeamColors[i % iNumberOfTeamColors][1], + kTeamColors[i % iNumberOfTeamColors][2], + 0 ); + m_pTeamInfoPanel[i]->setBgColor( 0,0,0, 255 ); + } + + // Create the Cancel button + m_pCancelButton = new CommandButton( CHudTextMessage::BufferedLocaliseTextString( "#Menu_Cancel" ), TEAMMENU_TOPLEFT_BUTTON_X, 0, TEAMMENU_BUTTON_SIZE_X, TEAMMENU_BUTTON_SIZE_Y); + m_pCancelButton->setParent( this ); + m_pCancelButton->addActionSignal( new CMenuHandler_TextWindow(HIDE_TEXTWINDOW) ); + + // Create the Spectate button + m_pSpectateButton = new SpectateButton( CHudTextMessage::BufferedLocaliseTextString( "#Menu_Spectate" ), TEAMMENU_TOPLEFT_BUTTON_X, 0, TEAMMENU_BUTTON_SIZE_X, TEAMMENU_BUTTON_SIZE_Y, true); + m_pSpectateButton->setParent( this ); + m_pSpectateButton->addActionSignal( new CMenuHandler_StringCommand( "spectate", true ) ); + m_pSpectateButton->setBoundKey( '6' ); + m_pSpectateButton->addInputSignal( new CHandler_MenuButtonOver(this, 6) ); + + Initialize(); +} + +//----------------------------------------------------------------------------- +// Purpose: Called each time a new level is started. +//----------------------------------------------------------------------------- +void CTeamMenuPanel::Initialize( void ) +{ + m_bUpdatedMapName = false; + m_iCurrentInfo = 0; + m_pScrollPanel->setScrollValue( 0, 0 ); +} + +//----------------------------------------------------------------------------- +// Purpose: Called everytime the Team Menu is displayed +//----------------------------------------------------------------------------- +void CTeamMenuPanel::Update( void ) +{ + int iYPos = TEAMMENU_TOPLEFT_BUTTON_Y; + + // Set the team buttons + for (int i = 1; i <= 4; i++) + { + if (m_pButtons[i]) + { + if ( i <= gViewPort->GetNumberOfTeams() ) + { + m_pButtons[i]->setText( gViewPort->GetTeamName(i) ); + + // bound key replacement + char sz[32]; + sprintf( sz, "%d", i ); + m_pButtons[i]->setBoundKey( sz[0] ); + + m_pButtons[i]->setVisible( true ); + m_pButtons[i]->setPos( TEAMMENU_TOPLEFT_BUTTON_X, iYPos ); + iYPos += TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y; + + // Start with the first option up + if (!m_iCurrentInfo) + SetActiveInfo( i ); + + char szPlayerList[ (MAX_PLAYER_NAME_LENGTH + 3) * 31 ]; // name + ", " + strcpy(szPlayerList, "\n"); + // Update the Team Info + // Now count the number of teammembers of this class + int iTotal = 0; + for ( int j = 1; j <= MAX_PLAYERS; j++ ) + { + if ( g_PlayerInfoList[j].name == NULL ) + continue; // empty player slot, skip + if ( g_PlayerInfoList[j].thisplayer ) + continue; // skip this player + if ( g_PlayerExtraInfo[j].teamnumber != i ) + continue; // skip over players in other teams + + iTotal++; + if (iTotal > 1) + strncat( szPlayerList, ", ", sizeof(szPlayerList) - strlen(szPlayerList) ); + strncat( szPlayerList, g_PlayerInfoList[j].name, sizeof(szPlayerList) - strlen(szPlayerList) ); + szPlayerList[ sizeof(szPlayerList) - 1 ] = '\0'; + } + + if (iTotal > 0) + { + // Set the text of the info Panel + char szText[ ((MAX_PLAYER_NAME_LENGTH + 3) * 31) + 256 ]; + if (iTotal == 1) + sprintf(szText, "%s: %d Player (%d points)", gViewPort->GetTeamName(i), iTotal, g_TeamInfo[i].frags ); + else + sprintf(szText, "%s: %d Players (%d points)", gViewPort->GetTeamName(i), iTotal, g_TeamInfo[i].frags ); + strncat( szText, szPlayerList, sizeof(szText) - strlen(szText) ); + szText[ sizeof(szText) - 1 ] = '\0'; + + m_pTeamInfoPanel[i]->setText( szText ); + } + else + { + m_pTeamInfoPanel[i]->setText( "" ); + } + } + else + { + // Hide the button (may be visible from previous maps) + m_pButtons[i]->setVisible( false ); + } + } + } + + // Move the AutoAssign button into place + m_pButtons[5]->setPos( TEAMMENU_TOPLEFT_BUTTON_X, iYPos ); + iYPos += TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y; + + // Spectate button + if (m_pSpectateButton->IsNotValid()) + { + m_pSpectateButton->setVisible( false ); + } + else + { + m_pSpectateButton->setPos( TEAMMENU_TOPLEFT_BUTTON_X, iYPos ); + m_pSpectateButton->setVisible( true ); + iYPos += TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y; + } + + // If the player is already in a team, make the cancel button visible + if ( g_iTeamNumber ) + { + m_pCancelButton->setPos( TEAMMENU_TOPLEFT_BUTTON_X, iYPos ); + iYPos += TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y; + m_pCancelButton->setVisible( true ); + } + else + { + m_pCancelButton->setVisible( false ); + } + + // Set the Map Title + if (!m_bUpdatedMapName) + { + const char *level = gEngfuncs.pfnGetLevelName(); + if (level && level[0]) + { + char sz[256]; + char szTitle[256]; + char *ch; + + // Update the level name + strcpy( sz, level ); + ch = strchr( sz, '/' ); + if (!ch) + ch = strchr( sz, '\\' ); + strcpy( szTitle, ch+1 ); + ch = strchr( szTitle, '.' ); + *ch = '\0'; + m_pMapTitle->setText( szTitle ); + *ch = '.'; + + // Update the map briefing + strcpy( sz, level ); + ch = strchr( sz, '.' ); + *ch = '\0'; + strcat( sz, ".txt" ); + char *pfile = (char*)gEngfuncs.COM_LoadFile( sz, 5, NULL ); + if (pfile) + { + m_pBriefing->setText( pfile ); + + // Get the total size of the Briefing text and resize the text panel + int iXSize, iYSize; + m_pBriefing->getTextImage()->getTextSize( iXSize, iYSize ); + m_pBriefing->setSize( iXSize, iYSize ); + gEngfuncs.COM_FreeFile( pfile ); + } + + m_bUpdatedMapName = true; + } + } + + m_pScrollPanel->validate(); +} + +//===================================== +// Key inputs +bool CTeamMenuPanel::SlotInput( int iSlot ) +{ + // Check for AutoAssign + if ( iSlot == 5) + { + m_pButtons[5]->fireActionSignal(); + return true; + } + + // Spectate + if ( iSlot == 6) + { + m_pSpectateButton->fireActionSignal(); + return true; + } + + // Otherwise, see if a particular team is selectable + if ( (iSlot < 1) || (iSlot > gViewPort->GetNumberOfTeams()) ) + return false; + if ( !m_pButtons[ iSlot ] ) + return false; + + // Is the button pushable? + if ( m_pButtons[ iSlot ]->isVisible() ) + { + m_pButtons[ iSlot ]->fireActionSignal(); + return true; + } + + return false; +} + +//====================================== +// Update the Team menu before opening it +void CTeamMenuPanel::Open( void ) +{ + Update(); + CMenuPanel::Open(); +} + +void CTeamMenuPanel::paintBackground() +{ + // make sure we get the map briefing up + if ( !m_bUpdatedMapName ) + Update(); + + CMenuPanel::paintBackground(); +} + +//====================================== +// Mouse is over a team button, bring up the class info +void CTeamMenuPanel::SetActiveInfo( int iInput ) +{ + // Remove all the Info panels and bring up the specified one + m_pSpectateButton->setArmed( false ); + for (int i = 1; i <= 5; i++) + { + m_pButtons[i]->setArmed( false ); + m_pTeamInfoPanel[i]->setVisible( false ); + } + + // 6 is Spectate + if (iInput == 6) + { + m_pSpectateButton->setArmed( true ); + } + else + { + m_pButtons[iInput]->setArmed( true ); + m_pTeamInfoPanel[iInput]->setVisible( true ); + } + + m_iCurrentInfo = iInput; + + m_pScrollPanel->validate(); +} diff --git a/main/source/cl_dll/view.cpp b/main/source/cl_dll/view.cpp new file mode 100644 index 00000000..a7cdc157 --- /dev/null +++ b/main/source/cl_dll/view.cpp @@ -0,0 +1,2764 @@ +//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// view/refresh setup functions + +#include "hud.h" +#include "cl_util.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" + +#include "entity_state.h" +#include "cl_entity.h" +#include "ref_params.h" +#include "in_defs.h" // PITCH YAW ROLL +#include "pm_movevars.h" +#include "pm_shared.h" +#include "pm_defs.h" +#include "event_api.h" +#include "pmtrace.h" +#include "screenfade.h" +#include "shake.h" +#include "mod/AvHClientUtil.h" +#include "APIProxy.h" +#include "Exports.h" +#include "hltv.h" +#include "util/MathUtil.h" +#include "util/STLUtil.h" +#include "mod/AvHMarineEquipmentConstants.h" +#include "mod/AvHMarineWeaponConstants.h" +#include "mod/AvHAlienWeaponConstants.h" +#include "mod/AvHSpecials.h" + +extern float gTopDownViewOrigin[3]; +extern float gTopDownViewAngles[3]; + +#ifndef M_PI +#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h +#endif + +void PM_ParticleLine( float *start, float *end, int pcolor, float life, float vert); +int PM_GetVisEntInfo( int ent ); +int PM_GetPhysEntInfo( int ent ); +void InterpolateAngles( float *start, float *end, float *output, float frac ); +void NormalizeAngles(float* angles); +float AngleBetweenVectors(float * v1, float * v2 ); + +void V_DropPunchAngle ( float frametime, float *ev_punchangle ); +void VectorAngles( const float *forward, float *angles ); +void V_CalcTopDownRefdef ( struct ref_params_s *pparams ); + +extern float vJumpOrigin[3]; +extern float vJumpAngles[3]; + +#include "r_studioint.h" +#include "com_model.h" + +extern engine_studio_api_t IEngineStudio; + +/* +The view is allowed to move slightly from it's true position for bobbing, +but if it exceeds 8 pixels linear distance (spherical, not box), the list of +entities sent from the server may not include everything in the pvs, especially +when crossing a water boudnary. +*/ + +extern cvar_t *chase_active; +extern cvar_t *scr_ofsx, *scr_ofsy, *scr_ofsz; +extern cvar_t *cl_vsmoothing; + +#define CAM_MODE_RELAX 1 +#define CAM_MODE_FOCUS 2 + +vec3_t v_origin, v_angles, v_cl_angles, v_sim_org, v_lastAngles, v_view_ofs; +float v_frametime, v_lastDistance; +float v_cameraRelaxAngle = 5.0f; +float v_cameraFocusAngle = 35.0f; +int v_cameraMode = CAM_MODE_FOCUS; +qboolean v_resetCamera = 1; + +extern float gTopDownHeight; + +vec3_t gLastCommanderViewpoint; + +vec3_t ev_punchangle; + +cvar_t *scr_ofsx; +cvar_t *scr_ofsy; +cvar_t *scr_ofsz; + +cvar_t *v_centermove; +cvar_t *v_centerspeed; + +cvar_t *cl_bobcycle; +cvar_t *cl_bob; +cvar_t *cl_bobup; +cvar_t *cl_waterdist; +cvar_t *cl_chasedist; +cvar_t *cl_hudcam; + +// These cvars are not registered (so users can't cheat), so set the ->value field directly +// Register these cvars in V_Init() if needed for easy tweaking +cvar_t v_iyaw_cycle = {"v_iyaw_cycle", "2", 0, 2}; +cvar_t v_iroll_cycle = {"v_iroll_cycle", "0.5", 0, 0.5}; +cvar_t v_ipitch_cycle = {"v_ipitch_cycle", "1", 0, 1}; +cvar_t v_iyaw_level = {"v_iyaw_level", "0.3", 0, 0.3}; +cvar_t v_iroll_level = {"v_iroll_level", "0.1", 0, 0.1}; +cvar_t v_ipitch_level = {"v_ipitch_level", "0.3", 0, 0.3}; + +float v_idlescale; // used by TFC for concussion grenade effect + +/* +//============================================================================= +void V_NormalizeAngles( float *angles ) +{ + int i; + // Normalize angles + for ( i = 0; i < 3; i++ ) + { + if ( angles[i] > 180.0 ) + { + angles[i] -= 360.0; + } + else if ( angles[i] < -180.0 ) + { + angles[i] += 360.0; + } + } +} + +/* +=================== +V_InterpolateAngles + +Interpolate Euler angles. +FIXME: Use Quaternions to avoid discontinuities +Frac is 0.0 to 1.0 ( i.e., should probably be clamped, but doesn't have to be ) +=================== + +void V_InterpolateAngles( float *start, float *end, float *output, float frac ) +{ + int i; + float ang1, ang2; + float d; + + V_NormalizeAngles( start ); + V_NormalizeAngles( end ); + + for ( i = 0 ; i < 3 ; i++ ) + { + ang1 = start[i]; + ang2 = end[i]; + + d = ang2 - ang1; + if ( d > 180 ) + { + d -= 360; + } + else if ( d < -180 ) + { + d += 360; + } + + output[i] = ang1 + d * frac; + } + + V_NormalizeAngles( output ); +} */ + +// Quakeworld bob code, this fixes jitters in the mutliplayer since the clock (pparams->time) isn't quite linear +float V_CalcBob ( struct ref_params_s *pparams ) +{ + static double bobtime; + static float bob; + float cycle; + static float lasttime; + vec3_t vel; + + if ( pparams->onground == -1 || + pparams->time == lasttime ) + { + // just use old value + return bob; + } + + lasttime = pparams->time; + + bobtime += pparams->frametime; + cycle = bobtime - (int)( bobtime / cl_bobcycle->value ) * cl_bobcycle->value; + cycle /= cl_bobcycle->value; + + if ( cycle < cl_bobup->value ) + { + cycle = M_PI * cycle / cl_bobup->value; + } + else + { + cycle = M_PI + M_PI * ( cycle - cl_bobup->value )/( 1.0 - cl_bobup->value ); + } + + // bob is proportional to simulated velocity in the xy plane + // (don't count Z, or jumping messes it up) + VectorCopy( pparams->simvel, vel ); + vel[2] = 0; + + bob = sqrt( vel[0] * vel[0] + vel[1] * vel[1] ) * cl_bob->value; + bob = bob * 0.3 + bob * 0.7 * sin(cycle); + bob = min( bob, 4 ); + bob = max( bob, -7 ); + return bob; + +} + +/* +=============== +V_CalcRoll +Used by view and sv_user +=============== +*/ +float V_CalcRoll (vec3_t angles, vec3_t velocity, float rollangle, float rollspeed ) +{ + float sign; + float side; + float value; + vec3_t forward, right, up; + + AngleVectors ( angles, forward, right, up ); + + side = DotProduct (velocity, right); + sign = side < 0 ? -1 : 1; + side = fabs( side ); + + value = rollangle; + if (side < rollspeed) + { + side = side * value / rollspeed; + } + else + { + side = value; + } + return side * sign; +} + +typedef struct pitchdrift_s +{ + float pitchvel; + int nodrift; + float driftmove; + double laststop; +} pitchdrift_t; + +static pitchdrift_t pd; + +void V_StartPitchDrift( void ) +{ + if ( pd.laststop == gEngfuncs.GetClientTime() ) + { + return; // something else is keeping it from drifting + } + + if ( pd.nodrift || !pd.pitchvel ) + { + pd.pitchvel = v_centerspeed->value; + pd.nodrift = 0; + pd.driftmove = 0; + } +} + +void V_StopPitchDrift ( void ) +{ + pd.laststop = gEngfuncs.GetClientTime(); + pd.nodrift = 1; + pd.pitchvel = 0; +} + +/* +=============== +V_DriftPitch + +Moves the client pitch angle towards idealpitch sent by the server. + +If the user is adjusting pitch manually, either with lookup/lookdown, +mlook and mouse, or klook and keyboard, pitch drifting is constantly stopped. +=============== +*/ +void V_DriftPitch ( struct ref_params_s *pparams ) +{ + float delta, move; + + if ( gEngfuncs.IsNoClipping() || !pparams->onground || pparams->demoplayback || pparams->spectator ) + { + pd.driftmove = 0; + pd.pitchvel = 0; + return; + } + + // don't count small mouse motion + if (pd.nodrift) + { + if ( fabs( pparams->cmd->forwardmove ) < kForwardSpeed ) + pd.driftmove = 0; + else + pd.driftmove += pparams->frametime; + + if ( pd.driftmove > v_centermove->value) + { + V_StartPitchDrift (); + } + return; + } + + delta = pparams->idealpitch - pparams->cl_viewangles[PITCH]; + + if (!delta) + { + pd.pitchvel = 0; + return; + } + + move = pparams->frametime * pd.pitchvel; + pd.pitchvel += pparams->frametime * v_centerspeed->value; + +//Con_Printf ("move: %f (%f)\n", move, pparams->frametime); + + if (delta > 0) + { + if (move > delta) + { + pd.pitchvel = 0; + move = delta; + } + pparams->cl_viewangles[PITCH] += move; + } + else if (delta < 0) + { + if (move > -delta) + { + pd.pitchvel = 0; + move = -delta; + } + pparams->cl_viewangles[PITCH] -= move; + } +} + +/* +============================================================================== + VIEW RENDERING +============================================================================== +*/ + +/* +================== +V_CalcGunAngle +================== +*/ +void V_CalcGunAngle ( struct ref_params_s *pparams ) +{ + cl_entity_t *viewent; + + viewent = gEngfuncs.GetViewModel(); + if ( !viewent ) + return; + + viewent->angles[YAW] = pparams->viewangles[YAW] + pparams->crosshairangle[YAW]; + viewent->angles[PITCH] = -pparams->viewangles[PITCH] + pparams->crosshairangle[PITCH] * 0.25; + viewent->angles[ROLL] -= v_idlescale * sin(pparams->time*v_iroll_cycle.value) * v_iroll_level.value; + + // don't apply all of the v_ipitch to prevent normally unseen parts of viewmodel from coming into view. + viewent->angles[PITCH] -= v_idlescale * sin(pparams->time*v_ipitch_cycle.value) * (v_ipitch_level.value * 0.5); + viewent->angles[YAW] -= v_idlescale * sin(pparams->time*v_iyaw_cycle.value) * v_iyaw_level.value; + + VectorCopy( viewent->angles, viewent->curstate.angles ); + VectorCopy( viewent->angles, viewent->latched.prevangles ); +} + +/* +============== +V_AddIdle + +Idle swaying +============== +*/ +void V_AddIdle ( struct ref_params_s *pparams ) +{ + pparams->viewangles[ROLL] += v_idlescale * sin(pparams->time*v_iroll_cycle.value) * v_iroll_level.value; + pparams->viewangles[PITCH] += v_idlescale * sin(pparams->time*v_ipitch_cycle.value) * v_ipitch_level.value; + pparams->viewangles[YAW] += v_idlescale * sin(pparams->time*v_iyaw_cycle.value) * v_iyaw_level.value; +} + + +/* +============== +V_CalcViewRoll + +Roll is induced by movement and damage +============== +*/ +void V_CalcViewRoll ( struct ref_params_s *pparams ) +{ + float side; + cl_entity_t *viewentity; + + viewentity = gEngfuncs.GetEntityByIndex( pparams->viewentity ); + if ( !viewentity ) + return; + + side = V_CalcRoll ( viewentity->angles, pparams->simvel, pparams->movevars->rollangle, pparams->movevars->rollspeed ); + + pparams->viewangles[ROLL] += side; + + if ( pparams->health <= 0 && ( pparams->viewheight[2] != 0 ) ) + { + // only roll the view if the player is dead and the viewheight[2] is nonzero + // this is so deadcam in multiplayer will work. + pparams->viewangles[ROLL] = 80; // dead view angle + return; + } +} + + +/* +================== +V_CalcIntermissionRefdef + +================== +*/ +void V_CalcIntermissionRefdef ( struct ref_params_s *pparams ) +{ + cl_entity_t *ent, *view; + float old; + + // ent is the player model ( visible when out of body ) + ent = gEngfuncs.GetLocalPlayer(); + + // view is the weapon model (only visible from inside body ) + view = gEngfuncs.GetViewModel(); + + VectorCopy ( pparams->simorg, pparams->vieworg ); + VectorCopy ( pparams->cl_viewangles, pparams->viewangles ); + + view->model = NULL; + + // allways idle in intermission + old = v_idlescale; + v_idlescale = 1; + + V_AddIdle ( pparams ); + + if ( gEngfuncs.IsSpectateOnly() ) + { + // in HLTV we must go to 'intermission' position by ourself + VectorCopy( gHUD.m_Spectator.m_cameraOrigin, pparams->vieworg ); + VectorCopy( gHUD.m_Spectator.m_cameraAngles, pparams->viewangles ); + } + + v_idlescale = old; + + v_cl_angles = pparams->cl_viewangles; + v_origin = pparams->vieworg; + v_angles = pparams->viewangles; + v_view_ofs = pparams->viewheight; + +} + +#define ORIGIN_BACKUP 64 +#define ORIGIN_MASK ( ORIGIN_BACKUP - 1 ) + +typedef struct +{ + float Origins[ ORIGIN_BACKUP ][3]; + float OriginTime[ ORIGIN_BACKUP ]; + + float Angles[ ORIGIN_BACKUP ][3]; + float AngleTime[ ORIGIN_BACKUP ]; + + int CurrentOrigin; + int CurrentAngle; +} viewinterp_t; + +/* +================== +V_CalcRefdef + +================== +*/ +void V_CalcNormalRefdef ( struct ref_params_s *pparams ) +{ + cl_entity_t *ent, *view; + int i; + vec3_t angles; + float bob, waterOffset; + static viewinterp_t ViewInterp; + + static float oldz = 0; + static float lasttime; + + vec3_t camAngles, camForward, camRight, camUp; + cl_entity_t *pwater; + + V_DriftPitch ( pparams ); + + if ( gEngfuncs.IsSpectateOnly() ) + { + ent = gEngfuncs.GetEntityByIndex( g_iUser2 ); + } + else + { + // ent is the player model ( visible when out of body ) + ent = gEngfuncs.GetLocalPlayer(); + } + + // view is the weapon model (only visible from inside body ) + view = gEngfuncs.GetViewModel(); + + // transform the view offset by the model's matrix to get the offset from + // model origin for the view + bob = V_CalcBob ( pparams ); + + // refresh position + VectorCopy ( pparams->simorg, pparams->vieworg ); + pparams->vieworg[2] += ( bob ); + VectorAdd( pparams->vieworg, pparams->viewheight, pparams->vieworg ); + + VectorCopy ( pparams->cl_viewangles, pparams->viewangles ); + + gEngfuncs.V_CalcShake(); + gEngfuncs.V_ApplyShake( pparams->vieworg, pparams->viewangles, 1.0 ); + + // never let view origin sit exactly on a node line, because a water plane can + // dissapear when viewed with the eye exactly on it. + // FIXME, we send origin at 1/128 now, change this? + // the server protocol only specifies to 1/16 pixel, so add 1/32 in each axis + + pparams->vieworg[0] += 1.0/32; + pparams->vieworg[1] += 1.0/32; + pparams->vieworg[2] += 1.0/32; + + // Check for problems around water, move the viewer artificially if necessary + // -- this prevents drawing errors in GL due to waves + + waterOffset = 0; + if ( pparams->waterlevel >= 2 ) + { + int i, contents, waterDist, waterEntity; + vec3_t point; + waterDist = cl_waterdist->value; + + if ( pparams->hardware ) + { + waterEntity = gEngfuncs.PM_WaterEntity( pparams->simorg ); + if ( waterEntity >= 0 && waterEntity < pparams->max_entities ) + { + pwater = gEngfuncs.GetEntityByIndex( waterEntity ); + if ( pwater && ( pwater->model != NULL ) ) + { + waterDist += ( pwater->curstate.scale * 16 ); // Add in wave height + } + } + } + else + { + waterEntity = 0; // Don't need this in software + } + + VectorCopy( pparams->vieworg, point ); + + // Eyes are above water, make sure we're above the waves + if ( pparams->waterlevel == 2 ) + { + point[2] -= waterDist; + for ( i = 0; i < waterDist; i++ ) + { + contents = gEngfuncs.PM_PointContents( point, NULL ); + if ( contents > CONTENTS_WATER ) + break; + point[2] += 1; + } + waterOffset = (point[2] + waterDist) - pparams->vieworg[2]; + } + else + { + // eyes are under water. Make sure we're far enough under + point[2] += waterDist; + + for ( i = 0; i < waterDist; i++ ) + { + contents = gEngfuncs.PM_PointContents( point, NULL ); + if ( contents <= CONTENTS_WATER ) + break; + point[2] -= 1; + } + waterOffset = (point[2] - waterDist) - pparams->vieworg[2]; + } + } + + pparams->vieworg[2] += waterOffset; + + V_CalcViewRoll ( pparams ); + + V_AddIdle ( pparams ); + + // offsets + VectorCopy( pparams->cl_viewangles, angles ); + + AngleVectors ( angles, pparams->forward, pparams->right, pparams->up ); + + // don't allow cheats in multiplayer + if ( pparams->maxclients <= 1 ) + { + for ( i=0 ; i<3 ; i++ ) + { + pparams->vieworg[i] += scr_ofsx->value*pparams->forward[i] + scr_ofsy->value*pparams->right[i] + scr_ofsz->value*pparams->up[i]; + } + } + + // Treating cam_ofs[2] as the distance + if( CL_IsThirdPerson() ) + { + vec3_t ofs; + + ofs[0] = ofs[1] = ofs[2] = 0.0; + + CL_CameraOffset( (float *)&ofs ); + + VectorCopy( ofs, camAngles ); + camAngles[ ROLL ] = 0; + + AngleVectors( camAngles, camForward, camRight, camUp ); + + for ( i = 0; i < 3; i++ ) + { + pparams->vieworg[ i ] += -ofs[2] * camForward[ i ]; + } + } + + // Give gun our viewangles + VectorCopy ( pparams->cl_viewangles, view->angles ); + + // set up gun position + V_CalcGunAngle ( pparams ); + + // Use predicted origin as view origin. + VectorCopy ( pparams->simorg, view->origin ); + view->origin[2] += ( waterOffset ); + VectorAdd( view->origin, pparams->viewheight, view->origin ); + + // Let the viewmodel shake at about 10% of the amplitude + gEngfuncs.V_ApplyShake( view->origin, view->angles, 0.9 ); + + for ( i = 0; i < 3; i++ ) + { + view->origin[ i ] += bob * 0.4 * pparams->forward[ i ]; + } + view->origin[2] += bob; + + // throw in a little tilt. + view->angles[YAW] -= bob * 0.5; + view->angles[ROLL] -= bob * 1; + view->angles[PITCH] -= bob * 0.3; + + // pushing the view origin down off of the same X/Z plane as the ent's origin will give the + // gun a very nice 'shifting' effect when the player looks up/down. If there is a problem + // with view model distortion, this may be a cause. (SJB). + view->origin[2] -= 1; + + // fudge position around to keep amount of weapon visible + // roughly equal with different FOV + if (pparams->viewsize == 110) + { + view->origin[2] += 1; + } + else if (pparams->viewsize == 100) + { + view->origin[2] += 2; + } + else if (pparams->viewsize == 90) + { + view->origin[2] += 1; + } + else if (pparams->viewsize == 80) + { + view->origin[2] += 0.5; + } + + // Add in the punchangle, if any + VectorAdd ( pparams->viewangles, pparams->punchangle, pparams->viewangles ); + + // Include client side punch, too + VectorAdd ( pparams->viewangles, (float *)&ev_punchangle, pparams->viewangles); + + V_DropPunchAngle ( pparams->frametime, (float *)&ev_punchangle ); + + // smooth out stair step ups +#if 1 + if ( !pparams->smoothing && pparams->onground && pparams->simorg[2] - oldz > 0) + { + float steptime; + + steptime = pparams->time - lasttime; + if (steptime < 0) + //FIXME I_Error ("steptime < 0"); + steptime = 0; + + oldz += steptime * 150; + if (oldz > pparams->simorg[2]) + oldz = pparams->simorg[2]; + if (pparams->simorg[2] - oldz > 18) + oldz = pparams->simorg[2]- 18; + pparams->vieworg[2] += oldz - pparams->simorg[2]; + view->origin[2] += oldz - pparams->simorg[2]; + } + else + { + oldz = pparams->simorg[2]; + } +#endif + + { + static float lastorg[3]; + vec3_t delta; + + VectorSubtract( pparams->simorg, lastorg, delta ); + + if ( Length( delta ) != 0.0 ) + { + VectorCopy( pparams->simorg, ViewInterp.Origins[ ViewInterp.CurrentOrigin & ORIGIN_MASK ] ); + ViewInterp.OriginTime[ ViewInterp.CurrentOrigin & ORIGIN_MASK ] = pparams->time; + ViewInterp.CurrentOrigin++; + + VectorCopy( pparams->simorg, lastorg ); + } + } + + // Smooth out whole view in multiplayer when on trains, lifts + if ( cl_vsmoothing && cl_vsmoothing->value && + ( pparams->smoothing && ( pparams->maxclients > 1 ) ) ) + { + int foundidx; + int i; + float t; + + if ( cl_vsmoothing->value < 0.0 ) + { + gEngfuncs.Cvar_SetValue( "cl_vsmoothing", 0.0 ); + } + + t = pparams->time - cl_vsmoothing->value; + + for ( i = 1; i < ORIGIN_MASK; i++ ) + { + foundidx = ViewInterp.CurrentOrigin - 1 - i; + if ( ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ] <= t ) + break; + } + + if ( i < ORIGIN_MASK && ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ] != 0.0 ) + { + // Interpolate + vec3_t delta; + double frac; + double dt; + vec3_t neworg; + + dt = ViewInterp.OriginTime[ (foundidx + 1) & ORIGIN_MASK ] - ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ]; + if ( dt > 0.0 ) + { + frac = ( t - ViewInterp.OriginTime[ foundidx & ORIGIN_MASK] ) / dt; + frac = min( 1.0, frac ); + VectorSubtract( ViewInterp.Origins[ ( foundidx + 1 ) & ORIGIN_MASK ], ViewInterp.Origins[ foundidx & ORIGIN_MASK ], delta ); + VectorMA( ViewInterp.Origins[ foundidx & ORIGIN_MASK ], frac, delta, neworg ); + + // Dont interpolate large changes + if ( Length( delta ) < 64 ) + { + VectorSubtract( neworg, pparams->simorg, delta ); + + VectorAdd( pparams->simorg, delta, pparams->simorg ); + VectorAdd( pparams->vieworg, delta, pparams->vieworg ); + VectorAdd( view->origin, delta, view->origin ); + + } + } + } + } + + // Store off v_angles before munging for third person + v_angles = pparams->viewangles; + v_lastAngles = pparams->viewangles; +// v_cl_angles = pparams->cl_viewangles; // keep old user mouse angles ! + if ( CL_IsThirdPerson() ) + { + VectorCopy( camAngles, pparams->viewangles); + float pitch = camAngles[ 0 ]; + + // Normalize angles + if ( pitch > 180 ) + pitch -= 360.0; + else if ( pitch < -180 ) + pitch += 360; + + // Player pitch is inverted + pitch /= -3.0; + + // Slam local player's pitch value + ent->angles[ 0 ] = pitch; + ent->curstate.angles[ 0 ] = pitch; + ent->prevstate.angles[ 0 ] = pitch; + ent->latched.prevangles[ 0 ] = pitch; + } + + // override all previous settings if the viewent isn't the client + if ( pparams->viewentity > pparams->maxclients ) + { + cl_entity_t *viewentity; + viewentity = gEngfuncs.GetEntityByIndex( pparams->viewentity ); + if ( viewentity ) + { + VectorCopy( viewentity->origin, pparams->vieworg ); + VectorCopy( viewentity->angles, pparams->viewangles ); + + // Store off overridden viewangles + v_angles = pparams->viewangles; + } + } + + lasttime = pparams->time; + + v_origin = pparams->vieworg; + v_view_ofs = pparams->viewheight; + +} + +/* +================== +V_CalcTopDownRefdef + +================== +*/ +void V_CalcTopDownRefdef ( struct ref_params_s *pparams ) +{ + cl_entity_t *ent, *view; + int i; + vec3_t angles; + //float waterOffset; + static viewinterp_t ViewInterp; + + static float oldz = 0; + static float lasttime; + + vec3_t camAngles, camForward, camRight, camUp; + //cl_entity_t *pwater; + + V_DriftPitch ( pparams ); + + if ( gEngfuncs.IsSpectateOnly() ) + { + ent = gEngfuncs.GetEntityByIndex( g_iUser2 ); + } + else + { + // ent is the player model ( visible when out of body ) + ent = gEngfuncs.GetLocalPlayer(); + } + + // view is the weapon model (only visible from inside body ) + view = gEngfuncs.GetViewModel(); + + // Override topdown position and angles from physics code + VectorCopy( gTopDownViewOrigin, pparams->vieworg ); + VectorCopy( gTopDownViewOrigin, pparams->simorg ); + + VectorCopy( gTopDownViewAngles, pparams->cl_viewangles ); + VectorCopy( gTopDownViewAngles, pparams->viewangles ); + + gEngfuncs.V_CalcShake(); + gEngfuncs.V_ApplyShake( pparams->vieworg, pparams->viewangles, 1.0 ); + +// // never let view origin sit exactly on a node line, because a water plane can +// // dissapear when viewed with the eye exactly on it. +// // FIXME, we send origin at 1/128 now, change this? +// // the server protocol only specifies to 1/16 pixel, so add 1/32 in each axis +// +// pparams->vieworg[0] += 1.0/32; +// pparams->vieworg[1] += 1.0/32; +// pparams->vieworg[2] += 1.0/32; +// +// // Check for problems around water, move the viewer artificially if necessary +// // -- this prevents drawing errors in GL due to waves +// +// waterOffset = 0; +// if ( pparams->waterlevel >= 2 ) +// { +// int i, contents, waterDist, waterEntity; +// vec3_t point; +// waterDist = cl_waterdist->value; +// +// if ( pparams->hardware ) +// { +// waterEntity = gEngfuncs.PM_WaterEntity( pparams->simorg ); +// if ( waterEntity >= 0 && waterEntity < pparams->max_entities ) +// { +// pwater = gEngfuncs.GetEntityByIndex( waterEntity ); +// if ( pwater && ( pwater->model != NULL ) ) +// { +// waterDist += ( pwater->curstate.scale * 16 ); // Add in wave height +// } +// } +// } +// else +// { +// waterEntity = 0; // Don't need this in software +// } +// +// VectorCopy( pparams->vieworg, point ); +// +// // Eyes are above water, make sure we're above the waves +// if ( pparams->waterlevel == 2 ) +// { +// point[2] -= waterDist; +// for ( i = 0; i < waterDist; i++ ) +// { +// contents = gEngfuncs.PM_PointContents( point, NULL ); +// if ( contents > CONTENTS_WATER ) +// break; +// point[2] += 1; +// } +// waterOffset = (point[2] + waterDist) - pparams->vieworg[2]; +// } +// else +// { +// // eyes are under water. Make sure we're far enough under +// point[2] += waterDist; +// +// for ( i = 0; i < waterDist; i++ ) +// { +// contents = gEngfuncs.PM_PointContents( point, NULL ); +// if ( contents <= CONTENTS_WATER ) +// break; +// point[2] -= 1; +// } +// waterOffset = (point[2] - waterDist) - pparams->vieworg[2]; +// } +// } +// +// pparams->vieworg[2] += waterOffset; + + V_CalcViewRoll ( pparams ); + + //V_AddIdle ( pparams ); + + // offsets + VectorCopy( pparams->cl_viewangles, angles ); + + AngleVectors ( angles, pparams->forward, pparams->right, pparams->up ); + + // don't allow cheats in multiplayer + if ( pparams->maxclients <= 1 ) + { + for ( i=0 ; i<3 ; i++ ) + { + pparams->vieworg[i] += scr_ofsx->value*pparams->forward[i] + scr_ofsy->value*pparams->right[i] + scr_ofsz->value*pparams->up[i]; + } + } + + // Treating cam_ofs[2] as the distance +// if( CL_IsThirdPerson() ) +// { +// vec3_t ofs; +// +// ofs[0] = ofs[1] = ofs[2] = 0.0; +// +// CL_CameraOffset( (float *)&ofs ); +// +// VectorCopy( ofs, camAngles ); +// camAngles[ ROLL ] = 0; +// +// AngleVectors( camAngles, camForward, camRight, camUp ); +// +// for ( i = 0; i < 3; i++ ) +// { +// pparams->vieworg[ i ] += -ofs[2] * camForward[ i ]; +// } +// } + + // Give gun our viewangles +// VectorCopy ( pparams->cl_viewangles, view->angles ); + + // set up gun position +// V_CalcGunAngle ( pparams ); + + // Use predicted origin as view origin. +// VectorCopy ( pparams->simorg, view->origin ); +//// view->origin[2] += ( waterOffset ); +// VectorAdd( view->origin, pparams->viewheight, view->origin ); + + // Let the viewmodel shake at about 10% of the amplitude +// gEngfuncs.V_ApplyShake( view->origin, view->angles, 0.9 ); + +// for ( i = 0; i < 3; i++ ) +// { +// view->origin[ i ] += bob * 0.4 * pparams->forward[ i ]; +// } +// view->origin[2] += bob; +// +// // throw in a little tilt. +// view->angles[YAW] -= bob * 0.5; +// view->angles[ROLL] -= bob * 1; +// view->angles[PITCH] -= bob * 0.3; +// +// // pushing the view origin down off of the same X/Z plane as the ent's origin will give the +// // gun a very nice 'shifting' effect when the player looks up/down. If there is a problem +// // with view model distortion, this may be a cause. (SJB). +// view->origin[2] -= 1; +// +// // fudge position around to keep amount of weapon visible +// // roughly equal with different FOV +// if (pparams->viewsize == 110) +// { +// view->origin[2] += 1; +// } +// else if (pparams->viewsize == 100) +// { +// view->origin[2] += 2; +// } +// else if (pparams->viewsize == 90) +// { +// view->origin[2] += 1; +// } +// else if (pparams->viewsize == 80) +// { +// view->origin[2] += 0.5; +// } + + // Add in the punchangle, if any +// VectorAdd ( pparams->viewangles, pparams->punchangle, pparams->viewangles ); +// +// // Include client side punch, too +//// VectorAdd ( pparams->viewangles, (float *)&ev_punchangle, pparams->viewangles); +// +// V_DropPunchAngle ( pparams->frametime, (float *)&ev_punchangle ); + + // smooth out stair step ups +#if 1 + if ( !pparams->smoothing && pparams->onground && pparams->simorg[2] - oldz > 0) + { + float steptime; + + steptime = pparams->time - lasttime; + if (steptime < 0) + //FIXME I_Error ("steptime < 0"); + steptime = 0; + + oldz += steptime * 150; + if (oldz > pparams->simorg[2]) + oldz = pparams->simorg[2]; + if (pparams->simorg[2] - oldz > 18) + oldz = pparams->simorg[2]- 18; + pparams->vieworg[2] += oldz - pparams->simorg[2]; + view->origin[2] += oldz - pparams->simorg[2]; + } + else + { + oldz = pparams->simorg[2]; + } +#endif + + { + static float lastorg[3]; + vec3_t delta; + + VectorSubtract( pparams->simorg, lastorg, delta ); + + if ( Length( delta ) != 0.0 ) + { + VectorCopy( pparams->simorg, ViewInterp.Origins[ ViewInterp.CurrentOrigin & ORIGIN_MASK ] ); + ViewInterp.OriginTime[ ViewInterp.CurrentOrigin & ORIGIN_MASK ] = pparams->time; + ViewInterp.CurrentOrigin++; + + VectorCopy( pparams->simorg, lastorg ); + } + } + + // Smooth out whole view in multiplayer when on trains, lifts + if ( cl_vsmoothing && cl_vsmoothing->value && + ( pparams->smoothing && ( pparams->maxclients > 1 ) ) ) + { + int foundidx; + int i; + float t; + + if ( cl_vsmoothing->value < 0.0 ) + { + gEngfuncs.Cvar_SetValue( "cl_vsmoothing", 0.0 ); + } + + t = pparams->time - cl_vsmoothing->value; + + for ( i = 1; i < ORIGIN_MASK; i++ ) + { + foundidx = ViewInterp.CurrentOrigin - 1 - i; + if ( ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ] <= t ) + break; + } + + if ( i < ORIGIN_MASK && ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ] != 0.0 ) + { + // Interpolate + vec3_t delta; + double frac; + double dt; + vec3_t neworg; + + dt = ViewInterp.OriginTime[ (foundidx + 1) & ORIGIN_MASK ] - ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ]; + if ( dt > 0.0 ) + { + frac = ( t - ViewInterp.OriginTime[ foundidx & ORIGIN_MASK] ) / dt; + frac = min( 1.0, frac ); + VectorSubtract( ViewInterp.Origins[ ( foundidx + 1 ) & ORIGIN_MASK ], ViewInterp.Origins[ foundidx & ORIGIN_MASK ], delta ); + VectorMA( ViewInterp.Origins[ foundidx & ORIGIN_MASK ], frac, delta, neworg ); + + // Dont interpolate large changes + if ( Length( delta ) < 64 ) + { + VectorSubtract( neworg, pparams->simorg, delta ); + + VectorAdd( pparams->simorg, delta, pparams->simorg ); + VectorAdd( pparams->vieworg, delta, pparams->vieworg ); + VectorAdd( view->origin, delta, view->origin ); + + //VectorCopy( pparams->simorg, gTopDownViewOrigin ); + } + } + } + } + + // Store off v_angles before munging for third person + v_angles = pparams->viewangles; + v_lastAngles = pparams->viewangles; +// v_cl_angles = pparams->cl_viewangles; // keep old user mouse angles ! +// if ( CL_IsThirdPerson() ) +// { +// VectorCopy( camAngles, pparams->viewangles); +// float pitch = camAngles[ 0 ]; +// +// // Normalize angles +// if ( pitch > 180 ) +// pitch -= 360.0; +// else if ( pitch < -180 ) +// pitch += 360; +// +// // Player pitch is inverted +// pitch /= -3.0; +// +// // Slam local player's pitch value +// ent->angles[ 0 ] = pitch; +// ent->curstate.angles[ 0 ] = pitch; +// ent->prevstate.angles[ 0 ] = pitch; +// ent->latched.prevangles[ 0 ] = pitch; +// } + +// // override all previous settings if the viewent isn't the client +// if ( pparams->viewentity > pparams->maxclients ) +// { +// cl_entity_t *viewentity; +// viewentity = gEngfuncs.GetEntityByIndex( pparams->viewentity ); +// if ( viewentity ) +// { +// VectorCopy( viewentity->origin, pparams->vieworg ); +// VectorCopy( viewentity->angles, pparams->viewangles ); +// +// // Store off overridden viewangles +// v_angles = pparams->viewangles; +// } +// } + + lasttime = pparams->time; + + v_origin = pparams->vieworg; + v_view_ofs = pparams->viewheight; + +} + +void V_SmoothInterpolateAngles( float * startAngle, float * endAngle, float * finalAngle, float degreesPerSec ) +{ + float absd,frac,d,threshhold; + + NormalizeAngles( startAngle ); + NormalizeAngles( endAngle ); + + for ( int i = 0 ; i < 3 ; i++ ) + { + d = endAngle[i] - startAngle[i]; + + if ( d > 180.0f ) + { + d -= 360.0f; + } + else if ( d < -180.0f ) + { + d += 360.0f; + } + + absd = fabs(d); + + if ( absd > 0.01f ) + { + frac = degreesPerSec * v_frametime; + + threshhold= degreesPerSec / 4; + + if ( absd < threshhold ) + { + float h = absd / threshhold; + h *= h; + frac*= h; // slow down last degrees + } + + if ( frac > absd ) + { + finalAngle[i] = endAngle[i]; + } + else + { + if ( d>0) + finalAngle[i] = startAngle[i] + frac; + else + finalAngle[i] = startAngle[i] - frac; + } + } + else + { + finalAngle[i] = endAngle[i]; + } + + } + + NormalizeAngles( finalAngle ); +} + +// Get the origin of the Observer based around the target's position and angles +void V_GetChaseOrigin( float * angles, float * origin, float distance, float * returnvec ) +{ + vec3_t vecEnd; + vec3_t forward; + vec3_t vecStart; + pmtrace_t * trace; + int maxLoops = 8; + + int ignoreent = -1; // first, ignore no entity + + cl_entity_t * ent = NULL; + + // Trace back from the target using the player's view angles + AngleVectors(angles, forward, NULL, NULL); + + VectorScale(forward,-1,forward); + + VectorCopy( origin, vecStart ); + + VectorMA(vecStart, distance , forward, vecEnd); + + while ( maxLoops > 0) + { + trace = gEngfuncs.PM_TraceLine( vecStart, vecEnd, PM_TRACELINE_PHYSENTSONLY, 2, ignoreent ); + + // WARNING! trace->ent is is the number in physent list not the normal entity number + + if ( trace->ent <= 0) + break; // we hit the world or nothing, stop trace + + ent = gEngfuncs.GetEntityByIndex( PM_GetPhysEntInfo( trace->ent ) ); + + if ( ent == NULL ) + break; + + // hit non-player solid BSP , stop here + if ( ent->curstate.solid == SOLID_BSP && !ent->player ) + break; + + // if close enought to end pos, stop, otherwise continue trace + if( VectorDistance(trace->endpos, vecEnd ) < 1.0f ) + { + break; + } + else + { + ignoreent = trace->ent; // ignore last hit entity + VectorCopy( trace->endpos, vecStart); + } + + maxLoops--; + } + +/* if ( ent ) + { + gEngfuncs.Con_Printf("Trace loops %i , entity %i, model %s, solid %i\n",(8-maxLoops),ent->curstate.number, ent->model->name , ent->curstate.solid ); + } */ + + VectorMA( trace->endpos, 4, trace->plane.normal, returnvec ); + + v_lastDistance = VectorDistance(trace->endpos, origin); // real distance without offset +} + +/*void V_GetDeathCam(cl_entity_t * ent1, cl_entity_t * ent2, float * angle, float * origin) +{ + float newAngle[3]; float newOrigin[3]; + + float distance = 168.0f; + + v_lastDistance+= v_frametime * 96.0f; // move unit per seconds back + + if ( v_resetCamera ) + v_lastDistance = 64.0f; + + if ( distance > v_lastDistance ) + distance = v_lastDistance; + + VectorCopy(ent1->origin, newOrigin); + + if ( ent1->player ) + newOrigin[2]+= 17; // head level of living player + + // get new angle towards second target + if ( ent2 ) + { + VectorSubtract( ent2->origin, ent1->origin, newAngle ); + VectorAngles( newAngle, newAngle ); + newAngle[0] = -newAngle[0]; + } + else + { + // if no second target is given, look down to dead player + newAngle[0] = 90.0f; + newAngle[1] = 0.0f; + newAngle[2] = 0; + } + + // and smooth view + V_SmoothInterpolateAngles( v_lastAngles, newAngle, angle, 120.0f ); + + V_GetChaseOrigin( angle, newOrigin, distance, origin ); + + VectorCopy(angle, v_lastAngles); +}*/ + +void V_GetSingleTargetCam(cl_entity_t * ent1, float * angle, float * origin) +{ + float newAngle[3]; float newOrigin[3]; + + int flags = gHUD.m_Spectator.m_iObserverFlags; + + // see is target is a dead player + qboolean deadPlayer = ent1->player && (ent1->curstate.solid == SOLID_NOT); + + float dfactor = ( flags & DRC_FLAG_DRAMATIC )? -1.0f : 1.0f; + + float distance = 112.0f + ( 16.0f * dfactor ); // get close if dramatic; + + // go away in final scenes or if player just died + if ( flags & DRC_FLAG_FINAL ) + distance*=2.0f; + else if ( deadPlayer ) + distance*=1.5f; + + // let v_lastDistance float smoothly away + v_lastDistance+= v_frametime * 32.0f; // move unit per seconds back + + if ( distance > v_lastDistance ) + distance = v_lastDistance; + + VectorCopy(ent1->origin, newOrigin); + + if ( ent1->player ) + { + if ( deadPlayer ) + newOrigin[2]+= 2; //laying on ground + else + newOrigin[2]+= 17; // head level of living player + + } + else + newOrigin[2]+= 8; // object, tricky, must be above bomb in CS + + // we have no second target, choose view direction based on + // show front of primary target + VectorCopy(ent1->angles, newAngle); + + // show dead players from front, normal players back + if ( flags & DRC_FLAG_FACEPLAYER ) + newAngle[1]+= 180.0f; + + + newAngle[0]+= 12.5f * dfactor; // lower angle if dramatic + + // if final scene (bomb), show from real high pos + if ( flags & DRC_FLAG_FINAL ) + newAngle[0] = 22.5f; + + // choose side of object/player + if ( flags & DRC_FLAG_SIDE ) + newAngle[1]+=22.5f; + else + newAngle[1]-=22.5f; + + V_SmoothInterpolateAngles( v_lastAngles, newAngle, angle, 120.0f ); + + // HACK, if player is dead don't clip against his dead body, can't check this + V_GetChaseOrigin( angle, newOrigin, distance, origin ); +} + +float MaxAngleBetweenAngles( float * a1, float * a2 ) +{ + float d, maxd = 0.0f; + + NormalizeAngles( a1 ); + NormalizeAngles( a2 ); + + for ( int i = 0 ; i < 3 ; i++ ) + { + d = a2[i] - a1[i]; + if ( d > 180 ) + { + d -= 360; + } + else if ( d < -180 ) + { + d += 360; + } + + d = fabs(d); + + if ( d > maxd ) + maxd=d; + } + + return maxd; +} + +void V_GetDoubleTargetsCam(cl_entity_t * ent1, cl_entity_t * ent2,float * angle, float * origin) +{ + float newAngle[3]; float newOrigin[3]; float tempVec[3]; + + int flags = gHUD.m_Spectator.m_iObserverFlags; + + float dfactor = ( flags & DRC_FLAG_DRAMATIC )? -1.0f : 1.0f; + + float distance = 112.0f + ( 16.0f * dfactor ); // get close if dramatic; + + // go away in final scenes or if player just died + if ( flags & DRC_FLAG_FINAL ) + distance*=2.0f; + + // let v_lastDistance float smoothly away + v_lastDistance+= v_frametime * 32.0f; // move unit per seconds back + + if ( distance > v_lastDistance ) + distance = v_lastDistance; + + VectorCopy(ent1->origin, newOrigin); + + if ( ent1->player ) + newOrigin[2]+= 17; // head level of living player + else + newOrigin[2]+= 8; // object, tricky, must be above bomb in CS + + // get new angle towards second target + VectorSubtract( ent2->origin, ent1->origin, newAngle ); + + VectorAngles( newAngle, newAngle ); + newAngle[0] = -newAngle[0]; + + // set angle diffrent in Dramtaic scenes + newAngle[0]+= 12.5f * dfactor; // lower angle if dramatic + + if ( flags & DRC_FLAG_SIDE ) + newAngle[1]+=22.5f; + else + newAngle[1]-=22.5f; + + float d = MaxAngleBetweenAngles( v_lastAngles, newAngle ); + + if ( ( d < v_cameraFocusAngle) && ( v_cameraMode == CAM_MODE_RELAX ) ) + { + // difference is to small and we are in relax camera mode, keep viewangles + VectorCopy(v_lastAngles, newAngle ); + } + else if ( (d < v_cameraRelaxAngle) && (v_cameraMode == CAM_MODE_FOCUS) ) + { + // we catched up with our target, relax again + v_cameraMode = CAM_MODE_RELAX; + } + else + { + // target move too far away, focus camera again + v_cameraMode = CAM_MODE_FOCUS; + } + + // and smooth view, if not a scene cut + if ( v_resetCamera || (v_cameraMode == CAM_MODE_RELAX) ) + { + VectorCopy( newAngle, angle ); + } + else + { + V_SmoothInterpolateAngles( v_lastAngles, newAngle, angle, 180.0f ); + } + + V_GetChaseOrigin( newAngle, newOrigin, distance, origin ); + + // move position up, if very close at target + if ( v_lastDistance < 64.0f ) + origin[2]+= 16.0f*( 1.0f - (v_lastDistance / 64.0f ) ); + + // calculate angle to second target + VectorSubtract( ent2->origin, origin, tempVec ); + VectorAngles( tempVec, tempVec ); + tempVec[0] = -tempVec[0]; + + /* take middle between two viewangles + InterpolateAngles( newAngle, tempVec, newAngle, 0.5f); */ +} + + +void V_GetDirectedChasePosition(cl_entity_t * ent1, cl_entity_t * ent2,float * angle, float * origin) +{ + + if ( v_resetCamera ) + { + v_lastDistance = 4096.0f; + // v_cameraMode = CAM_MODE_FOCUS; + } + + if ( ( ent2 == (cl_entity_t*)0xFFFFFFFF ) || ( ent1->player && (ent1->curstate.solid == SOLID_NOT) ) ) + { + // we have no second target or player just died + V_GetSingleTargetCam(ent1, angle, origin); + } + else if ( ent2 ) + { + // keep both target in view + V_GetDoubleTargetsCam( ent1, ent2, angle, origin ); + } + else + { + // second target disappeard somehow (dead) + + // keep last good viewangle + float newOrigin[3]; + + int flags = gHUD.m_Spectator.m_iObserverFlags; + + float dfactor = ( flags & DRC_FLAG_DRAMATIC )? -1.0f : 1.0f; + + float distance = 112.0f + ( 16.0f * dfactor ); // get close if dramatic; + + // go away in final scenes or if player just died + if ( flags & DRC_FLAG_FINAL ) + distance*=2.0f; + + // let v_lastDistance float smoothly away + v_lastDistance+= v_frametime * 32.0f; // move unit per seconds back + + if ( distance > v_lastDistance ) + distance = v_lastDistance; + + VectorCopy(ent1->origin, newOrigin); + + if ( ent1->player ) + newOrigin[2]+= 17; // head level of living player + else + newOrigin[2]+= 8; // object, tricky, must be above bomb in CS + + V_GetChaseOrigin( angle, newOrigin, distance, origin ); + } + + VectorCopy(angle, v_lastAngles); +} + +void V_GetChasePos(int target, float * cl_angles, float * origin, float * angles) +{ + cl_entity_t * ent = NULL; + + if ( target ) + { + ent = gEngfuncs.GetEntityByIndex( target ); + }; + + if (!ent) + { + // just copy a save in-map position + VectorCopy ( vJumpAngles, angles ); + VectorCopy ( vJumpOrigin, origin ); + return; + } + + + + if ( gHUD.m_Spectator.m_autoDirector->value ) + { + if ( g_iUser3 ) + V_GetDirectedChasePosition( ent, gEngfuncs.GetEntityByIndex( g_iUser3 ), + angles, origin ); + else + V_GetDirectedChasePosition( ent, ( cl_entity_t*)0xFFFFFFFF, + angles, origin ); + } + else + { + if ( cl_angles == NULL ) // no mouse angles given, use entity angles ( locked mode ) + { + VectorCopy ( ent->angles, angles); + angles[0]*=-1; + } + else + VectorCopy ( cl_angles, angles); + + + VectorCopy ( ent->origin, origin); + + origin[2]+= 28; // DEFAULT_VIEWHEIGHT - some offset + + V_GetChaseOrigin( angles, origin, cl_chasedist->value, origin ); + } + + v_resetCamera = false; +} + +void V_ResetChaseCam() +{ + v_resetCamera = true; +} + +void V_GetInEyePos(int entity, float *origin, float * angles ) +{ + cl_entity_t * ent = gEngfuncs.GetEntityByIndex( entity ); + + if ( !ent ) + return; + + if ( !ent->player || g_PlayerInfoList[entity].name == NULL ) + return; + + VectorCopy ( ent->origin, origin ); + VectorCopy ( ent->angles, angles ); + + angles[0]*=-M_PI; + + if ( ent->curstate.solid == SOLID_NOT ) + { + angles[ROLL] = 80; // dead view angle + origin[2]+= -8 ; // PM_DEAD_VIEWHEIGHT + } + else if (ent->curstate.usehull == 1 ) + origin[2]+= 12; // VEC_DUCK_VIEW; + else + // exacty eye position can't be caluculated since it depends on + // client values like cl_bobcycle, this offset matches the default values + origin[2]+= 28; // DEFAULT_VIEWHEIGHT +} + +void V_GetMapFreePosition( float * cl_angles, float * origin, float * angles ) +{ + vec3_t forward; + vec3_t zScaledTarget; + + VectorCopy(cl_angles, angles); + + // modify angles since we don't wanna see map's bottom + angles[0] = 51.25f + 38.75f*(angles[0]/90.0f); + + zScaledTarget[0] = gHUD.m_Spectator.m_mapOrigin[0]; + zScaledTarget[1] = gHUD.m_Spectator.m_mapOrigin[1]; + zScaledTarget[2] = gHUD.m_Spectator.m_mapOrigin[2] * (( 90.0f - angles[0] ) / 90.0f ); + + + AngleVectors(angles, forward, NULL, NULL); + + VectorNormalize(forward); + + VectorMA(zScaledTarget, -( 4096.0f / gHUD.m_Spectator.m_mapZoom ), forward , origin); +} + +void V_GetMapChasePosition(int target, float * cl_angles, float * origin, float * angles) +{ + vec3_t forward; + + if ( target ) + { + cl_entity_t * ent = gEngfuncs.GetEntityByIndex( target ); + + if ( gHUD.m_Spectator.m_autoDirector->value ) + { + // this is done to get the angles made by director mode + V_GetChasePos(target, cl_angles, origin, angles); + VectorCopy(ent->origin, origin); + + // keep fix chase angle horizontal + angles[0] = 45.0f; + } + else + { + VectorCopy(cl_angles, angles); + VectorCopy(ent->origin, origin); + + // modify angles since we don't wanna see map's bottom + angles[0] = 51.25f + 38.75f*(angles[0]/90.0f); + } + } + else + { + // keep out roaming position, but modify angles + VectorCopy(cl_angles, angles); + angles[0] = 51.25f + 38.75f*(angles[0]/90.0f); + } + + origin[2] *= (( 90.0f - angles[0] ) / 90.0f ); + angles[2] = 0.0f; // don't roll angle (if chased player is dead) + + AngleVectors(angles, forward, NULL, NULL); + + VectorNormalize(forward); + + VectorMA(origin, -1536, forward, origin); +} + +void V_GetMiniMapOriginAndAngle(float * cl_angles, float * origin, float * angles) +{ + // Center map on local player + VectorCopy(gEngfuncs.GetLocalPlayer()->curstate.origin, origin); + //v_origin.z += 300; + + //// Set view height above parsed map settings + origin[2] = gHUD.m_Spectator.m_OverviewData.origin.z + 100; + + //if(gHUD.m_Spectator.m_OverviewData.layers > 0) + //{ + // v_origin.z = gHUD.m_Spectator.m_OverviewData.layersHeights[0]; + //} + // + //v_origin.z += 300; + + //V_GetMapChasePosition(gEngfuncs.GetLocalPlayer()->index, v_cl_angles, v_origin, v_angles ); + + // Set view like top down + cl_angles[0] = angles[0] = 90;//kTopDownYaw; + cl_angles[1] = angles[1] = 90;//kTopDownPitch; + cl_angles[2] = angles[2] = 0;//kTopDownRoll; +} + +int V_FindViewModelByWeaponModel(int weaponindex, int inUser3, int inUser4) +{ + int theViewModelIndex = 0; + + static char * modelmap[][2] = { + { kKNPModel, kKNVModel }, + { kHGPModel, kHGVModel }, + { kMGPModel, kMGVModel }, + { kSGPModel, kSGVModel }, + { kHMGPModel, kHMGVModel }, + { kGGPModel, kGGVModel }, + { kTripminePModel, kTripmineVModel }, + { kWelderPModel, kWelderVModel }, + { NULL, NULL } + }; + + static char * hvymodelmap[][2] = { + { kKNPModel, kKNHVVModel }, + { kHGPModel, kHGHVVModel }, + { kMGPModel, kMGHVVModel }, + { kSGPModel, kSGHVVModel }, + { kHMGPModel, kHMGHVVModel }, + { kGGPModel, kGGHVVModel }, + { kTripminePModel, kTripmineHVVModel }, + { kWelderPModel, kWelderHVVModel }, + { NULL, NULL } + }; + + struct model_s * weaponModel = NULL; + + // If we're an alien, get view model that way + if((inUser3 == AVH_USER3_ALIEN_PLAYER1) || (inUser3 == AVH_USER3_ALIEN_PLAYER2) || (inUser3 == AVH_USER3_ALIEN_PLAYER3) || (inUser3 == AVH_USER3_ALIEN_PLAYER4) || (inUser3 == AVH_USER3_ALIEN_PLAYER5)) + { + const char* theViewModel = ""; + switch(inUser3) + { + case AVH_USER3_ALIEN_PLAYER1: + theViewModel = kLevel1ViewModel; + break; + case AVH_USER3_ALIEN_PLAYER2: + theViewModel = kLevel2ViewModel; + break; + case AVH_USER3_ALIEN_PLAYER3: + theViewModel = kLevel3ViewModel; + break; + case AVH_USER3_ALIEN_PLAYER4: + theViewModel = kLevel4ViewModel; + break; + case AVH_USER3_ALIEN_PLAYER5: + theViewModel = kLevel5ViewModel; + break; + } + + theViewModelIndex = gEngfuncs.pEventAPI->EV_FindModelIndex(theViewModel); + } + // else we're holding a weapon + else + { + // Take user3 and user4 into account for heavy armor + if(inUser3 == AVH_USER3_MARINE_PLAYER) + { + weaponModel = IEngineStudio.GetModelByIndex( weaponindex ); + + if ( weaponModel ) + { + //int len = strlen( weaponModel->name ); + int i = 0; + + if(GetHasUpgrade(inUser4, MASK_UPGRADE_13)) + { + while ( *hvymodelmap[i] != NULL ) + { + const char* theCurrentPWeapon = hvymodelmap[i][0]; + const char* theCurrentVWeapon = hvymodelmap[i][1]; + + if ( !SafeStrcmp( weaponModel->name, theCurrentPWeapon) ) + { + theViewModelIndex = gEngfuncs.pEventAPI->EV_FindModelIndex( theCurrentVWeapon ); + } + i++; + } + } + else + { + while ( *modelmap[i] != NULL ) + { + const char* theCurrentPWeapon = modelmap[i][0]; + const char* theCurrentVWeapon = modelmap[i][1]; + + if ( !SafeStrcmp( weaponModel->name, theCurrentPWeapon) ) + { + theViewModelIndex = gEngfuncs.pEventAPI->EV_FindModelIndex( theCurrentVWeapon ); + } + i++; + } + } + } + } + } + + return theViewModelIndex; +} + +/* +================== +V_CalcSpectatorRefdef + +================== +*/ + +static int lastWeaponModelIndex = 0; +static int lastViewModelIndex = 0; + +void V_CalcSpectatorRefdef ( struct ref_params_s * pparams ) +{ + + vec3_t angles; + static viewinterp_t ViewInterp; + static float bob = 0.0f; + static vec3_t velocity ( 0.0f, 0.0f, 0.0f); + + static float lasttime; + + static float lastang[3]; + static float lastorg[3]; + + vec3_t delta; + pparams->onlyClientDraw = false; + + // refresh position + VectorCopy ( pparams->simorg, v_sim_org ); + + // get old values + VectorCopy ( pparams->cl_viewangles, v_cl_angles ); + VectorCopy ( pparams->viewangles, v_angles ); + VectorCopy ( pparams->vieworg, v_origin ); + VectorCopy ( pparams->viewheight, v_view_ofs); + + v_frametime = pparams->frametime; + + if ( pparams->nextView == 0 ) + { + // first renderer cycle, full screen + + if (!gHUD.m_Spectator.IsInOverviewMode()) + { + + switch ( g_iUser1 ) + { + case OBS_CHASE_LOCKED: V_GetChasePos( g_iUser2, NULL, v_origin, v_angles ); + break; + + case OBS_CHASE_FREE: V_GetChasePos( g_iUser2, v_cl_angles, v_origin, v_angles ); + break; + + case OBS_ROAMING : VectorCopy (v_cl_angles, v_angles); + VectorCopy (v_sim_org, v_origin); + break; + + case OBS_IN_EYE : V_GetInEyePos( g_iUser2, v_origin, v_angles ); + break; + + } + + } + else + { + pparams->onlyClientDraw = true; + V_GetMapFreePosition( v_cl_angles, v_origin, v_angles ); + } + + + // Removed by mmcguire. + /* + switch ( g_iUser1 ) + { + case OBS_CHASE_LOCKED: V_GetChasePos( g_iUser2, NULL, v_origin, v_angles ); + break; + + case OBS_CHASE_FREE: V_GetChasePos( g_iUser2, v_cl_angles, v_origin, v_angles ); + break; + + case OBS_ROAMING : VectorCopy (v_cl_angles, v_angles); + VectorCopy (v_sim_org, v_origin); + break; + + case OBS_IN_EYE : V_GetInEyePos( g_iUser2, v_origin, v_angles ); + break; + + case OBS_MAP_FREE : pparams->onlyClientDraw = true; + V_GetMapFreePosition( v_cl_angles, v_origin, v_angles ); + break; + + case OBS_MAP_CHASE : pparams->onlyClientDraw = true; + V_GetMapChasePosition( g_iUser2, v_cl_angles, v_origin, v_angles ); + break; + } + */ + + if (g_iUser1) + { + + // Adjust the viewport so that the letterbox spectator mode + // doesn't cut anything off. + + pparams->viewport[1] += YRES(32); + pparams->viewport[3] -= YRES(32 * 2); + + } + + if ( gHUD.m_Spectator.IsInOverviewMode()) + { + pparams->nextView = 1; // force a second renderer view + } + + gHUD.m_Spectator.m_iDrawCycle = 0; + + } + else + { + // second renderer cycle, inset window + + // set inset parameters + pparams->viewport[0] = XRES(gHUD.m_Spectator.m_OverviewData.insetWindowX) + 1; // change viewport to inset window + pparams->viewport[1] = YRES(gHUD.m_Spectator.m_OverviewData.insetWindowY) + 1; + pparams->viewport[2] = XRES(gHUD.m_Spectator.m_OverviewData.insetWindowWidth) - 2; + pparams->viewport[3] = YRES(gHUD.m_Spectator.m_OverviewData.insetWindowHeight) - 2; + pparams->nextView = 0; // on further view + pparams->onlyClientDraw = false; + + if (gHUD.m_Spectator.IsInOverviewMode()) + { + if (g_iUser1 == OBS_IN_EYE) + { + V_GetInEyePos( g_iUser2, v_origin, v_angles ); + } + else if (g_iUser1 == OBS_CHASE_FREE) + { + V_GetChasePos( g_iUser2, v_cl_angles, v_origin, v_angles ); + } + else if (g_iUser1 == OBS_CHASE_LOCKED) + { + V_GetChasePos( g_iUser2, NULL, v_origin, v_angles ); + } + else if (g_iUser1 == OBS_ROAMING) + { + VectorCopy (v_cl_angles, v_angles); + VectorCopy (v_sim_org, v_origin); + } + } + + // Removed by mmcguire. + /* + // override some settings in certain modes + switch ( (int)gHUD.m_Spectator.m_pip->value ) + { + case INSET_CHASE_FREE : V_GetChasePos( g_iUser2, v_cl_angles, v_origin, v_angles ); + break; + + case INSET_CHASE_LOCKED : V_GetChasePos( g_iUser2, NULL, v_origin, v_angles ); + break; + + case INSET_IN_EYE : V_GetInEyePos( g_iUser2, v_origin, v_angles ); + break; + + case INSET_MAP_FREE : pparams->onlyClientDraw = true; + V_GetMapFreePosition( v_cl_angles, v_origin, v_angles ); + break; + + case INSET_MAP_CHASE : pparams->onlyClientDraw = true; + + if ( g_iUser1 == OBS_ROAMING ) + V_GetMapChasePosition( 0, v_cl_angles, v_origin, v_angles ); + else + V_GetMapChasePosition( g_iUser2, v_cl_angles, v_origin, v_angles ); + + break; + } + */ + + gHUD.m_Spectator.m_iDrawCycle = 1; + } + + + // do the smoothing only once per frame, not in roaming or map mode + if ( (gHUD.m_Spectator.m_iDrawCycle == 0) && (g_iUser1 == OBS_IN_EYE) ) + { + // smooth angles + + VectorSubtract( v_angles, lastang, delta ); + if ( Length( delta ) != 0.0f ) + { + VectorCopy( v_angles, ViewInterp.Angles[ ViewInterp.CurrentAngle & ORIGIN_MASK ] ); + ViewInterp.AngleTime[ ViewInterp.CurrentAngle & ORIGIN_MASK ] = pparams->time; + ViewInterp.CurrentAngle++; + VectorCopy( v_angles, lastang ); + } + + if ( cl_vsmoothing && cl_vsmoothing->value ) + { + int foundidx; + int i; + float t; + + t = pparams->time - cl_vsmoothing->value; + + for ( i = 1; i < ORIGIN_MASK; i++ ) + { + foundidx = ViewInterp.CurrentAngle - 1 - i; + if ( ViewInterp.AngleTime[ foundidx & ORIGIN_MASK ] <= t ) + break; + } + + if ( i < ORIGIN_MASK && ViewInterp.AngleTime[ foundidx & ORIGIN_MASK ] != 0.0 ) + { + // Interpolate + double dt; + float da; + vec3_t v1,v2; + + AngleVectors( ViewInterp.Angles[ foundidx & ORIGIN_MASK ], v1, NULL, NULL ); + AngleVectors( ViewInterp.Angles[ (foundidx + 1) & ORIGIN_MASK ], v2, NULL, NULL ); + da = AngleBetweenVectors( v1, v2 ); + + dt = ViewInterp.AngleTime[ (foundidx + 1) & ORIGIN_MASK ] - ViewInterp.AngleTime[ foundidx & ORIGIN_MASK ]; + + if ( dt > 0.0 && ( da < 22.5f) ) + { + double frac; + + frac = ( t - ViewInterp.AngleTime[ foundidx & ORIGIN_MASK] ) / dt; + frac = min( 1.0, frac ); + + // interpolate angles + InterpolateAngles( ViewInterp.Angles[ foundidx & ORIGIN_MASK ], ViewInterp.Angles[ (foundidx + 1) & ORIGIN_MASK ], v_angles, frac ); + } + } + } + + // smooth origin + + VectorSubtract( v_origin, lastorg, delta ); + + if ( Length( delta ) != 0.0 ) + { + VectorCopy( v_origin, ViewInterp.Origins[ ViewInterp.CurrentOrigin & ORIGIN_MASK ] ); + ViewInterp.OriginTime[ ViewInterp.CurrentOrigin & ORIGIN_MASK ] = pparams->time; + ViewInterp.CurrentOrigin++; + + VectorCopy( v_origin, lastorg ); + } + + // don't smooth in roaming (already smoothd), + if ( cl_vsmoothing && cl_vsmoothing->value ) + { + int foundidx; + int i; + float t; + + t = pparams->time - cl_vsmoothing->value; + + for ( i = 1; i < ORIGIN_MASK; i++ ) + { + foundidx = ViewInterp.CurrentOrigin - 1 - i; + if ( ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ] <= t ) + break; + } + + if ( i < ORIGIN_MASK && ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ] != 0.0 ) + { + // Interpolate + vec3_t delta; + double frac; + double dt; + vec3_t neworg; + + dt = ViewInterp.OriginTime[ (foundidx + 1) & ORIGIN_MASK ] - ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ]; + if ( dt > 0.0 ) + { + frac = ( t - ViewInterp.OriginTime[ foundidx & ORIGIN_MASK] ) / dt; + frac = min( 1.0, frac ); + VectorSubtract( ViewInterp.Origins[ ( foundidx + 1 ) & ORIGIN_MASK ], ViewInterp.Origins[ foundidx & ORIGIN_MASK ], delta ); + VectorMA( ViewInterp.Origins[ foundidx & ORIGIN_MASK ], frac, delta, neworg ); + + // Dont interpolate large changes + if ( Length( delta ) < 64 ) + { + VectorCopy( neworg, v_origin ); + } + } + } + } + } + + // Hack in weapon model: + cl_entity_t* ent = gEngfuncs.GetEntityByIndex(g_iUser2); + cl_entity_t* gunModel = gEngfuncs.GetViewModel(); + if ( (g_iUser1 == OBS_IN_EYE) && ent && g_iUser2 ) + { + // get position for weapon model + VectorCopy( v_origin, gunModel->origin); + VectorCopy( v_angles, gunModel->angles); + + // add idle tremble + gunModel->angles[PITCH]*=-1; + + // calculate player velocity + float timeDiff = ent->curstate.msg_time - ent->prevstate.msg_time; + + if ( timeDiff > 0 ) + { + vec3_t distance; + VectorSubtract(ent->prevstate.origin, ent->curstate.origin, distance); + VectorScale(distance, 1/timeDiff, distance ); + + velocity[0] = velocity[0]*0.66f + distance[0]*0.33f; + velocity[1] = velocity[1]*0.66f + distance[1]*0.33f; + velocity[2] = velocity[2]*0.66f + distance[2]*0.33f; + + VectorCopy(velocity, pparams->simvel); + pparams->onground = 1; + + bob = V_CalcBob( pparams ); + } + + vec3_t forward; + AngleVectors(v_angles, forward, NULL, NULL ); + + for ( int i = 0; i < 3; i++ ) + { + gunModel->origin[ i ] += bob * 0.4 * forward[ i ]; + } + + // throw in a little tilt. + gunModel->angles[YAW] -= bob * 0.5; + gunModel->angles[ROLL] -= bob * 1; + gunModel->angles[PITCH] -= bob * 0.3; + + VectorCopy( gunModel->angles, gunModel->curstate.angles ); + VectorCopy( gunModel->angles, gunModel->latched.prevangles ); + + lastWeaponModelIndex = ent->curstate.weaponmodel; + int theCurrentViewModel = V_FindViewModelByWeaponModel( lastWeaponModelIndex, ent->curstate.iuser3, ent->curstate.iuser4); + + //if ( lastWeaponModelIndex != ent->curstate.weaponmodel ) + if ( lastViewModelIndex != theCurrentViewModel ) + { + // weapon model changed + lastViewModelIndex = theCurrentViewModel; + if ( lastViewModelIndex ) + { + gEngfuncs.pfnWeaponAnim(0,0); // reset weapon animation + } + else + { + // model not found + gunModel->model = NULL; // disable weaopn model + lastWeaponModelIndex = lastViewModelIndex = 0; + } + } + + if ( lastViewModelIndex ) + { + gunModel->model = IEngineStudio.GetModelByIndex( lastViewModelIndex ); + gunModel->curstate.modelindex = lastViewModelIndex; + gunModel->curstate.frame = 0; + gunModel->curstate.colormap = 0; + gunModel->index = g_iUser2; + } + else + { + gunModel->model = NULL; // disable weaopn model + } + } + else + { + gunModel->model = NULL; // disable weaopn model + lastWeaponModelIndex = lastViewModelIndex = 0; + } + + lasttime = pparams->time; + + // write back new values into pparams + + VectorCopy ( v_angles, pparams->viewangles ) + VectorCopy ( v_origin, pparams->vieworg ); + +} + +void CL_DLLEXPORT V_CalcRefdef( struct ref_params_s *pparams ) +{ + RecClCalcRefdef(pparams); + + if (!pparams->hardware) + { + // Don't show anything in software mode. + pparams->onlyClientDraw = true; + pparams->viewport[0] = 0; + pparams->viewport[1] = 0; + pparams->viewport[2] = 0; + pparams->viewport[3] = 0; + } + else + { + + // intermission / finale rendering + if ( pparams->intermission ) + { + V_CalcIntermissionRefdef ( pparams ); + } + else if ( pparams->spectator || g_iUser1) // g_iUser1 true if in spectator mode + { + V_CalcSpectatorRefdef ( pparams ); + } + else if ( !pparams->paused ) + { + if(gHUD.GetInTopDownMode()) + { + V_CalcTopDownRefdef ( pparams ); + } + else + { + V_CalcNormalRefdef ( pparams ); + } + } + + } + + gHUD.SetViewport(pparams->viewport); + +//// Example of how to overlay the whole screen with red at 50 % alpha +//#define SF_TEST +//#if defined SF_TEST +// { +// screenfade_t sf; +// gEngfuncs.pfnGetScreenFade( &sf ); +// +// sf.fader = 0; +// sf.fadeg = 255; +// sf.fadeb = 0; +// sf.fadealpha = 60; +// sf.fadeFlags = FFADE_STAYOUT | FFADE_OUT; +// +// gEngfuncs.pfnSetScreenFade( &sf ); +// } +//#endif +} + +/* +============= +V_DropPunchAngle + +============= +*/ +void V_DropPunchAngle ( float frametime, float *ev_punchangle ) +{ + float len; + + len = VectorNormalize ( ev_punchangle ); + len -= (10.0 + len * 0.5) * frametime; + len = max( len, 0.0 ); + VectorScale ( ev_punchangle, len, ev_punchangle ); +} + +/* +============= +V_PunchAxis + +Client side punch effect +============= +*/ +void V_PunchAxis( int axis, float punch ) +{ + ev_punchangle[ axis ] = punch; +} + +/* +============= +V_Init +============= +*/ +void V_Init (void) +{ + gEngfuncs.pfnAddCommand ("centerview", V_StartPitchDrift ); + + scr_ofsx = gEngfuncs.pfnRegisterVariable( "scr_ofsx","0", 0 ); + scr_ofsy = gEngfuncs.pfnRegisterVariable( "scr_ofsy","0", 0 ); + scr_ofsz = gEngfuncs.pfnRegisterVariable( "scr_ofsz","0", 0 ); + + v_centermove = gEngfuncs.pfnRegisterVariable( "v_centermove", "0.15", 0 ); + v_centerspeed = gEngfuncs.pfnRegisterVariable( "v_centerspeed","500", 0 ); + + cl_bobcycle = gEngfuncs.pfnRegisterVariable( "cl_bobcycle","0.8", 0 );// best default for my experimental gun wag (sjb) + cl_bob = gEngfuncs.pfnRegisterVariable( "cl_bob","0.01", 0 );// best default for my experimental gun wag (sjb) + cl_bobup = gEngfuncs.pfnRegisterVariable( "cl_bobup","0.5", 0 ); + cl_waterdist = gEngfuncs.pfnRegisterVariable( "cl_waterdist","4", 0 ); + cl_hudcam = gEngfuncs.pfnRegisterVariable( "cl_hudcam", "1", 0 ); + cl_chasedist = gEngfuncs.pfnRegisterVariable( "cl_chasedist", "200", 0 ); +} + + +//#define TRACE_TEST +#if defined( TRACE_TEST ) + +extern float in_fov; +/* +==================== +CalcFov +==================== +*/ +float CalcFov (float fov_x, float width, float height) +{ + float a; + float x; + + if (fov_x < 1 || fov_x > 179) + fov_x = 90; // error, set to 90 + + x = width/tan(fov_x/360*M_PI); + + a = atan (height/x); + + a = a*360/M_PI; + + return a; +} + +int hitent = -1; + +void V_Move( int mx, int my ) +{ + float fov; + float fx, fy; + float dx, dy; + float c_x, c_y; + float dX, dY; + vec3_t forward, up, right; + vec3_t newangles; + + vec3_t farpoint; + pmtrace_t tr; + + fov = CalcFov( in_fov, (float)ScreenWidth, (float)ScreenHeight ); + + c_x = (float)ScreenWidth / 2.0; + c_y = (float)ScreenHeight / 2.0; + + dx = (float)mx - c_x; + dy = (float)my - c_y; + + // Proportion we moved in each direction + fx = dx / c_x; + fy = dy / c_y; + + dX = fx * in_fov / 2.0 ; + dY = fy * fov / 2.0; + + newangles = v_angles; + + newangles[ YAW ] -= dX; + newangles[ PITCH ] += dY; + + // Now rotate v_forward around that point + AngleVectors ( newangles, forward, right, up ); + + farpoint = v_origin + 8192 * forward; + + // Trace + tr = *(gEngfuncs.PM_TraceLine( (float *)&v_origin, (float *)&farpoint, PM_TRACELINE_PHYSENTSONLY, 2 /*point sized hull*/, -1 )); + + if ( tr.fraction != 1.0 && tr.ent != 0 ) + { + hitent = PM_GetPhysEntInfo( tr.ent ); + PM_ParticleLine( (float *)&v_origin, (float *)&tr.endpos, 5, 1.0, 0.0 ); + } + else + { + hitent = -1; + } +} + +#endif + + + + +///* +//================== +//V_CalcTopDownRefdef +// +//================== +//*/ +//void V_CalcTopDownRefdef ( struct ref_params_s *pparams ) +//{ +// cl_entity_t *ent, *view; +// int i; +// vec3_t angles; +// static viewinterp_t ViewInterp; +// +// static float oldz = 0; +// static float lasttime; +// +// static float lastang[3]; +// vec3_t angdelta; +// +// vec3_t camAngles, camForward, camRight, camUp; +// //cl_entity_t *pwater; +// +// // don't allow cheats in multiplayer +// if ( pparams->maxclients > 1 ) +// { +// scr_ofsx->value = 0.0; +// scr_ofsy->value = 0.0; +// scr_ofsz->value = 0.0; +// } +// +// +// V_DriftPitch ( pparams ); +// +// // ent is the player model ( visible when out of body ) +// ent = gEngfuncs.GetLocalPlayer(); +// +// // view is the weapon model (only visible from inside body ) +// view = gEngfuncs.GetViewModel(); +// +// // Observer angle capturing and smoothing +// if ( iHasNewViewOrigin ) +// { +// // Get the angles from the physics code +// VectorCopy( gTopDownViewOrigin, pparams->vieworg ); +// VectorCopy( gTopDownViewOrigin, pparams->simorg ); +// } +// +// // Override position to commander position +// pparams->vieworg[2] = gTopDownHeight; +// pparams->simorg[2] = gTopDownHeight; +// +// // Override view height when in top down +// pparams->viewheight[2] = 0.0f; +// +// // refresh position +// VectorCopy ( pparams->simorg, pparams->vieworg ); +// VectorAdd( pparams->vieworg, pparams->viewheight, pparams->vieworg ); +// +// // Observer angle capturing and smoothing +// if ( iHasNewViewAngles ) +// { +// // Get the angles from the physics code +// VectorCopy( gTopDownViewAngles, pparams->cl_viewangles ); +// } +// +// VectorSubtract( pparams->cl_viewangles, lastang, angdelta ); +// if ( Length( angdelta ) != 0.0 ) +// { +// VectorCopy( pparams->cl_viewangles, ViewInterp.Angles[ ViewInterp.CurrentAngle & ORIGIN_MASK ] ); +// ViewInterp.AngleTime[ ViewInterp.CurrentAngle & ORIGIN_MASK ] = pparams->time; +// ViewInterp.CurrentAngle++; +// +// VectorCopy( pparams->cl_viewangles, lastang ); +// } +// +// if ( cl_vsmoothing && cl_vsmoothing->value && ( iIsSpectator & SPEC_SMOOTH_ANGLES ) ) +// { +// int foundidx; +// int i; +// float t; +// +// if ( cl_vsmoothing->value < 0.0 ) +// { +// gEngfuncs.Cvar_SetValue( "cl_vsmoothing", 0.0 ); +// } +// +// t = pparams->time - cl_vsmoothing->value; +// +// for ( i = 1; i < ORIGIN_MASK; i++ ) +// { +// foundidx = ViewInterp.CurrentAngle - 1 - i; +// if ( ViewInterp.AngleTime[ foundidx & ORIGIN_MASK ] <= t ) +// break; +// } +// +// if ( i < ORIGIN_MASK && ViewInterp.AngleTime[ foundidx & ORIGIN_MASK ] != 0.0 ) +// { +// // Interpolate +// double dt; +// +// dt = ViewInterp.AngleTime[ (foundidx + 1) & ORIGIN_MASK ] - ViewInterp.AngleTime[ foundidx & ORIGIN_MASK ]; +// if ( dt > 0.0 ) +// { +// double frac; +// +// frac = ( t - ViewInterp.AngleTime[ foundidx & ORIGIN_MASK] ) / dt; +// frac = min( 1.0, frac ); +// +// // interpolate angles +// InterpolateAngles( ViewInterp.Angles[ foundidx & ORIGIN_MASK ], ViewInterp.Angles[ (foundidx + 1) & ORIGIN_MASK ], pparams->cl_viewangles, frac ); +// +// VectorCopy( pparams->cl_viewangles, gTopDownViewAngles ); +// } +// } +// } +// +// +// VectorCopy ( pparams->cl_viewangles, pparams->viewangles ); +// +// gEngfuncs.V_CalcShake(); +// gEngfuncs.V_ApplyShake( pparams->vieworg, pparams->viewangles, 1.0 ); +// +//// // never let view origin sit exactly on a node line, because a water plane can +//// // dissapear when viewed with the eye exactly on it. +//// // FIXME, we send origin at 1/128 now, change this? +//// // the server protocol only specifies to 1/16 pixel, so add 1/32 in each axis +//// +//// pparams->vieworg[0] += 1.0/32; +//// pparams->vieworg[1] += 1.0/32; +//// pparams->vieworg[2] += 1.0/32; +// +// // Check for problems around water, move the viewer artificially if necessary +// // -- this prevents drawing errors in GL due to waves +// +//// if ( pparams->waterlevel >= 2 ) +//// { +//// int waterDist, waterEntity; +//// vec3_t point; +//// waterDist = cl_waterdist->value; +//// +//// if ( pparams->hardware ) +//// { +//// waterEntity = gEngfuncs.PM_WaterEntity( pparams->simorg ); +//// if ( waterEntity >= 0 && waterEntity < pparams->max_entities ) +//// { +//// pwater = gEngfuncs.GetEntityByIndex( waterEntity ); +//// if ( pwater && ( pwater->model != NULL ) ) +//// { +//// waterDist += ( pwater->curstate.scale * 16 ); // Add in wave height +//// } +//// } +//// } +//// else +//// { +//// waterEntity = 0; // Don't need this in software +//// } +//// +//// VectorCopy( pparams->vieworg, point ); +//// } +// +// V_CalcViewRoll ( pparams ); +// +// //V_AddIdle ( pparams ); +// +// // offsets +// VectorCopy( pparams->cl_viewangles, angles ); +// +// AngleVectors ( angles, pparams->forward, pparams->right, pparams->up ); +// +// for ( i=0 ; i<3 ; i++ ) +// { +// pparams->vieworg[i] += scr_ofsx->value*pparams->forward[i] + scr_ofsy->value*pparams->right[i] + scr_ofsz->value*pparams->up[i]; +// } +// +// // Treating cam_ofs[2] as the distance +//// if( CL_IsThirdPerson() ) +//// { +//// vec3_t ofs; +//// +//// ofs[0] = ofs[1] = ofs[2] = 0.0; +//// +//// CL_CameraOffset( (float *)&ofs ); +//// +//// VectorCopy( ofs, camAngles ); +//// camAngles[ ROLL ] = 0; +//// +//// AngleVectors( camAngles, camForward, camRight, camUp ); +//// +//// for ( i = 0; i < 3; i++ ) +//// { +//// pparams->vieworg[ i ] += -ofs[2] * camForward[ i ]; +//// } +//// } +// +// // Give gun our viewangles +//// VectorCopy ( pparams->cl_viewangles, view->angles ); +// +// // set up gun position +//// V_CalcGunAngle ( pparams ); +// +// // Use predicted origin as view origin. +// VectorCopy ( pparams->simorg, view->origin ); +// VectorAdd( view->origin, pparams->viewheight, view->origin ); +// +// // Let the viewmodel shake at about 10% of the amplitude +//// gEngfuncs.V_ApplyShake( view->origin, view->angles, 0.9 ); +// +// // smooth out stair step ups +//#if 1 +// if ( !pparams->smoothing && pparams->onground && pparams->simorg[2] - oldz > 0) +// { +// float steptime; +// +// steptime = pparams->time - lasttime; +// if (steptime < 0) +// //FIXME I_Error ("steptime < 0"); +// steptime = 0; +// +// oldz += steptime * 150; +// if (oldz > pparams->simorg[2]) +// oldz = pparams->simorg[2]; +// if (pparams->simorg[2] - oldz > 18) +// oldz = pparams->simorg[2]- 18; +// pparams->vieworg[2] += oldz - pparams->simorg[2]; +// view->origin[2] += oldz - pparams->simorg[2]; +// } +// else +// { +// oldz = pparams->simorg[2]; +// } +//#endif +// +// { +// static float lastorg[3]; +// vec3_t delta; +// +// VectorSubtract( pparams->simorg, lastorg, delta ); +// +// if ( Length( delta ) != 0.0 ) +// { +// VectorCopy( pparams->simorg, ViewInterp.Origins[ ViewInterp.CurrentOrigin & ORIGIN_MASK ] ); +// ViewInterp.OriginTime[ ViewInterp.CurrentOrigin & ORIGIN_MASK ] = pparams->time; +// ViewInterp.CurrentOrigin++; +// +// VectorCopy( pparams->simorg, lastorg ); +// } +// } +// +// // Smooth out whole view in multiplayer when on trains, lifts +// if ( cl_vsmoothing && cl_vsmoothing->value && +// ( ( iIsSpectator & SPEC_SMOOTH_ORIGIN ) || (pparams->smoothing && ( pparams->maxclients > 1 ) ) ) ) +// { +// int foundidx; +// int i; +// float t; +// +// if ( cl_vsmoothing->value < 0.0 ) +// { +// gEngfuncs.Cvar_SetValue( "cl_vsmoothing", 0.0 ); +// } +// +// t = pparams->time - cl_vsmoothing->value; +// +// for ( i = 1; i < ORIGIN_MASK; i++ ) +// { +// foundidx = ViewInterp.CurrentOrigin - 1 - i; +// if ( ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ] <= t ) +// break; +// } +// +// if ( i < ORIGIN_MASK && ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ] != 0.0 ) +// { +// // Interpolate +// vec3_t delta; +// double frac; +// double dt; +// vec3_t neworg; +// +// dt = ViewInterp.OriginTime[ (foundidx + 1) & ORIGIN_MASK ] - ViewInterp.OriginTime[ foundidx & ORIGIN_MASK ]; +// if ( dt > 0.0 ) +// { +// frac = ( t - ViewInterp.OriginTime[ foundidx & ORIGIN_MASK] ) / dt; +// frac = min( 1.0, frac ); +// VectorSubtract( ViewInterp.Origins[ ( foundidx + 1 ) & ORIGIN_MASK ], ViewInterp.Origins[ foundidx & ORIGIN_MASK ], delta ); +// VectorMA( ViewInterp.Origins[ foundidx & ORIGIN_MASK ], frac, delta, neworg ); +// +// // Dont interpolate large changes +// if ( Length( delta ) < 64 ) +// { +// VectorSubtract( neworg, pparams->simorg, delta ); +// +// VectorAdd( pparams->simorg, delta, pparams->simorg ); +// VectorAdd( pparams->vieworg, delta, pparams->vieworg ); +// VectorAdd( view->origin, delta, view->origin ); +// +// VectorCopy( pparams->simorg, gTopDownViewOrigin ); +// } +// } +// } +// } +// +// // Store off v_angles before munging for third person +// v_angles = pparams->viewangles; +// +// // override all previous settings if the viewent isn't the client +// if ( pparams->viewentity > pparams->maxclients ) +// { +// cl_entity_t *viewentity; +// viewentity = gEngfuncs.GetEntityByIndex( pparams->viewentity ); +// if ( viewentity ) +// { +// VectorCopy( viewentity->origin, pparams->vieworg ); +// VectorCopy( viewentity->angles, pparams->viewangles ); +// +// // Store off overridden viewangles +// v_angles = pparams->viewangles; +// } +// } +// +// lasttime = pparams->time; +// +// v_origin = pparams->vieworg; +//} + diff --git a/main/source/cl_dll/view.h b/main/source/cl_dll/view.h new file mode 100644 index 00000000..83d6566e --- /dev/null +++ b/main/source/cl_dll/view.h @@ -0,0 +1,8 @@ +#if !defined ( VIEWH ) +#define VIEWH +#pragma once + +void V_StartPitchDrift( void ); +void V_StopPitchDrift( void ); + +#endif // !VIEWH \ No newline at end of file diff --git a/main/source/cl_dll/wrect.h b/main/source/cl_dll/wrect.h new file mode 100644 index 00000000..1346fabf --- /dev/null +++ b/main/source/cl_dll/wrect.h @@ -0,0 +1,9 @@ +#if !defined( WRECTH ) +#define WRECTH + +typedef struct rect_s +{ + int left, right, top, bottom; +} wrect_t; + +#endif \ No newline at end of file diff --git a/main/source/common/beamdef.h b/main/source/common/beamdef.h new file mode 100644 index 00000000..48ac07b7 --- /dev/null +++ b/main/source/common/beamdef.h @@ -0,0 +1,62 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined ( BEAMDEFH ) +#define BEAMDEFH +#ifdef _WIN32 +#pragma once +#endif + +#define FBEAM_STARTENTITY 0x00000001 +#define FBEAM_ENDENTITY 0x00000002 +#define FBEAM_FADEIN 0x00000004 +#define FBEAM_FADEOUT 0x00000008 +#define FBEAM_SINENOISE 0x00000010 +#define FBEAM_SOLID 0x00000020 +#define FBEAM_SHADEIN 0x00000040 +#define FBEAM_SHADEOUT 0x00000080 +#define FBEAM_STARTVISIBLE 0x10000000 // Has this client actually seen this beam's start entity yet? +#define FBEAM_ENDVISIBLE 0x20000000 // Has this client actually seen this beam's end entity yet? +#define FBEAM_ISACTIVE 0x40000000 +#define FBEAM_FOREVER 0x80000000 + +typedef struct beam_s BEAM; +struct beam_s +{ + BEAM *next; + int type; + int flags; + vec3_t source; + vec3_t target; + vec3_t delta; + float t; // 0 .. 1 over lifetime of beam + float freq; + float die; + float width; + float amplitude; + float r, g, b; + float brightness; + float speed; + float frameRate; + float frame; + int segments; + int startEntity; + int endEntity; + int modelIndex; + int frameCount; + struct model_s *pFollowModel; + struct particle_s *particles; +}; + +#endif diff --git a/main/source/common/bullettypes.h b/main/source/common/bullettypes.h new file mode 100644 index 00000000..1b615690 --- /dev/null +++ b/main/source/common/bullettypes.h @@ -0,0 +1,19 @@ +#ifndef BULLET_TYPES_H +#define BULLET_TYPES_H + +// bullet types +typedef enum +{ + BULLET_NONE = 0, + BULLET_PLAYER_9MM, // glock + BULLET_PLAYER_MP5, // mp5 + BULLET_PLAYER_357, // python + BULLET_PLAYER_BUCKSHOT, // shotgun + BULLET_PLAYER_CROWBAR, // crowbar swipe + + BULLET_MONSTER_9MM, + BULLET_MONSTER_MP5, + BULLET_MONSTER_12MM, +} Bullet; + +#endif \ No newline at end of file diff --git a/main/source/common/cl_entity.h b/main/source/common/cl_entity.h new file mode 100644 index 00000000..902c0679 --- /dev/null +++ b/main/source/common/cl_entity.h @@ -0,0 +1,115 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// cl_entity.h +#if !defined( CL_ENTITYH ) +#define CL_ENTITYH +#ifdef _WIN32 +#pragma once +#endif + +typedef struct efrag_s +{ + struct mleaf_s *leaf; + struct efrag_s *leafnext; + struct cl_entity_s *entity; + struct efrag_s *entnext; +} efrag_t; + +typedef struct +{ + byte mouthopen; // 0 = mouth closed, 255 = mouth agape + byte sndcount; // counter for running average + int sndavg; // running average +} mouth_t; + +typedef struct +{ + float prevanimtime; + float sequencetime; + byte prevseqblending[2]; + vec3_t prevorigin; + vec3_t prevangles; + + int prevsequence; + float prevframe; + + byte prevcontroller[4]; + byte prevblending[2]; +} latchedvars_t; + +typedef struct +{ + // Time stamp for this movement + float animtime; + + vec3_t origin; + vec3_t angles; +} position_history_t; + +typedef struct cl_entity_s cl_entity_t; + +#define HISTORY_MAX 64 // Must be power of 2 +#define HISTORY_MASK ( HISTORY_MAX - 1 ) + + +#if !defined( ENTITY_STATEH ) +#include "entity_state.h" +#endif + +#if !defined( PROGS_H ) +#include "progs.h" +#endif + +struct cl_entity_s +{ + int index; // Index into cl_entities ( should match actual slot, but not necessarily ) + + qboolean player; // True if this entity is a "player" + + entity_state_t baseline; // The original state from which to delta during an uncompressed message + entity_state_t prevstate; // The state information from the penultimate message received from the server + entity_state_t curstate; // The state information from the last message received from server + + int current_position; // Last received history update index + position_history_t ph[ HISTORY_MAX ]; // History of position and angle updates for this player + + mouth_t mouth; // For synchronizing mouth movements. + + latchedvars_t latched; // Variables used by studio model rendering routines + + // Information based on interplocation, extrapolation, prediction, or just copied from last msg received. + // + float lastmove; + + // Actual render position and angles + vec3_t origin; + vec3_t angles; + + // Attachment points + vec3_t attachment[4]; + + // Other entity local information + int trivial_accept; + + struct model_s *model; // cl.model_precache[ curstate.modelindes ]; all visible entities have a model + struct efrag_s *efrag; // linked list of efrags + struct mnode_s *topnode; // for bmodels, first world node that splits bmodel, or NULL if not split + + float syncbase; // for client-side animations -- used by obsolete alias animation system, remove? + int visframe; // last frame this entity was found in an active leaf + colorVec cvFloorColor; +}; + +#endif // !CL_ENTITYH diff --git a/main/source/common/com_model.h b/main/source/common/com_model.h new file mode 100644 index 00000000..78c2147a --- /dev/null +++ b/main/source/common/com_model.h @@ -0,0 +1,344 @@ +// com_model.h +#if !defined( COM_MODEL_H ) +#define COM_MODEL_H +#if defined( _WIN32 ) +#pragma once +#endif + +#define STUDIO_RENDER 1 +#define STUDIO_EVENTS 2 + +#define MAX_CLIENTS 32 +#define MAX_EDICTS 900 + +#define MAX_MODEL_NAME 64 +#define MAX_MAP_HULLS 4 +#define MIPLEVELS 4 +#define NUM_AMBIENTS 4 // automatic ambient sounds +#define MAXLIGHTMAPS 4 +#define PLANE_ANYZ 5 + +#define ALIAS_Z_CLIP_PLANE 5 + +// flags in finalvert_t.flags +#define ALIAS_LEFT_CLIP 0x0001 +#define ALIAS_TOP_CLIP 0x0002 +#define ALIAS_RIGHT_CLIP 0x0004 +#define ALIAS_BOTTOM_CLIP 0x0008 +#define ALIAS_Z_CLIP 0x0010 +#define ALIAS_ONSEAM 0x0020 +#define ALIAS_XY_CLIP_MASK 0x000F + +#define ZISCALE ((float)0x8000) + +#define CACHE_SIZE 32 // used to align key data structures + +typedef enum +{ + mod_brush, + mod_sprite, + mod_alias, + mod_studio +} modtype_t; + +// must match definition in modelgen.h +#ifndef SYNCTYPE_T +#define SYNCTYPE_T + +typedef enum +{ + ST_SYNC=0, + ST_RAND +} synctype_t; + +#endif + +typedef struct +{ + float mins[3], maxs[3]; + float origin[3]; + int headnode[MAX_MAP_HULLS]; + int visleafs; // not including the solid leaf 0 + int firstface, numfaces; +} dmodel_t; + +// plane_t structure +typedef struct mplane_s +{ + vec3_t normal; // surface normal + float dist; // closest appoach to origin + byte type; // for texture axis selection and fast side tests + byte signbits; // signx + signy<<1 + signz<<1 + byte pad[2]; +} mplane_t; + +typedef struct +{ + vec3_t position; +} mvertex_t; + +typedef struct +{ + unsigned short v[2]; + unsigned int cachededgeoffset; +} medge_t; + +typedef struct texture_s +{ + char name[16]; + unsigned width, height; + int anim_total; // total tenths in sequence ( 0 = no) + int anim_min, anim_max; // time for this frame min <=time< max + struct texture_s *anim_next; // in the animation sequence + struct texture_s *alternate_anims; // bmodels in frame 1 use these + unsigned offsets[MIPLEVELS]; // four mip maps stored + unsigned paloffset; +} texture_t; + +typedef struct +{ + float vecs[2][4]; // [s/t] unit vectors in world space. + // [i][3] is the s/t offset relative to the origin. + // s or t = dot(3Dpoint,vecs[i])+vecs[i][3] + float mipadjust; // ?? mipmap limits for very small surfaces + texture_t *texture; + int flags; // sky or slime, no lightmap or 256 subdivision +} mtexinfo_t; + +typedef struct mnode_s +{ +// common with leaf + int contents; // 0, to differentiate from leafs + int visframe; // node needs to be traversed if current + + short minmaxs[6]; // for bounding box culling + + struct mnode_s *parent; + +// node specific + mplane_t *plane; + struct mnode_s *children[2]; + + unsigned short firstsurface; + unsigned short numsurfaces; +} mnode_t; + +typedef struct msurface_s msurface_t; +typedef struct decal_s decal_t; + +// JAY: Compress this as much as possible +struct decal_s +{ + decal_t *pnext; // linked list for each surface + msurface_t *psurface; // Surface id for persistence / unlinking + short dx; // Offsets into surface texture (in texture coordinates, so we don't need floats) + short dy; + short texture; // Decal texture + byte scale; // Pixel scale + byte flags; // Decal flags + + short entityIndex; // Entity this is attached to +}; + +typedef struct mleaf_s +{ +// common with node + int contents; // wil be a negative contents number + int visframe; // node needs to be traversed if current + + short minmaxs[6]; // for bounding box culling + + struct mnode_s *parent; + +// leaf specific + byte *compressed_vis; + struct efrag_s *efrags; + + msurface_t **firstmarksurface; + int nummarksurfaces; + int key; // BSP sequence number for leaf's contents + byte ambient_sound_level[NUM_AMBIENTS]; +} mleaf_t; + +struct msurface_s +{ + int visframe; // should be drawn when node is crossed + + int dlightframe; // last frame the surface was checked by an animated light + int dlightbits; // dynamically generated. Indicates if the surface illumination + // is modified by an animated light. + + mplane_t *plane; // pointer to shared plane + int flags; // see SURF_ #defines + + int firstedge; // look up in model->surfedges[], negative numbers + int numedges; // are backwards edges + +// surface generation data + struct surfcache_s *cachespots[MIPLEVELS]; + + short texturemins[2]; // smallest s/t position on the surface. + short extents[2]; // ?? s/t texture size, 1..256 for all non-sky surfaces + + mtexinfo_t *texinfo; + +// lighting info + byte styles[MAXLIGHTMAPS]; // index into d_lightstylevalue[] for animated lights + // no one surface can be effected by more than 4 + // animated lights. + color24 *samples; + + decal_t *pdecals; +}; + +typedef struct +{ + int planenum; + short children[2]; // negative numbers are contents +} dclipnode_t; + +typedef struct hull_s +{ + dclipnode_t *clipnodes; + mplane_t *planes; + int firstclipnode; + int lastclipnode; + vec3_t clip_mins; + vec3_t clip_maxs; +} hull_t; + +#if !defined( CACHE_USER ) && !defined( QUAKEDEF_H ) +#define CACHE_USER +typedef struct cache_user_s +{ + void *data; +} cache_user_t; +#endif + +typedef struct model_s +{ + char name[ MAX_MODEL_NAME ]; + qboolean needload; // bmodels and sprites don't cache normally + + modtype_t type; + int numframes; + synctype_t synctype; + + int flags; + +// +// volume occupied by the model +// + vec3_t mins, maxs; + float radius; + +// +// brush model +// + int firstmodelsurface, nummodelsurfaces; + + int numsubmodels; + dmodel_t *submodels; + + int numplanes; + mplane_t *planes; + + int numleafs; // number of visible leafs, not counting 0 + struct mleaf_s *leafs; + + int numvertexes; + mvertex_t *vertexes; + + int numedges; + medge_t *edges; + + int numnodes; + mnode_t *nodes; + + int numtexinfo; + mtexinfo_t *texinfo; + + int numsurfaces; + msurface_t *surfaces; + + int numsurfedges; + int *surfedges; + + int numclipnodes; + dclipnode_t *clipnodes; + + int nummarksurfaces; + msurface_t **marksurfaces; + + hull_t hulls[MAX_MAP_HULLS]; + + int numtextures; + texture_t **textures; + + byte *visdata; + + color24 *lightdata; + + char *entities; + +// +// additional model data +// + cache_user_t cache; // only access through Mod_Extradata + +} model_t; + +typedef vec_t vec4_t[4]; + +typedef struct alight_s +{ + int ambientlight; // clip at 128 + int shadelight; // clip at 192 - ambientlight + vec3_t color; + float *plightvec; +} alight_t; + +typedef struct auxvert_s +{ + float fv[3]; // viewspace x, y +} auxvert_t; + +#include "custom.h" + +#define MAX_INFO_STRING 256 +#define MAX_SCOREBOARDNAME 32 +typedef struct player_info_s +{ + // User id on server + int userid; + + // User info string + char userinfo[ MAX_INFO_STRING ]; + + // Name + char name[ MAX_SCOREBOARDNAME ]; + + // Spectator or not, unused + int spectator; + + int ping; + int packet_loss; + + // skin information + char model[MAX_QPATH]; + int topcolor; + int bottomcolor; + + // last frame rendered + int renderframe; + + // Gait frame estimation + int gaitsequence; + float gaitframe; + float gaityaw; + vec3_t prevgaitorigin; + + customization_t customdata; +} player_info_t; + +#endif // #define COM_MODEL_H diff --git a/main/source/common/con_nprint.h b/main/source/common/con_nprint.h new file mode 100644 index 00000000..5128d87f --- /dev/null +++ b/main/source/common/con_nprint.h @@ -0,0 +1,31 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( CON_NPRINTH ) +#define CON_NPRINTH +#ifdef _WIN32 +#pragma once +#endif + +typedef struct con_nprint_s +{ + int index; // Row # + float time_to_live; // # of seconds before it dissappears + float color[ 3 ]; // RGB colors ( 0.0 -> 1.0 scale ) +} con_nprint_t; + +void Con_NPrintf( int idx, char *fmt, ... ); +void Con_NXPrintf( struct con_nprint_s *info, char *fmt, ... ); + +#endif diff --git a/main/source/common/const.h b/main/source/common/const.h new file mode 100644 index 00000000..4df5d74f --- /dev/null +++ b/main/source/common/const.h @@ -0,0 +1,744 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#ifndef CONST_H +#define CONST_H +// +// Constants shared by the engine and dlls +// This header file included by engine files and DLL files. +// Most came from server.h + +// edict->flags +#define FL_FLY (1<<0) // Changes the SV_Movestep() behavior to not need to be on ground +#define FL_SWIM (1<<1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) +#define FL_CONVEYOR (1<<2) +#define FL_CLIENT (1<<3) +#define FL_INWATER (1<<4) +#define FL_MONSTER (1<<5) +#define FL_GODMODE (1<<6) +#define FL_NOTARGET (1<<7) +#define FL_SKIPLOCALHOST (1<<8) // Don't send entity to local host, it's predicting this entity itself +#define FL_ONGROUND (1<<9) // At rest / on the ground +#define FL_PARTIALGROUND (1<<10) // not all corners are valid +#define FL_WATERJUMP (1<<11) // player jumping out of water +#define FL_FROZEN (1<<12) // Player is frozen for 3rd person camera +#define FL_FAKECLIENT (1<<13) // JAC: fake client, simulated server side; don't send network messages to them +#define FL_DUCKING (1<<14) // Player flag -- Player is fully crouched +#define FL_FLOAT (1<<15) // Apply floating force to this entity when in water +#define FL_GRAPHED (1<<16) // worldgraph has this ent listed as something that blocks a connection + +// UNDONE: Do we need these? +#define FL_IMMUNE_WATER (1<<17) +#define FL_IMMUNE_SLIME (1<<18) +#define FL_IMMUNE_LAVA (1<<19) + +#define FL_PROXY (1<<20) // This is a spectator proxy +#define FL_ALWAYSTHINK (1<<21) // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path) +#define FL_BASEVELOCITY (1<<22) // Base velocity has been applied this frame (used to convert base velocity into momentum) +#define FL_MONSTERCLIP (1<<23) // Only collide in with monsters who have FL_MONSTERCLIP set +#define FL_ONTRAIN (1<<24) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction. +#define FL_WORLDBRUSH (1<<25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something) +#define FL_SPECTATOR (1<<26) // This client is a spectator, don't run touch functions, etc. +#define FL_CUSTOMENTITY (1<<29) // This is a custom entity +#define FL_KILLME (1<<30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time +#define FL_DORMANT (1<<31) // Entity is dormant, no updates to client + + +// Goes into globalvars_t.trace_flags +#define FTRACE_SIMPLEBOX (1<<0) // Traceline with a simple box + + +// walkmove modes +#define WALKMOVE_NORMAL 0 // normal walkmove +#define WALKMOVE_WORLDONLY 1 // doesn't hit ANY entities, no matter what the solid type +#define WALKMOVE_CHECKONLY 2 // move, but don't touch triggers + +// edict->movetype values +#define MOVETYPE_NONE 0 // never moves +//#define MOVETYPE_ANGLENOCLIP 1 +//#define MOVETYPE_ANGLECLIP 2 +#define MOVETYPE_WALK 3 // Player only - moving on the ground +#define MOVETYPE_STEP 4 // gravity, special edge handling -- monsters use this +#define MOVETYPE_FLY 5 // No gravity, but still collides with stuff +#define MOVETYPE_TOSS 6 // gravity/collisions +#define MOVETYPE_PUSH 7 // no clip to world, push and crush +#define MOVETYPE_NOCLIP 8 // No gravity, no collisions, still do velocity/avelocity +#define MOVETYPE_FLYMISSILE 9 // extra size to monsters +#define MOVETYPE_BOUNCE 10 // Just like Toss, but reflect velocity when contacting surfaces +#define MOVETYPE_BOUNCEMISSILE 11 // bounce w/o gravity +#define MOVETYPE_FOLLOW 12 // track movement of aiment +#define MOVETYPE_PUSHSTEP 13 // BSP model that needs physics/world collisions (uses nearest hull for world collision) + +// edict->solid values +// NOTE: Some movetypes will cause collisions independent of SOLID_NOT/SOLID_TRIGGER when the entity moves +// SOLID only effects OTHER entities colliding with this one when they move - UGH! +#define SOLID_NOT 0 // no interaction with other objects +#define SOLID_TRIGGER 1 // touch on edge, but not blocking +#define SOLID_BBOX 2 // touch on edge, block +#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground +#define SOLID_BSP 4 // bsp clip, touch on edge, block + +// edict->deadflag values +#define DEAD_NO 0 // alive +#define DEAD_DYING 1 // playing death animation or still falling off of a ledge waiting to hit ground +#define DEAD_DEAD 2 // dead. lying still. +#define DEAD_RESPAWNABLE 3 +#define DEAD_DISCARDBODY 4 + +#define DAMAGE_NO 0 +#define DAMAGE_YES 1 +#define DAMAGE_AIM 2 + +// entity effects +#define EF_BRIGHTFIELD 1 // swirling cloud of particles +#define EF_MUZZLEFLASH 2 // single frame ELIGHT on entity attachment 0 +#define EF_BRIGHTLIGHT 4 // DLIGHT centered at entity origin +#define EF_DIMLIGHT 8 // player flashlight +#define EF_INVLIGHT 16 // get lighting from ceiling +#define EF_NOINTERP 32 // don't interpolate the next frame +#define EF_LIGHT 64 // rocket flare glow sprite +#define EF_NODRAW 128 // don't draw entity + +// entity flags +#define EFLAG_SLERP 1 // do studio interpolation of this entity + +// +// temp entity events +// +#define TE_BEAMPOINTS 0 // beam effect between two points +// coord coord coord (start position) +// coord coord coord (end position) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_BEAMENTPOINT 1 // beam effect between point and entity +// short (start entity) +// coord coord coord (end position) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_GUNSHOT 2 // particle effect plus ricochet sound +// coord coord coord (position) + +#define TE_EXPLOSION 3 // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps +// coord coord coord (position) +// short (sprite index) +// byte (scale in 0.1's) +// byte (framerate) +// byte (flags) +// +// The Explosion effect has some flags to control performance/aesthetic features: +#define TE_EXPLFLAG_NONE 0 // all flags clear makes default Half-Life explosion +#define TE_EXPLFLAG_NOADDITIVE 1 // sprite will be drawn opaque (ensure that the sprite you send is a non-additive sprite) +#define TE_EXPLFLAG_NODLIGHTS 2 // do not render dynamic lights +#define TE_EXPLFLAG_NOSOUND 4 // do not play client explosion sound +#define TE_EXPLFLAG_NOPARTICLES 8 // do not draw particles + + +#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound +// coord coord coord (position) + +#define TE_SMOKE 5 // alphablend sprite, move vertically 30 pps +// coord coord coord (position) +// short (sprite index) +// byte (scale in 0.1's) +// byte (framerate) + +#define TE_TRACER 6 // tracer effect from point to point +// coord, coord, coord (start) +// coord, coord, coord (end) + +#define TE_LIGHTNING 7 // TE_BEAMPOINTS with simplified parameters +// coord, coord, coord (start) +// coord, coord, coord (end) +// byte (life in 0.1's) +// byte (width in 0.1's) +// byte (amplitude in 0.01's) +// short (sprite model index) + +#define TE_BEAMENTS 8 +// short (start entity) +// short (end entity) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_SPARKS 9 // 8 random tracers with gravity, ricochet sprite +// coord coord coord (position) + +#define TE_LAVASPLASH 10 // Quake1 lava splash +// coord coord coord (position) + +#define TE_TELEPORT 11 // Quake1 teleport splash +// coord coord coord (position) + +#define TE_EXPLOSION2 12 // Quake1 colormaped (base palette) particle explosion with sound +// coord coord coord (position) +// byte (starting color) +// byte (num colors) + +#define TE_BSPDECAL 13 // Decal from the .BSP file +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// short (texture index of precached decal texture name) +// short (entity index) +// [optional - only included if previous short is non-zero (not the world)] short (index of model of above entity) + +#define TE_IMPLOSION 14 // tracers moving toward a point +// coord, coord, coord (position) +// byte (radius) +// byte (count) +// byte (life in 0.1's) + +#define TE_SPRITETRAIL 15 // line of moving glow sprites with gravity, fadeout, and collisions +// coord, coord, coord (start) +// coord, coord, coord (end) +// short (sprite index) +// byte (count) +// byte (life in 0.1's) +// byte (scale in 0.1's) +// byte (velocity along vector in 10's) +// byte (randomness of velocity in 10's) + +#define TE_BEAM 16 // obsolete + +#define TE_SPRITE 17 // additive sprite, plays 1 cycle +// coord, coord, coord (position) +// short (sprite index) +// byte (scale in 0.1's) +// byte (brightness) + +#define TE_BEAMSPRITE 18 // A beam with a sprite at the end +// coord, coord, coord (start position) +// coord, coord, coord (end position) +// short (beam sprite index) +// short (end sprite index) + +#define TE_BEAMTORUS 19 // screen aligned beam ring, expands to max radius over lifetime +// coord coord coord (center position) +// coord coord coord (axis and radius) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_BEAMDISK 20 // disk that expands to max radius over lifetime +// coord coord coord (center position) +// coord coord coord (axis and radius) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_BEAMCYLINDER 21 // cylinder that expands to max radius over lifetime +// coord coord coord (center position) +// coord coord coord (axis and radius) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving +// short (entity:attachment to follow) +// short (sprite index) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte,byte,byte (color) +// byte (brightness) + +#define TE_GLOWSPRITE 23 +// coord, coord, coord (pos) short (model index) byte (scale / 10) + +#define TE_BEAMRING 24 // connect a beam ring to two entities +// short (start entity) +// short (end entity) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_STREAK_SPLASH 25 // oriented shower of tracers +// coord coord coord (start position) +// coord coord coord (direction vector) +// byte (color) +// short (count) +// short (base speed) +// short (ramdon velocity) + +#define TE_BEAMHOSE 26 // obsolete + +#define TE_DLIGHT 27 // dynamic light, effect world, minor entity effect +// coord, coord, coord (pos) +// byte (radius in 10's) +// byte byte byte (color) +// byte (brightness) +// byte (life in 10's) +// byte (decay rate in 10's) + +#define TE_ELIGHT 28 // point entity light, no world effect +// short (entity:attachment to follow) +// coord coord coord (initial position) +// coord (radius) +// byte byte byte (color) +// byte (life in 0.1's) +// coord (decay rate) + +#define TE_TEXTMESSAGE 29 +// short 1.2.13 x (-1 = center) +// short 1.2.13 y (-1 = center) +// byte Effect 0 = fade in/fade out + // 1 is flickery credits + // 2 is write out (training room) + +// 4 bytes r,g,b,a color1 (text color) +// 4 bytes r,g,b,a color2 (effect color) +// ushort 8.8 fadein time +// ushort 8.8 fadeout time +// ushort 8.8 hold time +// optional ushort 8.8 fxtime (time the highlight lags behing the leading text in effect 2) +// string text message (512 chars max sz string) +#define TE_LINE 30 +// coord, coord, coord startpos +// coord, coord, coord endpos +// short life in 0.1 s +// 3 bytes r, g, b + +#define TE_BOX 31 +// coord, coord, coord boxmins +// coord, coord, coord boxmaxs +// short life in 0.1 s +// 3 bytes r, g, b + +#define TE_KILLBEAM 99 // kill all beams attached to entity +// short (entity) + +#define TE_LARGEFUNNEL 100 +// coord coord coord (funnel position) +// short (sprite index) +// short (flags) + +#define TE_BLOODSTREAM 101 // particle spray +// coord coord coord (start position) +// coord coord coord (spray vector) +// byte (color) +// byte (speed) + +#define TE_SHOWLINE 102 // line of particles every 5 units, dies in 30 seconds +// coord coord coord (start position) +// coord coord coord (end position) + +#define TE_BLOOD 103 // particle spray +// coord coord coord (start position) +// coord coord coord (spray vector) +// byte (color) +// byte (speed) + +#define TE_DECAL 104 // Decal applied to a brush entity (not the world) +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// byte (texture index of precached decal texture name) +// short (entity index) + +#define TE_FIZZ 105 // create alpha sprites inside of entity, float upwards +// short (entity) +// short (sprite index) +// byte (density) + +#define TE_MODEL 106 // create a moving model that bounces and makes a sound when it hits +// coord, coord, coord (position) +// coord, coord, coord (velocity) +// angle (initial yaw) +// short (model index) +// byte (bounce sound type) +// byte (life in 0.1's) + +#define TE_EXPLODEMODEL 107 // spherical shower of models, picks from set +// coord, coord, coord (origin) +// coord (velocity) +// short (model index) +// short (count) +// byte (life in 0.1's) + +#define TE_BREAKMODEL 108 // box of models or sprites +// coord, coord, coord (position) +// coord, coord, coord (size) +// coord, coord, coord (velocity) +// byte (random velocity in 10's) +// short (sprite or model index) +// byte (count) +// byte (life in 0.1 secs) +// byte (flags) + +#define TE_GUNSHOTDECAL 109 // decal and ricochet sound +// coord, coord, coord (position) +// short (entity index???) +// byte (decal???) + +#define TE_SPRITE_SPRAY 110 // spay of alpha sprites +// coord, coord, coord (position) +// coord, coord, coord (velocity) +// short (sprite index) +// byte (count) +// byte (speed) +// byte (noise) + +#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound. +// coord, coord, coord (position) +// byte (scale in 0.1's) + +#define TE_PLAYERDECAL 112 // ??? +// byte (playerindex) +// coord, coord, coord (position) +// short (entity???) +// byte (decal number???) +// [optional] short (model index???) + +#define TE_BUBBLES 113 // create alpha sprites inside of box, float upwards +// coord, coord, coord (min start position) +// coord, coord, coord (max start position) +// coord (float height) +// short (model index) +// byte (count) +// coord (speed) + +#define TE_BUBBLETRAIL 114 // create alpha sprites along a line, float upwards +// coord, coord, coord (min start position) +// coord, coord, coord (max start position) +// coord (float height) +// short (model index) +// byte (count) +// coord (speed) + +#define TE_BLOODSPRITE 115 // spray of opaque sprite1's that fall, single sprite2 for 1..2 secs (this is a high-priority tent) +// coord, coord, coord (position) +// short (sprite1 index) +// short (sprite2 index) +// byte (color) +// byte (scale) + +#define TE_WORLDDECAL 116 // Decal applied to the world brush +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// byte (texture index of precached decal texture name) + +#define TE_WORLDDECALHIGH 117 // Decal (with texture index > 256) applied to world brush +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// byte (texture index of precached decal texture name - 256) + +#define TE_DECALHIGH 118 // Same as TE_DECAL, but the texture index was greater than 256 +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// byte (texture index of precached decal texture name - 256) +// short (entity index) + +#define TE_PROJECTILE 119 // Makes a projectile (like a nail) (this is a high-priority tent) +// coord, coord, coord (position) +// coord, coord, coord (velocity) +// short (modelindex) +// byte (life) +// byte (owner) projectile won't collide with owner (if owner == 0, projectile will hit any client). + +#define TE_SPRAY 120 // Throws a shower of sprites or models +// coord, coord, coord (position) +// coord, coord, coord (direction) +// short (modelindex) +// byte (count) +// byte (speed) +// byte (noise) +// byte (rendermode) + +#define TE_PLAYERSPRITES 121 // sprites emit from a player's bounding box (ONLY use for players!) +// byte (playernum) +// short (sprite modelindex) +// byte (count) +// byte (variance) (0 = no variance in size) (10 = 10% variance in size) + +#define TE_PARTICLEBURST 122 // very similar to lavasplash. +// coord (origin) +// short (radius) +// byte (particle color) +// byte (duration * 10) (will be randomized a bit) + +#define TE_FIREFIELD 123 // makes a field of fire. +// coord (origin) +// short (radius) (fire is made in a square around origin. -radius, -radius to radius, radius) +// short (modelindex) +// byte (count) +// byte (flags) +// byte (duration (in seconds) * 10) (will be randomized a bit) +// +// to keep network traffic low, this message has associated flags that fit into a byte: +#define TEFIRE_FLAG_ALLFLOAT 1 // all sprites will drift upwards as they animate +#define TEFIRE_FLAG_SOMEFLOAT 2 // some of the sprites will drift upwards. (50% chance) +#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration. +#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque +#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube. + +#define TE_PLAYERATTACHMENT 124 // attaches a TENT to a player (this is a high-priority tent) +// byte (entity index of player) +// coord (vertical offset) ( attachment origin.z = player origin.z + vertical offset ) +// short (model index) +// short (life * 10 ); + +#define TE_KILLPLAYERATTACHMENTS 125 // will expire all TENTS attached to a player. +// byte (entity index of player) + +#define TE_MULTIGUNSHOT 126 // much more compact shotgun message +// This message is used to make a client approximate a 'spray' of gunfire. +// Any weapon that fires more than one bullet per frame and fires in a bit of a spread is +// a good candidate for MULTIGUNSHOT use. (shotguns) +// +// NOTE: This effect makes the client do traces for each bullet, these client traces ignore +// entities that have studio models.Traces are 4096 long. +// +// coord (origin) +// coord (origin) +// coord (origin) +// coord (direction) +// coord (direction) +// coord (direction) +// coord (x noise * 100) +// coord (y noise * 100) +// byte (count) +// byte (bullethole decal texture index) + +#define TE_USERTRACER 127 // larger message than the standard tracer, but allows some customization. +// coord (origin) +// coord (origin) +// coord (origin) +// coord (velocity) +// coord (velocity) +// coord (velocity) +// byte ( life * 10 ) +// byte ( color ) this is an index into an array of color vectors in the engine. (0 - ) +// byte ( length * 10 ) + + + +#define MSG_BROADCAST 0 // unreliable to all +#define MSG_ONE 1 // reliable to one (msg_entity) +#define MSG_ALL 2 // reliable to all +#define MSG_INIT 3 // write to the init string +#define MSG_PVS 4 // Ents in PVS of org +#define MSG_PAS 5 // Ents in PAS of org +#define MSG_PVS_R 6 // Reliable to PVS +#define MSG_PAS_R 7 // Reliable to PAS +#define MSG_ONE_UNRELIABLE 8 // Send to one client, but don't put in reliable stream, put in unreliable datagram ( could be dropped ) +#define MSG_SPEC 9 // Sends to all spectator proxies + +// contents of a spot in the world +#define CONTENTS_EMPTY -1 +#define CONTENTS_SOLID -2 +#define CONTENTS_WATER -3 +#define CONTENTS_SLIME -4 +#define CONTENTS_LAVA -5 +#define CONTENTS_SKY -6 +/* These additional contents constants are defined in bspfile.h +#define CONTENTS_ORIGIN -7 // removed at csg time +#define CONTENTS_CLIP -8 // changed to contents_solid +#define CONTENTS_CURRENT_0 -9 +#define CONTENTS_CURRENT_90 -10 +#define CONTENTS_CURRENT_180 -11 +#define CONTENTS_CURRENT_270 -12 +#define CONTENTS_CURRENT_UP -13 +#define CONTENTS_CURRENT_DOWN -14 + +#define CONTENTS_TRANSLUCENT -15 +*/ +#define CONTENTS_LADDER -16 + +// Used when trying to make bsp optimizations +//#define CONTENTS_PORTAL -17 + +#define CONTENT_FLYFIELD -17 +#define CONTENT_GRAVITY_FLYFIELD -18 +#define CONTENT_FOG -19 + +#define CONTENT_EMPTY -1 +#define CONTENT_SOLID -2 +#define CONTENT_WATER -3 +#define CONTENT_SLIME -4 +#define CONTENT_LAVA -5 +#define CONTENT_SKY -6 + +// channels +#define CHAN_AUTO 0 +#define CHAN_WEAPON 1 +#define CHAN_VOICE 2 +#define CHAN_ITEM 3 +#define CHAN_BODY 4 +#define CHAN_STREAM 5 // allocate stream channel from the static or dynamic area +#define CHAN_STATIC 6 // allocate channel from the static area +#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network +#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). + +// attenuation values +#define ATTN_NONE 0 +#define ATTN_NORM (float)0.8 +#define ATTN_IDLE (float)2 +#define ATTN_STATIC (float)1.25 + +// pitch values +#define PITCH_NORM 100 // non-pitch shifted +#define PITCH_LOW 95 // other values are possible - 0-255, where 255 is very high +#define PITCH_HIGH 120 + +// volume values +#define VOL_NORM 1.0 + +// plats +#define PLAT_LOW_TRIGGER 1 + +// Trains +#define SF_TRAIN_WAIT_RETRIGGER 1 +#define SF_TRAIN_START_ON 4 // Train is initially moving +#define SF_TRAIN_PASSABLE 8 // Train is not solid -- used to make water trains + +// buttons +#ifndef IN_BUTTONS_H +#include "in_buttons.h" +#endif + +// Break Model Defines + +#define BREAK_TYPEMASK 0x4F +#define BREAK_GLASS 0x01 +#define BREAK_METAL 0x02 +#define BREAK_FLESH 0x04 +#define BREAK_WOOD 0x08 + +#define BREAK_SMOKE 0x10 +#define BREAK_TRANS 0x20 +#define BREAK_CONCRETE 0x40 +#define BREAK_2 0x80 + +// Colliding temp entity sounds + +#define BOUNCE_GLASS BREAK_GLASS +#define BOUNCE_METAL BREAK_METAL +#define BOUNCE_FLESH BREAK_FLESH +#define BOUNCE_WOOD BREAK_WOOD +#define BOUNCE_SHRAP 0x10 +#define BOUNCE_SHELL 0x20 +#define BOUNCE_CONCRETE BREAK_CONCRETE +#define BOUNCE_SHOTSHELL 0x80 + +// Temp entity bounce sound types +#define TE_BOUNCE_NULL 0 +#define TE_BOUNCE_SHELL 1 +#define TE_BOUNCE_SHOTSHELL 2 + +#include "common/renderingconst.h" + +typedef int func_t; +typedef int string_t; + +typedef unsigned char byte; +typedef unsigned short word; +#define _DEF_BYTE_ + +#undef true +#undef false + +#ifndef __cplusplus +typedef enum {false, true} qboolean; +#else +typedef int qboolean; +#endif + +typedef struct +{ + byte r, g, b; +} color24; + +typedef struct +{ + unsigned r, g, b, a; +} colorVec; + +#ifdef _WIN32 +#pragma pack(push,2) +#endif + +typedef struct +{ + unsigned short r, g, b, a; +} PackedColorVec; + +#ifdef _WIN32 +#pragma pack(pop) +#endif +typedef struct link_s +{ + struct link_s *prev, *next; +} link_t; + +typedef struct edict_s edict_t; + +typedef struct +{ + vec3_t normal; + float dist; +} plane_t; + +typedef struct +{ + qboolean allsolid; // if true, plane is not valid + qboolean startsolid; // if true, the initial point was in a solid area + qboolean inopen, inwater; + float fraction; // time completed, 1.0 = didn't hit anything + vec3_t endpos; // final position + plane_t plane; // surface normal at impact + edict_t *ent; // entity the surface is on + int hitgroup; // 0 == generic, non zero is specific body part +} trace_t; + +#endif + diff --git a/main/source/common/crc.h b/main/source/common/crc.h new file mode 100644 index 00000000..f2f69abe --- /dev/null +++ b/main/source/common/crc.h @@ -0,0 +1,52 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +/* crc.h */ +#ifndef CRC_H +#define CRC_H +#ifdef _WIN32 +#pragma once +#endif + +// MD5 Hash +typedef struct +{ + unsigned int buf[4]; + unsigned int bits[2]; + unsigned char in[64]; +} MD5Context_t; + + +typedef unsigned long CRC32_t; +void CRC32_Init(CRC32_t *pulCRC); +CRC32_t CRC32_Final(CRC32_t pulCRC); +void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); +void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); +int CRC_File(CRC32_t *crcvalue, char *pszFileName); + +unsigned char COM_BlockSequenceCRCByte (unsigned char *base, int length, int sequence); + +void MD5Init(MD5Context_t *context); +void MD5Update(MD5Context_t *context, unsigned char const *buf, + unsigned int len); +void MD5Final(unsigned char digest[16], MD5Context_t *context); +void Transform(unsigned int buf[4], unsigned int const in[16]); + +int MD5_Hash_File(unsigned char digest[16], char *pszFileName, int bUsefopen, int bSeed, unsigned int seed[4]); +char *MD5_Print(unsigned char hash[16]); +int MD5_Hash_CachedFile(unsigned char digest[16], unsigned char *pCache, int nFileSize, int bSeed, unsigned int seed[4]); + +int CRC_MapFile(CRC32_t *crcvalue, char *pszFileName); + +#endif diff --git a/main/source/common/cvardef.h b/main/source/common/cvardef.h new file mode 100644 index 00000000..2d599a35 --- /dev/null +++ b/main/source/common/cvardef.h @@ -0,0 +1,36 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#ifndef CVARDEF_H +#define CVARDEF_H + +#define FCVAR_ARCHIVE (1<<0) // set to cause it to be saved to vars.rc +#define FCVAR_USERINFO (1<<1) // changes the client's info string +#define FCVAR_SERVER (1<<2) // notifies players when changed +#define FCVAR_EXTDLL (1<<3) // defined by external DLL +#define FCVAR_CLIENTDLL (1<<4) // defined by the client dll +#define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value +#define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server. +#define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). +#define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log + +typedef struct cvar_s +{ + char *name; + char *string; + int flags; + float value; + struct cvar_s *next; +} cvar_t; +#endif diff --git a/main/source/common/damagetypes.h b/main/source/common/damagetypes.h new file mode 100644 index 00000000..cceea945 --- /dev/null +++ b/main/source/common/damagetypes.h @@ -0,0 +1,58 @@ +#ifndef DAMAGETYPES_H +#define DAMAGETYPES_H + +#define DMG_GENERIC 0 // generic damage was done +#define DMG_CRUSH (1 << 0) // crushed by falling or moving object +#define DMG_BULLET (1 << 1) // shot +#define DMG_SLASH (1 << 2) // cut, clawed, stabbed +#define DMG_BURN (1 << 3) // heat burned +#define DMG_FREEZE (1 << 4) // frozen +#define DMG_FALL (1 << 5) // fell too far +#define DMG_BLAST (1 << 6) // explosive blast damage +#define DMG_CLUB (1 << 7) // crowbar, punch, headbutt +#define DMG_SHOCK (1 << 8) // electric shock +#define DMG_SONIC (1 << 9) // sound pulse shockwave +#define DMG_ENERGYBEAM (1 << 10) // laser or other high energy beam +#define DMG_NEVERGIB (1 << 12) // with this bit OR'd in, no damage type will be able to gib victims upon death +#define DMG_ALWAYSGIB (1 << 13) // with this bit OR'd in, any damage type can be made to gib victims upon death. +#define DMG_DROWN (1 << 14) // Drowning + +// NS damage types +// Special notes: babblers count as players +#define NS_DMG_NORMAL DMG_BULLET // Normal damage against all targets +#define NS_DMG_PIERCING DMG_SONIC // Normal against players, half vs. structures +#define NS_DMG_BLAST DMG_BLAST // Normal vs. players, double vs. structures +#define NS_DMG_ORGANIC DMG_FREEZE // Only damages living things (players, living structures) +#define NS_DMG_STRUCTURAL DMG_ENERGYBEAM // Doesn't damage players +#define NS_DMG_LIGHT DMG_SHOCK // Half damage to heavily armored targets +#define NS_DMG_ACID DMG_MORTAR // Double armor damage + +// time-based damage +//mask off TF-specific stuff too +#define DMG_TIMEBASED (~(0xff003fff)) // mask for time-based damage + +#define DMG_DROWN (1 << 14) // Drowning +#define DMG_FIRSTTIMEBASED DMG_DROWN + +#define DMG_PARALYZE (1 << 15) // slows affected creature down +#define DMG_NERVEGAS (1 << 16) // nerve toxins, very bad +#define DMG_POISON (1 << 17) // blood poisioning +#define DMG_RADIATION (1 << 18) // radiation exposure +#define DMG_DROWNRECOVER (1 << 19) // drowning recovery +#define DMG_ACID (1 << 20) // toxic chemicals or acid burns +#define DMG_SLOWBURN (1 << 21) // in an oven +#define DMG_SLOWFREEZE (1 << 22) // in a subzero freezer +#define DMG_MORTAR (1 << 23) // Hit by air raid (done to distinguish grenade from mortar) + +//TF ADDITIONS +#define DMG_IGNITE (1 << 24) // Players hit by this begin to burn +#define DMG_RADIUS_MAX (1 << 25) // Radius damage with this flag doesn't decrease over distance +#define DMG_RADIUS_QUAKE (1 << 26) // Radius damage is done like Quake. 1/2 damage at 1/2 radius. +#define DMG_IGNOREARMOR (1 << 27) // Damage ignores target's armor +#define DMG_AIMED (1 << 28) // Does Hit location damage +#define DMG_WALLPIERCING (1 << 29) // Blast Damages ents through walls + +#define DMG_CALTROP (1<<30) +#define DMG_HALLUC (1<<31) + +#endif \ No newline at end of file diff --git a/main/source/common/demo_api.h b/main/source/common/demo_api.h new file mode 100644 index 00000000..f87d5ee8 --- /dev/null +++ b/main/source/common/demo_api.h @@ -0,0 +1,31 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined ( DEMO_APIH ) +#define DEMO_APIH +#ifdef _WIN32 +#pragma once +#endif + +typedef struct demo_api_s +{ + int ( *IsRecording ) ( void ); + int ( *IsPlayingback ) ( void ); + int ( *IsTimeDemo ) ( void ); + void ( *WriteBuffer ) ( int size, unsigned char *buffer ); +} demo_api_t; + +extern demo_api_t demoapi; + +#endif diff --git a/main/source/common/director_cmds.h b/main/source/common/director_cmds.h new file mode 100644 index 00000000..850ddab7 --- /dev/null +++ b/main/source/common/director_cmds.h @@ -0,0 +1,31 @@ +// director_cmds.h +// sub commands for svc_director + +#define DRC_ACTIVE 0 // tells client that he's an spectator and will get director command +#define DRC_STATUS 1 // send status infos about proxy +#define DRC_CAMERA 2 // set the actual director camera position +#define DRC_EVENT 3 // informs the dircetor about ann important game event + + +#define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important) +#define DRC_FLAG_SIDE (1<<4) +#define DRC_FLAG_DRAMATIC (1<<5) + + + +// commands of the director API function CallDirectorProc(...) + +#define DRCAPI_NOP 0 // no operation +#define DRCAPI_ACTIVE 1 // de/acivates director mode in engine +#define DRCAPI_STATUS 2 // request proxy information +#define DRCAPI_SETCAM 3 // set camera n to given position and angle +#define DRCAPI_GETCAM 4 // request camera n position and angle +#define DRCAPI_DIRPLAY 5 // set director time and play with normal speed +#define DRCAPI_DIRFREEZE 6 // freeze directo at this time +#define DRCAPI_SETVIEWMODE 7 // overview or 4 cameras +#define DRCAPI_SETOVERVIEWPARAMS 8 // sets parameter for overview mode +#define DRCAPI_SETFOCUS 9 // set the camera which has the input focus +#define DRCAPI_GETTARGETS 10 // queries engine for player list +#define DRCAPI_SETVIEWPOINTS 11 // gives engine all waypoints + + diff --git a/main/source/common/dlight.h b/main/source/common/dlight.h new file mode 100644 index 00000000..ac74c655 --- /dev/null +++ b/main/source/common/dlight.h @@ -0,0 +1,33 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined ( DLIGHTH ) +#define DLIGHTH +#ifdef _WIN32 +#pragma once +#endif + +typedef struct dlight_s +{ + vec3_t origin; + float radius; + color24 color; + float die; // stop lighting after this time + float decay; // drop this each second + float minlight; // don't add when contributing less + int key; + qboolean dark; // subtracts light instead of adding +} dlight_t; + +#endif diff --git a/main/source/common/dll_state.h b/main/source/common/dll_state.h new file mode 100644 index 00000000..403f591d --- /dev/null +++ b/main/source/common/dll_state.h @@ -0,0 +1,16 @@ +//DLL State Flags + +#define DLL_INACTIVE 0 // no dll +#define DLL_ACTIVE 1 // dll is running +#define DLL_PAUSED 2 // dll is paused +#define DLL_CLOSE 3 // closing down dll +#define DLL_TRANS 4 // Level Transition + +// DLL Pause reasons + +#define DLL_NORMAL 0 // User hit Esc or something. +#define DLL_QUIT 4 // Quit now +#define DLL_RESTART 6 // Switch to launcher for linux, does a quit but returns 1 + +// DLL Substate info ( not relevant ) +#define ENG_NORMAL (1<<0) diff --git a/main/source/common/engine_launcher_api.h b/main/source/common/engine_launcher_api.h new file mode 100644 index 00000000..fef1a650 --- /dev/null +++ b/main/source/common/engine_launcher_api.h @@ -0,0 +1,103 @@ +// engine/launcher interface +#if !defined( ENGINE_LAUNCHER_APIH ) +#define ENGINE_LAUNCHER_APIH +#ifdef _WIN32 +#pragma once +#endif + +//typedef void ( *xcommand_t ) ( void ); + +#define RENDERTYPE_UNDEFINED 0 +#define RENDERTYPE_SOFTWARE 1 +#define RENDERTYPE_HARDWARE 2 + +#define ENGINE_LAUNCHER_API_VERSION 1 + +typedef struct engine_api_s +{ + int version; + int rendertype; + int size; + + // Functions + int ( *GetEngineState ) ( void ); + void ( *Cbuf_AddText ) ( char *text ); // append cmd at end of buf + void ( *Cbuf_InsertText ) ( char *text ); // insert cmd at start of buf + void ( *Cmd_AddCommand ) ( char *cmd_name, void ( *funcname )( void ) ); + int ( *Cmd_Argc ) ( void ); + char *( *Cmd_Args ) ( void ); + char *( *Cmd_Argv ) ( int arg ); + void ( *Con_Printf ) ( char *, ... ); + void ( *Con_SafePrintf ) ( char *, ... ); + void ( *Cvar_Set ) ( char *var_name, char *value ); + void ( *Cvar_SetValue ) ( char *var_name, float value ); + int ( *Cvar_VariableInt ) ( char *var_name ); + char *( *Cvar_VariableString ) ( char *var_name ); + float ( *Cvar_VariableValue ) ( char *var_name ); + void ( *ForceReloadProfile ) ( void ); + int ( *GetGameInfo ) ( struct GameInfo_s *pGI, char *pszChannel ); + void ( *GameSetBackground ) ( int bBack ); + void ( *GameSetState ) ( int iState ); + void ( *GameSetSubState ) ( int iState ); + int ( *GetPauseState ) ( void ); + int ( *Host_Frame ) ( float time, int iState, int *stateInfo ); + void ( *Host_GetHostInfo ) ( float *fps, int *nActive, int *nSpectators, int *nMaxPlayers, char *pszMap ); + void ( *Host_Shutdown ) ( void ); + int ( *Game_Init ) ( char *lpCmdLine, unsigned char *pMem, int iSize, struct exefuncs_s *pef, void *, int ); + void ( *IN_ActivateMouse ) ( void ); + void ( *IN_ClearStates ) ( void ); + void ( *IN_DeactivateMouse ) ( void ); + void ( *IN_MouseEvent ) ( int mstate ); + void ( *Keyboard_ReturnToGame ) ( void ); + void ( *Key_ClearStates ) ( void ); + void ( *Key_Event ) ( int key, int down ); + int ( *LoadGame ) ( const char *pszSlot ); + void ( *S_BlockSound ) ( void ); + void ( *S_ClearBuffer ) ( void ); + void ( *S_GetDSPointer ) ( struct IDirectSound **lpDS, struct IDirectSoundBuffer **lpDSBuf ); + void *( *S_GetWAVPointer ) ( void ); + void ( *S_UnblockSound ) ( void ); + int ( *SaveGame ) ( const char *pszSlot, const char *pszComment ); + void ( *SetAuth ) ( void *pobj ); + void ( *SetMessagePumpDisableMode ) ( int bMode ); + void ( *SetPauseState ) ( int bPause ); + void ( *SetStartupMode ) ( int bMode ); + void ( *SNDDMA_Shutdown ) ( void ); + void ( *Snd_AcquireBuffer ) ( void ); + void ( *Snd_ReleaseBuffer ) ( void ); + void ( *StoreProfile ) ( void ); + double ( *Sys_FloatTime ) ( void ); + void ( *VID_UpdateWindowVars ) ( void *prc, int x, int y ); + void ( *VID_UpdateVID ) ( struct viddef_s *pvid ); + + // VGUI interfaces + void ( *VGui_CallEngineSurfaceProc ) ( void* hwnd, unsigned int msg, unsigned int wparam, long lparam ); + + // notifications that the launcher is taking/giving focus to the engine + void ( *EngineTakingFocus ) ( void ); + void ( *LauncherTakingFocus ) ( void ); + +#ifdef _WIN32 + // Only filled in by rendertype RENDERTYPE_HARDWARE + void ( *GL_Init ) ( void ); + int ( *GL_SetMode ) ( HWND hwndGame, HDC *pmaindc, HGLRC *pbaseRC, int fD3D, const char *p, const char *pszCmdLine ); + void ( *GL_Shutdown ) ( HWND hwnd, HDC hdc, HGLRC hglrc ); + + void ( *QGL_D3DShared ) ( struct tagD3DGlobals *d3dGShared ); + + int ( WINAPI *glSwapBuffers ) ( HDC dc ); + void ( *DirectorProc ) ( unsigned int cmd, void * params ); +#else + // NOT USED IN LINUX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + void ( *GL_Init ) ( void ); + void ( *GL_SetMode ) ( void ); + void ( *GL_Shutdown ) ( void ); + void ( *QGL_D3DShared ) ( void ); + void ( *glSwapBuffers ) ( void ); + void ( *DirectorProc ) ( void ); + // LINUX +#endif + +} engine_api_t; + +#endif // ENGINE_LAUNCHER_APIH diff --git a/main/source/common/entity_state.h b/main/source/common/entity_state.h new file mode 100644 index 00000000..ee9b0cd9 --- /dev/null +++ b/main/source/common/entity_state.h @@ -0,0 +1,194 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( ENTITY_STATEH ) +#define ENTITY_STATEH +#ifdef _WIN32 +#pragma once +#endif +#include "common/const.h" + +// For entityType below +#define ENTITY_NORMAL (1<<0) +#define ENTITY_BEAM (1<<1) + +// Entity state is used for the baseline and for delta compression of a packet of +// entities that is sent to a client. +typedef struct entity_state_s entity_state_t; + +struct entity_state_s +{ +// Fields which are filled in by routines outside of delta compression + int entityType; + // Index into cl_entities array for this entity. + int number; + float msg_time; + + // Message number last time the player/entity state was updated. + int messagenum; + + // Fields which can be transitted and reconstructed over the network stream + vec3_t origin; + vec3_t angles; + + int modelindex; + int sequence; + float frame; + int colormap; + short skin; + short solid; + int effects; + float scale; + + byte eflags; + + // Render information + int rendermode; + int renderamt; + color24 rendercolor; + int renderfx; + + int movetype; + float animtime; + float framerate; + int body; + byte controller[4]; + byte blending[4]; + vec3_t velocity; + + // Send bbox down to client for use during prediction. + vec3_t mins; + vec3_t maxs; + + int aiment; + // If owned by a player, the index of that player ( for projectiles ). + int owner; + + // Friction, for prediction. + float friction; + // Gravity multiplier + float gravity; + +// PLAYER SPECIFIC + int team; + int playerclass; + int health; + qboolean spectator; + int weaponmodel; + int gaitsequence; + // If standing on conveyor, e.g. + vec3_t basevelocity; + // Use the crouched hull, or the regular player hull. + int usehull; + // Latched buttons last time state updated. + int oldbuttons; + // -1 = in air, else pmove entity number + int onground; + int iStepLeft; + // How fast we are falling + float flFallVelocity; + + float fov; + int weaponanim; + + // Parametric movement overrides + vec3_t startpos; + vec3_t endpos; + float impacttime; + float starttime; + + // For mods + int iuser1; + int iuser2; + int iuser3; + int iuser4; + float fuser1; + float fuser2; + float fuser3; + float fuser4; + vec3_t vuser1; + vec3_t vuser2; + vec3_t vuser3; + vec3_t vuser4; +}; + +#include "pm_info.h" + +typedef struct clientdata_s +{ + vec3_t origin; + vec3_t velocity; + + int viewmodel; + vec3_t punchangle; + int flags; + int waterlevel; + int watertype; + vec3_t view_ofs; + float health; + + int bInDuck; + + int weapons; // remove? + + int flTimeStepSound; + int flDuckTime; + int flSwimTime; + int waterjumptime; + + float maxspeed; + + float fov; + int weaponanim; + + int m_iId; + int ammo_shells; + int ammo_nails; + int ammo_cells; + int ammo_rockets; + float m_flNextAttack; + + int tfstate; + + int pushmsec; + + int deadflag; + + char physinfo[ MAX_PHYSINFO_STRING ]; + + // For mods + int iuser1; + int iuser2; + int iuser3; + int iuser4; + float fuser1; + float fuser2; + float fuser3; + float fuser4; + vec3_t vuser1; + vec3_t vuser2; + vec3_t vuser3; + vec3_t vuser4; +} clientdata_t; + +#include "weaponinfo.h" + +typedef struct local_state_s +{ + entity_state_t playerstate; + clientdata_t client; + weapon_data_t weapondata[ 32 ]; +} local_state_t; + +#endif // !ENTITY_STATEH diff --git a/main/source/common/entity_types.h b/main/source/common/entity_types.h new file mode 100644 index 00000000..856a61bf --- /dev/null +++ b/main/source/common/entity_types.h @@ -0,0 +1,26 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// entity_types.h +#if !defined( ENTITY_TYPESH ) +#define ENTITY_TYPESH + +#define ET_NORMAL 0 +#define ET_PLAYER 1 +#define ET_TEMPENTITY 2 +#define ET_BEAM 3 +// BMODEL or SPRITE that was split across BSP nodes +#define ET_FRAGMENTED 4 + +#endif // !ENTITY_TYPESH diff --git a/main/source/common/event_api.h b/main/source/common/event_api.h new file mode 100644 index 00000000..466f3b40 --- /dev/null +++ b/main/source/common/event_api.h @@ -0,0 +1,51 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined ( EVENT_APIH ) +#define EVENT_APIH +#ifdef _WIN32 +#pragma once +#endif + +#define EVENT_API_VERSION 1 + +typedef struct event_api_s +{ + int version; + void ( *EV_PlaySound ) ( int ent, float *origin, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch ); + void ( *EV_StopSound ) ( int ent, int channel, const char *sample ); + int ( *EV_FindModelIndex )( const char *pmodel ); + int ( *EV_IsLocal ) ( int playernum ); + int ( *EV_LocalPlayerDucking ) ( void ); + void ( *EV_LocalPlayerViewheight ) ( float * ); + void ( *EV_LocalPlayerBounds ) ( int hull, float *mins, float *maxs ); + int ( *EV_IndexFromTrace) ( struct pmtrace_s *pTrace ); + struct physent_s *( *EV_GetPhysent ) ( int idx ); + void ( *EV_SetUpPlayerPrediction ) ( int dopred, int bIncludeLocalClient ); + void ( *EV_PushPMStates ) ( void ); + void ( *EV_PopPMStates ) ( void ); + void ( *EV_SetSolidPlayers ) (int playernum); + void ( *EV_SetTraceHull ) ( int hull ); + void ( *EV_PlayerTrace ) ( float *start, float *end, int traceFlags, int ignore_pe, struct pmtrace_s *tr ); + void ( *EV_WeaponAnimation ) ( int sequence, int body ); + unsigned short ( *EV_PrecacheEvent ) ( int type, const char* psz ); + void ( *EV_PlaybackEvent ) ( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); + const char *( *EV_TraceTexture ) ( int ground, float *vstart, float *vend ); + void ( *EV_StopAllSounds ) ( int entnum, int entchannel ); + void ( *EV_KillEvents ) ( int entnum, const char *eventname ); +} event_api_t; + +extern event_api_t eventapi; + +#endif diff --git a/main/source/common/event_args.h b/main/source/common/event_args.h new file mode 100644 index 00000000..acbe8c34 --- /dev/null +++ b/main/source/common/event_args.h @@ -0,0 +1,50 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( EVENT_ARGSH ) +#define EVENT_ARGSH +#ifdef _WIN32 +#pragma once +#endif + +// Event was invoked with stated origin +#define FEVENT_ORIGIN ( 1<<0 ) + +// Event was invoked with stated angles +#define FEVENT_ANGLES ( 1<<1 ) + +typedef struct event_args_s +{ + int flags; + + // Transmitted + int entindex; + + float origin[3]; + float angles[3]; + float velocity[3]; + + int ducking; + + float fparam1; + float fparam2; + + int iparam1; + int iparam2; + + int bparam1; + int bparam2; +} event_args_t; + +#endif diff --git a/main/source/common/event_flags.h b/main/source/common/event_flags.h new file mode 100644 index 00000000..9e1aa545 --- /dev/null +++ b/main/source/common/event_flags.h @@ -0,0 +1,47 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( EVENT_FLAGSH ) +#define EVENT_FLAGSH +#ifdef _WIN32 +#pragma once +#endif + +// Skip local host for event send. +#define FEV_NOTHOST (1<<0) + +// Send the event reliably. You must specify the origin and angles and use +// PLAYBACK_EVENT_FULL for this to work correctly on the server for anything +// that depends on the event origin/angles. I.e., the origin/angles are not +// taken from the invoking edict for reliable events. +#define FEV_RELIABLE (1<<1) + +// Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC +// sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ). +#define FEV_GLOBAL (1<<2) + +// If this client already has one of these events in its queue, just update the event instead of sending it as a duplicate +// +#define FEV_UPDATE (1<<3) + +// Only send to entity specified as the invoker +#define FEV_HOSTONLY (1<<4) + +// Only send if the event was created on the server. +#define FEV_SERVER (1<<5) + +// Only issue event client side ( from shared code ) +#define FEV_CLIENT (1<<6) + +#endif diff --git a/main/source/common/exefuncs.h b/main/source/common/exefuncs.h new file mode 100644 index 00000000..a82f7dce --- /dev/null +++ b/main/source/common/exefuncs.h @@ -0,0 +1,43 @@ +// exefuncs.h +#ifndef EXEFUNCS_H +#define EXEFUNCS_H + +// Engine hands this to DLLs for functionality callbacks +typedef struct exefuncs_s +{ + int fMMX; + int iCPUMhz; + void (*unused1)(void); + void (*unused2)(void); + void (*unused3)(void); + void (*unused4)(void); + void (*VID_ForceLockState)(int lk); + int (*VID_ForceUnlockedAndReturnState)(void); + void (*unused5)(void); + void (*unused6)(void); + void (*unused7)(void); + void (*unused8)(void); + void (*unused9)(void); + void (*unused10)(void); + void (*unused11)(void); + void (*unused12)(void); + void (*unused13)(void); + void (*unused14)(void); + void (*unused15)(void); + void (*ErrorMessage)(int nLevel, const char *pszErrorMessage); + void (*unused16)(void); + void (*Sys_Printf)(char *fmt, ...); + void (*unused17)(void); + void (*unused18)(void); + void (*unused19)(void); + void (*unused20)(void); + void (*unused21)(void); + void (*unused22)(void); + void (*unused23)(void); + void (*unused24)(void); + void (*unused25)(void); + void (*unused26)(void); + void (*unused27)(void); +} exefuncs_t; + +#endif diff --git a/main/source/common/hldm.h b/main/source/common/hldm.h new file mode 100644 index 00000000..2c27445b --- /dev/null +++ b/main/source/common/hldm.h @@ -0,0 +1,33 @@ +//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. ========= +// +// The copyright to the contents herein is the property of Charles G. Cleveland. +// The contents may be used and/or copied only with the written permission of +// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: +// +// $Workfile: hldm.h $ +// $Date: 2002/08/02 21:42:34 $ +// +//------------------------------------------------------------------------------- +// $Log: hldm.h,v $ +// Revision 1.4 2002/08/02 21:42:34 Flayra +// - Allow ability to control how often a ricochet sound plays +// +// Revision 1.3 2002/07/08 16:17:46 Flayra +// - Reworked bullet firing to add random spread (bug #236) +// +//=============================================================================== +#ifndef HLDM_H +#define HLDM_H + +#include "common/pmtrace.h" + +void EV_HLDM_GunshotDecalTrace( pmtrace_t *pTrace, char *decalName, int inChanceOfSound = 1); +void EV_HLDM_DecalGunshot( pmtrace_t *pTrace, int iBulletType, int inChanceOfSound = 1); +int EV_HLDM_CheckTracer( int idx, float *vecSrc, float *end, float *forward, float *right, int iBulletType, int iTracerFreq, int *tracerCount ); +void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int cShots, float *vecSrc, float *vecDirShooting, float flDistance, int iBulletType, int iTracerFreq, int *tracerCount, float flSpreadX, float flSpreadY ); +void EV_HLDM_FireBulletsPlayer( int idx, float *forward, float *right, float *up, int cShots, float *vecSrc, float *vecDirShooting, float flDistance, int iBulletType, int iTracerFreq, int *tracerCount, Vector& inSpread, int inRandomSeed); + +#endif \ No newline at end of file diff --git a/main/source/common/hltv.h b/main/source/common/hltv.h new file mode 100644 index 00000000..ff00d249 --- /dev/null +++ b/main/source/common/hltv.h @@ -0,0 +1,57 @@ +//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// hltv.h +// all shared consts between server, clients and proxy + +#ifndef HLTV_H +#define HLTV_H + +#define TYPE_CLIENT 0 // client is a normal HL client (default) +#define TYPE_PROXY 1 // client is another proxy +#define TYPE_COMMENTATOR 3 // client is a commentator +#define TYPE_DEMO 4 // client is a demo file +// sub commands of svc_hltv: +#define HLTV_ACTIVE 0 // tells client that he's an spectator and will get director commands +#define HLTV_STATUS 1 // send status infos about proxy +#define HLTV_LISTEN 2 // tell client to listen to a multicast stream + +// sub commands of svc_director: +#define DRC_CMD_NONE 0 // NULL director command +#define DRC_CMD_START 1 // start director mode +#define DRC_CMD_EVENT 2 // informs about director command +#define DRC_CMD_MODE 3 // switches camera modes +#define DRC_CMD_CAMERA 4 // sets camera registers +#define DRC_CMD_TIMESCALE 5 // sets time scale +#define DRC_CMD_MESSAGE 6 // send HUD centerprint +#define DRC_CMD_SOUND 7 // plays a particular sound +#define DRC_CMD_STATUS 8 // status info about broadcast +#define DRC_CMD_BANNER 9 // banner file name for HLTV gui +#define DRC_CMD_FADE 10 // send screen fade command +#define DRC_CMD_SHAKE 11 // send screen shake command +#define DRC_CMD_STUFFTEXT 12 // like the normal svc_stufftext but as director command + +#define DRC_CMD_LAST 12 + + + +// HLTV_EVENT event flags +#define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important) +#define DRC_FLAG_SIDE (1<<4) // +#define DRC_FLAG_DRAMATIC (1<<5) // is a dramatic scene +#define DRC_FLAG_SLOWMOTION (1<<6) // would look good in SloMo +#define DRC_FLAG_FACEPLAYER (1<<7) // player is doning something (reload/defuse bomb etc) +#define DRC_FLAG_INTRO (1<<8) // is a introduction scene +#define DRC_FLAG_FINAL (1<<9) // is a final scene +#define DRC_FLAG_NO_RANDOM (1<<10) // don't randomize event data + + +#define MAX_DIRECTOR_CMD_PARAMETERS 4 +#define MAX_DIRECTOR_CMD_STRING 128 + + +#endif // HLTV_H diff --git a/main/source/common/in_buttons.h b/main/source/common/in_buttons.h new file mode 100644 index 00000000..1894b0a6 --- /dev/null +++ b/main/source/common/in_buttons.h @@ -0,0 +1,38 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#ifndef IN_BUTTONS_H +#define IN_BUTTONS_H +#ifdef _WIN32 +#pragma once +#endif + +#define IN_ATTACK (1 << 0) +#define IN_JUMP (1 << 1) +#define IN_DUCK (1 << 2) +#define IN_FORWARD (1 << 3) +#define IN_BACK (1 << 4) +#define IN_USE (1 << 5) +#define IN_CANCEL (1 << 6) +#define IN_LEFT (1 << 7) +#define IN_RIGHT (1 << 8) +#define IN_MOVELEFT (1 << 9) +#define IN_MOVERIGHT (1 << 10) +#define IN_ATTACK2 (1 << 11) +#define IN_RUN (1 << 12) +#define IN_RELOAD (1 << 13) +#define IN_ALT1 (1 << 14) +#define IN_SCORE (1 << 15) // Used by client.dll for when scoreboard is held down + +#endif // IN_BUTTONS_H diff --git a/main/source/common/interface.cpp b/main/source/common/interface.cpp new file mode 100644 index 00000000..42f4801d --- /dev/null +++ b/main/source/common/interface.cpp @@ -0,0 +1,144 @@ + +#include +#include +#include "interface.h" + +#ifndef _WIN32 // LINUX +#include +#include // getcwd +#include // sprintf +#endif + + +// ------------------------------------------------------------------------------------ // +// InterfaceReg. +// ------------------------------------------------------------------------------------ // +InterfaceReg *InterfaceReg::s_pInterfaceRegs = NULL; + + +InterfaceReg::InterfaceReg( InstantiateInterfaceFn fn, const char *pName ) : + m_pName(pName) +{ + m_CreateFn = fn; + m_pNext = s_pInterfaceRegs; + s_pInterfaceRegs = this; +} + + + +// ------------------------------------------------------------------------------------ // +// CreateInterface. +// ------------------------------------------------------------------------------------ // +EXPORT_FUNCTION IBaseInterface *CreateInterface( const char *pName, int *pReturnCode ) +{ + InterfaceReg *pCur; + + for(pCur=InterfaceReg::s_pInterfaceRegs; pCur; pCur=pCur->m_pNext) + { + if(strcmp(pCur->m_pName, pName) == 0) + { + if ( pReturnCode ) + { + *pReturnCode = IFACE_OK; + } + return pCur->m_CreateFn(); + } + } + + if ( pReturnCode ) + { + *pReturnCode = IFACE_FAILED; + } + return NULL; +} + + +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include "windows.h" +#endif + + +#ifdef _WIN32 +HINTERFACEMODULE Sys_LoadModule(const char *pModuleName) +{ + return (HINTERFACEMODULE)LoadLibrary(pModuleName); +} + +#else // LINUX +HINTERFACEMODULE Sys_LoadModule(const char *pModuleName) +{ + // Linux dlopen() doesn't look in the current directory for libraries. + // We tell it to, so people don't have to 'install' libraries as root. + + char szCwd[1024]; + char szAbsoluteLibFilename[1024]; + + getcwd( szCwd, sizeof( szCwd ) ); + if ( szCwd[ strlen( szCwd ) - 1 ] == '/' ) + szCwd[ strlen( szCwd ) - 1 ] = 0; + + sprintf( szAbsoluteLibFilename, "%s/%s", szCwd, pModuleName ); + + return (HINTERFACEMODULE)dlopen( szAbsoluteLibFilename, RTLD_NOW ); +} + +#endif + + +#ifdef _WIN32 +void Sys_FreeModule(HINTERFACEMODULE hModule) +{ + if(!hModule) + return; + + FreeLibrary((HMODULE)hModule); +} + +#else // LINUX +void Sys_FreeModule(HINTERFACEMODULE hModule) +{ + if(!hModule) + return; + + dlclose( (void *)hModule ); +} + +#endif + + +//----------------------------------------------------------------------------- +// Purpose: returns the instance of this module +// Output : interface_instance_t +//----------------------------------------------------------------------------- +CreateInterfaceFn Sys_GetFactoryThis( void ) +{ + return CreateInterface; +} + + +//----------------------------------------------------------------------------- +// Purpose: returns the instance of the named module +// Input : *pModuleName - name of the module +// Output : interface_instance_t - instance of that module +//----------------------------------------------------------------------------- + +#ifdef _WIN32 +CreateInterfaceFn Sys_GetFactory( HINTERFACEMODULE hModule ) +{ + if(!hModule) + return NULL; + + return (CreateInterfaceFn)GetProcAddress((HMODULE)hModule, CREATEINTERFACE_PROCNAME); +} + +#else // LINUX +CreateInterfaceFn Sys_GetFactory( HINTERFACEMODULE hModule ) +{ + if(!hModule) + return NULL; + + return (CreateInterfaceFn)dlsym( (void *)hModule, CREATEINTERFACE_PROCNAME ); +} + +#endif diff --git a/main/source/common/interface.h b/main/source/common/interface.h new file mode 100644 index 00000000..8099662a --- /dev/null +++ b/main/source/common/interface.h @@ -0,0 +1,123 @@ + +// This header defines the interface convention used in the valve engine. +// To make an interface and expose it: +// 1. Derive from IBaseInterface. +// 2. The interface must be ALL pure virtuals, and have no data members. +// 3. Define a name for it. +// 4. In its implementation file, use EXPOSE_INTERFACE or EXPOSE_SINGLE_INTERFACE. + +// Versioning +// There are two versioning cases that are handled by this: +// 1. You add functions to the end of an interface, so it is binary compatible with the previous interface. In this case, +// you need two EXPOSE_INTERFACEs: one to expose your class as the old interface and one to expose it as the new interface. +// 2. You update an interface so it's not compatible anymore (but you still want to be able to expose the old interface +// for legacy code). In this case, you need to make a new version name for your new interface, and make a wrapper interface and +// expose it for the old interface. + +#ifndef INTERFACE_H +#define INTERFACE_H + +#ifdef __cplusplus + +// All interfaces derive from this. +class IBaseInterface +{ +public: + + virtual ~IBaseInterface() {} +}; + + +#define CREATEINTERFACE_PROCNAME "CreateInterface" +typedef IBaseInterface* (*CreateInterfaceFn)(const char *pName, int *pReturnCode); + + +typedef IBaseInterface* (*InstantiateInterfaceFn)(); + + +// Used internally to register classes. +class InterfaceReg +{ +public: + InterfaceReg(InstantiateInterfaceFn fn, const char *pName); + +public: + + InstantiateInterfaceFn m_CreateFn; + const char *m_pName; + + InterfaceReg *m_pNext; // For the global list. + static InterfaceReg *s_pInterfaceRegs; +}; + + +// Use this to expose an interface that can have multiple instances. +// e.g.: +// EXPOSE_INTERFACE( CInterfaceImp, IInterface, "MyInterface001" ) +// This will expose a class called CInterfaceImp that implements IInterface (a pure class) +// clients can receive a pointer to this class by calling CreateInterface( "MyInterface001" ) +// +// In practice, the shared header file defines the interface (IInterface) and version name ("MyInterface001") +// so that each component can use these names/vtables to communicate +// +// A single class can support multiple interfaces through multiple inheritance +// +#define EXPOSE_INTERFACE_FN(functionName, interfaceName, versionName) \ + static InterfaceReg __g_Create##className##_reg(functionName, versionName); + +#define EXPOSE_INTERFACE(className, interfaceName, versionName) \ + static IBaseInterface* __Create##className##_interface() {return (interfaceName *)new className;}\ + static InterfaceReg __g_Create##className##_reg(__Create##className##_interface, versionName ); + +// Use this to expose a singleton interface with a global variable you've created. +#define EXPOSE_SINGLE_INTERFACE_GLOBALVAR(className, interfaceName, versionName, globalVarName) \ + static IBaseInterface* __Create##className##interfaceName##_interface() {return (interfaceName *)&globalVarName;}\ + static InterfaceReg __g_Create##className##interfaceName##_reg(__Create##className##interfaceName##_interface, versionName); + +// Use this to expose a singleton interface. This creates the global variable for you automatically. +#define EXPOSE_SINGLE_INTERFACE(className, interfaceName, versionName) \ + static className __g_##className##_singleton;\ + EXPOSE_SINGLE_INTERFACE_GLOBALVAR(className, interfaceName, versionName, __g_##className##_singleton) + + +#ifdef WIN32 + #define EXPORT_FUNCTION __declspec(dllexport) +#else + #define EXPORT_FUNCTION +#endif + + +// This function is automatically exported and allows you to access any interfaces exposed with the above macros. +// if pReturnCode is set, it will return one of the following values +// extend this for other error conditions/code +enum +{ + IFACE_OK = 0, + IFACE_FAILED +}; + + +extern "C" +{ + EXPORT_FUNCTION IBaseInterface* CreateInterface(const char *pName, int *pReturnCode); +}; + + +// Handle to an interface (HInterfaceModule_t* is just there for type safety). +typedef struct HInterfaceModule_t* HINTERFACEMODULE; + + +// Use these to load and unload a module. +extern HINTERFACEMODULE Sys_LoadModule(const char *pModuleName); +extern void Sys_FreeModule(HINTERFACEMODULE hModule); + +// Use these to get the factory function from either a loaded module or the current module. +extern CreateInterfaceFn Sys_GetFactory( HINTERFACEMODULE hModule ); +extern CreateInterfaceFn Sys_GetFactoryThis( void ); + +#endif // __cplusplus + +#endif + + + diff --git a/main/source/common/itrackeruser.h b/main/source/common/itrackeruser.h new file mode 100644 index 00000000..5ba185c9 --- /dev/null +++ b/main/source/common/itrackeruser.h @@ -0,0 +1,46 @@ +//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef ITRACKERUSER_H +#define ITRACKERUSER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "interface.h" + +//----------------------------------------------------------------------------- +// Purpose: Interface to accessing information about tracker users +//----------------------------------------------------------------------------- +class ITrackerUser : public IBaseInterface +{ +public: + // returns true if the interface is ready for use + virtual bool IsValid() = 0; + + // returns the tracker ID of the current user + virtual int GetTrackerID() = 0; + + // returns information about a user + // information may not be known about some users, "" will be returned + virtual const char *GetUserName(int trackerID) = 0; + virtual const char *GetFirstName(int trackerID) = 0; + virtual const char *GetLastName(int trackerID) = 0; + virtual const char *GetEmail(int trackerID) = 0; + + // returns true if friendID is a friend of the current user + // ie. the current is authorized to see when the friend is online + virtual bool IsFriend(int friendID) = 0; + + // requests authorization from a user + virtual void RequestAuthorizationFromUser(int potentialFriendID) = 0; +}; + +#define TRACKERUSER_INTERFACE_VERSION "TrackerUser001" + + +#endif // ITRACKERUSER_H diff --git a/main/source/common/ivoicetweak.h b/main/source/common/ivoicetweak.h new file mode 100644 index 00000000..9c39a5fe --- /dev/null +++ b/main/source/common/ivoicetweak.h @@ -0,0 +1,35 @@ +//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef IVOICETWEAK_H +#define IVOICETWEAK_H +#ifdef _WIN32 +#pragma once +#endif + +// These provide access to the voice controls. +typedef enum +{ + MicrophoneVolume=0, // values 0-1. + OtherSpeakerScale // values 0-1. Scales how loud other players are. +} VoiceTweakControl; + + +typedef struct IVoiceTweak_s +{ + // These turn voice tweak mode on and off. While in voice tweak mode, the user's voice is echoed back + // without sending to the server. + int (*StartVoiceTweakMode)(); // Returns 0 on error. + void (*EndVoiceTweakMode)(); + + // Get/set control values. + void (*SetControlFloat)(VoiceTweakControl iControl, float value); + float (*GetControlFloat)(VoiceTweakControl iControl); +} IVoiceTweak; + + +#endif // IVOICETWEAK_H diff --git a/main/source/common/mathlib.h b/main/source/common/mathlib.h new file mode 100644 index 00000000..7d62c4c8 --- /dev/null +++ b/main/source/common/mathlib.h @@ -0,0 +1,154 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// mathlib.h +#ifndef MATHLIB_H +#define MATHLIB_H + +typedef float vec_t; +typedef vec_t vec3_t[3]; +typedef vec_t vec4_t[4]; // x,y,z,w +typedef vec_t vec5_t[5]; + +typedef short vec_s_t; +typedef vec_s_t vec3s_t[3]; +typedef vec_s_t vec4s_t[4]; // x,y,z,w +typedef vec_s_t vec5s_t[5]; + +typedef int fixed4_t; +typedef int fixed8_t; +typedef int fixed16_t; + +#ifndef M_PI +#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h +#endif + +struct mplane_s; + +extern vec3_t vec3_origin; +extern int nanmask; + +#define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) + +#include "common/vec_op.h" +//#ifndef VECTOR_H +// #define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) +//#endif +// +//#define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];} +//#define VectorAdd(a,b,c) {(c)[0]=(a)[0]+(b)[0];(c)[1]=(a)[1]+(b)[1];(c)[2]=(a)[2]+(b)[2];} +//#define VectorCopy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];(b)[2]=(a)[2];} +//#define VectorClear(a) {(a)[0]=0.0;(a)[1]=0.0;(a)[2]=0.0;} + +//void VectorMA (const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc); + +vec_t _DotProduct (vec3_t v1, vec3_t v2); +void _VectorSubtract (vec3_t veca, vec3_t vecb, vec3_t out); +void _VectorAdd (vec3_t veca, vec3_t vecb, vec3_t out); +void _VectorCopy (vec3_t in, vec3_t out); + +int VectorCompare (const vec3_t v1, const vec3_t v2); +//float Length (const vec3_t v); +void CrossProduct (const vec3_t v1, const vec3_t v2, vec3_t cross); +//float VectorNormalize (vec3_t v); // returns vector length +void VectorInverse (vec3_t v); +//void VectorScale (const vec3_t in, vec_t scale, vec3_t out); +int Q_log2(int val); + +void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]); +void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]); + +// Here are some "manual" INLINE routines for doing floating point to integer conversions +extern short new_cw, old_cw; + +typedef union DLONG { + int i[2]; + double d; + float f; + } DLONG; + +extern DLONG dlong; + +#ifdef _WIN32 +void __inline set_fpu_cw(void) +{ +_asm + { wait + fnstcw old_cw + wait + mov ax, word ptr old_cw + or ah, 0xc + mov word ptr new_cw,ax + fldcw new_cw + } +} + +int __inline quick_ftol(float f) +{ + _asm { + // Assumes that we are already in chop mode, and only need a 32-bit int + fld DWORD PTR f + fistp DWORD PTR dlong + } + return dlong.i[0]; +} + +void __inline restore_fpu_cw(void) +{ + _asm fldcw old_cw +} +#else +#define set_fpu_cw() /* */ +#define quick_ftol(f) ftol(f) +#define restore_fpu_cw() /* */ +#endif + +void FloorDivMod (double numer, double denom, int *quotient, + int *rem); +fixed16_t Invert24To16(fixed16_t val); +int GreatestCommonDivisor (int i1, int i2); + +void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); +void AngleVectorsTranspose (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); +#define AngleIVectors AngleVectorsTranspose + +void AngleMatrix (const vec3_t angles, float (*matrix)[4] ); +void AngleIMatrix (const vec3_t angles, float (*matrix)[4] ); +void VectorTransform (const vec3_t in1, float in2[3][4], vec3_t out); + +void VectorMatrix( vec3_t forward, vec3_t right, vec3_t up); +//void VectorAngles( const vec3_t forward, vec3_t angles ); + +int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct mplane_s *plane); +float anglemod(float a); + + + +#define BOX_ON_PLANE_SIDE(emins, emaxs, p) \ + (((p)->type < 3)? \ + ( \ + ((p)->dist <= (emins)[(p)->type])? \ + 1 \ + : \ + ( \ + ((p)->dist >= (emaxs)[(p)->type])?\ + 2 \ + : \ + 3 \ + ) \ + ) \ + : \ + BoxOnPlaneSide( (emins), (emaxs), (p))) + +#endif \ No newline at end of file diff --git a/main/source/common/net_api.h b/main/source/common/net_api.h new file mode 100644 index 00000000..769a6f23 --- /dev/null +++ b/main/source/common/net_api.h @@ -0,0 +1,92 @@ +#if !defined( NET_APIH ) +#define NET_APIH +#ifdef _WIN32 +#pragma once +#endif + +#if !defined ( NETADRH ) +#include "netadr.h" +#endif + +#define NETAPI_REQUEST_SERVERLIST ( 0 ) // Doesn't need a remote address +#define NETAPI_REQUEST_PING ( 1 ) +#define NETAPI_REQUEST_RULES ( 2 ) +#define NETAPI_REQUEST_PLAYERS ( 3 ) +#define NETAPI_REQUEST_DETAILS ( 4 ) + +// Set this flag for things like broadcast requests, etc. where the engine should not +// kill the request hook after receiving the first response +#define FNETAPI_MULTIPLE_RESPONSE ( 1<<0 ) + +typedef void ( *net_api_response_func_t ) ( struct net_response_s *response ); + +#define NET_SUCCESS ( 0 ) +#define NET_ERROR_TIMEOUT ( 1<<0 ) +#define NET_ERROR_PROTO_UNSUPPORTED ( 1<<1 ) +#define NET_ERROR_UNDEFINED ( 1<<2 ) + +typedef struct net_adrlist_s +{ + struct net_adrlist_s *next; + netadr_t remote_address; +} net_adrlist_t; + +typedef struct net_response_s +{ + // NET_SUCCESS or an error code + int error; + + // Context ID + int context; + // Type + int type; + + // Server that is responding to the request + netadr_t remote_address; + + // Response RTT ping time + double ping; + // Key/Value pair string ( separated by backlash \ characters ) + // WARNING: You must copy this buffer in the callback function, because it is freed + // by the engine right after the call!!!! + // ALSO: For NETAPI_REQUEST_SERVERLIST requests, this will be a pointer to a linked list of net_adrlist_t's + void *response; +} net_response_t; + +typedef struct net_status_s +{ + // Connected to remote server? 1 == yes, 0 otherwise + int connected; + // Client's IP address + netadr_t local_address; + // Address of remote server + netadr_t remote_address; + // Packet Loss ( as a percentage ) + int packet_loss; + // Latency, in seconds ( multiply by 1000.0 to get milliseconds ) + double latency; + // Connection time, in seconds + double connection_time; + // Rate setting ( for incoming data ) + double rate; +} net_status_t; + +typedef struct net_api_s +{ + // APIs + void ( *InitNetworking )( void ); + void ( *Status ) ( struct net_status_s *status ); + void ( *SendRequest) ( int context, int request, int flags, double timeout, struct netadr_s *remote_address, net_api_response_func_t response ); + void ( *CancelRequest ) ( int context ); + void ( *CancelAllRequests ) ( void ); + char *( *AdrToString ) ( struct netadr_s *a ); + int ( *CompareAdr ) ( struct netadr_s *a, struct netadr_s *b ); + int ( *StringToAdr ) ( char *s, struct netadr_s *a ); + const char *( *ValueForKey ) ( const char *s, const char *key ); + void ( *RemoveKey ) ( char *s, const char *key ); + void ( *SetValueForKey ) (char *s, const char *key, const char *value, int maxsize ); +} net_api_t; + +extern net_api_t netapi; + +#endif // NET_APIH \ No newline at end of file diff --git a/main/source/common/netadr.h b/main/source/common/netadr.h new file mode 100644 index 00000000..5d295244 --- /dev/null +++ b/main/source/common/netadr.h @@ -0,0 +1,40 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +// netadr.h +#ifndef NETADR_H +#define NETADR_H +#ifdef _WIN32 +#pragma once +#endif + +typedef enum +{ + NA_UNUSED, + NA_LOOPBACK, + NA_BROADCAST, + NA_IP, + NA_IPX, + NA_BROADCAST_IPX, +} netadrtype_t; + +typedef struct netadr_s +{ + netadrtype_t type; + unsigned char ip[4]; + unsigned char ipx[10]; + unsigned short port; +} netadr_t; + +#endif // NETADR_H diff --git a/main/source/common/nowin.h b/main/source/common/nowin.h new file mode 100644 index 00000000..315ac83c --- /dev/null +++ b/main/source/common/nowin.h @@ -0,0 +1,9 @@ + +#ifndef INC_NOWIN_H +#define INC_NOWIN_H +#ifndef _WIN32 + +#include + +#endif //!_WIN32 +#endif //INC_NOWIN_H \ No newline at end of file diff --git a/main/source/common/particledef.h b/main/source/common/particledef.h new file mode 100644 index 00000000..823f4fd6 --- /dev/null +++ b/main/source/common/particledef.h @@ -0,0 +1,57 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( PARTICLEDEFH ) +#define PARTICLEDEFH +#ifdef _WIN32 +#pragma once +#endif + +typedef enum { + pt_static, + pt_grav, + pt_slowgrav, + pt_fire, + pt_explode, + pt_explode2, + pt_blob, + pt_blob2, + pt_vox_slowgrav, + pt_vox_grav, + pt_clientcustom // Must have callback function specified +} ptype_t; + +// !!! if this is changed, it must be changed in d_ifacea.h too !!! +typedef struct particle_s +{ +// driver-usable fields + vec3_t org; + short color; + short packedColor; +// drivers never touch the following fields + struct particle_s *next; + vec3_t vel; + float ramp; + float die; + ptype_t type; + void (*deathfunc)( struct particle_s *particle ); + + // for pt_clientcusttom, we'll call this function each frame + void (*callback)( struct particle_s *particle, float frametime ); + + // For deathfunc, etc. + unsigned char context; +} particle_t; + +#endif diff --git a/main/source/common/pmtrace.h b/main/source/common/pmtrace.h new file mode 100644 index 00000000..071185fa --- /dev/null +++ b/main/source/common/pmtrace.h @@ -0,0 +1,43 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( PMTRACEH ) +#define PMTRACEH +#ifdef _WIN32 +#pragma once +#endif + +typedef struct +{ + vec3_t normal; + float dist; +} pmplane_t; + +typedef struct pmtrace_s pmtrace_t; + +struct pmtrace_s +{ + qboolean allsolid; // if true, plane is not valid + qboolean startsolid; // if true, the initial point was in a solid area + qboolean inopen, inwater; // End point is in empty space or in water + float fraction; // time completed, 1.0 = didn't hit anything + vec3_t endpos; // final position + pmplane_t plane; // surface normal at impact + int ent; // entity at impact + vec3_t deltavelocity; // Change in player's velocity caused by impact. + // Only run on server. + int hitgroup; +}; + +#endif diff --git a/main/source/common/qfont.h b/main/source/common/qfont.h new file mode 100644 index 00000000..3989001a --- /dev/null +++ b/main/source/common/qfont.h @@ -0,0 +1,40 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( QFONTH ) +#define QFONTH +#ifdef _WIN32 +#pragma once +#endif + +// Font stuff + +#define NUM_GLYPHS 256 + +typedef struct +{ + short startoffset; + short charwidth; +} charinfo; + +typedef struct qfont_s +{ + int width, height; + int rowcount; + int rowheight; + charinfo fontinfo[ NUM_GLYPHS ]; + byte data[4]; +} qfont_t; + +#endif // qfont.h diff --git a/main/source/common/r_efx.h b/main/source/common/r_efx.h new file mode 100644 index 00000000..436128cf --- /dev/null +++ b/main/source/common/r_efx.h @@ -0,0 +1,197 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined ( R_EFXH ) +#define R_EFXH +#ifdef _WIN32 +#pragma once +#endif + +// particle_t +#if !defined( PARTICLEDEFH ) +#include "particledef.h" +#endif + +// BEAM +#if !defined( BEAMDEFH ) +#include "beamdef.h" +#endif + +// dlight_t +#if !defined ( DLIGHTH ) +#include "dlight.h" +#endif + +// cl_entity_t +#if !defined( CL_ENTITYH ) +#include "cl_entity.h" +#endif + +/* +// FOR REFERENCE, These are the built-in tracer colors. Note, color 4 is the one +// that uses the tracerred/tracergreen/tracerblue and traceralpha cvar settings +color24 gTracerColors[] = +{ + { 255, 255, 255 }, // White + { 255, 0, 0 }, // Red + { 0, 255, 0 }, // Green + { 0, 0, 255 }, // Blue + { 0, 0, 0 }, // Tracer default, filled in from cvars, etc. + { 255, 167, 17 }, // Yellow-orange sparks + { 255, 130, 90 }, // Yellowish streaks (garg) + { 55, 60, 144 }, // Blue egon streak + { 255, 130, 90 }, // More Yellowish streaks (garg) + { 255, 140, 90 }, // More Yellowish streaks (garg) + { 200, 130, 90 }, // More red streaks (garg) + { 255, 120, 70 }, // Darker red streaks (garg) +}; +*/ + +// Temporary entity array +#define TENTPRIORITY_LOW 0 +#define TENTPRIORITY_HIGH 1 + +// TEMPENTITY flags +#define FTENT_NONE 0x00000000 +#define FTENT_SINEWAVE 0x00000001 +#define FTENT_GRAVITY 0x00000002 +#define FTENT_ROTATE 0x00000004 +#define FTENT_SLOWGRAVITY 0x00000008 +#define FTENT_SMOKETRAIL 0x00000010 +#define FTENT_COLLIDEWORLD 0x00000020 +#define FTENT_FLICKER 0x00000040 +#define FTENT_FADEOUT 0x00000080 +#define FTENT_SPRANIMATE 0x00000100 +#define FTENT_HITSOUND 0x00000200 +#define FTENT_SPIRAL 0x00000400 +#define FTENT_SPRCYCLE 0x00000800 +#define FTENT_COLLIDEALL 0x00001000 // will collide with world and slideboxes +#define FTENT_PERSIST 0x00002000 // tent is not removed when unable to draw +#define FTENT_COLLIDEKILL 0x00004000 // tent is removed upon collision with anything +#define FTENT_PLYRATTACHMENT 0x00008000 // tent is attached to a player (owner) +#define FTENT_SPRANIMATELOOP 0x00010000 // animating sprite doesn't die when last frame is displayed +#define FTENT_SPARKSHOWER 0x00020000 +#define FTENT_NOMODEL 0x00040000 // Doesn't have a model, never try to draw ( it just triggers other things ) +#define FTENT_CLIENTCUSTOM 0x00080000 // Must specify callback. Callback function is responsible for killing tempent and updating fields ( unless other flags specify how to do things ) + +typedef struct tempent_s TEMPENTITY; +typedef struct tempent_s +{ + int flags; + float die; + float frameMax; + float x; + float y; + float z; + float fadeSpeed; + float bounceFactor; + int hitSound; + void ( *hitcallback ) ( struct tempent_s *ent, struct pmtrace_s *ptr ); + void ( *callback ) ( struct tempent_s *ent, float frametime, float currenttime ); + TEMPENTITY *next; + int priority; + short clientIndex; // if attached, this is the index of the client to stick to + // if COLLIDEALL, this is the index of the client to ignore + // TENTS with FTENT_PLYRATTACHMENT MUST set the clientindex! + + vec3_t tentOffset; // if attached, client origin + tentOffset = tent origin. + cl_entity_t entity; + + // baseline.origin - velocity + // baseline.renderamt - starting fadeout intensity + // baseline.angles - angle velocity +} TEMPENTITY; + +typedef struct efx_api_s efx_api_t; + +struct efx_api_s +{ + particle_t *( *R_AllocParticle ) ( void ( *callback ) ( struct particle_s *particle, float frametime ) ); + void ( *R_BlobExplosion ) ( float * org ); + void ( *R_Blood ) ( float * org, float * dir, int pcolor, int speed ); + void ( *R_BloodSprite ) ( float * org, int colorindex, int modelIndex, int modelIndex2, float size ); + void ( *R_BloodStream ) ( float * org, float * dir, int pcolor, int speed ); + void ( *R_BreakModel ) ( float *pos, float *size, float *dir, float random, float life, int count, int modelIndex, char flags ); + void ( *R_Bubbles ) ( float * mins, float * maxs, float height, int modelIndex, int count, float speed ); + void ( *R_BubbleTrail ) ( float * start, float * end, float height, int modelIndex, int count, float speed ); + void ( *R_BulletImpactParticles ) ( float * pos ); + void ( *R_EntityParticles ) ( struct cl_entity_s *ent ); + void ( *R_Explosion ) ( float *pos, int model, float scale, float framerate, int flags ); + void ( *R_FizzEffect ) ( struct cl_entity_s *pent, int modelIndex, int density ); + void ( *R_FireField ) ( float * org, int radius, int modelIndex, int count, int flags, float life ); + void ( *R_FlickerParticles ) ( float * org ); + void ( *R_FunnelSprite ) ( float *org, int modelIndex, int reverse ); + void ( *R_Implosion ) ( float * end, float radius, int count, float life ); + void ( *R_LargeFunnel ) ( float * org, int reverse ); + void ( *R_LavaSplash ) ( float * org ); + void ( *R_MultiGunshot ) ( float * org, float * dir, float * noise, int count, int decalCount, int *decalIndices ); + void ( *R_MuzzleFlash ) ( float *pos1, int type ); + void ( *R_ParticleBox ) ( float *mins, float *maxs, unsigned char r, unsigned char g, unsigned char b, float life ); + void ( *R_ParticleBurst ) ( float * pos, int size, int color, float life ); + void ( *R_ParticleExplosion ) ( float * org ); + void ( *R_ParticleExplosion2 ) ( float * org, int colorStart, int colorLength ); + void ( *R_ParticleLine ) ( float * start, float *end, unsigned char r, unsigned char g, unsigned char b, float life ); + void ( *R_PlayerSprites ) ( int client, int modelIndex, int count, int size ); + void ( *R_Projectile ) ( float * origin, float * velocity, int modelIndex, int life, int owner, void (*hitcallback)( struct tempent_s *ent, struct pmtrace_s *ptr ) ); + void ( *R_RicochetSound ) ( float * pos ); + void ( *R_RicochetSprite ) ( float *pos, struct model_s *pmodel, float duration, float scale ); + void ( *R_RocketFlare ) ( float *pos ); + void ( *R_RocketTrail ) ( float * start, float * end, int type ); + void ( *R_RunParticleEffect ) ( float * org, float * dir, int color, int count ); + void ( *R_ShowLine ) ( float * start, float * end ); + void ( *R_SparkEffect ) ( float *pos, int count, int velocityMin, int velocityMax ); + void ( *R_SparkShower ) ( float *pos ); + void ( *R_SparkStreaks ) ( float * pos, int count, int velocityMin, int velocityMax ); + void ( *R_Spray ) ( float * pos, float * dir, int modelIndex, int count, int speed, int spread, int rendermode ); + void ( *R_Sprite_Explode ) ( TEMPENTITY *pTemp, float scale, int flags ); + void ( *R_Sprite_Smoke ) ( TEMPENTITY *pTemp, float scale ); + void ( *R_Sprite_Spray ) ( float * pos, float * dir, int modelIndex, int count, int speed, int iRand ); + void ( *R_Sprite_Trail ) ( int type, float * start, float * end, int modelIndex, int count, float life, float size, float amplitude, int renderamt, float speed ); + void ( *R_Sprite_WallPuff ) ( TEMPENTITY *pTemp, float scale ); + void ( *R_StreakSplash ) ( float * pos, float * dir, int color, int count, float speed, int velocityMin, int velocityMax ); + void ( *R_TracerEffect ) ( float * start, float * end ); + void ( *R_UserTracerParticle ) ( float * org, float * vel, float life, int colorIndex, float length, unsigned char deathcontext, void ( *deathfunc)( struct particle_s *particle ) ); + particle_t *( *R_TracerParticles ) ( float * org, float * vel, float life ); + void ( *R_TeleportSplash ) ( float * org ); + void ( *R_TempSphereModel ) ( float *pos, float speed, float life, int count, int modelIndex ); + TEMPENTITY *( *R_TempModel ) ( float *pos, float *dir, float *angles, float life, int modelIndex, int soundtype ); + TEMPENTITY *( *R_DefaultSprite ) ( float *pos, int spriteIndex, float framerate ); + TEMPENTITY *( *R_TempSprite ) ( float *pos, float *dir, float scale, int modelIndex, int rendermode, int renderfx, float a, float life, int flags ); + int ( *Draw_DecalIndex ) ( int id ); + int ( *Draw_DecalIndexFromName ) ( char *name ); + void ( *R_DecalShoot ) ( int textureIndex, int entity, int modelIndex, float * position, int flags ); + void ( *R_AttachTentToPlayer ) ( int client, int modelIndex, float zoffset, float life ); + void ( *R_KillAttachedTents ) ( int client ); + BEAM *( *R_BeamCirclePoints ) ( int type, float * start, float * end, int modelIndex, float life, float width, float amplitude, float brightness, float speed, int startFrame, float framerate, float r, float g, float b ); + BEAM *( *R_BeamEntPoint ) ( int startEnt, float * end, int modelIndex, float life, float width, float amplitude, float brightness, float speed, int startFrame, float framerate, float r, float g, float b ); + BEAM *( *R_BeamEnts ) ( int startEnt, int endEnt, int modelIndex, float life, float width, float amplitude, float brightness, float speed, int startFrame, float framerate, float r, float g, float b ); + BEAM *( *R_BeamFollow ) ( int startEnt, int modelIndex, float life, float width, float r, float g, float b, float brightness ); + void ( *R_BeamKill ) ( int deadEntity ); + BEAM *( *R_BeamLightning ) ( float * start, float * end, int modelIndex, float life, float width, float amplitude, float brightness, float speed ); + BEAM *( *R_BeamPoints ) ( float * start, float * end, int modelIndex, float life, float width, float amplitude, float brightness, float speed, int startFrame, float framerate, float r, float g, float b ); + BEAM *( *R_BeamRing ) ( int startEnt, int endEnt, int modelIndex, float life, float width, float amplitude, float brightness, float speed, int startFrame, float framerate, float r, float g, float b ); + dlight_t *( *CL_AllocDlight ) ( int key ); + dlight_t *( *CL_AllocElight ) ( int key ); + TEMPENTITY *( *CL_TempEntAlloc ) ( float * org, struct model_s *model ); + TEMPENTITY *( *CL_TempEntAllocNoModel ) ( float * org ); + TEMPENTITY *( *CL_TempEntAllocHigh ) ( float * org, struct model_s *model ); + TEMPENTITY *( *CL_TentEntAllocCustom ) ( float *origin, struct model_s *model, int high, void ( *callback ) ( struct tempent_s *ent, float frametime, float currenttime ) ); + void ( *R_GetPackedColor ) ( short *packed, short color ); + short ( *R_LookupColor ) ( unsigned char r, unsigned char g, unsigned char b ); + void ( *R_DecalRemoveAll ) ( int textureIndex ); //textureIndex points to the decal index in the array, not the actual texture index. +}; + +extern efx_api_t efx; + +#endif diff --git a/main/source/common/ref_params.h b/main/source/common/ref_params.h new file mode 100644 index 00000000..974fcc70 --- /dev/null +++ b/main/source/common/ref_params.h @@ -0,0 +1,75 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( REF_PARAMSH ) +#define REF_PARAMSH + +typedef struct ref_params_s +{ + // Output + float vieworg[3]; + float viewangles[3]; + + float forward[3]; + float right[3]; + float up[3]; + + // Client frametime; + float frametime; + // Client time + float time; + + // Misc + int intermission; + int paused; + int spectator; + int onground; + int waterlevel; + + float simvel[3]; + float simorg[3]; + + float viewheight[3]; + float idealpitch; + + float cl_viewangles[3]; + + int health; + float crosshairangle[3]; + float viewsize; + + float punchangle[3]; + int maxclients; + int viewentity; + int playernum; + int max_entities; + int demoplayback; + int hardware; + + int smoothing; + + // Last issued usercmd + struct usercmd_s *cmd; + + // Movevars + struct movevars_s *movevars; + + int viewport[4]; // the viewport coordinates x ,y , width, height + + int nextView; // the renderer calls ClientDLL_CalcRefdef() and Renderview + // so long in cycles until this value is 0 (multiple views) + int onlyClientDraw; // if !=0 nothing is drawn by the engine except clientDraw functions +} ref_params_t; + +#endif // !REF_PARAMSH diff --git a/main/source/common/renderingconst.h b/main/source/common/renderingconst.h new file mode 100644 index 00000000..f06a60f2 --- /dev/null +++ b/main/source/common/renderingconst.h @@ -0,0 +1,41 @@ +#ifndef RENDERINGCONST_H +#define RENDERINGCONST_H + +// Rendering constants +enum +{ + kRenderNormal, // src + kRenderTransColor, // c*a+dest*(1-a) + kRenderTransTexture, // src*a+dest*(1-a) + kRenderGlow, // src*a+dest -- No Z buffer checks + kRenderTransAlpha, // src*srca+dest*(1-srca) + kRenderTransAdd, // src*a+dest +}; + +enum +{ + kRenderFxNone = 0, + kRenderFxPulseSlow, + kRenderFxPulseFast, + kRenderFxPulseSlowWide, + kRenderFxPulseFastWide, + kRenderFxFadeSlow, + kRenderFxFadeFast, + kRenderFxSolidSlow, + kRenderFxSolidFast, + kRenderFxStrobeSlow, + kRenderFxStrobeFast, + kRenderFxStrobeFaster, + kRenderFxFlickerSlow, + kRenderFxFlickerFast, + kRenderFxNoDissipation, + kRenderFxDistort, // Distort/scale/translate flicker + kRenderFxHologram, // kRenderFxDistort + distance fade + kRenderFxDeadPlayer, // kRenderAmt is the player index + kRenderFxExplode, // Scale up really big! + kRenderFxGlowShell, // Glowing Shell + kRenderFxClampMinScale, // Keep this sprite from getting very small (SPRITES only!) +}; + +#endif + diff --git a/main/source/common/screenfade.h b/main/source/common/screenfade.h new file mode 100644 index 00000000..2311d06d --- /dev/null +++ b/main/source/common/screenfade.h @@ -0,0 +1,18 @@ +#if !defined( SCREENFADEH ) +#define SCREENFADEH +#ifdef _WIN32 +#pragma once +#endif + + +typedef struct screenfade_s +{ + float fadeSpeed; // How fast to fade (tics / second) (+ fade in, - fade out) + float fadeEnd; // When the fading hits maximum + float fadeTotalEnd; // Total End Time of the fade (used for FFADE_OUT) + float fadeReset; // When to reset to not fading (for fadeout and hold) + byte fader, fadeg, fadeb, fadealpha; // Fade color + int fadeFlags; // Fading flags +} screenfade_t; + +#endif // !SCREENFADEH diff --git a/main/source/common/studio_event.h b/main/source/common/studio_event.h new file mode 100644 index 00000000..8fae6f54 --- /dev/null +++ b/main/source/common/studio_event.h @@ -0,0 +1,29 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( STUDIO_EVENTH ) +#define STUDIO_EVENTH +#ifdef _WIN32 +#pragma once +#endif + +typedef struct mstudioevent_s +{ + int frame; + int event; + int type; + char options[64]; +} mstudioevent_t; + +#endif // STUDIO_EVENTH diff --git a/main/source/common/triangleapi.h b/main/source/common/triangleapi.h new file mode 100644 index 00000000..5041e0b7 --- /dev/null +++ b/main/source/common/triangleapi.h @@ -0,0 +1,59 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined( TRIANGLEAPIH ) +#define TRIANGLEAPIH +#ifdef _WIN32 +#pragma once +#endif + +typedef enum +{ + TRI_FRONT = 0, + TRI_NONE = 1, +} TRICULLSTYLE; + +#define TRI_API_VERSION 1 + +#define TRI_TRIANGLES 0 +#define TRI_TRIANGLE_FAN 1 +#define TRI_QUADS 2 +#define TRI_POLYGON 3 +#define TRI_LINES 4 +#define TRI_TRIANGLE_STRIP 5 +#define TRI_QUAD_STRIP 6 + +typedef struct triangleapi_s +{ + int version; + + void ( *RenderMode )( int mode ); + void ( *Begin )( int primitiveCode ); + void ( *End ) ( void ); + + void ( *Color4f ) ( float r, float g, float b, float a ); + void ( *Color4ub ) ( unsigned char r, unsigned char g, unsigned char b, unsigned char a ); + void ( *TexCoord2f ) ( float u, float v ); + void ( *Vertex3fv ) ( float *worldPnt ); + void ( *Vertex3f ) ( float x, float y, float z ); + void ( *Brightness ) ( float brightness ); + void ( *CullFace ) ( TRICULLSTYLE style ); + int ( *SpriteTexture ) ( struct model_s *pSpriteModel, int frame ); + int ( *WorldToScreen ) ( float *world, float *screen ); // Returns 1 if it's z clipped + void ( *Fog ) ( float flFogColor[3], float flStart, float flEnd, int bOn ); //Works just like GL_FOG, flFogColor is r/g/b. + void ( *ScreenToWorld ) ( float *screen, float *world ); + +} triangleapi_t; + +#endif // !TRIANGLEAPIH diff --git a/main/source/common/usercmd.h b/main/source/common/usercmd.h new file mode 100644 index 00000000..5f9bf82a --- /dev/null +++ b/main/source/common/usercmd.h @@ -0,0 +1,41 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#ifndef USERCMD_H +#define USERCMD_H +#ifdef _WIN32 +#pragma once +#endif + +typedef struct usercmd_s +{ + short lerp_msec; // Interpolation time on client + byte msec; // Duration in ms of command + vec3_t viewangles; // Command view angles. + +// intended velocities + float forwardmove; // Forward velocity. + float sidemove; // Sideways velocity. + float upmove; // Upward velocity. + byte lightlevel; // Light level at spot where we are standing. + unsigned short buttons; // Attack buttons + byte impulse; // Impulse command issued. + byte weaponselect; // Current weapon id + +// Experimental player impact stuff. + int impact_index; + vec3_t impact_position; +} usercmd_t; + +#endif // USERCMD_H diff --git a/main/source/common/vec_op.h b/main/source/common/vec_op.h new file mode 100644 index 00000000..1090c923 --- /dev/null +++ b/main/source/common/vec_op.h @@ -0,0 +1,10 @@ +#ifndef VECOP_H +#define VECOP_H + +#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) +#define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];} +#define VectorAdd(a,b,c) {(c)[0]=(a)[0]+(b)[0];(c)[1]=(a)[1]+(b)[1];(c)[2]=(a)[2]+(b)[2];} +#define VectorCopy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];(b)[2]=(a)[2];} +#define VectorClear(a) { a[0]=0.0;a[1]=0.0;a[2]=0.0;} + +#endif \ No newline at end of file diff --git a/main/source/common/vector_util.h b/main/source/common/vector_util.h new file mode 100644 index 00000000..0a649950 --- /dev/null +++ b/main/source/common/vector_util.h @@ -0,0 +1,14 @@ +#ifndef VECTOR_UTIL_H +#define VECTOR_UTIL_H + +#include "common/vec_op.h" + +float Length(const float *v); +void VectorMA (const float *veca, float scale, const float *vecb, float *vecc); +void VectorScale (const float *in, float scale, float *out); +float VectorNormalize (float *v); +void VectorInverse ( float *v ); + +extern vec3_t vec3_origin; + +#endif \ No newline at end of file diff --git a/main/source/common/vectorclasses.h b/main/source/common/vectorclasses.h new file mode 100644 index 00000000..c5b2f115 --- /dev/null +++ b/main/source/common/vectorclasses.h @@ -0,0 +1,97 @@ +#ifndef VECTORCLASSES_H +#define VECTORCLASSES_H + +//========================================================= +// 2DVector - used for many pathfinding and many other +// operations that are treated as planar rather than 3d. +//========================================================= +class Vector2D +{ +public: + inline Vector2D(void) { } + inline Vector2D(float X, float Y) { x = X; y = Y; } + inline Vector2D operator+(const Vector2D& v) const { return Vector2D(x+v.x, y+v.y); } + inline Vector2D operator-(const Vector2D& v) const { return Vector2D(x-v.x, y-v.y); } + inline Vector2D operator*(float fl) const { return Vector2D(x*fl, y*fl); } + inline Vector2D operator/(float fl) const { return Vector2D(x/fl, y/fl); } + + inline float Length(void) const { return (float)sqrt(x*x + y*y ); } + + inline Vector2D Normalize ( void ) const + { + Vector2D vec2; + + float flLen = Length(); + if ( flLen == 0 ) + { + return Vector2D( (float)0, (float)0 ); + } + else + { + flLen = 1 / flLen; + return Vector2D( x * flLen, y * flLen ); + } + } + + vec_t x, y; +}; + +inline float DotProduct(const Vector2D& a, const Vector2D& b) { return( a.x*b.x + a.y*b.y ); } +inline Vector2D operator*(float fl, const Vector2D& v) { return v * fl; } + +//========================================================= +// 3D Vector +//========================================================= +class Vector // same data-layout as engine's vec3_t, +{ // which is a vec_t[3] +public: + // Construction/destruction + inline Vector(void) { } + inline Vector(float X, float Y, float Z) { x = X; y = Y; z = Z; } + inline Vector(double X, double Y, double Z) { x = (float)X; y = (float)Y; z = (float)Z; } + inline Vector(int X, int Y, int Z) { x = (float)X; y = (float)Y; z = (float)Z; } + inline Vector(const Vector& v) { x = v.x; y = v.y; z = v.z; } + inline Vector(float rgfl[3]) { x = rgfl[0]; y = rgfl[1]; z = rgfl[2]; } + + // Operators + inline Vector operator-(void) const { return Vector(-x,-y,-z); } + inline int operator==(const Vector& v) const { return x==v.x && y==v.y && z==v.z; } + inline int operator!=(const Vector& v) const { return !(*this==v); } + inline Vector operator+(const Vector& v) const { return Vector(x+v.x, y+v.y, z+v.z); } + inline Vector operator-(const Vector& v) const { return Vector(x-v.x, y-v.y, z-v.z); } + inline Vector operator*(float fl) const { return Vector(x*fl, y*fl, z*fl); } + inline Vector operator/(float fl) const { return Vector(x/fl, y/fl, z/fl); } + + // Methods + inline void CopyToArray(float* rgfl) const { rgfl[0] = x, rgfl[1] = y, rgfl[2] = z; } + inline float Length(void) const { return (float)sqrt(x*x + y*y + z*z); } + operator float *() { return &x; } // Vectors will now automatically convert to float * when needed + operator const float *() const { return &x; } // Vectors will now automatically convert to float * when needed + inline Vector Normalize(void) const + { + float flLen = Length(); + if (flLen == 0) return Vector(0,0,1); // ???? + flLen = 1 / flLen; + return Vector(x * flLen, y * flLen, z * flLen); + } + + inline Vector2D Make2D ( void ) const + { + Vector2D Vec2; + + Vec2.x = x; + Vec2.y = y; + + return Vec2; + } + inline float Length2D(void) const { return (float)sqrt(x*x + y*y); } + + // Members + vec_t x, y, z; +}; + +inline Vector operator*(float fl, const Vector& v) { return v * fl; } +inline float DotProduct(const Vector& a, const Vector& b) { return(a.x*b.x+a.y*b.y+a.z*b.z); } +inline Vector CrossProduct(const Vector& a, const Vector& b) { return Vector( a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x ); } + +#endif \ No newline at end of file diff --git a/main/source/common/weaponinfo.h b/main/source/common/weaponinfo.h new file mode 100644 index 00000000..39ee1935 --- /dev/null +++ b/main/source/common/weaponinfo.h @@ -0,0 +1,52 @@ +/*** +* +* Copyright (c) 1999, 2000, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. +* +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. +* +****/ +#if !defined ( WEAPONINFOH ) +#define WEAPONINFOH +#ifdef _WIN32 +#pragma once +#endif + +// Info about weapons player might have in his/her possession +typedef struct weapon_data_s +{ + int m_iId; + int m_iClip; + + float m_flNextPrimaryAttack; + float m_flNextSecondaryAttack; + float m_flTimeWeaponIdle; + + int m_fInReload; + int m_fInSpecialReload; + float m_flNextReload; + float m_flPumpTime; + float m_fReloadTime; + + float m_fAimedDamage; + float m_fNextAimBonus; + int m_fInZoom; + int m_iWeaponState; + + int iuser1; + int iuser2; + int iuser3; + int iuser4; + float fuser1; + float fuser2; + float fuser3; + float fuser4; +} weapon_data_t; + +#endif diff --git a/main/source/curl/CHANGES b/main/source/curl/CHANGES new file mode 100644 index 00000000..a58f6d6c --- /dev/null +++ b/main/source/curl/CHANGES @@ -0,0 +1,2060 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + + Changelog + +Version 7.10.5 (19 May 2003) + +Daniel (15 May) +- Changed the order for the in_addr_t testing, as 'unsigned long' seems to be + a very common type inet_addr() returns. + +Daniel (14 May) +- George Comninos provided a fix that calls the progress meter when waiting + for FTP command responses take >1 second. It'll make applications more + "responsive" even when dealing with very slow ftp servers. + +Daniel (12 May) +- George Comninos pointed out that libcurl uploads had two quirks: + o when using FTP PORT command, it used blocking sockets! + o it could loop a long time without doing progress meter updates + Both items are fixed now. + +Daniel (9 May) +- Dan Fandrich changed CURLOPT_ENCODING to select all supported encodings if + set to "". This frees the application from having to know which encodings + the library supports. + +- Dan Fandrich pointed out we had three unnecessary files in CVS that is + generated with libtoolize, so they're now removed and libtoolize is invoked + accordingly in the buildconf script. + +- Avery Fay found out that the CURLOPT_INTERFACE way of first checking if the + given name is a network interface gave a real performance penalty on Linux, + so now we more appropriately first check if it is an IP number and if so + we don't check for a network interface with that name. + +- CURLOPT_FTP_USE_EPRT added. Set this to FALSE to disable libcurl's attempts + to use EPRT and LPRT before the traditional PORT command. The command line + tool sets this option with '--disable-eprt'. + +Version 7.10.5-pre2 (6 May 2003) + +Daniel (6 May) +- Kevin Delafield reported another case where we didn't correctly check for + EAGAIN but only EWOULDBLOCK, which caused badness on HPUX. + +Daniel (4 May) +- Ben Greear noticed that the check for 'writable argv' exited the configure + script when run for cross-compiling, which wasn't nice. Now it'll default to + no and output a warning about the fact that it was not checked for. + +Daniel (2 May) +- Added test case 62 and fixed some more on the cookie sending with a custom + Host: header set. + +Daniel (1 May) +- Andy Cedilnik fixed a few compiler warnings. + +- Made the "SSL read error: 5" error message more verbose, by adding code that + queries the OpenSSL library to fill in the error buffer. + +Daniel (30 Apr) +- Added sys/select.h include in the curl/multi.h file, after having been + reminded about this by Rich Gray. + +- I made each test set its own server requirements, thus abandoning the + previous system where the test number implied what server(s) to use for a + specific test. + +- David Balazic made curl more RFC1738-compliant for FTP URLs, by fixing so + that libcurl now uses one CWD command for each path part. A bunch of test + cases were fixed to work accordingly. + +- Cookie fixes: + + A. Save domains in jars like Mozilla does. It means all domains set in + Set-Cookie: headers are dot-prefixed. + B. Save and use the 'tailmatch' field in the Mozilla/Netscape cookie jars + (the second column). + C. Reject cookies using illegal domains in the Set-Cookie: line. Concerns + both domains with too few dots or domains that are outside the currently + operating server host's domain. + D. Set the path part by default to the one used in the request, if none was + set in the Set-Cookie line. + + To make item C really good, I also made libcurl notice custom Host: headers + and extract the host name set in there and use that as the host name for the + site we're getting the cookies from. This allows user to specify a site's + IP-address, but still be able to receive and send its cookies properly if + you provide a valid Host: name for the site. + +Daniel (29 Apr) +- Peter Kovacs provided a patch that makes the CURLINFO_CONNECT_TIME work fine + when using the multi interface (too). + +Version 7.10.5-pre1 (23 Apr 2003) + +Daniel (23 Apr) +- Upgraded to libtool 1.5. + +Daniel (22 Apr) +- Peter Sylvester pointed out that curl_easy_setopt() will always (wrongly) + return CURLE_OK no matter what happens. + +- Dan Fandrich fixed some gzip decompression bugs and flaws. + +Daniel (16 Apr) +- Fixed minor typo in man page, reported in the Debian bug tracker. + +Daniel (15 Apr) +- Fixed some FTP tests in the test suite that failed on my Solaris host, due + to the config.h not being included before the system headers. When done that + way, it did get a mixed sense of if big files are supported or not and then + stat() and fstat() (as used in test case 505) got confused and failed to + return a proper file size. + +- Formposting a file using a .html suffix is now properly set to Content-Type: text/html. + +Daniel (14 Apr) +- Fixed the SSL error handling to return proper SSL error messages again, they + broke in 7.10.4. I also attempt to track down CA cert problems and then + return the CURLE_SSL_CACERT error code. + +- The curl tool now intercepts the CURLE_SSL_CACERT error code and displays + a fairly big and explanatory error message. Kevin Roth helped me out with + the wording. + +Daniel (11 Apr) +- Nic Hines provided a second patch for gzip decompression, and fixed a bug + when deflate or gzip contents were downloaded using chunked encoding. + +- Dan Fandrich made libcurl support automatic decompression of gzip contents + (as an addition to the previous deflate support). + +- I made the CWD command during FTP session consider all 2xy codes to be OK + responses. + +Daniel (10 Apr) +- Vlad Krupin fixed a URL parsing issue. URLs that were not using a slash + after the host name, but still had "?" and parameters appended, as in + "http://hostname.com?foobar=moo", were not properly parsed by libcurl. + +Daniel (9 Apr) +- Made CURLOPT_TIMECONDITION work for FTP transfers, using the same syntax as + for HTTP. This then made -z work for ftp transfers too. Added test case 139 + and 140 for verifying this. + +- Getting the file date of an ftp file used the wrong time zone when + displayed. It is supposedly always GMT. Added test case 141 for this. + +- Made the test suite's FTP server support MDTM. + +- The default DEBUGFUNCTION, as enabled with CURLOPT_VERBOSE now outputs + CURLINFO_HEADER_IN data as well. The most notable effect from this is that + using curl -v, you get to see the incoming "headers" as well. This is + perhaps most useful when doing ftp. + +Daniel (8 Apr) +- James Bursa fixed a flaw in the Content-Type extraction code, which missed + the first letter if no space followed the colon. + +- Magnus Nilsson pointed out that share.c was missing in the MSVC project + file. + +Daniel (6 Apr) +- Ryan Weaver provided a patch that makes the CA cert bundle not get installed + anymore when 'configure --without-ssl' has been used. + +Daniel (4 Apr) +- Martijn Broenland found another cases where a server application didn't + like the boundary string used by curl when foing a multi-part/formpost. We + modified the boundary string to look like the one IE uses, as this is + probably gonna make curl work with more applications. + +Daniel (3 Apr) +- Kevin Roth reported that a bunch of tests fails on cygwin. One set fails + when using perl 5.8 (and they run fine with perl 5.6), and another set + failed because of an artifact in the test suite's FTP server that I + corrected. It turned out the FTP server code was still having a file opened + while the main test script removed it and invoked the HTTP server that + attempted to create the same file name of the file the FTP server kept open. + This operation works fine on unix, but not on cygwin. + +Version 7.10.4 (2 Apr 2003) + +Daniel (1 Apr) +- Added test case 505 to exercise FTP upload with rename done with libcurl, + and for that I had to extend the test suite's FTP server to deal with the + RNFR and RNTO commands. + +Daniel (31 Mar) +- Even more SSL config check modifications after Richard's testing. + +Version 7.10.4-pre6 (31 Mar 2003) + +Daniel (31 Mar) +- More fixes for the SSL session ID cache checks when SSL configs are changed + between connections. Based on tests and talks with Richard Bramante. + +- Guillaume Cottenceau provided a patch that added CURLOPT_UNRESTRICTED_AUTH. + When enabled, it will prevent libcurl from limiting to which host it sends + user+password to when following locations. By default, libcurl only sends + name and password to the original host used in the first URL, but with this + option set it will send the auth info to all hosts it follows location + headers to. The new tool command line option for this is named + "--location-trusted". + +- Frankie Fong reported a problem with libcurl if you re-used an easy handle + with a proxy, and you first made a https:// connction to a host and then + switched to a http:// one to the same host. libcurl would then wrongly re-use + the same connection for it and fail to get the second URL properly + +Daniel (29 Mar) +- Dan Shearer's fix that makes curl complain if invoked with nothing but "curl + -O" was applied. + +Daniel (26 Mar) +- Bryan Kemp was friendly enough to lend me an account on his Redhat 9 box and + I could fix the configure problems on redhat 8.1 and 9 in no time thanks to + this. Thanks a bunch Bryan! + +Daniel (25 Mar) +- Renamed configure.in to configure.ac + +Version 7.10.4-pre5 (25 Mar 2003) + +Daniel (25 Mar) +- Richard Bramante provided a fix for a handle re-use problem seen when you + change options on an SSL-enabled connection between requests. Previously, + changing peer verification or host verification and similar things was not + taken into account when a connection were checked for re-use and thus + enabling stricter check between requests on a re-used connection made no + difference and the connection would thus be used erroneously. + +Daniel (24 Mar) +- Götz Babin-Ebell pointed out that the ca-bundle.crt file contained a + certificate from Trustcenter that was a demo certificate only that was never + indended to be part of a CA bundle. + +Daniel (21 Mar) +- Life is a mystery. Within a time period of 17 hours, Tim Pope and Michael + Churchill filed one bug report each, both identifying problems with a second + transfer when doing persistant transfers re-using a connection. Tim's one is + #706624, labeled "Multiple uploads per handle fail" and Michael's #707003 + "Does not send Authorization: header when reusing connection". I could track + both down to the same piece of logic and it turned out libcurl was not using + new settings properly when re-using an existing connection. This concerned + both uploading and downloading and involved exactly those pieces these two + reports identified. This code has been this faulty since the day I + introduced persistant connection support in libcurl, more than 2 years ago. + +Daniel (20 Mar 2003) +- Five year anniversary. Today five years ago, the first ever curl release saw + the light of day. + +Daniel (17 Mar) +- Andy Cedilnik corrected flaws in some libcurl example-usage sources. + +Daniel (16 Mar) +- Juan F. Codagnone reported that the fix from March 2nd was incomplete. + +- Added code to the configure.in to check for select() argument types. I've + not made any code use the results just yet though. + +Daniel (15 Mar) +- Gisle Vanem provided two patches to build better on Windows. + +- Adjusted the test suite code to better make sure that the server(s) required + for a specific test is properly started before the test case is attempted. + Many tests now run a lot faster than before. + +Daniel (14 Mar) +- Another configure.in adjustment made the configure detect functions properly + on HPUX now. + +Daniel (13 Mar) +- Philippe Raoult fixed pre4-compile quirks for FreeBSD. + +Version 7.10.4-pre4 (13 Mar 2003) + +Daniel (13 Mar) +- Added a backup-check for functions that aren't found by AC_CHECK_FUNCS() + as I believe some checks on HPUX need this. At least some of the info given + to us by Rick Jones seemed to indicate this. + +Daniel (12 Mar) +- Thomas Tonino found out that if you used the curl tool to do PUT operations + as in 'curl www.foo.com/dir/ -T file' and the file name included for example + space or other characters that don't belong in URLs, curl did not properly + URL encode them before using them in the URL. + +- Added an option to configure called --enable-libgcc that simply adds -lgcc + to the LIBS variable, as this seems to be a common problem. + +- I modified the configure.in file, so that the headers are now checked in an + order of "viality". We must also make sure to use the "default headers" + parameter to AC_CHECK_HEADERS() so that headers are checked with the proper + prerequisites included (i.e all the major and generally important header + files are included there by default). This might be what we need for various + Sun, HP, AIX and Tru64 systems to behave good again on the header check + front. + +- Rick Jones pointed out a few compiler warnings on HP-UX that I addressed. + +- I made the configure --help output nicer by using AC_HELP_STRING() a lot + more. + +Daniel (11 Mar) +- Christophe Demory fixed the socket sending code to work better on HP-UX + when sending data to a socket that would block. It then returns EAGAIN, not + EWOULDBLOCK. + +- Richard Gorton improved the seeding function for systems without a good + and reliable random source. + +- Richard Gorton fixed a few warnings that popped up when you built curl + using the Sun compiler on a 64bit SPARC platform. + +- Martin C. Martin fixed a case where a connect failure using the multi + interface didn't produce a human readable error string. + +Daniel (10 Mar) +- Reverted ltmain.sh back to libtool 1.4.2 status again, as the 1.4.3 version + broke the build on numerous platforms. It seems that libtool 1.4.3 puts some + requirements on what versions of the other tools (autoconf + automake) that + I am not familiar with and thus I couldn't fulfill at this point. + + Yes, this is more than mildly frustrating. + +Daniel (7 Mar) +- Run libtoolize version 1.4.3. + +Version 7.10.4-pre3 (4 Mar 2003) + +Daniel (3 Mar) +- Added share.obj to the VC6 and Borland libcurl makefiles. + +- Troels Walsted Hansen found and investigated a problem with libcurl on AIX, + presumably only on 4.3 or later. gethostbyname_r() is not returning data + that is possible to "keep" and cache the way libcurl does. But instead these + versions of AIX uses a gethostbyname() that works thread-safely we can + instead use the ordinary gethostbyname() and our pack_hostent() approach to + achieve what we want. The configure script now attempts to detect AIX 4.3 or + later to adjust for this. + +Daniel (2 Mar) +- Juan F. Codagnone found a problem introduced in 7.10.3 when you first did a + POST and then back to a GET using the same easy handle. + +Daniel (28 Feb) +- Removed the strequal and strnequal defines from curl/curl.h header. They + were never meant for the public header anyway. Philippe Raoult brought it + up. + +- James Bursa fixed the RISC OS build. + +Daniel (27 Feb) +- Avery Fay pointed out the very misleading curl_multi_info_read man page, and + I updated it to become more accurate. + +- Salvatore Sorrentino found a problem with FTP downloading that turned out to + be his FTP server returning size zero (0 bytes) when SIZE was used on a file + while being in BINARY mode. We now make a second check for the actual size + by scanning the RETR reply anyway, even if the SIZE command returned 0. + +Daniel (26 Feb) +- Kyle Sallee reported a case where he would do a transfer that didn't update + the progress meter properly. It turned out to be a case where libcurl would + loop a little too eagerly in the tranfer loop, which isn't really good for + the APIs, especially not the multi API. + +Version 7.10.4-pre2 (24 Feb 2003) + +Daniel (24 Feb) +- Kjetil Jacobsen found out that setting CURLOPT_MAXCONNECTS to a value higher + than 5 could cause a segfault. + +- I believe I fixed the 'Expect: 100-continue' behavior that has been broken + for a while (I think since my change dated Dec 10 2002). When this header is + used, libcurl should wait for a HTTP 100 (or timeout) before sending the + post/put data. + +Daniel (14 Feb) +- Matthew Clarke provided some info what to modify to make curl build + flawlessly on AIX 3.2.5. + +- Martin C. Martin found and fixed a problem in the multi interface when + running on Windows and trying to connect to a port without a listener. + +Daniel (13 Feb) +- Christopher R. Palmer fixed Curl_base64_encode() to deal with zeroes in the + data to encode. + +Daniel (4 Feb) +- Jean-Philippe added the first code that enables the 'share' system. This + should now enable sharing of DNS data between two curl easy handles. + +- Incorporated Nico Baggus' fixes to again compile flawlessly on VMS. + +- James Bursa corrected a bad comment in the public include file curl/multi.h + +- Peter Forret reported one of those error:00000000 cases in libcurl again + when connecting to a HTTPS site, and this time I did discover some oddities + in how curl reports SSL errors back. It could miss showing the actual error. + +Version 7.10.4-pre1 (3 Feb 2003) + +Daniel (3 Feb) +- Removed things in the docs saying capath doesn't work on Windows, as Julian + Noble told us it works fine. + +Daniel (31 Jan) +- Kevin Roth fixed the zlib build stuff in the Mingw32 makefile. + +Daniel (30 Jan) +- Kevin Roth found out that curl on Windows always checked for the CA cert + bundle using the environment variable and the path scan, even though + -k/--insecure was used. + +- Hamish Mackenzie pointed out that curl only did strict host name verifying + if capath or cainfo was used. Now it'll always do it unless -k / --insecure + is used! + +- Pavel Cenek pointed out that the Content-Type extraction was done wrongly + as the full string was not fetched. Added test case 57 to verify that curl + does it right now. + +Daniel (29 Jan) +- Jamie Wilkinson provided a patch that now makes curl attempt to clear out + "sensitive" command line arguments so that they don't appear in ps outputs + (only on platforms that allow writing to argv[]). + +- John McGowan found out that the DEBUGFUNCTION could be called with bad + arguments and thus cause the --trace outputs to go wrong. + +- Removed all the emacs local variables from all files. Mats Lidell provided + the new sample.emacs file (for a sample of what to include in your .emacs) + and the curl-style.el that sets a better c-style for editing curl sources. + +- Dave Halbakken found a problem with FTP downloads that could accidently + return CURLE_PARTIAL_FILE when curl_easy_perform() was called with NOBODY + set TRUE. + +Daniel (27 Jan) +- The fopen.c example was flawed as Nick Humfrey noticed, and I fixed it to + work again. + +Daniel (24 Jan) +- Bertrand Demiddelaer found and fixed a memory leak (the content-type string) + when following locations. + +Daniel (22 Jan 2003) +- Ian Wilkes and Legoff Vincent both independently provided fixes for making + curl/multi.h work properly when compiled with a C++ compiler. + +Daniel (20 Jan 2003) +- Fixed 'buildconf' to check version number of the required tools before + they're actually used. + +- Wrote 'testcurl.sh', a script targeted for automatic and distributed curl + tests on various platforms. + +- David Thiel pointed out that the .netrc file was not being dealt with + properly anymore. I broke this in the password prompting "fix". + +- Markus F.X.J. Oberhumer patched libcurl to allocate the scratch buffer only + on demand and thus we save 32KB in each curl handle that don't use that + buffer. This need appeared when some people started using thousands of + simultaneous curl handles... :-) + +Daniel (16 Jan 2003) +- Markus Oberhumer fixed curl-config --cflags when the includedir was not + /usr/include. + +- Markus Oberhumer fixed CURLINFO_PRIVATE to properly return NULL if it was + set to NULL! + +Version 7.10.3 (14 Jan 2003) + +Daniel (10 Jan 2003) +- Steve Oliphant pointed out that test case 105 did not work anymore and this + was due to a missing fix for the password prompting. + +Version 7.10.3-pre6 (10 Jan 2003) + +Daniel (9 Jan 2003) +- Bryan Kemp pointed out that curl -u could not provide a blank password + without prompting the user. It can now. -u username: makes the password + empty, while -u username makes curl prompt the user for a password. + +- Kjetil Jacobsen found a remaining connect problem in the multi interface on + ipv4 systems (Linux only?), that I fixed and Kjetil verified that it fixed + his problems. + +- memanalyze.pl now reads a file name from the command line, and no longer + takes the data on stdin as before. + +Version 7.10.3-pre5 (9 Jan 2003) + +Daniel (9 Jan 2003) +- Fixed tests/memanalyze.pl to work with file names that contain colons (as on + Windows). + +- Kjetil Jacobsen quickly pointed out that lib/share.h was missing... + +Version 7.10.3-pre4 (9 Jan 2003) + +Daniel (9 Jan 2003) +- Updated lib/share.c quite a bit to match the design document at + http://curl.haxx.se/dev/sharing.txt a lot more. + + I'll try to update the document soonish. share.c is still not actually used + by libcurl, but the API is slowly getting there and we can start + implementing code that takes advantage of this system. + +Daniel (8 Jan 2003) +- Updated share stuff in curl/curl.h, including data types, structs and + function prototypes. The corresponding files in lib/ were also modified + of course to remain compilable. Based on input from Jean-Philippe and also + to make it more in line with the design document. + +- Jean-Philippe Barrette-LaPierre patched a very trivial memory leak in + curl_escape() that would happen when realloc() returns NULL... + +- Matthew Blain provided feedback to make the --create-dirs stuff build + properly on Windows. + +- Fixed the #include in tests/libtest/first.c as Legoff Vincent pointed out. + +Daniel (7 Jan 2003) +- Philippe Raoult provided a patch that now makes libcurl properly support + wildcard checks for certificate names. + +- Simon Liu added CURLOPT_HTTP200ALIASES, to let an application set other + strings recognized as "HTTP 200" to allow http-like protocols to get + downloaded fine by curl. + +- Now using autoconf 2.57 and automake 1.7.2 + +- Doing "curl -I ftp://domain/non-existing-file" still outputed a date! + Wayne Haigh reported. + +- The error message is now written properly with a newline in the --trace + file. + +Daniel (6 Jan 2003) +- Sterling Hughes fixed a possible bug: previously, if you called + curl_easy_perform and then set the global dns cache, the global cache + wouldn't be used. Pointed out by Jean-Philippe Barrette-LaPierre. + +- Matthew Blain's fixed the VC6 libcurl makefile to include better debug data + on debug builds. + +Daniel (27 Dec 2002) +- Philippe Raoult reported a bug with HTTPS connections which I evidently + added in my 19 dec fix. I corrected it. + +Daniel (20 Dec) +- Idea from the Debian latest patch: use AM_MAINTAINER_MODE in the configure + script to make the default makefile less confusing "to the casual + installer". + +Version 7.10.3-pre3 (20 Dec) + +Daniel (19 Dec) +- Matthew Blain patched the Curl_base64_decode() function. + +- Evan Jordan reported in bug report #653022 that the SSL_read() usage was + wrong, and it certainly was. It could lead to curl using too much CPU due to + a stupid loop. + +Daniel (18 Dec) +- As suggested by Margus Freudenthal, CURLE_HTTP_NOT_FOUND was renamed to + CURLE_HTTP_RETURNED_ERROR since it is returned on any >= 400 code when + CURLOPT_FAILONERROR is set. + +Daniel (17 Dec) +- Bug reported #651464, reported by Christopher Palmer, provided an example + source code using the multi interface that hang when trying to connect to a + proxy on a localhost port where no proxy was listening. This bug was not + repeatable on libcurls that were IPv6-enabled. + +Daniel (16 Dec) +- Christopher Palmer also noticed what Vojtech Janota already was + experiencing: The attempted name resolve fix for glibc 2.2.93 caused libcurl + to crash when used on some older glibc versions. The problem is of course + the silliness of the 2.2.93. I committed a fix that hopefully should make + the binary run fine on either one of the versions, even though the solution + is not as nice as I'd like it to be. + +Daniel (13 Dec) +- Bug report #651460 by Christopher R. Palmer showed that when using libcurl + to for example go over a proxy on localhost, it would attempt to connect + through the proxy TWICE. + + I added test case 503 with which I managed to repeat this problem and I + fixed the code to not re-attempt any connects (which also made it a nicer + fix for the #650941 bug mentioned below). + + The sws server was extended to deal with CONNECT in order to make test + case 503 do good. + +- Evan Jordan posted bug report #650989 about a memory leak in the public key + retrieving code. He provided a suggested fix and I merely applied it! + +- Bug report #650941, posted by Christopher R. Palmer identified a problem + with the multi interface and getting file:// URLs. This was now fixed and + test case 502 was added to verify this. + +Daniel (12 Dec) +- Test case 500 and 501 are the first ever libcurl test cases that run. + +- Made "configure --enable-debug" cut off all -O* options to the compiler + +- Finally fixed the test suite's ftp server so that test case 402 doesn't + cause the following test case to fail anymore! + +Daniel (11 Dec) +- CURL_MAX_WRITE_SIZE is now decreased to 16KB since it makes the Windows + version perform uploads much faster!!! RBramante did lots of research on + this topic. + +- Fixed the #include in curl/curl.h to include the other files outside the + extern "C" scope. + +Daniel (10 Dec) +- Moved around and added more logic: + + First, POST data is never sent as part of the request headers in the http.c + code. It is always sent the "normal" read callback then send() way. This now + enables a plain HTTP POST to be sent chunked if we want to. This also + reduces the risk of having very big POSTs causing problems. + + Further, sending off the initial HTTP request is not done using a loop + anymore. If it wasn't all sent off in the first send(), the rest of the + request is sent off in the normal transfer select() loop. This makes several + things possible, but mainly it makes libcurl block less when used from the + multi interface and it also reduces the risk of problems with issuing very + large requests. + +Daniel (9 Dec) +- Moved the read callback pointer and data within the structs to a more + suitable place. This in preparation for a better HTTP-request sending code + without (a silly) loop. + +- The Dodds fix seems not to work. + +- Vojtech Janota tests proved that the resolve fix from oct 21st is not good + enough since obviously older glibcs might return EAGAIN without this meaning + that the buffer was too small. + +- [the other day] Made libcurl loop on recv() and send() now until done, and + then get back to select(). Previously it went back to select() more often + which really was a slight overhead. This was due to the reported performance + problems on HTTP PUT on Windows. I couldn't see any notable difference on + Linux... + +Version 7.10.3-pre2 (4 Dec 2002) + +Daniel (4 Dec 2002) +- Lots of work with Malcolm Dodds made me add a temporary code fix that now + shortens the timeout waiting for the 226 or 250 line after a completed + FTP transfer. + + If no data is received within 60 seconds, this is taken as a sign of a dead + control connection and we bail out. + +Daniel (3 Dec 2002) +- Ralph's bug report #644841 identified a problem in which curl returned a + timeout error code when in fact the problem was not a timeout. The proper + error should now be propagated better when they're detected in the FTP + response reading function. + +- Updated the Borland Makefiles. + +Daniel (2 Dec 2002) +- Nicolas Berloquin provided a patch that introduced --create-dirs to the + command line tool. When used in combination with -o, it lets curl create + [non-existing] directories used in -o, suitably used with #-combinations + such as: + + curl "www.images.com/{flowers,cities,parks,mountains}/pic_[1-100].jpg \ + -o "dir_#1/pic#2.jpg" --create-dirs + +Version 7.10.3-pre1 + +Daniel (28 Nov 2002) +- I visited Lars Nordgren and had a go with his problem, which lead me to + implement this fix. If libcurl detects the added custom header + "Transfer-Encoding: chunked", it will now enable a chunked transfer. + + Also, chunked transfer didn't quite work before but seems to do so now. + +- Kjetil Jacobsen pointed out that ./configure --disable-ipv6 --without-zlib + didn't work on any platform... + +Daniel (26 Nov 2002) +- Fixed a bad addrinfo free in the hostip.c code, hardly exposed anywhere + +- Dan Becker found and fixed a minor memory leak on persistent connnections + using CURLOPT_USERPWD. + +Daniel (22 Nov 2002) +- Based on Ralph Mitchell's excellent analysis I found a bug in the test suite + web server (sws) which now lets test case 306 run fine even in combination + with the other test cases. + +- Juan Ignacio Hervás found a crash in the verbose connect message that is + used on persistent connections. This bug was added in 7.10.2 due to the + rearranged name resolve code. + +Daniel (20 Nov 2002) +- Kjetil Jacobsen provided a patch that introduces: + + CURLOPT_PRIVATE stores a private pointer in the curl handle. + + CURLINFO_PRIVATE retrieves the private pointer from the curl handle. + +- Karol Pietrzak pointed out how curl-config --cflags didn't output a good + include dir so I've removed that for now. + +Version 7.10.2 (18 Nov 2002) + +Daniel (11 Nov 2002) +- Dave Halbakken added curl_version_info to lib/libcurl.def to make libcurl + properly build with MSVC on Windows. + +Daniel (8 Nov 2002) +- Doing HTTP PUT without a specified file size now makes libcurl use + Transfer-Encoding: chunked. + +Daniel (7 Nov 2002) +- Bug report #634625 identified how curl returned timeout immediately when + CURLOPT_CONNECTTIMEOUT was used and provided a fix. + +Version 7.10.2-pre4 (6 Nov 2002) + +Daniel (5 Nov 2002) +- Lehel Bernadt found out and fixed. libcurl sent error message to the debug + output when it stored the error message. + +- Avery Fay found some problems with the DNS cache (when the cache time was + set to 0 we got a memory leak, but when the leak was fixed he got a crash + when he used the CURLOPT_INTERFACE with that) that had me do some real + restructuring so that we now have a reference counter in the dns cache + entries to prevent an entry to get flushed while still actually in use. + + I also detected that we previously didn't update the time stamp when we + extracted an entry from the cache so that must've been a reason for some + very weird dns cache bugs. + +Version 7.10.2-pre3 + +Daniel (31 Oct 2002) +- Downgraded automake to 1.6.3 in an attempt to fix cygwin problems. (It + turned out this didn't help though.) + +- Disable the DNS cache (by setting the timeout to 0) made libcurl leak + memory. Avery Fay brought the example code that proved this. + +Version 7.10.2-pre2 + +Daniel (28 Oct 2002) +- Upgraded to autoconf 2.54 and automake 1.7 on the release-build host. + +- Kevin Roth made the command line tool check for a CURL_CA_BUNDLE environment + variable (if --cacert isn't used) and if not set, the Windows version will + check for a file named "curl-ca-bundle.crt" in the current directory or the + directory where curl is located. That file is then used as CA root cert + bundle. + +- Avery Fay pointed out that curl's configure scrip didn't get right if you + used autoconf newer than 2.52. This was due to some badly quoted code. + +Version 7.10.2-pre1 + +Daniel (23 Oct 2002) +- Emiliano Ida confirmed that we now build properly with the Borland C++ + compiler too. We needed yet another fix for the ISO cpp check in the curl.h + header file. + +- Yet another fix was needed to get the HTTP download without headers to work. + This time it was needed if the first "believed header" was read all in the + first read. Test 306 has not run properly since the 11th october fix. + +Daniel (21 Oct 2002) +- Zvi Har'El pointed out a problem with curl's name resolving on Redhat 8 + machines (running IPv6 disabled). Mats Lidell let me use an account on his + machine and I could verify that gethostbyname_r() has been changed to return + EAGAIN instead of ERANGE when the given buffer size is too small. This is + glibc 2.2.93. + +- Albert Chin helped me get the -no-undefined option corrected in + lib/Makefile.am since Cygwin builds want it there while Solaris builds don't + want it present. Kevin Roth helped me try it out on cygwin. + +- Nikita Schmidt provided a bug fix for a FOLLOWLOCATION bug introduced when + the ../ support got in (7.10.1). + +Daniel (18 Oct 2002) +- Fabrizio Ammollo pointed out a remaining problem with FOLLOWLOCATION in + the multi interface. + +Daniel (17 Oct 2002) +- Richard Cooper's experimenting proved that -j (CURLOPT_COOKIESESSION) didn't + work quite as supposed. You needed to set it *before* you use + CURLOPT_COOKIEFILE, and we dont' want that kind of dependencies. + +Daniel (15 Oct 2002) +- Andrés García provided corrections for erratas in four libcurl man pages. + +Daniel (13 Oct 2002) +- Starting now, we generate and include PDF versions of all the docs in the + release archives. + +Daniel (12 Oct 2002) +- Trying to connect to a host on a bad port number caused the multi interface + to never return failure and it appeared to keep on trying forever (it just + didn't do anything). + +Daniel (11 Oct 2002) +- Downloading HTTP without headers didn't work 100%, some of the initial data + got written twice. Kevin Roth reported. + +- Kevin Roth found out the "config file" parser in the client code could + segfault, like if DOS newlines were used. + +Version 7.10.1 (11 Oct 2002) + +Daniel (10 Oct 2002) +- Jeff Lawson fixed a few problems with connection re-use that remained when + you set CURLOPT_PROXY to "". + +Daniel (9 Oct 2002) +- Craig Davison found a terrible flaw and Cris Bailiff helped out in the + search. Getting HTTP data from servers when the headers are split up in + multiple reads, could cause junk data to get inserted among the saved + headers. This only concerns HTTP(S) headers. + +Daniel (8 Oct 2002) +- Vincent Penquerc'h gave us the good suggestion that when the ERRRORBUFFER + is set internally, the error text is sent to the debug function as well. + +- I fixed the telnet code to timeout properly as the option tells it to. On + non-windows platforms. + +Daniel (7 Oct 2002) +- John Crow pointed out that libcurl-the-guide wasn't included in the release + tarball! + +- Kevin Roth pointed out that make install didn't do right if build outside + the source tree (ca-bundle wise). + +- FOLLOWLOCATION bugfix for the multi interface + +Daniel (4 Oct 2002) +- Kevin Roth got problems with his cygwin build with -no-undefined was not + present in lib/Makefile.am so I put it back in there again. The poor one who + needs to remove it again must write a configure script to detect that need. + +- Ralph Mitchell pointed out that curl was a bit naive and didn't deal with ./ + or ../ stuff in the string passed back in a Location: header when following + locations. + +- Albert Chin helped me to work out a better configure.in check for zlib, and + both --without-zlib and -with-zlib seem to work rather well right now. + +- Zvi Har'El improvied the OpenSSL ENGINE check in the configure script to + become more accurate. + +Daniel (1 Oct 2002) +- Detlef Schmier pointed out the lack of a --without-libz option to configure, + so I added one. + +Version 7.10 (1 Oct 2002) + +Daniel (30 Sep 2002) +- Modified the curl_version_info() proto and returned struct once again, and + updated the man page accordingly. + +- Cris Bailiff found out that the pre-releases crashed on name lookups on + names such as "a:" or "baz:" (on Linux versions not being ipv6-enabled) due + to some weird return codes from gethostbyname_r(). I'll blame the complete + lack of docs in that department. Cris provided a fix, which I modified only + slightly. + +Daniel (27 Sep 2002) +- After a suggestion from Christian Kurz to Debian curl package maintainer + Domenico Andreoli, I made it possible to override the proxy environment + variables better. Now, by setting -x "" you can explicitly tell libcurl to + not use a proxy, no matter whan the environment variables say. + +Version 7.10-pre4 + +Daniel (26 Sep 2002) +- Extended curl_version_info() more and wrote a man page for it. + +Daniel (25 Sep 2002) +- libcurl could leak memory when downloading multiple files using http ranges, + reported and fixed by Jean-Luc Guevel. + +- Walter J. Mack provided code and docs for the new curl_free() function that + shall be used to free memory that is allocated by libcurl and returned back + to the application, as curl_escape() and curl_unescape() do. + +- Yarram Sunil pointed out a flaw in the multi interface where a failed + connection didn't close down properly and thus a second transfer using the + same handle failed. + +- Andrés García fixed a flaw that made (among other things) dict-fetches + return a random value. + +Daniel (24 Sep 2002) +- Wez Furlong brought his initial patch that introduced curl_version_info(). + We might need to tweak it somewhat before release. + +Daniel (20 Sep 2002) +- Craig Markwardt fixed another Tru64 IP resolve problem. + +Daniel (19 Sep 2002) +- Dolbneff A.V and Spiridonoff A.V made the file:// code work with resumes + in the same style other code does. + +- Ilguiz Latypov fixed a flaw in the client code when fetching multiple URLs + and -C - was used. The first file's resume position was then accidentally + reused on all the other files too. + +Daniel (18 Sep 2002) +- The curl_easy_setopt.3 man page was greatly modified and the options have + now been grouped in logical groups so that it should be somewhat easier to + read it and find things you search for. + +Daniel (13 Sep 2002) +- Kevin Roth pinpointed a scary flaw in libcurl, when the HTTP server doesn't + send any headers back, only raw content. Right, that is a violation of the + standard but still happens at times and we need to deal with it. Test case + 306 was added to verify that we do right now. + +Version 7.10-pre3 + +Daniel (11 Sep 2002) +- Lukasz Czekierda found out that curl didn't send a correct HTTP Host: header + when you specified the URL with an IPv6 IP-address. + +Daniel (4 Sep 2002) +- Sven Neuhaus made --silent being acknowledged even when multiple URLs + were used. It used to output "[1/2]: http://host/a.html.de --> a.html.d" etc + even when told to shut up. + +Daniel (3 Sep 2002) +- Updated all source code headers to use MIT-license references only, and + point to the COPYING file and the http://curl.haxx.se/docs/copyright.html + URL. I've cut out all references to MPL that I could find. + +- Corected the makefiles to not always use -lz when linking + +Version 7.10-pre2 + +Daniel (2 Sep 2002) +- James Gallagher added Content-Encoding support to libcurl so now curl and + libcurl-using apps can request compressed contents using the 'deflate' + method. See the special file lib/README.encoding for details. + + curl --compressed is now used to request compressed contents. + + curl-config --feature will include 'libz' if this feature was around when + the library was built. + +Daniel (30 Aug 2002) +- Applied an anonymous SOCKS5-proxy patch. Not properly working in all + situations though, as all getaddrinfo()-using libcurls will fail on this. + This is because of the somewhat naive way the current code tries to extract + the IP address of the proxy. + +- Fixed up the SSL cert fixes from the other day even more after more inputs + from Cris. Added three new SSL error codes to make the + CURLE_SSL_CONNECT_ERROR slightly less overloaded. + +Daniel (27 Aug 2002) +- After lots of talk with Tom Zerucha, Nick Gimbrone and Cris Bailiff I + decided to talk the bold path and I now made libcurl do CA certificate + verification by default. Thus library users need to explicitly turn this off + if you want to connect to sites without proper checking. We also install a + CA cert bundle on 'make install' now. + + The curl tool now requires the -k/--insecure option in order to allow + connections and operations on SSL sites that aren't properly verified with + -cafile or --capath. + + curl-config --ca displays the built-in path to the CA cert bundle. + +Daniel (26 Aug 2002) +- Andrew Francis cleaned up some code that now compiles fine without the need + for ugly MSVC pragmas. + +- Keith MacDonald found a minor bug in src/main.c that made it close stdin + instead of the actual file handle. It shouldn't have resulted in much + trouble as most operating systems close all file handles on process exit + anyway. + +Daniel (22 Aug 2002) +- Markus Oberhumer provided some documentation for his previously provided + CURLOPT_NOSIGNAL fix. + +- Patched the lib/Makefile.am to hopefully no longer complain on undefined + symbols that seemed to occur on builds with shared OpenSSL libraries on + Solaris lately... + +Daniel (20 Aug 2002) +- Fixed compiler warnings on MSCV++ compiles. We're looking for help here: + remove the pragmas from lib/config-win32.h and adjust the sources where + the warnings occur. Hiding them with pragmas like this is not the correct + way of dealing with compiler warnings. + +Daniel (13 Aug 2002) +- Ulrich Zadow made the global include files in curl/* include themselves + using "curl.h" instead of which thus allows people to more + freely decide how to include curl and how to setup their include paths. + +- Sterling Hughes added the curl_share* interface, somewhat as discussed + previously. + +- Jörn Hartroth pointed out that poll() was used in the pre1 source code and + it isn't very portable, so now I check for it in the configure script and + work around it. + +Version 7.9.9-pre1 + +Daniel (12 Aug 2002) +- Applied my initial take on making the multi stuff more asynchronous. Connects + should now return back without "hanging" until it has connected for real. + This should also be the case for FTP-PASV connects. + +Daniel (9 Aug 2002) +- Applied Markus F.X.J. Oberhumer's patch that introduces CURLOPT_NOSIGNAL, + which effectively prevents libcurl from doing anything that may cause + signals to get sent. This is basicly for multi-threaded applications that + now can use timeouts properly, without risking any signals to burst in and + ruin the party. + +Daniel (5 Aug 2002) +- Lukasz Czekierda reported that RFC2732-style literal IPv6 addresses didn't + work. When did that code vanish? Anyway, it's back again now and seems to + work! + +- Jonatan Lander found out that POSTing an empty string didn't work with the + command line tool. + +Daniel (3 Aug 2002) +- Jörn Hartroth fixed the libcurl.def file to build the windows DLL with + the multi interface enabled. + +Daniel (1 Aug 2002) +- The ftp PORT command now uses a better default IP address, as it will + extract and use the local IP address used by the control connection. + +- Modified the #include lines in curl/multi.h to work better on more + platforms. + +Daniel (31 Jul 2002) +- Attempted a fix for Ray DeGennaro's reported HP-UX host name resolve + problems. + +Daniel (30 Jul 2002) +- Priya Ramakrishnan and Ryan Jones compiles curl/curl.h with a C++ compiler + and don't get __STDC__ defined, which required us to extend the preprocessor + check for the ## operator usage. + +- Correct the description for CURLOPT_PASSWDFUNCTION, if set to NULL the + internal default function will be put back. + +- danfuzz at milk.com found out that libcurl badly assumed a space after + 'Set-Cookie:' so if it wasn't present, it caused the first letter of the + cookie name to fall off! + +Daniel (29 Jul 2002) +- The password prompt asking for user password used stdout and now uses + stderr instead to better allow redirecting. It also leaked a fopen() file + handle that is now fixed. + +Daniel (28 Jul 2002) +- HAVE_SETVBUF was left out from src/main.c which made -N not work. Found out + by M T. + +Daniel (26 Jun 2002) +- Glen Nakamura solved a crash in the name resolving function for IP-only + addresses on Alpha Linux (at least). + +- T. Bharath corrected the high resolution timer introduced in 7.9.8. + +Daniel (22 Jun 2002) +- Andrés García pointed out man page errors in curl_formadd.3. I fixed. + +Daniel (19 Jun 2002) +- Chris Combes pointed out a flaw in curl_escape(). I fixed. We no longer + tries to generate nor parse '+' in URLs. Spaces become %20, and only %-codes + are translated by curl_unescape(). + +Daniel (15 Jun 2002) +- Added --limit-rate to the curl tool. Allows the user to set a maxmimum + upper limit to how much bandwidth to use for transfers. + +- CURLOPT_BUFFERSIZE was added to libcurl. This sets a prefered size for the + receive buffer in libcurl. The main point of this would be that the write + callback gets called more often and with smaller chunks. + +Daniel (14 Jun 2002) +- Yarram Sunil found out that the SocketIsDead() function performed a lot + faster on Windows when removing the 1 microsecond timeout. + +- Hanno L. Kranzhoff fixed the VC++ project files. + +- Tom Mattison found out that ftp transfers closed the connection a little + too often. + +- Miklos Nemeth posted a VC++ makefile fix and some INSTALL comments on how + to disable specific protocols when building for Windows. + +Version 7.9.8 + +Daniel (13 Jun 2002) +- Time to let this baby go. + +Daniel (12 Jun 2002) +- Chris Combes added three new options for curl_formadd(): CURLFORM_BUFFER, + CURLFORM_BUFFERPTR, CURLFORM_BUFFERLENGTH. They are used to create a + multipart that appears as a regular file upload, but the data is provided + with a pointer and length. + +- Nico Baggus made the VMS version use sigsetjmp() too. + +- Jörn Hartroth fixed the mingw32 build using the mm lib. + +- Applied patches by Kris Kennaway that correct format string problems in + lib/ftp.c and lib/ldap.c. + +Version 7.9.8-pre3 + +Daniel (11 Jun 2002) +- James Cone brought the idea of using sigsetjmp() in the signal handler to + make the time-out of name lookups to work, even when the underlying name + resolver library traps EINTR. The use of sigsetjmp() and siglongjmp() for + this may be a bit drastic, and also not likely to exist on all platforms. I + added careful checking for this in the configure script, even checks for it + being a macro (which seems to be the case in for example Linux). + + sigsetjmp() seems to be mentioned in the Single Unix specification. + +- Miklos Nemeth brought a patch that allows libcurl to get built with specific + protocols disabled. This is done by running ./configure + --disable-[protocol]. + +- FTP range downloads could make CURLE_FTP_WRITE_ERROR get returned. We now + make precautions to not return this for range downloads. + + Added test case 135 that makes an ftp range download. Had to tweak the + runtests.pl script a bit too. + +- Bug report #566835 identified a strlen() on a NULL pointer. Added additional + check to prevent this. + +Daniel (10 Jun 2002) +- Found and corrected a connect failure problem that didn't create a human + error text. + +- Added code to compile with OpenSSL 0.9.7. Based on patch from Jacob Meuser + and comments from Götz Babin-Ebell. + +- Gautam Mani found a socket descriptor leak that happened when FTP transfers + failed and you reinvoked curl_easy_perform(). + +Daniel (5 Jun 2002) +- Gustaf Hui corrected curl_multi_remove_handle() so that it won't crash no + matter when you decide to remove the CURL handle. + +- HAVE_RAND_STATUS was added to lib/config-win32.h by Andreas Olsson, as it + makes windows builds stop complaining about "weak seeding" when it in fact + isn't. + +- Another 64bit architecture crash that was introduced in 7.9.7 was now + removed, as bug report #564585 clarified. This happened due to our attempts + to only allocate only as much memory as is actually needed for name + resolving (using realloc) which called for a function that could 'move' a + hostent struct in memory. + +Version 7.9.8-pre2 + +Daniel (3 Jun 2002) +- T. Bharath fixed the CURLINFO_REDIRECT_TIME to return a correct time and + made the CURLINFO_REQUEST_SIZE return the correct total request size. He + also made the win32 timers use higher resolution than before. + +Daniel (29 May 2002) +- Renaud Chaillat made me aware of the fact that libcurl returned an error if + you tried to get an empty FTP file. This seemed like a wrong thing to do, so + now it no longer does that! I just hope that no one built anything fancy + upon this unexpected behavior... + +Daniel (28 May 2002) +- Cris Bailiff brought CURLOPT_CAPATH that works like CURLOPT_CAINFO but + specifies a path to a directory with certificates rather than a single file + with them all concatenated. --capath was added to the command line tool + for the same function. + + Windows users need to pay attention that the directory should be setup with + the c_rehash tool of the OpenSSL package, and that creates symlinks by + default that need to be replaced with actual copies to work on Windows. + +- Gustaf Hui provided new code that changes how curl_multi_info_read() + messages are stored, so that they don't have to be kept around for the multi + handle's entire life time. He also made it return failure codes properly + which it didn't do before. + +Daniel (27 May 2002) +- Gustaf Hui pointed out that running curl_multi_perform() without doing + curl_multi_fdset() first was not really a working combo. I added an internal + check for this and have some extra select() code without timeout to make the + library internals work identically nevertheless. We might need to somehow + either document that once you've used the *_fdset() you should remain using + them in select() or you should blank them somehow so that libcurl won't go + crazy. + +Version 7.9.8-pre1 + +Daniel (22 May 2002) +- James Cone brought an excellent patch, including several tests and docs! + CURLOPT_NETRC now takes an enum as argument instead of the previous boolean. + --netrc-optional was introduced as an addition to --netrc to allow the + command line client to take use of all that new netrc stuff. + +- Bug report #558888 showed a case where libcurl re-used the previous host + name when a connection over a proxy was re-used but to a different target + host. + +Daniel (21 May 2002) +- Edin Kadribasic helped me sort out a problem to made libcurl crash when + trying to HTTP POST an empty string. + +- Clarified that Juergen Wilke donated the original tests/server/sws.c code. + +- Jean-Philippe Barrette-LaPierre made curl_formadd() return a typedef named + CURLFORMcode instead of the previous 'int', and the various return codes are + now globally exported. It allows applications to better figure out what goes + wrong when curl_formadd() returns errors. + +Daniel (20 May 2002) +- Roland Zimmermann pointed out that SSL_CTX_use_certificate_chain_file() + is prefered to SSL_CTX_use_certificate_file(). + +Daniel (17 May 2002) +- Bug report #556869 pointed out that src/writeout.c didn't compile on freebsd + after my AIX fixes the other week. + +- Bug report #556930 pointed out a FreeBSD core dump introduced in 7.9.7 in + the DNS struct realloc stuff. Actually, this crash could happen on all + systems that made the pack_hostent() function get invoked. + +- I removed several compiler warnings in the test suite's HTTP server. + +Version 7.9.7 + +Daniel (10 May 2002) +- Kevin Roth adjusted the --trace-ascii output slightly. + +- Paul Harrington found out that src/writeout.c needed an additional header + file included for AIX builds + +Version 7.9.7-pre2 + +Daniel (7 May 2002) +- Updated the man page with --trace-ascii and -j/--junk-session-cookies. + +- Made --trace-ascii do pretty much the same as --trace but without the hex + part in the output. + +- Added CURLOPT_COOKIESESSION that when enabled makes libcurl ignore session + cookies read from a file. This option is enforced by the curl command line + tool using the new -j/--junk-session-cookies option. After discussions with + Kevin Roth. This makes it easier to use curl to fully emulate a browser's + behavior, even when it comes to "session cookies". Session cookies are + cookies that a normal browser discards when the browser is shut + down. They're identified by not having any expire date/time. + +- When CURLOPT_DEBUGDATA was set, it ruined the CURLOPT_STDERR setting and + this was discovered when --trace was made to crash. + +- Using -v and --trace at the same time confused matters. -v is now pretty + much ignored when --trace or --trace-ascii is used. + +- Made --trace (and --trace-ascii) support - as file name to pass output to + stdout instead. It makes it consistent with how other options work. + +Version 7.9.7-pre1 + +Daniel (6 May 2002) +- Added multi-post.c to the examples directory. I got the basic source for + this from Gustaf Hui. + +Daniel (3 May 2002) +- CURL_MAX_WRITE_SIZE is now an exported #define in the curl/curl.h header and + can be used to figure out the maximum buffer size your write callback can + get. + +- CURLOPT_READDATA is now an alias for CURLOPT_INFILE and CURLOPT_WRITEDATE is + an alias for CURLOPT_FILE. These two were added for conformity. Most other + callback function's userdata are provided with options using a similar name- + scheme. + +- Added "--trace [file]" to the command line tool. It makes a very detailed + trace dump get stored, with a full protocol dump that includes all received + and transmitted data. This could be a very effective tool for debugging what + goes wrong. This dump includes every byte the way it is sent to/received + from the server. The dump is the plain-text version, so SSL transfers will + still be readable. + +- I found out that the DEBUGFUNCTION was not called properly everywhere as we + wanted it to. I fixed it. + +- -D now stores all headers to the same file if multiple URLs are given on the + command line! Kevin Roth made me aware of that it didn't already do this! + +- Gustaf Hui wrote an excellent formpost example that used the multi + interface. Unfortunately, it didn't work due to several bugs in how + transfers were made when the multi interface was used. + +Daniel (2 May 2002) +- Hanno Kranzhoff found out that when doing multiple transfers on the same + easy handle, the progress meter would show a bad "currently downloaded + value" when the transfer starts. + +Daniel (1 May 2002) +- Applied another patch by Jacky Lam to make the name resolve info realloc() + stuff work properly. + +Daniel (28 April 2002) +- curl_multi_info_read() is now implemented! + +Daniel (27 April 2002) +- Updated BUGS, TODO, FAQ, INSTALL and added BINDINGS. + +- I think I fixed the DNS cache prune crach Jacky Lam found and reported. + +- I cleaned up the name prefix stuff in the hash and llist modules. + +- FTP responses should now be better on timing out properly. The timeout value + is maximum timeout for the entire request operation, but before this, the + timeout was used as a maximum allowed time between two reads... + +Daniel (26 April 2002) +- Fixed the test suite http server to not use snprintf() anymore due to better + portability. + +Daniel (25 April 2002) +- With Sterling Hughes' new DNS pruning, Jacky Lam asked if this wouldn't + cause problems since the pruning is only checking the entry time, and it + sure could cause problems. Therefor, I've now added and changed code so that + this should not be a problem. Nowhere in the code will be store name + resolved information around so that a sunsequent DNS cache prune should + cause a problem. This of course called for some mild internal changes. + +Daniel (23 April 2002) +- Improved the 'no_proxy' check, as using port numbers in the URL confused it + previously. Reported by Erwan Legrand in bug report #547484. + +- The --interface option now works even on IPv6 enabled builds. Reported by + 'thor'. + +Daniel (22 April 2002) +- The #defines names starting with TIMECOND now has CURL_ prefixes. (The old + names are still #defined too.) Pointed out by Robert Olson. + +- Jacky Lam brought code that lets the name resolve function only use as much + memory as it actually needs. This only works on certain operating systems, + but is totally transparant to all users. + +Daniel (19 April 2002) +- Bjorn Reese fixed pack_hostent to work properly with 64 bit pointers. + +Daniel (18 April 2002) +- Sterling Hughes added code to prune old DNS cache entries, since Jacky Lam + experienced very big caches. + +Daniel (17 April 2002) +- Dirk Manske patched the 301 response to work against the RFC but more like + common browsers do. If a POST get a 301 back, it'll switch to GET in the + next request (if location-following is enabled). + +Daniel (16 April 2002) +- Dirk Manske posted a patch originally written by Ingo Wilken that introduced + two new CURLINFO_* values: CURLINFO_REDIRECT_TIME and + CURLINFO_REDIRECT_COUNT. + +Daniel (15 April 2002) +- Jonatan Lander patched the verbose text 'Disables POST, goes with GET' to + reflect reality better, like when the first request isn't POST and when + the second isn't GET... :-) + +- Craig Davison pointed out that when curl_formadd()ing a file that doesn't + exist, libcurl doesn't return error. Now, curl_easy_perform() will return + CURLE_READ_ERROR if that is the case. Test 41 was added to verify this. + +Version 7.9.6 + +Daniel (14 April 2002) +- Dirk Manske brought a fix that makes libcurl strip off white spaces from the + beginning of cookie contents. + +- Had to patch include/curl/curl.h since MSVC doesn't set the __STDC__ define. + Moonesamy pointed out the problem, Bjorn Reese the solution. + +Version 7.9.6-pre5 + +Daniel (12 April 2002) +- Fixed the TIMER_CONNECT to be more accurate for FTP transfers. Previously + FTP transfers got the "connect done" time set after the initial FTP commands + and not directly after the TCP/IP connect as it should. + + I also made the time stamp get set even if the connect itself fails, which + it didn't do previously. + +- Jean-Philippe Barrette-LaPierre provided his patch that introduces + CURLOPT_DEBUGFUNCTION and CURLOPT_DEBUGDATA. They allow a program to a set a + callback to receive debug/information data. That includes headers and data + that is received and sent. CURLOPT_VERBOSE still controls it. + + By default, there is an internal debugfunction that will make things look + and work as before if not changed. + +Daniel (10 April 2002) +- Sebastien Willemijns found out that -x didn't use the default port number as + is documented. It does now. + +- libcurl-errors.3 is a new man page attempting to document all libcurl error + codes + +- Added two new error codes and changed the behaviour of two old ones + slightly: + + CURLE_WRITE_ERROR + This error was returned *both* for errors that occured when writing + received data to a local file, as well as when we get problems writing data + to a remote server. CURLE_SEND_ERROR has now been added for the latter + error. + + CURLE_READ_ERROR + This error was similarly returned *both* for errors when reading a local + file, as well as when getting problems when reading network data. + CURLE_RECV_ERROR has now been added for the latter error. + + (Two test cases were adjusted accordingly.) + +Daniel (9 April 2002) +- runtests.pl now sets the HOME variable before running curl, to prevent any + actual ~/.curlrc file to fool the tests! + +Version 7.9.6-pre4 + +Daniel (8 April 2002) +- Michael Curtis provided new functionality for curl on some platforms. Using + the --environment option, curl will *set* a bunch of environment variables + to values. The names are the same ones as for the -w/--writeout option. + + For now, this only works on the RISC OS version, as this feature relies on + both OS support and that it matches OS paradigms. + +- Jacky Lam provided a fix for getting headers-only when the reply is HTTP/1.0 + and 304, I edited it slightly. + +Daniel (5 April 2002) +- As requested by Jay Graves, the '.curlrc' file (or _curlrc as it is called + when used in windows), is now loaded from the current directory if the HOME + environment variable isn't set (or if it is too long). I also enlarged the + array used to store the full file path in, to 512 bytes. + +- Kevin Roth pointed out to me why the "19 March" change regarding -G and -I + was stupid and the change was reverted. Added test case 48 to verify the + functionality. + +Version 7.9.6-pre3 + +Daniel (4 April 2002) +- Jonatan Lander brought a patch that makes curl/curl.h compile nicely on + pre-ISO compilers, like when using gcc -traditional. + +Daniel (3 April 2002) +- Jacky Lam identified a glitch when getting headers-only, where libcurl would + "hang" 1 second in vain in the select() loop before returning back. + +- Tor Arntsen brought a patch for multipart formposts. It turned out that the + "CGI_Lite Perl package" makes some bad assumptions on what letters that may + be used in boundary strings and thus curl could confuse it by including '+' + and '/'. While this is standards-compliant, we change the behavior to work + smoothly with existing software based on that package. + +Daniel (2 April 2002) +- Gerhard Herre filed bug report #536238 where he pointed out a crash in + verbose FTP passive transfers for AIX. + +- Clarence Gardner pointed out a minor flaw in how libcurl didn't properly + take care of all errors that SSL_read() could return. + +- Jacky Lam fixed a MALLOCDEBUG problem in lib/getinfo.c + +Daniel (27 March 2002) +- T. Bharath pointed out a flaw in the connection re-use function that didn't + check proxy connections properly for "deadness" before they were re-used. + +- Pedro Neves found out that HTTP POSTing with --data-binary did not properly + work under Windows as the file specified wasn't read fully binary! + +Daniel (25 March 2002) +- Jacky Lam brought a fix that improves treatment of cookies using identical + domains but with leading dots properly. + +Daniel (22 March 2002) +- Miklos Nemeth updated the windows section of the docs/INSTALL file and the + windows makefiles. + +- Jon Dillon provided us with several good-looking curl images for + promotion. View them here http://curl.haxx.se/icons.html + +Daniel (20 March 2002) +- Peter Verhas found out that CRLF replacement in uploads was not working. I + fixed it, and added test case 128 that verifies the functionality. + +- The list formerly known as curl-main is now named curl-users and is hosted + by sourceforge. Susbcribe to the new list, get off the old one. + +Version 7.9.6-pre2 + +Daniel (19 March 2002) +- Made -G and -I on the same command line cause an error. + +- Moved the multi.h file to the "public" include directory and made it get + included by curl.h so that no extra include files will be necessary to use + it. + + Added docs and man pages for the multi interface to the release archive. + Added the three example source codes too. + + Necessary steps in my campaign to sneak in the multi interface... ;-) + +- Updated the year in all copyright notices in all C and H files. + +Daniel (18 March 2002) +- Tomas Szepe found out that -d and -G didn't mix as they should. I broke this + in 7.9.5... Added test case 32 for this. + +Version 7.9.6-pre1 + +Daniel (16 March 2002) +- Peter Verhas pointed out that the curl_escape and curl_unscape man pages + contained factual errors. + +- Albert Choy found and corrected a problem with the verbose output when doing + PASV ftp transfers. It could make libcurl crash. + + Details in bug report #530562: + http://sourceforge.net/tracker/?func=detail&atid=100976&aid=530562&group_id=976 + +Daniel (15 March 2002) +- Jun-ichiro itojun Hagino filed bug report #530204 that clearly pointed out + the PF_INET fix from February 19 as a not-very-good fix as it broke IPv6 + capability! That patch is now reverted. + + The problem with slow name lookups with getaddrinfo() on non-IPv6 enabled + hosts are instead made by first checking if the stack is IPv6-enabled and if + not, the PF_INET is used and otherwise we go with the full PF_UNSPEC. + +- T. Bharath pointed out that when we return an "error" from a WRITEFUNCTION + as described in the man page, libcurl did not return the documented error + code (CURLE_WRITE_ERROR) but would instead return CURLE_READ_ERROR. This is + now corrected. + +Daniel (14 March 2002) +- Setting CURLOPT_POST without setting CURLOPT_POSTFIELDS now read the POST- + data from the callback. + +- The GOPHER support seems to be broken. I don't think I'll even start fixing + it until someone else finds out... :-) + +Daniel (13 March 2002) +- Trying 'curl -I ftp.sunet.se' or similar did a SIZE on a silly "(nil)" + string. If such a file would be present, curl returned the size of it! Now + we prevent this. + +- Curl_sendf() was fixed to deal with situation where Curl_write() would've + blocked and thus return -1. + +- Setting CURLOPT_PROGRESSFUNCTION to NULL now restores the internal function. + +- All CURLFORM_* options can now be used in a CURLFORM_ARRAY except the + CURLFORM_ARRAY itself. This was necessary since we couldn't expand the + CURLFORM_* list proprely and unrestricted until this was the case. It was + also a bit peculiar to users why some options could be used in an array + while others couldn't. + +- Removed some silly CRLF lines that had accidentally slipped into src/main.c + Nico Baggus pointed them out to me. + +Daniel (11 March 2002) +- CURLFORM_FILENAME was added. This can be set when creating a file upload + part, to set the 'filename' field to a custom value. If this isn't used, + the actually used filename will be included instead (as libcurl always has + done). curl was adjusted accordingly, and now -F accepts a 'filename=' field + too, and allows constructs such as: + + -F 'name=@filename;filename=/dev/null' + + and this can be combined with type= too, in a manner similar to: + + -F "file=@log/test39.txt;filename=fakerfile;type=moo/foobar" + + Test case 39 was added to verify this functionality. + +- The struct formerly known as HttpPost is now named curl_httppost to properly + use the curl name space. I added a #define for the old name to make existing + programs compile even when this new include file is used. + +Daniel (8 March 2002) +- Clifford also discovered that if the client code failed early, as when doing + "curl -O" only, it would do fclose(NULL) which caused a segmentation fault + on some systems. + +- Clifford Wolf provided a patch that made --progress-bar work again. + +- I closed bug report #527032 by making sure that we add a newline after a + transfer when --progress-bar has been used. Before, without the newline, it + made the subsequent text come out wrong. + +Version 7.9.5 + +Daniel (7 March 2002) +- Added docs/KNOWN_BUGS to the release archive. + +Daniel (6 March 2002) +- Kevin Roth corrected a flaw in the curl client globbing code that made it + mess up backslashes. This was most notable on windows (cygwin) machines when + using file://. + +- Brad provided another fix for building outside the source-tree. + +- Ralph Mitchell patched away a few compiler warnings in tests/server/sws.c + +Daniel (5 March 2002) +- I noticed that the typedef in curl.h for the progress callback prototype was + wrong and thus applications that used it would not get the proper input + data. It used size_t where the implementation actually uses doubles! + + I wish I could blame someone else, but this was my fault. Again. + +Version 7.9.5-pre6 + +Daniel (4 March 2002) +- Cut off the changes done during 2001 from this changelog file and put them + in a separate file (CHANGES.2001), available from CVS of course. + +- I removed the multi directory. The example sources were moved to the + docs/examples directory where they belong. + +- Wrote 7 new man pages for the current functions in the new multi interface. + They're all still pretty basic, but we can use them as a start and add more + contents to them when we figure out what to write. The large amount of man + pages for libcurl now present made me decide to put them in a new separate + subdirectory in the docs directory. Named libcurl. + +- Giuseppe Corbelli provided a template file for the EPM package manager, it + gets generated nicely by the configure script now. + +Version 7.9.5-pre5 + +Daniel (1 March 2002) +- Moved the memanalyze.pl script into the tests/ dir and added it to the + release archives. It was previously only present in the CVS tree. + +- Modified the February 17th Host: fix, as bug report #523718 pointed out that + it caused crashes! + +- Nico Baggus added more error codes to the VMS stuff. + +- Wesley Laxton brought the code that introduced the new CURLOPT_PREQUOTE + option. It is just another FTP quote option that allows the user to specify + a list of FTP commands to issue *just before* the transfer command (RETR or + STOR etc). It has turned up a few systems that really need this. + + The curl command line tool can also take advantage of this by prefixing the + quote commands with a plus (+) in similar style that post transfer quote + commands are specified. + + This is not yet documented. There is no test case for this yet. + +Daniel (28 February 2002) +- Ralph Mitchell made some serious efforts and put a lot of sweat in setting + up scripts and things for me to be able to repeat his problems, and I + finally could. I found a problem with the header byte counter that wasn't + increased properly and thus we could return CURLE_GOT_NOTHING when we in + fact had received data. + +Daniel (27 February 2002) +- I had to revert the non-space parsing cookie fix I posted to the mailing + list. Expire dates do have spaces and still need to get parsed properly! + Instead we just ignore trailing white space and it seems to work... + +Daniel (26 February 2002) +- Made the cookie property 'Max-Age' work, just since we already tried to + support it, it is better to do it right. No one uses this anyway. + +- The cookie parser could crash if a really weird (illegal) cookie line was + received. I also made it better discard really oddly formatted lines better. + + Made the cookie jar store the second field from the left using the syntax + that Netscape and Mozilla probably like. Curl itself ignores it. + + Added test case 31 for these cases. + + Clay Loveless' email regarding some cookie issues started my cleanup. + +- Kevin Roth pointed out that my automake fiddles broke the ability to build + outside the source-tree and I posted a patch to the mailing list that brings + this ability back. + +Version 7.9.5-pre4 + +Daniel (25 February 2002) +- Fiddled with the automake files to make all source files in the lib + directory not have ../src in the include path, and the src sources shouldn't + have ../lib! + +- All 79 test cases ran OK under Linux and Solaris using the new HTTP server + in the test suite. The new HTTP server was first donated by Georg Horn and + subsequently modified to work with the test suite. It is currently still not + portable enough to run on "all over" but this is a start and I can run all + curl tests on my machines. This is an important requirement for the upcoming + public release. + +- Using -d and -I on the same command line now reports an error, as it implies + two different HTTP requests that can't be mixed. + +- Jeffrey Pohlmeyer provided a patch that made the -w/--write-out option + support %{content_type} to get the content type of the recent download. + +- Kevin Roth reported that pre2 and pre3 didn't compile properly on cygwin, + and this was because I used #ifdef HAVE_WINSOCK_H in lib/multi.h to figure + out if we could include winsock.h which turns out not to be a wise choice to + do on cygwin since it has the file but can't include it! + +Daniel (22 February 2002) +- Added src/config-vms.h to the release archive. + +- Fixed the connection timeout value again, the change from February 18 wasn't + complete. + +Version 7.9.5-pre3 + +Daniel (21 February 2002) +- Kevin Roth and Andrés García both found out that lib/config.h.in was missing + in the pre-release archive and thus the configure script failed. + +Version 7.9.5-pre2 + +Daniel (20 February 2002) +- Andrés García provided a solution to bug report #515228. the total time + counter was not set correctly when -I was used during some conditions (all + headers were read in one single read). + +- Nico Baggus provided a huge patch with minor tweaks all over to make curl + compile nicely on VMS. + +Daniel (19 February 2002) +- Rick Richardson found out that by replacing PF_UNSPEC with PF_INET in the + getaddrinfo() calls, he could speed up some name resolving calls with an + order of magnitudes on his Redhat Linux 7.2. + +- Philip Gladstone found a second INADDR_NONE problem where we used long + intead of in_addr_t which caused 64bit problemos. We really shouldn't define + that on two different places. + +Daniel (18 February 2002) +- Philip Gladstone found a problem in how HTTP requests were sent if the + request couldn't be sent all at once. + +- Emil found and corrected a bad connection timeout comparison that made curl + use the longest of connect-timeout and timout as a timeout value, instead of + the shortest as it was supposed to! + +- Aron Roberts provided updated information about LDAP URL syntax to go into + the manual as a replacement for the old references. + +Daniel (17 February 2002) +- Philip Gladstone pointed out two missing include files that made curl core + dump on 64bit architectures. We need to pay more attention on these details. + It is *lethal* to for example forget the malloc() prototype, as 'int' is + 32bit and malloc() must return a 64bit pointer on these platforms. + +- Giaslas Georgios fixed a problem with Host: headers on repeated requests on + the same handle using a proxy. + +Daniel (8 February 2002) +- Hanno L. Kranzhoff accurately found out that disabling the Expect: header + when doing multipart formposts didn't work very well. It disabled other + parts of the request header too, resulting in a broken header. When I fixed + this, I also noticed that the Content-Type wasn't possible to disable. It is + now, even though it probably is really stupid to try to do this (because of + the boundary string that is included in the internally generated header, + used as form part separator.) + +Daniel (7 February 2002) +- I moved the config*.h files from the root directory to the lib/ directory. + +- I've added the new test suite HTTP server to the CVS repository, It seems to + work pretty good now, but we must make it get used by the test scripts + properly and then we need to make sure that it compiles, builds and runs on + most operating systems. + +Version 7.9.5-pre1 + +Daniel (6 February 2002) +- Miklos Nemeth provided updated windows makefiles and INSTALL docs. + +- Mr Larry Fahnoe found a problem with formposts and I managed to track down + and patch this bug. This was actually two bugs, as the posted size was also + said to be two bytes too large. + +- Brent Beardsley found out and brought a correction for the + CURLINFO_CONTENT_TYPE parser that was off one byte. This was my fault, I + accidentaly broke Giaslas Georgios' patch. + +Daniel (5 February 2002) +- Kevin Roth found yet another SSL download problem. + +Version 7.9.4 + +- no changes since pre-release + +Version 7.9.4-pre2 + +Daniel (3 February 2002) +- Eric Melville provided a few spelling corrections in the curl man page. + +Daniel (1 February 2002) +- Andreas Damm corrected the unconditional use of gmtime() in getdate, it now + uses gmtime_r() on all hosts that have it. + +Daniel (31 January 2002) +- An anonymous bug report identified a problem in the DNS caching which made it + sometimes allocate one byte too little to store the cache entry in. This + happened when the port number started with 1! + +- Albert Chin provided a patch that improves the gethostbyname_r() configure + check on HP-UX 11.00. + +Version 7.9.4-pre1 + +Daniel (30 January 2002) +- Georg Horn found another way the SSL reading failed due to the non-blocking + state of the sockets! I fixed. + +Daniel (29 January 2002) +- Multipart formposts now send the full request properly, including the CRLF. + They were previously treated as part of the post data. + +- The upload byte counter bugged. + +- T. Bharath pointed out that we seed SSL on every connect, which is a time- + consuming operation that should only be needed to do once. We patched + libcurl to now only seed on the first connect when unseeded. The seeded + status is global so it'll now only happen once during a program's life time. + + If the random_file or egdsocket is set, the seed will be re-made though. + +- Giaslas Georgios introduced CURLINFO_CONTENT_TYPE that lets + curl_easy_getinfo() read the content-type from the previous request. + +Daniel (28 January 2002) +- Kjetil Jacobsen found a way to crash curl and after much debugging, it + turned out it was a IPv4-linux only problem introduced in 7.9.3 related to + name resolving. + +- Andreas Damm posted a huge patch that made the curl_getdate() function fully + reentrant! + +- Steve Marx pointed out that you couldn't mix CURLOPT_CUSTOMREQUEST with + CURLOPT_POSTFIELDS. You can now! + +Daniel (25 January 2002) +- Krishnendu Majumdar pointed out that the header length counter was not reset + between multiple requests on the same handle. + +- Pedro Neves rightfully questioned why curl always append \r\n to the data + that is sent in HTTP POST requests. Unfortunately, this broke the test suite + as the test HTTP server is lame enough not to deal with this... :-O + +- Following Location: headers when the connection didn't close didn't work as + libcurl didn't properly stop reading. This problem was added in 7.9.3 due to + the restructured internals. 'Frank' posted a bug report about this. + +Daniel (24 January 2002) +- Kevin Roth very quickly spotted that we wrongly installed the example + programs that were built in the multi directory, when 'make install' was + used. :-/ + +Version 7.9.3 + +Daniel (23 January 2002) +- Andrés García found a persistancy problem when doing HTTP HEAD, that made + curl "hang" until the connection was closed by the server. This problem has + been introduced in 7.9.3 due to internal rewrites, this was not present in + 7.9.2. + +Version 7.9.3-pre4 + +Daniel (19 January 2002) +- Antonio filed bug report #505514 and provided a fix! When doing multipart + formposts, libcurl would include an error text in the actual post if a + specified file wasn't found. This is not libcurl's job. Instead we add an + empty part. + +Daniel (18 January 2002) +- Played around with stricter compiler warnings for gcc (when ./configure + --enable-debug is used) and changed some minor things to stop the warnings. + +- Commented out the 'long long' and 'long double' checks in configure.in, as + we don't currently use them anyway and the code in lib/mprintf.c that use + them causes warnings. + +- Saul Good and jonatan pointed out Mac OS X build problems with pre3 and how + to correct them. Two compiler warnings were removed as well. + +- Andrés García fixed two minor mingw32 building problems. + +Version 7.9.3-pre3 + +Daniel (17 January 2002) +- docs/libcurl-the-guide is a new tutorial for our libcurl programming + friends. + +- Richard Archer brought back the ability to compile and build with OpenSSL + versions before 0.9.5. + [http://sourceforge.net/tracker/?func=detail&atid=100976&aid=504163&group_id=976] + +- The DNS cache code didn't take the port number into account, which made it + work rather bad on IPv6-enabled hosts (especially when doing passive + FTP). Sterling fixed it. + +Daniel (16 January 2002) +- Georg Horn could make a transfer time-out without error text. I found it and + corrected it. + +- SSL writes didn't work, they return an uninitialized value that caused + havoc all over. Georg Horn experienced this. + +- Kevin Roth patched the curl_version() function to use the proper OpenSSL + function for version information. This way, curl will report the version of + the SSL library actually running right now, not the one that had its headers + installed when libcurl was built. Mainly intersting when running with shared + OpenSSL libraries. + +Version 7.9.3-pre2 + +Daniel (16 January 2002) +- Mofied the main transfer loop and related stuff to deal with non-blocking + sockets in the upload section. While doing this, I've now separated the + connection oriented buffers to have one for downloads and one for uploads + (as two can happen simultaneously). I also shrunk the buffers to 20K + each. As we have a scratch buffer twice the size of the upload buffer, we + arrived at 80K for buffers compared with the previous 150K. + +- Added the --cc option to curl-config command as it enables so very cool + one-liners. Have a go a this one, building the simple.c example: + + $ `curl-config --cc --cflags --libs` -o example simple.c + +Daniel (14 January 2002) +- I made all socket reads (recv) handle EWOULDBLOCK. I hope nicely. Now we + only need to address all writes (send) too and then I'm ready for another + pre-release... + +- Stoned Elipot patched the in_addr_t configure test to make it work better on + more platforms. + +Daniel (9 January 2002) +- Cris Bailiff found out that filling up curl's SSL session cache caused a + crash! + +- Posted the curl questionnaire on the web site. If you haven't posted your + opinions there yet, go there and do it now while it is still there: + + http://curl.haxx.se/q/ + +- Georg Horn quickly found out that the SSL reading no longer worked as + supposed since the switch to non-blocking sockets. I've made a quick patch + (for reading only) but we should improve it even further. + +Version 7.9.3-pre1 + +Daniel (7 January 2002) +- I made the 'bool' typedef use an "unsigned char". It makes it the same on + all platforms, no matter what the platform thinks the default format for + char is. This was noticed since we made a silly comparison involving such a + bool variable, and only one compiler/platform combination (on Debian Linux) + complained about it (that happened to have its char unsigned by default). + +- Bug report #495290 identified a cookie parsing problem that was corrected. + When a Set-Cookie: line is received without a trailing semicolon, libcurl + didn't read the last "name=value" pair of the line, leading to confusions... + +- Sterling committed his updated DNS cache code. + +- I worked with Georg Horn and comments from Götz Babin-Ebell and switched + curl's socket operations completely over to non-blocking for the entire + operation (previously we used non-blocking only for the connection phase). + We had to do this to make the SSL connection phase timeout properly without + the use of signals. A little extra code to deal with this was added. + +- T. Bharath pointed out a slightly obscure cookie engine flaw. + +- Pete Su pointed out that libcurl didn't treat HTTP code 204 as it should. + 204-replies never provides a response-body. This resulted in bad persistant + behavior when 204 was received. + +Daniel (5 January 2002) +- SM updated the VC++ library Makefiles for the new source files. + +Daniel (4 January 2002) +- I discovered that we wrongly used inet_ntoa() (instead of inet_ntoa_r() in + two places in the source code). One happened with VERBOSE set on connects, + and the other when VERBOSE was on and krb4 over nat was used... I honestly + don't think anyone has suffered from these mistakes. + +- I replaced a lot of silly occurances of printf() to instead use the more + appropriate Curl_infof() or Curl_failf(). The krb4 and telnet code were + affected. + +- Philip Gladstone found a few more problems with 64-bit archs (the 64-bit + sparc on solaris 8). + +- After discussions on the libcurl list with Raoul Cridlig, I just made FTP + response lines get passed to the header callback if such a one is + registered. It'll make it possible for any application to get all the + responses an FTP server sends to libcurl. + +Daniel (3 January 2002) +- Sterling Hughes brought a few buckets of code. Now, libcurl will + automatically cache DNS lookups and re-use the previous results first if any + such is available. It greatly improves speed when doing many repeated + operations to the same host. + +- As the test case uses --include and then --head, I had to modify src/main.c + to deal with this situation slightly better than previously. When done, we + have 100% good tests again in the main branch. + +Daniel (2 January 2002) +- Made test case 25 run again in the multi-dev branch. But it seems that the + changes done on dec-20 made test case 104 cease to work (in both branches). + +- Philip Gladstone pointed out a few portability problems in the source code + that didn't compile on 64-bit sparcs using Sun's native compiler. diff --git a/main/source/curl/COPYING b/main/source/curl/COPYING new file mode 100644 index 00000000..54153506 --- /dev/null +++ b/main/source/curl/COPYING @@ -0,0 +1,21 @@ +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1996 - 2003, Daniel Stenberg, . + +All rights reserved. + +Permission to use, copy, modify, and distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization of the copyright holder. diff --git a/main/source/curl/Makefile b/main/source/curl/Makefile new file mode 100644 index 00000000..f1cd41fb --- /dev/null +++ b/main/source/curl/Makefile @@ -0,0 +1,76 @@ +############################################################################# +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) 2002, Daniel Stenberg, , et al. +# +# In order to be useful for every potential user, curl and libcurl are +# dual-licensed under the MPL and the MIT/X-derivate licenses. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the MPL or the MIT/X-derivate +# licenses. You may pick one of these licenses. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# $Id: Makefile.dist,v 1.12 2002/09/07 21:44:02 hartroth Exp $ +############################################################################# + +all: + ./configure + make + +ssl: + ./configure --with-ssl + make + +borland: + cd lib & make -f Makefile.b32 + cd src & make -f Makefile.b32 + +mingw32: + cd lib & make -f Makefile.m32 ZLIB=1 + cd src & make -f Makefile.m32 ZLIB=1 + +mingw32-ssl: + cd lib & make -f Makefile.m32 SSL=1 ZLIB=1 + cd src & make -f Makefile.m32 SSL=1 ZLIB=1 + +vc: + cd lib + nmake -f Makefile.vc6 cfg=release + cd ..\src + nmake -f Makefile.vc6 + +vc-ssl: + cd lib + nmake -f Makefile.vc6 cfg=release-ssl + cd ..\src + nmake -f Makefile.vc6 cfg=release-ssl + +vc-ssl-dll: + cd lib + nmake -f Makefile.vc6 cfg=release-ssl-dll + cd ..\src + nmake -f Makefile.vc6 + +cygwin: + ./configure + make + +cygwin-ssl: + ./configure --with-ssl + make + +unix: all + +unix-ssl: ssl + +linux: all + +linux-ssl: ssl diff --git a/main/source/curl/Makefile.am b/main/source/curl/Makefile.am new file mode 100644 index 00000000..368a0e8c --- /dev/null +++ b/main/source/curl/Makefile.am @@ -0,0 +1,79 @@ +# +# $Id: Makefile.am,v 1.41 2003/03/31 11:37:47 bagder Exp $ +# + +AUTOMAKE_OPTIONS = foreign + +EXTRA_DIST = CHANGES COPYING maketgz SSLCERTS reconf Makefile.dist \ + curl-config.in build_vms.com curl-style.el sample.emacs testcurl.sh + +bin_SCRIPTS = curl-config + +SUBDIRS = docs lib src include tests packages + +# create a root makefile in the distribution: +dist-hook: + rm -rf $(top_builddir)/tests/log + cp $(srcdir)/Makefile.dist $(distdir)/Makefile + +html: + cd docs; make html + +pdf: + cd docs; make pdf + +check: test + +test: + @(cd tests; $(MAKE) quiet-test) + +test-full: + @(cd tests; $(MAKE) full-test) + +# +# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros +# must contain the following line: +# %_topdir /home/loic/local/rpm +# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc. +# +# cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS +# +# If additional configure flags are needed to build the package, add the +# following in ~/.rpmmacros +# %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS} +# and run make rpm in the following way: +# AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm +# + +rpms: + $(MAKE) RPMDIST=curl rpm + $(MAKE) RPMDIST=curl-ssl rpm + +rpm: + RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \ + cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \ + cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \ + rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \ + mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \ + mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm . + +# +# Build a Solaris pkkgadd format file +# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format +# file (which ends up back in this directory). +# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do +# pkgadd -d ./HAXXcurl-* +# + +# gak - libtool requires an absoulte directory, hence the pwd below... +pkgadd: + umask 022 ; \ + make install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \ + cat COPYING > $(srcdir)/packages/Solaris/copyright ; \ + cd $(srcdir)/packages/Solaris && $(MAKE) package + +# +# Build a cygwin binary tarball installation file +# resulting .tar.bz2 file will end up at packages/Win32/cygwin +cygwinbin: + $(MAKE) -C packages/Win32/cygwin cygwinbin diff --git a/main/source/curl/Makefile.dist b/main/source/curl/Makefile.dist new file mode 100644 index 00000000..f1cd41fb --- /dev/null +++ b/main/source/curl/Makefile.dist @@ -0,0 +1,76 @@ +############################################################################# +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) 2002, Daniel Stenberg, , et al. +# +# In order to be useful for every potential user, curl and libcurl are +# dual-licensed under the MPL and the MIT/X-derivate licenses. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the MPL or the MIT/X-derivate +# licenses. You may pick one of these licenses. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# $Id: Makefile.dist,v 1.12 2002/09/07 21:44:02 hartroth Exp $ +############################################################################# + +all: + ./configure + make + +ssl: + ./configure --with-ssl + make + +borland: + cd lib & make -f Makefile.b32 + cd src & make -f Makefile.b32 + +mingw32: + cd lib & make -f Makefile.m32 ZLIB=1 + cd src & make -f Makefile.m32 ZLIB=1 + +mingw32-ssl: + cd lib & make -f Makefile.m32 SSL=1 ZLIB=1 + cd src & make -f Makefile.m32 SSL=1 ZLIB=1 + +vc: + cd lib + nmake -f Makefile.vc6 cfg=release + cd ..\src + nmake -f Makefile.vc6 + +vc-ssl: + cd lib + nmake -f Makefile.vc6 cfg=release-ssl + cd ..\src + nmake -f Makefile.vc6 cfg=release-ssl + +vc-ssl-dll: + cd lib + nmake -f Makefile.vc6 cfg=release-ssl-dll + cd ..\src + nmake -f Makefile.vc6 + +cygwin: + ./configure + make + +cygwin-ssl: + ./configure --with-ssl + make + +unix: all + +unix-ssl: ssl + +linux: all + +linux-ssl: ssl diff --git a/main/source/curl/Makefile.in b/main/source/curl/Makefile.in new file mode 100644 index 00000000..09ef58b3 --- /dev/null +++ b/main/source/curl/Makefile.in @@ -0,0 +1,664 @@ +# Makefile.in generated by automake 1.7.2 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# $Id: Makefile.am,v 1.41 2003/03/31 11:37:47 bagder Exp $ +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ +CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ +CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ +CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ +CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ +CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ +CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ +CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +HAVE_LIBZ = @HAVE_LIBZ@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +IPV6_ENABLED = @IPV6_ENABLED@ +KRB4_ENABLED = @KRB4_ENABLED@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +NO_UNDEFINED_FALSE = @NO_UNDEFINED_FALSE@ +NO_UNDEFINED_TRUE = @NO_UNDEFINED_TRUE@ +NROFF = @NROFF@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_ENABLED = @OPENSSL_ENABLED@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKGADD_NAME = @PKGADD_NAME@ +PKGADD_PKG = @PKGADD_PKG@ +PKGADD_VENDOR = @PKGADD_VENDOR@ +PKGCONFIG = @PKGCONFIG@ +RANDOM_FILE = @RANDOM_FILE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +VERSIONNUM = @VERSIONNUM@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +AUTOMAKE_OPTIONS = foreign + +EXTRA_DIST = CHANGES COPYING maketgz SSLCERTS reconf Makefile.dist \ + curl-config.in build_vms.com curl-style.el sample.emacs testcurl.sh + + +bin_SCRIPTS = curl-config + +SUBDIRS = docs lib src include tests packages +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/lib/config.h \ + $(top_builddir)/src/config.h \ + $(top_builddir)/tests/server/config.h \ + $(top_builddir)/lib/ca-bundle.h +CONFIG_CLEAN_FILES = curl-config +SCRIPTS = $(bin_SCRIPTS) + +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = README COPYING Makefile.am Makefile.in acinclude.m4 \ + aclocal.m4 config.guess config.sub configure configure.ac \ + curl-config.in depcomp install-sh ltmain.sh missing \ + mkinstalldirs +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: + +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.ac acinclude.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +curl-config: $(top_builddir)/config.status curl-config.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +binSCRIPT_INSTALL = $(INSTALL_SCRIPT) +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \ + $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +distdir = $(PACKAGE)-$(VERSION) + +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/. $(distdir)/packages/EPM $(distdir)/packages/Linux/RPM + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ + && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +distuninstallcheck: + cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(SCRIPTS) +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(bindir) + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: install-binSCRIPTS + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf autom4te.cache +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binSCRIPTS uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive dist dist-all dist-gzip distcheck distclean \ + distclean-generic distclean-libtool distclean-recursive \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-binSCRIPTS install-data install-data-am \ + install-data-recursive install-exec install-exec-am \ + install-exec-recursive install-info install-info-am \ + install-info-recursive install-man install-recursive \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am installdirs-recursive maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive mostlyclean \ + mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ + pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \ + tags-recursive uninstall uninstall-am uninstall-binSCRIPTS \ + uninstall-info-am uninstall-info-recursive uninstall-recursive + + +# create a root makefile in the distribution: +dist-hook: + rm -rf $(top_builddir)/tests/log + cp $(srcdir)/Makefile.dist $(distdir)/Makefile + +html: + cd docs; make html + +pdf: + cd docs; make pdf + +check: test + +test: + @(cd tests; $(MAKE) quiet-test) + +test-full: + @(cd tests; $(MAKE) full-test) + +# +# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros +# must contain the following line: +# %_topdir /home/loic/local/rpm +# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc. +# +# cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS +# +# If additional configure flags are needed to build the package, add the +# following in ~/.rpmmacros +# %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS} +# and run make rpm in the following way: +# AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm +# + +rpms: + $(MAKE) RPMDIST=curl rpm + $(MAKE) RPMDIST=curl-ssl rpm + +rpm: + RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \ + cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \ + cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \ + rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \ + mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \ + mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm . + +# +# Build a Solaris pkkgadd format file +# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format +# file (which ends up back in this directory). +# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do +# pkgadd -d ./HAXXcurl-* +# + +# gak - libtool requires an absoulte directory, hence the pwd below... +pkgadd: + umask 022 ; \ + make install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \ + cat COPYING > $(srcdir)/packages/Solaris/copyright ; \ + cd $(srcdir)/packages/Solaris && $(MAKE) package + +# +# Build a cygwin binary tarball installation file +# resulting .tar.bz2 file will end up at packages/Win32/cygwin +cygwinbin: + $(MAKE) -C packages/Win32/cygwin cygwinbin +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/main/source/curl/README b/main/source/curl/README new file mode 100644 index 00000000..09da4f18 --- /dev/null +++ b/main/source/curl/README @@ -0,0 +1,68 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + +README + + Curl is a command line tool for transfering data specified with URL + syntax. Find out how to use Curl by reading the curl.1 man page or the + MANUAL document. Find out how to install Curl by reading the INSTALL + document. + + libcurl is the library curl is using to do its job. It is readily + available to be used by your software. Read the libcurl.3 man page to + learn how! + + You find answers to the most frequent questions we get in the FAQ document. + + Study the COPYING file for distribution terms and similar. + +CONTACT + + If you have problems, questions, ideas or suggestions, please contact us + by posting to a suitable mailing list. See http://curl.haxx.se/mail/ + + Many major contributors to the project are listed in the THANKS document. + +WEB SITE + + Visit the curl web site or mirrors for the latest news: + + Sweden -- http://curl.haxx.se/ + US -- http://curl.sf.net/ + Australia -- http://curl.planetmirror.com/ + +DOWNLOAD + + The official download mirror sites are: + + Sweden -- ftp://ftp.sunet.se/pub/www/utilities/curl/ + Sweden -- http://cool.haxx.se/curl/ + Germany -- ftp://ftp.fu-berlin.de/pub/unix/network/curl/ + Australia -- http://curl.planetmirror.com/download/ + US -- http://curl.sourceforge.net/download/ + Hongkong -- http://www.execve.net/curl/ + +CVS + + To download the very latest source off the CVS server do this: + + cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl login + + (just press enter when asked for password) + + cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl co curl + + (you'll get a directory named curl created, filled with the source code) + + cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl logout + + (you're off the hook!) + +NOTICE + + Curl contains pieces of source code that is Copyright (c) 1998, 1999 + Kungliga Tekniska Högskolan. This notice is included here to comply with the + distribution terms. diff --git a/main/source/curl/SSLCERTS b/main/source/curl/SSLCERTS new file mode 100644 index 00000000..099b10d9 --- /dev/null +++ b/main/source/curl/SSLCERTS @@ -0,0 +1,39 @@ + Peer SSL Certificate Verification + ================================= + +Starting in 7.10, libcurl performs peer SSL certificate verification by +default. This is done by installing a default CA cert bundle on 'make install' +(or similar), that CA bundle package is used by default on operations against +SSL servers. + +Alas, if you communicate with HTTPS servers using certificates that are signed +by CAs present in the bundle, you will not notice any changed behavior and you +will seamlessly get a higher security level on your SSL connections since you +can be sure that the remote server really is the one it claims to be. + +If the remote server uses a self-signed certificate, or if you don't install +curl's CA cert bundle or if it uses a certificate signed by a CA that isn't +included in the bundle, then you need to do one of the following: + + 1. Tell libcurl to *not* verify the peer. With libcurl you disable with with + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE); + + With the curl command tool, you disable this with -k/--insecure. + + 2. Get a CA certificate that can verify the remote server and use the proper + option to point out this CA cert for verification when connecting. For + libcurl hackers: curl_easy_setopt(curl, CURLOPT_CAPATH, capath); + + With the curl command tool: --cacert [file] + +Neglecting to use one of the above menthods when dealing with a server using a +certficate that isn't signed by one of the certficates in the installed CA +cert bundle, will cause SSL to report an error ("certificate verify failed") +during the handshake and SSL will then refuse further communication with that +server. + +This procedure has been deemed The Right Thing even though it adds this extra +trouble for some users, since it adds security to a majority of the SSL +connections that previously weren't really secure. It turned out many people +were using previous versions of curl/libcurl without realizing the need for +the CA cert options to get truly secure SSL connections. diff --git a/main/source/curl/acinclude.m4 b/main/source/curl/acinclude.m4 new file mode 100644 index 00000000..947e129d --- /dev/null +++ b/main/source/curl/acinclude.m4 @@ -0,0 +1,445 @@ +dnl Check for how to set a socket to non-blocking state. There seems to exist +dnl four known different ways, with the one used almost everywhere being POSIX +dnl and XPG3, while the other different ways for different systems (old BSD, +dnl Windows and Amiga). +dnl +dnl There are two known platforms (AIX 3.x and SunOS 4.1.x) where the +dnl O_NONBLOCK define is found but does not work. This condition is attempted +dnl to get caught in this script by using an excessive number of #ifdefs... +dnl +AC_DEFUN(CURL_CHECK_NONBLOCKING_SOCKET, +[ + AC_MSG_CHECKING([non-blocking sockets style]) + + AC_TRY_COMPILE([ +/* headers for O_NONBLOCK test */ +#include +#include +#include +],[ +/* try to compile O_NONBLOCK */ + +#if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if defined(__SVR4) || defined(__srv4__) +# define PLATFORM_SOLARIS +# else +# define PLATFORM_SUNOS4 +# endif +#endif +#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX4) +# define PLATFORM_AIX_V3 +#endif + +#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) +#error "O_NONBLOCK does not work on this platform" +#endif + int socket; + int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK); +],[ +dnl the O_NONBLOCK test was fine +nonblock="O_NONBLOCK" +AC_DEFINE(HAVE_O_NONBLOCK, 1, [use O_NONBLOCK for non-blocking sockets]) +],[ +dnl the code was bad, try a different program now, test 2 + + AC_TRY_COMPILE([ +/* headers for FIONBIO test */ +#include +#include +],[ +/* FIONBIO source test */ + int flags = ioctl(socket, FIONBIO, &flags); +],[ +dnl FIONBIO test was good +nonblock="FIONBIO" +AC_DEFINE(HAVE_FIONBIO, 1, [use FIONBIO for non-blocking sockets]) +],[ +dnl FIONBIO test was also bad +dnl the code was bad, try a different program now, test 3 + + AC_TRY_COMPILE([ +/* headers for ioctlsocket test (cygwin?) */ +#include +],[ +/* ioctlsocket source code */ + int flags = ioctlsocket(socket, FIONBIO, &flags); +],[ +dnl ioctlsocket test was good +nonblock="ioctlsocket" +AC_DEFINE(HAVE_IOCTLSOCKET, 1, [use ioctlsocket() for non-blocking sockets]) +],[ +dnl ioctlsocket didnt compile! + + AC_TRY_COMPILE([ +/* headers for IoctlSocket test (Amiga?) */ +#include +],[ +/* IoctlSocket source code */ + int flags = IoctlSocket(socket, FIONBIO, (long)1); +],[ +dnl ioctlsocket test was good +nonblock="IoctlSocket" +AC_DEFINE(HAVE_IOCTLSOCKET_CASE, 1, [use Ioctlsocket() for non-blocking sockets]) +],[ +dnl ioctlsocket didnt compile! +nonblock="nada" +AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1, [disabled non-blocking sockets]) +]) +dnl end of forth test + +]) +dnl end of third test + +]) +dnl end of second test + +]) +dnl end of non-blocking try-compile test + AC_MSG_RESULT($nonblock) + + if test "$nonblock" = "nada"; then + AC_MSG_WARN([non-block sockets disabled]) + fi +]) + +dnl Check for socklen_t: historically on BSD it is an int, and in +dnl POSIX 1g it is a type of its own, but some platforms use different +dnl types for the argument to getsockopt, getpeername, etc. So we +dnl have to test to find something that will work. +AC_DEFUN([TYPE_SOCKLEN_T], +[ + AC_CHECK_TYPE([socklen_t], ,[ + AC_MSG_CHECKING([for socklen_t equivalent]) + AC_CACHE_VAL([curl_cv_socklen_t_equiv], + [ + # Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + curl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t unsigned long "unsigned long"; do + AC_TRY_COMPILE([ + #include + #include + + int getpeername (int, $arg2 *, $t *); + ],[ + $t len; + getpeername(0,0,&len); + ],[ + curl_cv_socklen_t_equiv="$t" + break + ]) + done + done + + if test "x$curl_cv_socklen_t_equiv" = x; then + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) + fi + ]) + AC_MSG_RESULT($curl_cv_socklen_t_equiv) + AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, + [type to use in place of socklen_t if not defined])], + [#include +#include ]) +]) + +dnl Check for in_addr_t: it is used to receive the return code of inet_addr() +dnl and a few other things. If not found, we set it to unsigned int, as even +dnl 64-bit implementations use to set it to a 32-bit type. +AC_DEFUN([TYPE_IN_ADDR_T], +[ + AC_CHECK_TYPE([in_addr_t], ,[ + AC_MSG_CHECKING([for in_addr_t equivalent]) + AC_CACHE_VAL([curl_cv_in_addr_t_equiv], + [ + curl_cv_in_addr_t_equiv= + for t in "unsigned long" int size_t unsigned long; do + AC_TRY_COMPILE([ + #include + #include + #include + ],[ + $t data = inet_addr ("1.2.3.4"); + ],[ + curl_cv_in_addr_t_equiv="$t" + break + ]) + done + + if test "x$curl_cv_in_addr_t_equiv" = x; then + AC_MSG_ERROR([Cannot find a type to use in place of in_addr_t]) + fi + ]) + AC_MSG_RESULT($curl_cv_in_addr_t_equiv) + AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv, + [type to use in place of in_addr_t if not defined])], + [#include +#include +#include ]) +]) + +dnl ************************************************************ +dnl check for "localhost", if it doesn't exist, we can't do the +dnl gethostbyname_r tests! +dnl + +AC_DEFUN(CURL_CHECK_WORKING_RESOLVER,[ +AC_MSG_CHECKING([if "localhost" resolves]) +AC_TRY_RUN([ +#include +#include +#include + +int +main () { +struct hostent *h; +h = gethostbyname("localhost"); +exit (h == NULL ? 1 : 0); }],[ + AC_MSG_RESULT(yes)],[ + AC_MSG_RESULT(no) + AC_MSG_ERROR([can't figure out gethostbyname_r() since localhost doesn't resolve]) + + ] +) +]) + +dnl ************************************************************ +dnl check for working getaddrinfo() +dnl +AC_DEFUN(CURL_CHECK_WORKING_GETADDRINFO,[ + AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ + AC_TRY_RUN( [ +#include +#include +#include + +void main(void) { + struct addrinfo hints, *ai; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); + if (error) { + exit(1); + } + else { + exit(0); + } +} +],[ + ac_cv_working_getaddrinfo="yes" +],[ + ac_cv_working_getaddrinfo="no" +],[ + ac_cv_working_getaddrinfo="yes" +])]) +if test "$ac_cv_working_getaddrinfo" = "yes"; then + AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works]) + AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support]) + + IPV6_ENABLED=1 + AC_SUBST(IPV6_ENABLED) +fi +]) + + +AC_DEFUN(CURL_CHECK_LOCALTIME_R, +[ + dnl check for a few thread-safe functions + AC_CHECK_FUNCS(localtime_r,[ + AC_MSG_CHECKING(whether localtime_r is declared) + AC_EGREP_CPP(localtime_r,[ +#include ],[ + AC_MSG_RESULT(yes)],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(whether localtime_r with -D_REENTRANT is declared) + AC_EGREP_CPP(localtime_r,[ +#define _REENTRANT +#include ],[ + AC_DEFINE(NEED_REENTRANT) + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no))])]) +]) + +AC_DEFUN(CURL_CHECK_INET_NTOA_R, +[ + dnl determine if function definition for inet_ntoa_r exists. + AC_CHECK_FUNCS(inet_ntoa_r,[ + AC_MSG_CHECKING(whether inet_ntoa_r is declared) + AC_EGREP_CPP(inet_ntoa_r,[ +#include ],[ + AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared]) + AC_MSG_RESULT(yes)],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(whether inet_ntoa_r with -D_REENTRANT is declared) + AC_EGREP_CPP(inet_ntoa_r,[ +#define _REENTRANT +#include ],[ + AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared]) + AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT defined]) + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no))])]) +]) + +AC_DEFUN(CURL_CHECK_GETHOSTBYADDR_R, +[ + dnl check for number of arguments to gethostbyaddr_r. it might take + dnl either 5, 7, or 8 arguments. + AC_CHECK_FUNCS(gethostbyaddr_r,[ + AC_MSG_CHECKING(if gethostbyaddr_r takes 5 arguments) + AC_TRY_COMPILE([ +#include +#include ],[ +char * address; +int length; +int type; +struct hostent h; +struct hostent_data hdata; +int rc; +rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args]) + ac_cv_gethostbyaddr_args=5],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(if gethostbyaddr_r with -D_REENTRANT takes 5 arguments) + AC_TRY_COMPILE([ +#define _REENTRANT +#include +#include ],[ +char * address; +int length; +int type; +struct hostent h; +struct hostent_data hdata; +int rc; +rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args]) + AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT]) + ac_cv_gethostbyaddr_args=5],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(if gethostbyaddr_r takes 7 arguments) + AC_TRY_COMPILE([ +#include +#include ],[ +char * address; +int length; +int type; +struct hostent h; +char buffer[8192]; +int h_errnop; +struct hostent * hp; + +hp = gethostbyaddr_r(address, length, type, &h, + buffer, 8192, &h_errnop);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args] ) + ac_cv_gethostbyaddr_args=7],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(if gethostbyaddr_r takes 8 arguments) + AC_TRY_COMPILE([ +#include +#include ],[ +char * address; +int length; +int type; +struct hostent h; +char buffer[8192]; +int h_errnop; +struct hostent * hp; +int rc; + +rc = gethostbyaddr_r(address, length, type, &h, + buffer, 8192, &hp, &h_errnop);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args]) + ac_cv_gethostbyaddr_args=8],[ + AC_MSG_RESULT(no) + have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"])])])])]) +]) + +AC_DEFUN(CURL_CHECK_GETHOSTBYNAME_R, +[ + dnl check for number of arguments to gethostbyname_r. it might take + dnl either 3, 5, or 6 arguments. + AC_CHECK_FUNCS(gethostbyname_r,[ + AC_MSG_CHECKING([if gethostbyname_r takes 3 arguments]) + AC_TRY_COMPILE([ +#include +#include +#include +#undef NULL +#define NULL (void *)0 + +int +gethostbyname_r(const char *, struct hostent *, struct hostent_data *);],[ +struct hostent_data data; +gethostbyname_r(NULL, NULL, NULL);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args]) + ac_cv_gethostbyname_args=3],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING([if gethostbyname_r with -D_REENTRANT takes 3 arguments]) + AC_TRY_COMPILE([ +#define _REENTRANT + +#include +#include +#include +#undef NULL +#define NULL (void *)0 + +int +gethostbyname_r(const char *,struct hostent *, struct hostent_data *);],[ +struct hostent_data data; +gethostbyname_r(NULL, NULL, NULL);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args]) + AC_DEFINE(NEED_REENTRANT, 1, [needs REENTRANT]) + ac_cv_gethostbyname_args=3],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING([if gethostbyname_r takes 5 arguments]) + AC_TRY_COMPILE([ +#include +#include +#undef NULL +#define NULL (void *)0 + +struct hostent * +gethostbyname_r(const char *, struct hostent *, char *, int, int *);],[ +gethostbyname_r(NULL, NULL, NULL, 0, NULL);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args]) + ac_cv_gethostbyname_args=5],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING([if gethostbyname_r takes 6 arguments]) + AC_TRY_COMPILE([ +#include +#include +#undef NULL +#define NULL (void *)0 + +int +gethostbyname_r(const char *, struct hostent *, char *, size_t, +struct hostent **, int *);],[ +gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args]) + ac_cv_gethostbyname_args=6],[ + AC_MSG_RESULT(no) + have_missing_r_funcs="$have_missing_r_funcs gethostbyname_r"], + [ac_cv_gethostbyname_args=0])], + [ac_cv_gethostbyname_args=0])], + [ac_cv_gethostbyname_args=0])], + [ac_cv_gethostbyname_args=0])]) + +if test "$ac_cv_func_gethostbyname_r" = "yes"; then + if test "$ac_cv_gethostbyname_args" = "0"; then + dnl there's a gethostbyname_r() function, but we don't know how + dnl many arguments it wants! + AC_MSG_ERROR([couldn't figure out how to use gethostbyname_r()]) + fi +fi +]) diff --git a/main/source/curl/aclocal.m4 b/main/source/curl/aclocal.m4 new file mode 100644 index 00000000..890b74b5 --- /dev/null +++ b/main/source/curl/aclocal.m4 @@ -0,0 +1,7128 @@ +# generated automatically by aclocal 1.7.2 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +dnl Check for how to set a socket to non-blocking state. There seems to exist +dnl four known different ways, with the one used almost everywhere being POSIX +dnl and XPG3, while the other different ways for different systems (old BSD, +dnl Windows and Amiga). +dnl +dnl There are two known platforms (AIX 3.x and SunOS 4.1.x) where the +dnl O_NONBLOCK define is found but does not work. This condition is attempted +dnl to get caught in this script by using an excessive number of #ifdefs... +dnl +AC_DEFUN(CURL_CHECK_NONBLOCKING_SOCKET, +[ + AC_MSG_CHECKING([non-blocking sockets style]) + + AC_TRY_COMPILE([ +/* headers for O_NONBLOCK test */ +#include +#include +#include +],[ +/* try to compile O_NONBLOCK */ + +#if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if defined(__SVR4) || defined(__srv4__) +# define PLATFORM_SOLARIS +# else +# define PLATFORM_SUNOS4 +# endif +#endif +#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX4) +# define PLATFORM_AIX_V3 +#endif + +#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) +#error "O_NONBLOCK does not work on this platform" +#endif + int socket; + int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK); +],[ +dnl the O_NONBLOCK test was fine +nonblock="O_NONBLOCK" +AC_DEFINE(HAVE_O_NONBLOCK, 1, [use O_NONBLOCK for non-blocking sockets]) +],[ +dnl the code was bad, try a different program now, test 2 + + AC_TRY_COMPILE([ +/* headers for FIONBIO test */ +#include +#include +],[ +/* FIONBIO source test */ + int flags = ioctl(socket, FIONBIO, &flags); +],[ +dnl FIONBIO test was good +nonblock="FIONBIO" +AC_DEFINE(HAVE_FIONBIO, 1, [use FIONBIO for non-blocking sockets]) +],[ +dnl FIONBIO test was also bad +dnl the code was bad, try a different program now, test 3 + + AC_TRY_COMPILE([ +/* headers for ioctlsocket test (cygwin?) */ +#include +],[ +/* ioctlsocket source code */ + int flags = ioctlsocket(socket, FIONBIO, &flags); +],[ +dnl ioctlsocket test was good +nonblock="ioctlsocket" +AC_DEFINE(HAVE_IOCTLSOCKET, 1, [use ioctlsocket() for non-blocking sockets]) +],[ +dnl ioctlsocket didnt compile! + + AC_TRY_COMPILE([ +/* headers for IoctlSocket test (Amiga?) */ +#include +],[ +/* IoctlSocket source code */ + int flags = IoctlSocket(socket, FIONBIO, (long)1); +],[ +dnl ioctlsocket test was good +nonblock="IoctlSocket" +AC_DEFINE(HAVE_IOCTLSOCKET_CASE, 1, [use Ioctlsocket() for non-blocking sockets]) +],[ +dnl ioctlsocket didnt compile! +nonblock="nada" +AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1, [disabled non-blocking sockets]) +]) +dnl end of forth test + +]) +dnl end of third test + +]) +dnl end of second test + +]) +dnl end of non-blocking try-compile test + AC_MSG_RESULT($nonblock) + + if test "$nonblock" = "nada"; then + AC_MSG_WARN([non-block sockets disabled]) + fi +]) + +dnl Check for socklen_t: historically on BSD it is an int, and in +dnl POSIX 1g it is a type of its own, but some platforms use different +dnl types for the argument to getsockopt, getpeername, etc. So we +dnl have to test to find something that will work. +AC_DEFUN([TYPE_SOCKLEN_T], +[ + AC_CHECK_TYPE([socklen_t], ,[ + AC_MSG_CHECKING([for socklen_t equivalent]) + AC_CACHE_VAL([curl_cv_socklen_t_equiv], + [ + # Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + curl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t unsigned long "unsigned long"; do + AC_TRY_COMPILE([ + #include + #include + + int getpeername (int, $arg2 *, $t *); + ],[ + $t len; + getpeername(0,0,&len); + ],[ + curl_cv_socklen_t_equiv="$t" + break + ]) + done + done + + if test "x$curl_cv_socklen_t_equiv" = x; then + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) + fi + ]) + AC_MSG_RESULT($curl_cv_socklen_t_equiv) + AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, + [type to use in place of socklen_t if not defined])], + [#include +#include ]) +]) + +dnl Check for in_addr_t: it is used to receive the return code of inet_addr() +dnl and a few other things. If not found, we set it to unsigned int, as even +dnl 64-bit implementations use to set it to a 32-bit type. +AC_DEFUN([TYPE_IN_ADDR_T], +[ + AC_CHECK_TYPE([in_addr_t], ,[ + AC_MSG_CHECKING([for in_addr_t equivalent]) + AC_CACHE_VAL([curl_cv_in_addr_t_equiv], + [ + curl_cv_in_addr_t_equiv= + for t in "unsigned long" int size_t unsigned long; do + AC_TRY_COMPILE([ + #include + #include + #include + ],[ + $t data = inet_addr ("1.2.3.4"); + ],[ + curl_cv_in_addr_t_equiv="$t" + break + ]) + done + + if test "x$curl_cv_in_addr_t_equiv" = x; then + AC_MSG_ERROR([Cannot find a type to use in place of in_addr_t]) + fi + ]) + AC_MSG_RESULT($curl_cv_in_addr_t_equiv) + AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv, + [type to use in place of in_addr_t if not defined])], + [#include +#include +#include ]) +]) + +dnl ************************************************************ +dnl check for "localhost", if it doesn't exist, we can't do the +dnl gethostbyname_r tests! +dnl + +AC_DEFUN(CURL_CHECK_WORKING_RESOLVER,[ +AC_MSG_CHECKING([if "localhost" resolves]) +AC_TRY_RUN([ +#include +#include +#include + +int +main () { +struct hostent *h; +h = gethostbyname("localhost"); +exit (h == NULL ? 1 : 0); }],[ + AC_MSG_RESULT(yes)],[ + AC_MSG_RESULT(no) + AC_MSG_ERROR([can't figure out gethostbyname_r() since localhost doesn't resolve]) + + ] +) +]) + +dnl ************************************************************ +dnl check for working getaddrinfo() +dnl +AC_DEFUN(CURL_CHECK_WORKING_GETADDRINFO,[ + AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ + AC_TRY_RUN( [ +#include +#include +#include + +void main(void) { + struct addrinfo hints, *ai; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); + if (error) { + exit(1); + } + else { + exit(0); + } +} +],[ + ac_cv_working_getaddrinfo="yes" +],[ + ac_cv_working_getaddrinfo="no" +],[ + ac_cv_working_getaddrinfo="yes" +])]) +if test "$ac_cv_working_getaddrinfo" = "yes"; then + AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works]) + AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support]) + + IPV6_ENABLED=1 + AC_SUBST(IPV6_ENABLED) +fi +]) + + +AC_DEFUN(CURL_CHECK_LOCALTIME_R, +[ + dnl check for a few thread-safe functions + AC_CHECK_FUNCS(localtime_r,[ + AC_MSG_CHECKING(whether localtime_r is declared) + AC_EGREP_CPP(localtime_r,[ +#include ],[ + AC_MSG_RESULT(yes)],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(whether localtime_r with -D_REENTRANT is declared) + AC_EGREP_CPP(localtime_r,[ +#define _REENTRANT +#include ],[ + AC_DEFINE(NEED_REENTRANT) + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no))])]) +]) + +AC_DEFUN(CURL_CHECK_INET_NTOA_R, +[ + dnl determine if function definition for inet_ntoa_r exists. + AC_CHECK_FUNCS(inet_ntoa_r,[ + AC_MSG_CHECKING(whether inet_ntoa_r is declared) + AC_EGREP_CPP(inet_ntoa_r,[ +#include ],[ + AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared]) + AC_MSG_RESULT(yes)],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(whether inet_ntoa_r with -D_REENTRANT is declared) + AC_EGREP_CPP(inet_ntoa_r,[ +#define _REENTRANT +#include ],[ + AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared]) + AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT defined]) + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no))])]) +]) + +AC_DEFUN(CURL_CHECK_GETHOSTBYADDR_R, +[ + dnl check for number of arguments to gethostbyaddr_r. it might take + dnl either 5, 7, or 8 arguments. + AC_CHECK_FUNCS(gethostbyaddr_r,[ + AC_MSG_CHECKING(if gethostbyaddr_r takes 5 arguments) + AC_TRY_COMPILE([ +#include +#include ],[ +char * address; +int length; +int type; +struct hostent h; +struct hostent_data hdata; +int rc; +rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args]) + ac_cv_gethostbyaddr_args=5],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(if gethostbyaddr_r with -D_REENTRANT takes 5 arguments) + AC_TRY_COMPILE([ +#define _REENTRANT +#include +#include ],[ +char * address; +int length; +int type; +struct hostent h; +struct hostent_data hdata; +int rc; +rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args]) + AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT]) + ac_cv_gethostbyaddr_args=5],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(if gethostbyaddr_r takes 7 arguments) + AC_TRY_COMPILE([ +#include +#include ],[ +char * address; +int length; +int type; +struct hostent h; +char buffer[8192]; +int h_errnop; +struct hostent * hp; + +hp = gethostbyaddr_r(address, length, type, &h, + buffer, 8192, &h_errnop);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args] ) + ac_cv_gethostbyaddr_args=7],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(if gethostbyaddr_r takes 8 arguments) + AC_TRY_COMPILE([ +#include +#include ],[ +char * address; +int length; +int type; +struct hostent h; +char buffer[8192]; +int h_errnop; +struct hostent * hp; +int rc; + +rc = gethostbyaddr_r(address, length, type, &h, + buffer, 8192, &hp, &h_errnop);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args]) + ac_cv_gethostbyaddr_args=8],[ + AC_MSG_RESULT(no) + have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"])])])])]) +]) + +AC_DEFUN(CURL_CHECK_GETHOSTBYNAME_R, +[ + dnl check for number of arguments to gethostbyname_r. it might take + dnl either 3, 5, or 6 arguments. + AC_CHECK_FUNCS(gethostbyname_r,[ + AC_MSG_CHECKING([if gethostbyname_r takes 3 arguments]) + AC_TRY_COMPILE([ +#include +#include +#include +#undef NULL +#define NULL (void *)0 + +int +gethostbyname_r(const char *, struct hostent *, struct hostent_data *);],[ +struct hostent_data data; +gethostbyname_r(NULL, NULL, NULL);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args]) + ac_cv_gethostbyname_args=3],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING([if gethostbyname_r with -D_REENTRANT takes 3 arguments]) + AC_TRY_COMPILE([ +#define _REENTRANT + +#include +#include +#include +#undef NULL +#define NULL (void *)0 + +int +gethostbyname_r(const char *,struct hostent *, struct hostent_data *);],[ +struct hostent_data data; +gethostbyname_r(NULL, NULL, NULL);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args]) + AC_DEFINE(NEED_REENTRANT, 1, [needs REENTRANT]) + ac_cv_gethostbyname_args=3],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING([if gethostbyname_r takes 5 arguments]) + AC_TRY_COMPILE([ +#include +#include +#undef NULL +#define NULL (void *)0 + +struct hostent * +gethostbyname_r(const char *, struct hostent *, char *, int, int *);],[ +gethostbyname_r(NULL, NULL, NULL, 0, NULL);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args]) + ac_cv_gethostbyname_args=5],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING([if gethostbyname_r takes 6 arguments]) + AC_TRY_COMPILE([ +#include +#include +#undef NULL +#define NULL (void *)0 + +int +gethostbyname_r(const char *, struct hostent *, char *, size_t, +struct hostent **, int *);],[ +gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args]) + ac_cv_gethostbyname_args=6],[ + AC_MSG_RESULT(no) + have_missing_r_funcs="$have_missing_r_funcs gethostbyname_r"], + [ac_cv_gethostbyname_args=0])], + [ac_cv_gethostbyname_args=0])], + [ac_cv_gethostbyname_args=0])], + [ac_cv_gethostbyname_args=0])]) + +if test "$ac_cv_func_gethostbyname_r" = "yes"; then + if test "$ac_cv_gethostbyname_args" = "0"; then + dnl there's a gethostbyname_r() function, but we don't know how + dnl many arguments it wants! + AC_MSG_ERROR([couldn't figure out how to use gethostbyname_r()]) + fi +fi +]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_PREREQ([2.52]) + +# serial 6 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 5 + +AC_PREREQ(2.52) + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +AC_PREREQ([2.54]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl + AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[_am_stamp_count=`expr ${_am_stamp_count-0} + 1` +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.7.2])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# -*- Autoconf -*- + + +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +# Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# serial 4 -*- Autoconf -*- + +# Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null +AC_SUBST([DEPDIR]) +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST(am__include) +AC_SUBST(am__quote) +AC_MSG_RESULT($_am_result) +rm -f confinc confmf +]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 47 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + testring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +#- set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the path to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + irix5* | nonstopux*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + case $host_cpu in + alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the path to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided and an installed libltdl is not found, it is +# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single +# quotes!). If your package is not flat and you're not using automake, +# define top_builddir and top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`]) +])# _LT_AC_LANG_CXX + + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# -------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# +# Check for any special shared library compilation flags. +# +_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac +fi +if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) + + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_DLOPEN_SELF($1) + +# Report which librarie types wil actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cc + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_DLOPEN_SELF($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGISTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $CC in + icc|ecc) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + ccc) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi4*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +SED=$lt_cv_path_SED +]) +AC_MSG_RESULT([$SED]) +]) + diff --git a/main/source/curl/build_vms.com b/main/source/curl/build_vms.com new file mode 100644 index 00000000..142d846b --- /dev/null +++ b/main/source/curl/build_vms.com @@ -0,0 +1,69 @@ +$! +$ +$ on control_y then goto Common_Exit! +$ orig = f$environment("DEFAULT") +$ loc = f$environment("PROCEDURE") +$ def = f$parse("X.X;1",loc) - "X.X;1" +$ +$ set def 'def' +$ cc_qual = "/define=HAVE_CONFIG_H=1/include=(""../include/"",""../"",""../../openssl-0_9_7/include/"")" +$ if p1 .eqs. "LISTING" then cc_qual = cc_qual + "/LIST/MACHINE" +$ if p1 .eqs. "DEBUG" then cc_qual = cc_qual + "/LIST/MACHINE/DEBUG" +$ msg_qual = "" +$ call build "[.lib]" "*.c" +$ call build "[.src]" "*.c" +$ call build "[.src]" "*.msg" +$ link /exe=curl.exe [.src]curl/lib/include=main,[.lib]curl/lib, - + [-.openssl-0_9_7.axp.exe.ssl]libssl/lib, - + [-.openssl-0_9_7.axp.exe.crypto]libcrypto/lib +$ +$ +$ goto Common_Exit +$build: subroutine +$ set noon +$ set default 'p1' +$ search = p2 +$ reset = f$search("reset") +$ if f$search("CURL.OLB") .eqs. "" +$ then +$ LIB/CREATE/OBJECT CURL.OLB +$ endif +$ reset = f$search("reset",1) +$Loop: +$ file = f$search(search,1) +$ if file .eqs. "" then goto EndLoop +$ obj = f$search(f$parse(".OBJ;",file),2) +$ if (obj .nes. "") +$ then +$ if (f$cvtime(f$file(file,"rdt")) .gts. f$cvtime(f$file(obj,"rdt"))) +$ then +$ call compile 'file' +$ lib/object curl.OLB 'f$parse(".obj;",file)' +$ else +$! write sys$output "File: ''file' is up to date" +$ endif +$ else +$! write sys$output "Object for file: ''file' does not exist" +$ call compile 'file' +$ lib/object curl.OLB 'f$parse(".obj;",file)' +$ endif +$ goto Loop +$EndLoop: +$ purge +$ set def 'def' +$ endsubroutine ! Build +$ +$compile: subroutine +$ set noon +$ file = p1 +$ qual = p2+p3+p4+p5+p6+p7+p8 +$ typ = f$parse(file,,,"TYPE") - "." +$ cmd_c = "CC "+cc_qual +$ cmd_msg = "MESSAGE "+msg_qual +$ x = cmd_'typ' +$ 'x' 'file' +$ ENDSUBROUTINE ! Compile +$ +$Common_Exit: +$ set default 'orig' +$ exit diff --git a/main/source/curl/config.guess b/main/source/curl/config.guess new file mode 100644 index 00000000..6cdcc158 --- /dev/null +++ b/main/source/curl/config.guess @@ -0,0 +1,1400 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-11-30' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $files ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; +unset files' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + eval $set_cc_for_build + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null + if test "$?" = 0 ; then + case `$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; + esac + fi + rm -f $dummy.s $dummy && rmdir $tmpdir + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy && rmdir $tmpdir + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i586-pc-interix3 + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +rm -f $dummy.c $dummy && rmdir $tmpdir + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/main/source/curl/config.sub b/main/source/curl/config.sub new file mode 100644 index 00000000..df03fce1 --- /dev/null +++ b/main/source/curl/config.sub @@ -0,0 +1,1469 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-11-30' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39 | mipstx39el \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic4x | c4x*) + basic_machine=tic4x-unknown + os=-coff + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/main/source/curl/configure b/main/source/curl/configure new file mode 100644 index 00000000..080733d5 --- /dev/null +++ b/main/source/curl/configure @@ -0,0 +1,27746 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.57 for curl -. +# +# Report bugs to . +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +# +# Copyright (c) 1998 - 2003 Daniel Stenberg, +# This configure script may be copied, distributed and modified under the +# terms of the curl license; see COPYING for more details +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=`echo "$tagnames,CXX" | sed 's/^,//'` + +tagnames=`echo "$tagnames,F77" | sed 's/^,//'` + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='curl' +PACKAGE_TARNAME='curl' +PACKAGE_VERSION='-' +PACKAGE_STRING='curl -' +PACKAGE_BUGREPORT='curl-bug@haxx.se' + +ac_unique_file="lib/urldata.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT SED INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE VERSIONNUM PKGADD_PKG PKGADD_NAME PKGADD_VENDOR build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL NO_UNDEFINED_TRUE NO_UNDEFINED_FALSE CURL_DISABLE_HTTP CURL_DISABLE_GOPHER CURL_DISABLE_FTP CURL_DISABLE_FILE CURL_DISABLE_LDAP CURL_DISABLE_DICT CURL_DISABLE_TELNET IPV6_ENABLED RANDOM_FILE KRB4_ENABLED PKGCONFIG OPENSSL_ENABLED HAVE_LIBZ PERL NROFF CURL_CA_BUNDLE YACC LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures curl - to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of curl -:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors + --disable-largefile omit support for large files + --enable-shared[=PKGS] + build shared libraries [default=yes] + --enable-static[=PKGS] + build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-http Enable HTTP support + --disable-http Disable HTTP support + --enable-ftp Enable FTP support + --disable-ftp Disable FTP support + --enable-gopher Enable GOPHER support + --disable-gopher Disable GOPHER support + --enable-file Enable FILE support + --disable-file Disable FILE support + --enable-ldap Enable LDAP support + --disable-ldap Disable LDAP support + --enable-dict Enable DICT support + --disable-dict Disable DICT support + --enable-telnet Enable TELNET support + --disable-telnet Disable TELNET support + --enable-ipv6 Enable ipv6 (with ipv4) support + --disable-ipv6 Disable ipv6 support + --enable-libgcc use libgcc when linking + --enable-nonblocking Enable detecting how to do it + --disable-nonblocking Disable non-blocking socket detection + --disable-thread don't look for thread-safe functions + --enable-debug Enable pedantic debug options + --disable-debug Disable debug options + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] + include additional configurations [automatic] + --with-egd-socket=FILE Entropy Gathering Daemon socket pathname + --with-random=FILE read randomness from FILE (default=/dev/urandom) + --with-krb4-includes=DIR + Specify location of kerberos4 headers + --with-krb4-libs=DIR Specify location of kerberos4 libs + --with-krb4=DIR where to look for Kerberos4 + --with-ssl=PATH where to look for SSL, PATH points to the SSL + installation (default: /usr/local/ssl) + --without-ssl disable SSL + --with-zlib=PATH search for zlib in PATH + --without-zlib disable use of zlib + --with-ca-bundle=FILE File name to install the CA bundle as + --without-ca-bundle Don't install the CA bundle + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +curl configure - +generated by GNU Autoconf 2.57 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. + +Copyright (c) 1998 - 2003 Daniel Stenberg, +This configure script may be copied, distributed and modified under the +terms of the curl license; see COPYING for more details +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by curl $as_me -, which was +generated by GNU Autoconf 2.57. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers lib/config.h src/config.h tests/server/config.h lib/ca-bundle.h" + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +# Extract the first word of "sed", so it can be a program name with args. +set dummy sed; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SED in + [\\/]* | ?:[\\/]*) + ac_cv_path_SED="$SED" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +SED=$ac_cv_path_SED + +if test -n "$SED"; then + echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + +VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h` +am__api_version="1.7" +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + # test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=curl + VERSION=$VERSION + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + + +echo "$as_me:$LINENO: checking curl version" >&5 +echo $ECHO_N "checking curl version... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $VERSION" >&5 +echo "${ECHO_T}$VERSION" >&6 + +VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curl.h` + + +PKGADD_PKG="HAXXcurl" +PKGADD_NAME="cURL - a client that groks URLs" +PKGADD_VENDOR="curl.haxx.se" + + + + + + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + + +cat >>confdefs.h <<_ACEOF +#define OS "${host}" +_ACEOF + + +rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null + + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + + +echo "$as_me:$LINENO: checking for AIX" >&5 +echo $ECHO_N "checking for AIX... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef _AIX + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest* + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# Check whether --enable-largefile or --disable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval="$enable_largefile" + +fi; +if test "$enable_largefile" != no; then + + echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + ac_cv_sys_file_offset_bits=no + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_file_offset_bits=64; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + break +done +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 +if test "$ac_cv_sys_file_offset_bits" != no; then + +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF + +fi +rm -f conftest* + echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + ac_cv_sys_large_files=no + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_large_files=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + break +done +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6 +if test "$ac_cv_sys_large_files" != no; then + +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF + +fi +rm -f conftest* +fi + + + + + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi; + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi; + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +SED=$lt_cv_path_SED + +fi + +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `"$LD" -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin* | mingw* | pw32*) + # win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='win32_libid' + ;; + +darwin* | rhapsody*) + # this will be overwritten by pass_all, but leave it in just in case + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.[012]) + lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System` + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + irix5* | nonstopux*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + case $host_cpu in + alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 4985 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*-cygwin* | *-*-mingw* | *-*-pw32*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_DLLTOOL" && ac_cv_prog_ac_ct_DLLTOOL="false" +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +echo "${ECHO_T}$ac_ct_DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DLLTOOL=$ac_ct_DLLTOOL +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AS" && ac_cv_prog_ac_ct_AS="false" +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +echo "${ECHO_T}$ac_ct_AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AS=$ac_ct_AS +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_OBJDUMP" && ac_cv_prog_ac_ct_OBJDUMP="false" +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +echo "${ECHO_T}$ac_ct_OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + OBJDUMP=$ac_ct_OBJDUMP +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; + +esac + +need_locks="$enable_libtool_lock" + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:6468:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. +ac_save_ext=$ac_ext +ac_ext=F +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "$G77" = yes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "$G77" = yes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + testring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris* | sysv5*) + symcode='[BDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGISTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=yes + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# +# Check for any special shared library compilation flags. +# +lt_prog_cc_shlib= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + lt_prog_cc_shlib='-belf' + ;; + esac +fi +if test -n "$lt_prog_cc_shlib"; then + { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 +echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} + if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : + else + { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 +echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} + lt_cv_prog_cc_can_build_shared=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_prog_compiler_static" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7473: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7477: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $CC in + icc|ecc) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + ccc) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic='-Kpic' + lt_prog_compiler_static='-dn' + ;; + + solaris*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7705: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7709: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7772: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7776: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi4*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='-all_load $convenience' + link_all_deplibs=yes + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var " || \ + test "X$hardcode_automatic"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# Report which librarie types wil actually be built +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='-all_load $convenience' + link_all_deplibs=yes + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags or --without-tags was given. +if test "${with_tags+set}" = set; then + withval="$with_tags" + tagnames="$withval" +fi; + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cc + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `"$LD" -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_CXX=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX=' ' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs_CXX=no + fi + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc_CXX=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_CXX='-flat_namespace -undefined suppress' + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='-all_load $convenience' + link_all_deplibs_CXX=yes + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd12*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + hardcode_libdir_separator_CXX=: + ;; + ia64*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + *) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + archive_cmds_need_lc_CXX=no + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sco*) + archive_cmds_need_lc_CXX=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.0-5 | solaris2.0-5.*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + archive_cmds_need_lc_CXX=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12014: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:12018: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12081: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:12085: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var CXX" || \ + test "X$hardcode_automatic_CXX"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6 + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4*) + test "$enable_shared" = yes && enable_static=no + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +test "$ld_shlibs_F77" = no && can_build_shared=no + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $CC in + icc|ecc) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + ccc) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic_F77='-Kpic' + lt_prog_compiler_static_F77='-dn' + ;; + + solaris*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14244: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:14248: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14311: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:14315: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_F77=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77=' ' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi4*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc_F77=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_F77='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_F77='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='-all_load $convenience' + link_all_deplibs_F77=yes + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + ia64*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + *) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + sco3.2v5*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_F77='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv5*) + no_undefined_flag_F77=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec_F77= + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var F77" || \ + test "X$hardcode_automatic_F77"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6 + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16251: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16255: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $CC in + icc|ecc) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + ccc) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic_GCJ='-Kpic' + lt_prog_compiler_static_GCJ='-dn' + ;; + + solaris*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16483: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16487: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16550: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:16554: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_GCJ=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ=' ' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi4*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc_GCJ=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_GCJ='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='-all_load $convenience' + link_all_deplibs_GCJ=yes + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + ia64*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + *) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + sco3.2v5*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv5*) + no_undefined_flag_GCJ=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec_GCJ= + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var GCJ" || \ + test "X$hardcode_automatic_GCJ"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6 + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + + +case $host in + *-*-cygwin | *-*-mingw* | *-*-pw32*) + need_no_undefined=yes + ;; + *) + need_no_undefined=no + ;; +esac + + + +if test x$need_no_undefined = xyes; then + NO_UNDEFINED_TRUE= + NO_UNDEFINED_FALSE='#' +else + NO_UNDEFINED_TRUE='#' + NO_UNDEFINED_FALSE= +fi + + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +echo "$as_me:$LINENO: checking whether to support http" >&5 +echo $ECHO_N "checking whether to support http... $ECHO_C" >&6 +# Check whether --enable-http or --disable-http was given. +if test "${enable_http+set}" = set; then + enableval="$enable_http" + case "$enableval" in + no) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\_ACEOF +#define CURL_DISABLE_HTTP 1 +_ACEOF + + { echo "$as_me:$LINENO: WARNING: disable HTTP disables FTP over proxy and GOPHER too" >&5 +echo "$as_me: WARNING: disable HTTP disables FTP over proxy and GOPHER too" >&2;} + +cat >>confdefs.h <<\_ACEOF +#define CURL_DISABLE_GOPHER 1 +_ACEOF + + + + ;; + *) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + esac +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +fi; +echo "$as_me:$LINENO: checking whether to support ftp" >&5 +echo $ECHO_N "checking whether to support ftp... $ECHO_C" >&6 +# Check whether --enable-ftp or --disable-ftp was given. +if test "${enable_ftp+set}" = set; then + enableval="$enable_ftp" + case "$enableval" in + no) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\_ACEOF +#define CURL_DISABLE_FTP 1 +_ACEOF + + + ;; + *) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + esac +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +fi; +echo "$as_me:$LINENO: checking whether to support gopher" >&5 +echo $ECHO_N "checking whether to support gopher... $ECHO_C" >&6 +# Check whether --enable-gopher or --disable-gopher was given. +if test "${enable_gopher+set}" = set; then + enableval="$enable_gopher" + case "$enableval" in + no) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\_ACEOF +#define CURL_DISABLE_GOPHER 1 +_ACEOF + + + ;; + *) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + esac +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +fi; +echo "$as_me:$LINENO: checking whether to support file" >&5 +echo $ECHO_N "checking whether to support file... $ECHO_C" >&6 +# Check whether --enable-file or --disable-file was given. +if test "${enable_file+set}" = set; then + enableval="$enable_file" + case "$enableval" in + no) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\_ACEOF +#define CURL_DISABLE_FILE 1 +_ACEOF + + + ;; + *) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + esac +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +fi; +echo "$as_me:$LINENO: checking whether to support ldap" >&5 +echo $ECHO_N "checking whether to support ldap... $ECHO_C" >&6 +# Check whether --enable-ldap or --disable-ldap was given. +if test "${enable_ldap+set}" = set; then + enableval="$enable_ldap" + case "$enableval" in + no) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\_ACEOF +#define CURL_DISABLE_LDAP 1 +_ACEOF + + + ;; + *) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + esac +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +fi; +echo "$as_me:$LINENO: checking whether to support dict" >&5 +echo $ECHO_N "checking whether to support dict... $ECHO_C" >&6 +# Check whether --enable-dict or --disable-dict was given. +if test "${enable_dict+set}" = set; then + enableval="$enable_dict" + case "$enableval" in + no) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\_ACEOF +#define CURL_DISABLE_DICT 1 +_ACEOF + + + ;; + *) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + esac +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +fi; +echo "$as_me:$LINENO: checking whether to support telnet" >&5 +echo $ECHO_N "checking whether to support telnet... $ECHO_C" >&6 +# Check whether --enable-telnet or --disable-telnet was given. +if test "${enable_telnet+set}" = set; then + enableval="$enable_telnet" + case "$enableval" in + no) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\_ACEOF +#define CURL_DISABLE_TELNET 1 +_ACEOF + + + ;; + *) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + esac +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +fi; + + + +echo "$as_me:$LINENO: checking whether to enable ipv6" >&5 +echo $ECHO_N "checking whether to enable ipv6... $ECHO_C" >&6 +# Check whether --enable-ipv6 or --disable-ipv6 was given. +if test "${enable_ipv6+set}" = set; then + enableval="$enable_ipv6" + case "$enableval" in + no) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ipv6=no + ;; + *) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ipv6=yes + ;; + esac +else + if test "$cross_compiling" = yes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ipv6=no + +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* is AF_INET6 available? */ +#include +#include +main() +{ + if (socket(AF_INET6, SOCK_STREAM, 0) < 0) + exit(1); + else + exit(0); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ipv6=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ipv6=no +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi; + +if test "$ipv6" = "yes"; then + + echo "$as_me:$LINENO: checking for working getaddrinfo" >&5 +echo $ECHO_N "checking for working getaddrinfo... $ECHO_C" >&6 +if test "${ac_cv_working_getaddrinfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + + ac_cv_working_getaddrinfo="yes" + +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include + +void main(void) { + struct addrinfo hints, *ai; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); + if (error) { + exit(1); + } + else { + exit(0); + } +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + ac_cv_working_getaddrinfo="yes" + +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) + + ac_cv_working_getaddrinfo="no" + +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_working_getaddrinfo" >&5 +echo "${ECHO_T}$ac_cv_working_getaddrinfo" >&6 +if test "$ac_cv_working_getaddrinfo" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETADDRINFO 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_IPV6 1 +_ACEOF + + + IPV6_ENABLED=1 + +fi + +fi + + + +echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 +if test $ac_cv_func_gethostbyname = yes; then + : +else + +echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +fi + +fi + + +if test "$ac_cv_lib_nsl_gethostbyname" != "yes" -a "$ac_cv_func_gethostbyname" != "yes"; then + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 +if test $ac_cv_func_gethostbyname = yes; then + : +else + +echo "$as_me:$LINENO: checking for gethostbyname in -lsocket" >&5 +echo $ECHO_N "checking for gethostbyname in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_gethostbyname" >&6 +if test $ac_cv_lib_socket_gethostbyname = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +fi + +fi + +if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname"; then + echo "$as_me:$LINENO: checking trying both nsl and socket libs" >&5 +echo $ECHO_N "checking trying both nsl and socket libs... $ECHO_C" >&6 + my_ac_save_LIBS=$LIBS + LIBS="-lnsl -lsocket $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +gethostbyname(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + my_ac_link_result=success +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +my_ac_link_result=failure +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + if test "$my_ac_link_result" = "failure"; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: couldn't find libraries for gethostbyname()" >&5 +echo "$as_me: error: couldn't find libraries for gethostbyname()" >&2;} + { (exit 1); exit 1; }; } + LIBS=$my_ac_save_LIBS + else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + fi +fi + +echo "$as_me:$LINENO: checking for strcasecmp" >&5 +echo $ECHO_N "checking for strcasecmp... $ECHO_C" >&6 +if test "${ac_cv_func_strcasecmp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char strcasecmp (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strcasecmp (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_strcasecmp) || defined (__stub___strcasecmp) +choke me +#else +char (*f) () = strcasecmp; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != strcasecmp; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strcasecmp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_strcasecmp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_strcasecmp" >&5 +echo "${ECHO_T}$ac_cv_func_strcasecmp" >&6 +if test $ac_cv_func_strcasecmp = yes; then + : +else + +echo "$as_me:$LINENO: checking for strcasecmp in -lresolve" >&5 +echo $ECHO_N "checking for strcasecmp in -lresolve... $ECHO_C" >&6 +if test "${ac_cv_lib_resolve_strcasecmp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolve $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strcasecmp (); +int +main () +{ +strcasecmp (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_resolve_strcasecmp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_resolve_strcasecmp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_resolve_strcasecmp" >&5 +echo "${ECHO_T}$ac_cv_lib_resolve_strcasecmp" >&6 +if test $ac_cv_lib_resolve_strcasecmp = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRESOLVE 1 +_ACEOF + + LIBS="-lresolve $LIBS" + +fi + +fi + + +if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then + echo "$as_me:$LINENO: checking for strcasecmp in -lresolve" >&5 +echo $ECHO_N "checking for strcasecmp in -lresolve... $ECHO_C" >&6 +if test "${ac_cv_lib_resolve_strcasecmp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolve -lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strcasecmp (); +int +main () +{ +strcasecmp (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_resolve_strcasecmp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_resolve_strcasecmp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_resolve_strcasecmp" >&5 +echo "${ECHO_T}$ac_cv_lib_resolve_strcasecmp" >&6 +if test $ac_cv_lib_resolve_strcasecmp = yes; then + LIBS="-lresolve $LIBS" +fi + +fi + +echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +char (*f) () = connect; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != connect; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_connect=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 +if test $ac_cv_func_connect = yes; then + : +else + +echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +int +main () +{ +connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_connect=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 +if test $ac_cv_lib_socket_connect = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +fi + + +echo "$as_me:$LINENO: checking for dlclose" >&5 +echo $ECHO_N "checking for dlclose... $ECHO_C" >&6 +if test "${ac_cv_func_dlclose+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlclose (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlclose (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlclose) || defined (__stub___dlclose) +choke me +#else +char (*f) () = dlclose; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlclose; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlclose=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlclose=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlclose" >&5 +echo "${ECHO_T}$ac_cv_func_dlclose" >&6 +if test $ac_cv_func_dlclose = yes; then + : +else + +echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + +fi + + +echo "$as_me:$LINENO: checking whether to use libgcc" >&5 +echo $ECHO_N "checking whether to use libgcc... $ECHO_C" >&6 +# Check whether --enable-libgcc or --disable-libgcc was given. +if test "${enable_libgcc+set}" = set; then + enableval="$enable_libgcc" + case "$enableval" in + yes) + LIBS="$LIBS -lgcc" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + *) echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi; + +# Check whether --enable-nonblocking or --disable-nonblocking was given. +if test "${enable_nonblocking+set}" = set; then + enableval="$enable_nonblocking" + + if test "$enableval" = "no" ; then + { echo "$as_me:$LINENO: WARNING: non-blocking sockets disabled" >&5 +echo "$as_me: WARNING: non-blocking sockets disabled" >&2;} + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DISABLED_NONBLOCKING 1 +_ACEOF + + else + + echo "$as_me:$LINENO: checking non-blocking sockets style" >&5 +echo $ECHO_N "checking non-blocking sockets style... $ECHO_C" >&6 + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* headers for O_NONBLOCK test */ +#include +#include +#include + +int +main () +{ + +/* try to compile O_NONBLOCK */ + +#if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if defined(__SVR4) || defined(__srv4__) +# define PLATFORM_SOLARIS +# else +# define PLATFORM_SUNOS4 +# endif +#endif +#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX4) +# define PLATFORM_AIX_V3 +#endif + +#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) +#error "O_NONBLOCK does not work on this platform" +#endif + int socket; + int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +nonblock="O_NONBLOCK" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_O_NONBLOCK 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* headers for FIONBIO test */ +#include +#include + +int +main () +{ + +/* FIONBIO source test */ + int flags = ioctl(socket, FIONBIO, &flags); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +nonblock="FIONBIO" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FIONBIO 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* headers for ioctlsocket test (cygwin?) */ +#include + +int +main () +{ + +/* ioctlsocket source code */ + int flags = ioctlsocket(socket, FIONBIO, &flags); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +nonblock="ioctlsocket" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_IOCTLSOCKET 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* headers for IoctlSocket test (Amiga?) */ +#include + +int +main () +{ + +/* IoctlSocket source code */ + int flags = IoctlSocket(socket, FIONBIO, (long)1); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +nonblock="IoctlSocket" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_IOCTLSOCKET_CASE 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +nonblock="nada" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DISABLED_NONBLOCKING 1 +_ACEOF + + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:$LINENO: result: $nonblock" >&5 +echo "${ECHO_T}$nonblock" >&6 + + if test "$nonblock" = "nada"; then + { echo "$as_me:$LINENO: WARNING: non-block sockets disabled" >&5 +echo "$as_me: WARNING: non-block sockets disabled" >&2;} + fi + + fi + +else + + + echo "$as_me:$LINENO: checking non-blocking sockets style" >&5 +echo $ECHO_N "checking non-blocking sockets style... $ECHO_C" >&6 + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* headers for O_NONBLOCK test */ +#include +#include +#include + +int +main () +{ + +/* try to compile O_NONBLOCK */ + +#if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if defined(__SVR4) || defined(__srv4__) +# define PLATFORM_SOLARIS +# else +# define PLATFORM_SUNOS4 +# endif +#endif +#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX4) +# define PLATFORM_AIX_V3 +#endif + +#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) +#error "O_NONBLOCK does not work on this platform" +#endif + int socket; + int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +nonblock="O_NONBLOCK" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_O_NONBLOCK 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* headers for FIONBIO test */ +#include +#include + +int +main () +{ + +/* FIONBIO source test */ + int flags = ioctl(socket, FIONBIO, &flags); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +nonblock="FIONBIO" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FIONBIO 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* headers for ioctlsocket test (cygwin?) */ +#include + +int +main () +{ + +/* ioctlsocket source code */ + int flags = ioctlsocket(socket, FIONBIO, &flags); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +nonblock="ioctlsocket" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_IOCTLSOCKET 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* headers for IoctlSocket test (Amiga?) */ +#include + +int +main () +{ + +/* IoctlSocket source code */ + int flags = IoctlSocket(socket, FIONBIO, (long)1); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +nonblock="IoctlSocket" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_IOCTLSOCKET_CASE 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +nonblock="nada" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DISABLED_NONBLOCKING 1 +_ACEOF + + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:$LINENO: result: $nonblock" >&5 +echo "${ECHO_T}$nonblock" >&6 + + if test "$nonblock" = "nada"; then + { echo "$as_me:$LINENO: WARNING: non-block sockets disabled" >&5 +echo "$as_me: WARNING: non-block sockets disabled" >&2;} + fi + + +fi; + + + +# Check whether --with-egd-socket or --without-egd-socket was given. +if test "${with_egd_socket+set}" = set; then + withval="$with_egd_socket" + EGD_SOCKET="$withval" + +fi; +if test -n "$EGD_SOCKET" ; then + +cat >>confdefs.h <<_ACEOF +#define EGD_SOCKET "$EGD_SOCKET" +_ACEOF + +fi + + +# Check whether --with-random or --without-random was given. +if test "${with_random+set}" = set; then + withval="$with_random" + RANDOM_FILE="$withval" +else + + echo "$as_me:$LINENO: checking for \"/dev/urandom\"" >&5 +echo $ECHO_N "checking for \"/dev/urandom\"... $ECHO_C" >&6 +if test "${ac_cv_file___dev_urandom_+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r ""/dev/urandom""; then + ac_cv_file___dev_urandom_=yes +else + ac_cv_file___dev_urandom_=no +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_file___dev_urandom_" >&5 +echo "${ECHO_T}$ac_cv_file___dev_urandom_" >&6 +if test $ac_cv_file___dev_urandom_ = yes; then + RANDOM_FILE="/dev/urandom" +fi + + + +fi; +if test -n "$RANDOM_FILE" ; then + + +cat >>confdefs.h <<_ACEOF +#define RANDOM_FILE "$RANDOM_FILE" +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking if argv can be written to" >&5 +echo $ECHO_N "checking if argv can be written to... $ECHO_C" >&6 +if test "$cross_compiling" = yes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: WARNING: the previous check could not be made default was used" >&5 +echo "$as_me: WARNING: the previous check could not be made default was used" >&2;} + +else + cat >conftest.$ac_ext <<_ACEOF + +int main(int argc, char ** argv) { + argv[0][0] = ' '; + return (argv[0][0] == ' ')?0:1; +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_WRITABLE_ARGV 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + +# Check whether --with-krb4-includes or --without-krb4-includes was given. +if test "${with_krb4_includes+set}" = set; then + withval="$with_krb4_includes" + + CPPFLAGS="$CPPFLAGS -I$withval" + KRB4INC="$withval" + want_krb4=yes + +fi; + + +# Check whether --with-krb4-libs or --without-krb4-libs was given. +if test "${with_krb4_libs+set}" = set; then + withval="$with_krb4_libs" + + LDFLAGS="$LDFLAGS -L$withval" + KRB4LIB="$withval" + want_krb4=yes + +fi; + + +OPT_KRB4=off + +# Check whether --with-krb4 or --without-krb4 was given. +if test "${with_krb4+set}" = set; then + withval="$with_krb4" + + OPT_KRB4="$withval" + if test X"$OPT_KRB4" != Xyes + then + LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib" + KRB4LIB="$OPT_KRB4/lib" + CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include" + KRB4INC="$OPT_KRB4/include" + fi + want_krb4="yes" + +fi; + +echo "$as_me:$LINENO: checking if Kerberos4 support is requested" >&5 +echo $ECHO_N "checking if Kerberos4 support is requested... $ECHO_C" >&6 + +if test "$want_krb4" = yes +then + if test "$ipv6" = "yes"; then + echo krb4 is not compatible with IPv6 + exit 1 + fi + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + + + echo "$as_me:$LINENO: checking where to look for Kerberos4" >&5 +echo $ECHO_N "checking where to look for Kerberos4... $ECHO_C" >&6 + if test X"$OPT_KRB4" = Xyes + then + echo "$as_me:$LINENO: result: defaults" >&5 +echo "${ECHO_T}defaults" >&6 + else + echo "$as_me:$LINENO: result: libs in $KRB4LIB, headers in $KRB4INC" >&5 +echo "${ECHO_T}libs in $KRB4LIB, headers in $KRB4INC" >&6 + fi + + echo "$as_me:$LINENO: checking for des_pcbc_encrypt in -ldes" >&5 +echo $ECHO_N "checking for des_pcbc_encrypt in -ldes... $ECHO_C" >&6 +if test "${ac_cv_lib_des_des_pcbc_encrypt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldes $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char des_pcbc_encrypt (); +int +main () +{ +des_pcbc_encrypt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_des_des_pcbc_encrypt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_des_des_pcbc_encrypt=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_des_des_pcbc_encrypt" >&5 +echo "${ECHO_T}$ac_cv_lib_des_des_pcbc_encrypt" >&6 +if test $ac_cv_lib_des_des_pcbc_encrypt = yes; then + + +for ac_header in des.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + echo "$as_me:$LINENO: checking for res_search" >&5 +echo $ECHO_N "checking for res_search... $ECHO_C" >&6 +if test "${ac_cv_func_res_search+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char res_search (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char res_search (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_res_search) || defined (__stub___res_search) +choke me +#else +char (*f) () = res_search; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != res_search; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_res_search=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_res_search=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_res_search" >&5 +echo "${ECHO_T}$ac_cv_func_res_search" >&6 +if test $ac_cv_func_res_search = yes; then + : +else + +echo "$as_me:$LINENO: checking for res_search in -lresolv" >&5 +echo $ECHO_N "checking for res_search in -lresolv... $ECHO_C" >&6 +if test "${ac_cv_lib_resolv_res_search+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char res_search (); +int +main () +{ +res_search (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_resolv_res_search=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_resolv_res_search=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_search" >&5 +echo "${ECHO_T}$ac_cv_lib_resolv_res_search" >&6 +if test $ac_cv_lib_resolv_res_search = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + +fi + + + echo "$as_me:$LINENO: checking for krb_net_read in -lkrb" >&5 +echo $ECHO_N "checking for krb_net_read in -lkrb... $ECHO_C" >&6 +if test "${ac_cv_lib_krb_krb_net_read+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lkrb $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char krb_net_read (); +int +main () +{ +krb_net_read (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_krb_krb_net_read=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_krb_krb_net_read=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_krb_krb_net_read" >&5 +echo "${ECHO_T}$ac_cv_lib_krb_krb_net_read" >&6 +if test $ac_cv_lib_krb_krb_net_read = yes; then + + +for ac_header in krb.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + LIBS="-lkrb -ldes $LIBS" + + +for ac_func in krb_get_our_ip_for_realm +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +cat >>confdefs.h <<\_ACEOF +#define KRB4 1 +_ACEOF + + + KRB4_ENABLED=1 + + + +for ac_func in strlcpy +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +fi + + +fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKGCONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_PKGCONFIG" && ac_cv_path_PKGCONFIG="no" + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG + +if test -n "$PKGCONFIG"; then + echo "$as_me:$LINENO: result: $PKGCONFIG" >&5 +echo "${ECHO_T}$PKGCONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test "$PKGCONFIG" != "no" ; then + echo "$as_me:$LINENO: checking for OpenSSL options using pkg-config" >&5 +echo $ECHO_N "checking for OpenSSL options using pkg-config... $ECHO_C" >&6 + + $PKGCONFIG --exists openssl + SSL_EXISTS=$? + + if test "$SSL_EXISTS" -eq "0"; then + SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null` + SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null` + SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null` + + LIBS="$LIBS $SSL_LIBS" + CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" + LDFLAGS="$LDFLAGS $SSL_LDFLAGS" + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + +fi + + +OPT_SSL=off + +# Check whether --with-ssl or --without-ssl was given. +if test "${with_ssl+set}" = set; then + withval="$with_ssl" + OPT_SSL=$withval +fi; + +if test X"$OPT_SSL" = Xno +then + { echo "$as_me:$LINENO: WARNING: SSL/https support disabled" >&5 +echo "$as_me: WARNING: SSL/https support disabled" >&2;} +else + + + CLEANLDFLAGS="$LDFLAGS" + CLEANCPPFLAGS="$CPPFLAGS" + + case "$OPT_SSL" in + yes) + EXTRA_SSL=/usr/local/ssl ;; + off) + EXTRA_SSL= ;; + *) + EXTRA_SSL=$OPT_SSL + LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib" + CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include" + ;; + esac + + echo "$as_me:$LINENO: checking for CRYPTO_lock in -lcrypto" >&5 +echo $ECHO_N "checking for CRYPTO_lock in -lcrypto... $ECHO_C" >&6 +if test "${ac_cv_lib_crypto_CRYPTO_lock+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char CRYPTO_lock (); +int +main () +{ +CRYPTO_lock (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_crypto_CRYPTO_lock=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_crypto_CRYPTO_lock=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_CRYPTO_lock" >&5 +echo "${ECHO_T}$ac_cv_lib_crypto_CRYPTO_lock" >&6 +if test $ac_cv_lib_crypto_CRYPTO_lock = yes; then + + HAVECRYPTO="yes" + +else + + OLDLDFLAGS="$LDFLAGS" + OLDCPPFLAGS="$CPPFLAGS" + LDFLAGS="$CLEANLDFLAGS -L$EXTRA_SSL/lib" + CPPFLAGS="$CLEANCPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include" + echo "$as_me:$LINENO: checking for CRYPTO_add_lock in -lcrypto" >&5 +echo $ECHO_N "checking for CRYPTO_add_lock in -lcrypto... $ECHO_C" >&6 +if test "${ac_cv_lib_crypto_CRYPTO_add_lock+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char CRYPTO_add_lock (); +int +main () +{ +CRYPTO_add_lock (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_crypto_CRYPTO_add_lock=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_crypto_CRYPTO_add_lock=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_CRYPTO_add_lock" >&5 +echo "${ECHO_T}$ac_cv_lib_crypto_CRYPTO_add_lock" >&6 +if test $ac_cv_lib_crypto_CRYPTO_add_lock = yes; then + + HAVECRYPTO="yes" +else + + LDFLAGS="$OLDLDFLAGS" + CPPFLAGS="$OLDCPPFLAGS" + +fi + + +fi + + + + if test "$HAVECRYPTO" = "yes"; then + + +echo "$as_me:$LINENO: checking for CRYPTO_add_lock in -lcrypto" >&5 +echo $ECHO_N "checking for CRYPTO_add_lock in -lcrypto... $ECHO_C" >&6 +if test "${ac_cv_lib_crypto_CRYPTO_add_lock+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char CRYPTO_add_lock (); +int +main () +{ +CRYPTO_add_lock (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_crypto_CRYPTO_add_lock=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_crypto_CRYPTO_add_lock=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_CRYPTO_add_lock" >&5 +echo "${ECHO_T}$ac_cv_lib_crypto_CRYPTO_add_lock" >&6 +if test $ac_cv_lib_crypto_CRYPTO_add_lock = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +fi + + +echo "$as_me:$LINENO: checking for SSL_connect in -lssl" >&5 +echo $ECHO_N "checking for SSL_connect in -lssl... $ECHO_C" >&6 +if test "${ac_cv_lib_ssl_SSL_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char SSL_connect (); +int +main () +{ +SSL_connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ssl_SSL_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ssl_SSL_connect=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_connect" >&5 +echo "${ECHO_T}$ac_cv_lib_ssl_SSL_connect" >&6 +if test $ac_cv_lib_ssl_SSL_connect = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSSL 1 +_ACEOF + + LIBS="-lssl $LIBS" + +fi + + + if test "$ac_cv_lib_ssl_SSL_connect" != yes; then + echo "$as_me:$LINENO: checking for ssl with RSAglue/rsaref libs in use" >&5 +echo $ECHO_N "checking for ssl with RSAglue/rsaref libs in use... $ECHO_C" >&6; + OLIBS=$LIBS + LIBS="$LIBS -lRSAglue -lrsaref" + +echo "$as_me:$LINENO: checking for SSL_connect in -lssl" >&5 +echo $ECHO_N "checking for SSL_connect in -lssl... $ECHO_C" >&6 +if test "${ac_cv_lib_ssl_SSL_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char SSL_connect (); +int +main () +{ +SSL_connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ssl_SSL_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ssl_SSL_connect=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_connect" >&5 +echo "${ECHO_T}$ac_cv_lib_ssl_SSL_connect" >&6 +if test $ac_cv_lib_ssl_SSL_connect = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSSL 1 +_ACEOF + + LIBS="-lssl $LIBS" + +fi + + if test "$ac_cv_lib_ssl_SSL_connect" != yes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS=$OLIBS + else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + fi + fi + + + + + + + + +for ac_header in openssl/x509.h openssl/rsa.h openssl/crypto.h \ + openssl/pem.h openssl/ssl.h openssl/err.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + OPENSSL_ENABLED=1 +fi + +done + + + if test $ac_cv_header_openssl_x509_h = no; then + + + + + + +for ac_header in x509.h rsa.h crypto.h pem.h ssl.h err.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + OPENSSL_ENABLED=1 +fi + +done + + fi + + echo "$as_me:$LINENO: checking for ENGINE_init" >&5 +echo $ECHO_N "checking for ENGINE_init... $ECHO_C" >&6 +if test "${ac_cv_func_ENGINE_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char ENGINE_init (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char ENGINE_init (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_ENGINE_init) || defined (__stub___ENGINE_init) +choke me +#else +char (*f) () = ENGINE_init; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != ENGINE_init; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_ENGINE_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_ENGINE_init=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_ENGINE_init" >&5 +echo "${ECHO_T}$ac_cv_func_ENGINE_init" >&6 +if test $ac_cv_func_ENGINE_init = yes; then + +for ac_header in openssl/engine.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +fi + + + + + fi + + if test X"$OPT_SSL" != Xoff && + test "$OPENSSL_ENABLED" != "1"; then + { { echo "$as_me:$LINENO: error: OpenSSL libs and/or directories were not found where specified!" >&5 +echo "$as_me: error: OpenSSL libs and/or directories were not found where specified!" >&2;} + { (exit 1); exit 1; }; } + fi + + + + + + +for ac_func in RAND_status \ + RAND_screen \ + RAND_egd +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +fi + + + +_cppflags=$CPPFLAGS +_ldflags=$LDFLAGS +OPT_ZLIB="/usr/local" + +# Check whether --with-zlib or --without-zlib was given. +if test "${with_zlib+set}" = set; then + withval="$with_zlib" + OPT_ZLIB="$withval" +fi; + +case "$OPT_ZLIB" in + no) + { echo "$as_me:$LINENO: WARNING: zlib disabled" >&5 +echo "$as_me: WARNING: zlib disabled" >&2;} ;; + *) + + +echo "$as_me:$LINENO: checking for inflateEnd in -lz" >&5 +echo $ECHO_N "checking for inflateEnd in -lz... $ECHO_C" >&6 +if test "${ac_cv_lib_z_inflateEnd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inflateEnd (); +int +main () +{ +inflateEnd (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_z_inflateEnd=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_z_inflateEnd=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateEnd" >&5 +echo "${ECHO_T}$ac_cv_lib_z_inflateEnd" >&6 +if test $ac_cv_lib_z_inflateEnd = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + if test -d "$OPT_ZLIB"; then + CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" + LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib" + fi +fi + + + if test "${ac_cv_header_zlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking zlib.h usability" >&5 +echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking zlib.h presence" >&5 +echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_zlib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 + +fi +if test $ac_cv_header_zlib_h = yes; then + + echo "$as_me:$LINENO: checking for gzread in -lz" >&5 +echo $ECHO_N "checking for gzread in -lz... $ECHO_C" >&6 +if test "${ac_cv_lib_z_gzread+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gzread (); +int +main () +{ +gzread (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_z_gzread=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_z_gzread=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzread" >&5 +echo "${ECHO_T}$ac_cv_lib_z_gzread" >&6 +if test $ac_cv_lib_z_gzread = yes; then + HAVE_LIBZ="1" + + LIBS="$LIBS -lz" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ZLIB_H 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + +else + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags +fi + +else + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags + +fi + + + ;; +esac + +OPT_THREAD=on + +echo "$as_me:$LINENO: checking AIX 4.3 or later" >&5 +echo $ECHO_N "checking AIX 4.3 or later... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF + +#if defined(_AIX) && defined(_AIX43) +printf("just fine"); +#else +#error "this is not AIX 4.3 or later" +#endif + +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + OPT_THREAD=off +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi +rm -f conftest.err conftest.$ac_ext + +# Check whether --enable-thread or --disable-thread was given. +if test "${enable_thread+set}" = set; then + enableval="$enable_thread" + OPT_THREAD=off + { echo "$as_me:$LINENO: WARNING: libcurl will not get built using thread-safe functions" >&5 +echo "$as_me: WARNING: libcurl will not get built using thread-safe functions" >&2;} + +fi; + +if test X"$OPT_THREAD" = Xoff +then + +cat >>confdefs.h <<\_ACEOF +#define DISABLED_THREADSAFE 1 +_ACEOF + +else + + + +for ac_func in gethostbyname_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + + echo "$as_me:$LINENO: checking if gethostbyname_r takes 3 arguments" >&5 +echo $ECHO_N "checking if gethostbyname_r takes 3 arguments... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#undef NULL +#define NULL (void *)0 + +int +gethostbyname_r(const char *, struct hostent *, struct hostent_data *); +int +main () +{ + +struct hostent_data data; +gethostbyname_r(NULL, NULL, NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETHOSTBYNAME_R_3 1 +_ACEOF + + ac_cv_gethostbyname_args=3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo "$as_me:$LINENO: checking if gethostbyname_r with -D_REENTRANT takes 3 arguments" >&5 +echo $ECHO_N "checking if gethostbyname_r with -D_REENTRANT takes 3 arguments... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _REENTRANT + +#include +#include +#include +#undef NULL +#define NULL (void *)0 + +int +gethostbyname_r(const char *,struct hostent *, struct hostent_data *); +int +main () +{ + +struct hostent_data data; +gethostbyname_r(NULL, NULL, NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETHOSTBYNAME_R_3 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define NEED_REENTRANT 1 +_ACEOF + + ac_cv_gethostbyname_args=3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo "$as_me:$LINENO: checking if gethostbyname_r takes 5 arguments" >&5 +echo $ECHO_N "checking if gethostbyname_r takes 5 arguments... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#undef NULL +#define NULL (void *)0 + +struct hostent * +gethostbyname_r(const char *, struct hostent *, char *, int, int *); +int +main () +{ + +gethostbyname_r(NULL, NULL, NULL, 0, NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETHOSTBYNAME_R_5 1 +_ACEOF + + ac_cv_gethostbyname_args=5 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo "$as_me:$LINENO: checking if gethostbyname_r takes 6 arguments" >&5 +echo $ECHO_N "checking if gethostbyname_r takes 6 arguments... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#undef NULL +#define NULL (void *)0 + +int +gethostbyname_r(const char *, struct hostent *, char *, size_t, +struct hostent **, int *); +int +main () +{ + +gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETHOSTBYNAME_R_6 1 +_ACEOF + + ac_cv_gethostbyname_args=6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + have_missing_r_funcs="$have_missing_r_funcs gethostbyname_r" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +done + + +if test "$ac_cv_func_gethostbyname_r" = "yes"; then + if test "$ac_cv_gethostbyname_args" = "0"; then + { { echo "$as_me:$LINENO: error: couldn't figure out how to use gethostbyname_r()" >&5 +echo "$as_me: error: couldn't figure out how to use gethostbyname_r()" >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + + +for ac_func in gethostbyaddr_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + + echo "$as_me:$LINENO: checking if gethostbyaddr_r takes 5 arguments" >&5 +echo $ECHO_N "checking if gethostbyaddr_r takes 5 arguments... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +int +main () +{ + +char * address; +int length; +int type; +struct hostent h; +struct hostent_data hdata; +int rc; +rc = gethostbyaddr_r(address, length, type, &h, &hdata); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETHOSTBYADDR_R_5 1 +_ACEOF + + ac_cv_gethostbyaddr_args=5 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo "$as_me:$LINENO: checking if gethostbyaddr_r with -D_REENTRANT takes 5 arguments" >&5 +echo $ECHO_N "checking if gethostbyaddr_r with -D_REENTRANT takes 5 arguments... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _REENTRANT +#include +#include +int +main () +{ + +char * address; +int length; +int type; +struct hostent h; +struct hostent_data hdata; +int rc; +rc = gethostbyaddr_r(address, length, type, &h, &hdata); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETHOSTBYADDR_R_5 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define NEED_REENTRANT 1 +_ACEOF + + ac_cv_gethostbyaddr_args=5 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo "$as_me:$LINENO: checking if gethostbyaddr_r takes 7 arguments" >&5 +echo $ECHO_N "checking if gethostbyaddr_r takes 7 arguments... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +int +main () +{ + +char * address; +int length; +int type; +struct hostent h; +char buffer[8192]; +int h_errnop; +struct hostent * hp; + +hp = gethostbyaddr_r(address, length, type, &h, + buffer, 8192, &h_errnop); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETHOSTBYADDR_R_7 1 +_ACEOF + + ac_cv_gethostbyaddr_args=7 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo "$as_me:$LINENO: checking if gethostbyaddr_r takes 8 arguments" >&5 +echo $ECHO_N "checking if gethostbyaddr_r takes 8 arguments... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +int +main () +{ + +char * address; +int length; +int type; +struct hostent h; +char buffer[8192]; +int h_errnop; +struct hostent * hp; +int rc; + +rc = gethostbyaddr_r(address, length, type, &h, + buffer, 8192, &hp, &h_errnop); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETHOSTBYADDR_R_8 1 +_ACEOF + + ac_cv_gethostbyaddr_args=8 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +done + + + + + +for ac_func in inet_ntoa_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + + echo "$as_me:$LINENO: checking whether inet_ntoa_r is declared" >&5 +echo $ECHO_N "checking whether inet_ntoa_r is declared... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "inet_ntoa_r" >/dev/null 2>&1; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_INET_NTOA_R_DECL 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo "$as_me:$LINENO: checking whether inet_ntoa_r with -D_REENTRANT is declared" >&5 +echo $ECHO_N "checking whether inet_ntoa_r with -D_REENTRANT is declared... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _REENTRANT +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "inet_ntoa_r" >/dev/null 2>&1; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_INET_NTOA_R_DECL 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define NEED_REENTRANT 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest* + +fi +rm -f conftest* + +fi +done + + + + + +for ac_func in localtime_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + + echo "$as_me:$LINENO: checking whether localtime_r is declared" >&5 +echo $ECHO_N "checking whether localtime_r is declared... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "localtime_r" >/dev/null 2>&1; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo "$as_me:$LINENO: checking whether localtime_r with -D_REENTRANT is declared" >&5 +echo $ECHO_N "checking whether localtime_r with -D_REENTRANT is declared... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _REENTRANT +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "localtime_r" >/dev/null 2>&1; then + + cat >>confdefs.h <<\_ACEOF +#define NEED_REENTRANT 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest* + +fi +rm -f conftest* + +fi +done + + + + +for ac_func in gmtime_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +fi + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_header in sys/types.h \ + sys/time.h \ + sys/select.h \ + sys/socket.h \ + unistd.h \ + malloc.h \ + stdlib.h \ + arpa/inet.h \ + net/if.h \ + netinet/in.h \ + netdb.h \ + sys/sockio.h \ + sys/stat.h \ + sys/param.h \ + termios.h \ + termio.h \ + sgtty.h \ + fcntl.h \ + dlfcn.h \ + alloca.h \ + winsock.h \ + time.h \ + io.h \ + pwd.h \ + utime.h \ + sys/utime.h \ + sys/poll.h \ + setjmp.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + + + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + + +# mprintf() checks: + +# check for 'long double' +# AC_CHECK_SIZEOF(long double, 8) +# check for 'long long' +# AC_CHECK_SIZEOF(long long, 4) + +# check for ssize_t +echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 +if test "${ac_cv_type_ssize_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((ssize_t *) 0) + return 0; +if (sizeof (ssize_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_ssize_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_ssize_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 +if test $ac_cv_type_ssize_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define ssize_t int +_ACEOF + +fi + + + + echo "$as_me:$LINENO: checking for socklen_t" >&5 +echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 +if test "${ac_cv_type_socklen_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +if ((socklen_t *) 0) + return 0; +if (sizeof (socklen_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_socklen_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_socklen_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 +if test $ac_cv_type_socklen_t = yes; then + : +else + + echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 +echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6 + if test "${curl_cv_socklen_t_equiv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + curl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t unsigned long "unsigned long"; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include + + int getpeername (int, $arg2 *, $t *); + +int +main () +{ + + $t len; + getpeername(0,0,&len); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + curl_cv_socklen_t_equiv="$t" + break + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done + done + + if test "x$curl_cv_socklen_t_equiv" = x; then + { { echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5 +echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;} + { (exit 1); exit 1; }; } + fi + +fi + + echo "$as_me:$LINENO: result: $curl_cv_socklen_t_equiv" >&5 +echo "${ECHO_T}$curl_cv_socklen_t_equiv" >&6 + +cat >>confdefs.h <<_ACEOF +#define socklen_t $curl_cv_socklen_t_equiv +_ACEOF + +fi + + + + echo "$as_me:$LINENO: checking for in_addr_t" >&5 +echo $ECHO_N "checking for in_addr_t... $ECHO_C" >&6 +if test "${ac_cv_type_in_addr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((in_addr_t *) 0) + return 0; +if (sizeof (in_addr_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_in_addr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_in_addr_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_in_addr_t" >&5 +echo "${ECHO_T}$ac_cv_type_in_addr_t" >&6 +if test $ac_cv_type_in_addr_t = yes; then + : +else + + echo "$as_me:$LINENO: checking for in_addr_t equivalent" >&5 +echo $ECHO_N "checking for in_addr_t equivalent... $ECHO_C" >&6 + if test "${curl_cv_in_addr_t_equiv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + curl_cv_in_addr_t_equiv= + for t in "unsigned long" int size_t unsigned long; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include + #include + +int +main () +{ + + $t data = inet_addr ("1.2.3.4"); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + curl_cv_in_addr_t_equiv="$t" + break + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done + + if test "x$curl_cv_in_addr_t_equiv" = x; then + { { echo "$as_me:$LINENO: error: Cannot find a type to use in place of in_addr_t" >&5 +echo "$as_me: error: Cannot find a type to use in place of in_addr_t" >&2;} + { (exit 1); exit 1; }; } + fi + +fi + + echo "$as_me:$LINENO: result: $curl_cv_in_addr_t_equiv" >&5 +echo "${ECHO_T}$curl_cv_in_addr_t_equiv" >&6 + +cat >>confdefs.h <<_ACEOF +#define in_addr_t $curl_cv_in_addr_t_equiv +_ACEOF + +fi + + + + + +for ac_header in sys/select.h sys/socket.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +echo "$as_me:$LINENO: checking types of arguments for select" >&5 +echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6 +if test "${ac_cv_func_select_args+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#if HAVE_SYS_SELECT_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: ${ac_cv_func_select_args='int,int *,struct timeval *'} + +fi +echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 +echo "${ECHO_T}$ac_cv_func_select_args" >&6 +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + + +echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_signal=void +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_signal=int +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_func in socket \ + select \ + strdup \ + strstr \ + strtok_r \ + strftime \ + uname \ + strcasecmp \ + stricmp \ + strcmpi \ + gethostbyaddr \ + gettimeofday \ + inet_addr \ + inet_ntoa \ + tcsetattr \ + tcgetattr \ + perror \ + closesocket \ + setvbuf \ + sigaction \ + signal \ + getpass_r \ + strlcat \ + getpwuid \ + geteuid \ + dlopen \ + utime \ + sigsetjmp \ + poll +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + func="$ac_func" + echo "$as_me:$LINENO: checking deeper for $func" >&5 +echo $ECHO_N "checking deeper for $func... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + $func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes!" >&5 +echo "${ECHO_T}yes!" >&6 + eval "ac_cv_func_$func=yes" + def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'` + +cat >>confdefs.h <<_ACEOF +#define $def 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: but still no" >&5 +echo "${ECHO_T}but still no" >&6 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + +fi +done + + +if test "$ac_cv_func_sigsetjmp" != "yes"; then + echo "$as_me:$LINENO: checking for sigsetjmp defined as macro" >&5 +echo $ECHO_N "checking for sigsetjmp defined as macro... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +sigjmp_buf jmpenv; + sigsetjmp(jmpenv, 1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SIGSETJMP 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PERL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin " +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PERL=$ac_cv_path_PERL + +if test -n "$PERL"; then + echo "$as_me:$LINENO: result: $PERL" >&5 +echo "${ECHO_T}$PERL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + +for ac_prog in gnroff nroff +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NROFF+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $NROFF in + [\\/]* | ?:[\\/]*) + ac_cv_path_NROFF="$NROFF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin/:/usr/local/bin " +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_NROFF="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +NROFF=$ac_cv_path_NROFF + +if test -n "$NROFF"; then + echo "$as_me:$LINENO: result: $NROFF" >&5 +echo "${ECHO_T}$NROFF" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$NROFF" && break +done + + + +echo "$as_me:$LINENO: checking CA cert bundle install path" >&5 +echo $ECHO_N "checking CA cert bundle install path... $ECHO_C" >&6 + + +# Check whether --with-ca-bundle or --without-ca-bundle was given. +if test "${with_ca_bundle+set}" = set; then + withval="$with_ca_bundle" + ca="$withval" +else + + if test "x$prefix" != xNONE; then + ca="$prefix/share/curl/curl-ca-bundle.crt" + else + ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt" + fi + +fi; + +if test X"$OPT_SSL" = Xno +then + ca="no" +fi + +if test "x$ca" = "xno"; then + ca="" +else + +cat >>confdefs.h <<_ACEOF +#define CURL_CA_BUNDLE "$ca" +_ACEOF + +fi + +CURL_CA_BUNDLE="$ca" + +echo "$as_me:$LINENO: result: $ca" >&5 +echo "${ECHO_T}$ca" >&6 + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_YACC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + + + +echo "$as_me:$LINENO: checking whether to enable debug options" >&5 +echo $ECHO_N "checking whether to enable debug options... $ECHO_C" >&6 +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + case "$enableval" in + no) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + *) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + + CPPFLAGS="$CPPFLAGS -DMALLOCDEBUG" + CFLAGS="$CFLAGS -g" + if test "$GCC" = "yes"; then + CFLAGS="$CFLAGS -W -Wall -Wwrite-strings -pedantic -Wundef -Wpointer-arith -Wnested-externs" + fi + NEWFLAGS="" + for flag in $CFLAGS; do + case "$flag" in + -O*) + ;; + *) + NEWFLAGS="$NEWFLAGS $flag" + ;; + esac + done + CFLAGS=$NEWFLAGS + ;; + esac +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi; + + ac_config_files="$ac_config_files Makefile docs/Makefile docs/examples/Makefile docs/libcurl/Makefile include/Makefile include/curl/Makefile src/Makefile lib/Makefile tests/Makefile tests/data/Makefile tests/server/Makefile tests/libtest/Makefile packages/Makefile packages/Win32/Makefile packages/Win32/cygwin/Makefile packages/Linux/Makefile packages/Linux/RPM/Makefile packages/Linux/RPM/curl.spec packages/Linux/RPM/curl-ssl.spec packages/Solaris/Makefile packages/EPM/curl.list packages/EPM/Makefile curl-config" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${NO_UNDEFINED_TRUE}" && test -z "${NO_UNDEFINED_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"NO_UNDEFINED\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"NO_UNDEFINED\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by curl $as_me -, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +curl config.status - +configured by $0, generated by GNU Autoconf 2.57, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "docs/examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/examples/Makefile" ;; + "docs/libcurl/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/libcurl/Makefile" ;; + "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/curl/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/curl/Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/data/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/data/Makefile" ;; + "tests/server/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/server/Makefile" ;; + "tests/libtest/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/libtest/Makefile" ;; + "packages/Makefile" ) CONFIG_FILES="$CONFIG_FILES packages/Makefile" ;; + "packages/Win32/Makefile" ) CONFIG_FILES="$CONFIG_FILES packages/Win32/Makefile" ;; + "packages/Win32/cygwin/Makefile" ) CONFIG_FILES="$CONFIG_FILES packages/Win32/cygwin/Makefile" ;; + "packages/Linux/Makefile" ) CONFIG_FILES="$CONFIG_FILES packages/Linux/Makefile" ;; + "packages/Linux/RPM/Makefile" ) CONFIG_FILES="$CONFIG_FILES packages/Linux/RPM/Makefile" ;; + "packages/Linux/RPM/curl.spec" ) CONFIG_FILES="$CONFIG_FILES packages/Linux/RPM/curl.spec" ;; + "packages/Linux/RPM/curl-ssl.spec" ) CONFIG_FILES="$CONFIG_FILES packages/Linux/RPM/curl-ssl.spec" ;; + "packages/Solaris/Makefile" ) CONFIG_FILES="$CONFIG_FILES packages/Solaris/Makefile" ;; + "packages/EPM/curl.list" ) CONFIG_FILES="$CONFIG_FILES packages/EPM/curl.list" ;; + "packages/EPM/Makefile" ) CONFIG_FILES="$CONFIG_FILES packages/EPM/Makefile" ;; + "curl-config" ) CONFIG_FILES="$CONFIG_FILES curl-config" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "lib/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h" ;; + "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; + "tests/server/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS tests/server/config.h" ;; + "lib/ca-bundle.h" ) CONFIG_HEADERS="$CONFIG_HEADERS lib/ca-bundle.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@SED@,$SED,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@VERSIONNUM@,$VERSIONNUM,;t t +s,@PKGADD_PKG@,$PKGADD_PKG,;t t +s,@PKGADD_NAME@,$PKGADD_NAME,;t t +s,@PKGADD_VENDOR@,$PKGADD_VENDOR,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@LN_S@,$LN_S,;t t +s,@ECHO@,$ECHO,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@DLLTOOL@,$DLLTOOL,;t t +s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t +s,@AS@,$AS,;t t +s,@ac_ct_AS@,$ac_ct_AS,;t t +s,@OBJDUMP@,$OBJDUMP,;t t +s,@ac_ct_OBJDUMP@,$ac_ct_OBJDUMP,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@CXXDEPMODE@,$CXXDEPMODE,;t t +s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t +s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t +s,@CXXCPP@,$CXXCPP,;t t +s,@F77@,$F77,;t t +s,@FFLAGS@,$FFLAGS,;t t +s,@ac_ct_F77@,$ac_ct_F77,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@NO_UNDEFINED_TRUE@,$NO_UNDEFINED_TRUE,;t t +s,@NO_UNDEFINED_FALSE@,$NO_UNDEFINED_FALSE,;t t +s,@CURL_DISABLE_HTTP@,$CURL_DISABLE_HTTP,;t t +s,@CURL_DISABLE_GOPHER@,$CURL_DISABLE_GOPHER,;t t +s,@CURL_DISABLE_FTP@,$CURL_DISABLE_FTP,;t t +s,@CURL_DISABLE_FILE@,$CURL_DISABLE_FILE,;t t +s,@CURL_DISABLE_LDAP@,$CURL_DISABLE_LDAP,;t t +s,@CURL_DISABLE_DICT@,$CURL_DISABLE_DICT,;t t +s,@CURL_DISABLE_TELNET@,$CURL_DISABLE_TELNET,;t t +s,@IPV6_ENABLED@,$IPV6_ENABLED,;t t +s,@RANDOM_FILE@,$RANDOM_FILE,;t t +s,@KRB4_ENABLED@,$KRB4_ENABLED,;t t +s,@PKGCONFIG@,$PKGCONFIG,;t t +s,@OPENSSL_ENABLED@,$OPENSSL_ENABLED,;t t +s,@HAVE_LIBZ@,$HAVE_LIBZ,;t t +s,@PERL@,$PERL,;t t +s,@NROFF@,$NROFF,;t t +s,@CURL_CA_BUNDLE@,$CURL_CA_BUNDLE,;t t +s,@YACC@,$YACC,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +_am_stamp_count=`expr ${_am_stamp_count-0} + 1` +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/main/source/curl/configure.ac b/main/source/curl/configure.ac new file mode 100644 index 00000000..8b03d3b6 --- /dev/null +++ b/main/source/curl/configure.ac @@ -0,0 +1,921 @@ +dnl $Id: configure.ac,v 1.5 2003/05/04 16:07:19 bagder Exp $ +dnl Process this file with autoconf to produce a configure script. + +dnl Ensure that this file is processed with autoconf 2.50 or newer +dnl Don't even think about removing this check! +AC_PREREQ(2.50) + +dnl We don't know the version number "staticly" so we use a dash here +AC_INIT(curl, [-], [curl-bug@haxx.se]) + +dnl configure script copyright +AC_COPYRIGHT([Copyright (c) 1998 - 2003 Daniel Stenberg, +This configure script may be copied, distributed and modified under the +terms of the curl license; see COPYING for more details]) + +AC_CONFIG_SRCDIR([lib/urldata.h]) +AM_CONFIG_HEADER(lib/config.h src/config.h tests/server/config.h lib/ca-bundle.h) +AM_MAINTAINER_MODE + +AC_PATH_PROG( SED, sed, , $PATH:/usr/bin:/usr/local/bin) +AC_SUBST(SED) + +dnl figure out the libcurl version +VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h` +AM_INIT_AUTOMAKE(curl,$VERSION) +AC_MSG_CHECKING([curl version]) +AC_MSG_RESULT($VERSION) + +dnl +dnl we extract the numerical version for curl-config only +VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curl.h` +AC_SUBST(VERSIONNUM) + +dnl Solaris pkgadd support definitions +PKGADD_PKG="HAXXcurl" +PKGADD_NAME="cURL - a client that groks URLs" +PKGADD_VENDOR="curl.haxx.se" +AC_SUBST(PKGADD_PKG) +AC_SUBST(PKGADD_NAME) +AC_SUBST(PKGADD_VENDOR) + + +dnl +dnl Detect the canonical host and target build environment +dnl + +AC_CANONICAL_HOST +dnl Get system canonical name +AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS]) + +dnl Check for AIX weirdos +AC_AIX + +dnl Checks for programs. +AC_PROG_CC + +dnl check for how to do large files +AC_SYS_LARGEFILE + +dnl check for cygwin stuff +AC_LIBTOOL_WIN32_DLL + +dnl libtool setup +AM_PROG_LIBTOOL + +case $host in + *-*-cygwin | *-*-mingw* | *-*-pw32*) + need_no_undefined=yes + ;; + *) + need_no_undefined=no + ;; +esac + +AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes) + +dnl The install stuff has already been taken care of by the automake stuff +dnl AC_PROG_INSTALL +AC_PROG_MAKE_SET + +dnl ************************************************************ +dnl switch off particular protocols +dnl +AC_MSG_CHECKING([whether to support http]) +AC_ARG_ENABLE(http, +AC_HELP_STRING([--enable-http],[Enable HTTP support]) +AC_HELP_STRING([--disable-http],[Disable HTTP support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP]) + AC_MSG_WARN([disable HTTP disables FTP over proxy and GOPHER too]) + AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER]) + AC_SUBST(CURL_DISABLE_HTTP) + AC_SUBST(CURL_DISABLE_GOPHER) + ;; + *) AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) +AC_MSG_CHECKING([whether to support ftp]) +AC_ARG_ENABLE(ftp, +AC_HELP_STRING([--enable-ftp],[Enable FTP support]) +AC_HELP_STRING([--disable-ftp],[Disable FTP support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP]) + AC_SUBST(CURL_DISABLE_FTP) + ;; + *) AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) +AC_MSG_CHECKING([whether to support gopher]) +AC_ARG_ENABLE(gopher, +AC_HELP_STRING([--enable-gopher],[Enable GOPHER support]) +AC_HELP_STRING([--disable-gopher],[Disable GOPHER support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER]) + AC_SUBST(CURL_DISABLE_GOPHER) + ;; + *) AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) +AC_MSG_CHECKING([whether to support file]) +AC_ARG_ENABLE(file, +AC_HELP_STRING([--enable-file],[Enable FILE support]) +AC_HELP_STRING([--disable-file],[Disable FILE support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE]) + AC_SUBST(CURL_DISABLE_FILE) + ;; + *) AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) +AC_MSG_CHECKING([whether to support ldap]) +AC_ARG_ENABLE(ldap, +AC_HELP_STRING([--enable-ldap],[Enable LDAP support]) +AC_HELP_STRING([--disable-ldap],[Disable LDAP support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) + AC_SUBST(CURL_DISABLE_LDAP) + ;; + *) AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) +AC_MSG_CHECKING([whether to support dict]) +AC_ARG_ENABLE(dict, +AC_HELP_STRING([--enable-dict],[Enable DICT support]) +AC_HELP_STRING([--disable-dict],[Disable DICT support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT]) + AC_SUBST(CURL_DISABLE_DICT) + ;; + *) AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) +AC_MSG_CHECKING([whether to support telnet]) +AC_ARG_ENABLE(telnet, +AC_HELP_STRING([--enable-telnet],[Enable TELNET support]) +AC_HELP_STRING([--disable-telnet],[Disable TELNET support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) + AC_SUBST(CURL_DISABLE_TELNET) + ;; + *) AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + + +dnl ********************************************************************** +dnl Checks for IPv6 +dnl ********************************************************************** + +AC_MSG_CHECKING([whether to enable ipv6]) +AC_ARG_ENABLE(ipv6, +AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support]) +AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + ipv6=no + ;; + *) AC_MSG_RESULT(yes) + ipv6=yes + ;; + esac ], + + AC_TRY_RUN([ /* is AF_INET6 available? */ +#include +#include +main() +{ + if (socket(AF_INET6, SOCK_STREAM, 0) < 0) + exit(1); + else + exit(0); +} +], + AC_MSG_RESULT(yes) + ipv6=yes, + AC_MSG_RESULT(no) + ipv6=no, + AC_MSG_RESULT(no) + ipv6=no +)) + +if test "$ipv6" = "yes"; then + CURL_CHECK_WORKING_GETADDRINFO +fi + + +dnl ********************************************************************** +dnl Checks for libraries. +dnl ********************************************************************** + +dnl gethostbyname in the nsl lib? +AC_CHECK_FUNC(gethostbyname, , [ AC_CHECK_LIB(nsl, gethostbyname) ]) + +if test "$ac_cv_lib_nsl_gethostbyname" != "yes" -a "$ac_cv_func_gethostbyname" != "yes"; then + dnl gethostbyname in the socket lib? + AC_CHECK_FUNC(gethostbyname, , [ AC_CHECK_LIB(socket, gethostbyname) ]) +fi + +dnl At least one system has been identified to require BOTH nsl and +dnl socket libs to link properly. +if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname"; then + AC_MSG_CHECKING([trying both nsl and socket libs]) + my_ac_save_LIBS=$LIBS + LIBS="-lnsl -lsocket $LIBS" + AC_TRY_LINK( , + [gethostbyname();], + my_ac_link_result=success, + my_ac_link_result=failure ) + + if test "$my_ac_link_result" = "failure"; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([couldn't find libraries for gethostbyname()]) + dnl restore LIBS + LIBS=$my_ac_save_LIBS + else + AC_MSG_RESULT([yes]) + fi +fi + +dnl resolve lib? +AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ]) + +if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then + AC_CHECK_LIB(resolve, strcasecmp, + [LIBS="-lresolve $LIBS"], + , + -lnsl) +fi + +dnl socket lib? +AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ]) + +dnl dl lib? +AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ]) + +AC_MSG_CHECKING([whether to use libgcc]) +AC_ARG_ENABLE(libgcc, +AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]), +[ case "$enableval" in + yes) + LIBS="$LIBS -lgcc" + AC_MSG_RESULT(yes) + ;; + *) AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +dnl ********************************************************************** +dnl Check how non-blocking sockets are set +dnl ********************************************************************** +AC_ARG_ENABLE(nonblocking, +AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it]) +AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]), +[ + if test "$enableval" = "no" ; then + AC_MSG_WARN([non-blocking sockets disabled]) + AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1, + [to disable NON-BLOCKING connections]) + else + CURL_CHECK_NONBLOCKING_SOCKET + fi +], +[ + CURL_CHECK_NONBLOCKING_SOCKET +]) + +dnl ********************************************************************** +dnl Check for the random seed preferences +dnl ********************************************************************** + +AC_ARG_WITH(egd-socket, +AC_HELP_STRING([--with-egd-socket=FILE], + [Entropy Gathering Daemon socket pathname]), + [ EGD_SOCKET="$withval" ] +) +if test -n "$EGD_SOCKET" ; then + AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET", + [your Entropy Gathering Daemon socket pathname] ) +fi + +dnl Check for user-specified random device +AC_ARG_WITH(random, +AC_HELP_STRING([--with-random=FILE],[read randomness from FILE (default=/dev/urandom)]), + [ RANDOM_FILE="$withval" ], + [ + dnl Check for random device + AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] ) + ] +) +if test -n "$RANDOM_FILE" ; then + AC_SUBST(RANDOM_FILE) + AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE", + [a suitable file to read random data from]) +fi + +dnl ********************************************************************** +dnl Check if the operating system allows programs to write to their own argv[] +dnl ********************************************************************** + +AC_MSG_CHECKING([if argv can be written to]) +AC_RUN_IFELSE([[ +int main(int argc, char ** argv) { + argv[0][0] = ' '; + return (argv[0][0] == ' ')?0:1; +} + ]], + AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no), + AC_MSG_RESULT(no) + AC_MSG_WARN([the previous check could not be made default was used]) +) + +dnl ********************************************************************** +dnl Check for the presence of Kerberos4 libraries and headers +dnl ********************************************************************** + +AC_ARG_WITH(krb4-includes, +AC_HELP_STRING([--with-krb4-includes=DIR], + [Specify location of kerberos4 headers]),[ + CPPFLAGS="$CPPFLAGS -I$withval" + KRB4INC="$withval" + want_krb4=yes + ]) + +AC_ARG_WITH(krb4-libs, +AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[ + LDFLAGS="$LDFLAGS -L$withval" + KRB4LIB="$withval" + want_krb4=yes + ]) + + +OPT_KRB4=off +AC_ARG_WITH(krb4,dnl +AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[ + OPT_KRB4="$withval" + if test X"$OPT_KRB4" != Xyes + then + LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib" + KRB4LIB="$OPT_KRB4/lib" + CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include" + KRB4INC="$OPT_KRB4/include" + fi + want_krb4="yes" + ]) + +AC_MSG_CHECKING([if Kerberos4 support is requested]) + +if test "$want_krb4" = yes +then + if test "$ipv6" = "yes"; then + echo krb4 is not compatible with IPv6 + exit 1 + fi + AC_MSG_RESULT(yes) + + dnl Check for & handle argument to --with-krb4 + + AC_MSG_CHECKING(where to look for Kerberos4) + if test X"$OPT_KRB4" = Xyes + then + AC_MSG_RESULT([defaults]) + else + AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC]) + fi + + dnl Check for DES library + AC_CHECK_LIB(des, des_pcbc_encrypt, + [ + AC_CHECK_HEADERS(des.h) + + dnl resolv lib? + AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)]) + + dnl Check for the Kerberos4 library + AC_CHECK_LIB(krb, krb_net_read, + [ + dnl Check for header files + AC_CHECK_HEADERS(krb.h) + + dnl we found the required libraries, add to LIBS + LIBS="-lkrb -ldes $LIBS" + + dnl Check for function krb_get_our_ip_for_realm + dnl this is needed for NAT networks + AC_CHECK_FUNCS(krb_get_our_ip_for_realm) + + dnl add define KRB4 + AC_DEFINE(KRB4, 1, + [if you have the Kerberos4 libraries (including -ldes)]) + + dnl substitute it too! + KRB4_ENABLED=1 + AC_SUBST(KRB4_ENABLED) + + dnl the krb4 stuff needs a strlcpy() + AC_CHECK_FUNCS(strlcpy) + + ]) + ]) +else + AC_MSG_RESULT(no) +fi + +dnl Detect the pkg-config tool, as it may have extra info about the +dnl openssl installation we can use. I *believe* this is what we are +dnl expected to do on really recent Redhat Linux hosts. +AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin) +if test "$PKGCONFIG" != "no" ; then + AC_MSG_CHECKING([for OpenSSL options using pkg-config]) + + $PKGCONFIG --exists openssl + SSL_EXISTS=$? + + if test "$SSL_EXISTS" -eq "0"; then + SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null` + SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null` + SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null` + + LIBS="$LIBS $SSL_LIBS" + CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" + LDFLAGS="$LDFLAGS $SSL_LDFLAGS" + + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + +fi + +dnl ********************************************************************** +dnl Check for the presence of SSL libraries and headers +dnl ********************************************************************** + +dnl Default to compiler & linker defaults for SSL files & libraries. +OPT_SSL=off +AC_ARG_WITH(ssl,dnl +AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)]) +AC_HELP_STRING([--without-ssl], [disable SSL]), + OPT_SSL=$withval) + +if test X"$OPT_SSL" = Xno +then + AC_MSG_WARN(SSL/https support disabled) +else + + dnl Check for and handle argument to --with-ssl. + + dnl save the pre-ssl check flags for a while + CLEANLDFLAGS="$LDFLAGS" + CLEANCPPFLAGS="$CPPFLAGS" + + case "$OPT_SSL" in + yes) + EXTRA_SSL=/usr/local/ssl ;; + off) + EXTRA_SSL= ;; + *) + dnl check the given spot right away! + EXTRA_SSL=$OPT_SSL + LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib" + CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include" + ;; + esac + + AC_CHECK_LIB(crypto, CRYPTO_lock,[ + HAVECRYPTO="yes" + ],[ + OLDLDFLAGS="$LDFLAGS" + OLDCPPFLAGS="$CPPFLAGS" + LDFLAGS="$CLEANLDFLAGS -L$EXTRA_SSL/lib" + CPPFLAGS="$CLEANCPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include" + AC_CHECK_LIB(crypto, CRYPTO_add_lock,[ + HAVECRYPTO="yes" ], [ + LDFLAGS="$OLDLDFLAGS" + CPPFLAGS="$OLDCPPFLAGS" + ]) + ]) + + + if test "$HAVECRYPTO" = "yes"; then + dnl This is only reasonable to do if crypto actually is there: check for + dnl SSL libs NOTE: it is important to do this AFTER the crypto lib + + AC_CHECK_LIB(crypto, CRYPTO_add_lock) + AC_CHECK_LIB(ssl, SSL_connect) + + if test "$ac_cv_lib_ssl_SSL_connect" != yes; then + dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff + AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use); + OLIBS=$LIBS + LIBS="$LIBS -lRSAglue -lrsaref" + AC_CHECK_LIB(ssl, SSL_connect) + if test "$ac_cv_lib_ssl_SSL_connect" != yes; then + dnl still no SSL_connect + AC_MSG_RESULT(no) + LIBS=$OLIBS + else + AC_MSG_RESULT(yes) + fi + fi + + + dnl Check for SSLeay headers + AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ + openssl/pem.h openssl/ssl.h openssl/err.h, + OPENSSL_ENABLED=1) + + if test $ac_cv_header_openssl_x509_h = no; then + AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h, + OPENSSL_ENABLED=1) + fi + + dnl If the ENGINE library seems to be around, check for the OpenSSL engine + dnl header, it is kind of "separated" from the main SSL check + AC_CHECK_FUNC(ENGINE_init, [ AC_CHECK_HEADERS(openssl/engine.h) ]) + + AC_SUBST(OPENSSL_ENABLED) + + fi + + if test X"$OPT_SSL" != Xoff && + test "$OPENSSL_ENABLED" != "1"; then + AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!]) + fi + + + dnl these can only exist if openssl exists + + AC_CHECK_FUNCS( RAND_status \ + RAND_screen \ + RAND_egd ) + +fi + +dnl ********************************************************************** +dnl Check for the presence of ZLIB libraries and headers +dnl ********************************************************************** + +dnl Check for & handle argument to --with-zlib. + +_cppflags=$CPPFLAGS +_ldflags=$LDFLAGS +OPT_ZLIB="/usr/local" +AC_ARG_WITH(zlib, +AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) +AC_HELP_STRING([--without-zlib],[disable use of zlib]), + [OPT_ZLIB="$withval"]) + +case "$OPT_ZLIB" in + no) + AC_MSG_WARN([zlib disabled]) ;; + *) + dnl check for the lib first without setting any new path, since many + dnl people have it in the default path + + AC_CHECK_LIB(z, inflateEnd, , + [if test -d "$OPT_ZLIB"; then + CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" + LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib" + fi]) + + AC_CHECK_HEADER(zlib.h,[ + AC_CHECK_LIB(z, gzread, + [HAVE_LIBZ="1" + AC_SUBST(HAVE_LIBZ) + LIBS="$LIBS -lz" + AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file]) + AC_DEFINE(HAVE_LIBZ, 1, [If zlib is available])], + [ CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags])], + [ CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags] + ) + ;; +esac + +dnl Default is to try the thread-safe versions of a few functions +OPT_THREAD=on + +dnl detect AIX 4.3 or later +dnl see full docs on this reasoning in the lib/hostip.c source file +AC_MSG_CHECKING([AIX 4.3 or later]) +AC_PREPROC_IFELSE([ +#if defined(_AIX) && defined(_AIX43) +printf("just fine"); +#else +#error "this is not AIX 4.3 or later" +#endif +], + [ AC_MSG_RESULT([yes]) + OPT_THREAD=off ], + [ AC_MSG_RESULT([no]) ] +) + +AC_ARG_ENABLE(thread,dnl +AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions]), + OPT_THREAD=off + AC_MSG_WARN(libcurl will not get built using thread-safe functions) +) + +if test X"$OPT_THREAD" = Xoff +then + AC_DEFINE(DISABLED_THREADSAFE, 1, \ +Set to explicitly specify we don't want to use thread-safe functions) +else + + dnl dig around for gethostbyname_r() + CURL_CHECK_GETHOSTBYNAME_R() + + dnl dig around for gethostbyaddr_r() + CURL_CHECK_GETHOSTBYADDR_R() + + dnl poke around for inet_ntoa_r() + CURL_CHECK_INET_NTOA_R() + + dnl is there a localtime_r() + CURL_CHECK_LOCALTIME_R() + + AC_CHECK_FUNCS( gmtime_r ) + +fi + +dnl ********************************************************************** +dnl Back to "normal" configuring +dnl ********************************************************************** + +dnl Checks for header files. +AC_HEADER_STDC + +dnl First check for the very most basic headers. Then we can use these +dnl ones as default-headers when checking for the rest! +AC_CHECK_HEADERS( + sys/types.h \ + sys/time.h \ + sys/select.h \ + sys/socket.h \ + unistd.h \ + malloc.h \ + stdlib.h \ + arpa/inet.h \ + net/if.h \ + netinet/in.h \ + netdb.h \ + sys/sockio.h \ + sys/stat.h \ + sys/param.h \ + termios.h \ + termio.h \ + sgtty.h \ + fcntl.h \ + dlfcn.h \ + alloca.h \ + winsock.h \ + time.h \ + io.h \ + pwd.h \ + utime.h \ + sys/utime.h \ + sys/poll.h \ + setjmp.h, +dnl to do if not found +[], +dnl to do if found +[], +dnl default includes +[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +] +) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_HEADER_TIME + +# mprintf() checks: + +# check for 'long double' +# AC_CHECK_SIZEOF(long double, 8) +# check for 'long long' +# AC_CHECK_SIZEOF(long long, 4) + +# check for ssize_t +AC_CHECK_TYPE(ssize_t, int) + +TYPE_SOCKLEN_T +TYPE_IN_ADDR_T + +AC_FUNC_SELECT_ARGTYPES + +dnl Checks for library functions. +dnl AC_PROG_GCC_TRADITIONAL +AC_TYPE_SIGNAL +dnl AC_FUNC_VPRINTF +AC_CHECK_FUNCS( socket \ + select \ + strdup \ + strstr \ + strtok_r \ + strftime \ + uname \ + strcasecmp \ + stricmp \ + strcmpi \ + gethostbyaddr \ + gettimeofday \ + inet_addr \ + inet_ntoa \ + tcsetattr \ + tcgetattr \ + perror \ + closesocket \ + setvbuf \ + sigaction \ + signal \ + getpass_r \ + strlcat \ + getpwuid \ + geteuid \ + dlopen \ + utime \ + sigsetjmp \ + poll, +dnl if found +[], +dnl if not found, $ac_func is the name we check for + func="$ac_func" + AC_MSG_CHECKING([deeper for $func]) + AC_TRY_LINK( [], + [ $func ();], + AC_MSG_RESULT(yes!) + eval "ac_cv_func_$func=yes" + def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'` + AC_DEFINE_UNQUOTED($def, 1, [If you have $func]), + AC_MSG_RESULT(but still no) + ) + +) + +dnl sigsetjmp() might be a macro and no function so if it isn't found already +dnl we make an extra check here! +if test "$ac_cv_func_sigsetjmp" != "yes"; then + AC_MSG_CHECKING([for sigsetjmp defined as macro]) + AC_TRY_LINK( [#include ], + [sigjmp_buf jmpenv; + sigsetjmp(jmpenv, 1);], + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]), + AC_MSG_RESULT(no) + ) +fi + +AC_PATH_PROG( PERL, perl, , + $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin ) +AC_SUBST(PERL) + +AC_PATH_PROGS( NROFF, gnroff nroff, , + $PATH:/usr/bin/:/usr/local/bin ) +AC_SUBST(NROFF) + +AC_MSG_CHECKING([CA cert bundle install path]) + +AC_ARG_WITH(ca-bundle, +AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as]) +AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]), + [ ca="$withval" ], + [ + if test "x$prefix" != xNONE; then + ca="$prefix/share/curl/curl-ca-bundle.crt" + else + ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt" + fi + ] ) + +if test X"$OPT_SSL" = Xno +then + ca="no" +fi + +if test "x$ca" = "xno"; then + dnl let's not keep "no" as path name, blank it instead + ca="" +else + AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [CA bundle full path name]) +fi + +CURL_CA_BUNDLE="$ca" +AC_SUBST(CURL_CA_BUNDLE) +AC_MSG_RESULT([$ca]) + +AC_PROG_YACC + +dnl AC_PATH_PROG( RANLIB, ranlib, /usr/bin/ranlib, +dnl $PATH:/usr/bin/:/usr/local/bin ) +dnl AC_SUBST(RANLIB) + +dnl ************************************************************ +dnl lame option to switch on debug options +dnl +AC_MSG_CHECKING([whether to enable debug options]) +AC_ARG_ENABLE(debug, +AC_HELP_STRING([--enable-debug],[Enable pedantic debug options]) +AC_HELP_STRING([--disable-debug],[Disable debug options]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + ;; + *) AC_MSG_RESULT(yes) + + CPPFLAGS="$CPPFLAGS -DMALLOCDEBUG" + CFLAGS="$CFLAGS -g" + if test "$GCC" = "yes"; then + CFLAGS="$CFLAGS -W -Wall -Wwrite-strings -pedantic -Wundef -Wpointer-arith -Wnested-externs" + fi + dnl strip off optimizer flags + NEWFLAGS="" + for flag in $CFLAGS; do + case "$flag" in + -O*) + dnl echo "cut off $flag" + ;; + *) + NEWFLAGS="$NEWFLAGS $flag" + ;; + esac + done + CFLAGS=$NEWFLAGS + ;; + esac ], + AC_MSG_RESULT(no) +) + +AC_CONFIG_FILES([Makefile \ + docs/Makefile \ + docs/examples/Makefile \ + docs/libcurl/Makefile \ + include/Makefile \ + include/curl/Makefile \ + src/Makefile \ + lib/Makefile \ + tests/Makefile \ + tests/data/Makefile \ + tests/server/Makefile \ + tests/libtest/Makefile \ + packages/Makefile \ + packages/Win32/Makefile \ + packages/Win32/cygwin/Makefile \ + packages/Linux/Makefile \ + packages/Linux/RPM/Makefile \ + packages/Linux/RPM/curl.spec \ + packages/Linux/RPM/curl-ssl.spec \ + packages/Solaris/Makefile \ + packages/EPM/curl.list \ + packages/EPM/Makefile \ + curl-config +]) +AC_OUTPUT diff --git a/main/source/curl/curl-config.in b/main/source/curl/curl-config.in new file mode 100644 index 00000000..01c986ea --- /dev/null +++ b/main/source/curl/curl-config.in @@ -0,0 +1,130 @@ +#! /bin/sh +# +# The idea to this kind of setup info script was stolen from numerous +# other packages, such as neon, libxml and gnome. +# +# $Id: curl-config.in,v 1.17 2003/01/16 10:58:49 bagder Exp $ +# +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ + +usage() +{ + cat <. + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. This file always lives in the current directory. + # Also, the AIX compiler puts `$object:' at the start of each line; + # $object doesn't have directory information. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 AIX compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + + tmpdepfile1="$object.d" + tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` + if test "$libtool" = yes; then + "$@" -Wc,-MD + else + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + test -z "$dashmflag" && dashmflag=-M + ( IFS=" " + case " $* " in + *" --mode=compile "*) # this is libtool, let us make it quiet + for arg + do # cycle over the arguments + case "$arg" in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + # X makedepend + ( + shift + cleared=no + for arg in "$@"; do + case $cleared in no) + set ""; shift + cleared=yes + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tail +3 "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/main/source/curl/docs/BINDINGS b/main/source/curl/docs/BINDINGS new file mode 100644 index 00000000..a97e820f --- /dev/null +++ b/main/source/curl/docs/BINDINGS @@ -0,0 +1,96 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + + libcurl bindings + +Creative people have written particular bindings or interfaces for various +environments and programming languages. Using one of these allows you to take +advantage of curl powers from within your favourite language or system. + +This is a list of all known interfaces as of this writing. + +The bindings listed below are not part of the curl/libcurl distribution +archives, but must be downloaded and installed separately. + +Basic + + ScriptBasic bindings to libcurl. Writtten by Peter Verhas. + http://scriptbasic.com/ + +C++ + + Maintained by Jean-Philippe Barrette-LaPierre. + http://curl.haxx.se/libcurl/cplusplus/ + +Cocoa + + Written by Dan Wood. + http://curlhandle.sourceforge.net/ + +Dylan + + Written by Chris Double. + http://dylanlibs.sourceforge.net/ + +Java + + Written by Daniel Stenberg. + http://curl.haxx.se/libcurl/java/ + +Lua + + Written by Steve Dekorte. + http://curl.haxx.se/libcurl/lua/ + +Object-Pascal + + Free Pascal, Delphi and Kylix binding written by Christophe Espern. + http://www.tekool.com/opcurl + +Pascal + + Free Pascal, Delphi and Kylix binding written by Jeffrey Pohlmeyer. + http://houston.quik.com/jkp/curlpas/ + +Perl + + Maintained by Cris Bailiff. + http://curl.haxx.se/libcurl/perl/ + +PHP + + Written by Sterling Hughes. + http://curl.haxx.se/libcurl/php/ + +PostgreSQL + + Written by Gian Paolo Ciceri. + http://gborg.postgresql.org/project/pgcurl/projdisplay.php + +Python + + Written by Kjetil Jacobsen. + http://pycurl.sourceforge.net/ + +Rexx + + Written Mark Hessling. + http://rexxcurl.sourceforge.net/ + +Ruby + + Written by Hirotaka Matsuyuki. + http://www.d1.dion.ne.jp/~matuyuki/ruby.html + +Scheme + + Bigloo binding written by Kirill Lisovsky. + http://curl.haxx.se/libcurl/scheme/ + +Tcl + + Written by Andrés García. + http://personal1.iddeo.es/andresgarci/tclcurl/english/docs.html diff --git a/main/source/curl/docs/BUGS b/main/source/curl/docs/BUGS new file mode 100644 index 00000000..8e0ab4a7 --- /dev/null +++ b/main/source/curl/docs/BUGS @@ -0,0 +1,82 @@ +$Id: BUGS,v 1.6 2003/03/26 11:44:04 bagder Exp $ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + +BUGS + + Curl and libcurl have grown substantially since the beginning. At the time + of writing (end of March 2003), there are 35000 lines of source code, and by + the time you read this it has probably grown even more. + + Of course there are lots of bugs left. And lots of misfeatures. + + To help us make curl the stable and solid product we want it to be, we need + bug reports and bug fixes. + +WHERE TO REPORT + + If you can't fix a bug yourself and submit a fix for it, try to report an as + detailed report as possible to a curl mailing list to allow one of us to + have a go at a solution. You should also post your bug/problem at curl's bug + tracking system over at + + http://sourceforge.net/bugs/?group_id=976 + + (but please read the sections below first before doing that) + + If you feel you need to ask around first, find a suitable mailing list and + post there. The lists are available on http://curl.haxx.se/mail/ + +WHAT TO REPORT + + When reporting a bug, you should include information that will help us + understand what's wrong, what you expected to happen and how to repeat the + bad behavior. You therefore need to tell us: + + - your operating system's name and version number (uname -a under a unix + is fine) + - what version of curl you're using (curl -V is fine) + - what URL you were working with (if possible), at least which protocol + + and anything and everything else you think matters. Tell us what you + expected to happen, tell use what did happen, tell us how you could make it + work another way. Dig around, try out, test. Then include all the tiny bits + and pieces in your report. You will benefit from this yourself, as it will + enable us to help you quicker and more accurately. + + Since curl deals with networks, it often helps us if you include a protocol + debug dump with your bug report. The output you get by using the -v + flag. Usually, you also get more info by using -i so that is likely to be + useful when reporting bugs as well. + + If curl crashed, causing a core dump (in unix), there is hardly any use to + send that huge file to anyone of us. Unless we have an exact same system + setup as you, we can't do much with it. What we instead ask of you is to get + a stack trace and send that (much smaller) output to us instead! + + The address and how to subscribe to the mailing list is detailed in the + MANUAL file. + +HOW TO GET A STACK TRACE + + First, you must make sure that you compile all sources with -g and that you + don't 'strip' the final executable. Try to avoid optimizing the code as + well, remove -O, -O2 etc from the compiler options. + + Run the program until it dumps core. + + Run your debugger on the core file, like ' curl core'. + should be replaced with the name of your debugger, in most cases that will + be 'gdb', but 'dbx' and others also occur. + + When the debugger has finished loading the core file and presents you a + prompt, enter 'where' (without the quotes) and press return. + + The list that is presented is the stack trace. If everything worked, it is + supposed to contain the chain of functions that were called when curl + crashed. Include the stack trace with your detailed bug report. It'll help a + lot. + diff --git a/main/source/curl/docs/CONTRIBUTE b/main/source/curl/docs/CONTRIBUTE new file mode 100644 index 00000000..ba095c2c --- /dev/null +++ b/main/source/curl/docs/CONTRIBUTE @@ -0,0 +1,159 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + +To Think About When Contributing Source Code + + This document is intended to offer some simple guidelines that can be useful + to keep in mind when you decide to contribute to the project. This concerns + new features as well as corrections to existing flaws or bugs. + +Join the Community + + Skip over to http://curl.haxx.se/mail/ and join the appropriate mailing + list(s). Read up on details before you post questions. Read this file before + you start sending patches! We prefer patches and discussions being held on + the mailing list(s), not sent to individuals. + +The License Issue + + When contributing with code, you agree to put your changes and new code under + the same license curl and libcurl is already using unless stated otherwise. + + If you add a larger piece of code, you can opt to make that file or set of + files to use a different license as long as they don't enforce any changes to + the rest of the package and they make sense. Such "separate parts" can not be + GPL (as we don't want the GPL virus to attack users of libcurl) but they must + use "GPL compatible" licenses. + +What To Read + + Source code, the man pages, the INTERNALS document, the TODO, the most recent + CHANGES. Just lurking on the libcurl mailing list is gonna give you a lot of + insights on what's going on right now. Asking there is a good idea too. + +Naming + + Try using a non-confusing naming scheme for your new functions and variable + names. It doesn't necessarily have to mean that you should use the same as in + other places of the code, just that the names should be logical, + understandable and be named according to what they're used for. File-local + functions should be made static. We like lower case names. + + See the INTERNALS document on how we name non-exported library-global + symbols. + +Indenting + + Please try using the same indenting levels and bracing method as all the + other code already does. It makes the source code a lot easier to follow if + all of it is written using the same style. We don't ask you to like it, we + just ask you to follow the tradition! ;-) This mainly means: 2-level indents, + using spaces only (no tabs) and having the opening brace ({) on the same line + as the if() or while(). + +Commenting + + Comment your source code extensively using C comments (/* comment */), DO NOT + use C++ comments (// this style). Commented code is quality code and enables + future modifications much more. Uncommented code much more risk being + completely replaced when someone wants to extend things, since other persons' + source code can get quite hard to read. + +General Style + + Keep your functions small. If they're small you avoid a lot of mistakes and + you don't accidentally mix up variables etc. + +Non-clobbering All Over + + When you write new functionality or fix bugs, it is important that you don't + fiddle all over the source files and functions. Remember that it is likely + that other people have done changes in the same source files as you have and + possibly even in the same functions. If you bring completely new + functionality, try writing it in a new source file. If you fix bugs, try to + fix one bug at a time and send them as separate patches. + +Platform Dependent Code + + Use #ifdef HAVE_FEATURE to do conditional code. We avoid checking for + particular operating systems or hardware in the #ifdef lines. The + HAVE_FEATURE shall be generated by the configure script for unix-like systems + and they are hard-coded in the config-[system].h files for the others. + +Separate Patches + + It is annoying when you get a huge patch from someone that is said to fix 511 + odd problems, but discussions and opinions don't agree with 510 of them - or + 509 of them were already fixed in a different way. Then the patcher needs to + extract the single interesting patch from somewhere within the huge pile of + source, and that gives a lot of extra work. Preferably, all fixes that + correct different problems should be in their own patch with an attached + description exactly what they correct so that all patches can be selectively + applied by the maintainer or other interested parties. + +Patch Against Recent Sources + + Please try to get the latest available sources to make your patches + against. It makes the life of the developers so much easier. The very best is + if you get the most up-to-date sources from the CVS repository, but the + latest release archive is quite OK as well! + +Document + + Writing docs is dead boring and one of the big problems with many open source + projects. Someone's gotta do it. It makes it a lot easier if you submit a + small description of your fix or your new features with every contribution so + that it can be swiftly added to the package documentation. + + The documentation is always made in man pages (nroff formatted) or plain + ASCII files. All HTML files on the web site and in the release archives are + generated from the nroff/ASCII versions. + +Write Access to CVS Repository + + If you are a frequent contributor, or have another good reason, you can of + course get write access to the CVS repository and then you'll be able to + check-in all your changes straight into the CVS tree instead of sending all + changes by mail as patches. Just ask if this is what you'd want. You will be + required to have posted a few quality patches first, before you can be + granted write access. + +Test Cases + + Since the introduction of the test suite, we can quickly verify that the main + features are working as they're supposed to. To maintain this situation and + improve it, all new features and functions that are added need to be tested + in the test suite. Every feature that is added should get at least one valid + test case that verifies that it works as documented. If every submitter also + post a few test cases, it won't end up as a heavy burden on a single person! + +How To Make a Patch + + Keep a copy of the unmodified curl sources. Make your changes in a separate + source tree. When you think you have something that you want to offer the + curl community, use GNU diff to generate patches. + + If you have modified a single file, try something like: + + diff -u undmodified-file.c my-changed-one.c > my-fixes.diff + + If you have modified several files, possibly in different directories, you + can use diff recursively: + + diff -ur curl-original-dir curl-modfied-sources-dir > my-fixes.diff + + The GNU diff and GNU patch tools exist for virtually all platforms, including + all kinds of unixes and Windows: + + For unix-like operating systems: + + http://www.fsf.org/software/patch/patch.html + http://www.gnu.org/directory/diffutils.html + + For Windows: + + http://gnuwin32.sourceforge.net/packages/patch.htm + http://gnuwin32.sourceforge.net/packages/diffutils.htm diff --git a/main/source/curl/docs/FAQ b/main/source/curl/docs/FAQ new file mode 100644 index 00000000..d40492de --- /dev/null +++ b/main/source/curl/docs/FAQ @@ -0,0 +1,781 @@ +Updated: May 9, 2003 (http://curl.haxx.se/docs/faq.html) + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + +FAQ + + 1. Philosophy + 1.1 What is cURL? + 1.2 What is libcurl? + 1.3 What is cURL not? + 1.4 When will you make curl do XXXX ? + 1.5 Who makes cURL? + 1.6 What do you get for making cURL? + 1.7 What about CURL from curl.com? + 1.8 I have a problem who do I mail? + + 2. Install Related Problems + 2.1 configure doesn't find OpenSSL even when it is installed + 2.1.1. native linker doesn't find openssl + 2.1.2. only the libssl lib is missing + 2.2 Does curl work/build with other SSL libraries? + 2.3 Where can I find a copy of LIBEAY32.DLL? + 2.4 Does cURL support Socks (RFC 1928) ? + + 3. Usage Problems + 3.1 curl: (1) SSL is disabled, https: not supported + 3.2 How do I tell curl to resume a transfer? + 3.3 Why doesn't my posting using -F work? + 3.4 How do I tell curl to run custom FTP commands? + 3.5 How can I disable the Pragma: nocache header? + 3.6 Does curl support ASP, XML, XHTML or HTML version Y? + 3.7 Can I use curl to delete/rename a file through FTP? + 3.8 How do I tell curl to follow HTTP redirects? + 3.9 How do I use curl in my favorite programming language? + 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? + 3.11 How do I POST with a different Content-Type? + 3.12 Why do FTP specific features over HTTP proxy fail? + 3.13 Why does my single/double quotes fail? + 3.14 Does curl support javascript or pac (automated proxy config)? + + 4. Running Problems + 4.1 Problems connecting to SSL servers. + 4.2 Why do I get problems when I use & or % in the URL? + 4.3 How can I use {, }, [ or ] to specify multiple URLs? + 4.4 Why do I get downloaded data even though the web page doesn't exist? + 4.5 Why do I get return code XXX from a HTTP server? + 4.5.1 "400 Bad Request" + 4.5.2 "401 Unauthorized" + 4.5.3 "403 Forbidden" + 4.5.4 "404 Not Found" + 4.5.5 "405 Method Not Allowed" + 4.5.6 "301 Moved Permanently" + 4.6 Can you tell me what error code 142 means? + 4.7 How do I keep user names and passwords secret in Curl command lines? + 4.8 I found a bug! + 4.9 Curl can't authenticate to the server that requires NTLM? + 4.10 My HTTP request using HEAD, PUT or DELETE doesn't work! + 4.11 Why does my HTTP range requests return the full document? + 4.12 Why do I get "certificate verify failed" ? + + 5. libcurl Issues + 5.1 Is libcurl thread-safe? + 5.2 How can I receive all data into a large memory chunk? + 5.3 How do I fetch multiple files with libcurl? + 5.4 Does libcurl do Winsock initing on win32 systems? + 5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ? + 5.6 What about Keep-Alive or persistent connections? + 5.7 Link errors when building libcurl on Windows! + + 6. License Issues + 6.1 I have a GPL program, can I use the libcurl library? + 6.2 I have a closed-source program, can I use the libcurl library? + 6.3 I have a BSD licensed program, can I use the libcurl library? + 6.4 I have a program that uses LGPL libraries, can I use libcurl? + 6.5 Can I modify curl/libcurl for my program and keep the changes secret? + 6.6 Can you please change the curl/libcurl license to XXXX? + +============================================================================== + +1. Philosophy + + 1.1 What is cURL? + + cURL (or simply just 'curl') is a command line tool for getting or sending + files using URL syntax. The name is a play on 'Client for URLs', originally + with URL spelled in uppercase to make it obvious it deals with URLs. The + fact it can also be pronounced 'see URL' also helped, it works as an + abbrivation for "Client URL Request Library" or why not the recursive + version: "Curl is a URL Request Library". + + Curl supports a range of common Internet protocols, currently including + HTTP, HTTPS, FTP, FTPS, GOPHER, LDAP, DICT, TELNET and FILE. + + We spell it cURL or just curl. We pronounce it with an initial k sound: + [kurl]. + + NOTE: there are numerous sub-projects and related projects that also use the + word curl in the project names in various combinations, but you should take + notice that this FAQ is directed at the command-line tool named curl (and + libcurl the library), and may therefore not be valid for other curl + projects. + + 1.2 What is libcurl? + + libcurl is a reliable and portable library which provides you with an easy + interface to a range of common Internet protocols. + + You can use libcurl for free in your application even if it is commercial + or closed-source. + + 1.3 What is cURL not? + + Curl is *not* a wget clone even though that is a very common misconception. + Never, during curl's development, have we intended curl to replace wget or + compete on its market. Curl is targeted at single-shot file transfers. + + Curl is not a web site mirroring program. If you wanna use curl to mirror + something: fine, go ahead and write a script that wraps around curl to make + it reality (like curlmirror.pl does). + + Curl is not an FTP site mirroring program. Sure, get and send FTP with curl + but if you want systematic and sequential behavior you should write a + script (or write a new program that interfaces libcurl) and do it. + + Curl is not a PHP tool, even though it works perfectly well when used from + or with PHP. + + Curl is not a single-OS program. Curl exists, compiles, builds and runs + under a wide range of operating systems, including all modern Unixes (and a + bunch of older ones too), Windows, Amiga, BeOS, OS/2, OS X, QNX etc. + + 1.4 When will you make curl do XXXX ? + + We love suggestions of what to change in order to make curl and libcurl + better. We do however believe in a few rules when it comes to the future of + curl: + + * Curl -- the command line tool -- is to remain a non-graphical command line + tool. If you want GUIs or fancy scripting capabilities, you should look + for another tool that uses libcurl. + + * We do not add things to curl that other small and available tools already + do very fine at the side. Curl's output is fine to pipe into another + program or redirect to another file for the next program to interpret. + + * We focus on protocol related issues and improvements. If you wanna do more + magic with the supported protocols than curl currently does, chances are + big we will agree. If you wanna add more protocols, we may very well + agree. + + * If you want someone else to make all the work while you wait for us to + implement it for you, that is not a very friendly attitude. We spend a + considerable time already on maintaining and developing curl. In order to + get more out of us, you should consider trading in some of your time and + efforts in return. + + * If you write the code, chances are bigger that it will get into curl + faster. + + 1.5 Who makes cURL? + + cURL and libcurl are not made by any single individual. Sure, Daniel + Stenberg writes the major parts, but other persons' submissions are + important and crucial. Anyone can contribute and post their changes and + improvements and have them inserted in the main sources (of course on the + condition that developers agree on that the fixes are good). + + The list of contributors in the docs/THANKS file is only a small part of all + the people that every day provide us with bug reports, suggestions, ideas + and source code. + + curl is developed by a community, with Daniel at the wheel. + + 1.6 What do you get for making cURL? + + Project cURL is entirely free and open. No person gets paid for developing + curl. We do this voluntarily on our spare time. + + We get some help from companies. Contactor Data hosts the curl web site, + Haxx owns the curl web site's domain and sourceforge.net hosts several + project services we take advantage from, like the bug tracker, mailing lists + and more. + + If you want to support our project with a donation or similar, one way of + doing that would be to buy "gift certificates" at useful online shopping + sites, such as amazon.com or thinkgeek.com. Another way would be to sponsor + us through a banner-program or even better: by helping us coding, + documenting, testing etc. You're welcome to send us a buck using paypal, as + described here: http://curl.haxx.se/donation.html + + 1.7 What about CURL from curl.com? + + During the summer 2001, curl.com was busy advertising their client-side + programming language for the web, named CURL. + + We are in no way associated with curl.com or their CURL programming + language. + + Our project name curl has been in effective use since 1998. We were not the + first computer related project to use the name "curl" and do not claim any + first-hand rights to the name. + + We recognize that we will be living in parallel with curl.com and wish them + every success. + + 1.8 I have a problem who do I mail? + + Please do not mail any single individual unless you really need to. Keep + curl-related questions on a suitable mailing list. All available mailing + lists are listed in the MANUAL document and online at + http://curl.haxx.se/mail/ + + Keeping curl-related questions and discussions on mailing lists allows + others to join in and help, to share their ideas, contribute their + suggestions and spread their wisdom. Keeping discussions on public mailing + lists also allows for others to learn from this (both current and future + users thanks to the web based archives of the mailing lists), thus saving us + from having to repeat ourselves even more. Thanks for respecting this. + + +2. Install Related Problems + + 2.1. configure doesn't find OpenSSL even when it is installed + + This may be because of several reasons. + + 2.1.1. native linker doesn't find openssl + + Affected platforms: + Solaris (native cc compiler) + HPUX (native cc compiler) + SGI IRIX (native cc compiler) + SCO UNIX (native cc compiler) + + When configuring curl, I specify --with-ssl. OpenSSL is installed in + /usr/local/ssl Configure reports SSL in /usr/local/ssl, but fails to find + CRYPTO_lock in -lcrypto + + Cause: The cc for this test places the -L/usr/local/ssl/lib AFTER + -lcrypto, so ld can't find the library. This is due to a bug in the GNU + autoconf tool. + + Workaround: Specifying "LDFLAGS=-L/usr/local/ssl/lib" in front of + ./configure places the -L/usr/local/ssl/lib early enough in the command + line to make things work + + Solution submitted by: Bob Allison + + 2.1.2. only the libssl lib is missing + + If all include files and the libcrypto lib is present, with only the + libssl being missing according to configure, this is mostly likely because + a few functions are left out from the libssl. + + If the function names missing include RSA or RSAREF you can be certain + that this is because libssl requires the RSA and RSAREF libs to build. + + See the INSTALL file section that explains how to add those libs to + configure. Make sure that you remove the config.cache file before you + rerun configure with the new flags. + + 2.2. Does curl work/build with other SSL libraries? + + Curl has been written to use OpenSSL, although there should not be much + problems using a different library. If anyone does "port" curl to use a + different SSL library, we are of course very interested in getting the + patch! + + 2.3. Where can I find a copy of LIBEAY32.DLL? + + That is an OpenSSL binary built for Windows. + + Curl uses OpenSSL to do the SSL stuff. The LIBEAY32.DLL is what curl needs + on a windows machine to do https://. Check out the curl web site to find + accurate and up-to-date pointers to recent OpenSSL DLLs and other binary + packages. + + 2.4. Does cURL support Socks (RFC 1928) ? + + There is limited support for SOCKS5 for curl built with IPv6 support + disabled. + + +3. Usage problems + + 3.1. curl: (1) SSL is disabled, https: not supported + + If you get this output when trying to get anything from a https:// server, + it means that the configure script couldn't find all libs and include files + it requires for SSL to work. If the configure script fails to find them, + curl is simply built without SSL support. + + To get the https:// support into a curl that was previously built but that + reports that https:// is not supported, you should dig through the document + and logs and check out why the configure script doesn't find the SSL libs + and/or include files. + + Also, check out the other paragraph in this FAQ labeled "configure doesn't + find OpenSSL even when it is installed". + + 3.2. How do I tell curl to resume a transfer? + + Curl supports resumed transfers both ways on both FTP and HTTP. + + Try the -C option. + + 3.3. Why doesn't my posting using -F work? + + You can't simply use -F or -d at your choice. The web server that will + receive your post assumes one of the formats. If the form you're trying to + "fake" sets the type to 'multipart/form-data', then and only then you must + use the -F type. In all the most common cases, you should use -d which then + causes a posting with the type 'application/x-www-form-urlencoded'. + + This is described in some detail in the MANUAL and TheArtOfHttpScripting + documents, and if you don't understand it the first time, read it again + before you post questions about this to the mailing list. Also, try reading + through the mailing list archives for old postings and questions regarding + this. + + 3.4. How do I tell curl to run custom FTP commands? + + You can tell curl to perform optional commands both before and/or after a + file transfer. Study the -Q/--quote option. + + Since curl is used for file transfers, you don't use curl to just perform + FTP commands without transferring anything. Therefore you must always specify + a URL to transfer to/from even when doing custom FTP commands. + + 3.5. How can I disable the Pragma: nocache header? + + You can change all internally generated headers by adding a replacement with + the -H/--header option. By adding a header with empty contents you safely + disable that one. Use -H "Pragma:" to disable that specific header. + + 3.6. Does curl support ASP, XML, XHTML or HTML version Y? + + To curl, all contents are alike. It doesn't matter how the page was + generated. It may be ASP, PHP, Perl, shell-script, SSI or plain + HTML-files. There's no difference to curl and it doesn't even know what kind + of language that generated the page. + + See also item 3.14 regarding javascript. + + 3.7. Can I use curl to delete/rename a file through FTP? + + Yes. You specify custom FTP commands with -Q/--quote. + + One example would be to delete a file after you have downloaded it: + + curl -O ftp://download.com/coolfile -Q '-DELE coolfile' + + 3.8 How do I tell curl to follow HTTP redirects? + + Curl does not follow so-called redirects by default. The Location: header + that informs the client about this is only interpreted if you're using the + -L/--location option. As in: + + curl -L http://redirector.com + + 3.9 How do I use curl in my favorite programming language? + + There exist many language interfaces/bindings for curl that integrates it + better with various languages. If you are fluid in a script language, you + may very well opt to use such an interface instead of using the command line + tool. + + Find out more about which languages that support curl directly, and how to + install and use them, in the libcurl section of the curl web site: + + http://curl.haxx.se/libcurl/ + + In February 2003, there are interfaces available for the following + languages: Basic, C, C++, Cocoa, Dylan, Euphoria, Java, Lua, Object-Pascal, + Pascal, Perl, PHP, PostgreSQL, Python, Rexx, Ruby, Scheme and Tcl. By the + time you read this, additional ones may have appeared! + + 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? + + Curl adheres to the HTTP spec, which basically means you can play with *any* + protocol that is built on top of HTTP. Protocols such as SOAP, WEBDAV and + XML-RPC are all such ones. You can use -X to set custom requests and -H to + set custom headers (or replace internally generated ones). + + Using libcurl is of course just as fine and you'd just use the proper + library options to do the same. + + 3.11 How do I POST with a different Content-Type? + + You can always replace the internally generated headers with -H/--header. + To make a simple HTTP POST with text/xml as content-type, do something like: + + curl -d "datatopost" -H "Content-Type: text/xml" [URL] + + 3.12 Why do FTP specific features over HTTP proxy fail? + + Because when you use a HTTP proxy, the protocol spoken on the network will + be HTTP, even if you specify a FTP URL. This effectively means that you + normally can't use FTP specific features such as FTP upload and FTP quote + etc. + + There is one exception to this rule, and that is if you can "tunnel through" + the given HTTP proxy. Proxy tunneling is enabled with a special option (-p) + and is generally not available as proxy admins usually disable tunneling to + other ports than 443 (which is used for HTTPS access through proxies). + + 3.13 Why does my single/double quotes fail? + + To specify a command line option that includes spaces, you might need to + put the entire option within quotes. Like in: + + curl -d " with spaces " url.com + + or perhaps + + curl -d ' with spaces ' url.com + + Exactly what kind of quotes and how to do this is entirely up to the shell + or command line interpreter that you are using. For most unix shells, you + can more or less pick either single (') or double (") quotes. For + Windows/DOS prompts I believe you're forced to use double (") quotes. + + Please study the documentation for your particular environment. Examples in + the curl docs will use a mix of both these ones as shown above. You must + adjust them to work in your environment. + + Remember that curl works and runs on more operating systems than most single + individuals have ever tried. + + 3.14 Does curl support javascript or pac (automated proxy config)? + + Many web pages do magic stuff using embedded javascript. Curl and libcurl + have no built-in support for that, so it will be treated just like any other + contents. + + .pac files are a netscape invention and are sometimes used by organizations + to allow them to differentiate which proxies to use. The .pac contents is + just a javascript program that gets invoked by the browser and that returns + the name of the proxy to connect to. Since curl doesn't support javascript, + it can't support .pac proxy configuration either. + + Some work-arounds usually suggested to overcome this javascript dependency: + + - Depending on the javascript complexity, write up a script that + translates it to another language and execute that. + + - Read the javascript code and rewrite the same logic in another language. + + - Implement a javascript interpreted, people have successfully used the + Mozilla javascript engine in the past. + + - Ask your admins to stop this, for a static proxy setup or similar. + + +4. Running Problems + + 4.1. Problems connecting to SSL servers. + + It took a very long time before we could sort out why curl had problems to + connect to certain SSL servers when using SSLeay or OpenSSL v0.9+. The + error sometimes showed up similar to: + + 16570:error:1407D071:SSL routines:SSL2_READ:bad mac decode:s2_pkt.c:233: + + It turned out to be because many older SSL servers don't deal with SSLv3 + requests properly. To correct this problem, tell curl to select SSLv2 from + the command line (-2/--sslv2). + + There has also been examples where the remote server didn't like the SSLv2 + request and instead you had to force curl to use SSLv3 with -3/--sslv3. + + 4.2. Why do I get problems when I use & or % in the URL? + + In general unix shells, the & letter is treated special and when used, it + runs the specified command in the background. To safely send the & as a part + of a URL, you should quote the entire URL by using single (') or double (") + quotes around it. + + An example that would invoke a remote CGI that uses &-letters could be: + + curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl' + + In Windows, the standard DOS shell treats the %-letter specially and you + need to use TWO %-letters for each single one you want to use in the URL. + + Also note that if you want the literal %-letter to be part of the data you + pass in a POST using -d/--data you must encode it as '%25' (which then also + needs the %-letter doubled on Windows machines). + + 4.3. How can I use {, }, [ or ] to specify multiple URLs? + + Because those letters have a special meaning to the shell, and to be used in + a URL specified to curl you must quote them. + + An example that downloads two URLs (sequentially) would do: + + curl '{curl,www}.haxx.se' + + To be able to use those letters as actual parts of the URL (without using + them for the curl URL "globbing" system), use the -g/--globoff option: + + curl -g 'www.site.com/weirdname[].html' + + 4.4. Why do I get downloaded data even though the web page doesn't exist? + + Curl asks remote servers for the page you specify. If the page doesn't exist + at the server, the HTTP protocol defines how the server should respond and + that means that headers and a "page" will be returned. That's simply how + HTTP works. + + By using the --fail option you can tell curl explicitly to not get any data + if the HTTP return code doesn't say success. + + 4.5 Why do I get return code XXX from a HTTP server? + + RFC2616 clearly explains the return codes. This is a short transcript. Go + read the RFC for exact details: + + 4.5.1 "400 Bad Request" + + The request could not be understood by the server due to malformed + syntax. The client SHOULD NOT repeat the request without modifications. + + 4.5.2 "401 Unauthorized" + + The request requires user authentication. + + 4.5.3 "403 Forbidden" + + The server understood the request, but is refusing to fulfill it. + Authorization will not help and the request SHOULD NOT be repeated. + + 4.5.4 "404 Not Found" + + The server has not found anything matching the Request-URI. No indication + is given of whether the condition is temporary or permanent. + + 4.5.5 "405 Method Not Allowed" + + The method specified in the Request-Line is not allowed for the resource + identified by the Request-URI. The response MUST include an Allow header + containing a list of valid methods for the requested resource. + + 4.5.6 "301 Moved Permanently" + + If you get this return code and an HTML output similar to this: + +

Moved Permanently

The document has moved here. + + it might be because you request a directory URL but without the trailing + slash. Try the same operation again _with_ the trailing URL, or use the + -L/--location option to follow the redirection. + + 4.6. Can you tell me what error code 142 means? + + All error codes that are larger than the highest documented error code means + that curl has exited due to a crash. This is a serious error, and we + appreciate a detailed bug report from you that describes how we could go + ahead and repeat this! + + 4.7. How do I keep user names and passwords secret in Curl command lines? + + This problem has two sides: + + The first part is to avoid having clear-text passwords in the command line + so that they don't appear in 'ps' outputs and similar. That is easily + avoided by using the "-K" option to tell curl to read parameters from a + file or stdin to which you can pass the secret info. + + To keep the passwords in your account secret from the rest of the world is + not a task that curl addresses. You could of course encrypt them somehow to + at least hide them from being read by human eyes, but that is not what + anyone would call security. + + Also note that regular HTTP and FTP passwords are sent in clear across the + network. All it takes for anyone to fetch them is to listen on the network. + Eavesdropping is very easy. + + 4.8 I found a bug! + + It is not a bug if the behavior is documented. Read the docs first. + + If it is a problem with a binary you've downloaded or a package for your + particular platform, try contacting the person who built the package/archive + you have. + + If there is a bug, read the BUGS document first. Then report it as described + in there. + + 4.9. Curl can't authenticate to the server that requires NTLM? + + NTLM is a Microsoft proprietary protocol. Unfortunately, curl does not + currently support that. Proprietary formats are evil. You should not use + such ones. + + 4.10 My HTTP request using HEAD, PUT or DELETE doesn't work! + + Many web servers allow or demand that the administrator configures the + server properly for these requests to work on the web server. + + Some servers seem to support HEAD only on certain kinds of URLs. + + To fully grasp this, try the documentation for the particular server + software you're trying to interact with. This is not anything curl can do + anything about. + + 4.11 Why does my HTTP range requests return the full document? + + Because the range may not be supported by the server, or the server may + choose to ignore it and return the full document anyway. + + 4.12 Why do I get "certificate verify failed" ? + + You invoke curl 7.10 or later to communicate on a https:// URL and get an + error back looking something similar to this: + + curl: (35) SSL: error:14090086:SSL routines: + SSL3_GET_SERVER_CERTIFICATE:certificate verify failed + + Then it means that curl couldn't verify that the server's certificate was + good. Curl verifies the certificate using the CA cert bundle that comes with + the curl installation. + + To disable the verification (which makes it act like curl did before 7.10), + use -k. This does however enable man-in-the-middle attacks. + + If you get this failure but are having a CA cert bundle installed and used, + the server's certificate is not signed by one of the CA's in the bundle. It + might for example be self-signed. You then correct this problem by obtaining + a valid CA cert for the server. Or again, decrease the security by disabling + this check. + + Details are also in the SSLCERTS file in the release archives, found online + here: http://curl.haxx.se/docs/sslcerts.html + +5. libcurl Issues + + 5.1. Is libcurl thread-safe? + + Yes. + + We have written the libcurl code specificly adjusted for multi-threaded + programs. libcurl will use thread-safe functions instead of non-safe ones if + your system has such. + + We would appreciate some kind of report or README file from those who have + used libcurl in a threaded environment. + + 5.2 How can I receive all data into a large memory chunk? + + [ See also the examples/getinmemory.c source ] + + You are in full control of the callback function that gets called every time + there is data received from the remote server. You can make that callback do + whatever you want. You do not have to write the received data to a file. + + One solution to this problem could be to have a pointer to a struct that you + pass to the callback function. You set the pointer using the + curl_easy_setopt(CURLOPT_FILE) function. Then that pointer will be passed to + the callback instead of a FILE * to a file: + + /* imaginary struct */ + struct MemoryStruct { + char *memory; + size_t size; + }; + + /* imaginary callback function */ + size_t + WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) + { + register int realsize = size * nmemb; + struct MemoryStruct *mem = (struct MemoryStruct *)data; + + mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); + if (mem->memory) { + memcpy(&(mem->memory[mem->size]), ptr, realsize); + mem->size += realsize; + mem->memory[mem->size] = 0; + } + return realsize; + } + + 5.3 How do I fetch multiple files with libcurl? + + libcurl has excellent support for transferring multiple files. You should + just repeatedly set new URLs with curl_easy_setopt() and then transfer it + with curl_easy_perform(). The handle you get from curl_easy_init() is not + only reusable, but you're even encouraged to reuse it if you can, as that + will enable libcurl to use persistent connections. + + 5.4 Does libcurl do Winsock initialization on win32 systems? + + Yes, if told to in the curl_global_init() call. + + 5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ? + + Yes, but you cannot open a FILE * and pass the pointer to a DLL and have + that DLL use the FILE *. If you set CURLOPT_FILE you must also use + CURLOPT_WRITEFUNCTION as well to set a function that writes the file, even + if that simply writes the data to the specified FILE*. Similarly, if you use + CURLOPT_INFILE you must also specify CURLOPT_READFUNCTION. + + (Provided by Joel DeYoung and Bob Schader) + + 5.6 What about Keep-Alive or persistent connections? + + curl and libcurl have excellent support for persistent connections when + transferring several files from the same server. Curl will attempt to reuse + connections for all URLs specified on the same command line/config file, and + libcurl will reuse connections for all transfers that are made using the + same libcurl handle. + + 5.7 Link errors when building libcurl on Windows! + + You need to make sure that your project, and all the libraries (both static + and dynamic) that it links against, are compiled/linked against the same run + time library. + + This is determined by the /MD, /ML, /MT (and their corresponding /M?d) + options to the command line compiler. /MD (linking against MSVCRT dll) seems + to be the most commonly used option. + + (Provided by Andrew Francis) + + +6. License Issues + + Curl and libcurl are released under a MIT/X derivate license. The license is + very liberal and should not impose a problem for your project. This section + is just a brief summary for the cases we get the most questions. (Parts of + this section was much enhanced by Bjorn Reese.) + + 6.1. I have a GPL program, can I use the libcurl library? + + Yes! + + Since libcurl may be distributed under the MIT/X derivate license, it can be + used together with GPL in any software. + + 6.2. I have a closed-source program, can I use the libcurl library? + + Yes! + + libcurl does not put any restrictions on the program that uses the library. + + 6.3. I have a BSD licensed program, can I use the libcurl library? + + Yes! + + libcurl does not put any restrictions on the program that uses the library. + + 6.4. I have a program that uses LGPL libraries, can I use libcurl? + + Yes! + + The LGPL license doesn't clash with other licenses. + + 6.5. Can I modify curl/libcurl for my program and keep the changes secret? + + Yes! + + The MIT/X derivate license practically allows you to do almost anything with + the sources, on the condition that the copyright texts in the sources are + left intact. + + 6.6. Can you please change the curl/libcurl license to XXXX? + + No. + + We have carefully picked this license after years of development and + discussions and a large amount of people have contributed with source code + knowing that this is the license we use. This license puts the restrictions + we want on curl/libcurl and it does not spread to other programs or + libraries that use it. The recent dual license modification should make it + possible for everyone to use libcurl or curl in their projects, no matter + what license they already have in use. diff --git a/main/source/curl/docs/FEATURES b/main/source/curl/docs/FEATURES new file mode 100644 index 00000000..853a3463 --- /dev/null +++ b/main/source/curl/docs/FEATURES @@ -0,0 +1,94 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + +FEATURES + +Misc + - full URL syntax + - custom maximum download time + - custom least download speed acceptable + - custom output result after completion + - multiple URLs + - guesses protocol from host name unless specified + - uses .netrc + - progress bar/time specs while downloading + - "standard" proxy environment variables support + - config file support + - compiles on win32 (reported built on 29 operating systems) + - redirectable stderr + - use selected network interface for outgoing traffic + - IPv6 support + - persistant connections + +HTTP + - HTTP/1.1 compliant + - GET + - PUT + - HEAD + - POST + - multipart POST + - authentication + - resume (both GET and PUT) + - follow redirects + - maximum amount of redirects to follow + - custom HTTP request + - cookie get/send fully parsed + - understands the netscape cookie file format + - custom headers (that can replace/remove internally generated headers) + - custom user-agent string + - custom referer string + - range + - proxy authentication + - time conditions + - via http-proxy + - retrieve file modification date + +HTTPS (*1) + - (all the HTTP features) + - using certificates + - verify server certificate + - via http-proxy + +FTP + - download + - authentication + - kerberos security + - active/passive using PORT, EPRT, PASV or EPSV + - single file size information (compare to HTTP HEAD) + - 'type=' URL support + - dir listing + - dir listing names-only + - upload + - upload append + - upload via http-proxy as HTTP PUT + - download resume + - upload resume + - custom ftp commands (before and/or after the transfer) + - simple "range" support + - via http-proxy + - all operations can be tunneled through a http-proxy + - customizable to retrieve file modification date + +TELNET + - connection negotiation + - custom telnet options + - stdin/stdout I/O + +LDAP (*2) + - full LDAP URL support + +DICT + - extended DICT URL support + +GOPHER + - GET + - via http-proxy + +FILE + - URL support + + *1 = requires OpenSSL + *2 = requires OpenLDAP diff --git a/main/source/curl/docs/HISTORY b/main/source/curl/docs/HISTORY new file mode 100644 index 00000000..839da30c --- /dev/null +++ b/main/source/curl/docs/HISTORY @@ -0,0 +1,116 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + + How cURL Became Like This + + +In the second half of 1997, Daniel Stenberg came up with the idea to make +currency-exchange calculations available to Internet Relay Chat (IRC) +users. All the necessary data are published on the Web; he just needed to +automate their retrieval. + +Daniel simply adopted an existing command-line open-source tool, httpget, that +Brazilian Rafael Sagula had written. After a few minor adjustments, it did +just what he needed. + +Soon, he found currencies on a GOPHER site, so support for that had to go in, +and not before long FTP download support was added as well. The name of the +project was changed to urlget to better fit what it actually did now, since +the http-only days were already passed. + +The project slowly grew bigger. When upload capabilities were added and the +name once again was misleading, a second name change was made and on March 20, +1998 curl 4 was released. (The version numbering from the previous names were +kept.) + +(Unrelated to this project a company called Curl Corporation filed a US +trademark on the name "CURL" on May 18 1998. That company had then already +registered the curl.com domain back in November of the previous year. All this +was much later brought into the lights.) + +SSL support was added, powered by the SSLeay library. + +August 1998, added project curl to freshmeat.net. + +October 1998, with the curl 4.9 release and the introduction of cookie +support, curl was no longer released under the GPL license. Now we're at 4000 +lines of code, we switched over to the MPL license to restrict the effects of +"copyleft". + +November 1998, configure script and reported successful compiles on several +major operating systems. The never-quite-understood -F option was added and +curl could now simulate quite a lot of a browser. + +Curl 5 was released in December 1998 and introduced the first ever curl man +page. People started making Linux RPM packages out of it. + +January 1999, DICT support added. + +OpenSSL took over where SSLeay was abandoned. + +May 1999, first Debian package. + +August 1999, LDAP:// and FILE:// support added. The curl web site gets 1300 +visits weekly. + +Released curl 6.0 in September. 15000 lines of code. + +December 28 1999, added the project on Sourceforge and started using its +services for managing the project. + +Spring 2000, major internal overhaul to provide a suitable library interface. +The first non-beta release was named 7.1 and arrived in August. This offered +the easy interface and turned out to be the beginning of actually getting +other software and programs to get based on and powered by libcurl. Almost +20000 lines of code. + +August 2000, the curl web site gets 4000 visits weekly. + +The PHP guys adopted libcurl already the same month, when the first ever third +party libcurl binding showed up. CURL has been a supported module in PHP since +the release of PHP 4.0.2. This would soon get followers. More than 16 +different bindings exist at the time of this writing. + +September 2000, kerberos4 support was added. + +In November 2000 started the work on a test suite for curl. It was later +re-written from scratch again. + +January 2001, Daniel released curl 7.5.2 under a new license again: MIT (or +MPL). The MIT license is extremely liberal and can be used combined with GPL +in other projects. This would finally put an end to the "complaints" from +people involved in GPLed projects that previously were prohibited from using +libcurl while it was released under MPL only. (Due to the fact that MPL is +deemed "GPL incompatible".) + +curl supports HTTP 1.1 starting with the release of 7.7, March 22 2001. This +also introduced libcurl's ability to do persistent connections. 24000 lines of +code. + +August 2001. curl is bundled in Mac OS X, 10.1. It was already becoming more +and more of a standard utility of Linux distributions and a regular in the BSD +ports collections. The curl web site gets 8000 visits weekly. Curl Corporation +contacted Daniel to discuss "the name issue". After Daniel's reply, they have +never since got in touch again. + +September 2001, libcurl 7.9 introduces cookie jar and curl_formadd(). During +the forthcoming 7.9.x releases, we introduced the multi interface slowly and +without much whistles. + +June 2002, the curl web site gets 13000 visits weekly. curl and libcurl is +35000 lines of code. Reported successful compiles on more than 40 combinations +of CPUs and operating systems. + +To estimate number of users of the curl tool or libcurl library is next to +impossible. Around 5000 downloaded packages each week from the main site gives +a hint, but the packages are mirrored extensively, bundled with numerous OS +distributions and otherwise retrieved as part of other software. + +September 2002, with the release of curl 7.10 it is released under the MIT +license only. + +February 2003, the curl site averages at 20000 visits weekly. At any given +moment, there's an average of 3 people browsing the curl.haxx.se site. diff --git a/main/source/curl/docs/INSTALL b/main/source/curl/docs/INSTALL new file mode 100644 index 00000000..6045ca80 --- /dev/null +++ b/main/source/curl/docs/INSTALL @@ -0,0 +1,495 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + + How To Compile + +Curl has been compiled and built on numerous different operating systems. + +Most systems build curl the same way (unix-style). Continue reading below for +more details if you're one of them. + +If you're using Windows (95/98/NT/ME/2000/XP or similar), VMS, RISC OS or OS/2 +or cross-compile, you should continue reading from one the paragraphs further +down. + +UNIX +==== + + A normal unix installation is made in three or four steps (after you've + unpacked the source archive): + + ./configure + make + make test (optional) + make install + + You probably need to be root when doing the last command. + + If you have checked out the sources from the CVS repository, read the + CVS-INFO on how to proceed. + + Get a full listing of all available configure options by invoking it like: + + ./configure --help + + If you want to install curl in a different file hierarchy than /usr/local, + you need to specify that already when running configure: + + ./configure --prefix=/path/to/curl/tree + + If you happen to have write permission in that directory, you can do 'make + install' without being root. An example of this would be to make a local + install in your own home directory: + + ./configure --prefix=$HOME + make + make install + + The configure script always tries to find a working SSL library unless + explicitly told not to. If you have OpenSSL installed in the default search + path for your compiler/linker, you don't need to do anything special. If + you have OpenSSL installed in /usr/local/ssl, you can run configure like: + + ./configure --with-ssl + + If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL,) + you can run configure like this: + + ./configure --with-ssl=/opt/OpenSSL + + If you insist on forcing a build without SSL support, even though you may + have OpenSSL installed in your system, you can run configure like this: + + ./configure --without-ssl + + If you have OpenSSL installed, but with the libraries in one place and the + header files somewhere else, you have to set the LDFLAGS and CPPFLAGS + environment variables prior to running configure. Something like this + should work: + + (with the Bourne shell and its clones): + + CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \ + ./configure + + (with csh, tcsh and their clones): + + env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \ + ./configure + + If your SSL library was compiled with rsaref (usually for use in the United + States), you may also need to set: + + LIBS=-lRSAglue -lrsaref + (as suggested by Doug Kaufman) + + MORE OPTIONS + + To force configure to use the standard cc compiler if both cc and gcc are + present, run configure like + + CC=cc ./configure + or + env Cc=cc ./configure + + To force a static library compile, disable the shared library creation + by running configure like: + + ./configure --disable-shared + + To tell the configure script to skip searching for thread-safe functions, + add an option like: + + ./configure --disable-thread + + To build curl with kerberos4 support enabled, curl requires the krb4 libs + and headers installed. You can then use a set of options to tell + configure where those are: + + --with-krb4-includes[=DIR] Specify location of kerberos4 headers + --with-krb4-libs[=DIR] Specify location of kerberos4 libs + --with-krb4[=DIR] where to look for Kerberos4 + + In most cases, /usr/athena is the install prefix and then it works with + + ./configure --with-krb4=/usr/athena + + If you're a curl developer and use gcc, you might want to enable more + debug options with the --enable-debug option. + +Win32 +===== + + Without SSL: + + MingW32 (GCC-2.95) style + ------------------------ + Run the 'mingw32.bat' file to get the proper environment variables + set, then run 'make mingw32' in the root dir. + + If you have any problems linking libraries or finding header files, be + sure to verify that the provided "Makefile.m32" files use the proper + paths, and adjust as necessary. + + Cygwin style + ------------ + Almost identical to the unix installation. Run the configure script in + the curl root with 'sh configure'. Make sure you have the sh + executable in /bin/ or you'll see the configure fail towards the end. + + Run 'make' + + Microsoft command line style + ---------------------------- + Run the 'vcvars32.bat' file to get the proper environment variables + set, then run 'nmake vc' in the root dir. + + The vcvars32.bat file is part of the Microsoft development + environment. + + IDE-style + ------------------------- + If you use VC++, Borland or similar compilers. Include all lib source + files in a static lib "project" (all .c and .h files that is). + (you should name it libcurl or similar) + + Make the sources in the src/ drawer be a "win32 console application" + project. Name it curl. + + With VC++, add 'ws2_32.lib' to the link libs when you build curl! + Borland seems to do that itself magically. Of course you have to make + sure it links with the libcurl too! + + For VC++ 6, there's an included Makefile.vc6 that should be possible + to use out-of-the-box. + + Microsoft note: add /Zm200 to the compiler options to increase the + compiler's memory allocation limit, as the hugehelp.c won't compile + due to "too long puts string". + + + With SSL: + + MingW32 (GCC-2.95) style + ------------------------ + Run the 'mingw32.bat' file to get the proper environment variables + set, then run 'make mingw32-ssl' in the root dir. + + If you have any problems linking libraries or finding header files, be + sure to look at the provided "Makefile.m32" files for the proper + paths, and adjust as necessary. + + Cygwin style + ------------ + Haven't done, nor got any reports on how to do. It should although be + identical to the unix setup for the same purpose. See above. + + Microsoft command line style + ---------------------------- + + Please read the OpenSSL documentation on how to compile and install + the OpenSSL libraries. The build process of OpenSSL generates the + libeay32.dll and ssleay32.dll files in the out32dll subdirectory in + the OpenSSL home directory. OpenSSL static libraries (libeay32.lib, + ssleay32.lib, RSAglue.lib) are created in the out32 subdirectory. + + Run the 'vcvars32.bat' file to get a proper environment. The + vcvars32.bat file is part of the Microsoft development environment and + you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin' + provided that you installed Visual C/C++ 6 in the default directory. + + Before running nmake define the OPENSSL_PATH environment variable with + the root/base directory of OpenSSL, for example: + + set OPENSSL_PATH=c:\openssl-0.9.6b + + Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root + directory. 'nmake vc-ssl' will create a libcurl static and dynamic + libraries in the lib subdirectory, as well as a statically linked + version of curl.exe in the src subdirectory. This statically linked + version is a standalone executable not requiring any DLL at + runtime. This make method requires that you have the static OpenSSL + libraries available in OpenSSL's out32 subdirectory. + 'nmake vc-ssl-dll' creates the libcurl dynamic library and + links curl.exe against libcurl and OpenSSL dynamically. + This executable requires libcurl.dll and the OpenSSL DLLs + at runtime. + + Microsoft / Borland style + ------------------------- + If you have OpenSSL, and want curl to take advantage of it, edit your + project properties to use the SSL include path, link with the SSL libs + and define the USE_SSLEAY symbol. + + Disabling Specific Protocols: + + The configure utility, unfortunately, is not available for the Windows + environment, therefore, you cannot use the various disable-protocol + options of the configure utility on this platform. + + However, you can use the following defines to disable specific + protocols: + + HTTP_ONLY disables all protocols except HTTP + CURL_DISABLE_FTP disables FTP + CURL_DISABLE_LDAP disables LDAP + CURL_DISABLE_TELNET disables TELNET + CURL_DISABLE_DICT disables DICT + CURL_DISABLE_FILE disables FILE + CURL_DISABLE_GOPHER disables GOPHER + + If you want to set any of these defines you have the following + possibilities: + + - Modify lib/setup.h + - Modify lib/Makefile.vc6 + - Add defines to Project/Settings/C/C++/General/Preprocessor Definitions + in the curllib.dsw/curllib.dsp Visual C++ 6 IDE project. + +IBM OS/2 +======== + + Building under OS/2 is not much different from building under unix. + You need: + + - emx 0.9d + - GNU make + - GNU patch + - ksh + - GNU bison + - GNU file utilities + - GNU sed + - autoconf 2.13 + + If you want to build with OpenSSL or OpenLDAP support, you'll need to + download those libraries, too. Dirk Ohme has done some work to port SSL + libraries under OS/2, but it looks like he doesn't care about emx. You'll + find his patches on: http://come.to/Dirk_Ohme + + If during the linking you get an error about _errno being an undefined + symbol referenced from the text segment, you need to add -D__ST_MT_ERRNO__ + in your definitions. + + If everything seems to work fine but there's no curl.exe, you need to add + -Zexe to your linker flags. + + If you're getting huge binaries, probably your makefiles have the -g in + CFLAGS. + +VMS +=== + (The VMS section is in whole contributed by the friendly Nico Baggus) + + This is the first attempt at porting cURL to VMS. + + Curl seems to work with FTP & HTTP other protocols are not tested. (the + perl http/ftp testing server supplied as testing too cannot work on VMS + because vms has no concept of fork(). [ I tried to give it a whack, but + thats of no use. + + SSL stuff has not been ported. + + Telnet has about the same issues as for Win32. When the changes for Win32 + are clear maybe they'l work for VMS too. The basic problem is that select + ONLY works for sockets. + + Marked instances of fopen/[f]stat that might become a problem, especially + for non stream files. In this regard, the files opened for writing will be + created stream/lf and will thus be safe. Just keep in mind that non-binary + read/wring from/to files will have a records size limit of 32767 bytes + imposed. + + Stat to get the size of the files is again only safe for stream files & + fixed record files without implied CC. + + -- My guess is that only allowing access to stream files is the quickest + way to get around the most issues. Therefore all files need to to be + checked to be sure they will be stream/lf before processing them. This is + the easiest way out, I know. The reason for this is that code that needs to + report the filesize will become a pain in the ass otherwise. + + Exit status.... Well we needed something done here, + + VMS has a structured exist status: + | 3 | 2 | 1 | 0| + |1098|765432109876|5432109876543|210| + +----+------------+-------------+---+ + |Ctrl| Facility | Error code |sev| + +----+------------+-------------+---+ + + With the Ctrl-bits an application can tell if part or the whole message has + allready been printed from the program, DCL doesn't need to print it again. + + Facility - basicaly the program ID. A code assigned to the program + the name can be fetched from external or internal message libraries + Errorcode - the errodes assigned by the application + Sev. - severity: Even = error, off = non error + 0 = Warning + 1 = Success + 2 = Error + 3 = Information + 4 = Fatal + <5-7> reserved. + + This all presents itself with: + %--, + + See also the src/curlmsg.msg file, it has the source for the messages In + src/main.c a section is devoted to message status values, the globalvalues + create symbols with certain values, referenced from a compiled message + file. Have all exit function use a exit status derived from a translation + table with the compiled message codes. + + This was all compiled with: + + Compaq C V6.2-003 on OpenVMS Alpha V7.1-1H2 + + So far for porting notes as of: + 13-jul-2001 + N. Baggus + +QNX +=== + (This section was graciously brought to us by David Bentham) + + As QNX is targetted for resource constrained environments, the QNX headers + set conservative limits. This includes the FD_SETSIZE macro, set by default + to 32. Socket descriptors returned within the CURL library may exceed this, + resulting in memory faults/SIGSEGV crashes when passed into select(..) + calls using fd_set macros. + + A good all-round solution to this is to override the default when building + libcurl, by overriding CFLAGS during configure, example + # configure CFLAGS='-DFD_SETSIZE=64 -g -O2' + +CROSS COMPILE +============= + + (This section was graciously brought to us by Jim Duey, 23-oct-2001) + + Download and unpack the cURL package. Version should be 7.9.1 or later. + + 'cd' to the new directory. (ie. curl-7.9.1-pre4) + + Set environment variables to point to the cross-compile toolchain and call + configure with any options you need. Be sure and specify the '--host' and + '--build' parameters at configuration time. The following script is an + example of cross-compiling for the IBM 405GP PowerPC processor using the + toolchain from MonteVista for Hardhat Linux. + + (begin script) + + #! /bin/sh + + export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin + export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include" + export AR=ppc_405-ar + export AS=ppc_405-as + export LD=ppc_405-ld + export RANLIB=ppc_405-ranlib + export CC=ppc_405-gcc + export NM=ppc_405-nm + + configure --target=powerpc-hardhat-linux \ + --host=powerpc-hardhat-linux \ + --build=i586-pc-linux-gnu \ + --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local \ + --exec-prefix=/usr/local + + (end script) + + The '--prefix' parameter specifies where cURL will be installed. If + 'configure' completes successfully, do 'make' and 'make install' as usual. + +RISC OS +======= + The library can be cross-compiled using gccsdk as follows: + + CC=riscos-gcc AR=riscos-ar RANLIB='riscos-ar -s' ./configure \ + --host=arm-riscos-aof --without-random --disable-shared + make + + where riscos-gcc and riscos-ar are links to the gccsdk tools. + You can then link your program with curl/lib/.libs/libcurl.a + +PORTS +===== + This is a probably incomplete list of known hardware and operating systems + that curl has been compiled for. If you know a system curl compiles and + runs on, that isn't listed, please let us know! + + - Alpha DEC OSF 4 + - Alpha Digital UNIX v3.2 + - Alpha FreeBSD 4.1, 4.5 + - Alpha Linux 2.2, 2.4 + - Alpha NetBSD 1.5.2 + - Alpha OpenBSD 3.0 + - Alpha OpenVMS V7.1-1H2 + - Alpha Tru64 v5.0 5.1 + - HP-PA HP-UX 9.X 10.X 11.X + - HP-PA Linux + - MIPS IRIX 6.2, 6.5 + - MIPS Linux + - Pocket PC/Win CE 3.0 + - Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1 + - PowerPC Darwin 1.0 + - PowerPC Linux + - PowerPC Mac OS 9 + - PowerPC Mac OS X + - SINIX-Z v5 + - Sparc Linux + - Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8 + - Sparc SunOS 4.1.X + - StrongARM (and other ARM) RISC OS 3.1, 4.02 + - StrongARM Linux 2.4 + - StrongARM NetBSD 1.4.1 + - Ultrix 4.3a + - i386 BeOS + - i386 FreeBSD + - i386 HURD + - i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4 + - i386 NetBSD + - i386 OS/2 + - i386 OpenBSD + - i386 SCO unix + - i386 Solaris 2.7 + - i386 Windows 95, 98, ME, NT, 2000 + - i386 QNX 6 + - i486 ncr-sysv4.3.03 (NCR MP-RAS) + - ia64 Linux 2.3.99 + - m68k AmigaOS 3 + - m68k Linux + - m68k OpenBSD + - m88k dg-dgux5.4R3.00 + - s390 Linux + - XScale/PXA250 Linux 2.4 + +OpenSSL +======= + + You'll find OpenSSL information at: + + http://www.openssl.org + + +MingW32/Cygwin +============== + + You'll find MingW32 and Cygwin information at: + + http://www.mingw.org + +OpenLDAP +======== + + You'll find OpenLDAP information at: + + http://www.openldap.org + + You need to install it with shared libraries, which is enabled when running + the ldap configure script with "--enable-shared". With my linux 2.0.36 + kernel I also had to disable using threads (with --without-threads), + because the configure script couldn't figure out my system. diff --git a/main/source/curl/docs/INTERNALS b/main/source/curl/docs/INTERNALS new file mode 100644 index 00000000..16fdbb5e --- /dev/null +++ b/main/source/curl/docs/INTERNALS @@ -0,0 +1,381 @@ + Updated for curl 7.9.1 on November 2, 2001 + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + +INTERNALS + + The project is split in two. The library and the client. The client part uses + the library, but the library is designed to allow other applications to use + it. + + The largest amount of code and complexity is in the library part. + +CVS +=== + All changes to the sources are committed to the CVS repository as soon as + they're somewhat verified to work. Changes shall be commited as independently + as possible so that individual changes can be easier spotted and tracked + afterwards. + + Tagging shall be used extensively, and by the time we release new archives we + should tag the sources with a name similar to the released version number. + +Windows vs Unix +=============== + + There are a few differences in how to program curl the unix way compared to + the Windows way. The four perhaps most notable details are: + + 1. Different function names for socket operations. + + In curl, this is solved with defines and macros, so that the source looks + the same at all places except for the header file that defines them. The + macros in use are sclose(), sread() and swrite(). + + 2. Windows requires a couple of init calls for the socket stuff. + + Those must be made by the application that uses libcurl, in curl that means + src/main.c has some code #ifdef'ed to do just that. + + 3. The file descriptors for network communication and file operations are + not easily interchangable as in unix. + + We avoid this by not trying any funny tricks on file descriptors. + + 4. When writing data to stdout, Windows makes end-of-lines the DOS way, thus + destroying binary data, although you do want that conversion if it is + text coming through... (sigh) + + We set stdout to binary under windows + + Inside the source code, We make an effort to avoid '#ifdef [Your OS]'. All + conditionals that deal with features *should* instead be in the format + '#ifdef HAVE_THAT_WEIRD_FUNCTION'. Since Windows can't run configure scripts, + we maintain two config-win32.h files (one in lib/ and one in src/) that are + supposed to look exactly as a config.h file would have looked like on a + Windows machine! + + Generally speaking: always remember that this will be compiled on dozens of + operating systems. Don't walk on the edge. + +Library +======= + + There are plenty of entry points to the library, namely each publicly defined + function that libcurl offers to applications. All of those functions are + rather small and easy-to-follow. All the ones prefixed with 'curl_easy' are + put in the lib/easy.c file. + + curl_global_init_() and curl_global_cleanup() should be called by the + application to initialize and clean up global stuff in the library. As of + today, it can handle the global SSL initing if SSL is enabled and it can init + the socket layer on windows machines. libcurl itself has no "global" scope. + + All printf()-style functions use the supplied clones in lib/mprintf.c. This + makes sure we stay absolutely platform independent. + + curl_easy_init() allocates an internal struct and makes some initializations. + The returned handle does not reveal internals. This is the 'SessionHandle' + struct which works as an "anchor" struct for all curl_easy functions. All + connections performed will get connect-specific data allocated that should be + used for things related to particular connections/requests. + + curl_easy_setopt() takes three arguments, where the option stuff must be + passed in pairs: the parameter-ID and the parameter-value. The list of + options is documented in the man page. This function mainly sets things in + the 'SessionHandle' struct. + + curl_easy_perform() does a whole lot of things: + + It starts off in the lib/easy.c file by calling Curl_perform() and the main + work then continues in lib/url.c. The flow continues with a call to + Curl_connect() to connect to the remote site. + + o Curl_connect() + + ... analyzes the URL, it separates the different components and connects to + the remote host. This may involve using a proxy and/or using SSL. The + Curl_gethost() function in lib/hostip.c is used for looking up host names. + + When Curl_connect is done, we are connected to the remote site. Then it is + time to tell the server to get a document/file. Curl_do() arranges this. + + This function makes sure there's an allocated and initiated 'connectdata' + struct that is used for this particular connection only (although there may + be several requests performed on the same connect). A bunch of things are + inited/inherited from the SessionHandle struct. + + o Curl_do() + + Curl_do() makes sure the proper protocol-specific function is called. The + functions are named after the protocols they handle. Curl_ftp(), + Curl_http(), Curl_dict(), etc. They all reside in their respective files + (ftp.c, http.c and dict.c). HTTPS is handled by Curl_http() and FTPS by + Curl_ftp(). + + The protocol-specific functions of course deal with protocol-specific + negotiations and setup. They have access to the Curl_sendf() (from + lib/sendf.c) function to send printf-style formatted data to the remote + host and when they're ready to make the actual file transfer they call the + Curl_Transfer() function (in lib/transfer.c) to setup the transfer and + returns. + + Starting in 7.9.1, if this DO function fails and the connection is being + re-used, libcurl will then close this connection, setup a new connection + and re-issue the DO request on that. This is because there is no way to be + perfectly sure that we have discovered a dead connection before the DO + function and thus we might wrongly be re-using a connection that was closed + by the remote peer. + + o Transfer() + + Curl_perform() then calls Transfer() in lib/transfer.c that performs + the entire file transfer. + + During transfer, the progress functions in lib/progress.c are called at a + frequent interval (or at the user's choice, a specified callback might get + called). The speedcheck functions in lib/speedcheck.c are also used to + verify that the transfer is as fast as required. + + o Curl_done() + + Called after a transfer is done. This function takes care of everything + that has to be done after a transfer. This function attempts to leave + matters in a state so that Curl_do() should be possible to call again on + the same connection (in a persistent connection case). It might also soon + be closed with Curl_disconnect(). + + o Curl_disconnect() + + When doing normal connections and transfers, no one ever tries to close any + connections so this is not normally called when curl_easy_perform() is + used. This function is only used when we are certain that no more transfers + is going to be made on the connection. It can be also closed by force, or + it can be called to make sure that libcurl doesn't keep too many + connections alive at the same time (there's a default amount of 5 but that + can be changed with the CURLOPT_MAXCONNECTS option). + + This function cleans up all resources that are associated with a single + connection. + + Curl_perform() is the function that does the main "connect - do - transfer - + done" loop. It loops if there's a Location: to follow. + + When completed, the curl_easy_cleanup() should be called to free up used + resources. It runs Curl_disconnect() on all open connectons. + + A quick roundup on internal function sequences (many of these call + protocol-specific function-pointers): + + curl_connect - connects to a remote site and does initial connect fluff + This also checks for an existing connection to the requested site and uses + that one if it is possible. + + curl_do - starts a transfer + curl_transfer() - transfers data + curl_done - ends a transfer + + curl_disconnect - disconnects from a remote site. This is called when the + disconnect is really requested, which doesn't necessarily have to be + exactly after curl_done in case we want to keep the connection open for + a while. + + HTTP(S) + + HTTP offers a lot and is the protocol in curl that uses the most lines of + code. There is a special file (lib/formdata.c) that offers all the multipart + post functions. + + base64-functions for user+password stuff (and more) is in (lib/base64.c) and + all functions for parsing and sending cookies are found in (lib/cookie.c). + + HTTPS uses in almost every means the same procedure as HTTP, with only two + exceptions: the connect procedure is different and the function used to read + or write from the socket is different, although the latter fact is hidden in + the source by the use of curl_read() for reading and curl_write() for writing + data to the remote server. + + http_chunks.c contains functions that understands HTTP 1.1 chunked transfer + encoding. + + An interesting detail with the HTTP(S) request, is the add_buffer() series of + functions we use. They append data to one single buffer, and when the + building is done the entire request is sent off in one single write. This is + done this way to overcome problems with flawed firewalls and lame servers. + + FTP + + The Curl_if2ip() function can be used for getting the IP number of a + specified network interface, and it resides in lib/if2ip.c. + + Curl_ftpsendf() is used for sending FTP commands to the remote server. It was + made a separate function to prevent us programmers from forgetting that they + must be CRLF terminated. They must also be sent in one single write() to make + firewalls and similar happy. + + Kerberos + + The kerberos support is mainly in lib/krb4.c and lib/security.c. + + TELNET + + Telnet is implemented in lib/telnet.c. + + FILE + + The file:// protocol is dealt with in lib/file.c. + + LDAP + + Everything LDAP is in lib/ldap.c. + + GENERAL + + URL encoding and decoding, called escaping and unescaping in the source code, + is found in lib/escape.c. + + While transfering data in Transfer() a few functions might get + used. curl_getdate() in lib/getdate.c is for HTTP date comparisons (and + more). + + lib/getenv.c offers curl_getenv() which is for reading environment variables + in a neat platform independent way. That's used in the client, but also in + lib/url.c when checking the proxy environment variables. Note that contrary + to the normal unix getenv(), this returns an allocated buffer that must be + free()ed after use. + + lib/netrc.c holds the .netrc parser + + lib/timeval.c features replacement functions for systems that don't have + gettimeofday() and a few support functions for timeval convertions. + + A function named curl_version() that returns the full curl version string is + found in lib/version.c. + + If authentication is requested but no password is given, a getpass_r() clone + exists in lib/getpass.c. libcurl offers a custom callback that can be used + instead of this, but it doesn't change much to us. + +Persistent Connections +====================== + + The persistent connection support in libcurl requires some considerations on + how to do things inside of the library. + + o The 'SessionHandle' struct returned in the curl_easy_init() call must never + hold connection-oriented data. It is meant to hold the root data as well as + all the options etc that the library-user may choose. + o The 'SessionHandle' struct holds the "connection cache" (an array of + pointers to 'connectdata' structs). There's one connectdata struct + allocated for each connection that libcurl knows about. + o This also enables the 'curl handle' to be reused on subsequent transfers, + something that was illegal before libcurl 7.7. + o When we are about to perform a transfer with curl_easy_perform(), we first + check for an already existing connection in the cache that we can use, + otherwise we create a new one and add to the cache. If the cache is full + already when we add a new connection, we close one of the present ones. We + select which one to close dependent on the close policy that may have been + previously set. + o When the transfer operation is complete, we try to leave the connection + open. Particular options may tell us not to, and protocols may signal + closure on connections and then we don't keep it open of course. + o When curl_easy_cleanup() is called, we close all still opened connections. + + You do realize that the curl handle must be re-used in order for the + persistent connections to work. + +Library Symbols +=============== + + All symbols used internally in libcurl must use a 'Curl_' prefix if they're + used in more than a single file. Single-file symbols must be made static. + Public ("exported") symbols must use a 'curl_' prefix. (There are exceptions, + but they are to be changed to follow this pattern in future versions.) + +Return Codes and Informationals +=============================== + + I've made things simple. Almost every function in libcurl returns a CURLcode, + that must be CURLE_OK if everything is OK or otherwise a suitable error code + as the curl/curl.h include file defines. The very spot that detects an error + must use the Curl_failf() function to set the human-readable error + description. + + In aiding the user to understand what's happening and to debug curl usage, we + must supply a fair amount of informational messages by using the Curl_infof() + function. Those messages are only displayed when the user explicitly asks for + them. They are best used when revealing information that isn't otherwise + obvious. + +Client +====== + + main() resides in src/main.c together with most of the client code. + + src/hugehelp.c is automatically generated by the mkhelp.pl perl script to + display the complete "manual" and the src/urlglob.c file holds the functions + used for the URL-"globbing" support. Globbing in the sense that the {} and [] + expansion stuff is there. + + The client mostly messes around to setup its 'config' struct properly, then + it calls the curl_easy_*() functions of the library and when it gets back + control after the curl_easy_perform() it cleans up the library, checks status + and exits. + + When the operation is done, the ourWriteOut() function in src/writeout.c may + be called to report about the operation. That function is using the + curl_easy_getinfo() function to extract useful information from the curl + session. + + Recent versions may loop and do all this several times if many URLs were + specified on the command line or config file. + +Memory Debugging +================ + + The file lib/memdebug.c contains debug-versions of a few functions. Functions + such as malloc, free, fopen, fclose, etc that somehow deal with resources + that might give us problems if we "leak" them. The functions in the memdebug + system do nothing fancy, they do their normal function and then log + information about what they just did. The logged data can then be analyzed + after a complete session, + + memanalyze.pl is the perl script present only present in CVS (not part of the + release archives) that analyzes a log file generated by the memdebug + system. It detects if resources are allocated but never freed and other kinds + of errors related to resource management. + + Use -DMALLOCDEBUG when compiling to enable memory debugging, this is also + switched on by running configure with --enable-debug. + +Test Suite +========== + + Since November 2000, a test suite has evolved. It is placed in its own + subdirectory directly off the root in the curl archive tree, and it contains + a bunch of scripts and a lot of test case data. + + The main test script is runtests.pl that will invoke the two servers + httpserver.pl and ftpserver.pl before all the test cases are performed. The + test suite currently only runs on unix-like platforms. + + You'll find a complete description of the test case data files in the + tests/README file. + + The test suite automatically detects if curl was built with the memory + debugging enabled, and if it was it will detect memory leaks too. + +Building Releases +================= + + There's no magic to this. When you consider everything stable enough to be + released, run the 'maketgz' script (using 'make distcheck' will give you a + pretty good view on the status of the current sources). maketgz prompts for + version number of the client and the library before it creates a release + archive. maketgz uses 'make dist' for the actual archive building, why you + need to fill in the Makefile.am files properly for which files that should + be included in the release archives. + diff --git a/main/source/curl/docs/KNOWN_BUGS b/main/source/curl/docs/KNOWN_BUGS new file mode 100644 index 00000000..dbbdf292 --- /dev/null +++ b/main/source/curl/docs/KNOWN_BUGS @@ -0,0 +1,91 @@ +These are problems known to exist at the time of this release. Feel free to +join in and help us correct one or more of these! Also be sure to check the +changelog of the current development status, as one or more of these problems +may have been fixed since this was written! + +* IPv6 support on AIX 4.3.3 doesn't work due to a missing sockaddr_storage + struct. It has been reported to work on AIX 5.1 though. + +* Running 'make test' on Mac OS X gives 4 errors. This seems to be related + to some kind of libtool problem: + http://curl.haxx.se/mail/archive-2002-03/0029.html and + http://curl.haxx.se/mail/archive-2002-03/0033.html + +* libcurl does not deal nicely with files larger than 2GB + +* GOPHER transfers seem broken + +* configure --disable-http is not fully supported. All other protocols seem + to work to disable. + +* The -m parameter does not work when using telnet with curl on Windows. + +* If a HTTP server responds to a HEAD request and includes a body (thus + violating the RFC2616), curl won't wait to read the response but just stop + reading and return back. If a second request (let's assume a GET) is then + immediately made to the same server again, the connection will be re-used + fine of course, and the second request will be sent off but when the + response is to get read, the previous response-body is what curl will read + and havoc is what happens. + More details on this is found in this libcurl mailing list thread: + http://curl.haxx.se/mail/lib-2002-08/0000.html + +------------------------------------------------------------------------------ + +Q: My program blows up when I run lots of curl_easy_perform() calls on a +single thread +Q: My program dies when a single thread re-enters the win32 select() call +via curl_easy_perform() +Q: --- add your own flavour here --- + +Single Threaded Re-Entracy +-------------------------- + +There is a glitch / trick to using cURL on Win32 related to re-entrancy. +This experience was gained on verion 7.9.4 using Windows NT SP3 in a banking +environment (just in case you wanted to know). + +If you have already called curl_easy_perform(), and *somehow* you cause your +single thread of execution to make another call to curl_easy_perform() - the +windows socket() call used to create a new socket for the second connection +can return with 10044 / 10043 error codes. + +The WSA errors we experienced are: +WSAEPROTONOSUPPORT +(10043) +Protocol not supported. +The requested protocol has not been configured into the system, or no +implementation for it exists. For example, a socket call requests a +SOCK_DGRAM socket, but specifies a stream protocol. + +WSAESOCKTNOSUPPORT +(10044) +Socket type not supported. +The support for the specified socket type does not exist in this address +family. For example, the optional type SOCK_RAW might be selected in a +socket call, and the implementation does not support SOCK_RAW sockets at +all. + +We have experienced this by creating a timer that ticks every 20ms, and on +the tick making a curl_easy_perform() call. The call usually completed in +about 300ms. And we expected (before this test) that the timer would NOT be +fired during a call to curl_easy_perform(), howvever, while the first +curl_easy_perform() is running a tick *is* fired by the windows API somehow, +and we then call curl_easy_perform() again - thus single threaded +re-entrancy is achieved. + +Notes: +* We made sure that a new CURL structure was being used for each +curl_easy_perform() request, and that the curl_global_init() had been called +beforehand. +* I'm happy to answer any questions about this problem to try to track it +down. +* Once the socket() call started failing, there is no hope - it never works +again. +* Slowing the timer down to give each request enough time to complete solves +this problem completely. + +If anyone has the source code to the WinNT implementation of socket() and +can figure out WHY this can occur, more tracing can be performed. + + John Clayton diff --git a/main/source/curl/docs/MANUAL b/main/source/curl/docs/MANUAL new file mode 100644 index 00000000..9a2eaa39 --- /dev/null +++ b/main/source/curl/docs/MANUAL @@ -0,0 +1,879 @@ +LATEST VERSION + + You always find news about what's going on as well as the latest versions + from the curl web pages, located at: + + http://curl.haxx.se + +SIMPLE USAGE + + Get the main page from netscape's web-server: + + curl http://www.netscape.com/ + + Get the root README file from funet's ftp-server: + + curl ftp://ftp.funet.fi/README + + Get a web page from a server using port 8000: + + curl http://www.weirdserver.com:8000/ + + Get a list of the root directory of an FTP site: + + curl ftp://cool.haxx.se/ + + Get a gopher document from funet's gopher server: + + curl gopher://gopher.funet.fi + + Get the definition of curl from a dictionary: + + curl dict://dict.org/m:curl + + Fetch two documents at once: + + curl ftp://cool.haxx.se/ http://www.weirdserver.com:8000/ + +DOWNLOAD TO A FILE + + Get a web page and store in a local file: + + curl -o thatpage.html http://www.netscape.com/ + + Get a web page and store in a local file, make the local file get the name + of the remote document (if no file name part is specified in the URL, this + will fail): + + curl -O http://www.netscape.com/index.html + + Fetch two files and store them with their remote names: + + curl -O www.haxx.se/index.html -O curl.haxx.se/download.html + +USING PASSWORDS + + FTP + + To ftp files using name+passwd, include them in the URL like: + + curl ftp://name:passwd@machine.domain:port/full/path/to/file + + or specify them with the -u flag like + + curl -u name:passwd ftp://machine.domain:port/full/path/to/file + + HTTP + + The HTTP URL doesn't support user and password in the URL string. Curl + does support that anyway to provide a ftp-style interface and thus you can + pick a file like: + + curl http://name:passwd@machine.domain/full/path/to/file + + or specify user and password separately like in + + curl -u name:passwd http://machine.domain/full/path/to/file + + NOTE! Since HTTP URLs don't support user and password, you can't use that + style when using Curl via a proxy. You _must_ use the -u style fetch + during such circumstances. + + HTTPS + + Probably most commonly used with private certificates, as explained below. + + GOPHER + + Curl features no password support for gopher. + +PROXY + + Get an ftp file using a proxy named my-proxy that uses port 888: + + curl -x my-proxy:888 ftp://ftp.leachsite.com/README + + Get a file from a HTTP server that requires user and password, using the + same proxy as above: + + curl -u user:passwd -x my-proxy:888 http://www.get.this/ + + Some proxies require special authentication. Specify by using -U as above: + + curl -U user:passwd -x my-proxy:888 http://www.get.this/ + + See also the environment variables Curl support that offer further proxy + control. + +RANGES + + With HTTP 1.1 byte-ranges were introduced. Using this, a client can request + to get only one or more subparts of a specified document. Curl supports + this with the -r flag. + + Get the first 100 bytes of a document: + + curl -r 0-99 http://www.get.this/ + + Get the last 500 bytes of a document: + + curl -r -500 http://www.get.this/ + + Curl also supports simple ranges for FTP files as well. Then you can only + specify start and stop position. + + Get the first 100 bytes of a document using FTP: + + curl -r 0-99 ftp://www.get.this/README + +UPLOADING + + FTP + + Upload all data on stdin to a specified ftp site: + + curl -T - ftp://ftp.upload.com/myfile + + Upload data from a specified file, login with user and password: + + curl -T uploadfile -u user:passwd ftp://ftp.upload.com/myfile + + Upload a local file to the remote site, and use the local file name remote + too: + + curl -T uploadfile -u user:passwd ftp://ftp.upload.com/ + + Upload a local file to get appended to the remote file using ftp: + + curl -T localfile -a ftp://ftp.upload.com/remotefile + + Curl also supports ftp upload through a proxy, but only if the proxy is + configured to allow that kind of tunneling. If it does, you can run curl in + a fashion similar to: + + curl --proxytunnel -x proxy:port -T localfile ftp.upload.com + + HTTP + + Upload all data on stdin to a specified http site: + + curl -T - http://www.upload.com/myfile + + Note that the http server must've been configured to accept PUT before this + can be done successfully. + + For other ways to do http data upload, see the POST section below. + +VERBOSE / DEBUG + + If curl fails where it isn't supposed to, if the servers don't let you in, + if you can't understand the responses: use the -v flag to get verbose + fetching. Curl will output lots of info and what it sends and receives in + order to let the user see all client-server interaction (but it won't show + you the actual data). + + curl -v ftp://ftp.upload.com/ + + To get even more details and information on what curl does, try using the + --trace or --trace-ascii options with a given file name to log to, like + this: + + curl --trace trace.txt www.haxx.se + + +DETAILED INFORMATION + + Different protocols provide different ways of getting detailed information + about specific files/documents. To get curl to show detailed information + about a single file, you should use -I/--head option. It displays all + available info on a single file for HTTP and FTP. The HTTP information is a + lot more extensive. + + For HTTP, you can get the header information (the same as -I would show) + shown before the data by using -i/--include. Curl understands the + -D/--dump-header option when getting files from both FTP and HTTP, and it + will then store the headers in the specified file. + + Store the HTTP headers in a separate file (headers.txt in the example): + + curl --dump-header headers.txt curl.haxx.se + + Note that headers stored in a separate file can be very useful at a later + time if you want curl to use cookies sent by the server. More about that in + the cookies section. + +POST (HTTP) + + It's easy to post data using curl. This is done using the -d + option. The post data must be urlencoded. + + Post a simple "name" and "phone" guestbook. + + curl -d "name=Rafael%20Sagula&phone=3320780" \ + http://www.where.com/guest.cgi + + How to post a form with curl, lesson #1: + + Dig out all the tags in the form that you want to fill in. (There's + a perl program called formfind.pl on the curl site that helps with this). + + If there's a "normal" post, you use -d to post. -d takes a full "post + string", which is in the format + + =&=&... + + The 'variable' names are the names set with "name=" in the tags, and + the data is the contents you want to fill in for the inputs. The data *must* + be properly URL encoded. That means you replace space with + and that you + write weird letters with %XX where XX is the hexadecimal representation of + the letter's ASCII code. + + Example: + + (page located at http://www.formpost.com/getthis/ + +
+ + + + +
+ + We want to enter user 'foobar' with password '12345'. + + To post to this, you enter a curl command line like: + + curl -d "user=foobar&pass=12345&id=blablabla&dig=submit" (continues) + http://www.formpost.com/getthis/post.cgi + + + While -d uses the application/x-www-form-urlencoded mime-type, generally + understood by CGI's and similar, curl also supports the more capable + multipart/form-data type. This latter type supports things like file upload. + + -F accepts parameters like -F "name=contents". If you want the contents to + be read from a file, use <@filename> as contents. When specifying a file, + you can also specify the file content type by appending ';type=' + to the file name. You can also post the contents of several files in one + field. For example, the field name 'coolfiles' is used to send three files, + with different content types using the following syntax: + + curl -F "coolfiles=@fil1.gif;type=image/gif,fil2.txt,fil3.html" \ + http://www.post.com/postit.cgi + + If the content-type is not specified, curl will try to guess from the file + extension (it only knows a few), or use the previously specified type (from + an earlier file if several files are specified in a list) or else it will + using the default type 'text/plain'. + + Emulate a fill-in form with -F. Let's say you fill in three fields in a + form. One field is a file name which to post, one field is your name and one + field is a file description. We want to post the file we have written named + "cooltext.txt". To let curl do the posting of this data instead of your + favourite browser, you have to read the HTML source of the form page and + find the names of the input fields. In our example, the input field names + are 'file', 'yourname' and 'filedescription'. + + curl -F "file=@cooltext.txt" -F "yourname=Daniel" \ + -F "filedescription=Cool text file with cool text inside" \ + http://www.post.com/postit.cgi + + To send two files in one post you can do it in two ways: + + 1. Send multiple files in a single "field" with a single field name: + + curl -F "pictures=@dog.gif,cat.gif" + + 2. Send two fields with two field names: + + curl -F "docpicture=@dog.gif" -F "catpicture=@cat.gif" + +REFERRER + + A HTTP request has the option to include information about which address + that referred to actual page. Curl allows you to specify the + referrer to be used on the command line. It is especially useful to + fool or trick stupid servers or CGI scripts that rely on that information + being available or contain certain data. + + curl -e www.coolsite.com http://www.showme.com/ + + NOTE: The referer field is defined in the HTTP spec to be a full URL. + +USER AGENT + + A HTTP request has the option to include information about the browser + that generated the request. Curl allows it to be specified on the command + line. It is especially useful to fool or trick stupid servers or CGI + scripts that only accept certain browsers. + + Example: + + curl -A 'Mozilla/3.0 (Win95; I)' http://www.nationsbank.com/ + + Other common strings: + 'Mozilla/3.0 (Win95; I)' Netscape Version 3 for Windows 95 + 'Mozilla/3.04 (Win95; U)' Netscape Version 3 for Windows 95 + 'Mozilla/2.02 (OS/2; U)' Netscape Version 2 for OS/2 + 'Mozilla/4.04 [en] (X11; U; AIX 4.2; Nav)' NS for AIX + 'Mozilla/4.05 [en] (X11; U; Linux 2.0.32 i586)' NS for Linux + + Note that Internet Explorer tries hard to be compatible in every way: + 'Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)' MSIE for W95 + + Mozilla is not the only possible User-Agent name: + 'Konqueror/1.0' KDE File Manager desktop client + 'Lynx/2.7.1 libwww-FM/2.14' Lynx command line browser + +COOKIES + + Cookies are generally used by web servers to keep state information at the + client's side. The server sets cookies by sending a response line in the + headers that looks like 'Set-Cookie: ' where the data part then + typically contains a set of NAME=VALUE pairs (separated by semicolons ';' + like "NAME1=VALUE1; NAME2=VALUE2;"). The server can also specify for what + path the "cookie" should be used for (by specifying "path=value"), when the + cookie should expire ("expire=DATE"), for what domain to use it + ("domain=NAME") and if it should be used on secure connections only + ("secure"). + + If you've received a page from a server that contains a header like: + Set-Cookie: sessionid=boo123; path="/foo"; + + it means the server wants that first pair passed on when we get anything in + a path beginning with "/foo". + + Example, get a page that wants my name passed in a cookie: + + curl -b "name=Daniel" www.sillypage.com + + Curl also has the ability to use previously received cookies in following + sessions. If you get cookies from a server and store them in a file in a + manner similar to: + + curl --dump-header headers www.example.com + + ... you can then in a second connect to that (or another) site, use the + cookies from the 'headers' file like: + + curl -b headers www.example.com + + While saving headers to a file is a working way to store cookies, it is + however error-prone and not the prefered way to do this. Instead, make curl + save the incoming cookies using the well-known netscape cookie format like + this: + + curl -c cookies.txt www.example.com + + Note that by specifying -b you enable the "cookie awareness" and with -L + you can make curl follow a location: (which often is used in combination + with cookies). So that if a site sends cookies and a location, you can + use a non-existing file to trigger the cookie awareness like: + + curl -L -b empty.txt www.example.com + + The file to read cookies from must be formatted using plain HTTP headers OR + as netscape's cookie file. Curl will determine what kind it is based on the + file contents. In the above command, curl will parse the header and store + the cookies received from www.example.com. curl will send to the server the + stored cookies which match the request as it follows the location. The + file "empty.txt" may be a non-existant file. + + Alas, to both read and write cookies from a netscape cookie file, you can + set both -b and -c to use the same file: + + curl -b cookies.txt -c cookies.txt www.example.com + +PROGRESS METER + + The progress meter exists to show a user that something actually is + happening. The different fields in the output have the following meaning: + + % Total % Received % Xferd Average Speed Time Curr. + Dload Upload Total Current Left Speed + 0 151M 0 38608 0 0 9406 0 4:41:43 0:00:04 4:41:39 9287 + + From left-to-right: + % - percentage completed of the whole transfer + Total - total size of the whole expected transfer + % - percentage completed of the download + Received - currently downloaded amount of bytes + % - percentage completed of the upload + Xferd - currently uploaded amount of bytes + Average Speed + Dload - the average transfer speed of the download + Average Speed + Upload - the average transfer speed of the upload + Time Total - expected time to complete the operation + Time Current - time passed since the invoke + Time Left - expected time left to completetion + Curr.Speed - the average transfer speed the last 5 seconds (the first + 5 seconds of a transfer is based on less time of course.) + + The -# option will display a totally different progress bar that doesn't + need much explanation! + +SPEED LIMIT + + Curl allows the user to set the transfer speed conditions that must be met + to let the transfer keep going. By using the switch -y and -Y you + can make curl abort transfers if the transfer speed is below the specified + lowest limit for a specified time. + + To have curl abort the download if the speed is slower than 3000 bytes per + second for 1 minute, run: + + curl -Y 3000 -y 60 www.far-away-site.com + + This can very well be used in combination with the overall time limit, so + that the above operatioin must be completed in whole within 30 minutes: + + curl -m 1800 -Y 3000 -y 60 www.far-away-site.com + + Forcing curl not to transfer data faster than a given rate is also possible, + which might be useful if you're using a limited bandwidth connection and you + don't want your transfer to use all of it (sometimes referred to as + "bandwith throttle"). + + Make curl transfer data no faster than 10 kilobytes per second: + + curl --limit-rate 10K www.far-away-site.com + + or + + curl --limit-rate 10240 www.far-away-site.com + + Or prevent curl from uploading data faster than 1 megabyte per second: + + curl -T upload --limit-rate 1M ftp://uploadshereplease.com + + When using the --limit-rate option, the transfer rate is regulated on a + per-second basis, which will cause the total transfer speed to become lower + than the given number. Sometimes of course substantially lower, if your + transfer stalls during periods. + +CONFIG FILE + + Curl automatically tries to read the .curlrc file (or _curlrc file on win32 + systems) from the user's home dir on startup. + + The config file could be made up with normal command line switches, but you + can also specify the long options without the dashes to make it more + readable. You can separate the options and the parameter with spaces, or + with = or :. Comments can be used within the file. If the first letter on a + line is a '#'-letter the rest of the line is treated as a comment. + + If you want the parameter to contain spaces, you must inclose the entire + parameter within double quotes ("). Within those quotes, you specify a + quote as \". + + NOTE: You must specify options and their arguments on the same line. + + Example, set default time out and proxy in a config file: + + # We want a 30 minute timeout: + -m 1800 + # ... and we use a proxy for all accesses: + proxy = proxy.our.domain.com:8080 + + White spaces ARE significant at the end of lines, but all white spaces + leading up to the first characters of each line are ignored. + + Prevent curl from reading the default file by using -q as the first command + line parameter, like: + + curl -q www.thatsite.com + + Force curl to get and display a local help page in case it is invoked + without URL by making a config file similar to: + + # default url to get + url = "http://help.with.curl.com/curlhelp.html" + + You can specify another config file to be read by using the -K/--config + flag. If you set config file name to "-" it'll read the config from stdin, + which can be handy if you want to hide options from being visible in process + tables etc: + + echo "user = user:passwd" | curl -K - http://that.secret.site.com + +EXTRA HEADERS + + When using curl in your own very special programs, you may end up needing + to pass on your own custom headers when getting a web page. You can do + this by using the -H flag. + + Example, send the header "X-you-and-me: yes" to the server when getting a + page: + + curl -H "X-you-and-me: yes" www.love.com + + This can also be useful in case you want curl to send a different text in a + header than it normally does. The -H header you specify then replaces the + header curl would normally send. If you replace an internal header with an + empty one, you prevent that header from being sent. To prevent the Host: + header from being used: + + curl -H "Host:" www.server.com + +FTP and PATH NAMES + + Do note that when getting files with the ftp:// URL, the given path is + relative the directory you enter. To get the file 'README' from your home + directory at your ftp site, do: + + curl ftp://user:passwd@my.site.com/README + + But if you want the README file from the root directory of that very same + site, you need to specify the absolute file name: + + curl ftp://user:passwd@my.site.com//README + + (I.e with an extra slash in front of the file name.) + +FTP and firewalls + + The FTP protocol requires one of the involved parties to open a second + connction as soon as data is about to get transfered. There are two ways to + do this. + + The default way for curl is to issue the PASV command which causes the + server to open another port and await another connection performed by the + client. This is good if the client is behind a firewall that don't allow + incoming connections. + + curl ftp.download.com + + If the server for example, is behind a firewall that don't allow connections + on other ports than 21 (or if it just doesn't support the PASV command), the + other way to do it is to use the PORT command and instruct the server to + connect to the client on the given (as parameters to the PORT command) IP + number and port. + + The -P flag to curl supports a few different options. Your machine may have + several IP-addresses and/or network interfaces and curl allows you to select + which of them to use. Default address can also be used: + + curl -P - ftp.download.com + + Download with PORT but use the IP address of our 'le0' interface (this does + not work on windows): + + curl -P le0 ftp.download.com + + Download with PORT but use 192.168.0.10 as our IP address to use: + + curl -P 192.168.0.10 ftp.download.com + +NETWORK INTERFACE + + Get a web page from a server using a specified port for the interface: + + curl --interface eth0:1 http://www.netscape.com/ + + or + + curl --interface 192.168.1.10 http://www.netscape.com/ + +HTTPS + + Secure HTTP requires SSL libraries to be installed and used when curl is + built. If that is done, curl is capable of retrieving and posting documents + using the HTTPS procotol. + + Example: + + curl https://www.secure-site.com + + Curl is also capable of using your personal certificates to get/post files + from sites that require valid certificates. The only drawback is that the + certificate needs to be in PEM-format. PEM is a standard and open format to + store certificates with, but it is not used by the most commonly used + browsers (Netscape and MSIE both use the so called PKCS#12 format). If you + want curl to use the certificates you use with your (favourite) browser, you + may need to download/compile a converter that can convert your browser's + formatted certificates to PEM formatted ones. This kind of converter is + included in recent versions of OpenSSL, and for older versions Dr Stephen + N. Henson has written a patch for SSLeay that adds this functionality. You + can get his patch (that requires an SSLeay installation) from his site at: + http://www.drh-consultancy.demon.co.uk/ + + Example on how to automatically retrieve a document using a certificate with + a personal password: + + curl -E /path/to/cert.pem:password https://secure.site.com/ + + If you neglect to specify the password on the command line, you will be + prompted for the correct password before any data can be received. + + Many older SSL-servers have problems with SSLv3 or TLS, that newer versions + of OpenSSL etc is using, therefore it is sometimes useful to specify what + SSL-version curl should use. Use -3, -2 or -1 to specify that exact SSL + version to use (for SSLv3, SSLv2 or TLSv1 respectively): + + curl -2 https://secure.site.com/ + + Otherwise, curl will first attempt to use v3 and then v2. + + To use OpenSSL to convert your favourite browser's certificate into a PEM + formatted one that curl can use, do something like this (assuming netscape, + but IE is likely to work similarly): + + You start with hitting the 'security' menu button in netscape. + + Select 'certificates->yours' and then pick a certificate in the list + + Press the 'export' button + + enter your PIN code for the certs + + select a proper place to save it + + Run the 'openssl' application to convert the certificate. If you cd to the + openssl installation, you can do it like: + + # ./apps/openssl pkcs12 -in [file you saved] -clcerts -out [PEMfile] + + +RESUMING FILE TRANSFERS + + To continue a file transfer where it was previously aborted, curl supports + resume on http(s) downloads as well as ftp uploads and downloads. + + Continue downloading a document: + + curl -C - -o file ftp://ftp.server.com/path/file + + Continue uploading a document(*1): + + curl -C - -T file ftp://ftp.server.com/path/file + + Continue downloading a document from a web server(*2): + + curl -C - -o file http://www.server.com/ + + (*1) = This requires that the ftp server supports the non-standard command + SIZE. If it doesn't, curl will say so. + + (*2) = This requires that the web server supports at least HTTP/1.1. If it + doesn't, curl will say so. + +TIME CONDITIONS + + HTTP allows a client to specify a time condition for the document it + requests. It is If-Modified-Since or If-Unmodified-Since. Curl allow you to + specify them with the -z/--time-cond flag. + + For example, you can easily make a download that only gets performed if the + remote file is newer than a local copy. It would be made like: + + curl -z local.html http://remote.server.com/remote.html + + Or you can download a file only if the local file is newer than the remote + one. Do this by prepending the date string with a '-', as in: + + curl -z -local.html http://remote.server.com/remote.html + + You can specify a "free text" date as condition. Tell curl to only download + the file if it was updated since yesterday: + + curl -z yesterday http://remote.server.com/remote.html + + Curl will then accept a wide range of date formats. You always make the date + check the other way around by prepending it with a dash '-'. + +DICT + + For fun try + + curl dict://dict.org/m:curl + curl dict://dict.org/d:heisenbug:jargon + curl dict://dict.org/d:daniel:web1913 + + Aliases for 'm' are 'match' and 'find', and aliases for 'd' are 'define' + and 'lookup'. For example, + + curl dict://dict.org/find:curl + + Commands that break the URL description of the RFC (but not the DICT + protocol) are + + curl dict://dict.org/show:db + curl dict://dict.org/show:strat + + Authentication is still missing (but this is not required by the RFC) + +LDAP + + If you have installed the OpenLDAP library, curl can take advantage of it + and offer ldap:// support. + + LDAP is a complex thing and writing an LDAP query is not an easy task. I do + advice you to dig up the syntax description for that elsewhere. Two places + that might suit you are: + + Netscape's "Netscape Directory SDK 3.0 for C Programmer's Guide Chapter 10: + Working with LDAP URLs": + http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm + + RFC 2255, "The LDAP URL Format" http://www.rfc-editor.org/rfc/rfc2255.txt + + To show you an example, this is now I can get all people from my local LDAP + server that has a certain sub-domain in their email address: + + curl -B "ldap://ldap.frontec.se/o=frontec??sub?mail=*sth.frontec.se" + + If I want the same info in HTML format, I can get it by not using the -B + (enforce ASCII) flag. + +ENVIRONMENT VARIABLES + + Curl reads and understands the following environment variables: + + http_proxy, HTTPS_PROXY, FTP_PROXY, GOPHER_PROXY + + They should be set for protocol-specific proxies. General proxy should be + set with + + ALL_PROXY + + A comma-separated list of host names that shouldn't go through any proxy is + set in (only an asterisk, '*' matches all hosts) + + NO_PROXY + + If a tail substring of the domain-path for a host matches one of these + strings, transactions with that node will not be proxied. + + + The usage of the -x/--proxy flag overrides the environment variables. + +NETRC + + Unix introduced the .netrc concept a long time ago. It is a way for a user + to specify name and password for commonly visited ftp sites in a file so + that you don't have to type them in each time you visit those sites. You + realize this is a big security risk if someone else gets hold of your + passwords, so therefor most unix programs won't read this file unless it is + only readable by yourself (curl doesn't care though). + + Curl supports .netrc files if told so (using the -n/--netrc and + --netrc-optional options). This is not restricted to only ftp, + but curl can use it for all protocols where authentication is used. + + A very simple .netrc file could look something like: + + machine curl.haxx.se login iamdaniel password mysecret + +CUSTOM OUTPUT + + To better allow script programmers to get to know about the progress of + curl, the -w/--write-out option was introduced. Using this, you can specify + what information from the previous transfer you want to extract. + + To display the amount of bytes downloaded together with some text and an + ending newline: + + curl -w 'We downloaded %{size_download} bytes\n' www.download.com + +KERBEROS4 FTP TRANSFER + + Curl supports kerberos4 for FTP transfers. You need the kerberos package + installed and used at curl build time for it to be used. + + First, get the krb-ticket the normal way, like with the kauth tool. Then use + curl in way similar to: + + curl --krb4 private ftp://krb4site.com -u username:fakepwd + + There's no use for a password on the -u switch, but a blank one will make + curl ask for one and you already entered the real password to kauth. + +TELNET + + The curl telnet support is basic and very easy to use. Curl passes all data + passed to it on stdin to the remote server. Connect to a remote telnet + server using a command line similar to: + + curl telnet://remote.server.com + + And enter the data to pass to the server on stdin. The result will be sent + to stdout or to the file you specify with -o. + + You might want the -N/--no-buffer option to switch off the buffered output + for slow connections or similar. + + Pass options to the telnet protocol negotiation, by using the -t option. To + tell the server we use a vt100 terminal, try something like: + + curl -tTTYPE=vt100 telnet://remote.server.com + + Other interesting options for it -t include: + + - XDISPLOC= Sets the X display location. + + - NEW_ENV= Sets an environment variable. + + NOTE: the telnet protocol does not specify any way to login with a specified + user and password so curl can't do that automatically. To do that, you need + to track when the login prompt is received and send the username and + password accordingly. + +PERSISTANT CONNECTIONS + + Specifying multiple files on a single command line will make curl transfer + all of them, one after the other in the specified order. + + libcurl will attempt to use persistant connections for the transfers so that + the second transfer to the same host can use the same connection that was + already initiated and was left open in the previous transfer. This greatly + decreases connection time for all but the first transfer and it makes a far + better use of the network. + + Note that curl cannot use persistant connections for transfers that are used + in subsequence curl invokes. Try to stuff as many URLs as possible on the + same command line if they are using the same host, as that'll make the + transfers faster. If you use a http proxy for file transfers, practicly + all transfers will be persistant. + + Persistant connections were introduced in curl 7.7. + +MAILING LISTS + + For your convenience, we have several open mailing lists to discuss curl, + its development and things relevant to this. Get all info at + http://curl.haxx.se/mail/. The lists available are: + + curl-users + + Users of the command line tool. How to use it, what doesn't work, new + features, related tools, questions, news, installations, compilations, + running, porting etc. + + curl-library + + Developers using or developing libcurl. Bugs, extensions, improvements. + + curl-announce + + Low-traffic. Only announcements of new public versions. + + curl-and-PHP + + Using the curl functions in PHP. Everything curl with a PHP angle. Or PHP + with a curl angle. + + curl-commits + + Receives notifications on all CVS commits done to the curl source module. + This can become quite a large amount of mails during intense development, + be aware. This is for us who like email... + + curl-www-commits + + Receives notifications on all CVS commits done to the curl www module + (basicly the web site). This can become quite a large amount of mails + during intense changing, be aware. This is for us who like email... + + Please direct curl questions, feature requests and trouble reports to one of + these mailing lists instead of mailing any individual. diff --git a/main/source/curl/docs/Makefile.am b/main/source/curl/docs/Makefile.am new file mode 100644 index 00000000..925d1419 --- /dev/null +++ b/main/source/curl/docs/Makefile.am @@ -0,0 +1,48 @@ +# +# $Id: Makefile.am,v 1.25 2003/02/26 13:46:38 bagder Exp $ +# + +AUTOMAKE_OPTIONS = foreign no-dependencies + +man_MANS = \ + curl.1 \ + curl-config.1 + +HTMLPAGES = \ + curl.html \ + curl-config.html \ + index.html + +PDFPAGES = \ + curl.pdf \ + curl-config.pdf + +SUBDIRS = examples libcurl + +EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS \ + README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS \ + VERSIONS KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) \ + HISTORY INSTALL libcurl-the-guide $(PDFPAGES) + +MAN2HTML= gnroff -man $< | man2html >$@ + +SUFFIXES = .1 .3 .html .pdf + +html: $(HTMLPAGES) + cd libcurl; make html + +.3.html: + $(MAN2HTML) + +.1.html: + $(MAN2HTML) + +MAN2PDF = groff -Tps -man curl.1 $< >$@ + +pdf: + for file in $(man_MANS); do \ + foo=`echo $$file | sed -e 's/\.[0-9]$$//g'`; \ + groff -Tps -man $$file >$$foo.ps; \ + ps2pdf $$foo.ps $$foo.pdf; \ + done + cd libcurl; make pdf diff --git a/main/source/curl/docs/Makefile.in b/main/source/curl/docs/Makefile.in new file mode 100644 index 00000000..69d60147 --- /dev/null +++ b/main/source/curl/docs/Makefile.in @@ -0,0 +1,565 @@ +# Makefile.in generated by automake 1.7.2 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# $Id: Makefile.am,v 1.25 2003/02/26 13:46:38 bagder Exp $ +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ +CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ +CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ +CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ +CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ +CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ +CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ +CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +HAVE_LIBZ = @HAVE_LIBZ@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +IPV6_ENABLED = @IPV6_ENABLED@ +KRB4_ENABLED = @KRB4_ENABLED@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +NO_UNDEFINED_FALSE = @NO_UNDEFINED_FALSE@ +NO_UNDEFINED_TRUE = @NO_UNDEFINED_TRUE@ +NROFF = @NROFF@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_ENABLED = @OPENSSL_ENABLED@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKGADD_NAME = @PKGADD_NAME@ +PKGADD_PKG = @PKGADD_PKG@ +PKGADD_VENDOR = @PKGADD_VENDOR@ +PKGCONFIG = @PKGCONFIG@ +RANDOM_FILE = @RANDOM_FILE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +VERSIONNUM = @VERSIONNUM@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +AUTOMAKE_OPTIONS = foreign no-dependencies + +man_MANS = \ + curl.1 \ + curl-config.1 + + +HTMLPAGES = \ + curl.html \ + curl-config.html \ + index.html + + +PDFPAGES = \ + curl.pdf \ + curl-config.pdf + + +SUBDIRS = examples libcurl + +EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS \ + README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS \ + VERSIONS KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) \ + HISTORY INSTALL libcurl-the-guide $(PDFPAGES) + + +MAN2HTML = gnroff -man $< | man2html >$@ + +SUFFIXES = .1 .3 .html .pdf + +MAN2PDF = groff -Tps -man curl.1 $< >$@ +subdir = docs +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/lib/config.h \ + $(top_builddir)/src/config.h \ + $(top_builddir)/tests/server/config.h \ + $(top_builddir)/lib/ca-bundle.h +CONFIG_CLEAN_FILES = +depcomp = +am__depfiles_maybe = +DIST_SOURCES = +MANS = $(man_MANS) + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = INSTALL Makefile.am Makefile.in THANKS TODO +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .1 .3 .html .pdf +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign docs/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +man1dir = $(mandir)/man1 +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(MANS) +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: install-man + +install-exec-am: + +install-info: install-info-recursive + +install-man: install-man1 + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am uninstall-man + +uninstall-info: uninstall-info-recursive + +uninstall-man: uninstall-man1 + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-man1 install-recursive install-strip installcheck \ + installcheck-am installdirs installdirs-am \ + installdirs-recursive maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ + pdf-recursive ps ps-am ps-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-man uninstall-man1 \ + uninstall-recursive + + +html: $(HTMLPAGES) + cd libcurl; make html + +.3.html: + $(MAN2HTML) + +.1.html: + $(MAN2HTML) + +pdf: + for file in $(man_MANS); do \ + foo=`echo $$file | sed -e 's/\.[0-9]$$//g'`; \ + groff -Tps -man $$file >$$foo.ps; \ + ps2pdf $$foo.ps $$foo.pdf; \ + done + cd libcurl; make pdf +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/main/source/curl/docs/README.win32 b/main/source/curl/docs/README.win32 new file mode 100644 index 00000000..74275124 --- /dev/null +++ b/main/source/curl/docs/README.win32 @@ -0,0 +1,22 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + +README.win32 + + Read the README file first. + + Curl has been compiled, built and run on all sorts of Windows and win32 + systems. While not being the main develop target, a fair share of curl users + are win32-based. + + The unix-style man pages are tricky to read on windows, so therefore are all + those pages also converted to HTML and those are also included in the + release archives. + + The main curl.1 man page is also "built-in" in the command line tool. Use a + command line similar to this in order to extract a separate text file: + + curl -M >manual.txt diff --git a/main/source/curl/docs/RESOURCES b/main/source/curl/docs/RESOURCES new file mode 100644 index 00000000..a33720d3 --- /dev/null +++ b/main/source/curl/docs/RESOURCES @@ -0,0 +1,124 @@ + _ _ ____ _ + Project ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + + +This document lists documents that specify standards used by curl, software +that extends curl, web pages with similar utilities and information pages that +describe some of the tools that we use to build/compile/develop curl. + +Standards +--------- + + RFC 959 - Defines how FTP works + + RFC 1635 - How to Use Anonymous FTP + + RFC 1738 - Uniform Resource Locators + + RFC 1777 - defines the LDAP protocol + + RFC 1808 - Relative Uniform Resource Locators + + RFC 1867 - Form-based File Upload in HTML + + RFC 1950 - ZLIB Compressed Data Format Specification + + RFC 1951 - DEFLATE Compressed Data Format Specification + + RFC 1952 - gzip compression format + + RFC 1959 - LDAP URL syntax + + RFC 2045-2049 - Everything you need to know about MIME! (needed for form + based upload) + + RFC 2068 - HTTP 1.1 (obsoleted by RFC 2616) + + RFC 2109 - HTTP State Management Mechanism (cookie stuff) + - Also, read Netscape's specification at + http://curl.haxx.se/rfc/cookie_spec.html + + RFC 2183 - The Content-Disposition Header Field + + RFC 2229 - A Dictionary Server Protocol + + RFC 2255 - Newer LDAP URL syntax document. + + RFC 2231 - MIME Parameter Value and Encoded Word Extensions: + Character Sets, Languages, and Continuations + + RFC 2388 - "Returning Values from Forms: multipart/form-data" + Use this as an addition to the RFC1867 + + RFC 2396 - "Uniform Resource Identifiers: Generic Syntax and Semantics" This + one obsoletes RFC 1738, but since RFC 1738 is often mentioned + I've left it in this list. + + RFC 2428 - FTP Extensions for IPv6 and NATs + + RFC 2577 - FTP Security Considerations + + RFC 2616 - HTTP 1.1, the latest + + RFC 2617 - HTTP Authentication + + RFC 2718 - Guidelines for new URL Schemes + + RFC 2732 - Format for Literal IPv6 Addresses in URL's + + RFC 2818 - HTTP Over TLS (TLS is the successor to SSL) + + RFC 2964 - Use of HTTP State Management + + RFC 2965 - HTTP State Management Mechanism. Cookies. Obsoletes RFC2109 + +Compilers +--------- + MingW32 - http://www.mingw.org/ + + gcc - http://www.gnu.org/software/gcc/gcc.html + +Software +-------- + OpenSSL - http://www.openssl.org/ + + OpenLDAP - http://www.openldap.org/ + + zlib - http://www.cdrom.com/pub/infozip/zlib/ + +Similar Tools +------------- + wget - http://sunsite.dk/wget/ + + snarf - http://www.xach.com/snarf/ + + lynx - http://lynx.browser.org/ (well at least when -dump is used) + + swebget - http://www.uni-hildesheim.de/~smol0075/swebget/ + + Kermit - http://www.columbia.edu/kermit/ftpclient + + Pavuk - http://www.idata.sk/~ondrej/pavuk/ + + httpr - http://zwolak.dhs.org/httpr/ + + puf - http://www.inf.tu-dresden.de/~ob6/sw/puf.html + +Related Software +---------------- + ftpparse - http://cr.yp.to/ftpparse.html parses FTP LIST responses + + autoconf - http://www.gnu.org/software/autoconf/autoconf.html + + automake - http://www.gnu.org/software/automake/automake.html + + bison - http://www.gnu.org/software/bison/bison.html + + gzip - http://www.gnu.org/software/gzip/gzip.html + + tar - http://www.gnu.org/software/tar/tar.html + + libtool - http://www.gnu.org/software/libtool/libtool.html diff --git a/main/source/curl/docs/THANKS b/main/source/curl/docs/THANKS new file mode 100644 index 00000000..5099af3b --- /dev/null +++ b/main/source/curl/docs/THANKS @@ -0,0 +1,92 @@ +This project has been alive for several years. Countless people have provided +feedback that have improved curl. Here follows a (incomplete) list of people +that have contributed with non-trivial parts: + + - Daniel Stenberg + - Rafael Sagula + - Sampo Kellomaki + - Linas Vepstas + - Bjorn Reese + - Johan Anderson + - Kjell Ericson + - Troy Engel + - Ryan Nelson + - Björn Stenberg + - Angus Mackay + - Eric Young + - Simon Dick + - Oren Tirosh + - Steven G. Johnson + - Gilbert Ramirez Jr. + - Andrés García + - Douglas E. Wegscheid + - Mark Butler + - Eric Thelin + - Marc Boucher + - Greg Onufer + - Doug Kaufman + - David Eriksson + - Ralph Beckmann + - T. Yamada + - Lars J. Aas + - Jörn Hartroth + - Matthew Clarke + - Linus Nielsen Feltzing + - Felix von Leitner + - Dan Zitter + - Jongki Suwandi + - Chris Maltby + - Ron Zapp + - Paul Marquis + - Ellis Pritchard + - Damien Adant + - Chris + - Marco G. Salvagno + - Paul Marquis + - David LeBlanc + - Rich Gray at Plus Technologies + - Luong Dinh Dung + - Torsten Foertsch + - Kristian Köhntopp + - Fred Noz + - Caolan McNamara + - Albert Chin-A-Young + - Stephen Kick + - Martin Hedenfalk + - Richard Prescott + - Jason S. Priebe + - T. Bharath + - Alexander Kourakos + - James Griffiths + - Loic Dachary + - Robert Weaver + - Ingo Ralf Blum + - Jun-ichiro itojun Hagino + - Frederic Lepied + - Georg Horn + - Cris Bailiff + - Sterling Hughes + - S. Moonesamy + - Ingo Wilken + - Pawel A. Gajda + - Patrick Bihan-Faou + - Nico Baggus + - Sergio Ballestrero + - Andrew Francis + - Tomasz Lacki + - Georg Huettenegger + - John Lask + - Eric Lavigne + - Marcus Webster + - Götz Babin-Ebell + - Andreas Damm + - Jacky Lam + - James Gallagher + - Kjetil Jacobsen + - Markus F.X.J. Oberhumer + - Miklos Nemeth + - Kevin Roth + - Ralph Mitchell + - Dan Fandrich + - Jean-Philippe Barrette-LaPierre + - Richard Bramante diff --git a/main/source/curl/docs/TODO b/main/source/curl/docs/TODO new file mode 100644 index 00000000..e024b0dc --- /dev/null +++ b/main/source/curl/docs/TODO @@ -0,0 +1,228 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + +TODO + + Things to do in project cURL. Please tell us what you think, contribute and + send us patches that improve things! Also check the http://curl.haxx.se/dev + web section for various technical development notes. + + LIBCURL + + * Introduce an interface to libcurl that allows applications to easier get to + know what cookies that are received. Pushing interface that calls a + callback on each received cookie? Querying interface that asks about + existing cookies? We probably need both. Enable applications to modify + existing cookies as well. + + * Make content encoding/decoding internally be made using a filter system. + + * Introduce another callback interface for upload/download that makes one + less copy of data and thus a faster operation. + [http://curl.haxx.se/dev/no_copy_callbacks.txt] + + * Add asynchronous name resolving (http://libdenise.sf.net/). This should be + made to work on most of the supported platforms, or otherwise it isn't + really interesting. + + * Data sharing. Tell which easy handles within a multi handle that should + share cookies, connection cache, dns cache, ssl session cache. Full + suggestion found here: http://curl.haxx.se/dev/sharing.txt + + * Mutexes. By adding mutex callback support, the 'data sharing' mentioned + above can be made between several easy handles running in different threads + too. The actual mutex implementations will be left for the application to + implement, libcurl will merely call 'getmutex' and 'leavemutex' callbacks. + Part of the sharing suggestion at: http://curl.haxx.se/dev/sharing.txt + + * Set the SO_KEEPALIVE socket option to make libcurl notice and disconnect + very long time idle connections. + + * Go through the code and verify that libcurl deals with big files >2GB and + >4GB all over. Bug reports (and source reviews) indicate that it doesn't + currently work properly. + + * CURLOPT_MAXFILESIZE. Prevent downloads that are larger than the specified + size. CURLE_FILESIZE_EXCEEDED would then be returned. Gautam Mani + requested. That is, the download should not even begin but be aborted + immediately. + + * Allow the http_proxy (and other) environment variables to contain user and + password as well in the style: http://proxyuser:proxypasswd@proxy:port + Berend Reitsma suggested. + + LIBCURL - multi interface + + * Make sure we don't ever loop because of non-blocking sockets return + EWOULDBLOCK or similar. This FTP command sending, the SSL connection etc. + + * Make transfers treated more carefully. We need a way to tell libcurl we + have data to write, as the current system expects us to upload data each + time the socket is writable and there is no way to say that we want to + upload data soon just not right now, without that aborting the upload. The + opposite situation should be possible as well, that we tell libcurl we're + ready to accept read data. Today libcurl feeds the data as soon as it is + available for reading, no matter what. + + DOCUMENTATION + + * More and better + + FTP + + * Make CURLOPT_FTPPORT support an additional port number on the IP/if/name, + like "blabla:[port]" or possibly even "blabla:[portfirst]-[portsecond]". + + * FTP ASCII upload does not follow RFC959 section 3.1.1.1: "The sender + converts the data from an internal character representation to the standard + 8-bit NVT-ASCII representation (see the Telnet specification). The + receiver will convert the data from the standard form to his own internal + form." + + * Since USERPWD always override the user and password specified in URLs, we + might need another way to specify user+password for anonymous ftp logins. + + * An option to only download remote FTP files if they're newer than the local + one is a good idea, and it would fit right into the same syntax as the + already working http dito works (-z). It of course requires that 'MDTM' + works, and it isn't a standard FTP command. + + * Add FTPS support with SSL for the data connection too. This should be made + according to the specs written in draft-murray-auth-ftp-ssl-08.txt, + "Securing FTP with TLS" + + * --disable-epsv exists, but for active connections we have no --disable-eprt + (or even --disable-lprt). + + HTTP + + * If the "body" of the POST is < MSS it really aught to be sent along with + the headers. More generally, if the last chunk of the POST body is < MSS, + it should be sent with the previous chunk (which may be the POST headers). + So long as any one send is larger than MSS (or there is only one send when + < MSS :), the Nagle Algorithm will not be a problem on any stack where + Nagle is implemented correctly. (pointed out by Rick Jones) + + * Authentication: NTLM. Support for that MS crap called NTLM + authentication. MS proxies and servers sometime require that. Since that + protocol is a proprietary one, it involves reverse engineering and network + sniffing. This should however be a library-based functionality. There are a + few different efforts "out there" to make open source HTTP clients support + this and it should be possible to take advantage of other people's hard + work. http://modntlm.sourceforge.net/ is one. There's a web page at + http://www.innovation.ch/java/ntlm.html that contains detailed reverse- + engineered info. + + * RFC2617 compliance, "Digest Access Authentication" A valid test page seem + to exist at: http://hopf.math.nwu.edu/testpage/digest/ And some friendly + person's server source code is available at + http://hopf.math.nwu.edu/digestauth/index.html Then there's the Apache + mod_digest source code too of course. It seems as if Netscape doesn't + support this, and not many servers do. Although this is a lot better + authentication method than the more common "Basic". Basic sends the + password in cleartext over the network, this "Digest" method uses a + challange-response protocol which increases security quite a lot. + + * Pipelining. Sending multiple requests before the previous one(s) are done. + This could possibly be implemented using the multi interface to queue + requests and the response data. + + TELNET + + * Make TELNET work on windows98! + + * Reading input (to send to the remote server) on stdin is a crappy solution + for library purposes. We need to invent a good way for the application to + be able to provide the data to send. + + * Move the telnet support's network select() loop go away and merge the code + into the main transfer loop. Until this is done, the multi interface won't + work for telnet. + + SSL + + * If you really want to improve the SSL situation, you should probably have a + look at SSL cafile loading as well - quick traces look to me like these are + done on every request as well, when they should only be necessary once per + ssl context (or once per handle). Even better would be to support the SSL + CAdir option - instead of loading all of the root CA certs for every + request, this option allows you to only read the CA chain that is actually + required (into the cache)... + + * Add an interface to libcurl that enables "session IDs" to get + exported/imported. Cris Bailiff said: "OpenSSL has functions which can + serialise the current SSL state to a buffer of your choice, and + recover/reset the state from such a buffer at a later date - this is used + by mod_ssl for apache to implement and SSL session ID cache". This whole + idea might become moot if we enable the 'data sharing' as mentioned in the + LIBCURL label above. + + * OpenSSL supports a callback for customised verification of the peer + certificate, but this doesn't seem to be exposed in the libcurl APIs. Could + it be? There's so much that could be done if it were! (brought by Chris + Clark) + + * Make curl's SSL layer option capable of using other free SSL libraries. + Such as the Mozilla Security Services + (http://www.mozilla.org/projects/security/pki/nss/) and GNUTLS + (http://gnutls.hellug.gr/) + + LDAP + + * Look over the implementation. The looping will have to "go away" from the + lib/ldap.c source file and get moved to the main network code so that the + multi interface and friends will work for LDAP as well. + + CLIENT + + * Add an option that prevents cURL from overwiting existing local files. When + used, and there already is an existing file with the target file name + (either -O or -o), a number should be appended (and increased if already + existing). So that index.html becomes first index.html.1 and then + index.html.2 etc. Jeff Pohlmeyer suggested. + + * "curl ftp://site.com/*.txt" + + * Several URLs can be specified to get downloaded. We should be able to use + the same syntax to specify several files to get uploaded (using the same + persistant connection), using -T. + + * When the multi interface has been implemented and proved to work, the + client could be told to use maximum N simultaneous transfers and then just + make sure that happens. It should of course not make more than one + connection to the same remote host. + + * Extending the capabilities of the multipart formposting. How about leaving + the ';type=foo' syntax as it is and adding an extra tag (headers) which + works like this: curl -F "coolfiles=@fil1.txt;headers=@fil1.hdr" where + fil1.hdr contains extra headers like + + Content-Type: text/plain; charset=KOI8-R" + Content-Transfer-Encoding: base64 + X-User-Comment: Please don't use browser specific HTML code + + which should overwrite the program reasonable defaults (plain/text, + 8bit...) (Idea brough to us by kromJx) + + TEST SUITE + + * If perl wasn't found by the configure script, don't attempt to run the + tests but explain something nice why it doesn't. + + * Extend the test suite to include more protocols. The telnet could just do + ftp or http operations (for which we have test servers). + + * Make the test suite work on more platforms. OpenBSD and Mac OS. Remove + fork()s and it should become even more portable. + + * Introduce a test suite that tests libcurl better and more explicitly. + +NEXT MAJOR RELEASE + + * curl_easy_cleanup() returns void, but curl_multi_cleanup() returns a + CURLMcode. These should be changed to be the same. + + * curl_formparse() should be removed diff --git a/main/source/curl/docs/TheArtOfHttpScripting b/main/source/curl/docs/TheArtOfHttpScripting new file mode 100644 index 00000000..4f82a8ef --- /dev/null +++ b/main/source/curl/docs/TheArtOfHttpScripting @@ -0,0 +1,378 @@ +Online: http://curl.haxx.se/docs/httpscripting.shtml +Author: Daniel Stenberg +Date: October 31, 2001 +Version: 0.5 + + The Art Of Scripting HTTP Requests Using Curl + ============================================= + + This document will assume that you're familiar with HTML and general + networking. + + The possibility to write scripts is essential to make a good computer + system. Unix' capability to be extended by shell scripts and various tools to + run various automated commands and scripts is one reason why it has succeeded + so well. + + The increasing amount of applications moving to the web has made "HTTP + Scripting" more frequently requested and wanted. To be able to automatically + extract information from the web, to fake users, to post or upload data to + web servers are all important tasks today. + + Curl is a command line tool for doing all sorts of URL manipulations and + transfers, but this particular document will focus on how to use it when + doing HTTP requests for fun and profit. I'll assume that you know how to + invoke 'curl --help' or 'curl --manual' to get basic information about it. + + Curl is not written to do everything for you. It makes the requests, it gets + the data, it sends data and it retrieves the information. You probably need + to glue everything together using some kind of script language or repeated + manual invokes. + +1. The HTTP Protocol + + HTTP is the protocol used to fetch data from web servers. It is a very simple + protocol that is built upon TCP/IP. The protocol also allows information to + get sent to the server from the client using a few different methods, as will + be shown here. + + HTTP is plain ASCII text lines being sent by the client to a server to + request a particular action, and then the server replies a few text lines + before the actual requested content is sent to the client. + + Using curl's option -v will display what kind of commands curl sends to the + server, as well as a few other informational texts. -v is the single most + useful option when it comes to debug or even understand the curl<->server + interaction. + +2. URL + + The Uniform Resource Locator format is how you specify the address of a + particular resource on the Internet. You know these, you've seen URLs like + http://curl.haxx.se or https://yourbank.com a million times. + +3. GET a page + + The simplest and most common request/operation made using HTTP is to get a + URL. The URL could itself refer to a web page, an image or a file. The client + issues a GET request to the server and receives the document it asked for. + If you issue the command line + + curl http://curl.haxx.se + + you get a web page returned in your terminal window. The entire HTML document + that that URL holds. + + All HTTP replies contain a set of headers that are normally hidden, use + curl's -i option to display them as well as the rest of the document. You can + also ask the remote server for ONLY the headers by using the -I option. + +4. Forms + + Forms are the general way a web site can present a HTML page with fields for + the user to enter data in, and then press some kind of 'OK' or 'submit' + button to get that data sent to the server. The server then typically uses + the posted data to decide how to act. Like using the entered words to search + in a database, or to add the info in a bug track system, display the entered + address on a map or using the info as a login-prompt verifying that the user + is allowed to see what it is about to see. + + Of course there has to be some kind of program in the server end to receive + the data you send. You cannot just invent something out of the air. + + 4.1 GET + + A GET-form uses the method GET, as specified in HTML like: + +
+ + +
+ + In your favorite browser, this form will appear with a text box to fill in + and a press-button labeled "OK". If you fill in '1905' and press the OK + button, your browser will then create a new URL to get for you. The URL will + get "junk.cgi?birthyear=1905&press=OK" appended to the path part of the + previous URL. + + If the original form was seen on the page "www.hotmail.com/when/birth.html", + the second page you'll get will become + "www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK". + + Most search engines work this way. + + To make curl do the GET form post for you, just enter the expected created + URL: + + curl "www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK" + + 4.2 POST + + The GET method makes all input field names get displayed in the URL field of + your browser. That's generally a good thing when you want to be able to + bookmark that page with your given data, but it is an obvious disadvantage + if you entered secret information in one of the fields or if there are a + large amount of fields creating a very long and unreadable URL. + + The HTTP protocol then offers the POST method. This way the client sends the + data separated from the URL and thus you won't see any of it in the URL + address field. + + The form would look very similar to the previous one: + +
+ + +
+ + And to use curl to post this form with the same data filled in as before, we + could do it like: + + curl -d "birthyear=1905&press=OK" www.hotmail.com/when/junk.cgi + + This kind of POST will use the Content-Type + application/x-www-form-urlencoded and is the most widely used POST kind. + + 4.3 FILE UPLOAD POST + + Back in late 1995 they defined a new way to post data over HTTP. It was + documented in the RFC 1867, why this method sometimes is referred to as + a RFC1867-posting. + + This method is mainly designed to better support file uploads. A form that + allows a user to upload a file could be written like this in HTML: + +
+ + +
+ + This clearly shows that the Content-Type about to be sent is + multipart/form-data. + + To post to a form like this with curl, you enter a command line like: + + curl -F upload=@localfilename -F press=OK [URL] + + 4.4 HIDDEN FIELDS + + A very common way for HTML based application to pass state information + between pages is to add hidden fields to the forms. Hidden fields are + already filled in, they aren't displayed to the user and they get passed + along just as all the other fields. + + A similar example form with one visible field, one hidden field and one + submit button could look like: + +
+ + + +
+ + To post this with curl, you won't have to think about if the fields are + hidden or not. To curl they're all the same: + + curl -d "birthyear=1905&press=OK&person=daniel" [URL] + + 4.5 FIGURE OUT WHAT A POST LOOKS LIKE + + When you're about fill in a form and send to a server by using curl instead + of a browser, you're of course very interested in sending a POST exactly the + way your browser does. + + An easy way to get to see this, is to save the HTML page with the form on + your local disk, modify the 'method' to a GET, and press the submit button + (you could also change the action URL if you want to). + + You will then clearly see the data get appended to the URL, separated with a + '?'-letter as GET forms are supposed to. + +5. PUT + + The perhaps best way to upload data to a HTTP server is to use PUT. Then + again, this of course requires that someone put a program or script on the + server end that knows how to receive a HTTP PUT stream. + + Put a file to a HTTP server with curl: + + curl -T uploadfile www.uploadhttp.com/receive.cgi + +6. AUTHENTICATION + + Authentication is the ability to tell the server your username and password + so that it can verify that you're allowed to do the request you're doing. The + basic authentication used in HTTP is *plain* *text* based, which means it + sends username and password only slightly obfuscated, but still fully + readable by anyone that sniffs on the network between you and the remote + server. + + To tell curl to use a user and password for authentication: + + curl -u name:password www.secrets.com + + Sometimes your HTTP access is only available through the use of a HTTP + proxy. This seems to be especially common at various companies. A HTTP proxy + may require its own user and password to allow the client to get through to + the Internet. To specify those with curl, run something like: + + curl -U proxyuser:proxypassword curl.haxx.se + + If you use any one these user+password options but leave out the password + part, curl will prompt for the password interactively. + + Do note that when a program is run, its parameters are possible to see when + listing the running processes of the system. Thus, other users may be able to + watch your passwords if you pass them as plain command line options. There + are ways to circumvent this. + +7. REFERER + + A HTTP request may include a 'referer' field, which can be used to tell from + which URL the client got to this particular resource. Some programs/scripts + check the referer field of requests to verify that this wasn't arriving from + an external site or an unknown page. While this is a stupid way to check + something so easily forged, many scripts still do it. Using curl, you can put + anything you want in the referer-field and thus more easily be able to fool + the server into serving your request. + + Use curl to set the referer field with: + + curl -e http://curl.haxx.se daniel.haxx.se + +8. USER AGENT + + Very similar to the referer field, all HTTP requests may set the User-Agent + field. It names what user agent (client) that is being used. Many + applications use this information to decide how to display pages. Silly web + programmers try to make different pages for users of different browsers to + make them look the best possible for their particular browsers. They usually + also do different kinds of javascript, vbscript etc. + + At times, you will see that getting a page with curl will not return the same + page that you see when getting the page with your browser. Then you know it + is time to set the User Agent field to fool the server into thinking you're + one of those browsers. + + To make curl look like Internet Explorer on a Windows 2000 box: + + curl -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" [URL] + + Or why not look like you're using Netscape 4.73 on a Linux (PIII) box: + + curl -A "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" [URL] + +9. REDIRECTS + + When a resource is requested from a server, the reply from the server may + include a hint about where the browser should go next to find this page, or a + new page keeping newly generated output. The header that tells the browser + to redirect is Location:. + + Curl does not follow Location: headers by default, but will simply display + such pages in the same manner it display all HTTP replies. It does however + feature an option that will make it attempt to follow the Location: pointers. + + To tell curl to follow a Location: + + curl -L www.sitethatredirects.com + + If you use curl to POST to a site that immediately redirects you to another + page, you can safely use -L and -d/-F together. Curl will only use POST in + the first request, and then revert to GET in the following operations. + +10. COOKIES + + The way the web browsers do "client side state control" is by using + cookies. Cookies are just names with associated contents. The cookies are + sent to the client by the server. The server tells the client for what path + and host name it wants the cookie sent back, and it also sends an expiration + date and a few more properties. + + When a client communicates with a server with a name and path as previously + specified in a received cookie, the client sends back the cookies and their + contents to the server, unless of course they are expired. + + Many applications and servers use this method to connect a series of requests + into a single logical session. To be able to use curl in such occasions, we + must be able to record and send back cookies the way the web application + expects them. The same way browsers deal with them. + + The simplest way to send a few cookies to the server when getting a page with + curl is to add them on the command line like: + + curl -b "name=Daniel" www.cookiesite.com + + Cookies are sent as common HTTP headers. This is practical as it allows curl + to record cookies simply by recording headers. Record cookies with curl by + using the -D option like: + + curl -D headers_and_cookies www.cookiesite.com + + Curl has a full blown cookie parsing engine built-in that comes to use if you + want to reconnect to a server and use cookies that were stored from a + previous connection (or handicrafted manually to fool the server into + believing you had a previous connection). To use previously stored cookies, + you run curl like: + + curl -b stored_cookies_in_file www.cookiesite.com + + Curl's "cookie engine" gets enabled when you use the -b option. If you only + want curl to understand received cookies, use -b with a file that doesn't + exist. Example, if you want to let curl understand cookies from a page and + follow a location (and thus possibly send back cookies it received), you can + invoke it like: + + curl -b nada -L www.cookiesite.com + + Curl has the ability to read and write cookie files that use the same file + format that Netscape and Mozilla do. It is a convenient way to share cookies + between browsers and automatic scripts. The -b switch automatically detects + if a given file is such a cookie file and parses it, and by using the + -c/--cookie-jar option you'll make curl write a new cookie file at the end of + an operation: + + curl -b cookies.txt -c newcookies.txt www.cookiesite.com + +11. HTTPS + + There are a few ways to do secure HTTP transfers. The by far most common + protocol for doing this is what is generally known as HTTPS, HTTP over + SSL. SSL encrypts all the data that is sent and received over the network and + thus makes it harder for attackers to spy on sensitive information. + + SSL (or TLS as the latest version of the standard is called) offers a + truckload of advanced features to allow all those encryptions and key + infrastructure mechanisms encrypted HTTP requires. + + Curl supports encrypted fetches thanks to the freely available OpenSSL + libraries. To get a page from a HTTPS server, simply run curl like: + + curl https://that.secure.server.com + + 11.1 CERTIFICATES + + In the HTTPS world, you use certificates to validate that you are the one + you you claim to be, as an addition to normal passwords. Curl supports + client-side certificates. All certificates are locked with a PIN-code, why + you need to enter the unlock-code before the certificate can be used by + curl. The PIN-code can be specified on the command line or if not, entered + interactively when curl queries for it. Use a certificate with curl on a + HTTPS server like: + + curl -E mycert.pem https://that.secure.server.com + +12. REFERENCES + + RFC 2616 is a must to read if you want in-depth understanding of the HTTP + protocol. + + RFC 2396 explains the URL syntax. + + RFC 2109 defines how cookies are supposed to work. + + RFC 1867 defines the HTTP post upload format. + + http://www.openssl.org is the home of the OpenSSL project + + http://curl.haxx.se is the home of the cURL project diff --git a/main/source/curl/docs/VERSIONS b/main/source/curl/docs/VERSIONS new file mode 100644 index 00000000..48be6719 --- /dev/null +++ b/main/source/curl/docs/VERSIONS @@ -0,0 +1,64 @@ + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + +Version Numbers and Releases + + Curl is not only curl. Curl is also libcurl. They're actually individually + versioned, but they mostly follow each other rather closely. + + The version numbering is always built up using the same system: + + X.Y[.Z][-preN] + + Where + X is main version number + Y is release number + Z is patch number + N is pre-release number + + One of these numbers will get bumped in each new release. The numbers to the + right of a bumped number will be reset to zero. If Z is zero, it is not + included in the version number. The pre release number is only included in + pre releases (they're never used in public, official, releases). + + The main version number will get bumped when *really* big, world colliding + changes are made. The release number is bumped when big changes are + performed. The patch number is bumped when the changes are mere bugfixes and + only minor feature changes. The pre-release is a counter, to identify which + pre-release a certain release is. + + When reaching the end of a pre-release period, the version without the + pre-release part will be released as a public release. + + It means that after release 1.2.3, we can release 2.0 if something really big + has been made, 1.3 if not that big changes were made or 1.2.4 if mostly bugs + were fixed. Before 1.2.4 is released, we might release a 1.2.4-pre1 release + for the brave people to try before the actual release. + + Bumping, as in increasing the number with 1, is unconditionally only + affecting one of the numbers (except the ones to the right of it, that may be + set to zero). 1 becomes 2, 3 becomes 4, 9 becomes 10, 88 becomes 89 and 99 + becomes 100. So, after 1.2.9 comes 1.2.10. After 3.99.3, 3.100 might come. + + All original curl source release archives are named according to the libcurl + version (not according to the curl client version that, as said before, might + differ). + + As a service to any application that might want to support new libcurl + features while still being able to build with older versions, all releases + have the libcurl version stored in the curl/curl.h file using a static + numbering scheme that can be used for comparison. The version number is + defined as: + + #define LIBCURL_VERSION_NUM 0xXXYYZZ + + Where XX, YY and ZZ are the main version, release and patch numbers in + hexadecimal. All three numbers are always represented using two digits. 1.2 + would appear as "0x010200" while version 9.11.7 appears as "0x090b07". + + This 6-digit hexadecimal number does not show pre-release number, and it is + always a greater number in a more recent release. It makes comparisons with + greater than and less than work. diff --git a/main/source/curl/docs/curl-config.1 b/main/source/curl/docs/curl-config.1 new file mode 100644 index 00000000..921f05bd --- /dev/null +++ b/main/source/curl/docs/curl-config.1 @@ -0,0 +1,64 @@ +.\" You can view this file with: +.\" nroff -man curl-config.1 +.\" Written by Daniel Stenberg +.\" +.TH curl-config 1 "8 Oct 2002" "Curl 7.10" "curl-config manual" +.SH NAME +curl-config \- Get information about a libcurl installation +.SH SYNOPSIS +.B curl-config [options] +.SH DESCRIPTION +.B curl-config +displays information about a previous curl and libcurl installation. +.SH OPTIONS +.IP "--ca" +Displays the built-in path to the CA cert bundle this libcurl uses. +.IP "--cc" +Displays the compiler used to build libcurl. +.IP "--cflags" +Set of compiler options (CFLAGS) to use when compiling files that use +libcurl. Currently that is only thw include path to the curl include files. +.IP "--feature" +Lists what particular main features the installed libcurl was built with. At +the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume +any particular order. The keywords will be separated by newlines. There may be +none, one or several keywords in the list. +.IP "--help" +Displays the available options. +.IP "--libs" +Shows the complete set of libs and other linker options you will need in order +to link your application with libcurl. +.IP "--prefix" +This is the prefix used when libcurl was installed. Libcurl is then installed +in $prefix/lib and its header files are installed in $prefix/include and so +on. The prefix is set with "configure --prefix". +.IP "--version" +Outputs version information about the installed libcurl. +.IP "--vernum" +Outputs version information about the installed libcurl, in numerical mode. +This outputs the version number, in hexadecimal, with 8 bits for each part; +major, minor, patch. So that libcurl 7.7.4 would appear as 070704 and libcurl +12.13.14 would appear as 0c0d0e... +.SH "EXAMPLES" +What linker options do I need when I link with libcurl? + + $ curl-config --libs + +What compiler options do I need when I compile using libcurl functions? + + $ curl-config --cflags + +How do I know if libcurl was built with SSL support? + + $ curl-config --feature | grep SSL + +What's the installed libcurl version? + + $ curl-config --version + +How do I build a single file with a one-line command? + + $ `curl-config --cc --cflags --libs` -o example example.c + +.SH "SEE ALSO" +.BR curl (1) diff --git a/main/source/curl/docs/curl-config.html b/main/source/curl/docs/curl-config.html new file mode 100644 index 00000000..eacdd0b6 --- /dev/null +++ b/main/source/curl/docs/curl-config.html @@ -0,0 +1,124 @@ + + +
+
+       curl-config - Get information about a libcurl installation
+
+
+
+

SYNOPSIS

+       curl-config [options]
+
+
+
+

DESCRIPTION

+       curl-config displays information about a previous curl and
+       libcurl installation.
+
+
+
+

OPTIONS

+       --ca   Displays  the  built-in  path to the CA cert bundle
+              this libcurl uses.
+
+       --cc   Displays the compiler used to build libcurl.
+
+       --cflags
+              Set of compiler options (CFLAGS) to use  when  com-
+              piling  files  that  use libcurl. Currently that is
+              only thw include path to the curl include files.
+
+       --feature
+              Lists what particular main features  the  installed
+              libcurl  was  built  with.  At the time of writing,
+              this list may include SSL, KRB4  or  IPv6.  Do  not
+              assume  any  particular order. The keywords will be
+              separated by newlines. There may be  none,  one  or
+              several keywords in the list.
+
+       --help Displays the available options.
+
+       --libs Shows  the  complete  set  of libs and other linker
+              options you will need in order to link your  appli-
+              cation with libcurl.
+
+       --prefix
+              This is the prefix used when libcurl was installed.
+              Libcurl is then installed in  $prefix/lib  and  its
+              header  files  are installed in $prefix/include and
+              so on. The prefix is set with "configure --prefix".
+
+       --version
+              Outputs  version  information  about  the installed
+              libcurl.
+
+       --vernum
+              Outputs version  information  about  the  installed
+              libcurl,  in numerical mode.  This outputs the ver-
+              sion number, in hexadecimal, with 8 bits  for  each
+              part;  major,  minor,  patch. So that libcurl 7.7.4
+              would appear as 070704 and libcurl  12.13.14  would
+              appear as 0c0d0e...
+
+       What linker options do I need when I link with libcurl?
+
+         $ curl-config --libs
+
+       What  compiler  options  do  I  need  when I compile using
+       libcurl functions?
+
+         $ curl-config --cflags
+
+       How do I know if libcurl was built with SSL support?
+
+         $ curl-config --feature | grep SSL
+
+       What's the installed libcurl version?
+
+         $ curl-config --version
+
+       How do I build a single file with a one-line command?
+
+         $ `curl-config --cc --cflags --libs`  -o  example  exam-
+       ple.c
+
+
+
+
+

SEE ALSO

+       curl(1)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/main/source/curl/docs/curl-config.pdf b/main/source/curl/docs/curl-config.pdf new file mode 100644 index 00000000..c84fb9e2 Binary files /dev/null and b/main/source/curl/docs/curl-config.pdf differ diff --git a/main/source/curl/docs/curl.1 b/main/source/curl/docs/curl.1 new file mode 100644 index 00000000..a72f3818 --- /dev/null +++ b/main/source/curl/docs/curl.1 @@ -0,0 +1,959 @@ +.\" You can view this file with: +.\" nroff -man curl.1 +.\" Written by Daniel Stenberg +.\" +.TH curl 1 "14 Feb 2003" "Curl 7.10.3" "Curl Manual" +.SH NAME +curl \- transfer a URL +.SH SYNOPSIS +.B curl [options] +.I [URL...] +.SH DESCRIPTION +.B curl +is a client to get documents/files from or send documents to a server, using +any of the supported protocols (HTTP, HTTPS, FTP, GOPHER, DICT, TELNET, LDAP +or FILE). The command is designed to work without user interaction or any kind +of interactivity. + +curl offers a busload of useful tricks like proxy support, user +authentication, ftp upload, HTTP post, SSL (https:) connections, cookies, file +transfer resume and more. +.SH URL +The URL syntax is protocol dependent. You'll find a detailed description in +RFC 2396. + +You can specify multiple URLs or parts of URLs by writing part sets within +braces as in: + + http://site.{one,two,three}.com + +or you can get sequences of alphanumeric series by using [] as in: + + ftp://ftp.numericals.com/file[1-100].txt + ftp://ftp.numericals.com/file[001-100].txt (with leading zeros) + ftp://ftp.letters.com/file[a-z].txt + +It is possible to specify up to 9 sets or series for a URL, but no nesting is +supported at the moment: + + http://www.any.org/archive[1996-1999]/volume[1-4]part{a,b,c,index}.html + +You can specify any amount of URLs on the command line. They will be fetched +in a sequential manner in the specified order. + +Curl will attempt to re-use connections for multiple file transfers, so that +getting many files from the same server will not do multiple connects / +handshakes. This improves speed. Of course this is only done on files +specified on a single command line and cannot be used between separate curl +invokes. +.SH OPTIONS +.IP "-a/--append" +(FTP) +When used in a ftp upload, this will tell curl to append to the target +file instead of overwriting it. If the file doesn't exist, it will +be created. + +If this option is used twice, the second one will disable append mode again. +.IP "-A/--user-agent " +(HTTP) +Specify the User-Agent string to send to the HTTP server. Some badly done CGIs +fail if its not set to "Mozilla/4.0". To encode blanks in the string, +surround the string with single quote marks. This can also be set with the +-H/--header flag of course. + +If this option is set more than once, the last one will be the one that's +used. +.IP "-b/--cookie " +(HTTP) +Pass the data to the HTTP server as a cookie. It is supposedly the +data previously received from the server in a "Set-Cookie:" line. +The data should be in the format "NAME1=VALUE1; NAME2=VALUE2". + +If no '=' letter is used in the line, it is treated as a filename to use to +read previously stored cookie lines from, which should be used in this session +if they match. Using this method also activates the "cookie parser" which will +make curl record incoming cookies too, which may be handy if you're using this +in combination with the -L/--location option. The file format of the file to +read cookies from should be plain HTTP headers or the Netscape/Mozilla cookie +file format. + +.B NOTE +that the file specified with -b/--cookie is only used as input. No cookies +will be stored in the file. To store cookies, save the HTTP headers to a file +using -D/--dump-header! + +If this option is set more than once, the last one will be the one that's +used. +.IP "-B/--use-ascii" +Use ASCII transfer when getting an FTP file or LDAP info. For FTP, this can +also be enforced by using an URL that ends with ";type=A". This option causes +data sent to stdout to be in text mode for win32 systems. + +If this option is used twice, the second one will disable ASCII usage. +.IP "--ciphers " +(SSL) Specifies which ciphers to use in the connection. The list of ciphers +must be using valid ciphers. Read up on SSL cipher list details on this URL: +.I http://www.openssl.org/docs/apps/ciphers.html (Option added in curl 7.9) + +If this option is used several times, the last one will override the others. +.IP "--compressed" +(HTTP) Request a compressed response using the deflate or gzip +algorithms and return the uncompressed document. If this option is used +and the server sends an unsupported encoding, Curl will report an error. +.IP "--connect-timeout " +Maximum time in seconds that you allow the connection to the server to take. +This only limits the connection phase, once curl has connected this option is +of no more use. See also the \fI--max-time\fP option. + +If this option is used several times, the last one will be used. +.IP "-c/--cookie-jar " +Specify to which file you want curl to write all cookies after a completed +operation. Curl writes all cookies previously read from a specified file as +well as all cookies received from remote server(s). If no cookies are known, +no file will be written. The file will be written using the Netscape cookie +file format. If you set the file name to a single dash, "-", the cookies will +be written to stdout. (Option added in curl 7.9) + +.B NOTE +If the cookie jar can't be created or written to, the whole curl operation +won't fail or even report an error clearly. Using -v will get a warning +displayed, but that is the only visible feedback you get about this possibly +lethal situation. + +If this option is used several times, the last specfied file name will be +used. +.IP "-C/--continue-at " +Continue/Resume a previous file transfer at the given offset. The given offset +is the exact number of bytes that will be skipped counted from the beginning +of the source file before it is transfered to the destination. If used with +uploads, the ftp server command SIZE will not be used by curl. + +Use "-C -" to tell curl to automatically find out where/how to resume the +transfer. It then uses the given output/input files to figure that out. + +If this option is used several times, the last one will be used. +.IP "--create-dirs" +When used in conjunction with the -o option, curl will create the necessary +local directory hierarchy as needed. +.IP "--crlf" +(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390). + +If this option is used twice, the second will again disable crlf converting. +.IP "-d/--data " +(HTTP) Sends the specified data in a POST request to the HTTP server, in a way +that can emulate as if a user has filled in a HTML form and pressed the submit +button. Note that the data is sent exactly as specified with no extra +processing (with all newlines cut off). The data is expected to be +"url-encoded". This will cause curl to pass the data to the server using the +content-type application/x-www-form-urlencoded. Compare to -F. If more than +one -d/--data option is used on the same command line, the data pieces +specified will be merged together with a separating &-letter. Thus, using '-d +name=daniel -d skill=lousy' would generate a post chunk that looks like +\&'name=daniel&skill=lousy'. + +If you start the data with the letter @, the rest should be a file name to +read the data from, or - if you want curl to read the data from stdin. The +contents of the file must already be url-encoded. Multiple files can also be +specified. Posting data from a file named 'foobar' would thus be done with +"--data @foobar". + +To post data purely binary, you should instead use the --data-binary option. + +-d/--data is the same as --data-ascii. + +If this option is used several times, the ones following the first will +append data. +.IP "--data-ascii " +(HTTP) This is an alias for the -d/--data option. + +If this option is used several times, the ones following the first will +append data. +.IP "--data-binary " +(HTTP) This posts data in a similar manner as --data-ascii does, although when +using this option the entire context of the posted data is kept as-is. If you +want to post a binary file without the strip-newlines feature of the +--data-ascii option, this is for you. + +If this option is used several times, the ones following the first will +append data. +.IP "--disable-epsv" +(FTP) Tell curl to disable the use of the EPSV command when doing passive FTP +downloads. Curl will normally always first attempt to use EPSV before PASV, +but with this option, it will not try using EPSV. + +If this option is used several times, each occurrence will toggle this on/off. +.IP "-D/--dump-header " +Write the protocol headers to the specified file. + +This option is handy to use when you want to store the cookies that a HTTP +site sends to you. The cookies could then be read in a second curl invoke by +using the -b/--cookie option! + +When used on FTP, the ftp server response lines are considered being "headers" +and thus are saved there. + +If this option is used several times, the last one will be used. +.IP "-e/--referer " +(HTTP) Sends the "Referer Page" information to the HTTP server. This can also +be set with the -H/--header flag of course. When used with +.I -L/--location +you can append ";auto" to the referer URL to make curl automatically set the +previous URL when it follows a Location: header. The ";auto" string can be +used alone, even if you don't set an initial referer. + +If this option is used several times, the last one will be used. +.IP "--environment" +(RISC OS ONLY) Sets a range of environment variables, using the names the -w +option supports, to easier allow extraction of useful information after having +run curl. + +If this option is used several times, each occurrence will toggle this on/off. +.IP "--egd-file " +(HTTPS) Specify the path name to the Entropy Gathering Daemon socket. The +socket is used to seed the random engine for SSL connections. See also the +.I "--random-file" +option. +.IP "-E/--cert " +(HTTPS) +Tells curl to use the specified certificate file when getting a file +with HTTPS. The certificate must be in PEM format. +If the optional password isn't specified, it will be queried for on +the terminal. Note that this certificate is the private key and the private +certificate concatenated! + +If this option is used several times, the last one will be used. +.IP "--cacert " +(HTTPS) Tells curl to use the specified certificate file to verify the +peer. The file may contain multiple CA certificates. The certificate(s) must +be in PEM format. + +curl recognizes the environment variable named 'CURL_CA_BUNDLE' if that is +set, and uses the given path as a path to a CA cert bundle. This option +overrides that variable. + +The windows version of curl will automatically look for a CA certs file named +\'curl-ca-bundle.crt\', either in the same directory as curl.exe, or in the +Current Working Directory, or in any folder along your PATH. + +If this option is used several times, the last one will be used. +.IP "--capath " +(HTTPS) Tells curl to use the specified certificate directory to verify the +peer. The certificates must be in PEM format, and the directory must have been +processed using the c_rehash utility supplied with openssl. Using --capath can +allow curl to make https connections much more efficiently than using --cacert +if the --cacert file contains many CA certificates. + +If this option is used several times, the last one will be used. +.IP "-f/--fail" +(HTTP) Fail silently (no output at all) on server errors. This is mostly done +like this to better enable scripts etc to better deal with failed attempts. In +normal cases when a HTTP server fails to deliver a document, it returns a HTML +document stating so (which often also describes why and more). This flag will +prevent curl from outputting that and fail silently instead. + +If this option is used twice, the second will again disable silent failure. +.IP "-F/--form " +(HTTP) This lets curl emulate a filled in form in which a user has pressed the +submit button. This causes curl to POST data using the content-type +multipart/form-data according to RFC1867. This enables uploading of binary +files etc. To force the 'content' part to be be a file, prefix the file name +with an @ sign. To just get the content part from a file, prefix the file name +with the letter <. The difference between @ and < is then that @ makes a file +get attached in the post as a file upload, while the < makes a text field and +just get the contents for that text field from a file. + +Example, to send your password file to the server, where +\&'password' is the name of the form-field to which /etc/passwd will be the +input: + +\fBcurl\fP -F password=@/etc/passwd www.mypasswords.com + +To read the file's content from stdin insted of a file, use - where the file +name should've been. This goes for both @ and < constructs. + +You can also tell curl what Content-Type to use for the file upload part, by +using 'type=', in a manner similar to: + +\fBcurl\fP -F "web=@index.html;type=text/html" url.com + +See further examples and details in the MANUAL. + +This option can be used multiple times. +.IP "-g/--globoff" +This option switches off the "URL globbing parser". When you set this option, +you can specify URLs that contain the letters {}[] without having them being +interpreted by curl itself. Note that these letters are not normal legal URL +contents but they should be encoded according to the URI standard. +.IP "-G/--get" +When used, this option will make all data specified with -d/--data or +--data-binary to be used in a HTTP GET request instead of the POST request +that otherwise would be used. The data will be appended to the URL with a '?' +separator. (Option added in curl 7.9) + +If used in combination with -I, the POST data will instead be appended to the +URL with a HEAD request. + +If used multiple times, nothing special happens. +.IP "-h/--help" +Usage help. +.IP "-H/--header
" +(HTTP) Extra header to use when getting a web page. You may specify any number +of extra headers. Note that if you should add a custom header that has the +same name as one of the internal ones curl would use, your externally set +header will be used instead of the internal one. This allows you to make even +trickier stuff than curl would normally do. You should not replace internally +set headers without knowing perfectly well what you're doing. Replacing an +internal header with one without content on the right side of the colon will +prevent that header from appearing. + +This option can be used multiple times to add/replace/remove multiple headers. +.IP "-i/--include" +(HTTP) +Include the HTTP-header in the output. The HTTP-header includes things +like server-name, date of the document, HTTP-version and more... + +If this option is used twice, the second will again disable header include. +.IP "--interface " +Perform an operation using a specified interface. You can enter interface +name, IP address or host name. An example could look like: + +.B "curl --interface eth0:1 http://www.netscape.com/" + +If this option is used several times, the last one will be used. +.IP "-I/--head" +(HTTP/FTP) +Fetch the HTTP-header only! HTTP-servers feature the command HEAD +which this uses to get nothing but the header of a document. When used +on a FTP file, curl displays the file size only. + +If this option is used twice, the second will again disable header only. +.IP "-j/--junk-session-cookies" +(HTTP) When curl is told to read cookies from a given file, this option will +make it discard all "session cookies". This will basicly have the same effect +as if a new session is started. Typical browsers always discard session +cookies when they're closed down. (Added in 7.9.7) + +If this option is used several times, each occurrence will toggle this on/off. +.IP "-k/--insecure" +(SSL) This option explicitly allows curl to perform "insecure" SSL connections +and transfers. Starting with curl 7.10, all SSL connections will be attempted +to be made secure by using the CA certificate bundle installed by +default. This makes all connections considered "insecure" to fail unless +-k/--insecure is used. + +This option is ignored if --cacert or --capath is used! + +If this option is used twice, the second time will again disable it. +.IP "--krb4 " +(FTP) Enable kerberos4 authentication and use. The level must be entered and +should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use +a level that is not one of these, 'private' will instead be used. + +If this option is used several times, the last one will be used. +.IP "-K/--config " +Specify which config file to read curl arguments from. The config file is a +text file in which command line arguments can be written which then will be +used as if they were written on the actual command line. Options and their +parameters must be specified on the same config file line. If the parameter is +to contain white spaces, the parameter must be inclosed within quotes. If the +first column of a config line is a '#' character, the rest of the line will be +treated as a comment. + +Specify the filename as '-' to make curl read the file from stdin. + +Note that to be able to specify a URL in the config file, you need to specify +it using the --url option, and not by simply writing the URL on its own +line. So, it could look similar to this: + +url = "http://curl.haxx.se/docs/" + +This option can be used multiple times. +.IP "--limit-rate " +Specify the maximum transfer rate you want curl to use. This feature is useful +if you have a limited pipe and you'd like your transfer not use your entire +bandwidth. + +The given speed is measured in bytes/second, unless a suffix is +appended. Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' +makes it megabytes while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and +1G. + +This option was introduced in curl 7.10. + +If this option is used several times, the last one will be used. +.IP "-l/--list-only" +(FTP) +When listing an FTP directory, this switch forces a name-only view. +Especially useful if you want to machine-parse the contents of an FTP +directory since the normal directory view doesn't use a standard look +or format. + +This option causes an FTP NLST command to be sent. Some FTP servers +list only files in their response to NLST; they do not include +subdirectories and symbolic links. + +If this option is used twice, the second will again disable list only. +.IP "-L/--location" +(HTTP/HTTPS) If the server reports that the requested page has a different +location (indicated with the header line Location:) this flag will let curl +attempt to reattempt the get on the new place. If used together with -i or -I, +headers from all requested pages will be shown. If this flag is used when +making a HTTP POST, curl will automatically switch to GET after the initial +POST has been done. + +If this option is used twice, the second will again disable location following. +.IP "-m/--max-time " +Maximum time in seconds that you allow the whole operation to take. This is +useful for preventing your batch jobs from hanging for hours due to slow +networks or links going down. This doesn't work fully in win32 systems. See +also the \fI--connect-timeout\fP option. + +If this option is used several times, the last one will be used. +.IP "-M/--manual" +Manual. Display the huge help text. +.IP "-n/--netrc" +Makes curl scan the +.I .netrc +file in the user's home directory for login name and password. This is +typically used for ftp on unix. If used with http, curl will enable user +authentication. See +.BR netrc(4) +or +.BR ftp(1) +for details on the file format. Curl will not complain if that file +hasn't the right permissions (it should not be world nor group +readable). The environment variable "HOME" is used to find the home +directory. + +A quick and very simple example of how to setup a +.I .netrc +to allow curl to ftp to the machine host.domain.com with user name +\&'myself' and password 'secret' should look similar to: + +.B "machine host.domain.com login myself password secret" + +If this option is used twice, the second will again disable netrc usage. +.IP "-N/--no-buffer" +Disables the buffering of the output stream. In normal work situations, curl +will use a standard buffered output stream that will have the effect that it +will output the data in chunks, not necessarily exactly when the data arrives. +Using this option will disable that buffering. + +If this option is used twice, the second will again switch on buffering. +.IP "-o/--output " +Write output to instead of stdout. If you are using {} or [] to fetch +multiple documents, you can use '#' followed by a number in the +specifier. That variable will be replaced with the current string for the URL +being fetched. Like in: + + curl http://{one,two}.site.com -o "file_#1.txt" + +or use several variables like: + + curl http://{site,host}.host[1-5].com -o "#1_#2" + +You may use this option as many times as you have number of URLs. + +See also the --create-dirs option to create the local directories dynamically. +.IP "-O/--remote-name" +Write output to a local file named like the remote file we get. (Only +the file part of the remote file is used, the path is cut off.) + +You may use this option as many times as you have number of URLs. +.IP "-p/--proxytunnel" +When an HTTP proxy is used, this option will cause non-HTTP protocols to +attempt to tunnel through the proxy instead of merely using it to do HTTP-like +operations. The tunnel approach is made with the HTTP proxy CONNECT request +and requires that the proxy allows direct connect to the remote port number +curl wants to tunnel through to. + +If this option is used twice, the second will again disable proxy tunnel. +.IP "-P/--ftpport
" +(FTP) +Reverses the initiator/listener roles when connecting with ftp. This +switch makes Curl use the PORT command instead of PASV. In +practice, PORT tells the server to connect to the client's specified +address and port, while PASV asks the server for an ip address and +port to connect to.
should be one of: +.RS +.TP 12 +.B interface +i.e "eth0" to specify which interface's IP address you want to use (Unix only) +.TP +.B "IP address" +i.e "192.168.10.1" to specify exact IP number +.TP +.B "host name" +i.e "my.host.domain" to specify machine +.TP +.B "-" +(any single-letter string) to make it pick the machine's default +.RE + +If this option is used several times, the last one will be used. +.IP "-q" +If used as the first parameter on the command line, the +.I $HOME/.curlrc +file will not be read and used as a config file. +.IP "-Q/--quote " +(FTP) Send an arbitrary command to the remote FTP server, by using the QUOTE +command of the server. Not all servers support this command, and the set of +QUOTE commands are server specific! Quote commands are sent BEFORE the +transfer is taking place. To make commands take place after a successful +transfer, prefix them with a dash '-'. You may specify any amount of commands +to be run before and after the transfer. If the server returns failure for one +of the commands, the entire operation will be aborted. + +This option can be used multiple times. +.IP "--random-file " +(HTTPS) Specify the path name to file containing what will be considered as +random data. The data is used to seed the random engine for SSL connections. +See also the +.I "--edg-file" +option. +.IP "-r/--range " +(HTTP/FTP) +Retrieve a byte range (i.e a partial document) from a HTTP/1.1 or FTP +server. Ranges can be specified in a number of ways. +.RS +.TP 10 +.B 0-499 +specifies the first 500 bytes +.TP +.B 500-999 +specifies the second 500 bytes +.TP +.B -500 +specifies the last 500 bytes +.TP +.B 9500 +specifies the bytes from offset 9500 and forward +.TP +.B 0-0,-1 +specifies the first and last byte only(*)(H) +.TP +.B 500-700,600-799 +specifies 300 bytes from offset 500(H) +.TP +.B 100-199,500-599 +specifies two separate 100 bytes ranges(*)(H) +.RE + +(*) = NOTE that this will cause the server to reply with a multipart +response! + +You should also be aware that many HTTP/1.1 servers do not have this feature +enabled, so that when you attempt to get a range, you'll instead get the whole +document. + +FTP range downloads only support the simple syntax 'start-stop' (optionally +with one of the numbers omitted). It depends on the non-RFC command SIZE. + +If this option is used several times, the last one will be used. +.IP "-R/--remote-time" +When used, this will make libcurl attempt to figure out the timestamp of the +remote file, and if that is available make the local file get that same +timestamp. + +If this option is used twice, the second time disables this again. +.IP "-s/--silent" +Silent mode. Don't show progress meter or error messages. Makes +Curl mute. + +If this option is used twice, the second will again disable mute. +.IP "-S/--show-error" +When used with -s it makes curl show error message if it fails. + +If this option is used twice, the second will again disable show error. +.IP "--stderr " +Redirect all writes to stderr to the specified file instead. If the file name +is a plain '-', it is instead written to stdout. This option has no point when +you're using a shell with decent redirecting capabilities. + +If this option is used several times, the last one will be used. +.IP "-t/--telnet-option " +Pass options to the telnet protocol. Supported options are: + +TTYPE= Sets the terminal type. + +XDISPLOC= Sets the X display location. + +NEW_ENV= Sets an environment variable. +.IP "-T/--upload-file " +This transfers the specified local file to the remote URL. If there is no file +part in the specified URL, Curl will append the local file name. NOTE that you +must use a trailing / on the last directory to really prove to Curl that there +is no file name or curl will think that your last directory name is the remote +file name to use. That will most likely cause the upload operation to fail. If +this is used on a http(s) server, the PUT command will be used. + +Use the file name "-" (a single dash) to use stdin instead of a given file. + +If this option is used several times, the last one will be used. +.IP "--trace " +Enables a full trace dump of all incoming and outgoing data, including +descriptive information, to the given output file. Use "-" as filename to have +the output sent to stdout. + +If this option is used several times, the last one will be used. (Added in +curl 7.9.7) +.IP "--trace-ascii " +Enables a full trace dump of all incoming and outgoing data, including +descriptive information, to the given output file. Use "-" as filename to have +the output sent to stdout. + +This is very similar to --trace, but leaves out the hex part and only shows +the ASCII part of the dump. It makes smaller output that might be easier to +read for untrained humans. + +If this option is used several times, the last one will be used. (Added in +curl 7.9.7) +.IP "-u/--user " +Specify user and password to use when fetching. Read the MANUAL for detailed +examples of how to use this. If no password is specified, curl will ask for it +interactively. + +If this option is used several times, the last one will be used. +.IP "-U/--proxy-user " +Specify user and password to use for Proxy authentication. If no +password is specified, curl will ask for it interactively. + +If this option is used several times, the last one will be used. +.IP "--url " +Specify a URL to fetch. This option is mostly handy when you want to specify +URL(s) in a config file. + +This option may be used any number of times. To control where this URL is written, use the +.I -o +or the +.I -O +options. +.IP "-v/--verbose" +Makes the fetching more verbose/talkative. Mostly usable for debugging. Lines +starting with '>' means data sent by curl, '<' means data received by curl +that is hidden in normal cases and lines starting with '*' means additional +info provided by curl. + +Note that if you want to see HTTP headers in the output, \fI-i/--include\fP +might be option you're looking for. + +If you think this option still doesn't give you enough details, consider using +\fI--trace\fP or \fI--trace-ascii\fP instead. + +If this option is used twice, the second will again disable verbose. +.IP "-V/--version" +Displays the full version of curl, libcurl and other 3rd party libraries +linked with the executable. +.IP "-w/--write-out " +Defines what to display after a completed and successful operation. The format +is a string that may contain plain text mixed with any number of variables. The +string can be specified as "string", to get read from a particular file you +specify it "@filename" and to tell curl to read the format from stdin you +write "@-". + +The variables present in the output format will be substituted by the value or +text that curl thinks fit, as described below. All variables are specified +like %{variable_name} and to output a normal % you just write them like +%%. You can output a newline by using \\n, a carriage return with \\r and a tab +space with \\t. + +.B NOTE: +The %-letter is a special letter in the win32-environment, where all +occurrences of % must be doubled when using this option. + +Available variables are at this point: +.RS +.TP 15 +.B url_effective +The URL that was fetched last. This is mostly meaningful if you've told curl +to follow location: headers. +.TP +.B http_code +The numerical code that was found in the last retrieved HTTP(S) page. +.TP +.B time_total +The total time, in seconds, that the full operation lasted. The time will be +displayed with millisecond resolution. +.TP +.B time_namelookup +The time, in seconds, it took from the start until the name resolving was +completed. +.TP +.B time_connect +The time, in seconds, it took from the start until the connect to the remote +host (or proxy) was completed. +.TP +.B time_pretransfer +The time, in seconds, it took from the start until the file transfer is just +about to begin. This includes all pre-transfer commands and negotiations that +are specific to the particular protocol(s) involved. +.TP +.B time_starttransfer +The time, in seconds, it took from the start until the first byte is just about +to be transfered. This includes time_pretransfer and also the time the +server needs to calculate the result. +.TP +.B size_download +The total amount of bytes that were downloaded. +.TP +.B size_upload +The total amount of bytes that were uploaded. +.TP +.B size_header +The total amount of bytes of the downloaded headers. +.TP +.B size_request +The total amount of bytes that were sent in the HTTP request. +.TP +.B speed_download +The average download speed that curl measured for the complete download. +.TP +.B speed_upload +The average upload speed that curl measured for the complete upload. +.TP +.B content_type +The Content-Type of the requested document, if there was any. (Added in 7.9.5) +.RE + +If this option is used several times, the last one will be used. +.IP "-x/--proxy " +Use specified HTTP proxy. If the port number is not specified, it is assumed +at port 1080. + +This option overrides existing environment variables that sets proxy to +use. If there's an environment variable setting a proxy, you can set proxy to +"" to override it. + +\fBNote\fP that all operations that are performed over a HTTP proxy will +transparantly be converted to HTTP. It means that certain protocol specific +operations might not be available. This is not the case if you can tunnel +through the proxy, as done with the \fI-p/--proxytunnel\fP option. + +If this option is used several times, the last one will be used. +.IP "-X/--request " +(HTTP) +Specifies a custom request to use when communicating with the HTTP server. +The specified request will be used instead of the standard GET. Read the +HTTP 1.1 specification for details and explanations. + +(FTP) +Specifies a custom FTP command to use instead of LIST when doing file lists +with ftp. + +If this option is used several times, the last one will be used. +.IP "-y/--speed-time