fix readme

This commit is contained in:
Iris Lightshard 2020-05-03 01:36:33 -04:00
parent 20fbac8ed1
commit 1d7fe3d8c9
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398

104
README.md
View file

@ -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 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 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 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 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* 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 returns a Mix_Chunk* of the wav file at given path
###renderBackground() ### renderBackground()
paints the current room's background image and increment its animation 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 paints the current room's fg objects and people, and the player
###renderHUD() ### renderHUD()
paints the spell selection HUD paints the spell selection HUD
###interact() ### interact()
grabs keyboard input in the main loop and modifies the game state 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; 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 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 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 builds some hyperKaos* and stores them in spellBook
###burnSpellbook() ### burnSpellbook()
deallocates spellbook Memory deallocates spellbook Memory
###toggleFullscreen() ### toggleFullscreen()
reinvents the wheel with SDL_SetVideoMode reinvents the wheel with SDL_SetVideoMode
###timeDilation() ### timeDilation()
waits with SDL_Delay to keep a constant framerate 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 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 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. 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 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 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 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) 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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! 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 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() 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 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 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 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 returns a pointer to an empty TextBox, with portarit image
###deleteTextBox(TextBox* target) ### deleteTextBox(TextBox* target)
deallocates memory for 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 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 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() takes control of the main loop and draws the room, foreground, and the TextBox over it all, and passes input to textBoxInput()