void DoSlime(void) { long frameOld; pPicture=pAlloc(32768L + 16L); pAPicture=_pAlignPara(pPicture); pSlimeTable=pAlloc(MAXTRIG * sizeof(long) + 16L); pASlimeTable=_pAlignPara(pSlimeTable); pPalette=pAlloc(768); pTempPal=pAlloc(768); pTrig=pAlloc(MAXTRIG * sizeof(long)); pLoadFile("slime.bin", pAPicture, 32768L); pLoadFile("slime.tab", pASlimeTable, MAXTRIG * sizeof(long)); pLoadFile("slime.pal", pPalette, 768); pLoadFile("slime.trg", pTrig, MAXTRIG * sizeof(long)); FadePalFromBlack(pTempPal, pPalette, 0); RemapPal(pTempPal, 0, 256); tmrSyncScr(tmrSync200, preVR, NULL, inVR); frameCount=0; frameWaitOne(); while(pos != 255) { frameOld=frameCount; DrawPic(StartX, StartY, dX, dY, (ZoomSide) ? Zoom : -Zoom); while(frameCount == frameOld); } frameCount=0; while(frameCount < 128) { frameOld=frameCount; FadePalFromBlack(pTempPal, pPalette, 64 - (frameOld >> 1)); RemapPal(pTempPal, 0, 256); DrawPic(StartX, StartY, dX, dY, (ZoomSide) ? Zoom : -Zoom); while(frameCount == frameOld); } FadePalFromBlack(pTempPal, pPalette, 0); RemapPal(pTempPal, 0, 256); tmrSyncScr(tmrSync200, preVR, NULL, NULL); Free(pPicture); Free(pPalette); Free(pTrig); Free(pSlimeTable); }
void CDlgCfgUserMgr::ReadData() { stdex::tString str ; //控制台登录密码 consolepwd_ = i8desk::GetDataMgr().GetOptVal(OPT_U_CTLPWD,str).c_str(); //授权期限 dateend_ = i8desk::GetDataMgr().GetOptVal(OPT_U_DATEEND,str).c_str(); dateend_ += _T(" ") ; dateend_ += i8desk::GetDataMgr().GetOptVal(OPT_U_USERTYPE,str).c_str(); //上级ID bindid_ = i8desk::GetDataMgr().GetOptVal(OPT_U_OEMID,str).c_str(); //网吧名称 netname_ = i8desk::GetDataMgr().GetOptVal(OPT_U_NBNAME,str).c_str(); //网吧ID netid_ = i8desk::GetDataMgr().GetOptVal(OPT_U_NID,str).c_str(); //网吧所在省市 /*addr_ = i8desk::GetDataMgr().GetOptVal(OPT_U_PROVINCE,str).c_str(); addr_ += _T(" ");*/ addr_ = i8desk::GetDataMgr().GetOptVal(OPT_U_CITY,str).c_str(); //网吧地址 address_ = i8desk::GetDataMgr().GetOptVal(OPT_U_NBADDRESS,str).c_str(); //网吧电话 telephone_ = i8desk::GetDataMgr().GetOptVal(OPT_U_NBPHONE,str).c_str(); //网吧手机 mobile_ = i8desk::GetDataMgr().GetOptVal(OPT_U_NBMOBILE,str).c_str(); //上级名称 bindname_ = i8desk::GetDataMgr().GetOptVal(OPT_U_OEMNAME,str).c_str(); // 磁盘类型 int diskType = 0; diskType = i8desk::GetDataMgr().GetOptVal(OPT_M_DISKTYPE, diskType); disktype_ = i8desk::business::config::GetDiskNameByType(diskType).c_str(); // 网络状态 int netStatus = 0; netStatus = i8desk::GetDataMgr().GetOptVal(OPT_M_BROADBANDTYPE, netStatus); netstatus_ = i8desk::business::config::GetNetworkByType(netStatus).c_str(); // 无盘名称 disklessname_ = i8desk::GetDataMgr().GetOptVal(OPT_M_DISKPRODUCTNAME,str).c_str(); // 计费软件名称 feesname_ = i8desk::GetDataMgr().GetOptVal(OPT_M_FEEPRODUCTNAME,str).c_str(); // 安全监控软件名称 monitorname_= i8desk::GetDataMgr().GetOptVal(OPT_M_CULTURALNAME,str).c_str(); //网吧图片路径 str = _T(""); textNetbarJpg_ = i8desk::GetDataMgr().GetOptVal(OPT_M_NETBARJPG, str).c_str(); if(!textNetbarJpg_.IsEmpty()) DrawPic((LPCTSTR)textNetbarJpg_, wndNetBarPic_); UpdateData(FALSE); }
void F_Drawer(void) { switch(FinaleStage) { case 0: // Fade in initial finale screen DrawPic(); break; case 1: case 2: TextWrite(); break; case 3: // Fade screen out DrawPic(); break; case 4: // Fade in chess screen DrawPic(); break; case 5: TextWrite(); break; } UpdateState |= I_FULLSCRN; }
void CcontrolClientDlg::OnBnClickedButton2() { // TODO: Add your control notification handler code here CFileDialog dlg(TRUE, //TRUE为OPEN对话框,FALSE为SAVE AS对话框 NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, (LPCTSTR)_TEXT("JPG Files (*.jpg)|*.jpg|All Files (*.*)|*.*||"), NULL); if(dlg.DoModal()==IDOK) { FilePathName=dlg.GetPathName(); //文件名保存在了FilePathName里 } else { return; } DrawPic(FilePathName); }
/////////////////// // Process & Draw the speech bubble void Dnr_SpeechProcess(void) { glColor4f(1,1,1,1); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); DrawPic( psDnrSpeech, 144, 500 ); int size = 16; Font_SetSize(size); int length = strlen( szDnrSpeech ) * size; Font_Draw( 400 - length/2, 445, CVec(0,0,0), szDnrSpeech ); if( (System_GetMouse()->Up & SDL_BUTTON(1)) || System_GetKeyboard()->KeyUp[SDLK_ESCAPE] ) { psDiner->bSpeechBubble = false; // If we have an offer, lets go! if(psDiner->bGoodOffer) { Dnr_LetsGo(); return; } } }
void CDlgCfgUserMgr::OnBnClickedNetbarJpg() { UpdateData(TRUE); if( textNetbarJpg_.Right(1) == _T("\\") ) textNetbarJpg_.Delete(textNetbarJpg_.GetLength() - 1); CFileDialog fileDlg(TRUE, _T(""), _T(""), 4|2, _T("所有文件(*.*)|*.*||")); CString fileName; fileDlg.m_ofn.lpstrInitialDir = textNetbarJpg_; if( fileDlg.DoModal() == IDOK ) fileName = fileDlg.GetPathName(); else return; textNetbarJpg_ = fileName; if(!textNetbarJpg_.IsEmpty()) DrawPic((LPCTSTR)textNetbarJpg_, wndNetBarPic_); UpdateData(FALSE); }
void Display(int index, int xc, int yc, int key) { char s[128]; int y = 5; int i; SetSecondaryMouseRects(NULL); memset(GetDstScreen(), 58, 64000); sprintf(s, "Key: 0x%x", key); TextStringAt(270, 190, s); DisplayText(25, y, campaign.title, yc == YC_CAMPAIGNTITLE && xc == XC_CAMPAIGNTITLE, 1); if (fileChanged) DrawTPic(10, y, gPics[221], NULL); if (currentMission) { sprintf(s, "Mission %d/%d", index + 1, campaign.missionCount); DisplayText(270, y, s, yc == YC_MISSIONINDEX, 0); y += TextHeight() + 3; DisplayText(25, y, currentMission->title, yc == YC_MISSIONTITLE && xc == XC_MISSIONTITLE, 1); y += TextHeight() + 2; sprintf(s, "Width: %d", currentMission->mapWidth); DisplayText(20, y, s, yc == YC_MISSIONPROPS && xc == XC_WIDTH, 0); sprintf(s, "Height: %d", currentMission->mapHeight); DisplayText(60, y, s, yc == YC_MISSIONPROPS && xc == XC_HEIGHT, 0); sprintf(s, "Walls: %d", currentMission->wallCount); DisplayText(100, y, s, yc == YC_MISSIONPROPS && xc == XC_WALLCOUNT, 0); sprintf(s, "Len: %d", currentMission->wallLength); DisplayText(140, y, s, yc == YC_MISSIONPROPS && xc == XC_WALLLENGTH, 0); sprintf(s, "Rooms: %d", currentMission->roomCount); DisplayText(180, y, s, yc == YC_MISSIONPROPS && xc == XC_ROOMCOUNT, 0); sprintf(s, "Sqr: %d", currentMission->squareCount); DisplayText(220, y, s, yc == YC_MISSIONPROPS && xc == XC_SQRCOUNT, 0); sprintf(s, "Dens: %d", currentMission->baddieDensity); DisplayText(260, y, s, yc == YC_MISSIONPROPS && xc == XC_DENSITY, 0); y += TextHeight(); DisplayText(20, y, "Wall", yc == YC_MISSIONLOOKS && xc == XC_WALL, 0); DisplayText(50, y, "Floor", yc == YC_MISSIONLOOKS && xc == XC_FLOOR, 0); DisplayText(80, y, "Rooms", yc == YC_MISSIONLOOKS && xc == XC_ROOM, 0); DisplayText(110, y, "Doors", yc == YC_MISSIONLOOKS && xc == XC_DOORS, 0); DisplayText(140, y, "Keys", yc == YC_MISSIONLOOKS && xc == XC_KEYS, 0); DisplayText(170, y, "Exit", yc == YC_MISSIONLOOKS && xc == XC_EXIT, 0); sprintf(s, "Walls: %s", RangeName(currentMission->wallRange)); DisplayText(200, y, s, yc == YC_MISSIONLOOKS && xc == XC_COLOR1, 0); sprintf(s, "Floor: %s", RangeName(currentMission->floorRange)); DisplayText(200, y + TH, s, yc == YC_MISSIONLOOKS && xc == XC_COLOR2, 0); sprintf(s, "Rooms: %s", RangeName(currentMission->roomRange)); DisplayText(200, y + 2 * TH, s, yc == YC_MISSIONLOOKS && xc == XC_COLOR3, 0); sprintf(s, "Extra: %s", RangeName(currentMission->altRange)); DisplayText(200, y + 3 * TH, s, yc == YC_MISSIONLOOKS && xc == XC_COLOR4, 0); DrawPic(20, y + TH, gPics[cWallPics [currentMission->wallStyle % WALL_COUNT][WALL_SINGLE]], NULL); DrawPic(50, y + TH, gPics[cFloorPics [currentMission->floorStyle % FLOOR_COUNT][FLOOR_NORMAL]], NULL); DrawPic(80, y + TH, gPics[cRoomPics [currentMission->roomStyle % ROOMFLOOR_COUNT][ROOMFLOOR_NORMAL]], NULL); DrawPic(110, y + TH, gPics[cGeneralPics[gMission.doorPics[0].horzPic]. picIndex], NULL); DrawTPic(140, y + TH, gPics[cGeneralPics[gMission.keyPics[0]].picIndex], NULL); DrawPic(170, y + TH, gPics[gMission.exitPic], NULL); y += TH + 25; DisplayText(20, y, "Mission description", yc == YC_MISSIONDESC, 0); y += TextHeight(); sprintf(s, "Characters (%d/%d)", currentMission->baddieCount, BADDIE_MAX); DisplayText(20, y, s, yc == YC_CHARACTERS, 0); y += TextHeight(); sprintf(s, "Mission objective characters (%d/%d)", currentMission->specialCount, SPECIAL_MAX); DisplayText(20, y, s, yc == YC_SPECIALS, 0); y += TextHeight(); sprintf(s, "Available weapons (%d/%d)", gMission.weaponCount, WEAPON_MAX); DisplayText(20, y, s, yc == YC_WEAPONS, 0); y += TextHeight(); sprintf(s, "Map items (%d/%d)", gMission.objectCount, ITEMS_MAX); DisplayText(20, y, s, yc == YC_ITEMS, 0); y += TextHeight() + 2; if (currentMission->objectiveCount) { for (i = 0; i < currentMission->objectiveCount; i++) { DisplayText(20, y, currentMission->objectives[i]. description, yc - YC_OBJECTIVES == i, 1); y += TextHeight(); } } else DisplayText(20, y, "-- mission objectives --", yc == YC_OBJECTIVES, 0); } else if (campaign.missionCount) { sprintf(s, "End/%d", campaign.missionCount); DisplayText(270, y, s, yc == YC_MISSIONINDEX, 0); } y = 170; switch (yc) { case YC_CAMPAIGNTITLE: DisplayText(20, 150, campaign.author, yc == YC_CAMPAIGNTITLE && xc == XC_AUTHOR, 1); MissionDescription(150 + TH, campaign.description, yc == YC_CAMPAIGNTITLE && xc == XC_CAMPAIGNDESC); SetSecondaryMouseRects(localCampaignClicks); break; case YC_MISSIONTITLE: DisplayText(20, 150, currentMission->song, yc == YC_MISSIONTITLE && xc == XC_MUSICFILE, 1); SetSecondaryMouseRects(localMissionClicks); break; case YC_MISSIONDESC: MissionDescription(150, currentMission->description, yc == YC_MISSIONDESC); break; case YC_CHARACTERS: TextStringAt(5, 190, "Use Insert, Delete and PageUp/PageDown"); if (!currentMission) break; for (i = 0; i < currentMission->baddieCount; i++) DisplayCharacter(20 + 20 * i, y, CHARACTER_OTHERS + i, xc == i); SetSecondaryMouseRects(localCharacterClicks); break; case YC_SPECIALS: TextStringAt(5, 190, "Use Insert, Delete and PageUp/PageDown"); if (!currentMission) break; for (i = 0; i < currentMission->specialCount; i++) DisplayCharacter(20 + 20 * i, y, CHARACTER_OTHERS + currentMission->baddieCount + i, xc == i); SetSecondaryMouseRects(localCharacterClicks); break; case YC_ITEMS: TextStringAt(5, 190, "Use Insert, Delete and PageUp/PageDown"); if (!currentMission) break; for (i = 0; i < currentMission->itemCount; i++) DisplayMapItem(10 + 20 * i, y, gMission.mapObjects[i], currentMission->itemDensity[i], xc == i); break; case YC_WEAPONS: if (!currentMission) break; ListWeapons(150, xc); break; default: if (currentMission && yc >= YC_OBJECTIVES && yc - YC_OBJECTIVES < currentMission->objectiveCount) { TextStringAt(5, 190, "Use Insert, Delete and PageUp/PageDown"); DrawObjectiveInfo(yc - YC_OBJECTIVES, y, xc); } break; } vsync(); CopyToScreen(); }