| 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/BriefingParse.h $ |
| 21 | * $Revision: 7 $ |
| 22 | * $Date: 4/17/99 6:15p $ |
| 23 | * $Author: Samir $ |
| 24 | * |
| 25 | * |
| 26 | * |
| 27 | * $Log: /DescentIII/main/BriefingParse.h $ |
| 28 | * |
| 29 | * 7 4/17/99 6:15p Samir |
| 30 | * replaced gr.h with grdefs.h and fixed resulting compile bugs. |
| 31 | * |
| 32 | * 6 4/16/99 1:51a Jeff |
| 33 | * include linux fix for stricmp |
| 34 | * |
| 35 | * 5 4/14/99 3:56a Jeff |
| 36 | * fixed case mismatch in #includes |
| 37 | * |
| 38 | * 4 1/04/99 12:32p Jeff |
| 39 | * added support for mission flag parsing |
| 40 | * |
| 41 | * 3 9/11/98 6:06p Jeff |
| 42 | * Briefing Editor completed |
| 43 | * |
| 44 | * 2 9/09/98 7:02p Jeff |
| 45 | * Initial Creation |
| 46 | * |
| 47 | * $NoKeywords: $ |
| 48 | */ |
| 49 | |
| 50 | #ifndef __BRIEFPARSE_H_ |
| 51 | #define __BRIEFPARSE_H_cxx . . $ `Descent3/BriefingParse.h:51:9`! |
| 52 | |
| 53 | #if defined(POSIXcxx . . $ `<built-in>:480:9`!) |
| 54 | #include "linux_fix.h"cxx . . $ `<file>/linux/linux_fix.h`/ //for stricmp |
| 55 | #endif |
| 56 | |
| 57 | #include "TelComEfxStructs.h"cxx . . $ `<file>/Descent3/TelComEfxStructs.h`/ |
| 58 | #include "grdefs.h"cxx . . $ `<file>/lib/grdefs.h`/ |
| 59 | |
| 60 | // Return codes of ParseBriefing |
| 61 | #define PBERR_FILENOTEXISTcxx . . $ `Descent3/BriefingParse.h:61:9`! -1 |
| 62 | #define PBERR_NOERRcxx . . $ `Descent3/BriefingParse.h:62:9`! 0 |
| 63 | |
| 64 | struct tBriefParseCallbackscxx . . $ tBriefParseCallbacks# { |
| 65 | void (*AddTextEffectcxx . . $ tBriefParseCallbacks#AddTextEffect.)(TCTEXTDESCcxx . . $ TCTEXTDESC#* desc, char *text, char *description, int id); |
| 66 | void (*AddBmpEffectcxx . . $ tBriefParseCallbacks#AddBmpEffect.)(TCBMPDESCcxx . . $ TCBMPDESC#* desc, char *description); |
| 67 | void (*AddMovieEffectcxx . . $ tBriefParseCallbacks#AddMovieEffect.)(TCMOVIEDESCcxx . . $ TCMOVIEDESC#* desc, char *description); |
| 68 | void (*AddBkgEffectcxx . . $ tBriefParseCallbacks#AddBkgEffect.)(TCBKGDESCcxx . . $ TCBKGDESC#* desc, char *description); |
| 69 | void (*AddPolyEffectcxx . . $ tBriefParseCallbacks#AddPolyEffect.)(TCPOLYDESCcxx . . $ TCPOLYDESC#* desc, char *description); |
| 70 | void (*AddSoundEffectcxx . . $ tBriefParseCallbacks#AddSoundEffect.)(TCSNDDESCcxx . . $ TCSNDDESC#* desc, char *description); |
| 71 | void (*AddButtonEffectcxx . . $ tBriefParseCallbacks#AddButtonEffect.)(TCBUTTONDESCcxx . . $ TCBUTTONDESC#* desc, char *description, int id); |
| 72 | void (*StartScreencxx . . $ tBriefParseCallbacks#StartScreen.)(int screen_num, char *description, char *layout, uint32_tcxx . . $ uint32_t# mask_set, uint32_tcxx . . $ uint32_t# mask_unset); |
| 73 | void (*EndScreencxx . . $ tBriefParseCallbacks#EndScreen.)(); |
| 74 | bool (*LoopCallbackcxx . . $ tBriefParseCallbacks#LoopCallback.)(); |
| 75 | void (*SetTitlecxx . . $ tBriefParseCallbacks#SetTitle.)(char *title); |
| 76 | void (*SetStaticcxx . . $ tBriefParseCallbacks#SetStatic.)(float amount); |
| 77 | void (*SetGlitchcxx . . $ tBriefParseCallbacks#SetGlitch.)(float amount); |
| 78 | void (*AddVoicecxx . . $ tBriefParseCallbacks#AddVoice.)(char *filename, int flags,char *description); |
| 79 | }; |
| 80 | |
| 81 | struct tTextBufferDesccxx . . $ tTextBufferDesc# { |
| 82 | TCTEXTDESCcxx . . $ TCTEXTDESC# textdesccxx . . $ tTextBufferDesc#textdesc.; |
| 83 | int text_idcxx . . $ tTextBufferDesc#text_id.; |
| 84 | int teffectcxx . . $ tTextBufferDesc#teffect.; |
| 85 | char descriptioncxx . . $ tTextBufferDesc#description.[128]; |
| 86 | }; |
| 87 | |
| 88 | class CBriefParsecxx . . $ CBriefParse# { |
| 89 | public: |
| 90 | CBriefParsecxx . . $ CBriefParse#CBriefParse(49f6e7a06ebc5aa8).(); |
| 91 | ~cxx . . $ CBriefParse#`~CBriefParse`(ced63f7c635d850d).CBriefParsecxx . . $ CBriefParse#(); |
| 92 | void SetCallbackscxx . . $ CBriefParse#SetCallbacks(9ee811468c67755d).(tBriefParseCallbackscxx . . $ tBriefParseCallbacks# *cb); |
| 93 | int ParseBriefingcxx . . $ CBriefParse#ParseBriefing(5c4306d8553b3696).(const char *filename); |
| 94 | |
| 95 | private: |
| 96 | void (*AddTextEffectcxx . . $ CBriefParse#AddTextEffect.)(TCTEXTDESCcxx . . $ TCTEXTDESC#* desc, char *text, char *description, int id); |
| 97 | void (*AddBmpEffectcxx . . $ CBriefParse#AddBmpEffect.)(TCBMPDESCcxx . . $ TCBMPDESC#* desc, char *description); |
| 98 | void (*AddMovieEffectcxx . . $ CBriefParse#AddMovieEffect.)(TCMOVIEDESCcxx . . $ TCMOVIEDESC#* desc, char *description); |
| 99 | void (*AddBkgEffectcxx . . $ CBriefParse#AddBkgEffect.)(TCBKGDESCcxx . . $ TCBKGDESC#* desc, char *description); |
| 100 | void (*AddPolyEffectcxx . . $ CBriefParse#AddPolyEffect.)(TCPOLYDESCcxx . . $ TCPOLYDESC#* desc, char *description); |
| 101 | void (*AddSoundEffectcxx . . $ CBriefParse#AddSoundEffect.)(TCSNDDESCcxx . . $ TCSNDDESC#* desc, char *description); |
| 102 | void (*AddButtonEffectcxx . . $ CBriefParse#AddButtonEffect.)(TCBUTTONDESCcxx . . $ TCBUTTONDESC#* desc, char *description, int id); |
| 103 | void (*StartScreencxx . . $ CBriefParse#StartScreen.)(int screen_num, char *desc, char *layout, uint32_tcxx . . $ uint32_t# mask_set, uint32_tcxx . . $ uint32_t# mask_unset); |
| 104 | void (*EndScreencxx . . $ CBriefParse#EndScreen.)(); |
| 105 | bool (*LoopCallbackcxx . . $ CBriefParse#LoopCallback.)(); |
| 106 | void (*SetTitlecxx . . $ CBriefParse#SetTitle.)(char *title); |
| 107 | void (*SetStaticcxx . . $ CBriefParse#SetStatic.)(float amount); |
| 108 | void (*SetGlitchcxx . . $ CBriefParse#SetGlitch.)(float amount); |
| 109 | void (*AddVoicecxx . . $ CBriefParse#AddVoice.)(char *filename, int flags, char *description); |
| 110 | |
| 111 | void ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).(const char *msg, const char *p = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 112 | const char *ParseCommacxx . . $ CBriefParse#ParseComma(fb58d2e09a2a1ce6).(const char *p); |
| 113 | const char *ParseFloatcxx . . $ CBriefParse#ParseFloat(2db94096432b516).(const char *p, float *f); |
| 114 | const char *ParseIntcxx . . $ CBriefParse#ParseInt(6a735779416056db).(const char *p, int *i); |
| 115 | const char *ParseStringcxx . . $ CBriefParse#ParseString(7e82c60a547522db).(const char *p, char *buf, int bufsize); |
| 116 | const char *ParseTokencxx . . $ CBriefParse#ParseToken(7e82c60a547522db).(const char *p, char *buf, int bufsize); |
| 117 | const char *SkipWhitecxx . . $ CBriefParse#SkipWhite(fb58d2e09a2a1ce6).(const char *p); |
| 118 | const char *ParseKeywordcxx . . $ CBriefParse#ParseKeyword(6a735779416056db).(const char *p, int *keyword_id); |
| 119 | bool ParseButtonEffectcxx . . $ CBriefParse#ParseButtonEffect(c5f7da30cbc0f4e9).(const char *p); |
| 120 | bool ParseTextEffectcxx . . $ CBriefParse#ParseTextEffect(7303da5f26e915b1).(const char *p, tTextBufferDesccxx . . $ tTextBufferDesc# *tbd); |
| 121 | |
| 122 | int linenumcxx . . $ CBriefParse#linenum.; |
| 123 | bool parse_errorcxx . . $ CBriefParse#parse_error.; |
| 124 | }; |
| 125 | |
| 126 | #endif |