| 1 | /* |
| 2 | * OpenTyrian: A modern cross-platform port of Tyrian |
| 3 | * Copyright (C) 2007-2009 The OpenTyrian Development Team |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (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, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | #ifndef SPRITE_H |
| 20 | #define SPRITE_Hcxx . . $ `src/sprite.h:20:9`! |
| 21 | |
| 22 | #include "opentyr.h"cxx . . $ `<file>/src/opentyr.h`/ |
| 23 | |
| 24 | #include "SDL.h" |
| 25 | |
| 26 | #include <assert.h> |
| 27 | #include <stdio.h> |
| 28 | |
| 29 | #define FONT_SHAPEScxx . . $ `src/sprite.h:29:9`! 0 |
| 30 | #define SMALL_FONT_SHAPEScxx . . $ `src/sprite.h:30:9`! 1 |
| 31 | #define TINY_FONTcxx . . $ `src/sprite.h:31:9`! 2 |
| 32 | #define PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`! 3 |
| 33 | #define FACE_SHAPEScxx . . $ `src/sprite.h:33:9`! 4 |
| 34 | #define OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`! 5 /*Also contains help shapes*/ |
| 35 | #define WEAPON_SHAPEScxx . . $ `src/sprite.h:35:9`! 6 |
| 36 | #define EXTRA_SHAPEScxx . . $ `src/sprite.h:36:9`! 7 /*Used for Ending pics*/ |
| 37 | |
| 38 | #define SPRITE_TABLES_MAXcxx . . $ `src/sprite.h:38:9`! 8 |
| 39 | #define SPRITES_PER_TABLE_MAXcxx . . $ `src/sprite.h:39:9`! 151 |
| 40 | |
| 41 | typedef structcxx . . $ $anonymous_type_297934740aeafb7d_0# |
| 42 | { |
| 43 | Uint16cxx . . $ Uint16# widthcxx . . $ $anonymous_type_297934740aeafb7d_0#width., heightcxx . . $ $anonymous_type_297934740aeafb7d_0#height.; |
| 44 | Uint16cxx . . $ Uint16# sizecxx . . $ $anonymous_type_297934740aeafb7d_0#size.; |
| 45 | Uint8cxx . . $ Uint8# *datacxx . . $ $anonymous_type_297934740aeafb7d_0#data.; |
| 46 | } |
| 47 | Spritecxx . . $ Sprite#; |
| 48 | |
| 49 | typedef structcxx . . $ $anonymous_type_297934740aeafb7d_1# |
| 50 | { |
| 51 | unsigned int countcxx . . $ $anonymous_type_297934740aeafb7d_1#count.; |
| 52 | Spritecxx . . $ Sprite# spritecxx . . $ $anonymous_type_297934740aeafb7d_1#sprite.[SPRITES_PER_TABLE_MAXcxx . . $ `src/sprite.h:39:9`!]; |
| 53 | } |
| 54 | Sprite_arraycxx . . $ Sprite_array#; |
| 55 | |
| 56 | extern Sprite_arraycxx . . $ Sprite_array# sprite_tablecxx . . $ sprite_table.[SPRITE_TABLES_MAXcxx . . $ `src/sprite.h:38:9`!]; // fka shapearray, shapex, shapey, shapesize, shapexist, maxshape |
| 57 | |
| 58 | static inline Spritecxx . . $ Sprite# *spritecxx . . $ sprite(d067a90ab23634af).(unsigned int table, unsigned int index) |
| 59 | { |
| 60 | assertcxx . . $ `/usr/include/assert.h:50:10`!(table < COUNTOF(sprite_table)); |
| 61 | assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!(index < COUNTOF(sprite_table->sprite)); |
| 62 | return &sprite_tablecxx . . $ sprite_table.[table].spritecxx . . $ $anonymous_type_297934740aeafb7d_1#sprite.[index]; |
| 63 | } |
| 64 | |
| 65 | static inline boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! sprite_existscxx . . $ sprite_exists(8e1b545ea3aecce3).(unsigned int table, unsigned int index) |
| 66 | { |
| 67 | return (spritecxx . . $ sprite(d067a90ab23634af).(table, index)->datacxx . . $ $anonymous_type_297934740aeafb7d_0#data. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 68 | } |
| 69 | static inline Uint16cxx . . $ Uint16# get_sprite_widthcxx . . $ get_sprite_width(c7f281617652c176).(unsigned int table, unsigned int index) |
| 70 | { |
| 71 | return (sprite_existscxx . . $ sprite_exists(8e1b545ea3aecce3).(table, index) ? spritecxx . . $ sprite(d067a90ab23634af).(table, index)->widthcxx . . $ $anonymous_type_297934740aeafb7d_0#width. : 0); |
| 72 | } |
| 73 | static inline Uint16cxx . . $ Uint16# get_sprite_heightcxx . . $ get_sprite_height(c7f281617652c176).(unsigned int table, unsigned int index) |
| 74 | { |
| 75 | return (sprite_existscxx . . $ sprite_exists(8e1b545ea3aecce3).(table, index) ? spritecxx . . $ sprite(d067a90ab23634af).(table, index)->heightcxx . . $ $anonymous_type_297934740aeafb7d_0#height. : 0); |
| 76 | } |
| 77 | |
| 78 | void load_sprites_filecxx . . $ load_sprites_file(d7adf5cfafc0e15a).(unsigned int table, const char *filename); |
| 79 | void load_spritescxx . . $ load_sprites(60af6e60da050086).(unsigned int table, FILEcxx . . $ FILE# *f); |
| 80 | void free_spritescxx . . $ free_sprites(cb2f890c2fdad230).(unsigned int table); |
| 81 | |
| 82 | void blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, unsigned int table, unsigned int index); // JE_newDrawCShapeNum |
| 83 | void blit_sprite_blendcxx . . $ blit_sprite_blend(ee201c8e1efc2766).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, unsigned int table, unsigned int index); // JE_newDrawCShapeTrick |
| 84 | void blit_sprite_hv_unsafecxx . . $ blit_sprite_hv_unsafe(62f96868ab2f1929).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, unsigned int table, unsigned int index, Uint8cxx . . $ Uint8# hue, Sint8cxx . . $ Sint8# value); // JE_newDrawCShapeBright |
| 85 | void blit_sprite_hvcxx . . $ blit_sprite_hv(62f96868ab2f1929).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, unsigned int table, unsigned int index, Uint8cxx . . $ Uint8# hue, Sint8cxx . . $ Sint8# value); // JE_newDrawCShapeAdjust |
| 86 | void blit_sprite_hv_blendcxx . . $ blit_sprite_hv_blend(62f96868ab2f1929).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, unsigned int table, unsigned int index, Uint8cxx . . $ Uint8# hue, Sint8cxx . . $ Sint8# value); // JE_newDrawCShapeModify |
| 87 | void blit_sprite_darkcxx . . $ blit_sprite_dark(34bc9a7b28a4eeec).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, unsigned int table, unsigned int index, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! black); // JE_newDrawCShapeDarken, JE_newDrawCShapeShadow |
| 88 | |
| 89 | typedef structcxx . . $ $anonymous_type_297934740aeafb7d_2# |
| 90 | { |
| 91 | size_t sizecxx . . $ $anonymous_type_297934740aeafb7d_2#size.; |
| 92 | Uint8cxx . . $ Uint8# *datacxx . . $ $anonymous_type_297934740aeafb7d_2#data.; |
| 93 | } |
| 94 | Sprite2_arraycxx . . $ Sprite2_array#; |
| 95 | |
| 96 | // Shop icons and arrows sprite sheet. |
| 97 | extern Sprite2_arraycxx . . $ Sprite2_array# shopSpriteSheetcxx . . $ shopSpriteSheet.; // fka shapes6 |
| 98 | |
| 99 | // Explosions sprite sheet. |
| 100 | extern Sprite2_arraycxx . . $ Sprite2_array# explosionSpriteSheetcxx . . $ explosionSpriteSheet.; // fka shapes6 |
| 101 | |
| 102 | // Enemy sprite sheet banks. |
| 103 | extern Sprite2_arraycxx . . $ Sprite2_array# enemySpriteSheetscxx . . $ enemySpriteSheets.[4]; // fka eShapes1, eShapes2, eShapes3, eShapes4 |
| 104 | extern Uint8cxx . . $ Uint8# enemySpriteSheetIdscxx . . $ enemySpriteSheetIds.[4]; // fka enemyShapeTables |
| 105 | |
| 106 | // Destruct sprite sheet. |
| 107 | extern Sprite2_arraycxx . . $ Sprite2_array# destructSpriteSheetcxx . . $ destructSpriteSheet.; // fka shapes6 |
| 108 | |
| 109 | // Static sprite sheets. Player shots, player ships, power-ups, coins, etc. |
| 110 | extern Sprite2_arraycxx . . $ Sprite2_array# spriteSheet8cxx . . $ spriteSheet8.; // fka shapesC1 |
| 111 | extern Sprite2_arraycxx . . $ Sprite2_array# spriteSheet9cxx . . $ spriteSheet9.; // fka shapes9 |
| 112 | extern Sprite2_arraycxx . . $ Sprite2_array# spriteSheet10cxx . . $ spriteSheet10.; // fka eShapes6 |
| 113 | extern Sprite2_arraycxx . . $ Sprite2_array# spriteSheet11cxx . . $ spriteSheet11.; // fka eShapes5 |
| 114 | extern Sprite2_arraycxx . . $ Sprite2_array# spriteSheet12cxx . . $ spriteSheet12.; // fka shapesW2 |
| 115 | |
| 116 | void JE_loadCompShapescxx . . $ JE_loadCompShapes(676db0deaa5c5c40).(Sprite2_arraycxx . . $ Sprite2_array# *, char s); |
| 117 | void JE_loadCompShapesBcxx . . $ JE_loadCompShapesB(95a3c161ef275fb3).(Sprite2_arraycxx . . $ Sprite2_array# *, FILEcxx . . $ FILE# *f); |
| 118 | void free_sprite2scxx . . $ free_sprite2s(da72ff5ad2e190db).(Sprite2_arraycxx . . $ Sprite2_array# *); |
| 119 | |
| 120 | void blit_sprite2cxx . . $ blit_sprite2(b5d0f2be3b000a5b).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index); |
| 121 | void blit_sprite2_clipcxx . . $ blit_sprite2_clip(b5d0f2be3b000a5b).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index); |
| 122 | void blit_sprite2_blendcxx . . $ blit_sprite2_blend(b5d0f2be3b000a5b).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index); |
| 123 | void blit_sprite2_darkencxx . . $ blit_sprite2_darken(b5d0f2be3b000a5b).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index); |
| 124 | void blit_sprite2_filtercxx . . $ blit_sprite2_filter(2b2597c85c53621a).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index, Uint8cxx . . $ Uint8# filter); |
| 125 | void blit_sprite2_filter_clipcxx . . $ blit_sprite2_filter_clip(2b2597c85c53621a).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index, Uint8cxx . . $ Uint8# filter); |
| 126 | |
| 127 | void blit_sprite2x2cxx . . $ blit_sprite2x2(b5d0f2be3b000a5b).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index); |
| 128 | void blit_sprite2x2_clipcxx . . $ blit_sprite2x2_clip(b5d0f2be3b000a5b).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index); |
| 129 | void blit_sprite2x2_blendcxx . . $ blit_sprite2x2_blend(b5d0f2be3b000a5b).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index); |
| 130 | void blit_sprite2x2_darkencxx . . $ blit_sprite2x2_darken(b5d0f2be3b000a5b).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index); |
| 131 | void blit_sprite2x2_filtercxx . . $ blit_sprite2x2_filter(2b2597c85c53621a).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index, Uint8cxx . . $ Uint8# filter); |
| 132 | void blit_sprite2x2_filter_clipcxx . . $ blit_sprite2x2_filter_clip(2b2597c85c53621a).(SDL_Surfacecxx . . $ SDL_Surface# *, int x, int y, Sprite2_arraycxx . . $ Sprite2_array#, unsigned int index, Uint8cxx . . $ Uint8# filter); |
| 133 | |
| 134 | void JE_loadMainShapeTablescxx . . $ JE_loadMainShapeTables(85c52e162fed56f9).(const char *shpfile); |
| 135 | void free_main_shape_tablescxx . . $ free_main_shape_tables(49f6e7a06ebc5aa8).(void); |
| 136 | |
| 137 | #endif // SPRITE_H |