| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Main/SmallViews.h $ |
| 21 | * $Revision: 11 $ |
| 22 | * $Date: 5/01/99 12:41a $ |
| 23 | * $Author: Matt $ |
| 24 | * |
| 25 | * Header for SmallViews.cpp |
| 26 | * |
| 27 | * $Log: /DescentIII/Main/SmallViews.h $ |
| 28 | * |
| 29 | * 11 5/01/99 12:41a Matt |
| 30 | * Added static when a small viewer object dies. |
| 31 | * |
| 32 | * 10 4/19/99 1:31p Matt |
| 33 | * Made guided missile small view use title and crosshairs flag, instead |
| 34 | * of doing special check for guided missile. |
| 35 | * |
| 36 | * 9 4/12/99 1:10a Matt |
| 37 | * Added labels for small views. |
| 38 | * |
| 39 | * 8 3/22/99 4:26p Samir |
| 40 | * added toggles for guided missile view and reticle. |
| 41 | * |
| 42 | * 7 2/10/99 1:47p Matt |
| 43 | * Changed object handle symbolic constants |
| 44 | * |
| 45 | * 6 1/13/99 12:42p Matt |
| 46 | * Added code to close a popup view |
| 47 | * |
| 48 | * 5 5/26/98 11:37a Matt |
| 49 | * Changed small view system to allow the popup window in any of the three |
| 50 | * positions, to allow any window to be the "bigger" size, and to restore |
| 51 | * the old view when a popup view goes away. |
| 52 | * |
| 53 | * 4 2/09/98 3:19p Matt |
| 54 | * Added function to return the viewer object for a small view |
| 55 | * |
| 56 | * 3 2/04/98 12:50a Matt |
| 57 | * Added ability to view from a gun point in small views. |
| 58 | * Made pop-up view separate from and bigger than other small views. |
| 59 | * Added real keys to set view mode in the three small views. |
| 60 | * Changed rendering functions a bit to accommodate smallview changes. |
| 61 | * |
| 62 | * 2 1/30/98 2:55p Matt |
| 63 | * Added SmallViews system |
| 64 | * |
| 65 | * 1 1/29/98 11:15a Matt |
| 66 | * |
| 67 | */ |
| 68 | |
| 69 | #include "descent.h" |
| 70 | |
| 71 | // Values for the small view windows |
| 72 | #define SVW_LEFT 0 |
| 73 | #define SVW_CENTER 1 |
| 74 | #define SVW_RIGHT 2 |
| 75 | |
| 76 | // Small view flags |
| 77 | #define SVF_POPUP 1 // This is a temporary window |
| 78 | #define SVF_BIGGER 2 // This window is drawn a little bigger than the normal window |
| 79 | #define SVF_REARVIEW 4 // Draw looking backward from the viewer |
| 80 | #define SVF_TIMED 8 // This window is timer-based. DO NOT USE THIS FLAG WHEN CALLING CreateSmallView(). |
| 81 | #define SVF_CROSSHAIRS 16 // This window has crosshairs |
| 82 | #define SVF_STATIC 32 // Window is showing static. The object handle is unused |
| 83 | |
| 84 | // if guided missile smallview is up, this will be true. |
| 85 | extern bool Guided_missile_smallview; |
| 86 | |
| 87 | // Create a new small view. If there is already a view in the given window, the old view gets blown away. |
| 88 | // Parameters: window - which window to open. See constants in SmallViews.h |
| 89 | // objhandle - handle for the object to view from |
| 90 | // flags - various view attributes. See defines in header file. |
| 91 | // time - how long to keep the window up. If 0, keep up indefinitely |
| 92 | // zoom - the zoom for this window. If 0, use the default zoom |
| 93 | // gun_num - which gun to view from. if -1, use viewer's center and orientation. |
| 94 | // label - the label for the window |
| 95 | // Returns: which window was opened, or -1 if window couldn't be created |
| 96 | int CreateSmallView(int window, int objhandle, int flags = 0, float time = 0.0, float zoom = D3_DEFAULT_ZOOM, |
| 97 | int gun_num = -1, const char *label = NULL); |
| 98 | |
| 99 | // Called to get rid of all the small views & init system |
| 100 | void ResetSmallViews(); |
| 101 | |
| 102 | // Draw all the active small views |
| 103 | void DrawSmallViews(); |
| 104 | |
| 105 | // Returns the viewer object for the specified small view. |
| 106 | // If the view isn't active, returns OBJECT_HANDLE_NONE. |
| 107 | int GetSmallViewer(int window); |
| 108 | |
| 109 | // Get rid of a small view |
| 110 | // Parameters: window - the window to get rid of |
| 111 | void CloseSmallView(int window); |
| 112 | |
| 113 | // Get rid of a small view if it's a popup window |
| 114 | // Parameters: window - the window to get rid of |
| 115 | void ClosePopupView(int window); |