1 /* $Id: kcurve.c,v 1.3 2004-12-19 15:21:11 btb Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
17 * Functions for curve stuff.
22 static char rcsid[] = "$Id: kcurve.c,v 1.3 2004-12-19 15:21:11 btb Exp $";
35 static fix r1scale, r4scale;
46 if ( (Markedsegp != 0) && !IS_CHILD(Markedsegp->children[Markedside])) {
47 r1scale = r4scale = F1_0*20;
48 autosave_mine( mine_filename );
49 diagnostic_message("Curve Generated.");
50 Update_flags |= UF_WORLD_CHANGED;
51 curve = generate_curve(r1scale, r4scale);
54 strcpy(undo_status[Autosave_count], "Curve Generation UNDONE.\n");
56 if (curve == 0) diagnostic_message("Cannot generate curve -- check Current segment.");
58 else diagnostic_message("Cannot generate curve -- check Marked segment.");
59 warn_if_concave_segments();
67 Update_flags |= UF_WORLD_CHANGED;
70 generate_curve(r1scale, r4scale);
71 diagnostic_message("R4 vector decreased.");
73 warn_if_concave_segments();
81 Update_flags |= UF_WORLD_CHANGED;
84 generate_curve(r1scale, r4scale);
85 diagnostic_message("R4 vector increased.");
87 warn_if_concave_segments();
95 Update_flags |= UF_WORLD_CHANGED;
98 generate_curve(r1scale, r4scale);
99 diagnostic_message("R1 vector decreased.");
101 warn_if_concave_segments();
109 Update_flags |= UF_WORLD_CHANGED;
112 generate_curve(r1scale, r4scale);
113 diagnostic_message("R1 vector increased.");
115 warn_if_concave_segments();
122 // fix_bogus_uvs_all();
123 set_average_light_on_curside();
126 Update_flags |= UF_WORLD_CHANGED;
130 diagnostic_message("Curve Deleted.");
131 warn_if_concave_segments();
138 if (curve) curve = 0;
139 //autosave_mine( mine_filename );
140 //strcpy(undo_status[Autosave_count], "Curve Generation UNDONE.\n");