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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
71 USA or view http://www.gnu.org/copyleft/gpl.html.
73 **********************************************************************/
80 if (Simtime >= fog_next_time)
82 if (fog_current_segment != 0)
84 if (fog_value[fog_current_segment] > fog_value[fog_current_segment-1])
86 else if (fog_value[fog_current_segment] < fog_value[fog_current_segment-1])
94 if (Simtime > fog_time[fog_current_segment]) {
95 if (fog_current_segment == fog_segments)
102 fog_current_segment++; }
104 if (fog_value[fog_current_segment] == fog_value[fog_current_segment-1])
105 fog_next_time = fog_time[fog_current_segment];
107 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]);