1 /**********************************************************************
5 ----------------------------------------------------------------------
7 DESCRIPTION: changes Fog variable to +/-1 or 0 using fog
10 ----------------------------------------------------------------------
14 ----------------------------------------------------------------------
18 ----------------------------------------------------------------------
20 HISTORY: 05/20/2001 initial release
22 ----------------------------------------------------------------------
24 AUTHOR(S): Michael Savchenko <savchenk@uiuc.edu>
26 ----------------------------------------------------------------------
30 ----------------------------------------------------------------------
40 ----------------------------------------------------------------------
47 ----------------------------------------------------------------------
49 CALLED BY: uiuc_wrapper
51 ----------------------------------------------------------------------
55 ----------------------------------------------------------------------
57 COPYRIGHT: (C) 2000 by Michael Selig
59 This program is free software; you can redistribute it and/or
60 modify it under the terms of the GNU General Public License
61 as published by the Free Software Foundation.
63 This program is distributed in the hope that it will be useful,
64 but WITHOUT ANY WARRANTY; without even the implied warranty of
65 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66 GNU General Public License for more details.
68 You should have received a copy of the GNU General Public License
69 along with this program; if not, write to the Free Software
70 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
72 **********************************************************************/
79 if (Simtime >= fog_next_time)
81 if (fog_current_segment != 0)
83 if (fog_value[fog_current_segment] > fog_value[fog_current_segment-1])
85 else if (fog_value[fog_current_segment] < fog_value[fog_current_segment-1])
93 if (Simtime > fog_time[fog_current_segment]) {
94 if (fog_current_segment == fog_segments)
101 fog_current_segment++; }
103 if (fog_value[fog_current_segment] == fog_value[fog_current_segment-1])
104 fog_next_time = fog_time[fog_current_segment];
106 fog_next_time += (fog_time[fog_current_segment]-fog_time[fog_current_segment-1]) / abs(fog_value[fog_current_segment]-fog_value[fog_current_segment-1]);