| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
#pragma once |
| 50 |
|
| 51 |
#include <SDL_endian.h> |
| 52 |
|
| 53 |
#include "sys_config.h" |
| 54 |
#include "gamedata.h" |
| 55 |
#include "sys_specifics.h" |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
#ifdef _MSC_VER |
| 80 |
#pragma pack(push, 1) |
| 81 |
#endif |
| 82 |
typedef struct |
| 83 |
{ |
| 84 |
int32_t armedBodyPic; |
| 85 |
int32_t unarmedBodyPic; |
| 86 |
int32_t facePic; |
| 87 |
int32_t speed; |
| 88 |
int32_t probabilityToMove; |
| 89 |
int32_t probabilityToTrack; |
| 90 |
int32_t probabilityToShoot; |
| 91 |
int32_t actionDelay; |
| 92 |
int32_t gun; |
| 93 |
int32_t skinColor; |
| 94 |
int32_t armColor; |
| 95 |
int32_t bodyColor; |
| 96 |
int32_t legColor; |
| 97 |
int32_t hairColor; |
| 98 |
int32_t health; |
| 99 |
int32_t flags; |
| 100 |
} |
| 101 |
#ifndef _MSC_VER |
| 102 |
__attribute__((packed)) |
| 103 |
#endif |
| 104 |
TBadGuy; |
| 105 |
#ifdef _MSC_VER |
| 106 |
#pragma pack(pop) |
| 107 |
#endif |
| 108 |
|
| 109 |
|
| 110 |
typedef struct |
| 111 |
{ |
| 112 |
char title[40]; |
| 113 |
char author[40]; |
| 114 |
char description[200]; |
| 115 |
int missionCount; |
| 116 |
struct MissionOld *missions; |
| 117 |
int characterCount; |
| 118 |
TBadGuy *characters; |
| 119 |
} CampaignSettingOld; |
| 120 |
|
| 121 |
|
| 122 |
#ifdef _MSC_VER |
| 123 |
#pragma pack(push, 1) |
| 124 |
#endif |
| 125 |
struct MissionObjectiveOld |
| 126 |
{ |
| 127 |
char description[60]; |
| 128 |
int32_t type; |
| 129 |
int32_t index; |
| 130 |
int32_t count; |
| 131 |
int32_t required; |
| 132 |
int32_t flags; |
| 133 |
} |
| 134 |
#ifndef _MSC_VER |
| 135 |
__attribute__((packed)) |
| 136 |
#endif |
| 137 |
; |
| 138 |
#ifdef _MSC_VER |
| 139 |
#pragma pack(pop) |
| 140 |
#endif |
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
#define BADDIE_MAX 12 |
| 145 |
#define SPECIAL_MAX 6 |
| 146 |
#define ITEMS_MAX 16 |
| 147 |
|
| 148 |
#define WEAPON_MAX 11 |
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
#ifdef _MSC_VER |
| 153 |
#pragma pack(push, 1) |
| 154 |
#endif |
| 155 |
struct MissionOld |
| 156 |
{ |
| 157 |
char title[60]; |
| 158 |
char description[400]; |
| 159 |
int32_t wallStyle; |
| 160 |
int32_t floorStyle; |
| 161 |
int32_t roomStyle; |
| 162 |
int32_t exitStyle; |
| 163 |
int32_t keyStyle; |
| 164 |
int32_t doorStyle; |
| 165 |
|
| 166 |
int32_t mapWidth, mapHeight; |
| 167 |
int32_t wallCount, wallLength; |
| 168 |
int32_t roomCount; |
| 169 |
int32_t squareCount; |
| 170 |
|
| 171 |
int32_t exitLeft, exitTop, exitRight, exitBottom; |
| 172 |
|
| 173 |
int32_t objectiveCount; |
| 174 |
struct MissionObjectiveOld objectives[OBJECTIVE_MAX_OLD]; |
| 175 |
|
| 176 |
int32_t baddieCount; |
| 177 |
int32_t baddies[BADDIE_MAX]; |
| 178 |
int32_t specialCount; |
| 179 |
int32_t specials[SPECIAL_MAX]; |
| 180 |
int32_t itemCount; |
| 181 |
int32_t items[ITEMS_MAX]; |
| 182 |
int32_t itemDensity[ITEMS_MAX]; |
| 183 |
|
| 184 |
int32_t baddieDensity; |
| 185 |
int32_t weaponSelection; |
| 186 |
|
| 187 |
char song[80]; |
| 188 |
char map[80]; |
| 189 |
|
| 190 |
int32_t wallRange; |
| 191 |
int32_t floorRange; |
| 192 |
int32_t roomRange; |
| 193 |
int32_t altRange; |
| 194 |
} |
| 195 |
#ifndef _MSC_VER |
| 196 |
__attribute__((packed)) |
| 197 |
#endif |
| 198 |
; |
| 199 |
#ifdef _MSC_VER |
| 200 |
#pragma pack(pop) |
| 201 |
#endif |
| 202 |
|
| 203 |
void ConvertCampaignSetting(CampaignSetting *dest, CampaignSettingOld *src); |
| 204 |
void ConvertCharacterColors( |
| 205 |
const int skin, const int arm, const int body, const int leg, |
| 206 |
const int hair, CharColors *c); |
| 207 |
void ConvertHairColors(Character *ch, const char *face); |
| 208 |
|
| 209 |
int ScanCampaignOld(const char *filename, char **title, int *missions); |
| 210 |
int IsCampaignOldFile(const char *filename); |
| 211 |
int LoadCampaignOld(const char *filename, CampaignSettingOld *setting); |
| 212 |
|
| 213 |
const char *GetHomeDirectory(void); |
| 214 |
const char *GetConfigFilePath(const char *name); |
| 215 |
|
| 216 |
void SetupConfigDir(void); |
| 217 |
|
| 218 |
size_t f_read(FILE *f, void *buf, size_t size); |
| 219 |
size_t f_read16(FILE *f, void *buf, size_t size); |
| 220 |
|
| 221 |
void swap16 (void *d); |
| 222 |
|
| 223 |
|
| 224 |
color_t RangeToColor(const int range); |
| 225 |
#define COLORRANGE_COUNT 27 |
| 226 |
|
| 227 |
bool mkdir_deep(const char *path); |