/** * MouseShow turns on the mouse cursor. If the mouse was already on, * it increments the level of showing. Therefore, it will take an * equal number of MouseHide calls to turn the mouse off. * *<!-----------------------------------------------------------------------*/ T_void MouseShow(T_void) { #if 0 union REGPACK regs; DebugRoutine("MouseShow") ; DebugCheck(F_MouseIsInitialized == TRUE) ; if (G_mouseShowLevel == 0) { /* If the mouse was just hidden (and soon won't be), */ /* turn on the mouse. */ /* memset(®s,0,sizeof(union REGPACK)); regs.w.ax = 1; intr(0x33,®s); */ MouseDraw() ; } /* Increment the hide level */ G_mouseShowLevel++ ; /* Limit to 10 shows */ DebugCheck(G_mouseShowLevel < 10) ; DebugEnd() ; #endif }
static void Display(GraphicsDevice *g, int yc, HandleInputResult result) { char s[128]; int y = 5; int i; int w = g->cachedConfig.Res.x; int h = g->cachedConfig.Res.y; Mission *mission = CampaignGetCurrentMission(&gCampaign); if (mission) { // Re-make the background if the resolution has changed if (gEventHandlers.HasResolutionChanged) { MakeBackground(g, 0); } if (result.RemakeBg || brush.IsGuideImageNew) { // Clear background first for (i = 0; i < GraphicsGetScreenSize(&g->cachedConfig); i++) { g->buf[i] = PixelFromColor(g, colorBlack); } brush.IsGuideImageNew = false; GrafxDrawExtra extra; extra.guideImage = brush.GuideImageSurface; extra.guideImageAlpha = brush.GuideImageAlpha; GrafxDrawBackground(g, &sDrawBuffer, tintNone, camera, &extra); } GraphicsBlitBkg(g); // Draw brush highlight tiles if (brush.IsActive && IsBrushPosValid(brush.Pos, mission)) { EditorBrushSetHighlightedTiles(&brush); } for (i = 0; i < (int)brush.HighlightedTiles.size; i++) { Vec2i *pos = CArrayGet(&brush.HighlightedTiles, i); Vec2i screenPos = GetScreenPos(*pos); if (screenPos.x >= 0 && screenPos.x < w && screenPos.y >= 0 && screenPos.y < h) { DrawRectangle( g, screenPos, Vec2iNew(TILE_WIDTH, TILE_HEIGHT), colorWhite, DRAW_FLAG_LINE); } } sprintf( s, "Mission %d/%d", gCampaign.MissionIndex + 1, (int)gCampaign.Setting.Missions.size); TextStringMasked(&gTextManager, s, g, Vec2iNew(270, y), yc == YC_MISSIONINDEX ? colorRed : colorWhite); if (brush.LastPos.x) { sprintf(s, "(%d, %d)", brush.Pos.x, brush.Pos.y); TextString(&gTextManager, s, g, Vec2iNew(w - 40, h - 16)); } } else { ClearScreen(g); if (gCampaign.Setting.Missions.size) { sprintf(s, "End/%d", (int)gCampaign.Setting.Missions.size); TextStringMasked(&gTextManager, s, g, Vec2iNew(270, y), yc == YC_MISSIONINDEX ? colorRed : colorWhite); } } if (fileChanged) { DrawTPic(10, y, PicManagerGetOldPic(&gPicManager, 221)); } TextString(&gTextManager, "Press F1 for help", g, Vec2iNew(20, h - 20 - CDogsTextHeight())); y = 150; UIObjectDraw( sObjs, g, Vec2iZero(), gEventHandlers.mouse.currentPos, &sDrawObjs); if (result.WillDisplayAutomap && mission) { AutomapDraw(AUTOMAP_FLAGS_SHOWALL, true); } else { if (sTooltipObj && sTooltipObj->Tooltip) { UITooltipDraw( g, gEventHandlers.mouse.currentPos, sTooltipObj->Tooltip); } MouseDraw(&gEventHandlers.mouse); } BlitFlip(g, &gConfig.Graphics); }