void cPopMenu::drawItems() { // Ñ»·»æÖÆitemÎÄ×Ö£¬Óö¼û selected ÎÄ×Ö¾ÍÏÈ»æÖÆÑ¡ÔñÌõ for( size_t i = 0; i < _items.size(); ++i ) { s16 itemX = _position.x + _itemTopLeftPoint.x; s16 itemY = _position.y + i * _itemHeight + _itemTopLeftPoint.y; if( _selectedItemIndex == (s16)i ) { s16 barX = _position.x + _barLeft; s16 barY = itemY - 2; gdi().setPenColor( _barColor, _engine ); gdi().fillRect( _barColor, _barColor, barX, barY, barWidth(), _itemHeight, _engine ); gdi().setPenColor( _textHighLightColor, _engine ); } else { gdi().setPenColor( _textColor, _engine ); } gdi().textOut( itemX, itemY, _items[i].c_str(), _engine ); } }
u32 cForm::doModal() { windowManager().addWindow( this ); show(); do { // manually update system loop timer().updateFps(); INPUT & inputs = updateInput(); processInput( inputs ); windowManager().update(); gdi().present( GE_MAIN ); //dbg_printf( "modal window looping\n" ); } while( modalRet() == (u32 )-1 ); windowManager().removeWindow( this ); return modalRet(); }
void cFileIcons::Draw(s32 idx,u8 x,u8 y,GRAPHICS_ENGINE engine) { gdi().maskBlt(_icons[idx].Icon().buffer(),x,y,32,32,engine); }
Disc* load_gdi(const char* file) { u32 iso_tc; Disc* disc = new Disc(); //memset(&gdi_toc,0xFFFFFFFF,sizeof(gdi_toc)); //memset(&gdi_ses,0xFFFFFFFF,sizeof(gdi_ses)); core_file* t=core_fopen(file); if (!t) return 0; size_t gdi_len = core_fsize(t); char gdi_data[8193] = { 0 }; if (gdi_len >= sizeof(gdi_data)) { core_fclose(t); return 0; } core_fread(t, gdi_data, gdi_len); core_fclose(t); istringstream gdi(gdi_data); gdi >> iso_tc; printf("\nGDI : %d tracks\n",iso_tc); char path[512]; strcpy(path,file); size_t len=strlen(file); while (len>2) { if (path[len]=='\\' || path[len]=='/') break; len--; } len++; char* pathptr=&path[len]; u32 TRACK=0,FADS=0,CTRL=0,SSIZE=0; s32 OFFSET=0; for (u32 i=0;i<iso_tc;i++) { string track_filename; //TRACK FADS CTRL SSIZE file OFFSET gdi >> TRACK; gdi >> FADS; gdi >> CTRL; gdi >> SSIZE; char last; do { gdi >> last; } while (isspace(last)); if (last == '"') { gdi >> std::noskipws; for(;;) { gdi >> last; if (last == '"') break; track_filename += last; } gdi >> std::skipws; } else {