From 4c42b9ebafe08e3fc44be2b2d98ea9516962e9a4 Mon Sep 17 00:00:00 2001 From: riccardom Date: Fri, 3 Jul 2009 18:51:10 +0000 Subject: [PATCH] Remove a chunk of double zero-ifdeffed code. --- .../gtk-glade/dTools/callbacks_4_tileview.cpp | 152 ------------------ 1 file changed, 152 deletions(-) diff --git a/desmume/src/gtk-glade/dTools/callbacks_4_tileview.cpp b/desmume/src/gtk-glade/dTools/callbacks_4_tileview.cpp index 46b059c26..1702f491e 100755 --- a/desmume/src/gtk-glade/dTools/callbacks_4_tileview.cpp +++ b/desmume/src/gtk-glade/dTools/callbacks_4_tileview.cpp @@ -310,156 +310,4 @@ gboolean on_wDraw_Tile_expose_event (GtkWidget * w, GdkEventExpose * e, gp return TRUE; } - - -#if 0 - -void other_screen (GtkWidget * widget, int screen) { - if (!my_gl_Begin(screen)) return; - - my_gl_Identity(); - glClear( GL_COLOR_BUFFER_BIT ); - - GPU * gpu = &SubScreen; - struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits; - _OAM_ * spriteInfo = (_OAM_*)(gpu->oam + 127);// + 127; - u16 i; int mode; - u8 prioTab[256]; - -#define MODE_IDX_16 1 -#define MODE_IDX_256 2 -#define MODE_BMP 3 - - for(i = 0; i<127; ++i, --spriteInfo) - { - size sprSize; - s32 sprX, sprY, x, y, lg; - int xdir; - u8 prio, * src; - u16 * pal; - u16 i,j; - u16 rotScaleA,rotScaleB,rotScaleC,rotScaleD; - int block; - - prio = spriteInfo->Priority; - - // get sprite location and size - sprX = (spriteInfo->X<<23)>>23; - sprY = spriteInfo->Y; - sprSize = sprSizeTab[spriteInfo->Size][spriteInfo->Shape]; - - lg = sprSize.x; - - if (spriteInfo->RotScale == 2) continue; -#if 0 - // switch TOP<-->BOTTOM - if (spriteInfo->VFlip); - // switch LEFT<-->RIGHT - if (spriteInfo->HFlip); - - { - u16 rotScaleIndex; - // index from 0 to 31 - rotScaleIndex = spriteInfo->RotScalIndex + (spriteInfo->HFlip<<1) + (spriteInfo->VFlip << 2); - rotScaleA = T1ReadWord((u8*)(gpu->oam + rotScaleIndex*0x20 + 0x06),0) ; - rotScaleB = T1ReadWord((u8*)(gpu->oam + rotScaleIndex*0x20 + 0x0E),0) ; - rotScaleC = T1ReadWord((u8*)(gpu->oam + rotScaleIndex*0x20 + 0x16),0) ; - rotScaleD = T1ReadWord((u8*)(gpu->oam + rotScaleIndex*0x20 + 0x1E),0) ; - } - - if (spriteInfo->Mode == 2) { - src = gpu->sprMem + ((spriteInfo->TileIndex)<<5) + ((y>>3)<<10); - continue; - } - - if (spriteInfo->Mode == 3) /* sprite is in BMP format */ - { - src = (gpu->sprMem) + (spriteInfo->TileIndex<<4) + (y<sprBMPBoundary); - - if (dispCnt->OBJ_BMP_2D_dim) // 256*256 - src = (gpu->sprMem) + (((spriteInfo->TileIndex&0x3F0) * 64 + (spriteInfo->TileIndex&0x0F) *8) << 1); - else // 128 * 512 - src = (gpu->sprMem) + (((spriteInfo->TileIndex&0x3E0) * 64 + (spriteInfo->TileIndex&0x1F) *8) << 1); - continue; - } - - - if(dispCnt->OBJ_Tile_mapping) - - if (spriteInfo->Depth) { - //256 colors - glColorTable(GL_TEXTURE_COLOR_TABLE_EXT, - GL_RGBA, 256, GL_RGBA, - GL_UNSIGNED_SHORT_1_5_5_5_REV, pal); - } else { - pal += (spriteInfo->PaletteIndex<<4); - glColorTable(GL_TEXTURE_COLOR_TABLE_EXT, - GL_RGBA, 16, GL_RGBA, - GL_UNSIGNED_SHORT_1_5_5_5_REV, pal); - } - glTexImage2D(GL_TEXTURE_2D, 0, COLOR_INDEX4_EXT, - 16, 16, 0, - GL_COLOR_INDEX, GL_UNSIGNED_BYTE, src); - src = gpu->sprMem + ((spriteInfo->TileIndex)<<5) + ((y>>3)<<10); - pal = (u16*)(ARM9Mem.ARM9_VMEM + 0x200 + gpu->core *0x400); -#endif - } - - int boundary = 32; - if (dispCnt->OBJ_Tile_mapping) - boundary <<= dispCnt->OBJ_Tile_mapping_Bound; - - int bmpboundary = 128; - bmpboundary <<= (dispCnt->OBJ_BMP_mapping & dispCnt->OBJ_BMP_1D_Bound); - - guint Textures[3]; - glGenTextures(3, Textures); - glBindTexture(GL_TEXTURE_2D, Textures[0]); - //proxy - glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA, - 256, 256, 0, - GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL); - - u16 * pal = (u16*)(ARM9Mem.ARM9_VMEM + 0x200 + gpu->core *0x400); - - u8 palette_16[1024][64]; - u8 palette_256[1024][64]; -// u16 tile_BMP[1024][64]; - u8 * index16 = gpu->sprMem; - u8 * index256 = gpu->sprMem; - u16 * indexBMP = gpu->sprMem; - int tile_n, index; - if (gpu->sprMem != NULL) - for (tile_n=0; tile_n<1024; tile_n++) { - for (index=0; index<64; index++) { -// tile_BMP[tile_n][index]=*indexBMP; -// indexBMP++; - palette_256[tile_n][index]=pal[*index256]; - index256++; - - if (index & 1) continue; - palette_16[tile_n][index] =pal[*index16 & 15]; - palette_16[tile_n][index+1]=pal[*index16 >> 4]; - index16++; - } - glBindTexture(GL_TEXTURE_2D, Textures[0]); - glTexSubImage2D(GL_TEXTURE_2D, 0, - (tile_n & 0x1F)<<3, (tile_n >> 5)<<3, - 8, 8, GL_RGBA, - GL_UNSIGNED_SHORT_1_5_5_5_REV, indexBMP); - } - - glBegin(GL_QUADS); - glTexCoord2f(0.0, 0.0); glVertex2d(-1.0, 1.0); - glTexCoord2f(0.0, 1.0); glVertex2d(-1.0,-1.0); - glTexCoord2f(1.0, 1.0); glVertex2d( 1.0,-1.0); - glTexCoord2f(1.0, 0.0); glVertex2d( 1.0, 1.0); - glEnd(); - - my_gl_End(screen); - glDeleteTextures(3, &Textures); -} - -#endif - #endif