2016-07-04 00:56:45 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2017-07-22 18:22:12 +02:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2016-07-04 00:56:45 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2017-07-22 18:22:12 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2016-07-04 00:56:45 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LIBSUPERDERPY_INTERNAL_H
|
|
|
|
#define LIBSUPERDERPY_INTERNAL_H
|
|
|
|
|
2017-09-10 21:35:14 +02:00
|
|
|
#include "libsuperderpy.h"
|
2016-07-04 00:56:45 +02:00
|
|
|
#include <allegro5/allegro.h>
|
|
|
|
#include <allegro5/allegro_font.h>
|
|
|
|
|
2016-07-04 01:12:55 +02:00
|
|
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
2017-09-10 21:35:14 +02:00
|
|
|
#define SYMBOL_INTERNAL
|
|
|
|
#define SYMBOL_EXPORT __declspec(dllexport)
|
|
|
|
#define SYMBOL_IMPORT __declspec(dllimport)
|
2016-07-04 01:12:55 +02:00
|
|
|
#else
|
2017-09-10 21:35:14 +02:00
|
|
|
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
|
|
|
#define SYMBOL_INTERNAL __attribute__((visibility("hidden")))
|
|
|
|
#define SYMBOL_EXPORT __attribute__((visibility("default")))
|
|
|
|
#else
|
|
|
|
#define SYMBOL_INTERNAL
|
|
|
|
#define SYMBOL_EXPORT
|
|
|
|
#endif
|
|
|
|
#define SYMBOL_IMPORT extern
|
2016-07-04 01:12:55 +02:00
|
|
|
#endif
|
|
|
|
|
2017-09-10 22:33:32 +02:00
|
|
|
#define STRINGIFY(a) #a
|
|
|
|
#if defined(__clang__) || defined(__codemodel__)
|
|
|
|
#define SUPPRESS_WARNING(x) _Pragma("clang diagnostic push") _Pragma(STRINGIFY(clang diagnostic ignored x))
|
|
|
|
#define SUPPRESS_END _Pragma("clang diagnostic pop")
|
|
|
|
#else
|
|
|
|
#define SUPPRESS_WARNING(x)
|
|
|
|
#define SUPPRESS_END
|
|
|
|
#endif
|
|
|
|
|
2016-09-08 00:32:21 +02:00
|
|
|
struct libsuperderpy_list {
|
2017-09-10 21:35:14 +02:00
|
|
|
void* data;
|
|
|
|
struct libsuperderpy_list* next;
|
2016-09-08 00:32:21 +02:00
|
|
|
};
|
|
|
|
|
2017-09-09 00:11:43 +02:00
|
|
|
struct GamestateLoadingThreadData {
|
2017-09-10 21:35:14 +02:00
|
|
|
struct Game* game;
|
|
|
|
struct Gamestate* gamestate;
|
|
|
|
int bitmap_flags;
|
2017-09-09 00:11:43 +02:00
|
|
|
};
|
|
|
|
|
2017-09-09 00:42:57 +02:00
|
|
|
struct ScreenshotThreadData {
|
2017-09-10 21:35:14 +02:00
|
|
|
struct Game* game;
|
|
|
|
ALLEGRO_BITMAP* bitmap;
|
2017-09-09 00:42:57 +02:00
|
|
|
};
|
|
|
|
|
2018-02-03 03:46:33 +01:00
|
|
|
void SimpleCompositor(struct Game* game, struct Gamestate* gamestates);
|
2017-09-10 21:35:14 +02:00
|
|
|
void DrawGamestates(struct Game* game);
|
2018-02-03 03:37:44 +01:00
|
|
|
void LogicGamestates(struct Game* game, double delta);
|
2017-09-10 21:35:14 +02:00
|
|
|
void EventGamestates(struct Game* game, ALLEGRO_EVENT* ev);
|
|
|
|
void ReloadGamestates(struct Game* game);
|
|
|
|
void FreezeGamestates(struct Game* game);
|
|
|
|
void UnfreezeGamestates(struct Game* game);
|
2018-02-03 03:46:33 +01:00
|
|
|
void ResizeGamestates(struct Game* game);
|
2017-09-10 21:35:14 +02:00
|
|
|
void DrawConsole(struct Game* game);
|
|
|
|
void Console_Load(struct Game* game);
|
|
|
|
void Console_Unload(struct Game* game);
|
|
|
|
void* GamestateLoadingThread(void* arg);
|
|
|
|
void* ScreenshotThread(void* arg);
|
|
|
|
void GamestateProgress(struct Game* game);
|
|
|
|
void* AddGarbage(struct Game* game, void* data);
|
|
|
|
void ClearGarbage(struct Game* game);
|
|
|
|
void ClearScreen(struct Game* game);
|
|
|
|
struct libsuperderpy_list* AddToList(struct libsuperderpy_list* list, void* data);
|
2018-05-31 20:52:16 +02:00
|
|
|
struct libsuperderpy_list* FindInList(struct libsuperderpy_list* list, void* data, bool (*identity)(struct libsuperderpy_list* elem, void* data));
|
|
|
|
void* RemoveFromList(struct libsuperderpy_list** list, void* data, bool (*identity)(struct libsuperderpy_list* elem, void* data));
|
2017-09-10 21:35:14 +02:00
|
|
|
void AddTimeline(struct Game* game, struct Timeline* timeline);
|
|
|
|
void RemoveTimeline(struct Game* game, struct Timeline* timeline);
|
|
|
|
void DrawTimelines(struct Game* game);
|
|
|
|
bool OpenGamestate(struct Game* game, struct Gamestate* gamestate);
|
|
|
|
bool LinkGamestate(struct Game* game, struct Gamestate* gamestate);
|
|
|
|
void CloseGamestate(struct Game* game, struct Gamestate* gamestate);
|
|
|
|
struct Gamestate* AllocateGamestate(struct Game* game, const char* name);
|
2017-09-20 18:11:29 +02:00
|
|
|
char* GetLibraryPath(struct Game* game, char* filename);
|
2018-04-16 01:06:58 +02:00
|
|
|
void PauseExecution(struct Game* game);
|
|
|
|
void ResumeExecution(struct Game* game);
|
2018-05-31 20:52:16 +02:00
|
|
|
void ReloadShaders(struct Game* game, bool force);
|
|
|
|
void DestroyShaders(struct Game* game);
|
2016-07-04 00:56:45 +02:00
|
|
|
|
|
|
|
#endif
|