void GamerecTest::Draw(void){ unsigned long long totalIn=0; unsigned long long totalOut=0; unsigned long long totalMainGamePlayScores=0; unsigned long long totalMainGameWinScores=0; std::map<bufferevent*,CLIENTDATA>::iterator cmit; for(cmit=clientMap.begin();cmit!=clientMap.end();cmit++){ if(cmit->second.m_idCheckSuccess==true){ totalIn += cmit->second.clientPlayData->m_all_time_record.m_in; totalOut += cmit->second.clientPlayData->m_all_time_record.m_out; } } for(cmit=clientMap.begin();cmit!=clientMap.end();cmit++){ if(cmit->second.m_idCheckSuccess==true){ totalMainGamePlayScores += cmit->second.clientPlayData->m_all_time_record.m_totalMainGamePlayScores; totalMainGameWinScores += cmit->second.clientPlayData->m_all_time_record.m_totalMainGameWinScores; } } DrawFont(&sheet_font,256,32,32,20,font_align_center,0,GETY(87), "All Client Total In : %llu",totalIn); DrawFont(&sheet_font,256,32,32,20,font_align_center,0,GETY(119),"All Client Total Out: %llu",totalOut); DrawFont(&sheet_font,256,32,32,20,font_align_center,0,GETY(151),"All Client MainGamePlayScores : %llu",totalMainGamePlayScores); DrawFont(&sheet_font,256,32,32,20,font_align_center,0,GETY(183),"All Client MainGameWinScores: %llu",totalMainGameWinScores); }
void Test22() { int curgrp = 0; char tb[512]; printf("Use LTTT? "); int uselt = atoi(fgets(tb, 511, stdin)); LoadBCP("data.bcp"); InitWindow(); InitFont(); if(uselt) LoadLTTT("Maps\\Map_Textures\\128_4Peaks.lttt"); LoadMapTextures(); //MessageBox(hWindow, "Terrain textures loaded.", appName, 64); printf("%u groups:\n", maptexgroup.len); for(int i = 0; i < maptexgroup.len; i++) { MapTextureGroup *g = maptexgroup.getpnt(i); printf(" * %s\n", g->name); printf(" %u textures:\n", g->tex->len); for(int j = 0; j < g->tex->len; j++) printf(" - %u\n", g->tex->getpnt(j)->id); } //texture t = GetTexture("Warrior Kings Game Set\\Textures\\Tavern.pcx"); while(!appexit) { BeginDrawing(); InitRectDrawing(); //SetTexture(0, maptexgroup.getpnt(0)->tex->getpnt(0)->t); //SetTexture(0, t); //DrawRect(0, 0, 256, 256, -1); MapTextureGroup *g = maptexgroup.getpnt(curgrp); sprintf(tb, "%s (%u/%u)", g->name, curgrp, maptexgroup.len); DrawFont(0, 0, tb); for(int i = 0; i < g->tex->len; i++) { MapTexture *t = g->tex->getpnt(i); SetTexture(0, t->t); DrawRect(i * 65, 32, 64, 64, -1, t->x / 256.f, t->y / 256.f, t->w / 256.f, t->h / 256.f); sprintf(tb, "%u", t->id); DrawFont(i * 65, 96, tb); } if(keypressed[VK_LEFT]) { if(curgrp > 0) curgrp--; } if(keypressed[VK_RIGHT]) { if(curgrp < maptexgroup.len-1) curgrp++; } EndDrawing(); HandleWindow(); } }
void sys_monitor_ctrl_draw(gui_control __far * c) { INT32S s[12]; INT08S str[512]; __int i, x, y, x1, y1; x = c->real_rect.x + 1; y = c->real_rect.y + 1; x1 = c->real_rect.width + x - 2; y1 = c->real_rect.height + y - 2; if(c->flag & GUI_CTRL_FLAG_REFRESH){ sprintf(str, "System Monitor"); DrawFont(x+150, y, str, c->color, 2, DRAW_OPT_FIL_BG); y += 56; sprintf(str, "handle buf btm ptr total used remain state prio name "); DrawFont(x, y, str, c->color, 0, DRAW_OPT_FIL_BG); y += 14; sprintf(str, "------------------------------------------------------------------------------------------"); DrawFont(x, y, str, c->color, 0, DRAW_OPT_FIL_BG); y += 14; for(i=0; i<MAX_TASKS; i++){ if(TCBS[i].TcbUsed != TCB_USED_YES)continue; s[0] = (INT32S)TaskStackCheck(i, STACK_CHECK_OPT_GET_BUF); s[1] = (INT32S)TaskStackCheck(i, STACK_CHECK_OPT_GET_BTM); s[2] = (INT32S)TaskStackCheck(i, STACK_CHECK_OPT_GET_PTR); s[3] = (INT32S)TaskStackCheck(i, STACK_CHECK_OPT_TOTAL); s[4] = (INT32S)TaskStackCheck(i, STACK_CHECK_OPT_USED); s[5] = (INT32S)TaskStackCheck(i, STACK_CHECK_OPT_REMAIN); sprintf(str, " %2d %p %p %p %-6ld %-6ld %c %-6ld %s %-6d %s", i, s[0], s[1], s[2], s[3], s[4], ((s[5]<32L)?'*':' '), s[5], ((TCBS[i].TaskState==0)?" ":"SLEEP"), TCBS[i].Priority, TCBS[i].TaskName);/*lint !e559 !e622*/ DrawFont(x, y, str, c->color, 0, DRAW_OPT_FIL_BG); y += 14; } if(1){ char aaa[32]; sprintf(aaa, "CPU使用率: %3d%%", CPU_USED); DrawFont(x, y, aaa, 0, 0, DRAW_OPT_FIL_BG); } y+=14; sprintf(str, "tasks: %-4d free-memory: %-8ld switches: %-8ld seconds-from-start: %ld", NumberOfTasks, get_free_mem(), TaskSwitches, SecondsFromStart); DrawFont(x, y, str, c->color, 0, DRAW_OPT_FIL_BG); y += 14; sprintf(str, "------------------------------------------------------------------------------------------"); DrawFont(x, y, str, c->color, 0, DRAW_OPT_FIL_BG); y += 24; sprintf(str, "FamesOS "FamesOS_VersionString); DrawFont(x, y, str, 68, 2, DRAW_OPT_FIL_BG); y += 50; sprintf(str, "我是中国人,hello, I am a chinese!"); DrawFont(x, y, str, 98, 1, DRAW_OPT_FIL_BG); DrawFont(x, y+16, str, 98, 0, DRAW_OPT_FIL_BG); y += 50; } }
//レイヤーウィンドウプロシージャ LRESULT __stdcall LayerWndProc(HWND WindowHandle,UINT Message,WPARAM WParam,LPARAM LParam) { switch (Message){ case WM_PAINT: { PAINTSTRUCT PaintStruct; BeginPaint(WindowHandle,&PaintStruct); std::unique_ptr<Gdiplus::Font> DrawFont(new Gdiplus::Font(L"Tahoma",8)); std::unique_ptr<Gdiplus::SolidBrush> WhiteBrush(new Gdiplus::SolidBrush(Gdiplus::Color::White)),BlackBrush(new Gdiplus::SolidBrush(Gdiplus::Color::Black)); std::unique_ptr<Gdiplus::Graphics> LayerWindowGraphics(new Gdiplus::Graphics(WindowHandle)); std::unique_ptr<Gdiplus::StringFormat> Layout(new Gdiplus::StringFormat(Gdiplus::StringFormatFlagsNoWrap)); Layout->SetAlignment(Gdiplus::StringAlignment::StringAlignmentFar); Layout->SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentFar); Layout->SetTrimming(Gdiplus::StringTrimmingNone); RECT ClientRect; GetClientRect(WindowHandle,&ClientRect); Gdiplus::RectF LayoutRect(ClientRect.left,ClientRect.top,ClientRect.right-5,ClientRect.bottom-5); std::vector<wchar_t> WindowSize(64,0); _itow(ClientRect.right,WindowSize.data(),10); auto Null=std::find(WindowSize.begin(),WindowSize.end(),0); *Null++=L'\n'; _itow(ClientRect.bottom,Null._Ptr,10); int Count=std::wcslen(WindowSize.data()); LayerWindowGraphics->DrawString(WindowSize.data(),Count,&*DrawFont,LayoutRect,&*Layout,&*BlackBrush); LayoutRect.Inflate(-1,-1); LayerWindowGraphics->DrawString(WindowSize.data(),Count,&*DrawFont,LayoutRect,&*Layout,&*WhiteBrush); EndPaint(WindowHandle,&PaintStruct); break; } default: return DefWindowProc(WindowHandle,Message,WParam,LParam); } return 0; }
void CListBox::OnDraw(const SRect &rUpdate) { if (mpDrawPrimitives == NULL) { mpDrawPrimitives = IDrawPrimitives::Create(); mpDrawPrimitives->Init(GetParentWindow()); } SRect rctDraw(GetPos(), SSize(GetSize().iCX, 10)); tint32 iIndex = 0; std::list<std::string>::const_iterator it = mTexts.begin(); for (; it != mTexts.end(); it++, iIndex++) { const std::string& sText = *it; DrawFont(dynamic_cast<IFontResource*>(GetBitmapResource()), rUpdate, rctDraw, (const tchar*)(sText.c_str())); if (iIndex == miDragIndex) { SRect rctInvert(rctDraw); rctInvert.iY -= 2; rctInvert.iCY += 4; mpDrawPrimitives->InvertRect(rUpdate, rctInvert); } rctDraw.iY += 14; } } // OnDraw
static void TestDoVCOM(void) { int i; DrawFont(); for(i=0; i<10; i++) { SHM1_ToggleVCOM(); /* toggle VCOM with 1 Hz */ WAIT1_Waitms(1000); } }
void Menu::Render() { if (!GetIsAvaible())return; PlayMusic(Scene::m_Sound->GetPointerToMusic("ambient")); if (System::CheckPosition(m_MenuInfo["NEW_GAME"])) DrawFont(GetFont("pacman"), m_MenuInfo["NEW_GAME"].x, m_MenuInfo["NEW_GAME"].y, "New Game", Font::shaded, color1, color2, 0.0, SDL_FLIP_NONE, true); else DrawFont(GetFont("pacman"), m_MenuInfo["NEW_GAME"].x, m_MenuInfo["NEW_GAME"].y, "New Game", Font::blended, color1, color2, 0.0, SDL_FLIP_NONE, true); if (System::CheckPosition(m_MenuInfo["CONTINUE"])) { DrawFont(GetFont("pacman"), m_MenuInfo["CONTINUE"].x, m_MenuInfo["CONTINUE"].y, "Continue", Font::shaded, color1, color2, 0.0, SDL_FLIP_NONE, true); if (m_Mouse->operator[]("left")) Switch(nextScene); } else DrawFont(GetFont("pacman"), m_MenuInfo["CONTINUE"].x, m_MenuInfo["CONTINUE"].y, "Continue", Font::blended, color1, color2, 0.0, SDL_FLIP_NONE, true); if (System::CheckPosition(m_MenuInfo["QUIT"])) { DrawFont(GetFont("pacman"), m_MenuInfo["QUIT"].x, m_MenuInfo["QUIT"].y, "Quit", Font::shaded, color1, color2, 0.0, SDL_FLIP_NONE, true); if (m_Mouse->operator[]("left")) *Scene::m_Running = false; } else DrawFont(GetFont("pacman"), m_MenuInfo["QUIT"].x, m_MenuInfo["QUIT"].y, "Quit", Font::blended, color1, color2, 0.0, SDL_FLIP_NONE, true); }
void CBrowser::DrawItems(const SRect RectUpdate, const std::list<SItem*>& Items, SPos& Pos) { SSize SizeBitmap; mpArrow->GetRealSize(SizeBitmap); tint32 iNrOfItems = Items.size(); std::list<SItem*>::const_iterator it = Items.begin(); tint32 iItem; for (iItem = 0; iItem < iNrOfItems; iItem++, it++) { SItem* pItem = *it; if (pItem->bFolder) { // Item is folder DrawBitmapFrame(mpArrow, RectUpdate, SRect(Pos, SizeBitmap), pItem->bFolderIsOpen ? 1 : 0, 2); } SPos PosText = Pos + mTextPosition; SSize SizeText; SizeText.iCY = mpFont->GetTextHeight(); SizeText.iCX = mpFont->GetTextWidth((tchar*)(pItem->sNameModified.c_str())); DrawFont(mpFont, RectUpdate, SRect(PosText, SizeText), (const tchar*)(pItem->sNameModified.c_str())); if (pItem == mpItemSelected) { // This is the selected item SRect RectInvert(GetPos(), SizeText); RectInvert.iY = PosText.iY - 1; RectInvert.iCY += 1; RectInvert.iCX = GetSize().iCX; mpPrimitives->InvertRect(RectUpdate, RectInvert); } Pos.iY += miSpaceBetweenItems; if (pItem->bFolder) { if (pItem->bFolderIsOpen) { tint iX = Pos.iX; Pos.iX += miSpaceBetweenFolders; DrawItems(RectUpdate, pItem->SubItems, Pos); Pos.iX = iX; } } } }
void FontGen::Go() { // Starts genereting the font stuff PrepareFont(); PrepareBitmap(); PrepareHeader(); DrawFont(); if (!cppFormat) { SaveTarga(); SaveFontdef(); } else { SaveCpp(); } }
static void Test(void) { DrawFont(); DrawLines(); DrawRectangles(); DrawBoxes(); }
void ClientConnectStatusDraw::Draw(void){ //Draw Line DrawLine(0, 0, 1023, 0, 2,COLOR(1.0f,1.0f,1.0f,1.0f)); DrawLine(0,GETY(50), 1023, GETY(50),2,COLOR(1.0f,1.0f,1.0f,1.0f)); DrawLine(0,GETY(526),1023,GETY(526),2,COLOR(1.0f,1.0f,1.0f,1.0f)); DrawLine(0,GETY(574),1023,GETY(574),2,COLOR(1.0f,1.0f,1.0f,1.0f)); DrawLine(0, 0, 0,GETY(575),2,COLOR(1.0f,1.0f,1.0f,1.0f)); DrawLine(1023, 0, 1023,GETY(575),2,COLOR(1.0f,1.0f,1.0f,1.0f)); for(unsigned int i=0,x=102; i<9; i++,x+=102){ DrawLine(x, 0,x,GETY(50), 2,COLOR(1.0f,1.0f,1.0f,1.0f)); DrawLine(x,GETY(526),x,GETY(575),2,COLOR(1.0f,1.0f,1.0f,1.0f)); } //Draw Dark Number sheet_font.SetColor(COLOR(0.5f,0.5f,0.5f,1.0f)); //1~10 for(unsigned int i=1,x=(102-32)/2; i<=10; i++,x+=102){ DrawFont(&sheet_font,256,32,32,20,font_align_none,i<10 ? x : x-8,GETY(9), "%d",i); } //11~20 for(unsigned int i=11,x=(102-32)/2; i<=20; i++,x+=102){ DrawFont(&sheet_font,256,32,32,20,font_align_none,x-8,GETY(535),"%d",i); } //Draw Connecting Number sheet_font.SetColor(COLOR(0.0f,1.0f,0.0f,1.0f)); //1~10 std::map<bufferevent*,CLIENTDATA>::iterator cmit; for(unsigned int i=1,x=(102-32)/2; i<=10; i++,x+=102){ for(cmit=clientMap.begin();cmit!=clientMap.end();cmit++){ if(cmit->second.client_id == i){ DrawFont(&sheet_font,256,32,32,20,font_align_none,i<10 ? x : x-8,GETY(9), "%d",i); } } } //11~20 for(unsigned int i=11,x=(102-32)/2; i<=20; i++,x+=102){ for(cmit=clientMap.begin();cmit!=clientMap.end();cmit++){ if(cmit->second.client_id == i){ DrawFont(&sheet_font,256,32,32,20,font_align_none,x-8,GETY(535),"%d",i); } } } sheet_font.SetColor(COLOR(1.0f,1.0f,1.0f,1.0f)); // ServerClientIDChecker* serverIDChecker = (ServerClientIDChecker*)this->GetTask(tid_ServerClientIDChecker,0); assert(serverIDChecker != NULL); DrawFont(&sheet_font,256,32,32,20,font_align_center,0,GETY(55),"Have %d(%d) clients",clientMap.size(),serverIDChecker->GetIDOKClientCount()); unsigned long long totalIn = 0, sectionIn = 0; unsigned long long totalOut = 0, sectionOut = 0; unsigned long long totalMainGamePlayScores = 0, sectionMainGamePlayScores = 0; unsigned long long totalMainGameWinScores = 0, sectionMainGameWinScores = 0; std::map<bufferevent*, CLIENTDATA>::iterator clientIterator; for (clientIterator = clientMap.begin(); clientIterator != clientMap.end(); clientIterator++) { if (clientIterator->second.PassedValidationOrNot() == true) { totalIn += clientIterator->second.clientPlayData->m_all_time_record.m_coinIn + clientIterator->second.clientPlayData->m_all_time_record.m_keyIn; totalOut += clientIterator->second.clientPlayData->m_all_time_record.m_coinOut + clientIterator->second.clientPlayData->m_all_time_record.m_keyOut; totalMainGamePlayScores += clientIterator->second.clientPlayData->m_all_time_record.m_totalMainGamePlayScores; totalMainGameWinScores += clientIterator->second.clientPlayData->m_all_time_record.m_totalMainGameWinScores; sectionIn += clientIterator->second.clientPlayData->m_section_record.m_coinIn + clientIterator->second.clientPlayData->m_section_record.m_keyIn; sectionOut += clientIterator->second.clientPlayData->m_section_record.m_coinOut + clientIterator->second.clientPlayData->m_section_record.m_keyOut; sectionMainGamePlayScores += clientIterator->second.clientPlayData->m_section_record.m_totalMainGamePlayScores; sectionMainGameWinScores += clientIterator->second.clientPlayData->m_section_record.m_totalMainGameWinScores; } } DrawFont(&sheet_font, 256, 32, 32, 20, font_align_center, 0, GETY(87), "All Client Total In : %llu", totalIn); DrawFont(&sheet_font, 256, 32, 32, 20, font_align_center, 0, GETY(119), "All Client Total Out: %llu", totalOut); DrawFont(&sheet_font, 256, 32, 32, 20, font_align_center, 0, GETY(151), "All Client MainGamePlayScores : %llu", totalMainGamePlayScores); DrawFont(&sheet_font, 256, 32, 32, 20, font_align_center, 0, GETY(183), "All Client MainGameWinScores: %llu", totalMainGameWinScores); DrawFont(&sheet_font, 256, 32, 32, 20, font_align_center, 0, GETY(215), "Section Client Total In : %llu", sectionIn); DrawFont(&sheet_font, 256, 32, 32, 20, font_align_center, 0, GETY(247), "Section Client Total Out: %llu", sectionOut); DrawFont(&sheet_font, 256, 32, 32, 20, font_align_center, 0, GETY(279), "Section Client MainGamePlayScores : %llu", sectionMainGamePlayScores); DrawFont(&sheet_font, 256, 32, 32, 20, font_align_center, 0, GETY(311), "Section Client MainGameWinScores: %llu", sectionMainGameWinScores); // ServerMainProcess* mproc = (ServerMainProcess*)this->GetTask(tid_ServerMainProcess,0); //Draw Present JACKPOT Values //JACKPOT 1 DrawFont(&sheet_font,256,32,32,20,font_align_center,0,GETY(430),"JP1: %d",mproc->getMainProcess()->m_jackpot1Value); //JACKPOT 2 DrawFont(&sheet_font,256,32,32,20,font_align_center,0,GETY(462),"JP2: %d",mproc->getMainProcess()->m_jackpot2Value); //JACKPOT 3 DrawFont(&sheet_font,256,32,32,20,font_align_center,0,GETY(494),"JP3: %d",mproc->getMainProcess()->m_jackpot3Value); }