/******************************* * Callbacks *******************************/ void Core_SaveCallback(void * reserved) { SaveModList(&g_OBSESerializationInterface); g_StringMap.Save(&g_OBSESerializationInterface); g_ArrayMap.Save(&g_OBSESerializationInterface); SaveGlobals (&g_OBSESerializationInterface); }
static void _stdcall SaveGame2() { char buf[MAX_PATH]; GetSavePath(buf, "gv"); dlog_f("Saving game: %s\r\n", DL_MAIN, buf); DWORD size, unused = 0; HANDLE h = CreateFileA(buf, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); if (h != INVALID_HANDLE_VALUE) { SaveGlobals(h); WriteFile(h, &unused, 4, &size, 0); unused++; WriteFile(h, &unused, 4, &size, 0); PerksSave(h); SaveArrays(h); CloseHandle(h); } else { dlogr("ERROR creating sfallgv!", DL_MAIN); DisplayConsoleMessage(SaveSfallDataFailMsg); PlaySfx("IISXXXX1"); } GetSavePath(buf, "fs"); h = CreateFileA(buf, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); if (h != INVALID_HANDLE_VALUE) { FileSystemSave(h); } CloseHandle(h); }
void PolyDrawLinePortal::Render(int portalDepth) { SaveGlobals(); // Find portal destination line and make sure it faces the right way line_t *clipLine = Portal ? Portal->mDestination : Mirror; DVector2 pt1 = clipLine->v1->fPos() - PolyRenderer::Instance()->Viewpoint.Pos; DVector2 pt2 = clipLine->v2->fPos() - PolyRenderer::Instance()->Viewpoint.Pos; bool backfacing = (pt1.Y * (pt1.X - pt2.X) + pt1.X * (pt2.Y - pt1.Y) >= 0); PortalViewpoint = PolyRenderer::Instance()->SetupPerspectiveMatrix(Mirror != nullptr); PortalViewpoint.StencilValue = StencilValue; PortalViewpoint.PortalDepth = portalDepth; PortalViewpoint.PortalEnterLine = clipLine; PortalViewpoint.PortalEnterSector = backfacing ? clipLine->frontsector : clipLine->backsector; PolyRenderer::Instance()->Scene.Render(&PortalViewpoint); RestoreGlobals(); }
void PolyDrawSectorPortal::Render(int portalDepth) { if (Portal->mType == PORTS_HORIZON || Portal->mType == PORTS_PLANE) return; /*angle_t angle1 = PolyCull::PointToPseudoAngle(v1->fX(), v1->fY()); angle_t angle2 = PolyCull::PointToPseudoAngle(v2->fX(), v2->fY()); Segments.clear(); Segments.push_back({ angle1, angle2 });*/ SaveGlobals(); PortalViewpoint = PolyRenderer::Instance()->SetupPerspectiveMatrix(); PortalViewpoint.StencilValue = StencilValue; PortalViewpoint.PortalDepth = portalDepth; PortalViewpoint.PortalEnterSector = Portal->mDestination; PolyRenderer::Instance()->Scene.Render(&PortalViewpoint); RestoreGlobals(); }
void MakeTopBox() { Widget form, command, label; /* widgets. */ Arg arglist[TOPARGS]; /* An argument list */ Cardinal num_args = 0; /* The number of arguments. */ ManpageGlobals * man_globals; static char * full_size[] = { "topLabel", MANPAGE_BUTTON, NULL }; static char * half_size[] = { HELP_BUTTON, QUIT_BUTTON, NULL }; /* create the top icon. */ num_args = 0; XtSetArg(arglist[num_args], XtNiconPixmap, XCreateBitmapFromData( XtDisplay(initial_widget), XtScreen(initial_widget)->root, (char *)iconclosed_bits, iconclosed_width, iconclosed_height)); num_args++; XtSetArg(arglist[num_args], XtNtitle, resources.title); num_args++; XtSetArg(arglist[num_args], XtNiconic, resources.iconic); num_args++; top = XtCreatePopupShell(TOPBOXNAME, topLevelShellWidgetClass, initial_widget, arglist, num_args); form = XtCreateManagedWidget("form", formWidgetClass, top, NULL, (Cardinal) 0); label = XtCreateManagedWidget("topLabel", labelWidgetClass, form, NULL, (Cardinal) 0); num_args = 0; XtSetArg(arglist[num_args], XtNfromVert, label); num_args++; command = XtCreateManagedWidget(HELP_BUTTON, commandWidgetClass, form, arglist, num_args); /* use same vertical as help widget. */ XtSetArg(arglist[num_args], XtNfromHoriz, command); num_args++; command = XtCreateManagedWidget(QUIT_BUTTON, commandWidgetClass, form, arglist, num_args); num_args = 0; XtSetArg(arglist[num_args], XtNfromVert, command); num_args++; command = XtCreateManagedWidget(MANPAGE_BUTTON, commandWidgetClass, form, arglist, num_args); help_widget = NULL; /* We have not seen the help yet. */ FormUpWidgets(form, full_size, half_size); XtRealizeWidget(top); /* add WM_COMMAND property */ XSetCommand(XtDisplay(top), XtWindow(top), saved_argv, saved_argc); man_globals = (ManpageGlobals*) XtMalloc( (Cardinal) sizeof(ManpageGlobals)); man_globals->label = NULL; man_globals->manpagewidgets.directory = NULL; man_globals->manpagewidgets.manpage = NULL; man_globals->manpagewidgets.box = NULL; man_globals->current_directory = 0; MakeSearchWidget(man_globals, top); MakeSaveWidgets(man_globals, top); SaveGlobals( (man_globals->This_Manpage = top), man_globals); XtMapWidget(top); AddCursor(top, resources.cursors.top); /* * Set up ICCCM delete window. */ wm_delete_window = XInternAtom(XtDisplay(top), "WM_DELETE_WINDOW", False); XtOverrideTranslations (top, XtParseTranslationTable ("<Message>WM_PROTOCOLS: Quit()")); (void) XSetWMProtocols (XtDisplay(top), XtWindow(top), &wm_delete_window, 1); }