forked from sam-itt/sofis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalt-ladder-page-descriptor.c
47 lines (39 loc) · 1.17 KB
/
alt-ladder-page-descriptor.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* SPDX-FileCopyrightText: 2021 Samuel Cuella <samuel.cuella@gmail.com>
*
* This file is part of SoFIS - an open source EFIS
*
* SPDX-License-Identifier: GPL-2.0-only
*/
#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL_image.h>
#include "alt-ladder-page-descriptor.h"
#include "generic-layer.h"
#include "resource-manager.h"
#include "sdl-colors.h"
#include "res-dirs.h"
#define PAGE_SIZE 700 /*number of values per page*/
AltLadderPageDescriptor *alt_ladder_page_descriptor_new(void)
{
AltLadderPageDescriptor *self;
FBPageDescriptor *tmp;
self = calloc(1, sizeof(AltLadderPageDescriptor));
if(self){
tmp = fb_page_descriptor_init((FBPageDescriptor *)self, IMG_DIR"/alt-ladder.png",BOTTUM_UP, PAGE_SIZE, 100, 20);
if(!tmp){
free(self);
return NULL;
}
self->super.super.init_page = alt_ladder_page_init;
self->super.super.fei = 227;
}
return self;
}
LadderPage *alt_ladder_page_init(LadderPage *self)
{
fb_ladder_page_init(self);
ladder_page_etch_markings(self, resource_manager_get_font(TERMINUS_16));
generic_layer_build_texture(GENERIC_LAYER(self));
return self;
}