Debian Codegraph @

manage/doorpage.h

raw symbols SCIP
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
19 #ifndef DOORPAGE_H
20 #define DOORPAGE_H
21
22 #include "manage.h"
23 #include "door.h"
24 #include "cfile.h"
25 #include "pstypes.h"
26
27 struct mngs_door_page {
28 door door_struct;
29 char image_name[PAGENAME_LEN];
30 char open_sound_name[PAGENAME_LEN];
31 char close_sound_name[PAGENAME_LEN];
32 };
33
34 // Door page functions
35 //---------------------------------------------------------------
36
37 // Given an open file pointer and a door_page struct, writes that doorpage out
38 void mng_WriteDoorPage(CFILE *outfile, mngs_door_page *doorpage);
39
40 // Reads a door page from an open file. Returns 0 on error.
41 int mng_ReadDoorPage(CFILE *infile, mngs_door_page *doorpage);
42
43 // Given an open file pointer and a door_page struct, writes that doorpage out
44 void mng_WriteNewDoorPage(CFILE *outfile, mngs_door_page *doorpage);
45
46 // Reads a door page from an open file. Returns 0 on error.
47 int mng_ReadNewDoorPage(CFILE *infile, mngs_door_page *doorpage);
48
49 // Reads in the doorpage named "name" into doorpage struct
50 // Returns 0 on error or couldn't find, else 1 if all is good
51 int mng_FindSpecificDoorPage(char *name, mngs_door_page *doorpage, int offset = 0);
52
53 // Given a door page, allocs a door and calls AssignDoorPageToDoor to actually
54 // load model and values. Rturns door handle on success, -1 if fail
55 int mng_SetAndLoadDoor(mngs_door_page *doorpage);
56
57 // Given a doorpage and a door handle, attempts to make door n correspond to
58 // to the doorpage.
59 // Returns 1 on success, 0 otherwise
60 int mng_AssignDoorPageToDoor(mngs_door_page *doorpage, int n);
61
62 // Copies values from a Door into a door_page
63 void mng_AssignDoorToDoorPage(int n, mngs_door_page *doorpage);
64
65 // Reads in a door page from the local table file, superseding any door
66 // already in RAM with that same name
67 void mng_LoadLocalDoorPage(CFILE *);
68
69 // Reads in a page off the net
70 void mng_LoadNetDoorPage(CFILE *, bool overlay = false);
71
72 #endif