tty-solitaire/lib/frame.c
2010-04-11 17:15:36 -03:00

35 lines
645 B
C

#include <malloc.h>
#include "frame.h"
void allocate_frame(struct frame **frame) {
*frame = malloc(sizeof(**frame));
return;
}
void initialize_frame(struct frame *frame) {
frame->shape = NULL;
frame->start_y = 0;
frame->start_x = 0;
return;
}
void delete_frame(struct frame *frame) {
delwin(frame->shape);
free(frame);
return;
}
void set_frame(struct frame *frame, int start_y, int start_x) {
frame->start_y = start_y;
frame->start_x = start_x;
frame->shape = newwin(FRAME_HEIGHT,
FRAME_WIDTH,
frame->start_y,
frame->start_x);
return;
}