| tfxTexInfo *ti; | tfxTexInfo *ti; | ||||
| int i; | int i; | ||||
| if(!(ti=malloc(sizeof(tfxTexInfo)))) { | |||||
| if(!(ti=MALLOC(sizeof(tfxTexInfo)))) { | |||||
| fprintf(stderr,"fx Driver: out of memory !\n"); | fprintf(stderr,"fx Driver: out of memory !\n"); | ||||
| fxCloseHardware(); | fxCloseHardware(); | ||||
| exit(-1); | exit(-1); | ||||
| fxTMFreeTexture(fxMesa,tObj); | fxTMFreeTexture(fxMesa,tObj); | ||||
| free(ti); | |||||
| FREE(ti); | |||||
| tObj->DriverData=NULL; | tObj->DriverData=NULL; | ||||
| ctx->NewState|=NEW_TEXTURING; | ctx->NewState|=NEW_TEXTURING; | ||||
| (*istranslate)=GL_TRUE; | (*istranslate)=GL_TRUE; | ||||
| if(!(*dest)) { | if(!(*dest)) { | ||||
| if(!((*dest)=src=(unsigned short *)malloc(sizeof(unsigned char)*w*h))) { | |||||
| if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned char)*w*h))) { | |||||
| fprintf(stderr,"fx Driver: out of memory !\n"); | fprintf(stderr,"fx Driver: out of memory !\n"); | ||||
| fxCloseHardware(); | fxCloseHardware(); | ||||
| exit(-1); | exit(-1); | ||||
| (*istranslate)=GL_TRUE; | (*istranslate)=GL_TRUE; | ||||
| if(!(*dest)) { | if(!(*dest)) { | ||||
| if(!((*dest)=src=(unsigned short *)malloc(sizeof(unsigned short)*w*h))) { | |||||
| if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned short)*w*h))) { | |||||
| fprintf(stderr,"fx Driver: out of memory !\n"); | fprintf(stderr,"fx Driver: out of memory !\n"); | ||||
| fxCloseHardware(); | fxCloseHardware(); | ||||
| exit(-1); | exit(-1); | ||||
| (*istranslate)=GL_TRUE; | (*istranslate)=GL_TRUE; | ||||
| if(!(*dest)) { | if(!(*dest)) { | ||||
| if(!((*dest)=src=(unsigned short *)malloc(sizeof(unsigned short)*w*h))) { | |||||
| if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned short)*w*h))) { | |||||
| fprintf(stderr,"fx Driver: out of memory !\n"); | fprintf(stderr,"fx Driver: out of memory !\n"); | ||||
| fxCloseHardware(); | fxCloseHardware(); | ||||
| exit(-1); | exit(-1); | ||||
| (*istranslate)=GL_TRUE; | (*istranslate)=GL_TRUE; | ||||
| if(!(*dest)) { | if(!(*dest)) { | ||||
| if(!((*dest)=src=(unsigned short *)malloc(sizeof(unsigned short)*w*h))) { | |||||
| if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned short)*w*h))) { | |||||
| fprintf(stderr,"fx Driver: out of memory !\n"); | fprintf(stderr,"fx Driver: out of memory !\n"); | ||||
| fxCloseHardware(); | fxCloseHardware(); | ||||
| exit(-1); | exit(-1); | ||||
| return; | return; | ||||
| } else { | } else { | ||||
| if(mml->translated) | if(mml->translated) | ||||
| free(mml->data); | |||||
| FREE(mml->data); | |||||
| mml->data=NULL; | mml->data=NULL; | ||||
| } | } | ||||
| } | } |
| { | { | ||||
| tfxTMFreeNode *tmn; | tfxTMFreeNode *tmn; | ||||
| if(!(tmn=malloc(sizeof(tfxTMFreeNode)))) { | |||||
| if(!(tmn=MALLOC(sizeof(tfxTMFreeNode)))) { | |||||
| fprintf(stderr,"fx Driver: out of memory !\n"); | fprintf(stderr,"fx Driver: out of memory !\n"); | ||||
| fxCloseHardware(); | fxCloseHardware(); | ||||
| exit(-1); | exit(-1); | ||||
| *startadr=tmfree->startAddress; | *startadr=tmfree->startAddress; | ||||
| nexttmfree=tmfree->next; | nexttmfree=tmfree->next; | ||||
| free(tmfree); | |||||
| FREE(tmfree); | |||||
| return nexttmfree; | return nexttmfree; | ||||
| } | } | ||||
| fxMesa->freeTexMem[tmu]-=texmemsize; | fxMesa->freeTexMem[tmu]-=texmemsize; | ||||
| if(!(newtmalloc=malloc(sizeof(tfxTMAllocNode)))) { | |||||
| if(!(newtmalloc=MALLOC(sizeof(tfxTMAllocNode)))) { | |||||
| fprintf(stderr,"fx Driver: out of memory !\n"); | fprintf(stderr,"fx Driver: out of memory !\n"); | ||||
| fxCloseHardware(); | fxCloseHardware(); | ||||
| exit(-1); | exit(-1); | ||||
| tfxTMAllocNode *newtmalloc; | tfxTMAllocNode *newtmalloc; | ||||
| newtmalloc=tmalloc->next; | newtmalloc=tmalloc->next; | ||||
| free(tmalloc); | |||||
| FREE(tmalloc); | |||||
| return newtmalloc; | return newtmalloc; | ||||
| } | } | ||||
| tmfree->endAddress=tmfree->next->endAddress; | tmfree->endAddress=tmfree->next->endAddress; | ||||
| nexttmfree=tmfree->next->next; | nexttmfree=tmfree->next->next; | ||||
| free(tmfree->next); | |||||
| FREE(tmfree->next); | |||||
| tmfree->next=nexttmfree; | tmfree->next=nexttmfree; | ||||
| } | } | ||||
| for(i=0;i<MAX_TEXTURE_LEVELS;i++) { | for(i=0;i<MAX_TEXTURE_LEVELS;i++) { | ||||
| if(ti->tmi.mipmapLevel[i].used && | if(ti->tmi.mipmapLevel[i].used && | ||||
| ti->tmi.mipmapLevel[i].translated) | ti->tmi.mipmapLevel[i].translated) | ||||
| free(ti->tmi.mipmapLevel[i].data); | |||||
| FREE(ti->tmi.mipmapLevel[i].data); | |||||
| (void)ti->tmi.mipmapLevel[i].data; | (void)ti->tmi.mipmapLevel[i].data; | ||||
| } | } | ||||
| if(fn->next) | if(fn->next) | ||||
| fxTMFreeAllFreeNode(fn->next); | fxTMFreeAllFreeNode(fn->next); | ||||
| free(fn); | |||||
| FREE(fn); | |||||
| } | } | ||||
| void fxTMFreeAllAllocNode(tfxTMAllocNode *an) | void fxTMFreeAllAllocNode(tfxTMAllocNode *an) | ||||
| if(an->next) | if(an->next) | ||||
| fxTMFreeAllAllocNode(an->next); | fxTMFreeAllAllocNode(an->next); | ||||
| free(an); | |||||
| FREE(an); | |||||
| } | } | ||||
| void fxTMClose(fxMesaContext fxMesa) | void fxTMClose(fxMesaContext fxMesa) |
| hDC = GetDC(dibWnd); | hDC = GetDC(dibWnd); | ||||
| dibBMI = (BITMAPINFO*) malloc( sizeof(BITMAPINFO) + (256*sizeof(RGBQUAD))); | |||||
| dibBMI = (BITMAPINFO*) MALLOC( sizeof(BITMAPINFO) + (256*sizeof(RGBQUAD))); | |||||
| memset(dibBMI,0,sizeof(BITMAPINFO) + (256*sizeof(RGBQUAD))); | memset(dibBMI,0,sizeof(BITMAPINFO) + (256*sizeof(RGBQUAD))); | ||||
| if(ctx && hglrc == (HGLRC)1) { | if(ctx && hglrc == (HGLRC)1) { | ||||
| if (gdiWindowHackEna) { | if (gdiWindowHackEna) { | ||||
| DeleteObject(dibHBM); | DeleteObject(dibHBM); | ||||
| free(dibBMI); | |||||
| FREE(dibBMI); | |||||
| dibSurfacePtr = NULL; | dibSurfacePtr = NULL; | ||||
| dibBMI = NULL; | dibBMI = NULL; | ||||
| // Convert the display dependant representation to a 1 bit deep DIB | // Convert the display dependant representation to a 1 bit deep DIB | ||||
| numBytes = (bmapWidth * bmapHeight) / 8; | numBytes = (bmapWidth * bmapHeight) / 8; | ||||
| bmap = malloc(numBytes); | |||||
| bmap = MALLOC(numBytes); | |||||
| dibInfo->bmiHeader.biWidth = bmapWidth; | dibInfo->bmiHeader.biWidth = bmapWidth; | ||||
| dibInfo->bmiHeader.biHeight = bmapHeight; | dibInfo->bmiHeader.biHeight = bmapHeight; | ||||
| res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap, | res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap, | ||||
| DeleteObject(bitObject); | DeleteObject(bitObject); | ||||
| // Deallocate the bitmap data | // Deallocate the bitmap data | ||||
| free(bmap); | |||||
| FREE(bmap); | |||||
| } | } | ||||
| // Destroy the DC | // Destroy the DC | ||||
| VERIFY(DeleteDC(bitDevice)); | VERIFY(DeleteDC(bitDevice)); | ||||
| free(dibInfo); | |||||
| FREE(dibInfo); | |||||
| return TRUE; | return TRUE; | ||||
| #undef VERIFY | #undef VERIFY |
| /* $Id: fakeglx.c,v 1.8 1999/09/16 16:44:37 brianp Exp $ */ | |||||
| /* $Id: fakeglx.c,v 1.9 1999/10/13 18:49:47 brianp Exp $ */ | |||||
| /* | /* | ||||
| * Mesa 3-D graphics library | * Mesa 3-D graphics library | ||||
| if (deepvis==NULL || vislist->depth > deepest) { | if (deepvis==NULL || vislist->depth > deepest) { | ||||
| /* YES! found a satisfactory visual */ | /* YES! found a satisfactory visual */ | ||||
| if (deepvis) { | if (deepvis) { | ||||
| free( deepvis ); | |||||
| XFree( deepvis ); | |||||
| } | } | ||||
| deepest = vislist->depth; | deepest = vislist->depth; | ||||
| deepvis = vislist; | deepvis = vislist; |
| /* $Id: xfonts.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ | |||||
| /* $Id: xfonts.c,v 1.2 1999/10/13 18:49:47 brianp Exp $ */ | |||||
| /* | /* | ||||
| * Mesa 3-D graphics library | * Mesa 3-D graphics library | ||||
| max_bm_width = (max_width + 7) / 8; | max_bm_width = (max_width + 7) / 8; | ||||
| max_bm_height = max_height; | max_bm_height = max_height; | ||||
| bm = (GLubyte *) malloc ((max_bm_width * max_bm_height) * sizeof | |||||
| bm = (GLubyte *) MALLOC((max_bm_width * max_bm_height) * sizeof | |||||
| (GLubyte)); | (GLubyte)); | ||||
| if (!bm) { | if (!bm) { | ||||
| XFreeFontInfo( NULL, fs, 0 ); | XFreeFontInfo( NULL, fs, 0 ); |