void CBoidObject::UpdateDisplay(SBoidContext &bc) { if(bc.animationMaxDistanceSq ==0) return; Vec3 cameraPos(gEnv->pRenderer->GetCamera().GetPosition()); Vec3 cameraDir(gEnv->pRenderer->GetCamera().GetMatrix().GetColumn1()); float dot = (m_pos - cameraPos).Dot(cameraDir); float distSq = Distance::Point_PointSq(cameraPos,m_pos); if(m_displayChr) { if(dot < 0 || distSq > bc.animationMaxDistanceSq) { DisplayCharacter(false); } } else { if(dot > 0 && distSq <= bc.animationMaxDistanceSq) { // show animated character DisplayCharacter(true); } } }
void Display_Data(void){//Setting up text display OSD_Position_H(0x00); DisplayCharacter(25,0x1A); DisplayCharacter(26,0x44); DisplayCharacter(55,0x1C); DisplayCharacter(56,0x44); }
void TWODDRAW_CLASS::DisplayString (int row, int col, char *str) { while (*str) { DisplayCharacter ((short)(toupper(*str++) - ','), col, row ); col += CHAR_WIDTH; } }
static void Display(TCampaignSetting * setting, int index, int xc, int yc) { int x, y = 10; char s[50]; const TBadGuy *b; int i; memset(GetDstScreen(), 74, SCREEN_MEMSIZE); sprintf(s, "%d/%d", setting->characterCount, MAX_CHARACTERS); TextStringAt(10, 190, s); if (index >= 0 && index < setting->characterCount) { b = &setting->characters[index]; DisplayText(30, y, "Face", yc == YC_APPEARANCE && xc == XC_FACE); DisplayText(60, y, "Skin", yc == YC_APPEARANCE && xc == XC_SKIN); DisplayText(90, y, "Hair", yc == YC_APPEARANCE && xc == XC_HAIR); DisplayText(120, y, "Body", yc == YC_APPEARANCE && xc == XC_BODY); DisplayText(150, y, "Arms", yc == YC_APPEARANCE && xc == XC_ARMS); DisplayText(180, y, "Legs", yc == YC_APPEARANCE && xc == XC_LEGS); y += TextHeight(); sprintf(s, "Speed: %d%%", (100 * b->speed) / 256); DisplayText(20, y, s, yc == YC_ATTRIBUTES && xc == XC_SPEED); sprintf(s, "Hp: %d", b->health); DisplayText(70, y, s, yc == YC_ATTRIBUTES && xc == XC_HEALTH); sprintf(s, "Move: %d%%", b->probabilityToMove); DisplayText(120, y, s, yc == YC_ATTRIBUTES && xc == XC_MOVE); sprintf(s, "Track: %d%%", b->probabilityToTrack); DisplayText(170, y, s, yc == YC_ATTRIBUTES && xc == XC_TRACK); sprintf(s, "Shoot: %d%%", b->probabilityToShoot); DisplayText(220, y, s, yc == YC_ATTRIBUTES && xc == XC_SHOOT); sprintf(s, "Delay: %d", b->actionDelay); DisplayText(270, y, s, yc == YC_ATTRIBUTES && xc == XC_DELAY); y += TextHeight(); DisplayFlag(5, y, "Asbestos", (b->flags & FLAGS_ASBESTOS) != 0, yc == YC_FLAGS && xc == XC_ASBESTOS); DisplayFlag(50, y, "Immunity", (b->flags & FLAGS_IMMUNITY) != 0, yc == YC_FLAGS && xc == XC_IMMUNITY); DisplayFlag(95, y, "C-thru", (b->flags & FLAGS_SEETHROUGH) != 0, yc == YC_FLAGS && xc == XC_SEETHROUGH); DisplayFlag(140, y, "Run-away", (b->flags & FLAGS_RUNS_AWAY) != 0, yc == YC_FLAGS && xc == XC_RUNS_AWAY); DisplayFlag(185, y, "Sneaky", (b->flags & FLAGS_SNEAKY) != 0, yc == YC_FLAGS && xc == XC_SNEAKY); DisplayFlag(230, y, "Good guy", (b->flags & FLAGS_GOOD_GUY) != 0, yc == YC_FLAGS && xc == XC_GOOD_GUY); DisplayFlag(275, y, "Asleep", (b->flags & FLAGS_SLEEPALWAYS) != 0, yc == YC_FLAGS && xc == XC_SLEEPING); y += TextHeight(); DisplayFlag(5, y, "Prisoner", (b->flags & FLAGS_PRISONER) != 0, yc == YC_FLAGS2 && xc == XC_PRISONER); DisplayFlag(50, y, "Invuln.", (b->flags & FLAGS_INVULNERABLE) != 0, yc == YC_FLAGS2 && xc == XC_INVULNERABLE); DisplayFlag(95, y, "Follower", (b->flags & FLAGS_FOLLOWER) != 0, yc == YC_FLAGS2 && xc == XC_FOLLOWER); DisplayFlag(140, y, "Penalty", (b->flags & FLAGS_PENALTY) != 0, yc == YC_FLAGS2 && xc == XC_PENALTY); DisplayFlag(185, y, "Victim", (b->flags & FLAGS_VICTIM) != 0, yc == YC_FLAGS2 && xc == XC_VICTIM); DisplayFlag(230, y, "Awake", (b->flags & FLAGS_AWAKEALWAYS) != 0, yc == YC_FLAGS2 && xc == XC_AWAKE); y += TextHeight(); DisplayText(50, y, gunDesc[b->gun].gunName, yc == YC_WEAPON); y += TextHeight() + 5; x = 10; for (i = 0; i < setting->characterCount; i++) { DisplayCharacter(x, y + 20, &setting->characters[i], index == i); x += 20; if (x > SCREEN_WIDTH) { x = 10; y += 30; } } } CopyToScreen(); }
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(); }
static void Display(CampaignSettingNew *setting, int idx, int xc, int yc) { int x, y = 10; char s[50]; const Character *b; int i; int tag; for (i = 0; i < GraphicsGetScreenSize(&gGraphicsDevice.cachedConfig); i++) { gGraphicsDevice.buf[i] = LookupPalette(74); } sprintf(s, "%d", setting->characters.otherCount); CDogsTextStringAt(10, 190, s); if (idx >= 0 && idx < setting->characters.otherCount) { b = &setting->characters.others[idx]; DisplayCDogsText(30, y, "Face", yc == YC_APPEARANCE && xc == XC_FACE); DisplayCDogsText(60, y, "Skin", yc == YC_APPEARANCE && xc == XC_SKIN); DisplayCDogsText(90, y, "Hair", yc == YC_APPEARANCE && xc == XC_HAIR); DisplayCDogsText(120, y, "Body", yc == YC_APPEARANCE && xc == XC_BODY); DisplayCDogsText(150, y, "Arms", yc == YC_APPEARANCE && xc == XC_ARMS); DisplayCDogsText(180, y, "Legs", yc == YC_APPEARANCE && xc == XC_LEGS); y += CDogsTextHeight(); sprintf(s, "Speed: %d%%", (100 * b->speed) / 256); DisplayCDogsText(20, y, s, yc == YC_ATTRIBUTES && xc == XC_SPEED); sprintf(s, "Hp: %d", b->maxHealth); DisplayCDogsText(70, y, s, yc == YC_ATTRIBUTES && xc == XC_HEALTH); sprintf(s, "Move: %d%%", b->bot.probabilityToMove); DisplayCDogsText(120, y, s, yc == YC_ATTRIBUTES && xc == XC_MOVE); sprintf(s, "Track: %d%%", b->bot.probabilityToTrack); DisplayCDogsText(170, y, s, yc == YC_ATTRIBUTES && xc == XC_TRACK); sprintf(s, "Shoot: %d%%", b->bot.probabilityToShoot); DisplayCDogsText(220, y, s, yc == YC_ATTRIBUTES && xc == XC_SHOOT); sprintf(s, "Delay: %d", b->bot.actionDelay); DisplayCDogsText(270, y, s, yc == YC_ATTRIBUTES && xc == XC_DELAY); y += CDogsTextHeight(); DisplayFlag(5, y, "Asbestos", (b->flags & FLAGS_ASBESTOS) != 0, yc == YC_FLAGS && xc == XC_ASBESTOS); DisplayFlag(50, y, "Immunity", (b->flags & FLAGS_IMMUNITY) != 0, yc == YC_FLAGS && xc == XC_IMMUNITY); DisplayFlag(95, y, "C-thru", (b->flags & FLAGS_SEETHROUGH) != 0, yc == YC_FLAGS && xc == XC_SEETHROUGH); DisplayFlag(140, y, "Run-away", (b->flags & FLAGS_RUNS_AWAY) != 0, yc == YC_FLAGS && xc == XC_RUNS_AWAY); DisplayFlag(185, y, "Sneaky", (b->flags & FLAGS_SNEAKY) != 0, yc == YC_FLAGS && xc == XC_SNEAKY); DisplayFlag(230, y, "Good guy", (b->flags & FLAGS_GOOD_GUY) != 0, yc == YC_FLAGS && xc == XC_GOOD_GUY); DisplayFlag(275, y, "Asleep", (b->flags & FLAGS_SLEEPALWAYS) != 0, yc == YC_FLAGS && xc == XC_SLEEPING); y += CDogsTextHeight(); DisplayFlag(5, y, "Prisoner", (b->flags & FLAGS_PRISONER) != 0, yc == YC_FLAGS2 && xc == XC_PRISONER); DisplayFlag(50, y, "Invuln.", (b->flags & FLAGS_INVULNERABLE) != 0, yc == YC_FLAGS2 && xc == XC_INVULNERABLE); DisplayFlag(95, y, "Follower", (b->flags & FLAGS_FOLLOWER) != 0, yc == YC_FLAGS2 && xc == XC_FOLLOWER); DisplayFlag(140, y, "Penalty", (b->flags & FLAGS_PENALTY) != 0, yc == YC_FLAGS2 && xc == XC_PENALTY); DisplayFlag(185, y, "Victim", (b->flags & FLAGS_VICTIM) != 0, yc == YC_FLAGS2 && xc == XC_VICTIM); DisplayFlag(230, y, "Awake", (b->flags & FLAGS_AWAKEALWAYS) != 0, yc == YC_FLAGS2 && xc == XC_AWAKE); y += CDogsTextHeight(); DisplayCDogsText(50, y, GunGetName(b->gun), yc == YC_WEAPON); y += CDogsTextHeight() + 5; x = 10; for (i = 0; i < setting->characters.otherCount; i++) { DisplayCharacter( x, y + 20, &setting->characters.others[i], idx == i, 0); x += 20; if (x > gGraphicsDevice.cachedConfig.ResolutionWidth) { x = 10; y += 30; } } } if (MouseTryGetRectTag(&gInputDevices.mouse, &tag)) { int mouseYc = tag & 0xFF; int mouseXc = (tag & 0xFF00) >> 8; Vec2i tooltipPos = Vec2iAdd( gInputDevices.mouse.currentPos, Vec2iNew(10, 10)); DrawTooltips(&gGraphicsDevice, tooltipPos, yc, xc, mouseYc, mouseXc); }