utils/testparse.c
changeset 1104 9147482e1ec7
parent 1090 636ffcd3f14a
child 1150 02c0f0afb39a
equal deleted inserted replaced
1103:8b7c29c019d5 1104:9147482e1ec7
   480     // magic for an effects file (!!! FIXME: I _think_).
   480     // magic for an effects file (!!! FIXME: I _think_).
   481     if ( (buf[0] == 0x01) && (buf[1] == 0x09) &&
   481     if ( (buf[0] == 0x01) && (buf[1] == 0x09) &&
   482          (buf[2] == 0xFF) && (buf[3] == 0xFE) )
   482          (buf[2] == 0xFF) && (buf[3] == 0xFE) )
   483     {
   483     {
   484         const MOJOSHADER_effect *effect;
   484         const MOJOSHADER_effect *effect;
   485         effect = MOJOSHADER_parseEffect(prof, buf, len, 0, 0, Malloc, Free, 0);
   485         effect = MOJOSHADER_parseEffect(prof, buf, len, NULL, 0,
       
   486                                         NULL, 0, Malloc, Free, 0);
   486         retval = (effect->error_count == 0);
   487         retval = (effect->error_count == 0);
   487         printf("EFFECT: %s\n", fname);
   488         printf("EFFECT: %s\n", fname);
   488         print_effect(fname, effect, 1);
   489         print_effect(fname, effect, 1);
   489         MOJOSHADER_freeEffect(effect);
   490         MOJOSHADER_freeEffect(effect);
   490     } // if
   491     } // if
   491 
   492 
   492     else  // do it as a regular compiled shader.
   493     else  // do it as a regular compiled shader.
   493     {
   494     {
   494         const MOJOSHADER_parseData *pd;
   495         const MOJOSHADER_parseData *pd;
   495         pd = MOJOSHADER_parse(prof, buf, len, NULL, 0, Malloc, Free, NULL);
   496         pd = MOJOSHADER_parse(prof, buf, len, NULL, 0,
       
   497                               NULL, 0, Malloc, Free, NULL);
   496         retval = (pd->error_count == 0);
   498         retval = (pd->error_count == 0);
   497         printf("SHADER: %s\n", fname);
   499         printf("SHADER: %s\n", fname);
   498         print_shader(fname, pd, 1);
   500         print_shader(fname, pd, 1);
   499         MOJOSHADER_freeParseData(pd);
   501         MOJOSHADER_freeParseData(pd);
   500     } // else
   502     } // else