![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
| #define RT_BOUNDING_DISABLED 0 |
| #define RT_BOUNDING_ENABLED 1 |
Definition at line 139 of file api.h.
Referenced by renderscene(), and rt_newscene().
| #define RT_DISPLAY_DISABLED 0 |
| #define RT_DISPLAY_ENABLED 1 |
Definition at line 146 of file api.h.
Referenced by getparm(), main_init_parts(), and rt_newscene().
| #define RT_PHONG_METAL 1 |
Definition at line 215 of file api.h.
Referenced by GetTexBody().
| #define RT_PHONG_PLASTIC 0 |
Definition at line 214 of file api.h.
Referenced by GetTexBody().
| typedef void* SceneHandle |
| void rt_background | ( | SceneHandle | , |
| color | |||
| ) |
Definition at line 185 of file api.cpp.
References color::b, scenedef::background, color::g, color::r, and scene.
Referenced by readmodel().
{
scenedef * scene = (scenedef *) voidscene;
scene->background.r = col.r;
scene->background.g = col.g;
scene->background.b = col.b;
}
| void rt_boundmode | ( | SceneHandle | , |
| int | |||
| ) |
Definition at line 192 of file api.cpp.
References scenedef::boundmode, and scene.
Referenced by rt_newscene(), and useoptions().
| void rt_boundthresh | ( | SceneHandle | , |
| int | |||
| ) |
Definition at line 197 of file api.cpp.
References scenedef::boundthresh, MAXOCTNODES, rtmesg(), and scene.
Referenced by rt_newscene(), and useoptions().
{
scenedef * scene = (scenedef *) voidscene;
if (threshold > 1) {
scene->boundthresh = threshold;
}
else {
rtmesg("Ignoring out-of-range automatic bounding threshold.\n");
rtmesg("Automatic bounding threshold reset to default.\n");
scene->boundthresh = MAXOCTNODES;
}
}
Definition at line 363 of file api.cpp.
References add_object(), and newbox().
Referenced by GetBox().
{
add_object((object *) newbox(tex, (vector)min, (vector)max));
}
Definition at line 135 of file api.cpp.
References scenedef::antialiasing, scenedef::aspectratio, scenedef::camcent, scenedef::camrightvec, scenedef::camupvec, scenedef::camviewvec, scenedef::camzoom, scenedef::raydepth, scene, VCross(), and VNorm().
Referenced by GetScenedefs(), and rt_newscene().
{
scenedef * scene = (scenedef *) voidscene;
vector newupvec;
vector newviewvec;
vector newrightvec;
VCross((vector *) &upvec, &viewvec, &newrightvec);
VNorm(&newrightvec);
VCross((vector *) &viewvec, &newrightvec, &newupvec);
VNorm(&newupvec);
newviewvec=viewvec;
VNorm(&newviewvec);
scene->camzoom=zoom;
scene->aspectratio=aspectratio;
scene->antialiasing=antialiasing;
scene->raydepth=raydepth;
scene->camcent=camcent;
scene->camviewvec=newviewvec;
scene->camrightvec=newrightvec;
scene->camupvec=newupvec;
}
Definition at line 367 of file api.cpp.
References add_object(), and newcylinder().
Referenced by GetCylinder().
{
add_object(newcylinder(tex, (vector)ctr, (vector)axis, rad));
}
| void rt_deletescene | ( | SceneHandle | ) |
| void rt_displaymode | ( | SceneHandle | , |
| int | |||
| ) |
Definition at line 210 of file api.cpp.
References scenedef::displaymode, and scene.
Referenced by rt_newscene(), and useoptions().
{
scenedef * scene = (scenedef *) voidscene;
scene->displaymode = mode;
}
Definition at line 359 of file api.cpp.
References add_object(), and newextvol().
{
add_object((object *) newextvol(tex, (vector)min, (vector)max, samples, evaluator));
}
Definition at line 371 of file api.cpp.
References add_object(), and newfcylinder().
Referenced by GetFCylinder(), rt_polycylinder(), and rt_tri_cylinder().
{
add_object(newfcylinder(tex, (vector)ctr, (vector)axis, rad));
}
| void rt_finalize | ( | void | ) |
Definition at line 183 of file video.cpp.
Referenced by main_init_parts(), and rtbomb().
{
timerstart();
if(global_usegraphics)
do { rt_sleep(10); timerstop(); }
while(timertime() < 10 && video->next_frame());
#ifdef _WINDOWS
else rt_sleep(10000);
#endif
}
Definition at line 97 of file apigeom.cpp.
References rt_tri(), vector::x, vector::y, and vector::z.
{
int xx,yy;
vector v0, v1, v2;
apiflt xoff, yoff, zoff;
xoff=ctr.x - (wx / 2.0);
yoff=ctr.z - (wy / 2.0);
zoff=ctr.y;
for (yy=0; yy<(n-1); yy++) {
for (xx=0; xx<(m-1); xx++) {
v0.x=wx*(xx )/(m*1.0) + xoff;
v0.y=field[(yy )*m + (xx )] + zoff;
v0.z=wy*(yy )/(n*1.0) + yoff;
v1.x=wx*(xx + 1)/(m*1.0) + xoff;
v1.y=field[(yy )*m + (xx + 1)] + zoff;
v1.z=wy*(yy )/(n*1.0) + yoff;
v2.x=wx*(xx + 1)/(m*1.0) + xoff;
v2.y=field[(yy + 1)*m + (xx + 1)] + zoff;
v2.z=wy*(yy + 1)/(n*1.0) + yoff;
rt_tri(tex, v1, v0, v2);
v0.x=wx*(xx )/(m*1.0) + xoff;
v0.y=field[(yy )*m + (xx )] + zoff;
v0.z=wy*(yy )/(n*1.0) + yoff;
v1.x=wx*(xx )/(m*1.0) + xoff;
v1.y=field[(yy + 1)*m + (xx )] + zoff;
v1.z=wy*(yy + 1)/(n*1.0) + yoff;
v2.x=wx*(xx + 1)/(m*1.0) + xoff;
v2.y=field[(yy + 1)*m + (xx + 1)] + zoff;
v2.z=wy*(yy + 1)/(n*1.0) + yoff;
rt_tri(tex, v0, v1, v2);
}
}
} /* end of heightfield */
| void rt_initialize | ( | int * | , |
| char *** | |||
| ) |
Definition at line 116 of file api.cpp.
References InitTextures(), parinitted, reset_lights(), reset_object(), and rpcmsg::type.
Referenced by main_init_parts().
{
rpcmsg msg;
reset_object();
reset_lights();
InitTextures();
if (!parinitted) {
parinitted=1;
msg.type=1; /* setup a ping message */
}
}
Definition at line 250 of file apigeom.cpp.
References mission1::m, rt_sheightfield(), and subdivide().
Referenced by GetLandScape().
{
int totalsize, x, y;
apiflt * field;
totalsize=m*n;
srand(totalsize);
field=(apiflt *) malloc(totalsize*sizeof(apiflt));
for (y=0; y<n; y++) {
for (x=0; x<m; x++) {
field[x + y*m]=0.0;
}
}
field[0 + 0]=1.0 + (rand() % 100)/100.0;
field[m - 1]=1.0 + (rand() % 100)/100.0;
field[0 + m*(n - 1)]=1.0 + (rand() % 100)/100.0;
field[m - 1 + m*(n - 1)]=1.0 + (rand() % 100)/100.0;
subdivide(field, m, n, wx, wy, 0, 0, m-1, n-1);
rt_sheightfield(tex, ctr, m, n, field, wx, wy);
free(field);
}
Definition at line 339 of file api.cpp.
References add_light(), add_object(), texture::diffuse, texture::islight, newlight(), texture::opacity, texture::shadowcast, texture::specular, and point_light::tex.
Referenced by GetLight().
{
point_light * li;
li=newlight(tex, (vector) ctr, rad);
li->tex->islight=1;
li->tex->shadowcast=1;
li->tex->diffuse=0.0;
li->tex->specular=0.0;
li->tex->opacity=1.0;
add_light(li);
add_object((object *)li);
}
| SceneHandle rt_newscene | ( | void | ) |
Definition at line 222 of file api.cpp.
References MAXOCTNODES, RT_BOUNDING_ENABLED, rt_boundmode(), rt_boundthresh(), rt_camerasetup(), RT_DISPLAY_ENABLED, rt_displaymode(), rt_outputfile(), rt_rawimage(), rt_resolution(), rt_vector(), rt_verbose(), and scene.
Referenced by main_init_parts().
{
scenedef * scene;
SceneHandle voidscene;
scene = (scenedef *) malloc(sizeof(scenedef));
memset(scene, 0, sizeof(scenedef)); /* clear all valuas to 0 */
voidscene = (SceneHandle) scene;
rt_outputfile(voidscene, "/dev/null"); /* default output file (.tga) */
rt_resolution(voidscene, 512, 512); /* 512x512 resolution */
rt_verbose(voidscene, 0); /* verbose messages off */
rt_rawimage(voidscene, NULL); /* raw image output off */
rt_boundmode(voidscene, RT_BOUNDING_ENABLED); /* spatial subdivision on */
rt_boundthresh(voidscene, MAXOCTNODES); /* default threshold */
rt_displaymode(voidscene, RT_DISPLAY_ENABLED); /* video output on */
rt_camerasetup(voidscene, 1.0, 1.0, 0, 6,
rt_vector(0.0, 0.0, 0.0),
rt_vector(0.0, 0.0, 1.0),
rt_vector(0.0, 1.0, 0.0));
return scene;
}
| void rt_outputfile | ( | SceneHandle | , |
| const char * | outname | ||
| ) |
Definition at line 164 of file api.cpp.
References scenedef::outfilename, and scene.
Referenced by rt_newscene(), rt_scenesetup(), and useoptions().
{
scenedef * scene = (scenedef *) voidscene;
strcpy((char *) &scene->outfilename, outname);
}
Definition at line 375 of file api.cpp.
References add_object(), and newplane().
Referenced by GetPlane().
{
add_object(newplane(tex, (vector)ctr, (vector)norm));
}
Definition at line 73 of file apigeom.cpp.
References rt_fcylinder(), rt_sphere(), vector::x, vector::y, and vector::z.
Referenced by GetPolyCylinder().
{
vector a;
int i;
if ((points == NULL) || (numpts == 0)) {
return;
}
if (numpts > 0) {
rt_sphere(tex, points[0], rad);
if (numpts > 1) {
for (i=1; i<numpts; i++) {
a.x = points[i].x - points[i-1].x;
a.y = points[i].y - points[i-1].y;
a.z = points[i].z - points[i-1].z;
rt_fcylinder(tex, points[i-1], a, rad);
rt_sphere(tex, points[i], rad);
}
}
}
}
Definition at line 408 of file api.cpp.
References quadmatrix::a, add_object(), quadmatrix::b, quadmatrix::c, quadric::ctr, quadmatrix::d, quadmatrix::e, quadmatrix::f, quadmatrix::g, quadmatrix::h, quadmatrix::i, quadmatrix::j, quadric::mat, newquadric(), and quadric::tex.
| void rt_rawimage | ( | SceneHandle | , |
| unsigned char * | rawimage | ||
| ) |
Definition at line 180 of file api.cpp.
References scenedef::rawimage, and scene.
Referenced by rt_newscene().
| void rt_renderscene | ( | SceneHandle | ) |
Definition at line 130 of file api.cpp.
References renderscene(), and scene.
{
scenedef * scene = (scenedef *) voidscene;
renderscene(*scene);
}
| void rt_resolution | ( | SceneHandle | , |
| int | hres, | ||
| int | vres | ||
| ) |
Definition at line 169 of file api.cpp.
References scenedef::hres, scene, and scenedef::vres.
Referenced by rt_newscene(), and rt_scenesetup().
Definition at line 379 of file api.cpp.
References add_object(), and newring().
Referenced by GetRing().
{
add_object(newring(tex, (vector)ctr, (vector)norm, a, b));
}
Definition at line 354 of file api.cpp.
References add_object(), and newscalarvol().
Referenced by GetVol().
{
add_object((object *) newscalarvol(tex, (vector)min, (vector)max, xs, ys, zs, fname, (scalarvol *) invol));
}
| void rt_scenesetup | ( | SceneHandle | , |
| char * | , | ||
| int | , | ||
| int | , | ||
| int | |||
| ) |
Definition at line 216 of file api.cpp.
References rt_outputfile(), rt_resolution(), and rt_verbose().
Referenced by GetScenedefs().
{
rt_outputfile(voidscene, outname);
rt_resolution(voidscene, hres, vres);
rt_verbose(voidscene, verbose);
}
Definition at line 383 of file api.cpp.
References add_object(), and newsphere().
Referenced by GetSphere(), and rt_polycylinder().
{
add_object(newsphere(tex, (vector)ctr, rad));
}
Definition at line 397 of file api.cpp.
References add_object(), and newstri().
Referenced by GetSTri(), rt_sheightfield(), rt_tri_fcylinder(), and rt_tri_ring().
| void rt_tex_color | ( | void * | voidtex, |
| color | col | ||
| ) |
Definition at line 332 of file api.cpp.
References texture::phong, texture::phongexp, and texture::phongtype.
Referenced by GetTexBody().
| void* rt_texture | ( | apitexture * | ) |
Definition at line 319 of file api.cpp.
References apitextotex(), and rt_getmem().
Referenced by GetLight(), GetTexBody(), and reset_tex_table().
{
texture * tex;
tex=(texture *)rt_getmem(sizeof(texture));
apitextotex(apitex, tex);
return(tex);
}
Definition at line 387 of file api.cpp.
References add_object(), and newtri().
Referenced by GetTPolyFile(), GetTri(), rt_heightfield(), and rt_tri_box().
{
object * trn;
trn = newtri(tex, (vector)v0, (vector)v1, (vector)v2);
if (trn != NULL) {
add_object(trn);
}
}
Definition at line 96 of file api.cpp.
References vector::x, vector::y, and vector::z.
Referenced by rt_newscene(), rt_sheightfield(), and rt_tri_box().
| void rt_verbose | ( | SceneHandle | , |
| int | v | ||
| ) |
Definition at line 175 of file api.cpp.
References scene, and scenedef::verbosemode.
Referenced by rt_newscene(), rt_scenesetup(), and useoptions().
{
scenedef * scene = (scenedef *) voidscene;
scene->verbosemode = v;
}
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.