MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / RenderTexFrame

Function RenderTexFrame

editor/jaytest.cpp:53–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void RenderTexFrame(grViewport *my_viewport) {
54 int nv, i, t;
55 g3s_point phold[70], dhold[70], fhold[70];
56 g3s_point *plist = phold, *dlist = dhold, *flist = fhold;
57 vms_vector vpos = {0, 0, 0};
58 vms_orient vang = {0, 0, 0};
59
60 static float sx = 0, sy = 0, sz = 15, rl = 0.0;
61 static float xdir = .4;
62 static float ydir = .5;
63 static float zdir = .7;
64 static float ldir = .05;
65
66 static frame = 0;
67 static time_t oldtime = 0;
68 static int framecount = 0;
69 time_t newtime;
70
71 static char f_play_sound = 1;
72
73 framecount++;
74 g3_SetViewAngles(&vpos, &vang, 0);
75
76 newtime = time(NULL);
77 if (newtime != oldtime) {
78 mprintf_at(1, 2, 0, "%d FPS ", framecount);
79 oldtime = newtime;
80 framecount = 0;
81 }
82
83 SndLib.begin_sound_frame();
84
85 if (Square2 == NULL) {
86 if ((Square2 = AllocateObject()) == NULL)
87 return;
88 mng_LoadAllTextures();
89 D3EditState.texdlg_texture = 0;
90 }
91
92 frame++;
93 sx = sx + xdir;
94 sy = sy + ydir;
95 sz = sz + zdir;
96 rl = rl + ldir;
97
98 if (rl < 0 || rl > 1) {
99 ldir = -ldir;
100 rl = rl + ldir;
101 }
102 if (sx > 10 || sx < -10) {
103 xdir = -xdir;
104 // f_play_sound = 1;
105 }
106 if (sy > 10 || sy < -10) {
107 ydir = -ydir;
108 // f_play_sound = 1;
109 }
110 if (sz > 170 || sz < .000001) {

Callers

nothing calls this directly

Calls 2

lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected