Overview
Comment: | Add some more stuff with graphics and some other stuff that was previously forgotten |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c5926b50b9cfd1e1bd8ea65458b8eaf8 |
User & Date: | user on 2018-07-08 00:13:54 |
Other Links: | manifest | tags |
Context
2018-07-10
| ||
05:56 | Add a "maxObjects" resource. Also add some missing "extern" from declarations in heromesh.h and add a hidden "heap test" option check-in: 402432f1b2 user: user tags: trunk | |
2018-07-08
| ||
00:13 | Add some more stuff with graphics and some other stuff that was previously forgotten check-in: c5926b50b9 user: user tags: trunk | |
2018-07-02
| ||
21:27 | Correct some errors in exec.c introduced in the previous commit check-in: 59319cbd25 user: user tags: trunk | |
Changes
Modified compile from [67c0841242] to [5fc19466c4].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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 | + + + + + + + + + | #!/bin/bash -- test -f CFLAGS || echo xxx > CFLAGS test "xx$CFLAGS" = "x`cat CFLAGS`" || rm bindings.o class.o picture.o function.o exec.o echo "x$CFLAGS" > CFLAGS test "x$EXE" = "x" && EXE=~/bin/heromesh echo 'Flags: ' "$CFLAGS" echo 'Target filename: ' "$EXE" test instruc -nt instruc.h && node instruc.js > instruc.h test instruc.js -nt instruc.h && node instruc.js > instruc.h test names.js -nt names.h && node names.js > names.h test quarks -nt quarks.h && node quarks.js > quarks.h test quarks.js -nt quarks.h && node quarks.js > quarks.h test heromesh.h -nt "$EXE" && rm bindings.o class.o picture.o function.o exec.o test instruc.h -nt "$EXE" && rm class.o test pcfont.h -nt "$EXE" && rm picture.o test quarks.h -nt "$EXE" && rm bindings.o picture.o echo '* bindings' test bindings.c -nt bindings.o && bash bindings.c echo '* class' test class.c -nt class.o && bash class.c echo '* function' test function.c -nt function.o && bash function.c echo '* picture' test picture.c -nt picture.o && bash picture.c echo '* exec' test exec.c -nt exec.o && bash exec.c echo '* main' bash main.c echo 'DONE' |
Modified exec.c from [61678b6bb7] to [355c5a5b56].
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + | Uint32 generation_number; Object**objects; Uint32 nobjects; Value globals[0x800]; Uint32 firstobj=VOIDLINK; Uint32 lastobj=VOIDLINK; Uint32 playfield[64*64]; Uint8 pfwidth,pfheight; typedef struct { Uint16 msg; Uint32 from; Value arg1,arg2,arg3; } MessageVars; |
︙ |
Modified heromesh.h from [38fd763986] to [d034a0352f].
︙ | |||
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | + + | #define LUMP_LEVEL_IDX (-1) #define LUMP_CLASS_DEF (-2) // == picture == extern SDL_Surface*screen; extern Uint16 picture_size; extern int left_margin; void draw_picture(int x,int y,Uint16 img); void draw_text(int x,int y,const unsigned char*t,int bg,int fg); void draw_cell(int x,int y); void load_pictures(void); // == class == #define CF_PLAYER 0x01 #define CF_INPUT 0x02 #define CF_COMPATIBLE 0x04 |
︙ | |||
168 169 170 171 172 173 174 175 176 177 178 179 180 181 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | + | extern Uint32 generation_number; extern Object**objects; extern Uint32 nobjects; extern Value globals[0x800]; extern Uint32 firstobj,lastobj; extern Uint32 playfield[64*64]; Uint8 pfwidth,pfheight; void pfunlink(Uint32 n); void pflink(Uint32 n); Uint32 objalloc(Uint16 c); void annihilate(void); const char*execute_turn(int key); |
Modified main.c from [d2ea69aa98] to [2de729fbaa].
1 | 1 2 3 4 5 6 7 8 9 | - + | #if 0 |
︙ |
Modified picture.c from [b641536c5e] to [cbe344cbd2].
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | + | #include "smallxrm.h" #include "pcfont.h" #include "quarks.h" #include "heromesh.h" SDL_Surface*screen; Uint16 picture_size; int left_margin; static SDL_Surface*picts; static Uint8*curpic; static const char default_palette[]= "C020FF " "000000 222222 333333 444444 555555 666666 777777 888888 999999 AAAAAA BBBBBB CCCCCC DDDDDD EEEEEE FFFFFF " |
︙ | |||
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | + + + + + + + + + + + + + + + + + | void draw_picture(int x,int y,Uint16 img) { // To be called only when screen is unlocked! SDL_Rect src={(img&15)*picture_size,(img>>4)*picture_size,picture_size,picture_size}; SDL_Rect dst={x,y,picture_size,picture_size}; SDL_BlitSurface(picts,&src,screen,&dst); } void draw_cell(int x,int y) { // To be called only when screen is unlocked! Uint32 o; Class*c; SDL_Rect dst={x,y,picture_size,picture_size}; if(x<1 || x>64 || y<1 || y>64) return; SDL_FillRect(screen,&dst,back_color); o=playfield[y*64+x+65]; while(o!=VOIDLINK) { if(!(objects[o]->oflags&OF_INVISIBLE)) { c=classes[objects[o]->class]; if(objects[o]->image<c->nimages) draw_picture(x*picture_size+left_margin,y*picture_size,c->images[objects[o]->image]&0x7FFF); } o=objects[o]->up; } } void draw_text(int x,int y,const unsigned char*t,int bg,int fg) { // To be called only when screen is locked! int len=strlen(t); Uint8*pix=screen->pixels; Uint8*p; Uint16 pitch=screen->pitch; |
︙ | |||
334 335 336 337 338 339 340 341 | 352 353 354 355 356 357 358 359 360 361 | + + | if(v=xrm_get_resource(resourcedb,optionquery,optionquery,2)) { w=strtol(v,(void*)&v,10); h=strtol(v,0,10); SDL_EnableKeyRepeat(w,h); } else { SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,SDL_DEFAULT_REPEAT_INTERVAL); } optionquery[1]=Q_margin; left_margin=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"65",0,10); } |
Modified quarks from [289fcbcd17] to [4fe1d966b3].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | + | ! Resource names for Free Hero Mesh. ! This file is public domain. ! Each line contains one name, is blank, or starts with ! for a comment. ! Graphics/screen screenWidth screenHeight margin palette popupColors imageSize altImage editTitle gameTitle gamma |
︙ |
Modified quarks.h from [e59ed81496] to [2ba01dbe27].
1 2 | 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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #define Q_screenWidth 2 #define Q_screenHeight 3 #define Q_margin 4 |
︙ |