[56] | 1 | /* |
---|
| 2 | * Abuse - dark 2D side-scrolling platform game |
---|
| 3 | * Copyright (c) 1995 Crack dot Com |
---|
| 4 | * |
---|
| 5 | * This software was released into the Public Domain. As with most public |
---|
| 6 | * domain software, no warranty is made or implied by Crack dot Com or |
---|
| 7 | * Jonathan Clark. |
---|
| 8 | */ |
---|
| 9 | |
---|
[66] | 10 | /* FIXME: this file is unused */ |
---|
| 11 | |
---|
[2] | 12 | #ifndef __MORPH_HPP_ |
---|
| 13 | #define __MORPH_HPP_ |
---|
| 14 | |
---|
| 15 | #include <stdio.h> |
---|
[66] | 16 | |
---|
[481] | 17 | #include "image.h" |
---|
| 18 | #include "palette.h" |
---|
| 19 | #include "macs.h" |
---|
| 20 | #include "specs.h" |
---|
| 21 | #include "filter.h" |
---|
[2] | 22 | |
---|
| 23 | |
---|
| 24 | struct morph_point8 |
---|
[124] | 25 | { |
---|
[2] | 26 | unsigned char x1,y1,x2,y2; |
---|
| 27 | unsigned char start_color,end_color; |
---|
| 28 | } ; |
---|
| 29 | |
---|
| 30 | struct morph_point16 |
---|
[124] | 31 | { |
---|
[2] | 32 | unsigned short x1,y1,x2,y2; |
---|
| 33 | unsigned char start_color,end_color; |
---|
| 34 | } ; |
---|
| 35 | |
---|
| 36 | struct morph_patch // patch a frame of animation |
---|
| 37 | { |
---|
| 38 | unsigned short patches; |
---|
| 39 | unsigned char *patch_data; // x,y,color |
---|
| 40 | } ; |
---|
| 41 | |
---|
| 42 | class jmorph |
---|
| 43 | { |
---|
| 44 | protected : |
---|
| 45 | unsigned char small; |
---|
| 46 | void *p; // points to a 8 or 16 struct |
---|
[124] | 47 | long total; |
---|
[2] | 48 | unsigned short w[2],h[2]; |
---|
[124] | 49 | public : |
---|
[2] | 50 | int total_points() { return total; } |
---|
| 51 | morph_point8 *small_points() { return (morph_point8 *)p; } |
---|
| 52 | jmorph(spec_entry *e, FILE *fp); |
---|
| 53 | jmorph(image *i1, image *hint1, image *i2, image *hint2, int aneal_steps); |
---|
[124] | 54 | void show_frame(image *screen, int x, int y, int frames, int frame_on, |
---|
| 55 | color_filter *fli, palette *pal); |
---|
| 56 | void show_8(image *screen, int x, int y, int frame_on, color_filter *fli, palette *pal); |
---|
[2] | 57 | void show_24frame(unsigned char *screen, int width, int height, |
---|
[124] | 58 | int x, int y, int frames, int frame_on, palette *pal); |
---|
[2] | 59 | void show_step_frame(image *screen, int x, int y, int frame_on, color_filter *fli, palette *pal); |
---|
| 60 | int bound_x1(int which) { return 0; } |
---|
| 61 | int bound_y1(int which) { return 0; } |
---|
| 62 | int bound_x2(int which) { return w[which]; } |
---|
| 63 | int bound_y2(int which) { return h[which]; } |
---|
| 64 | int write(FILE *fp); |
---|
| 65 | void add_filler(int frames); |
---|
| 66 | int small_morph() { return small; } |
---|
[129] | 67 | ~jmorph() { free(p); } |
---|
[124] | 68 | } ; |
---|
[2] | 69 | |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | class patched_morph : public jmorph |
---|
| 73 | { |
---|
| 74 | public : |
---|
| 75 | morph_patch *pats; |
---|
| 76 | unsigned short patches; |
---|
| 77 | patched_morph(spec_entry *e, FILE *fp); |
---|
| 78 | patched_morph(image *i1, image *hint1, image *i2, image *hint2, int aneal_steps, |
---|
[124] | 79 | color_filter *fli, palette *pal, int frames); |
---|
| 80 | void show_frame(image *screen, int x, int y, int frame_on, color_filter *fli, palette *pal); |
---|
| 81 | void show_8(image *screen, int x, int y, int frame_on, color_filter *fli, palette *pal); |
---|
[129] | 82 | ~patched_morph() { free(pats); } |
---|
[2] | 83 | |
---|
| 84 | } ; |
---|
| 85 | |
---|
| 86 | struct step_struct |
---|
| 87 | { |
---|
| 88 | unsigned short x,y,r,g,b; |
---|
| 89 | short dx,dy,dr,dg,db; |
---|
| 90 | } ; |
---|
| 91 | |
---|
| 92 | class step_morph |
---|
| 93 | { |
---|
| 94 | int total; |
---|
| 95 | step_struct *points; |
---|
| 96 | int frame_on,dir,face_dir; |
---|
| 97 | patched_morph *pm; |
---|
| 98 | public : |
---|
| 99 | step_morph(patched_morph *mor, palette *pal, int frame_direction, int face_direction); |
---|
[124] | 100 | void show_frame(image *screen, int x, int y, color_filter *fli); |
---|
[2] | 101 | void reverse_direction(); |
---|
[129] | 102 | ~step_morph() { free(points); } |
---|
[2] | 103 | } ; |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | #endif |
---|
| 107 | |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | |
---|
| 112 | |
---|