Skip to content

Commit

Permalink
Level palette support
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Jan 9, 2022
1 parent 94fd38b commit 96be33d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ int main()
material_end_offsets[i] = material_bytes[i * sizeof (uint32_t) + 1];
}

uint8_t palette[0x300] = {};
for (int i=0; i<0x100; ++i) {
palette[3*i+0] = 0x80 + i * 17;
palette[3*i+1] = 0x80 + i * 19;
palette[3*i+2] = 0x80 + i * 23;
}

rv_gl_functor gl_functor = (rv_gl_functor)SDL_GL_GetProcAddress;

rv_init_descriptor init_desc = {
Expand All @@ -250,6 +257,7 @@ int main()
.material_begin_offsets = material_begin_offsets,
.material_end_offsets = material_end_offsets,
.material_count = material_count,
.palette = palette,
};

std::cout << "rv_map_init" << std::endl;
Expand Down
3 changes: 3 additions & 0 deletions vange_rs.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ struct rv_map_description {

// 8 for world, 16 for escave
int32_t material_count;

// RGB for 256 colors
uint8_t* palette;
};

// TODO: or it could be left, bottom, right, top
Expand Down

0 comments on commit 96be33d

Please sign in to comment.