59 lines
1.2 KiB
C
59 lines
1.2 KiB
C
#include <SDL3/SDL.h>
|
|
|
|
#include "dat.h"
|
|
#include "fns.h"
|
|
|
|
void
|
|
put_samply_to_bed(Samply *sam)
|
|
{
|
|
if (sam) {
|
|
babble("free samply idle!!");
|
|
free_image(sam->idle);
|
|
babble("free samply walk a!!");
|
|
free_image(sam->walka);
|
|
babble("free samply walk b!!");
|
|
free_image(sam->walkb);
|
|
}
|
|
|
|
babble("good night, samply!!");
|
|
SDL_free(sam);
|
|
}
|
|
|
|
Samply *
|
|
wake_samply_up(SDL_Renderer *ren)
|
|
{
|
|
Samply *sam;
|
|
|
|
babble("wake up, samply!!");
|
|
sam = SDL_calloc(1, sizeof(Samply));
|
|
if (!sam) {
|
|
fuck("samply would rather stay in bed. too bad! %s", SDL_GetError());
|
|
return NULL;
|
|
}
|
|
|
|
babble("stand samply up!!");
|
|
sam->idle = load_image(ren, "samply/Samply.png");
|
|
if (!sam->idle) {
|
|
fuck("samply would rather stay in bed. too bad! %s", SDL_GetError());
|
|
put_samply_to_bed(sam);
|
|
return NULL;
|
|
}
|
|
|
|
babble("samply walk! part 1!!");
|
|
sam->walka = load_image(ren, "samply/Samply_Walk1.png");
|
|
if (!sam->walka) {
|
|
fuck("samply would rather stay in bed. too bad! %s", SDL_GetError());
|
|
put_samply_to_bed(sam);
|
|
return NULL;
|
|
}
|
|
|
|
babble("samply walk! part 2!!");
|
|
sam->walkb = load_image(ren, "samply/Samply_Walk2.png");
|
|
if (!sam->walkb) {
|
|
fuck("samply would rather stay in bed. too bad! %s", SDL_GetError());
|
|
put_samply_to_bed(sam);
|
|
return NULL;
|
|
}
|
|
|
|
return sam;
|
|
}
|