Skip to content

Commit

Permalink
cleaning up aiinit.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
philippedax committed Jun 21, 2021
1 parent 72be959 commit 22fcec9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/3d/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,9 @@ void Render::setCameraScissor(GLfloat posx, GLfloat posy, GLfloat posz, GLfloat
satPos.v[2] = posz;
satRot.v[2] = rotz;
}
else
else {
view = VIEW_FIRST_PERSON;
}
}

V3 Render::getVisiblePosition(WObject *po)
Expand Down Expand Up @@ -290,8 +291,9 @@ V3 Render::getVisiblePosition(WObject *po)
gluProject(xa+dxa, ya-dya, za-dza, mview, mproj, vp, &x[3],&y[3],&z[3]);
gluProject(xa-dxa, ya-dya, za-dza, mview, mproj, vp, &x[4],&y[4],&z[4]);

for (int i=0; i<5; i++)
for (int i=0; i<5; i++) {
y[i] = vp[3] - y[i];
}

for (int i=0; i<5; i++) {
if ((x[i] > w) || (x[i] < 0) || (y[i] > h) || (y[i] < 0)) continue;
Expand Down
6 changes: 3 additions & 3 deletions src/ai/aiinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ value recherche_Typegen(value ttype, value actiondemande)
return Val_int(1);
}

//XXX demande désignation.
//XXX demande designation.
return Val_int(0);
}

Expand Down Expand Up @@ -236,7 +236,7 @@ value recherche_Func(value mot, value act)
WObject **listObj = g.render.getVisibleObjects(typelist, nbtype, &nb);

if (nb > 0 && strcasecmp(actiontype, "NA")) {
//on lance la méthode sur les objets visibles! faut-il la lancer sur tout?
//on lance la methode sur les objets visibles! faut-il la lancer sur tout?
for (int l=0; l<nb; l++) {
if (!strcasecmp(listObj[l]->typeName(), actiontype))
listObj[l]->runAction(val);
Expand Down Expand Up @@ -288,7 +288,7 @@ value deplacement_to_Proximite(value mot, value pos)
char *val = (char *) String_val(mot);
char filename[64];
Cache::cache(World::current()->getUrl(), filename);
temp = Xml::selectProximity(filename,val,&posx,&posy,&posz,&orient);
temp = Xml::selectProximity(filename, val, &posx, &posy, &posz, &orient);
#endif

if (! temp)
Expand Down

0 comments on commit 22fcec9

Please sign in to comment.