Need some help to finalize AmigaOS4 port of AssaultCube
#13
Yep, i think about the same too for now, as about better/faster way. So, i found that "m" its just "struct model" which have inside:
Quote:virtual void render(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, float pitch, dynent *d, modelattach *a = NULL, float scale = 1.0f) = 0;

So trying to found that "render" fucntion for now, and found that "void render" handles in many files, but i assume "our one", is in md2.h or in md3.h ? Or somethere else ? (sorry, not so good with programming, and a bit looses in that sources for now).

EDIT: trying to comment our render fucntion in the md2.h only - crashes. in the md3.h only - crashes. But if i comment out these functions in the boch md2.h and in md3.h - then no crashes / but no meshes of course.

I think that i need to put all that print/pause stuff to boch (md2 and md3 includes), inside of that render fucntions ? I will try for first comment out fully render in md3, and printf/pause all the stuff in md2 (i think problem will be the same in boch as well)

added printfs to the void render of md2.h fucntion, and , it works for a while, i see tons
of prints, all going well , and on some moment it crashes there:

Quote:conoutf("if anim scale blabla, + redner !");
if(anim&ANIM_MIRROR || scale!=1) matrixstack[0].scale(scale, anim&ANIM_MIRROR ? -scale : scale, scale);
conoutf("end of scale");
parts[0]->render(anim, varseed, speed, basetime, d);
conoutf("end of anim scale blablab and render");

In the shell after tons of working loops, i have :
Quote:if anim scale blabla, + redner !
end of scale

Should to say, it happenes exactly when everything should showns on screen. I can hear first sound when game starts, and then that crash. Some times it even show me that first screen, but when i "shoot", then crash is happenes.

For now all the ways bring me back to vertmodel.h, to the "struct mesh", which have inside also render() functions which looks like this:
Quote: void render(animstate &as, anpos &cur, anpos *prev, float ai_t)
{
if(!(as.anim&ANIM_NOSKIN))
{
GLuint id = tex < 0 ? -tex : skin->id;
if(tex > 0) id = lookuptexture(tex)->id;
if(id != lasttex)
{
glBindTexture(GL_TEXTURE_2D, id);
lasttex = id;
}
if(enablealphablend) { glDisable(GL_BLEND); enablealphablend = false; }
if(skin->bpp == 32 && owner->model->alphatest > 0)
{
if(!enablealphatest) { glEnable(GL_ALPHA_TEST); enablealphatest = true; }
if(lastalphatest != owner->model->alphatest)
{
glAlphaFunc(GL_GREATER, owner->model->alphatest);
lastalphatest = owner->model->alphatest;
}
}
else if(enablealphatest) { glDisable(GL_ALPHA_TEST); enablealphatest = false; }
if(!enabledepthmask) { glDepthMask(GL_TRUE); enabledepthmask = true; }
}

I think is the "very first and very main" render of all the meshes ?
Thanks given by:


Messages In This Thread
RE: Need some help to finalize AmigaOS4 port of AssaultCube - by kas1e - 13 Nov 10, 12:28PM