they're very hasty
This commit is contained in:
parent
3840fb0321
commit
d65a270aab
10 changed files with 102 additions and 17 deletions
59
samply.c
Normal file
59
samply.c
Normal file
|
@ -0,0 +1,59 @@
|
|||
#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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue