void sdlgl_font_startup(void) { int i; static int text_intensities[5] = { 0, 64, 136, 208, 255 }; /* initialise text colors */ for (i=0; i < 125; i++) { int r = text_intensities[TXT_GET_R(i)]; int g = text_intensities[TXT_GET_G(i)]; int b = text_intensities[TXT_GET_B(i)]; sdlgl_text_colors[i] = RGB_MAKE(r,g,b); } /* load the font sets */ load_font(8); /* the 8x8 font is always loaded */ sdlgl_font_map = load_font(iflags.wc_fontsiz_map); sdlgl_font_text = load_font(iflags.wc_fontsiz_text); sdlgl_font_menu = load_font(iflags.wc_fontsiz_menu); sdlgl_font_message = load_font(iflags.wc_fontsiz_message); sdlgl_font_status = load_font(iflags.wc_fontsiz_status); assert(sdlgl_font_8); assert(sdlgl_font_map); assert(sdlgl_font_text && sdlgl_font_menu); assert(sdlgl_font_message && sdlgl_font_status); }
void reinstate_d3d_fog ( void ) { #ifdef _WIN32 if ( d3d_fog_enabled ) { set_d3d_int_state ( D3DRENDERSTATE_FOGENABLE, TRUE ); set_d3d_int_state ( D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_NONE ); set_d3d_int_state ( D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE ); // set_d3d_float_state ( D3DRENDERSTATE_FOGSTART, d3d_fog_start ); // set_d3d_float_state ( D3DRENDERSTATE_FOGEND, d3d_fog_end ); set_d3d_int_state ( D3DRENDERSTATE_FOGCOLOR, RGB_MAKE ( d3d_fog_colour.r, d3d_fog_colour.g, d3d_fog_colour.b ) ); } else { set_d3d_int_state ( D3DRENDERSTATE_FOGENABLE, FALSE ); } #elif defined __unix__ if ( d3d_fog_enabled ) { set_d3d_int_state ( D3DRENDERSTATE_FOGENABLE, TRUE ); set_d3d_int_state ( D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_NONE ); set_d3d_int_state ( D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE ); // set_d3d_float_state ( D3DRENDERSTATE_FOGSTART, d3d_fog_start ); // set_d3d_float_state ( D3DRENDERSTATE_FOGEND, d3d_fog_end ); set_d3d_int_state ( D3DRENDERSTATE_FOGCOLOR, RGB_MAKE ( d3d_fog_colour.r, d3d_fog_colour.g, d3d_fog_colour.b ) ); } else { set_d3d_int_state ( D3DRENDERSTATE_FOGENABLE, FALSE ); } #endif }
static void hw_draw_tile(struct TileWindow *win, int sx, int sy, int sw, int sh, tileidx_t tile, tilecol_t tilecol, tileflags_t flags, short layer) { struct TileSet *set = win->set; rgbcol_t color; int bx, by, til_idx; float tx1, ty1, tx2, ty2; float fudge = 0.1; int tw = set->tile_w + TILE_PAD; int th = set->tile_h + TILE_PAD; float tsize_w = set->tex_size_w; float tsize_h = set->tex_size_h; assert(set); assert(tile < set->tile_num); /* ignore spaces */ if (win->is_text && TILE_2_CHAR(tile) == (unsigned char)' ') return; til_idx = tile / (set->pack_w * set->pack_h); tile %= (set->pack_w * set->pack_h); bx = tile % set->pack_w; by = tile / set->pack_w; /* a little fudging to get the pixels we want */ tx1 = ((bx + 0) * tw + 1 + fudge) / tsize_w; ty1 = ((by + 0) * th + 1 + fudge) / tsize_h; tx2 = ((bx + 1) * tw - 1 - fudge) / tsize_w; ty2 = ((by + 1) * th - 1 - fudge) / tsize_h; if (flags & TILE_F_FLIPX) { float tmp = tx1; tx1 = tx2; tx2 = tmp; } if (win->is_text) color = sdlgl_text_colors[tilecol & 0xFF]; else color = RGB_MAKE(255, 255, 255); sdlgl_add_unit(set->tex_ids[til_idx], tx1, ty1, tx2, ty2, sx, sy, sw, sh, layer, color, win->see_through ? RIP_ALPHA : (flags & TILE_F_TRANS50) ? 0.5 : 1); }
void set_d3d_fog_renderstates ( void ) { if ( d3d_fog_enabled ) { set_d3d_int_state ( D3DRENDERSTATE_FOGENABLE, TRUE ); set_d3d_int_state ( D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_NONE ); set_d3d_int_state ( D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE ); // set_d3d_float_state ( D3DRENDERSTATE_FOGSTART, d3d_fog_start ); // set_d3d_float_state ( D3DRENDERSTATE_FOGEND, d3d_fog_end ); set_d3d_int_state ( D3DRENDERSTATE_FOGCOLOR, RGB_MAKE ( d3d_fog_colour.r, d3d_fog_colour.g, d3d_fog_colour.b ) ); } else { set_d3d_int_state ( D3DRENDERSTATE_FOGENABLE, FALSE ); } }
enum MENU_code fAboutMgr( void ) { int LastApplication = -1; int AppSizeCounter = 0; int freeMemoryFlash = 0; int i; long unsigned addr; unsigned long* lptr = ( unsigned long* ) CIRCLEOS_FAT_ADDRESS; // YRT20090114 tMenuItem *(( *ApplicationTable )[] ); ApplicationTable = ( tMenuItem * ((* )[] ) )( *lptr ); MENU_ClearCurrentMenu(); for ( i = 0 ; i < MAXAPP ; i++ ) { if (( *ApplicationTable )[ -i ] == APP_VOID ) //has been programmed { break; } LastApplication = i; } if ( LastApplication != -1 ) { for ( i = 0; i <= LastApplication; i++ ) { addr = ( long unsigned )( *ApplicationTable )[ -i ] ; addr &= 0xFF000000; AppSizeCounter += ( addr >> 24 ); } } // When the user pushedthe button, it's time to leave! if ( BUTTON_GetState() == BUTTON_PUSHED ) { return fQuit(); } // If screen orientation has changed, we redraw the screen! if ( MenuFirstDisplay == 0 ) { if ( LCD_GetScreenOrientation() != previous_Screen_Orientation ) { MenuFirstDisplay = 1; } } // Let's draw the 'About' screen. if ( MenuFirstDisplay ) { DRAW_SetCharMagniCoeff( 2 ); previous_Screen_Orientation = LCD_GetScreenOrientation(); DRAW_SetTextColor( RGB_BLACK ); freeMemoryFlash = 128 - 104 - AppSizeCounter; DRAW_DisplayStringWithMode( 0, 200, "STM32L Primer", ALL_SCREEN, NORMAL_TEXT, CENTER ); DRAW_DisplayStringWithMode( 0, 174, "CPU:STM32L152VB", ALL_SCREEN, NORMAL_TEXT, CENTER ); DRAW_SetCharMagniCoeff( 1 ); DRAW_DisplayString( 62, 148, "OS : V4.0 24 KB", 18 ); DRAW_DisplayString( 62, 122, "App: 2 16 KB", 18 ); DRAW_DisplayString( 62, 96, "Avail FLASH: 88 KB", 18 ); DRAW_SetTextColor( RGB_BLUE ); DRAW_DisplayString( 97, 148, UTIL_GetVersion(), 6 ); DRAW_DisplayString( 146, 148, "100", 3 ); UTIL_uint2str( TextBuffer, LastApplication + 1, 2, 0 ); DRAW_DisplayString( 97, 122, TextBuffer, 2 ); UTIL_uint2str( TextBuffer, AppSizeCounter, 3, 0 ); DRAW_DisplayString( 146, 122, TextBuffer, 3 ); UTIL_uint2str( TextBuffer, freeMemoryFlash , 3, 0 ); DRAW_DisplayString( 146, 96, TextBuffer, 3 ); DRAW_SetCharMagniCoeff( 2 ); DRAW_SetTextColor( RGB_MAKE( 0, 183, 239 ) ); DRAW_SetBGndColor( RGB_BLACK ); LCD_FillRect_Circle( 0, 0, Screen_Width, Char_Height * 2, RGB_BLACK ); DRAW_DisplayStringWithMode( 0, 0, "STM32circle.com", ALL_SCREEN, NORMAL_TEXT, CENTER ); DRAW_SetDefaultColor(); DRAW_SetCharMagniCoeff( 1 ); MenuFirstDisplay = 0; } return MENU_CONTINUE; }
#include "patchlevel.h" #if defined(GL_GRAPHICS) /* hardware only */ #define WINGL_INTERNAL #include "winGL.h" #define TILE_PAD 2 #define RIP_ALPHA 0.64 static GLuint pet_mark_id = 0; static GLuint ridden_mark_id = 0; static rgbcol_t fade_color = RGB_MAKE(0, 0, 0); void hw_rend_startup(void) { sdlgl_unit_startup(); } void hw_rend_shutdown(void) { sdlgl_unit_shutdown(); } /* ---------------------------------------------------------------- */