Skip to content

Commit

Permalink
Load jump height and animation speed
Browse files Browse the repository at this point in the history
  • Loading branch information
carstene1ns committed Oct 26, 2023
1 parent e6caae7 commit 5388ba2
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/jj1/level/jj1levelload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "io/sound.h"
#include "loop.h"
#include "util.h"
#include "io/log.h"

#include <string.h>

Expand Down Expand Up @@ -403,7 +404,8 @@ int JJ1Level::load (char* fileName, bool checkpoint) {
int tiles;
int count, x, y, type;
unsigned char startX, startY;

// FIXME: actually use these
int animSpeed, jumpHeight;

// Load font

Expand Down Expand Up @@ -853,17 +855,26 @@ int JJ1Level::load (char* fileName, bool checkpoint) {
y = file->loadChar();
setNext(x, y);

// jump height
jumpHeight = (file->loadShort() - 0xFFFF) / 2;
if (jumpHeight != -5)
LOG_TRACE("Uncommon jumpHeight: %i", jumpHeight);

// Skip jump height (FIXME) and some unknown level
file->seek(4, false);
// skip some unknown level
file->seek(2, false);

// Thanks to Doubble Dutch for the water level bytes
waterLevelTarget = ITOF(file->loadShort() + 17);
waterLevel = waterLevelTarget - F8;
waterLevelSpeed = -80000;

// Skip Jazz animation speed(FIXME) and an unknown value (end marker?)
file->seek(3, false);
// Jazz animation speed
animSpeed = file->loadChar();
if (animSpeed != 119)
LOG_TRACE("Uncommon animationSpeed: %i", animSpeed);

// Skip an unknown value (end marker?)
file->seek(2, false);


// Thanks to Feline and the JCS94 team for the next bits:
Expand Down

0 comments on commit 5388ba2

Please sign in to comment.