all repos — hyperkaos @ 1d7fe3d8c9679faf818524248c9d7ccfbc6791ce

lightweight modular puzzle/adventure game engine in C with SDL 1.2

fix readme
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAl6uWGEACgkQO3+8IhRO
Y5hpqw/+LiGvSLw8SBeXCT+YSN/F5dTArHQdxhCoXUumL6smkKOnPniqejnqyeEd
pRKNrbNwh0VDIfuZcTTdYewe8b/lQGrsUtINWQZvQcwTEwpxnxXhGtJsfeWbVJUK
00ori+Hi7ejbkX610Oq7W9Hcv2mPiMTvSVygDXOtGS75xlJDwdaOdOwO45TuxBgm
dDrtKmFrbVJ7Fx2UkfXzmMktHswDTkDYmYlAw2eBG/FJTDBhXHtcNOGmsK/Hjk2h
nIg0FiySmGAYEsVQ3tVQiqxwHmdb//abP53Gnuqzk3si+lhuZy9OcYe66/HSZ31I
R/O7p/tcnlf7lcBOFQeOvtP0+oB6y0PUZofOO8sCbBp7YFJXRoXnDBt6c7LjX1k+
ONZfahIq4aU4n6CorIWTotAV8GOoDz0TTxNwyJK6O4yQh9O44vPoZZ8kWNtBBR/+
hYQxHsNTjFSmQNUIi2CUfXeR4Klt3LXbKpkxsHoYqZtfYl5ESfpnveBxVdAmZzGj
PnMP2AAB5F+JoscaobFJXIzcAyPCvU0M7D0XmTsNgcYqhpZ6C4lhPyrQkLp55I+6
U1lrGswsnIbS42Q90bFZ91a5UdspM6JbAxNuqnhO6GaviyTROD6/Ht8zhZouUsUH
BKXxsRIunDCKTJ1lvbIOJO+Ybn6Hh0qIq/sz8VI9bZt7tTQfp94=
=+/sk
-----END PGP SIGNATURE-----
commit

1d7fe3d8c9679faf818524248c9d7ccfbc6791ce

parent

20fbac8ed1ac18bbcb91b84602bf0cee7037797b

1 files changed, 52 insertions(+), 52 deletions(-)

jump to
M README.mdREADME.md

@@ -1,201 +1,201 @@

