aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/game/moveinfo_t.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jake2/game/moveinfo_t.java')
-rw-r--r--src/jake2/game/moveinfo_t.java64
1 files changed, 63 insertions, 1 deletions
diff --git a/src/jake2/game/moveinfo_t.java b/src/jake2/game/moveinfo_t.java
index 16b0b50..864051d 100644
--- a/src/jake2/game/moveinfo_t.java
+++ b/src/jake2/game/moveinfo_t.java
@@ -19,10 +19,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: moveinfo_t.java,v 1.1 2004-07-07 19:59:26 hzi Exp $
+// $Id: moveinfo_t.java,v 1.2 2004-08-20 21:29:58 salomo Exp $
package jake2.game;
+import java.io.IOException;
+
+import jake2.util.QuakeFile;
+
public class moveinfo_t {
// fixed data
float[] start_origin= { 0, 0, 0 };
@@ -51,4 +55,62 @@ public class moveinfo_t {
float remaining_distance;
float decel_distance;
EntThinkAdapter endfunc;
+
+ /** saves the moveinfo to the file.*/
+ public void write(QuakeFile f) throws IOException {
+ f.writeVector(start_origin);
+ f.writeVector(start_angles);
+ f.writeVector(end_origin);
+ f.writeVector(end_angles);
+
+ f.writeInt(sound_start);
+ f.writeInt(sound_middle);
+ f.writeInt(sound_end);
+
+ f.writeFloat(accel);
+ f.writeFloat(speed);
+ f.writeFloat(decel);
+ f.writeFloat(distance);
+
+ f.writeFloat(wait);
+
+ f.writeInt(state);
+ f.writeVector(dir);
+
+ f.writeFloat(current_speed);
+ f.writeFloat(move_speed);
+ f.writeFloat(next_speed);
+ f.writeFloat(remaining_distance);
+ f.writeFloat(decel_distance);
+ f.writeAdapter(endfunc);
+ }
+
+ /** Reads the moveinfo from a file. */
+ public void read(QuakeFile f) throws IOException {
+ start_origin= f.readVector();
+ start_angles= f.readVector();
+ end_origin= f.readVector();
+ end_angles= f.readVector();
+
+ sound_start= f.readInt();
+ sound_middle= f.readInt();
+ sound_end= f.readInt();
+
+ accel= f.readFloat();
+ speed= f.readFloat();
+ decel= f.readFloat();
+ distance= f.readFloat();
+
+ wait= f.readFloat();
+
+ state= f.readInt();
+ dir= f.readVector();
+
+ current_speed= f.readFloat();
+ move_speed= f.readFloat();
+ next_speed= f.readFloat();
+ remaining_distance= f.readFloat();
+ decel_distance= f.readFloat();
+ endfunc= (EntThinkAdapter) f.readAdapter();
+ }
}