| 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 MOVIE_H_ |
| 20 | #define MOVIE_H_cxx . . $ `Descent3/d3movie.h:20:9`! |
| 21 | |
| 22 | #include <cstdint> |
| 23 | #include <filesystem> |
| 24 | |
| 25 | #include "application.h"cxx . . $ `<file>/lib/application.h`/ |
| 26 | #include "renderer.h"cxx . . $ `<file>/lib/renderer.h`/ |
| 27 | |
| 28 | #define MVELIB_NOERRORcxx . . $ `Descent3/d3movie.h:28:9`! 0 |
| 29 | #define MVELIB_FILE_ERRORcxx . . $ `Descent3/d3movie.h:29:9`! (-1) |
| 30 | #define MVELIB_NOTINIT_ERRORcxx . . $ `Descent3/d3movie.h:30:9`! (-2) |
| 31 | #define MVELIB_DDGR_ERRORcxx . . $ `Descent3/d3movie.h:31:9`! (-3) |
| 32 | #define MVELIB_INIT_ERRORcxx . . $ `Descent3/d3movie.h:32:9`! (-4) |
| 33 | #define MVELIB_PLAYBACK_ERRORcxx . . $ `Descent3/d3movie.h:33:9`! (-5) |
| 34 | #define MVELIB_PLAYBACK_ABORTEDcxx . . $ `Descent3/d3movie.h:34:9`! (-6) |
| 35 | |
| 36 | int mve_Initcxx . . $ mve_Init(5ae29d726ae57f88).(const char *dir, const char *sndcard); |
| 37 | |
| 38 | // simply plays a movie. |
| 39 | int mve_PlayMoviecxx . . $ mve_PlayMovie(1d7e1054ee864747).(const stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# &pMovieName, oeApplicationcxx . . $ oeApplication# *pApp); |
| 40 | |
| 41 | // used to copy movie data to a pointer, looping will loop, fhandle will be a pointer to a file handle to be returned |
| 42 | // handle to movie sequence is returned by function. |
| 43 | intptr_tcxx . . $ intptr_t# mve_SequenceStartcxx . . $ mve_SequenceStart(290e4e6c58f7778e).(const char *mvename, void *fhandle, oeApplicationcxx . . $ oeApplication# *app, bool looping = false); |
| 44 | |
| 45 | // frames movies started with SequenceStart. Optionally, pass a pointer to a variable which will receive |
| 46 | // bitmap handle containing data, nx and ny will contain adjusted x and y coordinates if needed. |
| 47 | // passing -1 to x and y centers the frame on that axis |
| 48 | // handle is the movie handle returned by mve_Sequence start |
| 49 | // returned value is the handle passed into mve_SequenceFrame or new one if movie looped. |
| 50 | intptr_tcxx . . $ intptr_t# mve_SequenceFramecxx . . $ mve_SequenceFrame(688560c0d8406393).(intptr_tcxx . . $ intptr_t# handle, void *fhandle, bool sequence, int *bm_handle); |
| 51 | |
| 52 | bool mve_SequenceClosecxx . . $ mve_SequenceClose(b2ca06e953f3967f).(intptr_tcxx . . $ intptr_t# handle, void *fhandle); |
| 53 | |
| 54 | // sets render frame boundaries. |
| 55 | void mve_SetRenderPropertiescxx . . $ mve_SetRenderProperties(aca4f8ddff7084a4).(int16_t x, int16_t y, int16_t w, int16_t h, renderer_typecxx . . $ renderer_type# type, bool hicolor); |
| 56 | |
| 57 | // called every frame. |
| 58 | typedef void (*MovieFrameCallback_fpcxx . . $ MovieFrameCallback_fp#)(int x, int y, int movieFrameNum); |
| 59 | void mve_SetCallbackcxx . . $ mve_SetCallback(d20c6d03e4c9e417).(MovieFrameCallback_fpcxx . . $ MovieFrameCallback_fp# callBack); |
| 60 | |
| 61 | // call to print out text. |
| 62 | void mve_Putscxx . . $ mve_Puts(fd7f3a04a1c20bf5).(int16_t x, int16_t y, ddgr_colorcxx . . $ ddgr_color# col, const char *txt); |
| 63 | |
| 64 | void mve_ClearRectcxx . . $ mve_ClearRect(6f3a90be462c391b).(int16_t x1, int16_t y1, int16_t x2, int16_t y2); |
| 65 | |
| 66 | #endif |