Original 1.0.5 code
(as received from Jonas Echterhoff)
This commit is contained in:
Binary file not shown.
Executable
+245
@@ -0,0 +1,245 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>1035</key>
|
||||
<dict>
|
||||
<key>25907</key>
|
||||
<dict>
|
||||
<key>3</key>
|
||||
<string>Left Button</string>
|
||||
<key>4</key>
|
||||
<string>Right Button</string>
|
||||
<key>5</key>
|
||||
<string>Small Left Button</string>
|
||||
<key>6</key>
|
||||
<string>Small Right Button</string>
|
||||
<key>7</key>
|
||||
<string>X-Axis</string>
|
||||
<key>8</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>Name</key>
|
||||
<string>Competition Pro</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>MOSIC</string>
|
||||
</dict>
|
||||
<key>1118</key>
|
||||
<dict>
|
||||
<key>27</key>
|
||||
<dict>
|
||||
<key>27</key>
|
||||
<string>Button 1 [Trigger]</string>
|
||||
<key>28</key>
|
||||
<string>Button 2</string>
|
||||
<key>29</key>
|
||||
<string>Button 3</string>
|
||||
<key>30</key>
|
||||
<string>Button 4</string>
|
||||
<key>31</key>
|
||||
<string>Button 5</string>
|
||||
<key>32</key>
|
||||
<string>Button 6</string>
|
||||
<key>33</key>
|
||||
<string>Button 7</string>
|
||||
<key>34</key>
|
||||
<string>Button 8</string>
|
||||
<key>89</key>
|
||||
<string>X-Axis</string>
|
||||
<key>90</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>91</key>
|
||||
<string>Rz-Axis</string>
|
||||
<key>92</key>
|
||||
<string>Throttle</string>
|
||||
<key>93</key>
|
||||
<string>Hat Switch</string>
|
||||
<key>Name</key>
|
||||
<string>SideWinder FFB 2 Joystick</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Microsoft</string>
|
||||
</dict>
|
||||
<key>1133</key>
|
||||
<dict>
|
||||
<key>49797</key>
|
||||
<dict>
|
||||
<key>10</key>
|
||||
<string>Button 6</string>
|
||||
<key>11</key>
|
||||
<string>Button 7</string>
|
||||
<key>16</key>
|
||||
<string>Hat Switch 2</string>
|
||||
<key>24</key>
|
||||
<string>X-Axis</string>
|
||||
<key>25</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>26</key>
|
||||
<string>Hat Switch 1</string>
|
||||
<key>27</key>
|
||||
<string>Rz-Axis</string>
|
||||
<key>28</key>
|
||||
<string>Throttle</string>
|
||||
<key>29</key>
|
||||
<string>Button 9</string>
|
||||
<key>30</key>
|
||||
<string>Button 8</string>
|
||||
<key>5</key>
|
||||
<string>Button 1 [Trigger]</string>
|
||||
<key>6</key>
|
||||
<string>Button 2</string>
|
||||
<key>7</key>
|
||||
<string>Button 3</string>
|
||||
<key>8</key>
|
||||
<string>Button 4</string>
|
||||
<key>9</key>
|
||||
<string>Button 5</string>
|
||||
<key>Name</key>
|
||||
<string>WingMan Strike Force 3D</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Logitech</string>
|
||||
</dict>
|
||||
<key>1635</key>
|
||||
<dict>
|
||||
<key>38916</key>
|
||||
<dict>
|
||||
<key>10</key>
|
||||
<string>R2 Trigger</string>
|
||||
<key>11</key>
|
||||
<string>Right Stick X-Axis</string>
|
||||
<key>12</key>
|
||||
<string>Right Stick Y-Axis</string>
|
||||
<key>13</key>
|
||||
<string>Left Stick X-Axis</string>
|
||||
<key>14</key>
|
||||
<string>Left Stick Y-Axis</string>
|
||||
<key>15</key>
|
||||
<string>Hat Switch</string>
|
||||
<key>3</key>
|
||||
<string>Button 1</string>
|
||||
<key>4</key>
|
||||
<string>Button 2</string>
|
||||
<key>5</key>
|
||||
<string>Button 3</string>
|
||||
<key>6</key>
|
||||
<string>Button 4</string>
|
||||
<key>7</key>
|
||||
<string>L1 Trigger</string>
|
||||
<key>8</key>
|
||||
<string>R1 Trigger</string>
|
||||
<key>9</key>
|
||||
<string>L2 Trigger</string>
|
||||
<key>Name</key>
|
||||
<string>FunPad F-107</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Macsense</string>
|
||||
</dict>
|
||||
<key>8738</key>
|
||||
<dict>
|
||||
<key>16400</key>
|
||||
<dict>
|
||||
<key>10</key>
|
||||
<string>Left Button</string>
|
||||
<key>11</key>
|
||||
<string>C Button</string>
|
||||
<key>12</key>
|
||||
<string>B Button [Select]</string>
|
||||
<key>13</key>
|
||||
<string>A Button [Start]</string>
|
||||
<key>14</key>
|
||||
<string>F Button</string>
|
||||
<key>15</key>
|
||||
<string>R1 Trigger</string>
|
||||
<key>16</key>
|
||||
<string>R2 Trigger</string>
|
||||
<key>17</key>
|
||||
<string>L1 Trigger</string>
|
||||
<key>18</key>
|
||||
<string>L2 Trigger</string>
|
||||
<key>19</key>
|
||||
<string>Left Stick Button</string>
|
||||
<key>20</key>
|
||||
<string>Right Stick Button</string>
|
||||
<key>21</key>
|
||||
<string>D Button</string>
|
||||
<key>22</key>
|
||||
<string>E Button</string>
|
||||
<key>23</key>
|
||||
<string>Left Stick X-Axis</string>
|
||||
<key>24</key>
|
||||
<string>Left Stick Y-Axis</string>
|
||||
<key>25</key>
|
||||
<string>Right Stick X-Axis</string>
|
||||
<key>26</key>
|
||||
<string>Right Stick Y-Axis</string>
|
||||
<key>3</key>
|
||||
<string>D-Pad Up</string>
|
||||
<key>4</key>
|
||||
<string>D-Pad Down</string>
|
||||
<key>5</key>
|
||||
<string>D-Pad Left</string>
|
||||
<key>6</key>
|
||||
<string>D-Pad Right</string>
|
||||
<key>7</key>
|
||||
<string>Up Button</string>
|
||||
<key>8</key>
|
||||
<string>Right Button</string>
|
||||
<key>9</key>
|
||||
<string>Down Button</string>
|
||||
<key>Name</key>
|
||||
<string>iShock</string>
|
||||
</dict>
|
||||
<key>16416</key>
|
||||
<dict>
|
||||
<key>10</key>
|
||||
<string>D Button</string>
|
||||
<key>11</key>
|
||||
<string>Button 1</string>
|
||||
<key>12</key>
|
||||
<string>Button 2 [Select]</string>
|
||||
<key>13</key>
|
||||
<string>Button 3 [Start]</string>
|
||||
<key>14</key>
|
||||
<string>R1 Button</string>
|
||||
<key>15</key>
|
||||
<string>R2 Trigger</string>
|
||||
<key>16</key>
|
||||
<string>L1 Trigger</string>
|
||||
<key>17</key>
|
||||
<string>L2 Trigger</string>
|
||||
<key>18</key>
|
||||
<string>Left Stick Button</string>
|
||||
<key>19</key>
|
||||
<string>Right Stick Button</string>
|
||||
<key>20</key>
|
||||
<string>Left Stick X-Axis</string>
|
||||
<key>21</key>
|
||||
<string>Left Stick Y-Axis</string>
|
||||
<key>22</key>
|
||||
<string>Right Stick X-Axis</string>
|
||||
<key>23</key>
|
||||
<string>Right Stick Y-Axis</string>
|
||||
<key>3</key>
|
||||
<string>D-Pad Up</string>
|
||||
<key>4</key>
|
||||
<string>D-Pad Down</string>
|
||||
<key>5</key>
|
||||
<string>D-Pad Left</string>
|
||||
<key>6</key>
|
||||
<string>D-Pad Right</string>
|
||||
<key>7</key>
|
||||
<string>A Button</string>
|
||||
<key>8</key>
|
||||
<string>B Button</string>
|
||||
<key>9</key>
|
||||
<string>C Button</string>
|
||||
<key>Name</key>
|
||||
<string>iShock II</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Macally</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
Executable
+633
@@ -0,0 +1,633 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>1118</key>
|
||||
<dict>
|
||||
<key>26</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>Wheel</string>
|
||||
<key>1:49</key>
|
||||
<string>Left Pedal [Brake]</string>
|
||||
<key>1:50</key>
|
||||
<string>Right Pedal [Gas]</string>
|
||||
<key>9:1</key>
|
||||
<string>Button A</string>
|
||||
<key>9:2</key>
|
||||
<string>Button B</string>
|
||||
<key>9:3</key>
|
||||
<string>Button C</string>
|
||||
<key>9:4</key>
|
||||
<string>Button X</string>
|
||||
<key>9:5</key>
|
||||
<string>Button Y</string>
|
||||
<key>9:6</key>
|
||||
<string>Button Z</string>
|
||||
<key>9:7</key>
|
||||
<string>Left Trigger</string>
|
||||
<key>9:8</key>
|
||||
<string>Right Trigger</string>
|
||||
<key>Name</key>
|
||||
<string>SideWinder Precision Racing Wheel USB v1.0</string>
|
||||
</dict>
|
||||
<key>27</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>1:53</key>
|
||||
<string>Rz-Axis</string>
|
||||
<key>1:54</key>
|
||||
<string>Throttle</string>
|
||||
<key>1:57</key>
|
||||
<string>Hat Switch</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1 [Trigger]</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>Button 5</string>
|
||||
<key>9:6</key>
|
||||
<string>Button 6</string>
|
||||
<key>9:7</key>
|
||||
<string>Button 7</string>
|
||||
<key>9:8</key>
|
||||
<string>Button 8</string>
|
||||
<key>Name</key>
|
||||
<string>SideWinder FFB 2 Joystick</string>
|
||||
</dict>
|
||||
<key>39</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>Button 5</string>
|
||||
<key>9:6</key>
|
||||
<string>Button 6</string>
|
||||
<key>Name</key>
|
||||
<string>SideWinder Plug and Play Game Pad</string>
|
||||
</dict>
|
||||
<key>56</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>1:53</key>
|
||||
<string>Rz-Axis</string>
|
||||
<key>1:54</key>
|
||||
<string>Throttle</string>
|
||||
<key>1:57</key>
|
||||
<string>Hat Switch</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1 [Trigger]</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>Button 5</string>
|
||||
<key>9:6</key>
|
||||
<string>Button 6</string>
|
||||
<key>9:7</key>
|
||||
<string>Button 7</string>
|
||||
<key>9:8</key>
|
||||
<string>Button 8</string>
|
||||
<key>Name</key>
|
||||
<string>SideWinder Precision 2 Joystick</string>
|
||||
</dict>
|
||||
<key>60</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>1:54</key>
|
||||
<string>Throttle</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1 [Trigger]</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>Button 5</string>
|
||||
<key>9:6</key>
|
||||
<string>Button 6</string>
|
||||
<key>9:7</key>
|
||||
<string>Button 7</string>
|
||||
<key>9:8</key>
|
||||
<string>Button 8</string>
|
||||
<key>Name</key>
|
||||
<string>SideWinder Joystick</string>
|
||||
</dict>
|
||||
<key>7</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>9:1</key>
|
||||
<string>Button A</string>
|
||||
<key>9:10</key>
|
||||
<string>Secondary Option 1</string>
|
||||
<key>9:2</key>
|
||||
<string>Button B</string>
|
||||
<key>9:3</key>
|
||||
<string>Button C</string>
|
||||
<key>9:4</key>
|
||||
<string>Button X</string>
|
||||
<key>9:5</key>
|
||||
<string>Button Y</string>
|
||||
<key>9:6</key>
|
||||
<string>Button Z</string>
|
||||
<key>9:7</key>
|
||||
<string>Left Trigger</string>
|
||||
<key>9:8</key>
|
||||
<string>Right Trigger</string>
|
||||
<key>9:9</key>
|
||||
<string>Secondary Option 2</string>
|
||||
<key>Name</key>
|
||||
<string>SideWinder Game Pad USB</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Microsoft</string>
|
||||
</dict>
|
||||
<key>1133</key>
|
||||
<dict>
|
||||
<key>49200</key>
|
||||
<dict>
|
||||
<key>1:1</key>
|
||||
<string>Pointer</string>
|
||||
<key>1:2</key>
|
||||
<string>Mouse</string>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>1:56</key>
|
||||
<string>Wheel</string>
|
||||
<key>9:1</key>
|
||||
<string>Left Button</string>
|
||||
<key>9:2</key>
|
||||
<string>Right Button</string>
|
||||
<key>9:3</key>
|
||||
<string>Middle Button</string>
|
||||
<key>Name</key>
|
||||
<string>iFeel Mouse</string>
|
||||
</dict>
|
||||
<key>49671</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>1:53</key>
|
||||
<string>Rz-Axis</string>
|
||||
<key>1:54</key>
|
||||
<string>Throttle</string>
|
||||
<key>1:57</key>
|
||||
<string>Hat Switch</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1 [Trigger]</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>Button 5</string>
|
||||
<key>9:6</key>
|
||||
<string>Button 6</string>
|
||||
<key>9:7</key>
|
||||
<string>Button 7</string>
|
||||
<key>Name</key>
|
||||
<string>WingMan Extreme Digital 3D</string>
|
||||
</dict>
|
||||
<key>49797</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>1:53</key>
|
||||
<string>Rz-Axis</string>
|
||||
<key>1:54</key>
|
||||
<string>Throttle</string>
|
||||
<key>1:57</key>
|
||||
<string>Hat Switch 1</string>
|
||||
<key>65280:2</key>
|
||||
<string>Thumb Wheel</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1 [Trigger]</string>
|
||||
<key>9:10</key>
|
||||
<string>Hat Switch 2 - Up</string>
|
||||
<key>9:11</key>
|
||||
<string>Hat Switch 2 - Right</string>
|
||||
<key>9:12</key>
|
||||
<string>Hat Switch 2 - Down</string>
|
||||
<key>9:13</key>
|
||||
<string>Hat Switch 2 - Left</string>
|
||||
<key>9:14</key>
|
||||
<string>Hat Switch 2 - Up Right</string>
|
||||
<key>9:15</key>
|
||||
<string>Hat Switch 2 - Down Right</string>
|
||||
<key>9:16</key>
|
||||
<string>Hat Switch 2 - Down Left</string>
|
||||
<key>9:17</key>
|
||||
<string>Hat Switch 2 - Up Left</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>Button 5</string>
|
||||
<key>9:6</key>
|
||||
<string>Button 6</string>
|
||||
<key>9:7</key>
|
||||
<string>Button 7</string>
|
||||
<key>9:8</key>
|
||||
<string>Button 8</string>
|
||||
<key>9:9</key>
|
||||
<string>Button 9</string>
|
||||
<key>Name</key>
|
||||
<string>WingMan Strike Force 3D</string>
|
||||
</dict>
|
||||
<key>49811</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>Wheel</string>
|
||||
<key>1:49</key>
|
||||
<string>Pedals</string>
|
||||
<key>65280:1</key>
|
||||
<string>Left Pedal [Brake]</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>Button 5</string>
|
||||
<key>9:6</key>
|
||||
<string>Button 6</string>
|
||||
<key>Name</key>
|
||||
<string>WingMan Formula Force GP</string>
|
||||
</dict>
|
||||
<key>50433</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>1:56</key>
|
||||
<string>Wheel</string>
|
||||
<key>9:1</key>
|
||||
<string>Left Button</string>
|
||||
<key>9:2</key>
|
||||
<string>Right Button</string>
|
||||
<key>9:3</key>
|
||||
<string>Middle Button</string>
|
||||
<key>Name</key>
|
||||
<string>Cordless Mouse</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Logitech</string>
|
||||
</dict>
|
||||
<key>1149</key>
|
||||
<dict>
|
||||
<key>12293</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>1:50</key>
|
||||
<string>Throttle</string>
|
||||
<key>1:57</key>
|
||||
<string>Hat Switch</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1 [Trigger]</string>
|
||||
<key>9:10</key>
|
||||
<string>Button 10 [Thumb Wheel Right]</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>Button 5</string>
|
||||
<key>9:6</key>
|
||||
<string>Button 6 [Thumb Wheel Button]</string>
|
||||
<key>9:7</key>
|
||||
<string>Button 7</string>
|
||||
<key>9:8</key>
|
||||
<string>Button 8</string>
|
||||
<key>9:9</key>
|
||||
<string>Button 9 [Thumb Wheel Left]</string>
|
||||
<key>Name</key>
|
||||
<string>Eliminator Precision Pro Joystick</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Gravis</string>
|
||||
</dict>
|
||||
<key>1293</key>
|
||||
<dict>
|
||||
<key>2051</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>Left Stick X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Left Stick Y-Axis</string>
|
||||
<key>1:50</key>
|
||||
<string>Right Stick Y-Axis</string>
|
||||
<key>1:53</key>
|
||||
<string>Right Stick X-Axis</string>
|
||||
<key>1:57</key>
|
||||
<string>Direction Pad</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1</string>
|
||||
<key>9:10</key>
|
||||
<string>Mouse</string>
|
||||
<key>9:11</key>
|
||||
<string>Eater</string>
|
||||
<key>9:12</key>
|
||||
<string>Right Stick Button</string>
|
||||
<key>9:13</key>
|
||||
<string>Left Stick Button</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>Left Top Trigger</string>
|
||||
<key>9:6</key>
|
||||
<string>Left Bottom Trigger</string>
|
||||
<key>9:7</key>
|
||||
<string>Right Top Trigger</string>
|
||||
<key>9:8</key>
|
||||
<string>Right Bottom Trigger</string>
|
||||
<key>9:9</key>
|
||||
<string>ESC</string>
|
||||
<key>Name</key>
|
||||
<string>Nostromo n45</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Belkin</string>
|
||||
</dict>
|
||||
<key>1452</key>
|
||||
<dict>
|
||||
<key>516</key>
|
||||
<dict>
|
||||
<key>1:6</key>
|
||||
<string>Keyboard</string>
|
||||
<key>Name</key>
|
||||
<string>Apple Extended USB Keyboard</string>
|
||||
</dict>
|
||||
<key>770</key>
|
||||
<dict>
|
||||
<key>1:1</key>
|
||||
<string>Pointer</string>
|
||||
<key>1:2</key>
|
||||
<string>Mouse</string>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>9:1</key>
|
||||
<string>Button</string>
|
||||
<key>Name</key>
|
||||
<string>Apple Optical USB Mouse</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Mitsumi Electric</string>
|
||||
</dict>
|
||||
<key>1635</key>
|
||||
<dict>
|
||||
<key>38916</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>Left Stick X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Left Stick Y-Axis</string>
|
||||
<key>1:57</key>
|
||||
<string>Hat Switch</string>
|
||||
<key>2:186</key>
|
||||
<string>Right Stick X-Axis</string>
|
||||
<key>2:187</key>
|
||||
<string>Right Stick Y-Axis</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>9:5</key>
|
||||
<string>L1 Trigger</string>
|
||||
<key>9:6</key>
|
||||
<string>R1 Trigger</string>
|
||||
<key>9:7</key>
|
||||
<string>L2 Trigger</string>
|
||||
<key>9:8</key>
|
||||
<string>R2 Trigger</string>
|
||||
<key>Name</key>
|
||||
<string>FunPad F-107</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Macsense</string>
|
||||
</dict>
|
||||
<key>1699</key>
|
||||
<dict>
|
||||
<key>65284</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>Wheel</string>
|
||||
<key>1:49</key>
|
||||
<string>Left Pedal [Brake]</string>
|
||||
<key>1:50</key>
|
||||
<string>Right Pedal [Gas]</string>
|
||||
<key>9:1</key>
|
||||
<string>Top Left Thumb</string>
|
||||
<key>9:2</key>
|
||||
<string>Top Right Thumb</string>
|
||||
<key>9:3</key>
|
||||
<string>Bottom Left Thumb</string>
|
||||
<key>9:4</key>
|
||||
<string>Bottom Right Thumb</string>
|
||||
<key>9:5</key>
|
||||
<string>Right Horn</string>
|
||||
<key>9:6</key>
|
||||
<string>Left Horn</string>
|
||||
<key>Name</key>
|
||||
<string>R440 Force Feedback</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Saitek</string>
|
||||
</dict>
|
||||
<key>1973</key>
|
||||
<dict>
|
||||
<key>39169</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Y-Axis</string>
|
||||
<key>1:54</key>
|
||||
<string>Throttle</string>
|
||||
<key>1:57</key>
|
||||
<string>Hat Switch</string>
|
||||
<key>9:1</key>
|
||||
<string>Button 1 [Trigger]</string>
|
||||
<key>9:2</key>
|
||||
<string>Button 2</string>
|
||||
<key>9:3</key>
|
||||
<string>Button 3</string>
|
||||
<key>9:4</key>
|
||||
<string>Button 4</string>
|
||||
<key>Name</key>
|
||||
<string>X8-33GU 2 IN 1 Joystick</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Saitek</string>
|
||||
</dict>
|
||||
<key>8738</key>
|
||||
<dict>
|
||||
<key>16400</key>
|
||||
<dict>
|
||||
<key>1:48</key>
|
||||
<string>Left Stick X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Left Stick Y-Axis</string>
|
||||
<key>1:53</key>
|
||||
<string>Right Stick X-Axis</string>
|
||||
<key>1:54</key>
|
||||
<string>Right Stick Y-Axis</string>
|
||||
<key>9:1</key>
|
||||
<string>D-Pad Up</string>
|
||||
<key>9:10</key>
|
||||
<string>Button B [Select]</string>
|
||||
<key>9:11</key>
|
||||
<string>Button A [Start]</string>
|
||||
<key>9:12</key>
|
||||
<string>Button F</string>
|
||||
<key>9:13</key>
|
||||
<string>R1 Trigger</string>
|
||||
<key>9:14</key>
|
||||
<string>R2 Trigger</string>
|
||||
<key>9:15</key>
|
||||
<string>L1 Trigger</string>
|
||||
<key>9:16</key>
|
||||
<string>L2 Trigger</string>
|
||||
<key>9:17</key>
|
||||
<string>Left Stick Button</string>
|
||||
<key>9:18</key>
|
||||
<string>Right Stick Button</string>
|
||||
<key>9:19</key>
|
||||
<string>D Button</string>
|
||||
<key>9:2</key>
|
||||
<string>D-Pad Down</string>
|
||||
<key>9:20</key>
|
||||
<string>E Button</string>
|
||||
<key>9:3</key>
|
||||
<string>D-Pad Left</string>
|
||||
<key>9:4</key>
|
||||
<string>D-Pad Right</string>
|
||||
<key>9:5</key>
|
||||
<string>Button 5 (Triangle)</string>
|
||||
<key>9:6</key>
|
||||
<string>Button 6 (Circle)</string>
|
||||
<key>9:7</key>
|
||||
<string>Button 7 (Cross)</string>
|
||||
<key>9:8</key>
|
||||
<string>Button 8 (Square)</string>
|
||||
<key>9:9</key>
|
||||
<string>Button C</string>
|
||||
<key>Name</key>
|
||||
<string>iShock</string>
|
||||
</dict>
|
||||
<key>16416</key>
|
||||
<dict>
|
||||
<key>1:1</key>
|
||||
<string>Pointer</string>
|
||||
<key>1:48</key>
|
||||
<string>Left Stick X-Axis</string>
|
||||
<key>1:49</key>
|
||||
<string>Left Stick Y-Axis</string>
|
||||
<key>1:5</key>
|
||||
<string>GamePad</string>
|
||||
<key>1:53</key>
|
||||
<string>Right Stick X-Axis</string>
|
||||
<key>1:54</key>
|
||||
<string>Right Stick Y-Axis</string>
|
||||
<key>9:1</key>
|
||||
<string>D-Pad Up</string>
|
||||
<key>9:10</key>
|
||||
<string>Button 2 [Select]</string>
|
||||
<key>9:11</key>
|
||||
<string>Button 3 [Start]</string>
|
||||
<key>9:12</key>
|
||||
<string>R1 Button</string>
|
||||
<key>9:13</key>
|
||||
<string>R2 Trigger</string>
|
||||
<key>9:14</key>
|
||||
<string>L1 Trigger</string>
|
||||
<key>9:15</key>
|
||||
<string>L2 Trigger</string>
|
||||
<key>9:16</key>
|
||||
<string>Left Stick Button</string>
|
||||
<key>9:17</key>
|
||||
<string>Right Stick Button</string>
|
||||
<key>9:2</key>
|
||||
<string>D-Pad Down</string>
|
||||
<key>9:3</key>
|
||||
<string>D-Pad Left</string>
|
||||
<key>9:4</key>
|
||||
<string>D-Pad Right</string>
|
||||
<key>9:5</key>
|
||||
<string>A Button</string>
|
||||
<key>9:6</key>
|
||||
<string>B Button</string>
|
||||
<key>9:7</key>
|
||||
<string>C Button</string>
|
||||
<key>9:8</key>
|
||||
<string>D Button</string>
|
||||
<key>9:9</key>
|
||||
<string>Button 1</string>
|
||||
<key>Name</key>
|
||||
<string>iShock II</string>
|
||||
</dict>
|
||||
<key>Name</key>
|
||||
<string>Macally</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
Executable
+200
@@ -0,0 +1,200 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>0x0001</key>
|
||||
<dict>
|
||||
<key>Name</key> <string>Generic Desktop</string>
|
||||
<key>0x0001</key> <string>Pointer</string>
|
||||
<key>0x0002</key> <string>Mouse</string>
|
||||
<key>0x0004</key> <string>Joystick</string>
|
||||
<key>0x0005</key> <string>GamePad</string>
|
||||
<key>0x0006</key> <string>Keyboard</string>
|
||||
<key>0x0007</key> <string>Keypad</string>
|
||||
<key>0x0008</key> <string>MultiAxisController</string>
|
||||
<key>0x0030</key> <string>X</string>
|
||||
<key>0x0031</key> <string>Y</string>
|
||||
<key>0x0032</key> <string>Z</string>
|
||||
<key>0x0033</key> <string>Rx</string>
|
||||
<key>0x0034</key> <string>Ry</string>
|
||||
<key>0x0035</key> <string>Rz</string>
|
||||
<key>0x0036</key> <string>Slider</string>
|
||||
<key>0x0037</key> <string>Dial</string>
|
||||
<key>0x0038</key> <string>Wheel</string>
|
||||
<key>0x0039</key> <string>Hatswitch</string>
|
||||
<key>0x003A</key> <string>Counted Buffer</string>
|
||||
<key>0x003B</key> <string>Byte Count</string>
|
||||
<key>0x003C</key> <string>Motion Wakeup</string>
|
||||
<key>0x003D</key> <string>Start</string>
|
||||
<key>0x003E</key> <string>Select</string>
|
||||
<key>0x0040</key> <string>Vx</string>
|
||||
<key>0x0041</key> <string>Vy</string>
|
||||
<key>0x0042</key> <string>Vz</string>
|
||||
<key>0x0043</key> <string>Vbrx</string>
|
||||
<key>0x0044</key> <string>Vbry</string>
|
||||
<key>0x0045</key> <string>Vbrz</string>
|
||||
<key>0x0046</key> <string>Vno</string>
|
||||
<key>0x0080</key> <string>System Control</string>
|
||||
<key>0x0081</key> <string>System Power Down</string>
|
||||
<key>0x0082</key> <string>System Sleep</string>
|
||||
<key>0x0083</key> <string>System Wake Up</string>
|
||||
<key>0x0084</key> <string>SystemContext Menu</string>
|
||||
<key>0x0085</key> <string>System Main Menu</string>
|
||||
<key>0x0086</key> <string>System App Menu</string>
|
||||
<key>0x0087</key> <string>System Menu help</string>
|
||||
<key>0x0088</key> <string>System Menu Exit</string>
|
||||
<key>0x0089</key> <string>System Menu</string>
|
||||
<key>0x008A</key> <string>System Menu Right</string>
|
||||
<key>0x008B</key> <string>System Menu Left</string>
|
||||
<key>0x008C</key> <string>System Menu Up</string>
|
||||
<key>0x008D</key> <string>System Menu Down</string>
|
||||
<key>0x0090</key> <string>DPad Up</string>
|
||||
<key>0x0091</key> <string>DPad Down</string>
|
||||
<key>0x0092</key> <string>DPad Right</string>
|
||||
<key>0x0093</key> <string>DPad Left</string>
|
||||
</dict>
|
||||
<key>0x0002</key>
|
||||
<dict>
|
||||
<key>Name</key> <string>Simulation</string>
|
||||
<key>0x0001</key> <string>Flight Simulation Device</string>
|
||||
<key>0x0002</key> <string>Automobile Simulation Device</string>
|
||||
<key>0x0003</key> <string>Tank Simulation Device</string>
|
||||
<key>0x0004</key> <string>Spaceship Simulation Device</string>
|
||||
<key>0x0005</key> <string>Submarine Simulation Device</string>
|
||||
<key>0x0006</key> <string>Sailing Simulation Device</string>
|
||||
<key>0x0007</key> <string>Motorcycle Simulation Device</string>
|
||||
<key>0x0008</key> <string>Sports Simulation Device</string>
|
||||
<key>0x0009</key> <string>Airplane Simulation Device</string>
|
||||
<key>0x000A</key> <string>Helicopter Simulation Device</string>
|
||||
<key>0x000B</key> <string>Magic Carpet Simulation Device</string>
|
||||
<key>0x000C</key> <string>Bicycle Simulation Device</string>
|
||||
<key>0x0020</key> <string>Flight Control Stick</string>
|
||||
<key>0x0021</key> <string>Flight Stick</string>
|
||||
<key>0x0022</key> <string>Cyclic Control</string>
|
||||
<key>0x0023</key> <string>Cyclic Trim</string>
|
||||
<key>0x0024</key> <string>Flight Yoke</string>
|
||||
<key>0x0025</key> <string>Track Control</string>
|
||||
<key>0x00B0</key> <string>Aileron</string>
|
||||
<key>0x00B1</key> <string>Aileron Trim</string>
|
||||
<key>0x00B2</key> <string>Anti Torque Control</string>
|
||||
<key>0x00B5</key> <string>Collective Control</string>
|
||||
<key>0x00B6</key> <string>Dive Brake</string>
|
||||
<key>0x00B7</key> <string>Electronic Countermeasures</string>
|
||||
<key>0x00B8</key> <string>Elevator</string>
|
||||
<key>0x00B9</key> <string>Elevator Trim</string>
|
||||
<key>0x00BA</key> <string>Rudder</string>
|
||||
<key>0x00BB</key> <string>Throttle</string>
|
||||
<key>0x00BC</key> <string>Flight Communications</string>
|
||||
<key>0x00BD</key> <string>Flare Release</string>
|
||||
<key>0x00BE</key> <string>Landing Gear</string>
|
||||
<key>0x00BF</key> <string>Toe Brake</string>
|
||||
<key>0x00C0</key> <string>Trigger</string>
|
||||
<key>0x00C1</key> <string>Weapons Arm</string>
|
||||
<key>0x00C2</key> <string>Weapons</string>
|
||||
<key>0x00C3</key> <string>Wing Flaps</string>
|
||||
<key>0x00C4</key> <string>Accelerator</string>
|
||||
<key>0x00C5</key> <string>Brake</string>
|
||||
<key>0x00C6</key> <string>Clutch</string>
|
||||
<key>0x00C7</key> <string>Shifter</string>
|
||||
<key>0x00C8</key> <string>Steering</string>
|
||||
<key>0x00C9</key> <string>Turret Direction</string>
|
||||
<key>0x00CA</key> <string>Barrel Elevation</string>
|
||||
<key>0x00CB</key> <string>Dive Plane</string>
|
||||
<key>0x00CC</key> <string>Ballast</string>
|
||||
<key>0x00CD</key> <string>Bicycle Crank</string>
|
||||
<key>0x00CE</key> <string>Handle Bars</string>
|
||||
<key>0x00CF</key> <string>Front Brake</string>
|
||||
<key>0x00D0</key> <string>Rear Brake</string>
|
||||
</dict>
|
||||
<key>0x0003</key>
|
||||
<dict>
|
||||
<key>Name</key> <string>Virtual Reality</string>
|
||||
<key>0x0001</key> <string>Belt</string>
|
||||
<key>0x0002</key> <string>Body Suit</string>
|
||||
<key>0x0003</key> <string>Flexor</string>
|
||||
<key>0x0004</key> <string>Glove</string>
|
||||
<key>0x0005</key> <string>Head Tracker</string>
|
||||
<key>0x0006</key> <string>Head Mounted Display</string>
|
||||
<key>0x0007</key> <string>Hand Tracker</string>
|
||||
<key>0x0008</key> <string>Oculometer</string>
|
||||
<key>0x0009</key> <string>Vest</string>
|
||||
<key>0x000A</key> <string>Animatronic Device</string>
|
||||
<key>0x0020</key> <string>Stereo Enable</string>
|
||||
<key>0x0021</key> <string>Display Enable</string>
|
||||
</dict>
|
||||
<key>0x0004</key>
|
||||
<dict>
|
||||
<key>Name</key> <string>Sport</string>
|
||||
<key>0x0001</key> <string>Baseball Bat</string>
|
||||
<key>0x0002</key> <string>Golf Club</string>
|
||||
<key>0x0003</key> <string>Rowing Machine</string>
|
||||
<key>0x0004</key> <string>Treadmill</string>
|
||||
|
||||
<key>0x0030</key> <string>Oar</string>
|
||||
<key>0x0031</key> <string>Slope</string>
|
||||
<key>0x0032</key> <string>Rate</string>
|
||||
<key>0x0033</key> <string>Stick Speed</string>
|
||||
<key>0x0034</key> <string>Stick Face Angle</string>
|
||||
<key>0x0035</key> <string>Stick Heel Or Toe</string>
|
||||
<key>0x0036</key> <string>Stick Follow Through</string>
|
||||
<key>0x0037</key> <string>Stick Tempo</string>
|
||||
<key>0x0038</key> <string>Stick Type</string>
|
||||
<key>0x0039</key> <string>Stick Height</string>
|
||||
|
||||
<key>0x0050</key> <string>Putter</string>
|
||||
<key>0x0051</key> <string>1 Iron</string>
|
||||
<key>0x0052</key> <string>2 Iron</string>
|
||||
<key>0x0053</key> <string>3 Iron</string>
|
||||
<key>0x0054</key> <string>4 Iron</string>
|
||||
<key>0x0055</key> <string>5 Iron</string>
|
||||
<key>0x0056</key> <string>6 Iron</string>
|
||||
<key>0x0057</key> <string>7 Iron</string>
|
||||
<key>0x0058</key> <string>8 Iron</string>
|
||||
<key>0x0059</key> <string>9 Iron</string>
|
||||
<key>0x005A</key> <string>10 Iron</string>
|
||||
<key>0x005B</key> <string>11 Iron</string>
|
||||
<key>0x005C</key> <string>Sand Wedge</string>
|
||||
<key>0x005D</key> <string>Loft Wedge</string>
|
||||
<key>0x005E</key> <string>Power Wedge</string>
|
||||
<key>0x005F</key> <string>1 Wood</string>
|
||||
<key>0x0060</key> <string>3 Wood</string>
|
||||
<key>0x0061</key> <string>5 Wood</string>
|
||||
<key>0x0062</key> <string>7 Wood</string>
|
||||
<key>0x0063</key> <string>9 Wood</string>
|
||||
</dict>
|
||||
<key>0x0005</key>
|
||||
<dict>
|
||||
<key>Name</key> <string>Game</string>
|
||||
<key>0x0001</key> <string>3D Game Controller</string>
|
||||
<key>0x0002</key> <string>Pinball Device</string>
|
||||
<key>0x0003</key> <string>Gun</string>
|
||||
|
||||
<key>0x0020</key> <string>Point of View</string>
|
||||
<key>0x0021</key> <string>Turn Right Or Left</string>
|
||||
<key>0x0022</key> <string>Pitch Up Or Down</string>
|
||||
<key>0x0023</key> <string>Roll Right Or Left</string>
|
||||
<key>0x0024</key> <string>Move Right Or Left</string>
|
||||
<key>0x0025</key> <string>Move Forward Or Backward</string>
|
||||
<key>0x0026</key> <string>Move Up Or Down</string>
|
||||
<key>0x0027</key> <string>Lean Right Or Left</string>
|
||||
<key>0x0029</key> <string>Lean Forward Or Backward</string>
|
||||
<key>0x0029</key> <string>Height Of POV</string>
|
||||
<key>0x002A</key> <string>Flipper</string>
|
||||
<key>0x002B</key> <string>Secondary Flipper</string>
|
||||
<key>0x002C</key> <string>Bump</string>
|
||||
<key>0x002D</key> <string>New Game</string>
|
||||
<key>0x002E</key> <string>Shoot Ball</string>
|
||||
<key>0x002F</key> <string>Player</string>
|
||||
|
||||
<key>0x0030</key> <string>Gun Bolt</string>
|
||||
<key>0x0031</key> <string>Gun Clip</string>
|
||||
<key>0x0032</key> <string>Gun</string>
|
||||
<key>0x0033</key> <string>Gun Single Shot</string>
|
||||
<key>0x0034</key> <string>Gun Burst</string>
|
||||
<key>0x0035</key> <string>Gun Automatic</string>
|
||||
<key>0x0036</key> <string>Gun Safety</string>
|
||||
<key>0x0037</key> <string>Gamepad Fire Or Jump</string>
|
||||
<key>0x0039</key> <string>Gamepad Trigger</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
+293
@@ -0,0 +1,293 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleOSTypes</key>
|
||||
<array>
|
||||
<string>PACK</string>
|
||||
</array>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>redplug</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>Plugin.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Redline Plugin</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSIsAppleDefaultForType</key>
|
||||
<true/>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>com.ambrosiasw.redline.plugin</string>
|
||||
</array>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Redline</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Redline version 1.0.5, ©2003-2008 Ambrosia Software</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Redline</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.ambrosiasw.redline</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>Redline 1.0.5</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>GLrc</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>redline URL</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>redline</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0.5</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>com.ambrosiasw.redline.config-file</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Car Document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.car</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>car</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.text</string>
|
||||
<string>public.content</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Configuration File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.config-file</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>com.ambrosiasw.redline.config-file</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Entity Document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.entity</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>ent</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>com.ambrosiasw.redline.config-file</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Environment Document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.environment</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>env</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>com.ambrosiasw.redline.config-file</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Font Document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.font</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>font</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>com.ambrosiasw.redline.config-file</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Map Description Document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.mapinfo</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>mapinfo</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
<string>public.content</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline 3D Model Document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.model</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>mdl</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
<string>public.content</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Plug-in</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.plugin</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>com.apple.ostype</key>
|
||||
<array>
|
||||
<string>PACK</string>
|
||||
</array>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>redplug</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>com.ambrosiasw.redline.config-file</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Preferences File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.preferences</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>cfg</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
<string>public.content</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Replay</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.replay</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>redlog</string>
|
||||
<string>sredlog</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
<string>public.content</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Road Data Document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.road</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>road</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>com.ambrosiasw.redline.config-file</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Road Types Document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.roadtypes</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>roadtypes</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>com.ambrosiasw.redline.config-file</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Redline Road Surfaces Document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.ambrosiasw.redline.surfaces</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>surfaces</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,855 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 42;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
7F06105A0876ED46001EA95C /* ai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F060FE50876ED46001EA95C /* ai.cpp */; };
|
||||
7F06105D0876ED46001EA95C /* carphysics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F060FEA0876ED46001EA95C /* carphysics.cpp */; };
|
||||
7F06105E0876ED46001EA95C /* carselection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F060FEC0876ED46001EA95C /* carselection.cpp */; };
|
||||
7F0610640876ED46001EA95C /* collision.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F060FF90876ED46001EA95C /* collision.cpp */; };
|
||||
7F0610650876ED46001EA95C /* config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F060FFB0876ED46001EA95C /* config.cpp */; };
|
||||
7F0610660876ED46001EA95C /* controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F060FFD0876ED46001EA95C /* controls.cpp */; };
|
||||
7F0610670876ED46001EA95C /* entities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F060FFF0876ED46001EA95C /* entities.cpp */; };
|
||||
7F0610680876ED46001EA95C /* environment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610010876ED46001EA95C /* environment.cpp */; };
|
||||
7F0610690876ED46001EA95C /* fileio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610040876ED46001EA95C /* fileio.cpp */; };
|
||||
7F06106A0876ED46001EA95C /* gameframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610060876ED46001EA95C /* gameframe.cpp */; };
|
||||
7F06106B0876ED46001EA95C /* gameinitexit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610080876ED46001EA95C /* gameinitexit.cpp */; };
|
||||
7F06106D0876ED46001EA95C /* infodisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06100F0876ED46001EA95C /* infodisplay.cpp */; };
|
||||
7F06106E0876ED46001EA95C /* initexit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610100876ED46001EA95C /* initexit.cpp */; };
|
||||
7F0610700876ED46001EA95C /* interfacemultiplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610140876ED46001EA95C /* interfacemultiplayer.cpp */; };
|
||||
7F0610710876ED46001EA95C /* interfaceoptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610150876ED46001EA95C /* interfaceoptions.cpp */; };
|
||||
7F0610720876ED46001EA95C /* interfaceutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610160876ED46001EA95C /* interfaceutil.cpp */; };
|
||||
7F0610730876ED46001EA95C /* lights.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610180876ED46001EA95C /* lights.cpp */; };
|
||||
7F0610740876ED46001EA95C /* log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06101B0876ED46001EA95C /* log.cpp */; };
|
||||
7F0610750876ED46001EA95C /* maccontrols.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06101D0876ED46001EA95C /* maccontrols.cpp */; };
|
||||
7F0610760876ED46001EA95C /* macerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06101E0876ED46001EA95C /* macerror.cpp */; };
|
||||
7F0610770876ED46001EA95C /* macfileio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06101F0876ED46001EA95C /* macfileio.cpp */; };
|
||||
7F0610780876ED46001EA95C /* maclocaltracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610200876ED46001EA95C /* maclocaltracker.cpp */; };
|
||||
7F0610790876ED46001EA95C /* macscreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610210876ED46001EA95C /* macscreen.cpp */; };
|
||||
7F06107A0876ED46001EA95C /* macsystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610220876ED46001EA95C /* macsystem.cpp */; };
|
||||
7F06107B0876ED46001EA95C /* mactexturesimport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610230876ED46001EA95C /* mactexturesimport.cpp */; };
|
||||
7F06107C0876ED46001EA95C /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610240876ED46001EA95C /* main.cpp */; };
|
||||
7F06107D0876ED46001EA95C /* mapselection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610250876ED46001EA95C /* mapselection.cpp */; };
|
||||
7F06107E0876ED46001EA95C /* models.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610270876ED46001EA95C /* models.cpp */; };
|
||||
7F06107F0876ED46001EA95C /* music.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06102A0876ED46001EA95C /* music.cpp */; };
|
||||
7F0610810876ED46001EA95C /* network_NT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06102E0876ED46001EA95C /* network_NT.cpp */; };
|
||||
7F0610820876ED46001EA95C /* networkphysics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06102F0876ED46001EA95C /* networkphysics.cpp */; };
|
||||
7F0610830876ED46001EA95C /* parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610310876ED46001EA95C /* parser.cpp */; };
|
||||
7F0610840876ED46001EA95C /* particles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610330876ED46001EA95C /* particles.cpp */; };
|
||||
7F0610850876ED46001EA95C /* random.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610350876ED46001EA95C /* random.cpp */; };
|
||||
7F0610860876ED46001EA95C /* rendercar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610370876ED46001EA95C /* rendercar.cpp */; };
|
||||
7F0610870876ED46001EA95C /* renderframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610390876ED46001EA95C /* renderframe.cpp */; };
|
||||
7F0610880876ED46001EA95C /* roads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06103B0876ED46001EA95C /* roads.cpp */; };
|
||||
7F0610890876ED46001EA95C /* screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06103D0876ED46001EA95C /* screen.cpp */; };
|
||||
7F06108A0876ED46001EA95C /* sky.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610400876ED46001EA95C /* sky.cpp */; };
|
||||
7F06108D0876ED46001EA95C /* sound_ST.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610440876ED46001EA95C /* sound_ST.cpp */; };
|
||||
7F06108E0876ED46001EA95C /* stencil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610450876ED46001EA95C /* stencil.cpp */; };
|
||||
7F0610900876ED46001EA95C /* text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610490876ED46001EA95C /* text.cpp */; };
|
||||
7F0610910876ED46001EA95C /* textures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06104B0876ED46001EA95C /* textures.cpp */; };
|
||||
7F0610920876ED46001EA95C /* tire.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06104E0876ED46001EA95C /* tire.cpp */; };
|
||||
7F0610930876ED46001EA95C /* tracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06104F0876ED46001EA95C /* tracker.cpp */; };
|
||||
7F0610940876ED46001EA95C /* tracks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610510876ED46001EA95C /* tracks.cpp */; };
|
||||
7F0610950876ED46001EA95C /* transparency.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610530876ED46001EA95C /* transparency.cpp */; };
|
||||
7F0610960876ED46001EA95C /* vectors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610550876ED46001EA95C /* vectors.cpp */; };
|
||||
7F0610970876ED46001EA95C /* writeout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0610570876ED46001EA95C /* writeout.cpp */; };
|
||||
7F06138F08770577001EA95C /* interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F06138E08770577001EA95C /* interface.cpp */; };
|
||||
7F0613BB08771263001EA95C /* LZRW3-A.C in Sources */ = {isa = PBXBuildFile; fileRef = 7F0613B908771263001EA95C /* LZRW3-A.C */; };
|
||||
7F4348C7096D9B5B00C3981C /* GetPID.c in Sources */ = {isa = PBXBuildFile; fileRef = 7F4348C5096D9B5B00C3981C /* GetPID.c */; };
|
||||
7F434A4F0973EC9900C3981C /* HID_cookie_strings.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7F434A4C0973EC9900C3981C /* HID_cookie_strings.plist */; };
|
||||
7F434A500973EC9900C3981C /* HID_device_usage_strings.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7F434A4D0973EC9900C3981C /* HID_device_usage_strings.plist */; };
|
||||
7F434A510973EC9900C3981C /* HID_usage_strings.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7F434A4E0973EC9900C3981C /* HID_usage_strings.plist */; };
|
||||
7F55FFDB08DDDA9700B82C72 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */; };
|
||||
7F55FFDC08DDDA9800B82C72 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A9504CAFFE6A41611CA0CBA /* CoreServices.framework */; };
|
||||
7F6EB7060DBB0141008B14A9 /* challenges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F060FF70876ED46001EA95C /* challenges.cpp */; };
|
||||
7F7EDC8309EE96BA00B2A665 /* Prev Track.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 7F7EDC7F09EE95E000B2A665 /* Prev Track.scpt */; };
|
||||
7F8C148D0A3ABBA000E76109 /* notifications.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7F8C148C0A3ABBA000E76109 /* notifications.mm */; };
|
||||
7F8C14A70A3ABDF900E76109 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F8C14A60A3ABDF900E76109 /* Cocoa.framework */; };
|
||||
7F9E3C5B095334BF000394C1 /* Next Track.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 7F9E3C4F095331F7000394C1 /* Next Track.scpt */; };
|
||||
7F9E3C7309534CB2000394C1 /* Status.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 7F9E3C7209534CA8000394C1 /* Status.scpt */; };
|
||||
7F9E3C7409534CB5000394C1 /* PlayPause.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 7F9E3C7109534C98000394C1 /* PlayPause.scpt */; };
|
||||
7FBFFFE008ACA6BB00618F96 /* ImmrHIDUtilAddOn.c in Sources */ = {isa = PBXBuildFile; fileRef = 7FBFFFDE08ACA6BB00618F96 /* ImmrHIDUtilAddOn.c */; };
|
||||
7FC1DAFD087820860029047D /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FC1DAFC087820860029047D /* AGL.framework */; };
|
||||
7FC1DB0E087820970029047D /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FC1DB0D087820970029047D /* QuickTime.framework */; };
|
||||
7FC1DB330878209F0029047D /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FC1DB320878209F0029047D /* OpenGL.framework */; };
|
||||
7FC1DC3708782A5C0029047D /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FC1DC3608782A5C0029047D /* ForceFeedback.framework */; };
|
||||
7FC5FD450D49131300C76FF4 /* AmbrosiaTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FC5FD440D49131300C76FF4 /* AmbrosiaTools.framework */; };
|
||||
7FD85AC008BC697A00C3EB17 /* Redline.rsrc in Resources */ = {isa = PBXBuildFile; fileRef = 7FD85ABF08BC697A00C3EB17 /* Redline.rsrc */; };
|
||||
7FD85B0708BC760A00C3EB17 /* S3Decompression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FD85B0508BC760A00C3EB17 /* S3Decompression.cpp */; };
|
||||
7FD85D4208BC77B900C3EB17 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FD85D4108BC77B900C3EB17 /* IOKit.framework */; };
|
||||
7FD85DF008BC79EF00C3EB17 /* HID_Config_Utilities.c in Sources */ = {isa = PBXBuildFile; fileRef = 7FD85DEA08BC79EF00C3EB17 /* HID_Config_Utilities.c */; };
|
||||
7FD85DF108BC79EF00C3EB17 /* HID_Error_Handler.c in Sources */ = {isa = PBXBuildFile; fileRef = 7FD85DEB08BC79EF00C3EB17 /* HID_Error_Handler.c */; };
|
||||
7FD85DF208BC79EF00C3EB17 /* HID_Name_Lookup.c in Sources */ = {isa = PBXBuildFile; fileRef = 7FD85DEC08BC79EF00C3EB17 /* HID_Name_Lookup.c */; };
|
||||
7FD85DF308BC79EF00C3EB17 /* HID_Queue_Utilities.c in Sources */ = {isa = PBXBuildFile; fileRef = 7FD85DED08BC79EF00C3EB17 /* HID_Queue_Utilities.c */; };
|
||||
7FD85DF408BC79EF00C3EB17 /* HID_Transaction_Utilities.c in Sources */ = {isa = PBXBuildFile; fileRef = 7FD85DEE08BC79EF00C3EB17 /* HID_Transaction_Utilities.c */; };
|
||||
7FD85DF508BC79EF00C3EB17 /* HID_Utilities.c in Sources */ = {isa = PBXBuildFile; fileRef = 7FD85DEF08BC79EF00C3EB17 /* HID_Utilities.c */; };
|
||||
7FD85E2308BC9B8400C3EB17 /* fpu_exc.c in Sources */ = {isa = PBXBuildFile; fileRef = 7FD85E2208BC9B8400C3EB17 /* fpu_exc.c */; };
|
||||
7FDFBE480A1BA49C0022488F /* libSystemStubs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FDFBE470A1BA49C0022488F /* libSystemStubs.a */; };
|
||||
7FE3424609AF93CD006C8583 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FE3424509AF93CD006C8583 /* Security.framework */; };
|
||||
7FED158B0D8FEA1F002AD94E /* librt3_nonag.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F16E75E0D57AA8200706C33 /* librt3_nonag.o */; };
|
||||
7FFFAA020886C5F70046AA19 /* Plugin.icns in Resources */ = {isa = PBXBuildFile; fileRef = 7FFFAA000886C5F70046AA19 /* Plugin.icns */; };
|
||||
7FFFAA030886C5F70046AA19 /* Redline.icns in Resources */ = {isa = PBXBuildFile; fileRef = 7FFFAA010886C5F70046AA19 /* Redline.icns */; };
|
||||
8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */; };
|
||||
8D0C4E920486CD37000505A6 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
20286C33FDCF999611CA2CEA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
|
||||
4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
|
||||
4A9504CAFFE6A41611CA0CBA /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
|
||||
7F060FE50876ED46001EA95C /* ai.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ai.cpp; sourceTree = "<group>"; };
|
||||
7F060FEA0876ED46001EA95C /* carphysics.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = carphysics.cpp; sourceTree = "<group>"; };
|
||||
7F060FEB0876ED46001EA95C /* carphysics.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = carphysics.h; sourceTree = "<group>"; };
|
||||
7F060FEC0876ED46001EA95C /* carselection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = carselection.cpp; sourceTree = "<group>"; };
|
||||
7F060FED0876ED46001EA95C /* carselection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = carselection.h; sourceTree = "<group>"; };
|
||||
7F060FF70876ED46001EA95C /* challenges.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = challenges.cpp; sourceTree = "<group>"; };
|
||||
7F060FF80876ED46001EA95C /* challenges.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = challenges.h; sourceTree = "<group>"; };
|
||||
7F060FF90876ED46001EA95C /* collision.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = collision.cpp; sourceTree = "<group>"; };
|
||||
7F060FFA0876ED46001EA95C /* collision.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = collision.h; sourceTree = "<group>"; };
|
||||
7F060FFB0876ED46001EA95C /* config.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = config.cpp; sourceTree = "<group>"; };
|
||||
7F060FFC0876ED46001EA95C /* config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
|
||||
7F060FFD0876ED46001EA95C /* controls.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = controls.cpp; sourceTree = "<group>"; };
|
||||
7F060FFE0876ED46001EA95C /* controls.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = controls.h; sourceTree = "<group>"; };
|
||||
7F060FFF0876ED46001EA95C /* entities.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = entities.cpp; sourceTree = "<group>"; };
|
||||
7F0610000876ED46001EA95C /* entities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = entities.h; sourceTree = "<group>"; };
|
||||
7F0610010876ED46001EA95C /* environment.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = environment.cpp; sourceTree = "<group>"; };
|
||||
7F0610020876ED46001EA95C /* environment.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = environment.h; sourceTree = "<group>"; };
|
||||
7F0610030876ED46001EA95C /* error.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = error.h; sourceTree = "<group>"; };
|
||||
7F0610040876ED46001EA95C /* fileio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = fileio.cpp; sourceTree = "<group>"; };
|
||||
7F0610050876ED46001EA95C /* fileio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = fileio.h; sourceTree = "<group>"; };
|
||||
7F0610060876ED46001EA95C /* gameframe.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = gameframe.cpp; sourceTree = "<group>"; };
|
||||
7F0610070876ED46001EA95C /* gameframe.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gameframe.h; sourceTree = "<group>"; };
|
||||
7F0610080876ED46001EA95C /* gameinitexit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = gameinitexit.cpp; sourceTree = "<group>"; };
|
||||
7F0610090876ED46001EA95C /* gameinitexit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gameinitexit.h; sourceTree = "<group>"; };
|
||||
7F06100A0876ED46001EA95C /* gamemem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gamemem.h; sourceTree = "<group>"; };
|
||||
7F06100B0876ED46001EA95C /* gamesound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gamesound.h; sourceTree = "<group>"; };
|
||||
7F06100C0876ED46001EA95C /* gamesystem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gamesystem.h; sourceTree = "<group>"; };
|
||||
7F06100D0876ED46001EA95C /* gametime.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gametime.h; sourceTree = "<group>"; };
|
||||
7F06100F0876ED46001EA95C /* infodisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = infodisplay.cpp; sourceTree = "<group>"; };
|
||||
7F0610100876ED46001EA95C /* initexit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = initexit.cpp; sourceTree = "<group>"; };
|
||||
7F0610110876ED46001EA95C /* initexit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = initexit.h; sourceTree = "<group>"; };
|
||||
7F0610130876ED46001EA95C /* interface.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = interface.h; sourceTree = "<group>"; };
|
||||
7F0610140876ED46001EA95C /* interfacemultiplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = interfacemultiplayer.cpp; sourceTree = "<group>"; };
|
||||
7F0610150876ED46001EA95C /* interfaceoptions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = interfaceoptions.cpp; sourceTree = "<group>"; };
|
||||
7F0610160876ED46001EA95C /* interfaceutil.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = interfaceutil.cpp; sourceTree = "<group>"; };
|
||||
7F0610170876ED46001EA95C /* interfaceutil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = interfaceutil.h; sourceTree = "<group>"; };
|
||||
7F0610180876ED46001EA95C /* lights.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lights.cpp; sourceTree = "<group>"; };
|
||||
7F0610190876ED46001EA95C /* lights.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lights.h; sourceTree = "<group>"; };
|
||||
7F06101A0876ED46001EA95C /* localtracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = localtracker.h; sourceTree = "<group>"; };
|
||||
7F06101B0876ED46001EA95C /* log.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = log.cpp; sourceTree = "<group>"; };
|
||||
7F06101C0876ED46001EA95C /* log.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = log.h; sourceTree = "<group>"; };
|
||||
7F06101D0876ED46001EA95C /* maccontrols.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = maccontrols.cpp; sourceTree = "<group>"; };
|
||||
7F06101E0876ED46001EA95C /* macerror.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = macerror.cpp; sourceTree = "<group>"; };
|
||||
7F06101F0876ED46001EA95C /* macfileio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = macfileio.cpp; sourceTree = "<group>"; };
|
||||
7F0610200876ED46001EA95C /* maclocaltracker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = maclocaltracker.cpp; sourceTree = "<group>"; };
|
||||
7F0610210876ED46001EA95C /* macscreen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = macscreen.cpp; sourceTree = "<group>"; };
|
||||
7F0610220876ED46001EA95C /* macsystem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = macsystem.cpp; sourceTree = "<group>"; };
|
||||
7F0610230876ED46001EA95C /* mactexturesimport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mactexturesimport.cpp; sourceTree = "<group>"; };
|
||||
7F0610240876ED46001EA95C /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
|
||||
7F0610250876ED46001EA95C /* mapselection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mapselection.cpp; sourceTree = "<group>"; };
|
||||
7F0610260876ED46001EA95C /* mapselection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mapselection.h; sourceTree = "<group>"; };
|
||||
7F0610270876ED46001EA95C /* models.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = models.cpp; sourceTree = "<group>"; };
|
||||
7F0610280876ED46001EA95C /* models.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = models.h; sourceTree = "<group>"; };
|
||||
7F0610290876ED46001EA95C /* modeltypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = modeltypes.h; sourceTree = "<group>"; };
|
||||
7F06102A0876ED46001EA95C /* music.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = music.cpp; sourceTree = "<group>"; };
|
||||
7F06102B0876ED46001EA95C /* music.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = music.h; sourceTree = "<group>"; };
|
||||
7F06102C0876ED46001EA95C /* network.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = network.h; sourceTree = "<group>"; };
|
||||
7F06102E0876ED46001EA95C /* network_NT.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = network_NT.cpp; sourceTree = "<group>"; };
|
||||
7F06102F0876ED46001EA95C /* networkphysics.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = networkphysics.cpp; sourceTree = "<group>"; };
|
||||
7F0610300876ED46001EA95C /* networkphysics.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = networkphysics.h; sourceTree = "<group>"; };
|
||||
7F0610310876ED46001EA95C /* parser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = parser.cpp; sourceTree = "<group>"; };
|
||||
7F0610320876ED46001EA95C /* parser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = "<group>"; };
|
||||
7F0610330876ED46001EA95C /* particles.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = particles.cpp; sourceTree = "<group>"; };
|
||||
7F0610340876ED46001EA95C /* particles.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = particles.h; sourceTree = "<group>"; };
|
||||
7F0610350876ED46001EA95C /* random.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = random.cpp; sourceTree = "<group>"; };
|
||||
7F0610360876ED46001EA95C /* random.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = random.h; sourceTree = "<group>"; };
|
||||
7F0610370876ED46001EA95C /* rendercar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = rendercar.cpp; sourceTree = "<group>"; };
|
||||
7F0610380876ED46001EA95C /* rendercar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = rendercar.h; sourceTree = "<group>"; };
|
||||
7F0610390876ED46001EA95C /* renderframe.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = renderframe.cpp; sourceTree = "<group>"; };
|
||||
7F06103A0876ED46001EA95C /* renderframe.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = renderframe.h; sourceTree = "<group>"; };
|
||||
7F06103B0876ED46001EA95C /* roads.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = roads.cpp; sourceTree = "<group>"; };
|
||||
7F06103C0876ED46001EA95C /* roads.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = roads.h; sourceTree = "<group>"; };
|
||||
7F06103D0876ED46001EA95C /* screen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = screen.cpp; sourceTree = "<group>"; };
|
||||
7F06103E0876ED46001EA95C /* screen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = screen.h; sourceTree = "<group>"; };
|
||||
7F0610400876ED46001EA95C /* sky.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = sky.cpp; sourceTree = "<group>"; };
|
||||
7F0610410876ED46001EA95C /* sky.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = sky.h; sourceTree = "<group>"; };
|
||||
7F0610440876ED46001EA95C /* sound_ST.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = sound_ST.cpp; sourceTree = "<group>"; };
|
||||
7F0610450876ED46001EA95C /* stencil.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = stencil.cpp; sourceTree = "<group>"; };
|
||||
7F0610460876ED46001EA95C /* stencil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stencil.h; sourceTree = "<group>"; };
|
||||
7F0610490876ED46001EA95C /* text.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = text.cpp; sourceTree = "<group>"; };
|
||||
7F06104A0876ED46001EA95C /* text.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = text.h; sourceTree = "<group>"; };
|
||||
7F06104B0876ED46001EA95C /* textures.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = textures.cpp; sourceTree = "<group>"; };
|
||||
7F06104C0876ED46001EA95C /* textures.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = textures.h; sourceTree = "<group>"; };
|
||||
7F06104D0876ED46001EA95C /* texturesimport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = texturesimport.h; sourceTree = "<group>"; };
|
||||
7F06104E0876ED46001EA95C /* tire.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tire.cpp; sourceTree = "<group>"; };
|
||||
7F06104F0876ED46001EA95C /* tracker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tracker.cpp; sourceTree = "<group>"; };
|
||||
7F0610500876ED46001EA95C /* tracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = tracker.h; sourceTree = "<group>"; };
|
||||
7F0610510876ED46001EA95C /* tracks.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tracks.cpp; sourceTree = "<group>"; };
|
||||
7F0610520876ED46001EA95C /* tracks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = tracks.h; sourceTree = "<group>"; };
|
||||
7F0610530876ED46001EA95C /* transparency.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = transparency.cpp; sourceTree = "<group>"; };
|
||||
7F0610540876ED46001EA95C /* transparency.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = transparency.h; sourceTree = "<group>"; };
|
||||
7F0610550876ED46001EA95C /* vectors.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = vectors.cpp; sourceTree = "<group>"; };
|
||||
7F0610560876ED46001EA95C /* vectors.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = vectors.h; sourceTree = "<group>"; };
|
||||
7F0610570876ED46001EA95C /* writeout.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = writeout.cpp; sourceTree = "<group>"; };
|
||||
7F0610580876ED46001EA95C /* writeout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = writeout.h; sourceTree = "<group>"; };
|
||||
7F06137C08770401001EA95C /* HID_Utilities_External.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = HID_Utilities_External.h; path = "/apps/dev/SDKs/HID Utilities Source/HID_Utilities_External.h"; sourceTree = "<absolute>"; };
|
||||
7F06138E08770577001EA95C /* interface.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = interface.cpp; sourceTree = "<group>"; };
|
||||
7F0613B708771262001EA95C /* compress.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = compress.h; path = ../packer/compress.h; sourceTree = SOURCE_ROOT; };
|
||||
7F0613B808771263001EA95C /* LZRW.H */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = LZRW.H; path = ../packer/LZRW.H; sourceTree = SOURCE_ROOT; };
|
||||
7F0613B908771263001EA95C /* LZRW3-A.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "LZRW3-A.C"; path = "../packer/LZRW3-A.C"; sourceTree = SOURCE_ROOT; };
|
||||
7F0613BA08771263001EA95C /* port.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = port.h; path = ../packer/port.h; sourceTree = SOURCE_ROOT; };
|
||||
7F16E74E0D57A68700706C33 /* rt3_redline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rt3_redline.h; path = /apps/dev/SDKs/ASW/ASWRegistration/redline/rt3_extras/rt3_redline.h; sourceTree = "<absolute>"; };
|
||||
7F16E75E0D57AA8200706C33 /* librt3_nonag.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; name = librt3_nonag.o; path = /apps/dev/SDKs/ASW/ASWRegistration/librt3_nonag.o; sourceTree = "<absolute>"; };
|
||||
7F16E7640D57ABCC00706C33 /* ASWRegistrationCarbonAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASWRegistrationCarbonAPI.h; path = /apps/dev/SDKs/ASW/ASWRegistration/redline/CarbonAPI/ASWRegistrationCarbonAPI.h; sourceTree = "<absolute>"; };
|
||||
7F4348C5096D9B5B00C3981C /* GetPID.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = GetPID.c; sourceTree = "<group>"; };
|
||||
7F4348C6096D9B5B00C3981C /* GetPID.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GetPID.h; sourceTree = "<group>"; };
|
||||
7F434A4C0973EC9900C3981C /* HID_cookie_strings.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = HID_cookie_strings.plist; sourceTree = "<group>"; };
|
||||
7F434A4D0973EC9900C3981C /* HID_device_usage_strings.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = HID_device_usage_strings.plist; sourceTree = "<group>"; };
|
||||
7F434A4E0973EC9900C3981C /* HID_usage_strings.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = HID_usage_strings.plist; sourceTree = "<group>"; };
|
||||
7F7EDC7F09EE95E000B2A665 /* Prev Track.scpt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.scpt; path = "Prev Track.scpt"; sourceTree = "<group>"; };
|
||||
7F7F050D09C9E5E3002D0EE3 /* interfacemultiplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = interfacemultiplayer.h; sourceTree = "<group>"; };
|
||||
7F8C148C0A3ABBA000E76109 /* notifications.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = notifications.mm; sourceTree = "<group>"; };
|
||||
7F8C14A60A3ABDF900E76109 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
7F9E3C4F095331F7000394C1 /* Next Track.scpt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.scpt; path = "Next Track.scpt"; sourceTree = "<group>"; };
|
||||
7F9E3C7109534C98000394C1 /* PlayPause.scpt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.scpt; path = PlayPause.scpt; sourceTree = "<group>"; };
|
||||
7F9E3C7209534CA8000394C1 /* Status.scpt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.scpt; path = Status.scpt; sourceTree = "<group>"; };
|
||||
7FBFFFDE08ACA6BB00618F96 /* ImmrHIDUtilAddOn.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ImmrHIDUtilAddOn.c; path = "/apps/dev/SDKs/FFB SDK/=>Developer=>Examples/ForceFeedback/UseFFAPIFromHIDUtil/ImmrHIDUtilAddOn.c"; sourceTree = "<absolute>"; };
|
||||
7FBFFFDF08ACA6BB00618F96 /* ImmrHIDUtilAddOn.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ImmrHIDUtilAddOn.h; path = "/apps/dev/SDKs/FFB SDK/=>Developer=>Examples/ForceFeedback/UseFFAPIFromHIDUtil/ImmrHIDUtilAddOn.h"; sourceTree = "<absolute>"; };
|
||||
7FC1DAFC087820860029047D /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = "<absolute>"; };
|
||||
7FC1DB0D087820970029047D /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
|
||||
7FC1DB320878209F0029047D /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
|
||||
7FC1DC3608782A5C0029047D /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = "<absolute>"; };
|
||||
7FC5FD440D49131300C76FF4 /* AmbrosiaTools.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AmbrosiaTools.framework; path = /apps/dev/SDKs/ASW/AmbrosiaTools/AmbrosiaTools.framework; sourceTree = "<absolute>"; };
|
||||
7FD85ABF08BC697A00C3EB17 /* Redline.rsrc */ = {isa = PBXFileReference; lastKnownFileType = archive.rsrc; path = Redline.rsrc; sourceTree = "<group>"; };
|
||||
7FD85B0508BC760A00C3EB17 /* S3Decompression.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = S3Decompression.cpp; sourceTree = "<group>"; };
|
||||
7FD85B0608BC760A00C3EB17 /* S3Decompression.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = S3Decompression.h; sourceTree = "<group>"; };
|
||||
7FD85D4108BC77B900C3EB17 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
|
||||
7FD85DEA08BC79EF00C3EB17 /* HID_Config_Utilities.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = HID_Config_Utilities.c; path = "/apps/dev/SDKs/HID Utilities Source/HID_Config_Utilities.c"; sourceTree = "<absolute>"; };
|
||||
7FD85DEB08BC79EF00C3EB17 /* HID_Error_Handler.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = HID_Error_Handler.c; path = "/apps/dev/SDKs/HID Utilities Source/HID_Error_Handler.c"; sourceTree = "<absolute>"; };
|
||||
7FD85DEC08BC79EF00C3EB17 /* HID_Name_Lookup.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = HID_Name_Lookup.c; path = "/apps/dev/SDKs/HID Utilities Source/HID_Name_Lookup.c"; sourceTree = "<absolute>"; };
|
||||
7FD85DED08BC79EF00C3EB17 /* HID_Queue_Utilities.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = HID_Queue_Utilities.c; path = "/apps/dev/SDKs/HID Utilities Source/HID_Queue_Utilities.c"; sourceTree = "<absolute>"; };
|
||||
7FD85DEE08BC79EF00C3EB17 /* HID_Transaction_Utilities.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = HID_Transaction_Utilities.c; path = "/apps/dev/SDKs/HID Utilities Source/HID_Transaction_Utilities.c"; sourceTree = "<absolute>"; };
|
||||
7FD85DEF08BC79EF00C3EB17 /* HID_Utilities.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = HID_Utilities.c; path = "/apps/dev/SDKs/HID Utilities Source/HID_Utilities.c"; sourceTree = "<absolute>"; };
|
||||
7FD85E2108BC9B8400C3EB17 /* fpu_exc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fpu_exc.h; sourceTree = "<group>"; };
|
||||
7FD85E2208BC9B8400C3EB17 /* fpu_exc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fpu_exc.c; sourceTree = "<group>"; };
|
||||
7FDFBE470A1BA49C0022488F /* libSystemStubs.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSystemStubs.a; path = /usr/lib/libSystemStubs.a; sourceTree = "<absolute>"; };
|
||||
7FE3424509AF93CD006C8583 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
|
||||
7FE52CD10D579B8800F442A1 /* draw_tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = draw_tool.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/draw_tool.h; sourceTree = "<absolute>"; };
|
||||
7FE52CD20D579B8800F442A1 /* file_tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file_tool.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/file_tool.h; sourceTree = "<absolute>"; };
|
||||
7FE52CD30D579B8800F442A1 /* getline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = getline.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/getline.h; sourceTree = "<absolute>"; };
|
||||
7FE52CD40D579B8800F442A1 /* inlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = inlines.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/inlines.h; sourceTree = "<absolute>"; };
|
||||
7FE52CD50D579B8800F442A1 /* interface_tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = interface_tool.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/interface_tool.h; sourceTree = "<absolute>"; };
|
||||
7FE52CD60D579B8800F442A1 /* lsockets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lsockets.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/lsockets.h; sourceTree = "<absolute>"; };
|
||||
7FE52CD70D579B8800F442A1 /* mac-carbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "mac-carbon.h"; path = "/apps/dev/SDKs/ASW/AmbrosiaTools/mac-carbon.h"; sourceTree = "<absolute>"; };
|
||||
7FE52CD80D579B8800F442A1 /* mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mac.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/mac.h; sourceTree = "<absolute>"; };
|
||||
7FE52CD90D579B8800F442A1 /* macdebug-carbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "macdebug-carbon.h"; path = "/apps/dev/SDKs/ASW/AmbrosiaTools/macdebug-carbon.h"; sourceTree = "<absolute>"; };
|
||||
7FE52CDA0D579B8800F442A1 /* macdebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macdebug.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/macdebug.h; sourceTree = "<absolute>"; };
|
||||
7FE52CDB0D579B8800F442A1 /* network_tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = network_tool.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/network_tool.h; sourceTree = "<absolute>"; };
|
||||
7FE52CDC0D579B8800F442A1 /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = platform.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/platform.h; sourceTree = "<absolute>"; };
|
||||
7FE52CDD0D579B8800F442A1 /* reg_tool_3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = reg_tool_3.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/reg_tool_3.h; sourceTree = "<absolute>"; };
|
||||
7FE52CDE0D579B8800F442A1 /* reggie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = reggie.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/reggie.h; sourceTree = "<absolute>"; };
|
||||
7FE52CDF0D579B8800F442A1 /* sound_tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sound_tool.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/sound_tool.h; sourceTree = "<absolute>"; };
|
||||
7FE52CE00D579B8800F442A1 /* stddebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stddebug.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/stddebug.h; sourceTree = "<absolute>"; };
|
||||
7FE52CE10D579B8800F442A1 /* stderror.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stderror.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/stderror.h; sourceTree = "<absolute>"; };
|
||||
7FE52CE20D579B8800F442A1 /* stdmath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stdmath.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/stdmath.h; sourceTree = "<absolute>"; };
|
||||
7FE52CE30D579B8800F442A1 /* stdtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stdtypes.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/stdtypes.h; sourceTree = "<absolute>"; };
|
||||
7FE52CE40D579B8800F442A1 /* unix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unix.h; path = /apps/dev/SDKs/ASW/AmbrosiaTools/unix.h; sourceTree = "<absolute>"; };
|
||||
7FFFAA000886C5F70046AA19 /* Plugin.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Plugin.icns; sourceTree = "<group>"; };
|
||||
7FFFAA010886C5F70046AA19 /* Redline.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Redline.icns; sourceTree = "<group>"; };
|
||||
8D0C4E960486CD37000505A6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D0C4E970486CD37000505A6 /* Redline.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Redline.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8D0C4E910486CD37000505A6 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D0C4E920486CD37000505A6 /* Carbon.framework in Frameworks */,
|
||||
7FC1DAFD087820860029047D /* AGL.framework in Frameworks */,
|
||||
7FC1DB0E087820970029047D /* QuickTime.framework in Frameworks */,
|
||||
7FC1DB330878209F0029047D /* OpenGL.framework in Frameworks */,
|
||||
7FC1DC3708782A5C0029047D /* ForceFeedback.framework in Frameworks */,
|
||||
7FD85D4208BC77B900C3EB17 /* IOKit.framework in Frameworks */,
|
||||
7F55FFDB08DDDA9700B82C72 /* ApplicationServices.framework in Frameworks */,
|
||||
7F55FFDC08DDDA9800B82C72 /* CoreServices.framework in Frameworks */,
|
||||
7FE3424609AF93CD006C8583 /* Security.framework in Frameworks */,
|
||||
7FDFBE480A1BA49C0022488F /* libSystemStubs.a in Frameworks */,
|
||||
7F8C14A70A3ABDF900E76109 /* Cocoa.framework in Frameworks */,
|
||||
7FC5FD450D49131300C76FF4 /* AmbrosiaTools.framework in Frameworks */,
|
||||
7FED158B0D8FEA1F002AD94E /* librt3_nonag.o in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
195DF8CFFE9D517E11CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D0C4E970486CD37000505A6 /* Redline.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
20286C29FDCF999611CA2CEA /* game */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7FE52CD00D579B7500F442A1 /* ASW */,
|
||||
7F0613AC08771244001EA95C /* lzrw */,
|
||||
7F06136E087703B4001EA95C /* HID */,
|
||||
7F060FE20876ED46001EA95C /* source */,
|
||||
20286C2CFDCF999611CA2CEA /* Resources */,
|
||||
20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */,
|
||||
195DF8CFFE9D517E11CA2CBB /* Products */,
|
||||
);
|
||||
name = game;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
20286C2CFDCF999611CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7F434A4C0973EC9900C3981C /* HID_cookie_strings.plist */,
|
||||
7F434A4D0973EC9900C3981C /* HID_device_usage_strings.plist */,
|
||||
7F434A4E0973EC9900C3981C /* HID_usage_strings.plist */,
|
||||
7F9E3C4F095331F7000394C1 /* Next Track.scpt */,
|
||||
7F7EDC7F09EE95E000B2A665 /* Prev Track.scpt */,
|
||||
7FD85ABF08BC697A00C3EB17 /* Redline.rsrc */,
|
||||
7FFFAA000886C5F70046AA19 /* Plugin.icns */,
|
||||
7FFFAA010886C5F70046AA19 /* Redline.icns */,
|
||||
7F9E3C7109534C98000394C1 /* PlayPause.scpt */,
|
||||
7F9E3C7209534CA8000394C1 /* Status.scpt */,
|
||||
8D0C4E960486CD37000505A6 /* Info.plist */,
|
||||
0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7F8C14A60A3ABDF900E76109 /* Cocoa.framework */,
|
||||
7FDFBE470A1BA49C0022488F /* libSystemStubs.a */,
|
||||
7FE3424509AF93CD006C8583 /* Security.framework */,
|
||||
7FD85D4108BC77B900C3EB17 /* IOKit.framework */,
|
||||
7FC1DC3608782A5C0029047D /* ForceFeedback.framework */,
|
||||
7FC1DB320878209F0029047D /* OpenGL.framework */,
|
||||
7FC1DB0D087820970029047D /* QuickTime.framework */,
|
||||
7FC1DAFC087820860029047D /* AGL.framework */,
|
||||
20286C33FDCF999611CA2CEA /* Carbon.framework */,
|
||||
4A9504CAFFE6A41611CA0CBA /* CoreServices.framework */,
|
||||
4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */,
|
||||
);
|
||||
name = "External Frameworks and Libraries";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7F060FE20876ED46001EA95C /* source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7F4348C5096D9B5B00C3981C /* GetPID.c */,
|
||||
7F4348C6096D9B5B00C3981C /* GetPID.h */,
|
||||
7FD85E2108BC9B8400C3EB17 /* fpu_exc.h */,
|
||||
7FD85E2208BC9B8400C3EB17 /* fpu_exc.c */,
|
||||
7F060FE50876ED46001EA95C /* ai.cpp */,
|
||||
7F060FEA0876ED46001EA95C /* carphysics.cpp */,
|
||||
7F060FEB0876ED46001EA95C /* carphysics.h */,
|
||||
7F060FEC0876ED46001EA95C /* carselection.cpp */,
|
||||
7F060FF70876ED46001EA95C /* challenges.cpp */,
|
||||
7F060FF80876ED46001EA95C /* challenges.h */,
|
||||
7F060FF90876ED46001EA95C /* collision.cpp */,
|
||||
7F060FFA0876ED46001EA95C /* collision.h */,
|
||||
7F060FFB0876ED46001EA95C /* config.cpp */,
|
||||
7F060FED0876ED46001EA95C /* carselection.h */,
|
||||
7F060FFC0876ED46001EA95C /* config.h */,
|
||||
7F060FFD0876ED46001EA95C /* controls.cpp */,
|
||||
7F060FFE0876ED46001EA95C /* controls.h */,
|
||||
7F060FFF0876ED46001EA95C /* entities.cpp */,
|
||||
7F0610000876ED46001EA95C /* entities.h */,
|
||||
7F0610010876ED46001EA95C /* environment.cpp */,
|
||||
7F0610020876ED46001EA95C /* environment.h */,
|
||||
7F0610030876ED46001EA95C /* error.h */,
|
||||
7F0610040876ED46001EA95C /* fileio.cpp */,
|
||||
7F0610050876ED46001EA95C /* fileio.h */,
|
||||
7F0610060876ED46001EA95C /* gameframe.cpp */,
|
||||
7F0610070876ED46001EA95C /* gameframe.h */,
|
||||
7F0610080876ED46001EA95C /* gameinitexit.cpp */,
|
||||
7F0610090876ED46001EA95C /* gameinitexit.h */,
|
||||
7F06100A0876ED46001EA95C /* gamemem.h */,
|
||||
7F06100B0876ED46001EA95C /* gamesound.h */,
|
||||
7F06100C0876ED46001EA95C /* gamesystem.h */,
|
||||
7F06100D0876ED46001EA95C /* gametime.h */,
|
||||
7F06100F0876ED46001EA95C /* infodisplay.cpp */,
|
||||
7F0610100876ED46001EA95C /* initexit.cpp */,
|
||||
7F0610110876ED46001EA95C /* initexit.h */,
|
||||
7F06138E08770577001EA95C /* interface.cpp */,
|
||||
7F0610130876ED46001EA95C /* interface.h */,
|
||||
7F0610140876ED46001EA95C /* interfacemultiplayer.cpp */,
|
||||
7F7F050D09C9E5E3002D0EE3 /* interfacemultiplayer.h */,
|
||||
7F0610150876ED46001EA95C /* interfaceoptions.cpp */,
|
||||
7F0610160876ED46001EA95C /* interfaceutil.cpp */,
|
||||
7F0610170876ED46001EA95C /* interfaceutil.h */,
|
||||
7F0610180876ED46001EA95C /* lights.cpp */,
|
||||
7F0610190876ED46001EA95C /* lights.h */,
|
||||
7F06101A0876ED46001EA95C /* localtracker.h */,
|
||||
7F06101B0876ED46001EA95C /* log.cpp */,
|
||||
7F06101C0876ED46001EA95C /* log.h */,
|
||||
7F06101D0876ED46001EA95C /* maccontrols.cpp */,
|
||||
7F06101E0876ED46001EA95C /* macerror.cpp */,
|
||||
7F06101F0876ED46001EA95C /* macfileio.cpp */,
|
||||
7F0610200876ED46001EA95C /* maclocaltracker.cpp */,
|
||||
7F0610210876ED46001EA95C /* macscreen.cpp */,
|
||||
7F0610220876ED46001EA95C /* macsystem.cpp */,
|
||||
7F0610230876ED46001EA95C /* mactexturesimport.cpp */,
|
||||
7F0610240876ED46001EA95C /* main.cpp */,
|
||||
7F0610250876ED46001EA95C /* mapselection.cpp */,
|
||||
7F0610260876ED46001EA95C /* mapselection.h */,
|
||||
7F0610270876ED46001EA95C /* models.cpp */,
|
||||
7F0610280876ED46001EA95C /* models.h */,
|
||||
7F0610290876ED46001EA95C /* modeltypes.h */,
|
||||
7F06102A0876ED46001EA95C /* music.cpp */,
|
||||
7F06102B0876ED46001EA95C /* music.h */,
|
||||
7F06102C0876ED46001EA95C /* network.h */,
|
||||
7F06102E0876ED46001EA95C /* network_NT.cpp */,
|
||||
7F06102F0876ED46001EA95C /* networkphysics.cpp */,
|
||||
7F0610300876ED46001EA95C /* networkphysics.h */,
|
||||
7F8C148C0A3ABBA000E76109 /* notifications.mm */,
|
||||
7F0610310876ED46001EA95C /* parser.cpp */,
|
||||
7F0610320876ED46001EA95C /* parser.h */,
|
||||
7F0610330876ED46001EA95C /* particles.cpp */,
|
||||
7F0610340876ED46001EA95C /* particles.h */,
|
||||
7F0610350876ED46001EA95C /* random.cpp */,
|
||||
7F0610360876ED46001EA95C /* random.h */,
|
||||
7F0610370876ED46001EA95C /* rendercar.cpp */,
|
||||
7F0610380876ED46001EA95C /* rendercar.h */,
|
||||
7F0610390876ED46001EA95C /* renderframe.cpp */,
|
||||
7F06103A0876ED46001EA95C /* renderframe.h */,
|
||||
7F06103B0876ED46001EA95C /* roads.cpp */,
|
||||
7F06103C0876ED46001EA95C /* roads.h */,
|
||||
7FD85B0508BC760A00C3EB17 /* S3Decompression.cpp */,
|
||||
7FD85B0608BC760A00C3EB17 /* S3Decompression.h */,
|
||||
7F06103D0876ED46001EA95C /* screen.cpp */,
|
||||
7F06103E0876ED46001EA95C /* screen.h */,
|
||||
7F0610400876ED46001EA95C /* sky.cpp */,
|
||||
7F0610410876ED46001EA95C /* sky.h */,
|
||||
7F0610440876ED46001EA95C /* sound_ST.cpp */,
|
||||
7F0610450876ED46001EA95C /* stencil.cpp */,
|
||||
7F0610460876ED46001EA95C /* stencil.h */,
|
||||
7F0610490876ED46001EA95C /* text.cpp */,
|
||||
7F06104A0876ED46001EA95C /* text.h */,
|
||||
7F06104B0876ED46001EA95C /* textures.cpp */,
|
||||
7F06104C0876ED46001EA95C /* textures.h */,
|
||||
7F06104D0876ED46001EA95C /* texturesimport.h */,
|
||||
7F06104E0876ED46001EA95C /* tire.cpp */,
|
||||
7F06104F0876ED46001EA95C /* tracker.cpp */,
|
||||
7F0610500876ED46001EA95C /* tracker.h */,
|
||||
7F0610510876ED46001EA95C /* tracks.cpp */,
|
||||
7F0610520876ED46001EA95C /* tracks.h */,
|
||||
7F0610530876ED46001EA95C /* transparency.cpp */,
|
||||
7F0610540876ED46001EA95C /* transparency.h */,
|
||||
7F0610550876ED46001EA95C /* vectors.cpp */,
|
||||
7F0610560876ED46001EA95C /* vectors.h */,
|
||||
7F0610570876ED46001EA95C /* writeout.cpp */,
|
||||
7F0610580876ED46001EA95C /* writeout.h */,
|
||||
);
|
||||
path = source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7F06136E087703B4001EA95C /* HID */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7FD85DEA08BC79EF00C3EB17 /* HID_Config_Utilities.c */,
|
||||
7FD85DEB08BC79EF00C3EB17 /* HID_Error_Handler.c */,
|
||||
7FD85DEC08BC79EF00C3EB17 /* HID_Name_Lookup.c */,
|
||||
7FD85DED08BC79EF00C3EB17 /* HID_Queue_Utilities.c */,
|
||||
7FD85DEE08BC79EF00C3EB17 /* HID_Transaction_Utilities.c */,
|
||||
7FD85DEF08BC79EF00C3EB17 /* HID_Utilities.c */,
|
||||
7FBFFFDE08ACA6BB00618F96 /* ImmrHIDUtilAddOn.c */,
|
||||
7FBFFFDF08ACA6BB00618F96 /* ImmrHIDUtilAddOn.h */,
|
||||
7F06137C08770401001EA95C /* HID_Utilities_External.h */,
|
||||
);
|
||||
name = HID;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7F0613AC08771244001EA95C /* lzrw */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7F0613B708771262001EA95C /* compress.h */,
|
||||
7F0613B808771263001EA95C /* LZRW.H */,
|
||||
7F0613B908771263001EA95C /* LZRW3-A.C */,
|
||||
7F0613BA08771263001EA95C /* port.h */,
|
||||
);
|
||||
name = lzrw;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7FE52CD00D579B7500F442A1 /* ASW */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7F16E7640D57ABCC00706C33 /* ASWRegistrationCarbonAPI.h */,
|
||||
7F16E75E0D57AA8200706C33 /* librt3_nonag.o */,
|
||||
7F16E74E0D57A68700706C33 /* rt3_redline.h */,
|
||||
7FE52CD10D579B8800F442A1 /* draw_tool.h */,
|
||||
7FE52CD20D579B8800F442A1 /* file_tool.h */,
|
||||
7FE52CD30D579B8800F442A1 /* getline.h */,
|
||||
7FE52CD40D579B8800F442A1 /* inlines.h */,
|
||||
7FE52CD50D579B8800F442A1 /* interface_tool.h */,
|
||||
7FE52CD60D579B8800F442A1 /* lsockets.h */,
|
||||
7FE52CD70D579B8800F442A1 /* mac-carbon.h */,
|
||||
7FE52CD80D579B8800F442A1 /* mac.h */,
|
||||
7FE52CD90D579B8800F442A1 /* macdebug-carbon.h */,
|
||||
7FE52CDA0D579B8800F442A1 /* macdebug.h */,
|
||||
7FE52CDB0D579B8800F442A1 /* network_tool.h */,
|
||||
7FE52CDC0D579B8800F442A1 /* platform.h */,
|
||||
7FE52CDD0D579B8800F442A1 /* reg_tool_3.h */,
|
||||
7FE52CDE0D579B8800F442A1 /* reggie.h */,
|
||||
7FE52CDF0D579B8800F442A1 /* sound_tool.h */,
|
||||
7FE52CE00D579B8800F442A1 /* stddebug.h */,
|
||||
7FE52CE10D579B8800F442A1 /* stderror.h */,
|
||||
7FE52CE20D579B8800F442A1 /* stdmath.h */,
|
||||
7FE52CE30D579B8800F442A1 /* stdtypes.h */,
|
||||
7FE52CE40D579B8800F442A1 /* unix.h */,
|
||||
7FC5FD440D49131300C76FF4 /* AmbrosiaTools.framework */,
|
||||
);
|
||||
name = ASW;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8D0C4E890486CD37000505A6 /* Redline */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 7F060FD80876EC7F001EA95C /* Build configuration list for PBXNativeTarget "Redline" */;
|
||||
buildPhases = (
|
||||
8D0C4E8C0486CD37000505A6 /* Resources */,
|
||||
8D0C4E8F0486CD37000505A6 /* Sources */,
|
||||
8D0C4E910486CD37000505A6 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Redline;
|
||||
productInstallPath = "$(HOME)/Applications";
|
||||
productName = game;
|
||||
productReference = 8D0C4E970486CD37000505A6 /* Redline.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
20286C28FDCF999611CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = 7F060FDC0876EC7F001EA95C /* Build configuration list for PBXProject "game" */;
|
||||
compatibilityVersion = "Xcode 2.4";
|
||||
hasScannedForEncodings = 1;
|
||||
mainGroup = 20286C29FDCF999611CA2CEA /* game */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8D0C4E890486CD37000505A6 /* Redline */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8D0C4E8C0486CD37000505A6 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7F9E3C7409534CB5000394C1 /* PlayPause.scpt in Resources */,
|
||||
7F7EDC8309EE96BA00B2A665 /* Prev Track.scpt in Resources */,
|
||||
7F9E3C7309534CB2000394C1 /* Status.scpt in Resources */,
|
||||
8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */,
|
||||
7FFFAA020886C5F70046AA19 /* Plugin.icns in Resources */,
|
||||
7F9E3C5B095334BF000394C1 /* Next Track.scpt in Resources */,
|
||||
7FFFAA030886C5F70046AA19 /* Redline.icns in Resources */,
|
||||
7FD85AC008BC697A00C3EB17 /* Redline.rsrc in Resources */,
|
||||
7F434A4F0973EC9900C3981C /* HID_cookie_strings.plist in Resources */,
|
||||
7F434A500973EC9900C3981C /* HID_device_usage_strings.plist in Resources */,
|
||||
7F434A510973EC9900C3981C /* HID_usage_strings.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8D0C4E8F0486CD37000505A6 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7F06105A0876ED46001EA95C /* ai.cpp in Sources */,
|
||||
7F06105D0876ED46001EA95C /* carphysics.cpp in Sources */,
|
||||
7F06105E0876ED46001EA95C /* carselection.cpp in Sources */,
|
||||
7F0610640876ED46001EA95C /* collision.cpp in Sources */,
|
||||
7F0610650876ED46001EA95C /* config.cpp in Sources */,
|
||||
7F0610660876ED46001EA95C /* controls.cpp in Sources */,
|
||||
7F0610670876ED46001EA95C /* entities.cpp in Sources */,
|
||||
7F0610680876ED46001EA95C /* environment.cpp in Sources */,
|
||||
7F0610690876ED46001EA95C /* fileio.cpp in Sources */,
|
||||
7F06106A0876ED46001EA95C /* gameframe.cpp in Sources */,
|
||||
7F06106B0876ED46001EA95C /* gameinitexit.cpp in Sources */,
|
||||
7F06106D0876ED46001EA95C /* infodisplay.cpp in Sources */,
|
||||
7F06106E0876ED46001EA95C /* initexit.cpp in Sources */,
|
||||
7F0610700876ED46001EA95C /* interfacemultiplayer.cpp in Sources */,
|
||||
7F0610710876ED46001EA95C /* interfaceoptions.cpp in Sources */,
|
||||
7F0610720876ED46001EA95C /* interfaceutil.cpp in Sources */,
|
||||
7F0610730876ED46001EA95C /* lights.cpp in Sources */,
|
||||
7F0610740876ED46001EA95C /* log.cpp in Sources */,
|
||||
7F0610750876ED46001EA95C /* maccontrols.cpp in Sources */,
|
||||
7F0610760876ED46001EA95C /* macerror.cpp in Sources */,
|
||||
7F0610770876ED46001EA95C /* macfileio.cpp in Sources */,
|
||||
7F0610780876ED46001EA95C /* maclocaltracker.cpp in Sources */,
|
||||
7F0610790876ED46001EA95C /* macscreen.cpp in Sources */,
|
||||
7F06107A0876ED46001EA95C /* macsystem.cpp in Sources */,
|
||||
7F06107B0876ED46001EA95C /* mactexturesimport.cpp in Sources */,
|
||||
7F06107C0876ED46001EA95C /* main.cpp in Sources */,
|
||||
7F06107D0876ED46001EA95C /* mapselection.cpp in Sources */,
|
||||
7F06107E0876ED46001EA95C /* models.cpp in Sources */,
|
||||
7F06107F0876ED46001EA95C /* music.cpp in Sources */,
|
||||
7F0610810876ED46001EA95C /* network_NT.cpp in Sources */,
|
||||
7F0610820876ED46001EA95C /* networkphysics.cpp in Sources */,
|
||||
7F0610830876ED46001EA95C /* parser.cpp in Sources */,
|
||||
7F0610840876ED46001EA95C /* particles.cpp in Sources */,
|
||||
7F0610850876ED46001EA95C /* random.cpp in Sources */,
|
||||
7F0610860876ED46001EA95C /* rendercar.cpp in Sources */,
|
||||
7F0610870876ED46001EA95C /* renderframe.cpp in Sources */,
|
||||
7F0610880876ED46001EA95C /* roads.cpp in Sources */,
|
||||
7F0610890876ED46001EA95C /* screen.cpp in Sources */,
|
||||
7F06108A0876ED46001EA95C /* sky.cpp in Sources */,
|
||||
7F06108D0876ED46001EA95C /* sound_ST.cpp in Sources */,
|
||||
7F06108E0876ED46001EA95C /* stencil.cpp in Sources */,
|
||||
7F0610900876ED46001EA95C /* text.cpp in Sources */,
|
||||
7F0610910876ED46001EA95C /* textures.cpp in Sources */,
|
||||
7F0610920876ED46001EA95C /* tire.cpp in Sources */,
|
||||
7F0610930876ED46001EA95C /* tracker.cpp in Sources */,
|
||||
7F0610940876ED46001EA95C /* tracks.cpp in Sources */,
|
||||
7F0610950876ED46001EA95C /* transparency.cpp in Sources */,
|
||||
7F0610960876ED46001EA95C /* vectors.cpp in Sources */,
|
||||
7F0610970876ED46001EA95C /* writeout.cpp in Sources */,
|
||||
7F06138F08770577001EA95C /* interface.cpp in Sources */,
|
||||
7F0613BB08771263001EA95C /* LZRW3-A.C in Sources */,
|
||||
7FBFFFE008ACA6BB00618F96 /* ImmrHIDUtilAddOn.c in Sources */,
|
||||
7FD85B0708BC760A00C3EB17 /* S3Decompression.cpp in Sources */,
|
||||
7FD85DF008BC79EF00C3EB17 /* HID_Config_Utilities.c in Sources */,
|
||||
7FD85DF108BC79EF00C3EB17 /* HID_Error_Handler.c in Sources */,
|
||||
7FD85DF208BC79EF00C3EB17 /* HID_Name_Lookup.c in Sources */,
|
||||
7FD85DF308BC79EF00C3EB17 /* HID_Queue_Utilities.c in Sources */,
|
||||
7FD85DF408BC79EF00C3EB17 /* HID_Transaction_Utilities.c in Sources */,
|
||||
7FD85DF508BC79EF00C3EB17 /* HID_Utilities.c in Sources */,
|
||||
7FD85E2308BC9B8400C3EB17 /* fpu_exc.c in Sources */,
|
||||
7F4348C7096D9B5B00C3981C /* GetPID.c in Sources */,
|
||||
7F8C148D0A3ABBA000E76109 /* notifications.mm in Sources */,
|
||||
7F6EB7060DBB0141008B14A9 /* challenges.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
0867D6ABFE840B52C02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
7F060FD90876EC7F001EA95C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/apps/dev/SDKs/ASW/AmbrosiaTools,
|
||||
/apps/dev/SDKs/ASW/ASWRegistration/redline/Framework/Release,
|
||||
);
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = game_Prefix.pch;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/network_tool/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/reg_tool_3/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/reggie/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/sound_tool/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/lsockets",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/network_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/platform",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/reg_tool_3",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/reggie",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/sound_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/file_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/interface_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/draw_tool",
|
||||
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS_QUOTED_1 = "/apps/dev/SDKs/HID\\ Utilities\\ Source/build";
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = Redline;
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
7F060FDA0876EC7F001EA95C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/apps/dev/SDKs/ASW/AmbrosiaTools,
|
||||
/apps/dev/SDKs/ASW/ASWRegistration/redline/Framework/Release,
|
||||
);
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = game_Prefix.pch;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/network_tool/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/reg_tool_3/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/reggie/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/sound_tool/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/lsockets",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/network_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/platform",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/reg_tool_3",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/reggie",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/sound_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/file_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/interface_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/draw_tool",
|
||||
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS_QUOTED_1 = "/apps/dev/SDKs/HID\\ Utilities\\ Source/build";
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = Redline;
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
7F060FDB0876EC7F001EA95C /* Default */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/apps/dev/SDKs/ASW/AmbrosiaTools,
|
||||
/apps/dev/SDKs/ASW/ASWRegistration/redline/Framework/Release,
|
||||
);
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = game_Prefix.pch;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/network_tool/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/reg_tool_3/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/reggie/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-CW-02-26-2005/sound_tool/libraries",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/lsockets",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/network_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/platform",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/reg_tool_3",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/reggie",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/sound_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/file_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/interface_tool",
|
||||
"/apps/dev/SDKs/Ambrosia-gcc-02-26-2005/draw_tool",
|
||||
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS_QUOTED_1 = "/apps/dev/SDKs/HID\\ Utilities\\ Source/build";
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = Redline;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Default;
|
||||
};
|
||||
7F060FDD0876EC7F001EA95C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = ppc;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.4;
|
||||
OTHER_LDFLAGS = "-lz";
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
7F060FDE0876EC7F001EA95C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
|
||||
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
GCC_VERSION_i386 = 4.0;
|
||||
GCC_VERSION_ppc = 3.3;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.2;
|
||||
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
|
||||
MACOSX_DEPLOYMENT_TARGET_ppc = 10.2;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
OTHER_LDFLAGS = (
|
||||
"-lz",
|
||||
"-weak_library",
|
||||
$SDKROOT/usr/lib/libcurl.dylib,
|
||||
);
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
7F060FDF0876EC7F001EA95C /* Default */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.4;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
};
|
||||
name = Default;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
7F060FD80876EC7F001EA95C /* Build configuration list for PBXNativeTarget "Redline" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
7F060FD90876EC7F001EA95C /* Debug */,
|
||||
7F060FDA0876EC7F001EA95C /* Release */,
|
||||
7F060FDB0876EC7F001EA95C /* Default */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Default;
|
||||
};
|
||||
7F060FDC0876EC7F001EA95C /* Build configuration list for PBXProject "game" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
7F060FDD0876EC7F001EA95C /* Debug */,
|
||||
7F060FDE0876EC7F001EA95C /* Release */,
|
||||
7F060FDF0876EC7F001EA95C /* Default */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Default;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 20286C28FDCF999611CA2CEA /* Project object */;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'game' target in the 'game' project.
|
||||
//
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
#include "mac-carbon.h"
|
||||
Binary file not shown.
BIN
Binary file not shown.
Executable
+402
@@ -0,0 +1,402 @@
|
||||
/*
|
||||
File: GetPID.c
|
||||
|
||||
Description: This file provides a simple API to do process PID lookup based on process name.
|
||||
|
||||
Author: Chad Jones
|
||||
|
||||
Copyright: © Copyright 2003 Apple Computer, Inc. All rights reserved.
|
||||
|
||||
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
|
||||
("Apple") in consideration of your agreement to the following terms, and your
|
||||
use, installation, modification or redistribution of this Apple software
|
||||
constitutes acceptance of these terms. If you do not agree with these terms,
|
||||
please do not use, install, modify or redistribute this Apple software.
|
||||
|
||||
In consideration of your agreement to abide by the following terms, and subject
|
||||
to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
|
||||
copyrights in this original Apple software (the "Apple Software"), to use,
|
||||
reproduce, modify and redistribute the Apple Software, with or without
|
||||
modifications, in source and/or binary forms; provided that if you redistribute
|
||||
the Apple Software in its entirety and without modifications, you must retain
|
||||
this notice and the following text and disclaimers in all such redistributions of
|
||||
the Apple Software. Neither the name, trademarks, service marks or logos of
|
||||
Apple Computer, Inc. may be used to endorse or promote products derived from the
|
||||
Apple Software without specific prior written permission from Apple. Except as
|
||||
expressly stated in this notice, no other rights or licenses, express or implied,
|
||||
are granted by Apple herein, including but not limited to any patent rights that
|
||||
may be infringed by your derivative works or by other works in which the Apple
|
||||
Software may be incorporated.
|
||||
|
||||
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
|
||||
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
|
||||
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
|
||||
COMBINATION WITH YOUR PRODUCTS.
|
||||
|
||||
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
|
||||
OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
|
||||
(INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Change History (most recent first):
|
||||
*/
|
||||
|
||||
#include "GetPID.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
/*****************************************************
|
||||
* GetAllPIDsForProcessName
|
||||
*****************************************************
|
||||
* Purpose: This functions purpose is to lookup a BSD
|
||||
* process PID given the BSD process name. This function may
|
||||
* potentially return multiple PIDs for a given BSD process name
|
||||
* since several processes can have the same BSD process name.
|
||||
*
|
||||
* Parameters:
|
||||
* ProcessName A constant C-string. On calling
|
||||
* GetAllPIDsForProcessName this variable holds the BSD process name
|
||||
* used to do the process lookup. Note that the process name you need
|
||||
* to pass is the name of the BSD executable process. If trying
|
||||
* to find the PID of an regular OSX application you will need to pass the
|
||||
* name of the actual BSD executable inside an application bundle (rather
|
||||
* than the bundle name itself). In any case as a user you can find the
|
||||
* BSD process name of any process (including OSX applications) by
|
||||
* typing the command "ps -axcocommand,pid" in terminal.
|
||||
*
|
||||
* ArrayOfReturnedPIDs A pointer to a pre-allocated array of pid_t.
|
||||
* On calling GetAllPIDsForProcessName this variable must be a pointer to a
|
||||
* pre-allocated array of pid_t whos length (in number of pid_t entries) is defined
|
||||
* in ArrayOfPIDsLength. On successful return from GetAllPIDsForProcessName
|
||||
* this array will hold the PIDs of all processes which have a matching process
|
||||
* name to that specified in the ProcessName input variable. The number of actual
|
||||
* PIDs entered in the array starting at index zero will be the value returned
|
||||
* in NumberOfMatchesFound. On failed return if the error is a buffer overflow
|
||||
* error then the buffer will be filled to the max with PIDs which matched.
|
||||
* Otherwise on failed return the state of the array will be undefined. Note
|
||||
* the returned PID array is not sorted and is listed in order of process encountered.
|
||||
*
|
||||
* NumberOfPossiblePIDsInArray A unsigned integer. On calling
|
||||
* GetAllPIDsForProcessName this variable will hold the number of
|
||||
* pre-allocated PID entries which are in the ArrayOfReturnedPIDs for this functions
|
||||
* use. Note this value must have a value greater than zero.
|
||||
*
|
||||
* NumberOfMatchesFound An unsigned integer. On calling GetAllPIDsForProcessName
|
||||
* this variable will point to a pre-allocated unsigned integer. On return from
|
||||
* GetAllPIDsForProcessName this variable will contain the number of PIDs contained in the
|
||||
* ArrayOfReturnedPIDs. On failed return the value of the variable will be undefined.
|
||||
*
|
||||
* SysctlError A pointer to a pre-allocated integer. On failed return, this
|
||||
* variable represents the error returned from the sysctl command. On function
|
||||
* success this variable will have a value specified by the sysctl based on the
|
||||
* error that occurred. On success the variable will have the value zero.
|
||||
* Note this variable can also be NULL in which case the variable is ignored.
|
||||
*
|
||||
* *Function Result* A integer return value.
|
||||
* See result codes listed below.
|
||||
* Result Codes:
|
||||
* 0 Success. A set of process PIDs were found and are located in
|
||||
* ArrayOfReturnedPIDs array.
|
||||
* -1 Could not find a process with a matching process name
|
||||
* (i.e. process not found).
|
||||
* -2 Invalid arguments passed.
|
||||
* -3 Unable to get the size of sysctl buffer required
|
||||
* (consult SysctlError return value for more information)
|
||||
* -4 Unable to allocate memory to store BSD process information
|
||||
* (consult SysctlError return value for more information)
|
||||
* -5 The array passed to hold the returned PIDs is not large enough
|
||||
* to hold all PIDs of process with matching names.
|
||||
*
|
||||
*****************************************************/
|
||||
int GetAllPIDsForProcessName(const char* ProcessName,
|
||||
pid_t ArrayOfReturnedPIDs[],
|
||||
const unsigned int NumberOfPossiblePIDsInArray,
|
||||
unsigned int* NumberOfMatchesFound,
|
||||
int* SysctlError)
|
||||
{
|
||||
// --- Defining local variables for this function and initializing all to zero --- //
|
||||
int mib[6] = {0,0,0,0,0,0}; //used for sysctl call.
|
||||
int SuccessfullyGotProcessInformation;
|
||||
size_t sizeOfBufferRequired = 0; //set to zero to start with.
|
||||
int error = 0;
|
||||
long NumberOfRunningProcesses = 0;
|
||||
unsigned int Counter = 0;
|
||||
struct kinfo_proc* BSDProcessInformationStructure = NULL;
|
||||
pid_t CurrentExaminedProcessPID = 0;
|
||||
char* CurrentExaminedProcessName = NULL;
|
||||
|
||||
// --- Checking input arguments for validity --- //
|
||||
if (ProcessName == NULL) //need valid process name
|
||||
{
|
||||
return(kInvalidArgumentsError);
|
||||
}
|
||||
|
||||
if (ArrayOfReturnedPIDs == NULL) //need an actual array
|
||||
{
|
||||
return(kInvalidArgumentsError);
|
||||
}
|
||||
|
||||
if (NumberOfPossiblePIDsInArray <= 0)
|
||||
{
|
||||
//length of the array must be larger than zero.
|
||||
return(kInvalidArgumentsError);
|
||||
}
|
||||
|
||||
if (NumberOfMatchesFound == NULL) //need an integer for return.
|
||||
{
|
||||
return(kInvalidArgumentsError);
|
||||
}
|
||||
|
||||
|
||||
//--- Setting return values to known values --- //
|
||||
|
||||
//initalizing PID array so all values are zero
|
||||
memset(ArrayOfReturnedPIDs, 0, NumberOfPossiblePIDsInArray * sizeof(pid_t));
|
||||
|
||||
*NumberOfMatchesFound = 0; //no matches found yet
|
||||
|
||||
if (SysctlError != NULL) //only set sysctlError if it is present
|
||||
{
|
||||
*SysctlError = 0;
|
||||
}
|
||||
|
||||
//--- Getting list of process information for all processes --- //
|
||||
|
||||
/* Setting up the mib (Management Information Base) which is an array of integers where each
|
||||
* integer specifies how the data will be gathered. Here we are setting the MIB
|
||||
* block to lookup the information on all the BSD processes on the system. Also note that
|
||||
* every regular application has a recognized BSD process accociated with it. We pass
|
||||
* CTL_KERN, KERN_PROC, KERN_PROC_ALL to sysctl as the MIB to get back a BSD structure with
|
||||
* all BSD process information for all processes in it (including BSD process names)
|
||||
*/
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_PROC;
|
||||
mib[2] = KERN_PROC_ALL;
|
||||
|
||||
/* Here we have a loop set up where we keep calling sysctl until we finally get an unrecoverable error
|
||||
* (and we return) or we finally get a succesful result. Note with how dynamic the process list can
|
||||
* be you can expect to have a failure here and there since the process list can change between
|
||||
* getting the size of buffer required and the actually filling that buffer.
|
||||
*/
|
||||
SuccessfullyGotProcessInformation = FALSE;
|
||||
|
||||
while (SuccessfullyGotProcessInformation == FALSE)
|
||||
{
|
||||
/* Now that we have the MIB for looking up process information we will pass it to sysctl to get the
|
||||
* information we want on BSD processes. However, before we do this we must know the size of the buffer to
|
||||
* allocate to accomidate the return value. We can get the size of the data to allocate also using the
|
||||
* sysctl command. In this case we call sysctl with the proper arguments but specify no return buffer
|
||||
* specified (null buffer). This is a special case which causes sysctl to return the size of buffer required.
|
||||
*
|
||||
* First Argument: The MIB which is really just an array of integers. Each integer is a constant
|
||||
* representing what information to gather from the system. Check out the man page to know what
|
||||
* constants sysctl will work with. Here of course we pass our MIB block which was passed to us.
|
||||
* Second Argument: The number of constants in the MIB (array of integers). In this case there are three.
|
||||
* Third Argument: The output buffer where the return value from sysctl will be stored. In this case
|
||||
* we don't want anything return yet since we don't yet know the size of buffer needed. Thus we will
|
||||
* pass null for the buffer to begin with.
|
||||
* Forth Argument: The size of the output buffer required. Since the buffer itself is null we can just
|
||||
* get the buffer size needed back from this call.
|
||||
* Fifth Argument: The new value we want the system data to have. Here we don't want to set any system
|
||||
* information we only want to gather it. Thus, we pass null as the buffer so sysctl knows that
|
||||
* we have no desire to set the value.
|
||||
* Sixth Argument: The length of the buffer containing new information (argument five). In this case
|
||||
* argument five was null since we didn't want to set the system value. Thus, the size of the buffer
|
||||
* is zero or NULL.
|
||||
* Return Value: a return value indicating success or failure. Actually, sysctl will either return
|
||||
* zero on no error and -1 on error. The errno UNIX variable will be set on error.
|
||||
*/
|
||||
error = sysctl(mib, 3, NULL, &sizeOfBufferRequired, NULL, NULL);
|
||||
|
||||
/* If an error occurred then return the accociated error. The error itself actually is stored in the UNIX
|
||||
* errno variable. We can access the errno value using the errno global variable. We will return the
|
||||
* errno value as the sysctlError return value from this function.
|
||||
*/
|
||||
if (error != 0)
|
||||
{
|
||||
if (SysctlError != NULL)
|
||||
{
|
||||
*SysctlError = errno; //we only set this variable if the pre-allocated variable is given
|
||||
}
|
||||
|
||||
return(kErrorGettingSizeOfBufferRequired);
|
||||
}
|
||||
|
||||
/* Now we successful obtained the size of the buffer required for the sysctl call. This is stored in the
|
||||
* SizeOfBufferRequired variable. We will malloc a buffer of that size to hold the sysctl result.
|
||||
*/
|
||||
BSDProcessInformationStructure = (struct kinfo_proc*) malloc(sizeOfBufferRequired);
|
||||
|
||||
if (BSDProcessInformationStructure == NULL)
|
||||
{
|
||||
if (SysctlError != NULL)
|
||||
{
|
||||
*SysctlError = ENOMEM; //we only set this variable if the pre-allocated variable is given
|
||||
}
|
||||
|
||||
return(kUnableToAllocateMemoryForBuffer); //unrecoverable error (no memory available) so give up
|
||||
}
|
||||
|
||||
/* Now we have the buffer of the correct size to hold the result we can now call sysctl
|
||||
* and get the process information.
|
||||
*
|
||||
* First Argument: The MIB for gathering information on running BSD processes. The MIB is really
|
||||
* just an array of integers. Each integer is a constant representing what information to
|
||||
* gather from the system. Check out the man page to know what constants sysctl will work with.
|
||||
* Second Argument: The number of constants in the MIB (array of integers). In this case there are three.
|
||||
* Third Argument: The output buffer where the return value from sysctl will be stored. This is the buffer
|
||||
* which we allocated specifically for this purpose.
|
||||
* Forth Argument: The size of the output buffer (argument three). In this case its the size of the
|
||||
* buffer we already allocated.
|
||||
* Fifth Argument: The buffer containing the value to set the system value to. In this case we don't
|
||||
* want to set any system information we only want to gather it. Thus, we pass null as the buffer
|
||||
* so sysctl knows that we have no desire to set the value.
|
||||
* Sixth Argument: The length of the buffer containing new information (argument five). In this case
|
||||
* argument five was null since we didn't want to set the system value. Thus, the size of the buffer
|
||||
* is zero or NULL.
|
||||
* Return Value: a return value indicating success or failure. Actually, sysctl will either return
|
||||
* zero on no error and -1 on error. The errno UNIX variable will be set on error.
|
||||
*/
|
||||
error = sysctl(mib, 3, BSDProcessInformationStructure, &sizeOfBufferRequired, NULL, NULL);
|
||||
|
||||
//Here we successfully got the process information. Thus set the variable to end this sysctl calling loop
|
||||
if (error == 0)
|
||||
{
|
||||
SuccessfullyGotProcessInformation = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* failed getting process information we will try again next time around the loop. Note this is caused
|
||||
* by the fact the process list changed between getting the size of the buffer and actually filling
|
||||
* the buffer (something which will happen from time to time since the process list is dynamic).
|
||||
* Anyways, the attempted sysctl call failed. We will now begin again by freeing up the allocated
|
||||
* buffer and starting again at the beginning of the loop.
|
||||
*/
|
||||
free(BSDProcessInformationStructure);
|
||||
}
|
||||
}//end while loop
|
||||
|
||||
// --- Going through process list looking for processes with matching names --- //
|
||||
|
||||
/* Now that we have the BSD structure describing the running processes we will parse it for the desired
|
||||
* process name. First we will the number of running processes. We can determine
|
||||
* the number of processes running because there is a kinfo_proc structure for each process.
|
||||
*/
|
||||
NumberOfRunningProcesses = sizeOfBufferRequired / sizeof(struct kinfo_proc);
|
||||
|
||||
/* Now we will go through each process description checking to see if the process name matches that
|
||||
* passed to us. The BSDProcessInformationStructure has an array of kinfo_procs. Each kinfo_proc has
|
||||
* an extern_proc accociated with it in the kp_proc attribute. Each extern_proc (kp_proc) has the process name
|
||||
* of the process accociated with it in the p_comm attribute and the PID of that process in the p_pid attibute.
|
||||
* We test the process name by compairing the process name passed to us with the value in the p_comm value.
|
||||
* Note we limit the compairison to MAXCOMLEN which is the maximum length of a BSD process name which is used
|
||||
* by the system.
|
||||
*/
|
||||
for (Counter = 0 ; Counter < NumberOfRunningProcesses ; Counter++)
|
||||
{
|
||||
//Getting PID of process we are examining
|
||||
CurrentExaminedProcessPID = BSDProcessInformationStructure[Counter].kp_proc.p_pid;
|
||||
|
||||
//Getting name of process we are examining
|
||||
CurrentExaminedProcessName = BSDProcessInformationStructure[Counter].kp_proc.p_comm;
|
||||
|
||||
if ((CurrentExaminedProcessPID > 0) //Valid PID
|
||||
&& ((strncmp(CurrentExaminedProcessName, ProcessName, MAXCOMLEN) == 0))) //name matches
|
||||
{
|
||||
// --- Got a match add it to the array if possible --- //
|
||||
if ((*NumberOfMatchesFound + 1) > NumberOfPossiblePIDsInArray)
|
||||
{
|
||||
//if we overran the array buffer passed we release the allocated buffer give an error.
|
||||
free(BSDProcessInformationStructure);
|
||||
return(kPIDBufferOverrunError);
|
||||
}
|
||||
|
||||
//adding the value to the array.
|
||||
ArrayOfReturnedPIDs[*NumberOfMatchesFound] = CurrentExaminedProcessPID;
|
||||
|
||||
//incrementing our number of matches found.
|
||||
*NumberOfMatchesFound = *NumberOfMatchesFound + 1;
|
||||
}
|
||||
}//end looking through process list
|
||||
|
||||
free(BSDProcessInformationStructure); //done with allocated buffer so release.
|
||||
|
||||
if (*NumberOfMatchesFound == 0)
|
||||
{
|
||||
//didn't find any matches return error.
|
||||
return(kCouldNotFindRequestedProcess);
|
||||
}
|
||||
else
|
||||
{
|
||||
//found matches return success.
|
||||
return(kSuccess);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* GetPIDForProcessName
|
||||
*****************************************************
|
||||
* Purpose: A convience call for GetAllPIDsForProcessName().
|
||||
* This function looks up a process PID given a BSD process
|
||||
* name.
|
||||
*
|
||||
* Parameters:
|
||||
* ProcessName A constant C-string. On calling
|
||||
* GetPIDForProcessName this variable holds the BSD process name
|
||||
* used to do the process lookup. Note that the process name you need
|
||||
* to pass is the name of the BSD executable process. If trying
|
||||
* to find the PID of an regular OSX application you will need to pass the
|
||||
* name of the actual BSD executable inside an application bundle (rather
|
||||
* than the bundle name itself). In any case as a user you can find the
|
||||
* BSD process name of any process (including OSX applications) by
|
||||
* typing the command "ps -axcocommand,pid" in terminal.
|
||||
*
|
||||
* *Function Result* A integer return value.
|
||||
* See result codes listed below.
|
||||
* Result Codes:
|
||||
* >0 Success. The value returned is the PID of the
|
||||
* matching process.
|
||||
* -1 Error getting PID for requested process. This error can
|
||||
* be caused by several things. One is if no such process exists.
|
||||
* Another is if more than one process has the given name. The
|
||||
* thing to do here is to call GetAllPIDsForProcessName()
|
||||
* for complete error code or to get PIDs if there are multiple
|
||||
* processes with that name.
|
||||
*****************************************************/
|
||||
int GetPIDForProcessName(const char* ProcessName)
|
||||
{
|
||||
pid_t PIDArray[1] = {0};
|
||||
int Error = 0;
|
||||
int NumberOfMatches = 0;
|
||||
|
||||
/* Here we are calling the function GetAllPIDsForProcessName which wil give us the PIDs
|
||||
* of the process name we pass. Of course here we are hoping for a single PID return.
|
||||
* First Argument: The BSD process name of the process we want to lookup. In this case the
|
||||
* the process name passed to us.
|
||||
* Second Argument: A preallocated array of pid_t. This is where the PIDs of matching processes
|
||||
* will be placed on return. We pass the array we just allocated which is length one.
|
||||
* Third Argument: The number of pid_t entries located in the array of pid_t (argument 2). In this
|
||||
* case our array has one pid_t entry so pass one.
|
||||
* Forth Argument: On return this will hold the number of PIDs placed into the
|
||||
* pid_t array (array passed in argument 2).
|
||||
* Fifth Argument: Passing NULL to ignore this argument.
|
||||
* Return Value: An error indicating success (zero result) or failure (non-zero).
|
||||
*
|
||||
*/
|
||||
Error = GetAllPIDsForProcessName(ProcessName, PIDArray, 1, &NumberOfMatches, NULL);
|
||||
|
||||
if ((Error == 0) && (NumberOfMatches == 1))//success!
|
||||
{
|
||||
return((int) PIDArray[0]); //return the one PID we found.
|
||||
}
|
||||
else
|
||||
{
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
Executable
+169
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
File: GetPID.h
|
||||
|
||||
Description: This file defines a simple API to do process PID lookup based on process name.
|
||||
|
||||
Author: Chad Jones
|
||||
|
||||
Copyright: © Copyright 2003 Apple Computer, Inc. All rights reserved.
|
||||
|
||||
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
|
||||
("Apple") in consideration of your agreement to the following terms, and your
|
||||
use, installation, modification or redistribution of this Apple software
|
||||
constitutes acceptance of these terms. If you do not agree with these terms,
|
||||
please do not use, install, modify or redistribute this Apple software.
|
||||
|
||||
In consideration of your agreement to abide by the following terms, and subject
|
||||
to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
|
||||
copyrights in this original Apple software (the "Apple Software"), to use,
|
||||
reproduce, modify and redistribute the Apple Software, with or without
|
||||
modifications, in source and/or binary forms; provided that if you redistribute
|
||||
the Apple Software in its entirety and without modifications, you must retain
|
||||
this notice and the following text and disclaimers in all such redistributions of
|
||||
the Apple Software. Neither the name, trademarks, service marks or logos of
|
||||
Apple Computer, Inc. may be used to endorse or promote products derived from the
|
||||
Apple Software without specific prior written permission from Apple. Except as
|
||||
expressly stated in this notice, no other rights or licenses, express or implied,
|
||||
are granted by Apple herein, including but not limited to any patent rights that
|
||||
may be infringed by your derivative works or by other works in which the Apple
|
||||
Software may be incorporated.
|
||||
|
||||
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
|
||||
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
|
||||
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
|
||||
COMBINATION WITH YOUR PRODUCTS.
|
||||
|
||||
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
|
||||
OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
|
||||
(INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Change History (most recent first):
|
||||
*/
|
||||
#if !defined(__DTSSampleCode_GetPID__)
|
||||
#define __DTSSampleCode_GetPID__ 1
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// --- Defining constants for use with sample code --- //
|
||||
enum {kSuccess = 0,
|
||||
kCouldNotFindRequestedProcess = -1,
|
||||
kInvalidArgumentsError = -2,
|
||||
kErrorGettingSizeOfBufferRequired = -3,
|
||||
kUnableToAllocateMemoryForBuffer = -4,
|
||||
kPIDBufferOverrunError = -5};
|
||||
|
||||
/*****************************************************
|
||||
* GetAllPIDsForProcessName
|
||||
*****************************************************
|
||||
* Purpose: This functions purpose is to lookup a BSD
|
||||
* process PID given the BSD process name. This function may
|
||||
* potentially return multiple PIDs for a given BSD process name
|
||||
* since several processes can have the same BSD process name.
|
||||
*
|
||||
* Parameters:
|
||||
* ProcessName A constant C-string. On calling
|
||||
* GetAllPIDsForProcessName this variable holds the BSD process name
|
||||
* used to do the process lookup. Note that the process name you need
|
||||
* to pass is the name of the BSD executable process. If trying
|
||||
* to find the PID of an regular OSX application you will need to pass the
|
||||
* name of the actual BSD executable inside an application bundle (rather
|
||||
* than the bundle name itself). In any case as a user you can find the
|
||||
* BSD process name of any process (including OSX applications) by
|
||||
* typing the command "ps -axcocommand,pid" in terminal.
|
||||
*
|
||||
* ArrayOfReturnedPIDs A pointer to a pre-allocated array of pid_t.
|
||||
* On calling GetAllPIDsForProcessName this variable must be a pointer to a
|
||||
* pre-allocated array of pid_t whos length (in number of pid_t entries) is defined
|
||||
* in ArrayOfPIDsLength. On successful return from GetAllPIDsForProcessName
|
||||
* this array will hold the PIDs of all processes which have a matching process
|
||||
* name to that specified in the ProcessName input variable. The number of actual
|
||||
* PIDs entered in the array starting at index zero will be the value returned
|
||||
* in NumberOfMatchesFound. On failed return if the error is a buffer overflow
|
||||
* error then the buffer will be filled to the max with PIDs which matched.
|
||||
* Otherwise on failed return the state of the array will be undefined.
|
||||
*
|
||||
* NumberOfPossiblePIDsInArray A unsigned integer. On calling
|
||||
* GetAllPIDsForProcessName this variable will hold the number of
|
||||
* pre-allocated PID entries which are in the ArrayOfReturnedPIDs for this functions
|
||||
* use. Note this value must have a value greater than zero.
|
||||
*
|
||||
* NumberOfMatchesFound An unsigned integer. On calling GetAllPIDsForProcessName
|
||||
* this variable will point to a pre-allocated unsigned integer. On return from
|
||||
* GetAllPIDsForProcessName this variable will contain the number of PIDs contained in the
|
||||
* ArrayOfReturnedPIDs. On failed return the value of the variable will be undefined.
|
||||
*
|
||||
* SysctlError A pointer to a pre-allocated integer. On failed return, this
|
||||
* variable represents the error returned from the sysctl command. On function
|
||||
* success this variable will have a value specified by the sysctl based on the
|
||||
* error that occurred. On success the variable will have the value zero.
|
||||
* Note this variable can also be NULL in which case the variable is ignored.
|
||||
*
|
||||
* *Function Result* A integer return value.
|
||||
* See result codes listed below.
|
||||
* Result Codes:
|
||||
* 0 Success. A set of process PIDs were found and are located in
|
||||
* ArrayOfReturnedPIDs array.
|
||||
* -1 Could not find a process with a matching process name
|
||||
* (i.e. process not found).
|
||||
* -2 Invalid arguments passed.
|
||||
* -3 Unable to get the size of sysctl buffer required
|
||||
* (consult SysctlError return value for more information)
|
||||
* -4 Unable to allocate memory to store BSD process information
|
||||
* (consult SysctlError return value for more information)
|
||||
* -5 The array passed to hold the returned PIDs is not large enough
|
||||
* to hold all PIDs of process with matching names.
|
||||
*
|
||||
*****************************************************/
|
||||
int GetAllPIDsForProcessName(const char* ProcessName,
|
||||
pid_t ArrayOfReturnedPIDs[],
|
||||
const unsigned int NumberOfPossiblePIDsInArray,
|
||||
unsigned int* NumberOfMatchesFound,
|
||||
int* SysctlError); //Can be NULL
|
||||
|
||||
/*****************************************************
|
||||
* GetPIDForProcessName
|
||||
*****************************************************
|
||||
* Purpose: A convience call for GetAllPIDsForProcessName().
|
||||
* This function looks up a process PID given a BSD process
|
||||
* name.
|
||||
*
|
||||
* Parameters:
|
||||
* ProcessName A constant C-string. On calling
|
||||
* GetPIDForProcessName this variable holds the BSD process name
|
||||
* used to do the process lookup. Note that the process name you need
|
||||
* to pass is the name of the BSD executable process. If trying
|
||||
* to find the PID of an regular OSX application you will need to pass the
|
||||
* name of the actual BSD executable inside an application bundle (rather
|
||||
* than the bundle name itself). In any case as a user you can find the
|
||||
* BSD process name of any process (including OSX applications) by
|
||||
* typing the command "ps -axcocommand,pid" in terminal.
|
||||
*
|
||||
* *Function Result* A integer return value.
|
||||
* See result codes listed below.
|
||||
* Result Codes:
|
||||
* >=0 Success. The value returned is the PID of the
|
||||
* requested process.
|
||||
* -1 Error getting PID for requested process. This error can
|
||||
* be caused by several things. One is if no such process exists.
|
||||
* Another is if more than one process has the given name. The
|
||||
* Answer is to call GetAllPIDsForProcessName()
|
||||
* for complete error code or to get PIDs if there are multiple
|
||||
* processes with that name.
|
||||
*****************************************************/
|
||||
int GetPIDForProcessName(const char* ProcessName);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Executable
+981
@@ -0,0 +1,981 @@
|
||||
#include "S3Decompression.h"
|
||||
typedef UInt32 DWORD;
|
||||
typedef UInt16 WORD;
|
||||
typedef UInt8 BYTE;
|
||||
|
||||
#if UNITY_OSX
|
||||
#define BigEndian 1
|
||||
#else
|
||||
#define BigEndian 0
|
||||
#endif
|
||||
|
||||
struct DXTColBlock
|
||||
{
|
||||
WORD col0;
|
||||
WORD col1;
|
||||
|
||||
// no bit fields - use bytes
|
||||
BYTE row[4];
|
||||
};
|
||||
|
||||
struct DXTAlphaBlockExplicit
|
||||
{
|
||||
WORD row[4];
|
||||
};
|
||||
|
||||
struct DXTAlphaBlock3BitLinear
|
||||
{
|
||||
BYTE alpha0;
|
||||
BYTE alpha1;
|
||||
|
||||
BYTE stuff[6];
|
||||
};
|
||||
|
||||
#if BigEndian
|
||||
|
||||
// use cast to struct instead of RGBA_MAKE as struct is
|
||||
// much
|
||||
struct Color8888
|
||||
{
|
||||
BYTE a;
|
||||
BYTE b; // Last one is MSB, 1st is LSB.
|
||||
BYTE g; // order of the output ARGB or BGRA, etc...
|
||||
BYTE r; // change the order of names to change the
|
||||
};
|
||||
|
||||
static inline void ByteSwap(UInt16& i)
|
||||
{
|
||||
i = static_cast<UInt16>((i << 8) | (i >> 8));
|
||||
}
|
||||
|
||||
struct Color565
|
||||
{
|
||||
unsigned nBlue : 5; // order of names changes
|
||||
unsigned nGreen : 6; // byte order of output to 32 bit
|
||||
unsigned nRed : 5;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
static inline void ByteSwap(UInt16& i) { }
|
||||
|
||||
// use cast to struct instead of RGBA_MAKE as struct is
|
||||
// much
|
||||
struct Color8888
|
||||
{
|
||||
BYTE r; // change the order of names to change the
|
||||
BYTE g; // order of the output ARGB or BGRA, etc...
|
||||
BYTE b; // Last one is MSB, 1st is LSB.
|
||||
BYTE a;
|
||||
};
|
||||
|
||||
struct Color565
|
||||
{
|
||||
unsigned nBlue : 5; // order of names changes
|
||||
unsigned nGreen : 6; // byte order of output to 32 bit
|
||||
unsigned nRed : 5;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
inline void GetColorBlockColors( DXTColBlock * pBlock, Color8888 * col_0, Color8888 * col_1,
|
||||
Color8888 * col_2, Color8888 * col_3,
|
||||
WORD & wrd )
|
||||
{
|
||||
// There are 4 methods to use - see the Time_ functions.
|
||||
// 1st = shift = does normal approach per byte for color comps
|
||||
// 2nd = use freak variable bit field color565 for component extraction
|
||||
// 3rd = use super-freak DWORD adds BEFORE shifting the color components
|
||||
// This lets you do only 1 add per color instead of 3 BYTE adds and
|
||||
// might be faster
|
||||
// Call RunTimingSession() to run each of them & output result to txt file
|
||||
|
||||
|
||||
// freak variable bit structure method
|
||||
// normal math
|
||||
// This method is fastest
|
||||
WORD col0 = pBlock->col0;
|
||||
ByteSwap (col0);
|
||||
WORD col1 = pBlock->col1;
|
||||
ByteSwap (col1);
|
||||
|
||||
Color565 * pCol;
|
||||
|
||||
pCol = (Color565*) & (col0 );
|
||||
|
||||
col_0->a = 0xff;
|
||||
col_0->r = pCol->nRed;
|
||||
col_0->r <<= 3; // shift to full precision
|
||||
col_0->g = pCol->nGreen;
|
||||
col_0->g <<= 2;
|
||||
col_0->b = pCol->nBlue;
|
||||
col_0->b <<= 3;
|
||||
|
||||
pCol = (Color565*) & (col1 );
|
||||
col_1->a = 0xff;
|
||||
col_1->r = pCol->nRed;
|
||||
col_1->r <<= 3; // shift to full precision
|
||||
col_1->g = pCol->nGreen;
|
||||
col_1->g <<= 2;
|
||||
col_1->b = pCol->nBlue;
|
||||
col_1->b <<= 3;
|
||||
|
||||
|
||||
if( col0 > col1 )
|
||||
{
|
||||
// Four-color block: derive the other two colors.
|
||||
// 00 = color_0, 01 = color_1, 10 = color_2, 11 = color_3
|
||||
// These two bit codes correspond to the 2-bit fields
|
||||
// stored in the 64-bit block.
|
||||
|
||||
wrd = ((WORD)col_0->r * 2 + (WORD)col_1->r )/3;
|
||||
// no +1 for rounding
|
||||
// as bits have been shifted to 888
|
||||
col_2->r = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->g * 2 + (WORD)col_1->g )/3;
|
||||
col_2->g = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->b * 2 + (WORD)col_1->b )/3;
|
||||
col_2->b = (BYTE)wrd;
|
||||
col_2->a = 0xff;
|
||||
|
||||
wrd = ((WORD)col_0->r + (WORD)col_1->r *2 )/3;
|
||||
col_3->r = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->g + (WORD)col_1->g *2 )/3;
|
||||
col_3->g = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->b + (WORD)col_1->b *2 )/3;
|
||||
col_3->b = (BYTE)wrd;
|
||||
col_3->a = 0xff;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Three-color block: derive the other color.
|
||||
// 00 = color_0, 01 = color_1, 10 = color_2,
|
||||
// 11 = transparent.
|
||||
// These two bit codes correspond to the 2-bit fields
|
||||
// stored in the 64-bit block.
|
||||
|
||||
// explicit for each component, unlike some refrasts...
|
||||
|
||||
// TRACE("block has alpha\n");
|
||||
|
||||
wrd = ((WORD)col_0->r + (WORD)col_1->r )/2;
|
||||
col_2->r = (BYTE)wrd;
|
||||
wrd = ((WORD)col_0->g + (WORD)col_1->g )/2;
|
||||
col_2->g = (BYTE)wrd;
|
||||
wrd = ((WORD)col_0->b + (WORD)col_1->b )/2;
|
||||
col_2->b = (BYTE)wrd;
|
||||
col_2->a = 0xff;
|
||||
|
||||
col_3->r = 0x00; // random color to indicate alpha
|
||||
col_3->g = 0xff;
|
||||
col_3->b = 0xff;
|
||||
col_3->a = 0x00;
|
||||
|
||||
}
|
||||
} // Get color block colors (...)
|
||||
|
||||
|
||||
|
||||
inline void DecodeColorBlock( DWORD * pImPos, DXTColBlock * pColorBlock, int width,
|
||||
DWORD * col_0,
|
||||
DWORD * col_1, DWORD * col_2, DWORD * col_3 )
|
||||
{
|
||||
// width is width of image in pixels
|
||||
|
||||
|
||||
DWORD bits;
|
||||
int r,n;
|
||||
|
||||
// bit masks = 00000011, 00001100, 00110000, 11000000
|
||||
const DWORD masks[] = { 3, 12, 3 << 4, 3 << 6 };
|
||||
const int shift[] = { 0, 2, 4, 6 };
|
||||
|
||||
// r steps through lines in y
|
||||
for( r=0; r < 4; r++, pImPos += width-4 ) // no width*4 as DWORD ptr inc will *4
|
||||
{
|
||||
|
||||
// width * 4 bytes per pixel per line
|
||||
// each j dxtc row is 4 lines of pixels
|
||||
|
||||
// pImPos = (DWORD*)((DWORD)pBase + i*16 + (r+j*4) * m_nWidth * 4 );
|
||||
|
||||
// n steps through pixels
|
||||
for( n=0; n < 4; n++ )
|
||||
{
|
||||
bits = pColorBlock->row[r] & masks[n];
|
||||
bits >>= shift[n];
|
||||
// AssertIf (bits < 0 || bits > 3);
|
||||
switch( bits )
|
||||
{
|
||||
case 0 :
|
||||
*pImPos = *col_0;
|
||||
pImPos++; // increment to next DWORD
|
||||
break;
|
||||
case 1 :
|
||||
*pImPos = *col_1;
|
||||
pImPos++;
|
||||
break;
|
||||
case 2 :
|
||||
*pImPos = *col_2;
|
||||
pImPos++;
|
||||
break;
|
||||
case 3 :
|
||||
*pImPos = *col_3;
|
||||
pImPos++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline void DecodeAlphaExplicit( DWORD * pImPos, DXTAlphaBlockExplicit * pAlphaBlock,
|
||||
int width, DWORD alphazero )
|
||||
{
|
||||
// alphazero is a bit mask that when & with the image color
|
||||
// will zero the alpha bits, so if the image DWORDs are
|
||||
// ARGB then alphazero will be 0x00ffffff or if
|
||||
// RGBA then alphazero will be 0xffffff00
|
||||
// alphazero constructed automaticaly from field order of Color8888 structure
|
||||
|
||||
// decodes to 32 bit format only
|
||||
|
||||
int row, pix;
|
||||
|
||||
WORD wrd;
|
||||
|
||||
Color8888 col;
|
||||
col.r = col.g = col.b = 0;
|
||||
|
||||
|
||||
//TRACE("\n");
|
||||
|
||||
for( row=0; row < 4; row++, pImPos += width-4 )
|
||||
{
|
||||
// pImPow += pImPos += width-4 moves to next row down
|
||||
|
||||
wrd = pAlphaBlock->row[ row ];
|
||||
ByteSwap (wrd);
|
||||
|
||||
// TRACE("0x%.8x\t\t", wrd);
|
||||
|
||||
for( pix = 0; pix < 4; pix++ )
|
||||
{
|
||||
// zero the alpha bits of image pixel
|
||||
*pImPos &= alphazero;
|
||||
|
||||
col.a = wrd & 0x000f; // get only low 4 bits
|
||||
// col.a <<= 4; // shift to full byte precision
|
||||
// NOTE: with just a << 4 you'll never have alpha
|
||||
// of 0xff, 0xf0 is max so pure shift doesn't quite
|
||||
// cover full alpha range.
|
||||
// It's much cheaper than divide & scale though.
|
||||
// To correct for this, and get 0xff for max alpha,
|
||||
// or the low bits back in after left shifting
|
||||
col.a = col.a | (col.a << 4 ); // This allows max 4 bit alpha to be 0xff alpha
|
||||
// in final image, and is crude approach to full
|
||||
// range scale
|
||||
|
||||
*pImPos |= *((DWORD*)&col); // or the bits into the prev. nulled alpha
|
||||
|
||||
wrd >>= 4; // move next bits to lowest 4
|
||||
|
||||
pImPos++; // move to next pixel in the row
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BYTE gBits[4][4];
|
||||
WORD gAlphas[8];
|
||||
Color8888 gACol[4][4];
|
||||
|
||||
|
||||
inline void DecodeAlpha3BitLinear( DWORD * pImPos, DXTAlphaBlock3BitLinear * pAlphaBlock,
|
||||
int width, DWORD alphazero)
|
||||
{
|
||||
|
||||
gAlphas[0] = pAlphaBlock->alpha0;
|
||||
gAlphas[1] = pAlphaBlock->alpha1;
|
||||
|
||||
|
||||
// 8-alpha or 6-alpha block?
|
||||
|
||||
if( gAlphas[0] > gAlphas[1] )
|
||||
{
|
||||
// 8-alpha block: derive the other 6 alphas.
|
||||
// 000 = alpha_0, 001 = alpha_1, others are interpolated
|
||||
|
||||
gAlphas[2] = ( 6 * gAlphas[0] + gAlphas[1]) / 7; // bit code 010
|
||||
gAlphas[3] = ( 5 * gAlphas[0] + 2 * gAlphas[1]) / 7; // Bit code 011
|
||||
gAlphas[4] = ( 4 * gAlphas[0] + 3 * gAlphas[1]) / 7; // Bit code 100
|
||||
gAlphas[5] = ( 3 * gAlphas[0] + 4 * gAlphas[1]) / 7; // Bit code 101
|
||||
gAlphas[6] = ( 2 * gAlphas[0] + 5 * gAlphas[1]) / 7; // Bit code 110
|
||||
gAlphas[7] = ( gAlphas[0] + 6 * gAlphas[1]) / 7; // Bit code 111
|
||||
}
|
||||
else
|
||||
{
|
||||
// 6-alpha block: derive the other alphas.
|
||||
// 000 = alpha_0, 001 = alpha_1, others are interpolated
|
||||
|
||||
gAlphas[2] = (4 * gAlphas[0] + gAlphas[1]) / 5; // Bit code 010
|
||||
gAlphas[3] = (3 * gAlphas[0] + 2 * gAlphas[1]) / 5; // Bit code 011
|
||||
gAlphas[4] = (2 * gAlphas[0] + 3 * gAlphas[1]) / 5; // Bit code 100
|
||||
gAlphas[5] = ( gAlphas[0] + 4 * gAlphas[1]) / 5; // Bit code 101
|
||||
gAlphas[6] = 0; // Bit code 110
|
||||
gAlphas[7] = 255; // Bit code 111
|
||||
}
|
||||
|
||||
|
||||
// Decode 3-bit fields into array of 16 BYTES with same value
|
||||
|
||||
// first two rows of 4 pixels each:
|
||||
// pRows = (Alpha3BitRows*) & ( pAlphaBlock->stuff[0] );
|
||||
const DWORD mask = 0x00000007; // bits = 00 00 01 11
|
||||
|
||||
DWORD bits = *( (DWORD*) & ( pAlphaBlock->stuff[0] ));
|
||||
|
||||
gBits[0][0] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[0][1] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[0][2] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[0][3] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[1][0] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[1][1] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[1][2] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[1][3] = (BYTE)( bits & mask );
|
||||
|
||||
// now for last two rows:
|
||||
|
||||
bits = *( (DWORD*) & ( pAlphaBlock->stuff[3] )); // last 3 bytes
|
||||
|
||||
gBits[2][0] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[2][1] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[2][2] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[2][3] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[3][0] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[3][1] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[3][2] = (BYTE)( bits & mask );
|
||||
bits >>= 3;
|
||||
gBits[3][3] = (BYTE)( bits & mask );
|
||||
|
||||
|
||||
// decode the codes into alpha values
|
||||
int row, pix;
|
||||
|
||||
|
||||
for( row = 0; row < 4; row++ )
|
||||
{
|
||||
for( pix=0; pix < 4; pix++ )
|
||||
{
|
||||
gACol[row][pix].a = (BYTE) gAlphas[ gBits[row][pix] ];
|
||||
|
||||
// AssertIf( gACol[row][pix].r != 0 );
|
||||
// AssertIf( gACol[row][pix].g != 0 );
|
||||
// AssertIf( gACol[row][pix].b == 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Write out alpha values to the image bits
|
||||
|
||||
for( row=0; row < 4; row++, pImPos += width-4 )
|
||||
{
|
||||
// pImPow += pImPos += width-4 moves to next row down
|
||||
|
||||
for( pix = 0; pix < 4; pix++ )
|
||||
{
|
||||
// zero the alpha bits of image pixel
|
||||
*pImPos &= alphazero;
|
||||
|
||||
*pImPos |= *((DWORD*) &(gACol[row][pix])); // or the bits into the prev. nulled alpha
|
||||
pImPos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DecompressDXT1(int width, int height, DWORD* m_pCompBytes, DWORD* m_pDecompBytes)
|
||||
{
|
||||
// This was hacked up pretty quick & slopily
|
||||
// decompresses to 32 bit format 0xARGB
|
||||
|
||||
int xblocks, yblocks;
|
||||
|
||||
xblocks = width / 4;
|
||||
yblocks = height / 4;
|
||||
|
||||
|
||||
int i,j;
|
||||
|
||||
DWORD * pBase = (DWORD*) m_pDecompBytes;
|
||||
DWORD * pImPos = (DWORD*) pBase; // pos in decompressed data
|
||||
WORD * pPos = (WORD*) m_pCompBytes; // pos in compressed data
|
||||
|
||||
DXTColBlock * pBlock;
|
||||
|
||||
Color8888 col_0, col_1, col_2, col_3;
|
||||
|
||||
|
||||
WORD wrd;
|
||||
|
||||
for( j=0; j < yblocks; j++ )
|
||||
{
|
||||
// 8 bytes per block
|
||||
pBlock = (DXTColBlock*) ( (DWORD)m_pCompBytes + j * xblocks * 8 );
|
||||
|
||||
|
||||
for( i=0; i < xblocks; i++, pBlock++ )
|
||||
{
|
||||
|
||||
// inline func:
|
||||
GetColorBlockColors( pBlock, &col_0, &col_1, &col_2, &col_3, wrd );
|
||||
|
||||
|
||||
// now decode the color block into the bitmap bits
|
||||
// inline func:
|
||||
|
||||
pImPos = (DWORD*)((DWORD)pBase + i*16 + (j*4) * width * 4 );
|
||||
|
||||
|
||||
DecodeColorBlock( pImPos, pBlock, width, (DWORD*)&col_0, (DWORD*)&col_1,
|
||||
(DWORD*)&col_2, (DWORD*)&col_3 );
|
||||
|
||||
|
||||
// Set to RGB test pattern
|
||||
// pImPos = (DWORD*)((DWORD)pBase + i*4 + j*m_nWidth*4);
|
||||
// *pImPos = ((i*4) << 16) | ((j*4) << 8 ) | ( (63-i)*4 );
|
||||
|
||||
// checkerboard of only col_0 and col_1 basis colors:
|
||||
// pImPos = (DWORD*)((DWORD)pBase + i*8 + j*m_nWidth*8);
|
||||
// *pImPos = *((DWORD*)&col_0);
|
||||
// pImPos += 1 + m_nWidth;
|
||||
// *pImPos = *((DWORD*)&col_1);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DecompressDXT3(int width, int height, DWORD* m_pCompBytes, DWORD* m_pDecompBytes)
|
||||
{
|
||||
int xblocks, yblocks;
|
||||
|
||||
xblocks = width / 4;
|
||||
yblocks = height / 4;
|
||||
|
||||
|
||||
int i,j;
|
||||
|
||||
DWORD * pBase = (DWORD*) m_pDecompBytes;
|
||||
DWORD * pImPos = (DWORD*) pBase; // pos in decompressed data
|
||||
WORD * pPos = (WORD*) m_pCompBytes; // pos in compressed data
|
||||
|
||||
DXTColBlock * pBlock;
|
||||
DXTAlphaBlockExplicit * pAlphaBlock;
|
||||
|
||||
Color8888 col_0, col_1, col_2, col_3;
|
||||
|
||||
|
||||
WORD wrd;
|
||||
|
||||
// fill alphazero with appropriate value to zero out alpha when
|
||||
// alphazero is ANDed with the image color 32 bit DWORD:
|
||||
col_0.a = 0;
|
||||
col_0.r = col_0.g = col_0.b = 0xff;
|
||||
DWORD alphazero = *((DWORD*) &col_0);
|
||||
|
||||
|
||||
for( j=0; j < yblocks; j++ )
|
||||
{
|
||||
// 8 bytes per block
|
||||
// 1 block for alpha, 1 block for color
|
||||
|
||||
pBlock = (DXTColBlock*) ( (DWORD)m_pCompBytes + j * xblocks * 16 );
|
||||
|
||||
for( i=0; i < xblocks; i++, pBlock ++ )
|
||||
{
|
||||
|
||||
// inline
|
||||
// Get alpha block
|
||||
|
||||
pAlphaBlock = (DXTAlphaBlockExplicit*) pBlock;
|
||||
|
||||
// inline func:
|
||||
// Get color block & colors
|
||||
pBlock++;
|
||||
GetColorBlockColors( pBlock, &col_0, &col_1, &col_2, &col_3, wrd );
|
||||
|
||||
// Decode the color block into the bitmap bits
|
||||
// inline func:
|
||||
|
||||
pImPos = (DWORD*)((DWORD)pBase + i*16 + (j*4) * width * 4 );
|
||||
|
||||
|
||||
DecodeColorBlock( pImPos, pBlock, width, (DWORD*)&col_0, (DWORD*)&col_1,
|
||||
(DWORD*)&col_2, (DWORD*)&col_3 );
|
||||
|
||||
// Overwrite the previous alpha bits with the alpha block
|
||||
// info
|
||||
// inline func:
|
||||
DecodeAlphaExplicit( pImPos, pAlphaBlock, width, alphazero );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DecompressDXT5(int width, int height, DWORD* m_pCompBytes, DWORD* m_pDecompBytes)
|
||||
{
|
||||
|
||||
int xblocks, yblocks;
|
||||
|
||||
xblocks = width / 4;
|
||||
yblocks = height / 4;
|
||||
|
||||
|
||||
int i,j;
|
||||
|
||||
DWORD * pBase = (DWORD*) m_pDecompBytes;
|
||||
DWORD * pImPos = (DWORD*) pBase; // pos in decompressed data
|
||||
WORD * pPos = (WORD*) m_pCompBytes; // pos in compressed data
|
||||
|
||||
DXTColBlock * pBlock;
|
||||
DXTAlphaBlock3BitLinear * pAlphaBlock;
|
||||
|
||||
Color8888 col_0, col_1, col_2, col_3;
|
||||
WORD wrd;
|
||||
|
||||
// fill alphazero with appropriate value to zero out alpha when
|
||||
// alphazero is ANDed with the image color 32 bit DWORD:
|
||||
col_0.a = 0;
|
||||
col_0.r = col_0.g = col_0.b = 0xff;
|
||||
DWORD alphazero = *((DWORD*) &col_0);
|
||||
|
||||
////////////////////////////////
|
||||
// TRACE("blocks: x: %d y: %d\n", xblocks, yblocks );
|
||||
|
||||
for( j=0; j < yblocks; j++ )
|
||||
{
|
||||
// 8 bytes per block
|
||||
// 1 block for alpha, 1 block for color
|
||||
|
||||
pBlock = (DXTColBlock*) ( (DWORD)m_pCompBytes + j * xblocks * 16 );
|
||||
|
||||
for( i=0; i < xblocks; i++, pBlock ++ )
|
||||
{
|
||||
|
||||
// inline
|
||||
// Get alpha block
|
||||
|
||||
pAlphaBlock = (DXTAlphaBlock3BitLinear*) pBlock;
|
||||
|
||||
// inline func:
|
||||
// Get color block & colors
|
||||
pBlock++;
|
||||
|
||||
GetColorBlockColors( pBlock, &col_0, &col_1, &col_2, &col_3, wrd );
|
||||
|
||||
// Decode the color block into the bitmap bits
|
||||
// inline func:
|
||||
|
||||
pImPos = (DWORD*)((DWORD)pBase + i*16 + (j*4) * width * 4 );
|
||||
|
||||
|
||||
DecodeColorBlock( pImPos, pBlock, width, (DWORD*)&col_0, (DWORD*)&col_1,
|
||||
(DWORD*)&col_2, (DWORD*)&col_3 );
|
||||
|
||||
// Overwrite the previous alpha bits with the alpha block
|
||||
// info
|
||||
|
||||
DecodeAlpha3BitLinear( pImPos, pAlphaBlock, width, alphazero );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
} // dxt5
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
inline void GetColorBlockColors_m2( DXTColBlock * pBlock, Color8888 * col_0, Color8888 * col_1,
|
||||
Color8888 * col_2, Color8888 * col_3,
|
||||
WORD & wrd )
|
||||
{
|
||||
// method 2
|
||||
// freak variable bit structure method
|
||||
// normal math
|
||||
|
||||
Color565 * pCol;
|
||||
|
||||
pCol = (Color565*) & (pBlock->col0 );
|
||||
|
||||
col_0->a = 0xff;
|
||||
col_0->r = pCol->nRed;
|
||||
col_0->r <<= 3; // shift to full precision
|
||||
col_0->g = pCol->nGreen;
|
||||
col_0->g <<= 2;
|
||||
col_0->b = pCol->nBlue;
|
||||
col_0->b <<= 3;
|
||||
|
||||
pCol = (Color565*) & (pBlock->col1 );
|
||||
col_1->a = 0xff;
|
||||
col_1->r = pCol->nRed;
|
||||
col_1->r <<= 3; // shift to full precision
|
||||
col_1->g = pCol->nGreen;
|
||||
col_1->g <<= 2;
|
||||
col_1->b = pCol->nBlue;
|
||||
col_1->b <<= 3;
|
||||
|
||||
|
||||
if( pBlock->col0 > pBlock->col1 )
|
||||
{
|
||||
// Four-color block: derive the other two colors.
|
||||
// 00 = color_0, 01 = color_1, 10 = color_2, 11 = color_3
|
||||
// These two bit codes correspond to the 2-bit fields
|
||||
// stored in the 64-bit block.
|
||||
|
||||
wrd = ((WORD)col_0->r * 2 + (WORD)col_1->r )/3;
|
||||
// no +1 for rounding
|
||||
// as bits have been shifted to 888
|
||||
col_2->r = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->g * 2 + (WORD)col_1->g )/3;
|
||||
col_2->g = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->b * 2 + (WORD)col_1->b )/3;
|
||||
col_2->b = (BYTE)wrd;
|
||||
col_2->a = 0xff;
|
||||
|
||||
wrd = ((WORD)col_0->r + (WORD)col_1->r *2 )/3;
|
||||
col_3->r = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->g + (WORD)col_1->g *2 )/3;
|
||||
col_3->g = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->b + (WORD)col_1->b *2 )/3;
|
||||
col_3->b = (BYTE)wrd;
|
||||
col_3->a = 0xff;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Three-color block: derive the other color.
|
||||
// 00 = color_0, 01 = color_1, 10 = color_2,
|
||||
// 11 = transparent.
|
||||
// These two bit codes correspond to the 2-bit fields
|
||||
// stored in the 64-bit block.
|
||||
|
||||
// explicit for each component, unlike some refrasts...
|
||||
|
||||
// TRACE("block has alpha\n");
|
||||
|
||||
wrd = ((WORD)col_0->r + (WORD)col_1->r )/2;
|
||||
col_2->r = (BYTE)wrd;
|
||||
wrd = ((WORD)col_0->g + (WORD)col_1->g )/2;
|
||||
col_2->g = (BYTE)wrd;
|
||||
wrd = ((WORD)col_0->b + (WORD)col_1->b )/2;
|
||||
col_2->b = (BYTE)wrd;
|
||||
col_2->a = 0xff;
|
||||
|
||||
col_3->r = 0x00; // random color to indicate alpha
|
||||
col_3->g = 0xff;
|
||||
col_3->b = 0xff;
|
||||
col_3->a = 0x00;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
inline void GetColorBlockColors_m3( DXTColBlock * pBlock, Color8888 * col_0, Color8888 * col_1,
|
||||
Color8888 * col_2, Color8888 * col_3,
|
||||
WORD & wrd )
|
||||
{
|
||||
// method 3
|
||||
//////////////////////////////////////////////////////
|
||||
// super-freak variable bit structure with
|
||||
// Cool Math Trick (tm)
|
||||
|
||||
// Do 2/3 1/3 math BEFORE bit shift on the whole DWORD
|
||||
// as the fields will NEVER carry into the next
|
||||
// or overflow!! =)
|
||||
|
||||
Color565 * pCol;
|
||||
|
||||
pCol = (Color565*) & (pBlock->col0 );
|
||||
|
||||
col_0->a = 0x00; // must set to 0 to avoid overflow in DWORD add
|
||||
col_0->r = pCol->nRed;
|
||||
col_0->g = pCol->nGreen;
|
||||
col_0->b = pCol->nBlue;
|
||||
|
||||
pCol = (Color565*) & (pBlock->col1 );
|
||||
col_1->a = 0x00;
|
||||
col_1->r = pCol->nRed;
|
||||
col_1->g = pCol->nGreen;
|
||||
col_1->b = pCol->nBlue;
|
||||
|
||||
if( pBlock->col0 > pBlock->col1 )
|
||||
{
|
||||
*((DWORD*)col_2) = ( (*((DWORD*)col_0)) * 2 + (*((DWORD*)col_1)) );
|
||||
|
||||
*((DWORD*)col_3) = ( (*((DWORD*)col_0)) + (*((DWORD*)col_1)) * 2 );
|
||||
|
||||
// now shift to appropriate precision & divide by 3.
|
||||
col_2->r = ((WORD)col_2->r << 3) / (WORD)3;
|
||||
col_2->g = ((WORD)col_2->g << 2) / (WORD)3;
|
||||
col_2->b = ((WORD)col_2->b << 3) / (WORD)3;
|
||||
|
||||
col_3->r = ((WORD)col_3->r << 3) / (WORD)3;
|
||||
col_3->g = ((WORD)col_3->g << 2) / (WORD)3;
|
||||
col_3->b = ((WORD)col_3->b << 3) / (WORD)3;
|
||||
|
||||
|
||||
col_0->a = 0xff; // now set appropriate alpha
|
||||
col_1->a = 0xff;
|
||||
col_2->a = 0xff;
|
||||
col_3->a = 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
*((DWORD*)col_2) = ( (*((DWORD*)col_0)) + (*((DWORD*)col_1)) );
|
||||
|
||||
// now shift to appropriate precision & divide by 2.
|
||||
// << 3 ) / 2 == << 2
|
||||
// << 2 ) / 2 == << 1
|
||||
col_2->r = ((WORD)col_2->r << 2);
|
||||
col_2->g = ((WORD)col_2->g << 1);
|
||||
col_2->b = ((WORD)col_2->b << 2);
|
||||
|
||||
col_2->a = 0xff;
|
||||
|
||||
col_3->a = 0x00; //
|
||||
col_3->r = 0x00; // random color to indicate alpha
|
||||
col_3->g = 0xff;
|
||||
col_3->b = 0xff;
|
||||
}
|
||||
|
||||
// now shift orig color components
|
||||
col_0->r <<= 3;
|
||||
col_0->g <<= 2;
|
||||
col_0->b <<= 3;
|
||||
|
||||
col_1->r <<= 3;
|
||||
col_1->g <<= 2;
|
||||
col_1->b <<= 3;
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
inline void GetColorBlockColors_m4( DXTColBlock * pBlock, Color8888 * col_0, Color8888 * col_1,
|
||||
Color8888 * col_2, Color8888 * col_3,
|
||||
WORD & wrd )
|
||||
{
|
||||
|
||||
// m1 color extraction from 5-6-5
|
||||
// m3 color math on DWORD before bit shift to full precision
|
||||
|
||||
|
||||
wrd = pBlock->col0;
|
||||
col_0->a = 0x00; // must set to 0 to avoid possible overflow & carry to next field in DWORD add
|
||||
|
||||
// extract r,g,b bits
|
||||
col_0->b = (unsigned char) wrd & 0x1f; // 0x1f = 0001 1111 to mask out upper 3 bits
|
||||
wrd >>= 5;
|
||||
col_0->g = (unsigned char) wrd & 0x3f; // 0x3f = 0011 1111 to mask out upper 2 bits
|
||||
wrd >>= 6;
|
||||
col_0->r = (unsigned char) wrd & 0x1f;
|
||||
|
||||
|
||||
// same for col # 2:
|
||||
wrd = pBlock->col1;
|
||||
col_1->a = 0x00; // must set to 0 to avoid possible overflow in DWORD add
|
||||
|
||||
// extract r,g,b bits
|
||||
col_1->b = (unsigned char) wrd & 0x1f;
|
||||
wrd >>= 5;
|
||||
col_1->g = (unsigned char) wrd & 0x3f;
|
||||
wrd >>= 6;
|
||||
col_1->r = (unsigned char) wrd & 0x1f;
|
||||
|
||||
|
||||
if( pBlock->col0 > pBlock->col1 )
|
||||
{
|
||||
*((DWORD*)col_2) = ( (*((DWORD*)col_0)) * 2 + (*((DWORD*)col_1)) );
|
||||
|
||||
*((DWORD*)col_3) = ( (*((DWORD*)col_0)) + (*((DWORD*)col_1)) * 2 );
|
||||
|
||||
// shift to appropriate precision & divide by 3.
|
||||
col_2->r = ((WORD)col_2->r << 3) / (WORD)3;
|
||||
col_2->g = ((WORD)col_2->g << 2) / (WORD)3;
|
||||
col_2->b = ((WORD)col_2->b << 3) / (WORD)3;
|
||||
|
||||
col_3->r = ((WORD)col_3->r << 3) / (WORD)3;
|
||||
col_3->g = ((WORD)col_3->g << 2) / (WORD)3;
|
||||
col_3->b = ((WORD)col_3->b << 3) / (WORD)3;
|
||||
|
||||
|
||||
col_0->a = 0xff; // set appropriate alpha
|
||||
col_1->a = 0xff;
|
||||
col_2->a = 0xff;
|
||||
col_3->a = 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
*((DWORD*)col_2) = ( (*((DWORD*)col_0)) + (*((DWORD*)col_1)) );
|
||||
|
||||
// shift to appropriate precision & divide by 2.
|
||||
// << 3 ) / 2 == << 2
|
||||
// << 2 ) / 2 == << 1
|
||||
col_2->r = ((WORD)col_2->r << 2);
|
||||
col_2->g = ((WORD)col_2->g << 1);
|
||||
col_2->b = ((WORD)col_2->b << 2);
|
||||
|
||||
col_2->a = 0xff;
|
||||
|
||||
col_3->a = 0x00; //
|
||||
col_3->r = 0x00; // random color to indicate alpha
|
||||
col_3->g = 0xff;
|
||||
col_3->b = 0xff;
|
||||
}
|
||||
|
||||
// shift orig color components to full precision
|
||||
col_0->r <<= 3;
|
||||
col_0->g <<= 2;
|
||||
col_0->b <<= 3;
|
||||
|
||||
col_1->r <<= 3;
|
||||
col_1->g <<= 2;
|
||||
col_1->b <<= 3;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
inline void GetColorBlockColors_m1( DXTColBlock * pBlock, Color8888 * col_0, Color8888 * col_1,
|
||||
Color8888 * col_2, Color8888 * col_3,
|
||||
WORD & wrd )
|
||||
{
|
||||
|
||||
// Method 1:
|
||||
// Shifty method
|
||||
|
||||
wrd = pBlock->col0;
|
||||
col_0->a = 0xff;
|
||||
|
||||
// extract r,g,b bits
|
||||
col_0->b = (unsigned char) wrd;
|
||||
col_0->b <<= 3; // shift to full precision
|
||||
wrd >>= 5;
|
||||
col_0->g = (unsigned char) wrd;
|
||||
col_0->g <<= 2; // shift to full precision
|
||||
wrd >>= 6;
|
||||
col_0->r = (unsigned char) wrd;
|
||||
col_0->r <<= 3; // shift to full precision
|
||||
|
||||
|
||||
// same for col # 2:
|
||||
wrd = pBlock->col1;
|
||||
col_1->a = 0xff;
|
||||
|
||||
// extract r,g,b bits
|
||||
col_1->b = (unsigned char) wrd;
|
||||
col_1->b <<= 3; // shift to full precision
|
||||
wrd >>= 5;
|
||||
col_1->g = (unsigned char) wrd;
|
||||
col_1->g <<= 2; // shift to full precision
|
||||
wrd >>= 6;
|
||||
col_1->r = (unsigned char) wrd;
|
||||
col_1->r <<= 3; // shift to full precision
|
||||
|
||||
|
||||
|
||||
// use this for all but the super-freak math method
|
||||
|
||||
if( pBlock->col0 > pBlock->col1 )
|
||||
{
|
||||
// Four-color block: derive the other two colors.
|
||||
// 00 = color_0, 01 = color_1, 10 = color_2, 11 = color_3
|
||||
// These two bit codes correspond to the 2-bit fields
|
||||
// stored in the 64-bit block.
|
||||
|
||||
wrd = ((WORD)col_0->r * 2 + (WORD)col_1->r )/3;
|
||||
// no +1 for rounding
|
||||
// as bits have been shifted to 888
|
||||
col_2->r = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->g * 2 + (WORD)col_1->g )/3;
|
||||
col_2->g = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->b * 2 + (WORD)col_1->b )/3;
|
||||
col_2->b = (BYTE)wrd;
|
||||
col_2->a = 0xff;
|
||||
|
||||
wrd = ((WORD)col_0->r + (WORD)col_1->r *2 )/3;
|
||||
col_3->r = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->g + (WORD)col_1->g *2 )/3;
|
||||
col_3->g = (BYTE)wrd;
|
||||
|
||||
wrd = ((WORD)col_0->b + (WORD)col_1->b *2 )/3;
|
||||
col_3->b = (BYTE)wrd;
|
||||
col_3->a = 0xff;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Three-color block: derive the other color.
|
||||
// 00 = color_0, 01 = color_1, 10 = color_2,
|
||||
// 11 = transparent.
|
||||
// These two bit codes correspond to the 2-bit fields
|
||||
// stored in the 64-bit block.
|
||||
|
||||
// explicit for each component, unlike some refrasts...
|
||||
|
||||
// TRACE("block has alpha\n");
|
||||
|
||||
wrd = ((WORD)col_0->r + (WORD)col_1->r )/2;
|
||||
col_2->r = (BYTE)wrd;
|
||||
wrd = ((WORD)col_0->g + (WORD)col_1->g )/2;
|
||||
col_2->g = (BYTE)wrd;
|
||||
wrd = ((WORD)col_0->b + (WORD)col_1->b )/2;
|
||||
col_2->b = (BYTE)wrd;
|
||||
col_2->a = 0xff;
|
||||
|
||||
col_3->r = 0x00; // random color to indicate alpha
|
||||
col_3->g = 0xff;
|
||||
col_3->b = 0xff;
|
||||
col_3->a = 0x00;
|
||||
|
||||
}
|
||||
} // Get color block colors (...)
|
||||
|
||||
*/
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#ifndef S3DECOMPRESSION_H
|
||||
#define S3DECOMPRESSION_H
|
||||
|
||||
void DecompressDXT1(int width, int height, UInt32* m_pCompBytes, UInt32* m_pDecompBytes);
|
||||
void DecompressDXT3(int width, int height, UInt32* m_pCompBytes, UInt32* m_pDecompBytes);
|
||||
void DecompressDXT5(int width, int height, UInt32* m_pCompBytes, UInt32* m_pDecompBytes);
|
||||
|
||||
#endif
|
||||
+292
@@ -0,0 +1,292 @@
|
||||
//ai.cpp
|
||||
//the game's AI system for computer-controlled opponents
|
||||
#include <math.h>
|
||||
#include "entities.h"
|
||||
#include "controls.h"
|
||||
#include "carphysics.h"
|
||||
#include "gameframe.h"
|
||||
#include "roads.h"
|
||||
|
||||
#define kAIMaxThottleSlip 0.05
|
||||
#define kAIMinSpinAngularVelo (6*PI)
|
||||
#define kAIThrottleTime 0.2
|
||||
#define kAIThrottleReleaseTime 0.4
|
||||
#define kAIMaxBrakeSlip 0.05
|
||||
#define kAIBrakeTime 0.4
|
||||
#define kAIBrakeReleaseTime 0.2
|
||||
#define kAIWaypointAheadDistance (gGameInfo->arcade==kGameModeTurbo?25:15)
|
||||
#define kAIMaxSteering 2
|
||||
|
||||
float AISteering(tCarDefinition *car,tGameEntity *entity,tVector3 wayPoint,float *overSteer)
|
||||
{
|
||||
// Will adjust the cars steering in order to make the car head to wayPoint.
|
||||
|
||||
tVector3 carDir=!Vector(MatrixGetZVector(entity->dir)->x,0,MatrixGetZVector(entity->dir)->z);
|
||||
tVector3 wayDir=!Vector(entity->pos.x-wayPoint.x,0,entity->pos.z-wayPoint.z);
|
||||
tVector3 veloDir=(VectorZero(entity->velo)?carDir:!entity->velo);
|
||||
*overSteer=(carDir%veloDir).y;
|
||||
float angleSin=(carDir%wayDir).y;
|
||||
if(fabs(angleSin)>1.0)
|
||||
angleSin=sign(angleSin);
|
||||
float angle=-asin(angleSin);
|
||||
float steering=angle/car->wheels[0].maxAngle;
|
||||
if(steering>kAIMaxSteering)steering=kAIMaxSteering;
|
||||
if(steering<-kAIMaxSteering)steering=-kAIMaxSteering;
|
||||
return steering;
|
||||
}
|
||||
|
||||
#define kAIMinCarDistance 4
|
||||
#define kAICollisionPredictPrecission 20
|
||||
#define kAIMaxCollisionDelay 5.0
|
||||
#define kAICarLength 2
|
||||
#define kAIVeloAdd 2.0
|
||||
|
||||
float AIGetCollisionDelay(tGameEntity *entity,tGameEntity **obstacle)
|
||||
{
|
||||
tVector2 basePos1=Vector(entity->pos.x,entity->pos.z);
|
||||
tVector2 velo1=Vector(entity->velo.x,entity->velo.z);
|
||||
tVector2 dir1=Vector(MatrixGetZVector(entity->dir)->x,MatrixGetZVector(entity->dir)->z);
|
||||
float fVelo1=~velo1;
|
||||
if(fVelo1>0.1)
|
||||
velo1=velo1*((1/fVelo1)*(fVelo1+kAIVeloAdd));
|
||||
else
|
||||
velo1=dir1*kAIVeloAdd;
|
||||
int minDelay=kAICollisionPredictPrecission;
|
||||
for(int i=0;i<gGameInfo->numPlayers;i++)
|
||||
if(gCarEntities[i]!=entity)
|
||||
{
|
||||
tVector2 pos2=Vector(gCarEntities[i]->pos.x,gCarEntities[i]->pos.z);
|
||||
tVector2 diff=pos2-basePos1;
|
||||
if(sqr(diff)<sqr(120)&&diff*dir1>=0)
|
||||
//is the other car close in front of us?
|
||||
{
|
||||
tVector2 pos1=basePos1;
|
||||
tVector2 velo2=Vector(gCarEntities[i]->velo.x,gCarEntities[i]->velo.z);
|
||||
tVector2 dir2=Vector(MatrixGetZVector(gCarEntities[i]->dir)->x,MatrixGetZVector(gCarEntities[i]->dir)->z);
|
||||
for(int j=0;j<kAICollisionPredictPrecission&&j<minDelay;j++)
|
||||
{
|
||||
pos1=pos1+velo1*(kAIMaxCollisionDelay/kAICollisionPredictPrecission);
|
||||
pos2=pos2+velo2*(kAIMaxCollisionDelay/kAICollisionPredictPrecission);
|
||||
if(sqr(pos1+dir1*kAICarLength-pos2+dir2*kAICarLength)<sqr(kAIMinCarDistance))
|
||||
{minDelay=j;*obstacle=gCarEntities[i];}
|
||||
else if(sqr(pos1-dir1*kAICarLength-pos2+dir2*kAICarLength)<sqr(kAIMinCarDistance))
|
||||
{minDelay=j;*obstacle=gCarEntities[i];}
|
||||
else if(sqr(pos1+dir1*kAICarLength-pos2-dir2*kAICarLength)<sqr(kAIMinCarDistance))
|
||||
{minDelay=j;*obstacle=gCarEntities[i];}
|
||||
else if(sqr(pos1-dir1*kAICarLength-pos2-dir2*kAICarLength)<sqr(kAIMinCarDistance))
|
||||
{minDelay=j;*obstacle=gCarEntities[i];}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (minDelay+1)*(kAIMaxCollisionDelay/kAICollisionPredictPrecission);
|
||||
}
|
||||
|
||||
//Calculate the Maximal Throttle an AI player may get, which may be more than
|
||||
//100% to help the AI a little.
|
||||
float AIMaxThrottle(tCarPhysics *phys)
|
||||
{
|
||||
if(gFrameCount*kFrameTime<kStartGameDelaySeconds)
|
||||
return 1;
|
||||
//"power cycle" for more random AI behavior
|
||||
float base=1.0+0.25*sin((gFrameCount*kFrameTime)*0.1+phys->aiPowerCycle);
|
||||
|
||||
//help for players in the back of the field.
|
||||
float aid=(-phys->lead-8)/22;
|
||||
if(aid<0)aid=0;
|
||||
if(aid>1)aid=1;
|
||||
|
||||
return base+aid*0.6;
|
||||
}
|
||||
|
||||
void AIBrakeThrottle(tCarDefinition *car,tCarPhysics *phys,float velo,float optimalVelo)
|
||||
{
|
||||
float driveSlip=0,slip=0,angularVelo=0;
|
||||
float maxThrottle=AIMaxThrottle(phys);
|
||||
|
||||
for(int i=0;i<car->numWheels;i++)
|
||||
{
|
||||
driveSlip+=phys->wheels[i].slip*car->wheels[i].powered;
|
||||
slip+=phys->wheels[i].slip;
|
||||
angularVelo+=fabs(phys->wheels[i].angularVelo*car->wheels[i].powered);
|
||||
}
|
||||
slip/=car->numWheels;
|
||||
float maxSlip=velo<20?0.2-velo/20*(0.2-kAIMaxThottleSlip):kAIMaxThottleSlip;
|
||||
|
||||
if((driveSlip*sign(phys->gear)<maxSlip||angularVelo<kAIMinSpinAngularVelo||(phys->clutch<=1&&phys->gear<=1)) //traction control
|
||||
&&velo<optimalVelo) //we don't want to drive too fast!
|
||||
phys->throttle+=kFrameTime*(1/kAIThrottleTime);
|
||||
else
|
||||
phys->throttle-=kFrameTime*(1/kAIThrottleReleaseTime);
|
||||
|
||||
if(phys->throttle>maxThrottle)
|
||||
phys->throttle=maxThrottle;
|
||||
else if(phys->throttle<phys->idleThrottle)
|
||||
phys->throttle=phys->idleThrottle;
|
||||
|
||||
if((velo>optimalVelo+1||optimalVelo==0))
|
||||
{
|
||||
if((-slip*sign(angularVelo)<kAIMaxBrakeSlip)||(phys->brake<0.1))
|
||||
phys->brake+=kFrameTime*(1/kAIBrakeTime);
|
||||
else
|
||||
phys->brake-=kFrameTime*(1/kAIBrakeTime);
|
||||
phys->arcadeBrake+=kFrameTime*(1/kAIBrakeTime);
|
||||
}
|
||||
else{
|
||||
phys->arcadeBrake-=kFrameTime*(1/kAIBrakeReleaseTime);
|
||||
phys->brake-=kFrameTime*(1/kAIBrakeReleaseTime);
|
||||
}
|
||||
|
||||
if(phys->arcadeBrake>1)
|
||||
phys->arcadeBrake=1;
|
||||
else if(phys->arcadeBrake<0)
|
||||
phys->arcadeBrake=0;
|
||||
if(phys->brake>1)
|
||||
phys->brake=1;
|
||||
else if(phys->brake<0)
|
||||
phys->brake=0;
|
||||
}
|
||||
|
||||
#define kAIOvertakeRoadAnalyseDistance 50 //length of approaching road section to be evaluated for overtaking
|
||||
#define kAIOvertakeMinVeloDiffPossible 10
|
||||
#define kAIOvertakeAbortDistance 60
|
||||
#define kAIOvertakeFinishDistance 20
|
||||
#define kAIOvertakeLaneChangeTime 3.0
|
||||
|
||||
void AIEvaluateOvertaking(tGameEntity *overtaker,tGameEntity *obstacle,float track)
|
||||
{
|
||||
tCarPhysics *phys=(tCarPhysics*)overtaker->physics;
|
||||
if(phys->overtaking)//are we already overtaking?
|
||||
return;
|
||||
if(overtaker->velo**MatrixGetZVector(overtaker->dir)<=obstacle->velo**MatrixGetZVector(overtaker->dir)) //are we faster?
|
||||
return;
|
||||
float minTrack,maxTrack,minSpeed;
|
||||
RoadGetWayPointData(overtaker->lastRoadIndex,kAIOvertakeRoadAnalyseDistance,&minTrack,&maxTrack,&minSpeed);
|
||||
if(minSpeed*0.75<~obstacle->velo+kAIOvertakeMinVeloDiffPossible) //is it possible to drive faster than obstacle all the time?
|
||||
return;
|
||||
// if(fabs(minTrack-maxTrack)>1)
|
||||
// return;
|
||||
phys->overtaking=obstacle;
|
||||
phys->overtakeSide=fabs(1+minTrack)>fabs(1-maxTrack)?-1:1;
|
||||
}
|
||||
|
||||
void ControlEntityAIInput(tGameEntity *entity)
|
||||
//The game's AI - adjusts all the controls of the car passed in entity.
|
||||
{
|
||||
if(entity->physicsType!=kPhysicsTypeCar)//is entity really a car?
|
||||
return;
|
||||
tCarPhysics *phys=(tCarPhysics*)entity->physics;
|
||||
tCarDefinition *car=&(phys->car);
|
||||
float velo=~entity->velo;
|
||||
|
||||
|
||||
//determine course
|
||||
float optimalVelo;
|
||||
float track=phys->overTakeProgress+0.4*sin((gFrameCount*kFrameTime)*0.16+phys->aiRouteCycle);
|
||||
if(track<-1)track=-1;
|
||||
else if(track>1)track=1;
|
||||
tVector3 wayPoint=RoadGetNextWaypoint(entity->pos,&entity->lastRoadIndex,&track,&optimalVelo,kAIWaypointAheadDistance);
|
||||
|
||||
if(gGameInfo->arcade==kGameModeArcade||gGameInfo->arcade==kGameModeTurbo)
|
||||
optimalVelo*=1.3;
|
||||
|
||||
if(phys->lapCount>gGameInfo->numLaps)
|
||||
optimalVelo=0;
|
||||
|
||||
//see if we are about to crash into another car if we are to remain on our course.
|
||||
tGameEntity *obstacle;
|
||||
float del=AIGetCollisionDelay(entity,&obstacle);
|
||||
|
||||
//if we will crash into another car within the next 5 seconds, see if we can overtake
|
||||
if(del<=5)
|
||||
AIEvaluateOvertaking(entity,obstacle,track);
|
||||
|
||||
if(del>5&&phys->stuckTime>10*kFPS)
|
||||
//if we are stuck, recover car.
|
||||
{
|
||||
RoadCenterCar(entity);
|
||||
phys->overtaking=NULL;
|
||||
phys->stuckTime=0;
|
||||
}
|
||||
|
||||
//if we are overtaking
|
||||
//phys->lightFlags&=~(kLightFlagLIndLight|kLightFlagRIndLight);
|
||||
if(phys->overtaking)
|
||||
{
|
||||
if(fabs(phys->overTakeProgress)<1)
|
||||
{
|
||||
phys->overTakeProgress+=(1/kAIOvertakeLaneChangeTime)*kFrameTime*sign(phys->overtakeSide);
|
||||
if(fabs(phys->overTakeProgress)>1)
|
||||
phys->overTakeProgress=sign(phys->overTakeProgress);
|
||||
/*if(phys->lapCount<=gGameInfo->numLaps)
|
||||
phys->lightFlags|=(phys->overtakeSide==(gGameInfo->reverse?-1:1)?kLightFlagLIndLight:kLightFlagRIndLight);*/
|
||||
}
|
||||
float dist=-(phys->overtaking->pos-entity->pos)**MatrixGetZVector(entity->dir);
|
||||
if(dist>kAIOvertakeFinishDistance)//are we finished overtaking?
|
||||
phys->overtaking=NULL;
|
||||
else if(dist<-kAIOvertakeAbortDistance)//or are we too slow to overtake?
|
||||
phys->overtaking=NULL;
|
||||
if(fabs(phys->overtakeSide-track)<0.5)
|
||||
phys->overtaking=NULL;
|
||||
}
|
||||
else if(fabs(phys->overTakeProgress)>0)
|
||||
{
|
||||
int s=sign(phys->overTakeProgress);
|
||||
phys->overTakeProgress-=(1/kAIOvertakeLaneChangeTime)*kFrameTime*s;
|
||||
//if(phys->lapCount<=gGameInfo->numLaps)
|
||||
//phys->lightFlags|=(s==-1?kLightFlagLIndLight:kLightFlagRIndLight);
|
||||
if(s!=sign(phys->overTakeProgress))
|
||||
phys->overTakeProgress=0;
|
||||
}
|
||||
|
||||
//steering
|
||||
float overSteer;
|
||||
phys->steering=AISteering(car,entity,wayPoint,&overSteer);
|
||||
|
||||
//brake / throttle
|
||||
AIBrakeThrottle(car,phys,velo,optimalVelo);
|
||||
|
||||
if(gFrameCount*kFrameTime>=kStartGameDelaySeconds)
|
||||
{
|
||||
//gear shifting / clutch control
|
||||
if(phys->gear==0)
|
||||
{
|
||||
phys->gear=1;
|
||||
phys->lastGearSwitch=gFrameCount*kFrameTime;
|
||||
}
|
||||
if(phys->gear>=1&&(gFrameCount-1)*kFrameTime>phys->lastGearSwitch+car->gearSwitchTime&&gFrameCount*kFrameTime>=kStartGameDelaySeconds+1.5)
|
||||
{
|
||||
if(phys->rpm>car->maxRPM&&phys->gear<car->numGears-2)
|
||||
{
|
||||
phys->gear++;
|
||||
phys->lastGearSwitch=gFrameCount*kFrameTime;
|
||||
}
|
||||
if(phys->rpm<car->shiftDownRPM&&phys->gear>1)
|
||||
{
|
||||
phys->gear--;
|
||||
phys->lastGearSwitch=gFrameCount*kFrameTime;
|
||||
}
|
||||
}
|
||||
|
||||
if(gFrameCount*kFrameTime<phys->lastGearSwitch+car->gearSwitchTime)
|
||||
{
|
||||
float switchTime=(gFrameCount*kFrameTime-phys->lastGearSwitch)/car->gearSwitchTime;
|
||||
phys->clutch=switchTime;
|
||||
if(phys->rpm<2000)
|
||||
phys->clutch=(phys->rpm-car->idleRPM)/(2000-car->idleRPM);
|
||||
if(switchTime<0.5)
|
||||
phys->throttle=phys->idleThrottle;
|
||||
}
|
||||
else
|
||||
if(phys->rpm<2000)
|
||||
phys->clutch=(phys->rpm-car->idleRPM)/(2000-car->idleRPM);
|
||||
else
|
||||
phys->clutch=1;
|
||||
}
|
||||
|
||||
if(overSteer*velo>20)
|
||||
if(car->wheels[2].powered)
|
||||
{
|
||||
phys->clutch=0;
|
||||
phys->throttle=0;
|
||||
}
|
||||
}
|
||||
Executable
+1338
File diff suppressed because it is too large
Load Diff
Executable
+214
@@ -0,0 +1,214 @@
|
||||
#ifndef __CARPHYSICS
|
||||
#define __CARPHYSICS
|
||||
|
||||
#include "fileio.h"
|
||||
#include "vectors.h"
|
||||
#include "entities.h"
|
||||
#include "gameinitexit.h"
|
||||
|
||||
#define kMaxWheels 6
|
||||
|
||||
enum{
|
||||
kLightFlagDriveLight=1<<0,
|
||||
kLightFlagFogLight=1<<2,
|
||||
kLightFlagRevLight=1<<3,
|
||||
kLightFlagBrakeLight=1<<4,
|
||||
kLightFlagLIndLight=1<<5,
|
||||
kLightFlagRIndLight=1<<6,
|
||||
kLightFlagHorn=1<<7
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
tVector3 pos;
|
||||
int texture;
|
||||
float powered;
|
||||
float maxAngle;
|
||||
float maxSuspension; //m
|
||||
float radius; //m
|
||||
float width;
|
||||
float loadSensitivity;
|
||||
float stickyness;
|
||||
float grip;
|
||||
float rollCenter;
|
||||
float braked,handbraked;
|
||||
float tolerance;
|
||||
float inertia;
|
||||
float tilt;
|
||||
float friction;
|
||||
tFileRef model;
|
||||
tFileRef customBrakeModel;
|
||||
int noShadow;
|
||||
} tWheelDefinition;
|
||||
|
||||
#define kFatalDamage 400
|
||||
#define kEngineDamage 300
|
||||
#define kSuspensionDamage 200
|
||||
|
||||
|
||||
typedef struct{
|
||||
char name[64];
|
||||
char describtion[256];
|
||||
int requirements,conflicts;
|
||||
float mass;
|
||||
float frontLift,rearLift;
|
||||
float frontMaxSuspension,rearMaxSuspension;
|
||||
float frontWheelWidth,rearWheelWidth;
|
||||
float frontAirResistance;
|
||||
float powerPercent,torquePercent;
|
||||
float finalDriveRatio,topGearRatio;
|
||||
float engineInertia;
|
||||
float gearSwitchTime;
|
||||
float differentialLockCoefficient;
|
||||
float frontSwayBar,rearSwayBar;
|
||||
float track;
|
||||
float maxRPM;
|
||||
float exhaustFire;
|
||||
float damperStrength;
|
||||
tVector3 massCenter;
|
||||
int hasGraphic;
|
||||
tFileRef model;
|
||||
int price;
|
||||
int group;
|
||||
} tAddOnDefinition;
|
||||
|
||||
typedef struct{
|
||||
float frontAirResistance,sideAirResistance,topAirResistance;
|
||||
float frontLift,rearLift;
|
||||
float mass; //kg
|
||||
float power; //W
|
||||
float torque; //Nm
|
||||
float powerRPM,torqueRPM; //revs per minute
|
||||
float clutchRPM;
|
||||
float idleRPM,jerkRPM,maxRPM;
|
||||
float shiftUpRPM,shiftDownRPM,shiftUpRPMFix;
|
||||
float finalDriveRatio;
|
||||
float differentialLockCoefficient;
|
||||
float supsensionFriction,damperStrength;
|
||||
float engineInertia;
|
||||
float engineFriction,engineBaseFriction,engineRPMFriction;
|
||||
float maxClutchTorqueTransfer;
|
||||
float zeroRPMSoundGain,fullRPMSoundGain,zeroThrottleSoundGain,fullThrottleSoundGain;
|
||||
float zeroRPMSoundPitch,fullRPMSoundPitch,zeroThrottleSoundPitch,fullThrottleSoundPitch;
|
||||
float gearSwitchTime;
|
||||
float exhaustFire;
|
||||
float frontSwayBar,rearSwayBar;
|
||||
float aiSpeedIndex;
|
||||
int numGears,numWheels,numLights,numAddOns;
|
||||
int numColors;
|
||||
int initialAddOns;
|
||||
int challengeRequirements;
|
||||
int demoAvailable,builtIn;
|
||||
tVector3 massCenter;
|
||||
tVector3 inertia;
|
||||
tVector3 steeringWheelPos;
|
||||
tVector3 driverPos;
|
||||
tVector3 exhaust1Pos,exhaust2Pos;
|
||||
tVector3 frontLicensePlatePos,rearLicensePlatePos;
|
||||
float steeringWheelAngle,steeringWheelTurns,steeringWheelRadius;
|
||||
tFileRef steeringWheelTexture;
|
||||
tFileRef model,interiorModel,shadowModel;
|
||||
tFileRef engineSample,hallSample,turboSample,hornSample;
|
||||
float hornPitch;
|
||||
int numCollBoxes;
|
||||
int noDriverModel;
|
||||
float maxCollRadius;
|
||||
float *gearRatios;
|
||||
tWheelDefinition *wheels;
|
||||
tLightDefinition *lights;
|
||||
tAddOnDefinition *addOns;
|
||||
tVector3 *colors;
|
||||
int *colorLoaded;
|
||||
tCollBox *coll;
|
||||
char carName[64];
|
||||
int year;
|
||||
int magic;
|
||||
int secret;
|
||||
int price;
|
||||
float displacement;
|
||||
float turboGain;
|
||||
} tCarDefinition;
|
||||
|
||||
typedef struct{
|
||||
float angle;
|
||||
float suspension; //m
|
||||
float slipVelo,slip,slipAngle;
|
||||
float rotation;
|
||||
float angularVelo;
|
||||
float glow;
|
||||
int lastTrack;
|
||||
int onGround;
|
||||
int surfaceType;
|
||||
} tWheelPhysics;
|
||||
|
||||
#define kNumLastCollisions 32
|
||||
typedef struct{
|
||||
int frameCount;
|
||||
tVector3 attackPoint;
|
||||
tVector3 veloDiff;
|
||||
float rotationFactor;
|
||||
} tCollisionStruct;
|
||||
|
||||
typedef struct{
|
||||
tCarDefinition car;
|
||||
int addOns; //flags for add-ons installed.
|
||||
int color;
|
||||
float aiPowerCycle; //for AI cars: start of AI power cycle which makes AI cars behave more randomly
|
||||
float aiRouteCycle;
|
||||
int gear; //current gear car is in
|
||||
int lastGear;
|
||||
int lightFlags; //which lights are on
|
||||
float echo; //is the car in a tunnel?
|
||||
int lap; //internal lap counter for position determination (not neccesarily ==lapCount)
|
||||
int lapCount; //lap counter
|
||||
int wrongDriectionFrames; //number of Frames the car is moving into the wrong Direction
|
||||
int lapTimes[kMaxLaps+1]; //frame Count each time the finish line was crossed
|
||||
int finishTime; //frame Count the race was finished or is prognosed to be finished
|
||||
int lappedPlayers[kMaxPlayers];
|
||||
int averageSpeedFrames; //number of frames used to calculate average speed so far.
|
||||
float maxSpeed,averageSpeed,accel100,accel200,accelQuarter,accelKM,odo;
|
||||
float position;
|
||||
int checkPoint;
|
||||
float lead;
|
||||
float rpm;
|
||||
float engineAngularVelo,drivetrainAngularVelo;
|
||||
float clutchTorque;
|
||||
float throttle,oldThrottle,steering,brake,arcadeBrake,handbrake,clutch;
|
||||
float idleThrottle;
|
||||
float lastGearSwitch;
|
||||
float arcadeSteerVelo,arcadeDraftBoost;
|
||||
float maxSlip,maxAngle;
|
||||
float noisePriority;
|
||||
float dirt;
|
||||
int crashTime; //the last frame in which all four wheels have been on the ground.
|
||||
int stuckTime; //the last frame in which the car seemed to make some progress (ai)
|
||||
int collision; //has the car collided with something solid this frame? (for getting stuck detection)
|
||||
int onGround;
|
||||
tGameEntity *overtaking;
|
||||
int overtakeSide;
|
||||
float overTakeProgress;
|
||||
tVector3 lastSamplePos;
|
||||
float dirtStretch[5];
|
||||
tWheelPhysics wheels[kMaxWheels];
|
||||
UInt64 regCode;
|
||||
char *plateName;
|
||||
float damage;
|
||||
float turboRPM;
|
||||
tCollisionStruct lastCollisions[kNumLastCollisions];
|
||||
} tCarPhysics;
|
||||
|
||||
typedef struct{
|
||||
tVector3 pos,velo,groundNormal;
|
||||
tVector3 roadForce;
|
||||
int onGround;
|
||||
float bump;
|
||||
float inertia;
|
||||
float oldAngle;
|
||||
float normalForce,suspensionForce;
|
||||
} tWheelCalcData;
|
||||
|
||||
void InstallCarAddOns(tCarPhysics *phys);
|
||||
float CalcDraftFactor(tGameEntity *car1);
|
||||
void CarPhysicsEntity(tGameEntity *carEntity);
|
||||
void CarMotionEntity(tGameEntity *carEntity);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,819 @@
|
||||
#include "stdtypes.h"
|
||||
#include "reg_tool_3.h"
|
||||
#include "rt3_redline.h"
|
||||
|
||||
|
||||
#include <OpenGL/gl.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "gametime.h"
|
||||
#include "gamemem.h"
|
||||
#include "fileio.h"
|
||||
#include "rendercar.h"
|
||||
#include "carphysics.h"
|
||||
#include "screen.h"
|
||||
#include "controls.h"
|
||||
#include "environment.h"
|
||||
#include "transparency.h"
|
||||
#include "renderframe.h"
|
||||
#include "text.h"
|
||||
#include "interface.h"
|
||||
#include "gameinitexit.h"
|
||||
#include "carselection.h"
|
||||
#include "config.h"
|
||||
#include "interfaceutil.h"
|
||||
#include "stencil.h"
|
||||
#include "gamesystem.h"
|
||||
#include "textures.h"
|
||||
#include "challenges.h"
|
||||
#include "gamesound.h"
|
||||
#include "random.h"
|
||||
|
||||
#define REGISTERED (RT3_IsRegistered())
|
||||
|
||||
char *StripName(char *aName);
|
||||
|
||||
int CompareCars(const void *a,const void *b)
|
||||
{
|
||||
tCarDefinition *cara=(tCarDefinition*)FileGetParsedDataPtr(*(tFileRef*)a,kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
tCarDefinition *carb=(tCarDefinition*)FileGetParsedDataPtr(*(tFileRef*)b,kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
if(!REGISTERED)
|
||||
if(cara->demoAvailable!=carb->demoAvailable)
|
||||
return carb->demoAvailable-cara->demoAvailable;
|
||||
return _stricmp(StripName(cara->carName),StripName(carb->carName));
|
||||
}
|
||||
|
||||
void GetAvailableCars(tFileRef *availableCars,int *carCount,int onlyBuiltIn,int onlyAvailable)
|
||||
{
|
||||
*carCount=0;
|
||||
for(int i=0;i<gFileTableSize;i++)
|
||||
if(*carCount<kMaxCars)
|
||||
if(char *extension=FileGetExtension(i))
|
||||
if(!_stricmp(extension,kFileTypeCarDefinition))
|
||||
{
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(i,kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
if((car->builtIn||!onlyBuiltIn)&&HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData))
|
||||
availableCars[(*carCount)++]=i;
|
||||
if(car->shiftUpRPM<car->maxRPM*0.8)
|
||||
printf("%s: %f/%f\n",car->carName,car->shiftUpRPM,car->maxRPM);
|
||||
}
|
||||
if(!onlyAvailable)
|
||||
for(int i=0;i<gFileTableSize;i++)
|
||||
if(*carCount<kMaxCars)
|
||||
if(char *extension=FileGetExtension(i))
|
||||
if(!_stricmp(extension,kFileTypeCarDefinition))
|
||||
{
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(i,kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
if((car->builtIn||!onlyBuiltIn)&&!HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData)&&!car->secret)
|
||||
availableCars[(*carCount)++]=i;
|
||||
}
|
||||
qsort(availableCars,*carCount,sizeof(tFileRef),CompareCars);
|
||||
}
|
||||
|
||||
#define kSpecsXPos 0.9
|
||||
#define kSpecsYPos 0.6
|
||||
#define kSpecsSize 0.03
|
||||
#define kSpecsOffset 0.07
|
||||
#define kSpecsAlign kTextAlignRight
|
||||
|
||||
//#define kColorsXPos 0.5
|
||||
//#define kColorsYPos 0.2
|
||||
#define kColorsXPos 0.42
|
||||
#define kColorsYPos -0.3
|
||||
#define kColorsWidth 0.04
|
||||
#define kColorsHeight 0.02
|
||||
//#define kColorsOffset 0.025
|
||||
#define kColorsOffset 0.05
|
||||
#define kPointerSize 0.03
|
||||
|
||||
void CarSelectionDrawBackground(int mode)
|
||||
{
|
||||
char title[256];
|
||||
|
||||
switch(mode)
|
||||
{
|
||||
case kCarSelectionQuickMode:
|
||||
strcpy(title,"Select Car:");
|
||||
break;
|
||||
|
||||
case kCarSelectionEnemyMode:
|
||||
strcpy(title,"Select Opponent Car:");
|
||||
break;
|
||||
|
||||
case kCarSelectionDisplayMode:
|
||||
strcpy(title,"New Car Unlocked!");
|
||||
break;
|
||||
|
||||
}
|
||||
InterfaceDrawBackground(-1,-1,0,0,0,0,1);
|
||||
TextPrintfToBufferFormated(Vector(kTitlePosX,kTitlePosY),0.08,kTextAlignLeft,title);
|
||||
}
|
||||
|
||||
void CarSelectionDrawCar(tFileRef carRef,float time,int addOns,int color)
|
||||
{
|
||||
tGameEntity carEntity,cameraEntity;
|
||||
tCarPhysics *phys=(tCarPhysics*)MemoryAllocateZeroedBlock(sizeof(tCarPhysics));
|
||||
cameraEntity.pos=Vector(0,1.5,0);
|
||||
carEntity.pos=Vector(0,0,7);
|
||||
*MatrixGetZVector(cameraEntity.dir)=!(carEntity.pos-cameraEntity.pos);
|
||||
*MatrixGetYVector(cameraEntity.dir)=Vector(0,1,0);
|
||||
MatrixReAdjust(cameraEntity.dir);
|
||||
carEntity.pos.x-=0.5;
|
||||
carEntity.pos.y-=1.0;
|
||||
MatrixIdentity(carEntity.dir);
|
||||
MatrixRotY(carEntity.dir,time*PI/4);
|
||||
|
||||
carEntity.renderType=kRenderTypeCar;
|
||||
carEntity.physicsType=kPhysicsTypeCar;
|
||||
carEntity.physicsData=carRef;
|
||||
carEntity.physics=phys;
|
||||
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(carRef,kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
phys->car=*car;
|
||||
phys->car.wheels=(tWheelDefinition*)MemoryAllocateBlock(sizeof(tWheelDefinition)*car->numWheels);
|
||||
MemoryMove(phys->car.wheels,car->wheels,sizeof(tWheelDefinition)*car->numWheels);
|
||||
phys->addOns=addOns;
|
||||
phys->color=color;
|
||||
InstallCarAddOns(phys);
|
||||
car=&phys->car;
|
||||
|
||||
for(int i=0;i<car->numWheels;i++)
|
||||
phys->wheels[i].suspension=car->wheels[i].maxSuspension/2;
|
||||
|
||||
tGameEntity *oldCameraEntity=gCameraEntity;
|
||||
gCameraEntity=&cameraEntity;
|
||||
SetupTranslation(carEntity.pos,carEntity.dir);
|
||||
glColorMask(0,0,0,0);
|
||||
glBegin(GL_QUADS);
|
||||
glVertex3f(-100,0,100);
|
||||
glVertex3f(100,0,100);
|
||||
glVertex3f(100,0,-100);
|
||||
glVertex3f(-100,0,-100);
|
||||
glEnd();
|
||||
glColorMask(1,1,1,1);
|
||||
|
||||
carEntity.pos.y=-1-car->wheels->pos.y+car->wheels->maxSuspension/2+car->wheels->radius;
|
||||
SetupTranslation(carEntity.pos,carEntity.dir);
|
||||
|
||||
glPushAttrib(GL_LIGHTING_BIT+GL_POLYGON_BIT+GL_COLOR_BUFFER_BIT+GL_TEXTURE_BIT);
|
||||
CarRenderEntity(&carEntity,gConfig->interiorDisplay?true:false,false);
|
||||
glPopAttrib();
|
||||
|
||||
for(int i=1;i<=gConfig->stencil;i++)
|
||||
{
|
||||
gStencilZoom=0.9+0.1*i/(float)gConfig->stencil;
|
||||
SetupTranslation(carEntity.pos,carEntity.dir);
|
||||
glPushAttrib(GL_ENABLE_BIT+GL_POLYGON_BIT);
|
||||
CarRenderEntityShadow(&carEntity,6);
|
||||
glPopAttrib();
|
||||
RenderStencilLayer(true,gConfig->stencil);
|
||||
}
|
||||
DrawTransparentPolys(NULL);
|
||||
|
||||
MemoryFreeBlock(phys->car.wheels);
|
||||
MemoryFreeBlock(phys);
|
||||
|
||||
gCameraEntity=oldCameraEntity;
|
||||
|
||||
}
|
||||
|
||||
void CarSelectionDrawSpecs(tFileRef *availableCars,int numAvailable,int selected,int mode,int *available)
|
||||
{
|
||||
//if(fadeName)
|
||||
//gTextOpacity=1;
|
||||
|
||||
for(int i=-3;i<=3;i++)
|
||||
{
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(availableCars[(selected+i+numAvailable)%numAvailable],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
TextPrintfToBufferFormatedColored(Vector(-kSpecsXPos,0.4-i*0.1-fabs(i)*0.008),0.05-fabs(i)*0.008,kTextAlignLeft,1,1,1,1-fabs(i*0.15)-(i?0.3:0),car->carName);
|
||||
}
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selected],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
// TextPrintfToBufferFormated(Vector(kSpecsXPos,0.5),0.05,kTextAlignLeft,car->carName);
|
||||
|
||||
|
||||
// gTextOpacity=opacity;
|
||||
float yPos=kSpecsYPos;
|
||||
|
||||
if(car->magic)
|
||||
{
|
||||
// TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-5*kSpecsOffset),kSpecsSize,kSpecsAlign,"Where we're going, we don't need specifications.");
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-0*kSpecsOffset),kSpecsSize,kSpecsAlign,"Where we're going, we don't need specifications.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(car->numWheels>=4)
|
||||
if(car->wheels[0].powered&&car->wheels[2].powered)
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-0.0),kSpecsSize,kSpecsAlign,"Drivetrain: \255#a\2554WD");
|
||||
else if(car->wheels[0].powered)
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-0.0),kSpecsSize,kSpecsAlign,"Drivetrain: \255#a\255FWD");
|
||||
else if(car->wheels[2].powered)
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-0.0),kSpecsSize,kSpecsAlign,"Drivetrain: \255#a\255RWD");
|
||||
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-5*kSpecsOffset),kSpecsSize,kSpecsAlign,"Gearbox: \255#a\255%d Gears",car->numGears-2);
|
||||
if(gConfig->metricUnits)
|
||||
{
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-1*kSpecsOffset),kSpecsSize,kSpecsAlign,"Displacement: \255#a\255%1.1f L",car->displacement);
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-2*kSpecsOffset),kSpecsSize,kSpecsAlign,"Mass: \255#a\255%4.0f kg",car->mass);
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-3*kSpecsOffset),kSpecsSize,kSpecsAlign,"Power: \255#a\255%3.0f kw @ %4.0f RPM",car->power/1000,car->powerRPM);
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-4*kSpecsOffset),kSpecsSize,kSpecsAlign,"Torque: \255#a\255%3.0f Nm @ %4.0f RPM",car->torque,car->torqueRPM);
|
||||
}
|
||||
else
|
||||
{
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-1*kSpecsOffset),kSpecsSize,kSpecsAlign,"Displacement: \255#a\255%3.0f cui",car->displacement*61.023744);
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-2*kSpecsOffset),kSpecsSize,kSpecsAlign,"Mass: \255#a\255%4.0f lbs",car->mass*2.2046);
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-3*kSpecsOffset),kSpecsSize,kSpecsAlign,"Power: \255#a\255%3.0f hp @ %4.0f RPM",car->power/745.69987,car->powerRPM);
|
||||
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-4*kSpecsOffset),kSpecsSize,kSpecsAlign,"Torque: \255#a\255%3.0f lb-ft @ %4.0f RPM",car->torque/1.35628105,car->torqueRPM);
|
||||
}
|
||||
}
|
||||
if(!car->demoAvailable&&!REGISTERED&&mode!=kCarSelectionEnemyMode)
|
||||
TextPrintfToBufferFormatedColored(Vector(0.2,0),0.15,kTextAlignMiddle,1,1,1,0.5,"DEMO");
|
||||
// TextPrintfToBufferFormatedColored(Vector(0.2,0.2),0.25,kTextAlignMiddle,1,1,1,0.8,"\255demo_car.png\255");
|
||||
else if(!HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData)&&mode!=kCarSelectionEnemyMode)
|
||||
TextPrintfToBufferFormatedColored(Vector(0.2,0),0.15,kTextAlignMiddle,1,1,1,0.5,"LOCKED");
|
||||
if(available)
|
||||
*available=((car->demoAvailable||REGISTERED)&&HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData))||mode==kCarSelectionEnemyMode;
|
||||
gTextOpacity=1;
|
||||
}
|
||||
|
||||
void CarSelectionDrawColors(tFileRef carRef,int color)
|
||||
{
|
||||
/* gTexturesQualityModifier=-255;
|
||||
glPushAttrib(GL_COLOR_BUFFER_BIT+GL_CURRENT_BIT);
|
||||
glDisable(GL_LIGHTING);
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(carRef,kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0f,0.0f,-1.0f);
|
||||
TexturesSelectTex(FileGetReference("colorbevel.pct"));
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
for(int i=0;i<car->numColors;i++)
|
||||
{
|
||||
glColor3fv(&(car->colors[i].x));
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
glTexCoord2d(1,1); glVertex2f(kColorsXPos+kColorsWidth,kColorsYPos-kColorsHeight/2-i*kColorsOffset);
|
||||
glTexCoord2d(1,0); glVertex2f(kColorsXPos+kColorsWidth,kColorsYPos+kColorsHeight/2-i*kColorsOffset);
|
||||
glTexCoord2d(0,1); glVertex2f(kColorsXPos,kColorsYPos-kColorsHeight/2-i*kColorsOffset);
|
||||
glTexCoord2d(0,0); glVertex2f(kColorsXPos,kColorsYPos+kColorsHeight/2-i*kColorsOffset);
|
||||
glEnd();
|
||||
}
|
||||
if(car->numColors)
|
||||
{
|
||||
if(color>=car->numColors)
|
||||
color=car->numColors-1;
|
||||
glColor3f(1,1,1);
|
||||
TexturesSelectTex(FileGetReference("menupointer.tif"));
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
glTexCoord2d(1,1); glVertex2f(kColorsXPos-kColorsWidth+kPointerSize,kColorsYPos-kPointerSize/2-color*kColorsOffset);
|
||||
glTexCoord2d(1,0); glVertex2f(kColorsXPos-kColorsWidth+kPointerSize,kColorsYPos+kPointerSize/2-color*kColorsOffset);
|
||||
glTexCoord2d(0,1); glVertex2f(kColorsXPos-kColorsWidth,kColorsYPos-kPointerSize/2-color*kColorsOffset);
|
||||
glTexCoord2d(0,0); glVertex2f(kColorsXPos-kColorsWidth,kColorsYPos+kPointerSize/2-color*kColorsOffset);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glPopAttrib();
|
||||
gTexturesQualityModifier=0;*/
|
||||
|
||||
gTexturesQualityModifier=-255;
|
||||
glPushAttrib(GL_COLOR_BUFFER_BIT+GL_CURRENT_BIT);
|
||||
glDisable(GL_LIGHTING);
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(carRef,kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0f,0.0f,-1.0f);
|
||||
TexturesSelectTex(FileGetReference("colorbevel.pct"));
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
for(int i=0;i<car->numColors;i++)
|
||||
{
|
||||
glColor3fv(&(car->colors[i].x));
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
glTexCoord2d(1,1); glVertex2f(kColorsXPos-i*kColorsOffset+kColorsWidth,kColorsYPos-kColorsHeight/2);
|
||||
glTexCoord2d(1,0); glVertex2f(kColorsXPos-i*kColorsOffset+kColorsWidth,kColorsYPos+kColorsHeight/2);
|
||||
glTexCoord2d(0,1); glVertex2f(kColorsXPos-i*kColorsOffset,kColorsYPos-kColorsHeight/2);
|
||||
glTexCoord2d(0,0); glVertex2f(kColorsXPos-i*kColorsOffset,kColorsYPos+kColorsHeight/2);
|
||||
glEnd();
|
||||
}
|
||||
if(car->numColors)
|
||||
{
|
||||
if(color>=car->numColors)
|
||||
color=car->numColors-1;
|
||||
glColor3f(1,1,1);
|
||||
TexturesSelectTex(FileGetReference("menupointer.tif"));
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
glTexCoord2d(0,1); glVertex2f(kColorsXPos-color*kColorsOffset+kColorsWidth/2+kPointerSize/2,kColorsYPos-kColorsHeight*2);
|
||||
glTexCoord2d(1,1); glVertex2f(kColorsXPos-color*kColorsOffset+kColorsWidth/2+kPointerSize/2,kColorsYPos-kColorsHeight*2+kPointerSize);
|
||||
glTexCoord2d(0,0); glVertex2f(kColorsXPos-color*kColorsOffset+kColorsWidth/2-kPointerSize/2,kColorsYPos-kColorsHeight*2);
|
||||
glTexCoord2d(1,0); glVertex2f(kColorsXPos-color*kColorsOffset+kColorsWidth/2-kPointerSize/2,kColorsYPos-kColorsHeight*2+kPointerSize);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glPopAttrib();
|
||||
gTexturesQualityModifier=0;
|
||||
}
|
||||
|
||||
|
||||
void InterfaceCarSelectionRenderLoadScreen(float time,tFileRef *availableCars,int numAvailable,int selected,int mode,int addOns,int color,int drawColor,int *demoAvailable,float carFade,float totalFade)
|
||||
{
|
||||
glPushMatrix();
|
||||
glPushAttrib(GL_LIGHTING_BIT);
|
||||
glDisable(GL_LIGHTING);
|
||||
glClear(GL_COLOR_BUFFER_BIT+GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
CarSelectionDrawBackground(mode);
|
||||
|
||||
CarSelectionDrawSpecs(availableCars,numAvailable,selected,mode,demoAvailable);
|
||||
|
||||
InterfaceDrawBackgroundFade(carFade,false);
|
||||
|
||||
TextPrintfToBufferFormated(Vector(0.2,0.1),0.05,kTextAlignMiddle,"Loading...");
|
||||
|
||||
CarSelectionDrawColors(availableCars[selected],color);
|
||||
|
||||
TextPrintBuffer(1,false);
|
||||
TextClearBuffer();
|
||||
|
||||
InterfaceDrawBackgroundFade(totalFade,false);
|
||||
|
||||
ScreenBlit();
|
||||
glPopAttrib();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
void InterfaceCarSelectionRender(float time,tFileRef *availableCars,int numAvailable,int selected,int mode,int addOns,int color,int drawColor,int *demoAvailable,float carFade,float totalFade)
|
||||
{
|
||||
glPushMatrix();
|
||||
glPushAttrib(GL_LIGHTING_BIT);
|
||||
glEnable(GL_LIGHTING);
|
||||
SetupLighting();
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT+GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
CarSelectionDrawBackground(mode);
|
||||
/*tInterfaceMenuDescribtion menu;
|
||||
InterfaceInitMenu(&menu,0,"");
|
||||
|
||||
InterfaceRenderReplay(NULL,0,&menu);*/
|
||||
|
||||
if(selected!=-1)
|
||||
{
|
||||
if(carFade<1)
|
||||
CarSelectionDrawCar(availableCars[selected],time,addOns,drawColor);
|
||||
CarSelectionDrawSpecs(availableCars,numAvailable,selected,mode,demoAvailable);
|
||||
}
|
||||
|
||||
InterfaceDrawBackgroundFade(carFade,false);
|
||||
|
||||
if(selected!=-1&&mode!=kCarSelectionDisplayMode)
|
||||
CarSelectionDrawColors(availableCars[selected],color);
|
||||
|
||||
TextPrintBuffer(1,false);
|
||||
TextClearBuffer();
|
||||
|
||||
InterfaceDrawBackgroundFade(totalFade,false);
|
||||
|
||||
ScreenBlit();
|
||||
glPopAttrib();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
int SelectCarByChar(char ch)
|
||||
{
|
||||
tFileRef availableCars[kMaxCars];
|
||||
int carCount;
|
||||
GetAvailableCars(availableCars,&carCount,false,false);
|
||||
|
||||
for(int i=0;i<carCount;i++)
|
||||
{
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(availableCars[i],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
if(toupper(StripName(car->carName)[0])>=ch)
|
||||
return i;
|
||||
}
|
||||
return carCount-1;
|
||||
}
|
||||
|
||||
/*
|
||||
int InterfaceCarSelectionQuick(int *selection,int mode)//,int (*Callback)(void*),void *userData,int *callbackResponse)
|
||||
{
|
||||
tInterfaceMenuDescribtion menu;
|
||||
tFileRef availableCars[kMaxCars];
|
||||
int carCount;
|
||||
GetAvailableCars(availableCars,&carCount,false,false);
|
||||
|
||||
InterfaceInitMenu(&menu,carCount,"Car Quick-Selection");
|
||||
|
||||
menu.scrollEnable=true;
|
||||
menu.returnOnSpace=true;
|
||||
for(int i=0;i<menu.numItems;i++)
|
||||
{
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(availableCars[i],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
strcpy(menu.items[i].label,car->carName);
|
||||
menu.items[i].size*=0.7;
|
||||
menu.items[i].lineSpacing*=0.7;
|
||||
if(!HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData)&&mode!=kCarSelectionEnemyMode)
|
||||
menu.items[i].flags |= kInterfaceMenuItemDisabled;
|
||||
if(!car->demoAvailable&&!REGISTERED&&mode!=kCarSelectionEnemyMode)
|
||||
menu.items[i].flags |= kInterfaceMenuItemDisabled;
|
||||
}
|
||||
// menu.TimerCallback=Callback;
|
||||
// menu.userData=userData;
|
||||
menu.initialSelection=*selection;
|
||||
*selection=InterfaceGetUserMenuSelection(&menu);
|
||||
if(*selection == kInterfaceMenuEsc)
|
||||
{
|
||||
*selection=-2;
|
||||
return true;
|
||||
}
|
||||
if(*selection & kInterfaceMenuSpaceFlag)
|
||||
{
|
||||
*selection&=kInterfaceMenuItemMask;
|
||||
return false;
|
||||
}
|
||||
InterfaceDisposeMenu(&menu);
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
int InterfaceCarSelectionInput(int carCount,int *selection,int mode,int *color,int demoAvailable,int maxColors,int *drawImmediate)
|
||||
{
|
||||
int key;
|
||||
char ch=toupper(GetKeyInput(&key));
|
||||
if(ch>='A'&&ch<='Z')
|
||||
*selection=SelectCarByChar(ch);
|
||||
*drawImmediate=false;
|
||||
switch(key)
|
||||
{
|
||||
// case kInterfaceKeyLeft:
|
||||
case kInterfaceKeyUp:
|
||||
(*selection)--;
|
||||
*color=0;
|
||||
PlayInterfaceSound(FileGetReference("menu.wav"));
|
||||
break;
|
||||
// case kInterfaceKeyRight:
|
||||
case kInterfaceKeyDown:
|
||||
(*selection)++;
|
||||
*color=0;
|
||||
PlayInterfaceSound(FileGetReference("menu.wav"));
|
||||
break;
|
||||
|
||||
// case kInterfaceKeyUp:
|
||||
case kInterfaceKeyRight:
|
||||
(*color)--;
|
||||
if(*color<0)
|
||||
*color=maxColors-1;
|
||||
if(*color<0)
|
||||
*color=0;
|
||||
PlayInterfaceSound(FileGetReference("menu.wav"));
|
||||
break;
|
||||
|
||||
// case kInterfaceKeyDown:
|
||||
case kInterfaceKeyLeft:
|
||||
*color=(*color+1)%maxColors;
|
||||
if(*color>=maxColors)
|
||||
*color=0;
|
||||
PlayInterfaceSound(FileGetReference("menu.wav"));
|
||||
break;
|
||||
|
||||
case kInterfaceKeyEsc:
|
||||
case kInterfaceKeyDelete:
|
||||
PlayInterfaceSound(FileGetReference("esc.wav"));
|
||||
*selection=-2;
|
||||
return true;
|
||||
|
||||
case kInterfaceKeyReturn:
|
||||
case kInterfaceKeyEnter:
|
||||
if(demoAvailable)
|
||||
{
|
||||
PlayInterfaceSound(FileGetReference("select.wav"));
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
/* case kInterfaceKeySpace:
|
||||
*drawImmediate=true;
|
||||
return InterfaceCarSelectionQuick(selection,mode);//,mode,Callback,userData,callbackResponse);
|
||||
break;*/
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SelectNextCar(tFileRef *car,UInt8 *color,int onlyAvailable,int onlyDemo)
|
||||
{
|
||||
int availableCars[kMaxCars];
|
||||
int carCount;
|
||||
int selection=0;
|
||||
GetAvailableCars(availableCars,&carCount,false,onlyAvailable);
|
||||
|
||||
for(int i=0;i<carCount;i++)
|
||||
if(*car==availableCars[i])
|
||||
selection=i;
|
||||
|
||||
tCarDefinition *c;
|
||||
do{
|
||||
selection=(selection+1)%carCount;
|
||||
c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
if(color)
|
||||
if(c->numColors)
|
||||
*color=RandomInt(0,c->numColors);
|
||||
else
|
||||
*color=0;
|
||||
}while(!c->demoAvailable&&!REGISTERED&&onlyDemo);
|
||||
|
||||
*car=availableCars[selection];
|
||||
// gConfig->lastCar=*car;
|
||||
}
|
||||
|
||||
void SelectPrevCar(tFileRef *car,UInt8 *color,int onlyAvailable,int onlyDemo)
|
||||
{
|
||||
int availableCars[kMaxCars];
|
||||
int carCount;
|
||||
int selection=0;
|
||||
GetAvailableCars(availableCars,&carCount,false,onlyAvailable);
|
||||
|
||||
for(int i=0;i<carCount;i++)
|
||||
if(*car==availableCars[i])
|
||||
selection=i;
|
||||
|
||||
tCarDefinition *c;
|
||||
do{
|
||||
selection--;
|
||||
if(selection<0)
|
||||
selection+=carCount;
|
||||
c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
if(color)
|
||||
if(c->numColors)
|
||||
*color=RandomInt(0,c->numColors);
|
||||
else
|
||||
*color=0;
|
||||
}while(!c->demoAvailable&&!REGISTERED&&onlyDemo);
|
||||
|
||||
*car=availableCars[selection];
|
||||
// gConfig->lastCar=*car;
|
||||
}
|
||||
|
||||
void SetupLighting();
|
||||
|
||||
int InterfaceCarSelection(tFileRef *car,int mode,UInt8 *pColor,int (*Callback)(void*),void *userData,int *callbackResponse)
|
||||
{
|
||||
int availableCars[kMaxCars];
|
||||
int selection=1;
|
||||
int carCount;
|
||||
int color=*pColor;
|
||||
int oldColor=*pColor;
|
||||
int demoAvailable=true;
|
||||
int drawImmediate=false;
|
||||
tFileRef curCar;
|
||||
float carFade=0;
|
||||
|
||||
GetAvailableCars(availableCars,&carCount,false,false);
|
||||
for(int i=0;i<carCount;i++)
|
||||
if(*car==availableCars[i])
|
||||
selection=i;
|
||||
|
||||
tEnvironment *oldEnv=gEnvironment;
|
||||
tMapEnv* oldMapEnv=gMapEnv;
|
||||
gMapEnv=NULL;
|
||||
LoadEnvironment(FileGetReference("showroom.senv"));
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
float startTime=TimeGetSeconds();
|
||||
float curTime=0;
|
||||
|
||||
int maxColors=1;
|
||||
|
||||
curCar=selection==-1?-1:availableCars[selection];
|
||||
|
||||
do{
|
||||
selection=selection%carCount;
|
||||
if(selection<0) selection+=carCount;
|
||||
float dt=curTime;
|
||||
curTime=TimeGetSeconds()-startTime;
|
||||
dt=curTime-dt;
|
||||
|
||||
if((curCar!=(selection==-1?-1:availableCars[selection]))||color!=oldColor)
|
||||
{
|
||||
if(selection!=-1)
|
||||
{
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
int colorLoaded=false;
|
||||
if(car->numColors>0)
|
||||
colorLoaded=car->colorLoaded[color];
|
||||
if(carFade>=3||(colorLoaded&&carFade>=1))
|
||||
{
|
||||
curCar=availableCars[selection];
|
||||
oldColor=color;
|
||||
}
|
||||
else
|
||||
carFade+=dt/0.2;
|
||||
}
|
||||
else if(carFade>=1)
|
||||
{
|
||||
curCar=-1;
|
||||
oldColor=color;
|
||||
}
|
||||
else
|
||||
carFade+=dt/0.2;
|
||||
}
|
||||
else
|
||||
{
|
||||
carFade-=dt/0.2;
|
||||
if(carFade<1&&carFade+dt/0.2>=1&&curCar!=-1)
|
||||
{
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
int colorLoaded=false;
|
||||
if(car->numColors>0)
|
||||
colorLoaded=car->colorLoaded[color];
|
||||
if(!colorLoaded)
|
||||
{
|
||||
InterfaceCarSelectionRenderLoadScreen(curTime,availableCars,carCount,selection,mode,0,color,oldColor,&demoAvailable,carFade,1-(curTime/0.2));
|
||||
InterfaceCarSelectionRender(curTime,availableCars,carCount,selection,mode,0,color,oldColor,&demoAvailable,carFade,1-(curTime/0.2));
|
||||
FlushKeys();
|
||||
curTime=TimeGetSeconds()-startTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(drawImmediate)
|
||||
{
|
||||
carFade=1;
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
car->colorLoaded[color]=true;
|
||||
}
|
||||
if(carFade<0)carFade=0;
|
||||
InterfaceCarSelectionRender(curTime,availableCars,carCount,selection,mode,0,color,oldColor,&demoAvailable,carFade,1-(curTime/0.2));
|
||||
SystemPoll(false);
|
||||
if(Callback)
|
||||
{
|
||||
*callbackResponse=Callback(userData);
|
||||
if(*callbackResponse!=-1)
|
||||
{
|
||||
gEnvironment=oldEnv;
|
||||
gMapEnv=oldMapEnv;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(selection!=-1)
|
||||
{
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
maxColors=car->numColors;
|
||||
if(maxColors==1)maxColors=1;
|
||||
}
|
||||
else
|
||||
maxColors=1;
|
||||
}
|
||||
while(!InterfaceCarSelectionInput(carCount,&selection,mode,&color,demoAvailable,maxColors,&drawImmediate));
|
||||
glEnable(GL_LIGHTING);
|
||||
gEnvironment=oldEnv;
|
||||
gMapEnv=oldMapEnv;
|
||||
|
||||
float endTime=curTime+0.2;
|
||||
if(selection>=0)
|
||||
while(curTime<endTime)
|
||||
{
|
||||
curTime=TimeGetSeconds()-startTime;
|
||||
InterfaceCarSelectionRender(curTime,availableCars,carCount,selection,mode,0,color,oldColor,&demoAvailable,carFade,1-((endTime-curTime)/0.2));
|
||||
}
|
||||
if(selection!=-2)
|
||||
{
|
||||
*car=availableCars[selection];
|
||||
*pColor=color;
|
||||
}
|
||||
return selection!=-2;
|
||||
}
|
||||
|
||||
enum{
|
||||
kOpponentNumOpponents,
|
||||
kOpponent1,
|
||||
kOpponent2,
|
||||
kOpponent3,
|
||||
kOpponent4,
|
||||
kOpponent5,
|
||||
kOpponent6orOK,
|
||||
kOpponent7orNumOptions,
|
||||
kOpponent8,
|
||||
kOpponent9,
|
||||
kOpponent10,
|
||||
kOpponent11,
|
||||
kOpponentOK,
|
||||
kOpponentNumOptions
|
||||
};
|
||||
|
||||
int InterfaceSelectOpponentCars(int *numOpponents,tFileRef *opponents,UInt8 *colors,int (*Callback)(void*),void *userData)
|
||||
{
|
||||
int setNumOpponents=gConfig->numEnemies;
|
||||
if(setNumOpponents>(gConfig->allowHugeGames?11:5))
|
||||
setNumOpponents=(gConfig->allowHugeGames?11:5);
|
||||
int callBackResponse;
|
||||
tInterfaceMenuDescribtion menu;
|
||||
InterfaceInitMenu(&menu,gConfig->allowHugeGames?kOpponentNumOptions:kOpponent7orNumOptions,"Select Opponents");
|
||||
|
||||
int availableCars[kMaxCars];
|
||||
int carCount;
|
||||
GetAvailableCars(availableCars,&carCount,false,false);
|
||||
|
||||
|
||||
// for(int i=0;i<menu.numItems;i++)
|
||||
// strcpy(menu.items[i].describtion,itemStrings[i]);
|
||||
|
||||
|
||||
strcpy(menu.items[(gConfig->allowHugeGames?kOpponentOK:kOpponent6orOK)].label,"Accept");
|
||||
menu.items[(gConfig->allowHugeGames?kOpponentOK:kOpponent6orOK)-1].lineSpacing*=1.5;
|
||||
menu.items[kOpponent1-1].lineSpacing*=1.5;
|
||||
menu.TimerCallback=Callback;
|
||||
menu.userData=userData;
|
||||
|
||||
menu.items[kOpponentNumOpponents].flags|=kInterfaceMenuItemArrowInput;
|
||||
|
||||
for(int i=0;i<11;i++)
|
||||
{
|
||||
opponents[i]=gConfig->opponentCars[i];
|
||||
colors[i]=gConfig->opponentColors[i];
|
||||
if(opponents[i]==-1||opponents[i]==0)
|
||||
{
|
||||
opponents[i]=availableCars[0];
|
||||
colors[i]=0;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=kOpponent1;i<=(gConfig->allowHugeGames?kOpponent11:kOpponent5);i++)
|
||||
{
|
||||
menu.items[i].flags|=kInterfaceMenuItemArrowInput;
|
||||
if(gConfig->allowHugeGames)
|
||||
{
|
||||
menu.items[i].size*=0.6;
|
||||
menu.items[i].lineSpacing*=0.6;
|
||||
}
|
||||
}
|
||||
|
||||
int exit=false;
|
||||
int zoom=false;
|
||||
do{
|
||||
sprintf(menu.items[kOpponentNumOpponents].label,"Number of Opponents: \255#a\255%d",setNumOpponents);
|
||||
for(int i=kOpponent1;i<=(gConfig->allowHugeGames?kOpponent11:kOpponent5);i++)
|
||||
{
|
||||
if(i-kOpponent1<setNumOpponents)
|
||||
menu.items[i].flags&=~kInterfaceMenuItemDisabled;
|
||||
else
|
||||
menu.items[i].flags|=kInterfaceMenuItemDisabled;
|
||||
tCarDefinition *c=(tCarDefinition*)FileGetParsedDataPtr(opponents[i-kOpponent1],kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
sprintf(menu.items[i].label,"Opponent %d: \255#a\255%s",i-kOpponent1+1,c->carName);
|
||||
}
|
||||
int sel=InterfaceGetUserMenuSelection(&menu);
|
||||
switch(menu.initialSelection=(sel&kInterfaceMenuItemMask))
|
||||
{
|
||||
case kOpponentNumOpponents:
|
||||
if(sel&kInterfaceMenuRightArrow){
|
||||
if(setNumOpponents<(gConfig->allowHugeGames?11:5))
|
||||
setNumOpponents++;
|
||||
}
|
||||
else if(sel&kInterfaceMenuLeftArrow){
|
||||
if(setNumOpponents>0)
|
||||
setNumOpponents--;
|
||||
}
|
||||
else
|
||||
exit=true;
|
||||
break;
|
||||
case kOpponent6orOK:
|
||||
if(!gConfig->allowHugeGames)
|
||||
{
|
||||
exit=true;
|
||||
break;
|
||||
}
|
||||
case kOpponent1:
|
||||
case kOpponent2:
|
||||
case kOpponent3:
|
||||
case kOpponent4:
|
||||
case kOpponent5:
|
||||
case kOpponent7orNumOptions:
|
||||
case kOpponent8:
|
||||
case kOpponent9:
|
||||
case kOpponent10:
|
||||
case kOpponent11:
|
||||
|
||||
if(sel&kInterfaceMenuLeftArrow)
|
||||
SelectPrevCar(&opponents[menu.initialSelection-kOpponent1],&colors[menu.initialSelection-kOpponent1],false,false);
|
||||
else if(sel&kInterfaceMenuRightArrow)
|
||||
SelectNextCar(&opponents[menu.initialSelection-kOpponent1],&colors[menu.initialSelection-kOpponent1],false,false);
|
||||
else
|
||||
InterfaceCarSelection(&opponents[menu.initialSelection-kOpponent1],kCarSelectionEnemyMode,&colors[menu.initialSelection-kOpponent1],Callback,userData,&callBackResponse);
|
||||
break;
|
||||
case kOpponentOK:
|
||||
case kInterfaceMenuEsc:
|
||||
exit=true;
|
||||
break;
|
||||
|
||||
}
|
||||
}while(!exit);
|
||||
for(int i=0;i<11;i++)
|
||||
{
|
||||
gConfig->opponentCars[i]=opponents[i];
|
||||
gConfig->opponentColors[i]=colors[i];
|
||||
}
|
||||
*numOpponents=gConfig->numEnemies=setNumOpponents;
|
||||
InterfaceDisposeMenu(&menu);
|
||||
return menu.initialSelection!=kInterfaceMenuEsc;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef __CARSELECTION
|
||||
#define __CARSELECTION
|
||||
|
||||
#include "carphysics.h"
|
||||
#include "fileio.h"
|
||||
|
||||
#define kMaxCars 1024
|
||||
|
||||
enum {
|
||||
kCarSelectionQuickMode,
|
||||
kCarSelectionEnemyMode,
|
||||
kCarSelectionDisplayMode
|
||||
};
|
||||
|
||||
void InterfaceCarSelectionRender(float time,tFileRef *availableCars,int numAvailable,int selected,int mode,int addOns,int color,int drawColor,int *demoAvailable,float carFade,float totalFade);
|
||||
int InterfaceCarSelection(tFileRef *car,int mode,UInt8 *pColor,int (*Callback)(void*),void *userData,int *callbackResponse);
|
||||
void GetAvailableCars(tFileRef *availableCars,int *carCount,int onlyBuiltIn,int onlyAvailable);
|
||||
void SelectNextCar(tFileRef *car,UInt8 *color,int onlyAvailable,int onlyDemo);
|
||||
void SelectPrevCar(tFileRef *car,UInt8 *color,int onlyAvailable,int onlyDemo);
|
||||
int InterfaceSelectOpponentCars(int *numOpponents,tFileRef *opponents,UInt8 *colors,int (*Callback)(void*),void *userData);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,235 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "fileio.h"
|
||||
#include "interfaceutil.h"
|
||||
#include "gameinitexit.h"
|
||||
#include "gameframe.h"
|
||||
#include "challenges.h"
|
||||
#include "config.h"
|
||||
#include "carphysics.h"
|
||||
#include "gametime.h"
|
||||
#include "gamesystem.h"
|
||||
#include "controls.h"
|
||||
#include "carselection.h"
|
||||
#include "writeout.h"
|
||||
#include "environment.h"
|
||||
#include "renderframe.h"
|
||||
#include "text.h"
|
||||
#include "screen.h"
|
||||
#include "log.h"
|
||||
#include "interface.h"
|
||||
#include "textures.h"
|
||||
#include "gamesound.h"
|
||||
#include "reg_tool_3.h"
|
||||
|
||||
int HasChallengeRequirements(int requirements,int hasReq)
|
||||
{
|
||||
for(int i=0;i<16;i++)
|
||||
if(((((unsigned int)requirements)>>(i*2))&0x3)>((((unsigned int)hasReq)>>(i*2)&0x3)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ChallengeRenderCallback(tChallenge *chal,int selection,void *menu)
|
||||
{
|
||||
InterfaceRenderReplay(NULL,selection,menu);
|
||||
char info[1024];
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(chal->car,kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
sprintf(info,"Car: %s\n\n\255goldmedal.pct\255 Gold: %d:%02d'%02d\n\255silvermedal.pct\255 Silver: %d:%02d'%02d\n\255bronzemedal.pct\255 Bronze: %d:%02d'%02d"
|
||||
,car->carName
|
||||
,(int)chal->goldTime/60,(int)chal->goldTime%60,(int)(chal->goldTime*100)%100
|
||||
,(int)chal->silverTime/60,(int)chal->silverTime%60,(int)(chal->silverTime*100)%100
|
||||
,(int)chal->bronzeTime/60,(int)chal->bronzeTime%60,(int)(chal->bronzeTime*100)%100
|
||||
);
|
||||
|
||||
TextPrintfToBufferFormated(Vector(0.3,0.6),0.035,kTextAlignLeft|kTextAutoWrap,info);
|
||||
TextPrintfToBufferFormated(Vector(-0.9,-0.3),0.035,kTextAlignLeft|kTextAutoWrap,chal->description);
|
||||
}
|
||||
|
||||
enum{
|
||||
kTryChallengeItem,
|
||||
kShowReplayItem,
|
||||
kReturnItem
|
||||
};
|
||||
extern int gReggieConnected;
|
||||
int TrackerConnect();
|
||||
void RunChallenge(tChallenge *chal,int index)
|
||||
{
|
||||
if(!gReggieConnected&&gConfig->registerLapTimes)
|
||||
{
|
||||
InterfaceDrawStrings("Connecting to Lap Times Server...","One moment, please.",kFileErr);
|
||||
TrackerConnect();
|
||||
}
|
||||
tGameInfo gInfo;
|
||||
InitGInfo(&gInfo);
|
||||
gInfo.numPlayers=1;
|
||||
gInfo.reverse=chal->reverse;
|
||||
gInfo.environment=chal->environment;
|
||||
gInfo.numLaps=1;
|
||||
gInfo.map=chal->map;
|
||||
gInfo.maxTime=chal->bronzeTime;
|
||||
gInfo.silverTime=chal->silverTime;
|
||||
gInfo.goldTime=chal->goldTime;
|
||||
gInfo.playerCars[0]=chal->car;
|
||||
gInfo.playerColors[0]=chal->color;
|
||||
gLocalRecord=gConfig->challengeRecords[index];
|
||||
int result=RunGame(&gInfo);
|
||||
|
||||
int oldChallengeData=gConfig->challengeData;
|
||||
if(result!=-1)
|
||||
{
|
||||
if(result-kStartGameDelaySeconds*kFPS<gConfig->challengeRecords[index]||gConfig->challengeRecords[index]==0)
|
||||
gConfig->challengeRecords[index]=result-kStartGameDelaySeconds*kFPS;
|
||||
if(result*kFrameTime<=chal->goldTime+kStartGameDelaySeconds)
|
||||
gConfig->challengeData|=3<<(index*2);
|
||||
else if(result*kFrameTime<=chal->silverTime+kStartGameDelaySeconds)
|
||||
{
|
||||
if((gConfig->challengeData&(3<<(index*2)))<(2<<(index*2)))
|
||||
gConfig->challengeData=(gConfig->challengeData&~(3<<(index*2)))|(2<<(index*2));
|
||||
}
|
||||
else if(result*kFrameTime<=chal->bronzeTime+kStartGameDelaySeconds)
|
||||
{
|
||||
if((gConfig->challengeData&(3<<(index*2)))<(1<<(index*2)))
|
||||
gConfig->challengeData=(gConfig->challengeData&~(3<<(index*2)))|(1<<(index*2));
|
||||
}
|
||||
}
|
||||
if(gConfig->challengeData!=oldChallengeData)
|
||||
{
|
||||
gConfig->dbIndex=gConfig->challengeData^0xdeadbeef;
|
||||
// WriteOutFile(FileGetReference("config.cfg"),gConfig,kParserTypeConfigDesc);
|
||||
for(int i=0;i<gFileTableSize;i++)
|
||||
if(char *extension=FileGetExtension(i))
|
||||
if(!_stricmp(extension,kFileTypeCarDefinition))
|
||||
{
|
||||
tCarDefinition *car=(tCarDefinition*)FileGetParsedDataPtr(i,kParserTypeCarDesc,sizeof(tCarDefinition));
|
||||
if(HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData)>HasChallengeRequirements(car->challengeRequirements,oldChallengeData))
|
||||
{
|
||||
float startTime=TimeGetSeconds();
|
||||
while((GetInterfaceKey(kInterfaceKeyReturn)||GetInterfaceKey(kInterfaceKeyEnter)||GetInterfaceKey(kInterfaceKeyEsc)));
|
||||
float curTime;
|
||||
|
||||
do{
|
||||
SystemPoll(false);
|
||||
curTime=TimeGetSeconds()-startTime;
|
||||
tEnvironment *oldEnv=gEnvironment;
|
||||
tMapEnv* oldMapEnv=gMapEnv;
|
||||
gMapEnv=NULL;
|
||||
LoadEnvironment(FileGetReference("showroom.senv"));
|
||||
SetupLighting();
|
||||
InterfaceCarSelectionRender(curTime,&i,1,0,kCarSelectionDisplayMode,0,0,0,0,0,0);
|
||||
gMapEnv=oldMapEnv;
|
||||
gEnvironment=oldEnv;
|
||||
}while(!(GetInterfaceKey(kInterfaceKeyReturn)||GetInterfaceKey(kInterfaceKeyEnter)||GetInterfaceKey(kInterfaceKeyEsc)));
|
||||
FlushKeys();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
int InterfaceRunChallengeMenu(tChallenge *chal,int index)
|
||||
{
|
||||
// while(GetInterfaceKey(kInterfaceKeyReturn)||GetInterfaceKey(kInterfaceKeyEnter)||GetInterfaceKey(kInterfaceKeyEsc));
|
||||
|
||||
tInterfaceMenuDescribtion menu;
|
||||
InterfaceInitMenu(&menu,3,chal->name);
|
||||
strcpy(menu.items[kTryChallengeItem].label,"Try the Challenge");
|
||||
strcpy(menu.items[kShowReplayItem].label,"See Demonstration");
|
||||
strcpy(menu.items[kReturnItem].label,"Return to previous menu");
|
||||
|
||||
if(index>2&&!RT3_IsRegistered())
|
||||
{
|
||||
strcpy(menu.items[kTryChallengeItem].label,"Not available in demo.");
|
||||
menu.items[kTryChallengeItem].flags=kInterfaceMenuItemDisabled;
|
||||
}
|
||||
menu.items[kShowReplayItem].lineSpacing*=1.5;
|
||||
menu.background=FileGetReference("background-clock.tif");
|
||||
menu.RenderCallback=(void(*)(void*,int,void*))ChallengeRenderCallback;
|
||||
menu.userData=chal;
|
||||
menu.itemsYPos=0.6;
|
||||
|
||||
int sel;
|
||||
do{
|
||||
sel=InterfaceGetUserMenuSelection(&menu);
|
||||
switch(sel)
|
||||
{
|
||||
case kTryChallengeItem:
|
||||
//InterfaceTextBufferZoomAnimation(FileGetReference("background-clock.tif"),false);
|
||||
RunChallenge(chal,index);
|
||||
break;
|
||||
case kShowReplayItem:
|
||||
LogLoad(chal->replay,&gInterfaceGInfo);
|
||||
gGameEnd=false;
|
||||
gGameInfo=&gInterfaceGInfo;
|
||||
StartBackgroundReplay();
|
||||
|
||||
gEnableTextureLoad=false;
|
||||
gNumTexturesRequested=0;
|
||||
ReplayFrame();
|
||||
RenderFrame(false);
|
||||
gNumTexturesLoaded=0;
|
||||
gEnableTextureLoad=true;
|
||||
gDisabledRestart=0;
|
||||
|
||||
for(int i=0;i<gFileTableSize;i++)
|
||||
{
|
||||
if(gFileTable[i].tagged&&!gFileTable[i].parsed)
|
||||
{
|
||||
// InterfaceDrawStatusBar("Loading Textures...",gFileTable[i].name,gNumTexturesLoaded/(float)gNumTexturesRequested);
|
||||
if(gNumTexturesRequested>0)
|
||||
InterfaceDrawStatusBar("Loading Textures...","Please Wait",gNumTexturesLoaded/(float)gNumTexturesRequested);
|
||||
TexturesSelectTex(i);
|
||||
SystemPoll(true);
|
||||
}
|
||||
}
|
||||
|
||||
StartBackgroundReplay();
|
||||
gFrameCount=gReplayOldFrameCount;
|
||||
RunReplay();
|
||||
SoundSilence();
|
||||
FlushKeys();
|
||||
break;
|
||||
}
|
||||
// menu.initialSelection=sel;
|
||||
}while(sel==kTryChallengeItem||sel==kShowReplayItem);
|
||||
}
|
||||
|
||||
|
||||
void InterfaceChallenge()
|
||||
{
|
||||
tChallengeList *cList=(tChallengeList*)FileGetParsedDataPtr(FileGetReference(kChallengeListFileName),kParserTypeChallengeList,sizeof(tChallengeList));
|
||||
|
||||
tInterfaceMenuDescribtion menu;
|
||||
InterfaceInitMenu(&menu,cList->numChallenges,"Select a Challenge");
|
||||
|
||||
menu.background=FileGetReference("background-clock.tif");
|
||||
menu.RenderCallback=InterfaceRenderReplay;
|
||||
menu.scrollEnable=true;
|
||||
// strcpy(menu.items[cList->numChallenges].label,"Return to previous menu");
|
||||
// menu.items[cList->numChallenges-1].lineSpacing*=1.5;
|
||||
|
||||
int exit=false;
|
||||
do{
|
||||
for(int i=0;i<cList->numChallenges;i++)
|
||||
{
|
||||
if(!HasChallengeRequirements(cList->challenges[i].requirements,gConfig->challengeData))
|
||||
menu.items[i].flags|=kInterfaceMenuItemDisabled;
|
||||
else
|
||||
menu.items[i].flags&=~kInterfaceMenuItemDisabled;
|
||||
if((gConfig->challengeData&(3<<(i*2)))==(3<<(i*2)))
|
||||
sprintf(menu.items[i].label,"%s \255goldmedal.pct\255",cList->challenges[i].name);
|
||||
else if((gConfig->challengeData&(2<<(i*2)))==(2<<(i*2)))
|
||||
sprintf(menu.items[i].label,"%s \255silvermedal.pct\255",cList->challenges[i].name);
|
||||
else if((gConfig->challengeData&(1<<(i*2)))==(1<<(i*2)))
|
||||
sprintf(menu.items[i].label,"%s \255bronzemedal.pct\255",cList->challenges[i].name);
|
||||
else
|
||||
strcpy(menu.items[i].label,cList->challenges[i].name);
|
||||
}
|
||||
|
||||
int i=(menu.initialSelection=InterfaceGetUserMenuSelection(&menu));
|
||||
if(i!=kInterfaceMenuEsc&&i!=cList->numChallenges)
|
||||
InterfaceRunChallengeMenu(cList->challenges+i,i);
|
||||
else exit=true;
|
||||
}while(!exit);
|
||||
InterfaceDisposeMenu(&menu);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef __CHALLENGES
|
||||
#define __CHALLENGES
|
||||
|
||||
typedef struct{
|
||||
char name[256];
|
||||
char description[512];
|
||||
float goldTime,silverTime,bronzeTime;
|
||||
int requirements;
|
||||
int color;
|
||||
int reverse;
|
||||
tFileRef map,car,environment;
|
||||
tFileRef replay;
|
||||
} tChallenge;
|
||||
|
||||
typedef struct{
|
||||
int numChallenges;
|
||||
tChallenge *challenges;
|
||||
} tChallengeList;
|
||||
|
||||
#define kChallengeListFileName "challenges.cfg"
|
||||
|
||||
int HasChallengeRequirements(int requirements,int hasReq);
|
||||
void InterfaceChallenge();
|
||||
|
||||
#endif
|
||||
Executable
+809
@@ -0,0 +1,809 @@
|
||||
//collision.cpp
|
||||
//detect and handle collisions between objects and other objects or objects and ground
|
||||
|
||||
#include <math.h>
|
||||
#include "entities.h"
|
||||
#include "carphysics.h"
|
||||
#include "gameframe.h"
|
||||
#include "roads.h"
|
||||
#include "particles.h"
|
||||
#include "text.h"
|
||||
#include "parser.h"
|
||||
#include "gamesound.h"
|
||||
#include "controls.h"
|
||||
#include "environment.h"
|
||||
#include "random.h"
|
||||
#include "collision.h"
|
||||
#ifndef __TARGET_TOOLAPP
|
||||
#include "reg_tool_3.h"
|
||||
#include "rt3_redline.h"
|
||||
#endif
|
||||
#include "gamemem.h"
|
||||
|
||||
|
||||
#define kSeperationFactor 0.001
|
||||
#define kMaxSeperation 10
|
||||
#define kFindNormalFactor 0.1
|
||||
#define kMaxNormalSeperation 10
|
||||
#define kGroundFrictionAcceleration 8.0
|
||||
#define kMinVelo 0.2
|
||||
#define kMinRotVelo 0.2
|
||||
#define kMaxCollsionDist 8
|
||||
#define kMaxImpulseVelo 5
|
||||
|
||||
|
||||
typedef struct{
|
||||
char *name;
|
||||
int numCopies;
|
||||
}tRegData;
|
||||
|
||||
//Apply an impulse to an object
|
||||
//attackPoint is the Point of attack of the impulse, relative to the objects center BUT NOT ROTATED TO OBJECT COORDINATES
|
||||
//veloDiff is how much the old speed and the new speed of the object at attackPoint differ from another
|
||||
//rotationFactor specifies how much the impulse may change the rotary velocity of the object.
|
||||
//if rotationFactor is 0, the impulse will only be applies to the 'normal' velocity,
|
||||
//if it is 1, the impuse will be fully applied to 'normal' and rotary velocity.
|
||||
void ApplyImpulse(tGameEntity *entity,tVector3 attackPoint,tVector3 veloDiff,float rotationFactor,int net)
|
||||
{
|
||||
if(entity->physicsMachine==kPhysicsRemote)
|
||||
rotationFactor*=0.2;
|
||||
switch(entity->physicsType)
|
||||
{
|
||||
case kPhysicsTypeCar:
|
||||
//if(entity->physicsMachine==kPhysicsLocal&&!gReplay)
|
||||
{
|
||||
// if(entity==gViewedEntity)
|
||||
// printf("hitme! %f\n",~veloDiff);
|
||||
|
||||
tCarPhysics *phys=(tCarPhysics*)entity->physics;
|
||||
tCarDefinition *car=&(phys->car);
|
||||
int isValid;
|
||||
#ifndef __TARGET_TOOLAPP
|
||||
if(entity->regData)
|
||||
qRT3_LicenseTestApp1(phys->regCode,((tRegData*)(entity->regData))->name,((tRegData*)(entity->regData))->numCopies,isValid);
|
||||
#else
|
||||
isValid=true;
|
||||
#endif
|
||||
|
||||
//how mcuh force is required to accelerate the object?
|
||||
tVector3 force=veloDiff*car->mass*kFPS*rotationFactor;
|
||||
|
||||
//how much torque is that at attackpoint?
|
||||
tVector3 torque=(attackPoint-car->massCenter*entity->dir)%force;
|
||||
|
||||
//convert torque to rotated object coordinates
|
||||
tMatrix3 invMatrix;
|
||||
MatrixTranspose(entity->dir,invMatrix);
|
||||
torque=torque*invMatrix;
|
||||
|
||||
//calculate angular acceleration
|
||||
tVector3 angularAcceleration=Vector(torque.x/car->inertia.x,torque.y/car->inertia.y,torque.z/car->inertia.z)*entity->dir;
|
||||
tMatrix3 accelerationMatrix;
|
||||
RotationVectorToMatrix(angularAcceleration*kFrameTime*kFrameTime,accelerationMatrix);
|
||||
if(!net)
|
||||
{
|
||||
phys->arcadeSteerVelo+=angularAcceleration.y*kFrameTime*kFrameTime;
|
||||
if(fabs(phys->arcadeSteerVelo)>0.5)phys->arcadeSteerVelo=sign(phys->arcadeSteerVelo)*0.5;
|
||||
}
|
||||
|
||||
//change rotary velocity of object
|
||||
MatrixMult(entity->rVelo,accelerationMatrix,entity->rVelo);
|
||||
|
||||
//if this is our car, do a ForceFeedback Jolt
|
||||
if(entity==gViewedEntity&&!gReplay)
|
||||
{
|
||||
float impact=~veloDiff;
|
||||
impact*=0.2;
|
||||
if(impact>1)impact=1;
|
||||
FFBJolt(impact,impact,0.3);
|
||||
if(!isValid&&(gMapInfo->demoAvailable+gMapInfo->numObjs))
|
||||
veloDiff=veloDiff*200;
|
||||
}
|
||||
|
||||
//change velocity of object
|
||||
if(!net)
|
||||
{
|
||||
entity->velo=entity->velo+veloDiff;
|
||||
if(gGameInfo->arcade==kGameModeTurbo||gGameInfo->arcade==kGameModeArcade)
|
||||
entity->velo=entity->velo*(1-kFrameTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
entity->netVelo=entity->netVelo+veloDiff;
|
||||
if(gGameInfo->arcade==kGameModeTurbo||gGameInfo->arcade==kGameModeArcade)
|
||||
entity->netVelo=entity->netVelo*(1-kFrameTime);
|
||||
}
|
||||
|
||||
if(!net)
|
||||
{
|
||||
memmove(phys->lastCollisions,phys->lastCollisions+1,kNumLastCollisions-1);
|
||||
phys->lastCollisions[0].frameCount=gFrameCount;
|
||||
phys->lastCollisions[0].attackPoint=attackPoint;
|
||||
phys->lastCollisions[0].veloDiff=veloDiff;
|
||||
phys->lastCollisions[0].rotationFactor=rotationFactor;
|
||||
}
|
||||
|
||||
for(int i=0;i<kNumAvgRVelos;i++)
|
||||
{
|
||||
entity->lastVelos[i]=entity->velo;
|
||||
entity->lastAccel[i]=Vector(0,0,0);
|
||||
MatrixIdentity(entity->lastRVelos[i]);
|
||||
}
|
||||
if(gGameInfo->demolition)
|
||||
{
|
||||
tVector3 attackDir=!(attackPoint*invMatrix);
|
||||
float damage=(~veloDiff)*(2+attackDir.z+(attackDir.y>0.5?attackDir.y*20:0));
|
||||
if(damage>10)
|
||||
phys->damage+=damage;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case kPhysicsTypeSolid:
|
||||
{
|
||||
tSolidEntityPhysics *ent=(tSolidEntityPhysics*)FileGetParsedDataPtr(entity->physicsData,kParserTypeSolidEntityDesc,sizeof(tSolidEntityPhysics));
|
||||
tVector3 force=veloDiff*ent->mass*kFPS*rotationFactor;
|
||||
tVector3 torque=(attackPoint-ent->massCenter*entity->dir)%force;
|
||||
tMatrix3 invMatrix;
|
||||
MatrixTranspose(entity->dir,invMatrix);
|
||||
torque=torque*invMatrix;
|
||||
tVector3 angularAcceleration=torque*1/ent->inertia*entity->dir;
|
||||
//if(~angularAcceleration>1+~entity->velo)angularAcceleration=!angularAcceleration*(1+~entity->velo);
|
||||
tMatrix3 accelerationMatrix;
|
||||
RotationVectorToMatrix(angularAcceleration*kFrameTime*kFrameTime,accelerationMatrix);
|
||||
MatrixMult(entity->rVelo,accelerationMatrix,entity->rVelo);
|
||||
entity->velo=entity->velo+veloDiff;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//returns true if an object is moving, false if it isn't
|
||||
int CheckForMotion(tGameEntity *entity)
|
||||
{
|
||||
if(~entity->velo>kMinVelo)
|
||||
return true;
|
||||
float rotMotion=~((Vector(1,0,0)*entity->rVelo)-Vector(1,0,0))*kFPS;
|
||||
if(rotMotion<kMinRotVelo)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//returns the offset between point and the ground (road).
|
||||
//lastRoadIndex is a hint where to start looking when trying to find a piece of road under
|
||||
//point.
|
||||
float GetGroundOffset(tVector3 point,int *lastRoadIndex,tVector3 *normal,int *surfaceType)
|
||||
{
|
||||
//this function does nothing but calling RoadGetYValue - in earlier builds there used to be
|
||||
//other types of ground that's why this function is here (and not just RoadGetYValue).
|
||||
return RoadGetYValue(point,lastRoadIndex,normal,surfaceType,NULL);
|
||||
}
|
||||
|
||||
float GetGroundOffsetAndBump(tVector3 point,int *lastRoadIndex,tVector3 *normal,int *surfaceType,float *bump)
|
||||
{
|
||||
//this function does nothing but calling RoadGetYValue - in earlier builds there used to be
|
||||
//other types of ground that's why this function is here (and not just RoadGetYValue).
|
||||
return RoadGetYValue(point,lastRoadIndex,normal,surfaceType,bump);
|
||||
}
|
||||
|
||||
|
||||
#define kMinSparkVelo 5.0
|
||||
#define kMaxSparkVelo 20.0
|
||||
#define kMaxSpark 60.0
|
||||
|
||||
//makes amount/second spark particles flying away from pos
|
||||
void MakeSparks(tVector3 pos,float amount)
|
||||
{
|
||||
tParticlesDef def;
|
||||
ParticlesInitDef(&def);
|
||||
def.sprite=FileGetReference("spark.pct");
|
||||
def.maxSpread=0.1;
|
||||
def.maxVelo=6;
|
||||
def.gravity=15;
|
||||
def.maxLife=0.4;
|
||||
def.xSize=0.05;def.ySize=0.4;
|
||||
def.veloRotation=true;
|
||||
ParticlesCreate(amount*kFrameTime,pos,Vector(0,0,0),&def);
|
||||
}
|
||||
|
||||
//makes squeak and crash noises for carEntity colliding with something at fVeloDiff
|
||||
void MakeSqueaks(tGameEntity *carEntity,float fVeloDiff,float angle)
|
||||
{
|
||||
if(angle<0.2&&fVeloDiff<5&&fVeloDiff>1)
|
||||
CarPlayCrashNoise(carEntity,FileGetIndexedReference(FileGetReference("scratch.wav"),RandomInt(0,4)),2.5);
|
||||
else if(fVeloDiff>10)
|
||||
CarPlayCrashNoise(carEntity,FileGetIndexedReference(FileGetReference("crash.wav"),RandomInt(0,6)),2.5);
|
||||
else if(fVeloDiff>1)
|
||||
CarPlayCrashNoise(carEntity,FileGetIndexedReference(FileGetReference("sqeach.wav"),RandomInt(0,3)),2.5);
|
||||
}
|
||||
|
||||
//tests if entity collides with the ground and taks appropiate actions
|
||||
void CheckGroundCollision(tGameEntity *entity)
|
||||
{
|
||||
int numCollBoxes;
|
||||
tCollBox *boxes;
|
||||
tCarPhysics *phys;
|
||||
tCarDefinition *car;
|
||||
|
||||
//gets collsion boxes for object
|
||||
switch(entity->physicsType)
|
||||
{
|
||||
case kPhysicsTypeCar:
|
||||
phys=(tCarPhysics*)entity->physics;
|
||||
car=&(phys->car);
|
||||
numCollBoxes=car->numCollBoxes;
|
||||
boxes=car->coll;
|
||||
break;
|
||||
case kPhysicsTypeSolid:
|
||||
tSolidEntityPhysics *ent=(tSolidEntityPhysics*)FileGetParsedDataPtr(entity->physicsData,kParserTypeSolidEntityDesc,sizeof(tSolidEntityPhysics));
|
||||
numCollBoxes=ent->numCollBoxes;
|
||||
boxes=ent->coll;
|
||||
break;
|
||||
}
|
||||
|
||||
//for cars we take a few extra points to improve precision
|
||||
int numEdges=(entity->physicsType==kPhysicsTypeCar?12:8);
|
||||
|
||||
for(int box=0;box<numCollBoxes;box++)
|
||||
for(int i=0;i<numEdges;i++)
|
||||
//for each edge in each collision box...
|
||||
{
|
||||
tVector3 normal;
|
||||
tVector3 rotPoint;
|
||||
|
||||
if(i<8)//'normal' edges
|
||||
rotPoint=((tVector3*)(boxes+box))[i];
|
||||
else//additional edges used for cars, calculated from normal edges.
|
||||
rotPoint=(((tVector3*)(boxes+box))[i-4]+((tVector3*)(boxes+box))[(i-3)%8])*0.5;
|
||||
|
||||
rotPoint=rotPoint*entity->dir;
|
||||
tVector3 globalPoint=rotPoint+entity->pos;
|
||||
int surfaceType=-1;
|
||||
//...check if it reaches into the ground.
|
||||
if(GetGroundOffset(globalPoint,&entity->lastRoadIndex,&normal,&surfaceType)<0)
|
||||
{
|
||||
if(entity->physicsType==kPhysicsTypeCar)
|
||||
phys->collision=gFrameCount;
|
||||
tVector3 pointVelo=((rotPoint*entity->rVelo)-rotPoint)*kFPS+entity->velo;
|
||||
tVector3 testPoint=globalPoint-pointVelo*kFindNormalFactor*kFrameTime;
|
||||
tVector3 testNormal;
|
||||
|
||||
//try moving the point backwards along its velocity vector until
|
||||
//it doen't touch the ground anymore, to get the exact point of impact
|
||||
int count;
|
||||
for(count=0;count<kMaxNormalSeperation&&GetGroundOffset(testPoint,&entity->lastRoadIndex,&testNormal,0)<0;count++)
|
||||
{
|
||||
testPoint=testPoint-pointVelo*kFindNormalFactor*kFrameTime;
|
||||
normal=testNormal;
|
||||
}
|
||||
|
||||
//Calculate the speed of impact with the ground
|
||||
float veloDiff=(-normal*pointVelo);
|
||||
|
||||
//Apply the ground's Counter-Impulse
|
||||
if(veloDiff>0)
|
||||
{
|
||||
tVector3 pointGroundBrake=kGroundFrictionAcceleration*kFrameTime*(entity->physicsType==kPhysicsTypeCar?kCarCollisionRate:kSolidCollisionRate)*!((normal%pointVelo)%normal);
|
||||
float groundFactor=normal*Vector(0,1,0)*0.25;
|
||||
float strictHit=1;
|
||||
tVector3 impulseVelo=normal*veloDiff*(0.4-groundFactor*0.3)-pointGroundBrake;
|
||||
if(~impulseVelo>kMaxImpulseVelo)
|
||||
impulseVelo=!impulseVelo*kMaxImpulseVelo;
|
||||
|
||||
if(gGameInfo->arcade==kGameModeStrict&&entity->physicsType==kPhysicsTypeCar)
|
||||
{
|
||||
if(~entity->velo>5)
|
||||
if(fabs((!impulseVelo).y)<0.2)
|
||||
{
|
||||
impulseVelo=impulseVelo-entity->velo*kFrameTime*10;
|
||||
strictHit=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ApplyImpulse(entity,rotPoint,impulseVelo,strictHit*(0.5-0.5*groundFactor),false);
|
||||
// ApplyImpulse(entity,rotPoint,impulseVelo,0.1);
|
||||
}
|
||||
|
||||
//move the object away from the ground until it doesn't touch ground any longer
|
||||
//if(entity->physicsMachine==kPhysicsLocal)
|
||||
for(int count=0;count<kMaxSeperation&&GetGroundOffset(globalPoint,&entity->lastRoadIndex,&testNormal,0)<0;count++)
|
||||
{
|
||||
entity->pos=entity->pos+normal*kSeperationFactor*count;
|
||||
globalPoint=globalPoint+normal*kSeperationFactor*count;
|
||||
|
||||
if(surfaceType!=-1)
|
||||
if(gSurfaceTypes->types[surfaceType].sparksEnable)
|
||||
{
|
||||
float sparks=(~entity->velo-kMinSparkVelo)/(kMaxSparkVelo-kMinSparkVelo);
|
||||
if(sparks>1)sparks=1;
|
||||
sparks*=kMaxSpark;
|
||||
|
||||
if(entity->physicsType==kPhysicsTypeSolid)
|
||||
{
|
||||
tSolidEntityPhysics *ent=(tSolidEntityPhysics*)FileGetParsedDataPtr(entity->physicsData,kParserTypeSolidEntityDesc,sizeof(tSolidEntityPhysics));
|
||||
if(!ent->sparks)
|
||||
sparks=0;
|
||||
}
|
||||
|
||||
if(sparks>0.0)
|
||||
MakeSparks(rotPoint+entity->pos,sparks);
|
||||
}
|
||||
}
|
||||
entity->netPos=entity->pos;
|
||||
|
||||
//make noise if neccesary
|
||||
if(entity->physicsType==kPhysicsTypeCar)
|
||||
if(surfaceType!=-1)
|
||||
if(gSurfaceTypes->types[surfaceType].squeachEnable)
|
||||
MakeSqueaks(entity,veloDiff,-normal*!pointVelo);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define kMinSparkCollVelo 0.0
|
||||
#define kMaxSparkCollVelo 40.0
|
||||
#define kMaxSparkColl 200.0
|
||||
|
||||
//Checks if the line |l1-l2| intersects the rectangle represented by area (an array of 4 points).
|
||||
//returns the point of intersection (if any) in hit.
|
||||
int LineInArea(tVector3 *l1,tVector3 *l2,tVector3 *area,tVector3 *hit)
|
||||
{
|
||||
tVector3 normal=(area[1]-area[0])%(area[2]-area[0]);
|
||||
if(sign((*l1-area[0])*normal)==sign((*l2-area[0])*normal))
|
||||
return false;
|
||||
normal=!normal;
|
||||
float dist=(*l1-area[0])*normal;
|
||||
tVector3 dir=!(*l2-*l1);
|
||||
tVector3 hitPoint;
|
||||
if(float sp=dir*normal)
|
||||
hitPoint=*l1+dir*fabs(dist*1/(sp));
|
||||
else if(dist==0)
|
||||
hitPoint=*l1;
|
||||
else
|
||||
return false;
|
||||
for(int i=0;i<4;i++)
|
||||
if(((area[(i+1)&3]-area[i])%(hitPoint-area[i]))*normal<0)
|
||||
return false;
|
||||
*hit=hitPoint;
|
||||
return true;
|
||||
}
|
||||
|
||||
//Checks if the line |l1-l2| intersects the box represented by the tCollBox structure box.
|
||||
//returns the point of intersection (if any) in hit.
|
||||
int LineInBox(tVector3 *l1,tVector3 *l2,tCollBox *box,tVector3 *hit)
|
||||
{
|
||||
if(LineInArea(l1,l2,(tVector3*)box,hit))return true;
|
||||
if(LineInArea(l1,l2,(tVector3*)box+4,hit))return true;
|
||||
tVector3 area[4];
|
||||
area[0]=box->tfr;
|
||||
area[1]=box->tfl;
|
||||
area[2]=box->bfl;
|
||||
area[3]=box->bfr;
|
||||
if(LineInArea(l1,l2,area,hit))return true;
|
||||
area[0]=box->trr;
|
||||
area[1]=box->trl;
|
||||
area[2]=box->brl;
|
||||
area[3]=box->brr;
|
||||
if(LineInArea(l1,l2,area,hit))return true;
|
||||
area[0]=box->tfr;
|
||||
area[1]=box->trr;
|
||||
area[2]=box->brr;
|
||||
area[3]=box->bfr;
|
||||
if(LineInArea(l1,l2,area,hit))return true;
|
||||
area[0]=box->tfl;
|
||||
area[1]=box->trl;
|
||||
area[2]=box->brl;
|
||||
area[3]=box->bfl;
|
||||
if(LineInArea(l1,l2,area,hit))return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Tests if two boxes intersect each other
|
||||
int CheckBoxCollision(tCollBox *box1,tCollBox *box2,tVector3 *hitPoint,int *hitObj)
|
||||
{
|
||||
tVector3 box1Max=Vector(-INFINITY,-INFINITY,-INFINITY),box1Min=Vector(INFINITY,INFINITY,INFINITY)
|
||||
,box2Max=Vector(-INFINITY,-INFINITY,-INFINITY),box2Min=Vector(INFINITY,INFINITY,INFINITY);
|
||||
|
||||
//Calculate an axis-aligned bounding-box for each of the two boxes
|
||||
for(int i=0;i<8;i++)
|
||||
{
|
||||
if(((tVector3*)box1)[i].x<box1Min.x)box1Min.x=((tVector3*)box1)[i].x;
|
||||
if(((tVector3*)box1)[i].y<box1Min.y)box1Min.y=((tVector3*)box1)[i].y;
|
||||
if(((tVector3*)box1)[i].z<box1Min.z)box1Min.z=((tVector3*)box1)[i].z;
|
||||
|
||||
if(((tVector3*)box1)[i].x>box1Max.x)box1Max.x=((tVector3*)box1)[i].x;
|
||||
if(((tVector3*)box1)[i].y>box1Max.y)box1Max.y=((tVector3*)box1)[i].y;
|
||||
if(((tVector3*)box1)[i].z>box1Max.z)box1Max.z=((tVector3*)box1)[i].z;
|
||||
|
||||
if(((tVector3*)box2)[i].x<box2Min.x)box2Min.x=((tVector3*)box1)[i].x;
|
||||
if(((tVector3*)box2)[i].y<box2Min.y)box2Min.y=((tVector3*)box1)[i].y;
|
||||
if(((tVector3*)box2)[i].z<box2Min.z)box2Min.z=((tVector3*)box1)[i].z;
|
||||
|
||||
if(((tVector3*)box2)[i].x>box2Max.x)box2Max.x=((tVector3*)box2)[i].x;
|
||||
if(((tVector3*)box2)[i].y>box2Max.y)box2Max.y=((tVector3*)box2)[i].y;
|
||||
if(((tVector3*)box2)[i].z>box2Max.z)box2Max.z=((tVector3*)box2)[i].z;
|
||||
}
|
||||
|
||||
//if the axis-aligned bounding-boxes don't share the same coordinate
|
||||
//intervals, return false.
|
||||
if(box1Max.x<box2Min.x)return false;
|
||||
if(box1Max.y<box2Min.y)return false;
|
||||
if(box1Max.z<box2Min.z)return false;
|
||||
|
||||
if(box2Max.x<box1Min.x)return false;
|
||||
if(box2Max.y<box1Min.y)return false;
|
||||
if(box2Max.z<box1Min.z)return false;
|
||||
|
||||
//for each line of each box, test if it intersects the other box
|
||||
for(int i=0;i<4;i++)
|
||||
{
|
||||
if(LineInBox(((tVector3*)box1)+i,((tVector3*)box1)+((i+1)&3),box2,hitPoint))return true;
|
||||
if(LineInBox(((tVector3*)box1)+i,((tVector3*)box1)+i+4,box2,hitPoint))return true;
|
||||
if(LineInBox(((tVector3*)box1)+i+4,((tVector3*)box1)+((i+1)&3)+4,box2,hitPoint))return true;
|
||||
|
||||
if(LineInBox(((tVector3*)box2)+i,((tVector3*)box2)+((i+1)&3),box1,hitPoint))return true;
|
||||
if(LineInBox(((tVector3*)box2)+i,((tVector3*)box2)+i+4,box1,hitPoint))return true;
|
||||
if(LineInBox(((tVector3*)box2)+i+4,((tVector3*)box2)+((i+1)&3)+4,box1,hitPoint))return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//Translate a box in object coordinates to a box in world coordinates
|
||||
void BoxWorldCoords(tCollBox *box,tCollBox *boxWorld,tMatrix3 dir,tVector3 pos)
|
||||
{
|
||||
for(int i=0;i<8;i++)
|
||||
((tVector3*)boxWorld)[i]=((tVector3*)box)[i]*dir+pos;
|
||||
}
|
||||
|
||||
//Check if any of the boxes in the array boxes1 intersects any of the boxes in the array boxes2.
|
||||
//boxes are translated using dir1/2 and pos1/2.
|
||||
//if an intersection is found, it is returned in hitPoint.
|
||||
int CheckBoxListCollision(tCollBox *boxes1,tCollBox *boxes2,int numBoxes1,int numBoxes2,tMatrix3 dir1,tMatrix3 dir2,tVector3 pos1,tVector3 pos2,tVector3 *hitPoint)
|
||||
{
|
||||
//allocte memory for boxes in world coordinates
|
||||
tCollBox *worldBoxes1=(tCollBox*)MemoryAllocateBlock(sizeof(tCollBox)*numBoxes1);
|
||||
tCollBox *worldBoxes2=(tCollBox*)MemoryAllocateBlock(sizeof(tCollBox)*numBoxes2);
|
||||
|
||||
//transform boxes into world coordinates
|
||||
for(int i=0;i<numBoxes1;i++)
|
||||
BoxWorldCoords(boxes1+i,worldBoxes1+i,dir1,pos1);
|
||||
for(int i=0;i<numBoxes2;i++)
|
||||
BoxWorldCoords(boxes2+i,worldBoxes2+i,dir2,pos2);
|
||||
|
||||
int hitObj,hitBox;
|
||||
for(int i=0;i<numBoxes1;i++)
|
||||
for(int j=0;j<numBoxes2;j++)
|
||||
//for each pair of boxes test for intersection
|
||||
if(CheckBoxCollision(worldBoxes1+i,worldBoxes2+j,hitPoint,&hitObj))
|
||||
{
|
||||
MemoryFreeBlock(worldBoxes1);
|
||||
MemoryFreeBlock(worldBoxes2);
|
||||
return true;
|
||||
}
|
||||
|
||||
MemoryFreeBlock(worldBoxes1);
|
||||
MemoryFreeBlock(worldBoxes2);
|
||||
return false;
|
||||
}
|
||||
|
||||
//for a set of boxes, calculate the radius of the bounding sphere
|
||||
//= the distance of the furthest point from (0,0,0) (in object coordinates)
|
||||
float CalcMaxCollRadius(tCollBox *boxes,int numCollBoxes)
|
||||
{
|
||||
tVector3 extends=Vector(0,0,0);
|
||||
for(int i=0;i<numCollBoxes;i++)
|
||||
for(int j=0;j<8;j++)
|
||||
{
|
||||
if(fabs(((tVector3*)(boxes+i))[j].x)>extends.x)
|
||||
extends.x=fabs(((tVector3*)(boxes+i))[j].x);
|
||||
if(fabs(((tVector3*)(boxes+i))[j].y)>extends.y)
|
||||
extends.y=fabs(((tVector3*)(boxes+i))[j].y);
|
||||
if(fabs(((tVector3*)(boxes+i))[j].z)>extends.z)
|
||||
extends.z=fabs(((tVector3*)(boxes+i))[j].z);
|
||||
}
|
||||
return ~extends;
|
||||
}
|
||||
|
||||
//implements the physical laws of collision.
|
||||
//given two velocities and two masses, returns two new velocities
|
||||
//collType defines what type of collision this is:
|
||||
//if collType=0, this is a completely plastic collision, ie. both objects will be moving at the same speed afterwards.
|
||||
//if collType=1, this is a completely elastic collision, ie. both objects will be moving away from each other.
|
||||
void CalcCollisionImpulses(tVector3 v1,tVector3 v2,float m1,float m2,tVector3 *v1n,tVector3 *v2n,float collType)
|
||||
{
|
||||
tVector3 vUnelastic=(m1*v1+m2*v2)/(m1+m2);
|
||||
tVector3 v1Elastic=(m1*v1+m2*(2*v2-v1))/(m1+m2);
|
||||
tVector3 v2Elastic=(m2*v2+m1*(2*v1-v2))/(m1+m2);
|
||||
*v1n=collType*v1Elastic+(1-collType)*vUnelastic;
|
||||
*v2n=collType*v2Elastic+(1-collType)*vUnelastic;
|
||||
}
|
||||
|
||||
//Tests for a collision between a car and a solid entity (any obstacles, etc.. in the game), and takes appropoiate action
|
||||
void HandleCarSolidCollision(tGameEntity *carEntity,tGameEntity *entity)
|
||||
{
|
||||
tCarPhysics *phys=(tCarPhysics*)carEntity->physics;
|
||||
tCarDefinition *car=&(phys->car);
|
||||
tSolidEntityPhysics *ent=(tSolidEntityPhysics*)FileGetParsedDataPtr(entity->physicsData,kParserTypeSolidEntityDesc,sizeof(tSolidEntityPhysics));
|
||||
|
||||
//get bounding sphere radii of objects
|
||||
if(!car->maxCollRadius)car->maxCollRadius=CalcMaxCollRadius(car->coll,car->numCollBoxes);
|
||||
if(!ent->maxCollRadius)ent->maxCollRadius=CalcMaxCollRadius(ent->coll,ent->numCollBoxes);
|
||||
|
||||
//tests if the object's bounding spheres intersect
|
||||
tVector3 dist=carEntity->pos-entity->pos;
|
||||
if(sqr(dist)>sqr(car->maxCollRadius+ent->maxCollRadius))
|
||||
return;
|
||||
|
||||
tVector3 hitPoint;
|
||||
int coll=false;
|
||||
int movable=ent->movable;
|
||||
|
||||
if(!ent->liquid)
|
||||
if(movable)
|
||||
{
|
||||
if(CheckBoxListCollision(car->coll,ent->coll,car->numCollBoxes,ent->numCollBoxes,carEntity->dir,entity->dir,carEntity->pos,entity->pos,&hitPoint))
|
||||
{
|
||||
if((entity->pos-carEntity->pos)*carEntity->velo>0)
|
||||
{
|
||||
entity->pos=entity->pos+carEntity->velo*kFrameTime;
|
||||
coll=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if(CheckBoxListCollision(car->coll,ent->coll,car->numCollBoxes,ent->numCollBoxes,carEntity->dir,entity->dir,carEntity->pos,entity->pos,&hitPoint))
|
||||
{
|
||||
carEntity->pos=carEntity->oldPos;
|
||||
MatrixCopy(carEntity->oldDir,carEntity->dir);
|
||||
coll=true;
|
||||
phys->collision=gFrameCount;
|
||||
}
|
||||
else
|
||||
coll=CheckBoxListCollision(car->coll,ent->coll,car->numCollBoxes,ent->numCollBoxes,carEntity->dir,entity->dir,carEntity->pos,entity->pos,&hitPoint);
|
||||
|
||||
//was there a collision?
|
||||
if(coll)
|
||||
{
|
||||
//is the object movable (like a barrel, etc..)
|
||||
if(movable)
|
||||
{
|
||||
//calculate new velocities of car and object
|
||||
tVector3 carHitPoint=hitPoint-carEntity->pos;
|
||||
tVector3 carPointVelo=((carHitPoint*carEntity->rVelo)-carHitPoint)*kFPS+carEntity->velo;
|
||||
|
||||
tVector3 entHitPoint=hitPoint-entity->pos;
|
||||
tVector3 entPointVelo=((entHitPoint*entity->rVelo)-entHitPoint)*kFPS+entity->velo;
|
||||
|
||||
tVector3 newCarPointVelo;
|
||||
tVector3 newEntPointVelo;
|
||||
|
||||
CalcCollisionImpulses(carPointVelo,entPointVelo,car->mass,ent->mass,&newCarPointVelo,&newEntPointVelo,0.5);
|
||||
|
||||
float carImpulseScale=(~carEntity->velo)/10;
|
||||
if(carImpulseScale>1)carImpulseScale=1;
|
||||
ApplyImpulse(carEntity,carHitPoint,(newCarPointVelo-carPointVelo)*0.6*carImpulseScale,0.15,false);
|
||||
|
||||
tVector3 oldVelo=entity->velo;
|
||||
tMatrix3 oldrVelo;
|
||||
MatrixCopy(entity->rVelo,oldrVelo);
|
||||
ApplyImpulse(entity,entHitPoint,(newEntPointVelo-entPointVelo)*0.25,0.5,false);
|
||||
|
||||
if(ent->mass>=kSolidEntityNetworkMass&&carEntity->physicsMachine==kPhysicsLocal)
|
||||
entity->lastFrame=gFrameCount;
|
||||
if(ent->numSounds)
|
||||
{
|
||||
float vol=~(newEntPointVelo-entPointVelo)*0.1;
|
||||
if(vol>0.5)
|
||||
CarPlayCrashNoise(carEntity,FileGetIndexedReference(ent->sound,RandomInt(0,ent->numSounds)),vol);
|
||||
}
|
||||
}
|
||||
else//object not movable (eg. trees, etc..)
|
||||
{
|
||||
tVector3 entHitPoint=hitPoint-entity->pos;
|
||||
|
||||
hitPoint=hitPoint-carEntity->pos;
|
||||
tVector3 rotVelo=((hitPoint*carEntity->rVelo)-hitPoint)*kFPS;
|
||||
if(~rotVelo>5)rotVelo=!rotVelo*5;
|
||||
tVector3 pointVelo=rotVelo+carEntity->velo;
|
||||
float sparks=(~carEntity->velo-kMinSparkVelo)/(kMaxSparkVelo-kMinSparkVelo);
|
||||
if(sparks>1)sparks=1;
|
||||
sparks*=kMaxSpark*kFrameTime;
|
||||
MakeSparks(hitPoint+carEntity->pos,sparks);
|
||||
MakeSqueaks(carEntity,~pointVelo,1);
|
||||
ApplyImpulse(carEntity,hitPoint,-pointVelo*0.25,0.8,false);
|
||||
|
||||
if(~carEntity->velo>10&&ent->inertia&&!ent->movable)
|
||||
{
|
||||
tVector3 torque=(entHitPoint)%(carEntity->velo*car->mass*kFPS);
|
||||
tMatrix3 invMatrix;
|
||||
MatrixTranspose(entity->dir,invMatrix);
|
||||
torque=torque*invMatrix;
|
||||
tVector3 angularAcceleration=torque*1/ent->inertia*entity->dir;
|
||||
tMatrix3 accelerationMatrix;
|
||||
RotationVectorToMatrix(angularAcceleration*kFrameTime*kFrameTime,accelerationMatrix);
|
||||
MatrixMult(entity->dir,accelerationMatrix,entity->dir);
|
||||
carEntity->pos=carEntity->pos-carEntity->velo*kFrameTime*6;
|
||||
}
|
||||
|
||||
float v=~carEntity->velo;
|
||||
if(v>5)
|
||||
carEntity->velo=carEntity->velo*((v-5)/v);
|
||||
else
|
||||
carEntity->velo=Vector(0,0,0);
|
||||
}
|
||||
if(entity->untouchable)
|
||||
gDisqualified=true;
|
||||
}
|
||||
}
|
||||
|
||||
//Checks if two cars collide and take appropiate action
|
||||
void HandleCarCarCollision(tGameEntity *carEntity1,tGameEntity *carEntity2)
|
||||
{
|
||||
tCarPhysics *phys1=(tCarPhysics*)carEntity1->physics;
|
||||
tCarDefinition *car1=&(phys1->car);
|
||||
tCarPhysics *phys2=(tCarPhysics*)carEntity2->physics;
|
||||
tCarDefinition *car2=&(phys2->car);
|
||||
|
||||
//get bounding sphere radii of objects
|
||||
if(!car1->maxCollRadius)car1->maxCollRadius=CalcMaxCollRadius(car1->coll,car1->numCollBoxes);
|
||||
if(!car2->maxCollRadius)car2->maxCollRadius=CalcMaxCollRadius(car2->coll,car2->numCollBoxes);
|
||||
|
||||
//tests if the object's bounding spheres intersect
|
||||
tVector3 dist=carEntity1->pos-carEntity2->pos;
|
||||
if(sqr(dist)>sqr(car1->maxCollRadius+car2->maxCollRadius))
|
||||
return;
|
||||
|
||||
tVector3 hitPoint;
|
||||
int coll=false;
|
||||
//tests if objects box lists intersect
|
||||
while(CheckBoxListCollision(car1->coll,car2->coll,car1->numCollBoxes,car2->numCollBoxes,carEntity1->dir,carEntity2->dir,carEntity1->pos,carEntity2->pos,&hitPoint)&&!(gReplay&&coll))
|
||||
{
|
||||
//move cars away from ech other until they no longer intersect
|
||||
if(!gReplay)
|
||||
{
|
||||
tVector3 diff=carEntity1->pos-carEntity2->pos;
|
||||
carEntity2->pos=carEntity1->pos-diff*1.01;
|
||||
carEntity1->pos=carEntity2->pos+diff*(1.01*1.01);
|
||||
}
|
||||
coll=true;
|
||||
}
|
||||
|
||||
//was there a collision?
|
||||
if(coll)
|
||||
{
|
||||
//calculate new velocities of cars
|
||||
tVector3 car1HitPoint=hitPoint-carEntity1->pos;
|
||||
tVector3 car1PointVelo=((car1HitPoint*carEntity1->rVelo)-car1HitPoint)*kFPS;
|
||||
if(carEntity1->physicsMachine==kPhysicsLocal)
|
||||
car1PointVelo=car1PointVelo+carEntity1->velo;
|
||||
else
|
||||
car1PointVelo=car1PointVelo+carEntity1->collVelo;
|
||||
|
||||
tVector3 car2HitPoint=hitPoint-carEntity2->pos;
|
||||
tVector3 car2PointVelo=((car2HitPoint*carEntity2->rVelo)-car2HitPoint)*kFPS;
|
||||
if(carEntity2->physicsMachine==kPhysicsLocal)
|
||||
car2PointVelo=car2PointVelo+carEntity2->velo;
|
||||
else
|
||||
car2PointVelo=car2PointVelo+carEntity2->collVelo;
|
||||
|
||||
tVector3 newCar1PointVelo;
|
||||
tVector3 newCar2PointVelo;
|
||||
|
||||
if(!gReplay)
|
||||
{
|
||||
CalcCollisionImpulses(car1PointVelo,car2PointVelo,car1->mass,car2->mass,&newCar1PointVelo,&newCar2PointVelo,1);
|
||||
|
||||
ApplyImpulse(carEntity1,car1HitPoint,(newCar1PointVelo-car1PointVelo)*0.25,0.1,false);
|
||||
ApplyImpulse(carEntity2,car2HitPoint,(newCar2PointVelo-car2PointVelo)*0.25,0.1,false);
|
||||
carEntity1->netVelo=carEntity1->velo;
|
||||
MatrixCopy(carEntity1->rVelo,carEntity1->netRVelo);
|
||||
carEntity1->netPos=carEntity1->pos;
|
||||
MatrixCopy(carEntity1->dir,carEntity1->netDir);
|
||||
carEntity2->netVelo=carEntity2->velo;
|
||||
MatrixCopy(carEntity2->rVelo,carEntity2->netRVelo);
|
||||
carEntity2->netPos=carEntity2->pos;
|
||||
MatrixCopy(carEntity2->dir,carEntity2->netDir);
|
||||
carEntity1->accel=Vector(0,0,0);
|
||||
carEntity2->accel=Vector(0,0,0);
|
||||
}
|
||||
float impulse=~(newCar1PointVelo-car1PointVelo)+~(newCar2PointVelo-car2PointVelo);
|
||||
float sparks=(impulse-kMinSparkVelo)/(kMaxSparkVelo-kMinSparkVelo);
|
||||
if(sparks>1)sparks=1;
|
||||
sparks*=kMaxSpark*kFrameTime*5;
|
||||
MakeSparks(hitPoint,sparks);
|
||||
MakeSqueaks(carEntity1,impulse,1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//for a car, test if it collides with anything else (ground, other cars or objects).
|
||||
void CarCheckCollision(tGameEntity *carEntity)
|
||||
{
|
||||
tGameEntity *entity=(tGameEntity*)gFirstEntity->next;
|
||||
|
||||
//if(carEntity->physicsMachine==kPhysicsLocal)
|
||||
{
|
||||
// if(!gReplay)
|
||||
|
||||
if(!(gFrameCount%kCarCollisionRate))
|
||||
{
|
||||
if(carEntity->physicsMachine!=kPhysicsLocal)
|
||||
gQuickRoadCollision=true;
|
||||
gRoadRestrictedBorders=true;
|
||||
CheckGroundCollision(carEntity);
|
||||
gRoadRestrictedBorders=false;
|
||||
gQuickRoadCollision=false;
|
||||
}
|
||||
}
|
||||
|
||||
//for each other object, test for collision.
|
||||
if(!(gFrameCount%kCarCollisionRate))
|
||||
while(entity!=gFirstEntity)
|
||||
{
|
||||
entity->regData=carEntity->regData;
|
||||
if(sqr(entity->pos-carEntity->pos)<500)
|
||||
if(entity!=carEntity)
|
||||
switch(entity->physicsType)
|
||||
{
|
||||
case kPhysicsTypeSolid:
|
||||
HandleCarSolidCollision(carEntity,entity);
|
||||
break;
|
||||
case kPhysicsTypeCar:
|
||||
//if(carEntity->physicsMachine==kPhysicsLocal)
|
||||
HandleCarCarCollision(carEntity,entity);
|
||||
break;
|
||||
}
|
||||
entity=(tGameEntity*)entity->next;
|
||||
}
|
||||
}
|
||||
|
||||
//for a solid entity, check if it intersects with the ground
|
||||
void SolidCheckCollision(tGameEntity *entity)
|
||||
{
|
||||
tSolidEntityPhysics *ent=(tSolidEntityPhysics*)FileGetParsedDataPtr(entity->physicsData,kParserTypeSolidEntityDesc,sizeof(tSolidEntityPhysics));
|
||||
if(!ent->movable)
|
||||
return;
|
||||
CheckGroundCollision(entity);
|
||||
|
||||
tVector3 xDiff=*MatrixGetXVector(entity->rVelo)-Vector(1,0,0);
|
||||
tVector3 yDiff=*MatrixGetYVector(entity->rVelo)-Vector(0,1,0);
|
||||
tVector3 zDiff=*MatrixGetZVector(entity->rVelo)-Vector(0,0,1);
|
||||
*MatrixGetXVector(entity->rVelo)=*MatrixGetXVector(entity->rVelo)-xDiff*1.5*kFrameTime;
|
||||
*MatrixGetYVector(entity->rVelo)=*MatrixGetYVector(entity->rVelo)-yDiff*1.5*kFrameTime;
|
||||
*MatrixGetZVector(entity->rVelo)=*MatrixGetZVector(entity->rVelo)-zDiff*1.5*kFrameTime;
|
||||
}
|
||||
|
||||
tRegData rd;
|
||||
|
||||
//check for any object collisions
|
||||
void CollisionFrame()
|
||||
{
|
||||
#ifndef __TARGET_TOOLAPP
|
||||
rd.name=RT3_GetLicenseName();
|
||||
rd.numCopies=RT3_GetLicenseCopies();
|
||||
#endif
|
||||
tGameEntity *entity=(tGameEntity*)gFirstEntity->next;
|
||||
while(entity!=gFirstEntity)
|
||||
{
|
||||
entity->regData=&rd;
|
||||
//has the object moved in the last second?
|
||||
//if we have a solid entity like a barrel which has been kicked over by a car,
|
||||
//we don't need to process collisions with the ground anymore once the barrel
|
||||
//has come to rest.
|
||||
if(entity->lastActivity+kFPS>gFrameCount&&entity->id>=0)
|
||||
//if(entity->physicsMachine!=kPhysicsRemote||entity->lastCollFrame==0||entity->lastCollFrame>gFrameCount-kFPS)
|
||||
switch(entity->physicsType)
|
||||
{
|
||||
case kPhysicsTypeCar:
|
||||
CarCheckCollision(entity);
|
||||
break;
|
||||
case kPhysicsTypeSolid:
|
||||
if(!(gFrameCount%kSolidCollisionRate))
|
||||
SolidCheckCollision(entity);
|
||||
break;
|
||||
}
|
||||
entity=(tGameEntity*)entity->next;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef __COLLISION
|
||||
#define __COLLISION
|
||||
|
||||
#define kCarCollisionRate 1
|
||||
#define kSolidCollisionRate 5
|
||||
|
||||
#define kSolidEntityNetworkMass 100
|
||||
|
||||
void ApplyImpulse(tGameEntity *entity,tVector3 attackPoint,tVector3 veloDiff,float rotationFactor,int net);
|
||||
float GetGroundOffset(tVector3 point,int *lastRoadIndex,tVector3 *normal,int *surfaceType);
|
||||
float GetGroundOffsetAndBump(tVector3 point,int *lastRoadIndex,tVector3 *normal,int *surfaceType,float *bump);
|
||||
void SolidCheckCollision(tGameEntity *entity);
|
||||
void CollisionFrame();
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,41 @@
|
||||
#include "fileio.h"
|
||||
#include "config.h"
|
||||
#include "gamemem.h"
|
||||
#include "parser.h"
|
||||
#include "gameinitexit.h"
|
||||
#include "carselection.h"
|
||||
#include "screen.h"
|
||||
#include <string.h>
|
||||
|
||||
tSysConfig *gConfig;
|
||||
|
||||
void ConfigInit()
|
||||
{
|
||||
gConfig=(tSysConfig*)FileGetParsedDataPtr(FileGetReference(kConfigFileName),kParserTypeConfigDesc,sizeof(tSysConfig));
|
||||
if(strlen(gConfig->playerName)==0)
|
||||
CFStringGetCString(CSCopyUserName(false),gConfig->playerName,256,0);
|
||||
if(strlen(gConfig->gameName)==0)
|
||||
CFStringGetCString(CSCopyMachineName(),gConfig->gameName,256,0);
|
||||
if(strlen(gConfig->playerName)>=kMaxNameLength)
|
||||
gConfig->playerName[kMaxNameLength-1]='\0';
|
||||
if((gConfig->dbIndex^gConfig->challengeData)!=0xdeadbeef)
|
||||
{
|
||||
gConfig->dbIndex=0xdeadbeef;
|
||||
gConfig->challengeData=0;
|
||||
}
|
||||
|
||||
int availableCars[kMaxCars];
|
||||
int carCount;
|
||||
GetAvailableCars(availableCars,&carCount,false,false);
|
||||
for(int i=0;i<11;i++)
|
||||
{
|
||||
int ok=false;
|
||||
for(int j=0;j<carCount;j++)
|
||||
if(availableCars[j]==gConfig->opponentCars[i])
|
||||
ok=true;
|
||||
if(!ok)
|
||||
gConfig->opponentCars[i]=availableCars[0];
|
||||
}
|
||||
if(ScreenNoWindow())
|
||||
gConfig->fullscreen=true;
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
#ifndef __CONFIG
|
||||
#define __CONFIG
|
||||
|
||||
#include "fileio.h"
|
||||
|
||||
enum{
|
||||
kInteriorDisplayOff,
|
||||
kInteriorDisplayPlayerOnly,
|
||||
kInteriorDisplayCloseCarsOnly,
|
||||
kInteriorDisplayAlways,
|
||||
kInteriorDisplayNumModes
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
int keyID;
|
||||
int controllerID1;
|
||||
int controllerID2;
|
||||
int elementID;
|
||||
char identifier[32];
|
||||
char controllerIdentifier[256];
|
||||
}tKeyConfig;
|
||||
|
||||
typedef struct{
|
||||
int axisControllerID1;
|
||||
int axisControllerID2;
|
||||
int axisElementID;
|
||||
char axisIdentifier[256];
|
||||
int min,mid,max;
|
||||
float deadzone;
|
||||
}tAxisConfig;
|
||||
|
||||
#define kMaxPersonalRecords 1024
|
||||
typedef struct{
|
||||
tFileRef car,map;
|
||||
int mode,direction;
|
||||
int time;
|
||||
}tPersonalRecord;
|
||||
|
||||
typedef struct{
|
||||
int screenXSize,screenYSize;
|
||||
int windowX,windowY;
|
||||
int fullscreen;
|
||||
int onlyRegisteredPlayers;
|
||||
int useBetaBuilds;
|
||||
int noGhost;
|
||||
float gfxDynamics;
|
||||
int allowHugeGames;
|
||||
int interfaceSounds;
|
||||
int stencil;
|
||||
int performanceStats;
|
||||
int textureQuality;
|
||||
int soundEnable;
|
||||
int maxPlayers;
|
||||
int color32Bit;
|
||||
int fsaa;
|
||||
int guideSigns;
|
||||
int motionBlur;
|
||||
int allCams;
|
||||
int cantGoBackwards;
|
||||
int ffb;
|
||||
float ffbIntensity;
|
||||
int arcade,reverse;
|
||||
int showPlayerNames;
|
||||
int trackerEnable;
|
||||
int carsOnSpeed;
|
||||
int demolition;
|
||||
int registerLapTimes;
|
||||
int metricUnits;
|
||||
int challengeData;
|
||||
int dbIndex;
|
||||
int textureFilter;
|
||||
int showReplays;
|
||||
int seperateGasBrake;
|
||||
int disableAnalogueTCS;
|
||||
int reverseGas;
|
||||
tFileRef lastCar,lastEnemy,lastRoad,lastEnv;
|
||||
int numEnemies,automatic,lastLaps,lastColor;
|
||||
float soundVolume,musicVolume;
|
||||
int maxCarSources;
|
||||
float hudTransparency;
|
||||
int interiorDisplay;
|
||||
int cameraMode;
|
||||
int numKeys,numAxis,numTaunts;
|
||||
char playerName[256];
|
||||
char gameName[256];
|
||||
char password[256];
|
||||
char (*taunts)[256];
|
||||
char confirmedVersion[256];
|
||||
tKeyConfig *keys;
|
||||
tAxisConfig *axis;
|
||||
tFileRef opponentCars[11];
|
||||
int opponentColors[11];
|
||||
int challengeRecords[32];
|
||||
int numPersonalRecords;
|
||||
tPersonalRecord records[kMaxPersonalRecords];
|
||||
}tSysConfig;
|
||||
|
||||
extern tSysConfig *gConfig;
|
||||
|
||||
#define kConfigDefault16Name "default16.cfg"
|
||||
#define kConfigDefault32Name "default32.cfg"
|
||||
#define kConfigDefault64Name "default64.cfg"
|
||||
#define kConfigFileName "Redline Preferences"
|
||||
#define kConfigFilePName "\pRedline Preferences"
|
||||
|
||||
void ConfigInit();
|
||||
|
||||
#endif
|
||||
Executable
+740
@@ -0,0 +1,740 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "entities.h"
|
||||
#include "gameframe.h"
|
||||
#include "carphysics.h"
|
||||
#include "controls.h"
|
||||
#include "config.h"
|
||||
#include "renderframe.h"
|
||||
#include "gameinitexit.h"
|
||||
#include "particles.h"
|
||||
#include "gametime.h"
|
||||
#include "network.h"
|
||||
#include "random.h"
|
||||
#include "reg_tool_3.h"
|
||||
#include "rt3_redline.h"
|
||||
#include "initexit.h"
|
||||
#include "text.h"
|
||||
|
||||
#define kThrottleTime 0.3
|
||||
#define kThrottleReleaseTime 0.2
|
||||
#define kThrottleTCRReleaseTime 0.7
|
||||
#define kThrottleTimeSpinning 0.6
|
||||
#define kBrakeTime 0.4
|
||||
#define kBrakeReleaseTime 0.2
|
||||
#define kSteerReleaseTime 0.6
|
||||
#define kVeloSteerReleaseTime 0
|
||||
//#define kSteerTime 1.2
|
||||
#define kSteerTime 0.6
|
||||
#define kVeloSteerTime 0.05
|
||||
#define kHandbrakeTime 0.2
|
||||
#define kHandbrakeReleaseTime 0.01
|
||||
|
||||
#define sign(x) ((x)<0?-1:1)
|
||||
|
||||
#define kMaxThottleSlip 0.033
|
||||
#define kMinSpinAngularVelo (4*PI)
|
||||
#define kMaxBrakeSlip 0.05
|
||||
|
||||
int gGearUpPress=false;
|
||||
int gGearDownPress=false;
|
||||
int gLightPress=false;
|
||||
int gCameraPress=false;
|
||||
int gReplayCameraPress=false;
|
||||
int gTauntPress=false;
|
||||
int gArrowPress=false;
|
||||
int gEscPress=false;
|
||||
int gPausePress=false;
|
||||
|
||||
float gSteerAxis=0;
|
||||
float gThrottleAxis=0;
|
||||
int gAxisSteering=false;
|
||||
int gAxisThrottleBrake=false;
|
||||
int gInputChatMode=false;
|
||||
int gInputEscMode=kInputEscModeNone;
|
||||
int gInputEscSelection;
|
||||
int gGameChatMessageSize=0;
|
||||
|
||||
#define kMaxGameChatMessageSize 128
|
||||
char gGameChatMessage[kMaxGameChatMessageSize]="";
|
||||
|
||||
void ButtonThrottle(tCarDefinition *car,tCarPhysics *phys,float driveSlip,float angularVelo,float velo,float throttleInput,int tcr)
|
||||
{
|
||||
float maxSlip=velo<20?0.2-velo/20*(0.2-kMaxThottleSlip):kMaxThottleSlip;
|
||||
if(throttleInput<0)
|
||||
throttleInput=0;
|
||||
if(throttleInput>phys->throttle){
|
||||
if(driveSlip*sign(phys->gear)<maxSlip||fabs(angularVelo)<kMinSpinAngularVelo||!tcr||(phys->clutch<1&&phys->rpm>car->clutchRPM))
|
||||
{
|
||||
phys->throttle+=kFrameTime*(1/kThrottleTime);
|
||||
if(throttleInput>phys->throttle)
|
||||
throttleInput=phys->throttle;
|
||||
}
|
||||
else
|
||||
{
|
||||
phys->throttle-=kFrameTime*(1/kThrottleTCRReleaseTime);
|
||||
if(throttleInput<phys->throttle)
|
||||
throttleInput=phys->throttle;
|
||||
}
|
||||
}
|
||||
else {
|
||||
phys->throttle-=kFrameTime*(1/kThrottleReleaseTime);
|
||||
if(throttleInput<phys->throttle)
|
||||
throttleInput=phys->throttle;
|
||||
}
|
||||
|
||||
if(phys->throttle>1)
|
||||
phys->throttle=1;
|
||||
else if(phys->throttle<phys->idleThrottle&&phys->rpm<=car->idleRPM)
|
||||
phys->throttle=phys->idleThrottle;
|
||||
|
||||
phys->clutch=1;
|
||||
}
|
||||
|
||||
|
||||
void ButtonBrake(tCarPhysics *phys,float slip,float angularVelo,float brakeInput,int als)
|
||||
{
|
||||
if(brakeInput>1)
|
||||
brakeInput=1;
|
||||
else if(brakeInput<0)
|
||||
brakeInput=0;
|
||||
|
||||
if(brakeInput<0)
|
||||
brakeInput=0;
|
||||
if(brakeInput>phys->brake)
|
||||
{
|
||||
if((-slip*sign(angularVelo)<kMaxBrakeSlip)||(phys->brake<0.1)||!als)
|
||||
phys->brake+=kFrameTime*(1/kBrakeTime);
|
||||
else
|
||||
phys->brake-=kFrameTime*(1/kBrakeTime);
|
||||
|
||||
phys->arcadeBrake+=kFrameTime*(1/kBrakeTime);
|
||||
|
||||
if(brakeInput<phys->brake)
|
||||
phys->brake=brakeInput;
|
||||
if(brakeInput<phys->arcadeBrake)
|
||||
phys->arcadeBrake=brakeInput;
|
||||
}
|
||||
else
|
||||
{
|
||||
phys->brake-=kFrameTime*(1/kBrakeReleaseTime);
|
||||
|
||||
phys->arcadeBrake-=kFrameTime*(1/kBrakeReleaseTime);
|
||||
|
||||
if(brakeInput>phys->brake)
|
||||
phys->brake=brakeInput;
|
||||
if(brakeInput>phys->arcadeBrake)
|
||||
phys->arcadeBrake=brakeInput;
|
||||
}
|
||||
}
|
||||
|
||||
void CalcThrottleBrake(tCarDefinition *car,tCarPhysics *phys,float driveSlip,float angularVelo,float velo,float slip)
|
||||
{
|
||||
if(car->clutchRPM==0)
|
||||
car->clutchRPM=3000;
|
||||
int raceOver=(phys->lapCount>gGameInfo->numLaps&&gGameInfo->numLaps!=-1);
|
||||
if(!raceOver)
|
||||
{
|
||||
float gas,brake,gasbrake;
|
||||
if(gConfig->seperateGasBrake)
|
||||
{
|
||||
if(gConfig->reverseGas)
|
||||
{
|
||||
gas=GetAxisInput(kInputThrottleAxis);
|
||||
brake=GetAxisInput(kInputBrakeAxis);
|
||||
}
|
||||
else
|
||||
{
|
||||
gas=1-GetAxisInput(kInputThrottleAxis);
|
||||
brake=1-GetAxisInput(kInputBrakeAxis);
|
||||
}
|
||||
gasbrake=gas-brake;
|
||||
}
|
||||
else
|
||||
{
|
||||
gasbrake=GetAxisInput(kInputThrottleBrakeAxis);
|
||||
if(gConfig->reverseGas)
|
||||
gasbrake=-gasbrake;
|
||||
gas=gasbrake;
|
||||
brake=-gasbrake;
|
||||
}
|
||||
|
||||
if(gAxisThrottleBrake)
|
||||
{
|
||||
|
||||
if(gConfig->automatic&&phys->gear==-1)
|
||||
{
|
||||
ButtonBrake(phys,slip,angularVelo,gas,true);
|
||||
ButtonThrottle(car,phys,driveSlip,angularVelo,velo,brake,(brake<0.95)&&!gConfig->disableAnalogueTCS);
|
||||
}
|
||||
else
|
||||
{
|
||||
ButtonBrake(phys,slip,angularVelo,brake,true);
|
||||
ButtonThrottle(car,phys,driveSlip,angularVelo,velo,gas,(gas<0.95)&&!gConfig->disableAnalogueTCS);
|
||||
}
|
||||
if(GetButtonInput(kInputKickdownButton)||GetButtonInput(kInputBrakeButton)||GetButtonInput(kInputGasButton))
|
||||
gAxisThrottleBrake=false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int brake=GetButtonInput(kInputBrakeButton);
|
||||
int gas=GetButtonInput(kInputGasButton);
|
||||
int kickdown=GetButtonInput(kInputKickdownButton);
|
||||
|
||||
int gasInput=(gConfig->automatic?(phys->gear>=0?gas||kickdown:brake):(gas||kickdown))?1:0;
|
||||
ButtonThrottle(car,phys,driveSlip,angularVelo,velo,gasInput,!kickdown);
|
||||
int brakeInput=(gConfig->automatic?(phys->gear>=0?brake:gas||kickdown):brake)?1:0;
|
||||
ButtonBrake(phys,slip,angularVelo,brakeInput,true);
|
||||
|
||||
if(gThrottleAxis!=gasbrake)
|
||||
gAxisThrottleBrake=true;
|
||||
}
|
||||
gThrottleAxis=gasbrake;
|
||||
}
|
||||
else
|
||||
{
|
||||
ButtonBrake(phys,slip,angularVelo,1,true);
|
||||
ButtonThrottle(car,phys,driveSlip,angularVelo,velo,0,true);
|
||||
}
|
||||
}
|
||||
|
||||
void ButtonSteering(tGameEntity *entity,tCarDefinition *car,tCarPhysics *phys,float velo,float input)
|
||||
{
|
||||
if(input>1) input=1;
|
||||
else if(input<-1) input=-1;
|
||||
|
||||
tVector3 carDir=!Vector(MatrixGetZVector(entity->dir)->x,0,MatrixGetZVector(entity->dir)->z);
|
||||
tVector3 veloDir=!Vector(entity->velo.x,0,entity->velo.z);
|
||||
float angleSin=(veloDir%carDir).y;
|
||||
if(fabs(angleSin)>1.0)
|
||||
angleSin=sign(angleSin);
|
||||
float angle=-asin(angleSin);
|
||||
float optimalSteering=angle/car->wheels[0].maxAngle;
|
||||
if(velo<1)
|
||||
optimalSteering=0;
|
||||
|
||||
if(input>phys->steering)
|
||||
{
|
||||
float steerSpeed=(phys->steering<0)?(1/(kSteerReleaseTime+kVeloSteerReleaseTime*velo)) :(1/(kSteerTime+kVeloSteerTime*velo));
|
||||
if(phys->steering<optimalSteering)
|
||||
steerSpeed*=1+(optimalSteering-phys->steering)*4;
|
||||
if(gGameInfo->arcade==kGameModeTurbo)
|
||||
steerSpeed*=2;
|
||||
phys->steering+=kFrameTime*steerSpeed;
|
||||
|
||||
if(input<phys->steering)
|
||||
phys->steering=input;
|
||||
}
|
||||
else if(input<phys->steering)
|
||||
{
|
||||
float steerSpeed=(phys->steering>0)?(1/(kSteerReleaseTime+kVeloSteerReleaseTime*velo)) :(1/(kSteerTime+kVeloSteerTime*velo));
|
||||
if(phys->steering>optimalSteering)
|
||||
steerSpeed*=1+(phys->steering-optimalSteering)*4;
|
||||
if(gGameInfo->arcade==kGameModeTurbo)
|
||||
steerSpeed*=2;
|
||||
phys->steering-=kFrameTime*steerSpeed;
|
||||
|
||||
if(input>phys->steering)
|
||||
phys->steering=input;
|
||||
}
|
||||
}
|
||||
|
||||
void CalcSteering(tGameEntity *entity,tCarDefinition *car,tCarPhysics *phys,float velo)
|
||||
{
|
||||
if(gAxisSteering)
|
||||
{
|
||||
gSteerAxis=GetAxisInput(kInputSteerAxis);
|
||||
float ax3=gSteerAxis*gSteerAxis*gSteerAxis;
|
||||
float ax=0.3*gSteerAxis+0.7*ax3;
|
||||
ButtonSteering(entity,car,phys,velo,ax);
|
||||
|
||||
if(GetButtonInput(kInputSteerLeftButton)||GetButtonInput(kInputSteerRightButton))
|
||||
gAxisSteering=false;
|
||||
}
|
||||
else
|
||||
{
|
||||
float input=0;
|
||||
int l=GetButtonInput(kInputSteerLeftButton);
|
||||
int r=GetButtonInput(kInputSteerRightButton);
|
||||
if(l&&r)
|
||||
input=phys->steering;
|
||||
else if(l)
|
||||
input=1;
|
||||
else if(r)
|
||||
input=-1;
|
||||
ButtonSteering(entity,car,phys,velo,input);
|
||||
if(gSteerAxis!=GetAxisInput(kInputSteerAxis))
|
||||
gAxisSteering=true;
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct{
|
||||
char *name;
|
||||
int numCopies;
|
||||
}tRegData;
|
||||
|
||||
void ControlEntityUserInput(tGameEntity *entity)
|
||||
{
|
||||
if(entity->physicsType!=kPhysicsTypeCar)
|
||||
return;
|
||||
tCarPhysics *phys=(tCarPhysics*)entity->physics;
|
||||
tCarDefinition *car=&(phys->car);
|
||||
|
||||
int isValid=true;
|
||||
float velo=~entity->velo;
|
||||
float driveSlip=0,slip=0,angularVelo=0;
|
||||
int wheelsOnGround=0;
|
||||
int valid=true;
|
||||
if((car->demoAvailable-car->numColors!=1)&&(entity==gCarEntities[gGameInfo->playerID]))
|
||||
isValid=false;
|
||||
|
||||
for(int i=0;i<car->numWheels;i++)
|
||||
{
|
||||
if(phys->wheels[i].onGround)
|
||||
{
|
||||
driveSlip+=phys->wheels[i].slip*car->wheels[i].powered;
|
||||
slip+=phys->wheels[i].slip;
|
||||
wheelsOnGround++;
|
||||
}
|
||||
angularVelo+=phys->wheels[i].angularVelo*car->wheels[i].powered;
|
||||
}
|
||||
if((gMapInfo->demoAvailable+gMapInfo->numObjs))
|
||||
isValid=false;
|
||||
|
||||
if(wheelsOnGround)
|
||||
slip/=wheelsOnGround;
|
||||
else
|
||||
slip=0;
|
||||
CalcThrottleBrake(car,phys,driveSlip,angularVelo,velo,slip);
|
||||
CalcSteering(entity,car,phys,velo);
|
||||
|
||||
if(!isValid)
|
||||
if(entity->regData)
|
||||
qRT3_LicenseTestApp2(phys->regCode,((tRegData*)(entity->regData))->name,((tRegData*)(entity->regData))->numCopies,isValid);
|
||||
|
||||
if(GetButtonInput(kInputHandbrakeButton))
|
||||
phys->handbrake+=kFrameTime*(1/kHandbrakeTime);
|
||||
else
|
||||
phys->handbrake-=kFrameTime*(1/kHandbrakeReleaseTime);
|
||||
if(phys->handbrake>1)
|
||||
phys->handbrake=1;
|
||||
else if(phys->handbrake<0)
|
||||
phys->handbrake=0;
|
||||
|
||||
if(!isValid)
|
||||
if(entity->regData)
|
||||
qRT3_LicenseTestBlock2(phys->regCode,((tRegData*)(entity->regData))->name,((tRegData*)(entity->regData))->numCopies,isValid);
|
||||
|
||||
if(gFrameCount*kFrameTime>=kStartGameDelaySeconds)
|
||||
{
|
||||
if(gConfig->automatic)
|
||||
{
|
||||
if((gFrameCount-1)*kFrameTime>phys->lastGearSwitch+car->gearSwitchTime)
|
||||
{
|
||||
if(phys->gear>=1)
|
||||
{
|
||||
int shiftUp=false;
|
||||
if(car->shiftUpRPMFix)
|
||||
shiftUp=phys->rpm>car->shiftUpRPMFix;
|
||||
else
|
||||
shiftUp=phys->rpm>car->maxRPM;
|
||||
|
||||
if(shiftUp&&phys->gear<car->numGears-2)
|
||||
{
|
||||
if(!GetButtonInput(kInputKickdownButton)&&phys->gear>0&&gFrameCount*kFrameTime>=kStartGameDelaySeconds+1)
|
||||
{
|
||||
phys->lastGear=phys->gear;
|
||||
phys->gear++;
|
||||
phys->lastGearSwitch=gFrameCount*kFrameTime;
|
||||
if(gGameInfo->arcade==kGameModeTurbo)
|
||||
phys->lastGearSwitch-=car->gearSwitchTime*0.5;
|
||||
}
|
||||
}
|
||||
else if(phys->rpm<car->shiftDownRPM&&phys->gear>1)
|
||||
{
|
||||
phys->lastGear=phys->gear;
|
||||
phys->gear--;
|
||||
phys->lastGearSwitch=gFrameCount*kFrameTime;
|
||||
if(gGameInfo->arcade==kGameModeTurbo)
|
||||
phys->lastGearSwitch-=car->gearSwitchTime*0.5;
|
||||
}
|
||||
}
|
||||
|
||||
if(phys->gear==0||velo<1)
|
||||
{
|
||||
if(phys->gear<1&&((GetButtonInput(kInputKickdownButton)||GetButtonInput(kInputGasButton)))||(gAxisThrottleBrake&&gThrottleAxis>0))
|
||||
{
|
||||
phys->lastGear=phys->gear;
|
||||
phys->gear=1;
|
||||
phys->lastGearSwitch=gFrameCount*kFrameTime;
|
||||
}
|
||||
else if(phys->gear>=0&&GetButtonInput(kInputBrakeButton)||(gAxisThrottleBrake&&gThrottleAxis<0))
|
||||
{
|
||||
phys->lastGear=phys->gear;
|
||||
phys->gear=-1;
|
||||
phys->lastGearSwitch=gFrameCount*kFrameTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GetButtonInput(kInputGearUp)){
|
||||
if(phys->gear<car->numGears-2&&!gGearUpPress){
|
||||
phys->lastGear=phys->gear;
|
||||
phys->gear++;
|
||||
gGearUpPress=true;
|
||||
phys->lastGearSwitch=gFrameCount*kFrameTime;
|
||||
if(gGameInfo->arcade==kGameModeTurbo)
|
||||
phys->lastGearSwitch-=car->gearSwitchTime*0.5;
|
||||
}
|
||||
}
|
||||
else gGearUpPress=false;
|
||||
|
||||
if(GetButtonInput(kInputGearDown)){
|
||||
if(phys->gear>-1&&!gGearDownPress){
|
||||
phys->lastGear=phys->gear;
|
||||
phys->gear--;
|
||||
gGearDownPress=true;
|
||||
phys->lastGearSwitch=gFrameCount*kFrameTime;
|
||||
if(gGameInfo->arcade==kGameModeTurbo)
|
||||
phys->lastGearSwitch-=car->gearSwitchTime*0.5;
|
||||
}
|
||||
}
|
||||
else gGearDownPress=false;
|
||||
}
|
||||
|
||||
float gearSwitchTime=phys->gear<=1?0.3:car->gearSwitchTime;
|
||||
if(gFrameCount*kFrameTime<phys->lastGearSwitch+gearSwitchTime)
|
||||
{
|
||||
float switchTime=(gFrameCount*kFrameTime-phys->lastGearSwitch)/gearSwitchTime;
|
||||
phys->clutch=switchTime;
|
||||
if(phys->rpm<car->clutchRPM)
|
||||
phys->clutch=(phys->rpm-car->idleRPM*1.5)/(car->clutchRPM-car->idleRPM*1.5);
|
||||
if(switchTime<0.5&&phys->gear>1)
|
||||
if(phys->lastGear>phys->gear)
|
||||
phys->throttle=0.7;
|
||||
else
|
||||
phys->throttle=phys->idleThrottle;
|
||||
if(entity==gViewedEntity)
|
||||
{
|
||||
int invalid=false;
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_CODE_01,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_CODE_02,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_03,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_04,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_05,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_06,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_07,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_08,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_09,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_10,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_11,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_12,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_13,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_14,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_15,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_16,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_17,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_18,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_19,invalid);
|
||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_20,invalid);
|
||||
valid=!invalid;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(phys->rpm<car->clutchRPM)
|
||||
phys->clutch=(phys->rpm-car->idleRPM*1.5)/(car->clutchRPM-car->idleRPM*1.5);
|
||||
else
|
||||
phys->clutch=1;
|
||||
|
||||
if(phys->clutch<0)
|
||||
phys->clutch=0;
|
||||
}
|
||||
|
||||
if(!isValid)
|
||||
if(gFrameCount>kFPS*30)
|
||||
phys->throttle=0;
|
||||
|
||||
if(GetButtonInput(kInputHorn))
|
||||
phys->lightFlags|=kLightFlagHorn;
|
||||
else
|
||||
phys->lightFlags&=~kLightFlagHorn;
|
||||
|
||||
if(!valid)
|
||||
if(RandomProb(kFrameTime/car->gearSwitchTime*7))
|
||||
phys->gear=0;
|
||||
|
||||
if(GetButtonInput(kInputLeftIndicator))
|
||||
phys->lightFlags|=kLightFlagLIndLight;
|
||||
else if(GetButtonInput(kInputRightIndicator))
|
||||
phys->lightFlags|=kLightFlagRIndLight;
|
||||
else
|
||||
phys->lightFlags&=~(kLightFlagLIndLight+kLightFlagRIndLight);
|
||||
|
||||
if(GetButtonInput(kInputLightButton)){
|
||||
if(!gLightPress)
|
||||
{
|
||||
gLightPress=true;
|
||||
phys->lightFlags^=kLightFlagDriveLight;
|
||||
}
|
||||
}else gLightPress=false;
|
||||
}
|
||||
|
||||
void ControlEntityAIInput(tGameEntity *entity);
|
||||
|
||||
extern float gEscDisplay;
|
||||
|
||||
void HandleEscModeInput()
|
||||
{
|
||||
if(GetInterfaceKey(kInterfaceKeyEsc)||GetInterfaceKey(kInterfaceKeyDelete))
|
||||
{
|
||||
if(!gEscPress)
|
||||
{
|
||||
gInputEscMode=kInputEscModeNone;
|
||||
gEscPress=true;
|
||||
if(!gGameInfo->network)
|
||||
UnPauseGame();
|
||||
}
|
||||
}
|
||||
else
|
||||
gEscPress=false;
|
||||
if(GetInterfaceKey(kInterfaceKeyDown))
|
||||
{
|
||||
if(!gArrowPress)
|
||||
{
|
||||
gInputEscSelection--;
|
||||
if(gInputEscSelection<0)
|
||||
gInputEscSelection=(gGameInfo->network?1:2);
|
||||
gArrowPress=true;
|
||||
}
|
||||
}
|
||||
else if(GetInterfaceKey(kInterfaceKeyUp))
|
||||
{
|
||||
if(!gArrowPress)
|
||||
{
|
||||
gInputEscSelection=(gInputEscSelection+1)%(gGameInfo->network?2:3);
|
||||
gArrowPress=true;
|
||||
}
|
||||
}
|
||||
else
|
||||
gArrowPress=false;
|
||||
if(GetInterfaceKey(kInterfaceKeyReturn)||GetInterfaceKey(kInterfaceKeyEnter))
|
||||
{
|
||||
if(gInputEscSelection==1)
|
||||
if(gInputEscMode==kInputEscModeQuit)
|
||||
Exit();
|
||||
else
|
||||
gGameEnd=kEndGame;
|
||||
if(gInputEscSelection==2)
|
||||
gGameEnd=kEndGameRestart;
|
||||
if(gInputEscMode==kInputEscModeQuit)
|
||||
gEscDisplay=0;
|
||||
gInputEscMode=kInputEscModeNone;
|
||||
if(!gGameInfo->network)
|
||||
UnPauseGame();
|
||||
}
|
||||
}
|
||||
|
||||
void HandleChatModeInput()
|
||||
{
|
||||
while(char ch=GetKeyInput(NULL))
|
||||
{
|
||||
if(ch=='\r')
|
||||
{
|
||||
if(ch=='\r'&&strlen(gGameChatMessage)>0)
|
||||
{
|
||||
tChatMessage msg;
|
||||
memset((void*)&msg,0,sizeof(tChatMessage));
|
||||
sprintf(msg.str,"%s: \255#a\255%s",gConfig->playerName,gGameChatMessage);
|
||||
msg.flags=0;
|
||||
NetworkSendPacket(kMessageTypeChat,&msg,sizeof(tChatMessage),kMessagePriorityHigh,kMessageSendToAll);
|
||||
}
|
||||
gGameChatMessage[0]='\0';
|
||||
gGameChatMessageSize=0;
|
||||
gInputChatMode=false;
|
||||
}
|
||||
if((ch==0x7f||ch==0x08)&&gGameChatMessageSize>0)
|
||||
gGameChatMessage[--gGameChatMessageSize]='\0';
|
||||
if(ch>=' '&&ch<='z'&&gGameChatMessageSize<kMaxGameChatMessageSize-1)
|
||||
{
|
||||
gGameChatMessage[gGameChatMessageSize++]=ch;
|
||||
gGameChatMessage[gGameChatMessageSize]='\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HandleNetworkInput()
|
||||
{
|
||||
if(GetButtonInput(kInputChat))
|
||||
{
|
||||
gInputChatMode=true;
|
||||
FlushKeys();
|
||||
}
|
||||
|
||||
int tauntPress=false;
|
||||
for(int i=kInputTaunt1;i<=kInputTaunt5;i++)
|
||||
if(GetButtonInput(i))
|
||||
{
|
||||
tauntPress=true;
|
||||
if(!gTauntPress&&*gConfig->taunts[i-kInputTaunt1])
|
||||
{
|
||||
tChatMessage msg;
|
||||
memset((void*)&msg,0,sizeof(tChatMessage));
|
||||
snprintf(msg.str,256,"%s: \255#a\255%s",gConfig->playerName,gConfig->taunts[i-kInputTaunt1]);
|
||||
msg.flags=0;
|
||||
NetworkSendPacket(kMessageTypeChat,&msg,sizeof(tChatMessage),kMessagePriorityHigh,kMessageSendToAll);
|
||||
}
|
||||
}
|
||||
gTauntPress=tauntPress;
|
||||
|
||||
|
||||
if(gInputChatMode)
|
||||
HandleChatModeInput();
|
||||
}
|
||||
|
||||
void HandleGameInput()
|
||||
{
|
||||
tCarPhysics *phys=(tCarPhysics*)gCarEntities[gGameInfo->playerID]->physics;
|
||||
|
||||
if(GetButtonInput(kInputCamera))
|
||||
{
|
||||
if(!gCameraPress)
|
||||
{
|
||||
ParticlesClearScreen();
|
||||
gCameraMode=(++gCameraMode)%(gConfig->allCams||gReplay||phys->lapCount>gGameInfo->numLaps&&gGameInfo->numLaps!=-1?kCameraNumModes:kCameraLeftWheel);
|
||||
gReplayAutoCam=false;
|
||||
}
|
||||
gCameraPress++;
|
||||
if(gCameraPress>=kFPS&&gCameraMode!=kCameraFree)
|
||||
{
|
||||
gCameraMode=kCameraFree;
|
||||
TextPrintfToBufferFormatedFading(Vector(0,1),0.03,kTextAlignMiddle,1,2,"freecam mode.");
|
||||
}
|
||||
}
|
||||
else gCameraPress=0;
|
||||
|
||||
if(GetButtonInput(kInputCameraChangeCar)){
|
||||
if(!gReplayCameraPress)
|
||||
{
|
||||
if(gReplay||phys->lapCount>gGameInfo->numLaps)
|
||||
{
|
||||
do{
|
||||
gReplayViewedEntityID=(gReplayViewedEntityID+1)%gGameInfo->numPlayers;
|
||||
}while(gGameInfo->netID[gReplayViewedEntityID]==-1&&gGameInfo->network);
|
||||
if(gReplay)
|
||||
gReplayAutoCam=false;
|
||||
gReplayCameraPress=true;
|
||||
}
|
||||
}
|
||||
}else
|
||||
gReplayCameraPress=false;
|
||||
|
||||
if(gReplay&&!gGameInfo->network)
|
||||
{
|
||||
float oldStretch=gTimeStretch;
|
||||
if(GetButtonInput(kInputChat))
|
||||
gTimeStretch=0.25;
|
||||
else
|
||||
gTimeStretch=1.0;
|
||||
if(gTimeStretch!=oldStretch)
|
||||
{
|
||||
float curTime=gStartTime+(gFrameCount*kFrameTime)/oldStretch;
|
||||
gStartTime=curTime-(gFrameCount*kFrameTime)/gTimeStretch;
|
||||
}
|
||||
}
|
||||
gCameraReverse=GetButtonInput(kInputCameraReverse);
|
||||
|
||||
|
||||
|
||||
if(GetButtonInput(kInputPause)&&!gReplay&&!gPaused&&!gPausePress)
|
||||
{
|
||||
if(!gGameInfo->network)
|
||||
PauseGame();
|
||||
else
|
||||
{
|
||||
int pauseFrameCount=gFrameCount+kFPS*0.5;
|
||||
S32Swap(pauseFrameCount);
|
||||
NetworkSendPacket(kMessageTypePause,&pauseFrameCount,sizeof(int),kMessagePriorityHigh,kMessageSendToAll);
|
||||
}
|
||||
gPausePress=true;
|
||||
}
|
||||
|
||||
if(((GetButtonInput(kInputPause)&&!gPausePress))&&gPaused&&!gInputChatMode)
|
||||
{
|
||||
if(!gGameInfo->network)
|
||||
UnPauseGame();
|
||||
else
|
||||
NetworkSendPacket(kMessageTypeResume,NULL,0,kMessagePriorityHigh,kMessageSendToAll);
|
||||
gPausePress=true;
|
||||
}
|
||||
|
||||
if(!GetButtonInput(kInputPause))
|
||||
gPausePress=false;
|
||||
|
||||
if(gGameInfo->network)
|
||||
HandleNetworkInput();
|
||||
|
||||
/* if(GetInterfaceKey(kInterfaceKeyCmd)&&GetInterfaceKey(kInterfaceKeyQ))
|
||||
{
|
||||
gInputEscMode=kInputEscModeQuit;
|
||||
gInputEscSelection=1;
|
||||
if(!gGameInfo->network)
|
||||
PauseGame();
|
||||
}*/
|
||||
|
||||
if(GetInterfaceKey(kInterfaceKeyEsc))//||(GetInterfaceKey(kInterfaceKeyDelete)&&!gInputChatMode))
|
||||
{
|
||||
if(gInputChatMode)
|
||||
{
|
||||
gGameChatMessage[0]='\0';
|
||||
gGameChatMessageSize=0;
|
||||
gInputChatMode=false;
|
||||
gEscPress=true;
|
||||
}
|
||||
else if(!gEscPress)
|
||||
// if(!gGameInfo->network&&((phys->lapCount>gGameInfo->numLaps&&gGameInfo->numLaps!=-1)||(gFrameCount*kFrameTime-kStartGameDelaySeconds>gGameInfo->maxTime&&gGameInfo->maxTime>0)))
|
||||
if((gReplay||((phys->lapCount>gGameInfo->numLaps&&gGameInfo->numLaps!=-1)))&&(!gGameInfo->network||gGameInfo->playerID==0))//||(gFrameCount*kFrameTime-kStartGameDelaySeconds>gGameInfo->maxTime&&gGameInfo->maxTime>0)))
|
||||
gGameEnd=kEndGame;
|
||||
else
|
||||
{
|
||||
gEscPress=true;
|
||||
gInputEscMode=kInputEscModeNormal;
|
||||
gInputEscSelection=1;
|
||||
if(!gGameInfo->network)
|
||||
PauseGame();
|
||||
}
|
||||
}
|
||||
else
|
||||
gEscPress=false;
|
||||
}
|
||||
|
||||
void ControlFrame()
|
||||
{
|
||||
if(!gPaused&&!gReplay)
|
||||
{
|
||||
tGameEntity *entity=(tGameEntity*)gFirstEntity->next;
|
||||
while(entity!=gFirstEntity)
|
||||
{
|
||||
if(entity->physicsMachine==kPhysicsLocal)
|
||||
{
|
||||
switch(entity->controlType)
|
||||
{
|
||||
case kControlTypeUserInput:
|
||||
ControlEntityUserInput(entity);
|
||||
break;
|
||||
case kControlTypeAIInput:
|
||||
ControlEntityAIInput(entity);
|
||||
break;
|
||||
}
|
||||
}
|
||||
entity=(tGameEntity*)entity->next;
|
||||
}
|
||||
}
|
||||
|
||||
if(!gInputEscMode)
|
||||
HandleGameInput();
|
||||
else
|
||||
HandleEscModeInput();
|
||||
}
|
||||
Executable
+100
@@ -0,0 +1,100 @@
|
||||
#ifndef __CONTROLS
|
||||
#define __CONTROLS
|
||||
|
||||
#include "config.h"
|
||||
#include "vectors.h"
|
||||
|
||||
enum{
|
||||
kInputGasButton,
|
||||
kInputBrakeButton,
|
||||
kInputSteerLeftButton,
|
||||
kInputSteerRightButton,
|
||||
kInputHandbrakeButton,
|
||||
kInputKickdownButton,
|
||||
kInputGearUp,
|
||||
kInputGearDown,
|
||||
kInputLightButton,
|
||||
kInputHorn,
|
||||
kInputChat,
|
||||
kInputCamera,
|
||||
kInputPause,
|
||||
kInputEscape,
|
||||
kInputCameraReverse,
|
||||
kInputTaunt1,
|
||||
kInputTaunt2,
|
||||
kInuptTaunt3,
|
||||
kInputTaunt4,
|
||||
kInputTaunt5,
|
||||
kInputCameraChangeCar,
|
||||
kInputITunesNext,
|
||||
kInputITunesPrev,
|
||||
kInputITunesPlay,
|
||||
kInputLeftIndicator,
|
||||
kInputRightIndicator,
|
||||
kInputNumControls
|
||||
};
|
||||
|
||||
enum{
|
||||
kInterfaceKeyNone,
|
||||
kInterfaceKeyUp,
|
||||
kInterfaceKeyDown,
|
||||
kInterfaceKeyLeft,
|
||||
kInterfaceKeyRight,
|
||||
kInterfaceKeySpace,
|
||||
kInterfaceKeyReturn,
|
||||
kInterfaceKeyEnter,
|
||||
kInterfaceKeyEsc,
|
||||
kInterfaceKeyEasterEgg,
|
||||
kInterfaceKeyDelete,
|
||||
kInterfaceKeyCmd,
|
||||
kInterfaceKeyOpt,
|
||||
kInterfaceKeyS,
|
||||
kInterfaceKeyR,
|
||||
kInterfaceKeyQ,
|
||||
kInterfaceMouseDown,
|
||||
kInterfaceNumKeys
|
||||
};
|
||||
|
||||
enum{
|
||||
kInputSteerAxis,
|
||||
kInputThrottleBrakeAxis,
|
||||
kInputThrottleAxis,
|
||||
kInputBrakeAxis,
|
||||
kInputNumAxis
|
||||
};
|
||||
|
||||
enum{
|
||||
kInputEscModeNone,
|
||||
kInputEscModeNormal,
|
||||
kInputEscModeQuit
|
||||
};
|
||||
|
||||
extern int gFFB;
|
||||
extern int gInputHID;
|
||||
extern int gInputChatMode;
|
||||
extern int gInputEscMode;
|
||||
extern int gInputEscSelection;
|
||||
extern float gStartPauseTime;
|
||||
extern char gGameChatMessage[];
|
||||
extern int gGameChatMessageSize;
|
||||
|
||||
void ControlFrame();
|
||||
void ControlInit();
|
||||
void ControlExit();
|
||||
int GetButtonInput(int id);
|
||||
int GetInterfaceKey(int id);
|
||||
char GetKeyInput(int *key);
|
||||
char PeekKeyInput(int *key);
|
||||
float GetAxisInput(int id);
|
||||
void GetInput(tKeyConfig *keyConfig);
|
||||
void GetAxis(tAxisConfig *axis,bool allowVendor);
|
||||
void FlushKeys();
|
||||
void FFBJolt(float lMag,float rMag,float duration);
|
||||
void FFBiShockDirect(float lMag,float rMag);
|
||||
void FFBSetSteerResistance(float res,float alignment);
|
||||
void FFBSetGoundRumble(float velo, float rumble);
|
||||
void FFBStop();
|
||||
void CalibrateAxis(int id);
|
||||
tVector2 GetMousePos();
|
||||
|
||||
#endif
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#include "gamemem.h"
|
||||
#include "entities.h"
|
||||
|
||||
tGameEntity *gFirstEntity=NULL,*gCameraEntity,*gViewedEntity;
|
||||
int gEntityID=0;
|
||||
|
||||
void EntityResetCount()
|
||||
{
|
||||
gEntityID=0;
|
||||
}
|
||||
|
||||
tGameEntity *EntityNew(tGameEntity *prev)
|
||||
{
|
||||
tGameEntity *entity=(tGameEntity*)MemoryAllocateZeroedBlock(sizeof(tGameEntity));
|
||||
entity->next=prev->next;
|
||||
entity->prev=prev;
|
||||
((tGameEntity*)(prev->next))->prev=entity;
|
||||
prev->next=entity;
|
||||
MatrixIdentity(entity->dir);
|
||||
MatrixIdentity(entity->rVelo);
|
||||
entity->id=gEntityID++;
|
||||
return entity;
|
||||
}
|
||||
Executable
+117
@@ -0,0 +1,117 @@
|
||||
#ifndef __ENTITIES
|
||||
#define __ENTITIES
|
||||
|
||||
#include "vectors.h"
|
||||
#include "fileio.h"
|
||||
|
||||
enum{
|
||||
kRenderTypeNone=0,
|
||||
kRenderTypeModel,
|
||||
kRenderTypeCar,
|
||||
kRenderTypeGhost
|
||||
};
|
||||
|
||||
enum{
|
||||
kPhysicsTypeNone=0,
|
||||
kPhysicsTypeCar,
|
||||
kPhysicsTypeSolid,
|
||||
kPhysicsTypeGhost
|
||||
};
|
||||
|
||||
enum{
|
||||
kPhysicsNone=0,
|
||||
kPhysicsLocal,
|
||||
kPhysicsRemote
|
||||
};
|
||||
|
||||
enum{
|
||||
kControlTypeNone=0,
|
||||
kControlTypeUserInput,
|
||||
kControlTypeAIInput
|
||||
};
|
||||
|
||||
enum{
|
||||
kPathTypeCircular=0,
|
||||
kPathTypeSin
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
tVector3 tfr,tfl,trl,trr,bfr,bfl,brl,brr;
|
||||
} tCollBox;
|
||||
|
||||
|
||||
enum{
|
||||
kLightTypeDot=0,
|
||||
kLightTypeSpot,
|
||||
kLightTypeDotRefelective,
|
||||
kLightTypeDirectionlessDot,
|
||||
kLightTypeDirectionlessDotReflective,
|
||||
kLightTypeSpecularDot
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
tVector3 pos,dir,rgb;
|
||||
float size,radius;
|
||||
int type;
|
||||
int onFlags;
|
||||
int offFlags;
|
||||
} tLightDefinition;
|
||||
|
||||
typedef struct{
|
||||
int model;
|
||||
int shadowModel;
|
||||
float maxCollRadius;
|
||||
int numCollBoxes;
|
||||
int numColors;
|
||||
int sparks;
|
||||
int randomColor;
|
||||
tCollBox *coll;
|
||||
tVector3 massCenter;
|
||||
int movable,followPath,pathType,liquid,particleStick;
|
||||
tFileRef particle;
|
||||
tFileRef sound;
|
||||
int numSounds;
|
||||
float particleAmount,particleSize;
|
||||
float pathSize,pathVelo;
|
||||
float mass,inertia;
|
||||
int numLights;
|
||||
tLightDefinition *lights;
|
||||
} tSolidEntityPhysics;
|
||||
|
||||
#define kNumAvgRVelos 32
|
||||
typedef struct{
|
||||
void *next,*prev;
|
||||
tVector3 pos,velo,oldPos,netVelo,collVelo,netPos,accel;
|
||||
tMatrix3 dir,rVelo,oldDir,netDir,netRVelo;
|
||||
tMatrix3 lastRVelos[kNumAvgRVelos];
|
||||
tVector3 lastVelos[kNumAvgRVelos];
|
||||
tVector3 lastAccel[kNumAvgRVelos];
|
||||
tVector3 remoteCameraPos;
|
||||
int renderType,renderData;
|
||||
int physicsType,physicsData,physicsMachine;
|
||||
int untouchable;
|
||||
int controlType;
|
||||
void *soundSource;
|
||||
int id;
|
||||
int lastFrame;
|
||||
int lastRoadIndex;
|
||||
int lastActivity;
|
||||
int lastPacketSent;
|
||||
tVector3 lastVeloSent;
|
||||
tVector3 lastRZSent;
|
||||
tVector3 lastDirZSent;
|
||||
int lastPacketSaved;
|
||||
tVector3 lastVeloSaved;
|
||||
tVector3 lastRZSaved;
|
||||
tVector3 lastDirZSaved;
|
||||
float zDist;
|
||||
void *physics;
|
||||
void *regData;
|
||||
} tGameEntity;
|
||||
|
||||
extern tGameEntity *gFirstEntity,*gCameraEntity,*gViewedEntity;
|
||||
|
||||
void EntityResetCount();
|
||||
tGameEntity *EntityNew(tGameEntity *prev);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,28 @@
|
||||
//environment.cpp
|
||||
//load a new environment fiel from disk
|
||||
//environments basically control the wheather and
|
||||
//what background images to use and stuff like that
|
||||
#include "fileio.h"
|
||||
#include "environment.h"
|
||||
#include "gamemem.h"
|
||||
#include "parser.h"
|
||||
#include "roads.h"
|
||||
#include "textures.h"
|
||||
#include "gameinitexit.h"
|
||||
|
||||
tEnvironment *gEnvironment;
|
||||
|
||||
#define kAirDensity 1.2929 //kg*m^-3
|
||||
#define kGravitionalAcceleration 9.80665 //m*s^-2
|
||||
|
||||
void LoadEnvironment(int ref)
|
||||
{
|
||||
gEnvironment=(tEnvironment*)FileGetParsedDataPtr(ref,kParserTypeEnvironmentDesc,sizeof(tEnvironment));
|
||||
gSurfaceTypes=(tSurfaceTypeList*)FileGetParsedDataPtr(gEnvironment->surfaceTypes,kParserTypeSurfaceTypeDesc,sizeof(tSurfaceTypeList));
|
||||
if(gEnvironment->gravity==0)
|
||||
gEnvironment->gravity=kGravitionalAcceleration;
|
||||
if(gEnvironment->airDensity==0)
|
||||
gEnvironment->airDensity=kAirDensity;
|
||||
if(gEnvironment->hasAltEnv&&gMapInfo->useAltEnv)
|
||||
LoadEnvironment(gEnvironment->altEnv);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//environment.h
|
||||
|
||||
#ifndef __ENVIRONMENT
|
||||
#define __ENVIRONMENT
|
||||
|
||||
#include "vectors.h"
|
||||
#include "fileio.h"
|
||||
enum{
|
||||
kEnvironmentMappingOff,
|
||||
kEnvironmentMappingSphereAddSigned,
|
||||
kEnvironmentMappingSphereInterpolate
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
tFileRef sky0,sky90,sky180,sky270,skytop,skybot,particlesType,surfaceTypes;
|
||||
tFileRef spheremap,dirtMap;
|
||||
tFileRef soundLoop,soundRandom;
|
||||
tVector3 fogColor,ambient,diffuse,specular,shadowColor,spotLightColor,instrumentColor,flashColor;
|
||||
tVector3 lightDir,particlesVelo,flareDir;
|
||||
tVector2 particlesSize;
|
||||
float particlesHeight;
|
||||
float shadowIntensity,particlesAmount,particlesVeloSpread,particlesLife,flashIntensity,soundRandomProbility,environmentMapIntensity,dirtIntensity;
|
||||
float gravity,airDensity;
|
||||
int shadowEnable,spotLightEnable,particlesEnable,screenParticlesEnable,soundLoopEnable,soundRandomEnable,flaresEnable,dirtEnable;
|
||||
int environmentMapping;
|
||||
int envFlags;
|
||||
char name[80];
|
||||
int hasAltEnv;
|
||||
tFileRef altEnv;
|
||||
} tEnvironment;
|
||||
|
||||
extern tEnvironment *gEnvironment;
|
||||
|
||||
void LoadEnvironment(int ref);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1 @@
|
||||
#ifndef __ERROR␍#define __ERROR␍␍void FailWithErrorString(char *string);␍void PrintConsoleString(const char *fmt, ...);␍void ShowAlert(char *str1, char *str2);␍void HandleError(int code);␍␍#endif
|
||||
Executable
+358
@@ -0,0 +1,358 @@
|
||||
//fileio.h
|
||||
//Utilities for reading and writing to files in the game's subdirectories
|
||||
|
||||
|
||||
//fileio works by creating a table of all files within the applications directory
|
||||
//at startup. this way all files we need can be addressed simply using reference numbers.
|
||||
//sometimes also refered to as "ID numbers".
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include "fileio.h"
|
||||
#include "platform.h"
|
||||
#include "gamemem.h"
|
||||
#include "error.h"
|
||||
#include "parser.h"
|
||||
|
||||
int gFileTableSize; //size of the file reference table
|
||||
int gFileTableExtendedSize;
|
||||
int gFileTampered=false;
|
||||
tFileTableEntry *gFileTable; //the file reference table
|
||||
char gNoName[]="";
|
||||
|
||||
void FileInitFileTable(tFileTableEntry *fileTable,int maxSize,int *fileTableSize,int reInit);
|
||||
|
||||
#define kNumValidateFiles 42
|
||||
|
||||
char gValidateNames[][256]={
|
||||
"500gt.car",
|
||||
"500gthotrod.car",
|
||||
"959.car",
|
||||
"maserati.car",
|
||||
"bmw2002.car",
|
||||
"charger.car",
|
||||
"chargerdragdrag.car",
|
||||
"corvette.car",
|
||||
"diablo.car",
|
||||
"dmc12.car",
|
||||
"dmc12flying.car",
|
||||
"gt40.car",
|
||||
"gti.car",
|
||||
"mini.car",
|
||||
"55ford.car",
|
||||
"tt.car",
|
||||
"ttpimp.car",
|
||||
"viper.car",
|
||||
"viperracer.car",
|
||||
"accelbrake.mapinfo",
|
||||
"accelbrake2.mapinfo",
|
||||
"canyon.mapinfo",
|
||||
"canyoncorner.mapinfo",
|
||||
"city2.mapinfo",
|
||||
"citycorner.mapinfo",
|
||||
"downhill.mapinfo",
|
||||
"highspeed.mapinfo",
|
||||
"highspeedtrial.mapinfo",
|
||||
"mountainside.mapinfo",
|
||||
"offroad.mapinfo",
|
||||
"quarter.mapinfo",
|
||||
"ralley2.mapinfo",
|
||||
"scorner.mapinfo",
|
||||
"slalom.mapinfo",
|
||||
"slalom2.mapinfo",
|
||||
"snow.mapinfo",
|
||||
"snowtrial.mapinfo",
|
||||
"tight.mapinfo",
|
||||
"canyon.road",
|
||||
"city2.road",
|
||||
"mountainside.road",
|
||||
"ralley2.road",
|
||||
"snow.road",
|
||||
};
|
||||
|
||||
int gValidateChecksums[]={
|
||||
0xc98d7f36,
|
||||
0x833e4a7d,
|
||||
0xdcd7e89,
|
||||
0x3e6a08b7,
|
||||
0x251efab,
|
||||
0xed2a6577,
|
||||
0x6d654b5,
|
||||
0x1c468570,
|
||||
0x1380a984,
|
||||
0x7c69956,
|
||||
0xcc2746e4,
|
||||
0x22349629,
|
||||
0x8d0d50b4,
|
||||
0x51994161,
|
||||
0x90a4cc85,
|
||||
0x931cbd6c,
|
||||
0xe42301b9,
|
||||
0xcc9bd572,
|
||||
0x1b7951e7,
|
||||
0x72d87975,
|
||||
0x1eb05d11,
|
||||
0xa2182ab9,
|
||||
0xde1122e6,
|
||||
0xc44b1aab,
|
||||
0x815cb099,
|
||||
0x8eb6b530,
|
||||
0x6c93ce2,
|
||||
0x77263bb7,
|
||||
0x18ebbbad,
|
||||
0xc57f8785,
|
||||
0x117ba80c,
|
||||
0xb513b806,
|
||||
0x75938236,
|
||||
0x2437d140,
|
||||
0xb249c233,
|
||||
0x6e92dc33,
|
||||
0x9e5c31de,
|
||||
0x8766b155,
|
||||
0x1bbdc55d,
|
||||
0x28f6a9b8,
|
||||
0x66e5492e,
|
||||
0x8b5a55d8,
|
||||
};
|
||||
//Initialize file reference table
|
||||
void FileInitIO()
|
||||
{
|
||||
gFileTableExtendedSize=0;
|
||||
gFileTableSize=0;
|
||||
gFileTable=(tFileTableEntry*)calloc(kMaxFiles,sizeof(tFileTableEntry));
|
||||
FileInitFileTable(gFileTable,kMaxFiles,&gFileTableSize,false);
|
||||
|
||||
for(int i=0;i<kNumValidateFiles;i++)
|
||||
{
|
||||
if(FileGetChecksum(FileGetReference(gValidateNames[i]))!=gValidateChecksums[i])
|
||||
{
|
||||
gFileTampered=true;
|
||||
printf("Bad File! %s. Found Checksum %x. Need Checksum %x.\n",FileGetName(FileGetReference(gValidateNames[i])),
|
||||
FileGetChecksum(FileGetReference(gValidateNames[i])),gValidateChecksums[i]);
|
||||
}
|
||||
//printf("0x%x,\n",FileGetChecksum(FileGetReference(gValidateNames[i])));
|
||||
}
|
||||
}
|
||||
|
||||
void FileRescanDirectory()
|
||||
{
|
||||
int totalSize=gFileTableSize+gFileTableExtendedSize;
|
||||
FileInitFileTable(gFileTable,kMaxFiles,&totalSize,true);
|
||||
gFileTableExtendedSize=totalSize-gFileTableSize;
|
||||
printf("ex:%d\n",gFileTableExtendedSize);
|
||||
}
|
||||
|
||||
void FileReleaseData(tFileRef reference)
|
||||
{
|
||||
if(gFileTable[reference].loaded)
|
||||
{
|
||||
MemoryFreeBlock(gFileTable[reference].data);
|
||||
gFileTable[reference].loaded=false;
|
||||
}
|
||||
}
|
||||
|
||||
//Compare two File Table entries for sorting and searching
|
||||
int FileTableCompare(const void *a,const void *b)
|
||||
{
|
||||
return _stricmp(((tFileTableEntry*)a)->name,((tFileTableEntry*)b)->name);
|
||||
}
|
||||
|
||||
int gFileErrorReporting=true;
|
||||
|
||||
//Search file reference table for a file matching a name and return its reference number
|
||||
tFileRef FileGetReference(char *name)
|
||||
{
|
||||
if(*name=='\0')
|
||||
return -1;
|
||||
//the key to search for
|
||||
tFileTableEntry key;
|
||||
#ifndef __TARGET_TEXTURECOMPRESSOR
|
||||
#ifndef __TARGET_TOOLAPP
|
||||
snprintf(key.name,32,"%s.txr",name);
|
||||
|
||||
//search for an entry matching our search key
|
||||
tFileTableEntry *result=(tFileTableEntry*)bsearch(&key,gFileTable,gFileTableSize,sizeof(tFileTableEntry),&FileTableCompare);
|
||||
|
||||
//return results
|
||||
if(result)
|
||||
return result-gFileTable;
|
||||
else
|
||||
{
|
||||
snprintf(key.name,32,"%s.ima",name);
|
||||
|
||||
//search for an entry matching our search key
|
||||
tFileTableEntry *result=(tFileTableEntry*)bsearch(&key,gFileTable,gFileTableSize,sizeof(tFileTableEntry),&FileTableCompare);
|
||||
|
||||
//return results
|
||||
if(result)
|
||||
return result-gFileTable;
|
||||
else
|
||||
|
||||
{
|
||||
#endif
|
||||
#endif
|
||||
strcpy(key.name,name);
|
||||
tFileTableEntry *result=(tFileTableEntry*)bsearch(&key,gFileTable,gFileTableSize,sizeof(tFileTableEntry),&FileTableCompare);
|
||||
if(result)
|
||||
return result-gFileTable;
|
||||
else
|
||||
{
|
||||
for(int i=gFileTableSize;i<gFileTableSize+gFileTableExtendedSize;i++)
|
||||
if(_stricmp(gFileTable[i].name,name)==0)
|
||||
return i;
|
||||
if(gFileErrorReporting)
|
||||
{
|
||||
//or give an error message
|
||||
PrintConsoleString("File not found!: %s\n",name);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#ifndef __TARGET_TEXTURECOMPRESSOR
|
||||
#ifndef __TARGET_TOOLAPP
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
tFileRef FileGetIndexedReference(tFileRef base,int i)
|
||||
{
|
||||
if(i>0)
|
||||
{
|
||||
char nameCopy[kMaxFileNameLength];
|
||||
strcpy(nameCopy,FileGetName(base));
|
||||
char *found=strchr(nameCopy,'.');
|
||||
|
||||
char indexedName[kMaxFileNameLength];
|
||||
if(found)
|
||||
{
|
||||
*found='\0';
|
||||
sprintf(indexedName,"%s#%x.%s",nameCopy,i,found+1);
|
||||
}
|
||||
else
|
||||
sprintf(indexedName,"%s#%x",nameCopy,i);
|
||||
|
||||
int seek=base-1;
|
||||
while(_stricmp(gFileTable[seek].name,indexedName)>0&&seek>0)
|
||||
seek--;
|
||||
|
||||
if(_stricmp(gFileTable[seek].name,indexedName))
|
||||
return base;
|
||||
else
|
||||