//================================================================================================= void SingleInsideLocation::Save(GameWriter& f, bool local) { InsideLocation::Save(f, local); if(last_visit != -1) SaveLevel(f, local); }
int GotoGameCommon(int mode) { StopTime(); //@@ init_player_stats(); //@@ //@@ gameData.multiplayer.playerInit.position.vPos = Player->position.vPos; //@@ gameData.multiplayer.playerInit.position.mOrient = Player->position.mOrient; //@@ gameData.multiplayer.playerInit.nSegment = Player->nSegment; // -- must always save gamesave.sav because the restore-gameData.objs.objects code relies on it // -- that code could be made smarter and use the original file, if appropriate. // if (mine_changed) if (gamestate_not_restored == 0) { gamestate_not_restored = 1; SaveLevel("GAMESAVE.LVL"); editor_status("Gamestate saved.\n"); } AIResetAllPaths(); StartTime(); ModeFlag = mode; return 1; }
static glbsp_ret_e HandleLevel(void) { superblock_t *seg_list; node_t *root_node; node_t *root_stale_node; subsec_t *root_sub; glbsp_ret_e ret; if (cur_comms->cancelled) return GLBSP_E_Cancelled; DisplaySetBarLimit(1, 1000); DisplaySetBar(1, 0); cur_comms->build_pos = 0; LoadLevel(); InitBlockmap(); // create initial segs seg_list = CreateSegs(); root_stale_node = (num_stale_nodes == 0) ? NULL : LookupStaleNode(num_stale_nodes - 1); // recursively create nodes ret = BuildNodes(seg_list, &root_node, &root_sub, 0, root_stale_node); FreeSuper(seg_list); if (ret == GLBSP_E_OK) { ClockwiseBspTree(root_node); PrintVerbose("Built %d NODES, %d SSECTORS, %d SEGS, %d VERTEXES\n", num_nodes, num_subsecs, num_segs, num_normal_vert + num_gl_vert); if (root_node) PrintVerbose("Heights of left and right subtrees = (%d,%d)\n", ComputeBspHeight(root_node->r.node), ComputeBspHeight(root_node->l.node)); SaveLevel(root_node); } FreeLevel(); FreeQuickAllocCuts(); FreeQuickAllocSupers(); return ret; }
void Editor::ButtonDown(std::string button) { if (button == "1") { state->CurrentState = "none"; } else if (button == "2") { state->CurrentState = "terrain"; }else if (button == "3") { state->CurrentState = "physics"; } else if (button == " ") { SaveLevel("Level.txt"); } else if (button == "l") { LoadLevel("Level.txt"); } }
void MapEditor() { int key; clear(); ShowEditorWindow(); editing_terrain=FALSE; FillMap(); editing_terrain=TRUE; FillMap(); LoadLevel(); ShowEditorMap(); ShowEditorWindow(); mouse_on(ALL_MOUSE_EVENTS); nodelay(stdscr,TRUE); cbreak(); for(;;) { key=getch(); request_mouse_pos(); if (mouse_active && (MOUSE_X_POS!=cursor_x || MOUSE_Y_POS!=cursor_y)) { curs_set(0); EditorMoveCursor(MOUSE_X_POS,MOUSE_Y_POS); curs_set(2); } switch(key) { case KEY_F0+1: editing_terrain=TRUE; ShowEditorWindow(); break; case KEY_F0+2: editing_terrain=FALSE; ShowEditorWindow(); break; case KEY_F0+5: clear(); PlayLevel(); ClearAfterPlaying(); ShowEditorWindow(); mouse_on(ALL_MOUSE_EVENTS); nodelay(stdscr,TRUE); cbreak(); break; case KEY_F0+8: SaveLevel(); break; case KEY_F0+9: LoadLevel(); ShowEditorMap(); ShowEditorWindow(); break; case KEY_F0+12: FillMap(); break; case KEY_MOVE_LEFT: EditorMoveCursor(cursor_x-1,cursor_y); break; case KEY_MOVE_RIGHT: EditorMoveCursor(cursor_x+1,cursor_y); break; case KEY_MOVE_UP: EditorMoveCursor(cursor_x,cursor_y-1); break; case KEY_MOVE_DOWN: EditorMoveCursor(cursor_x,cursor_y+1); break; case KEY_MOUSE: case KEY_ACTION: curs_set(0); EditorAction(); move(cursor_y,cursor_x); curs_set(2); } } }
void DllWrapperSaveLevel( LPCTSTR lFileName ) { // When passing strings from C# to unmanaged dlls, you // have to pass as a LPCTSTR and cast to a char* SaveLevel( (char*)lFileName ); }
//----------------------------------------------------------------------------- // Name : DisplayWndProc () // Desc : The display devices internal WndProc function. All messages being // passed to this function are relative to the window it owns. //----------------------------------------------------------------------------- LRESULT CGameApp::DisplayWndProc( HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam ) { ULONG Direction = 0; // Determine message type switch (Message) { case WM_CREATE: break; case WM_CLOSE: PostQuitMessage(0); break; case WM_DESTROY: PostQuitMessage(0); break; case WM_SIZE: if ( wParam == SIZE_MINIMIZED ) { // App is inactive m_bActive = false; } // App has been minimized else { // App is active m_bActive = true; // Store new viewport sizes m_nViewWidth = LOWORD( lParam ); m_nViewHeight = HIWORD( lParam ); } // End if !Minimized break; case WM_LBUTTONDOWN: if(StartGame == true) { if(MoveBall == false || StickyBar == true) { FollowPlayer = false; LevelChange = false; MouseOrKeyboard = false; MoveBall = true; Direction |= Ball::DIR_START; m_pBall.lock()->Move(Direction,0); } } // Capture the mouse SetCapture( m_hWnd ); GetCursorPos( &m_OldCursorPos ); break; case WM_LBUTTONUP: // Release the mouse ReleaseCapture( ); break; case WM_KEYDOWN: switch(wParam) { case VK_ESCAPE: PostQuitMessage(0); break; case 0x50: if(m_bActive == true) m_bActive = false; else m_bActive = true; break; case 0x53: SaveLevel(); break; case 0x4C: StartLoad = true; break; case VK_SPACE: if(StartGame == true) { if(MoveBall == false || StickyBar == true) { FollowPlayer = false; LevelChange = false; MoveBall = true; Direction |= Ball::DIR_START; m_pBall.lock()->Move(Direction,0); } } break; } case WM_COMMAND: break; default: return DefWindowProc(hWnd, Message, wParam, lParam); } // End Message Switch return 0; }