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 | #!/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 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 test bindings.c -nt bindings.o && bash bindings.c test class.c -nt class.o && bash class.c test function.c -nt function.o && bash function.c test picture.c -nt picture.o && bash picture.c test exec.c -nt exec.o && bash exec.c bash main.c | > > > > > > > > > | 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 | Uint32 generation_number; Object**objects; Uint32 nobjects; Value globals[0x800]; Uint32 firstobj=VOIDLINK; Uint32 lastobj=VOIDLINK; Uint32 playfield[64*64]; typedef struct { Uint16 msg; Uint32 from; Value arg1,arg2,arg3; } MessageVars; | > | 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 | #define LUMP_LEVEL_IDX (-1) #define LUMP_CLASS_DEF (-2) // == picture == extern SDL_Surface*screen; extern Uint16 picture_size; 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 load_pictures(void); // == class == #define CF_PLAYER 0x01 #define CF_INPUT 0x02 #define CF_COMPATIBLE 0x04 | > > | 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 | extern Uint32 generation_number; extern Object**objects; extern Uint32 nobjects; extern Value globals[0x800]; extern Uint32 firstobj,lastobj; extern Uint32 playfield[64*64]; void pfunlink(Uint32 n); void pflink(Uint32 n); Uint32 objalloc(Uint16 c); void annihilate(void); const char*execute_turn(int key); | > | 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 | #if 0 | | | 1 2 3 4 5 6 7 8 9 | #if 0 gcc ${CFLAGS:--s -O2} -o ${EXE:-~/bin/heromesh} main.c class.o picture.o bindings.o function.o exec.o smallxrm.o sqlite3.o `sdl-config --cflags --libs` -ldl -lpthread exit #endif /* This program is part of Free Hero Mesh and is public domain. */ |
︙ | ︙ |
Modified picture.c from [b641536c5e] to [cbe344cbd2].
︙ | ︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include "smallxrm.h" #include "pcfont.h" #include "quarks.h" #include "heromesh.h" SDL_Surface*screen; Uint16 picture_size; 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 " | > | 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 | 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_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; | > > > > > > > > > > > > > > > > > | 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 | 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); } } | > > | 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 | ! 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 palette popupColors imageSize altImage editTitle gameTitle gamma | > | 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 | #define Q_screenWidth 2 #define Q_screenHeight 3 | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | 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 #define Q_palette 5 #define Q_popupColors 6 #define Q_imageSize 7 #define Q_altImage 8 #define Q_editTitle 9 #define Q_gameTitle 10 #define Q_gamma 11 #define Q_screenFlags 12 #define Q_sfxVolume 13 #define Q_audioBuffer 14 #define Q_audioRate 15 #define Q_audioFormat 16 #define Q_musicVolume 17 #define Q_musicFile 18 #define Q_keyRepeat 19 #define Q_editKey 20 #define Q_gameKey 21 #define Q_backspace 22 #define Q_tab 23 #define Q_clear 24 #define Q_return 25 #define Q_pause 26 #define Q_escape 27 #define Q_space 28 #define Q_exclaim 29 #define Q_quotedbl 30 #define Q_hash 31 #define Q_dollar 32 #define Q_ampersand 33 #define Q_quote 34 #define Q_leftparen 35 #define Q_rightparen 36 #define Q_asterisk 37 #define Q_plus 38 #define Q_comma 39 #define Q_minus 40 #define Q_period 41 #define Q_slash 42 #define Q_0 43 #define Q_1 44 #define Q_2 45 #define Q_3 46 #define Q_4 47 #define Q_5 48 #define Q_6 49 #define Q_7 50 #define Q_8 51 #define Q_9 52 #define Q_colon 53 #define Q_semicolon 54 #define Q_less 55 #define Q_equals 56 #define Q_greater 57 #define Q_question 58 #define Q_at 59 #define Q_leftbracket 60 #define Q_rightbracket 61 #define Q_caret 62 #define Q_underscore 63 #define Q_backquote 64 #define Q_A 65 #define Q_B 66 #define Q_C 67 #define Q_D 68 #define Q_E 69 #define Q_F 70 #define Q_G 71 #define Q_H 72 #define Q_I 73 #define Q_J 74 #define Q_K 75 #define Q_L 76 #define Q_M 77 #define Q_N 78 #define Q_O 79 #define Q_P 80 #define Q_Q 81 #define Q_R 82 #define Q_S 83 #define Q_T 84 #define Q_U 85 #define Q_V 86 #define Q_W 87 #define Q_X 88 #define Q_Y 89 #define Q_Z 90 #define Q_delete 91 #define Q_kp0 92 #define Q_kp1 93 #define Q_kp2 94 #define Q_kp3 95 #define Q_kp4 96 #define Q_kp5 97 #define Q_kp6 98 #define Q_kp7 99 #define Q_kp8 100 #define Q_kp9 101 #define Q_kp_period 102 #define Q_kp_divide 103 #define Q_kp_multiply 104 #define Q_kp_minus 105 #define Q_kp_plus 106 #define Q_kp_enter 107 #define Q_kp_equals 108 #define Q_up 109 #define Q_down 110 #define Q_right 111 #define Q_left 112 #define Q_insert 113 #define Q_home 114 #define Q_end 115 #define Q_pageup 116 #define Q_pagedown 117 #define Q_f1 118 #define Q_f2 119 #define Q_f3 120 #define Q_f4 121 #define Q_f5 122 #define Q_f6 123 #define Q_f7 124 #define Q_f8 125 #define Q_f9 126 #define Q_f10 127 #define Q_f11 128 #define Q_f12 129 #define Q_f13 130 #define Q_f14 131 #define Q_f15 132 #define Q_numlock 133 #define Q_capslock 134 #define Q_scrollock 135 #define Q_rshift 136 #define Q_lshift 137 #define Q_rctrl 138 #define Q_lctrl 139 #define Q_ralt 140 #define Q_lalt 141 #define Q_rmeta 142 #define Q_lmeta 143 #define Q_lsuper 144 #define Q_rsuper 145 #define Q_mode 146 #define Q_help 147 #define Q_print 148 #define Q_sysreq 149 #define Q_break 150 #define Q_menu 151 #define Q_power 152 #define Q_euro 153 #define Q_compose 154 #define Q_undo 155 #define Q_shift 156 #define Q_ctrl 157 #define Q_alt 158 #define Q_meta 159 #define Q_numLock 160 #define Q_editClick 161 #define Q_gameClick 162 #define Q_allowMouseWarp 163 #define Q_middle 164 #define Q_class 165 #define Q_quiz 166 #define Q_saveSolutions 167 #define Q_solutionComment 168 #define Q_solutionTimestamp 169 #define Q_sqlFile 170 #define Q_sqlInit 171 #define Q_sqlExtensions 172 #define Q_sqlMemStatus 173 #define Q_sqlSmallAllocations 174 #define Q_sqlCoveringIndexScan 175 #define Q_sqlPowerSafe 176 #define Q_level 177 #define Q_tracePrefix 178 #define Q_stackProtection 179 static const char*const global_quarks[]={ "screenWidth", "screenHeight", "margin", "palette", "popupColors", "imageSize", "altImage", "editTitle", "gameTitle", "gamma", |
︙ | ︙ |