• Caterpillar
    Caterpillar
    Posts: 33 from 2013/6/20
    Hello

    @waldiamiga
    Ok will test those demos

    @Intuition
    I have used the patch but perhaps it dont works with the demo WipeOut_2097_Demo
    This demo works some time on os4/wazp3D but finally crash due to the memory hit bug

    @kiero
    I am using only glDrawArrays for all drawings (see below)
    Now Wazp3D convert all primitives (like say a W3D_DrawTriFan) to triangles/points/lines list so now only the "newdraw" code is still present

    /*==================================================================*/
    void HARD3D_DrawPrimitive(void *hc,void *p,unsigned long Pnb,unsigned long primitive)
    {
    struct point3D *P=p;
    struct HARD3D_context *HC=hc;
    unsigned char UsePersp =(HC->state->PerspMode!=0);
    struct TexCoord4f *V=(void*)HC->V;
    unsigned int mode;
    long int n;

    HFUNC(HARD3D_DrawPrimitive);
    OS_CurrentContext(hc);
    VAR(P)
    VAR(Pnb)

    if(Pnb>MAXPRIM)
    return;

    if(UsePersp)
    {
    NLOOP(Pnb)
    {

    V[n].s=P[n].w*P[n].u ;
    V[n].t=P[n].w*P[n].v ;
    V[n].r=0.0;
    V[n].q=P[n].w;
    if(1.0 if(P[n].z<0.0) P[n].z=0.0;
    }
    glTexCoordPointer(4, GL_FLOAT, 4*4,HC->V);
    }
    else
    {
    NLOOP(Pnb)
    {
    if(1.0 if(P[n].z<0.0) P[n].z=0.0;
    }
    glTexCoordPointer(2, GL_FLOAT,PSIZE,(void *)&(P->u));
    }

    NLOOP(Pnb)
    PrintP(&P[n]);

    if(primitive==W3D_PRIMITIVE_POINTS) {primitive=GL_POINTS; goto newdraw;}
    if(primitive==W3D_PRIMITIVE_LINESTRIP) {primitive=GL_LINE_STRIP; goto newdraw;}
    if(primitive==W3D_PRIMITIVE_LINELOOP) {primitive=GL_LINE_LOOP; goto newdraw;}
    if(primitive==W3D_PRIMITIVE_LINES) {primitive=GL_LINES; goto newdraw;}
    if(primitive==W3D_PRIMITIVE_TRISTRIP) {primitive=GL_TRIANGLE_STRIP; goto newdraw;}
    if(primitive==W3D_PRIMITIVE_TRIFAN) {primitive=GL_TRIANGLE_FAN; goto newdraw;}
    if(primitive==W3D_PRIMITIVE_TRIANGLES) {primitive=GL_TRIANGLES; goto newdraw;}
    if(primitive==W3D_PRIMITIVE_POLYGON) {primitive=GL_POLYGON; goto newdraw;}


    newdraw:
    REM(newdraw)
    VAR(primitive)

    if(currentP!=P)
    {
    REM(P changed)
    currentP=P;
    glVertexPointer(3, GL_FLOAT, PSIZE,(void *)&(P->x));
    glEnableClientState(GL_VERTEX_ARRAY);
    glColorPointer(4,GL_UNSIGNED_BYTE,PSIZE,(void *)&(P->RGBA));
    glEnableClientState(GL_COLOR_ARRAY);
    }

    glDrawArrays(primitive,0,Pnb);
    return;
    }
  • »27.11.13 - 09:08
    Profile Visit Website