| 1 | |
| 2 | /** |
| 3 | * |
| 4 | * @file jj2levelplayer.cpp |
| 5 | * |
| 6 | * Part of the OpenJazz project |
| 7 | * |
| 8 | * @par History: |
| 9 | * - 23rd August 2005: Created level.c |
| 10 | * - 1st January 2006: Created events.c from parts of level.c |
| 11 | * - 3rd February 2009: Renamed events.c to events.cpp and level.c to level.cpp, |
| 12 | * created player.cpp |
| 13 | * - 5th February 2009: Added parts of events.cpp and level.cpp to player.cpp |
| 14 | * - 24th June 2010: Created levelplayer.cpp from parts of player.cpp |
| 15 | * - 29th June 2010: Created jj2levelplayer.cpp from parts of levelplayer.cpp |
| 16 | * |
| 17 | * @par Licence: |
| 18 | * Copyright (c) 2005-2012 AJ Thomson |
| 19 | * |
| 20 | * OpenJazz is distributed under the terms of |
| 21 | * the GNU General Public License, version 2.0 |
| 22 | * |
| 23 | * @par Description: |
| 24 | * Deals with the creation and destruction of players in levels, and their |
| 25 | * interactions with other level objects. |
| 26 | * |
| 27 | */ |
| 28 | |
| 29 | |
| 30 | #include "event/jj2event.h" |
| 31 | #include "jj2level.h" |
| 32 | #include "jj2levelplayer.h" |
| 33 | |
| 34 | #include "game/game.h" |
| 35 | #include "game/gamemode.h" |
| 36 | #include "io/sound.h" |
| 37 | |
| 38 | #include <string.h> |
| 39 | |
| 40 | |
| 41 | /** |
| 42 | * Create a JJ2 level player. |
| 43 | * |
| 44 | * @param parent The game player corresponding to this level player. |
| 45 | * @param newAnims Animations |
| 46 | * @param newFlippedAnims Flipped animations |
| 47 | * @param startX Starting position x-coordinate |
| 48 | * @param startY Starting position y-coordinate |
| 49 | * @param flockSize The number of birds accompanying the player |
| 50 | */ |
| 51 | JJ2LevelPlayer::JJ2LevelPlayer (Player* parent, Anim** newAnims, |
| 52 | Anim** newFlippedAnims, unsigned char startX, unsigned char startY, int flockSize) { |
| 53 | |
| 54 | const int offsets[14] = {JJ2PCO_GREY, JJ2PCO_SGREEN, JJ2PCO_BLUE, JJ2PCO_RED, |
| 55 | JJ2PCO_LGREEN, JJ2PCO_LEVEL1, JJ2PCO_YELLOW, JJ2PCO_LEVEL2, |
| 56 | JJ2PCO_ORANGE, JJ2PCO_LEVEL3, JJ2PCO_LEVEL4, JJ2PCO_SANIM, JJ2PCO_LANIM, |
| 57 | JJ2PCO_LEVEL5}; |
| 58 | const int lengths[14] = {JJ2PCL_GREY, JJ2PCL_SGREEN, JJ2PCL_BLUE, JJ2PCL_RED, |
| 59 | JJ2PCL_LGREEN, JJ2PCL_LEVEL1, JJ2PCL_YELLOW, JJ2PCL_LEVEL2, |
| 60 | JJ2PCL_ORANGE, JJ2PCL_LEVEL3, JJ2PCL_LEVEL4, JJ2PCL_SANIM, JJ2PCL_LANIM, |
| 61 | JJ2PCL_LEVEL5}; |
| 62 | int count, start, length; |
| 63 | |
| 64 | player = parent; |
| 65 | |
| 66 | memcpy(anims, newAnims, JJ2PANIMS * sizeof(Anim *)); |
| 67 | memcpy(flippedAnims, newFlippedAnims, JJ2PANIMS * sizeof(Anim *)); |
| 68 | |
| 69 | birds = flockSize; |
| 70 | |
| 71 | reset(startX, startY); |
| 72 | |
| 73 | |
| 74 | // Create the player's palette |
| 75 | |
| 76 | for (count = 0; count < MAX_PALETTE_COLORS; count++) |
| 77 | palette[count].r = palette[count].g = palette[count].b = count; |
| 78 | |
| 79 | |
| 80 | // Fur colours |
| 81 | |
| 82 | start = offsets[player->cols[0]]; |
| 83 | length = lengths[player->cols[0]]; |
| 84 | |
| 85 | for (count = 0; count < 16; count++) |
| 86 | palette[count + 16].r = palette[count + 16].g = palette[count + 16].b = |
| 87 | (count * length / 8) + start; |
| 88 | |
| 89 | |
| 90 | // Bandana colours |
| 91 | |
| 92 | start = offsets[player->cols[1]]; |
| 93 | length = lengths[player->cols[1]]; |
| 94 | |
| 95 | for (count = 0; count < 16; count++) |
| 96 | palette[count + 24].r = palette[count + 24].g = palette[count + 24].b = |
| 97 | (count * length / 8) + start; |
| 98 | |
| 99 | |
| 100 | // Gun colours |
| 101 | |
| 102 | start = offsets[player->cols[2]]; |
| 103 | length = lengths[player->cols[2]]; |
| 104 | |
| 105 | for (count = 0; count < 9; count++) |
| 106 | palette[count + 32].r = palette[count + 32].g = palette[count + 32].b = |
| 107 | (count * length / 8) + start; |
| 108 | |
| 109 | |
| 110 | // Wristband colours |
| 111 | |
| 112 | start = offsets[player->cols[3]]; |
| 113 | length = lengths[player->cols[3]]; |
| 114 | |
| 115 | for (count = 0; count < 8; count++) |
| 116 | palette[count + 40].r = palette[count + 40].g = palette[count + 40].b = |
| 117 | (count * length / 8) + start; |
| 118 | |
| 119 | } |
| 120 | |
| 121 | |
| 122 | /** |
| 123 | * Delete the JJ2 level player. |
| 124 | */ |
| 125 | JJ2LevelPlayer::~JJ2LevelPlayer () { |
| 126 | |
| 127 | } |
| 128 | |
| 129 | |
| 130 | /** |
| 131 | * Reset the player's position, energy etc. |
| 132 | * |
| 133 | * @param startX New x-coordinate |
| 134 | * @param startY New y-coordinate |
| 135 | */ |
| 136 | void JJ2LevelPlayer::reset (int startX, int startY) { |
| 137 | |
| 138 | mod = NULL; |
| 139 | energy = 5; |
| 140 | floating = false; |
| 141 | facing = true; |
| 142 | animType = JJ2PA_STAND; |
| 143 | event = JJ2PE_NONE; |
| 144 | reaction = JJ2PR_NONE; |
| 145 | reactionTime = 0; |
| 146 | jumpHeight = JJ2PYO_JUMP; |
| 147 | throwY = TTOF(256); |
| 148 | throwX = 0; |
| 149 | fastFeetTime = 0; |
| 150 | stopTime = 0; |
| 151 | lookTime = 0; |
| 152 | fireTime = 0; |
| 153 | dx = 0; |
| 154 | dy = 0; |
| 155 | x = TTOF(startX); |
| 156 | y = TTOF(startY); |
| 157 | gems[0] = gems[1] = gems[2] = gems[3] = 0; |
| 158 | coins = 0; |
| 159 | shield = JJ2S_NONE; |
| 160 | |
| 161 | } |
| 162 | |
| 163 | |
| 164 | /** |
| 165 | * Add to the player's tally of gems of a certain colour. |
| 166 | * |
| 167 | * @param colour The colour of the gem |
| 168 | */ |
| 169 | void JJ2LevelPlayer::addGem (int colour) { |
| 170 | |
| 171 | gems[colour]++; |
| 172 | |
| 173 | } |
| 174 | |
| 175 | |
| 176 | /** |
| 177 | * Centre the player horizontally on the nearest tile. |
| 178 | */ |
| 179 | void JJ2LevelPlayer::centreX () { |
| 180 | |
| 181 | x = ((x + JJ2PXO_MID) & ~32767) + F16 - JJ2PXO_MID; |
| 182 | |
| 183 | } |
| 184 | |
| 185 | |
| 186 | /** |
| 187 | * Centre the player vertically on the nearest tile. |
| 188 | */ |
| 189 | void JJ2LevelPlayer::centreY () { |
| 190 | |
| 191 | y = ((y + JJ2PYO_MID) & ~32767) + F16 - JJ2PYO_MID; |
| 192 | |
| 193 | } |
| 194 | |
| 195 | |
| 196 | /** |
| 197 | * Determine the player's current animation. |
| 198 | * |
| 199 | * @return The current animation |
| 200 | */ |
| 201 | Anim* JJ2LevelPlayer::getAnim () { |
| 202 | |
| 203 | return (facing? anims: flippedAnims)[animType]; |
| 204 | |
| 205 | } |
| 206 | |
| 207 | |
| 208 | /** |
| 209 | * Determine the player's current energy level. |
| 210 | * |
| 211 | * @return Energy level |
| 212 | */ |
| 213 | int JJ2LevelPlayer::getEnergy () { |
| 214 | |
| 215 | return energy; |
| 216 | |
| 217 | } |
| 218 | |
| 219 | |
| 220 | /** |
| 221 | * Determine the direction the player is facing. |
| 222 | * |
| 223 | * @return True if the player is facing right |
| 224 | */ |
| 225 | bool JJ2LevelPlayer::getFacing () { |
| 226 | |
| 227 | return facing; |
| 228 | |
| 229 | } |
| 230 | |
| 231 | |
| 232 | /** |
| 233 | * Determine the number of gems, of a certain colour, the player has collected. |
| 234 | * |
| 235 | * @param colour The colour of the gems |
| 236 | * |
| 237 | * @return Number of gems collected |
| 238 | */ |
| 239 | int JJ2LevelPlayer::getGems (int colour) { |
| 240 | |
| 241 | return gems[colour]; |
| 242 | |
| 243 | } |
| 244 | |
| 245 | |
| 246 | /** |
| 247 | * Determine whether or not the player is being accompanied by a bird. |
| 248 | * |
| 249 | * @return Whether or not the player is being accompanied by a bird |
| 250 | */ |
| 251 | int JJ2LevelPlayer::countBirds () { |
| 252 | |
| 253 | return birds; |
| 254 | |
| 255 | } |
| 256 | |
| 257 | |
| 258 | /** |
| 259 | * Deal with bullet collisions. |
| 260 | * |
| 261 | * @param source Player that fired the bullet (NULL if an event) |
| 262 | * @param ticks Time |
| 263 | * |
| 264 | * @return Whether or not the hit was successful |
| 265 | */ |
| 266 | bool JJ2LevelPlayer::hit (Player *source, unsigned int ticks) { |
| 267 | |
| 268 | // Invulnerable if reacting to e.g. having been hit |
| 269 | if (reaction != JJ2PR_NONE) return false; |
| 270 | |
| 271 | // Hits from the same team have no effect |
| 272 | if (source && (source->getTeam() == player->team)) return false; |
| 273 | |
| 274 | |
| 275 | if (player->hit(source)) { |
| 276 | |
| 277 | energy--; |
| 278 | |
| 279 | //if (bird) bird->hit(); |
| 280 | |
| 281 | playSound(SE::OW); |
| 282 | |
| 283 | } |
| 284 | |
| 285 | if (energy) { |
| 286 | |
| 287 | reaction = JJ2PR_HURT; |
| 288 | reactionTime = ticks + JJ2PRT_HURT; |
| 289 | |
| 290 | if (dx < 0) dx = JJ2PXS_RUN; |
| 291 | else dx = -JJ2PXS_RUN; |
| 292 | dy = JJ2PYS_JUMP; |
| 293 | |
| 294 | } else { |
| 295 | |
| 296 | kill(source, ticks); |
| 297 | |
| 298 | } |
| 299 | |
| 300 | return true; |
| 301 | |
| 302 | } |
| 303 | |
| 304 | |
| 305 | /** |
| 306 | * Kill the player. |
| 307 | * |
| 308 | * @param source Player responsible for the kill (NULL if due to an event or time) |
| 309 | * @param ticks time |
| 310 | */ |
| 311 | void JJ2LevelPlayer::kill (Player *source, unsigned int ticks) { |
| 312 | |
| 313 | if (reaction != JJ2PR_NONE) return; |
| 314 | |
| 315 | if (player->kill(source)) { |
| 316 | |
| 317 | energy = 0; |
| 318 | player->lives--; |
| 319 | |
| 320 | reaction = JJ2PR_KILLED; |
| 321 | reactionTime = ticks + JJ2PRT_KILLED; |
| 322 | |
| 323 | } |
| 324 | |
| 325 | } |
| 326 | |
| 327 | |
| 328 | /** |
| 329 | * Determine whether or not the player is overlapping the given area. |
| 330 | * |
| 331 | * @param left The x-coordinate of the left of the area |
| 332 | * @param top The y-coordinate of the top of the area |
| 333 | * @param width The width of the area |
| 334 | * @param height The height of the area |
| 335 | * |
| 336 | * @return Whether or not there is an overlap |
| 337 | */ |
| 338 | bool JJ2LevelPlayer::overlap (fixed left, fixed top, fixed width, fixed height) { |
| 339 | |
| 340 | return (x + JJ2PXO_R >= left) && (x + JJ2PXO_L < left + width) && |
| 341 | (y >= top) && (y + JJ2PYO_TOP < top + height); |
| 342 | |
| 343 | } |
| 344 | |
| 345 | |
| 346 | /** |
| 347 | * Handle the player's reaction. |
| 348 | * |
| 349 | * @param ticks Time |
| 350 | * |
| 351 | * @return The reaction the player has just finished |
| 352 | */ |
| 353 | JJ2PlayerReaction JJ2LevelPlayer::reacted (unsigned int ticks) { |
| 354 | |
| 355 | if ((reaction != JJ2PR_NONE) && (reactionTime < ticks)) { |
| 356 | |
| 357 | JJ2PlayerReaction oldReaction = reaction; |
| 358 | reaction = JJ2PR_NONE; |
| 359 | |
| 360 | return oldReaction; |
| 361 | |
| 362 | } |
| 363 | |
| 364 | return JJ2PR_NONE; |
| 365 | |
| 366 | } |
| 367 | |
| 368 | |
| 369 | /** |
| 370 | * Set the player's position. |
| 371 | * |
| 372 | * @param newX New x-coordinate |
| 373 | * @param newY New y-coordinate |
| 374 | */ |
| 375 | void JJ2LevelPlayer::setPosition (fixed newX, fixed newY) { |
| 376 | |
| 377 | x = newX; |
| 378 | y = newY; |
| 379 | |
| 380 | } |
| 381 | |
| 382 | |
| 383 | /** |
| 384 | * Set the player's speed. |
| 385 | * |
| 386 | * @param newDx New x-speed |
| 387 | * @param newDy New y-speed |
| 388 | */ |
| 389 | void JJ2LevelPlayer::setSpeed (fixed newDx, fixed newDy) { |
| 390 | |
| 391 | dx = newDx; |
| 392 | if (newDy) dy = newDy; |
| 393 | |
| 394 | } |
| 395 | |
| 396 | |
| 397 | /** |
| 398 | * Called when the player has touched an event. |
| 399 | * |
| 400 | * @param touched The event that was touched |
| 401 | * @param ticks Time |
| 402 | * @param msps Ticks per step |
| 403 | * |
| 404 | * @return Whether or not the event should be destroyed. |
| 405 | */ |
| 406 | bool JJ2LevelPlayer::touchEvent (JJ2Event* touched, unsigned int ticks, int msps) { |
| 407 | |
| 408 | (void)msps; |
| 409 | |
| 410 | unsigned char type; |
| 411 | bool fullPickup = false; |
| 412 | |
| 413 | type = touched->getType(); |
| 414 | |
| 415 | switch (type) { |
| 416 | |
| 417 | case 34: // Ammo |
| 418 | |
| 419 | player->addAmmo(2, 3); |
| 420 | player->addScore(100); |
| 421 | |
| 422 | return true; |
| 423 | |
| 424 | case 36: // Ammo |
| 425 | |
| 426 | player->addAmmo(1, 3); |
| 427 | player->addScore(100); |
| 428 | |
| 429 | return true; |
| 430 | |
| 431 | case 37: // Ammo |
| 432 | |
| 433 | player->addAmmo(0, 3); |
| 434 | player->addScore(100); |
| 435 | |
| 436 | return true; |
| 437 | |
| 438 | case 38: // TNT |
| 439 | |
| 440 | player->addAmmo(3, 3); |
| 441 | player->addScore(100); |
| 442 | |
| 443 | return true; |
| 444 | |
| 445 | case 44: |
| 446 | |
| 447 | coins++; |
| 448 | player->addScore(500); |
| 449 | |
| 450 | return true; |
| 451 | |
| 452 | case 45: |
| 453 | |
| 454 | coins += 5; |
| 455 | player->addScore(1000); |
| 456 | |
| 457 | return true; |
| 458 | |
| 459 | case 59: // Board |
| 460 | |
| 461 | floating = true; |
| 462 | |
| 463 | return true; |
| 464 | |
| 465 | case 60: // Frozen green spring |
| 466 | |
| 467 | throwY = y - TTOF(14); |
| 468 | dx = 0; |
| 469 | event = JJ2PE_SPRING; |
| 470 | |
| 471 | break; |
| 472 | |
| 473 | case 61: // Rapid fire |
| 474 | |
| 475 | player->fireSpeed++; |
| 476 | |
| 477 | return true; |
| 478 | |
| 479 | case 62: // Spring crate |
| 480 | |
| 481 | throwY = y - TTOF(18); |
| 482 | dx = 0; |
| 483 | event = JJ2PE_SPRING; |
| 484 | |
| 485 | break; |
| 486 | |
| 487 | case 63: // Red gem |
| 488 | |
| 489 | gems[0]++; |
| 490 | player->addScore(100); |
| 491 | |
| 492 | return true; |
| 493 | |
| 494 | case 64: // Green gem |
| 495 | |
| 496 | gems[1]++; |
| 497 | player->addScore(100); |
| 498 | |
| 499 | return true; |
| 500 | |
| 501 | case 65: // Blue gem |
| 502 | |
| 503 | gems[2]++; |
| 504 | player->addScore(100); |
| 505 | |
| 506 | return true; |
| 507 | |
| 508 | case 66: // Purple gem |
| 509 | |
| 510 | gems[3]++; |
| 511 | player->addScore(100); |
| 512 | |
| 513 | return true; |
| 514 | |
| 515 | case 72: // Carrot |
| 516 | |
| 517 | if ((energy < 5) || fullPickup) { |
| 518 | |
| 519 | if (energy < 5) energy++; |
| 520 | |
| 521 | player->addScore(200); |
| 522 | |
| 523 | return true; |
| 524 | |
| 525 | } |
| 526 | |
| 527 | break; |
| 528 | |
| 529 | case 73: // Full carrot |
| 530 | |
| 531 | if ((energy < 5) || fullPickup) { |
| 532 | |
| 533 | energy = 5; |
| 534 | |
| 535 | return true; |
| 536 | |
| 537 | } |
| 538 | |
| 539 | break; |
| 540 | |
| 541 | case 80: // 1-up |
| 542 | |
| 543 | player->addLife(); |
| 544 | |
| 545 | return true; |
| 546 | |
| 547 | case 83: // Checkpoint |
| 548 | |
| 549 | player->setCheckpoint(FTOT(x + JJ2PXO_MID), FTOT(y + JJ2PYO_MID)); |
| 550 | |
| 551 | break; |
| 552 | |
| 553 | case 85: // Red spring |
| 554 | |
| 555 | throwY = y - TTOF(8); |
| 556 | dx = 0; |
| 557 | event = JJ2PE_SPRING; |
| 558 | |
| 559 | break; |
| 560 | |
| 561 | case 86: // Green spring |
| 562 | |
| 563 | throwY = y - TTOF(14); |
| 564 | dx = 0; |
| 565 | event = JJ2PE_SPRING; |
| 566 | |
| 567 | break; |
| 568 | |
| 569 | case 87: // Blue spring |
| 570 | |
| 571 | throwY = y - TTOF(18); |
| 572 | dx = 0; |
| 573 | event = JJ2PE_SPRING; |
| 574 | |
| 575 | break; |
| 576 | |
| 577 | case 88: //Invincibility |
| 578 | |
| 579 | reaction = JJ2PR_INVINCIBLE; |
| 580 | reactionTime = ticks + JJ2PRT_INVINCIBLE; |
| 581 | |
| 582 | return true; |
| 583 | |
| 584 | case 91: // Horizontal red spring |
| 585 | |
| 586 | if (true) throwX = x + TTOF(7); |
| 587 | else throwX = x - TTOF(7); |
| 588 | |
| 589 | dy = 0; |
| 590 | |
| 591 | break; |
| 592 | |
| 593 | case 92: // Horizontal green spring |
| 594 | |
| 595 | if (true) throwX = x + TTOF(14); |
| 596 | else throwX = x - TTOF(14); |
| 597 | |
| 598 | dy = 0; |
| 599 | |
| 600 | break; |
| 601 | |
| 602 | case 93: // Horizontal blue spring |
| 603 | |
| 604 | if (true) throwX = x + TTOF(18); |
| 605 | else throwX = x - TTOF(18); |
| 606 | |
| 607 | dy = 0; |
| 608 | |
| 609 | break; |
| 610 | |
| 611 | case 96: // Helicarrot |
| 612 | |
| 613 | floating = true; |
| 614 | |
| 615 | return true; |
| 616 | |
| 617 | case 192: // Gem ring |
| 618 | |
| 619 | gems[0] += 8; |
| 620 | |
| 621 | return true; |
| 622 | |
| 623 | default: |
| 624 | |
| 625 | if (((type >= 141) && (type <= 147)) || ((type >= 154) && (type <= 182))) { |
| 626 | |
| 627 | // Food |
| 628 | player->addScore(50); |
| 629 | |
| 630 | return true; |
| 631 | |
| 632 | } |
| 633 | |
| 634 | break; |
| 635 | |
| 636 | } |
| 637 | |
| 638 | return false; |
| 639 | |
| 640 | } |
| 641 | |
| 642 | |
| 643 | /** |
| 644 | * Fill a buffer with player data. |
| 645 | * |
| 646 | * @param buffer The buffer |
| 647 | */ |
| 648 | void JJ2LevelPlayer::send (unsigned char *buffer) { |
| 649 | |
| 650 | buffer[9] = birds; |
| 651 | buffer[23] = energy; |
| 652 | buffer[25] = shield; |
| 653 | buffer[26] = floating; |
| 654 | buffer[27] = getFacing(); |
| 655 | buffer[29] = jumpHeight >> 24; |
| 656 | buffer[30] = (jumpHeight >> 16) & 255; |
| 657 | buffer[31] = (jumpHeight >> 8) & 255; |
| 658 | buffer[32] = jumpHeight & 255; |
| 659 | buffer[33] = throwY >> 24; |
| 660 | buffer[34] = (throwY >> 16) & 255; |
| 661 | buffer[35] = (throwY >> 8) & 255; |
| 662 | buffer[36] = throwY & 255; |
| 663 | buffer[37] = x >> 24; |
| 664 | buffer[38] = (x >> 16) & 255; |
| 665 | buffer[39] = (x >> 8) & 255; |
| 666 | buffer[40] = x & 255; |
| 667 | buffer[41] = y >> 24; |
| 668 | buffer[42] = (y >> 16) & 255; |
| 669 | buffer[43] = (y >> 8) & 255; |
| 670 | buffer[44] = y & 255; |
| 671 | |
| 672 | } |
| 673 | |
| 674 | |
| 675 | /** |
| 676 | * Adjust player data based on the contents of a given buffer. |
| 677 | * |
| 678 | * @param buffer The buffer |
| 679 | */ |
| 680 | void JJ2LevelPlayer::receive (unsigned char *buffer) { |
| 681 | |
| 682 | int count; |
| 683 | |
| 684 | switch (buffer[1]) { |
| 685 | |
| 686 | case MT_P_ANIMS: |
| 687 | |
| 688 | for (count = 0; count < JJ2PANIMS; count++) { |
| 689 | |
| 690 | anims[count] = jj2Level->getPlayerAnim(buffer[3], count, false); |
| 691 | flippedAnims[count] = jj2Level->getPlayerAnim(buffer[3], count, true); |
| 692 | |
| 693 | } |
| 694 | |
| 695 | break; |
| 696 | |
| 697 | case MT_P_TEMP: |
| 698 | |
| 699 | birds = buffer[9]; |
| 700 | energy = buffer[23]; |
| 701 | shield = (JJ2Shield)buffer[25]; |
| 702 | floating = buffer[26]; |
| 703 | facing = buffer[27]; |
| 704 | jumpHeight = (buffer[29] << 24) + (buffer[30] << 16) + (buffer[31] << 8) + buffer[32]; |
| 705 | throwY = (buffer[33] << 24) + (buffer[34] << 16) + (buffer[35] << 8) + buffer[36]; |
| 706 | x = (buffer[37] << 24) + (buffer[38] << 16) + (buffer[39] << 8) + buffer[40]; |
| 707 | y = (buffer[41] << 24) + (buffer[42] << 16) + (buffer[43] << 8) + buffer[44]; |
| 708 | |
| 709 | break; |
| 710 | |
| 711 | } |
| 712 | |
| 713 | } |