wwww
修訂 | 7477a345cbe3f5ee467e18f1a1020eff67e43ded (tree) |
---|---|
時間 | 2016-05-03 06:27:24 |
作者 | sparky4 <sparky4@cock...> |
Commiter | sparky4 |
panning updated and stuff wwww
@@ -32,7 +32,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
32 | 32 | //right movement |
33 | 33 | case 3: |
34 | 34 | //printf("pip[0].page->tilesw=%d\n", pip[0].page->tilesw); |
35 | - if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tilesw < pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx && | |
35 | + if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx && | |
36 | 36 | !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY)) //collision detection! |
37 | 37 | { |
38 | 38 | if(player[pn].q<=player[pn].spt) |
@@ -75,7 +75,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
75 | 75 | |
76 | 76 | //left movement |
77 | 77 | case 1: |
78 | - if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tilesw <= pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx && | |
78 | + if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx && | |
79 | 79 | !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY)) //collision detection! |
80 | 80 | { |
81 | 81 | if(player[pn].q<=player[pn].spt) |
@@ -118,7 +118,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
118 | 118 | |
119 | 119 | //down movement |
120 | 120 | case 4: |
121 | - if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->tilesh < pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny && | |
121 | + if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny && | |
122 | 122 | !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY)) //collision detection! |
123 | 123 | { |
124 | 124 | if(player[pn].q<=player[pn].spt) |
@@ -161,7 +161,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
161 | 161 | |
162 | 162 | //up movement |
163 | 163 | case 0: |
164 | - if(pip[0].ty > 0 && pip[0].ty+pip[0].page->tilesh <= pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny && | |
164 | + if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny && | |
165 | 165 | !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY)) //collision detection! |
166 | 166 | { |
167 | 167 | if(player[pn].q<=player[pn].spt) |
@@ -211,7 +211,7 @@ void panpagemanual(map_view_t *pip, player_t *player, word pn) | ||
211 | 211 | { |
212 | 212 | //right movement |
213 | 213 | case 3: |
214 | - if(pip[pip[0].pan->pn].tx >= -1 && pip[pip[0].pan->pn].tx+pip[pip[0].pan->pn].page->tilesw < pip[pip[0].pan->pn].page->tilesw+1) | |
214 | + if(pip[pip[0].pan->pn].tx >= -1 && pip[pip[0].pan->pn].tx+pip[pip[0].pan->pn].page->tw < pip[pip[0].pan->pn].page->tilesw+1) | |
215 | 215 | { |
216 | 216 | if(player[pn].q<=player[pn].spt) |
217 | 217 | { |
@@ -372,9 +372,9 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid) | ||
372 | 372 | x= mv[0].page->sw + mv[id].map->tiles->tileWidth; |
373 | 373 | if(player[plid].q%4) |
374 | 374 | if(id==0) |
375 | - mapDrawCol(&mv[0], mv[0].tx + mv[0].page->tilesw, mv[0].ty-1, x, player, mv->page->dx); | |
375 | + mapDrawCol(&mv[0], mv[0].tx + mv[0].page->tw, mv[0].ty-1, x, player, mv->page->dx); | |
376 | 376 | else |
377 | - modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*(mv[0].page->tilesh+2)); | |
377 | + modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*(mv[0].page->th+2)); | |
378 | 378 | //} |
379 | 379 | } |
380 | 380 |
@@ -403,7 +403,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid) | ||
403 | 403 | if(id==0) |
404 | 404 | mapDrawCol(&mv[0], mv[0].tx - 1, mv[0].ty-1, x, player, mv->page->dx); |
405 | 405 | else |
406 | - modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*(mv[0].page->tilesh+2)); | |
406 | + modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*(mv[0].page->th+2)); | |
407 | 407 | //} |
408 | 408 | } |
409 | 409 |
@@ -431,7 +431,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid) | ||
431 | 431 | if(id==0) |
432 | 432 | mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty-1, y, player, mv->page->dy); |
433 | 433 | else |
434 | - modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->tilesw+2), mv[id].map->tiles->tileHeight); | |
434 | + modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->tw+2), mv[id].map->tiles->tileHeight); | |
435 | 435 | //} |
436 | 436 | } |
437 | 437 |
@@ -456,9 +456,9 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid) | ||
456 | 456 | y= mv[0].page->sh + mv[id].map->tiles->tileHeight; |
457 | 457 | if(player[plid].q%3) |
458 | 458 | if(id==0) |
459 | - mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->tilesh, y, player, mv->page->dy); | |
459 | + mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->th, y, player, mv->page->dy); | |
460 | 460 | else |
461 | - modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->tilesw+2), mv[id].map->tiles->tileHeight); | |
461 | + modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->tw+2), mv[id].map->tiles->tileHeight); | |
462 | 462 | //} |
463 | 463 | } |
464 | 464 |
@@ -583,7 +583,7 @@ void mapGoTo(map_view_t *mv, int tx, int ty) | ||
583 | 583 | mv->dyThresh = mv->map->tiles->tileHeight * 2; |
584 | 584 | |
585 | 585 | /* draw the tiles */ |
586 | - modexClearRegion(mv->page, 0, 0, mv->page->width+mv->map->tiles->tileWidth, mv->page->height+mv->map->tiles->tileHeight, 0); | |
586 | + modexClearRegion(mv->page, 0, 0, mv->page->width, mv->page->height, 0); | |
587 | 587 | py=0; |
588 | 588 | i=mv->ty * mv->map->width + mv->tx; |
589 | 589 | for(ty=mv->ty-1; py < mv->page->sh+mv->dyThresh && ty < mv->map->height; ty++, py+=mv->map->tiles->tileHeight) { |
@@ -40,7 +40,7 @@ static planar_buf_t huge *pp; | ||
40 | 40 | float t; |
41 | 41 | sword bakapee; |
42 | 42 | pan_t pan; |
43 | -boolean panswitch=1; | |
43 | +boolean panswitch=0; | |
44 | 44 | unsigned int i; |
45 | 45 | const char *cpus; |
46 | 46 | //static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */ |
@@ -175,38 +175,38 @@ void main(int argc, char *argv[]) | ||
175 | 175 | |
176 | 176 | //TODO: put player in starting position of spot |
177 | 177 | //default player position on the viewable map |
178 | - player[panswitch].tx = mv[0].tx + mv[0].page->tilemidposscreenx; | |
179 | - player[panswitch].ty = mv[0].ty + mv[0].page->tilemidposscreeny; | |
178 | + player[0].tx = mv[0].tx + mv[0].page->tilemidposscreenx; | |
179 | + player[0].ty = mv[0].ty + mv[0].page->tilemidposscreeny; | |
180 | 180 | IN_initplayer(&player, 0); |
181 | 181 | IN_initplayer(&player, 1); |
182 | 182 | |
183 | -// modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height); | |
183 | + modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height); | |
184 | 184 | #ifndef SPRITE |
185 | -// modexClearRegion(mv[1].page, player[panswitch].x-4, player[panswitch].y-TILEWH, 24, 32, 15); | |
185 | + modexClearRegion(mv[1].page, player[panswitch].x-4, player[panswitch].y-TILEWH, 24, 32, 15); | |
186 | 186 | #else |
187 | 187 | //PBUFSFUN(mv[1].page, player[panswitch].x-4, player[panswitch].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATA); |
188 | -// PBUFSFUN(mv[1].page, player[panswitch].x-4, player[panswitch].y-TILEWH, 24, 64, 24, 32, &pp); | |
188 | + PBUFSFUN(mv[1].page, player[panswitch].x-4, player[panswitch].y-TILEWH, 24, 64, 24, 32, &pp); | |
189 | 189 | #endif |
190 | 190 | |
191 | - modexShowPage(mv[pan.pn].page); | |
192 | - shinku_fps_indicator_page = 0; // we're on page 1 now, shinku(). follow along please or it will not be visible. | |
191 | + modexShowPage(mv[1].page); | |
192 | + shinku_fps_indicator_page = 1; // we're on page 1 now, shinku(). follow along please or it will not be visible. | |
193 | 193 | //modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 1); |
194 | 194 | #ifdef MODEX |
195 | 195 | #ifdef FADE |
196 | 196 | modexFadeOn(4, gpal); |
197 | 197 | #endif |
198 | 198 | #endif |
199 | - while(!IN_KeyDown(sc_Escape) && player[panswitch].hp>0) | |
199 | + while(!IN_KeyDown(sc_Escape) && player[0].hp>0) | |
200 | 200 | { |
201 | 201 | shinku(&gvar); |
202 | 202 | //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square |
203 | 203 | //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction |
204 | - //when player[panswitch].tx or player[panswitch].ty == 0 or player[panswitch].tx == 20 or player[panswitch].ty == 15 then stop because that is edge of map and you do not want to walk of the map | |
204 | + //when player[0].tx or player[0].ty == 0 or player[0].tx == 20 or player[0].ty == 15 then stop because that is edge of map and you do not want to walk of the map | |
205 | 205 | |
206 | 206 | //player movement |
207 | 207 | IN_ReadControl(panswitch,&player); |
208 | 208 | if(!panswitch){ |
209 | - walk(mv, player, panswitch); | |
209 | + walk(mv, player, 0); | |
210 | 210 | }else{ |
211 | 211 | panpagemanual(mv, player, pan.pn); |
212 | 212 | //printf(" player[panswitch].q: %d", player[panswitch].q); printf(" player[panswitch].d: %d\n", player[panswitch].d); |
@@ -215,7 +215,7 @@ void main(int argc, char *argv[]) | ||
215 | 215 | |
216 | 216 | //the scripting stuff.... |
217 | 217 | //if(((player[panswitch].triggerx == TRIGGX && player[panswitch].triggery == TRIGGY) && IN_KeyDown(0x1C))||(player[panswitch].tx == 5 && player[panswitch].ty == 5)) |
218 | - if(((mv[panswitch].map->data[(player[panswitch].triggerx-1)+(map.width*(player[panswitch].triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[panswitch].tx == 5 && player[panswitch].ty == 5)) | |
218 | + if(((mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].tx == 5 && player[0].ty == 5)) | |
219 | 219 | { |
220 | 220 | short i; |
221 | 221 | for(i=800; i>=400; i--) |
@@ -224,7 +224,7 @@ void main(int argc, char *argv[]) | ||
224 | 224 | } |
225 | 225 | nosound(); |
226 | 226 | } |
227 | - if(player[panswitch].q == (TILEWH/(player[panswitch].speed))+1 && player[panswitch].info.dir != 2 && (player[panswitch].triggerx == 5 && player[panswitch].triggery == 5)){ player[panswitch].hp--; } | |
227 | + if(player[0].q == (TILEWH/(player[0].speed))+1 && player[0].info.dir != 2 && (player[0].triggerx == 5 && player[0].triggery == 5)){ player[0].hp--; } | |
228 | 228 | //debugging binds! |
229 | 229 | //if(IN_KeyDown(0x0E)) while(1){ if(xmsmalloc(24)) break; } |
230 | 230 | if(IN_KeyDown(2)){ modexShowPage(mv[0].page); pan.pn=0; } |
@@ -238,7 +238,7 @@ void main(int argc, char *argv[]) | ||
238 | 238 | #ifdef FADE |
239 | 239 | if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); } |
240 | 240 | if(IN_KeyDown(22)){ |
241 | - paloffset=0; modexPalBlack(); modexPalUpdate(&player[panswitch].data, &paloffset, 0, 0); | |
241 | + paloffset=0; modexPalBlack(); modexPalUpdate(&player[0].data, &paloffset, 0, 0); | |
242 | 242 | printf("1paloffset = %d\n", paloffset/3); |
243 | 243 | modexPalUpdate(map.tiles->data, &paloffset, 0, 0); |
244 | 244 | printf("2paloffset = %d\n", paloffset/3); |
@@ -276,7 +276,7 @@ void main(int argc, char *argv[]) | ||
276 | 276 | //9 |
277 | 277 | if(IN_KeyDown(10)){ modexPalOverscan(default_pal, rand()%56); modexPalUpdate1(default_pal); } |
278 | 278 | //if(IN_KeyDown(11)){ modexPalOverscan(default_pal, 15); } |
279 | - if((player[panswitch].q==1) && !(player[panswitch].x%TILEWH==0 && player[panswitch].y%TILEWH==0)) break; //incase things go out of sync! | |
279 | + if((player[0].q==1) && !(player[0].x%TILEWH==0 && player[0].y%TILEWH==0)) break; //incase things go out of sync! | |
280 | 280 | } |
281 | 281 | |
282 | 282 | /* fade back to text mode */ |