2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/nebedit/NebEdit.cpp $
15 * Program to edit nebulas in 2d
18 * Revision 1.3 2002/06/09 04:41:23 relnev
19 * added copyright header
21 * Revision 1.2 2002/05/07 03:16:47 theoddone33
22 * The Great Newline Fix
24 * Revision 1.1.1.1 2002/05/03 03:28:10 root
28 * 7 7/15/99 3:07p Dave
29 * 32 bit detection support. Mouse coord commandline.
31 * 6 5/19/99 4:07p Dave
32 * Moved versioning code into a nice isolated common place. Fixed up
33 * updating code on the pxo screen. Fixed several stub problems.
35 * 5 1/08/99 2:06p Dave
36 * Fixed pfoview for software mode.
38 * 4 12/18/98 1:14a Dave
39 * Rough 1024x768 support for Direct3D. Proper detection and usage through
42 * 3 11/13/98 2:32p Dave
43 * Improved commandline parsing for exe pathname.
45 * 2 10/24/98 9:51p Dave
47 * 1 10/24/98 9:39p Dave
49 * 13 4/13/98 10:11a John
50 * Made timer functions thread safe. Made timer_init be called in all
53 * 12 3/23/98 1:35p Sandeep
55 * 11 3/05/98 11:15p Hoffoss
56 * Changed non-game key checking to use game_check_key() instead of
59 * 10 12/29/97 5:10p Allender
60 * fixed problems with speed not being reported properly in multiplayer
61 * games. Made read_flying_controls take frametime as a parameter. More
62 * ship/weapon select stuff
64 * 9 12/04/97 3:47p John
65 * Made joystick move mouse cursor
67 * 8 11/21/97 11:32a John
68 * Added nebulas. Fixed some warpout bugs.
70 * 7 11/19/97 10:15p Adam
71 * upped maxtris to 200
73 * 6 11/19/97 4:28p Sandeep
74 * added poly/vert counter
76 * 5 11/19/97 1:59p Sandeep
77 * Added multiple vertex editing mode
79 * 4 11/16/97 2:29p John
80 * added versioning to nebulas; put nebula code into freespace.
82 * 3 11/13/97 12:04p Sandeep
83 * Added face editing support, deletion support, and a saving and loading
86 * 2 11/10/97 9:59p John
89 * 1 11/10/97 9:42p John
95 #include "wx/wxprec.h"
101 #include "wx/filedlg.h"
115 #include "floating.h"
118 #include "linklist.h"
119 #include "lighting.h"
135 physics_info ViewerPhysics;
136 float ViewerZoom = 1.0f;
139 int Fred_running = 0;
140 int Pofview_running = 0;
141 float flFrametime = 0.0f;
147 vector Global_light_world = { 0.208758f, -0.688253f, -0.694782f };
154 #define MAX_POINTS 300
156 int neb_w = 0, neb_h = 0;
158 int nebula_inited = 0;
161 int x[MAX_POINTS], y[MAX_POINTS], l[MAX_POINTS];
162 float scale_factor = 1.0f;
165 int tri[MAX_TRIS][3];
169 int Mouse_x, Mouse_y;
171 bool Selected[MAX_POINTS];
172 bool Sel_mode = false; // false = 1 point at a time, true = select multiple points
175 int View_mode = 0; // 0 = 2d editor, 1 = 3d viewer
177 int Vert_mode = 0; // 0 = Move vertices/Add vertices, 2 = Move face/Add face
179 int Which_vert = 0; // Current vertex of the faceadd
185 bool Draw_sel_box = false;
189 int Nebedit_running = 1;
191 extern void project_2d_onto_sphere(vector *, float, float);
193 class MyApp: public wxApp
196 virtual bool OnInit();
204 IMPLEMENT_APP_NO_MAIN(MyApp)
206 void create_default_neb()
211 num_pts = neb_w*neb_h;
213 for (j=0; j<neb_h; j++ ) {
214 for (i=0; i<neb_w; i++ ) {
215 x[i+j*neb_w] = ((i+1)*SCREEN_W)/(neb_w+2);
216 y[i+j*neb_w] = ((j+3)*SCREEN_H)/(neb_h+6);
217 if ( (j==0) || (j==neb_h-1)) {
227 for (j=0; j<neb_h-1; j++ ) {
228 for (i=0; i<neb_w-1; i++ ) {
229 tri[num_tris][0] = i+neb_w*j;
230 tri[num_tris][1] = i+neb_w*j+1;
231 tri[num_tris][2] = i+neb_w*(j+1)+1;
234 tri[num_tris][0] = i+neb_w*j;
235 tri[num_tris][1] = i+neb_w*(j+1)+1;
236 tri[num_tris][2] = i+neb_w*(j+1);
244 #define NEBULA_FILE_ID "NEBU"
245 #define NEBULA_MAJOR_VERSION 1 // Can be 1-?
246 #define NEBULA_MINOR_VERSION 0 // Can be 0-99
248 void save_nebula_sub(const char *filename)
256 fp = fopen(filename, "wb");
259 fwrite( "NEBU", 4, 1, fp );
260 version = NEBULA_MAJOR_VERSION*100+NEBULA_MINOR_VERSION;
261 tmp = INTEL_INT(version);
262 fwrite( &tmp, sizeof(int), 1, fp );
263 tmp = INTEL_INT(num_pts);
264 fwrite( &tmp, sizeof(int), 1, fp );
265 tmp = INTEL_INT(num_tris);
266 fwrite( &tmp, sizeof(int), 1, fp );
269 for (i=0; i<num_pts; i++ ) {
270 xf = INTEL_FLOAT(float(x[i])/640.0f);
271 yf = INTEL_FLOAT(float(y[i])/480.0f);
272 fwrite( &xf, sizeof(float), 1, fp );
273 fwrite( &yf, sizeof(float), 1, fp );
274 tmp = INTEL_INT(l[i]);
275 fwrite( &tmp, sizeof(int), 1, fp );
278 for (i=0; i<num_tris; i++ ) {
279 tmp = INTEL_INT(tri[i][0]);
280 fwrite( &tmp, sizeof(int), 1, fp );
281 tmp = INTEL_INT(tri[i][1]);
282 fwrite( &tmp, sizeof(int), 1, fp );
283 tmp = INTEL_INT(tri[i][2]);
284 fwrite( &tmp, sizeof(int), 1, fp );
290 // returns 0 if failed
291 int load_nebula_sub(const char *filename)
295 int version, major, minor;
297 fp = fopen(filename, "rb");
304 fread( id, 4, 1, fp );
305 if ( strncmp( id, NEBULA_FILE_ID, 4)) {
306 mprintf(( "Not a valid nebula file.\n" ));
310 fread( &version, sizeof(int), 1, fp );
311 version = INTEL_INT(version);
312 major = version / 100;
313 minor = version % 100;
315 if ( (major != NEBULA_MAJOR_VERSION) && (minor != NEBULA_MINOR_VERSION) ) {
316 mprintf(( "An out of date nebula file.\n" ));
320 fread( &num_pts, sizeof(int), 1, fp );
321 num_pts = INTEL_INT(num_pts);
322 SDL_assert( num_pts < MAX_POINTS );
323 fread( &num_tris, sizeof(int), 1, fp );
324 num_tris = INTEL_INT(num_tris);
325 SDL_assert( num_tris < MAX_TRIS );
327 for (int i=0; i<num_pts; i++ ) {
331 fread( &xf, sizeof(float), 1, fp );
332 fread( &yf, sizeof(float), 1, fp );
333 fread( &li, sizeof(int), 1, fp );
335 xf = INTEL_FLOAT(xf);
336 yf = INTEL_FLOAT(yf);
339 x[i] = (int)(xf*640.0f);
340 y[i] = (int)(yf*480.0f);
344 for (int i=0; i<num_tris; i++ ) {
345 fread( &tri[i][0], sizeof(int), 1, fp );
346 fread( &tri[i][1], sizeof(int), 1, fp );
347 fread( &tri[i][2], sizeof(int), 1, fp );
348 tri[i][0] = INTEL_INT(tri[i][0]);
349 tri[i][1] = INTEL_INT(tri[i][1]);
350 tri[i][2] = INTEL_INT(tri[i][2]);
360 save_nebula_sub( "autosaved.neb" );
365 wxFileDialog saveFileDialog(NULL, _("Save Nebula File"), wxEmptyString,
366 wxEmptyString, _("Nebula Files (*.neb)|*.neb"),
367 wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
369 if (saveFileDialog.ShowModal() == wxID_OK) {
370 save_nebula_sub(saveFileDialog.GetPath().ToAscii());
376 int create_default = 1;
378 wxFileDialog openFileDialog(NULL, _("Open Nebula File"), wxEmptyString,
379 wxEmptyString, _("Nebula Files (*.neb)|*.neb"),
380 wxFD_OPEN|wxFD_FILE_MUST_EXIST);
382 if (openFileDialog.ShowModal() == wxID_OK) {
383 create_default = !load_nebula_sub(openFileDialog.GetPath().ToAscii());
386 if ( create_default ) {
387 create_default_neb();
395 if ( nebula_inited ) return;
396 memset(Selected, 0, sizeof(bool)*MAX_POINTS);
399 create_default_neb();
400 gr_init_alphacolor( &nebula_color, 0, 255, 0, 255, AC_TYPE_HUD );
405 void draw_tri_2d( int i, int j, int k )
414 vertex * verts[3] = { &va, &vb, &vc };
415 // gr_zbuffering = 0;
416 for (int v=0; v<3; v++ ) {
417 verts[v]->sx = i2fl(x[index[v]]);
418 verts[v]->sy = i2fl(y[index[v]]);
422 verts[v]->b = (ubyte)(i2fl(l[index[v]]*255)/31.0f);
425 // gr_set_color( 0, 0, 0 );
426 gr_tmapper(3, verts, TMAP_FLAG_RAMP | TMAP_FLAG_GOURAUD | TMAP_FLAG_NEBULA );
428 if ( !key_pressed(SDLK_LSHIFT) ) {
429 gr_set_color(100,100,100);
430 gr_line( x[i], y[i], x[j], y[j] );
431 gr_line( x[j], y[j], x[k], y[k] );
432 gr_line( x[k], y[k], x[i], y[i] );
436 void nebula_draw_2d()
440 for (i=0; i<num_tris; i++ ) {
441 draw_tri_2d( tri[i][0], tri[i][1], tri[i][2] );
444 gr_set_color(100,0,0);
445 for (i=0; i<num_pts; i++ ) {
446 gr_circle( x[i], y[i], 4 );
448 if ((Sel_mode==1)) { // multiple selection
450 gr_set_color(200,0,200);
451 gr_line(Orig_pos_x, Orig_pos_y, Orig_pos_x, End_pos_y);
452 gr_line(Orig_pos_x, End_pos_y, End_pos_x, End_pos_y);
453 gr_line(End_pos_x, Orig_pos_y, End_pos_x, End_pos_y);
454 gr_line(End_pos_x, Orig_pos_y, Orig_pos_x, Orig_pos_y);
456 gr_set_color(0,100,0);
457 for (int i=0;i<num_pts;i++)
458 if (Selected[i]) gr_circle( x[i], y[i], 5);
460 } else if ((Vert_mode==0)&&(Current_point>-1)) {
461 gr_set_color(0,100,0);
462 gr_circle( x[Current_point], y[Current_point], 5);
463 } else if (Vert_mode == 1) {
464 for (i=0;i<Which_vert;i++) {
465 gr_set_color(0,0,100);
466 gr_circle( x[tri[num_tris][i]], y[tri[num_tris][i]], 6);
468 gr_set_color(200,200,0);
469 if (Current_face>-1) {
470 gr_line(x[tri[Current_face][0]], y[tri[Current_face][0]],
471 x[tri[Current_face][1]], y[tri[Current_face][1]]);
472 gr_line(x[tri[Current_face][1]], y[tri[Current_face][1]],
473 x[tri[Current_face][2]], y[tri[Current_face][2]]);
474 gr_line(x[tri[Current_face][2]], y[tri[Current_face][2]],
475 x[tri[Current_face][0]], y[tri[Current_face][0]]);
481 void draw_tri_3d( int i, int j, int k )
490 vertex * verts[3] = { &va, &vb, &vc };
492 for (int v=0; v<3; v++ ) {
495 project_2d_onto_sphere( &tmp, 1.0f - i2fl(x[index[v]])/640.0f, i2fl(y[index[v]])/480.0f );
497 vm_vec_scale( &tmp, 10.0f );
499 g3_rotate_faraway_vertex( verts[v], &tmp );
500 //g3_rotate_vertex( verts[v], &tmp );
501 g3_project_vertex( verts[v] );
503 verts[v]->b = (ubyte)(i2fl(l[index[v]]*255)/31.0f);
507 //gr_set_color_fast( &nebula_color );
508 //gr_set_color( 0, 0, 0 );
509 g3_draw_poly(3, verts, TMAP_FLAG_RAMP | TMAP_FLAG_GOURAUD | TMAP_FLAG_NEBULA );
512 void nebula_draw_3d()
515 for (i=0; i<num_tris; i++ ) {
516 draw_tri_3d( tri[i][0], tri[i][1], tri[i][2] );
524 gr_set_color(0,0,0); // set color to black
525 gr_rect(0,0,SCREEN_W,SCREEN_H); // clear screen
528 light_add_directional( &Global_light_world, 0.1f, 1.0f, 1.0f, 1.0f );
532 g3_set_view_matrix(&ViewerPos, &ViewerOrient,ViewerZoom);
534 if ( View_mode == 0 ) {
538 gr_set_color_fast( &color_green );
539 gr_printf(10,10,"Nebula Editor. Mode :");
541 gr_printf(180, 10, "Multiple Vertex Selection Editing");
542 } else if (Vert_mode ==0 ) {
543 gr_printf(180,10,"Vertex Editing");
544 if(Current_point >= 0){
545 gr_printf(180, 20, "Current vertex intensity : %d\n", l[Current_point]);
547 } else if (Vert_mode ==1) {
548 gr_printf(180,10,"Face Editing");
551 gr_printf(20,30,"# Points:");
552 gr_printf(100,30, SDL_itoa(num_pts, blah, 10));
553 gr_printf(220,30,"# Polys:");
554 gr_printf(300,30, SDL_itoa(num_tris, blah, 10));
557 model_render( test_model, &ModelOrient, &ModelPos );
565 int get_closest(int mx, int my)
567 int i, closest = -1, cval = 100000;
569 for (i=0; i<num_pts; i++ ) {
576 dist = fl2i(fl_sqrt( i2fl((dx*dx)+(dy*dy)) ));
587 int get_closest_face(int mx, int my)
589 int i, closest = -1, cval = 100000;
591 for (i=0; i<num_tris; i++ ) {
595 dx = x[tri[i][0]] - mx;
596 dy = y[tri[i][0]] - my;
598 dx += x[tri[i][1]] - mx;
599 dy += y[tri[i][1]] - my;
601 dx += x[tri[i][2]] - mx;
602 dy += y[tri[i][2]] - my;
604 dist = fl2i(fl_sqrt( i2fl((dx*dx)+(dy*dy)) ));
606 dist += fl2i(fl_sqrt( i2fl((dx*dx)+(dy*dy)) ));
608 dx = x[tri[i][2]] - mx;
609 dy = y[tri[i][2]] - my;
610 dist += fl2i(fl_sqrt( i2fl((dx*dx)+(dy*dy)) ));
622 void delete_face(int i)
624 for (int j=i;j<num_tris;j++) {
625 memcpy(tri[j], tri[j+1], sizeof(int)*3);
630 void delete_vert(int i)
634 for (j=0;j<num_tris;j++) {
635 if ((tri[j][0]==i)||(tri[j][1]==i)||(tri[j][2]==i)) {
640 for (j=0;j<num_tris;j++) {
641 if (tri[j][0]>i) tri[j][0]--;
642 if (tri[j][1]>i) tri[j][1]--;
643 if (tri[j][2]>i) tri[j][2]--;
645 for (j=i;j<num_pts;j++) {
653 int add_vert(int mx, int my)
655 SDL_assert(num_pts<300);
663 void select_by_box(int x1, int y1, int x2, int y2)
675 for (int i=0;i<num_pts;i++) {
676 if ((x[i]<=x2) && (x[i]>=x1) &&
677 (y[i]<=y2) && (y[i]>=y1)) {
683 void sphericalize_nebula()
686 int px = SCREEN_W / (neb_w - 1);
687 int py = SCREEN_H / (neb_h - 1);
689 // flatten out the nebula so that it covers the entire sphere evenly
690 for(idx1=0; idx1<neb_w; idx1++){
691 for(idx2=0; idx2<neb_h; idx2++){
692 x[idx1+idx2*neb_w] = px * idx1;
693 y[idx1+idx2*neb_w] = py * idx2;
698 void controls_read_all(control_info * ci, float sim_time )
703 float temp = ci->heading;
704 float temp1 = ci->pitch;
705 memset( ci, 0, sizeof(control_info) );
711 kh = (key_down_timef(SDLK_KP_6) - key_down_timef(SDLK_KP_4))/8.0f;
714 else if (kh > 0.0f) {
715 if (ci->heading < 0.0f)
718 if (ci->heading > 0.0f)
722 kh = (key_down_timef(SDLK_KP_8) - key_down_timef(SDLK_KP_2))/8.0f;
725 else if (kh > 0.0f) {
726 if (ci->pitch < 0.0f)
729 if (ci->pitch > 0.0f)
733 ci->bank = (key_down_timef(SDLK_KP_7) - key_down_timef(SDLK_KP_9))*.75f;
734 ci->forward = key_down_timef(SDLK_a) - key_down_timef(SDLK_z);
735 ci->sideways = key_down_timef(SDLK_KP_3) - key_down_timef(SDLK_KP_1);
736 ci->vertical = key_down_timef(SDLK_KP_PLUS) - key_down_timef(SDLK_KP_ENTER);
743 while( (k = key_inkey()) != 0 ) {
744 //mprintf(( "Key = %x\n", k ));
745 if ( k == SDLK_ESCAPE ) {
752 Vert_mode = !Vert_mode;
758 if (Vert_mode==1) delete_face(Current_face);
759 else if (Vert_mode==0) {
760 delete_vert(Current_point);
765 scale_factor -= 0.05f;
766 mprintf(( "Scale = %.1f\n", scale_factor ));
771 scale_factor += 0.05f;
772 mprintf(( "Scale = %.1f\n", scale_factor ));
776 Sel_mode = !Sel_mode;
780 View_mode = !View_mode;
786 for (i=0;i<num_pts;i++) if (Selected[i]) {
791 } else if (Vert_mode==0) {
792 if ( Current_point > -1 ) {
793 if ( l[Current_point] > 0 ) {
797 } else if (Vert_mode ==1) {
798 if ( l[tri[Current_face][0]] > 0 ) {
799 l[tri[Current_face][0]]--;
801 if ( l[tri[Current_face][1]] > 0 ) {
802 l[tri[Current_face][1]]--;
804 if ( l[tri[Current_face][2]] > 0 ) {
805 l[tri[Current_face][2]]--;
813 for (i=0;i<num_pts;i++) if (Selected[i]) {
818 } else if (Vert_mode==0) {
819 if ( Current_point > -1 ) {
820 if ( l[Current_point] < 31 ) {
824 } else if (Vert_mode ==1) {
825 if ( l[tri[Current_face][0]] <31 ) {
826 l[tri[Current_face][0]]++;
828 if ( l[tri[Current_face][1]] <31) {
829 l[tri[Current_face][1]]++;
831 if ( l[tri[Current_face][2]] <31 ) {
832 l[tri[Current_face][2]]++;
846 sphericalize_nebula();
862 int main(int argc, char *argv[])
867 float speed = 20.0f; // how fast viewer moves
869 // setup the fred exe directory so CFILE can init properly
871 char *c = GetCommandLine();
872 SDL_assert(c != NULL);
873 char *tok = strtok(c, " ");
874 SDL_assert(tok != NULL);
877 Cmdline_window = 1; // always windowed
882 os_init( "NebEdit", "NebEdit" ); //SCREEN_W, SCREEN_H );
883 os_set_title("NebEdit");
884 gr_init(GR_640, GR_OPENGL, 16);
885 palette_load_table( "gamepalette1-01.pcx" );
889 Font1 = gr_init_font( "font01.vf" );
890 gr_init_alphacolor( &color_green, 0,255,0,255,AC_TYPE_HUD );
892 test_model = model_load( "fighter01.pof", 0, NULL );
894 physics_init( &ViewerPhysics );
895 ViewerPhysics.flags |= PF_ACCELERATES | PF_SLIDE_ENABLED;
897 ViewerPhysics.max_vel.xyz.x = 2.0f*speed; //sideways
898 ViewerPhysics.max_vel.xyz.y = 2.0f*speed; //up/down
899 ViewerPhysics.max_vel.xyz.z = 2.0f*speed; //forward
900 ViewerPhysics.max_rear_vel = 2.0f*speed; //backward -- controlled seperately
902 memset( &ci, 0, sizeof(control_info) );
904 ModelOrient = vmd_identity_matrix;
905 ModelPos.xyz.x=0.0f; ModelPos.xyz.y = 0.0f; ModelPos.xyz.z = 0.0f;
907 ViewerOrient = vmd_identity_matrix;
908 ViewerPos.xyz.x=0.0f; ViewerPos.xyz.y = 0.0f; ViewerPos.xyz.z = -50.0f;
910 flFrametime = 0.033f;
912 t1 = timer_get_fixed_seconds();
916 wxApp::SetInstance( new MyApp() );
918 wxEntryStart(argc, argv);
920 //bool some_selected = false;
925 /*some_selected = false;
927 for (i=0;i<num_pts;i++) {
929 some_selected = true;
935 mouse_get_pos( &Mouse_x, &Mouse_y );
937 if (Current_face==-1) {
938 Current_face = get_closest_face(Mouse_x, Mouse_y);
946 // Special mouse handlers for multiple selmode
947 if (mouse_down_count(LOWEST_MOUSE_BUTTON)) {
948 Orig_pos_x = Mouse_x;
949 Orig_pos_y = Mouse_y;
951 if (mouse_down(LOWEST_MOUSE_BUTTON)) {
952 for (i=0;i<num_pts;i++) {
954 x[i]+=Mouse_x - Orig_pos_x;
955 y[i]+=Mouse_y - Orig_pos_y;
958 Orig_pos_x = Mouse_x;
959 Orig_pos_y = Mouse_y;
961 if (mouse_down_count(MOUSE_RIGHT_BUTTON)) {
962 Orig_pos_x = Mouse_x;
963 Orig_pos_y = Mouse_y;
964 for (i=0;i<num_pts;i++) {
968 if (mouse_down(MOUSE_RIGHT_BUTTON)) {
973 if (mouse_up_count(MOUSE_RIGHT_BUTTON)) {
974 Draw_sel_box = false;
977 select_by_box(Orig_pos_x, Orig_pos_y, End_pos_x, End_pos_y);
982 if ( mouse_down(LOWEST_MOUSE_BUTTON) ) {
985 x[Current_point] = Mouse_x;
986 y[Current_point] = Mouse_y;
987 } else if (Vert_mode==1) {
988 x[tri[Current_face][0]] += Mouse_x - Orig_pos_x;
989 y[tri[Current_face][0]] += Mouse_y - Orig_pos_y;
990 x[tri[Current_face][1]] += Mouse_x - Orig_pos_x;
991 y[tri[Current_face][1]] += Mouse_y - Orig_pos_y;
992 x[tri[Current_face][2]] += Mouse_x - Orig_pos_x;
993 y[tri[Current_face][2]] += Mouse_y - Orig_pos_y;
994 Orig_pos_x = Mouse_x;
995 Orig_pos_y = Mouse_y;
998 if (Vert_mode == 1) {
999 Current_face = get_closest_face(Mouse_x, Mouse_y);
1000 Orig_pos_x = Mouse_x;
1001 Orig_pos_y = Mouse_y;
1004 Current_point = get_closest(Mouse_x, Mouse_y);
1005 mouse_set_pos(x[Current_point], y[Current_point]);
1010 if ( mouse_up_count(LOWEST_MOUSE_BUTTON)) {
1011 //Current_point = -1;
1012 //Current_face = -1;
1016 if ( mouse_up_count(MOUSE_RIGHT_BUTTON) ) {
1018 Current_point = add_vert(Mouse_x, Mouse_y);
1019 } else if (Vert_mode==1) {
1020 if ((num_tris<MAX_TRIS-1)) {
1021 tri[num_tris][Which_vert] = get_closest(Mouse_x, Mouse_y);
1031 controls_read_all(&ci, flFrametime );
1032 physics_read_flying_controls( &ViewerOrient, &ViewerPhysics, &ci, flFrametime );
1033 physics_sim(&ViewerPos, &ViewerOrient, &ViewerPhysics, flFrametime );
1037 t2 = timer_get_fixed_seconds();
1039 flFrametime = f2fl(t2 - t1);
1054 // Stub functions and variables.
1055 // These do nothing but are needed to prevent link errors.
1056 void demo_set_playback_filter() {}
1058 void freespace_menu_background()
1064 int game_check_key()
1075 vector Dead_player_last_vel;