Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

Among Us: panels packed with DEFLATE and unpacked when shown

Mason3634b6554d0979a
diff --git a/games/amongus/src/data.bin b/games/amongus/src/data.bin
index 34c592b7..7aa060e2 100644
Binary files a/games/amongus/src/data.bin and b/games/amongus/src/data.bin differ
diff --git a/games/amongus/src/data.h b/games/amongus/src/data.h
index 790eb7f0..ef7cdd76 100644
--- a/games/amongus/src/data.h
+++ b/games/amongus/src/data.h
@@ -2,36 +2,39 @@
#ifndef AU_DATA_H
#define AU_DATA_H
#include <stdint.h>
-#define N_PICS 203
+#define N_PICS 280
#define N_FONTS 4
-#define BLOB_SHIP 207
-#define BLOB_FRONT_MASKS 208
-#define BLOB_MG_CARD 209
-#define BLOB_MG_WIRES 210
-#define BLOB_MG_ASTEROIDS 211
-#define BLOB_MG_ALIGN 212
-#define BLOB_MG_SCAN 213
-#define BLOB_MG_SAMPLE 214
-#define BLOB_MG_FUEL1 215
-#define BLOB_MG_FUEL2 216
-#define BLOB_MG_SIMON 217
-#define BLOB_MG_GARBAGE 218
-#define BLOB_MG_UPLOAD 219
-#define BLOB_MG_CALIBRATE 220
-#define BLOB_MG_COURSE 221
-#define BLOB_MG_LEAVES 222
-#define BLOB_MG_MANIFOLDS 223
-#define BLOB_MG_STEERING 224
-#define BLOB_MG_SHIELDS 225
-#define BLOB_MG_DIVERT 226
-#define BLOB_MG_ACCEPT 227
-#define BLOB_MG_HANDS 228
-#define BLOB_MG_LIGHTS 229
-#define BLOB_MG_COMMS 230
-#define BLOB_MG_KEYPAD 231
-#define BLOB_MG_CAMS 232
-#define BLOB_MG_EMERGENCY 233
-#define BLOB_MIX 234
+#define BLOB_SHIP 284
+#define BLOB_FRONT_MASKS 285
+#define BLOB_MEETING 286
+#define BLOB_KILLBG 287
+#define BLOB_KMIX 288
+#define BLOB_MG_CARD 289
+#define BLOB_MG_WIRES 290
+#define BLOB_MG_ASTEROIDS 291
+#define BLOB_MG_ALIGN 292
+#define BLOB_MG_SCAN 293
+#define BLOB_MG_SAMPLE 294
+#define BLOB_MG_FUEL1 295
+#define BLOB_MG_FUEL2 296
+#define BLOB_MG_SIMON 297
+#define BLOB_MG_GARBAGE 298
+#define BLOB_MG_UPLOAD 299
+#define BLOB_MG_CALIBRATE 300
+#define BLOB_MG_COURSE 301
+#define BLOB_MG_LEAVES 302
+#define BLOB_MG_MANIFOLDS 303
+#define BLOB_MG_STEERING 304
+#define BLOB_MG_SHIELDS 305
+#define BLOB_MG_DIVERT 306
+#define BLOB_MG_ACCEPT 307
+#define BLOB_MG_HANDS 308
+#define BLOB_MG_LIGHTS 309
+#define BLOB_MG_COMMS 310
+#define BLOB_MG_KEYPAD 311
+#define BLOB_MG_CAMS 312
+#define BLOB_MG_EMERGENCY 313
+#define BLOB_MIX 314
#define N_MIX 256
#define MG_X 160
#define MG_Y 112
@@ -55,227 +58,265 @@ enum { FONT_SMALL, FONT_MID, FONT_BIG, FONT_HUGE };
typedef struct { uint32_t off; int16_t x, y; uint16_t w, h; float z; } FrontRec;
#define N_FRONT 58
static const FrontRec FRONT[58] = {{0, 1946, 1403, 97, 144, 4.45048e-07f}, {1872, 1968, 1474, 67, 72, 4.45048e-07f}, {2520, 1950, 1423, 67, 72, 1.01725e-06f}, {3168, 1396, 763, 20, 12, 1.40841e-06f}, {3204, 1555, 763, 23, 12, 1.40841e-06f}, {3240, 1279, 828, 271, 189, -3.88f}, {9666, 1432, 946, 96, 52, -0.00820028f}, {10290, 1559, 948, 17, 34, -0.00832028f}, {10392, 1389, 947, 14, 34, -0.00832028f}, {10460, 1454, 946, 56, 29, -0.1282f}, {10663, 1153, 754, 16, 12, -1.6f}, {10687, 2599, 617, 34, 71, -0.00520021f}, {11042, 2543, 519, 38, 39, -0.00292054f}, {11237, 2410, 531, 163, 196, -3.88f}, {15353, 2523, 752, 27, 35, -0.0060402f}, {15493, 2545, 617, 33, 37, -0.00472013f}, {15678, 2512, 543, 32, 32, -0.00352021f}, {15806, 1868, 50, 39, 48, 0.00187957f}, {16046, 1716, 234, 72, 21, 0.00031986f}, {16235, 1959, 156, 59, 52, -0.28f}, {16651, 1665, 29, 264, 235, -3.64f}, {24406, 1746, 1138, 210, 229, -0.52f}, {30589, 1711, 1312, 74, 45, -0.0136004f}, {31039, 1960, 1127, 59, 19, -0.0107205f}, {31191, 1940, 1293, 21, 82, -0.52f}, {31437, 2170, 561, 16, 12, -1.6f}, {31461, 347, 986, 102, 79, -0.0100005f}, {32488, 317, 1051, 33, 30, -0.0101205f}, {32638, 398, 845, 202, 32, -1.6f}, {33470, -683, 509, 191, 333, -4.0012f}, {41462, -737, 571, 74, 81, -0.4012f}, {42272, 868, 1220, 156, 161, -0.0126404f}, {45492, 1037, 1190, 34, 16, -0.0246404f}, {45572, 1040, 1137, 28, 36, -0.0366404f}, {45716, 881, 1374, 17, 23, -0.0126524f}, {45785, -373, 1123, 149, 131, -0.0112006f}, {48274, -360, 1261, 23, 32, -0.0113206f}, {48370, -189, 1053, 10, 36, -4.012f}, {48442, -189, 1271, 10, 36, -4.012f}, {48514, -330, 1134, 33, 14, -4.012f}, {48584, -427, 1272, 24, 22, -0.0113206f}, {48650, -300, 1247, 104, 21, -0.0113206f}, {48923, -188, 1133, 30, 73, -0.0110806f}, {49215, 537, 95, 16, 12, -1.48f}, {49239, -313, 613, 16, 12, -1.6f}, {49263, -375, 147, 149, 131, 0.000799815f}, {51752, -362, 285, 23, 32, 0.000679815f}, {51848, -191, 78, 10, 36, -4.0f}, {51920, -191, 295, 10, 36, -4.0f}, {51992, -332, 158, 33, 14, -4.0f}, {52062, -429, 296, 24, 21, 0.000679815f}, {52125, -302, 271, 104, 21, 0.000679815f}, {52398, -190, 157, 30, 73, 0.000919815f}, {52690, 1398, 1596, 100, 52, -0.0172001f}, {53366, 1409, 1624, 87, 38, -0.0292001f}, {53784, 1332, 1428, 211, 172, -4.12f}, {58428, 1606, 1526, 25, 59, -0.0162406f}, {58664, 1248, 1526, 26, 59, -0.01624f}};
-#define PIC_MG_CARD_TOP 88
+#define PIC_PLATE_PLAYER 88
+#define PIC_VOTE_ICON 89
+#define PIC_UI_USEBUTTON 90
+#define PIC_UI_REPORTBUTTON 91
+#define PIC_UI_KILLBUTTON 92
+#define PIC_UI_VENT 93
+#define PIC_UI_SABOTAGE 94
+#define PIC_UI_MAPADMIN 95
+#define PIC_UI_SECURITY 96
+#define PIC_UI_VOTEPLAYERBASE 97
+#define PIC_UI_REPORTED 98
+#define PIC_UI_DEADX_BORDER 99
+#define PIC_UI_I_VOTED 100
+#define PIC_UI_VOTECONFIRM 101
+#define PIC_UI_VOTECANCEL 102
+#define PIC_UI_BUTTON_SKIPVOTE_EDIT 103
+#define PIC_UI_SKIPPEDVOTINGTALLY 104
+#define PIC_UI_SABOTAGE_DOORS 105
+#define PIC_UI_SABOTAGE_O2 106
+#define PIC_UI_SABOTAGE_COMMS 107
+#define PIC_UI_SABOTAGE_ELECTRICITY 108
+#define PIC_UI_SABOTAGE_REACTOR 109
+#define PIC_UI_TASK 110
+#define PIC_UI_BEFOREVOTING_DEADBODY 111
+#define PIC_UI_BANNERLOGO_AMONGUS 112
+#define PIC_UI_MAP 113
+#define PIC_UI_BEFOREVOTING_DEADBODYTEXT 114
+#define PIC_UI_BEFOREVOTING_EMTEXT 115
+#define PIC_UI_NO_SHH 116
+#define MAP_SCALE 0.310204f
+#define MEET_SCALE 0.375f
+#define N_KILL_IMP 24
+#define N_KILL_VICTIM 24
+#define PIC_KILL_IMP 117
+#define PIC_KILL_VICTIM 141
+#define N_KMIX 256
+#define KILL_PIC_MAX 7944
+#define PIC_MG_CARD_TOP 165
#define MG_CARD_TOP_X 160
#define MG_CARD_TOP_Y 46
-#define PIC_MG_CARD_FRONT 89
+#define PIC_MG_CARD_FRONT 166
#define MG_CARD_FRONT_X 117
#define MG_CARD_FRONT_Y 195
-#define PIC_MG_CARD_CARD 90
+#define PIC_MG_CARD_CARD 167
#define MG_CARD_CARD_X 117
#define MG_CARD_CARD_Y 188
-#define PIC_MG_CARD_GREEN 91
+#define PIC_MG_CARD_GREEN 168
#define MG_CARD_GREEN_X 246
#define MG_CARD_GREEN_Y 65
-#define PIC_MG_CARD_RED 92
+#define PIC_MG_CARD_RED 169
#define MG_CARD_RED_X 230
#define MG_CARD_RED_Y 65
-#define PIC_MG_WIRES_HEAD 93
+#define PIC_MG_WIRES_HEAD 170
#define MG_WIRES_HEAD_X 103
#define MG_WIRES_HEAD_Y 52
static const int16_t MG_WIRES_HEAD_XY[4][2] = {{103, 52}, {103, 94}, {103, 135}, {103, 177}};
-#define PIC_MG_WIRES_RNODE 94
+#define PIC_MG_WIRES_RNODE 171
#define MG_WIRES_RNODE_X 232
#define MG_WIRES_RNODE_Y 53
static const int16_t MG_WIRES_RNODE_XY[4][2] = {{232, 53}, {232, 94}, {232, 136}, {232, 177}};
-#define PIC_MG_WIRES_SYM 95
+#define PIC_MG_WIRES_SYM 172
#define MG_WIRES_SYM_X 67
#define MG_WIRES_SYM_Y 52
static const int16_t MG_WIRES_SYM_XY[4][2] = {{67, 52}, {67, 94}, {67, 135}, {67, 177}};
-#define PIC_X_WIREICONS0001 96
-#define PIC_X_WIREICONS0002 97
-#define PIC_X_WIREICONS0003 98
-#define PIC_X_WIREICONS0004 99
-#define PIC_MG_ASTEROIDS_RETICLE 100
+#define PIC_X_WIREICONS0001 173
+#define PIC_X_WIREICONS0002 174
+#define PIC_X_WIREICONS0003 175
+#define PIC_X_WIREICONS0004 176
+#define PIC_MG_ASTEROIDS_RETICLE 177
#define MG_ASTEROIDS_RETICLE_X 160
#define MG_ASTEROIDS_RETICLE_Y 112
-#define PIC_X_WEAPONS_ASTEROID1 101
-#define PIC_X_WEAPONS_ASTEROID2 102
-#define PIC_X_WEAPONS_ASTEROID3 103
-#define PIC_X_WEAPONS_ASTEROID4 104
-#define PIC_X_WEAPONS_ASTEROID5 105
-#define PIC_X_WEAPONS_EXPLOSION 106
-#define PIC_MG_ALIGN_SLIDER 107
+#define PIC_X_WEAPONS_ASTEROID1 178
+#define PIC_X_WEAPONS_ASTEROID2 179
+#define PIC_X_WEAPONS_ASTEROID3 180
+#define PIC_X_WEAPONS_ASTEROID4 181
+#define PIC_X_WEAPONS_ASTEROID5 182
+#define PIC_X_WEAPONS_EXPLOSION 183
+#define PIC_MG_ALIGN_SLIDER 184
#define MG_ALIGN_SLIDER_X 222
#define MG_ALIGN_SLIDER_Y 112
-#define PIC_MG_ALIGN_ENGINE 108
+#define PIC_MG_ALIGN_ENGINE 185
#define MG_ALIGN_ENGINE_X 198
#define MG_ALIGN_ENGINE_Y 112
-#define PIC_MG_SAMPLE_LIQUID 109
+#define PIC_MG_SAMPLE_LIQUID 186
#define MG_SAMPLE_LIQUID_X 110
#define MG_SAMPLE_LIQUID_Y 112
static const int16_t MG_SAMPLE_LIQUID_XY[5][2] = {{110, 112}, {135, 112}, {160, 112}, {186, 112}, {211, 112}};
-#define PIC_MG_SAMPLE_BUTTON 110
+#define PIC_MG_SAMPLE_BUTTON 187
#define MG_SAMPLE_BUTTON_X 160
#define MG_SAMPLE_BUTTON_Y 180
static const int16_t MG_SAMPLE_BUTTON_XY[5][2] = {{160, 180}, {135, 180}, {110, 180}, {185, 180}, {210, 180}};
-#define PIC_MG_SAMPLE_CONFIRM 111
+#define PIC_MG_SAMPLE_CONFIRM 188
#define MG_SAMPLE_CONFIRM_X 227
#define MG_SAMPLE_CONFIRM_Y 200
-#define PIC_MG_FUEL1_BUTTON 112
+#define PIC_MG_FUEL1_BUTTON 189
#define MG_FUEL1_BUTTON_X 272
#define MG_FUEL1_BUTTON_Y 188
-#define PIC_MG_FUEL1_LIGHT 113
+#define PIC_MG_FUEL1_LIGHT 190
#define MG_FUEL1_LIGHT_X 261
#define MG_FUEL1_LIGHT_Y 159
-#define PIC_MG_SIMON_BUTTON 114
+#define PIC_MG_SIMON_BUTTON 191
#define MG_SIMON_BUTTON_X 199
#define MG_SIMON_BUTTON_Y 97
static const int16_t MG_SIMON_BUTTON_XY[9][2] = {{199, 97}, {227, 97}, {255, 97}, {199, 125}, {227, 125}, {255, 125}, {199, 152}, {227, 152}, {255, 152}};
-#define PIC_MG_SIMON_LIGHT 115
+#define PIC_MG_SIMON_LIGHT 192
#define MG_SIMON_LIGHT_X 54
#define MG_SIMON_LIGHT_Y 63
-#define PIC_X_SSBUTTON1 116
-#define PIC_X_SSBUTTON2 117
-#define PIC_X_SSBUTTON3 118
-#define PIC_X_SSBUTTON4 119
-#define PIC_X_SSBUTTON5 120
-#define PIC_X_SSBUTTON6 121
-#define PIC_X_SSBUTTON7 122
-#define PIC_X_SSBUTTON8 123
-#define PIC_X_SSBUTTON9 124
-#define PIC_X_SSLIGHTS1 125
-#define PIC_X_SSLIGHTS2 126
-#define PIC_X_SSLIGHTS3 127
-#define PIC_X_SSLIGHTS4 128
-#define PIC_X_SSLIGHTS5 129
-#define PIC_MG_GARBAGE_HANDLE 130
+#define PIC_X_SSBUTTON1 193
+#define PIC_X_SSBUTTON2 194
+#define PIC_X_SSBUTTON3 195
+#define PIC_X_SSBUTTON4 196
+#define PIC_X_SSBUTTON5 197
+#define PIC_X_SSBUTTON6 198
+#define PIC_X_SSBUTTON7 199
+#define PIC_X_SSBUTTON8 200
+#define PIC_X_SSBUTTON9 201
+#define PIC_X_SSLIGHTS1 202
+#define PIC_X_SSLIGHTS2 203
+#define PIC_X_SSLIGHTS3 204
+#define PIC_X_SSLIGHTS4 205
+#define PIC_X_SSLIGHTS5 206
+#define PIC_MG_GARBAGE_HANDLE 207
#define MG_GARBAGE_HANDLE_X 230
#define MG_GARBAGE_HANDLE_Y 86
-#define PIC_MG_GARBAGE_BARS 131
+#define PIC_MG_GARBAGE_BARS 208
#define MG_GARBAGE_BARS_X 230
#define MG_GARBAGE_BARS_Y 112
-#define PIC_X_GARBAGE_1 132
-#define PIC_X_GARBAGE_2 133
-#define PIC_X_GARBAGE_3 134
-#define PIC_X_GARBAGE_4 135
-#define PIC_X_GARBAGE_5 136
-#define PIC_X_GARBAGE_6 137
-#define PIC_MG_UPLOAD_TOWER 138
+#define PIC_X_GARBAGE_1 209
+#define PIC_X_GARBAGE_2 210
+#define PIC_X_GARBAGE_3 211
+#define PIC_X_GARBAGE_4 212
+#define PIC_X_GARBAGE_5 213
+#define PIC_X_GARBAGE_6 214
+#define PIC_MG_UPLOAD_TOWER 215
#define MG_UPLOAD_TOWER_X 233
#define MG_UPLOAD_TOWER_Y 84
-#define PIC_MG_UPLOAD_BUTTON 139
+#define PIC_MG_UPLOAD_BUTTON 216
#define MG_UPLOAD_BUTTON_X 160
#define MG_UPLOAD_BUTTON_Y 138
-#define PIC_MG_UPLOAD_BAR 140
+#define PIC_MG_UPLOAD_BAR 217
#define MG_UPLOAD_BAR_X 146
#define MG_UPLOAD_BAR_Y 136
-#define PIC_X_DATATRANSFER_FOLDEROPEN0001 141
-#define PIC_X_DATATRANSFER_FOLDEROPEN0002 142
-#define PIC_X_DATATRANSFER_FOLDEROPEN0003 143
-#define PIC_X_DATATRANSFER_FOLDEROPEN0004 144
-#define PIC_X_DATATRANSFER_FOLDEROPEN0005 145
-#define PIC_X_DATATRANSFER_FILEFILL 146
-#define PIC_X_DATATRANSFER_DOWNLOADBUTTON 147
-#define PIC_MG_CALIBRATE_SPIN1 148
+#define PIC_X_DATATRANSFER_FOLDEROPEN0001 218
+#define PIC_X_DATATRANSFER_FOLDEROPEN0002 219
+#define PIC_X_DATATRANSFER_FOLDEROPEN0003 220
+#define PIC_X_DATATRANSFER_FOLDEROPEN0004 221
+#define PIC_X_DATATRANSFER_FOLDEROPEN0005 222
+#define PIC_X_DATATRANSFER_FILEFILL 223
+#define PIC_X_DATATRANSFER_DOWNLOADBUTTON 224
+#define PIC_MG_CALIBRATE_SPIN1 225
#define MG_CALIBRATE_SPIN1_X 104
#define MG_CALIBRATE_SPIN1_Y 51
-#define PIC_MG_CALIBRATE_SPIN2 149
+#define PIC_MG_CALIBRATE_SPIN2 226
#define MG_CALIBRATE_SPIN2_X 104
#define MG_CALIBRATE_SPIN2_Y 110
-#define PIC_MG_CALIBRATE_SPIN3 150
+#define PIC_MG_CALIBRATE_SPIN3 227
#define MG_CALIBRATE_SPIN3_X 104
#define MG_CALIBRATE_SPIN3_Y 170
-#define PIC_MG_CALIBRATE_LIT1 151
+#define PIC_MG_CALIBRATE_LIT1 228
#define MG_CALIBRATE_LIT1_X 138
#define MG_CALIBRATE_LIT1_Y 52
-#define PIC_MG_CALIBRATE_LIT2 152
+#define PIC_MG_CALIBRATE_LIT2 229
#define MG_CALIBRATE_LIT2_X 137
#define MG_CALIBRATE_LIT2_Y 110
-#define PIC_MG_CALIBRATE_LIT3 153
+#define PIC_MG_CALIBRATE_LIT3 230
#define MG_CALIBRATE_LIT3_X 137
#define MG_CALIBRATE_LIT3_Y 171
-#define PIC_MG_COURSE_SHIP 154
+#define PIC_MG_COURSE_SHIP 231
#define MG_COURSE_SHIP_X 160
#define MG_COURSE_SHIP_Y 112
-#define PIC_MG_COURSE_END 155
+#define PIC_MG_COURSE_END 232
#define MG_COURSE_END_X 254
#define MG_COURSE_END_Y 116
-#define PIC_X_NAV_CHARTCOURSE_CHECKPT 156
-#define PIC_X_NAV_CHARTCOURSE_START 157
-#define PIC_X_O2_LEAF1 158
-#define PIC_X_O2_LEAF2 159
-#define PIC_X_O2_LEAF3 160
-#define PIC_X_O2_LEAF4 161
-#define PIC_X_O2_LEAF5 162
-#define PIC_X_O2_LEAF6 163
-#define PIC_X_O2_LEAF7 164
-#define PIC_X_REACTORBUTTON01 165
-#define PIC_X_REACTORBUTTON02 166
-#define PIC_X_REACTORBUTTON03 167
-#define PIC_X_REACTORBUTTON04 168
-#define PIC_X_REACTORBUTTON05 169
-#define PIC_X_REACTORBUTTON06 170
-#define PIC_X_REACTORBUTTON07 171
-#define PIC_X_REACTORBUTTON08 172
-#define PIC_X_REACTORBUTTON09 173
-#define PIC_X_REACTORBUTTON10 174
-#define PIC_MG_STEERING_CROSS 175
+#define PIC_X_NAV_CHARTCOURSE_CHECKPT 233
+#define PIC_X_NAV_CHARTCOURSE_START 234
+#define PIC_X_O2_LEAF1 235
+#define PIC_X_O2_LEAF2 236
+#define PIC_X_O2_LEAF3 237
+#define PIC_X_O2_LEAF4 238
+#define PIC_X_O2_LEAF5 239
+#define PIC_X_O2_LEAF6 240
+#define PIC_X_O2_LEAF7 241
+#define PIC_X_REACTORBUTTON01 242
+#define PIC_X_REACTORBUTTON02 243
+#define PIC_X_REACTORBUTTON03 244
+#define PIC_X_REACTORBUTTON04 245
+#define PIC_X_REACTORBUTTON05 246
+#define PIC_X_REACTORBUTTON06 247
+#define PIC_X_REACTORBUTTON07 248
+#define PIC_X_REACTORBUTTON08 249
+#define PIC_X_REACTORBUTTON09 250
+#define PIC_X_REACTORBUTTON10 251
+#define PIC_MG_STEERING_CROSS 252
#define MG_STEERING_CROSS_X 222
#define MG_STEERING_CROSS_Y 58
-#define PIC_MG_SHIELDS_HEX 176
+#define PIC_MG_SHIELDS_HEX 253
#define MG_SHIELDS_HEX_X 160
#define MG_SHIELDS_HEX_Y 112
static const int16_t MG_SHIELDS_HEX_XY[7][2] = {{160, 112}, {112, 84}, {161, 56}, {208, 84}, {209, 141}, {160, 169}, {110, 140}};
-#define PIC_MG_DIVERT_SWITCH 177
+#define PIC_MG_DIVERT_SWITCH 254
#define MG_DIVERT_SWITCH_X 85
#define MG_DIVERT_SWITCH_Y 167
-#define PIC_MG_ACCEPT_SWITCH 178
+#define PIC_MG_ACCEPT_SWITCH 255
#define MG_ACCEPT_SWITCH_X 160
#define MG_ACCEPT_SWITCH_Y 113
-#define PIC_MG_LIGHTS_SWITCH 179
+#define PIC_MG_LIGHTS_SWITCH 256
#define MG_LIGHTS_SWITCH_X 83
#define MG_LIGHTS_SWITCH_Y 166
static const int16_t MG_LIGHTS_SWITCH_XY[5][2] = {{83, 166}, {122, 166}, {161, 166}, {200, 166}, {238, 166}};
-#define PIC_MG_LIGHTS_LIGHT 180
+#define PIC_MG_LIGHTS_LIGHT 257
#define MG_LIGHTS_LIGHT_X 83
#define MG_LIGHTS_LIGHT_Y 193
static const int16_t MG_LIGHTS_LIGHT_XY[5][2] = {{83, 193}, {122, 193}, {161, 193}, {200, 193}, {238, 193}};
-#define PIC_MG_COMMS_DIAL 181
+#define PIC_MG_COMMS_DIAL 258
#define MG_COMMS_DIAL_X 223
#define MG_COMMS_DIAL_Y 175
-#define PIC_MG_COMMS_DIALSHADOW 182
+#define PIC_MG_COMMS_DIALSHADOW 259
#define MG_COMMS_DIALSHADOW_X 223
#define MG_COMMS_DIALSHADOW_Y 179
-#define PIC_MG_COMMS_GLASS 183
+#define PIC_MG_COMMS_GLASS 260
#define MG_COMMS_GLASS_X 127
#define MG_COMMS_GLASS_Y 108
-#define PIC_MG_COMMS_LIGHT 184
+#define PIC_MG_COMMS_LIGHT 261
#define MG_COMMS_LIGHT_X 259
#define MG_COMMS_LIGHT_Y 141
static const int16_t MG_COMMS_LIGHT_XY[2][2] = {{247, 140}, {259, 141}};
-#define PIC_MG_KEYPAD_NOTE 185
+#define PIC_MG_KEYPAD_NOTE 262
#define MG_KEYPAD_NOTE_X 257
#define MG_KEYPAD_NOTE_Y 65
-#define PIC_MG_KEYPAD_X 186
+#define PIC_MG_KEYPAD_X 263
#define MG_KEYPAD_X_X 124
#define MG_KEYPAD_X_Y 185
-#define PIC_MG_KEYPAD_CHECK 187
+#define PIC_MG_KEYPAD_CHECK 264
#define MG_KEYPAD_CHECK_X 196
#define MG_KEYPAD_CHECK_Y 185
-#define PIC_MG_KEYPAD_K1 188
+#define PIC_MG_KEYPAD_K1 265
#define MG_KEYPAD_K1_X 124
#define MG_KEYPAD_K1_Y 77
-#define PIC_X_ADMIN_KEYPAD_0 189
-#define PIC_X_ADMIN_KEYPAD_1 190
-#define PIC_X_ADMIN_KEYPAD_2 191
-#define PIC_X_ADMIN_KEYPAD_3 192
-#define PIC_X_ADMIN_KEYPAD_4 193
-#define PIC_X_ADMIN_KEYPAD_5 194
-#define PIC_X_ADMIN_KEYPAD_6 195
-#define PIC_X_ADMIN_KEYPAD_7 196
-#define PIC_X_ADMIN_KEYPAD_8 197
-#define PIC_X_ADMIN_KEYPAD_9 198
-#define PIC_MG_EMERGENCY_CLOSED 199
+#define PIC_X_ADMIN_KEYPAD_0 266
+#define PIC_X_ADMIN_KEYPAD_1 267
+#define PIC_X_ADMIN_KEYPAD_2 268
+#define PIC_X_ADMIN_KEYPAD_3 269
+#define PIC_X_ADMIN_KEYPAD_4 270
+#define PIC_X_ADMIN_KEYPAD_5 271
+#define PIC_X_ADMIN_KEYPAD_6 272
+#define PIC_X_ADMIN_KEYPAD_7 273
+#define PIC_X_ADMIN_KEYPAD_8 274
+#define PIC_X_ADMIN_KEYPAD_9 275
+#define PIC_MG_EMERGENCY_CLOSED 276
#define MG_EMERGENCY_CLOSED_X 160
#define MG_EMERGENCY_CLOSED_Y 94
-#define PIC_MG_EMERGENCY_OPEN 200
+#define PIC_MG_EMERGENCY_OPEN 277
#define MG_EMERGENCY_OPEN_X 230
#define MG_EMERGENCY_OPEN_Y 73
-#define PIC_MG_EMERGENCY_BUTTON 201
+#define PIC_MG_EMERGENCY_BUTTON 278
#define MG_EMERGENCY_BUTTON_X 160
#define MG_EMERGENCY_BUTTON_Y 154
-#define PIC_MG_EMERGENCY_BUBBLE 202
+#define PIC_MG_EMERGENCY_BUBBLE 279
#define MG_EMERGENCY_BUBBLE_X 160
#define MG_EMERGENCY_BUBBLE_Y 172
+#define BIG_UNPACKED 28972
#endif
diff --git a/games/amongus/src/game.c b/games/amongus/src/game.c
index 4d3e30fb..f4028497 100644
--- a/games/amongus/src/game.c
+++ b/games/amongus/src/game.c
@@ -5,6 +5,7 @@
#include "game.h"
#include "gfx.h"
#include "plat.h"
+#include "res.h"
#include "world.h"
Game g;
@@ -497,11 +498,16 @@ static int32_t copy_get(const char *name, uint8_t *out, uint32_t cap) {
return (int32_t)o;
}
-/* packed game: the head, then the game LZ-packed */
-static uint8_t packed[sizeof(Game) + sizeof(Game) / 8 + 64];
+/* packed game: the head, then the game LZ-packed; the room for it borrowed from the pictures' (res.c) */
+#define PACKED_MAX ((sizeof(Game) + sizeof(Game) / 8 + 64 + 3) & ~3u)
+#define COPY_MAX (1 + sizeof copy_head + 64 + (PACKED_MAX + 2) / 3 * 4 + 64)
+static uint8_t *packed;
static uint32_t pack_game(void) {
- static uint16_t table[NP_LZ_HASH];
+ uint32_t room;
+ packed = scratch_borrow(&room);
+ if (room < PACKED_MAX + 2 * NP_LZ_HASH + COPY_MAX) return 0; /* (never: the tests check it) */
+ uint16_t *table = (uint16_t *)(void *)(packed + PACKED_MAX);
SaveHead h = {MAGIC_G, VERSION, 0, sizeof(Game)};
memcpy(packed, &h, sizeof h);
return sizeof h + np_lz_pack((const uint8_t *)&g, sizeof(Game), packed + sizeof h, table);
@@ -514,8 +520,9 @@ typedef struct {
} SetFile;
static void write_copy(uint32_t glen, const SetFile *s) {
- static uint8_t o[1 + sizeof copy_head + 64 + (sizeof packed + 2) / 3 * 4 + (sizeof(SetFile) + 2) / 3 * 4];
- uint8_t *p = o;
+ uint32_t room;
+ uint8_t *base = scratch_borrow(&room);
+ uint8_t *o = base + PACKED_MAX + 2 * NP_LZ_HASH, *p = o; /* (after the packed game) */
*p++ = 0;
memcpy(p, copy_head, sizeof copy_head - 1), p += sizeof copy_head - 1;
memcpy(p, "#>" SAVE_SET ":", 2 + sizeof SAVE_SET), p += 2 + sizeof SAVE_SET;
@@ -573,6 +580,7 @@ static void settings_load(void) {
bool game_save(void) {
uint32_t len = pack_game();
+ if (!len) return false;
bool ok = plat_save(SAVE_GAME, packed, len);
set_file.h = (SaveHead){MAGIC_S, VERSION, 0, sizeof(SetFile)};
set_file.opt = g.opt;
@@ -605,12 +613,14 @@ static bool game_sane(const Game *G) {
}
bool game_load(void) {
- uint32_t n;
+ uint32_t n, room;
const uint8_t *d = plat_load(SAVE_GAME, &n);
- static uint8_t buf[sizeof packed];
- if (d && n <= sizeof buf) memcpy(buf, d, n);
+ uint8_t *buf = scratch_borrow(&room);
+ if (room < 2 * PACKED_MAX) return false;
+ Game *tmp = (Game *)(void *)(buf + PACKED_MAX);
+ if (d && n <= PACKED_MAX) memcpy(buf, d, n);
else {
- int32_t m = copy_get(SAVE_GAME, buf, sizeof buf);
+ int32_t m = copy_get(SAVE_GAME, buf, PACKED_MAX);
if (m < 0) return false;
n = (uint32_t)m;
}
@@ -618,10 +628,9 @@ bool game_load(void) {
if (n < sizeof h) return false;
memcpy(&h, buf, sizeof h);
if (h.magic != MAGIC_G || h.version != VERSION || h.size != sizeof(Game)) return false;
- static Game tmp;
- if (np_lz_unpack(buf + sizeof h, n - sizeof h, (uint8_t *)&tmp, sizeof tmp) != (int32_t)sizeof tmp) return false;
- if (!game_sane(&tmp)) return false;
- g = tmp;
+ if (np_lz_unpack(buf + sizeof h, n - sizeof h, (uint8_t *)tmp, sizeof *tmp) != (int32_t)sizeof *tmp) return false;
+ if (!game_sane(tmp)) return false;
+ g = *tmp;
return true;
}
diff --git a/games/amongus/src/inflate.c b/games/amongus/src/inflate.c
new file mode 100644
index 00000000..6dc7c700
--- /dev/null
+++ b/games/amongus/src/inflate.c
@@ -0,0 +1,166 @@
+/* Among Us: a small raw DEFLATE decoder (RFC 1951) for the packed pictures in data.bin. */
+#include <string.h>
+#include "inflate.h"
+
+typedef struct {
+ uint16_t counts[16]; /* codes of each length */
+ uint16_t symbols[288]; /* symbols by code */
+} Huff;
+
+typedef struct {
+ const uint8_t *in, *end;
+ uint32_t bits;
+ int nbits;
+ uint8_t *out;
+ uint32_t n, cap;
+ int err;
+} St;
+
+static int bit(St *s) {
+ if (!s->nbits) {
+ if (s->in >= s->end) {
+ s->err = 1;
+ return 0;
+ }
+ s->bits = *s->in++;
+ s->nbits = 8;
+ }
+ int b = s->bits & 1;
+ s->bits >>= 1;
+ s->nbits--;
+ return b;
+}
+
+static uint32_t bits(St *s, int n) {
+ uint32_t v = 0;
+ for (int i = 0; i < n; i++) v |= (uint32_t)bit(s) << i;
+ return v;
+}
+
+static void build(Huff *h, const uint8_t *lens, int n) {
+ uint16_t offs[16];
+ memset(h->counts, 0, sizeof h->counts);
+ for (int i = 0; i < n; i++) h->counts[lens[i]]++;
+ h->counts[0] = 0;
+ offs[1] = 0;
+ for (int i = 1; i < 15; i++) offs[i + 1] = (uint16_t)(offs[i] + h->counts[i]);
+ for (int i = 0; i < n; i++)
+ if (lens[i]) h->symbols[offs[lens[i]]++] = (uint16_t)i;
+}
+
+static int decode(St *s, const Huff *h) {
+ int code = 0, first = 0, index = 0;
+ for (int len = 1; len < 16; len++) {
+ code |= bit(s);
+ int count = h->counts[len];
+ if (code - count < first) return h->symbols[index + (code - first)];
+ index += count;
+ first += count;
+ first <<= 1;
+ code <<= 1;
+ if (s->err) return -1;
+ }
+ s->err = 1;
+ return -1;
+}
+
+static const uint16_t LBASE[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27,
+ 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
+static const uint8_t LEXT[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
+static const uint16_t DBASE[30] = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129,
+ 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577};
+static const uint8_t DEXT[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13};
+
+static void block(St *s, const Huff *lit, const Huff *dist) {
+ for (;;) {
+ int sym = decode(s, lit);
+ if (s->err) return;
+ if (sym < 256) {
+ if (s->n >= s->cap) {
+ s->err = 1;
+ return;
+ }
+ s->out[s->n++] = (uint8_t)sym;
+ } else if (sym == 256) {
+ return;
+ } else {
+ sym -= 257;
+ if (sym >= 29) {
+ s->err = 1;
+ return;
+ }
+ uint32_t len = LBASE[sym] + bits(s, LEXT[sym]);
+ int ds = decode(s, dist);
+ if (ds < 0 || ds >= 30) {
+ s->err = 1;
+ return;
+ }
+ uint32_t d = DBASE[ds] + bits(s, DEXT[ds]);
+ if (d > s->n || s->n + len > s->cap) {
+ s->err = 1;
+ return;
+ }
+ for (uint32_t i = 0; i < len; i++, s->n++) s->out[s->n] = s->out[s->n - d];
+ }
+ }
+}
+
+int32_t inflate_raw(const uint8_t *in, uint32_t n, uint8_t *out, uint32_t cap) {
+ static Huff lit, dist;
+ St s = {in, in + n, 0, 0, out, 0, cap, 0};
+ int last;
+ do {
+ last = bit(&s);
+ int type = (int)bits(&s, 2);
+ if (type == 0) {
+ s.nbits = 0;
+ if (s.in + 4 > s.end) return -1;
+ uint32_t len = s.in[0] | s.in[1] << 8;
+ s.in += 4;
+ if (s.in + len > s.end || s.n + len > cap) return -1;
+ memcpy(out + s.n, s.in, len);
+ s.in += len, s.n += len;
+ } else if (type == 1) {
+ uint8_t lens[288];
+ for (int i = 0; i < 144; i++) lens[i] = 8;
+ for (int i = 144; i < 256; i++) lens[i] = 9;
+ for (int i = 256; i < 280; i++) lens[i] = 7;
+ for (int i = 280; i < 288; i++) lens[i] = 8;
+ build(&lit, lens, 288);
+ for (int i = 0; i < 30; i++) lens[i] = 5;
+ build(&dist, lens, 30);
+ block(&s, &lit, &dist);
+ } else if (type == 2) {
+ static const uint8_t ORDER[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+ int hlit = (int)bits(&s, 5) + 257, hdist = (int)bits(&s, 5) + 1, hclen = (int)bits(&s, 4) + 4;
+ uint8_t lens[320];
+ memset(lens, 0, 19);
+ for (int i = 0; i < hclen; i++) lens[ORDER[i]] = (uint8_t)bits(&s, 3);
+ Huff code;
+ build(&code, lens, 19);
+ int k = 0;
+ while (k < hlit + hdist) {
+ int sym = decode(&s, &code);
+ if (s.err) return -1;
+ if (sym < 16) lens[k++] = (uint8_t)sym;
+ else {
+ int rep = 0;
+ uint8_t v = 0;
+ if (sym == 16) {
+ if (!k) return -1;
+ v = lens[k - 1], rep = 3 + (int)bits(&s, 2);
+ } else if (sym == 17) rep = 3 + (int)bits(&s, 3);
+ else rep = 11 + (int)bits(&s, 7);
+ if (k + rep > hlit + hdist) return -1;
+ while (rep--) lens[k++] = v;
+ }
+ }
+ build(&lit, lens, hlit);
+ build(&dist, lens + hlit, hdist);
+ block(&s, &lit, &dist);
+ } else
+ return -1;
+ if (s.err) return -1;
+ } while (!last);
+ return (int32_t)s.n;
+}
diff --git a/games/amongus/src/inflate.h b/games/amongus/src/inflate.h
new file mode 100644
index 00000000..d45b077c
--- /dev/null
+++ b/games/amongus/src/inflate.h
@@ -0,0 +1,7 @@
+/* Among Us: raw DEFLATE (inflate.c). */
+#ifndef AU_INFLATE_H
+#define AU_INFLATE_H
+#include <stdint.h>
+/* unpacks n bytes into out (cap bytes at most): the size unpacked, or -1 if the stream is damaged */
+int32_t inflate_raw(const uint8_t *in, uint32_t n, uint8_t *out, uint32_t cap);
+#endif
diff --git a/games/amongus/src/mg.c b/games/amongus/src/mg.c
index 89794f9a..bb454dfb 100644
--- a/games/amongus/src/mg.c
+++ b/games/amongus/src/mg.c
@@ -13,7 +13,7 @@ void hud_keys(const char *s);
#define BLACK 0x0000
void mg_keys(const char *s) { hud_keys(s); }
-void mg_bg(int blob_id) { gfx_tiles(tilepic(blob_id), MG_X, MG_Y); }
+void mg_bg(int blob_id) { gfx_tiles((const TilePic *)unpacked(blob_id, 0), MG_X, MG_Y); }
void mg_status(const char *s, int y, uint16_t c) { gfx_text(FONT_MID, MG_X, y, s, c, BLACK, 1, 1); }
static int kind_of(int cons, int task) {
diff --git a/games/amongus/src/res.c b/games/amongus/src/res.c
index 646e2873..fcd523b3 100644
--- a/games/amongus/src/res.c
+++ b/games/amongus/src/res.c
@@ -1,4 +1,7 @@
-/* Among Us: the pictures, fonts and tiles in data.bin: "AUSD", the counts, then where each one starts. */
+/* Among Us: the pictures, fonts and tiles in data.bin: "AUSD", the counts, then where each one starts. The big
+ * panels and the kill's frames are packed (DEFLATE) and unpacked into RAM when shown. */
+#include <string.h>
+#include "inflate.h"
#include "res.h"
static uint32_t rd32(const uint8_t *p) { return p[0] | p[1] << 8 | p[2] << 16 | (uint32_t)p[3] << 24; }
@@ -11,3 +14,41 @@ const Pic *pic(int id) {
}
const Font *font(int id) { return (const Font *)blob(N_PICS + id); }
+
+/* the RAM unpacked into: a big slot (a panel), and two small ones after a panel's 25 KB (the kill's frames over its
+ * flames) */
+#define SMALL_AT 25600
+#define SMALL 8192
+_Static_assert(BIG_UNPACKED <= SMALL_AT + 2 * SMALL && KILL_PIC_MAX <= SMALL, "the unpacking room");
+static uint32_t scratch_words[(SMALL_AT + 2 * SMALL) / 4];
+#define SCRATCH ((uint8_t *)scratch_words)
+static int slot_id[3] = {-1, -1, -1};
+static uint32_t big_size;
+
+const void *unpacked(int id, int slot) {
+ if (slot_id[slot] == id) return slot ? SCRATCH + SMALL_AT + (slot - 1) * SMALL : SCRATCH;
+ const uint8_t *z = (const uint8_t *)blob(id);
+ uint32_t size = rd32(z);
+ uint32_t zlen = rd32(au_data + 16 + 4 * (id + 1)) - rd32(au_data + 16 + 4 * id) - 4;
+ uint8_t *dst = slot ? SCRATCH + SMALL_AT + (slot - 1) * SMALL : SCRATCH;
+ uint32_t cap = slot ? SMALL : SMALL_AT + 2 * SMALL;
+ if (slot == 0) {
+ big_size = size;
+ if (size > SMALL_AT) slot_id[1] = slot_id[2] = -1;
+ } else if (big_size > SMALL_AT) slot_id[0] = -1, big_size = 0;
+ if (size > cap || inflate_raw(z + 4, zlen, dst, cap) != (int32_t)size) {
+ /* (never with the game's own data) */
+ memset(dst, 0, 16);
+ slot_id[slot] = -1;
+ return dst;
+ }
+ slot_id[slot] = id;
+ return dst;
+}
+
+uint8_t *scratch_borrow(uint32_t *size) {
+ slot_id[0] = slot_id[1] = slot_id[2] = -1;
+ big_size = 0;
+ *size = sizeof scratch_words;
+ return SCRATCH;
+}
diff --git a/games/amongus/src/res.h b/games/amongus/src/res.h
index ce1f7dac..b24db694 100644
--- a/games/amongus/src/res.h
+++ b/games/amongus/src/res.h
@@ -18,6 +18,10 @@ enum { P_4BIT = 1, P_OPAQUE = 2, P_MIX = 4 };
const Pic *pic(int id);
const void *blob(int id);
+/* a packed blob unpacked into RAM (slot 0: a panel, 1 and 2: small pictures), kept until something else needs it */
+const void *unpacked(int id, int slot);
+/* that RAM for something else for a moment (the saves) */
+uint8_t *scratch_borrow(uint32_t *size);
static inline const uint16_t *pic_pal(const Pic *p) { return (const uint16_t *)(const void *)(p + 1); }
static inline const uint8_t *pic_alpha(const Pic *p) {
return (const uint8_t *)(pic_pal(p) + (p->ncolors ? p->ncolors : 256));
diff --git a/games/amongus/tools/pack.py b/games/amongus/tools/pack.py
index 613e88a7..a35943e5 100644
--- a/games/amongus/tools/pack.py
+++ b/games/amongus/tools/pack.py
@@ -11,6 +11,7 @@ import math
import os
import struct
import sys
+import zlib
import numpy as np
from PIL import Image, ImageDraw, ImageFont
@@ -289,6 +290,14 @@ def seg_cross(p, q, segs):
return bool((((d1 > 0) != (d2 > 0)) & ((d3 > 0) != (d4 > 0))).any())
+def zpack(blob):
+ """packed with DEFLATE (unpacked when shown): its size, then the raw stream"""
+ c = zlib.compressobj(9, zlib.DEFLATED, -15)
+ z = c.compress(blob) + c.flush()
+ z = struct.pack("<I", len(blob)) + z
+ return z + b"\0" * (-len(z) % 4)
+
+
def fl(v):
t = "%.6g" % float(v)
return (t if ("." in t or "e" in t) else t + ".0") + "f"
@@ -503,10 +512,53 @@ def main():
for i in range(1, 8):
mixframe("getinVent%04d" % i)
mixframe("idle", 0.7, "idle_big")
+ # the screens' pictures (extract_ui.py), the meeting's players and votes coloured like the players
+ ui = json.load(open(os.path.join(REF, "ui.json")))
+
+ def uiim(name):
+ return Image.open(os.path.join(REF, "ui", name + ".png")).convert("RGBA")
+
+ def uipic(name, bits=8):
+ pid = pics.add("ui_" + name, uiim(name), (ui[name]["px"], ui[name]["py"]), bits=bits)
+ D("#define PIC_UI_%s %d" % (cname(name), pid))
+ for name in ["noshadow", "playerVoteResults"]:
+ k = (0.375 * 0.8) if name == "noshadow" else 0.375
+ mixframe(name, k)
mix_table, nmix = mix.pack(pics)
+ D("#define PIC_PLATE_PLAYER %d\n#define PIC_VOTE_ICON %d" % (pics.ids["noshadow"], pics.ids["playerVoteResults"]))
+ for name in ["useButton", "reportButton", "killButton", "vent", "sabotage", "mapAdmin", "security", "votePlayerBase",
+ "reported", "deadX_border", "i_voted", "voteConfirm", "voteCancel", "button_skipVote_edit",
+ "skippedVotingTally", "sabotage_Doors", "sabotage_O2", "sabotage_comms", "sabotage_electricity",
+ "sabotage_reactor", "task", "beforeVoting_deadBody", "bannerLogo_AmongUs"]:
+ uipic(name)
+ for name in ["map", "beforeVoting_deadBodyText", "beforeVoting_EMText", "no_shh"]:
+ uipic(name, 4)
+ tiles.append(("MEETING", zpack(make_tiles(uiim("base"), (ui["base"]["px"], ui["base"]["py"]), name="meeting"))))
+ tiles.append(("KILLBG", zpack(make_tiles(uiim("killBG"), (ui["killBG"]["px"], ui["killBG"]["py"]), name="killbg"))))
+ D("#define MAP_SCALE %s\n#define MEET_SCALE %s" % (fl(ui["_map_scale"]), fl(ui["_meeting_scale"])))
+ # the tongue kill: its own mix table (the two players' colours made when it plays)
+ kmix = Mix()
+ for part, n in ui["_kill"]:
+ for k in range(n):
+ nm = "kill_%s%02d" % (part, k)
+ kmix.add(nm, uiim(nm), (ui[nm]["px"], ui[nm]["py"]))
+ D("#define N_KILL_%s %d" % (part.upper(), n))
+ kmix_table, nkmix = kmix.pack(pics)
+ D("#define PIC_KILL_IMP %d\n#define PIC_KILL_VICTIM %d\n#define N_KMIX %d" % (
+ pics.ids["kill_imp00"], pics.ids["kill_victim00"], nkmix))
+ tiles.append(("KMIX", kmix_table))
+ # (the kill's frames packed: two are unpacked at a time)
+ kill_max = 0
+ for part, n in ui["_kill"]:
+ for k in range(n):
+ i = pics.ids["kill_%s%02d" % (part, k)]
+ kill_max = max(kill_max, len(pics.blobs[i]))
+ pics.blobs[i] = zpack(pics.blobs[i])
+ D("#define KILL_PIC_MAX %d" % kill_max)
# the minigames: a tiled background, its moving parts, more frames
mg = json.load(open(os.path.join(REF, "mg.json")))
+ mg_max = 0
for name, m in mg.items():
N = cname(name)
if m["bg"]:
@@ -516,7 +568,9 @@ def main():
x0, y0 = max(0, int(bx - MG_X)), max(0, int(by - MG_Y))
x1, y1 = min(im.width, int(bx + SCREEN_W_PX - MG_X)), min(im.height, int(by + 228 - MG_Y))
im = im.crop((x0, y0, x1, y1))
- tiles.append(("MG_" + N, make_tiles(im, (bx - x0, by - y0), name="mg " + name)))
+ t = make_tiles(im, (bx - x0, by - y0), name="mg " + name)
+ mg_max = max(mg_max, len(t))
+ tiles.append(("MG_" + N, zpack(t)))
for key, p in m["parts"].items():
im = Image.open(os.path.join(REF, "mg", "%s_%s.png" % (name, key)))
pid = pics.add("mg_%s_%s" % (name, key), im, (p["px"], p["py"]), bits=8 if im.width * im.height < 6000 else 4)
@@ -530,6 +584,7 @@ def main():
im = Image.open(os.path.join(REF, "mg", "%s_x_%s.png" % (name, nm)))
pid = pics.add("x_" + nm, im, (e["px"], e["py"]), bits=8 if im.width * im.height < 6000 else 4)
D("#define PIC_X_%s %d" % (cname(nm), pid))
+ D("#define BIG_UNPACKED %d" % mg_max)
# fonts
fdir = os.path.join(REF, "fonts")
fonts = [make_font(os.path.join(fdir, "LiberationSans-Regular.ttf"), 10),