mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-12-24 23:04:51 +01:00
Uploading full engine sources
This commit is contained in:
parent
4b8c6df082
commit
9d8b787be2
271
Controls/00-Default.ctl
Normal file
271
Controls/00-Default.ctl
Normal file
|
@ -0,0 +1,271 @@
|
|||
Button
|
||||
Name: TTRS Move Forward
|
||||
Key1: W
|
||||
Key2: Arrow Up
|
||||
Pressed: ctl_bMoveForward = 1;
|
||||
Released: ctl_bMoveForward = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Move Backward
|
||||
Key1: S
|
||||
Key2: Arrow Down
|
||||
Pressed: ctl_bMoveBackward = 1;
|
||||
Released: ctl_bMoveBackward = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: A
|
||||
Key2: Q
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: D
|
||||
Key2: E
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Up/Jump
|
||||
Key1: Space
|
||||
Key2: R
|
||||
Pressed: ctl_bMoveUp = 1;
|
||||
Released: ctl_bMoveUp = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Down/Duck
|
||||
Key1: F
|
||||
Key2: C
|
||||
Pressed: ctl_bMoveDown = 1;
|
||||
Released: ctl_bMoveDown = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Turn Left
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnLeft = 1;
|
||||
Released: ctl_bTurnLeft = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Turn Right
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnRight = 1;
|
||||
Released: ctl_bTurnRight = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Look Up
|
||||
Key1: Mouse Button 4
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnUp = 1;
|
||||
Released: ctl_bTurnUp = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Look Down
|
||||
Key1: Mouse Button 5
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnDown = 1;
|
||||
Released: ctl_bTurnDown = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Center View
|
||||
Key1: Home
|
||||
Key2: None
|
||||
Pressed: ctl_bCenterView = 1;
|
||||
Released: ctl_bCenterView = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Walk
|
||||
Key1: Left Shift
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ctl_bWalk = !ctl_bWalk;
|
||||
|
||||
Button
|
||||
Name: TTRS Walk/Run Toggle
|
||||
Key1: Caps Lock
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ;
|
||||
|
||||
Button
|
||||
Name: TTRS Strafe
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bStrafe = 1;
|
||||
Released: ctl_bStrafe = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Fire
|
||||
Key1: Mouse Button 1
|
||||
Key2: Left Control
|
||||
Pressed: ctl_bFire = 1;
|
||||
Released: ctl_bFire = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Reload
|
||||
Key1: Left Alt
|
||||
Key2: None
|
||||
Pressed: ctl_bReload = 1;
|
||||
Released: ctl_bReload = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS 3rd Person View
|
||||
Key1: H
|
||||
Key2: None
|
||||
Pressed: ctl_b3rdPersonView = 1;
|
||||
Released: ctl_b3rdPersonView = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Use/Invoke NETRICSA/Sniper Zoom
|
||||
Key1: Mouse Button 2
|
||||
Key2: Enter
|
||||
Pressed: ctl_bUseOrComputer = 1;
|
||||
Released: ctl_bUseOrComputer = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Use/Sniper Zoom
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bUse = 1;
|
||||
Released: ctl_bUse = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Invoke NETRICSA
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bComputer = 1;
|
||||
Released: ctl_bComputer = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Talk
|
||||
Key1: T
|
||||
Key2: None
|
||||
Pressed: con_bTalk=1;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Previous Weapon
|
||||
Key1: Mouse Wheel Up
|
||||
Key2: [
|
||||
Pressed: ctl_bWeaponPrev = 1;
|
||||
Released: ctl_bWeaponPrev = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Next Weapon
|
||||
Key1: Mouse Wheel Down
|
||||
Key2: ]
|
||||
Pressed: ctl_bWeaponNext = 1;
|
||||
Released: ctl_bWeaponNext = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Flip Weapon
|
||||
Key1: Mouse Button 3
|
||||
Key2: None
|
||||
Pressed: ctl_bWeaponFlip = 1;
|
||||
Released: ctl_bWeaponFlip = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Knife/Chainsaw
|
||||
Key1: 1
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[1] = 1;
|
||||
Released: ctl_bSelectWeapon[1] = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Colt/Two Colts
|
||||
Key1: 2
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[2] = 1;
|
||||
Released: ctl_bSelectWeapon[2] = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Single/Double Shotgun
|
||||
Key1: 3
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[3] = 1;
|
||||
Released: ctl_bSelectWeapon[3] = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Tommygun/Minigun
|
||||
Key1: 4
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[4] = 1;
|
||||
Released: ctl_bSelectWeapon[4] = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Rocket Launcher/Grenade Launcher
|
||||
Key1: 5
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[5] = 1;
|
||||
Released: ctl_bSelectWeapon[5] = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Flamethrower/Sniper
|
||||
Key1: 6
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[6] = 1;
|
||||
Released: ctl_bSelectWeapon[6] = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Laser
|
||||
Key1: 7
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[7] = 1;
|
||||
Released: ctl_bSelectWeapon[7] = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Cannon
|
||||
Key1: 8
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[8] = 1;
|
||||
Released: ctl_bSelectWeapon[8] = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Serious Bomb
|
||||
Key1: 0
|
||||
Key2: None
|
||||
Pressed: ctl_bFireBomb = 1;
|
||||
Released: ctl_bFireBomb = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: Arrow Left
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: Arrow Right
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Sniper Zoom +
|
||||
Key1: X
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomIn = 1;
|
||||
Released: ctl_bSniperZoomIn = 0;
|
||||
|
||||
Button
|
||||
Name: TTRS Sniper Zoom -
|
||||
Key1: Z
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomOut = 1;
|
||||
Released: ctl_bSniperZoomOut = 0;
|
||||
|
||||
Axis "move u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move f/b" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "look u/d" "mouse Y" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "turn l/r" "mouse X" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
GlobalDontInvertLook
|
||||
GlobalSmoothAxes
|
||||
GlobalSensitivity 50
|
2
Controls/00-Default.des
Normal file
2
Controls/00-Default.des
Normal file
|
@ -0,0 +1,2 @@
|
|||
Default controls
|
||||
this will revert current controls to defaults
|
234
Controls/Controls0.ctl
Normal file
234
Controls/Controls0.ctl
Normal file
|
@ -0,0 +1,234 @@
|
|||
Button
|
||||
Name: TTRS Move Forward
|
||||
Key1: W
|
||||
Key2: Arrow Up
|
||||
Pressed: ctl_bMoveForward = 1;
|
||||
Released: ctl_bMoveForward = 0;
|
||||
Button
|
||||
Name: TTRS Move Backward
|
||||
Key1: S
|
||||
Key2: Arrow Down
|
||||
Pressed: ctl_bMoveBackward = 1;
|
||||
Released: ctl_bMoveBackward = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: A
|
||||
Key2: Q
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: D
|
||||
Key2: E
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Up/Jump
|
||||
Key1: Space
|
||||
Key2: R
|
||||
Pressed: ctl_bMoveUp = 1;
|
||||
Released: ctl_bMoveUp = 0;
|
||||
Button
|
||||
Name: TTRS Down/Duck
|
||||
Key1: F
|
||||
Key2: C
|
||||
Pressed: ctl_bMoveDown = 1;
|
||||
Released: ctl_bMoveDown = 0;
|
||||
Button
|
||||
Name: TTRS Turn Left
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnLeft = 1;
|
||||
Released: ctl_bTurnLeft = 0;
|
||||
Button
|
||||
Name: TTRS Turn Right
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnRight = 1;
|
||||
Released: ctl_bTurnRight = 0;
|
||||
Button
|
||||
Name: TTRS Look Up
|
||||
Key1: Mouse Button 4
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnUp = 1;
|
||||
Released: ctl_bTurnUp = 0;
|
||||
Button
|
||||
Name: TTRS Look Down
|
||||
Key1: Mouse Button 5
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnDown = 1;
|
||||
Released: ctl_bTurnDown = 0;
|
||||
Button
|
||||
Name: TTRS Center View
|
||||
Key1: Home
|
||||
Key2: None
|
||||
Pressed: ctl_bCenterView = 1;
|
||||
Released: ctl_bCenterView = 0;
|
||||
Button
|
||||
Name: TTRS Walk
|
||||
Key1: Left Shift
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ctl_bWalk = !ctl_bWalk;
|
||||
Button
|
||||
Name: TTRS Walk/Run Toggle
|
||||
Key1: Caps Lock
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ;
|
||||
Button
|
||||
Name: TTRS Strafe
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bStrafe = 1;
|
||||
Released: ctl_bStrafe = 0;
|
||||
Button
|
||||
Name: TTRS Fire
|
||||
Key1: Mouse Button 1
|
||||
Key2: Left Control
|
||||
Pressed: ctl_bFire = 1;
|
||||
Released: ctl_bFire = 0;
|
||||
Button
|
||||
Name: TTRS Reload
|
||||
Key1: Left Alt
|
||||
Key2: None
|
||||
Pressed: ctl_bReload = 1;
|
||||
Released: ctl_bReload = 0;
|
||||
Button
|
||||
Name: TTRS 3rd Person View
|
||||
Key1: H
|
||||
Key2: None
|
||||
Pressed: ctl_b3rdPersonView = 1;
|
||||
Released: ctl_b3rdPersonView = 0;
|
||||
Button
|
||||
Name: TTRS Use/Invoke NETRICSA/Sniper Zoom
|
||||
Key1: Mouse Button 2
|
||||
Key2: Enter
|
||||
Pressed: ctl_bUseOrComputer = 1;
|
||||
Released: ctl_bUseOrComputer = 0;
|
||||
Button
|
||||
Name: TTRS Use/Sniper Zoom
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bUse = 1;
|
||||
Released: ctl_bUse = 0;
|
||||
Button
|
||||
Name: TTRS Invoke NETRICSA
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bComputer = 1;
|
||||
Released: ctl_bComputer = 0;
|
||||
Button
|
||||
Name: TTRS Talk
|
||||
Key1: T
|
||||
Key2: None
|
||||
Pressed: con_bTalk=1;
|
||||
Released:
|
||||
Button
|
||||
Name: TTRS Previous Weapon
|
||||
Key1: Mouse Wheel Up
|
||||
Key2: [
|
||||
Pressed: ctl_bWeaponPrev = 1;
|
||||
Released: ctl_bWeaponPrev = 0;
|
||||
Button
|
||||
Name: TTRS Next Weapon
|
||||
Key1: Mouse Wheel Down
|
||||
Key2: ]
|
||||
Pressed: ctl_bWeaponNext = 1;
|
||||
Released: ctl_bWeaponNext = 0;
|
||||
Button
|
||||
Name: TTRS Flip Weapon
|
||||
Key1: Mouse Button 3
|
||||
Key2: None
|
||||
Pressed: ctl_bWeaponFlip = 1;
|
||||
Released: ctl_bWeaponFlip = 0;
|
||||
Button
|
||||
Name: TTRS Knife/Chainsaw
|
||||
Key1: 1
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[1] = 1;
|
||||
Released: ctl_bSelectWeapon[1] = 0;
|
||||
Button
|
||||
Name: TTRS Colt/Two Colts
|
||||
Key1: 2
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[2] = 1;
|
||||
Released: ctl_bSelectWeapon[2] = 0;
|
||||
Button
|
||||
Name: TTRS Single/Double Shotgun
|
||||
Key1: 3
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[3] = 1;
|
||||
Released: ctl_bSelectWeapon[3] = 0;
|
||||
Button
|
||||
Name: TTRS Tommygun/Minigun
|
||||
Key1: 4
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[4] = 1;
|
||||
Released: ctl_bSelectWeapon[4] = 0;
|
||||
Button
|
||||
Name: TTRS Rocket Launcher/Grenade Launcher
|
||||
Key1: 5
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[5] = 1;
|
||||
Released: ctl_bSelectWeapon[5] = 0;
|
||||
Button
|
||||
Name: TTRS Flamethrower/Sniper
|
||||
Key1: 6
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[6] = 1;
|
||||
Released: ctl_bSelectWeapon[6] = 0;
|
||||
Button
|
||||
Name: TTRS Laser
|
||||
Key1: 7
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[7] = 1;
|
||||
Released: ctl_bSelectWeapon[7] = 0;
|
||||
Button
|
||||
Name: TTRS Cannon
|
||||
Key1: 8
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[8] = 1;
|
||||
Released: ctl_bSelectWeapon[8] = 0;
|
||||
Button
|
||||
Name: TTRS Serious Bomb
|
||||
Key1: 0
|
||||
Key2: None
|
||||
Pressed: ctl_bFireBomb = 1;
|
||||
Released: ctl_bFireBomb = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: Arrow Left
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: Arrow Right
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom +
|
||||
Key1: X
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomIn = 1;
|
||||
Released: ctl_bSniperZoomIn = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom -
|
||||
Key1: Z
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomOut = 1;
|
||||
Released: ctl_bSniperZoomOut = 0;
|
||||
Axis "move u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move f/b" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "look u/d" "mouse Y" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "turn l/r" "mouse X" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
GlobalDontInvertLook
|
||||
GlobalSmoothAxes
|
||||
GlobalSensitivity 50
|
234
Controls/Controls1.ctl
Normal file
234
Controls/Controls1.ctl
Normal file
|
@ -0,0 +1,234 @@
|
|||
Button
|
||||
Name: TTRS Move Forward
|
||||
Key1: W
|
||||
Key2: Arrow Up
|
||||
Pressed: ctl_bMoveForward = 1;
|
||||
Released: ctl_bMoveForward = 0;
|
||||
Button
|
||||
Name: TTRS Move Backward
|
||||
Key1: S
|
||||
Key2: Arrow Down
|
||||
Pressed: ctl_bMoveBackward = 1;
|
||||
Released: ctl_bMoveBackward = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: A
|
||||
Key2: Q
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: D
|
||||
Key2: E
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Up/Jump
|
||||
Key1: Space
|
||||
Key2: R
|
||||
Pressed: ctl_bMoveUp = 1;
|
||||
Released: ctl_bMoveUp = 0;
|
||||
Button
|
||||
Name: TTRS Down/Duck
|
||||
Key1: F
|
||||
Key2: C
|
||||
Pressed: ctl_bMoveDown = 1;
|
||||
Released: ctl_bMoveDown = 0;
|
||||
Button
|
||||
Name: TTRS Turn Left
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnLeft = 1;
|
||||
Released: ctl_bTurnLeft = 0;
|
||||
Button
|
||||
Name: TTRS Turn Right
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnRight = 1;
|
||||
Released: ctl_bTurnRight = 0;
|
||||
Button
|
||||
Name: TTRS Look Up
|
||||
Key1: Mouse Button 4
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnUp = 1;
|
||||
Released: ctl_bTurnUp = 0;
|
||||
Button
|
||||
Name: TTRS Look Down
|
||||
Key1: Mouse Button 5
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnDown = 1;
|
||||
Released: ctl_bTurnDown = 0;
|
||||
Button
|
||||
Name: TTRS Center View
|
||||
Key1: Home
|
||||
Key2: None
|
||||
Pressed: ctl_bCenterView = 1;
|
||||
Released: ctl_bCenterView = 0;
|
||||
Button
|
||||
Name: TTRS Walk
|
||||
Key1: Left Shift
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ctl_bWalk = !ctl_bWalk;
|
||||
Button
|
||||
Name: TTRS Walk/Run Toggle
|
||||
Key1: Caps Lock
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ;
|
||||
Button
|
||||
Name: TTRS Strafe
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bStrafe = 1;
|
||||
Released: ctl_bStrafe = 0;
|
||||
Button
|
||||
Name: TTRS Fire
|
||||
Key1: Mouse Button 1
|
||||
Key2: Left Control
|
||||
Pressed: ctl_bFire = 1;
|
||||
Released: ctl_bFire = 0;
|
||||
Button
|
||||
Name: TTRS Reload
|
||||
Key1: Left Alt
|
||||
Key2: None
|
||||
Pressed: ctl_bReload = 1;
|
||||
Released: ctl_bReload = 0;
|
||||
Button
|
||||
Name: TTRS 3rd Person View
|
||||
Key1: H
|
||||
Key2: None
|
||||
Pressed: ctl_b3rdPersonView = 1;
|
||||
Released: ctl_b3rdPersonView = 0;
|
||||
Button
|
||||
Name: TTRS Use/Invoke NETRICSA/Sniper Zoom
|
||||
Key1: Mouse Button 2
|
||||
Key2: Enter
|
||||
Pressed: ctl_bUseOrComputer = 1;
|
||||
Released: ctl_bUseOrComputer = 0;
|
||||
Button
|
||||
Name: TTRS Use/Sniper Zoom
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bUse = 1;
|
||||
Released: ctl_bUse = 0;
|
||||
Button
|
||||
Name: TTRS Invoke NETRICSA
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bComputer = 1;
|
||||
Released: ctl_bComputer = 0;
|
||||
Button
|
||||
Name: TTRS Talk
|
||||
Key1: T
|
||||
Key2: None
|
||||
Pressed: con_bTalk=1;
|
||||
Released:
|
||||
Button
|
||||
Name: TTRS Previous Weapon
|
||||
Key1: Mouse Wheel Up
|
||||
Key2: [
|
||||
Pressed: ctl_bWeaponPrev = 1;
|
||||
Released: ctl_bWeaponPrev = 0;
|
||||
Button
|
||||
Name: TTRS Next Weapon
|
||||
Key1: Mouse Wheel Down
|
||||
Key2: ]
|
||||
Pressed: ctl_bWeaponNext = 1;
|
||||
Released: ctl_bWeaponNext = 0;
|
||||
Button
|
||||
Name: TTRS Flip Weapon
|
||||
Key1: Mouse Button 3
|
||||
Key2: None
|
||||
Pressed: ctl_bWeaponFlip = 1;
|
||||
Released: ctl_bWeaponFlip = 0;
|
||||
Button
|
||||
Name: TTRS Knife/Chainsaw
|
||||
Key1: 1
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[1] = 1;
|
||||
Released: ctl_bSelectWeapon[1] = 0;
|
||||
Button
|
||||
Name: TTRS Colt/Two Colts
|
||||
Key1: 2
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[2] = 1;
|
||||
Released: ctl_bSelectWeapon[2] = 0;
|
||||
Button
|
||||
Name: TTRS Single/Double Shotgun
|
||||
Key1: 3
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[3] = 1;
|
||||
Released: ctl_bSelectWeapon[3] = 0;
|
||||
Button
|
||||
Name: TTRS Tommygun/Minigun
|
||||
Key1: 4
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[4] = 1;
|
||||
Released: ctl_bSelectWeapon[4] = 0;
|
||||
Button
|
||||
Name: TTRS Rocket Launcher/Grenade Launcher
|
||||
Key1: 5
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[5] = 1;
|
||||
Released: ctl_bSelectWeapon[5] = 0;
|
||||
Button
|
||||
Name: TTRS Flamethrower/Sniper
|
||||
Key1: 6
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[6] = 1;
|
||||
Released: ctl_bSelectWeapon[6] = 0;
|
||||
Button
|
||||
Name: TTRS Laser
|
||||
Key1: 7
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[7] = 1;
|
||||
Released: ctl_bSelectWeapon[7] = 0;
|
||||
Button
|
||||
Name: TTRS Cannon
|
||||
Key1: 8
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[8] = 1;
|
||||
Released: ctl_bSelectWeapon[8] = 0;
|
||||
Button
|
||||
Name: TTRS Serious Bomb
|
||||
Key1: 0
|
||||
Key2: None
|
||||
Pressed: ctl_bFireBomb = 1;
|
||||
Released: ctl_bFireBomb = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: Arrow Left
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: Arrow Right
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom +
|
||||
Key1: X
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomIn = 1;
|
||||
Released: ctl_bSniperZoomIn = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom -
|
||||
Key1: Z
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomOut = 1;
|
||||
Released: ctl_bSniperZoomOut = 0;
|
||||
Axis "move u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move f/b" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "look u/d" "mouse Y" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "turn l/r" "mouse X" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
GlobalDontInvertLook
|
||||
GlobalSmoothAxes
|
||||
GlobalSensitivity 50
|
234
Controls/Controls2.ctl
Normal file
234
Controls/Controls2.ctl
Normal file
|
@ -0,0 +1,234 @@
|
|||
Button
|
||||
Name: TTRS Move Forward
|
||||
Key1: W
|
||||
Key2: Arrow Up
|
||||
Pressed: ctl_bMoveForward = 1;
|
||||
Released: ctl_bMoveForward = 0;
|
||||
Button
|
||||
Name: TTRS Move Backward
|
||||
Key1: S
|
||||
Key2: Arrow Down
|
||||
Pressed: ctl_bMoveBackward = 1;
|
||||
Released: ctl_bMoveBackward = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: A
|
||||
Key2: Q
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: D
|
||||
Key2: E
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Up/Jump
|
||||
Key1: Space
|
||||
Key2: R
|
||||
Pressed: ctl_bMoveUp = 1;
|
||||
Released: ctl_bMoveUp = 0;
|
||||
Button
|
||||
Name: TTRS Down/Duck
|
||||
Key1: F
|
||||
Key2: C
|
||||
Pressed: ctl_bMoveDown = 1;
|
||||
Released: ctl_bMoveDown = 0;
|
||||
Button
|
||||
Name: TTRS Turn Left
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnLeft = 1;
|
||||
Released: ctl_bTurnLeft = 0;
|
||||
Button
|
||||
Name: TTRS Turn Right
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnRight = 1;
|
||||
Released: ctl_bTurnRight = 0;
|
||||
Button
|
||||
Name: TTRS Look Up
|
||||
Key1: Mouse Button 4
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnUp = 1;
|
||||
Released: ctl_bTurnUp = 0;
|
||||
Button
|
||||
Name: TTRS Look Down
|
||||
Key1: Mouse Button 5
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnDown = 1;
|
||||
Released: ctl_bTurnDown = 0;
|
||||
Button
|
||||
Name: TTRS Center View
|
||||
Key1: Home
|
||||
Key2: None
|
||||
Pressed: ctl_bCenterView = 1;
|
||||
Released: ctl_bCenterView = 0;
|
||||
Button
|
||||
Name: TTRS Walk
|
||||
Key1: Left Shift
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ctl_bWalk = !ctl_bWalk;
|
||||
Button
|
||||
Name: TTRS Walk/Run Toggle
|
||||
Key1: Caps Lock
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ;
|
||||
Button
|
||||
Name: TTRS Strafe
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bStrafe = 1;
|
||||
Released: ctl_bStrafe = 0;
|
||||
Button
|
||||
Name: TTRS Fire
|
||||
Key1: Mouse Button 1
|
||||
Key2: Left Control
|
||||
Pressed: ctl_bFire = 1;
|
||||
Released: ctl_bFire = 0;
|
||||
Button
|
||||
Name: TTRS Reload
|
||||
Key1: Left Alt
|
||||
Key2: None
|
||||
Pressed: ctl_bReload = 1;
|
||||
Released: ctl_bReload = 0;
|
||||
Button
|
||||
Name: TTRS 3rd Person View
|
||||
Key1: H
|
||||
Key2: None
|
||||
Pressed: ctl_b3rdPersonView = 1;
|
||||
Released: ctl_b3rdPersonView = 0;
|
||||
Button
|
||||
Name: TTRS Use/Invoke NETRICSA/Sniper Zoom
|
||||
Key1: Mouse Button 2
|
||||
Key2: Enter
|
||||
Pressed: ctl_bUseOrComputer = 1;
|
||||
Released: ctl_bUseOrComputer = 0;
|
||||
Button
|
||||
Name: TTRS Use/Sniper Zoom
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bUse = 1;
|
||||
Released: ctl_bUse = 0;
|
||||
Button
|
||||
Name: TTRS Invoke NETRICSA
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bComputer = 1;
|
||||
Released: ctl_bComputer = 0;
|
||||
Button
|
||||
Name: TTRS Talk
|
||||
Key1: T
|
||||
Key2: None
|
||||
Pressed: con_bTalk=1;
|
||||
Released:
|
||||
Button
|
||||
Name: TTRS Previous Weapon
|
||||
Key1: Mouse Wheel Up
|
||||
Key2: [
|
||||
Pressed: ctl_bWeaponPrev = 1;
|
||||
Released: ctl_bWeaponPrev = 0;
|
||||
Button
|
||||
Name: TTRS Next Weapon
|
||||
Key1: Mouse Wheel Down
|
||||
Key2: ]
|
||||
Pressed: ctl_bWeaponNext = 1;
|
||||
Released: ctl_bWeaponNext = 0;
|
||||
Button
|
||||
Name: TTRS Flip Weapon
|
||||
Key1: Mouse Button 3
|
||||
Key2: None
|
||||
Pressed: ctl_bWeaponFlip = 1;
|
||||
Released: ctl_bWeaponFlip = 0;
|
||||
Button
|
||||
Name: TTRS Knife/Chainsaw
|
||||
Key1: 1
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[1] = 1;
|
||||
Released: ctl_bSelectWeapon[1] = 0;
|
||||
Button
|
||||
Name: TTRS Colt/Two Colts
|
||||
Key1: 2
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[2] = 1;
|
||||
Released: ctl_bSelectWeapon[2] = 0;
|
||||
Button
|
||||
Name: TTRS Single/Double Shotgun
|
||||
Key1: 3
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[3] = 1;
|
||||
Released: ctl_bSelectWeapon[3] = 0;
|
||||
Button
|
||||
Name: TTRS Tommygun/Minigun
|
||||
Key1: 4
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[4] = 1;
|
||||
Released: ctl_bSelectWeapon[4] = 0;
|
||||
Button
|
||||
Name: TTRS Rocket Launcher/Grenade Launcher
|
||||
Key1: 5
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[5] = 1;
|
||||
Released: ctl_bSelectWeapon[5] = 0;
|
||||
Button
|
||||
Name: TTRS Flamethrower/Sniper
|
||||
Key1: 6
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[6] = 1;
|
||||
Released: ctl_bSelectWeapon[6] = 0;
|
||||
Button
|
||||
Name: TTRS Laser
|
||||
Key1: 7
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[7] = 1;
|
||||
Released: ctl_bSelectWeapon[7] = 0;
|
||||
Button
|
||||
Name: TTRS Cannon
|
||||
Key1: 8
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[8] = 1;
|
||||
Released: ctl_bSelectWeapon[8] = 0;
|
||||
Button
|
||||
Name: TTRS Serious Bomb
|
||||
Key1: 0
|
||||
Key2: None
|
||||
Pressed: ctl_bFireBomb = 1;
|
||||
Released: ctl_bFireBomb = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: Arrow Left
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: Arrow Right
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom +
|
||||
Key1: X
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomIn = 1;
|
||||
Released: ctl_bSniperZoomIn = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom -
|
||||
Key1: Z
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomOut = 1;
|
||||
Released: ctl_bSniperZoomOut = 0;
|
||||
Axis "move u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move f/b" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "look u/d" "mouse Y" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "turn l/r" "mouse X" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
GlobalDontInvertLook
|
||||
GlobalSmoothAxes
|
||||
GlobalSensitivity 50
|
234
Controls/Controls3.ctl
Normal file
234
Controls/Controls3.ctl
Normal file
|
@ -0,0 +1,234 @@
|
|||
Button
|
||||
Name: TTRS Move Forward
|
||||
Key1: W
|
||||
Key2: Arrow Up
|
||||
Pressed: ctl_bMoveForward = 1;
|
||||
Released: ctl_bMoveForward = 0;
|
||||
Button
|
||||
Name: TTRS Move Backward
|
||||
Key1: S
|
||||
Key2: Arrow Down
|
||||
Pressed: ctl_bMoveBackward = 1;
|
||||
Released: ctl_bMoveBackward = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: A
|
||||
Key2: Q
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: D
|
||||
Key2: E
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Up/Jump
|
||||
Key1: Space
|
||||
Key2: R
|
||||
Pressed: ctl_bMoveUp = 1;
|
||||
Released: ctl_bMoveUp = 0;
|
||||
Button
|
||||
Name: TTRS Down/Duck
|
||||
Key1: F
|
||||
Key2: C
|
||||
Pressed: ctl_bMoveDown = 1;
|
||||
Released: ctl_bMoveDown = 0;
|
||||
Button
|
||||
Name: TTRS Turn Left
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnLeft = 1;
|
||||
Released: ctl_bTurnLeft = 0;
|
||||
Button
|
||||
Name: TTRS Turn Right
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnRight = 1;
|
||||
Released: ctl_bTurnRight = 0;
|
||||
Button
|
||||
Name: TTRS Look Up
|
||||
Key1: Mouse Button 4
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnUp = 1;
|
||||
Released: ctl_bTurnUp = 0;
|
||||
Button
|
||||
Name: TTRS Look Down
|
||||
Key1: Mouse Button 5
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnDown = 1;
|
||||
Released: ctl_bTurnDown = 0;
|
||||
Button
|
||||
Name: TTRS Center View
|
||||
Key1: Home
|
||||
Key2: None
|
||||
Pressed: ctl_bCenterView = 1;
|
||||
Released: ctl_bCenterView = 0;
|
||||
Button
|
||||
Name: TTRS Walk
|
||||
Key1: Left Shift
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ctl_bWalk = !ctl_bWalk;
|
||||
Button
|
||||
Name: TTRS Walk/Run Toggle
|
||||
Key1: Caps Lock
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ;
|
||||
Button
|
||||
Name: TTRS Strafe
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bStrafe = 1;
|
||||
Released: ctl_bStrafe = 0;
|
||||
Button
|
||||
Name: TTRS Fire
|
||||
Key1: Mouse Button 1
|
||||
Key2: Left Control
|
||||
Pressed: ctl_bFire = 1;
|
||||
Released: ctl_bFire = 0;
|
||||
Button
|
||||
Name: TTRS Reload
|
||||
Key1: Left Alt
|
||||
Key2: None
|
||||
Pressed: ctl_bReload = 1;
|
||||
Released: ctl_bReload = 0;
|
||||
Button
|
||||
Name: TTRS 3rd Person View
|
||||
Key1: H
|
||||
Key2: None
|
||||
Pressed: ctl_b3rdPersonView = 1;
|
||||
Released: ctl_b3rdPersonView = 0;
|
||||
Button
|
||||
Name: TTRS Use/Invoke NETRICSA/Sniper Zoom
|
||||
Key1: Mouse Button 2
|
||||
Key2: Enter
|
||||
Pressed: ctl_bUseOrComputer = 1;
|
||||
Released: ctl_bUseOrComputer = 0;
|
||||
Button
|
||||
Name: TTRS Use/Sniper Zoom
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bUse = 1;
|
||||
Released: ctl_bUse = 0;
|
||||
Button
|
||||
Name: TTRS Invoke NETRICSA
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bComputer = 1;
|
||||
Released: ctl_bComputer = 0;
|
||||
Button
|
||||
Name: TTRS Talk
|
||||
Key1: T
|
||||
Key2: None
|
||||
Pressed: con_bTalk=1;
|
||||
Released:
|
||||
Button
|
||||
Name: TTRS Previous Weapon
|
||||
Key1: Mouse Wheel Up
|
||||
Key2: [
|
||||
Pressed: ctl_bWeaponPrev = 1;
|
||||
Released: ctl_bWeaponPrev = 0;
|
||||
Button
|
||||
Name: TTRS Next Weapon
|
||||
Key1: Mouse Wheel Down
|
||||
Key2: ]
|
||||
Pressed: ctl_bWeaponNext = 1;
|
||||
Released: ctl_bWeaponNext = 0;
|
||||
Button
|
||||
Name: TTRS Flip Weapon
|
||||
Key1: Mouse Button 3
|
||||
Key2: None
|
||||
Pressed: ctl_bWeaponFlip = 1;
|
||||
Released: ctl_bWeaponFlip = 0;
|
||||
Button
|
||||
Name: TTRS Knife/Chainsaw
|
||||
Key1: 1
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[1] = 1;
|
||||
Released: ctl_bSelectWeapon[1] = 0;
|
||||
Button
|
||||
Name: TTRS Colt/Two Colts
|
||||
Key1: 2
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[2] = 1;
|
||||
Released: ctl_bSelectWeapon[2] = 0;
|
||||
Button
|
||||
Name: TTRS Single/Double Shotgun
|
||||
Key1: 3
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[3] = 1;
|
||||
Released: ctl_bSelectWeapon[3] = 0;
|
||||
Button
|
||||
Name: TTRS Tommygun/Minigun
|
||||
Key1: 4
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[4] = 1;
|
||||
Released: ctl_bSelectWeapon[4] = 0;
|
||||
Button
|
||||
Name: TTRS Rocket Launcher/Grenade Launcher
|
||||
Key1: 5
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[5] = 1;
|
||||
Released: ctl_bSelectWeapon[5] = 0;
|
||||
Button
|
||||
Name: TTRS Flamethrower/Sniper
|
||||
Key1: 6
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[6] = 1;
|
||||
Released: ctl_bSelectWeapon[6] = 0;
|
||||
Button
|
||||
Name: TTRS Laser
|
||||
Key1: 7
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[7] = 1;
|
||||
Released: ctl_bSelectWeapon[7] = 0;
|
||||
Button
|
||||
Name: TTRS Cannon
|
||||
Key1: 8
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[8] = 1;
|
||||
Released: ctl_bSelectWeapon[8] = 0;
|
||||
Button
|
||||
Name: TTRS Serious Bomb
|
||||
Key1: 0
|
||||
Key2: None
|
||||
Pressed: ctl_bFireBomb = 1;
|
||||
Released: ctl_bFireBomb = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: Arrow Left
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: Arrow Right
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom +
|
||||
Key1: X
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomIn = 1;
|
||||
Released: ctl_bSniperZoomIn = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom -
|
||||
Key1: Z
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomOut = 1;
|
||||
Released: ctl_bSniperZoomOut = 0;
|
||||
Axis "move u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move f/b" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "look u/d" "mouse Y" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "turn l/r" "mouse X" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
GlobalDontInvertLook
|
||||
GlobalSmoothAxes
|
||||
GlobalSensitivity 50
|
234
Controls/Controls4.ctl
Normal file
234
Controls/Controls4.ctl
Normal file
|
@ -0,0 +1,234 @@
|
|||
Button
|
||||
Name: TTRS Move Forward
|
||||
Key1: W
|
||||
Key2: Arrow Up
|
||||
Pressed: ctl_bMoveForward = 1;
|
||||
Released: ctl_bMoveForward = 0;
|
||||
Button
|
||||
Name: TTRS Move Backward
|
||||
Key1: S
|
||||
Key2: Arrow Down
|
||||
Pressed: ctl_bMoveBackward = 1;
|
||||
Released: ctl_bMoveBackward = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: A
|
||||
Key2: Q
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: D
|
||||
Key2: E
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Up/Jump
|
||||
Key1: Space
|
||||
Key2: R
|
||||
Pressed: ctl_bMoveUp = 1;
|
||||
Released: ctl_bMoveUp = 0;
|
||||
Button
|
||||
Name: TTRS Down/Duck
|
||||
Key1: F
|
||||
Key2: C
|
||||
Pressed: ctl_bMoveDown = 1;
|
||||
Released: ctl_bMoveDown = 0;
|
||||
Button
|
||||
Name: TTRS Turn Left
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnLeft = 1;
|
||||
Released: ctl_bTurnLeft = 0;
|
||||
Button
|
||||
Name: TTRS Turn Right
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnRight = 1;
|
||||
Released: ctl_bTurnRight = 0;
|
||||
Button
|
||||
Name: TTRS Look Up
|
||||
Key1: Mouse Button 4
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnUp = 1;
|
||||
Released: ctl_bTurnUp = 0;
|
||||
Button
|
||||
Name: TTRS Look Down
|
||||
Key1: Mouse Button 5
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnDown = 1;
|
||||
Released: ctl_bTurnDown = 0;
|
||||
Button
|
||||
Name: TTRS Center View
|
||||
Key1: Home
|
||||
Key2: None
|
||||
Pressed: ctl_bCenterView = 1;
|
||||
Released: ctl_bCenterView = 0;
|
||||
Button
|
||||
Name: TTRS Walk
|
||||
Key1: Left Shift
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ctl_bWalk = !ctl_bWalk;
|
||||
Button
|
||||
Name: TTRS Walk/Run Toggle
|
||||
Key1: Caps Lock
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ;
|
||||
Button
|
||||
Name: TTRS Strafe
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bStrafe = 1;
|
||||
Released: ctl_bStrafe = 0;
|
||||
Button
|
||||
Name: TTRS Fire
|
||||
Key1: Mouse Button 1
|
||||
Key2: Left Control
|
||||
Pressed: ctl_bFire = 1;
|
||||
Released: ctl_bFire = 0;
|
||||
Button
|
||||
Name: TTRS Reload
|
||||
Key1: Left Alt
|
||||
Key2: None
|
||||
Pressed: ctl_bReload = 1;
|
||||
Released: ctl_bReload = 0;
|
||||
Button
|
||||
Name: TTRS 3rd Person View
|
||||
Key1: H
|
||||
Key2: None
|
||||
Pressed: ctl_b3rdPersonView = 1;
|
||||
Released: ctl_b3rdPersonView = 0;
|
||||
Button
|
||||
Name: TTRS Use/Invoke NETRICSA/Sniper Zoom
|
||||
Key1: Mouse Button 2
|
||||
Key2: Enter
|
||||
Pressed: ctl_bUseOrComputer = 1;
|
||||
Released: ctl_bUseOrComputer = 0;
|
||||
Button
|
||||
Name: TTRS Use/Sniper Zoom
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bUse = 1;
|
||||
Released: ctl_bUse = 0;
|
||||
Button
|
||||
Name: TTRS Invoke NETRICSA
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bComputer = 1;
|
||||
Released: ctl_bComputer = 0;
|
||||
Button
|
||||
Name: TTRS Talk
|
||||
Key1: T
|
||||
Key2: None
|
||||
Pressed: con_bTalk=1;
|
||||
Released:
|
||||
Button
|
||||
Name: TTRS Previous Weapon
|
||||
Key1: Mouse Wheel Up
|
||||
Key2: [
|
||||
Pressed: ctl_bWeaponPrev = 1;
|
||||
Released: ctl_bWeaponPrev = 0;
|
||||
Button
|
||||
Name: TTRS Next Weapon
|
||||
Key1: Mouse Wheel Down
|
||||
Key2: ]
|
||||
Pressed: ctl_bWeaponNext = 1;
|
||||
Released: ctl_bWeaponNext = 0;
|
||||
Button
|
||||
Name: TTRS Flip Weapon
|
||||
Key1: Mouse Button 3
|
||||
Key2: None
|
||||
Pressed: ctl_bWeaponFlip = 1;
|
||||
Released: ctl_bWeaponFlip = 0;
|
||||
Button
|
||||
Name: TTRS Knife/Chainsaw
|
||||
Key1: 1
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[1] = 1;
|
||||
Released: ctl_bSelectWeapon[1] = 0;
|
||||
Button
|
||||
Name: TTRS Colt/Two Colts
|
||||
Key1: 2
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[2] = 1;
|
||||
Released: ctl_bSelectWeapon[2] = 0;
|
||||
Button
|
||||
Name: TTRS Single/Double Shotgun
|
||||
Key1: 3
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[3] = 1;
|
||||
Released: ctl_bSelectWeapon[3] = 0;
|
||||
Button
|
||||
Name: TTRS Tommygun/Minigun
|
||||
Key1: 4
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[4] = 1;
|
||||
Released: ctl_bSelectWeapon[4] = 0;
|
||||
Button
|
||||
Name: TTRS Rocket Launcher/Grenade Launcher
|
||||
Key1: 5
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[5] = 1;
|
||||
Released: ctl_bSelectWeapon[5] = 0;
|
||||
Button
|
||||
Name: TTRS Flamethrower/Sniper
|
||||
Key1: 6
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[6] = 1;
|
||||
Released: ctl_bSelectWeapon[6] = 0;
|
||||
Button
|
||||
Name: TTRS Laser
|
||||
Key1: 7
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[7] = 1;
|
||||
Released: ctl_bSelectWeapon[7] = 0;
|
||||
Button
|
||||
Name: TTRS Cannon
|
||||
Key1: 8
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[8] = 1;
|
||||
Released: ctl_bSelectWeapon[8] = 0;
|
||||
Button
|
||||
Name: TTRS Serious Bomb
|
||||
Key1: 0
|
||||
Key2: None
|
||||
Pressed: ctl_bFireBomb = 1;
|
||||
Released: ctl_bFireBomb = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: Arrow Left
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: Arrow Right
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom +
|
||||
Key1: X
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomIn = 1;
|
||||
Released: ctl_bSniperZoomIn = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom -
|
||||
Key1: Z
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomOut = 1;
|
||||
Released: ctl_bSniperZoomOut = 0;
|
||||
Axis "move u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move f/b" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "look u/d" "mouse Y" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "turn l/r" "mouse X" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
GlobalDontInvertLook
|
||||
GlobalSmoothAxes
|
||||
GlobalSensitivity 50
|
234
Controls/Controls5.ctl
Normal file
234
Controls/Controls5.ctl
Normal file
|
@ -0,0 +1,234 @@
|
|||
Button
|
||||
Name: TTRS Move Forward
|
||||
Key1: W
|
||||
Key2: Arrow Up
|
||||
Pressed: ctl_bMoveForward = 1;
|
||||
Released: ctl_bMoveForward = 0;
|
||||
Button
|
||||
Name: TTRS Move Backward
|
||||
Key1: S
|
||||
Key2: Arrow Down
|
||||
Pressed: ctl_bMoveBackward = 1;
|
||||
Released: ctl_bMoveBackward = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: A
|
||||
Key2: Q
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: D
|
||||
Key2: E
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Up/Jump
|
||||
Key1: Space
|
||||
Key2: R
|
||||
Pressed: ctl_bMoveUp = 1;
|
||||
Released: ctl_bMoveUp = 0;
|
||||
Button
|
||||
Name: TTRS Down/Duck
|
||||
Key1: F
|
||||
Key2: C
|
||||
Pressed: ctl_bMoveDown = 1;
|
||||
Released: ctl_bMoveDown = 0;
|
||||
Button
|
||||
Name: TTRS Turn Left
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnLeft = 1;
|
||||
Released: ctl_bTurnLeft = 0;
|
||||
Button
|
||||
Name: TTRS Turn Right
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnRight = 1;
|
||||
Released: ctl_bTurnRight = 0;
|
||||
Button
|
||||
Name: TTRS Look Up
|
||||
Key1: Mouse Button 4
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnUp = 1;
|
||||
Released: ctl_bTurnUp = 0;
|
||||
Button
|
||||
Name: TTRS Look Down
|
||||
Key1: Mouse Button 5
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnDown = 1;
|
||||
Released: ctl_bTurnDown = 0;
|
||||
Button
|
||||
Name: TTRS Center View
|
||||
Key1: Home
|
||||
Key2: None
|
||||
Pressed: ctl_bCenterView = 1;
|
||||
Released: ctl_bCenterView = 0;
|
||||
Button
|
||||
Name: TTRS Walk
|
||||
Key1: Left Shift
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ctl_bWalk = !ctl_bWalk;
|
||||
Button
|
||||
Name: TTRS Walk/Run Toggle
|
||||
Key1: Caps Lock
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ;
|
||||
Button
|
||||
Name: TTRS Strafe
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bStrafe = 1;
|
||||
Released: ctl_bStrafe = 0;
|
||||
Button
|
||||
Name: TTRS Fire
|
||||
Key1: Mouse Button 1
|
||||
Key2: Left Control
|
||||
Pressed: ctl_bFire = 1;
|
||||
Released: ctl_bFire = 0;
|
||||
Button
|
||||
Name: TTRS Reload
|
||||
Key1: Left Alt
|
||||
Key2: None
|
||||
Pressed: ctl_bReload = 1;
|
||||
Released: ctl_bReload = 0;
|
||||
Button
|
||||
Name: TTRS 3rd Person View
|
||||
Key1: H
|
||||
Key2: None
|
||||
Pressed: ctl_b3rdPersonView = 1;
|
||||
Released: ctl_b3rdPersonView = 0;
|
||||
Button
|
||||
Name: TTRS Use/Invoke NETRICSA/Sniper Zoom
|
||||
Key1: Mouse Button 2
|
||||
Key2: Enter
|
||||
Pressed: ctl_bUseOrComputer = 1;
|
||||
Released: ctl_bUseOrComputer = 0;
|
||||
Button
|
||||
Name: TTRS Use/Sniper Zoom
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bUse = 1;
|
||||
Released: ctl_bUse = 0;
|
||||
Button
|
||||
Name: TTRS Invoke NETRICSA
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bComputer = 1;
|
||||
Released: ctl_bComputer = 0;
|
||||
Button
|
||||
Name: TTRS Talk
|
||||
Key1: T
|
||||
Key2: None
|
||||
Pressed: con_bTalk=1;
|
||||
Released:
|
||||
Button
|
||||
Name: TTRS Previous Weapon
|
||||
Key1: Mouse Wheel Up
|
||||
Key2: [
|
||||
Pressed: ctl_bWeaponPrev = 1;
|
||||
Released: ctl_bWeaponPrev = 0;
|
||||
Button
|
||||
Name: TTRS Next Weapon
|
||||
Key1: Mouse Wheel Down
|
||||
Key2: ]
|
||||
Pressed: ctl_bWeaponNext = 1;
|
||||
Released: ctl_bWeaponNext = 0;
|
||||
Button
|
||||
Name: TTRS Flip Weapon
|
||||
Key1: Mouse Button 3
|
||||
Key2: None
|
||||
Pressed: ctl_bWeaponFlip = 1;
|
||||
Released: ctl_bWeaponFlip = 0;
|
||||
Button
|
||||
Name: TTRS Knife/Chainsaw
|
||||
Key1: 1
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[1] = 1;
|
||||
Released: ctl_bSelectWeapon[1] = 0;
|
||||
Button
|
||||
Name: TTRS Colt/Two Colts
|
||||
Key1: 2
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[2] = 1;
|
||||
Released: ctl_bSelectWeapon[2] = 0;
|
||||
Button
|
||||
Name: TTRS Single/Double Shotgun
|
||||
Key1: 3
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[3] = 1;
|
||||
Released: ctl_bSelectWeapon[3] = 0;
|
||||
Button
|
||||
Name: TTRS Tommygun/Minigun
|
||||
Key1: 4
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[4] = 1;
|
||||
Released: ctl_bSelectWeapon[4] = 0;
|
||||
Button
|
||||
Name: TTRS Rocket Launcher/Grenade Launcher
|
||||
Key1: 5
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[5] = 1;
|
||||
Released: ctl_bSelectWeapon[5] = 0;
|
||||
Button
|
||||
Name: TTRS Flamethrower/Sniper
|
||||
Key1: 6
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[6] = 1;
|
||||
Released: ctl_bSelectWeapon[6] = 0;
|
||||
Button
|
||||
Name: TTRS Laser
|
||||
Key1: 7
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[7] = 1;
|
||||
Released: ctl_bSelectWeapon[7] = 0;
|
||||
Button
|
||||
Name: TTRS Cannon
|
||||
Key1: 8
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[8] = 1;
|
||||
Released: ctl_bSelectWeapon[8] = 0;
|
||||
Button
|
||||
Name: TTRS Serious Bomb
|
||||
Key1: 0
|
||||
Key2: None
|
||||
Pressed: ctl_bFireBomb = 1;
|
||||
Released: ctl_bFireBomb = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: Arrow Left
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: Arrow Right
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom +
|
||||
Key1: X
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomIn = 1;
|
||||
Released: ctl_bSniperZoomIn = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom -
|
||||
Key1: Z
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomOut = 1;
|
||||
Released: ctl_bSniperZoomOut = 0;
|
||||
Axis "move u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move f/b" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "look u/d" "mouse Y" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "turn l/r" "mouse X" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
GlobalDontInvertLook
|
||||
GlobalSmoothAxes
|
||||
GlobalSensitivity 50
|
234
Controls/Controls6.ctl
Normal file
234
Controls/Controls6.ctl
Normal file
|
@ -0,0 +1,234 @@
|
|||
Button
|
||||
Name: TTRS Move Forward
|
||||
Key1: W
|
||||
Key2: Arrow Up
|
||||
Pressed: ctl_bMoveForward = 1;
|
||||
Released: ctl_bMoveForward = 0;
|
||||
Button
|
||||
Name: TTRS Move Backward
|
||||
Key1: S
|
||||
Key2: Arrow Down
|
||||
Pressed: ctl_bMoveBackward = 1;
|
||||
Released: ctl_bMoveBackward = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: A
|
||||
Key2: Q
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: D
|
||||
Key2: E
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Up/Jump
|
||||
Key1: Space
|
||||
Key2: R
|
||||
Pressed: ctl_bMoveUp = 1;
|
||||
Released: ctl_bMoveUp = 0;
|
||||
Button
|
||||
Name: TTRS Down/Duck
|
||||
Key1: F
|
||||
Key2: C
|
||||
Pressed: ctl_bMoveDown = 1;
|
||||
Released: ctl_bMoveDown = 0;
|
||||
Button
|
||||
Name: TTRS Turn Left
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnLeft = 1;
|
||||
Released: ctl_bTurnLeft = 0;
|
||||
Button
|
||||
Name: TTRS Turn Right
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnRight = 1;
|
||||
Released: ctl_bTurnRight = 0;
|
||||
Button
|
||||
Name: TTRS Look Up
|
||||
Key1: Mouse Button 4
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnUp = 1;
|
||||
Released: ctl_bTurnUp = 0;
|
||||
Button
|
||||
Name: TTRS Look Down
|
||||
Key1: Mouse Button 5
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnDown = 1;
|
||||
Released: ctl_bTurnDown = 0;
|
||||
Button
|
||||
Name: TTRS Center View
|
||||
Key1: Home
|
||||
Key2: None
|
||||
Pressed: ctl_bCenterView = 1;
|
||||
Released: ctl_bCenterView = 0;
|
||||
Button
|
||||
Name: TTRS Walk
|
||||
Key1: Left Shift
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ctl_bWalk = !ctl_bWalk;
|
||||
Button
|
||||
Name: TTRS Walk/Run Toggle
|
||||
Key1: Caps Lock
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ;
|
||||
Button
|
||||
Name: TTRS Strafe
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bStrafe = 1;
|
||||
Released: ctl_bStrafe = 0;
|
||||
Button
|
||||
Name: TTRS Fire
|
||||
Key1: Mouse Button 1
|
||||
Key2: Left Control
|
||||
Pressed: ctl_bFire = 1;
|
||||
Released: ctl_bFire = 0;
|
||||
Button
|
||||
Name: TTRS Reload
|
||||
Key1: Left Alt
|
||||
Key2: None
|
||||
Pressed: ctl_bReload = 1;
|
||||
Released: ctl_bReload = 0;
|
||||
Button
|
||||
Name: TTRS 3rd Person View
|
||||
Key1: H
|
||||
Key2: None
|
||||
Pressed: ctl_b3rdPersonView = 1;
|
||||
Released: ctl_b3rdPersonView = 0;
|
||||
Button
|
||||
Name: TTRS Use/Invoke NETRICSA/Sniper Zoom
|
||||
Key1: Mouse Button 2
|
||||
Key2: Enter
|
||||
Pressed: ctl_bUseOrComputer = 1;
|
||||
Released: ctl_bUseOrComputer = 0;
|
||||
Button
|
||||
Name: TTRS Use/Sniper Zoom
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bUse = 1;
|
||||
Released: ctl_bUse = 0;
|
||||
Button
|
||||
Name: TTRS Invoke NETRICSA
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bComputer = 1;
|
||||
Released: ctl_bComputer = 0;
|
||||
Button
|
||||
Name: TTRS Talk
|
||||
Key1: T
|
||||
Key2: None
|
||||
Pressed: con_bTalk=1;
|
||||
Released:
|
||||
Button
|
||||
Name: TTRS Previous Weapon
|
||||
Key1: Mouse Wheel Up
|
||||
Key2: [
|
||||
Pressed: ctl_bWeaponPrev = 1;
|
||||
Released: ctl_bWeaponPrev = 0;
|
||||
Button
|
||||
Name: TTRS Next Weapon
|
||||
Key1: Mouse Wheel Down
|
||||
Key2: ]
|
||||
Pressed: ctl_bWeaponNext = 1;
|
||||
Released: ctl_bWeaponNext = 0;
|
||||
Button
|
||||
Name: TTRS Flip Weapon
|
||||
Key1: Mouse Button 3
|
||||
Key2: None
|
||||
Pressed: ctl_bWeaponFlip = 1;
|
||||
Released: ctl_bWeaponFlip = 0;
|
||||
Button
|
||||
Name: TTRS Knife/Chainsaw
|
||||
Key1: 1
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[1] = 1;
|
||||
Released: ctl_bSelectWeapon[1] = 0;
|
||||
Button
|
||||
Name: TTRS Colt/Two Colts
|
||||
Key1: 2
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[2] = 1;
|
||||
Released: ctl_bSelectWeapon[2] = 0;
|
||||
Button
|
||||
Name: TTRS Single/Double Shotgun
|
||||
Key1: 3
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[3] = 1;
|
||||
Released: ctl_bSelectWeapon[3] = 0;
|
||||
Button
|
||||
Name: TTRS Tommygun/Minigun
|
||||
Key1: 4
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[4] = 1;
|
||||
Released: ctl_bSelectWeapon[4] = 0;
|
||||
Button
|
||||
Name: TTRS Rocket Launcher/Grenade Launcher
|
||||
Key1: 5
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[5] = 1;
|
||||
Released: ctl_bSelectWeapon[5] = 0;
|
||||
Button
|
||||
Name: TTRS Flamethrower/Sniper
|
||||
Key1: 6
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[6] = 1;
|
||||
Released: ctl_bSelectWeapon[6] = 0;
|
||||
Button
|
||||
Name: TTRS Laser
|
||||
Key1: 7
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[7] = 1;
|
||||
Released: ctl_bSelectWeapon[7] = 0;
|
||||
Button
|
||||
Name: TTRS Cannon
|
||||
Key1: 8
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[8] = 1;
|
||||
Released: ctl_bSelectWeapon[8] = 0;
|
||||
Button
|
||||
Name: TTRS Serious Bomb
|
||||
Key1: 0
|
||||
Key2: None
|
||||
Pressed: ctl_bFireBomb = 1;
|
||||
Released: ctl_bFireBomb = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: Arrow Left
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: Arrow Right
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom +
|
||||
Key1: X
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomIn = 1;
|
||||
Released: ctl_bSniperZoomIn = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom -
|
||||
Key1: Z
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomOut = 1;
|
||||
Released: ctl_bSniperZoomOut = 0;
|
||||
Axis "move u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move f/b" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "look u/d" "mouse Y" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "turn l/r" "mouse X" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
GlobalDontInvertLook
|
||||
GlobalSmoothAxes
|
||||
GlobalSensitivity 50
|
234
Controls/Controls7.ctl
Normal file
234
Controls/Controls7.ctl
Normal file
|
@ -0,0 +1,234 @@
|
|||
Button
|
||||
Name: TTRS Move Forward
|
||||
Key1: W
|
||||
Key2: Arrow Up
|
||||
Pressed: ctl_bMoveForward = 1;
|
||||
Released: ctl_bMoveForward = 0;
|
||||
Button
|
||||
Name: TTRS Move Backward
|
||||
Key1: S
|
||||
Key2: Arrow Down
|
||||
Pressed: ctl_bMoveBackward = 1;
|
||||
Released: ctl_bMoveBackward = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: A
|
||||
Key2: Q
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: D
|
||||
Key2: E
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Up/Jump
|
||||
Key1: Space
|
||||
Key2: R
|
||||
Pressed: ctl_bMoveUp = 1;
|
||||
Released: ctl_bMoveUp = 0;
|
||||
Button
|
||||
Name: TTRS Down/Duck
|
||||
Key1: F
|
||||
Key2: C
|
||||
Pressed: ctl_bMoveDown = 1;
|
||||
Released: ctl_bMoveDown = 0;
|
||||
Button
|
||||
Name: TTRS Turn Left
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnLeft = 1;
|
||||
Released: ctl_bTurnLeft = 0;
|
||||
Button
|
||||
Name: TTRS Turn Right
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnRight = 1;
|
||||
Released: ctl_bTurnRight = 0;
|
||||
Button
|
||||
Name: TTRS Look Up
|
||||
Key1: Mouse Button 4
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnUp = 1;
|
||||
Released: ctl_bTurnUp = 0;
|
||||
Button
|
||||
Name: TTRS Look Down
|
||||
Key1: Mouse Button 5
|
||||
Key2: None
|
||||
Pressed: ctl_bTurnDown = 1;
|
||||
Released: ctl_bTurnDown = 0;
|
||||
Button
|
||||
Name: TTRS Center View
|
||||
Key1: Home
|
||||
Key2: None
|
||||
Pressed: ctl_bCenterView = 1;
|
||||
Released: ctl_bCenterView = 0;
|
||||
Button
|
||||
Name: TTRS Walk
|
||||
Key1: Left Shift
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ctl_bWalk = !ctl_bWalk;
|
||||
Button
|
||||
Name: TTRS Walk/Run Toggle
|
||||
Key1: Caps Lock
|
||||
Key2: None
|
||||
Pressed: ctl_bWalk = !ctl_bWalk;
|
||||
Released: ;
|
||||
Button
|
||||
Name: TTRS Strafe
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bStrafe = 1;
|
||||
Released: ctl_bStrafe = 0;
|
||||
Button
|
||||
Name: TTRS Fire
|
||||
Key1: Mouse Button 1
|
||||
Key2: Left Control
|
||||
Pressed: ctl_bFire = 1;
|
||||
Released: ctl_bFire = 0;
|
||||
Button
|
||||
Name: TTRS Reload
|
||||
Key1: Left Alt
|
||||
Key2: None
|
||||
Pressed: ctl_bReload = 1;
|
||||
Released: ctl_bReload = 0;
|
||||
Button
|
||||
Name: TTRS 3rd Person View
|
||||
Key1: H
|
||||
Key2: None
|
||||
Pressed: ctl_b3rdPersonView = 1;
|
||||
Released: ctl_b3rdPersonView = 0;
|
||||
Button
|
||||
Name: TTRS Use/Invoke NETRICSA/Sniper Zoom
|
||||
Key1: Mouse Button 2
|
||||
Key2: Enter
|
||||
Pressed: ctl_bUseOrComputer = 1;
|
||||
Released: ctl_bUseOrComputer = 0;
|
||||
Button
|
||||
Name: TTRS Use/Sniper Zoom
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bUse = 1;
|
||||
Released: ctl_bUse = 0;
|
||||
Button
|
||||
Name: TTRS Invoke NETRICSA
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: ctl_bComputer = 1;
|
||||
Released: ctl_bComputer = 0;
|
||||
Button
|
||||
Name: TTRS Talk
|
||||
Key1: T
|
||||
Key2: None
|
||||
Pressed: con_bTalk=1;
|
||||
Released:
|
||||
Button
|
||||
Name: TTRS Previous Weapon
|
||||
Key1: Mouse Wheel Up
|
||||
Key2: [
|
||||
Pressed: ctl_bWeaponPrev = 1;
|
||||
Released: ctl_bWeaponPrev = 0;
|
||||
Button
|
||||
Name: TTRS Next Weapon
|
||||
Key1: Mouse Wheel Down
|
||||
Key2: ]
|
||||
Pressed: ctl_bWeaponNext = 1;
|
||||
Released: ctl_bWeaponNext = 0;
|
||||
Button
|
||||
Name: TTRS Flip Weapon
|
||||
Key1: Mouse Button 3
|
||||
Key2: None
|
||||
Pressed: ctl_bWeaponFlip = 1;
|
||||
Released: ctl_bWeaponFlip = 0;
|
||||
Button
|
||||
Name: TTRS Knife/Chainsaw
|
||||
Key1: 1
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[1] = 1;
|
||||
Released: ctl_bSelectWeapon[1] = 0;
|
||||
Button
|
||||
Name: TTRS Colt/Two Colts
|
||||
Key1: 2
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[2] = 1;
|
||||
Released: ctl_bSelectWeapon[2] = 0;
|
||||
Button
|
||||
Name: TTRS Single/Double Shotgun
|
||||
Key1: 3
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[3] = 1;
|
||||
Released: ctl_bSelectWeapon[3] = 0;
|
||||
Button
|
||||
Name: TTRS Tommygun/Minigun
|
||||
Key1: 4
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[4] = 1;
|
||||
Released: ctl_bSelectWeapon[4] = 0;
|
||||
Button
|
||||
Name: TTRS Rocket Launcher/Grenade Launcher
|
||||
Key1: 5
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[5] = 1;
|
||||
Released: ctl_bSelectWeapon[5] = 0;
|
||||
Button
|
||||
Name: TTRS Flamethrower/Sniper
|
||||
Key1: 6
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[6] = 1;
|
||||
Released: ctl_bSelectWeapon[6] = 0;
|
||||
Button
|
||||
Name: TTRS Laser
|
||||
Key1: 7
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[7] = 1;
|
||||
Released: ctl_bSelectWeapon[7] = 0;
|
||||
Button
|
||||
Name: TTRS Cannon
|
||||
Key1: 8
|
||||
Key2: None
|
||||
Pressed: ctl_bSelectWeapon[8] = 1;
|
||||
Released: ctl_bSelectWeapon[8] = 0;
|
||||
Button
|
||||
Name: TTRS Serious Bomb
|
||||
Key1: 0
|
||||
Key2: None
|
||||
Pressed: ctl_bFireBomb = 1;
|
||||
Released: ctl_bFireBomb = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Left
|
||||
Key1: Arrow Left
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveLeft = 1;
|
||||
Released: ctl_bMoveLeft = 0;
|
||||
Button
|
||||
Name: TTRS Strafe Right
|
||||
Key1: Arrow Right
|
||||
Key2: None
|
||||
Pressed: ctl_bMoveRight = 1;
|
||||
Released: ctl_bMoveRight = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom +
|
||||
Key1: X
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomIn = 1;
|
||||
Released: ctl_bSniperZoomIn = 0;
|
||||
Button
|
||||
Name: TTRS Sniper Zoom -
|
||||
Key1: Z
|
||||
Key2: None
|
||||
Pressed: ctl_bSniperZoomOut = 1;
|
||||
Released: ctl_bSniperZoomOut = 0;
|
||||
Axis "move u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "move f/b" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "look u/d" "mouse Y" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "turn l/r" "mouse X" 50 0 NotInverted Relative NotSmooth
|
||||
Axis "banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view u/d" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view l/r" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
Axis "view banking" "None" 50 0 NotInverted Absolute NotSmooth
|
||||
GlobalDontInvertLook
|
||||
GlobalSmoothAxes
|
||||
GlobalSensitivity 50
|
202
Controls/System/Common.ctl
Normal file
202
Controls/System/Common.ctl
Normal file
|
@ -0,0 +1,202 @@
|
|||
Button
|
||||
Name: TTRS Menu Save
|
||||
Key1: F2
|
||||
Key2: None
|
||||
Pressed: sam_bMenuSave=1;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Menu Load
|
||||
Key1: F3
|
||||
Key2: None
|
||||
Pressed: sam_bMenuLoad=1;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Menu Controls
|
||||
Key1: F4
|
||||
Key2: None
|
||||
Pressed: sam_bMenuControls=1;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Quick Save
|
||||
Key1: F6
|
||||
Key2: None
|
||||
Pressed: gam_bQuickSave=1;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Quick Load
|
||||
Key1: F9
|
||||
Key2: None
|
||||
Pressed: gam_bQuickLoad=1;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Screenshot
|
||||
Key1: F11
|
||||
Key2: None
|
||||
Pressed: SaveScreenShot();
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS StartDemoRecording
|
||||
Key1: F7
|
||||
Key2: None
|
||||
Pressed: StartDemoRecording();
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS StopDemoRecording
|
||||
Key1: F8
|
||||
Key2: None
|
||||
Pressed: StopDemoRecording();
|
||||
Released:
|
||||
|
||||
|
||||
Button
|
||||
Name: TTRS Toggle frame rate
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: hud_iStats=(hud_iStats+1)%3;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Show elapsed time and/or crosshair coordinates
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: extern FLOAT fTmp=hud_bShowTime*2+hud_bShowCoords; fTmp = (fTmp+1)%4; hud_bShowCoords=fTmp%2; hud_bShowTime=(fTmp-hud_bShowCoords)/2;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Toggle Triangles
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: wld_bShowTriangles=!wld_bShowTriangles;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Breakpoint
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: dbg_bBreak = 1;
|
||||
Released:
|
||||
|
||||
|
||||
Button
|
||||
Name: TTRS Observe No Players
|
||||
Key1: Num 0
|
||||
Key2: None
|
||||
Pressed: gam_iObserverConfig=0;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Observe 1 Player
|
||||
Key1: Num 1
|
||||
Key2: None
|
||||
Pressed: gam_iObserverConfig=1;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Observe 2 Players
|
||||
Key1: Num 2
|
||||
Key2: None
|
||||
Pressed: gam_iObserverConfig=2;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Observe 3 Players
|
||||
Key1: Num 3
|
||||
Key2: None
|
||||
Pressed: gam_iObserverConfig=3;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Observe 4 Players
|
||||
Key1: Num 4
|
||||
Key2: None
|
||||
Pressed: gam_iObserverConfig=4;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Observe Next
|
||||
Key1: Num +
|
||||
Key2: None
|
||||
Pressed: gam_iObserverOffset=(gam_iObserverOffset+1)%16;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Observe Prev
|
||||
Key1: Num -
|
||||
Key2: None
|
||||
Pressed: gam_iObserverOffset=(gam_iObserverOffset+16-1)%16;
|
||||
Released:
|
||||
|
||||
|
||||
Button
|
||||
Name: TTRS Demo FWD one tick
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: dem_tmTimer=dem_tmTimer+0.05;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Demo Jogg
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: dem_fSyncRate=0.05;
|
||||
Released: dem_fSyncRate=-1.0;
|
||||
|
||||
Button
|
||||
Name: TTRS Demo PLAY
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: dem_fSyncRate=0.0;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Demo PAUSE
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: dem_fSyncRate=-1.0;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Demo Toggle OSD
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: dem_bOnScreenDisplay=!dem_bOnScreenDisplay;
|
||||
Released:
|
||||
|
||||
|
||||
Button
|
||||
Name: TTRS Demo Fast
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: dem_fRealTimeFactor=4.0f;
|
||||
Released: dem_fRealTimeFactor=1.0f;
|
||||
|
||||
Button
|
||||
Name: TTRS Demo Super Fast
|
||||
Key1: '
|
||||
Key2: None
|
||||
Pressed: dem_fRealTimeFactor=16.0f;
|
||||
Released: dem_fRealTimeFactor=1.0f;
|
||||
|
||||
|
||||
|
||||
Button
|
||||
Name: TTRS Time slower
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: gam_fRealTimeFactor = gam_fRealTimeFactor / 2;
|
||||
Released:
|
||||
|
||||
Button
|
||||
Name: TTRS Time faster
|
||||
Key1: None
|
||||
Key2: None
|
||||
Pressed: gam_fRealTimeFactor = gam_fRealTimeFactor * 2;
|
||||
Released:
|
||||
|
BIN
Data/Default.ifr
Normal file
BIN
Data/Default.ifr
Normal file
Binary file not shown.
233
Data/Defaults/WorldEditor.reg
Normal file
233
Data/Defaults/WorldEditor.reg
Normal file
|
@ -0,0 +1,233 @@
|
|||
REGEDIT4
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor]
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General]
|
||||
"Browser width"=dword:000000a2
|
||||
"Browser height"=dword:00000158
|
||||
"Property width"=dword:000000a2
|
||||
"Property height"=dword:0000007e
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar0]
|
||||
"BarID"=dword:0000e800
|
||||
"XPos"=dword:fffffffe
|
||||
"YPos"=dword:fffffffe
|
||||
"MRUWidth"=dword:000000c4
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81b
|
||||
"MRUDockLeftPos"=dword:fffffffe
|
||||
"MRUDockTopPos"=dword:fffffffe
|
||||
"MRUDockRightPos"=dword:000000cd
|
||||
"MRUDockBottomPos"=dword:00000018
|
||||
"MRUFloatStyle"=dword:00002000
|
||||
"MRUFloatXPos"=dword:000000be
|
||||
"MRUFloatYPos"=dword:00000118
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar1]
|
||||
"BarID"=dword:0000e803
|
||||
"XPos"=dword:0000014f
|
||||
"YPos"=dword:0000002e
|
||||
"MRUWidth"=dword:00000073
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81b
|
||||
"MRUDockLeftPos"=dword:0000014f
|
||||
"MRUDockTopPos"=dword:0000002e
|
||||
"MRUDockRightPos"=dword:00000229
|
||||
"MRUDockBottomPos"=dword:00000048
|
||||
"MRUFloatStyle"=dword:00002000
|
||||
"MRUFloatXPos"=dword:000000d9
|
||||
"MRUFloatYPos"=dword:00000118
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar10]
|
||||
"BarID"=dword:0000e808
|
||||
"XPos"=dword:fffffffe
|
||||
"YPos"=dword:0000007a
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81c
|
||||
"MRUDockLeftPos"=dword:fffffffe
|
||||
"MRUDockTopPos"=dword:0000007a
|
||||
"MRUDockRightPos"=dword:000000a0
|
||||
"MRUDockBottomPos"=dword:000001d2
|
||||
"MRUFloatStyle"=dword:00002000
|
||||
"MRUFloatXPos"=dword:000000ac
|
||||
"MRUFloatYPos"=dword:00000063
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar11]
|
||||
"BarID"=dword:0000e809
|
||||
"XPos"=dword:fffffffe
|
||||
"YPos"=dword:fffffffe
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81c
|
||||
"MRUDockLeftPos"=dword:fffffffe
|
||||
"MRUDockTopPos"=dword:fffffffe
|
||||
"MRUDockRightPos"=dword:000000a0
|
||||
"MRUDockBottomPos"=dword:0000007c
|
||||
"MRUFloatStyle"=dword:00002000
|
||||
"MRUFloatXPos"=dword:000000e5
|
||||
"MRUFloatYPos"=dword:00000062
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar12]
|
||||
"BarID"=dword:0000e81b
|
||||
"Bars"=dword:0000000d
|
||||
"Bar#0"=dword:00000000
|
||||
"Bar#1"=dword:0000e800
|
||||
"Bar#2"=dword:0000e805
|
||||
"Bar#3"=dword:0000e80b
|
||||
"Bar#4"=dword:0000e806
|
||||
"Bar#5"=dword:00000000
|
||||
"Bar#6"=dword:0000e802
|
||||
"Bar#7"=dword:0000e80a
|
||||
"Bar#8"=dword:00000000
|
||||
"Bar#9"=dword:0000e804
|
||||
"Bar#10"=dword:0000e803
|
||||
"Bar#11"=dword:0000e807
|
||||
"Bar#12"=dword:00000000
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar13]
|
||||
"BarID"=dword:0000e81c
|
||||
"Bars"=dword:00000004
|
||||
"Bar#0"=dword:00000000
|
||||
"Bar#1"=dword:0000e809
|
||||
"Bar#2"=dword:0000e808
|
||||
"Bar#3"=dword:00000000
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar15]
|
||||
"BarID"=dword:0000e81f
|
||||
"Horz"=dword:00000001
|
||||
"Floating"=dword:00000001
|
||||
"XPos"=dword:000000dc
|
||||
"YPos"=dword:00000127
|
||||
"Bars"=dword:00000003
|
||||
"Bar#0"=dword:00000000
|
||||
"Bar#1"=dword:0000e803
|
||||
"Bar#2"=dword:00000000
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar16]
|
||||
"BarID"=dword:0000e81f
|
||||
"Horz"=dword:00000001
|
||||
"Floating"=dword:00000001
|
||||
"XPos"=dword:000000c8
|
||||
"YPos"=dword:000000ec
|
||||
"Bars"=dword:00000003
|
||||
"Bar#0"=dword:00000000
|
||||
"Bar#1"=dword:0000e804
|
||||
"Bar#2"=dword:00000000
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar17]
|
||||
"BarID"=dword:0000e81f
|
||||
"Horz"=dword:00000001
|
||||
"Floating"=dword:00000001
|
||||
"XPos"=dword:000000b0
|
||||
"YPos"=dword:00000077
|
||||
"Bars"=dword:00000003
|
||||
"Bar#0"=dword:00000000
|
||||
"Bar#1"=dword:0000e808
|
||||
"Bar#2"=dword:00000000
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar2]
|
||||
"BarID"=dword:0000e801
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar3]
|
||||
"BarID"=dword:0000e802
|
||||
"XPos"=dword:fffffffe
|
||||
"YPos"=dword:00000016
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81b
|
||||
"MRUDockLeftPos"=dword:fffffffe
|
||||
"MRUDockTopPos"=dword:00000016
|
||||
"MRUDockRightPos"=dword:00000264
|
||||
"MRUDockBottomPos"=dword:00000030
|
||||
"MRUFloatStyle"=dword:00002004
|
||||
"MRUFloatXPos"=dword:9c000000
|
||||
"MRUFloatYPos"=dword:d8c8c8c8
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar4]
|
||||
"BarID"=dword:0000e807
|
||||
"XPos"=dword:00000227
|
||||
"YPos"=dword:0000002e
|
||||
"MRUWidth"=dword:000000c4
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81b
|
||||
"MRUDockLeftPos"=dword:00000227
|
||||
"MRUDockTopPos"=dword:0000002e
|
||||
"MRUDockRightPos"=dword:000002f6
|
||||
"MRUDockBottomPos"=dword:00000048
|
||||
"MRUFloatStyle"=dword:00002000
|
||||
"MRUFloatXPos"=dword:00000216
|
||||
"MRUFloatYPos"=dword:0000008e
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar5]
|
||||
"BarID"=dword:0000e804
|
||||
"XPos"=dword:fffffffe
|
||||
"YPos"=dword:0000002e
|
||||
"MRUWidth"=dword:00000148
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81b
|
||||
"MRUDockLeftPos"=dword:fffffffe
|
||||
"MRUDockTopPos"=dword:0000002e
|
||||
"MRUDockRightPos"=dword:00000151
|
||||
"MRUDockBottomPos"=dword:00000048
|
||||
"MRUFloatStyle"=dword:00002000
|
||||
"MRUFloatXPos"=dword:000000c5
|
||||
"MRUFloatYPos"=dword:000000dc
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar6]
|
||||
"BarID"=dword:0000e805
|
||||
"XPos"=dword:000000cb
|
||||
"YPos"=dword:fffffffe
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81b
|
||||
"MRUDockLeftPos"=dword:000000cb
|
||||
"MRUDockTopPos"=dword:fffffffe
|
||||
"MRUDockRightPos"=dword:0000011b
|
||||
"MRUDockBottomPos"=dword:00000018
|
||||
"MRUFloatStyle"=dword:00002004
|
||||
"MRUFloatXPos"=dword:9c000000
|
||||
"MRUFloatYPos"=dword:d8c8c8c8
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar7]
|
||||
"BarID"=dword:0000e80a
|
||||
"XPos"=dword:00000262
|
||||
"YPos"=dword:00000016
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81b
|
||||
"MRUDockLeftPos"=dword:00000262
|
||||
"MRUDockTopPos"=dword:00000016
|
||||
"MRUDockRightPos"=dword:000002db
|
||||
"MRUDockBottomPos"=dword:00000030
|
||||
"MRUFloatStyle"=dword:00002004
|
||||
"MRUFloatXPos"=dword:9c000000
|
||||
"MRUFloatYPos"=dword:d8c8c8c8
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar8]
|
||||
"BarID"=dword:0000e80b
|
||||
"XPos"=dword:00000119
|
||||
"YPos"=dword:fffffffe
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81b
|
||||
"MRUDockLeftPos"=dword:00000119
|
||||
"MRUDockTopPos"=dword:fffffffe
|
||||
"MRUDockRightPos"=dword:000001ae
|
||||
"MRUDockBottomPos"=dword:00000018
|
||||
"MRUFloatStyle"=dword:00002004
|
||||
"MRUFloatXPos"=dword:9c000000
|
||||
"MRUFloatYPos"=dword:d8c8c8c8
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Bar9]
|
||||
"BarID"=dword:0000e806
|
||||
"XPos"=dword:000001ac
|
||||
"YPos"=dword:fffffffe
|
||||
"Docking"=dword:00000001
|
||||
"MRUDockID"=dword:0000e81b
|
||||
"MRUDockLeftPos"=dword:000001ac
|
||||
"MRUDockTopPos"=dword:fffffffe
|
||||
"MRUDockRightPos"=dword:000002e2
|
||||
"MRUDockBottomPos"=dword:00000018
|
||||
"MRUFloatStyle"=dword:00002004
|
||||
"MRUFloatXPos"=dword:9c000000
|
||||
"MRUFloatYPos"=dword:d8c8c8c8
|
||||
|
||||
[HKEY_CURRENT_USER\Software\CroTeam\WorldEditor\General-Summary]
|
||||
"Bars"=dword:0000000e
|
||||
"ScreenCX"=dword:00000320
|
||||
"ScreenCY"=dword:00000258
|
5
Data/IFeel.txt
Normal file
5
Data/IFeel.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
"Default" "Data\Default.ifr"
|
||||
"HP Force Feedback Mouse" "Data\Default.ifr"
|
||||
"Primax FX" "Data\Default.ifr"
|
||||
"Logitech iFeel Mouse" "Data\Logitech.ifr"
|
||||
"Nostromo n30 Game Mouse" "Data\Default.ifr"
|
BIN
Data/Logitech.ifr
Normal file
BIN
Data/Logitech.ifr
Normal file
Binary file not shown.
10
Data/NoCRC.lst
Normal file
10
Data/NoCRC.lst
Normal file
|
@ -0,0 +1,10 @@
|
|||
*.dll
|
||||
*.wav
|
||||
*.des
|
||||
*.txt
|
||||
*.fnt
|
||||
*.tex
|
||||
*.lst
|
||||
*.tbn
|
||||
*.ogg
|
||||
*.mp3
|
57
Data/SED_TipOfTheDay.txt
Normal file
57
Data/SED_TipOfTheDay.txt
Normal file
|
@ -0,0 +1,57 @@
|
|||
Serious Editor is a very powerful tool, but you will need to get acustomized with its interface to be able to use it well.
|
||||
It is recommended that you read at least the overview section in the help file and go through the tutorials before you start working.
|
||||
$
|
||||
By pressing 'Q', you can toggle the tool window on or off manually.
|
||||
$
|
||||
By pressing 'Z', you can toggle selection rendering (colored filters) on or off.
|
||||
$
|
||||
Use DataTips!
|
||||
In Info mode, you can point to an entity, polygon, or sector to view information about it. Info mode is toggled with 'I'.
|
||||
This works on selections too.
|
||||
$
|
||||
The 'A' key is used for aligning. It will align view to selected entities, polygons or sectors. In volume mode, it will align selection volume to the view.
|
||||
$
|
||||
The character next to an entity property name shows its shortcut key. Press Shift and that key to quickly select that property.
|
||||
$
|
||||
'Alt+Shift+A' selects parent entity property, 'Alt+Shift+S' selects spawn flags entity property.
|
||||
$
|
||||
Press 'W' to view or set virtual directory keyboard shortcuts.
|
||||
$
|
||||
'Ctrl+A' will select all entities in volume. In Primitive mode, it will align primitive to view.
|
||||
$
|
||||
You can remember two view positions in world by pressing 'Ctrl+Home' or 'Ctrl+End'. To jump to the remembered positions, press 'Home' or 'End'.
|
||||
$
|
||||
'Tab'/'Shift+Tab' rotates an entity or polygon texture by 90 degrees in current view. Use 'Left Arrow'/'Right Arrow' to rotate by 15 degrees.
|
||||
$
|
||||
Press 'N' or 'Ctrl+Shift+A' to browse all entities in current selection, current volume, or entire world by their names, classes, descriptions and positions.
|
||||
$
|
||||
Use '[' and ']' keys or mouse wheel to circle through selected polygons or entities in current volume.
|
||||
You can browse through custom selection of entities by pressing 'Feed to Volume' in the Entity Browser dialog (invoked by 'N' or 'Ctrl+Shift+A' ).
|
||||
$
|
||||
By pressing the tilde key ('~'), you deselect current selection (polygons, sectors or entities, depending on the current mode).
|
||||
If you press that key twice quickly (double-click it), all selections are deselected (polygons, sectors and entities).
|
||||
$
|
||||
Pressing 'Alt+~' maximizes the view under mouse pointer to entire window, or restores the window configuration back.
|
||||
$
|
||||
Undo buffer remembers each CSG operation as one Undo/Redo step. In Preferences, you can configure number of Undo/Redo steps remembered and select whether you want entity deletion to be remembered too.
|
||||
$
|
||||
You can use 'Ctrl+W' to remember an Undo/Redo step manually while performing other tasks besides CSG, (for example when you are texturizing), so that you can Undo those actions too.
|
||||
$
|
||||
Most operations like copying, mapping adjustment, etc. work on selection, or on the object you point to with the mouse.
|
||||
For example, you can select a few polygons, point to some unselected polygon, copy properties from it, then point to the selection and paste the properties there.
|
||||
$
|
||||
If you press 'Ctrl+C' in entity or sector mode, currently selected entities are copied. In none is selected, entire world is copied.
|
||||
$
|
||||
To copy sectors without entities, press 'Ctrl+Shift+C'.
|
||||
$
|
||||
You can paste entities from clipboard to second layer by 'Ctrl+Shift+V'. This way you can safely adjust their position as a group, without them beeing snapped to the grid.
|
||||
$
|
||||
Use ','/'K' to copy/paste texture in current texture layer.
|
||||
$
|
||||
'Ctrl+Shift+V' in polygon mode will paste all polygon properties except textures.
|
||||
$
|
||||
Use 'M'/'J' to copy/paste mapping in current texture layer.
|
||||
'U' will paste mapping projected from the original position that it was copied from.
|
||||
$
|
||||
'Ctrl+Shift+V' in polygon mode will paste all polygon properties except textures.
|
||||
$
|
90
GameAgent/GameAgent.txt
Normal file
90
GameAgent/GameAgent.txt
Normal file
|
@ -0,0 +1,90 @@
|
|||
GameAgent is the replacement for gameserver management, such as the serverlist.
|
||||
|
||||
The masterserver runs on master1.croteam.org on port 9005.
|
||||
|
||||
Querying the masterserver can be done using UDP packets the following way:
|
||||
|
||||
UDP Masterserver:9005 {
|
||||
char 'e'
|
||||
}
|
||||
|
||||
This will make the masterserver respond with a list of servers currently joined and alive in the following way:
|
||||
|
||||
UDP {
|
||||
char 's'
|
||||
4 bytes of the IP (0x7F 0x00 0x00 0x01 would be 127.0.0.1)
|
||||
short of the port
|
||||
}
|
||||
|
||||
To query gameservers for their current status, use their enumeration port (server port + 1):
|
||||
|
||||
UDP Gameserver:25601 {
|
||||
byte 0x02
|
||||
}
|
||||
|
||||
An example response would be:
|
||||
|
||||
UDP {
|
||||
char '0'
|
||||
string ";players;8"
|
||||
string ";maxplayers;16"
|
||||
string ";level;Yodeller"
|
||||
string ";gametype;Fragmatch"
|
||||
string ";version;1.10"
|
||||
string ";gamename;serioussamse"
|
||||
string ";sessionname;Awesome Server"
|
||||
}
|
||||
|
||||
Note: strings in this documentation are not null terminated unless pointed out otherwise.
|
||||
|
||||
This particular server would be a fragmatch server called "Awesome Server", having 8 out of 16 players, playing on Yodeller running on version 1.10.
|
||||
|
||||
To query a gameserver for the players, you would do the following:
|
||||
|
||||
UDP Gameserver:25601 {
|
||||
byte 0x03
|
||||
}
|
||||
|
||||
An example response would be:
|
||||
|
||||
UDP {
|
||||
byte 0x01
|
||||
|
||||
"players"
|
||||
byte 0x02
|
||||
"8"
|
||||
byte 0x03
|
||||
|
||||
{ // for each player
|
||||
"player_0"
|
||||
byte 0x02
|
||||
"Angelo"
|
||||
byte 0x03
|
||||
|
||||
"frags_0"
|
||||
byte 0x02
|
||||
"14"
|
||||
byte 0x03
|
||||
|
||||
"ping_0"
|
||||
byte 0x02
|
||||
"80"
|
||||
byte 0x03
|
||||
}
|
||||
|
||||
byte 0x04
|
||||
}
|
||||
|
||||
Where "0" after the "player_" and "frags_" is the index of the player in the server, not a counter.
|
||||
|
||||
Note: Players can be sent in multiple packets. Wait for the last 0x04 byte in a packet.
|
||||
|
||||
The player querying is done differently than the server status query to work around issues with seperator characters in player names.
|
||||
|
||||
Some useful things to remember when working with this packet:
|
||||
Byte 0x01 in ASCII is SOH; start of header.
|
||||
Byte 0x02 in ASCII is STX; start of text.
|
||||
Byte 0x03 in ASCII is ETX; end of text.
|
||||
Byte 0x04 in ASCII IS EOT; end of transmission.
|
||||
|
||||
Invalid player names are indicated by either byte 0x11 or 0x12 as the player name (in "player_0").
|
107
GameAgent/main.py
Normal file
107
GameAgent/main.py
Normal file
|
@ -0,0 +1,107 @@
|
|||
#!/usr/bin/python -u
|
||||
|
||||
# GameAgent
|
||||
import socket
|
||||
import random
|
||||
import struct
|
||||
import time
|
||||
import re
|
||||
|
||||
# global user/server arrays
|
||||
servers = {}
|
||||
players = {}
|
||||
|
||||
# load user thread
|
||||
execfile("user.py")
|
||||
execfile("server.py")
|
||||
|
||||
# listen on socket
|
||||
sockListen = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
sockListen.bind(("0.0.0.0", 9005))
|
||||
print("Listening on UDP port 9005.")
|
||||
|
||||
def sendto(data, addr):
|
||||
sockListen.sendto(data, addr)
|
||||
|
||||
# format address
|
||||
def fmta(addr):
|
||||
return addr[0] + ":" + str(addr[1])
|
||||
|
||||
def server_join(data, addr):
|
||||
if(servers.has_key(fmta(addr))):
|
||||
print("Join request from server already joined!")
|
||||
print("Server join from " + fmta(addr))
|
||||
s = Server()
|
||||
s.addr = addr
|
||||
s.join()
|
||||
servers[fmta(addr)] = s
|
||||
|
||||
def server_challengeresponse(data, addr):
|
||||
if(servers.has_key(fmta(addr))):
|
||||
servers[fmta(addr)].challengeresponse(data)
|
||||
else:
|
||||
# server didn't join yet, make server join
|
||||
server_join(data, addr)
|
||||
|
||||
def server_statechanged(data, addr):
|
||||
if(servers.has_key(fmta(addr))):
|
||||
if(servers[fmta(addr)].visible):
|
||||
servers[fmta(addr)].statechanged(data)
|
||||
else:
|
||||
if(servers[fmta(addr)].prejoinactions > 5):
|
||||
servers.pop(fmta(addr))
|
||||
print("Server sent too many pre join actions, removing!")
|
||||
else:
|
||||
servers[fmta(addr)].prejoinactions += 1
|
||||
else:
|
||||
print("State change from server who didn't join yet!")
|
||||
# server didn't join yet, make server join
|
||||
server_join(data, addr)
|
||||
|
||||
def enum_trigger(data, addr):
|
||||
p = Player()
|
||||
p.addr = addr
|
||||
|
||||
buffer = "s"
|
||||
topop = ""
|
||||
for key in servers:
|
||||
server = servers[key]
|
||||
if(time.time() - server.lastheartbeat > 300):
|
||||
# 5m have passed since last heartbeat
|
||||
# server sends a heartbeat every 2.5 minutes
|
||||
# we'll kick the server out because he's not doing this
|
||||
print("Server " + fmta(server.addr) + " hasn't given a heartbeat since " + time.strftime("%c", time.gmtime(server.lastheartbeat)) + ", kicking!")
|
||||
topop += key + ","
|
||||
continue
|
||||
if(not server.visible):
|
||||
continue
|
||||
if(len(buffer) + 6 > 1024):
|
||||
sendto(buffer, addr)
|
||||
buffer = "s"
|
||||
parse = server.addr[0].split(".")
|
||||
buffer += struct.pack("BBBBH", int(parse[0]), int(parse[1]), int(parse[2]), int(parse[3]), server.port)
|
||||
sendto(buffer, addr)
|
||||
for key in topop.split(","):
|
||||
if(servers.has_key(key)):
|
||||
servers.pop(key)
|
||||
|
||||
# masterserver main loop
|
||||
while True:
|
||||
data, addr = sockListen.recvfrom(1024)
|
||||
|
||||
packets = {
|
||||
'q': server_join,
|
||||
'0': server_challengeresponse,
|
||||
'u': server_statechanged,
|
||||
|
||||
'e': enum_trigger,
|
||||
}
|
||||
|
||||
packetID = data[0]
|
||||
if(packets.has_key(packetID)):
|
||||
packets[packetID](data[1:], addr)
|
||||
else:
|
||||
print("Packet from " + addr[0] + " denied because of unknown packet " + str(ord(packetID)))
|
||||
|
||||
# server died
|
||||
print("Server shutting down.")
|
2
GameAgent/run
Normal file
2
GameAgent/run
Normal file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
python -u main.py
|
43
GameAgent/server.py
Normal file
43
GameAgent/server.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
class Server:
|
||||
def __init__(self):
|
||||
self.challenge = 0
|
||||
self.addr = ("0.0.0.0", 0)
|
||||
self.port = 25600
|
||||
self.prejoinactions = 0
|
||||
self.product = ""
|
||||
self.params = {}
|
||||
self.paramsallowed = "port;players;maxplayers;level;gametype;version"
|
||||
self.visible = False
|
||||
self.lastheartbeat = time.time()
|
||||
|
||||
def join(self):
|
||||
self.challenge = random.randint(0x00000000, 0x7FFFFFFF)
|
||||
self.port = self.addr[1] - 1
|
||||
sendto("\1" + struct.pack("i", self.challenge), addr)
|
||||
|
||||
def challengeresponse(self, data):
|
||||
params = re.findall(";(\w+);([^;]*)", data)
|
||||
valid = False
|
||||
for param in params:
|
||||
key = param[0]
|
||||
val = param[1]
|
||||
if(key == "challenge"):
|
||||
if(val == str(self.challenge)):
|
||||
valid = True
|
||||
continue
|
||||
if(key == "product"):
|
||||
self.product = val
|
||||
continue
|
||||
try:
|
||||
self.paramsallowed.split(";").index(key)
|
||||
self.params[key] = val
|
||||
except:
|
||||
pass
|
||||
if(not self.visible):
|
||||
if(valid):
|
||||
self.visible = True
|
||||
else:
|
||||
self.lastheartbeat = time.time()
|
||||
|
||||
def statechanged(self, data):
|
||||
print("state changed: " + data)
|
3
GameAgent/user.py
Normal file
3
GameAgent/user.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Player:
|
||||
def __init__(self):
|
||||
self.addr = ("0.0.0.0", 0)
|
2
Help/seriouseditorcontext.hlk
Normal file
2
Help/seriouseditorcontext.hlk
Normal file
|
@ -0,0 +1,2 @@
|
|||
CHM
|
||||
Help\serious_editor_item_by_item.chm
|
1
ModEXT.txt
Normal file
1
ModEXT.txt
Normal file
|
@ -0,0 +1 @@
|
|||
MP
|
1
Players/about_this_directory.txt
Normal file
1
Players/about_this_directory.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Player files (Player0.plr, Player1.plr etc) are generated automatically in this folder. They are used for identification of players in multiplayer mode. You should not distribute .plr files together with any engine build because it might result in connection errors among network players.
|
BIN
SE1_10.gro
Normal file
BIN
SE1_10.gro
Normal file
Binary file not shown.
38
Scripts/Dedicated_startup.ini
Normal file
38
Scripts/Dedicated_startup.ini
Normal file
|
@ -0,0 +1,38 @@
|
|||
// startup script for dedicated server
|
||||
|
||||
// make all textures and shadows as low quality as possible - this effectively makes it take almost no memory
|
||||
tex_iNormalQuality=11;
|
||||
tex_iAnimationQuality=11;
|
||||
tex_fNormalSize=1;
|
||||
tex_fAnimationSize=1;
|
||||
tex_fEffectSize=1;
|
||||
tex_fForceLowQuality=1;
|
||||
tex_fForceHighQuality=0;
|
||||
tex_bFineEffect=0;
|
||||
shd_fStaticSize=1;
|
||||
shd_fDynamicSize=1;
|
||||
shd_bFineQuality=0;
|
||||
shd_bCacheAll=0;
|
||||
|
||||
// here we put extra settings for GameSpy that users will be able to see in their browsers
|
||||
// it is best that you fill-in this info, so users can see what they are connecting to
|
||||
// example would be:
|
||||
// gam_strGameSpyExtras = "\\dedicatedserver\\yes\\system\\PIII@500/512MB/Win2k\\connection\\T1\\admin\\sam@hotmail.com";
|
||||
// just take care to format those backslashes right and always add the settings in pairs key-value
|
||||
|
||||
gam_strGameSpyExtras = "\\dedicatedserver\\yes\\connection\\<not_configured>\\admin\\<not_configured>";
|
||||
|
||||
|
||||
// if you are running on a multihomed computer, you'll have to
|
||||
// setup the ip on which you want the server to be visible here,
|
||||
// in this syntax:
|
||||
// net_strLocalHost = "server.ip.goes.here";
|
||||
|
||||
// also, you might want to manually setup your location description,
|
||||
// so that people know how far your server is from them
|
||||
// if you don't set it up, it will automatically read your country code
|
||||
// from locale settings in Windows, but you might want to put exact
|
||||
// country and city where you are
|
||||
// here is an example:
|
||||
// net_strLocationCode="Zagreb, Croatia";
|
||||
|
2
Scripts/NetSettings/56-normal.des
Normal file
2
Scripts/NetSettings/56-normal.des
Normal file
|
@ -0,0 +1,2 @@
|
|||
56k modem - average connection
|
||||
if you have 56k modem and the connection is average
|
4
Scripts/NetSettings/56-normal.ini
Normal file
4
Scripts/NetSettings/56-normal.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
cli_bPrediction = 1;
|
||||
cli_iBufferActions = 5;
|
||||
cli_iMinBPS = 3000;
|
||||
cli_iMaxBPS = 5000;
|
2
Scripts/NetSettings/56k-quality.des
Normal file
2
Scripts/NetSettings/56k-quality.des
Normal file
|
@ -0,0 +1,2 @@
|
|||
56k modem - high quality connection
|
||||
if you have 56k modem and the connection is above average
|
4
Scripts/NetSettings/56k-quality.ini
Normal file
4
Scripts/NetSettings/56k-quality.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
cli_bPrediction = 1;
|
||||
cli_iBufferActions = 3;
|
||||
cli_iMinBPS = 3000;
|
||||
cli_iMaxBPS = 5000;
|
2
Scripts/NetSettings/DSLCable.des
Normal file
2
Scripts/NetSettings/DSLCable.des
Normal file
|
@ -0,0 +1,2 @@
|
|||
xDSL or Cable modem
|
||||
if you have any kind of DSL or cable modem
|
4
Scripts/NetSettings/DSLCable.ini
Normal file
4
Scripts/NetSettings/DSLCable.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
cli_bPrediction = 1;
|
||||
cli_iBufferActions = 2;
|
||||
cli_iMinBPS = 6000;
|
||||
cli_iMaxBPS = 10000;
|
2
Scripts/NetSettings/ISDN.des
Normal file
2
Scripts/NetSettings/ISDN.des
Normal file
|
@ -0,0 +1,2 @@
|
|||
ISDN
|
||||
if you have an ISDN link
|
4
Scripts/NetSettings/ISDN.ini
Normal file
4
Scripts/NetSettings/ISDN.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
cli_bPrediction = 1;
|
||||
cli_iBufferActions = 2;
|
||||
cli_iMinBPS = 5000;
|
||||
cli_iMaxBPS = 10000;
|
2
Scripts/NetSettings/LAN.des
Normal file
2
Scripts/NetSettings/LAN.des
Normal file
|
@ -0,0 +1,2 @@
|
|||
LAN gaming
|
||||
use this when playing in LAN
|
4
Scripts/NetSettings/LAN.ini
Normal file
4
Scripts/NetSettings/LAN.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
cli_bPrediction = 0; // turn off prediction
|
||||
cli_iBufferActions = 1; // no buffering == maximum responsiveness
|
||||
cli_iMinBPS = 6000;
|
||||
cli_iMaxBPS = 100000;
|
2
Scripts/NetSettings/OldModem.des
Normal file
2
Scripts/NetSettings/OldModem.des
Normal file
|
@ -0,0 +1,2 @@
|
|||
33.6k modem or older
|
||||
if you have a old modem, slower than 56k
|
4
Scripts/NetSettings/OldModem.ini
Normal file
4
Scripts/NetSettings/OldModem.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
cli_bPrediction = 1;
|
||||
cli_iBufferActions = 5;
|
||||
cli_iMinBPS = 2500;
|
||||
cli_iMaxBPS = 2500;
|
443
Scripts/PersistentSymbols.ini
Normal file
443
Scripts/PersistentSymbols.ini
Normal file
|
@ -0,0 +1,443 @@
|
|||
// automatically saved persistent symbols:
|
||||
persistent extern user INDEX con_iLastLines=(INDEX)5;
|
||||
tmp_af[0]=(FLOAT)0;
|
||||
tmp_af[1]=(FLOAT)0;
|
||||
tmp_af[2]=(FLOAT)0;
|
||||
tmp_af[3]=(FLOAT)0;
|
||||
tmp_af[4]=(FLOAT)0;
|
||||
tmp_af[5]=(FLOAT)0;
|
||||
tmp_af[6]=(FLOAT)0;
|
||||
tmp_af[7]=(FLOAT)0;
|
||||
tmp_af[8]=(FLOAT)0;
|
||||
tmp_af[9]=(FLOAT)0;
|
||||
tmp_ai[0]=(INDEX)0;
|
||||
tmp_ai[1]=(INDEX)0;
|
||||
tmp_ai[2]=(INDEX)0;
|
||||
tmp_ai[3]=(INDEX)0;
|
||||
tmp_ai[4]=(INDEX)0;
|
||||
tmp_ai[5]=(INDEX)0;
|
||||
tmp_ai[6]=(INDEX)0;
|
||||
tmp_ai[7]=(INDEX)0;
|
||||
tmp_ai[8]=(INDEX)0;
|
||||
tmp_ai[9]=(INDEX)0;
|
||||
persistent extern user INDEX tmp_i=(INDEX)0;
|
||||
persistent extern user FLOAT tmp_fAdd=(FLOAT)0;
|
||||
persistent extern user INDEX fil_bPreferZips=(INDEX)0;
|
||||
persistent extern user INDEX ogl_bUseCompiledVertexArrays=(INDEX)101;
|
||||
persistent extern user INDEX ogl_bExclusive=(INDEX)1;
|
||||
persistent extern user INDEX ogl_bAllowQuadArrays=(INDEX)0;
|
||||
persistent extern user INDEX ogl_iTextureCompressionType=(INDEX)1;
|
||||
persistent extern user INDEX ogl_iMaxBurstSize=(INDEX)0;
|
||||
persistent extern user INDEX ogl_bGrabDepthBuffer=(INDEX)0;
|
||||
persistent extern user INDEX ogl_iFinish=(INDEX)1;
|
||||
persistent extern user INDEX ogl_iTBufferEffect=(INDEX)0;
|
||||
persistent extern user INDEX ogl_iTBufferSamples=(INDEX)2;
|
||||
persistent extern user INDEX ogl_bTruformLinearNormals=(INDEX)1;
|
||||
persistent extern user INDEX ogl_bAlternateClipPlane=(INDEX)0;
|
||||
persistent extern user INDEX d3d_bUseHardwareTnL=(INDEX)1;
|
||||
persistent extern user INDEX d3d_iMaxBurstSize=(INDEX)0;
|
||||
persistent extern user INDEX d3d_iVertexBuffersSize=(INDEX)1024;
|
||||
persistent extern user INDEX d3d_iVertexRangeTreshold=(INDEX)99;
|
||||
persistent extern user INDEX d3d_bAlternateDepthReads=(INDEX)0;
|
||||
persistent extern INDEX d3d_bFastUpload=(INDEX)1;
|
||||
persistent extern user INDEX d3d_iFinish=(INDEX)0;
|
||||
persistent extern user INDEX gap_iUseTextureUnits=(INDEX)4;
|
||||
persistent extern user INDEX gap_iTextureFiltering=(INDEX)21;
|
||||
persistent extern user INDEX gap_iTextureAnisotropy=(INDEX)1;
|
||||
persistent extern user FLOAT gap_fTextureLODBias=(FLOAT)0;
|
||||
persistent extern user INDEX gap_bAllowGrayTextures=(INDEX)1;
|
||||
persistent extern user INDEX gap_bAllowSingleMipmap=(INDEX)1;
|
||||
persistent extern user INDEX gap_bOptimizeStateChanges=(INDEX)1;
|
||||
persistent extern user INDEX gap_iOptimizeDepthReads=(INDEX)1;
|
||||
persistent extern user INDEX gap_iOptimizeClipping=(INDEX)2;
|
||||
persistent extern user INDEX gap_iSwapInterval=(INDEX)0;
|
||||
persistent extern user INDEX gap_iRefreshRate=(INDEX)0;
|
||||
persistent extern user INDEX gap_iDithering=(INDEX)2;
|
||||
persistent extern user INDEX gap_bForceTruform=(INDEX)0;
|
||||
persistent extern user INDEX gap_iTruformLevel=(INDEX)0;
|
||||
persistent extern user INDEX gap_iDepthBits=(INDEX)0;
|
||||
persistent extern user INDEX gap_iStencilBits=(INDEX)0;
|
||||
persistent extern user FLOAT mdl_fLODMul=(FLOAT)1;
|
||||
persistent extern user FLOAT mdl_fLODAdd=(FLOAT)0;
|
||||
persistent extern user INDEX mdl_iLODDisappear=(INDEX)1;
|
||||
persistent extern user INDEX mdl_bRenderDetail=(INDEX)1;
|
||||
persistent extern user INDEX mdl_bRenderSpecular=(INDEX)1;
|
||||
persistent extern user INDEX mdl_bRenderReflection=(INDEX)1;
|
||||
persistent extern user INDEX mdl_bAllowOverbright=(INDEX)1;
|
||||
persistent extern user INDEX mdl_bFineQuality=(INDEX)1;
|
||||
persistent extern user INDEX mdl_iShadowQuality=(INDEX)1;
|
||||
persistent extern user FLOAT ska_fLODMul=(FLOAT)1;
|
||||
persistent extern user FLOAT ska_fLODAdd=(FLOAT)0;
|
||||
persistent extern user FLOAT gfx_tmProbeDecay=(FLOAT)30;
|
||||
persistent extern user INDEX gfx_iProbeSize=(INDEX)256;
|
||||
persistent extern user INDEX gfx_bClearScreen=(INDEX)0;
|
||||
persistent extern user INDEX gfx_bDisableMultiMonSupport=(INDEX)1;
|
||||
persistent extern user INDEX gfx_bDisableWindowsKeys=(INDEX)1;
|
||||
persistent extern user INDEX gfx_bDecoratedText=(INDEX)1;
|
||||
persistent extern user INDEX tex_iNormalQuality=(INDEX)22;
|
||||
persistent extern user INDEX tex_iAnimationQuality=(INDEX)11;
|
||||
persistent extern user INDEX tex_bFineEffect=(INDEX)0;
|
||||
persistent extern user INDEX tex_bFineFog=(INDEX)1;
|
||||
persistent extern user INDEX tex_iNormalSize=(INDEX)9;
|
||||
persistent extern user INDEX tex_iAnimationSize=(INDEX)7;
|
||||
persistent extern user INDEX tex_iEffectSize=(INDEX)7;
|
||||
persistent extern user INDEX tex_iFogSize=(INDEX)7;
|
||||
persistent extern user INDEX tex_bCompressAlphaChannel=(INDEX)0;
|
||||
persistent extern user INDEX tex_bAlternateCompression=(INDEX)0;
|
||||
persistent extern user INDEX tex_bDynamicMipmaps=(INDEX)0;
|
||||
persistent extern user INDEX tex_iDithering=(INDEX)3;
|
||||
persistent extern user INDEX tex_iFiltering=(INDEX)0;
|
||||
persistent extern user INDEX tex_iEffectFiltering=(INDEX)4;
|
||||
persistent extern user INDEX tex_bProgressiveFilter=(INDEX)0;
|
||||
persistent extern user INDEX shd_iStaticSize=(INDEX)8;
|
||||
persistent extern user INDEX shd_iDynamicSize=(INDEX)8;
|
||||
persistent extern user INDEX shd_bFineQuality=(INDEX)1;
|
||||
persistent extern user INDEX shd_iAllowDynamic=(INDEX)1;
|
||||
persistent extern user INDEX shd_bDynamicMipmaps=(INDEX)1;
|
||||
persistent extern user INDEX shd_iFiltering=(INDEX)3;
|
||||
persistent extern user INDEX shd_iDithering=(INDEX)1;
|
||||
persistent extern user FLOAT shd_tmFlushDelay=(FLOAT)30;
|
||||
persistent extern user FLOAT shd_fCacheSize=(FLOAT)8;
|
||||
persistent extern user INDEX shd_bCacheAll=(INDEX)0;
|
||||
persistent extern user INDEX shd_bAllowFlats=(INDEX)1;
|
||||
persistent extern INDEX shd_iForceFlats=(INDEX)0;
|
||||
persistent extern user INDEX gfx_iLensFlareQuality=(INDEX)3;
|
||||
persistent extern user INDEX wld_bTextureLayers=(INDEX)111;
|
||||
persistent extern user INDEX wld_bRenderMirrors=(INDEX)1;
|
||||
persistent extern user FLOAT wld_fEdgeOffsetI=(FLOAT)0;
|
||||
persistent extern user FLOAT wld_fEdgeAdjustK=(FLOAT)1;
|
||||
persistent extern user INDEX wld_iDetailRemovingBias=(INDEX)3;
|
||||
persistent extern user INDEX wed_bUseBaseForReplacement=(INDEX)0;
|
||||
persistent extern user INDEX tex_iHueShift=(INDEX)0;
|
||||
persistent extern user FLOAT tex_fSaturation=(FLOAT)1;
|
||||
persistent extern user INDEX shd_iHueShift=(INDEX)0;
|
||||
persistent extern user FLOAT shd_fSaturation=(FLOAT)1;
|
||||
persistent extern user INDEX gfx_iHueShift=(INDEX)0;
|
||||
persistent extern user FLOAT gfx_fSaturation=(FLOAT)1;
|
||||
persistent extern user FLOAT gfx_fBrightness=(FLOAT)0;
|
||||
persistent extern user FLOAT gfx_fContrast=(FLOAT)1;
|
||||
persistent extern user FLOAT gfx_fGamma=(FLOAT)1;
|
||||
persistent extern user FLOAT gfx_fBiasR=(FLOAT)1;
|
||||
persistent extern user FLOAT gfx_fBiasG=(FLOAT)1;
|
||||
persistent extern user FLOAT gfx_fBiasB=(FLOAT)1;
|
||||
persistent extern user INDEX gfx_iLevels=(INDEX)256;
|
||||
persistent extern user INDEX gfx_iStereo=(INDEX)0;
|
||||
persistent extern user INDEX gfx_bStereoInvert=(INDEX)0;
|
||||
persistent extern user INDEX gfx_iStereoOffset=(INDEX)10;
|
||||
persistent extern user FLOAT gfx_fStereoSeparation=(FLOAT)0.25;
|
||||
persistent extern user FLOAT snd_fEarsDistance=(FLOAT)0.2;
|
||||
persistent extern user FLOAT snd_fDelaySoundSpeed=(FLOAT)1e+010;
|
||||
persistent extern user FLOAT snd_fDopplerSoundSpeed=(FLOAT)330;
|
||||
persistent extern user FLOAT snd_fPanStrength=(FLOAT)0.1;
|
||||
persistent extern user FLOAT snd_fLRFilter=(FLOAT)3;
|
||||
persistent extern user FLOAT snd_fBFilter=(FLOAT)5;
|
||||
persistent extern user FLOAT snd_fUFilter=(FLOAT)1;
|
||||
persistent extern user FLOAT snd_fDFilter=(FLOAT)3;
|
||||
persistent extern user FLOAT snd_fSoundVolume=(FLOAT)1;
|
||||
persistent extern user FLOAT snd_fMusicVolume=(FLOAT)1;
|
||||
persistent extern user FLOAT snd_fNormalizer=(FLOAT)0.9;
|
||||
persistent extern user FLOAT snd_tmMixAhead=(FLOAT)0.2;
|
||||
persistent extern user INDEX snd_iInterface=(INDEX)1;
|
||||
persistent extern user INDEX snd_iDevice=(INDEX)-1;
|
||||
persistent extern user INDEX snd_iFormat=(INDEX)3;
|
||||
persistent extern user INDEX snd_iMaxExtraChannels=(INDEX)32;
|
||||
persistent extern user INDEX snd_iMaxOpenRetries=(INDEX)3;
|
||||
persistent extern user FLOAT snd_tmOpenFailDelay=(FLOAT)0.5;
|
||||
persistent extern user FLOAT snd_fEAXPanning=(FLOAT)0;
|
||||
persistent extern user INDEX gam_bPretouch=(INDEX)0;
|
||||
persistent extern user CTString cmd_cmdOnTick="";
|
||||
persistent extern user CTString cmd_cmdOnChat="";
|
||||
persistent extern user INDEX ent_bReportSpawnInWall=(INDEX)0;
|
||||
persistent extern user FLOAT ser_tmSyncCheckFrequency=(FLOAT)1;
|
||||
persistent extern user INDEX ser_iSyncCheckBuffer=(INDEX)60;
|
||||
persistent extern user INDEX cli_bLerpActions=(INDEX)0;
|
||||
persistent extern user INDEX cli_bReportPredicted=(INDEX)0;
|
||||
persistent extern user INDEX net_iExactTimer=(INDEX)2;
|
||||
persistent extern user CTString net_strLocalHost="";
|
||||
persistent extern user CTString net_strLocationCode="";
|
||||
persistent extern user INDEX ser_iExtensiveSyncCheck=(INDEX)0;
|
||||
persistent extern user INDEX net_bLookupHostNames=(INDEX)0;
|
||||
persistent extern user INDEX net_iCompression=(INDEX)1;
|
||||
persistent extern user INDEX net_bReportPackets=(INDEX)0;
|
||||
persistent extern user INDEX net_iMaxSendRetries=(INDEX)10;
|
||||
persistent extern user FLOAT net_fSendRetryWait=(FLOAT)0.5;
|
||||
persistent extern user INDEX net_bReportTraffic=(INDEX)0;
|
||||
persistent extern user INDEX net_bReportICMPErrors=(INDEX)0;
|
||||
persistent extern user INDEX net_bReportMiscErrors=(INDEX)0;
|
||||
persistent extern user INDEX net_bLerping=(INDEX)1;
|
||||
persistent extern user INDEX ser_bClientsMayPause=(INDEX)1;
|
||||
persistent extern user INDEX ser_bEnumeration=(INDEX)1;
|
||||
persistent extern user INDEX ser_bPingGameAgent=(INDEX)1;
|
||||
persistent extern user FLOAT ser_tmKeepAlive=(FLOAT)0.1;
|
||||
persistent extern user FLOAT ser_tmPingUpdate=(FLOAT)3;
|
||||
persistent extern user INDEX ser_bWaitFirstPlayer=(INDEX)0;
|
||||
persistent extern user INDEX ser_iMaxAllowedBPS=(INDEX)8000;
|
||||
persistent extern user CTString ser_strIPMask="";
|
||||
persistent extern user CTString ser_strNameMask="";
|
||||
persistent extern user INDEX ser_bInverseBanning=(INDEX)0;
|
||||
persistent extern user CTString ser_strMOTD="";
|
||||
persistent extern user INDEX cli_bAutoAdjustSettings=(INDEX)0;
|
||||
persistent extern user FLOAT cli_tmAutoAdjustThreshold=(FLOAT)2;
|
||||
persistent extern user INDEX cli_bPrediction=(INDEX)0;
|
||||
persistent extern user INDEX cli_iMaxPredictionSteps=(INDEX)10;
|
||||
persistent extern user INDEX cli_bPredictIfServer=(INDEX)0;
|
||||
persistent extern user INDEX cli_bPredictLocalPlayers=(INDEX)1;
|
||||
persistent extern user INDEX cli_bPredictRemotePlayers=(INDEX)0;
|
||||
persistent extern user FLOAT cli_fPredictEntitiesRange=(FLOAT)20;
|
||||
persistent extern user FLOAT cli_fPredictionFilter=(FLOAT)0.5;
|
||||
persistent extern user INDEX cli_iSendBehind=(INDEX)3;
|
||||
persistent extern user INDEX cli_iPredictionFlushing=(INDEX)1;
|
||||
persistent extern user INDEX cli_iBufferActions=(INDEX)1;
|
||||
persistent extern user INDEX cli_iMaxBPS=(INDEX)4000;
|
||||
persistent extern user INDEX cli_iMinBPS=(INDEX)100;
|
||||
persistent extern user INDEX net_iGraphBuffer=(INDEX)100;
|
||||
persistent extern user INDEX gam_iPrecachePolicy=(INDEX)1;
|
||||
persistent extern user INDEX inp_iKeyboardReadingMethod=(INDEX)2;
|
||||
persistent extern user INDEX inp_bAllowMouseAcceleration=(INDEX)1;
|
||||
persistent extern user FLOAT inp_fMouseSensitivity=(FLOAT)1;
|
||||
persistent extern user INDEX inp_bMousePrecision=(INDEX)0;
|
||||
persistent extern user FLOAT inp_fMousePrecisionFactor=(FLOAT)4;
|
||||
persistent extern user FLOAT inp_fMousePrecisionThreshold=(FLOAT)10;
|
||||
persistent extern user FLOAT inp_fMousePrecisionTimeout=(FLOAT)0.25;
|
||||
persistent extern user INDEX inp_bInvertMouse=(INDEX)0;
|
||||
persistent extern user INDEX inp_bFilterMouse=(INDEX)0;
|
||||
persistent extern user INDEX inp_bAllowPrescan=(INDEX)1;
|
||||
persistent extern user INDEX inp_i2ndMousePort=(INDEX)0;
|
||||
persistent extern user INDEX inp_bInvert2ndMouse=(INDEX)0;
|
||||
persistent extern user INDEX inp_bFilter2ndMouse=(INDEX)0;
|
||||
persistent extern user FLOAT inp_f2ndMouseSensitivity=(FLOAT)1;
|
||||
persistent extern user INDEX inp_b2ndMousePrecision=(INDEX)0;
|
||||
persistent extern user FLOAT inp_f2ndMousePrecisionFactor=(FLOAT)4;
|
||||
persistent extern user FLOAT inp_f2ndMousePrecisionThreshold=(FLOAT)10;
|
||||
persistent extern user FLOAT inp_f2ndMousePrecisionTimeout=(FLOAT)0.25;
|
||||
persistent extern user INDEX inp_bMsgDebugger=(INDEX)0;
|
||||
persistent extern user INDEX inp_iMButton4Up=(INDEX)131072;
|
||||
persistent extern user INDEX inp_iMButton4Dn=(INDEX)131136;
|
||||
persistent extern user INDEX inp_iMButton5Up=(INDEX)65536;
|
||||
persistent extern user INDEX inp_iMButton5Dn=(INDEX)65568;
|
||||
persistent extern user INDEX inp_ctJoysticksAllowed=(INDEX)8;
|
||||
persistent extern user INDEX inp_bForceJoystickPolling=(INDEX)0;
|
||||
persistent extern user INDEX inp_bAutoDisableJoysticks=(INDEX)0;
|
||||
persistent extern user INDEX wed_bUseGenericTextureReplacement=(INDEX)0;
|
||||
persistent extern user FLOAT ctl_tmComputerDoubleClick=(FLOAT)0.5;
|
||||
persistent extern user FLOAT ctl_fButtonRotationSpeedH=(FLOAT)300;
|
||||
persistent extern user FLOAT ctl_fButtonRotationSpeedP=(FLOAT)150;
|
||||
persistent extern user FLOAT ctl_fButtonRotationSpeedB=(FLOAT)150;
|
||||
persistent extern user FLOAT ctl_fAxisStrafingModifier=(FLOAT)1;
|
||||
persistent extern user FLOAT cli_fPredictPlayersRange=(FLOAT)0;
|
||||
persistent extern user FLOAT cli_fPredictItemsRange=(FLOAT)3;
|
||||
persistent extern user FLOAT cli_tmPredictFoe=(FLOAT)10;
|
||||
persistent extern user FLOAT cli_tmPredictAlly=(FLOAT)10;
|
||||
persistent extern user FLOAT cli_tmPredictEnemy=(FLOAT)10;
|
||||
persistent extern user INDEX hud_bShowLatency=(INDEX)0;
|
||||
persistent extern user INDEX hud_iShowPlayers=(INDEX)-1;
|
||||
persistent extern user INDEX hud_iSortPlayers=(INDEX)-1;
|
||||
persistent extern user INDEX hud_bShowWeapon=(INDEX)1;
|
||||
persistent extern user INDEX hud_bShowMessages=(INDEX)1;
|
||||
persistent extern user FLOAT hud_fScaling=(FLOAT)1;
|
||||
persistent extern user FLOAT hud_fOpacity=(FLOAT)0.9;
|
||||
persistent extern user FLOAT hud_tmWeaponsOnScreen=(FLOAT)3;
|
||||
persistent extern user FLOAT hud_tmLatencySnapshot=(FLOAT)1;
|
||||
persistent extern user FLOAT plr_fBreathingStrength=(FLOAT)0;
|
||||
persistent extern user INDEX hud_bShowMatchInfo=(INDEX)1;
|
||||
wpn_fRecoilSpeed[0]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[1]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[2]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[3]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[4]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[5]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[6]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[7]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[8]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[9]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[10]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[11]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[12]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[13]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[14]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[15]=(FLOAT)0;
|
||||
wpn_fRecoilSpeed[16]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[0]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[1]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[2]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[3]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[4]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[5]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[6]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[7]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[8]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[9]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[10]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[11]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[12]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[13]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[14]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[15]=(FLOAT)0;
|
||||
wpn_fRecoilLimit[16]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[0]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[1]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[2]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[3]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[4]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[5]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[6]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[7]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[8]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[9]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[10]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[11]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[12]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[13]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[14]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[15]=(FLOAT)0;
|
||||
wpn_fRecoilDampUp[16]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[0]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[1]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[2]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[3]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[4]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[5]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[6]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[7]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[8]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[9]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[10]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[11]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[12]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[13]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[14]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[15]=(FLOAT)0;
|
||||
wpn_fRecoilDampDn[16]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[0]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[1]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[2]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[3]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[4]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[5]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[6]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[7]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[8]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[9]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[10]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[11]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[12]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[13]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[14]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[15]=(FLOAT)0;
|
||||
wpn_fRecoilOffset[16]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[0]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[1]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[2]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[3]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[4]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[5]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[6]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[7]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[8]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[9]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[10]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[11]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[12]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[13]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[14]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[15]=(FLOAT)0;
|
||||
wpn_fRecoilFactorP[16]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[0]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[1]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[2]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[3]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[4]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[5]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[6]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[7]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[8]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[9]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[10]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[11]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[12]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[13]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[14]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[15]=(FLOAT)0;
|
||||
wpn_fRecoilFactorZ[16]=(FLOAT)0;
|
||||
persistent extern user FLOAT plr_fFOV=(FLOAT)90;
|
||||
persistent extern user FLOAT plr_fFrontClipDistance=(FLOAT)0.25;
|
||||
persistent extern user INDEX plr_bRenderPicked=(INDEX)0;
|
||||
persistent extern user INDEX plr_bRenderPickedParticles=(INDEX)0;
|
||||
persistent extern user INDEX plr_bOnlySam=(INDEX)0;
|
||||
persistent extern user INDEX ent_bReportBrokenChains=(INDEX)0;
|
||||
persistent extern user FLOAT ent_tmMentalIn=(FLOAT)0.5;
|
||||
persistent extern user FLOAT ent_tmMentalOut=(FLOAT)0.75;
|
||||
persistent extern user FLOAT ent_tmMentalFade=(FLOAT)0.5;
|
||||
persistent extern user FLOAT gfx_fEnvParticlesDensity=(FLOAT)1;
|
||||
persistent extern user FLOAT gfx_fEnvParticlesRange=(FLOAT)1;
|
||||
persistent extern user INDEX hud_bCrosshairFixed=(INDEX)0;
|
||||
persistent extern user INDEX hud_bCrosshairColoring=(INDEX)1;
|
||||
persistent extern user FLOAT hud_fCrosshairScale=(FLOAT)1;
|
||||
persistent extern user FLOAT hud_fCrosshairRatio=(FLOAT)0.5;
|
||||
persistent extern user FLOAT hud_fCrosshairOpacity=(FLOAT)1;
|
||||
persistent extern user INDEX hud_bShowPlayerName=(INDEX)1;
|
||||
persistent extern user INDEX hud_bShowCoords=(INDEX)0;
|
||||
persistent extern user FLOAT plr_tmSnoopingTime=(FLOAT)1;
|
||||
persistent extern user FLOAT plr_tmSnoopingDelay=(FLOAT)1;
|
||||
persistent extern user FLOAT inp_fIFeelGain=(FLOAT)1;
|
||||
persistent extern INDEX sam_bFullScreen=(INDEX)0;
|
||||
persistent extern INDEX sam_iScreenSizeI=(INDEX)1024;
|
||||
persistent extern INDEX sam_iScreenSizeJ=(INDEX)768;
|
||||
persistent extern INDEX sam_iDisplayDepth=(INDEX)0;
|
||||
persistent extern INDEX sam_iDisplayAdapter=(INDEX)0;
|
||||
persistent extern INDEX sam_iGfxAPI=(INDEX)0;
|
||||
persistent extern INDEX sam_bFirstStarted=(INDEX)0;
|
||||
persistent extern INDEX sam_bAutoAdjustAudio=(INDEX)1;
|
||||
persistent extern user INDEX sam_bWideScreen=(INDEX)0;
|
||||
persistent extern user FLOAT sam_fPlayerOffset=(FLOAT)0;
|
||||
persistent extern user INDEX sam_bAutoPlayDemos=(INDEX)1;
|
||||
persistent extern user INDEX sam_iMaxFPSActive=(INDEX)500;
|
||||
persistent extern user INDEX sam_iMaxFPSInactive=(INDEX)10;
|
||||
persistent extern user INDEX sam_bPauseOnMinimize=(INDEX)1;
|
||||
persistent extern user FLOAT sam_tmDisplayModeReport=(FLOAT)5;
|
||||
persistent extern user CTString sam_strNetworkSettings="";
|
||||
persistent extern user CTString sam_strIntroLevel="Levels\\LevelsMP\\Intro.wld";
|
||||
persistent extern user CTString sam_strGameName="serioussamse";
|
||||
persistent extern INDEX sam_bShowAllLevels=(INDEX)0;
|
||||
persistent extern INDEX sam_bMentalActivated=(INDEX)0;
|
||||
persistent extern user INDEX sam_iVideoSetup=(INDEX)3;
|
||||
persistent extern user INDEX hud_bShowTime=(INDEX)0;
|
||||
persistent extern user INDEX hud_bShowClock=(INDEX)0;
|
||||
persistent extern user INDEX dem_iProfileRate=(INDEX)5;
|
||||
persistent extern user INDEX hud_bShowNetGraph=(INDEX)0;
|
||||
persistent extern user FLOAT gam_fManaTransferFactor=(FLOAT)0.5;
|
||||
persistent extern user FLOAT gam_fExtraEnemyStrength=(FLOAT)0;
|
||||
persistent extern user FLOAT gam_fExtraEnemyStrengthPerPlayer=(FLOAT)0;
|
||||
persistent extern user INDEX gam_iInitialMana=(INDEX)100;
|
||||
persistent extern user INDEX gam_iScoreLimit=(INDEX)100000;
|
||||
persistent extern user INDEX gam_iFragLimit=(INDEX)20;
|
||||
persistent extern user INDEX gam_iTimeLimit=(INDEX)0;
|
||||
persistent extern user INDEX gam_ctMaxPlayers=(INDEX)8;
|
||||
persistent extern user INDEX gam_bWaitAllPlayers=(INDEX)0;
|
||||
persistent extern user INDEX gam_bFriendlyFire=(INDEX)0;
|
||||
persistent extern user INDEX gam_bPlayEntireGame=(INDEX)1;
|
||||
persistent extern user INDEX gam_bWeaponsStay=(INDEX)1;
|
||||
persistent extern user INDEX gam_bAmmoStays=(INDEX)1;
|
||||
persistent extern user INDEX gam_bHealthArmorStays=(INDEX)1;
|
||||
persistent extern user INDEX gam_bAllowHealth=(INDEX)1;
|
||||
persistent extern user INDEX gam_bAllowArmor=(INDEX)1;
|
||||
persistent extern user INDEX gam_bInfiniteAmmo=(INDEX)0;
|
||||
persistent extern user INDEX gam_bRespawnInPlace=(INDEX)1;
|
||||
persistent extern user INDEX gam_iCredits=(INDEX)-1;
|
||||
persistent extern user FLOAT gam_tmSpawnInvulnerability=(FLOAT)3;
|
||||
persistent extern user INDEX gam_iBlood=(INDEX)2;
|
||||
persistent extern user INDEX gam_bGibs=(INDEX)1;
|
||||
persistent extern user INDEX gam_bUseExtraEnemies=(INDEX)1;
|
||||
persistent extern user INDEX gam_iStartDifficulty=(INDEX)1;
|
||||
persistent extern user INDEX gam_iStartMode=(INDEX)-1;
|
||||
persistent extern user CTString gam_strGameAgentExtras="";
|
||||
persistent extern user CTString gam_strCustomLevel="";
|
||||
persistent extern user CTString gam_strSessionName="Unnamed session";
|
||||
persistent extern user CTString gam_strJoinAddress="serveraddress";
|
||||
persistent extern user INDEX gam_bEnableAdvancedObserving=(INDEX)0;
|
||||
persistent extern user FLOAT con_fHeightFactor=(FLOAT)0.5;
|
||||
persistent extern user FLOAT con_tmLastLines=(FLOAT)5;
|
||||
persistent extern user INDEX wed_iMaxFPSActive=(INDEX)500;
|
||||
persistent extern user FLOAT wed_fFrontClipDistance=(FLOAT)0.5;
|
||||
persistent extern CTString sam_strLastRenderer="none";
|
||||
persistent extern INDEX sam_iLastSetup=(INDEX)1;
|
2
Scripts/menu/ApplyShadowmaps.ini
Normal file
2
Scripts/menu/ApplyShadowmaps.ini
Normal file
|
@ -0,0 +1,2 @@
|
|||
sam_iVideoSetup=3;
|
||||
RecacheShadows();
|
2
Scripts/menu/ApplyTextures.ini
Normal file
2
Scripts/menu/ApplyTextures.ini
Normal file
|
@ -0,0 +1,2 @@
|
|||
sam_iVideoSetup=3;
|
||||
RefreshTextures();
|
1
Scripts/menu/ApplyVideo.ini
Normal file
1
Scripts/menu/ApplyVideo.ini
Normal file
|
@ -0,0 +1 @@
|
|||
ApplyVideoMode();
|
271
Scripts/menu/GameOptions.cfg
Normal file
271
Scripts/menu/GameOptions.cfg
Normal file
|
@ -0,0 +1,271 @@
|
|||
|
||||
//
|
||||
Gadget: TTRS Deathmatch options
|
||||
Type: Separator
|
||||
//
|
||||
Gadget:
|
||||
Type: Separator
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Time limit
|
||||
Tip: TTRS game length (minutes)
|
||||
Type: Toggle
|
||||
Var: gam_iTimeLimit
|
||||
|
||||
String: TTRS None
|
||||
Value: 0
|
||||
String: 1
|
||||
Value: 1
|
||||
String: 2
|
||||
Value: 2
|
||||
String: 5
|
||||
Value: 5
|
||||
String: 10
|
||||
Value: 10
|
||||
String: 15
|
||||
Value: 15
|
||||
String: 20
|
||||
Value: 20
|
||||
String: 30
|
||||
Value: 30
|
||||
String: 45
|
||||
Value: 45
|
||||
String: 60
|
||||
Value: 60
|
||||
String: 90
|
||||
Value: 90
|
||||
String: 120
|
||||
Value: 120
|
||||
|
||||
//
|
||||
Gadget: TTRS Kill limit
|
||||
Tip: TTRS for Deathmatch only
|
||||
Type: Toggle
|
||||
Var: gam_iFragLimit
|
||||
|
||||
String: TTRS None
|
||||
Value: 0
|
||||
String: 5
|
||||
Value: 5
|
||||
String: 10
|
||||
Value: 10
|
||||
String: 15
|
||||
Value: 15
|
||||
String: 20
|
||||
Value: 20
|
||||
String: 25
|
||||
Value: 25
|
||||
String: 30
|
||||
Value: 30
|
||||
String: 40
|
||||
Value: 40
|
||||
String: 50
|
||||
Value: 50
|
||||
String: 75
|
||||
Value: 75
|
||||
String: 100
|
||||
Value: 100
|
||||
|
||||
//
|
||||
Gadget: TTRS Allow health
|
||||
Tip: TTRS enable/disable health items
|
||||
Type: Toggle
|
||||
Var: gam_bAllowHealth
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
|
||||
//
|
||||
Gadget:
|
||||
Type: Separator
|
||||
//
|
||||
Gadget: TTRS Cooperative options
|
||||
Type: Separator
|
||||
//
|
||||
Gadget:
|
||||
Type: Separator
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Weapons stay
|
||||
Type: Toggle
|
||||
Tip: TTRS whether weapons disappear after picking
|
||||
Var: gam_bWeaponsStay
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
//
|
||||
Gadget: TTRS Ammo stays
|
||||
Tip: TTRS whether ammo disappears after picking
|
||||
Type: Toggle
|
||||
Var: gam_bAmmoStays
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
//
|
||||
Gadget: TTRS Health/armor stays
|
||||
Tip: TTRS whether health and armor disappears after picking
|
||||
Type: Toggle
|
||||
Var: gam_bHealthArmorStays
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
//
|
||||
Gadget: TTRS Friendly fire
|
||||
Type: Toggle
|
||||
Tip: TTRS enable/disable damaging of other players
|
||||
Var: gam_bFriendlyFire
|
||||
|
||||
String: TTRS Off
|
||||
Value: 0
|
||||
String: TTRS On
|
||||
Value: 1
|
||||
|
||||
//
|
||||
Gadget: TTRS Extra enemy strength
|
||||
Type: Toggle
|
||||
Tip: TTRS make enemies tougher by given percentage
|
||||
Var: gam_fExtraEnemyStrength
|
||||
|
||||
String: TTRS None
|
||||
Value: 0
|
||||
String: 25%
|
||||
Value: 0.25
|
||||
String: 50%
|
||||
Value: 0.5
|
||||
String: 75%
|
||||
Value: 0.75
|
||||
String: 100%
|
||||
Value: 1
|
||||
String: 150%
|
||||
Value: 1.5
|
||||
String: 200%
|
||||
Value: 2
|
||||
String: 300%
|
||||
Value: 3
|
||||
String: 400%
|
||||
Value: 4
|
||||
|
||||
//
|
||||
Gadget: TTRS Enemy strength per player
|
||||
Type: Toggle
|
||||
Tip: TTRS make enemies tougher as new players join
|
||||
Var: gam_fExtraEnemyStrengthPerPlayer
|
||||
|
||||
String: TTRS None
|
||||
Value: 0
|
||||
String: 10%
|
||||
Value: 0.1
|
||||
String: 20%
|
||||
Value: 0.2
|
||||
String: 30%
|
||||
Value: 0.3
|
||||
String: 50%
|
||||
Value: 0.5
|
||||
String: 75%
|
||||
Value: 0.75
|
||||
String: 100%
|
||||
Value: 1
|
||||
String: 200%
|
||||
Value: 2
|
||||
|
||||
//
|
||||
Gadget: TTRS Play entire game
|
||||
Tip: TTRS continue from level to level
|
||||
Type: Toggle
|
||||
Var: gam_bPlayEntireGame
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
|
||||
//
|
||||
Gadget:
|
||||
Type: Separator
|
||||
//
|
||||
Gadget: TTRS Common options
|
||||
Type: Separator
|
||||
//
|
||||
Gadget:
|
||||
Type: Separator
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Invulnerable after spawning (sec)
|
||||
Tip: TTRS protect players from being killed immediately after appearing
|
||||
Type: Toggle
|
||||
Var: gam_tmSpawnInvulnerability
|
||||
|
||||
String: TTRS None
|
||||
Value: 0
|
||||
String: 1
|
||||
Value: 1
|
||||
String: 2
|
||||
Value: 2
|
||||
String: 3
|
||||
Value: 3
|
||||
String: 5
|
||||
Value: 5
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Infinite ammo
|
||||
Tip: TTRS if on, you don't need ammo to use weapons
|
||||
Type: Toggle
|
||||
Var: gam_bInfiniteAmmo
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
//
|
||||
Gadget: TTRS Clients may pause
|
||||
Tip: TTRS if off, only server may pause the game
|
||||
Type: Toggle
|
||||
Var: ser_bClientsMayPause
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
|
||||
//
|
||||
Gadget:
|
||||
Type: Separator
|
||||
//
|
||||
Gadget: TTRS Violence options
|
||||
Type: Separator
|
||||
//
|
||||
Gadget:
|
||||
Type: Separator
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Gibs
|
||||
Type: Toggle
|
||||
Tip: TTRS enable/disable gibbing of enemies and players
|
||||
Var: gam_bGibs
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
MenuEnd
|
136
Scripts/menu/RenderingOptions.cfg
Normal file
136
Scripts/menu/RenderingOptions.cfg
Normal file
|
@ -0,0 +1,136 @@
|
|||
|
||||
//
|
||||
Gadget: TTRS Texture size
|
||||
Tip: TTRS set size for textures
|
||||
Type: Toggle
|
||||
Var: tex_iNormalSize
|
||||
Schedule: TFNM scripts\menu\ApplyTextures.ini
|
||||
Slider: Fill
|
||||
|
||||
String: TTRS (tiny)
|
||||
Value: 6.5
|
||||
String: TTRS (small)
|
||||
Value: 7
|
||||
String: TTRS (normal)
|
||||
Value: 8
|
||||
String: TTRS (large)
|
||||
Value: 8.5
|
||||
String: TTRS (huge)
|
||||
Value: 9
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Texture quality
|
||||
Tip: TTRS set quality for textures
|
||||
Type: Toggle
|
||||
Var: tex_iNormalQuality
|
||||
Schedule: TFNM scripts\menu\ApplyTextures.ini
|
||||
Filter: sys_bHas32bitTextures
|
||||
|
||||
String: TTRS Optimal
|
||||
Value: 0
|
||||
String: TTRS 16-bit
|
||||
Value: 11
|
||||
String: TTRS 32-bit
|
||||
Value: 22
|
||||
String: TTRS Compressed
|
||||
Value: 33
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Detail textures
|
||||
Tip: TTRS enable/disable rendering of detail textures in world
|
||||
Type: Toggle
|
||||
Var: wld_bTextureLayers
|
||||
|
||||
String: TTRS Disabled
|
||||
Value: 110
|
||||
String: TTRS Enabled
|
||||
Value: 111
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Shadowmap size
|
||||
Tip: TTRS set size of shadowmap textures in level
|
||||
Type: Toggle
|
||||
Var: shd_iStaticSize
|
||||
Schedule: TFNM scripts\menu\ApplyShadowmaps.ini
|
||||
Slider: Fill
|
||||
|
||||
String: TTRS (tiny)
|
||||
Value: 5
|
||||
String: TTRS (small)
|
||||
Value: 6
|
||||
String: TTRS (normal)
|
||||
Value: 7
|
||||
String: TTRS (large)
|
||||
Value: 7.5
|
||||
String: TTRS (huge)
|
||||
Value: 8
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Lens flares
|
||||
Tip: TTRS select type of rendering for lens flares
|
||||
Type: Toggle
|
||||
Var: gfx_iLensFlareQuality
|
||||
|
||||
String: TTRS Disabled
|
||||
Value: 0
|
||||
String: TTRS Simple
|
||||
Value: 1
|
||||
String: TTRS Standard
|
||||
Value: 3
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Gamma correction
|
||||
Tip: TTRS specify display gamma
|
||||
Type: Toggle
|
||||
Var: gfx_fGamma
|
||||
Filter: sys_bHasAdjustableGamma
|
||||
Slider: Ratio
|
||||
|
||||
String: TTRS (dark)
|
||||
Value: 0.2
|
||||
String: TTRS (dark)
|
||||
Value: 0.5
|
||||
String: TTRS (dark)
|
||||
Value: 0.8
|
||||
String: TTRS (normal)
|
||||
Value: 1
|
||||
String: TTRS (bright)
|
||||
Value: 1.1
|
||||
String: TTRS (bright)
|
||||
Value: 1.3
|
||||
String: TTRS (bright)
|
||||
Value: 1.5
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Wait vertical retrace
|
||||
Tip: TTRS synchronize frame change with monitor refresh rate
|
||||
Type: Toggle
|
||||
Var: gap_iSwapInterval
|
||||
Filter: sys_bHasSwapInterval
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
|
||||
//
|
||||
Gadget: TTRS Wide screen
|
||||
Tip: TTRS enable/disable wide screen mode (4:3 or 16:9 ratio)
|
||||
Type: Toggle
|
||||
Var: sam_bWideScreen
|
||||
Schedule: TFNM scripts\menu\ApplyVideo.ini
|
||||
|
||||
String: TTRS Off
|
||||
Value: 0
|
||||
String: TTRS On
|
||||
Value: 1
|
||||
|
||||
|
||||
MenuEnd
|
13
Scripts/menu/SPOptions.cfg
Normal file
13
Scripts/menu/SPOptions.cfg
Normal file
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
Gadget: TTRS Gibs
|
||||
Type: Toggle
|
||||
Tip: TTRS enable/disable gibbing of enemies and players
|
||||
Var: gam_bGibs
|
||||
InGame: No
|
||||
|
||||
String: TTRS No
|
||||
Value: 0
|
||||
String: TTRS Yes
|
||||
Value: 1
|
||||
|
||||
MenuEnd
|
206
Sources/All.sln
Normal file
206
Sources/All.sln
Normal file
|
@ -0,0 +1,206 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DecodeReport", "DecodeReport\DecodeReport.vcxproj", "{FF6F3C9B-689C-D26F-0563-9D12D6F6565B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DedicatedServer", "DedicatedServer\DedicatedServer.vcxproj", "{072EF3A9-482A-79A5-D364-2ECDD95B8029}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10} = {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}
|
||||
{4410EEB1-AFAD-A936-2168-716C245D36D5} = {4410EEB1-AFAD-A936-2168-716C245D36D5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Depend", "Depend\Depend.vcxproj", "{8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ecc", "Ecc\Ecc.vcxproj", "{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Engine", "Engine\Engine.vcxproj", "{4B6F587C-7C59-4481-FBB9-CA44380D0CBF}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05} = {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EngineGUI", "EngineGUI\EngineGUI.vcxproj", "{870758F3-5C2F-D196-2A89-CC336EBE7779}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EntitiesMP", "EntitiesMP\EntitiesMP.vcxproj", "{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05} = {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameGUIMP", "GameGUIMP\GameGUIMP.vcxproj", "{3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4410EEB1-AFAD-A936-2168-716C245D36D5} = {4410EEB1-AFAD-A936-2168-716C245D36D5}
|
||||
{870758F3-5C2F-D196-2A89-CC336EBE7779} = {870758F3-5C2F-D196-2A89-CC336EBE7779}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameMP", "GameMP\GameMP.vcxproj", "{4410EEB1-AFAD-A936-2168-716C245D36D5}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10} = {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LWSkaExporter", "LWSkaExporter\LWSkaExporter.vcxproj", "{ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MakeFONT", "MakeFONT\MakeFONT.vcxproj", "{ABD12F55-02CD-418D-3393-CF6F09A415F2}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modeler", "Modeler\Modeler.vcxproj", "{9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{870758F3-5C2F-D196-2A89-CC336EBE7779} = {870758F3-5C2F-D196-2A89-CC336EBE7779}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RCon", "RCon\RCon.vcxproj", "{BD59BFB2-B39D-6348-273D-48385E685C3D}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SeriousSam", "SeriousSam\SeriousSam.vcxproj", "{F0E01B8A-1C93-85CB-693E-B9CA24A27168}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10} = {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}
|
||||
{4410EEB1-AFAD-A936-2168-716C245D36D5} = {4410EEB1-AFAD-A936-2168-716C245D36D5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SeriousSkaStudio", "SeriousSkaStudio\SeriousSkaStudio.vcxproj", "{CC94A769-3B63-008D-0B03-525791C804D1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
{AC040397-6FEA-E9B2-2B28-5BB08E1607A1} = {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}
|
||||
{870758F3-5C2F-D196-2A89-CC336EBE7779} = {870758F3-5C2F-D196-2A89-CC336EBE7779}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Shaders", "Shaders\Shaders.vcxproj", "{AC040397-6FEA-E9B2-2B28-5BB08E1607A1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF} = {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WorldEditor", "WorldEditor\WorldEditor.vcxproj", "{DC47DA88-14E2-0634-61C5-7CEEC46A45C2}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE} = {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}
|
||||
{AC040397-6FEA-E9B2-2B28-5BB08E1607A1} = {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
Template|Win32 = Template|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Release|Win32.Build.0 = Release|Win32
|
||||
{FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Template|Win32.Build.0 = Template|Win32
|
||||
{072EF3A9-482A-79A5-D364-2ECDD95B8029}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{072EF3A9-482A-79A5-D364-2ECDD95B8029}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{072EF3A9-482A-79A5-D364-2ECDD95B8029}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{072EF3A9-482A-79A5-D364-2ECDD95B8029}.Release|Win32.Build.0 = Release|Win32
|
||||
{072EF3A9-482A-79A5-D364-2ECDD95B8029}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{072EF3A9-482A-79A5-D364-2ECDD95B8029}.Template|Win32.Build.0 = Template|Win32
|
||||
{8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Release|Win32.Build.0 = Release|Win32
|
||||
{8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Template|Win32.Build.0 = Template|Win32
|
||||
{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Release|Win32.Build.0 = Release|Win32
|
||||
{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Template|Win32.Build.0 = Template|Win32
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Release|Win32.Build.0 = Release|Win32
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Template|Win32.Build.0 = Template|Win32
|
||||
{870758F3-5C2F-D196-2A89-CC336EBE7779}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{870758F3-5C2F-D196-2A89-CC336EBE7779}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{870758F3-5C2F-D196-2A89-CC336EBE7779}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{870758F3-5C2F-D196-2A89-CC336EBE7779}.Release|Win32.Build.0 = Release|Win32
|
||||
{870758F3-5C2F-D196-2A89-CC336EBE7779}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{870758F3-5C2F-D196-2A89-CC336EBE7779}.Template|Win32.Build.0 = Template|Win32
|
||||
{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Release|Win32.Build.0 = Release|Win32
|
||||
{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Template|Win32.Build.0 = Template|Win32
|
||||
{3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Release|Win32.Build.0 = Release|Win32
|
||||
{3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Template|Win32.Build.0 = Template|Win32
|
||||
{4410EEB1-AFAD-A936-2168-716C245D36D5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4410EEB1-AFAD-A936-2168-716C245D36D5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4410EEB1-AFAD-A936-2168-716C245D36D5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4410EEB1-AFAD-A936-2168-716C245D36D5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4410EEB1-AFAD-A936-2168-716C245D36D5}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{4410EEB1-AFAD-A936-2168-716C245D36D5}.Template|Win32.Build.0 = Template|Win32
|
||||
{ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Release|Win32.Build.0 = Release|Win32
|
||||
{ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Template|Win32.Build.0 = Template|Win32
|
||||
{ABD12F55-02CD-418D-3393-CF6F09A415F2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{ABD12F55-02CD-418D-3393-CF6F09A415F2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{ABD12F55-02CD-418D-3393-CF6F09A415F2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{ABD12F55-02CD-418D-3393-CF6F09A415F2}.Release|Win32.Build.0 = Release|Win32
|
||||
{ABD12F55-02CD-418D-3393-CF6F09A415F2}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{ABD12F55-02CD-418D-3393-CF6F09A415F2}.Template|Win32.Build.0 = Template|Win32
|
||||
{9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Release|Win32.Build.0 = Release|Win32
|
||||
{9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Template|Win32.Build.0 = Template|Win32
|
||||
{BD59BFB2-B39D-6348-273D-48385E685C3D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BD59BFB2-B39D-6348-273D-48385E685C3D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BD59BFB2-B39D-6348-273D-48385E685C3D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BD59BFB2-B39D-6348-273D-48385E685C3D}.Release|Win32.Build.0 = Release|Win32
|
||||
{BD59BFB2-B39D-6348-273D-48385E685C3D}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{BD59BFB2-B39D-6348-273D-48385E685C3D}.Template|Win32.Build.0 = Template|Win32
|
||||
{F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Release|Win32.Build.0 = Release|Win32
|
||||
{F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Template|Win32.Build.0 = Template|Win32
|
||||
{CC94A769-3B63-008D-0B03-525791C804D1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{CC94A769-3B63-008D-0B03-525791C804D1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CC94A769-3B63-008D-0B03-525791C804D1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CC94A769-3B63-008D-0B03-525791C804D1}.Release|Win32.Build.0 = Release|Win32
|
||||
{CC94A769-3B63-008D-0B03-525791C804D1}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{CC94A769-3B63-008D-0B03-525791C804D1}.Template|Win32.Build.0 = Template|Win32
|
||||
{AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Release|Win32.Build.0 = Release|Win32
|
||||
{AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Template|Win32.Build.0 = Template|Win32
|
||||
{DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Release|Win32.Build.0 = Release|Win32
|
||||
{DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Template|Win32.ActiveCfg = Template|Win32
|
||||
{DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Template|Win32.Build.0 = Template|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
137
Sources/DecodeReport/DecodeReport.cpp
Normal file
137
Sources/DecodeReport/DecodeReport.cpp
Normal file
|
@ -0,0 +1,137 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
// DecodeReport.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
void SubMain( int argc, char *argv[]);
|
||||
|
||||
int main( int argc, char *argv[])
|
||||
{
|
||||
CTSTREAM_BEGIN {
|
||||
SubMain(argc, argv);
|
||||
} CTSTREAM_END;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FindInMapFile(const CTFileName &fnSymbols, const CTString &strImage, ULONG ulSeg, ULONG ulOff, CTString &strFunction, SLONG &slDelta)
|
||||
{
|
||||
CTFileName fnmImage = strImage;
|
||||
CTFileName fnmMap = fnSymbols+fnmImage.FileName()+".map";
|
||||
strFunction = CTString("<not found in '")+fnmMap+"'>";
|
||||
|
||||
try {
|
||||
CTFileStream strmMap;
|
||||
strmMap.Open_t(fnmMap, CTStream::OM_READ);
|
||||
// find beginning of functions in map file
|
||||
for(;;) {
|
||||
if (strmMap.AtEOF()) {
|
||||
return;
|
||||
}
|
||||
// read the line
|
||||
CTString strLine;
|
||||
strmMap.GetLine_t(strLine);
|
||||
if (strncmp(strLine, " Address", 9)==0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CTString strEmpty;
|
||||
strmMap.GetLine_t(strEmpty);
|
||||
|
||||
while (!strmMap.AtEOF()) {
|
||||
// read the line
|
||||
CTString strLine;
|
||||
strmMap.GetLine_t(strLine);
|
||||
char strFunctionLine[1024];
|
||||
strFunctionLine[0]=0;
|
||||
ULONG ulSegLine=-1;
|
||||
ULONG ulOfsLine=-1;
|
||||
strLine.ScanF("%x:%x %s", &ulSegLine, &ulOfsLine, strFunctionLine);
|
||||
if (ulSegLine!=ulSeg) {
|
||||
continue;
|
||||
}
|
||||
if (ulOfsLine>ulOff) {
|
||||
return;
|
||||
}
|
||||
strFunction = strFunctionLine;
|
||||
slDelta = ulOff-ulOfsLine;
|
||||
}
|
||||
|
||||
} catch (char *strError) {
|
||||
(void)strError;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void SubMain( int argc, char *argv[])
|
||||
{
|
||||
printf("\nDecodeReport - '.RPT' file decoder V1.0\n");
|
||||
printf( " (C)1999 CROTEAM Ltd\n\n");
|
||||
|
||||
if( argc!=3+1)
|
||||
{
|
||||
printf( "USAGE:\nDecodeReport <infilename> <outfilename> <symbolsdir>\n");
|
||||
exit( EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// initialize engine
|
||||
SE_InitEngine("");
|
||||
_fnmApplicationPath = CTString("");
|
||||
|
||||
|
||||
CTFileName fnSrc = CTString(argv[1]);
|
||||
CTFileName fnDst = CTString(argv[2]);
|
||||
CTFileName fnSymbols = CTString(argv[3]);
|
||||
|
||||
try
|
||||
{
|
||||
if (fnSrc==fnDst) {
|
||||
throw "Use different files!";
|
||||
}
|
||||
|
||||
CTFileStream strmSrc;
|
||||
strmSrc.Open_t(fnSrc, CTStream::OM_READ);
|
||||
CTFileStream strmDst;
|
||||
strmDst.Create_t(fnDst);
|
||||
|
||||
// while there is some line in src
|
||||
while(!strmSrc.AtEOF()) {
|
||||
// read the line
|
||||
CTString strLine;
|
||||
strmSrc.GetLine_t(strLine);
|
||||
|
||||
// try to find address marker in it
|
||||
const char *strAdr = strstr(strLine, "$adr:");
|
||||
// if there is no marker
|
||||
if (strAdr==NULL) {
|
||||
// just copy the line
|
||||
strmDst.PutLine_t(strLine);
|
||||
|
||||
// if there is marker
|
||||
} else {
|
||||
// parse the line
|
||||
char strImage[1024];
|
||||
strImage[0]=0;
|
||||
ULONG ulSegment=-1;
|
||||
ULONG ulOffset=-1;
|
||||
sscanf(strAdr, "$adr: %s %x:%x", strImage, &ulSegment, &ulOffset);
|
||||
// find the function
|
||||
CTString strFunction;
|
||||
SLONG slDelta;
|
||||
FindInMapFile(fnSymbols, CTString(strImage), ulSegment, ulOffset, strFunction, slDelta);
|
||||
// out put the result
|
||||
CTString strResult;
|
||||
strResult.PrintF("%s (%s+0X%X)", strLine, strFunction, slDelta);
|
||||
strmDst.PutLine_t(strResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(char *strError)
|
||||
{
|
||||
printf("\nError: %s\n", strError);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
179
Sources/DecodeReport/DecodeReport.vcxproj
Normal file
179
Sources/DecodeReport/DecodeReport.vcxproj
Normal file
|
@ -0,0 +1,179 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Template|Win32">
|
||||
<Configuration>Template</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<Keyword>MFCProj</Keyword>
|
||||
<ProjectGuid>{FF6F3C9B-689C-D26F-0563-9D12D6F6565B}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Debug\</OutDir>
|
||||
<IntDir>Debug\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<ExecutablePath>$(SolutionDir)..\Tools.Win32;$(SolutionDir)..\Bin\Debug;$(ExecutablePath)</ExecutablePath>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\Bin\Debug;$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Release\</OutDir>
|
||||
<IntDir>Release\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<ExecutablePath>$(SolutionDir)..\Tools.Win32;$(SolutionDir)..\Bin;$(ExecutablePath)</ExecutablePath>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\Bin;$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;DIRECT3D_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AssemblerListingLocation>Debug\</AssemblerListingLocation>
|
||||
<PrecompiledHeaderOutputFile>.\Debug\DecodeReport.pch</PrecompiledHeaderOutputFile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<ObjectFileName>Debug\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>Debug\</ProgramDataBaseFileName>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<DisableSpecificWarnings>4996;4333</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug\DecodeReport.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Debug\DecodeReport.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>Debug\DecodeReport.exe</OutputFile>
|
||||
<GenerateMapFile>true</GenerateMapFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy Debug\$(TargetName).exe $(SolutionDir)..\Bin\Debug\ >nul
|
||||
copy Debug\$(TargetName).map $(SolutionDir)..\Bin\Debug\ >nul</Command>
|
||||
<Message>Copying %(Filename) binaries to $(ENGINE_DIR)\Bin\Debug</Message>
|
||||
<Outputs>$(SolutionDir)..\Bin\Debug\$(TargetName).exe</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<OmitFramePointers>false</OmitFramePointers>
|
||||
<StringPooling>true</StringPooling>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;DIRECT3D_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AssemblerListingLocation>.\Release\</AssemblerListingLocation>
|
||||
<PrecompiledHeaderOutputFile>.\Release\DecodeReport.pch</PrecompiledHeaderOutputFile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<ObjectFileName>Release\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>Release\</ProgramDataBaseFileName>
|
||||
<DisableSpecificWarnings>4996;4333</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release\DecodeReport.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Release\DecodeReport.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>Release\DecodeReport.exe</OutputFile>
|
||||
<GenerateMapFile>true</GenerateMapFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy Release\$(TargetName).exe $(SolutionDir)..\Bin\ >nul
|
||||
copy Release\$(TargetName).map $(SolutionDir)..\Bin\ >nul</Command>
|
||||
<Message>Copying %(Filename) binaries to $(ENGINE_DIR)\Bin</Message>
|
||||
<Outputs>$(SolutionDir)..\Bin\$(TargetName).exe</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DecodeReport.cpp" />
|
||||
<ClCompile Include="StdAfx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdafx.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StdAfx.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
30
Sources/DecodeReport/DecodeReport.vcxproj.filters
Normal file
30
Sources/DecodeReport/DecodeReport.vcxproj.filters
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{b72ef112-1822-4995-a4b2-ce6a2ebd5544}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{d354ff58-3d39-4727-a8d0-90bf71f4f976}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{25310c72-4b16-4223-b6ac-1c93f9823c29}</UniqueIdentifier>
|
||||
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DecodeReport.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StdAfx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StdAfx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
3
Sources/DecodeReport/DecodeReport.vcxproj.user
Normal file
3
Sources/DecodeReport/DecodeReport.vcxproj.user
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
10
Sources/DecodeReport/StdAfx.cpp
Normal file
10
Sources/DecodeReport/StdAfx.cpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// DecodeReport.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
3
Sources/DecodeReport/StdAfx.h
Normal file
3
Sources/DecodeReport/StdAfx.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include <Engine/Engine.h>
|
452
Sources/DedicatedServer/DedicatedServer.cpp
Normal file
452
Sources/DedicatedServer/DedicatedServer.cpp
Normal file
|
@ -0,0 +1,452 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include <GameMP/Game.h>
|
||||
#define DECL_DLL
|
||||
|
||||
#if 0 /* rcg10042001 Doesn't seem to exist. */
|
||||
#include <Entities/Global.h>
|
||||
#endif
|
||||
|
||||
// application state variables
|
||||
extern BOOL _bRunning = TRUE;
|
||||
static BOOL _bForceRestart = FALSE;
|
||||
static BOOL _bForceNextMap = FALSE;
|
||||
|
||||
extern CTString _strSamVersion = "no version information";
|
||||
extern INDEX ded_iMaxFPS = 100;
|
||||
extern CTString ded_strConfig = "";
|
||||
extern CTString ded_strLevel = "";
|
||||
extern INDEX ded_bRestartWhenEmpty = TRUE;
|
||||
extern FLOAT ded_tmTimeout = -1;
|
||||
extern CGame *_pGame = NULL;
|
||||
extern CTString sam_strFirstLevel = "Levels\\KarnakDemo.wld";
|
||||
extern CTString sam_strIntroLevel = "Levels\\Intro.wld";
|
||||
extern CTString sam_strGameName = "serioussam";
|
||||
|
||||
CTimerValue _tvLastLevelEnd(-1i64);
|
||||
|
||||
void InitializeGame(void)
|
||||
{
|
||||
try {
|
||||
#ifndef NDEBUG
|
||||
#define GAMEDLL _fnmApplicationExe.FileDir()+"Game"+_strModExt+"D.dll"
|
||||
#else
|
||||
#define GAMEDLL _fnmApplicationExe.FileDir()+"Game"+_strModExt+".dll"
|
||||
#endif
|
||||
CTFileName fnmExpanded;
|
||||
ExpandFilePath(EFP_READ, CTString(GAMEDLL), fnmExpanded);
|
||||
|
||||
CPrintF(TRANS("Loading game library '%s'...\n"), (const char *)fnmExpanded);
|
||||
HMODULE hGame = LoadLibraryA(fnmExpanded);
|
||||
if (hGame==NULL) {
|
||||
ThrowF_t("%s", GetWindowsError(GetLastError()));
|
||||
}
|
||||
CGame* (*GAME_Create)(void) = (CGame* (*)(void))GetProcAddress(hGame, "GAME_Create");
|
||||
if (GAME_Create==NULL) {
|
||||
ThrowF_t("%s", GetWindowsError(GetLastError()));
|
||||
}
|
||||
_pGame = GAME_Create();
|
||||
|
||||
} catch (char *strError) {
|
||||
FatalError("%s", strError);
|
||||
}
|
||||
// init game - this will load persistent symbols
|
||||
_pGame->Initialize(CTString("Data\\DedicatedServer.gms"));
|
||||
}
|
||||
|
||||
static void QuitGame(void)
|
||||
{
|
||||
_bRunning = FALSE;
|
||||
}
|
||||
|
||||
static void RestartGame(void)
|
||||
{
|
||||
_bForceRestart = TRUE;
|
||||
}
|
||||
static void NextMap(void)
|
||||
{
|
||||
_bForceNextMap = TRUE;
|
||||
}
|
||||
|
||||
|
||||
void End(void);
|
||||
|
||||
// limit current frame rate if neeeded
|
||||
|
||||
void LimitFrameRate(void)
|
||||
{
|
||||
// measure passed time for each loop
|
||||
static CTimerValue tvLast(-1.0f);
|
||||
CTimerValue tvNow = _pTimer->GetHighPrecisionTimer();
|
||||
TIME tmCurrentDelta = (tvNow-tvLast).GetSeconds();
|
||||
|
||||
// limit maximum frame rate
|
||||
ded_iMaxFPS = ClampDn( ded_iMaxFPS, 1L);
|
||||
TIME tmWantedDelta = 1.0f / ded_iMaxFPS;
|
||||
if( tmCurrentDelta<tmWantedDelta) Sleep( (tmWantedDelta-tmCurrentDelta)*1000.0f);
|
||||
|
||||
// remember new time
|
||||
tvLast = _pTimer->GetHighPrecisionTimer();
|
||||
}
|
||||
|
||||
// break/close handler
|
||||
BOOL WINAPI HandlerRoutine(
|
||||
DWORD dwCtrlType // control signal type
|
||||
)
|
||||
{
|
||||
if (dwCtrlType == CTRL_C_EVENT
|
||||
|| dwCtrlType == CTRL_BREAK_EVENT
|
||||
|| dwCtrlType == CTRL_CLOSE_EVENT
|
||||
|| dwCtrlType == CTRL_LOGOFF_EVENT
|
||||
|| dwCtrlType == CTRL_SHUTDOWN_EVENT) {
|
||||
_bRunning = FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define REFRESHTIME (0.1f)
|
||||
|
||||
static void LoadingHook_t(CProgressHookInfo *pphi)
|
||||
{
|
||||
// measure time since last call
|
||||
static CTimerValue tvLast(0I64);
|
||||
CTimerValue tvNow = _pTimer->GetHighPrecisionTimer();
|
||||
|
||||
if (!_bRunning) {
|
||||
ThrowF_t(TRANS("User break!"));
|
||||
}
|
||||
// if not first or final update, and not enough time passed
|
||||
if (pphi->phi_fCompleted!=0 && pphi->phi_fCompleted!=1 &&
|
||||
(tvNow-tvLast).GetSeconds() < REFRESHTIME) {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
tvLast = tvNow;
|
||||
|
||||
// print status text
|
||||
CTString strRes;
|
||||
printf("\r ");
|
||||
printf("\r%s : %3.0f%%\r", pphi->phi_strDescription, pphi->phi_fCompleted*100);
|
||||
}
|
||||
|
||||
// loading hook functions
|
||||
void EnableLoadingHook(void)
|
||||
{
|
||||
printf("\n");
|
||||
SetProgressHook(LoadingHook_t);
|
||||
}
|
||||
|
||||
void DisableLoadingHook(void)
|
||||
{
|
||||
SetProgressHook(NULL);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
BOOL StartGame(CTString &strLevel)
|
||||
{
|
||||
_pGame->gm_aiStartLocalPlayers[0] = -1;
|
||||
_pGame->gm_aiStartLocalPlayers[1] = -1;
|
||||
_pGame->gm_aiStartLocalPlayers[2] = -1;
|
||||
_pGame->gm_aiStartLocalPlayers[3] = -1;
|
||||
|
||||
_pGame->gam_strCustomLevel = strLevel;
|
||||
|
||||
_pGame->gm_strNetworkProvider = "TCP/IP Server";
|
||||
CUniversalSessionProperties sp;
|
||||
_pGame->SetMultiPlayerSession(sp);
|
||||
return _pGame->NewGame( _pGame->gam_strSessionName, strLevel, sp);
|
||||
}
|
||||
|
||||
void ExecScript(const CTString &str)
|
||||
{
|
||||
CPrintF("Executing: '%s'\n", str);
|
||||
CTString strCmd;
|
||||
strCmd.PrintF("include \"%s\"", str);
|
||||
_pShell->Execute(strCmd);
|
||||
}
|
||||
|
||||
BOOL Init(int argc, char* argv[])
|
||||
{
|
||||
_bDedicatedServer = TRUE;
|
||||
|
||||
if (argc!=1+1 && argc!=2+1) {
|
||||
// NOTE: this cannot be translated - translations are not loaded yet
|
||||
printf("Usage: DedicatedServer <configname> [<modname>]\n"
|
||||
"This starts a server reading configs from directory 'Scripts\\Dedicated\\<configname>\\'\n");
|
||||
getch();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
SetConsoleTitleA(argv[1]);
|
||||
|
||||
ded_strConfig = CTString("Scripts\\Dedicated\\")+argv[1]+"\\";
|
||||
|
||||
if (argc==2+1) {
|
||||
_fnmMod = CTString("Mods\\")+argv[2]+"\\";
|
||||
}
|
||||
|
||||
|
||||
_strLogFile = CTString("Dedicated_")+argv[1];
|
||||
|
||||
// initialize engine
|
||||
SE_InitEngine(sam_strGameName);
|
||||
|
||||
// ParseCommandLine(strCmdLine);
|
||||
|
||||
// load all translation tables
|
||||
InitTranslation();
|
||||
CTFileName fnmTransTable;
|
||||
try {
|
||||
fnmTransTable = CTFILENAME("Data\\Translations\\Engine.txt");
|
||||
AddTranslationTable_t(fnmTransTable);
|
||||
fnmTransTable = CTFILENAME("Data\\Translations\\Game.txt");
|
||||
AddTranslationTable_t(fnmTransTable);
|
||||
fnmTransTable = CTFILENAME("Data\\Translations\\Entities.txt");
|
||||
AddTranslationTable_t(fnmTransTable);
|
||||
fnmTransTable = CTFILENAME("Data\\Translations\\SeriousSam.txt");
|
||||
AddTranslationTable_t(fnmTransTable);
|
||||
fnmTransTable = CTFILENAME("Data\\Translations\\Levels.txt");
|
||||
AddTranslationTable_t(fnmTransTable);
|
||||
|
||||
FinishTranslationTable();
|
||||
} catch (char *strError) {
|
||||
FatalError("%s %s", CTString(fnmTransTable), strError);
|
||||
}
|
||||
|
||||
// always disable all warnings when in serious sam
|
||||
_pShell->Execute( "con_bNoWarnings=1;");
|
||||
|
||||
// declare shell symbols
|
||||
_pShell->DeclareSymbol("persistent user INDEX ded_iMaxFPS;", &ded_iMaxFPS);
|
||||
_pShell->DeclareSymbol("user void Quit(void);", &QuitGame);
|
||||
_pShell->DeclareSymbol("user CTString ded_strLevel;", &ded_strLevel);
|
||||
_pShell->DeclareSymbol("user FLOAT ded_tmTimeout;", &ded_tmTimeout);
|
||||
_pShell->DeclareSymbol("user INDEX ded_bRestartWhenEmpty;", &ded_bRestartWhenEmpty);
|
||||
_pShell->DeclareSymbol("user void Restart(void);", &RestartGame);
|
||||
_pShell->DeclareSymbol("user void NextMap(void);", &NextMap);
|
||||
_pShell->DeclareSymbol("persistent user CTString sam_strIntroLevel;", &sam_strIntroLevel);
|
||||
_pShell->DeclareSymbol("persistent user CTString sam_strGameName;", &sam_strGameName);
|
||||
_pShell->DeclareSymbol("user CTString sam_strFirstLevel;", &sam_strFirstLevel);
|
||||
|
||||
// init game - this will load persistent symbols
|
||||
InitializeGame();
|
||||
_pNetwork->md_strGameID = sam_strGameName;
|
||||
|
||||
LoadStringVar(CTString("Data\\Var\\Sam_Version.var"), _strSamVersion);
|
||||
CPrintF(TRANS("Serious Sam version: %s\n"), _strSamVersion);
|
||||
|
||||
SetConsoleCtrlHandler(HandlerRoutine, TRUE);
|
||||
|
||||
// if there is a mod
|
||||
if (_fnmMod!="") {
|
||||
// execute the mod startup script
|
||||
_pShell->Execute(CTString("include \"Scripts\\Mod_startup.ini\";"));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
void End(void)
|
||||
{
|
||||
|
||||
// cleanup level-info subsystem
|
||||
// ClearDemosList();
|
||||
|
||||
// end game
|
||||
_pGame->End();
|
||||
|
||||
// end engine
|
||||
SE_EndEngine();
|
||||
}
|
||||
|
||||
static INDEX iRound = 1;
|
||||
static BOOL _bHadPlayers = 0;
|
||||
static BOOL _bRestart = 0;
|
||||
CTString strBegScript;
|
||||
CTString strEndScript;
|
||||
|
||||
void RoundBegin(void)
|
||||
{
|
||||
// repeat generate script names
|
||||
FOREVER {
|
||||
strBegScript.PrintF("%s%d_begin.ini", ded_strConfig, iRound);
|
||||
strEndScript.PrintF("%s%d_end.ini", ded_strConfig, iRound);
|
||||
// if start script exists
|
||||
if (FileExists(strBegScript)) {
|
||||
// stop searching
|
||||
break;
|
||||
|
||||
// if start script doesn't exist
|
||||
} else {
|
||||
// if this is first round
|
||||
if (iRound==1) {
|
||||
// error
|
||||
CPrintF(TRANS("No scripts present!\n"));
|
||||
_bRunning = FALSE;
|
||||
return;
|
||||
}
|
||||
// try again with first round
|
||||
iRound = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// run start script
|
||||
ExecScript(strBegScript);
|
||||
|
||||
// start the level specified there
|
||||
if (ded_strLevel=="") {
|
||||
CPrintF(TRANS("ERROR: No next level specified!\n"));
|
||||
_bRunning = FALSE;
|
||||
} else {
|
||||
EnableLoadingHook();
|
||||
StartGame(ded_strLevel);
|
||||
_bHadPlayers = 0;
|
||||
_bRestart = 0;
|
||||
DisableLoadingHook();
|
||||
_tvLastLevelEnd = CTimerValue(-1i64);
|
||||
CPrintF(TRANS("\nALL OK: Dedicated server is now running!\n"));
|
||||
CPrintF(TRANS("Use Ctrl+C to shutdown the server.\n"));
|
||||
CPrintF(TRANS("DO NOT use the 'Close' button, it might leave the port hanging!\n\n"));
|
||||
}
|
||||
}
|
||||
|
||||
void ForceNextMap(void)
|
||||
{
|
||||
EnableLoadingHook();
|
||||
StartGame(ded_strLevel);
|
||||
_bHadPlayers = 0;
|
||||
_bRestart = 0;
|
||||
DisableLoadingHook();
|
||||
_tvLastLevelEnd = CTimerValue(-1i64);
|
||||
}
|
||||
|
||||
void RoundEnd(void)
|
||||
{
|
||||
CPrintF("end of round---------------------------\n");
|
||||
|
||||
ExecScript(strEndScript);
|
||||
iRound++;
|
||||
}
|
||||
|
||||
// do the main game loop and render screen
|
||||
void DoGame(void)
|
||||
{
|
||||
// do the main game loop
|
||||
if( _pGame->gm_bGameOn) {
|
||||
_pGame->GameMainLoop();
|
||||
|
||||
// if any player is connected
|
||||
if (_pGame->GetPlayersCount()) {
|
||||
if (!_bHadPlayers) {
|
||||
// unpause server
|
||||
if (_pNetwork->IsPaused()) {
|
||||
_pNetwork->TogglePause();
|
||||
}
|
||||
}
|
||||
// remember that
|
||||
_bHadPlayers = 1;
|
||||
// if no player is connected,
|
||||
} else {
|
||||
// if was before
|
||||
if (_bHadPlayers) {
|
||||
// make it restart
|
||||
_bRestart = TRUE;
|
||||
// if never had any player yet
|
||||
} else {
|
||||
// keep the server paused
|
||||
if (!_pNetwork->IsPaused()) {
|
||||
_pNetwork->TogglePause();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if game is not started
|
||||
} else {
|
||||
// just handle broadcast messages
|
||||
_pNetwork->GameInactive();
|
||||
}
|
||||
|
||||
// limit current frame rate if needed
|
||||
LimitFrameRate();
|
||||
}
|
||||
|
||||
int SubMain(int argc, char* argv[])
|
||||
{
|
||||
|
||||
// initialize
|
||||
if( !Init(argc, argv)) {
|
||||
End();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// initialy, application is running
|
||||
_bRunning = TRUE;
|
||||
|
||||
// execute dedicated server startup script
|
||||
ExecScript(CTFILENAME("Scripts\\Dedicated_startup.ini"));
|
||||
// execute startup script for this config
|
||||
ExecScript(ded_strConfig+"init.ini");
|
||||
// start first round
|
||||
RoundBegin();
|
||||
|
||||
// while it is still running
|
||||
while( _bRunning)
|
||||
{
|
||||
// do the main game loop
|
||||
DoGame();
|
||||
|
||||
// if game is finished
|
||||
if (_pNetwork->IsGameFinished()) {
|
||||
// if not yet remembered end of level
|
||||
if (_tvLastLevelEnd.tv_llValue<0) {
|
||||
// remember end of level
|
||||
_tvLastLevelEnd = _pTimer->GetHighPrecisionTimer();
|
||||
// finish this round
|
||||
RoundEnd();
|
||||
// if already remembered
|
||||
} else {
|
||||
// if time is out
|
||||
if ((_pTimer->GetHighPrecisionTimer()-_tvLastLevelEnd).GetSeconds()>ded_tmTimeout) {
|
||||
// start next round
|
||||
RoundBegin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_bRestart||_bForceRestart) {
|
||||
if (ded_bRestartWhenEmpty||_bForceRestart) {
|
||||
_bForceRestart = FALSE;
|
||||
_bRestart = FALSE;
|
||||
RoundEnd();
|
||||
CPrintF(TRANS("\nNOTE: Restarting server!\n\n"));
|
||||
RoundBegin();
|
||||
} else {
|
||||
_bRestart = FALSE;
|
||||
_bHadPlayers = FALSE;
|
||||
}
|
||||
}
|
||||
if (_bForceNextMap) {
|
||||
ForceNextMap();
|
||||
_bForceNextMap = FALSE;
|
||||
}
|
||||
|
||||
} // end of main application loop
|
||||
|
||||
_pGame->StopGame();
|
||||
|
||||
End();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int iResult;
|
||||
CTSTREAM_BEGIN {
|
||||
iResult = SubMain(argc, argv);
|
||||
} CTSTREAM_END;
|
||||
|
||||
return iResult;
|
||||
}
|
||||
|
72
Sources/DedicatedServer/DedicatedServer.rc
Normal file
72
Sources/DedicatedServer/DedicatedServer.rc
Normal file
|
@ -0,0 +1,72 @@
|
|||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON ICON DISCARDABLE "icon1.ico"
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
184
Sources/DedicatedServer/DedicatedServer.vcxproj
Normal file
184
Sources/DedicatedServer/DedicatedServer.vcxproj
Normal file
|
@ -0,0 +1,184 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Template|Win32">
|
||||
<Configuration>Template</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<ProjectGuid>{072EF3A9-482A-79A5-D364-2ECDD95B8029}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Debug\</OutDir>
|
||||
<IntDir>Debug\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\Bin\Debug;$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Release\</OutDir>
|
||||
<IntDir>Release\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\Bin;$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;DIRECT3D_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
|
||||
<PrecompiledHeaderOutputFile>.\Debug\DedicatedServer.pch</PrecompiledHeaderOutputFile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<ObjectFileName>.\Debug\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<DisableSpecificWarnings>4996;4333</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug\DedicatedServer.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Debug\DedicatedServer.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreSpecificDefaultLibraries>gamed.dll gamempd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<OutputFile>Debug\DedicatedServer.exe</OutputFile>
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateMapFile>true</GenerateMapFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy Debug\$(TargetName).exe $(SolutionDir)..\Bin\Debug\ >nul
|
||||
copy Debug\$(TargetName).map $(SolutionDir)..\Bin\Debug\ >nul</Command>
|
||||
<Message>Copying %(Filename) binaries to $(ENGINE_DIR)\Bin\Debug</Message>
|
||||
<Outputs>$(ENGINE_DIR)\Bin\Debug\$(InputName).exe;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<StringPooling>true</StringPooling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;DIRECT3D_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AssemblerListingLocation>.\Release\</AssemblerListingLocation>
|
||||
<PrecompiledHeaderOutputFile>.\Release\DedicatedServer.pch</PrecompiledHeaderOutputFile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<ObjectFileName>.\Release\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
|
||||
<DisableSpecificWarnings>4996;4333</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release\DedicatedServer.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Release\DedicatedServer.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreSpecificDefaultLibraries>game.dll gamemp.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<OutputFile>.\Release\DedicatedServer.exe</OutputFile>
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateMapFile>true</GenerateMapFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy Release\$(TargetName).exe $(SolutionDir)..\Bin\ >nul
|
||||
copy Release\$(TargetName).map $(SolutionDir)..\Bin\ >nul</Command>
|
||||
<Message>Copying %(Filename) binaries to $(ENGINE_DIR)\Bin</Message>
|
||||
<Outputs>$(ENGINE_DIR)\Bin\$(InputName).exe;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DedicatedServer.cpp" />
|
||||
<ClCompile Include="StdAfx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdafx.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StdAfx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="DedicatedServer.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="icon1.ico" />
|
||||
<CustomBuild Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
41
Sources/DedicatedServer/DedicatedServer.vcxproj.filters
Normal file
41
Sources/DedicatedServer/DedicatedServer.vcxproj.filters
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{3a912290-4852-4d73-ba9b-6d52a7c95379}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{76cc8123-f0c6-4914-8a8f-8c3f06306d27}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{322898e6-3b58-4251-8e4c-d2330dbaa9a6}</UniqueIdentifier>
|
||||
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DedicatedServer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StdAfx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StdAfx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="DedicatedServer.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="icon1.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
</Project>
|
3
Sources/DedicatedServer/DedicatedServer.vcxproj.user
Normal file
3
Sources/DedicatedServer/DedicatedServer.vcxproj.user
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
34
Sources/DedicatedServer/ReadMe.txt
Normal file
34
Sources/DedicatedServer/ReadMe.txt
Normal file
|
@ -0,0 +1,34 @@
|
|||
========================================================================
|
||||
CONSOLE APPLICATION : DedicatedServer
|
||||
========================================================================
|
||||
|
||||
|
||||
AppWizard has created this DedicatedServer application for you.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your DedicatedServer application.
|
||||
|
||||
DedicatedServer.dsp
|
||||
This file (the project file) contains information at the project level and
|
||||
is used to build a single project or subproject. Other users can share the
|
||||
project (.dsp) file, but they should export the makefiles locally.
|
||||
|
||||
DedicatedServer.cpp
|
||||
This is the main application source file.
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named DedicatedServer.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
10
Sources/DedicatedServer/StdAfx.cpp
Normal file
10
Sources/DedicatedServer/StdAfx.cpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// DedicatedServer.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
23
Sources/DedicatedServer/StdAfx.h
Normal file
23
Sources/DedicatedServer/StdAfx.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include <Engine/Engine.h>
|
||||
#include <Engine/Templates/Stock_CTextureData.h>
|
||||
#include <Engine/Templates/Stock_CModelData.h>
|
||||
#include <GameMP/Game.h>
|
||||
|
||||
/* rcg10042001 protect against Visual C-isms. */
|
||||
#ifdef _MSC_VER
|
||||
#define DECL_DLL _declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_UNIX
|
||||
#define DECL_DLL
|
||||
#endif
|
||||
|
||||
|
||||
#include <EntitiesMP/Global.h>
|
||||
#include <EntitiesMP/Common/Common.h>
|
||||
#include <EntitiesMP/Common/GameInterface.h>
|
||||
#include <EntitiesMP/Player.h>
|
||||
|
||||
#undef DECL_DLL
|
BIN
Sources/DedicatedServer/icon1.ico
Normal file
BIN
Sources/DedicatedServer/icon1.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 766 B |
18
Sources/DedicatedServer/resource.h
Normal file
18
Sources/DedicatedServer/resource.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by DedicatedServer.rc
|
||||
//
|
||||
#define IDI_ICON 101
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
184
Sources/Depend/Depend.vcxproj
Normal file
184
Sources/Depend/Depend.vcxproj
Normal file
|
@ -0,0 +1,184 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Template|Win32">
|
||||
<Configuration>Template</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<Keyword>MFCProj</Keyword>
|
||||
<ProjectGuid>{8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Debug\</OutDir>
|
||||
<IntDir>Debug\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\Bin\Debug;$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Release\</OutDir>
|
||||
<IntDir>Release\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\Bin;$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;DIRECT3D_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
|
||||
<PrecompiledHeaderOutputFile>.\Debug\Depend.pch</PrecompiledHeaderOutputFile>
|
||||
<ObjectFileName>.\Debug\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
|
||||
<DisableSpecificWarnings>4996;4333</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug\Depend.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Debug\Depend.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>Debug\Depend.exe</OutputFile>
|
||||
<GenerateMapFile>true</GenerateMapFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy Debug\$(TargetName).exe $(SolutionDir)..\Bin\Debug\ >nul
|
||||
copy Debug\$(TargetName).map $(SolutionDir)..\Bin\Debug\ >nul</Command>
|
||||
<Message>Copying %(Filename) binaries to $(ENGINE_DIR)\Bin\Debug</Message>
|
||||
<Outputs>$(SolutionDir)..\Bin\Debug\$(TargetName).exe;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<OmitFramePointers>false</OmitFramePointers>
|
||||
<StringPooling>true</StringPooling>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;DIRECT3D_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AssemblerListingLocation>.\Release\</AssemblerListingLocation>
|
||||
<PrecompiledHeaderOutputFile>.\Release\Depend.pch</PrecompiledHeaderOutputFile>
|
||||
<ObjectFileName>.\Release\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
|
||||
<DisableSpecificWarnings>4996;4333</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release\Depend.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Release\Depend.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>.\Release\Depend.exe</OutputFile>
|
||||
<GenerateMapFile>true</GenerateMapFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy Release\$(TargetName).exe $(SolutionDir)..\Bin\ >nul
|
||||
copy Release\$(TargetName).map $(SolutionDir)..\Bin\ >nul</Command>
|
||||
<Message>Copying %(Filename) binaries to $(ENGINE_DIR)\Bin</Message>
|
||||
<Outputs>$(SolutionDir)..\Bin\$(TargetName).exe;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Dependency.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">StdH.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">StdH.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StdH.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">StdH.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">StdH.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<ClCompile Include="UtilityDepend.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">StdH.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">StdH.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Dependency.h" />
|
||||
<ClInclude Include="StdH.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
36
Sources/Depend/Depend.vcxproj.filters
Normal file
36
Sources/Depend/Depend.vcxproj.filters
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{fe5c9d04-bd48-46c9-a53c-cdec2710268a}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{35dbd032-f72b-4d4e-8a14-b9dd3610bab8}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;fi;fd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{8bc7607a-1165-4c3c-9775-61fbdccad572}</UniqueIdentifier>
|
||||
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Dependency.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StdH.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="UtilityDepend.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Dependency.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StdH.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
13
Sources/Depend/Depend.vcxproj.user
Normal file
13
Sources/Depend/Depend.vcxproj.user
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerCommandArguments>
|
||||
</LocalDebuggerCommandArguments>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommand>$(ProjectDir)..\..\Bin\Debug\$(TargetFileName)</LocalDebuggerCommand>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LocalDebuggerCommand>$(ProjectDir)..\..\Bin\$(TargetFileName)</LocalDebuggerCommand>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
570
Sources/Depend/Dependency.cpp
Normal file
570
Sources/Depend/Dependency.cpp
Normal file
|
@ -0,0 +1,570 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
#include "Dependency.h"
|
||||
#include <Engine/Base/TranslationPair.h>
|
||||
|
||||
// adjust file path automatically for application path prefix
|
||||
void AdjustFilePath_t(CTFileName &fnm)
|
||||
{
|
||||
// if filename contains a colon or double backslash
|
||||
if (strchr(fnm, ':')!=NULL
|
||||
||strstr(fnm, "\\\\")!=NULL) {
|
||||
// it must be prefixed with application path
|
||||
fnm.RemoveApplicationPath_t();
|
||||
}
|
||||
}
|
||||
|
||||
// class constructor
|
||||
CDependInfo::CDependInfo(CTFileName fnFileName, CTFileName fnParent)
|
||||
{
|
||||
// copy file name
|
||||
di_fnFileName = fnFileName;
|
||||
di_fnParent = fnParent;
|
||||
}
|
||||
|
||||
BOOL CDependInfo::IsFileOnDiskUpdated(void)
|
||||
{
|
||||
int file_handle;
|
||||
// try to open file for reading
|
||||
file_handle = _open( _fnmApplicationPath + di_fnFileName, _O_RDONLY | _O_BINARY);
|
||||
// mark as it is not updated
|
||||
BOOL bUpdated = FALSE;
|
||||
// if opened succesefully
|
||||
if( file_handle != -1)
|
||||
{
|
||||
struct stat statFileStatus;
|
||||
// get file status
|
||||
fstat( file_handle, &statFileStatus);
|
||||
ASSERT(statFileStatus.st_mtime<=time(NULL));
|
||||
|
||||
// if last modification time is same as remembered in dependency info object
|
||||
if( difftime( statFileStatus.st_mtime, di_tTime) >= 0)
|
||||
{
|
||||
// mark file as updated
|
||||
bUpdated = TRUE;
|
||||
}
|
||||
}
|
||||
if(file_handle!=-1) {
|
||||
_close(file_handle);
|
||||
}
|
||||
|
||||
return bUpdated;
|
||||
}
|
||||
|
||||
// if given file allready has its own DependInfo object linked in list
|
||||
BOOL CDependencyList::ExistsInList(CListHead &lh, CTFileName fnTestName) const
|
||||
{
|
||||
// for all members in depend list
|
||||
FOREACHINLIST( CDependInfo, di_Node, lh, itDependInfo)
|
||||
{
|
||||
// if this DependInfo is describing searching file
|
||||
if( itDependInfo->di_fnFileName == fnTestName)
|
||||
{
|
||||
// return true
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
// if none of linked DepenInfo objects represent our testing file
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// extract all dependencies from list
|
||||
void CDependencyList::ExtractDependencies()
|
||||
{
|
||||
int file_handle;
|
||||
volatile ULONG ulDFNM = 'NFD';
|
||||
volatile ULONG ulTFNM = 'NFT';
|
||||
volatile ULONG ulEFNM = 'NFE';
|
||||
char strDFNM[]="DFNM";
|
||||
char strTFNM[]="TFNM";
|
||||
char strEFNM[]="EFNM";
|
||||
|
||||
ulDFNM |= ULONG('M')<<24;
|
||||
ulTFNM |= ULONG('M')<<24;
|
||||
ulEFNM |= ULONG('M')<<24;
|
||||
|
||||
// for all list members
|
||||
CListHead lhToProcess;
|
||||
lhToProcess.MoveList(dl_ListHead);
|
||||
while(!lhToProcess.IsEmpty()) {
|
||||
CDependInfo *pdi = LIST_HEAD(lhToProcess, CDependInfo, di_Node);
|
||||
|
||||
pdi->di_Node.Remove();
|
||||
dl_ListHead.AddTail(pdi->di_Node);
|
||||
|
||||
CTFileName fnFileName = pdi->di_fnFileName;
|
||||
// try to open file for reading
|
||||
file_handle = _open( _fnmApplicationPath + fnFileName, _O_RDONLY | _O_BINARY);
|
||||
// if an error occured
|
||||
if( file_handle == -1)
|
||||
{
|
||||
// if file is not available remove it from list
|
||||
//FatalError( "File %s can't be opened!", (CTString&)(_fnmApplicationPath + fnFileName));
|
||||
printf( "warning, cannot open: %s (referenced from %s)\n", (CTString&)(fnFileName), (CTString&)(pdi->di_fnParent));
|
||||
delete pdi;
|
||||
}
|
||||
// if file is opened properly
|
||||
else
|
||||
{
|
||||
struct stat statFileStatus;
|
||||
// get file status
|
||||
fstat( file_handle, &statFileStatus);
|
||||
pdi->di_tTime = statFileStatus.st_mtime;
|
||||
ASSERT(pdi->di_tTime<=time(NULL));
|
||||
// get size
|
||||
SLONG ulSize = statFileStatus.st_size;
|
||||
// read file into memory
|
||||
char *pFileInMemory = (char *) AllocMemory( ulSize);
|
||||
// must be allocated properly
|
||||
ASSERT( pFileInMemory != NULL);
|
||||
// read file
|
||||
if( _read( file_handle, pFileInMemory, ulSize) != ulSize)
|
||||
{
|
||||
FatalError( "Fatal error ocured while reading file: %s.", (CTString&)pdi->di_fnFileName);
|
||||
}
|
||||
if(file_handle!=-1) {
|
||||
_close(file_handle);
|
||||
}
|
||||
|
||||
// find all file name indentifiers in memory file ("EFNM" or "DFNM")
|
||||
for( INDEX charCt=0; charCt<ulSize-4; charCt++)
|
||||
{
|
||||
ULONG ulMemValue = *((ULONG *)(pFileInMemory + charCt));
|
||||
char *pchrDependentFile;
|
||||
// if we found file name inside exe file (notice little-big indian convetion)
|
||||
if( ulMemValue == ulEFNM)
|
||||
{
|
||||
// after describing long we will find file name
|
||||
pchrDependentFile = pFileInMemory + charCt + 4;
|
||||
// create full file name
|
||||
CTFileName fnTestName = CTString(pchrDependentFile);
|
||||
if( strlen(fnTestName) > 254) {
|
||||
continue;
|
||||
}
|
||||
// if found file name does not yet exists in dependacy list
|
||||
if( (fnTestName!="") &&
|
||||
(!ExistsInList(dl_ListHead, fnTestName)) &&
|
||||
(!ExistsInList(lhToProcess, fnTestName)))
|
||||
{
|
||||
// create new depend info object
|
||||
CDependInfo *pDI = new CDependInfo( fnTestName, fnFileName);
|
||||
// add it at tail of dependency list
|
||||
lhToProcess.AddTail( pDI->di_Node);
|
||||
}
|
||||
}
|
||||
// if we found file name inside data file (notice little-big indian convetion)
|
||||
else if( ulMemValue == ulDFNM)
|
||||
{
|
||||
char chrFileName[ 256];
|
||||
INDEX iStringLenght = *(INDEX *)(pFileInMemory + charCt + 4);
|
||||
if( iStringLenght > 254 || iStringLenght<0) {
|
||||
continue;
|
||||
}
|
||||
memcpy( chrFileName, pFileInMemory + charCt + 8, iStringLenght);
|
||||
chrFileName[ iStringLenght] = 0;
|
||||
// create full file name
|
||||
CTFileName fnTestName = CTString(chrFileName);
|
||||
if( fnTestName!="" &&
|
||||
(!ExistsInList(dl_ListHead, fnTestName)) &&
|
||||
(!ExistsInList(lhToProcess, fnTestName)))
|
||||
{
|
||||
// create new depend info object
|
||||
// NOTICE: string containing file name starts after ULONG determing its lenght (+8!)
|
||||
CDependInfo *pDI = new CDependInfo( fnTestName, fnFileName);
|
||||
// add it at tail of dependency list
|
||||
lhToProcess.AddTail( pDI->di_Node);
|
||||
}
|
||||
}
|
||||
// if we found file name inside text file (notice little-big indian convetion)
|
||||
else if( ulMemValue == ulTFNM)
|
||||
{
|
||||
// after describing long and one space we will find file name
|
||||
pchrDependentFile = pFileInMemory + charCt + 4 + 1;
|
||||
// copy file name from the file, until newline
|
||||
char chrFileName[ 256];
|
||||
char *chrSrc = pchrDependentFile;
|
||||
char *chrDst = chrFileName;
|
||||
while(*chrSrc!='\n' && *chrSrc!='\r' && chrSrc-pchrDependentFile<254) {
|
||||
*chrDst++ = *chrSrc++;
|
||||
}
|
||||
*chrDst = 0;
|
||||
CTFileName fnTestName = CTString(chrFileName);
|
||||
if( strlen(fnTestName) > 254) {
|
||||
continue;
|
||||
}
|
||||
// if found file name does not yet exists in dependacy list
|
||||
if( (fnTestName!="") &&
|
||||
(!ExistsInList(dl_ListHead, fnTestName)) &&
|
||||
(!ExistsInList(lhToProcess, fnTestName)))
|
||||
{
|
||||
// create new depend info object
|
||||
CDependInfo *pDI = new CDependInfo( fnTestName, fnFileName);
|
||||
// add it at tail of dependency list
|
||||
lhToProcess.AddTail( pDI->di_Node);
|
||||
}
|
||||
}
|
||||
}
|
||||
// free file from memory
|
||||
FreeMemory(pFileInMemory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// substracts given dependecy list from this
|
||||
void CDependencyList::Substract( CDependencyList &dlToSubstract)
|
||||
{
|
||||
// for all files in this dependency
|
||||
FORDELETELIST( CDependInfo, di_Node, dl_ListHead, itThis)
|
||||
{
|
||||
// see if file exists in other dependency
|
||||
FOREACHINLIST( CDependInfo, di_Node, dlToSubstract.dl_ListHead, itOther)
|
||||
{
|
||||
// if we found same file in other dependency list
|
||||
if( itThis->di_fnFileName == itOther->di_fnFileName)
|
||||
{
|
||||
// if file is updated
|
||||
if( itOther->IsUpdated( *itThis))
|
||||
{
|
||||
// remove it from list
|
||||
delete &itThis.Current();
|
||||
break;
|
||||
}
|
||||
// if file to substract is newer than this one
|
||||
else if( itThis->IsOlder( *itOther))
|
||||
{
|
||||
FatalError( "File \"%s\" is newer in substracting dependency file.",
|
||||
(CTString&)itThis->di_fnFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// create list from ascii file
|
||||
void CDependencyList::ImportASCII( CTFileName fnAsciiFile)
|
||||
{
|
||||
char chrOneLine[ 256];
|
||||
CTFileStream file;
|
||||
int file_handle;
|
||||
|
||||
// try to
|
||||
try
|
||||
{
|
||||
// open file list for reading
|
||||
file.Open_t( fnAsciiFile);
|
||||
}
|
||||
catch( char *pError)
|
||||
{
|
||||
FatalError( "Error opening file %s. Error: %s.", (CTString&)fnAsciiFile, pError);
|
||||
}
|
||||
|
||||
// loop loading lines until EOF reached ("catched")
|
||||
FOREVER
|
||||
{
|
||||
try {
|
||||
// load one line from file
|
||||
file.GetLine_t( chrOneLine, 256);
|
||||
// create file name from loaded line
|
||||
CTFileName fnFileName = CTString(chrOneLine);
|
||||
AdjustFilePath_t(fnFileName);
|
||||
// try to open file for reading
|
||||
file_handle = _open( _fnmApplicationPath+fnFileName, _O_RDONLY | _O_BINARY);
|
||||
|
||||
// if opened succesefully
|
||||
if( file_handle != -1) {
|
||||
// create new depend info object
|
||||
CDependInfo *pDI = new CDependInfo( fnFileName, fnAsciiFile);
|
||||
struct stat statFileStatus;
|
||||
// get file status
|
||||
fstat( file_handle, &statFileStatus);
|
||||
// obtain last modification time
|
||||
pDI->di_tTime = statFileStatus.st_mtime;
|
||||
ASSERT(pDI->di_tTime<=time(NULL));
|
||||
// add it at tail of dependency list
|
||||
dl_ListHead.AddTail( pDI->di_Node);
|
||||
// close file
|
||||
_close( file_handle);
|
||||
} else {
|
||||
CPrintF("cannot open file '%s'\n", chrOneLine);
|
||||
}
|
||||
}
|
||||
// error, EOF catched
|
||||
catch( char *pFinished)
|
||||
{
|
||||
if (!file.AtEOF()) {
|
||||
CPrintF("%s\n", pFinished);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove updated files from list
|
||||
void CDependencyList::RemoveUpdatedFiles()
|
||||
{
|
||||
// for all list members
|
||||
FORDELETELIST( CDependInfo, di_Node, dl_ListHead, itDependInfo)
|
||||
{
|
||||
// if file is updated
|
||||
if( itDependInfo->IsFileOnDiskUpdated())
|
||||
{
|
||||
// remove it from list
|
||||
delete &itDependInfo.Current();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clear dependency list
|
||||
void CDependencyList::Clear( void)
|
||||
{
|
||||
// for all list members
|
||||
FORDELETELIST( CDependInfo, di_Node, dl_ListHead, itDependInfo)
|
||||
{
|
||||
// delete member
|
||||
delete &itDependInfo.Current();
|
||||
}
|
||||
}
|
||||
|
||||
// export list members into ascii file in form sutable for archivers
|
||||
void CDependencyList::ExportASCII_t( CTFileName fnAsciiFile)
|
||||
{
|
||||
CTFileStream strmFile;
|
||||
char line[ 256];
|
||||
|
||||
// try to
|
||||
try
|
||||
{
|
||||
// create exporting text file
|
||||
strmFile.Create_t( fnAsciiFile);
|
||||
}
|
||||
catch( char *pError)
|
||||
{
|
||||
FatalError( "Error creating file %s. Error: %s.", (CTString&)fnAsciiFile, pError);
|
||||
}
|
||||
|
||||
// for all members in depend list
|
||||
FOREACHINLIST( CDependInfo, di_Node, dl_ListHead, itDependInfo)
|
||||
{
|
||||
// prepare line of text
|
||||
sprintf( line, "%s\n", (CTString&)itDependInfo->di_fnFileName);
|
||||
// write text line into file
|
||||
strmFile.Write_t( line, strlen( line));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// dynamic array of translation pairs
|
||||
CDynamicArray<CTranslationPair> _atpPairs;
|
||||
|
||||
// add one string to array
|
||||
static void AddStringForTranslation(const CTString &str)
|
||||
{
|
||||
// for each existing pair
|
||||
_atpPairs.Lock();
|
||||
INDEX ct = _atpPairs.Count();
|
||||
for(INDEX i=0; i<ct; i++) {
|
||||
// if it is that one
|
||||
if (strcmp(_atpPairs[i].tp_strSrc, str)==0) {
|
||||
// just mark it as used
|
||||
_atpPairs[i].m_bUsed = TRUE;
|
||||
// don't search any more
|
||||
_atpPairs.Unlock();
|
||||
return;
|
||||
}
|
||||
}
|
||||
_atpPairs.Unlock();
|
||||
|
||||
// if not found, add it
|
||||
CTranslationPair &tp = *_atpPairs.New(1);
|
||||
tp.tp_strSrc = str;
|
||||
tp.tp_strDst = CTString("$TODO$") + str;
|
||||
tp.m_bUsed = TRUE;
|
||||
}
|
||||
|
||||
static void WriteTranslationToken_t(CTStream &strm, CTString str)
|
||||
{
|
||||
strm.PutString_t(str);
|
||||
}
|
||||
static void WriteTranslationString_t(CTStream &strm, CTString str)
|
||||
{
|
||||
const char *s = str;
|
||||
INDEX iLen=strlen(s);
|
||||
for (INDEX i=0; i<iLen; i++) {
|
||||
char c = s[i];
|
||||
switch(c) {
|
||||
case '\n':
|
||||
strm<<UBYTE('\\')<<UBYTE('n')<<UBYTE('\n');
|
||||
break;
|
||||
case '\\':
|
||||
strm<<UBYTE('\\')<<UBYTE('\\');
|
||||
break;
|
||||
default:
|
||||
strm<<UBYTE(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// extract translation strings from all files in list
|
||||
void CDependencyList::ExtractTranslations_t( const CTFileName &fnTranslations)
|
||||
{
|
||||
_atpPairs.Clear();
|
||||
|
||||
// read original translation table
|
||||
ReadTranslationTable_t(_atpPairs, fnTranslations);
|
||||
|
||||
// for each file in list
|
||||
FOREACHINLIST( CDependInfo, di_Node, dl_ListHead, itDependInfo) {
|
||||
CDependInfo &di = *itDependInfo;
|
||||
// open the file
|
||||
CTFileStream strm;
|
||||
strm.Open_t(di.di_fnFileName);
|
||||
// load it in memory
|
||||
SLONG slSize = strm.GetStreamSize();
|
||||
UBYTE *pubFile = (UBYTE *)AllocMemory(slSize);
|
||||
strm.Read_t(pubFile, slSize);
|
||||
|
||||
// for each byte in file
|
||||
for(INDEX iByte=0; iByte<slSize-4; iByte++) {
|
||||
UBYTE *pub = pubFile+iByte;
|
||||
ULONG *pul = (ULONG*)pub;
|
||||
|
||||
// if exe translatable string is here
|
||||
if (*pul=='SRTE') {
|
||||
// get it
|
||||
CTString str = (char*)(pub+4);
|
||||
// add it
|
||||
AddStringForTranslation(str);
|
||||
// if data translatable string is here
|
||||
} else if (*pul=='SRTD') {
|
||||
char achr[ 256];
|
||||
INDEX iStrLen = *(INDEX *)(pub + 4);
|
||||
if( iStrLen > 254 || iStrLen<0) {
|
||||
continue;
|
||||
}
|
||||
memcpy( achr, pub + 8, iStrLen);
|
||||
achr[ iStrLen] = 0;
|
||||
// get it
|
||||
CTString str = achr;
|
||||
// add it
|
||||
AddStringForTranslation(str);
|
||||
// if text translatable string is here
|
||||
} else if (*pul=='SRTT') {
|
||||
|
||||
// after describing long and one space we will find file name
|
||||
char *pchrStart = (char*)pub + 4 + 1;
|
||||
// copy file name from the file, until newline
|
||||
char chrString[ 256];
|
||||
char *chrSrc = pchrStart;
|
||||
char *chrDst = chrString;
|
||||
while(*chrSrc!='\n' && *chrSrc!='\r' && chrSrc-pchrStart<254) {
|
||||
*chrDst++ = *chrSrc++;
|
||||
}
|
||||
*chrDst = 0;
|
||||
CTString str = CTString(chrString);
|
||||
if( strlen(str) > 254) {
|
||||
continue;
|
||||
}
|
||||
// add it
|
||||
AddStringForTranslation(str);
|
||||
}
|
||||
}
|
||||
|
||||
// free file from memory
|
||||
FreeMemory(pubFile);
|
||||
}
|
||||
|
||||
// count used pairs
|
||||
_atpPairs.Lock();
|
||||
INDEX ctUsedPairs = 0;
|
||||
{INDEX ct = _atpPairs.Count();
|
||||
for(INDEX i=0; i<ct; i++) {
|
||||
if(_atpPairs[i].m_bUsed) {
|
||||
ctUsedPairs++;
|
||||
}
|
||||
}}
|
||||
_atpPairs.Unlock();
|
||||
|
||||
// create output file
|
||||
CTFileStream strm;
|
||||
strm.Create_t(fnTranslations);
|
||||
// write number of used pairs
|
||||
CTString strNo;
|
||||
strNo.PrintF("%d", ctUsedPairs);
|
||||
WriteTranslationString_t(strm, strNo);
|
||||
WriteTranslationToken_t(strm, "\n");
|
||||
// for each used pair
|
||||
_atpPairs.Lock();
|
||||
{INDEX ct = _atpPairs.Count();
|
||||
for(INDEX i=0; i<ct; i++) {
|
||||
CTranslationPair &tp = _atpPairs[i];
|
||||
if(!tp.m_bUsed) {
|
||||
continue;
|
||||
}
|
||||
// write it, as source and destination, with tags in front
|
||||
WriteTranslationToken_t(strm, "\n\\0\\<\n");
|
||||
WriteTranslationString_t(strm, tp.tp_strSrc);
|
||||
WriteTranslationToken_t(strm, "\n\\0\\>\n");
|
||||
WriteTranslationString_t(strm, tp.tp_strDst);
|
||||
}}
|
||||
_atpPairs.Unlock();
|
||||
// write eof token
|
||||
WriteTranslationToken_t(strm, "\n\\0\\$\n");
|
||||
}
|
||||
|
||||
// read operation
|
||||
void CDependencyList::Read_t( CTStream *istrFile)
|
||||
{
|
||||
// count of files
|
||||
INDEX ctFiles;
|
||||
// expect file ID
|
||||
istrFile->ExpectID_t( CChunkID( "DEPD"));
|
||||
// read number of entries in list
|
||||
*istrFile >> ctFiles;
|
||||
// load all list members
|
||||
for( INDEX i=0; i<ctFiles; i++)
|
||||
{
|
||||
// create new depend info object
|
||||
CDependInfo *pDI = new CDependInfo( CTString(""), istrFile->GetDescription());
|
||||
// read dependency object
|
||||
pDI->Read_t( istrFile);
|
||||
// add it at tail of dependency list
|
||||
dl_ListHead.AddTail( pDI->di_Node);
|
||||
}
|
||||
}
|
||||
|
||||
// write opertaion
|
||||
void CDependencyList::Write_t( CTStream *ostrFile)
|
||||
{
|
||||
// write file ID
|
||||
ostrFile->WriteID_t( CChunkID( "DEPD"));
|
||||
// write number of entries in list
|
||||
*ostrFile << dl_ListHead.Count();
|
||||
// for all members in dependency list
|
||||
FOREACHINLIST( CDependInfo, di_Node, dl_ListHead, itDependInfo)
|
||||
{
|
||||
// write one depend info object
|
||||
itDependInfo->Write_t( ostrFile);
|
||||
}
|
||||
}
|
||||
|
||||
// make a new directory recursively
|
||||
static void MakeDirectory_t(const CTFileName &fnm)
|
||||
{
|
||||
if (fnm=="") {
|
||||
return;
|
||||
}
|
||||
// remove trailing backslash
|
||||
CTFileName fnmDir = fnm;
|
||||
((char *)(const char*)fnmDir)[strlen(fnmDir)-1] = 0;
|
||||
// get the path part
|
||||
CTFileName fnmDirPath = fnmDir.FileDir();
|
||||
// if there is a path part
|
||||
if (fnmDirPath!="") {
|
||||
// create that first
|
||||
MakeDirectory_t(fnmDirPath);
|
||||
}
|
||||
// try to create the directory
|
||||
int iRes = _mkdir(_fnmApplicationPath+fnmDir);
|
||||
}
|
||||
|
70
Sources/Depend/Dependency.h
Normal file
70
Sources/Depend/Dependency.h
Normal file
|
@ -0,0 +1,70 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#ifndef SE_INCL_DEPENDENCY_H
|
||||
#define SE_INCL_DEPENDENCY_H
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// adjust file path automatically for application path prefix
|
||||
void AdjustFilePath_t(CTFileName &fnm);
|
||||
|
||||
class CDependInfo {
|
||||
public:
|
||||
// atributes
|
||||
CListNode di_Node;
|
||||
CTFileName di_fnFileName;
|
||||
time_t di_tTime;
|
||||
CTFileName di_fnParent;
|
||||
|
||||
// default constructor
|
||||
CDependInfo( CTFileName fnFileName, CTFileName fnParent);
|
||||
// if this file is updated
|
||||
BOOL IsFileOnDiskUpdated(void);
|
||||
// if time of given file is same
|
||||
inline BOOL IsUpdated(const CDependInfo &diOther) {
|
||||
return( diOther.di_tTime == di_tTime);};
|
||||
// if given file is older
|
||||
inline BOOL IsOlder(const CDependInfo &diOther) {
|
||||
return( di_tTime < diOther.di_tTime);};
|
||||
// Comparison operator.
|
||||
inline BOOL operator==(const CDependInfo &diOther) const {
|
||||
return( diOther.di_fnFileName == di_fnFileName);};
|
||||
// read and write opertaions
|
||||
inline void Read_t( CTStream *istrFile) {
|
||||
*istrFile >> di_fnFileName;
|
||||
istrFile->Read_t( &di_tTime, sizeof( time_t));
|
||||
};
|
||||
inline void Write_t( CTStream *ostrFile) const {
|
||||
*ostrFile << di_fnFileName;
|
||||
ostrFile->Write_t( &di_tTime, sizeof( time_t));
|
||||
};
|
||||
};
|
||||
|
||||
class CDependencyList {
|
||||
public:
|
||||
CListHead dl_ListHead;
|
||||
// operations
|
||||
void ExtractDependencies();
|
||||
// remove updated files from list
|
||||
void RemoveUpdatedFiles();
|
||||
// create list from ascii file
|
||||
void ImportASCII( CTFileName fnAsciiFile);
|
||||
// export list members into ascii file in form sutable for archivers
|
||||
void ExportASCII_t( CTFileName fnAsciiFile);
|
||||
// substracts given list from this
|
||||
void Substract( CDependencyList &dlToSubstract);
|
||||
// extract translation strings from all files in list
|
||||
void ExtractTranslations_t( const CTFileName &fnTranslations);
|
||||
// clear dependency list
|
||||
void Clear( void);
|
||||
// if given file allready has its own DependInfo object linked in list
|
||||
BOOL ExistsInList(CListHead &lh, CTFileName fnTestName) const;
|
||||
// read and write opertaions
|
||||
void Read_t( CTStream *istrFile); // throw char *
|
||||
void Write_t( CTStream *ostrFile); // throw char *
|
||||
};
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
3
Sources/Depend/StdH.cpp
Normal file
3
Sources/Depend/StdH.cpp
Normal file
|
@ -0,0 +1,3 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
13
Sources/Depend/StdH.h
Normal file
13
Sources/Depend/StdH.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <direct.h>
|
||||
#include <sys\types.h>
|
||||
#include <sys\stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
|
||||
#include <Engine/Engine.h>
|
||||
#include <Engine/Base/GroupFile.h>
|
156
Sources/Depend/UtilityDepend.cpp
Normal file
156
Sources/Depend/UtilityDepend.cpp
Normal file
|
@ -0,0 +1,156 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
#include "Dependency.h"
|
||||
|
||||
// Depend - extract dependencies and create group file utility
|
||||
|
||||
#define ACHR_OPTION argv[1]
|
||||
#define ACHR_APP_DIR argv[2]
|
||||
|
||||
void PrintUsage()
|
||||
{
|
||||
printf(
|
||||
"\nUSAGE:\n"
|
||||
"Depend d <application dir> <file 1> <file 2> <output file>\n"
|
||||
" make difference beetween two dependency files (result = file 1 - file 2)\n"
|
||||
"Depend i <application dir> <lst file> <dep file>\n"
|
||||
" create dependencies for files listed in given list file\n"
|
||||
"Depend u <application dir> <in dep file> <out dep file>\n"
|
||||
" remove updated files from dependency file\n"
|
||||
"Depend e <application dir> <dep file> <lst file>\n"
|
||||
" export dependency file to ascii list file\n"
|
||||
"Depend t <application dir> <lst file> <translation file>\n"
|
||||
" export strings for translation\n"
|
||||
"\n");
|
||||
exit( EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void SubMain( int argc, char *argv[]);
|
||||
|
||||
int main( int argc, char *argv[])
|
||||
{
|
||||
CTSTREAM_BEGIN {
|
||||
SubMain(argc, argv);
|
||||
} CTSTREAM_END;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SubMain( int argc, char *argv[])
|
||||
{
|
||||
// there must be 4 or 6 parameters (first is depend.exe file name)
|
||||
if( (argc < 4) || (argc > 6) )
|
||||
{
|
||||
PrintUsage();
|
||||
}
|
||||
|
||||
// initialize engine
|
||||
SE_InitEngine("");
|
||||
// get application path from cmd line
|
||||
_fnmApplicationPath = CTString(ACHR_APP_DIR);
|
||||
// if not ending with backslash
|
||||
if (_fnmApplicationPath[strlen(_fnmApplicationPath)-1]!='\\') {
|
||||
_fnmApplicationPath += "\\";
|
||||
}
|
||||
|
||||
// get all filenames from command line
|
||||
CTFileName afnFiles[3];
|
||||
INDEX ctFiles = argc-3;
|
||||
if (ctFiles>ARRAYCOUNT(afnFiles)) {
|
||||
PrintUsage();
|
||||
}
|
||||
for (INDEX iFile=0; iFile<ctFiles; iFile++) {
|
||||
afnFiles[iFile] = CTString(argv[iFile+3]);
|
||||
}
|
||||
|
||||
// lenght of options string must be 1
|
||||
if( strlen( ACHR_OPTION) != 1) {
|
||||
printf( "First argument must be letter representing wanted option.\n\n");
|
||||
PrintUsage();
|
||||
}
|
||||
|
||||
// try to
|
||||
try {
|
||||
// remove application paths
|
||||
for (INDEX iFile=0; iFile<ctFiles; iFile++) {
|
||||
AdjustFilePath_t(afnFiles[iFile]);
|
||||
}
|
||||
|
||||
// see what option was requested
|
||||
switch( tolower(ACHR_OPTION[0]) ) {
|
||||
case 'i': {
|
||||
if( ctFiles != 2) PrintUsage();
|
||||
CDependencyList dl;
|
||||
CTFileStream strmDep;
|
||||
|
||||
// import files into dependency list from given ascii file
|
||||
dl.ImportASCII( afnFiles[0]);
|
||||
// extract dependencies
|
||||
dl.ExtractDependencies();
|
||||
// write dependency list
|
||||
strmDep.Create_t( afnFiles[1], CTStream::CM_BINARY);
|
||||
dl.Write_t( &strmDep);
|
||||
} break;
|
||||
case 'e': {
|
||||
if( ctFiles != 2) PrintUsage();
|
||||
CDependencyList dl;
|
||||
CTFileStream strmDepIn;
|
||||
|
||||
// read dependency list
|
||||
strmDepIn.Open_t( afnFiles[0], CTStream::OM_READ);
|
||||
dl.Read_t( &strmDepIn);
|
||||
strmDepIn.Close();
|
||||
// export file suitable for archivers
|
||||
dl.ExportASCII_t( afnFiles[1]);
|
||||
} break;
|
||||
case 'u': {
|
||||
if( ctFiles != 2) PrintUsage();
|
||||
CDependencyList dl;
|
||||
CTFileStream strmDepIn, strmDepOut;
|
||||
|
||||
// read dependency list
|
||||
strmDepIn.Open_t( afnFiles[0], CTStream::OM_READ);
|
||||
dl.Read_t( &strmDepIn);
|
||||
strmDepIn.Close();
|
||||
// remove updated files from list
|
||||
dl.RemoveUpdatedFiles();
|
||||
// write dependency list
|
||||
strmDepOut.Create_t( afnFiles[1], CTStream::CM_BINARY);
|
||||
dl.Write_t( &strmDepOut);
|
||||
} break;
|
||||
case 'd': { // UNTESTED!!!!
|
||||
if( ctFiles != 3) PrintUsage();
|
||||
// load dependency lists
|
||||
CDependencyList dl1, dl2;
|
||||
CTFileStream strmDep1, strmDep2, strmDepDiff;
|
||||
strmDep1.Open_t( afnFiles[0], CTStream::OM_READ);
|
||||
strmDep2.Open_t( afnFiles[1], CTStream::OM_READ);
|
||||
dl1.Read_t( &strmDep1);
|
||||
dl2.Read_t( &strmDep2);
|
||||
strmDep1.Close();
|
||||
strmDep2.Close();
|
||||
// calculate difference dependency 1 and 2 (res = 1-2)
|
||||
dl1.Substract( dl2);
|
||||
// save the difference dependency list
|
||||
strmDepDiff.Create_t( afnFiles[2], CTStream::CM_BINARY);
|
||||
dl1.Write_t( &strmDepDiff);
|
||||
} break;
|
||||
case 't': {
|
||||
if( ctFiles != 2) PrintUsage();
|
||||
CDependencyList dl;
|
||||
// read file list
|
||||
dl.ImportASCII( afnFiles[0]);
|
||||
// extract translations
|
||||
dl.ExtractTranslations_t( afnFiles[1]);
|
||||
} break;
|
||||
default: {
|
||||
printf( "Unrecognizable option requested.\n\n");
|
||||
PrintUsage();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( char *pError)
|
||||
{
|
||||
printf( "Error occured.\n%s\n", pError);
|
||||
}
|
||||
}
|
214
Sources/Ecc/Ecc.vcxproj
Normal file
214
Sources/Ecc/Ecc.vcxproj
Normal file
|
@ -0,0 +1,214 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Template|Win32">
|
||||
<Configuration>Template</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<ProjectGuid>{1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Debug\</OutDir>
|
||||
<IntDir>Debug\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<ExecutablePath>$(SolutionDir)..\Tools.Win32;$(ExecutablePath)</ExecutablePath>
|
||||
<IncludePath>$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
<SourcePath>$(SolutionDir)Ecc;$(SourcePath)</SourcePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Release\</OutDir>
|
||||
<IntDir>Release\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<ExecutablePath>$(SolutionDir)..\Tools.Win32;$(ExecutablePath)</ExecutablePath>
|
||||
<IncludePath>$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
<SourcePath>$(SolutionDir)Ecc;$(SourcePath)</SourcePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;DIRECT3D_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
|
||||
<PrecompiledHeaderOutputFile>.\Debug\Ecc.pch</PrecompiledHeaderOutputFile>
|
||||
<ObjectFileName>.\Debug\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
|
||||
<DisableSpecificWarnings>4996;4333</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug\Ecc.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Debug\Ecc.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>.\Debug\Ecc.exe</OutputFile>
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateMapFile>true</GenerateMapFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>mkdir $(SolutionDir)..\Bin 2>nul
|
||||
mkdir $(SolutionDir)..\Bin\Debug 2>nul
|
||||
copy Debug\$(TargetName).exe $(SolutionDir)..\Bin\Debug\ >nul
|
||||
copy Debug\$(TargetName).map $(SolutionDir)..\Bin\Debug\ >nul</Command>
|
||||
<Message>Copying %(Filename) binaries to \Bin\Debug</Message>
|
||||
<Outputs>$(SolutionDir)..\Bin\Debug\$(TargetName).exe;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<OmitFramePointers>false</OmitFramePointers>
|
||||
<StringPooling>true</StringPooling>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;DIRECT3D_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AssemblerListingLocation>.\Release\</AssemblerListingLocation>
|
||||
<PrecompiledHeaderOutputFile>.\Release\Ecc.pch</PrecompiledHeaderOutputFile>
|
||||
<ObjectFileName>.\Release\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
|
||||
<DisableSpecificWarnings>4996;4333</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release\Ecc.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Release\Ecc.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>.\Release\Ecc.exe</OutputFile>
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateMapFile>true</GenerateMapFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>mkdir $(SolutionDir)..\Bin 2>nul
|
||||
copy Release\$(TargetName).exe $(SolutionDir)..\Bin\ >nul
|
||||
copy Release\$(TargetName).map $(SolutionDir)..\Bin\ >nul</Command>
|
||||
<Message>Copying %(Filename) binaries to \Bin</Message>
|
||||
<Outputs>$(SolutionDir)..\Bin\$(TargetName).exe;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
|
||||
<CustomBuildStep>
|
||||
<Command>mkdir $(SolutionDir)..\Bin 2>nul
|
||||
copy Debug\%(Filename).exe $(SolutionDir)..\Bin\ >nul
|
||||
copy Debug\%(Filename).map $(SolutionDir)..\Bin\ >nul</Command>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="Parser.y">
|
||||
<FileType>Document</FileType>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">pushd $(SolutionDir)
|
||||
bison -o$(ProjectName)/Parser.c $(ProjectName)/Parser.y -d
|
||||
popd
|
||||
copy %(RootDir)%(Directory)\Parser.c %(RootDir)%(Directory)\Parser.cpp
|
||||
del %(RootDir)%(Directory)\Parser.c /q</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Creating parser source</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(RootDir)%(Directory)\Parser.cpp;%(RootDir)%(Directory)\Parser.h;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">pushd $(SolutionDir)
|
||||
bison -o$(ProjectName)/Parser.c $(ProjectName)/Parser.y -d
|
||||
popd
|
||||
copy %(RootDir)%(Directory)\Parser.c %(RootDir)%(Directory)\Parser.cpp
|
||||
del %(RootDir)%(Directory)\Parser.c /q</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Creating parser source</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(RootDir)%(Directory)\Parser.cpp;%(RootDir)%(Directory)\Parser.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Scanner.l">
|
||||
<FileType>Document</FileType>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">flex -o%(RootDir)%(Directory)\Scanner.cpp %(RootDir)%(Directory)\Scanner.l</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Creating scanner source</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Scanner.cpp;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">flex -o%(RootDir)%(Directory)\Scanner.cpp %(RootDir)%(Directory)\Scanner.l</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Scanner.cpp;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Parser.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="Parser.cpp" />
|
||||
<ClCompile Include="Scanner.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Main.h" />
|
||||
<ClInclude Include="StdH.h" />
|
||||
<ClInclude Include="unistd.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
57
Sources/Ecc/Ecc.vcxproj.filters
Normal file
57
Sources/Ecc/Ecc.vcxproj.filters
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{acd5aeef-9312-4c06-9a18-ffc69148b586}</UniqueIdentifier>
|
||||
<Extensions>cpp</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Grammar files">
|
||||
<UniqueIdentifier>{97120739-0d00-462f-bb75-be637f0e69f3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Dummy">
|
||||
<UniqueIdentifier>{414eb5ab-c891-41f1-85bb-3594afce7081}</UniqueIdentifier>
|
||||
<Extensions>c</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{aebfcf57-f684-490f-baf9-b3c0fd748e23}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;fi;fd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{cf15f1a2-66f9-41f7-872d-8fbaa310a5e2}</UniqueIdentifier>
|
||||
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Parser.c">
|
||||
<Filter>Source Files\Dummy</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Parser.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Scanner.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Main.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StdH.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="unistd.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="Parser.y">
|
||||
<Filter>Source Files\Grammar files</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Scanner.l">
|
||||
<Filter>Source Files\Grammar files</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
</Project>
|
3
Sources/Ecc/Ecc.vcxproj.user
Normal file
3
Sources/Ecc/Ecc.vcxproj.user
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
333
Sources/Ecc/Main.cpp
Normal file
333
Sources/Ecc/Main.cpp
Normal file
|
@ -0,0 +1,333 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
#include "Main.h"
|
||||
|
||||
FILE *_fInput;
|
||||
int _iLinesCt = 1;
|
||||
char *_strInputFileName;
|
||||
int _bTrackLineInformation=0; // this is set if #line should be inserted in tokens
|
||||
bool _bRemoveLineDirective = 0;
|
||||
|
||||
|
||||
FILE *_fImplementation;
|
||||
FILE *_fDeclaration;
|
||||
FILE *_fTables;
|
||||
FILE *_fExports;
|
||||
char *_strFileNameBase;
|
||||
char *_strFileNameBaseIdentifier;
|
||||
|
||||
extern FILE *yyin;
|
||||
|
||||
extern "C" int yywrap(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
int ctErrors = 0;
|
||||
|
||||
char *stradd(char *str1, char *str2)
|
||||
{
|
||||
char *strResult;
|
||||
strResult = (char*)malloc(strlen(str1)+strlen(str2)+1);
|
||||
strcpy(strResult, str1);
|
||||
strcat(strResult, str2);
|
||||
return strResult;
|
||||
}
|
||||
char *stradd(char *str1, char *str2, char *str3)
|
||||
{
|
||||
char *strResult;
|
||||
strResult = (char*)malloc(strlen(str1)+strlen(str2)+strlen(str3)+1);
|
||||
strcpy(strResult, str1);
|
||||
strcat(strResult, str2);
|
||||
strcat(strResult, str3);
|
||||
return strResult;
|
||||
}
|
||||
|
||||
char *LineDirective(int i)
|
||||
{
|
||||
char str[256];
|
||||
sprintf(str, "\n#line %d %s\n", i, _strInputFileName);
|
||||
return strdup(str);
|
||||
}
|
||||
|
||||
SType SType::operator+(const SType &other)
|
||||
{
|
||||
SType sum;
|
||||
sum.strString = stradd(strString, other.strString);
|
||||
sum.iLine = -1;
|
||||
sum.bCrossesStates = bCrossesStates||other.bCrossesStates;
|
||||
return sum;
|
||||
};
|
||||
|
||||
/*
|
||||
* Function used for reporting errors.
|
||||
*/
|
||||
void yyerror(char *s)
|
||||
{
|
||||
fprintf( stderr, "%s(%d): Error: %s\n", _strInputFileName, _iLinesCt, s);
|
||||
ctErrors++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Change the extension of the filename.
|
||||
*/
|
||||
char *ChangeFileNameExtension(char *strFileName, char *strNewExtension)
|
||||
{
|
||||
char *strChanged = (char*)malloc(strlen(strFileName)+strlen(strNewExtension)+2);
|
||||
strcpy(strChanged, strFileName);
|
||||
char *pchDot = strrchr(strChanged, '.');
|
||||
if (pchDot==NULL) {
|
||||
pchDot = strChanged+strlen(strChanged);
|
||||
}
|
||||
strcpy(pchDot, strNewExtension);
|
||||
return strChanged;
|
||||
}
|
||||
|
||||
/*
|
||||
* Open a file and report an error if failed.
|
||||
*/
|
||||
FILE *FOpen(const char *strFileName, char *strMode)
|
||||
{
|
||||
// open the input file
|
||||
FILE *f = fopen(strFileName, strMode);
|
||||
// if not successful
|
||||
if (f==NULL) {
|
||||
// report error
|
||||
fprintf(stderr, "Can't open file '%s': %s\n", strFileName, strerror(errno));
|
||||
//quit
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
/*
|
||||
* Print a header to an output file.
|
||||
*/
|
||||
static void PrintHeader(FILE *f)
|
||||
{
|
||||
fprintf(f, "/*\n");
|
||||
fprintf(f, " * This file is generated by Entity Class Compiler, (c) CroTeam 1997-98\n");
|
||||
fprintf(f, " */\n");
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
||||
void TranslateBackSlashes(char *str)
|
||||
{
|
||||
char *strNextSlash = str;
|
||||
while((strNextSlash = strchr(strNextSlash, '\\'))!=NULL) {
|
||||
*strNextSlash = '/';
|
||||
}
|
||||
}
|
||||
|
||||
#define READSIZE 1024
|
||||
/* Relpace File and remove #line directive from file */
|
||||
void ReplaceFileRL(const char *strOld, const char *strNew)
|
||||
{
|
||||
char strOldBuff[READSIZE*3+1];
|
||||
char strNewBuff[READSIZE+1];
|
||||
int iOldch=0;
|
||||
FILE *pfNew = NULL;
|
||||
FILE *pfOld = NULL;
|
||||
bool bQuotes = 0;
|
||||
bool bComment = 0;
|
||||
|
||||
// open files
|
||||
pfNew = fopen(strNew,"rb");
|
||||
if(!pfNew) goto Error;
|
||||
pfOld = fopen(strOld,"wb");
|
||||
if(!pfOld) goto Error;
|
||||
|
||||
// until eof
|
||||
while(!feof(pfNew))
|
||||
{
|
||||
// clear buffers
|
||||
memset(&strOldBuff,0,sizeof(strOldBuff));
|
||||
memset(&strNewBuff,0,sizeof(strNewBuff));
|
||||
|
||||
iOldch = 0;
|
||||
bQuotes = 0;
|
||||
bComment = 0;
|
||||
|
||||
// read one line from file
|
||||
int iRead = fread(strNewBuff,1,READSIZE,pfNew);
|
||||
char *chLineEnd = strchr(strNewBuff,13);
|
||||
if(chLineEnd) *(chLineEnd+2) = 0;
|
||||
// get line length
|
||||
int ctch = strlen(strNewBuff);
|
||||
int iSeek = -iRead+ctch;
|
||||
// seek file for extra characters read
|
||||
if(iSeek!=0) fseek(pfNew,iSeek ,SEEK_CUR);
|
||||
if(strncmp(strNewBuff,"#line",5)==0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// process each charachter
|
||||
for(int ich=0;ich<ctch;ich++)
|
||||
{
|
||||
char *pchOld = &strOldBuff[iOldch];
|
||||
char *pchNew = &strNewBuff[ich];
|
||||
|
||||
if((*pchNew == '{') || (*pchNew == '}') || *pchNew == ';')
|
||||
{
|
||||
if((!bComment) && (!bQuotes) && (*(pchNew+1) != 13))
|
||||
{
|
||||
strOldBuff[iOldch++] = strNewBuff[ich];
|
||||
strOldBuff[iOldch++] = 13;
|
||||
strOldBuff[iOldch++] = 10;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(*pchNew == '"')
|
||||
{
|
||||
// if this is quote
|
||||
if((ich>0) && (*(pchNew-1)=='\\')) { }
|
||||
else bQuotes = !bQuotes;
|
||||
}
|
||||
else if((*pchNew == '/') && (*(pchNew+1) == '/'))
|
||||
{
|
||||
// if this is comment
|
||||
bComment = 1;
|
||||
}
|
||||
strOldBuff[iOldch++] = strNewBuff[ich];
|
||||
}
|
||||
fwrite(&strOldBuff,1,iOldch,pfOld);
|
||||
}
|
||||
|
||||
if(pfNew) fclose(pfNew);
|
||||
if(pfOld) fclose(pfOld);
|
||||
remove(strNew);
|
||||
return;
|
||||
Error:
|
||||
if(pfNew) fclose(pfNew);
|
||||
if(pfOld) fclose(pfOld);
|
||||
}
|
||||
|
||||
/* Replace a file with a new file. */
|
||||
void ReplaceFile(const char *strOld, const char *strNew)
|
||||
{
|
||||
if(_bRemoveLineDirective)
|
||||
{
|
||||
ReplaceFileRL(strOld,strNew);
|
||||
return;
|
||||
}
|
||||
remove(strOld);
|
||||
rename(strNew, strOld);
|
||||
}
|
||||
/* Replace a file with a new file if they are different.
|
||||
* Used to keep .h files from constantly changing when you change the implementation.
|
||||
*/
|
||||
void ReplaceIfChanged(const char *strOld, const char *strNew)
|
||||
{
|
||||
int iChanged = 1;
|
||||
FILE *fOld = fopen(strOld, "r");
|
||||
if (fOld!=NULL) {
|
||||
iChanged = 0;
|
||||
FILE *fNew = FOpen(strNew, "r");
|
||||
while (!feof(fOld)) {
|
||||
char strOldLine[4096] = "#l";
|
||||
char strNewLine[4096] = "#l";
|
||||
|
||||
// skip #line directives
|
||||
while(strNewLine[0]=='#' && strNewLine[1]=='l' && !feof(fNew)) {
|
||||
fgets(strNewLine, sizeof(strNewLine)-1, fNew);
|
||||
}
|
||||
while(strOldLine[0]=='#' && strOldLine[1]=='l' && !feof(fOld)) {
|
||||
fgets(strOldLine, sizeof(strOldLine)-1, fOld);
|
||||
}
|
||||
if (strcmp(strNewLine, strOldLine)!=0) {
|
||||
iChanged = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(fNew);
|
||||
fclose(fOld);
|
||||
}
|
||||
|
||||
if (iChanged) {
|
||||
remove(strOld);
|
||||
rename(strNew, strOld);
|
||||
} else {
|
||||
remove(strNew);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// if there is not one argument on the command line
|
||||
if (argc<1+1) {
|
||||
// print usage
|
||||
printf("Usage: Ecc <es_file_name>\n -line\n");
|
||||
//quit
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if(argc>2)
|
||||
{
|
||||
if(strcmp(argv[2],"-line")==0)
|
||||
{
|
||||
_bRemoveLineDirective=1;
|
||||
}
|
||||
}
|
||||
// open the input file
|
||||
_fInput = FOpen(argv[1], "r");
|
||||
//printf("%s\n", argv[1]);
|
||||
// open all the output files
|
||||
char *strImplementation = ChangeFileNameExtension(argv[1], ".cpp_tmp");
|
||||
char *strImplementationOld = ChangeFileNameExtension(argv[1], ".cpp");
|
||||
char *strDeclaration = ChangeFileNameExtension(argv[1], ".h_tmp");
|
||||
char *strDeclarationOld = ChangeFileNameExtension(argv[1], ".h");
|
||||
char *strTables = ChangeFileNameExtension(argv[1], "_tables.h_tmp");
|
||||
char *strTablesOld = ChangeFileNameExtension(argv[1], "_tables.h");
|
||||
|
||||
_fImplementation = FOpen(strImplementation, "w");
|
||||
_fDeclaration = FOpen(strDeclaration , "w");
|
||||
_fTables = FOpen(strTables , "w");
|
||||
// get the filename as preprocessor usable identifier
|
||||
_strFileNameBase = ChangeFileNameExtension(argv[1], "");
|
||||
_strFileNameBaseIdentifier = strdup(_strFileNameBase);
|
||||
{char *strNextSlash = _strFileNameBaseIdentifier;
|
||||
while((strNextSlash = strchr(strNextSlash, '/'))!=NULL) {
|
||||
*strNextSlash = '_';
|
||||
}}
|
||||
{char *strNextSlash = _strFileNameBaseIdentifier;
|
||||
while((strNextSlash = strchr(strNextSlash, '\\'))!=NULL) {
|
||||
*strNextSlash = '_';
|
||||
}}
|
||||
// print their headers
|
||||
PrintHeader(_fImplementation );
|
||||
PrintHeader(_fDeclaration );
|
||||
PrintHeader(_fTables );
|
||||
|
||||
// remember input filename
|
||||
char strFullInputName[MAXPATHLEN];
|
||||
_fullpath(strFullInputName, argv[1], MAXPATHLEN);
|
||||
_strInputFileName = strFullInputName;
|
||||
TranslateBackSlashes(_strInputFileName);
|
||||
// make lex use the input file
|
||||
yyin = _fInput;
|
||||
|
||||
// parse input file and generate the output files
|
||||
yyparse();
|
||||
|
||||
// close all files
|
||||
fclose(_fImplementation);
|
||||
fclose(_fDeclaration);
|
||||
fclose(_fTables);
|
||||
|
||||
// if there were no errors
|
||||
if (ctErrors==0) {
|
||||
// update the files that have changed
|
||||
ReplaceFile(strImplementationOld, strImplementation);
|
||||
ReplaceIfChanged(strDeclarationOld, strDeclaration);
|
||||
ReplaceIfChanged(strTablesOld, strTables);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
// if there were errors
|
||||
} else {
|
||||
// delete all files (the old declaration file is left intact!)
|
||||
remove(strImplementation);
|
||||
remove(strDeclaration );
|
||||
remove(strTables );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
64
Sources/Ecc/Main.h
Normal file
64
Sources/Ecc/Main.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
|
||||
/* rcg10042001 */
|
||||
#ifdef PLATFORM_WIN32
|
||||
#define alloca _alloca
|
||||
#endif
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN 256
|
||||
#endif
|
||||
|
||||
extern int yylex(void);
|
||||
extern void yyerror(char *s);
|
||||
extern int yyparse(void);
|
||||
|
||||
extern FILE *_fInput;
|
||||
extern int _iLinesCt;
|
||||
extern int _bTrackLineInformation; // this is set if #line should be inserted in tokens
|
||||
extern char *_strInputFileName;
|
||||
|
||||
extern FILE *_fImplementation;
|
||||
extern FILE *_fDeclaration;
|
||||
extern FILE *_fTables;
|
||||
extern FILE *_fExports;
|
||||
extern char *_strFileNameBase;
|
||||
extern char *_strFileNameBaseIdentifier;
|
||||
|
||||
struct SType {
|
||||
char *strString;
|
||||
int bCrossesStates;
|
||||
int iLine;
|
||||
|
||||
SType(void) {
|
||||
strString = strdup("");
|
||||
bCrossesStates = 0;
|
||||
iLine = -1;
|
||||
};
|
||||
SType(const char *str) {
|
||||
strString = strdup(str);
|
||||
bCrossesStates = 0;
|
||||
iLine = -1;
|
||||
};
|
||||
SType(const SType &other) {
|
||||
strString = strdup(other.strString);
|
||||
bCrossesStates = other.bCrossesStates;
|
||||
iLine = other.iLine;
|
||||
};
|
||||
const SType &operator=(const SType &other) {
|
||||
strString = strdup(other.strString);
|
||||
bCrossesStates = other.bCrossesStates;
|
||||
iLine = other.iLine;
|
||||
return *this;
|
||||
};
|
||||
const SType &operator=(char *str) {
|
||||
strString = strdup(str);
|
||||
bCrossesStates = 0;
|
||||
iLine = -1;
|
||||
return *this;
|
||||
};
|
||||
SType operator+(const SType &other);
|
||||
};
|
||||
|
||||
#define YYSTYPE SType
|
3508
Sources/Ecc/Parser.cpp
Normal file
3508
Sources/Ecc/Parser.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1427
Sources/Ecc/Parser.y
Normal file
1427
Sources/Ecc/Parser.y
Normal file
File diff suppressed because it is too large
Load Diff
2211
Sources/Ecc/Scanner.cpp
Normal file
2211
Sources/Ecc/Scanner.cpp
Normal file
File diff suppressed because it is too large
Load Diff
172
Sources/Ecc/Scanner.l
Normal file
172
Sources/Ecc/Scanner.l
Normal file
|
@ -0,0 +1,172 @@
|
|||
%{
|
||||
// rcg10042001 Changed to specify Ecc directory...
|
||||
#include "Ecc/StdH.h"
|
||||
#include "Ecc/Main.h"
|
||||
#include "Ecc/Parser.h"
|
||||
|
||||
#define YY_NEVER_INTERACTIVE 1
|
||||
|
||||
|
||||
int iLastLine = -1;
|
||||
|
||||
#define RETURN(symbolname) \
|
||||
if (iLastLine==_iLinesCt || !_bTrackLineInformation){\
|
||||
yylval = yytext; \
|
||||
} else { \
|
||||
char strLine[200]; \
|
||||
sprintf(strLine, "\n#line %d \"%s\"\n", _iLinesCt, _strInputFileName);\
|
||||
yylval = SType(strLine)+yytext; \
|
||||
iLastLine=_iLinesCt; \
|
||||
} \
|
||||
return symbolname;
|
||||
|
||||
char *_strCppBlock;
|
||||
|
||||
%}
|
||||
|
||||
%x COMMENT
|
||||
%x CPPBLOCK
|
||||
|
||||
DIGIT [0-9]
|
||||
HEXDIGIT [0-9A-Fa-f]
|
||||
IDENTIFIERFIRST [A-Za-z_]
|
||||
IDENTIFIEROTHER [A-Za-z0-9_]
|
||||
DOUBLEQUOTE \"
|
||||
NONEXP_FLT ({DIGIT}+"."{DIGIT}*)
|
||||
EXP_FLT (({DIGIT}+("."({DIGIT}*)?)?)("E"|"e")("+"|"-")?{DIGIT}+)
|
||||
|
||||
%%
|
||||
|
||||
/* standard cpp-keywords */
|
||||
"while" {RETURN(k_while);}
|
||||
"switch" {RETURN(k_switch);}
|
||||
"case" {RETURN(k_case);}
|
||||
"for" {RETURN(k_for);}
|
||||
"if" {RETURN(k_if);}
|
||||
"else" {RETURN(k_else);}
|
||||
"enum" {RETURN(k_enum);}
|
||||
"class" {RETURN(k_class);}
|
||||
"do" {RETURN(k_do);}
|
||||
"void" {RETURN(k_void);}
|
||||
"const" {RETURN(k_const);}
|
||||
"inline" {RETURN(k_inline);}
|
||||
"static" {RETURN(k_static);}
|
||||
"virtual" {RETURN(k_virtual);}
|
||||
"return" {RETURN(k_return);}
|
||||
"autowait" {RETURN(k_autowait);}
|
||||
"autocall" {RETURN(k_autocall);}
|
||||
"waitevent" {RETURN(k_waitevent);}
|
||||
|
||||
/* aditional keywords */
|
||||
"event" {RETURN(k_event);}
|
||||
"name" {RETURN(k_name);}
|
||||
"thumbnail" {RETURN(k_thumbnail);}
|
||||
"features" {RETURN(k_features);}
|
||||
"uses" {RETURN(k_uses);}
|
||||
"export" {RETURN(k_export);}
|
||||
|
||||
"texture" {RETURN(k_texture);}
|
||||
"sound" {RETURN(k_sound);}
|
||||
"model" {RETURN(k_model);}
|
||||
|
||||
"properties" {RETURN(k_properties);}
|
||||
"components" {RETURN(k_components);}
|
||||
"functions" {RETURN(k_functions);}
|
||||
"procedures" {RETURN(k_procedures);}
|
||||
|
||||
"wait" {RETURN(k_wait );}
|
||||
"on" {RETURN(k_on );}
|
||||
"otherwise" {RETURN(k_otherwise);}
|
||||
|
||||
"call" {RETURN(k_call );}
|
||||
"jump" {RETURN(k_jump );}
|
||||
"stop" {RETURN(k_stop );}
|
||||
"resume" {RETURN(k_resume );}
|
||||
"pass" {RETURN(k_pass );}
|
||||
|
||||
/* special data types */
|
||||
"CTString" {RETURN(k_CTString);}
|
||||
"CTStringTrans" {RETURN(k_CTStringTrans);}
|
||||
"CTFileName" {RETURN(k_CTFileName);}
|
||||
"CTFileNameNoDep" {RETURN(k_CTFileNameNoDep);}
|
||||
"BOOL" {RETURN(k_BOOL);}
|
||||
"COLOR" {RETURN(k_COLOR);}
|
||||
"FLOAT" {RETURN(k_FLOAT);}
|
||||
"INDEX" {RETURN(k_INDEX);}
|
||||
"RANGE" {RETURN(k_RANGE);}
|
||||
"CEntityPointer" {RETURN(k_CEntityPointer);}
|
||||
"CModelObject" {RETURN(k_CModelObject);}
|
||||
"CModelInstance" {RETURN(k_CModelInstance);}
|
||||
"CAnimObject" {RETURN(k_CAnimObject);}
|
||||
"CSoundObject" {RETURN(k_CSoundObject);}
|
||||
"CPlacement3D" {RETURN(k_CPlacement3D);}
|
||||
"FLOATaabbox3D" {RETURN(k_FLOATaabbox3D);}
|
||||
"FLOATmatrix3D" {RETURN(k_FLOATmatrix3D);}
|
||||
"FLOATquat3D" {RETURN(k_FLOATquat3D);}
|
||||
"ANGLE" {RETURN(k_ANGLE);};
|
||||
"ANIMATION" {RETURN(k_ANIMATION);};
|
||||
"ILLUMINATIONTYPE" {RETURN(k_ILLUMINATIONTYPE);};
|
||||
"FLOAT3D" {RETURN(k_FLOAT3D);};
|
||||
"ANGLE3D" {RETURN(k_ANGLE3D);};
|
||||
"FLOATplane3D" {RETURN(k_FLOATplane3D);};
|
||||
"flags" {RETURN(k_FLAGS);};
|
||||
|
||||
/* single character operators and punctuations */
|
||||
";"|"("|")"|"{"|"}"|"="|"+"|"-"|"<"|">"|"!"|"|"|"&"|"*"|"/"|"%"|"^"|"["|"]"|":"|","|"."|"?"|"~" {
|
||||
RETURN(yytext[0]);}
|
||||
|
||||
/* constants */
|
||||
{DIGIT}+ { RETURN(c_int); }
|
||||
"0x"{HEXDIGIT}+ { RETURN(c_int)};
|
||||
{NONEXP_FLT}("f"|"F")? { RETURN(c_int); }
|
||||
{EXP_FLT}("f"|"F")? { RETURN(c_int); }
|
||||
(\"[^\n"]+\")|(\"\") { RETURN(c_string); }
|
||||
(\'[^\n']+\')|(\'\') { RETURN(c_char); }
|
||||
|
||||
/* identifier */
|
||||
{IDENTIFIERFIRST}{IDENTIFIEROTHER}* {RETURN(identifier);}
|
||||
|
||||
/* specially bracketed cpp blocks */
|
||||
"%{" {
|
||||
char strLine[80];
|
||||
sprintf(strLine, "#line %d \"%s\"\n", _iLinesCt, _strInputFileName );
|
||||
_strCppBlock = strdup(strLine);
|
||||
BEGIN(CPPBLOCK);
|
||||
}
|
||||
<CPPBLOCK>"%}" {
|
||||
BEGIN(INITIAL);
|
||||
yylval = SType(_strCppBlock);
|
||||
return cppblock;
|
||||
}
|
||||
<CPPBLOCK>\n {
|
||||
_iLinesCt++;
|
||||
_strCppBlock = (SType(_strCppBlock)+yytext).strString;
|
||||
}
|
||||
<CPPBLOCK>.* {
|
||||
_strCppBlock = (SType(_strCppBlock)+yytext).strString;
|
||||
}
|
||||
|
||||
/* eat up comments */
|
||||
"/*" { BEGIN(COMMENT); }
|
||||
<COMMENT>"*/" { BEGIN(INITIAL); }
|
||||
<COMMENT>. {}
|
||||
"//"[^\n]*\n { _iLinesCt++; }
|
||||
|
||||
/* eat up whitespace */
|
||||
[ \t]+ {
|
||||
}
|
||||
/* eat up linefeeds and count lines in all conditions */
|
||||
<*>\n {
|
||||
_iLinesCt++;
|
||||
}
|
||||
/* for all unrecognized characters */
|
||||
. {
|
||||
// report an error
|
||||
char strError[80];
|
||||
sprintf(strError, "Unrecognized character '%c' (ASCII 0x%02x)\n",
|
||||
yytext[0], yytext[0] );
|
||||
yyerror(strError);
|
||||
}
|
||||
|
||||
%%
|
||||
|
17
Sources/Ecc/StdH.h
Normal file
17
Sources/Ecc/StdH.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef PLATFORM_UNIX
|
||||
#include <errno.h>
|
||||
#include <sys/param.h>
|
||||
#include <unistd.h>
|
||||
#define _fullpath(x, y, z) realpath(y, x)
|
||||
#endif
|
||||
|
686
Sources/Ecc/bison.simple
Normal file
686
Sources/Ecc/bison.simple
Normal file
|
@ -0,0 +1,686 @@
|
|||
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
|
||||
#line 3 "bison.simple"
|
||||
|
||||
/* Skeleton output parser for bison,
|
||||
Copyright (C) 1984, 1989, 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* As a special exception, when this file is copied by Bison into a
|
||||
Bison output file, you may use that output file without restriction.
|
||||
This special exception was added by the Free Software Foundation
|
||||
in version 1.24 of Bison. */
|
||||
|
||||
#ifndef alloca
|
||||
#ifdef __GNUC__
|
||||
#define alloca __builtin_alloca
|
||||
#else /* not GNU C. */
|
||||
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
|
||||
#include <alloca.h>
|
||||
#else /* not sparc */
|
||||
#if defined (MSDOS) && !defined (__TURBOC__)
|
||||
#include <malloc.h>
|
||||
#else /* not MSDOS, or __TURBOC__ */
|
||||
#if defined(_AIX)
|
||||
#include <malloc.h>
|
||||
#pragma alloca
|
||||
#else /* not MSDOS, __TURBOC__, or _AIX */
|
||||
#ifdef __hpux
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
void *alloca (unsigned int);
|
||||
};
|
||||
#else /* not __cplusplus */
|
||||
void *alloca ();
|
||||
#endif /* not __cplusplus */
|
||||
#endif /* __hpux */
|
||||
#endif /* not _AIX */
|
||||
#endif /* not MSDOS, or __TURBOC__ */
|
||||
#endif /* not sparc. */
|
||||
#endif /* not GNU C. */
|
||||
#endif /* alloca not defined. */
|
||||
|
||||
/* This is the parser code that is written into each bison parser
|
||||
when the %semantic_parser declaration is not specified in the grammar.
|
||||
It was written by Richard Stallman by simplifying the hairy parser
|
||||
used when %semantic_parser is specified. */
|
||||
|
||||
/* Note: there must be only one dollar sign in this file.
|
||||
It is replaced by the list of actions, each action
|
||||
as one case of the switch. */
|
||||
|
||||
#define yyerrok (yyerrstatus = 0)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define YYEMPTY -2
|
||||
#define YYEOF 0
|
||||
#define YYACCEPT return(0)
|
||||
#define YYABORT return(1)
|
||||
#define YYERROR goto yyerrlab1
|
||||
/* Like YYERROR except do call yyerror.
|
||||
This remains here temporarily to ease the
|
||||
transition to the new meaning of YYERROR, for GCC.
|
||||
Once GCC version 2 has supplanted version 1, this can go. */
|
||||
#define YYFAIL goto yyerrlab
|
||||
#define YYRECOVERING() (!!yyerrstatus)
|
||||
#define YYBACKUP(token, value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY && yylen == 1) \
|
||||
{ yychar = (token), yylval = (value); \
|
||||
yychar1 = YYTRANSLATE (yychar); \
|
||||
YYPOPSTACK; \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ yyerror ("syntax error: cannot back up"); YYERROR; } \
|
||||
while (0)
|
||||
|
||||
#define YYTERROR 1
|
||||
#define YYERRCODE 256
|
||||
|
||||
#ifndef YYPURE
|
||||
#define YYLEX yylex()
|
||||
#endif
|
||||
|
||||
#ifdef YYPURE
|
||||
#ifdef YYLSP_NEEDED
|
||||
#ifdef YYLEX_PARAM
|
||||
#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
|
||||
#else
|
||||
#define YYLEX yylex(&yylval, &yylloc)
|
||||
#endif
|
||||
#else /* not YYLSP_NEEDED */
|
||||
#ifdef YYLEX_PARAM
|
||||
#define YYLEX yylex(&yylval, YYLEX_PARAM)
|
||||
#else
|
||||
#define YYLEX yylex(&yylval)
|
||||
#endif
|
||||
#endif /* not YYLSP_NEEDED */
|
||||
#endif
|
||||
|
||||
/* If nonreentrant, generate the variables here */
|
||||
|
||||
#ifndef YYPURE
|
||||
|
||||
int yychar; /* the lookahead symbol */
|
||||
YYSTYPE yylval; /* the semantic value of the */
|
||||
/* lookahead symbol */
|
||||
|
||||
#ifdef YYLSP_NEEDED
|
||||
YYLTYPE yylloc; /* location data for the lookahead */
|
||||
/* symbol */
|
||||
#endif
|
||||
|
||||
int yynerrs; /* number of parse errors so far */
|
||||
#endif /* not YYPURE */
|
||||
|
||||
#if YYDEBUG != 0
|
||||
int yydebug; /* nonzero means print parse trace */
|
||||
/* Since this is uninitialized, it does not stop multiple parsers
|
||||
from coexisting. */
|
||||
#endif
|
||||
|
||||
/* YYINITDEPTH indicates the initial size of the parser's stacks */
|
||||
|
||||
#ifndef YYINITDEPTH
|
||||
#define YYINITDEPTH 200
|
||||
#endif
|
||||
|
||||
/* YYMAXDEPTH is the maximum size the stacks can grow to
|
||||
(effective only if the built-in stack extension method is used). */
|
||||
|
||||
#if YYMAXDEPTH == 0
|
||||
#undef YYMAXDEPTH
|
||||
#endif
|
||||
|
||||
#ifndef YYMAXDEPTH
|
||||
#define YYMAXDEPTH 10000
|
||||
#endif
|
||||
|
||||
/* Prevent warning if -Wstrict-prototypes. */
|
||||
#ifdef __GNUC__
|
||||
int yyparse (void);
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
|
||||
#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
|
||||
#else /* not GNU C or C++ */
|
||||
#ifndef __cplusplus
|
||||
|
||||
/* This is the most reliable way to avoid incompatibilities
|
||||
in available built-in functions on various systems. */
|
||||
static void
|
||||
__yy_memcpy (from, to, count)
|
||||
char *from;
|
||||
char *to;
|
||||
int count;
|
||||
{
|
||||
register char *f = from;
|
||||
register char *t = to;
|
||||
register int i = count;
|
||||
|
||||
while (i-- > 0)
|
||||
*t++ = *f++;
|
||||
}
|
||||
|
||||
#else /* __cplusplus */
|
||||
|
||||
/* This is the most reliable way to avoid incompatibilities
|
||||
in available built-in functions on various systems. */
|
||||
static void
|
||||
__yy_memcpy (char *from, char *to, int count)
|
||||
{
|
||||
register char *f = from;
|
||||
register char *t = to;
|
||||
register int i = count;
|
||||
|
||||
while (i-- > 0)
|
||||
*t++ = *f++;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#line 192 "bison.simple"
|
||||
|
||||
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
|
||||
into yyparse. The argument should have type void *.
|
||||
It should actually point to an object.
|
||||
Grammar actions can access the variable by casting it
|
||||
to the proper pointer type. */
|
||||
|
||||
#ifdef YYPARSE_PARAM
|
||||
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
|
||||
#else
|
||||
#define YYPARSE_PARAM
|
||||
#define YYPARSE_PARAM_DECL
|
||||
#endif
|
||||
|
||||
int
|
||||
yyparse(YYPARSE_PARAM)
|
||||
YYPARSE_PARAM_DECL
|
||||
{
|
||||
register int yystate;
|
||||
register int yyn;
|
||||
register short *yyssp;
|
||||
register YYSTYPE *yyvsp;
|
||||
int yyerrstatus; /* number of tokens to shift before error messages enabled */
|
||||
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
|
||||
|
||||
short yyssa[YYINITDEPTH]; /* the state stack */
|
||||
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
|
||||
|
||||
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
|
||||
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
|
||||
|
||||
#ifdef YYLSP_NEEDED
|
||||
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
|
||||
YYLTYPE *yyls = yylsa;
|
||||
YYLTYPE *yylsp;
|
||||
|
||||
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
|
||||
#else
|
||||
#define YYPOPSTACK (yyvsp--, yyssp--)
|
||||
#endif
|
||||
|
||||
int yystacksize = YYINITDEPTH;
|
||||
|
||||
#ifdef YYPURE
|
||||
int yychar;
|
||||
YYSTYPE yylval;
|
||||
int yynerrs;
|
||||
#ifdef YYLSP_NEEDED
|
||||
YYLTYPE yylloc;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
YYSTYPE yyval; /* the variable used to return */
|
||||
/* semantic values from the action */
|
||||
/* routines */
|
||||
|
||||
int yylen;
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
fprintf(stderr, "Starting parse\n");
|
||||
#endif
|
||||
|
||||
yystate = 0;
|
||||
yyerrstatus = 0;
|
||||
yynerrs = 0;
|
||||
yychar = YYEMPTY; /* Cause a token to be read. */
|
||||
|
||||
/* Initialize stack pointers.
|
||||
Waste one element of value and location stack
|
||||
so that they stay on the same level as the state stack.
|
||||
The wasted elements are never initialized. */
|
||||
|
||||
yyssp = yyss - 1;
|
||||
yyvsp = yyvs;
|
||||
#ifdef YYLSP_NEEDED
|
||||
yylsp = yyls;
|
||||
#endif
|
||||
|
||||
/* Push a new state, which is found in yystate . */
|
||||
/* In all cases, when you get here, the value and location stacks
|
||||
have just been pushed. so pushing a state here evens the stacks. */
|
||||
yynewstate:
|
||||
|
||||
*++yyssp = yystate;
|
||||
|
||||
if (yyssp >= yyss + yystacksize - 1)
|
||||
{
|
||||
/* Give user a chance to reallocate the stack */
|
||||
/* Use copies of these so that the &'s don't force the real ones into memory. */
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
short *yyss1 = yyss;
|
||||
#ifdef YYLSP_NEEDED
|
||||
YYLTYPE *yyls1 = yyls;
|
||||
#endif
|
||||
|
||||
/* Get the current used size of the three stacks, in elements. */
|
||||
int size = yyssp - yyss + 1;
|
||||
|
||||
#ifdef yyoverflow
|
||||
/* Each stack pointer address is followed by the size of
|
||||
the data in use in that stack, in bytes. */
|
||||
#ifdef YYLSP_NEEDED
|
||||
/* This used to be a conditional around just the two extra args,
|
||||
but that might be undefined if yyoverflow is a macro. */
|
||||
yyoverflow("parser stack overflow",
|
||||
&yyss1, size * sizeof (*yyssp),
|
||||
&yyvs1, size * sizeof (*yyvsp),
|
||||
&yyls1, size * sizeof (*yylsp),
|
||||
&yystacksize);
|
||||
#else
|
||||
yyoverflow("parser stack overflow",
|
||||
&yyss1, size * sizeof (*yyssp),
|
||||
&yyvs1, size * sizeof (*yyvsp),
|
||||
&yystacksize);
|
||||
#endif
|
||||
|
||||
yyss = yyss1; yyvs = yyvs1;
|
||||
#ifdef YYLSP_NEEDED
|
||||
yyls = yyls1;
|
||||
#endif
|
||||
#else /* no yyoverflow */
|
||||
/* Extend the stack our own way. */
|
||||
if (yystacksize >= YYMAXDEPTH)
|
||||
{
|
||||
yyerror("parser stack overflow");
|
||||
return 2;
|
||||
}
|
||||
yystacksize *= 2;
|
||||
if (yystacksize > YYMAXDEPTH)
|
||||
yystacksize = YYMAXDEPTH;
|
||||
yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
|
||||
__yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
|
||||
yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
|
||||
__yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
|
||||
#ifdef YYLSP_NEEDED
|
||||
yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
|
||||
__yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
|
||||
#endif
|
||||
#endif /* no yyoverflow */
|
||||
|
||||
yyssp = yyss + size - 1;
|
||||
yyvsp = yyvs + size - 1;
|
||||
#ifdef YYLSP_NEEDED
|
||||
yylsp = yyls + size - 1;
|
||||
#endif
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
|
||||
#endif
|
||||
|
||||
if (yyssp >= yyss + yystacksize - 1)
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
fprintf(stderr, "Entering state %d\n", yystate);
|
||||
#endif
|
||||
|
||||
goto yybackup;
|
||||
yybackup:
|
||||
|
||||
/* Do appropriate processing given the current state. */
|
||||
/* Read a lookahead token if we need one and don't already have one. */
|
||||
/* yyresume: */
|
||||
|
||||
/* First try to decide what to do without reference to lookahead token. */
|
||||
|
||||
yyn = yypact[yystate];
|
||||
if (yyn == YYFLAG)
|
||||
goto yydefault;
|
||||
|
||||
/* Not known => get a lookahead token if don't already have one. */
|
||||
|
||||
/* yychar is either YYEMPTY or YYEOF
|
||||
or a valid token in external form. */
|
||||
|
||||
if (yychar == YYEMPTY)
|
||||
{
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
fprintf(stderr, "Reading a token: ");
|
||||
#endif
|
||||
yychar = YYLEX;
|
||||
}
|
||||
|
||||
/* Convert token to internal form (in yychar1) for indexing tables with */
|
||||
|
||||
if (yychar <= 0) /* This means end of input. */
|
||||
{
|
||||
yychar1 = 0;
|
||||
yychar = YYEOF; /* Don't call YYLEX any more */
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
fprintf(stderr, "Now at end of input.\n");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
yychar1 = YYTRANSLATE(yychar);
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
{
|
||||
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
|
||||
/* Give the individual parser a way to print the precise meaning
|
||||
of a token, for further debugging info. */
|
||||
#ifdef YYPRINT
|
||||
YYPRINT (stderr, yychar, yylval);
|
||||
#endif
|
||||
fprintf (stderr, ")\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
yyn += yychar1;
|
||||
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
|
||||
goto yydefault;
|
||||
|
||||
yyn = yytable[yyn];
|
||||
|
||||
/* yyn is what to do for this token type in this state.
|
||||
Negative => reduce, -yyn is rule number.
|
||||
Positive => shift, yyn is new state.
|
||||
New state is final state => don't bother to shift,
|
||||
just return success.
|
||||
0, or most negative number => error. */
|
||||
|
||||
if (yyn < 0)
|
||||
{
|
||||
if (yyn == YYFLAG)
|
||||
goto yyerrlab;
|
||||
yyn = -yyn;
|
||||
goto yyreduce;
|
||||
}
|
||||
else if (yyn == 0)
|
||||
goto yyerrlab;
|
||||
|
||||
if (yyn == YYFINAL)
|
||||
YYACCEPT;
|
||||
|
||||
/* Shift the lookahead token. */
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
|
||||
#endif
|
||||
|
||||
/* Discard the token being shifted unless it is eof. */
|
||||
if (yychar != YYEOF)
|
||||
yychar = YYEMPTY;
|
||||
|
||||
*++yyvsp = yylval;
|
||||
#ifdef YYLSP_NEEDED
|
||||
*++yylsp = yylloc;
|
||||
#endif
|
||||
|
||||
/* count tokens shifted since error; after three, turn off error status. */
|
||||
if (yyerrstatus) yyerrstatus--;
|
||||
|
||||
yystate = yyn;
|
||||
goto yynewstate;
|
||||
|
||||
/* Do the default action for the current state. */
|
||||
yydefault:
|
||||
|
||||
yyn = yydefact[yystate];
|
||||
if (yyn == 0)
|
||||
goto yyerrlab;
|
||||
|
||||
/* Do a reduction. yyn is the number of a rule to reduce with. */
|
||||
yyreduce:
|
||||
yylen = yyr2[yyn];
|
||||
if (yylen > 0)
|
||||
yyval = yyvsp[1-yylen]; /* implement default value of the action */
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
{
|
||||
int i;
|
||||
|
||||
fprintf (stderr, "Reducing via rule %d (line %d), ",
|
||||
yyn, yyrline[yyn]);
|
||||
|
||||
/* Print the symbols being reduced, and their result. */
|
||||
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
|
||||
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
|
||||
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
|
||||
}
|
||||
#endif
|
||||
|
||||
$ /* the action file gets copied in in place of this dollarsign */
|
||||
#line 487 "bison.simple"
|
||||
|
||||
yyvsp -= yylen;
|
||||
yyssp -= yylen;
|
||||
#ifdef YYLSP_NEEDED
|
||||
yylsp -= yylen;
|
||||
#endif
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
{
|
||||
short *ssp1 = yyss - 1;
|
||||
fprintf (stderr, "state stack now");
|
||||
while (ssp1 != yyssp)
|
||||
fprintf (stderr, " %d", *++ssp1);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
*++yyvsp = yyval;
|
||||
|
||||
#ifdef YYLSP_NEEDED
|
||||
yylsp++;
|
||||
if (yylen == 0)
|
||||
{
|
||||
yylsp->first_line = yylloc.first_line;
|
||||
yylsp->first_column = yylloc.first_column;
|
||||
yylsp->last_line = (yylsp-1)->last_line;
|
||||
yylsp->last_column = (yylsp-1)->last_column;
|
||||
yylsp->text = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
yylsp->last_line = (yylsp+yylen-1)->last_line;
|
||||
yylsp->last_column = (yylsp+yylen-1)->last_column;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Now "shift" the result of the reduction.
|
||||
Determine what state that goes to,
|
||||
based on the state we popped back to
|
||||
and the rule number reduced by. */
|
||||
|
||||
yyn = yyr1[yyn];
|
||||
|
||||
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
|
||||
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
|
||||
yystate = yytable[yystate];
|
||||
else
|
||||
yystate = yydefgoto[yyn - YYNTBASE];
|
||||
|
||||
goto yynewstate;
|
||||
|
||||
yyerrlab: /* here on detecting error */
|
||||
|
||||
if (! yyerrstatus)
|
||||
/* If not already recovering from an error, report this error. */
|
||||
{
|
||||
++yynerrs;
|
||||
|
||||
#ifdef YYERROR_VERBOSE
|
||||
yyn = yypact[yystate];
|
||||
|
||||
if (yyn > YYFLAG && yyn < YYLAST)
|
||||
{
|
||||
int size = 0;
|
||||
char *msg;
|
||||
int x, count;
|
||||
|
||||
count = 0;
|
||||
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
|
||||
for (x = (yyn < 0 ? -yyn : 0);
|
||||
x < (sizeof(yytname) / sizeof(char *)); x++)
|
||||
if (yycheck[x + yyn] == x)
|
||||
size += strlen(yytname[x]) + 15, count++;
|
||||
msg = (char *) malloc(size + 15);
|
||||
if (msg != 0)
|
||||
{
|
||||
strcpy(msg, "parse error");
|
||||
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (x = (yyn < 0 ? -yyn : 0);
|
||||
x < (sizeof(yytname) / sizeof(char *)); x++)
|
||||
if (yycheck[x + yyn] == x)
|
||||
{
|
||||
strcat(msg, count == 0 ? ", expecting `" : " or `");
|
||||
strcat(msg, yytname[x]);
|
||||
strcat(msg, "'");
|
||||
count++;
|
||||
}
|
||||
}
|
||||
yyerror(msg);
|
||||
free(msg);
|
||||
}
|
||||
else
|
||||
yyerror ("parse error; also virtual memory exceeded");
|
||||
}
|
||||
else
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
yyerror("parse error");
|
||||
}
|
||||
|
||||
goto yyerrlab1;
|
||||
yyerrlab1: /* here on error raised explicitly by an action */
|
||||
|
||||
if (yyerrstatus == 3)
|
||||
{
|
||||
/* if just tried and failed to reuse lookahead token after an error, discard it. */
|
||||
|
||||
/* return failure if at end of input */
|
||||
if (yychar == YYEOF)
|
||||
YYABORT;
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
|
||||
#endif
|
||||
|
||||
yychar = YYEMPTY;
|
||||
}
|
||||
|
||||
/* Else will try to reuse lookahead token
|
||||
after shifting the error token. */
|
||||
|
||||
yyerrstatus = 3; /* Each real token shifted decrements this */
|
||||
|
||||
goto yyerrhandle;
|
||||
|
||||
yyerrdefault: /* current state does not do anything special for the error token. */
|
||||
|
||||
#if 0
|
||||
/* This is wrong; only states that explicitly want error tokens
|
||||
should shift them. */
|
||||
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
|
||||
if (yyn) goto yydefault;
|
||||
#endif
|
||||
|
||||
yyerrpop: /* pop the current state because it cannot handle the error token */
|
||||
|
||||
if (yyssp == yyss) YYABORT;
|
||||
yyvsp--;
|
||||
yystate = *--yyssp;
|
||||
#ifdef YYLSP_NEEDED
|
||||
yylsp--;
|
||||
#endif
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
{
|
||||
short *ssp1 = yyss - 1;
|
||||
fprintf (stderr, "Error: state stack now");
|
||||
while (ssp1 != yyssp)
|
||||
fprintf (stderr, " %d", *++ssp1);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
yyerrhandle:
|
||||
|
||||
yyn = yypact[yystate];
|
||||
if (yyn == YYFLAG)
|
||||
goto yyerrdefault;
|
||||
|
||||
yyn += YYTERROR;
|
||||
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
|
||||
goto yyerrdefault;
|
||||
|
||||
yyn = yytable[yyn];
|
||||
if (yyn < 0)
|
||||
{
|
||||
if (yyn == YYFLAG)
|
||||
goto yyerrpop;
|
||||
yyn = -yyn;
|
||||
goto yyreduce;
|
||||
}
|
||||
else if (yyn == 0)
|
||||
goto yyerrpop;
|
||||
|
||||
if (yyn == YYFINAL)
|
||||
YYACCEPT;
|
||||
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
fprintf(stderr, "Shifting error token, ");
|
||||
#endif
|
||||
|
||||
*++yyvsp = yylval;
|
||||
#ifdef YYLSP_NEEDED
|
||||
*++yylsp = yylloc;
|
||||
#endif
|
||||
|
||||
yystate = yyn;
|
||||
goto yynewstate;
|
||||
}
|
77
Sources/Ecc/parser.h
Normal file
77
Sources/Ecc/parser.h
Normal file
|
@ -0,0 +1,77 @@
|
|||
#ifndef YYSTYPE
|
||||
#define YYSTYPE int
|
||||
#endif
|
||||
#define c_char 258
|
||||
#define c_int 259
|
||||
#define c_float 260
|
||||
#define c_bool 261
|
||||
#define c_string 262
|
||||
#define identifier 263
|
||||
#define cppblock 264
|
||||
#define k_while 265
|
||||
#define k_for 266
|
||||
#define k_if 267
|
||||
#define k_else 268
|
||||
#define k_enum 269
|
||||
#define k_switch 270
|
||||
#define k_case 271
|
||||
#define k_class 272
|
||||
#define k_do 273
|
||||
#define k_void 274
|
||||
#define k_const 275
|
||||
#define k_inline 276
|
||||
#define k_static 277
|
||||
#define k_virtual 278
|
||||
#define k_return 279
|
||||
#define k_autowait 280
|
||||
#define k_autocall 281
|
||||
#define k_waitevent 282
|
||||
#define k_event 283
|
||||
#define k_name 284
|
||||
#define k_thumbnail 285
|
||||
#define k_features 286
|
||||
#define k_uses 287
|
||||
#define k_export 288
|
||||
#define k_texture 289
|
||||
#define k_sound 290
|
||||
#define k_model 291
|
||||
#define k_properties 292
|
||||
#define k_components 293
|
||||
#define k_functions 294
|
||||
#define k_procedures 295
|
||||
#define k_wait 296
|
||||
#define k_on 297
|
||||
#define k_otherwise 298
|
||||
#define k_call 299
|
||||
#define k_jump 300
|
||||
#define k_stop 301
|
||||
#define k_resume 302
|
||||
#define k_pass 303
|
||||
#define k_CTString 304
|
||||
#define k_CTStringTrans 305
|
||||
#define k_CTFileName 306
|
||||
#define k_CTFileNameNoDep 307
|
||||
#define k_BOOL 308
|
||||
#define k_COLOR 309
|
||||
#define k_FLOAT 310
|
||||
#define k_INDEX 311
|
||||
#define k_RANGE 312
|
||||
#define k_CEntityPointer 313
|
||||
#define k_CModelObject 314
|
||||
#define k_CModelInstance 315
|
||||
#define k_CAnimObject 316
|
||||
#define k_CSoundObject 317
|
||||
#define k_CPlacement3D 318
|
||||
#define k_FLOATaabbox3D 319
|
||||
#define k_FLOATmatrix3D 320
|
||||
#define k_FLOATquat3D 321
|
||||
#define k_ANGLE 322
|
||||
#define k_FLOAT3D 323
|
||||
#define k_ANGLE3D 324
|
||||
#define k_FLOATplane3D 325
|
||||
#define k_ANIMATION 326
|
||||
#define k_ILLUMINATIONTYPE 327
|
||||
#define k_FLAGS 328
|
||||
|
||||
|
||||
extern YYSTYPE yylval;
|
3
Sources/Ecc/unistd.h
Normal file
3
Sources/Ecc/unistd.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include <io.h>
|
1104
Sources/Engine/Base/Anim.cpp
Normal file
1104
Sources/Engine/Base/Anim.cpp
Normal file
File diff suppressed because it is too large
Load Diff
211
Sources/Engine/Base/Anim.h
Normal file
211
Sources/Engine/Base/Anim.h
Normal file
|
@ -0,0 +1,211 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#ifndef SE_INCL_ANIM_H
|
||||
#define SE_INCL_ANIM_H
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <Engine/Base/Serial.h>
|
||||
|
||||
#include <Engine/Base/Lists.h>
|
||||
|
||||
#define NAME_SIZE 32
|
||||
typedef char NAME[NAME_SIZE];
|
||||
#define PATH_MAX 260
|
||||
typedef char FILE_NAME[PATH_MAX];
|
||||
|
||||
/*
|
||||
* An object used for obtaining animation's information
|
||||
*/
|
||||
class CAnimInfo {
|
||||
public:
|
||||
NAME ai_AnimName;
|
||||
TIME ai_SecsPerFrame; // speed of this animation
|
||||
INDEX ai_NumberOfFrames;
|
||||
};
|
||||
|
||||
/*
|
||||
* Node used for linking file names representing frames.
|
||||
* Nodes of this kind are returned result of LoadFromScript function.
|
||||
*/
|
||||
class ENGINE_API CFileNameNode {
|
||||
public:
|
||||
FILE_NAME cfnn_FileName;
|
||||
CListNode cfnn_Node;
|
||||
CFileNameNode(const char *NewFileName, CListHead *LH);
|
||||
};
|
||||
|
||||
/*
|
||||
* Animation data for a class of animateable objects
|
||||
*/
|
||||
class CAnimData : public CSerial {
|
||||
public:
|
||||
INDEX ad_NumberOfAnims;
|
||||
class COneAnim *ad_Anims; // array of animations
|
||||
|
||||
public:
|
||||
|
||||
// fill member variables with invalid data
|
||||
ENGINE_API CAnimData();
|
||||
// Free allocated data (ad_Anims array), check invalid data
|
||||
ENGINE_API ~CAnimData();
|
||||
// clears animation data object
|
||||
ENGINE_API void Clear();
|
||||
// check if this kind of objects is auto-freed
|
||||
virtual BOOL IsAutoFreed(void);
|
||||
// reference counting functions
|
||||
virtual void RemReference_internal(void);
|
||||
|
||||
// get amount of memory used by this object
|
||||
SLONG GetUsedMemory(void);
|
||||
|
||||
// reference counting functions
|
||||
void AddReference(void);
|
||||
void RemReference(void);
|
||||
|
||||
// creates given number of default animations (1 frame, given name and apeed)
|
||||
ENGINE_API void CreateAnimations( INDEX ctAnimations, CTString strName="None",
|
||||
INDEX iDefaultFrame=0,TIME tmSpeed=0.02f);
|
||||
// replaces frames array with given one
|
||||
ENGINE_API void SetFrames( INDEX iAnimation, INDEX ctFrames, INDEX *pNewFrames);
|
||||
// replaces requested animation's name with given one
|
||||
ENGINE_API void SetName( INDEX iAnimation, CTString strNewName);
|
||||
// replaces requested animation's speed with given one
|
||||
ENGINE_API void SetSpeed( INDEX iAnimation, TIME tmSpeed);
|
||||
// obtains frame index for given place in array representing given animation
|
||||
ENGINE_API INDEX GetFrame( INDEX iAnimation, INDEX iFramePlace);
|
||||
// sets frame index for given place in array representing given animation
|
||||
ENGINE_API void SetFrame( INDEX iAnimation, INDEX iFramePlace, INDEX iNewFrame);
|
||||
// fill animation data object vith valid data containing one animation, one frame
|
||||
ENGINE_API void DefaultAnimation();
|
||||
/* Get animation's info. */
|
||||
ENGINE_API void GetAnimInfo(INDEX iAnimNo, CAnimInfo &aiInfo) const;
|
||||
/* Add animation */
|
||||
ENGINE_API void AddAnimation(void);
|
||||
/* Delete animation */
|
||||
ENGINE_API void DeleteAnimation(INDEX iAnim);
|
||||
/* Get number of animations. */
|
||||
ENGINE_API INDEX GetAnimsCt(void) const;
|
||||
// load list of frames from script file
|
||||
ENGINE_API void LoadFromScript_t( CTStream *File, CListHead *FrameFileList); // throw char *
|
||||
// print #define <animation name> lines for all animations into given file
|
||||
void ExportAnimationNames_t( CTStream *ostrFile, CTString strAnimationPrefix); // throw char *
|
||||
void Read_t( CTStream *istrFile); // throw char *
|
||||
void Write_t( CTStream *ostrFile); // throw char *
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* An instance of animateable object
|
||||
*/
|
||||
#define AOF_PAUSED (1L<<0) // current animation is paused
|
||||
#define AOF_LOOPING (1L<<1) // anim object is playing a looping animation
|
||||
#define AOF_NORESTART (1L<<2) // don't restart anim (used for PlayAnim())
|
||||
#define AOF_SMOOTHCHANGE (1L<<3) // smoothly change between anims
|
||||
|
||||
class CAnimObject : public CChangeable {
|
||||
public:
|
||||
TIME ao_tmAnimStart; // time when current anim was started
|
||||
INDEX ao_iCurrentAnim; // index of active animation
|
||||
ULONG ao_ulFlags; // flags
|
||||
INDEX ao_iLastAnim; // index of last animation (for smooth transition)
|
||||
|
||||
/* Calculate frame that coresponds to given time. */
|
||||
INDEX FrameInTime(TIME time) const;
|
||||
|
||||
public:
|
||||
CAnimData *ao_AnimData;
|
||||
|
||||
public:
|
||||
|
||||
// some of usual smart pointer functions are implemented, because AnimObjects
|
||||
// behave as smart pointers to AnimData objects
|
||||
/* Default constructor. */
|
||||
ENGINE_API CAnimObject(void);
|
||||
/* Destructor. */
|
||||
ENGINE_API ~CAnimObject(void);
|
||||
// copy from another object of same class
|
||||
ENGINE_API void Copy(CAnimObject &aoOther);
|
||||
// synchronize with another animation object (set same anim and frames)
|
||||
ENGINE_API void Synchronize(CAnimObject &aoOther);
|
||||
|
||||
// copying of AnimObjects is not allowed
|
||||
inline CAnimObject(const CAnimObject &aoOther) {
|
||||
ASSERT(FALSE); };
|
||||
inline const CAnimObject &operator=(const CAnimObject &aoOther) {
|
||||
ASSERT(FALSE); return *this;};
|
||||
|
||||
// clip frame index to be inside valid range (wrap around for looping anims)
|
||||
INDEX ClipFrame(INDEX iFrame) const;
|
||||
/* Loop anims forward */
|
||||
ENGINE_API void NextAnim(void);
|
||||
/* Loop anims backward */
|
||||
ENGINE_API void PrevAnim(void);
|
||||
/* Loop frames forward */
|
||||
ENGINE_API void NextFrame(void);
|
||||
/* Loop frames backward */
|
||||
ENGINE_API void PrevFrame(void);
|
||||
/* Select frame in given time offset */
|
||||
ENGINE_API void SelectFrameInTime(TIME tmOffset);
|
||||
/* Select first frame */
|
||||
ENGINE_API void FirstFrame(void);
|
||||
/* Select last frame */
|
||||
ENGINE_API void LastFrame(void);
|
||||
/* Test if some updateable object is up to date with this anim object. */
|
||||
ENGINE_API BOOL IsUpToDate(const CUpdateable &ud) const;
|
||||
void Read_t( CTStream *istrFile); // throw char *
|
||||
void Write_t( CTStream *ostrFile); // throw char *
|
||||
|
||||
/* Get animation's info. */
|
||||
ENGINE_API void GetAnimInfo(INDEX iAnimNo, CAnimInfo &aiInfo) const;
|
||||
|
||||
/* Attach data to this object. */
|
||||
ENGINE_API void SetData(CAnimData *pAD);
|
||||
// obtain animation and set it for this object
|
||||
ENGINE_API void SetData_t(const CTFileName &fnmAnim); // throw char *
|
||||
|
||||
/* Get current anim data ptr. */
|
||||
__forceinline CAnimData *GetData() { return ao_AnimData; };
|
||||
|
||||
/* Get animation's length. */
|
||||
ENGINE_API FLOAT GetCurrentAnimLength(void) const;
|
||||
ENGINE_API FLOAT GetAnimLength(INDEX iAnim) const;
|
||||
/* Get number of animations in current anim data */
|
||||
ENGINE_API INDEX GetAnimsCt() const;
|
||||
/* If animation has finished */
|
||||
ENGINE_API BOOL IsAnimFinished(void) const;
|
||||
/* Get passed time from start of animation */
|
||||
ENGINE_API TIME GetPassedTime(void) const;
|
||||
|
||||
/* Start new animation -- obsolete. */
|
||||
ENGINE_API void StartAnim(INDEX iNew);
|
||||
/* Start playing an animation. */
|
||||
ENGINE_API void PlayAnim(INDEX iNew, ULONG ulFlags);
|
||||
/* Seamlessly continue playing another animation from same point. */
|
||||
ENGINE_API void SwitchToAnim(INDEX iNew);
|
||||
/* Set new animation but doesn't starts it. */
|
||||
ENGINE_API void SetAnim(INDEX iNew);
|
||||
/* Reset anim (restart) */
|
||||
ENGINE_API void ResetAnim();
|
||||
/* Pauses current animation. */
|
||||
ENGINE_API void PauseAnim();
|
||||
/* Continues paused animation. */
|
||||
ENGINE_API void ContinueAnim();
|
||||
/* Offsets the animation phase */
|
||||
ENGINE_API void OffsetPhase(TIME tm);
|
||||
/* Retrieves paused flag */
|
||||
ENGINE_API BOOL IsPaused(void);
|
||||
/* Gets the number of current animation */
|
||||
ENGINE_API INDEX GetAnim(void) const;
|
||||
/* Gets the number of current frame. */
|
||||
ENGINE_API INDEX GetFrame(void) const;
|
||||
/* Gets number of frames in current anim. */
|
||||
ENGINE_API INDEX GetFramesInCurrentAnim(void) const;
|
||||
/* Get information for linear interpolation beetween frames. */
|
||||
ENGINE_API void GetFrame( INDEX &iFrame0, INDEX &iFrame1, FLOAT &fRatio) const;
|
||||
};
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
108
Sources/Engine/Base/Assert.h
Normal file
108
Sources/Engine/Base/Assert.h
Normal file
|
@ -0,0 +1,108 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#ifndef SE_INCL_ASSERT_H
|
||||
#define SE_INCL_ASSERT_H
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER /* rcg10042001 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* original VC definition of _assert */
|
||||
_CRTIMP void __cdecl _assert(void *, void *, unsigned);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PLATFORM_UNIX /* rcg10042001 */
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#define _assert(x, y, z) assert(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef NDEBUG
|
||||
#ifndef ASSERT
|
||||
#define ASSERT(__ignore) ((void)0)
|
||||
#endif
|
||||
#define ASSERTMSG(__ignore1, __ignore2) ((void)0)
|
||||
#define ASSERTALWAYS(__ignore) ((void)0)
|
||||
#define BREAKPOINT ((void)0)
|
||||
#define SAFEBREAKPOINT ((void)0)
|
||||
#define IFDEBUG(__ignore) ((void)0)
|
||||
#define DEBUGSTRING(__ignore) ("")
|
||||
#else
|
||||
|
||||
/* From VisualC assert.h: Define _CRTIMP */
|
||||
#ifndef _CRTIMP
|
||||
#ifdef _NTSDK
|
||||
/* definition compatible with NT SDK */
|
||||
#define _CRTIMP
|
||||
#else /* ndef _NTSDK */
|
||||
/* current definition */
|
||||
#ifdef _DLL
|
||||
#define _CRTIMP __declspec(dllimport)
|
||||
#else /* ndef _DLL */
|
||||
#define _CRTIMP
|
||||
#endif /* _DLL */
|
||||
#endif /* _NTSDK */
|
||||
#endif /* _CRTIMP */
|
||||
/* End: Define _CRTIMP */
|
||||
|
||||
// this breakpoint doesn't cause exceptions if not in debugger
|
||||
#ifdef _MSC_VER /* rcg10042001 */
|
||||
#define SAFEBREAKPOINT try { _asm { int 3 }; } catch(...) {;}
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_UNIX /* rcg10042001 */
|
||||
#define SAFEBREAKPOINT raise(SIGTRAP)
|
||||
#endif
|
||||
|
||||
/* CT break point macro */
|
||||
#define BREAKPOINT \
|
||||
if (1) { \
|
||||
SAFEBREAKPOINT; \
|
||||
_assert("hard-coded breakpoint (CroTeam)",__FILE__,__LINE__); \
|
||||
} else NOTHING
|
||||
|
||||
/* CT DEBUG macro -- the expression is executed only in debug version */
|
||||
#ifndef IFDEBUG
|
||||
#define IFDEBUG(expr) \
|
||||
expr
|
||||
#endif
|
||||
|
||||
/* CT assertion macros */
|
||||
#ifndef ASSERT
|
||||
#define ASSERT(expr) \
|
||||
if(!(expr)) { \
|
||||
/*SAFEBREAKPOINT;*/ \
|
||||
_assert(#expr,__FILE__,__LINE__); \
|
||||
} else NOTHING
|
||||
#endif
|
||||
|
||||
#define ASSERTALWAYS(msg) \
|
||||
if (1) { \
|
||||
/*SAFEBREAKPOINT;*/ \
|
||||
_assert(msg,__FILE__,__LINE__); \
|
||||
} else NOTHING
|
||||
|
||||
#define ASSERTMSG(expr, msg) \
|
||||
if(!(expr)) { \
|
||||
/*SAFEBREAKPOINT;*/ \
|
||||
_assert(msg,__FILE__,__LINE__); \
|
||||
} else NOTHING
|
||||
#define DEBUGSTRING(str) (str)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
47
Sources/Engine/Base/Base.h
Normal file
47
Sources/Engine/Base/Base.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
|
||||
/*
|
||||
* rcg10042001 In case these don't get defined in the project file, try to
|
||||
* catch them here...
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#ifndef PLATFORM_WIN32
|
||||
#define PLATFORM_WIN32
|
||||
#endif
|
||||
|
||||
#ifndef PRAGMA_ONCE
|
||||
#define PRAGMA_ONCE
|
||||
#endif
|
||||
|
||||
// disable problematic warnings
|
||||
|
||||
#pragma warning(disable: 4251) // dll interfacing problems
|
||||
#pragma warning(disable: 4275) // dll interfacing problems
|
||||
#pragma warning(disable: 4018) // signed/unsigned mismatch
|
||||
#pragma warning(disable: 4244) // type conversion warnings
|
||||
#pragma warning(disable: 4284) // using -> for UDT
|
||||
#pragma warning(disable: 4355) // 'this' : used in base member initializer list
|
||||
#pragma warning(disable: 4660) // template-class specialization is already instantiated
|
||||
#pragma warning(disable: 4723) // potential divide by 0
|
||||
|
||||
// define engine api exporting declaration specifiers
|
||||
#ifdef ENGINE_EXPORTS
|
||||
#define ENGINE_API __declspec(dllexport)
|
||||
#else
|
||||
#define ENGINE_API __declspec(dllimport)
|
||||
|
||||
#ifdef NDEBUG
|
||||
#pragma comment(lib, "Engine.lib")
|
||||
#else
|
||||
#pragma comment(lib, "EngineD.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // defined _MSC_VER
|
||||
|
||||
|
||||
#ifdef PLATFORM_UNIX /* rcg10042001 */
|
||||
#define ENGINE_API
|
||||
#endif
|
||||
|
52
Sources/Engine/Base/CRC.cpp
Normal file
52
Sources/Engine/Base/CRC.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "stdh.h"
|
||||
|
||||
// Note: this CRC calculation algorithm, although originating from MSDN examples,
|
||||
// is in fact identical to the Adler32 used in ZIP's CRC calculation.
|
||||
|
||||
ENGINE_API ULONG crc_aulCRCTable[256] = {
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F,
|
||||
0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
|
||||
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2,
|
||||
0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
|
||||
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,
|
||||
0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
|
||||
0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C,
|
||||
0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
|
||||
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423,
|
||||
0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
|
||||
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106,
|
||||
0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
|
||||
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D,
|
||||
0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
|
||||
0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,
|
||||
0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
|
||||
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7,
|
||||
0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
|
||||
0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA,
|
||||
0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
|
||||
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81,
|
||||
0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
|
||||
0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84,
|
||||
0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
|
||||
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,
|
||||
0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
|
||||
0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E,
|
||||
0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
|
||||
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55,
|
||||
0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
|
||||
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28,
|
||||
0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F,
|
||||
0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
|
||||
0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,
|
||||
0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
|
||||
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69,
|
||||
0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
|
||||
0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC,
|
||||
0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
|
||||
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693,
|
||||
0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
|
||||
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
|
||||
};
|
49
Sources/Engine/Base/CRC.h
Normal file
49
Sources/Engine/Base/CRC.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#ifndef SE_INCL_CRC_H
|
||||
#define SE_INCL_CRC_H
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
extern ENGINE_API ULONG crc_aulCRCTable[256];
|
||||
|
||||
// begin crc calculation
|
||||
inline void CRC_Start(ULONG &ulCRC) { ulCRC = 0xFFFFFFFF; };
|
||||
|
||||
// add data to a crc value
|
||||
inline void CRC_AddBYTE( ULONG &ulCRC, UBYTE ub)
|
||||
{
|
||||
ulCRC = (ulCRC>>8)^crc_aulCRCTable[UBYTE(ulCRC)^ub];
|
||||
};
|
||||
|
||||
inline void CRC_AddWORD( ULONG &ulCRC, UBYTE uw)
|
||||
{
|
||||
CRC_AddBYTE(ulCRC, UBYTE(uw>> 8));
|
||||
CRC_AddBYTE(ulCRC, UBYTE(uw>> 0));
|
||||
};
|
||||
|
||||
inline void CRC_AddLONG( ULONG &ulCRC, ULONG ul)
|
||||
{
|
||||
CRC_AddBYTE(ulCRC, UBYTE(ul>>24));
|
||||
CRC_AddBYTE(ulCRC, UBYTE(ul>>16));
|
||||
CRC_AddBYTE(ulCRC, UBYTE(ul>> 8));
|
||||
CRC_AddBYTE(ulCRC, UBYTE(ul>> 0));
|
||||
};
|
||||
|
||||
inline void CRC_AddFLOAT(ULONG &ulCRC, FLOAT f)
|
||||
{
|
||||
CRC_AddLONG(ulCRC, *(ULONG*)&f);
|
||||
};
|
||||
|
||||
// add memory block to a CRC value
|
||||
inline void CRC_AddBlock(ULONG &ulCRC, UBYTE *pubBlock, ULONG ulSize)
|
||||
{
|
||||
for( INDEX i=0; i<ulSize; i++) CRC_AddBYTE( ulCRC, pubBlock[i]);
|
||||
};
|
||||
|
||||
// end crc calculation
|
||||
inline void CRC_Finish(ULONG &ulCRC) { ulCRC ^= 0xFFFFFFFF; };
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
190
Sources/Engine/Base/CRCTable.cpp
Normal file
190
Sources/Engine/Base/CRCTable.cpp
Normal file
|
@ -0,0 +1,190 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
|
||||
#include <Engine/Base/CRCTable.h>
|
||||
#include <Engine/Base/FileName.h>
|
||||
#include <Engine/Base/Stream.h>
|
||||
#include <Engine/Base/Console.h>
|
||||
#include <Engine/Base/CRC.h>
|
||||
#include <Engine/Templates/DynamicStackArray.cpp>
|
||||
|
||||
extern INDEX net_bReportCRC;
|
||||
|
||||
class CCRCEntry {
|
||||
public:
|
||||
CTFileName ce_fnmFile; // the file that CRC is for
|
||||
ULONG ce_ulCRC; // CRC of the file
|
||||
BOOL ce_bActive; // set if the file is now active for CRC checking
|
||||
|
||||
// filename is its name (used for storing in nametable)
|
||||
inline const CTFileName &GetName(void) { return ce_fnmFile; };
|
||||
void Clear(void)
|
||||
{
|
||||
ce_fnmFile.Clear();
|
||||
ce_ulCRC = 0;
|
||||
ce_bActive = FALSE;
|
||||
}
|
||||
};
|
||||
|
||||
extern CDynamicStackArray<CTFileName> _afnmNoCRC;
|
||||
extern BOOL FileMatchesList(CDynamicStackArray<CTFileName> &afnm, const CTFileName &fnm);
|
||||
|
||||
#ifndef SE_INCL_CRCTABLE_CPP
|
||||
#define SE_INCL_CRCTABLE_CPP
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#define TYPE CCRCEntry
|
||||
#define CNameTable_TYPE CNameTable_CCRCEntry
|
||||
#define CNameTableSlot_TYPE CNameTableSlot_CCRCEntry
|
||||
#include <Engine/Templates/NameTable.h>
|
||||
#include <Engine/Templates/NameTable.cpp>
|
||||
#undef CNameTableSlot_TYPE
|
||||
#undef CNameTable_TYPE
|
||||
#undef TYPE
|
||||
|
||||
static CDynamicStackArray<CCRCEntry> _aceEntries;
|
||||
static CNameTable_CCRCEntry _ntEntries;
|
||||
|
||||
extern BOOL CRCT_bGatherCRCs = FALSE; // set while gathering CRCs of all loaded files
|
||||
|
||||
// init CRC table
|
||||
void CRCT_Init(void)
|
||||
{
|
||||
_ntEntries.SetAllocationParameters(50, 10, 10);
|
||||
}
|
||||
|
||||
// check if a file is added
|
||||
BOOL CRCT_IsFileAdded(const CTFileName &fnm)
|
||||
{
|
||||
return _ntEntries.Find(fnm)!=NULL;
|
||||
}
|
||||
|
||||
// add one file to active list and get its crc
|
||||
void CRCT_AddFile_t(const CTFileName &fnm, ULONG ulCRC/*=0*/) // throw char *
|
||||
{
|
||||
// if not gathering CRCs now
|
||||
if (!CRCT_bGatherCRCs) {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
// try to find it in table
|
||||
CCRCEntry *pce = _ntEntries.Find(fnm);
|
||||
|
||||
BOOL bNew = FALSE;
|
||||
// if found
|
||||
if (pce!=NULL) {
|
||||
// just activate it
|
||||
bNew = !pce->ce_bActive;
|
||||
pce->ce_bActive = TRUE;
|
||||
// if crc is given
|
||||
if (ulCRC!=0) {
|
||||
// force it
|
||||
pce->ce_ulCRC = ulCRC;
|
||||
}
|
||||
// if not found
|
||||
} else {
|
||||
// calculate checksum
|
||||
if (ulCRC==0) {
|
||||
|
||||
if (FileMatchesList(_afnmNoCRC, fnm)) {
|
||||
ulCRC = 0x12345678;
|
||||
} else {
|
||||
ulCRC = GetFileCRC32_t(fnm);
|
||||
}
|
||||
}
|
||||
// add to the table
|
||||
pce = &_aceEntries.Push();
|
||||
pce->ce_fnmFile = fnm;
|
||||
pce->ce_ulCRC = ulCRC;
|
||||
pce->ce_bActive = TRUE;
|
||||
_ntEntries.Add(pce);
|
||||
bNew = TRUE;
|
||||
}
|
||||
if (bNew && net_bReportCRC) {
|
||||
CPrintF("CRC %08x: '%s'\n", pce->ce_ulCRC, (const char*)pce->ce_fnmFile);
|
||||
}
|
||||
}
|
||||
|
||||
// free all memory used by the crc cache
|
||||
void CRCT_Clear(void)
|
||||
{
|
||||
_ntEntries.Clear();
|
||||
_aceEntries.Clear();
|
||||
}
|
||||
|
||||
// reset all files to not active
|
||||
void CRCT_ResetActiveList(void)
|
||||
{
|
||||
for(INDEX ice=0; ice<_aceEntries.Count(); ice++) {
|
||||
_aceEntries[ice].ce_bActive = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static INDEX GetNumberOfActiveEntries(void)
|
||||
{
|
||||
INDEX ctActive = 0;
|
||||
for(INDEX ice=0; ice<_aceEntries.Count(); ice++) {
|
||||
if (_aceEntries[ice].ce_bActive) {
|
||||
ctActive++;
|
||||
}
|
||||
}
|
||||
return ctActive;
|
||||
}
|
||||
|
||||
// dump list of all active files to the stream
|
||||
void CRCT_MakeFileList_t(CTStream &strmFiles) // throw char *
|
||||
{
|
||||
// save number of active entries
|
||||
INDEX ctActive = GetNumberOfActiveEntries();
|
||||
strmFiles<<ctActive;
|
||||
// for each active entry
|
||||
for(INDEX ice=0; ice<_aceEntries.Count(); ice++) {
|
||||
CCRCEntry &ce = _aceEntries[ice];
|
||||
if (!ce.ce_bActive) {
|
||||
continue;
|
||||
}
|
||||
// save name to stream
|
||||
strmFiles<<(CTString&)ce.ce_fnmFile;
|
||||
}
|
||||
}
|
||||
|
||||
// dump checksums for all files from the list
|
||||
ULONG CRCT_MakeCRCForFiles_t(CTStream &strmFiles) // throw char *
|
||||
{
|
||||
BOOL bOld = CRCT_bGatherCRCs;
|
||||
CRCT_bGatherCRCs = TRUE;
|
||||
|
||||
ULONG ulCRC;
|
||||
CRC_Start(ulCRC);
|
||||
// read number of active files
|
||||
INDEX ctFiles;
|
||||
strmFiles>>ctFiles;
|
||||
// for each one
|
||||
for(INDEX i=0; i<ctFiles; i++) {
|
||||
// read the name
|
||||
CTString strName;
|
||||
strmFiles>>strName;
|
||||
// try to find it in table
|
||||
CCRCEntry *pce = _ntEntries.Find(strName);
|
||||
// if not there
|
||||
if (pce==NULL) {
|
||||
CRCT_AddFile_t(strName);
|
||||
// add it now
|
||||
pce = _ntEntries.Find(strName);
|
||||
}
|
||||
// add the crc
|
||||
CRC_AddLONG(ulCRC, pce->ce_ulCRC);
|
||||
}
|
||||
CRCT_bGatherCRCs = bOld;
|
||||
CRC_Finish(ulCRC);
|
||||
return ulCRC;
|
||||
}
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
28
Sources/Engine/Base/CRCTable.h
Normal file
28
Sources/Engine/Base/CRCTable.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#ifndef SE_INCL_CRCTABLE_H
|
||||
#define SE_INCL_CRCTABLE_H
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
extern BOOL CRCT_bGatherCRCs; // set while gathering CRCs of all loaded files
|
||||
|
||||
// init CRC table
|
||||
void CRCT_Init(void);
|
||||
// add one file to active list
|
||||
void CRCT_AddFile_t(const CTFileName &fnm, ULONG ulCRC=0);// throw char *
|
||||
// check if a file is added
|
||||
BOOL CRCT_IsFileAdded(const CTFileName &fnm);
|
||||
// reset all files to not active
|
||||
void CRCT_ResetActiveList(void);
|
||||
// free all memory used by the crc cache
|
||||
void CRCT_Clear(void);
|
||||
// dump list of all active files to the stream
|
||||
void CRCT_MakeFileList_t(CTStream &strmFiles); // throw char *
|
||||
// dump checksums for all files from the list
|
||||
ULONG CRCT_MakeCRCForFiles_t(CTStream &strmFiles); // throw char *
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
714
Sources/Engine/Base/CTString.cpp
Normal file
714
Sources/Engine/Base/CTString.cpp
Normal file
|
@ -0,0 +1,714 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "stdh.h"
|
||||
|
||||
#include <Engine/Base/CTString.h>
|
||||
#include <Engine/Base/Memory.h>
|
||||
#include <Engine/Base/Stream.h>
|
||||
#include <Engine/Base/Console.h>
|
||||
|
||||
|
||||
/*
|
||||
* Equality comparison.
|
||||
*/
|
||||
BOOL CTString::operator==(const CTString &strOther) const
|
||||
{
|
||||
ASSERT(IsValid() && strOther.IsValid());
|
||||
|
||||
return stricmp( str_String, strOther.str_String) == 0;
|
||||
}
|
||||
BOOL CTString::operator==(const char *strOther) const
|
||||
{
|
||||
ASSERT(IsValid() && strOther!=NULL);
|
||||
|
||||
return stricmp( str_String, strOther) == 0;
|
||||
}
|
||||
BOOL operator==(const char *strThis, const CTString &strOther)
|
||||
{
|
||||
ASSERT(strOther.IsValid() && strThis!=NULL);
|
||||
|
||||
return strOther == strThis;
|
||||
}
|
||||
|
||||
/*
|
||||
* Inequality comparison.
|
||||
*/
|
||||
BOOL CTString::operator!=(const CTString &strOther) const
|
||||
{
|
||||
ASSERT(IsValid() && strOther.IsValid());
|
||||
|
||||
return !( *this == strOther );
|
||||
}
|
||||
BOOL CTString::operator!=(const char *strOther) const
|
||||
{
|
||||
ASSERT(IsValid() && strOther!=NULL);
|
||||
|
||||
return !( *this == strOther );
|
||||
}
|
||||
BOOL operator!=(const char *strThis, const CTString &strOther)
|
||||
{
|
||||
ASSERT(strOther.IsValid() && strThis!=NULL);
|
||||
|
||||
return !( strOther == strThis);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* String concatenation.
|
||||
*/
|
||||
CTString CTString::operator+(const CTString &strSecond) const
|
||||
{
|
||||
ASSERT(IsValid() && strSecond.IsValid());
|
||||
|
||||
return(CTString(*this)+=strSecond);
|
||||
}
|
||||
CTString operator+(const char *strFirst, const CTString &strSecond)
|
||||
{
|
||||
ASSERT(strFirst!=NULL && strSecond.IsValid());
|
||||
|
||||
return(CTString(strFirst)+=strSecond);
|
||||
}
|
||||
CTString &CTString::operator+=(const CTString &strSecond)
|
||||
{
|
||||
ASSERT(IsValid() && strSecond.IsValid());
|
||||
|
||||
GrowMemory( (void **)&str_String, strlen( str_String) + strlen( strSecond) + 1 );
|
||||
strcat(str_String, strSecond.str_String);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove given prefix string from this string
|
||||
*/
|
||||
BOOL CTString::RemovePrefix( const CTString &strPrefix)
|
||||
{
|
||||
INDEX lenPrefix = strlen( strPrefix);
|
||||
INDEX lenDest = strlen( str_String) - lenPrefix;
|
||||
|
||||
if( strnicmp( str_String, strPrefix, lenPrefix) != 0)
|
||||
return FALSE;
|
||||
CTString strTemp = CTString( &str_String[ lenPrefix]);
|
||||
ShrinkMemory( (void **)&str_String, lenDest+1);
|
||||
strcpy( str_String, strTemp.str_String);
|
||||
return TRUE;
|
||||
}
|
||||
/* Check if has given prefix */
|
||||
BOOL CTString::HasPrefix( const CTString &strPrefix) const
|
||||
{
|
||||
INDEX lenPrefix = strlen( strPrefix);
|
||||
if( strnicmp( str_String, strPrefix, lenPrefix) != 0)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Find index of a substring in a string (returns -1 if not found). */
|
||||
INDEX CTString::FindSubstr(const CTString &strSub)
|
||||
{
|
||||
INDEX ct = Length();
|
||||
INDEX ctSub = strSub.Length();
|
||||
for (INDEX i=0; i<ct-ctSub+1; i++) {
|
||||
for (INDEX iSub=0; iSub<ctSub; iSub++) {
|
||||
if ((*this)[i+iSub]!=strSub[iSub]) {
|
||||
goto wrong;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
wrong:;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Replace a substring in a string. */
|
||||
BOOL CTString::ReplaceSubstr(const CTString &strSub, const CTString &strNewSub)
|
||||
{
|
||||
INDEX iPos = FindSubstr(strSub);
|
||||
if (iPos<0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CTString strPart1, strPart2;
|
||||
Split(iPos, strPart1, strPart2);
|
||||
strPart2.RemovePrefix(strSub);
|
||||
|
||||
*this = strPart1+strNewSub+strPart2;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Trim the string from left to contain at most given number of characters. */
|
||||
INDEX CTString::TrimLeft( INDEX ctCharacters)
|
||||
{
|
||||
// clamp negative values
|
||||
if( ctCharacters<0) ctCharacters = 0;
|
||||
// find how much characters to remove
|
||||
INDEX lenOriginal = strlen(str_String);
|
||||
INDEX lenPrefix = lenOriginal-ctCharacters;
|
||||
// if nothing needs to be removed
|
||||
if( lenPrefix<=0) return 0;
|
||||
// crop
|
||||
memmove( str_String, &str_String[ lenPrefix], ctCharacters+1);
|
||||
ShrinkMemory( (void **)&str_String, ctCharacters+1);
|
||||
return lenPrefix;
|
||||
}
|
||||
|
||||
/* Trim the string from right to contain at most given number of characters. */
|
||||
INDEX CTString::TrimRight( INDEX ctCharacters)
|
||||
{
|
||||
// clamp negative values
|
||||
if( ctCharacters<0) ctCharacters = 0;
|
||||
// find how much characters to remove
|
||||
INDEX lenOriginal = strlen(str_String);
|
||||
INDEX lenPrefix = lenOriginal-ctCharacters;
|
||||
// if nothing needs to be removed
|
||||
if( lenPrefix<=0) return 0;
|
||||
// crop
|
||||
str_String[ctCharacters] = '\0';
|
||||
ShrinkMemory( (void**)&str_String, ctCharacters+1);
|
||||
return lenPrefix;
|
||||
}
|
||||
|
||||
|
||||
// return naked length of the string (ignoring all decorate codes)
|
||||
INDEX CTString::LengthNaked(void) const
|
||||
{
|
||||
return Undecorated().Length();
|
||||
}
|
||||
|
||||
// strip decorations from the string
|
||||
CTString CTString::Undecorated(void) const
|
||||
{
|
||||
// make a copy of the string to hold the result - we will rewrite it without the codes
|
||||
CTString strResult = *this;
|
||||
|
||||
// start at the beginning of both strings
|
||||
const char *pchSrc = str_String;
|
||||
char *pchDst = strResult.str_String;
|
||||
|
||||
// while the source is not finished
|
||||
while(pchSrc[0]!=0) {
|
||||
// if the source char is not escape char
|
||||
if (pchSrc[0]!='^') {
|
||||
// copy it over
|
||||
*pchDst++ = *pchSrc++;
|
||||
// go to next char
|
||||
continue;
|
||||
}
|
||||
// check the next char
|
||||
switch(pchSrc[1]) {
|
||||
// if one of the control codes, skip corresponding number of characters
|
||||
case 'c': pchSrc += 2+FindZero((UBYTE*)pchSrc+2,6); break;
|
||||
case 'a': pchSrc += 2+FindZero((UBYTE*)pchSrc+2,2); break;
|
||||
case 'f': pchSrc += 2+FindZero((UBYTE*)pchSrc+2,2); break;
|
||||
case 'b': case 'i': case 'r': case 'o':
|
||||
case 'C': case 'A': case 'F': case 'B': case 'I': pchSrc+=2; break;
|
||||
// if it is the escape char again, skip the first escape and copy the char
|
||||
case '^': pchSrc++; *pchDst++ = *pchSrc++; break;
|
||||
// if it is something else
|
||||
default:
|
||||
// just copy over the control char
|
||||
*pchDst++ = *pchSrc++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*pchDst++ = 0;
|
||||
ASSERT(strResult.Length()<=Length());
|
||||
return strResult;
|
||||
}
|
||||
|
||||
BOOL IsSpace(char c)
|
||||
{
|
||||
return c==' ' || c=='\t' || c=='\n' || c=='\r';
|
||||
}
|
||||
|
||||
/* Trim the string from from spaces from left. */
|
||||
INDEX CTString::TrimSpacesLeft(void)
|
||||
{
|
||||
// for each character in string
|
||||
const char *chr;
|
||||
for(chr = str_String; *chr!=0; chr++) {
|
||||
// if the character is not space
|
||||
if (!IsSpace(*chr)) {
|
||||
// stop searching
|
||||
break;
|
||||
}
|
||||
}
|
||||
// trim to that character
|
||||
return TrimLeft(str_String+strlen(str_String) - chr);
|
||||
}
|
||||
|
||||
/* Trim the string from from spaces from right. */
|
||||
INDEX CTString::TrimSpacesRight(void)
|
||||
{
|
||||
// for each character in string reversed
|
||||
const char *chr;
|
||||
for(chr = str_String+strlen(str_String)-1; chr>str_String; chr--) {
|
||||
// if the character is not space
|
||||
if (!IsSpace(*chr)) {
|
||||
// stop searching
|
||||
break;
|
||||
}
|
||||
}
|
||||
// trim to that character
|
||||
return TrimRight(chr-str_String+1);
|
||||
}
|
||||
|
||||
|
||||
// retain only first line of the string
|
||||
void CTString::OnlyFirstLine(void)
|
||||
{
|
||||
// get position of first line end
|
||||
const char *pchNL = strchr(str_String, '\n');
|
||||
// if none
|
||||
if (pchNL==NULL) {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
// trim everything after that char
|
||||
TrimRight(pchNL-str_String);
|
||||
}
|
||||
|
||||
|
||||
/* Calculate hashing value for the string. */
|
||||
ULONG CTString::GetHash(void) const
|
||||
{
|
||||
ULONG ulKey = 0;
|
||||
INDEX len = strlen(str_String);
|
||||
|
||||
for(INDEX i=0; i<len; i++) {
|
||||
ulKey = _rotl(ulKey,4)+toupper(str_String[i]);
|
||||
}
|
||||
return ulKey;
|
||||
}
|
||||
|
||||
/*
|
||||
* Throw exception
|
||||
*/
|
||||
void CTString::Throw_t(void)
|
||||
{
|
||||
throw(str_String);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Read from stream.
|
||||
*/
|
||||
CTStream &operator>>(CTStream &strmStream, CTString &strString)
|
||||
{
|
||||
ASSERT(strString.IsValid());
|
||||
|
||||
// read length
|
||||
INDEX iLength;
|
||||
strmStream>>iLength;
|
||||
ASSERT(iLength>=0);
|
||||
// allocate that much memory
|
||||
FreeMemory(strString.str_String);
|
||||
strString.str_String = (char *) AllocMemory(iLength+1); // take end-marker in account
|
||||
// if the string is not empty
|
||||
if (iLength>0) {
|
||||
// read string
|
||||
strmStream.Read_t( strString.str_String, iLength); // without end-marker
|
||||
}
|
||||
// set end-marker
|
||||
strString.str_String[iLength] = 0;
|
||||
|
||||
return strmStream;
|
||||
}
|
||||
|
||||
|
||||
void CTString::ReadFromText_t(CTStream &strmStream,
|
||||
const CTString &strKeyword="") // throw char *
|
||||
{
|
||||
ASSERT(IsValid());
|
||||
|
||||
// keyword must be present
|
||||
strmStream.ExpectKeyword_t(strKeyword);
|
||||
|
||||
// read the string from the file
|
||||
char str[1024];
|
||||
strmStream.GetLine_t(str, sizeof(str));
|
||||
|
||||
// copy it here
|
||||
(*this) = str;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write to stream.
|
||||
*/
|
||||
CTStream &operator<<(CTStream &strmStream, const CTString &strString)
|
||||
{
|
||||
ASSERT(strString.IsValid());
|
||||
|
||||
// calculate size
|
||||
INDEX iStringLen = strlen( strString);
|
||||
// write size
|
||||
strmStream<<iStringLen;
|
||||
// if the string is not empty
|
||||
if (iStringLen>0) {
|
||||
// write string
|
||||
strmStream.Write_t(strString.str_String, iStringLen); // without end-marker
|
||||
}
|
||||
|
||||
return strmStream;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
/*
|
||||
* Check if string data is valid.
|
||||
*/
|
||||
BOOL CTString::IsValid(void) const
|
||||
{
|
||||
ASSERT(this!=NULL && str_String!=NULL);
|
||||
return TRUE;
|
||||
}
|
||||
#endif // NDEBUG
|
||||
|
||||
|
||||
/* Load an entire text file into a string. */
|
||||
void CTString::ReadUntilEOF_t(CTStream &strmFile) // throw char *
|
||||
{
|
||||
// get the file size
|
||||
SLONG slFileSize = strmFile.GetStreamSize()-strmFile.GetPos_t();
|
||||
|
||||
// allocate that much memory
|
||||
FreeMemory(str_String);
|
||||
str_String = (char *) AllocMemory(slFileSize+1); // take end-marker in account
|
||||
// read the entire file there
|
||||
if (slFileSize>0) {
|
||||
strmFile.Read_t( str_String, slFileSize);
|
||||
}
|
||||
// add end marker
|
||||
str_String[slFileSize] = 0;
|
||||
|
||||
// rewrite entire string
|
||||
char *pchRead=str_String;
|
||||
char *pchWrite=str_String;
|
||||
while(*pchRead!=0) {
|
||||
// skip the '\r' characters
|
||||
if (*pchRead!='\r') {
|
||||
*pchWrite++ = *pchRead++;
|
||||
} else {
|
||||
pchRead++;
|
||||
}
|
||||
}
|
||||
*pchWrite = 0;
|
||||
}
|
||||
|
||||
|
||||
void CTString::Load_t(const class CTFileName &fnmFile) // throw char *
|
||||
{
|
||||
ASSERT(IsValid());
|
||||
|
||||
// open the file for reading
|
||||
CTFileStream strmFile;
|
||||
strmFile.Open_t(fnmFile);
|
||||
|
||||
// read string until end of file
|
||||
ReadUntilEOF_t(strmFile);
|
||||
}
|
||||
|
||||
|
||||
void CTString::LoadKeepCRLF_t(const class CTFileName &fnmFile) // throw char *
|
||||
{
|
||||
ASSERT(IsValid());
|
||||
|
||||
// open the file for reading
|
||||
CTFileStream strmFile;
|
||||
strmFile.Open_t(fnmFile);
|
||||
// get the file size
|
||||
SLONG slFileSize = strmFile.GetStreamSize();
|
||||
|
||||
// allocate that much memory
|
||||
FreeMemory(str_String);
|
||||
str_String = (char *) AllocMemory(slFileSize+1); // take end-marker in account
|
||||
// read the entire file there
|
||||
if (slFileSize>0) {
|
||||
strmFile.Read_t( str_String, slFileSize);
|
||||
}
|
||||
// add end marker
|
||||
str_String[slFileSize] = 0;
|
||||
}
|
||||
|
||||
/* Save an entire string into a text file. */
|
||||
void CTString::Save_t(const class CTFileName &fnmFile) // throw char *
|
||||
{
|
||||
// open the file for writing
|
||||
CTFileStream strmFile;
|
||||
strmFile.Create_t(fnmFile);
|
||||
// save the string to the file
|
||||
strmFile.PutString_t(*this);
|
||||
}
|
||||
void CTString::SaveKeepCRLF_t(const class CTFileName &fnmFile) // throw char *
|
||||
{
|
||||
// open the file for writing
|
||||
CTFileStream strmFile;
|
||||
strmFile.Create_t(fnmFile);
|
||||
// save the string to the file
|
||||
if (strlen(str_String)>0) {
|
||||
strmFile.Write_t(str_String, strlen(str_String));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Print formatted to a string
|
||||
INDEX CTString::PrintF(const char *strFormat, ...)
|
||||
{
|
||||
va_list arg;
|
||||
va_start(arg, strFormat);
|
||||
return VPrintF(strFormat, arg);
|
||||
}
|
||||
|
||||
|
||||
INDEX CTString::VPrintF(const char *strFormat, va_list arg)
|
||||
{
|
||||
|
||||
static INDEX _ctBufferSize = 0;
|
||||
static char *_pchBuffer = NULL;
|
||||
|
||||
// if buffer was not allocated yet
|
||||
if (_ctBufferSize==0) {
|
||||
// allocate it
|
||||
_ctBufferSize = 256;
|
||||
_pchBuffer = (char*)AllocMemory(_ctBufferSize);
|
||||
}
|
||||
|
||||
// repeat
|
||||
INDEX iLen;
|
||||
FOREVER {
|
||||
// print to the buffer
|
||||
iLen = _vsnprintf(_pchBuffer, _ctBufferSize, strFormat, arg);
|
||||
// if printed ok
|
||||
if (iLen!=-1) {
|
||||
// stop
|
||||
break;
|
||||
}
|
||||
// increase the buffer size
|
||||
_ctBufferSize += 256;
|
||||
GrowMemory((void**)&_pchBuffer, _ctBufferSize);
|
||||
}
|
||||
|
||||
(*this) = _pchBuffer;
|
||||
return iLen;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void *psscanf = &sscanf;
|
||||
// Scan formatted from a string
|
||||
__declspec(naked) INDEX CTString::ScanF(const char *strFormat, ...)
|
||||
{
|
||||
__asm {
|
||||
push eax
|
||||
mov eax,dword ptr [esp+8]
|
||||
mov eax,dword ptr [eax]
|
||||
mov dword ptr [esp+8], eax
|
||||
pop eax
|
||||
jmp dword ptr [psscanf]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// split string in two strings at specified position (char AT splitting position goes to str2)
|
||||
void CTString::Split( INDEX iPos, CTString &str1, CTString &str2)
|
||||
{
|
||||
str1 = str_String;
|
||||
str2 = str_String;
|
||||
str1.TrimRight(iPos);
|
||||
str2.TrimLeft(strlen(str2)-iPos);
|
||||
}
|
||||
|
||||
|
||||
// insert one character in string at specified pos
|
||||
void CTString::InsertChar( INDEX iPos, char cChr)
|
||||
{
|
||||
// clamp position
|
||||
INDEX ctChars = strlen(str_String);
|
||||
if( iPos>ctChars) iPos=ctChars;
|
||||
else if( iPos<0) iPos=0;
|
||||
// grow memory used by string
|
||||
GrowMemory( (void**)&str_String, ctChars+2);
|
||||
// copy part of string to make room for char to insert
|
||||
memmove( &str_String[iPos+1], &str_String[iPos], ctChars+1-iPos);
|
||||
str_String[iPos] = cChr;
|
||||
}
|
||||
|
||||
|
||||
// delete one character from string at specified pos
|
||||
void CTString::DeleteChar( INDEX iPos)
|
||||
{
|
||||
// clamp position
|
||||
INDEX ctChars = strlen(str_String);
|
||||
if (ctChars==0) {
|
||||
return;
|
||||
}
|
||||
if( iPos>ctChars) iPos=ctChars;
|
||||
else if( iPos<0) iPos=0;
|
||||
// copy part of string
|
||||
memmove( &str_String[iPos], &str_String[iPos+1], ctChars-iPos+1);
|
||||
// shrink memory used by string over deleted char
|
||||
ShrinkMemory( (void**)&str_String, ctChars);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// wild card comparison
|
||||
BOOL CTString::Matches(const CTString &strOther) const
|
||||
{
|
||||
return Matches(strOther.str_String);
|
||||
}
|
||||
|
||||
|
||||
BOOL CTString::Matches(const char *strOther) const
|
||||
{
|
||||
// pattern matching code from sourceforge.net codesnippet archive
|
||||
// adjusted a bit to match in/out parameters
|
||||
#define MAX_CALLS 200
|
||||
int calls=0, wild=0, q=0;
|
||||
const char *mask=strOther, *name=str_String;
|
||||
const char *m=mask, *n=name, *ma=mask, *na=name;
|
||||
|
||||
for(;;) {
|
||||
if (++calls > MAX_CALLS) {
|
||||
return FALSE;
|
||||
}
|
||||
if (*m == '*') {
|
||||
while (*m == '*') ++m;
|
||||
wild = 1;
|
||||
ma = m;
|
||||
na = n;
|
||||
}
|
||||
|
||||
if (!*m) {
|
||||
if (!*n) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
for (--m; (m > mask) && (*m == '?'); --m) ;
|
||||
|
||||
if ((*m == '*') && (m > mask) &&
|
||||
(m[-1] != '\\')) {
|
||||
return TRUE;
|
||||
}
|
||||
if (!wild) {
|
||||
return FALSE;
|
||||
}
|
||||
m = ma;
|
||||
} else if (!*n) {
|
||||
while(*m == '*') ++m;
|
||||
if (*m != 0) {
|
||||
return FALSE;
|
||||
} else {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if ((*m == '\\') && ((m[1] == '*') || (m[1] == '?'))) {
|
||||
++m;
|
||||
q = 1;
|
||||
} else {
|
||||
q = 0;
|
||||
}
|
||||
|
||||
if ((tolower(*m) != tolower(*n)) && ((*m != '?') || q)) {
|
||||
if (!wild) {
|
||||
return FALSE;
|
||||
}
|
||||
m = ma;
|
||||
n = ++na;
|
||||
} else {
|
||||
if (*m) ++m;
|
||||
if (*n) ++n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// variable management functions
|
||||
void CTString::LoadVar(const class CTFileName &fnmFile)
|
||||
{
|
||||
try {
|
||||
CTString str;
|
||||
str.Load_t(fnmFile);
|
||||
*this = str;
|
||||
} catch (char *strError) {
|
||||
CPrintF(TRANS("Cannot load variable from '%s':\n%s\n"), (CTString&)fnmFile, strError);
|
||||
}
|
||||
}
|
||||
|
||||
void CTString::SaveVar(const class CTFileName &fnmFile)
|
||||
{
|
||||
try {
|
||||
Save_t(fnmFile);
|
||||
} catch (char *strError) {
|
||||
CPrintF(TRANS("Cannot save variable to '%s':\n%s\n"), (CTString&)fnmFile, strError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// general variable functions
|
||||
void LoadStringVar(const CTFileName &fnmVar, CTString &strVar)
|
||||
{
|
||||
strVar.LoadVar(fnmVar);
|
||||
}
|
||||
|
||||
void SaveStringVar(const CTFileName &fnmVar, CTString &strVar)
|
||||
{
|
||||
strVar.SaveVar(fnmVar);
|
||||
}
|
||||
|
||||
|
||||
void LoadIntVar(const CTFileName &fnmVar, INDEX &iVar)
|
||||
{
|
||||
CTString strVar;
|
||||
strVar.LoadVar(fnmVar);
|
||||
if (strVar!="") {
|
||||
CTString strHex = strVar;
|
||||
if (strHex.RemovePrefix("0x")) {
|
||||
strHex.ScanF("%x", &iVar);
|
||||
} else {
|
||||
strVar.ScanF("%d", &iVar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SaveIntVar(const CTFileName &fnmVar, INDEX &iVar)
|
||||
{
|
||||
CTString strVar;
|
||||
strVar.PrintF("%d", iVar);
|
||||
strVar.SaveVar(fnmVar);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// remove special codes from string
|
||||
CTString RemoveSpecialCodes( const CTString &str)
|
||||
{
|
||||
CTString strRet=str;
|
||||
char *pcSrc = (char*)(const char*)strRet;
|
||||
char *pcDst = (char*)(const char*)strRet;
|
||||
// copy char inside string skipping special codes
|
||||
while( *pcSrc != 0)
|
||||
{
|
||||
if( *pcSrc != '^')
|
||||
{ // advance to next char
|
||||
*pcDst = *pcSrc;
|
||||
pcSrc++;
|
||||
pcDst++;
|
||||
}
|
||||
else
|
||||
{ // skip some characters
|
||||
pcSrc++;
|
||||
switch( *pcSrc) {
|
||||
case 'c': pcSrc+=FindZero((UBYTE*)pcSrc,7); continue;
|
||||
case 'a': pcSrc+=FindZero((UBYTE*)pcSrc,3); continue;
|
||||
case 'f': pcSrc+=FindZero((UBYTE*)pcSrc,2); continue;
|
||||
case 'b': case 'i': case 'r': case 'o':
|
||||
case 'C': case 'A': case 'F': case 'B': case 'I': pcSrc+=1; continue;
|
||||
// if we get here this means that ^ or an unrecognized special code was specified
|
||||
default: continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
// terminate string
|
||||
*pcDst = 0;
|
||||
return strRet;
|
||||
}
|
131
Sources/Engine/Base/CTString.h
Normal file
131
Sources/Engine/Base/CTString.h
Normal file
|
@ -0,0 +1,131 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#ifndef SE_INCL_CTSTRING_H
|
||||
#define SE_INCL_CTSTRING_H
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <Engine/Base/Types.h>
|
||||
|
||||
/*
|
||||
* Main string class
|
||||
*/
|
||||
class ENGINE_API CTString {
|
||||
public:
|
||||
char *str_String; // pointer to memory holding the character string
|
||||
public:
|
||||
/* Default constructor. */
|
||||
inline CTString(void);
|
||||
/* Copy constructor. */
|
||||
inline CTString(const CTString &strOriginal);
|
||||
/* Constructor from character string. */
|
||||
inline CTString(const char *pString);
|
||||
/* Constructor with formatting. */
|
||||
inline CTString(INDEX iDummy, const char *strFormat, ...);
|
||||
/* Destructor. */
|
||||
inline ~CTString();
|
||||
/* Clear the object. */
|
||||
inline void Clear(void);
|
||||
|
||||
/* Conversion into character string. */
|
||||
inline operator const char*() const;
|
||||
|
||||
/* Assignment. */
|
||||
inline CTString &operator=(const char *strCharString);
|
||||
inline CTString &operator=(const CTString &strOther);
|
||||
|
||||
/* Check if string data is valid. */
|
||||
BOOL IsValid(void) const;
|
||||
|
||||
// return length of the string
|
||||
inline INDEX Length(void) const { return strlen(str_String); };
|
||||
INDEX LengthNaked(void) const;
|
||||
|
||||
// strip decorations from the string
|
||||
CTString Undecorated(void) const;
|
||||
|
||||
/* Find index of a substring in a string (returns -1 if not found). */
|
||||
INDEX FindSubstr(const CTString &strSub);
|
||||
/* Replace a substring in a string. */
|
||||
BOOL ReplaceSubstr(const CTString &strSub, const CTString &strNewSub);
|
||||
/* Check if has given prefix */
|
||||
BOOL HasPrefix( const CTString &strPrefix) const;
|
||||
/* Remove given prefix string from this string */
|
||||
BOOL RemovePrefix( const CTString &strPrefix);
|
||||
/* Trim the string to contain at most given number of characters. */
|
||||
INDEX TrimLeft( INDEX ctCharacters);
|
||||
INDEX TrimRight( INDEX ctCharacters);
|
||||
/* Trim the string from spaces. */
|
||||
INDEX TrimSpacesLeft(void);
|
||||
INDEX TrimSpacesRight(void);
|
||||
/* Calcuate hashing value for the string. */
|
||||
ULONG GetHash(void) const;
|
||||
// retain only first line of the string
|
||||
void OnlyFirstLine(void);
|
||||
|
||||
/* Equality comparison. */
|
||||
BOOL operator==(const CTString &strOther) const;
|
||||
BOOL operator==(const char *strOther) const;
|
||||
ENGINE_API friend BOOL operator==(const char *strThis, const CTString &strOther);
|
||||
/* Inequality comparison. */
|
||||
BOOL operator!=(const CTString &strOther) const;
|
||||
BOOL operator!=(const char *strOther) const;
|
||||
ENGINE_API friend BOOL operator!=(const char *strThis, const CTString &strOther);
|
||||
// wild card comparison (other string may contain wildcards)
|
||||
BOOL Matches(const CTString &strOther) const;
|
||||
BOOL Matches(const char *strOther) const;
|
||||
|
||||
/* String concatenation. */
|
||||
CTString operator+(const CTString &strSecond) const;
|
||||
CTString &operator+=(const CTString &strSecond);
|
||||
ENGINE_API friend CTString operator+(const char *strFirst, const CTString &strSecond);
|
||||
|
||||
// split string in two strings at specified position (char AT splitting position goes to str2)
|
||||
void Split( INDEX iPos, CTString &str1, CTString &str2);
|
||||
void InsertChar( INDEX iPos, char cChr); // insert char at position
|
||||
void DeleteChar( INDEX iPos); // delete char at position
|
||||
|
||||
/* Throw exception */
|
||||
void Throw_t(void);
|
||||
|
||||
/* Read from stream. */
|
||||
ENGINE_API friend CTStream &operator>>(CTStream &strmStream, CTString &strString);
|
||||
void ReadFromText_t(CTStream &strmStream, const CTString &strKeyword); // throw char *
|
||||
/* Write to stream. */
|
||||
ENGINE_API friend CTStream &operator<<(CTStream &strmStream, const CTString &strString);
|
||||
|
||||
/* Load an entire text file into a string. */
|
||||
void Load_t(const class CTFileName &fnmFile); // throw char *
|
||||
void LoadKeepCRLF_t(const class CTFileName &fnmFile); // throw char *
|
||||
void ReadUntilEOF_t(CTStream &strmStream); // throw char *
|
||||
/* Save an entire string into a text file. */
|
||||
void Save_t(const class CTFileName &fnmFile); // throw char *
|
||||
void SaveKeepCRLF_t(const class CTFileName &fnmFile); // throw char *
|
||||
|
||||
// Print formatted to a string
|
||||
INDEX PrintF(const char *strFormat, ...);
|
||||
INDEX VPrintF(const char *strFormat, va_list arg);
|
||||
// Scan formatted from a string
|
||||
INDEX ScanF(const char *strFormat, ...);
|
||||
|
||||
// variable management functions
|
||||
void LoadVar(const CTFileName &fnmFile);
|
||||
void SaveVar(const CTFileName &fnmFile);
|
||||
};
|
||||
|
||||
|
||||
// general variable functions
|
||||
ENGINE_API void LoadStringVar( const CTFileName &fnmVar, CTString &strVar);
|
||||
ENGINE_API void SaveStringVar( const CTFileName &fnmVar, CTString &strVar);
|
||||
ENGINE_API void LoadIntVar( const CTFileName &fnmVar, INDEX &iVar);
|
||||
ENGINE_API void SaveIntVar( const CTFileName &fnmVar, INDEX &iVar);
|
||||
|
||||
ENGINE_API CTString RemoveSpecialCodes( const CTString &str);
|
||||
|
||||
|
||||
#include <Engine/Base/CTString.inl>
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
118
Sources/Engine/Base/CTString.inl
Normal file
118
Sources/Engine/Base/CTString.inl
Normal file
|
@ -0,0 +1,118 @@
|
|||
#ifndef SE_INCL_CTSTRING_INL
|
||||
#define SE_INCL_CTSTRING_INL
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <Engine/Base/Memory.h>
|
||||
#include <Engine/Base/Assert.h>
|
||||
|
||||
/*
|
||||
* Default constructor.
|
||||
*/
|
||||
ENGINE_API CTString::CTString(void)
|
||||
{
|
||||
str_String = StringDuplicate("");
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy constructor.
|
||||
*/
|
||||
ENGINE_API CTString::CTString(const CTString &strOriginal)
|
||||
{
|
||||
ASSERT(strOriginal.IsValid());
|
||||
|
||||
// make string duplicate
|
||||
str_String = StringDuplicate(strOriginal.str_String);
|
||||
}
|
||||
|
||||
/*
|
||||
* Constructor from character string.
|
||||
*/
|
||||
ENGINE_API CTString::CTString( const char *strCharString)
|
||||
{
|
||||
ASSERT(strCharString!=NULL);
|
||||
|
||||
// make string duplicate
|
||||
str_String = StringDuplicate( strCharString);
|
||||
}
|
||||
|
||||
/* Constructor with formatting. */
|
||||
ENGINE_API CTString::CTString(INDEX iDummy, const char *strFormat, ...)
|
||||
{
|
||||
str_String = StringDuplicate("");
|
||||
va_list arg;
|
||||
va_start(arg, strFormat);
|
||||
VPrintF(strFormat, arg);
|
||||
}
|
||||
|
||||
/*
|
||||
* Destructor.
|
||||
*/
|
||||
ENGINE_API CTString::~CTString()
|
||||
{
|
||||
// check that it is valid
|
||||
ASSERT(IsValid());
|
||||
// free memory
|
||||
FreeMemory(str_String);
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear the object.
|
||||
*/
|
||||
ENGINE_API void CTString::Clear(void)
|
||||
{
|
||||
operator=("");
|
||||
}
|
||||
|
||||
/*
|
||||
* Conversion into character string.
|
||||
*/
|
||||
ENGINE_API CTString::operator const char*() const
|
||||
{
|
||||
ASSERT(IsValid());
|
||||
|
||||
return str_String;
|
||||
}
|
||||
|
||||
/*
|
||||
* Assignment.
|
||||
*/
|
||||
ENGINE_API CTString &CTString::operator=(const char *strCharString)
|
||||
{
|
||||
ASSERT(IsValid());
|
||||
ASSERT(strCharString!=NULL);
|
||||
|
||||
/* The other string must be copied _before_ this memory is freed, since it could be same
|
||||
pointer!
|
||||
*/
|
||||
// make a copy of character string
|
||||
char *strCopy = StringDuplicate(strCharString);
|
||||
// empty this string
|
||||
FreeMemory(str_String);
|
||||
// assign it the copy of the character string
|
||||
str_String = strCopy;
|
||||
|
||||
return *this;
|
||||
}
|
||||
ENGINE_API CTString &CTString::operator=(const CTString &strOther)
|
||||
{
|
||||
ASSERT(IsValid());
|
||||
ASSERT(strOther.IsValid());
|
||||
|
||||
/* The other string must be copied _before_ this memory is freed, since it could be same
|
||||
pointer!
|
||||
*/
|
||||
// make a copy of character string
|
||||
char *strCopy = StringDuplicate(strOther.str_String);
|
||||
// empty this string
|
||||
FreeMemory(str_String);
|
||||
// assign it the copy of the character string
|
||||
str_String = strCopy;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
58
Sources/Engine/Base/Changeable.cpp
Normal file
58
Sources/Engine/Base/Changeable.cpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "stdh.h"
|
||||
|
||||
#include <Engine/Base/Changeable.h>
|
||||
#include <Engine/Base/ChangeableRT.h>
|
||||
#include <Engine/Base/Updateable.h>
|
||||
#include <Engine/Base/UpdateableRT.h>
|
||||
#include <Engine/Base/Timer.h>
|
||||
|
||||
/*
|
||||
* Constructor.
|
||||
*/
|
||||
CChangeable::CChangeable(void)
|
||||
{
|
||||
ch_LastChangeTime = TIME(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark that something has changed in this object.
|
||||
*/
|
||||
void CChangeable::MarkChanged(void)
|
||||
{
|
||||
ch_LastChangeTime = _pTimer->CurrentTick();
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if some updateable object is up to date with this changeable.
|
||||
*/
|
||||
BOOL CChangeable::IsUpToDate(const CUpdateable &ud) const
|
||||
{
|
||||
return ch_LastChangeTime < ud.LastUpdateTime();
|
||||
}
|
||||
|
||||
/*
|
||||
* Constructor.
|
||||
*/
|
||||
CChangeableRT::CChangeableRT(void)
|
||||
{
|
||||
ch_LastChangeTime = TIME(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark that something has changed in this object.
|
||||
*/
|
||||
void CChangeableRT::MarkChanged(void)
|
||||
{
|
||||
ch_LastChangeTime = _pTimer->GetRealTimeTick();
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if some updateable object is up to date with this changeable.
|
||||
*/
|
||||
BOOL CChangeableRT::IsUpToDate(const CUpdateableRT &ud) const
|
||||
{
|
||||
return ch_LastChangeTime < ud.LastUpdateTime();
|
||||
}
|
||||
|
26
Sources/Engine/Base/Changeable.h
Normal file
26
Sources/Engine/Base/Changeable.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#ifndef SE_INCL_CHANGEABLE_H
|
||||
#define SE_INCL_CHANGEABLE_H
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Object that can change in time.
|
||||
*/
|
||||
class ENGINE_API CChangeable {
|
||||
private:
|
||||
TIME ch_LastChangeTime; // last time this object has been changed
|
||||
public:
|
||||
/* Constructor. */
|
||||
CChangeable(void);
|
||||
/* Mark that something has changed in this object. */
|
||||
void MarkChanged(void);
|
||||
/* Test if some updateable object is up to date with this changeable. */
|
||||
BOOL IsUpToDate(const CUpdateable &ud) const;
|
||||
};
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
27
Sources/Engine/Base/ChangeableRT.h
Normal file
27
Sources/Engine/Base/ChangeableRT.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#ifndef SE_INCL_CHANGEABLERT_H
|
||||
#define SE_INCL_CHANGEABLERT_H
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Object that can change in time.
|
||||
*/
|
||||
class ENGINE_API CChangeableRT {
|
||||
private:
|
||||
TIME ch_LastChangeTime; // last time this object has been changed
|
||||
public:
|
||||
/* Constructor. */
|
||||
CChangeableRT(void);
|
||||
/* Mark that something has changed in this object. */
|
||||
void MarkChanged(void);
|
||||
/* Test if some updateable object is up to date with this changeable. */
|
||||
BOOL IsUpToDate(const CUpdateableRT &ud) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
327
Sources/Engine/Base/Console.cpp
Normal file
327
Sources/Engine/Base/Console.cpp
Normal file
|
@ -0,0 +1,327 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "stdh.h"
|
||||
|
||||
#include <Engine/Base/Console.h>
|
||||
#include <Engine/Base/Console_Internal.h>
|
||||
|
||||
#include <Engine/Base/Timer.h>
|
||||
#include <Engine/Base/ErrorReporting.h>
|
||||
#include <Engine/Base/CTString.h>
|
||||
#include <Engine/Base/FileName.h>
|
||||
#include <Engine/Base/Memory.h>
|
||||
|
||||
#include <Engine/Math/Functions.h>
|
||||
|
||||
extern CConsole *_pConsole = NULL;
|
||||
|
||||
extern INDEX con_iLastLines;
|
||||
extern BOOL con_bCapture = FALSE;
|
||||
extern CTString con_strCapture = "";
|
||||
|
||||
|
||||
// Constructor.
|
||||
CConsole::CConsole(void)
|
||||
{
|
||||
con_strBuffer = NULL;
|
||||
con_strLineBuffer = NULL;
|
||||
con_atmLines = NULL;
|
||||
con_fLog = NULL;
|
||||
}
|
||||
// Destructor.
|
||||
CConsole::~CConsole(void)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return;
|
||||
}
|
||||
if (con_fLog!=NULL) {
|
||||
fclose(con_fLog);
|
||||
con_fLog = NULL;
|
||||
}
|
||||
if (con_strBuffer!=NULL) {
|
||||
FreeMemory(con_strBuffer);
|
||||
}
|
||||
if (con_strLineBuffer!=NULL) {
|
||||
FreeMemory(con_strLineBuffer);
|
||||
}
|
||||
if (con_atmLines!=NULL) {
|
||||
FreeMemory(con_atmLines);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize the console.
|
||||
void CConsole::Initialize(const CTFileName &fnmLog, INDEX ctCharsPerLine, INDEX ctLines)
|
||||
{
|
||||
con_csConsole.cs_iIndex = -1;
|
||||
// synchronize access to console
|
||||
CTSingleLock slConsole(&con_csConsole, TRUE);
|
||||
|
||||
// allocate the buffer
|
||||
con_ctCharsPerLine = ctCharsPerLine;
|
||||
con_ctLines = ctLines;
|
||||
con_ctLinesPrinted = 0;
|
||||
// note: we add +1 for '\n' perline and +1 '\0' at the end of buffer
|
||||
con_strBuffer = (char *)AllocMemory((ctCharsPerLine+1)*ctLines+1);
|
||||
con_strLineBuffer = (char *)AllocMemory(ctCharsPerLine+2); // includes '\n' and '\0'
|
||||
con_atmLines = (TIME*)AllocMemory((ctLines+1)*sizeof(TIME));
|
||||
// make it empty
|
||||
for(INDEX iLine=0; iLine<ctLines; iLine++) {
|
||||
ClearLine(iLine);
|
||||
}
|
||||
// add string terminator at the end
|
||||
con_strBuffer[(ctCharsPerLine+1)*ctLines] = 0;
|
||||
|
||||
// start printing in last line
|
||||
con_strLastLine = con_strBuffer+(ctCharsPerLine+1)*(ctLines-1);
|
||||
con_strCurrent = con_strLastLine;
|
||||
|
||||
// open console file
|
||||
con_fLog = fopen(fnmLog, "wt");
|
||||
|
||||
if (con_fLog==NULL) {
|
||||
FatalError("%s", strerror(errno));
|
||||
}
|
||||
|
||||
// print one dummy line on start
|
||||
CPrintF("\n");
|
||||
}
|
||||
|
||||
// Get current console buffer.
|
||||
const char *CConsole::GetBuffer(void)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return "";
|
||||
}
|
||||
return con_strBuffer+(con_ctLines-con_ctLinesPrinted)*(con_ctCharsPerLine+1);
|
||||
}
|
||||
INDEX CConsole::GetBufferSize(void)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return 1;
|
||||
}
|
||||
return (con_ctCharsPerLine+1)*con_ctLines+1;
|
||||
}
|
||||
|
||||
// Discard timing info for last lines
|
||||
void CConsole::DiscardLastLineTimes(void)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return;
|
||||
}
|
||||
for(INDEX i=0; i<con_ctLines; i++) {
|
||||
con_atmLines[i] = -10000.0f;
|
||||
}
|
||||
}
|
||||
|
||||
// Get number of lines newer than given time
|
||||
INDEX CConsole::NumberOfLinesAfter(TIME tmLast)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return 0;
|
||||
}
|
||||
// clamp console variable
|
||||
con_iLastLines = Clamp( con_iLastLines, 0L, (INDEX)CONSOLE_MAXLASTLINES);
|
||||
// find number of last console lines to be displayed on screen
|
||||
for(INDEX i=0; i<con_iLastLines; i++) {
|
||||
if (con_atmLines[con_ctLines-1-i]<tmLast) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return con_iLastLines;
|
||||
}
|
||||
|
||||
// Get one of last lines
|
||||
CTString CConsole::GetLastLine(INDEX iLine)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return "";
|
||||
}
|
||||
if (iLine>=con_ctLinesPrinted) {
|
||||
return "";
|
||||
}
|
||||
ASSERT(iLine>=0 && iLine<con_ctLines);
|
||||
// get line number from the start of buffer
|
||||
iLine = con_ctLines-1-iLine;
|
||||
// copy line
|
||||
memcpy(con_strLineBuffer, con_strBuffer+iLine*(con_ctCharsPerLine+1), con_ctCharsPerLine);
|
||||
// put terminator at the end
|
||||
con_strLineBuffer[con_ctCharsPerLine] = 0;
|
||||
// return it
|
||||
return con_strLineBuffer;
|
||||
}
|
||||
|
||||
// clear one given line in buffer
|
||||
void CConsole::ClearLine(INDEX iLine)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return;
|
||||
}
|
||||
// line must be valid
|
||||
ASSERT(iLine>=0 && iLine<con_ctLines);
|
||||
// get start of line
|
||||
char *pchLine = con_strBuffer+iLine*(con_ctCharsPerLine+1);
|
||||
// fill it with spaces
|
||||
memset(pchLine, ' ', con_ctCharsPerLine);
|
||||
// add return at the end of line
|
||||
pchLine[con_ctCharsPerLine] = '\n';
|
||||
con_atmLines[iLine] = _pTimer!=NULL?_pTimer->GetRealTimeTick():0.0f;
|
||||
}
|
||||
|
||||
// scroll buffer up, discarding lines at the start
|
||||
void CConsole::ScrollBufferUp(INDEX ctLines)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return;
|
||||
}
|
||||
ASSERT(ctLines>0 && ctLines<con_ctLines);
|
||||
// move buffer up
|
||||
memmove(
|
||||
con_strBuffer,
|
||||
con_strBuffer+ctLines*(con_ctCharsPerLine+1),
|
||||
(con_ctLines-ctLines)*(con_ctCharsPerLine+1));
|
||||
// move buffer up
|
||||
memmove(
|
||||
con_atmLines,
|
||||
con_atmLines+ctLines,
|
||||
(con_ctLines-ctLines)*sizeof(TIME));
|
||||
con_ctLinesPrinted = ClampUp(con_ctLinesPrinted+1L, con_ctLines);
|
||||
// clear lines at the end
|
||||
for(INDEX iLine=con_ctLines-ctLines; iLine<con_ctLines; iLine++) {
|
||||
ClearLine(iLine);
|
||||
}
|
||||
}
|
||||
|
||||
// Add a line of text to console
|
||||
void CConsole::PutString(const char *strString)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return;
|
||||
}
|
||||
// synchronize access to console
|
||||
CTSingleLock slConsole(&con_csConsole, TRUE);
|
||||
|
||||
// if in debug version, report it to output window
|
||||
_RPT1(_CRT_WARN, "%s", strString);
|
||||
// first append that string to the console output file
|
||||
if (con_fLog!=NULL) {
|
||||
fprintf(con_fLog, "%s", strString);
|
||||
fflush(con_fLog);
|
||||
}
|
||||
// if needed, append to capture string
|
||||
if (con_bCapture) {
|
||||
con_strCapture+=strString;
|
||||
}
|
||||
|
||||
// if dedicated server
|
||||
extern BOOL _bDedicatedServer;
|
||||
if (_bDedicatedServer) {
|
||||
// print to output
|
||||
printf("%s", strString);
|
||||
}
|
||||
|
||||
// start at the beginning of the string
|
||||
const char *pch=strString;
|
||||
// while not end of string
|
||||
while(*pch!=0) {
|
||||
// if line buffer full
|
||||
if (con_strCurrent==con_strLastLine+con_ctCharsPerLine) {
|
||||
// move buffer up
|
||||
ScrollBufferUp(1);
|
||||
// restart new line
|
||||
con_strCurrent=con_strLastLine;
|
||||
}
|
||||
// get char
|
||||
char c = *pch++;
|
||||
// skip cr
|
||||
if (c=='\r') {
|
||||
continue;
|
||||
}
|
||||
// if it is end of line
|
||||
if (c=='\n') {
|
||||
// move buffer up
|
||||
ScrollBufferUp(1);
|
||||
// restart new line
|
||||
con_strCurrent=con_strLastLine;
|
||||
continue;
|
||||
}
|
||||
// otherwise, add the char to buffer
|
||||
*con_strCurrent++ = c;
|
||||
}
|
||||
}
|
||||
|
||||
// Close console log file buffers (call only when force-exiting!)
|
||||
void CConsole::CloseLog(void)
|
||||
{
|
||||
if (this==NULL) {
|
||||
return;
|
||||
}
|
||||
if (con_fLog!=NULL) {
|
||||
fclose(con_fLog);
|
||||
}
|
||||
con_fLog = NULL;
|
||||
}
|
||||
|
||||
// Print formated text to the main console.
|
||||
extern void CPrintF(const char *strFormat, ...)
|
||||
{
|
||||
if (_pConsole==NULL) {
|
||||
return;
|
||||
}
|
||||
// format the message in buffer
|
||||
va_list arg;
|
||||
va_start(arg, strFormat);
|
||||
CTString strBuffer;
|
||||
strBuffer.VPrintF(strFormat, arg);
|
||||
|
||||
// print it to the main console
|
||||
_pConsole->PutString(strBuffer);
|
||||
}
|
||||
|
||||
// Add a string of text to console
|
||||
void CPutString(const char *strString)
|
||||
{
|
||||
if (_pConsole==NULL) {
|
||||
return;
|
||||
}
|
||||
_pConsole->PutString(strString);
|
||||
}
|
||||
|
||||
// Get number of lines newer than given time
|
||||
INDEX CON_NumberOfLinesAfter(TIME tmLast)
|
||||
{
|
||||
if (_pConsole==NULL) {
|
||||
return 0;
|
||||
}
|
||||
return _pConsole->NumberOfLinesAfter(tmLast);
|
||||
}
|
||||
// Get one of last lines
|
||||
CTString CON_GetLastLine(INDEX iLine)
|
||||
{
|
||||
if (_pConsole==NULL) {
|
||||
return "";
|
||||
}
|
||||
return _pConsole->GetLastLine(iLine);
|
||||
}
|
||||
// Discard timing info for last lines
|
||||
void CON_DiscardLastLineTimes(void)
|
||||
{
|
||||
if (_pConsole==NULL) {
|
||||
return;
|
||||
}
|
||||
_pConsole->DiscardLastLineTimes();
|
||||
}
|
||||
// Get current console buffer.
|
||||
const char *CON_GetBuffer(void)
|
||||
{
|
||||
if (_pConsole==NULL) {
|
||||
return "";
|
||||
}
|
||||
return _pConsole->GetBuffer();
|
||||
}
|
||||
INDEX CON_GetBufferSize(void)
|
||||
{
|
||||
if (_pConsole==NULL) {
|
||||
return 1;
|
||||
}
|
||||
return _pConsole->GetBufferSize();
|
||||
}
|
26
Sources/Engine/Base/Console.h
Normal file
26
Sources/Engine/Base/Console.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#ifndef SE_INCL_CONSOLE_H
|
||||
#define SE_INCL_CONSOLE_H
|
||||
#ifdef PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Print formated text to the main console.
|
||||
ENGINE_API extern void CPrintF(const char *strFormat, ...);
|
||||
// Add a string of text to console
|
||||
ENGINE_API void CPutString(const char *strString);
|
||||
|
||||
// Get number of lines newer than given time
|
||||
ENGINE_API INDEX CON_NumberOfLinesAfter(TIME tmLast);
|
||||
// Get one of last lines
|
||||
ENGINE_API CTString CON_GetLastLine(INDEX iLine);
|
||||
// Discard timing info for last lines
|
||||
ENGINE_API void CON_DiscardLastLineTimes(void);
|
||||
// Get current console buffer.
|
||||
ENGINE_API const char *CON_GetBuffer(void);
|
||||
ENGINE_API INDEX CON_GetBufferSize(void);
|
||||
|
||||
|
||||
#endif /* include-once check. */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user