void CT_Demo_Entry_Draw(int x, int y, int w, int h, CTab_t *tab, CTabPage_t *page) { int z; y = y - 32; if (demo_playlist_started && cls.demoplayback) { M_Print (24, y + 32, "Currently playing:"); M_PrintWhite (24, y + 40, demo_playlist[demo_playlist_current_played].name); } else { M_Print (24, y + 32, "Not playing anything"); } M_Print (24, y + 56, "Next demo"); M_Print (24, y + 64, "Previous demo"); M_Print (24, y + 72, "Stop playlist"); M_Print (24, y + 80, "Clear playlist"); if (demo_playlist_num > 0) { M_Print (24, y + 96, "Currently selected:"); M_Print (24, y + 104, demo_playlist[demo_playlist_cursor].name); } else { M_Print (24, y + 96, "No demo in playlist"); } if (strcasecmp(demo_playlist[demo_playlist_cursor].name + strlen(demo_playlist[demo_playlist_cursor].name) - 4, ".mvd")) { M_Print (24, y + 120, "Tracking only available with mvds"); } else { M_Print (24, y + 120, "Track"); M_DrawTextBox (160, y + 112, 16, 1); M_PrintWhite (168, y + 120, demo_track); if (demo_playlist_opt_cursor == 4 && demo_playlist_num > 0) M_DrawCharacter (168 + 8*strlen(demo_track), 120 + y, FLASHINGCURSOR()); } z = demo_playlist_opt_cursor + (demo_playlist_opt_cursor >= 4 ? 4 : 0); z = y + 56 + z * 8; M_DrawCharacter (8, z, FLASHINGARROW()); }
static void SearchLocalGames( void ) { M_DrawTextBox( 8, 120 - 48, 36, 3 ); M_Print( 16 + 16, 120 - 48 + 8, "Searching for local servers, this" ); M_Print( 16 + 16, 120 - 48 + 16, "could take up to a minute, so" ); M_Print( 16 + 16, 120 - 48 + 24, "please be patient." ); // the text box won't show up unless we do a buffer swap R_EndFrame(); m_num_servers = 0; s_joinserver_server_list.count = 0; M_LoadServersFromFile(); M_LoadServers(); // send out info packets M_PingServers(); }
// poly : the convex polygon that encloses all child subsectors static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *bbox) { node_t *bsp; poly_t *backpoly, *frontpoly; fdivline_t fdivline; polyvertex_t *pt; INT32 i; // Found a subsector? if (bspnum & NF_SUBSECTOR) { if (bspnum == -1) { // BP: i think this code is useless and wrong because // - bspnum==-1 happens only when numsubsectors == 0 // - it can't happens in bsp recursive call since bspnum is a INT32 and children is UINT16 // - the BSP is complet !! (there just can have subsector without segs) (i am not sure of this point) // do we have a valid polygon ? if (poly && poly->numpts > 2) { DEBPRINT("Adding a new subsector\n"); if (addsubsector == numsubsectors + NEWSUBSECTORS) I_Error("WalkBSPNode: not enough addsubsectors\n"); else if (addsubsector > 0x7fff) I_Error("WalkBSPNode: addsubsector > 0x7fff\n"); *leafnode = (UINT16)((UINT16)addsubsector | NF_SUBSECTOR); extrasubsectors[addsubsector].planepoly = poly; addsubsector++; } //add subsectors without segs here? //HWR_SubsecPoly(0, NULL); } else { HWR_SubsecPoly(bspnum&(~NF_SUBSECTOR), poly); //Hurdler: implement a loading status if (ls_count-- <= 0) { char s[16]; int x, y; I_OsPolling(); ls_count = numsubsectors/50; CON_Drawer(); sprintf(s, "%d%%", (++ls_percent)<<1); x = BASEVIDWIDTH/2; y = BASEVIDHEIGHT/2; V_DrawFill(0, 0, vid.width, vid.height, 31); // Black background to match fade in effect //V_DrawPatchFill(W_CachePatchName("SRB2BACK",PU_CACHE)); // SRB2 background, ehhh too bright. M_DrawTextBox(x-58, y-8, 13, 1); V_DrawString(x-50, y, V_YELLOWMAP, "Loading..."); V_DrawString(x+50-V_StringWidth(s), y, V_YELLOWMAP, s); // Is this really necessary at this point..? V_DrawCenteredString(BASEVIDWIDTH/2, 40, V_YELLOWMAP, "OPENGL MODE IS INCOMPLETE AND MAY"); V_DrawCenteredString(BASEVIDWIDTH/2, 50, V_YELLOWMAP, "NOT DISPLAY SOME SURFACES."); V_DrawCenteredString(BASEVIDWIDTH/2, 70, V_YELLOWMAP, "USE AT SONIC'S RISK."); I_UpdateNoVsync(); } } M_ClearBox(bbox); poly = extrasubsectors[bspnum&~NF_SUBSECTOR].planepoly; for (i = 0, pt = poly->pts; i < poly->numpts; i++,pt++) M_AddToBox(bbox, FLOAT_TO_FIXED(pt->x), FLOAT_TO_FIXED(pt->y)); return; } bsp = &nodes[bspnum]; SearchDivline(bsp, &fdivline); SplitPoly(&fdivline, poly, &frontpoly, &backpoly); poly = NULL; //debug if (!backpoly) nobackpoly++; // Recursively divide front space. if (frontpoly) { WalkBSPNode(bsp->children[0], frontpoly, &bsp->children[0],bsp->bbox[0]); // copy child bbox M_Memcpy(bbox, bsp->bbox[0], 4*sizeof (fixed_t)); } else I_Error("WalkBSPNode: no front poly?"); // Recursively divide back space. if (backpoly) { // Correct back bbox to include floor/ceiling convex polygon WalkBSPNode(bsp->children[1], backpoly, &bsp->children[1], bsp->bbox[1]); // enlarge bbox with seconde child M_AddToBox(bbox, bsp->bbox[1][BOXLEFT ], bsp->bbox[1][BOXTOP ]); M_AddToBox(bbox, bsp->bbox[1][BOXRIGHT ], bsp->bbox[1][BOXBOTTOM]); } }