-#HyperKaos engine +# HyperKaos engine -##Engine.c +## Engine.c -###loadImage(char* filename) +### loadImage(char* filename) returns an SDL_Surface* of the image file at given file path -###applySurface(int x, int y, SDL_Surface* src, SDL_Surface dest, SDL_Rect* clip) +### applySurface(int x, int y, SDL_Surface* src, SDL_Surface dest, SDL_Rect* clip) wrapper for SDL_BlitSurface, drawing src onto dest with origin (x,y) and clipped according to clip -###getPixel(SDL_Surface* surface, int x, int y) +### getPixel(SDL_Surface* surface, int x, int y) get color value of a pixel on an SDL_Surface as a Uint32 -###scaleScreen() +### scaleScreen() scales the game widow from native resolution of 320x180 to integer multiple according to config.h -###loadBGM(char* filename) +### loadBGM(char* filename) sets hasMusic for this map chunk to True and returns the file as a Mix_Music* -###loadSFX(char* filename) +### loadSFX(char* filename) returns a Mix_Chunk* of the wav file at given path -###renderBackground() +### renderBackground() paints the current room's background image and increment its animation -###renderForeground() +### renderForeground() paints the current room's fg objects and people, and the player -###renderHUD() +### renderHUD() paints the spell selection HUD -###interact() +### interact() grabs keyboard input in the main loop and modifies the game state -###kListen() +### kListen() checks if spell has been cast; if so, looks up the spell in the spellbook and does a synergy; then unsets the spell lookup; then checks if any eventTriggers have been activated; due to the implementation of hyperKaos, if more than one are activated at the same time, the one later in the array is run -###init(int argc, char** args) +### init(int argc, char** args) initializes SDL subssytems, creates game window, loads UI data and hero data, allocates memory for mapData and mapBuffer, dialogueData, kaosData, theatre (scene data), and builds the spellbook -###writeSpellbook() +### writeSpellbook() builds some hyperKaos* and stores them in spellBook -###burnSpellbook() +### burnSpellbook() deallocates spellbook Memory -###toggleFullscreen() +### toggleFullscreen() reinvents the wheel with SDL_SetVideoMode -###timeDilation() +### timeDilation() waits with SDL_Delay to keep a constant framerate -###frameAdvance() +### frameAdvance() scales the internal screen to the game window size, updates the game window, and waits to start the main loop over -###cleanup() +### cleanup() enters windowed mode, cleans up all the memory, closes SDL subsystems -###intro() +### intro() builds a couple Scene*s for the intro sequence, plays them, and cleans up the memory. -###mainmenu() +### mainmenu() listens for keyboard input and navigates the main menu. reads save file if continued game, otherwise sets game data to the beginning of the game. or quit. takes control of the main game loop -###pausemenu() +### pausemenu() listens for keyboard input and saves, quits, or continues playing; takes control of the main game loop -##WorldData.c +## WorldData.c -###bufferData(int chunk) +### bufferData(int chunk) sets hasMusic to flase, paints loading message on screen, builds world chunk; if there is an error building the world, quit the game -###hashCmd(char* x) +### hashCmd(char* x) return an 8bit hash on a string for interpreting the worldBuilder script (this means there are max 256 commands for map generation, excluding "<" which functions as a closing bracket for "if" and "ifNot" directives) -###worldBuilder(int chunk) +### worldBuilder(int chunk) allocates memory, opens map data file for current chunk; reads line by line, hashing the first word of the line, then switching on that to execute an action; bubbles up failure (malformed lines) by returning nonzero; returns zero if the whole file is read and processed -###buildBGM(char* props) +### buildBGM(char* props) parses the args of loadBGM worldBuilder command and passes them to loadBGM(); return nonzero if malformed -###buildSFX(char* props) +### buildSFX(char* props) parses the args of loadFX worldBuilder command and passes them to loadSFX(); return nonzero if malformed -###buildRoom(char* props) +### buildRoom(char* props) parses the args of mkRoom worldBuilder command to build a room and place it in mapBuffer; return nonzero if malformed -###buildTextBox(char* props) +### buildTextBox(char* props) parses the args of mkTextBox worldBuilder command to build an empty textBox and place it in dialogueData; return nonzero if malformed -###modTextBox(char* props) +### modTextBox(char* props) parses the args of addText worldBuilder command to add text to the indicated textBox in dialogueData; return nonzero if malformed -###buildSynergy(char* props) +### buildSynergy(char* props) parses the args of addSigil worldBuilder command to pass to addSigil(); return nonzero if malformed -###buildKaos(char* props) +### buildKaos(char* props) parses the args of mkKaos worldBuilder command, switches on the class to figure out which constructor to pass the subsequent args to returns nonzero if malformed -###buildObstruction(char* props) +### buildObstruction(char* props) parses the args of addObstruction worldBuilder command, passes them to addObstacle(); returns nonzero if malformed -###buildFGImage(char* props) +### buildFGImage(char* props) parses the args of addImg worldBuilder command and passes them to addFGObj(); returns nonzero if malformed -###buildWarp(char* props) +### buildWarp(char* props) parses the args of addWrap worldBuilder command and passes them to addWarp(); returns nonzer o if malformed -###buildHyper(char* props) +### buildHyper(char* props) parses the args of addTrigger worldBuilder command and passes them to addTrigger(); returns nonzero if malformed -###chainKaos(char* props) +### chainKaos(char* props) parses the args of the chainKaos worldBuilder command and passes them to addKaos(); returns nonzero if malformed -###buildPerson(char* props) +### buildPerson(char* props) parses the args of the addPerson worldBuilder command and passes them to addPerson(); returns nonzero if malformed -###countMapThings(int* count, int chunk) +### countMapThings(int* count, int chunk) writes counts of global memory objects in this chunk to count based on mapdata file; this means the map data must be read again to count global objects before deletion! -###dataPurge(int* counts) +### dataPurge(int* counts) takes counts produced by countMap to free map chunk data -###unloadData(int chunk) +### unloadData(int chunk) allocates count buffer for global map objects, counts the objects with countMapThings(), and passes it to dataPurge() -###pushBufferData() +### pushBufferData() moves mapBuffer to mapData and allocates new mapBuffer; if music was loaded in the new map chunk, play the first track -###pager() +### pager() if the player is warping to a new map chunk, halt the music (if any), unload the current map chunk before pushing mapBuffer to mapData -##TextBox.c +## TextBox.c -###newTextBox() +### newTextBox() returns a pointer to an empty TextBox -###newGTextBox(SDL_Surface* image) +### newGTextBox(SDL_Surface* image) returns a pointer to an empty TextBox, with portarit image -###deleteTextBox(TextBox* target) +### deleteTextBox(TextBox* target) deallocates memory for target -###addText(TextBox* self, char* text) +### addText(TextBox* self, char* text) adds the string of text as a line in the TextBox pointed to by self -###textBoxInput(TextBox* self, int* textIsRelevent) +### textBoxInput(TextBox* self, int* textIsRelevent) increments TextBox cursor, handles keyboard input while TextBox is onscreen -###displayTextBox(TextBox* self) +### displayTextBox(TextBox* self) takes control of the main loop and draws the room, foreground, and the TextBox over it all, and passes input to textBoxInput()