|
void | init (const MapTileMatrix &, IntPoint) |
|
Chunk * | get_current_chunk () |
|
bool | is_initialized () |
|
void | act (long) |
|
bool | is_paused () |
|
void | pause () |
|
void | unpause () |
|
void | toggle_pause () |
|
const std::vector< std::vector
< Tile * > > & | get_canvas () |
|
IntPoint | get_vis_coords (IntPoint, IntPoint) |
|
std::vector< Enemy * > | get_vis_enemies () |
|
void | show_vis_items () |
|
std::vector< Animation > & | get_animations () |
|
void | tick_animations (long delta_ms) |
|
bool | is_vis (IntPoint coords) |
|
void | refresh () |
|
void | recalculate_visibility_lines (int radius) |
|
void | update_buffer (IntPoint) |
|
void | update_chunk_map (IntPoint) |
|
void | draw_visibility_lines () |
|
void | undo_visibility () |
|
void | run_spawners () |
|
void | run_enemies (long) |
|
void | remove_targets (Character *enem) |
|
std::vector< Enemy * > & | get_enemies () |
|
void | change_depth (int, Character *) |
|
void | move_char (int, int, Character *) |
|
void | get_item (Character *) |
|
void | drop_item (Item *, Character *) |
|
void | spawn_enemy (int, int, int, int, int, int) |
|
void | teleport (int chunk_x, int chunk_y, int x, int y) |
|
void | create_explosion (int x, int y, int chunk_x, int chunk_y) |
|
|
void | point_assertions (int row, int col) |
|
void | set_tile (int row, int col, Tile *tile) |
|
void | set_tile (IntPoint point, Tile *tile) |
|
Item * | item_at_coords (IntPoint, IntPoint, int) |
|
Tile * | get_tile (int row, int col) |
|
Tile * | get_tile (IntPoint point) |
|
bool | out_of_bounds (IntPoint point) |
|
bool | out_of_bounds (int row, int col) |
|
bool | in_buffer (int row, int col) |
|
bool | in_range (IntPoint chunk, IntPoint coords, IntPoint range_chunk, IntPoint center, IntPoint radius) |
|
void | update_main_char_chunk () |
|
IntPoint | get_canvas_coords (IntPoint, IntPoint) |
|
IntPoint | get_buffer_coords (IntPoint, IntPoint) |
|
Character * | enemy_at_loc (IntPoint, IntPoint) |
|
GAME.H
This file is part of ROGUELIKETHING.
ROGUELIKETHING is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
ROGUELIKETHING is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with ROGUELIKETHING. If not, see http://www.gnu.org/licenses/. struct TilePoint { Tile tile; IntPoint loc; };
void Game::update_buffer |
( |
IntPoint |
central_chunk | ) |
|
This part is a bit confusing. What I need is to write the contents of the chunk to the appropriate place in the buffer. A and B represent the Y and X of individual tiles. So, for each chunk, the X and Y are written to the buffer. The chunks that we're iterating through are essentially a 3x3 array. Each chunk needs to start being written at the appropriate location (e.g. the second chunk needs to start where the first one left off...), which is where the x and y variables come in. Starting at 0, the x and y are multiplied by the width/height of the chunk, which is added to a and b to get where the tile from the chunk corresponding to a and b should be written to the buffer. For example: The first chunk should start writing tiles to the buffer at 0,0. The second chunk should start writing tiles at 0 + CHUNK_WIDTH, and the third tile should start writing at 0 + (CHUNK_WIDTH * 2).