All pastes #388020 Raw Edit

Untitled

public c v1 · immutable
·published 2007-03-09 19:54 UTC
rendered paste body
int export_PherMap( brEval args[], brEval *result, void *instance ) {    char* filename = BRSTRING( &args[0] );    char* line = new char[PHERMAP_ROW_WIDTH];    FILE* OUTFH;        if ( ( OUTFH = fopen( filename, "w" ) ) == NULL ) {        //slMessage( DEBUG_ALL, "Could NOT open file 'myPheromoneColormap-plugin.dll_debug-output.txt'!\n" );        fprintf( stderr, "Could NOT open file 'myPheromoneColormap-plugin.dll_debug-output.txt'!\n" );        return EC_ERROR;	}      for( y = 0; y < PHERMAP_HEIGHT; y++ ) {        I = y * PHERMAP_ROW_WIDTH;        i = 0;        for( x = 0; x < PHERMAP_ROW_WIDTH; x+=4 ) {             line[i++] = PHERMAP [ I + x ];             line[i++] = ' ';        }        line[i++]=0xA;        line[i++]=0xD;        line[i]=0x0;        fprintf( OUTFH, line);     }		fflush( OUTFH );	fclose( OUTFH );	    // DEBUG( fprintf( DBGFH, "testPherMap: vector = (%d, %d, %d)!\n", x, y, pherStr ); )    DEBUG( fflush( DBGFH ); )    return EC_OK;}