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