Revision 332
worked out things
graph.c | ||
---|---|---|
256 | 256 |
} |
257 | 257 |
|
258 | 258 |
/// PIXEL DRAWING |
259 |
int (graph_set_pixel)(uint16_t x, uint16_t y, uint32_t color) { |
|
260 |
//pixels are certain to be inside can reduce lag |
|
261 |
/*if (x < 0 || vbe_mem_info.XResolution <= x || y < 0 || vbe_mem_info.YResolution <= y) { |
|
262 |
//printf("%s: invalid pixel.\n", __func__); |
|
263 |
return OUT_OF_RANGE; |
|
264 |
}*/ |
|
265 |
unsigned int pos = (x + y * vbe_mem_info.XResolution) * 3/*graph_get_bytes_pixel()*/; |
|
266 |
memcpy(video_buf + pos, &color, 3/*graph_get_bytes_pixel()*/); |
|
267 |
return SUCCESS; |
|
259 |
void (graph_set_pixel)(uint16_t x, uint16_t y, uint32_t color) { |
|
260 |
memcpy(video_buf + (x+y*graph_get_XRes())*graph_get_bytes_pixel(), &color, graph_get_bytes_pixel()); |
|
268 | 261 |
} |
269 | 262 |
void (graph_set_pixel_pos)(unsigned pos, uint32_t color){ |
270 | 263 |
memcpy(video_buf + pos, &color, graph_get_bytes_pixel()); |
... | ... | |
273 | 266 |
int (graph_draw)(void){ memcpy(video_mem, video_buf, graph_get_vram_size()); return SUCCESS; } |
274 | 267 |
|
275 | 268 |
///SPRITE |
269 |
#include "sprite.h" |
|
270 |
|
|
276 | 271 |
#include "utils.h" |
277 | 272 |
#include "fast_math.h" |
278 | 273 |
#include <math.h> |
Also available in: Unified diff