Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on Haiku(emu) + gitignore #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extern const uint32_t rock_spr[]; // big rock
#include "levels.h" // defines levels[]


object *bg, *clock, *diams, *rock;
object *bg, *xclock, *diams, *rock;

uint8_t vram[lvl_w*lvl_h];

Expand Down Expand Up @@ -132,7 +132,7 @@ void start_level(int l)
date_start = vga_frame;
date_death = vga_frame+60*level_time; // time left in seconds

clock->y=7; // show or hide clock
xclock->y=7; // show or hide clock
diams->y=7; // show or hide diams

diamonds= 0;
Expand All @@ -147,7 +147,7 @@ void start_level(int l)
} else { // title
memcpy(vram, bdash_tmap[level], sizeof(vram));
bg->x=0;bg->y=0;
clock->y=1024; // show or hide clock
xclock->y=1024; // show or hide clock
diams->y=1024; // show or hide diams
}

Expand All @@ -156,7 +156,7 @@ void start_level(int l)
void game_init() {
blitter_init();
bg = tilemap_new(bdash_tset, 0,0, bdash_header, &vram);
clock = sprite_new((uint32_t*)&clock_spr, 10, 10, -1);
xclock = sprite_new((uint32_t*)&clock_spr, 10, 10, -1);

diams = sprite_new((uint32_t*)&diams_spr, 50, 10, -1);

Expand Down Expand Up @@ -400,15 +400,15 @@ void update_displays(void)

if (vga_frame-date_start<32+32) {
t = (vga_frame-date_start-32)/32.f-1.f;
clock->y = -40 + (t*t*((os+1)*t + os)+1)*50.; // (s+1)*t^3 - s*t^2
xclock->y = -40 + (t*t*((os+1)*t + os)+1)*50.; // (s+1)*t^3 - s*t^2
}
if (vga_frame-date_start<32+64) {
t = (vga_frame-date_start-64)/32.f-1.f;
diams->y = -40 + (t*t*((os+1)*t + os)+1)*50.; // (s+1)*t^3 - s*t^2
}

// set to frame corresponding to level
clock->fr = vga_frame<date_death?(vga_frame-date_start)*9/(level_time*60):8; // clock
xclock->fr = vga_frame<date_death?(vga_frame-date_start)*9/(level_time*60):8; // clock
diams->fr = diamonds<level_diams?diamonds*9/level_diams:8; // diams

}
Expand Down