From: <at...@us...> - 2007-11-15 18:21:35
|
Revision: 546 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=546&view=rev Author: atani Date: 2007-11-15 10:21:33 -0800 (Thu, 15 Nov 2007) Log Message: ----------- removed debug_console bits, moved ascii_font init bit into SubConsole constructor, made CXXFLAGS consume existing flags for NDS builds (allows projects to specify them in the calling makefile) Modified Paths: -------------- tiki/include/Tiki/drawables/console.h tiki/nds/Makefile.rules tiki/nds/src/init_shutdown.cpp tiki/src/gl/drawables/console.cpp Modified: tiki/include/Tiki/drawables/console.h =================================================================== --- tiki/include/Tiki/drawables/console.h 2007-11-14 00:50:31 UTC (rev 545) +++ tiki/include/Tiki/drawables/console.h 2007-11-15 18:21:33 UTC (rev 546) @@ -72,9 +72,7 @@ } void disable(int code) { - if(m_features & code) { - m_features ^= code; - } + m_features &= ~code; } int getFeatures() { Modified: tiki/nds/Makefile.rules =================================================================== --- tiki/nds/Makefile.rules 2007-11-14 00:50:31 UTC (rev 545) +++ tiki/nds/Makefile.rules 2007-11-15 18:21:33 UTC (rev 546) @@ -17,7 +17,7 @@ TIKI_BASE_LIBS=-ltiki -L$(DEVKITPRO)/libnds/lib -ldswifi9 -lfat -lnds9 -CXXFLAGS=-I$(DEVKITPRO)/libnds/include +CXXFLAGS+=-I$(DEVKITPRO)/libnds/include CXXFLAGS+=-I$(TIKI_DIR)/include CXXFLAGS+=-I$(TIKI_DIR)/nds/include -g CXXFLAGS+=-I$(TIKI_DIR)/3rdparty/zlib Modified: tiki/nds/src/init_shutdown.cpp =================================================================== --- tiki/nds/src/init_shutdown.cpp 2007-11-14 00:50:31 UTC (rev 545) +++ tiki/nds/src/init_shutdown.cpp 2007-11-15 18:21:33 UTC (rev 546) @@ -24,10 +24,6 @@ SendCommandToArm7( 0x87654321 ); } -Tiki::GL::NDSSubScreenConsole *debug_console = NULL; -extern const u8 ascii_font_bin[]; -extern const u32 ascii_font_bin_size; - namespace Tiki { bool init( int argc, char **argv ) { @@ -38,14 +34,6 @@ if(g_tiki_init_flags & TIKI_INIT_DEBUG_CONSOLE) { consoleDemoInit(); - /* - videoSetModeSub( MODE_0_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG1_ACTIVE ); - SUB_BG0_CR = BG_64x32 | BG_COLOR_16 | BG_MAP_BASE( 0 ) | BG_TILE_BASE( 1 ); - SUB_BG1_CR = BG_64x32 | BG_COLOR_16 | BG_MAP_BASE( 2 ) | BG_TILE_BASE( 1 ); - vramSetBankC( VRAM_C_SUB_BG ); - memcpy( ( void * )BG_TILE_RAM_SUB( 1 ), ascii_font_bin, ascii_font_bin_size ); - debug_console = new Tiki::GL::NDSSubScreenConsole( 32, 24 ); - */ } // Setup the Main screen for 3D Modified: tiki/src/gl/drawables/console.cpp =================================================================== --- tiki/src/gl/drawables/console.cpp 2007-11-14 00:50:31 UTC (rev 545) +++ tiki/src/gl/drawables/console.cpp 2007-11-15 18:21:33 UTC (rev 546) @@ -38,12 +38,13 @@ m_charData.resize( rows * cols, 0 ); m_colorData.resize( rows * cols, 0 ); - m_texture->select(); - + if(m_texture != NULL) { + m_texture->select(); #if TIKI_PLAT != TIKI_DC && TIKI_PLAT != TIKI_NDS - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); #endif + } m_cursor_x = 0; m_cursor_y = 0; @@ -527,7 +528,17 @@ #if TIKI_PLAT == TIKI_NDS -NDSSubScreenConsole::NDSSubScreenConsole(int cols, int rows) : Console(cols, rows, NULL) { + +extern const u8 ascii_font_bin[]; +extern const u32 ascii_font_bin_size; + +NDSSubScreenConsole::NDSSubScreenConsole(int cols, int rows) : Console(cols, rows, NULL) { + videoSetModeSub( MODE_0_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG1_ACTIVE ); + SUB_BG0_CR = BG_64x32 | BG_COLOR_16 | BG_MAP_BASE( 0 ) | BG_TILE_BASE( 1 ); + SUB_BG1_CR = BG_64x32 | BG_COLOR_16 | BG_MAP_BASE( 2 ) | BG_TILE_BASE( 1 ); + vramSetBankC( VRAM_C_SUB_BG ); + dmaCopy( ( uint16 * )BG_TILE_RAM_SUB( 1 ), (uint16 *)ascii_font_bin, ascii_font_bin_size ); + BG_PALETTE_SUB[ ( 16 * 0 ) + 1 ] = RGB15( 0, 0, 0 ); BG_PALETTE_SUB[ ( 16 * 1 ) + 1 ] = RGB15( 0, 0, 15 ); BG_PALETTE_SUB[ ( 16 * 2 ) + 1 ] = RGB15( 0, 15, 0 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |