ok i promise i will actually start the rewrite
This commit is contained in:
parent
5b256e74cd
commit
57c6e52f86
18 changed files with 102889 additions and 135 deletions
50
readme
50
readme
|
@ -1,12 +1,46 @@
|
|||
horny desktop pet thing.
|
||||
design (+ usage)
|
||||
|
||||
currently being rewritten to make structural sense.
|
||||
(this is for now just a design document and not describing the actual program.)
|
||||
|
||||
you need sdl3 to build it.
|
||||
i have not tried cross-compiling to windows yet.
|
||||
slutpet makes use of s7 scheme as a scripting language.
|
||||
(this, by the way, is why the program takes a weirdly long time to compile --
|
||||
s7.{c,h} contain the entire s7 scheme interpreter, over 100,000 lines.)
|
||||
if you don't know scheme,
|
||||
a) don't worry, it's pretty simple, and
|
||||
b) sorry in advance.
|
||||
|
||||
i think it's probably best to use some sort of extension language.
|
||||
i want people to be able to create their own pets without having to
|
||||
figure out how to recompile.
|
||||
c source files:
|
||||
|
||||
run it with `SDL_LOGGING=app=debug ./slutpet` for verbose logging
|
||||
sp.c: main entry, exit, event/render loops
|
||||
|
||||
a pet is implemented by setting the variable 'pet' to
|
||||
an alist (is this the correct term?) which contains some values.
|
||||
setting the pet variable should handle this automatically,
|
||||
but various hooks can then be set, which will be executed
|
||||
whenever a certain event has happened.
|
||||
|
||||
list of variables:
|
||||
pet: the pet that the program will use. this is a list of cons that define the pet.
|
||||
TODO: maybe this should be a macro that sets other variables.
|
||||
|
||||
pet-name: string containing the pet's name.
|
||||
|
||||
list of hooks:
|
||||
pre-init-hook: before anything has happened at all; right after s7 has been initialised.
|
||||
this is also before any init files have been read
|
||||
post-init-hook: when the window has been set up and things are ready to happen.
|
||||
the current pet should be set and initialised by this point.
|
||||
tick-hook: every program tick. the pet's drawing information should be set
|
||||
here so it can be rendered.
|
||||
TODO: figure out what to do about event hooks
|
||||
pre-quit-hook: the program is about to exit, no de-init things have been done yet.
|
||||
post-quit-hook: everything (except, obviously, the s7 interpreter) has been de-initialised.
|
||||
|
||||
list of functions:
|
||||
(load-image path): set up a new image, with the data taken from the given path.
|
||||
this will return the a list of cons pairs with the image data,
|
||||
in a form that can be used in the pet variable.
|
||||
(free-image image): free heap-allocated data in image.
|
||||
|
||||
list of c-types:
|
||||
pixmap: the data created from stb-image.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue