static void Draw_Rect_Init(SDL_Surface *super, Sint16 x,Sint16 y, Uint16 w,Uint16 h, Uint32 color) { Draw_Init(); Draw_Rect(super, x, y, w, h, color); }
static void DrawDot(TTileItem * t, int color) { unsigned int x, y; x = MAP_XOFFS + MAP_FACTOR * t->x / TILE_WIDTH; y = MAP_YOFFS + MAP_FACTOR * t-> y / TILE_HEIGHT; Draw_Rect(x, y, 2, 2, color); }
static void MissionStatus(void) { //unsigned char *scr = GetDstScreen(); unsigned char color; int i, left; char s[4]; int allDone = 1; static int completed = 0; int x, y; if (gCampaign.dogFight) return; x = 5; y = SCREEN_HEIGHT - 5 - TextHeight(); for (i = 0; i < gMission.missionData->objectiveCount; i++) { if (gMission.missionData->objectives[i].type == OBJECTIVE_INVESTIGATE) gMission.objectives[i].done = ExploredPercentage(); if (gMission.missionData->objectives[i].required > 0) { // Objective color dot color = gMission.objectives[i].color; y += 3; Draw_Rect(x, y, 2, 2, color); y -= 3; left = gMission.objectives[i].required - gMission.objectives[i].done; if (left > 0) { if ((gMission.missionData->objectives[i].flags & OBJECTIVE_UNKNOWNCOUNT) == 0) { sprintf(s, "%d", left); } else { strcpy(s, "?"); } TextStringAt(x + 5, y, s); allDone = 0; } else { TextStringAt(x + 5, y, "Done"); } x += 30; } } if (allDone && !completed) { completed = 1; MarkExit(); } else if (!allDone) { completed = 0; } }
void MainMenu::PravilaGame(SDL_Surface *screen) { int en; SDL_FillRect(screen , NULL , 0x000000); en = 0; font3 = TTF_OpenFont("./font/42852.ttf",20); txtRect3.x = 50; txtRect3.y = 20; imgTxt3 = TTF_RenderText_Solid( font3 , "Игрок должен сдвинуть все ящики в отведенное для этого место экрана." , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = 45; imgTxt3 = TTF_RenderText_Solid( font3 , "Ящики можно только толкать. Через ящик нельзя ""перелезть""." , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = 70; imgTxt3 = TTF_RenderText_Solid( font3 , "Рабочий в состоянии сдвинуть только один ящик." , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = 105; imgTxt3 = TTF_RenderText_Solid( font3 , "Управление:" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = 135; imgTxt3 = TTF_RenderText_Solid( font3 , "Предвижение рабочего осуществляется клавишами управления (стрелочками)." , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = 165; imgTxt3 = TTF_RenderText_Solid( font3 , "Выход из игры в главное меню - Escape." , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.x = 300; txtRect3.y = 300; imgTxt3 = TTF_RenderText_Solid( font3 , "Вернуться в меню" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); Draw_Rect(screen, txtRect3.x - 10, txtRect3.y , 200, 25, 0xFFFFFF); SDL_Flip(screen); while(en == 0) { while(SDL_PollEvent(&event3)) { switch(event3.type) { case SDL_KEYDOWN: if(event3.key.keysym.sym == 0x0D)/*Выход по Enter*/ en = 1; } } } }
static void DrawObjectiveCounts(HUD *hud) { int x = 5 + GAUGE_WIDTH; int y = hud->device->cachedConfig.Res.y - 5 - FontH(); for (int i = 0; i < (int)gMission.missionData->Objectives.size; i++) { MissionObjective *mo = CArrayGet(&gMission.missionData->Objectives, i); const ObjectiveDef *o = CArrayGet(&gMission.Objectives, i); // Don't draw anything for optional objectives if (mo->Required == 0) { continue; } // Objective color dot Draw_Rect(x, y + 3, 2, 2, o->color); x += 5; char s[32]; int itemsLeft = mo->Required - o->done; if (itemsLeft > 0) { if (!(mo->Flags & OBJECTIVE_UNKNOWNCOUNT)) { sprintf(s, "%s: %d", ObjectiveTypeStr(mo->Type), itemsLeft); } else { sprintf(s, "%s: ?", ObjectiveTypeStr(mo->Type)); } } else { strcpy(s, "Done"); } FontStr(s, Vec2iNew(x, y)); DrawNumUpdate( CArrayGet(&hud->objectiveUpdates, i), "%d", o->done, Vec2iNew(x + FontStrW(s) - 8, y), 0); x += 40; } }
void Show_VOLB(u8 val)// 显示高音值 -7 ~ 7 { char str[]="B: 00dB"; u8 len = val*3; u8 tp; if(val<7) { str[2]=' '; tp = (7-val)*2; } else if(val==7) { str[2]=' '; tp = (7-val)*2; } else { str[2]=' '; tp = (16-val)*2;//(val-7)*2; } if(val>7) tp = 23-val;// dB值 else tp=val; len=tp*3; str[3] += tp/10; str[4] += tp%10; Draw_String6X8(1,55,str); //Draw_String6X8(43-2+5 ,55,"-"); Draw_Rect(49+5,55, 99+2,55+6,1); Draw_Line(50+5,57, 50+len+5,57,1); Draw_Line(50+len+5,57, 100,57,0); Draw_Line(50+5,58, 50+len+5,58,1); Draw_Line(50+len+5,58, 100,58,0); Draw_Line(50+5,59, 50+len+5,59,1); Draw_Line(50+len+5,59, 100,59,0); //Draw_String6X8(49+46+5,55,"+"); }
void Show_VOLH(u8 val)// 显示低音值 -7 ~ 7 { char str[]="H: 00dB"; u8 len = val*3; u8 tp; if(val<7) { str[2]=' '; tp = (7-val)*2; } else if(val==7) { str[2]=' '; tp = (7-val)*2; } else { str[2]=' '; tp = (16-val)*2;//(val-7)*2; } if(val>7) tp = 23-val;// dB值 else tp=val; len=tp*3;//Tiaoyin[tp]*3; str[3] += tp/10; str[4] += tp%10; Draw_String6X8(1,47,str); //Draw_String6X8(43+5-2 ,47,"-"); Draw_Rect(49+5,47, 99+2,47+6,1); Draw_Line(50+5,49, 50+len+5, 49,1); Draw_Line(50+len+5,49, 97+3,49,0); Draw_Line(50+5,50, 50+len+5,50,1); Draw_Line(50+len+5,50, 97+3,50,0); Draw_Line(50+5,51, 50+len+5,51,1); Draw_Line(50+len+5,51, 97+3,51,0); //Draw_String6X8(49+51,47,"+"); }
static void DisplaySummary() { int i, y, x, x2; char sScore[20]; unsigned char *scr = GetDstScreen(); unsigned char color; y = SCREEN_HEIGHT - 5 - TextHeight(); // 10 pixels from bottom for (i = 0; i < gMission.missionData->objectiveCount; i++) { if (gMission.objectives[i].required > 0 || gMission.objectives[i].done > 0) { // Objective color dot color = gMission.objectives[i].color; x = 5; Draw_Rect(x, (y + 3), 2, 2, color); x += 5; x2 = x + TextWidth(gMission.missionData->objectives[i].description) + 5; sprintf(sScore, "(%d)", gMission.objectives[i].done); if (gMission.objectives[i].required <= 0) { TextStringWithTableAt(x, y, gMission.missionData->objectives[i].description, &tablePurple); TextStringWithTableAt(x2, y, sScore, &tablePurple); } else if (gMission.objectives[i].done >= gMission.objectives[i].required) { TextStringWithTableAt(x, y, gMission.missionData->objectives[i].description, &tableFlamed); TextStringWithTableAt(x2, y, sScore, &tableFlamed); } else { TextStringAt(x, y, gMission.missionData->objectives[i].description); TextStringAt(x2, y, sScore); } y -= (TextHeight() + 1); } } }
int Generic::Which_Tile(std::shared_ptr<Entity> ent, int x, int y) { if (!ent) { Output_Handler::Error << "ERR Generic::Which_Tile : No Entity supplied\n"; return -1; } if (!ent->texture) { Output_Handler::Error << "ERR Generic::Which_Tile : Supplied Entity has no Texture\n"; return -1; } auto gt = std::dynamic_pointer_cast<Generic>(ent->texture); if (!gt) { Output_Handler::Error << "ERR Generic::Which_Tile : Supplied Entity has no Generic type Texture\n"; return -1; } if (!gt->Frame_Width || !gt->Frame_Height) { Output_Handler::Error << "ERR Generic::Which_Tile : Frame size has width/height equal to 0\n"; return -1; } x -= gt->Draw_Rect().x + (int)ent->X; y -= gt->Draw_Rect().y + (int)ent->Y; x = (int)((double)x / (double)gt->Frame_Width / ent->scale); y = (int)((double)y / (double)gt->Frame_Height / ent->scale); if (x < 0 || x >= (int)gt->__Width / (int)gt->Frame_Width || y < 0 || y >= (int)gt->__Height / (int)gt->Frame_Height) { return -1; } return gt->__Tilemap[y][x]; }
void drawCandlestick(SubWin sw,int x, float lowprice, float highprice, DayData data){ //start postion for rectangle. it will be drawn from start to right down corner int startx = x; int starty; //length of shadow line; hl mean up shadow line, ll mean down shadow line int hl, ll; float yunit = (highprice - lowprice)/sw->height; int length; Uint32 color; //get the abs value of the candle data->start > data->end ? (starty = data->start, color = GREEN ):(starty = data->end,color = RED); length = data->start - data->end; if(length<0){ length*=(-1); } printf("length = %d \n", length); //switch to the relative value hl = (int)((data->highest - starty)/yunit); ll = (int)((starty -length - data->lowest)/yunit); length = (int) (length/yunit); printf("length = %d pix\n", length); if(length <1){ length = 1; } getRelativePosition(sw,&startx,&starty, lowprice, highprice); //draw Draw_Rect(sw->screen,startx,starty,10,length,color); Draw_Line(sw->screen,startx+5,starty,startx+5, starty - hl,color); Draw_Line(sw->screen,startx+5,starty+length,startx+5, starty+length+ll,color); }
int DrawRectangle(SDL_Surface * screen, T_Rectangle *rectangle_info,T_Screen *screen_info) { int x = 0; int y = 0; int height = 0; int width = 0; int color = 0; //checking input parameters assert(NULL!=screen); assert(NULL!=rectangle_info); assert(NULL != screen_info); x = rectangle_info->start_point.x; y = rectangle_info->start_point.y; height = rectangle_info->height; width = rectangle_info->width; if ((x+width)>screen_info->width) { printf("warnning:the rectangle's stop x-accordate exceeds the screen's width!\n"); width = screen_info->width - x; } if ((y+height)>screen_info->height) { printf("warnning:the rectangle's stop y-accordate exceeds the screen's height!\n"); height = screen_info->height - y; } color = rectangle_info->color; //drawing the rectangle on the screen if ( 1== rectangle_info->fill) { Draw_FillRect(screen, x, y, width, height, color); } else { Draw_Rect(screen, x, y, width, height, color); } return 0; }
/*----------------------------------------------------------------------*/ int main(int argc, char *argv[]) { SDL_Surface *screen; int width, height; Uint8 video_bpp; Uint32 videoflags; int done; SDL_Event event; Uint32 then, now, frames; if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { fprintf(stderr, "SDL_Init problem: %s", SDL_GetError()); exit(1); } atexit(SDL_Quit); videoflags = SDL_SWSURFACE | SDL_ANYFORMAT; width = 640; height = 480; video_bpp = 0; while ( argc > 1 ) { --argc; if ( strcmp(argv[argc-1], "-width") == 0 ) { width = atoi(argv[argc]); --argc; } else if ( strcmp(argv[argc-1], "-height") == 0 ) { height = atoi(argv[argc]); --argc; } else if ( strcmp(argv[argc-1], "-bpp") == 0 ) { video_bpp = atoi(argv[argc]); videoflags &= ~SDL_ANYFORMAT; --argc; } else if ( strcmp(argv[argc], "-fast") == 0 ) { videoflags = FastestFlags(videoflags, width, height, video_bpp); } else if ( strcmp(argv[argc], "-hw") == 0 ) { videoflags ^= SDL_HWSURFACE; } else if ( strcmp(argv[argc], "-flip") == 0 ) { videoflags ^= SDL_DOUBLEBUF; } else if ( strcmp(argv[argc], "-fullscreen") == 0 ) { videoflags ^= SDL_FULLSCREEN; } else { fprintf(stderr, "Use: %s [-bpp N] [-hw] [-flip] [-fast] [-fullscreen]\n", argv[0]); exit(1); } }/*while*/ /*Video mode activation*/ screen = SDL_SetVideoMode(width, height, video_bpp, videoflags); if (!screen) { fprintf(stderr, "I can not activate video mode: %dx%d: %s\n", width, height, SDL_GetError()); exit(2); } {/*BEGIN*/ Uint32 c_white = SDL_MapRGB(screen->format, 255,255,255); Uint32 c_gray = SDL_MapRGB(screen->format, 200,200,200); Uint32 c_dgray= SDL_MapRGB(screen->format, 64,64,64); Uint32 c_cyan = SDL_MapRGB(screen->format, 32,255,255); //SDL_Rect r = {100,300,50,50}; //SDL_SetClipRect(screen, &r); //Test of clipping code frames = 0; then = SDL_GetTicks(); done = 0; while( !done ) { Draw_Line(screen, 100,100, 30,0, c_white); Draw_Line(screen, 30,0, 100,100, c_white); Draw_Line(screen, 100,100, 30,0, c_white); Draw_Line(screen, 30,0, 100,100, c_white); Draw_Line(screen, 0,0, 100,100, c_white); Draw_Line(screen, 100,100, 300,200, c_white); Draw_Line(screen, 200,300, 250,400, SDL_MapRGB(screen->format, 128,128,255)); Draw_Line(screen, 500,50, 600,70, SDL_MapRGB(screen->format, 128,255,128)); Draw_Line(screen, 500,50, 600,70, SDL_MapRGB(screen->format, 128,255,128)); //Draw_Circle(screen, 100+frames%200, 100, 50, c_white); Draw_Circle(screen, 100+(frames/3)%200, 100+(frames/2)%173, 50, SDL_MapRGB(screen->format, 128+frames,255+frames,68+frames)); /*-------------*/ Draw_Circle(screen, 150,150, 5, c_white); Draw_Circle(screen, 150,150, 4, SDL_MapRGB(screen->format, 64,64,64)); Draw_Circle(screen, 150,150, 3, SDL_MapRGB(screen->format, 255,0,0)); Draw_Circle(screen, 150,150, 2, SDL_MapRGB(screen->format, 0,255,0)); Draw_Circle(screen, 150,150, 1, SDL_MapRGB(screen->format, 0,0,255)); /*-------------*/ Draw_Line(screen, 500,100, 600,120, SDL_MapRGB(screen->format, 128,255,128)); Draw_Circle(screen, 601,121, 2, c_white); Draw_Circle(screen, 400,200, 2, c_white); Draw_Line(screen, 400,200, 409,200, c_white); Draw_Circle(screen, 409,200, 2, c_white); Draw_Line(screen, 400,200, 400,250, c_white); Draw_Circle(screen, 400,250, 2, c_white); Draw_Line(screen, 409,200, 400,250, c_white); Draw_Line(screen, 400,300, 409,300, c_gray); Draw_Line(screen, 400,300, 400,350, c_gray); Draw_Line(screen, 409,300, 400,350, c_dgray); Draw_Rect(screen, 398,298, 4,4, c_cyan); Draw_Rect(screen, 407,298, 4,4, c_cyan); Draw_Rect(screen, 398,348, 4,4, c_cyan); Draw_HLine(screen, 10,400, 50, c_white); Draw_VLine(screen, 60,400, 360, c_white); Draw_Rect(screen, 500,400, 50,50, c_white); Draw_Pixel(screen, 510,410, c_white); Draw_Pixel(screen, 520,420, SDL_MapRGB(screen->format, 255,0,0)); Draw_Pixel(screen, 530,430, SDL_MapRGB(screen->format, 0,255,0)); Draw_Pixel(screen, 540,440, SDL_MapRGB(screen->format, 0,0,255)); Draw_Ellipse(screen, 100,300, 60,30, c_white); Draw_FillEllipse(screen, 300,300, 30,60, SDL_MapRGB(screen->format, 64,64,200)); Draw_Ellipse(screen, 300,300, 30,60, SDL_MapRGB(screen->format, 255,0,0)); Draw_Round(screen, 200,20, 70,50, 10, c_white); Draw_Round(screen, 300,20, 70,50, 20, SDL_MapRGB(screen->format, 255,0,0)); Draw_FillRound(screen, 390,20, 70,50, 20, SDL_MapRGB(screen->format, 255,0,0)); Draw_Round(screen, 390,20, 70,50, 20, c_cyan); /*Draw_Round(screen, 500,400, 5,3, 4, c_cyan);*/ Draw_Rect(screen, 499,199, 52,72, SDL_MapRGB(screen->format, 255,255,0)); //Draw_FillRect(screen, 500,200, 50,70, // SDL_MapRGB(screen->format, 64,200,64)); Draw_FillCircle(screen, 500,330, 30, c_cyan); SDL_UpdateRect(screen, 0, 0, 0, 0); ++frames; while ( SDL_PollEvent(&event) ) { switch (event.type) { case SDL_KEYDOWN: /*break;*/ case SDL_QUIT: done = 1; break; default: break; } }/*while*/ }/*while(!done)*/ }/*END*/ now = SDL_GetTicks(); if ( now > then ) { printf("%2.2f frames per second\n", ((double)frames*1000)/(now-then)); } fprintf(stderr, "[END]\n"); return 0; }/*main*/
void MainMenu::Zastavka2(SDL_Surface *screen) { int sc = 0, bEnter = 0, swi = 1; SDL_Surface *black; SDL_Color blackColor = {0,0,0}; SDL_FillRect(screen , NULL , 0x000000); while(name[sc]!='\0') name[sc++] = '\0'; i3 = 0; txtRect3.x = HEIGHT/2 - 250; txtRect3.y = WIDTH/2 - 200; font3 = TTF_OpenFont("./font/42852.ttf",30); imgTxt3 = TTF_RenderText_Solid( font3 , "Введите имя игрока(минимум, 3 буквы):" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.x = HEIGHT/2 - 150; txtRect3.y = WIDTH/2 - 150; Draw_Rect(screen, txtRect3.x - 10, txtRect3.y , 400, 35, 0xFFFFFF); txtRect3.y = WIDTH/2 - 50; imgTxt3 = TTF_RenderText_Solid( font3 , "Shift - смена языка" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); SDL_Flip(screen); txtRect3.y = WIDTH/2 - 150; while(bEnter == 0) { while(SDL_PollEvent(&event3)) { switch(event3.type) { case SDL_KEYDOWN: if(event3.key.keysym.sym == 0x0D) /*Клавиша Enter*/ { if(i3<3) continue; name[20] = '\0'; bEnter = 1; } if(i3<19) { if(swi == 1) if((event3.key.keysym.sym >= 'a')&&(event3.key.keysym.sym <= 'z')) name[i3++] = event3.key.keysym.sym; if(swi == (-1)) { if(event3.key.keysym.sym == 'a') name[i3++] = 'ф'; if(event3.key.keysym.sym == 'b') name[i3++] = 'и'; if(event3.key.keysym.sym == 'c') name[i3++] = 'с'; if(event3.key.keysym.sym == 'd') name[i3++] = 'в'; if(event3.key.keysym.sym == 'e') name[i3++] = 'у'; if(event3.key.keysym.sym == 'f') name[i3++] = 'а'; if(event3.key.keysym.sym == 'g') name[i3++] = 'п'; if(event3.key.keysym.sym == 'h') name[i3++] = 'р'; if(event3.key.keysym.sym == 'i') name[i3++] = 'ш'; if(event3.key.keysym.sym == 'j') name[i3++] = 'о'; if(event3.key.keysym.sym == 'k') name[i3++] = 'л'; if(event3.key.keysym.sym == 'l') name[i3++] = 'д'; if(event3.key.keysym.sym == 'm') name[i3++] = 'ь'; if(event3.key.keysym.sym == 'n') name[i3++] = 'т'; if(event3.key.keysym.sym == 'o') name[i3++] = 'щ'; if(event3.key.keysym.sym == 'p') name[i3++] = 'з'; if(event3.key.keysym.sym == 'q') name[i3++] = 'й'; if(event3.key.keysym.sym == 'r') name[i3++] = 'к'; if(event3.key.keysym.sym == 's') name[i3++] = 'ы'; if(event3.key.keysym.sym == 't') name[i3++] = 'е'; if(event3.key.keysym.sym == 'u') name[i3++] = 'г'; if(event3.key.keysym.sym == 'v') name[i3++] = 'м'; if(event3.key.keysym.sym == 'w') name[i3++] = 'ц'; if(event3.key.keysym.sym == 'x') name[i3++] = 'ч'; if(event3.key.keysym.sym == 'y') name[i3++] = 'н'; if(event3.key.keysym.sym == 'z') name[i3++] = 'я'; if(event3.key.keysym.sym == 0x5B) name[i3++] = 'х'; if(event3.key.keysym.sym == 0x5D) name[i3++] = 'ъ'; if(event3.key.keysym.sym == 0x3B) name[i3++] = 'ж'; if(event3.key.keysym.sym == 39) name[i3++] = 'э'; if(event3.key.keysym.sym == 0x2C) name[i3++] = 'б'; if(event3.key.keysym.sym == 0x2E) name[i3++] = 'ю'; } } if(event3.key.keysym.sym == 0x08) /*Клавиша Backspace*/ { black = TTF_RenderText_Solid( font3 , name , blackColor ); SDL_BlitSurface( black , NULL , screen , &txtRect3 ); if(i3>=0) { i3--; name[i3] = '\0'; if(i3<0) i3 = 0; } else { i3=0; name[0] = '\0'; } } if(event3.key.keysym.sym == SDLK_LSHIFT) swi *= -1; imgTxt3 = TTF_RenderText_Solid( font3 , name , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); SDL_Flip(screen); break; } } } }
void MainMenu::Tablitca(SDL_Surface *screen) { struct score *temp, *begin=NULL; FILE *scoresf, *txtscore; SDL_Surface *txt; SDL_Rect rct; char llvl[30], timme[30],tempc[20]; int k=0, a=0, schet=0, num=0, tmp1=0, tmp2 = 0, back = 0; SDL_FillRect(screen , NULL , 0x000000); font3 = TTF_OpenFont("./font/42852.ttf",20); if((scoresf = fopen("score.dat","rb")) == NULL) { txtRect3.x = 100; txtRect3.y = 5; SDL_FillRect(screen , NULL , 0x000000); imgTxt3 = TTF_RenderText_Solid( font3 , "Извините, файла не существует." , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); SDL_Flip(screen); SDL_Delay(2000); return; } txtRect3.x = 30; txtRect3.y = 10; imgTxt3 = TTF_RenderText_Solid( font3 , "Имя игрока" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); Draw_Rect(screen, txtRect3.x-20, txtRect3.y-10 , 260, 35, 0xFFFFFF); SDL_Flip(screen); txtRect3.x = 290; imgTxt3 = TTF_RenderText_Solid( font3 , "Уровень" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); Draw_Rect(screen, txtRect3.x-20, txtRect3.y-10 , 260, 35, 0xFFFFFF); SDL_Flip(screen); txtRect3.x = 550; imgTxt3 = TTF_RenderText_Solid( font3 , "Время" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); Draw_Rect(screen, txtRect3.x-20, txtRect3.y-10 , 260, 35, 0xFFFFFF); SDL_Flip(screen); /* нарисовали заголовок таблицы */ begin = new struct score; temp = begin; k = fread(&(temp->scores), sizeof(temp->scores), 1, scoresf); while(k == 1) { a++; temp->next = new struct score; k = fread(&(temp->next->scores), sizeof(temp->scores), 1, scoresf); if (k!=1) { delete temp->next; temp->next = NULL; break; } temp = temp->next; } if (a == 0) { free(begin); fclose(scoresf); return; } fclose(scoresf); /* считали данные из файла */ /*сортируем по убыванию времени*/ temp = begin; for(i3=0; i3<a; i3++) { for(j3=0;j3< a - i3 - 1;j3++) { if(temp->scores.time > temp->next->scores.time && temp!=NULL) { k=0; while(temp->scores.names[k]!='\0') { tempc[k] = temp->scores.names[k]; k++; } tmp1 = temp->scores.lvls; tmp2 = temp->scores.time; k=0; while(temp->next->scores.names[k]!='\0') { temp->scores.names[k] = temp->next->scores.names[k]; k++; } k=0; while(temp->next->scores.names[k]!='\0') { temp->next->scores.names[k] = tempc[k]; k++; } temp->scores.lvls = temp->next->scores.lvls; temp->scores.time = temp->next->scores.time; temp->next->scores.lvls = tmp1; temp->next->scores.time = tmp2; } temp = temp->next; } temp = begin; } /* печатаем таблицу */ temp = begin; schet=0; while(temp!=NULL && schet!=10) { txtRect3.x = 30; txtRect3.y += 35; imgTxt3 = TTF_RenderText_Solid( font3 , temp->scores.names , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); Draw_Rect(screen, txtRect3.x-20, txtRect3.y-10 , 260, 35, 0xFFFFFF); SDL_Flip(screen); txtRect3.x = 290; itoa(temp->scores.lvls, llvl, 10); imgTxt3 = TTF_RenderText_Solid( font3 , llvl , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); Draw_Rect(screen, txtRect3.x-20, txtRect3.y-10 , 260, 35, 0xFFFFFF); SDL_Flip(screen); txtRect3.x = 550; itoa(temp->scores.time, timme, 10); imgTxt3 = TTF_RenderText_Solid( font3 , timme , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); Draw_Rect(screen, txtRect3.x-20, txtRect3.y-10 , 260, 35, 0xFFFFFF); SDL_Flip(screen); schet++; temp = temp->next; } /*напечатали таблицу*/ /* кнопка возврата в меню или удаления файла */ txtRect3.x = 30; txtRect3.y+= 40; imgTxt3 = TTF_RenderText_Solid( font3 , "1. Возврат в меню" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); SDL_Flip(screen); txtRect3.y+= 40; imgTxt3 = TTF_RenderText_Solid( font3 , "2. Удалить файл с таблицей рекордов" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); SDL_Flip(screen); txtRect3.y+= 40; imgTxt3 = TTF_RenderText_Solid( font3 , "3. Подготовить файл к печати" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); SDL_Flip(screen); temp = begin; while(back == 0) { while(SDL_PollEvent(&event3)) { switch(event3.type) { case SDL_KEYDOWN: if(event3.key.keysym.sym == '1') /*Если нажата 1 , возвращаемся в главное меню*/ back = 1; if(event3.key.keysym.sym == '2') /*Если нажата 2 - удаляем файл*/ { remove("score.dat"); back = 1; } if(event3.key.keysym.sym == '3') { if((txtscore = fopen("scores.txt","w"))!=NULL) { SDL_FillRect(screen, NULL, 0x000000); rct.x = HEIGHT/2-100; rct.y = WIDTH/2 - 100; txt = TTF_RenderText_Solid( font3 , "Файл создан успешно!" , Color3 ); SDL_BlitSurface( txt , NULL , screen , &rct ); SDL_Flip(screen); SDL_Delay(1000); } fputs("Имя игрока \t Уровень \t Время\n",txtscore); while(temp!=NULL) { fputs(temp->scores.names,txtscore); fprintf(txtscore,"\t%d\t%d\n",temp->scores.lvls,temp->scores.time); temp = temp->next; } fclose(txtscore); back = 1; } } } } /*очищаем память от структуры*/ temp = begin; while(temp != NULL) { temp = temp->next; delete begin; begin = temp; } }
int MainMenu::DrawMenu(SDL_Surface *screen) { Play igra; SDL_FillRect(screen , NULL , 0x000000); txtRect3.x = HEIGHT/2 - 100; txtRect3.y = WIDTH/2 - 295; font3 = TTF_OpenFont("./font/42852.ttf",20); imgTxt3 = TTF_RenderText_Solid( font3 , "Текущий игрок: " , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.x = HEIGHT/2 + 50; imgTxt3 = TTF_RenderText_Solid( font3 , name , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.x = HEIGHT/2 - 100; txtRect3.y = WIDTH/2 - 200; font3 = TTF_OpenFont("./font/42852.ttf",25); imgTxt3 = TTF_RenderText_Solid( font3 , "Начало игры" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); Draw_Rect(screen, txtRect3.x - 10, txtRect3.y , 285, 25, 0xFFFFFF); txtRect3.y = WIDTH/2 - 175; imgTxt3 = TTF_RenderText_Solid( font3 , "Смена игрока" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 150; imgTxt3 = TTF_RenderText_Solid( font3 , "Просмотр результатов" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 125; imgTxt3 = TTF_RenderText_Solid( font3 , "Правила игры" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 100; imgTxt3 = TTF_RenderText_Solid( font3 , "Выход" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); SDL_Flip(screen); j3=0; txtRect3.y = WIDTH/2 - 200; while(end3 == 0) { while(SDL_PollEvent(&event3)) { switch(event3.type) { case SDL_MOUSEBUTTONDOWN: { if(event3.button.x >= HEIGHT/2 - 100 && event3.button.x <= HEIGHT/2 + 185) { if(event3.button.y >= WIDTH/2 - 200 && event3.button.y < WIDTH/2 - 175) /*играть*/ { igra.Game(screen); return 0; } if(event3.button.y >= WIDTH/2 - 175 && event3.button.y < WIDTH/2 - 150) /*смена имени*/ { while(name[i3]!='\0') name[i3++] = '\0'; Zastavka2(screen); return 0; } if(event3.button.y >= WIDTH/2 - 150 && event3.button.y < WIDTH/2 - 125) { Tablitca(screen); return 0; } if(event3.button.y >= WIDTH/2 - 125 && event3.button.y < WIDTH/2 - 100)/*правила игры*/ { PravilaGame(screen); return 0; } if(event3.button.y >= WIDTH/2 - 100 && event3.button.y < WIDTH/2 - 75) end3 = 1; } break; } case SDL_KEYDOWN: { if(event3.key.keysym.sym == SDLK_DOWN && j3 != 4) { if(j3<4) j3++; Draw_Rect(screen, txtRect3.x - 10, txtRect3.y , 285, 25, 0x000000); if(j3==0) txtRect3.y = WIDTH/2 - 200; else if(j3==1) { imgTxt3 = TTF_RenderText_Solid( font3 , "Начало игры" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 175; imgTxt3 = TTF_RenderText_Solid( font3 , "Смена игрока" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); } else if(j3==2) { imgTxt3 = TTF_RenderText_Solid( font3 , "Смена игрока" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 150; imgTxt3 = TTF_RenderText_Solid( font3 , "Просмотр результатов" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); } else if(j3==3) { imgTxt3 = TTF_RenderText_Solid( font3 , "Просмотр результатов" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 125; imgTxt3 = TTF_RenderText_Solid( font3 , "Правила игры" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); } else if(j3==4) { imgTxt3 = TTF_RenderText_Solid( font3 , "Правила игры" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 100; imgTxt3 = TTF_RenderText_Solid( font3 , "Выход" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); } Draw_Rect(screen, txtRect3.x - 10, txtRect3.y , 285, 25, 0xFFFFFF); SDL_Flip(screen); } if(event3.key.keysym.sym == SDLK_UP && j3 != 0) { if(j3>0) j3--; Draw_Rect(screen, txtRect3.x - 10, txtRect3.y , 285, 25, 0x000000); if(j3==0) { imgTxt3 = TTF_RenderText_Solid( font3 , "Смена игрока" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 200; imgTxt3 = TTF_RenderText_Solid( font3 , "Начало игры" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); } else if(j3==1) { imgTxt3 = TTF_RenderText_Solid( font3 , "Просмотр результатов" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 175; imgTxt3 = TTF_RenderText_Solid( font3 , "Смена игрока" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); } else if(j3==2) { imgTxt3 = TTF_RenderText_Solid( font3 , "Правила игры" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 150; imgTxt3 = TTF_RenderText_Solid( font3 , "Просмотр результатов" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); } else if(j3==3) { imgTxt3 = TTF_RenderText_Solid( font3 , "Выход" , Color3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); txtRect3.y = WIDTH/2 - 125; imgTxt3 = TTF_RenderText_Solid( font3 , "Правила игры" , menucolor3 ); SDL_BlitSurface( imgTxt3 , NULL , screen , &txtRect3 ); } else if(j3==4) txtRect3.y = WIDTH/2 - 100; Draw_Rect(screen, txtRect3.x - 10, txtRect3.y , 285, 25, 0xFFFFFF); SDL_Flip(screen); } if(event3.key.keysym.sym == 0x0D) /*если нажат Enter*/ { if(txtRect3.y == men1) /*Играть*/ { igra.Game(screen); return 0; } if(txtRect3.y == men2) /*Смена игрока*/ { while(name[i3]!='\0') name[i3++] = '\0'; Zastavka2(screen); return 0; } if(txtRect3.y == men3) /*Просмотр результатов*/ { Tablitca(screen); return 0; } if(txtRect3.y == men4) /*Правила игры*/ { PravilaGame(screen); return 0; } if(txtRect3.y == men5) /*Выход*/ end3 = 1; } } } } } return end3; }
void CCell::Draw(CDC* pDC) { // InkPoint Draw--------------------------------------- POSITION aPos = GetListHeadPosition(); CInkPoint* pInkPoint = 0; while(aPos) { pInkPoint = GetNext(aPos); if(pInkPoint) { if(pDC->RectVisible(pInkPoint->GetBoundRect())) { pInkPoint->Draw(pDC, pInkPoint); } } } // Cell Draw-------------------------------------------- if(m_nCellType == 0) // IPS { // 셀 Draw Draw_Line(pDC, CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.bottom), ShiftPoint_IPS[0]); Draw_Line(pDC, ShiftPoint_IPS[0], CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.top)); Draw_Line(pDC, CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.top), CPoint(m_rtEnclosingRect.right, m_rtEnclosingRect.top)); Draw_Line(pDC, CPoint(m_rtEnclosingRect.right, m_rtEnclosingRect.top), ShiftPoint_IPS[1]); Draw_Line(pDC, ShiftPoint_IPS[1], CPoint(m_rtEnclosingRect.right, m_rtEnclosingRect.bottom)); Draw_Line(pDC, CPoint(m_rtEnclosingRect.right, m_rtEnclosingRect.bottom), CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.bottom)); // 셀 좌/우 Draw Draw_Line(pDC, CPoint(m_rtEnclosingRect.left - (int)DP[1], m_rtEnclosingRect.bottom), CPoint(ShiftPoint_IPS[0].x - (int)DP[1], ShiftPoint_IPS[0].y)); Draw_Line(pDC, CPoint(ShiftPoint_IPS[0].x - (int)DP[1], ShiftPoint_IPS[0].y), CPoint(m_rtEnclosingRect.left - (int)DP[1], m_rtEnclosingRect.top)); Draw_Line(pDC, CPoint(m_rtEnclosingRect.right + (int)DP[1], m_rtEnclosingRect.top), CPoint(ShiftPoint_IPS[1].x + (int)DP[1], ShiftPoint_IPS[1].y)); Draw_Line(pDC, CPoint(ShiftPoint_IPS[1].x + (int)DP[1], ShiftPoint_IPS[1].y), CPoint(m_rtEnclosingRect.right + (int)DP[1], m_rtEnclosingRect.bottom)); } else // TN { Draw_Rect(pDC, m_rtEnclosingRect); // 셀 좌 우 Draw_Line(pDC, CPoint(m_rtEnclosingRect.left - (int)DP[1], m_rtEnclosingRect.bottom), CPoint(m_rtEnclosingRect.left - (int)DP[1], m_rtEnclosingRect.top)); Draw_Line(pDC, CPoint(m_rtEnclosingRect.right + (int)DP[1], m_rtEnclosingRect.top), CPoint(m_rtEnclosingRect.right + (int)DP[1], m_rtEnclosingRect.bottom)); } // BMCD Draw m_bmArrBmcd[0].m_clrColor = m_bmArrBmcd[1].m_clrColor = GRAY; m_bmArrBmcd[0].m_nPenWidth = m_bmArrBmcd[1].m_nPenWidth = 3; m_bmArrBmcd[0].m_rtEnclosingRect = CRect(CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.bottom), CPoint(m_rtEnclosingRect.right, m_rtEnclosingRect.bottom + (int)GP[1])); m_bmArrBmcd[1].m_rtEnclosingRect = CRect(CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.top), CPoint(m_rtEnclosingRect.right, m_rtEnclosingRect.top - (int)GP[1])); m_bmArrBmcd[0].Draw(pDC); m_bmArrBmcd[1].Draw(pDC); // Dotted Line m_dlineArrDottedLine[0].m_ptStartPoint = CPoint(m_rtEnclosingRect.left , m_rtEnclosingRect.top); m_dlineArrDottedLine[0].m_ptEndPoint = CPoint(m_rtEnclosingRect.right + (int)(DP[1] + 150.0), m_rtEnclosingRect.top); m_dlineArrDottedLine[0].m_clrColor = GRAY; m_dlineArrDottedLine[0].Draw(pDC); m_dlineArrDottedLine[1].m_ptStartPoint = CPoint(m_rtEnclosingRect.left - ((int)DP[1] + 100) , m_rtEnclosingRect.bottom); m_dlineArrDottedLine[1].m_ptEndPoint = CPoint(m_rtEnclosingRect.right + (int)(DP[1] + 150.0), m_rtEnclosingRect.bottom); m_dlineArrDottedLine[1].m_clrColor = GRAY; m_dlineArrDottedLine[1].Draw(pDC); m_dlineArrDottedLine[2].m_ptStartPoint = CPoint(m_rtEnclosingRect.left , m_rtEnclosingRect.top - (int)GP[1]); m_dlineArrDottedLine[2].m_ptEndPoint = CPoint(m_rtEnclosingRect.right + (int)(DP[1] + 150.0), m_rtEnclosingRect.top - (int)GP[1]); m_dlineArrDottedLine[2].m_clrColor = GRAY; m_dlineArrDottedLine[2].Draw(pDC); m_dlineArrDottedLine[3].m_ptStartPoint = CPoint(m_rtEnclosingRect.left , m_rtEnclosingRect.top); m_dlineArrDottedLine[3].m_ptEndPoint = CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.bottom + (int)(GP[1] + 150.0)); m_dlineArrDottedLine[3].m_clrColor = GRAY; m_dlineArrDottedLine[3].Draw(pDC); m_dlineArrDottedLine[4].m_ptStartPoint = CPoint(m_rtEnclosingRect.right , m_rtEnclosingRect.top); m_dlineArrDottedLine[4].m_ptEndPoint = CPoint(m_rtEnclosingRect.right, m_rtEnclosingRect.bottom + (int)(GP[1] + 150.0)); m_dlineArrDottedLine[4].m_clrColor = GRAY; m_dlineArrDottedLine[4].Draw(pDC); m_dlineArrDottedLine[5].m_ptStartPoint = CPoint(m_rtEnclosingRect.right + (int)DP[1], m_rtEnclosingRect.bottom); m_dlineArrDottedLine[5].m_ptEndPoint = CPoint(m_rtEnclosingRect.right + (int)DP[1], m_rtEnclosingRect.bottom + (int)(GP[1] + 150.0)); m_dlineArrDottedLine[5].m_clrColor = GRAY; m_dlineArrDottedLine[5].Draw(pDC); UINT nInkCount = GetCount(); if(nInkCount > 0) { aPos = GetListHeadPosition(); pInkPoint = 0; pInkPoint = GetNext(aPos); m_dlineArrDottedLine[6].m_ptStartPoint = CPoint((pInkPoint->m_inkPointInfo.rtEnclosingRect.right - pInkPoint->m_inkPointInfo.rtEnclosingRect.left)/2 + pInkPoint->m_inkPointInfo.rtEnclosingRect.left, m_rtEnclosingRect.bottom + (int)GP[1] + 30); m_dlineArrDottedLine[6].m_ptEndPoint = CPoint((pInkPoint->m_inkPointInfo.rtEnclosingRect.right - pInkPoint->m_inkPointInfo.rtEnclosingRect.left)/2 + pInkPoint->m_inkPointInfo.rtEnclosingRect.left, m_rtEnclosingRect.top - (int)GP[1]); m_dlineArrDottedLine[6].m_clrColor = GRAY; m_dlineArrDottedLine[6].Draw(pDC); // InkPoint Left Pitch m_alineArrArrowLine[4].m_ptStartPoint = CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.bottom + (int)(GP[1] + 15.0)); m_alineArrArrowLine[4].m_ptEndPoint = CPoint((pInkPoint->m_inkPointInfo.rtEnclosingRect.right - pInkPoint->m_inkPointInfo.rtEnclosingRect.left)/2 + pInkPoint->m_inkPointInfo.rtEnclosingRect.left, m_rtEnclosingRect.bottom + (int)(GP[1] + 15.0)); m_alineArrArrowLine[4].m_clrColor = GRAY; m_alineArrArrowLine[4].m_nArrowSize = 5; m_alineArrArrowLine[4].Draw(pDC); } if(m_nCellType == 0) // IPS { m_dlineArrDottedLine[7].m_ptStartPoint = CPoint(ShiftPoint_IPS[0].x, m_rtEnclosingRect.bottom + (int)(GP[1] + 150.0)); m_dlineArrDottedLine[7].m_ptEndPoint = CPoint(ShiftPoint_IPS[0].x, m_rtEnclosingRect.top - (int)GP[1]); m_dlineArrDottedLine[7].m_clrColor = GRAY; m_dlineArrDottedLine[7].Draw(pDC); } // GP1 m_alineArrArrowLine[0].m_ptStartPoint = CPoint(m_rtEnclosingRect.right + (int)(DP[1] + 35.0), m_rtEnclosingRect.top - (int)GP[1]); m_alineArrArrowLine[0].m_ptEndPoint = CPoint(m_rtEnclosingRect.right + (int)(DP[1] + 35.0), m_rtEnclosingRect.bottom); m_alineArrArrowLine[0].m_clrColor = GRAY; m_alineArrArrowLine[0].m_nArrowSize = 5; m_alineArrArrowLine[0].Draw(pDC); // GP2 m_alineArrArrowLine[1].m_ptStartPoint = CPoint(m_rtEnclosingRect.right + (int)(DP[1] + 85.0), m_rtEnclosingRect.top - (int)GP[1]); m_alineArrArrowLine[1].m_ptEndPoint = CPoint(m_rtEnclosingRect.right + (int)(DP[1] + 85.0), m_rtEnclosingRect.top); m_alineArrArrowLine[1].m_clrColor = GRAY; m_alineArrArrowLine[1].m_nArrowSize = 5; m_alineArrArrowLine[1].Draw(pDC); // DP1 m_alineArrArrowLine[2].m_ptStartPoint = CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.bottom + (int)(GP[1] + 50.0)); m_alineArrArrowLine[2].m_ptEndPoint = CPoint(m_rtEnclosingRect.right + (int)DP[1], m_rtEnclosingRect.bottom + (int)(GP[1] + 50.0)); m_alineArrArrowLine[2].m_clrColor = GRAY; m_alineArrArrowLine[2].m_nArrowSize = 5; m_alineArrArrowLine[2].Draw(pDC); // DP2 m_alineArrArrowLine[3].m_ptStartPoint = CPoint(m_rtEnclosingRect.right, m_rtEnclosingRect.bottom + (int)(GP[1] + 75.0)); m_alineArrArrowLine[3].m_ptEndPoint = CPoint(m_rtEnclosingRect.right + (int)DP[1], m_rtEnclosingRect.bottom + (int)(GP[1] + 75.0)); m_alineArrArrowLine[3].m_clrColor = GRAY; m_alineArrArrowLine[3].m_nArrowSize = 5; m_alineArrArrowLine[3].Draw(pDC); if(m_nCellType == 0) // IPS { // DP3 m_alineArrArrowLine[4].m_ptStartPoint = CPoint(ShiftPoint_IPS[0].x, m_rtEnclosingRect.bottom + (int)(GP[1] + 95.0)); m_alineArrArrowLine[4].m_ptEndPoint = CPoint(m_rtEnclosingRect.left, m_rtEnclosingRect.bottom + (int)(GP[1] + 95.0)); m_alineArrArrowLine[4].m_clrColor = GRAY; m_alineArrArrowLine[4].m_nArrowSize = 5; m_alineArrArrowLine[4].Draw(pDC); } else { // DP3 m_alineArrArrowLine[4].m_ptStartPoint = CPoint(0,0); m_alineArrArrowLine[4].m_ptEndPoint = CPoint(0,0); m_alineArrArrowLine[4].m_clrColor = GRAY; m_alineArrArrowLine[4].m_nArrowSize = 0; m_alineArrArrowLine[4].Draw(pDC); } }