Commit Graph

  • d252677df2 Modified tile_editor and engine for OS X to change the cwd to the directory of the app bundle. Also lightly modified the engine to check modules/ and ../modules for... modules vashram kts 2014-11-18 12:56:44 -0800
  • 59beaa02ba added initial vashram module structure and most of the graphics. Vex 2014-11-17 13:05:25 -0800
  • d61f4e7d29 added proclib as a submodule in engine/proclib kts 2014-11-17 00:23:43 -0800
  • 55f77eb105 Set up initial vashram branch kts 2014-11-16 23:16:31 -0800
  • 5e708022a5 added .gitignore rules for xcode master kts 2014-11-16 22:30:55 -0800
  • a0a2dbddb8 Mysterious changes. Vex 2014-11-07 17:39:43 -0800
  • a314bf4750 added a npcs3 file which includes monsters/npcs for the third area, that is, the manitou jungle and the second troll brother's hideout Vex 2014-08-08 16:19:16 -0700
  • 8f86cc9ebc Merge branch 'master' of ssh://kettek.exoss.net:4422/srv/eureka/timesynk Vex 2014-08-03 22:01:07 -0700
  • 70c7c27620 created a second npc folder for the second area which includes various bandits, mountain animals, capran, kerres, burned bones, wendigo, and so on. also updated ingredients and added flesh materials. Other changes as well. Vex 2014-08-03 21:57:19 -0700
  • 24cc67faaf Added .DS_Store to .gitignore in a rage. kts 2014-05-27 21:47:47 -0700
  • 58dabb6bc7 Precompiler now reads the given source file into a buffer, rather than reading char by char during parsing. This allows for more flexibility in looking forwards and backwards during expression parsing at the expense of memory. Depending on the parsing methods chosen, this may be changed back to single forward reads directly from the file. kts 2014-05-27 21:45:50 -0700
  • fb149cfad8 Precompiler now reads the given source file into a buffer, rather than reading char by char during parsing. This allows for more flexibility in looking forwards and backwards during expression parsing at the expense of memory. Depending on the parsing methods chosen, this may be changed back to single forward reads directly from the file. kts 2014-05-27 21:45:25 -0700
  • a6623a9b76 Made changes to NPC file, adding giants, insects, slimes, violent fungus, big cats, bears, phages, vores, etc. Made changes to player file, adding shapeshifts. Made changes to spells file, adding firespells and waterspells. Made changes to walls, adding rock walls and stalag walls. Made changes to items fill, adding various rings, portaforg, cauldron, work bench, dirt mound, coins, and four directions. Vex 2014-05-27 14:51:55 -0700
  • 9f32631fe5 Added rolls test program. This reads rolls.tsc in and attempts to do some basic attack/defend rolls for Tiles. Also added the basic structure for the VM function precompiler. Next modification will likely be converting the current VM precompiling code into using a buffer rather than reading from the file handle directly. This will allow for forward reading of characters in addition to backwards, thereby allowing for easier expression parsing (at least towards what I am conceiving of it thus far). kts 2014-05-17 16:28:24 -0700
  • 42de0d491c Fixed up potential bugs and warnings revealed by clang. kts 2014-04-29 13:08:08 -0700
  • 22a8e518e1 Cleaned up and organized vm_compile.c/.h - will add expression parsing and dynamic memory management within the vm soon kts 2014-04-28 19:59:46 -0700
  • 6f1ffe3563 More added to the precompiler. To be done is function parameter word parsing into vm_pc_Variable Tables as well as the bulk of source to operation precompilation. kts 2014-04-25 12:53:31 -0700
  • 30472bf0ca Precompiler now adds Variables to a pc_Variable Table. Additional precompilation error checking implemented. TablePair now uses a T_POINTER type. If this data type is used, the memory pointed to is _not_ freed when the TablePair or its parent Table is freed. The developer must remember to free this data type manually when it is used. kts 2014-04-15 11:18:52 -0700
  • 5eb6cf5db2 added more npcs, made changes to player file Vex 2014-04-07 22:01:53 -0700
  • 543e714c86 Merge branch 'master' of ssh://kettek.exoss.net:4422/srv/eureka/timesynk Vex 2014-04-07 19:40:52 -0700
  • 084344885c added more npcs Vex 2014-04-07 19:39:44 -0700
  • 9bf0e3c7fa newTile no longer takes x, y, and z params. Default values are set to 0 and are changed/set upon addTileToMap call. kts 2014-04-07 10:08:04 -0700
  • c1b8cf6c56 added more npcs, worked on tree, modified hatun warrior Vex 2014-04-07 00:23:56 -0700
  • b7388533e3 updated city floors and city walls Vex 2014-04-06 14:02:57 -0700
  • 9fd2a2833c Updated graphics, including pcs, npcs, weapons, armor, items, etc. Vex 2014-04-04 16:38:24 -0700
  • b45862f351 Windows PTime now uses native (non-SDL) millisecond precision for acquiring and delaying time. kts 2014-04-03 19:54:29 -0700
  • 902e21ebc6 After far too long of a delay, a git commit. The updates pertain to vm_compile and implements the basic parsing of virtual machine C source files into global, group, and local scopes. At the moment it does not convert to op codes - it only identifies variables declared outside of functions for the given scope. kts 2014-04-02 00:37:31 -0700
  • c7daa2d1b7 Added a test compiler program. Not much functionality yet, but it describes the precompilation (and, to a lesser extent, precompilation) of VM functions. kts 2014-03-16 19:37:51 -0700
  • fa7a158ec9 The Mystery of the git Commit kts 2014-03-14 14:51:41 -0700
  • b0c5bea071 Added bone armor, capran blood shaman, human rogue, jaguar man, crow man, npcs; edited human mage -- all graphical Vex 2014-03-14 02:07:36 -0700
  • e3941fa552 Updated devcpp project. Engine runs fine on win64. kts 2014-03-13 16:29:13 -0700
  • c1397f62fc Fixed addTablePair bug wherein a new TablePair would overwrite the old rather than add itself to the end of the TablePair linked list. Also moved timer.c/.h from engine/sdl/ to engine/. If compiling on Windows, getPTime and doNanoSleep still require SDL. kts 2014-03-13 16:13:35 -0700
  • 0842a2252e Updated xcode project to compile the engine. tile_edtior and old engine probably will not compile in xcode at the moment, but this will be remedied later. Need to make modules directory definable in some way. kts 2014-03-13 04:10:59 -0700
  • 6b0ef6fd83 Lots of fun abounded with segfaulting. Fixed it eventually - was accessing a state after it had already been freed, thus wreaking havoc in the next state. Maps and Tiles implemented now. Animation is a thing as well, but still a work in progress. It will likely be managed entirely by the Tile's doThink VM function. With modules now (partially loading) and Maps/Tiles figured out, the limited virtual machine will soon take shape. kts 2014-03-13 03:25:17 -0700
  • b33b2a534c Added some (pretty bad) module loading code. At the moment modules/module_name/CONF is loaded (if not, it bails) into g_module_conf and the list of sprites and default scale is acquired. From this, g_module_spritesheets is malloced for (spritesheet count) * sizeof(struct Spritesheet*) and Spritesheets are created and loaded into their respective positions. NOTE: Spritesheets should be set up by the renderer in part - probably via function pointer, similar to Elements. After these are loaded, ../modules/module_name/module_name.tsd is attempted to be loaded as well. Not much error checking done yet, so eggshells abound. Module CONF error checking will probably be handled by some function when we first generate the list of modules in modules/ dir. ALSO, Spritesheet loading does not check sprites/CONF for width, height and columns - this will be fixed on next commit. kts 2014-03-12 03:46:46 -0700
  • d42b12885f Added a load module state that provides a button list of modules found in the ../modules directory. When clicking on one, it will attempt to load ../modules/MODULE_NAME/MODULE_NAME.tsd into struct Data* g_tile_data. If it succeeds, it switches to a test state where I will be tweaking stuff like tile movement and similar. I will also add spritesheet loading in the load module state. kts 2014-03-11 23:56:23 -0700
  • 722ceb5747 Reorganized the project root, deleted unnecessary files, moved data.c/.h, fio.c/.h, llist.c/.h into common and old code into old/ directory. All modules will now reside on the modules/ directory. kts 2014-03-10 12:41:49 -0700
  • 53ffd0fce3 Added vm.c/.h in test. Implemented a good portion of the bytecode execution system. Need to implement non int data type operations. The VM is coming together\! kts 2014-03-06 23:54:19 -0800
  • a590956502 Added vm_memory.c in test/ - basically just a test bed for vm memory. kts 2014-03-06 13:05:02 -0800
  • e9f2e33cf8 Created armor and weapons sprite sheets for Xibalba. Created system with Tiers(materials) on Y-axis and Types on X-axis. (ex. body slots) Also, created spell sprite sheet with system of Elements on Y and types (cone, bolt, ball, lode and combinations) on X. Vex 2014-03-05 00:18:34 -0800
  • 3b24b50e4c Added fio and llist to xcode project. Should move stuff like fio, llist, elements, etc. to a common/ directory in the top of the project hierarchy. kts 2014-03-03 22:57:22 -0800
  • f9f65cd376 Added the linked list struct, LList, along with two functions for initializing and freeing a single LList. Also added the fio.c/.h files that will contain all functions pertaining to more complicated file or directory access. At the moment it provides two functions: dirToLList, which populates a linked list with the contents of the directory (as explained in the source), and fileExists, a simple function that checks if the file exists. kts 2014-03-03 22:48:00 -0800
  • 1ebb045fef Fixed the freezing issue on Windows - apparently it does not handle type conversions as fluidly as *nix. Changed SDL_GetTicks in getPTime to be assigned to int64_t rather than int. I suspect bugs still exist, but this will likely become a non-issue once a high precision timer(or as close as we can get) is implemented for Windows. Also it is a mystery why fps is capped to 60 - perhaps some Windows-specific OpenGL voodoo. kts 2014-03-03 13:14:23 -0800
  • 452bdf4a1d Cleaned up code in data.c and organized it. Current and future code will be formatted in adherence to the current draft of KCS. Also added datatype-specific writing and reading functions for TablePair values. This reduces the chance of unexpected behaviors when one datatype is interpreted as another. kts 2014-03-03 12:11:19 -0800
  • 13df61167d Added dev-cpp project for the engine. It kind of works. For some reason, as soon as the fps goes over 60, the engine freezes. I've tried adding SDL_Delay(s), removing most of the engine, as well as tweaking both renderers, but the outcome is the same. No clue as to why it would stop responding after a couple seconds, but work fine during those initial moments. kts 2014-03-02 23:28:49 -0800
  • bbcd6cd0aa More stuff added - how nondescript. In particular, data.c/.h now includes a function for loading in a .tsc, or timesynk configuration file, into a Table. This adheres to the information regarding the timesynk Configuration Syntax on the wiki. This feature has been implemented in the engine, as video width, height, and other similar options are loaded from the settings.tsc file relative to the engine. Also added a modules directory with a basic skeleton for the Xibalba module. kts 2014-03-02 22:10:49 -0800
  • 1569e89715 Fixed elements rendering twice in state_menu. Added a moving background to state_menu for movement testing. kts 2014-02-26 18:43:05 -0800
  • 2f596f4d50 Fixed PTime on OS X. OpenGL performance still terrible on OS X. kts 2014-02-26 16:36:12 -0800
  • ffa74bd574 Fixed the high precision timer and renamed it to PTime. It seems a bit silly to use nanoseconds for game tickrate, as many systems only have microsecond precision at best - but why not. Still have to add support for higher-than-millisecond precision on Windows - will likely run with microsecond, but more research is needed. kts 2014-02-26 14:22:02 -0800
  • c6efd2245b Made some changes for the timer to work on OS X. It is likely unoptimized, but more research will be done. Also, for some unknown reason, the OpenGL renderer now runs slower than the terrible software renderer (in OS X). No clue why as of yet. kts 2014-02-25 03:31:27 -0800
  • 9b5a1ed4b3 Added rendering code for sprite and fonts, made a pretty bad high precision timer - while being higher precision than SDL_GetTicks, it has a few problems that I must sort out. Also need to make it crossplatform. kts 2014-02-25 02:44:16 -0800
  • 3634e0cfa3 Added engine as a target for the xcode project. SDL_Surface to OpenGL Texture function now packs pixel data according to the endianness of the machine, as acquired from a run-time test in the function. This should probably be checked for on start and have an appropriate system flag set. kts 2014-02-22 01:09:37 -0800
  • b3f50776e8 Lots of stuff added since last commit. ASCII-based Font system and Element system(similar to tile_editor)s now partially in place. State management now more flushed out, but still likely to be tweaked. Now sports two renderers - software-mode SDL and hardware-accelerated OpenGL mode. At the moment code is not in place to switch between the two renderers in-program (managed by a call to interfaceSetRenderer), but it will be added later with the appropriate freeing of surfaces and textures. A more generalized binary to .c/.h program was added to the new tools subdirectory - it takes a binary file as an argument and creates the appropriate .c/.h files. It also can handle the append flag, -a. kts 2014-02-22 00:20:44 -0800
  • 478090d7c4 Began work on complete client rewrite within the engine/ subdirectory. This new client is written with game states in mind (i.e., main menu, net lobby, game) and a more expandable structure for multiple interfaces. Old code in the main directory will be removed entirely or reintegrated with the new engine. Majority of the code related to Tile(s) will be removed, as their properties are now dynamically loaded from TSD files (as generated by the tile_editor). Tiles will also have a local x and y coordinate for positioning within their currently occupied tile (or something very similar) - this will allow for smooth movement and more precise collision detection (according to quarters of tiles). Much more to come\! kts 2014-02-14 06:46:11 -0800
  • 49ce932ece data.c/.h added to devcpp project. Tile editor runs fine on win32/64. kts 2014-01-21 00:15:02 -0800
  • 48574819b8 I have Done The Right Thing(tm) and made the tab key jump to the next Spinner or TextInput element it can find in the Element chain. kts 2014-01-20 17:00:40 -0800
  • 2e48e2e1fa The tile editor's Data struct(tiles_data) isa) and accompanying sets(up to 7 default) are now created on start. This allows for the saving of Data without a file needed to be loaded prior. Some code should be moved to data.c/.h and the entire thing needs to be stress tested. kts 2014-01-20 06:46:32 -0800
  • 75b1960fe1 Table's count property was not initialized to 0 in newTable, thus causing erroneous behavior on OS X - now initialized properly. kts 2014-01-20 02:44:59 -0800
  • 149cd25ef9 After much struggling due to a fool's lack of documentation, the tile_editor is now (seemingly) fully functional. Changes to tile entries can now be made by adding/deleting/modifying the UI elements and pressing the 'commit changes' button. This only does a change for the TileData, etc., stored in ram. These changes can be saved to a file by specifying a filename in the data field and pressing the 'save' button. On a more technical note, fixed some bugs in the data reading code, such as inventory lines being partially read but then being assigned as a simple key=>string pair rather than an InventoryData struct - this, of course, caused segfaults and was particularly mystifying. Table structs now also have a 'count' property that is incremented or decremented whenever a TablePair is added. kts 2014-01-20 02:21:15 -0800
  • 9fe34501b5 Added a commit changes button that will save the key=>value Elements to TileData/TablePair/InventoryData, etc. structs. At the moment it only parses the elements and printf()s the key=>value pairs, including inventory elements. kts 2014-01-19 20:56:13 -0800
  • 8615026e0b Fixed a minor bug wherein the editor_elements ElementList's last property was not set to the Inventory Item Element of a new Inventory declaration. kts 2014-01-19 18:02:54 -0800
  • a81419d662 Adding and deleting of Pair(s) and Inventory(s), as well as adding and deleting of Inventory Items now fully works. Some of the code is messy, but it works fine. Next on the itinerary is the saving of changed Elements to TileData/TablePair(s), then the saving of all such changed data back to a tsd file\! kts 2014-01-19 17:43:36 -0800
  • ff8409be64 Added UI elements for InventoryData in the tile editor. Also added various buttons for deleting key=>value pairs and for adding new pairs, new inventories, and new inventory items. These buttons do not change anything at the moment. Also changed the tile editor's dimensions. kts 2014-01-19 02:29:01 -0800
  • 38f62c970e Spinner and TextInput Elements now change cursor position based on mouseup coordinates. kts 2014-01-18 03:52:31 -0800
  • 4ea6159ef6 Added data.c/.h to xcode project for both the engine and the editor and tested both on OS X. kts 2014-01-17 04:34:43 -0800
  • 30f71466fd Much progress on the tile editor, as it can now read in a .tsd file using the earlier developed data.c/data.h (Data, TileSetData, TileData, etc. structs and accompanying functions). Once a file is successfully loaded, changing the set/id will attempt to populate the GUI with key=>value pairs for the given tile, if it exists. Partially implemented is the parsing of InventoryData. Will implement adding new TablePairs through the GUI and the saving of any changes back to a .tsd file. Fixed some memory allocation problems as well - some leakage still existing in the tile editor as well as the Data functions/structs, but they are noted and will be taken care of in time. kts 2014-01-17 04:03:10 -0800
  • 3b6160cb51 Spinner now has increment and decrement buttons, as well as mousewheel support. Mouse clicks now handled by the elements system rather than SDL. Tiles in the spritesheet view can now be clicked on, changing the currently focused tile id. kts 2014-01-15 05:52:36 -0800
  • cfb2eda1c4 Added tile_editor/helper.c/.h to the Tile Editor target in xcode. Also removed tile_editor/.helper.c.swp file that accidentally was committed. kts 2014-01-15 00:32:48 -0800
  • ae5cbb9b4e Tile editor becoming more functional. Set and id input now use the SpinnerElement type that only takes numerical input, increments or decrements via up/down keys, and runs its callback after any change. Currently loaded set's spritesheet shows in the right-hand side of the screen, resizing the screen accordingly. This spritesheet preview will be used as a way to load tile data visually rather than via tile ids. kts 2014-01-15 00:28:23 -0800
  • 8570a9cca5 devcpp project files now updated to compile with parser types and functions. Also added the tile editor project, which produces a working win32/64 tile editor. kts 2014-01-09 21:54:53 -0800
  • 874378c5a7 The tile editor now compiles and works on Linux/X11. Fixed quite a few memory allocation related problems and added code for free'ing Element(s). kts 2014-01-09 21:50:23 -0800
  • 2c28c31bf8 Tile graphics may now be loaded by specifying the directory in the tile editor and pressing the load button. It will then look for doors.png, equips.png, floors.png, items.png, npcs.png, players.png, and walls.png. If any of these are not found, some or all of the graphic sets will be unavailable (the program iterates through them and returns if any fail, so if the 3rd tileset to be loaded fails, all thereafter will not load). The set and id can also be specified, after which the tile's graphic will be displayed. kts 2014-01-09 06:41:50 -0800
  • b1aa56cade The tile editor has moved well beyond a skeleton, although much work is yet to be done. Added an Element struct for the tile_editor - basically the catch-all for input boxes, buttons, text fields, drop-down menus and so on. Fully functional is the button and text types, semi-functional (only visually) is text input (needs to be focus/editable), and non-existing are drop-down menus. The button callbacks for data and graphics loading do not actually load anything yet - will be done after text input, ofc. kts 2013-12-31 02:34:36 -0800
  • 4ca32efeee Added an empty skeleton for the tile editor, including its own sub-directory in tile_editor/ (along with corresponding Makefile), as well as its own Target in timesynk's XCode project file. kts 2013-12-27 23:22:04 -0800
  • f2422fdada added getTileDataById to data.h, as it was causing segfaults on gcc 4.2.1, mac os 10.6.8/x86 without it. Also fixed pack_data.c, as it was attempting to load the tile data directory before checking argc if an arg was passed. Also added equipment to ibexian shocktrooper and barbarian in xibalba/players for additional testing. kts 2013-12-24 06:01:43 -0800
  • d5f4947c90 Yet again committed the sin of not committing for a long duration of time. As I recall: Finished most of the code for parsing a ts tile declaration file into data structures. In doing so added the InventoryData structure, which simply contains the name of the target tile, the count of tiles(using struct Range, which has min and max properties), the chance of spawn(using a float from 0.0 to 100.0), and an optional pointer to the next InventoryData in the line (akin to Tile Chains). Still todo is for TileData's TablePairs to be parsed into more than char*=>char* pairs, such as char*=>int, char*=>float, etc.. This will be far more efficient and given that TablePair(s) already contain the property for type, it should be done. Also added variations to addTablePair/setTablePair - addTablePairPointer and setTablePairPointer. These functions set the value pointer to the passed pointer rather than allocating new memory and copying the pointer's target memory to that new memory. kts 2013-12-24 05:37:15 -0800
  • df13ab259f added pack_tiles.c, providing pack_tiles, a program that takes a directory as an argument and creates a new file (directory/directory.tsd) from cleaned files 'doors', 'floors', 'npcs', 'walls', 'equips', 'items', and 'players' in that directory. At the moment it can be used on the xibalba directory to create 'xibalba/xibalba.tsd', which can then be tested with test/t2d.c, providing the internal filename referenced is changed. At the moment the Data system does not properly deal with inventories so any inventory/equipment declaration is ignored. kts 2013-12-21 02:38:46 -0800
  • c7f3ac15d3 added pack_tiles.c, providing pack_tiles, a program that takes a directory as an argument and creates a new file (directory/directory.tsd) from cleaned files 'doors', 'floors', 'npcs', 'walls', 'equips', 'items', and 'players' in that directory. At the moment it can be used on the xibalba directory to create 'xibalba/xibalba.tsd', which can then be tested with test/t2d.c, providing the internal filename referenced is changed. At the moment the Data system does not properly deal with inventories so any inventory/equipment declaration is ignored. kts 2013-12-21 02:38:08 -0800
  • 0005a93d65 Implemented Data system fully now (not integrated into ts engine itself yet). In the process added a new Table (hash table) system that matches keys to values. More information pertaining to that in data.h/data.c. Might switch over to a system wherein all Tiles are actually TileData structs (or contain TileData structs). This would increase the processing necessary, as values for properties must be acquired from a string instead of reading from a pre-defined struct, but it would increase the modularity immensely as there is no real limit on the amount of properties a Tile may contain (which will be most important once the interpreter is implemented and used for tile movement, collisions, etc.). kts 2013-12-20 18:24:06 -0800
  • e2e015c76b Added two folders: test/ and xibalba/. Contained within test/ are two test/devel-beds for two systems that will be integrated within ts. The first is script.c, which is the development program for the interpreter system - this interpreter system allows for the setting of variables (both local and global), the creation of new functions, and the definition of default in-game functions such as dice rolling and the like. The second file, t2d.c functions as a basic test utility for Tile Data loading and the like - it interprets a tileset/tile definition file into Data, TileDataSet, and TileData(s) respectively. These structs, as defined in data.c/.h, allow for reference to tiles by TID:ID or simply by name through the use of key=>value pairs. It is from these structs and their accompanying access functions that new Tiles will be created (perhaps later optimized through a basic Tile array that contains semi-populated Tile(s) that can be memcpy'd similar to the current system). Also added the xibalba/ sub-dir that will contain the various data for Xibalba (tile definitions, graphics, map creation, etc.), moving majority of what is in tiles/ into xibalba/. kts 2013-12-17 17:08:37 -0800
  • b3a3831cd2 Added EquipTile/EQUIP. This distinguishes equipable items such as weapons, armour, rings, etc., from non-equipables such as keys and the like. kts 2013-11-27 18:31:49 -0800
  • 770ad240e2 Updated Xcode to include parser.c/.h. Since it was not mentioned in last commit, parser.c/.h contains functions related to parsing slots, adding slots together, doing comparisons between slots, etc.. It is also where dice parsing and stat parsing will go as well. kts 2013-11-26 16:08:13 -0800
  • ef59c0a365 Equipping and unequipping items now fully implemented. Uses the player's slots and used_slots properties along with the target item's required slots property. used_slots+required_slots are checked against slots and if less than, used_slots is changed accordingly. Unequipping removes required_slots from used_slots. equipmentContext added for equipping/unequipping as well. interface/sdl.c changed so that the focused UI (being either inventory or equipment) is at a higher opacity than the unfocused UI. kts 2013-11-26 16:02:04 -0800
  • 375067aa8a Added some equipment-related code, but it needs to be reworked entirely. Equipment should just be an instance of Inventory, not its own struct. kts 2013-11-25 00:59:08 -0800
  • d368c1efd0 Implemented the basic system for slots, stats, and damage wherein the type and amount of slots, stats, or die rolls are defined in their respective Tiles as a string. Although this has computational shortcomings due to parsing, it is the most flexible of all and forces no hard-coding on slot types or stat types. It can later be optimized, of course, as the size of each ItemTile, PlayerTile, and NpcTile has increased by at least 128 bytes. Note that some code is left-over from when the initial slot system was written using structs. Additionally, inventoryContext now handles up and down appropriately, and the inventory display has been improved. Along with the inventory display, an equipment surface is shown, although at the moment it lacks any equipment listing. kts 2013-11-23 03:28:38 -0800
  • d10407fb38 Added functions descriptions in various *.c files. Should be in the header files, but for me, having the comments with the code is far better (since it's all in-development). interface/sdl.c should likely be split into multiple files, as it handles netcode, basic graphics operations, user input, and drawing the various UI elements all in one file. kts 2013-11-21 18:20:20 -0800
  • bd67818190 Added tile_scale command that calls consoleScaleTiles(const char *string). This then converts the passed arguments of 'float x float y' (e.g., 'tile_scale 1.0 1.0' to scale to 1.0 times) to scaleTiles(float scale_x, float scale_y). If no argument is passed in the string, the default 2.0 scale is used. If the y property is not passed, the value of scale_x is used for scale_y. kts 2013-11-17 17:05:55 -0800
  • 4e6f983db8 win32/64 uncovered out-of-bounds reading/writing for getpixel/putpixel in interface/sdl.c, so both functions now check if x/y is greater than or equal to 0 and less than or equal to the surface's width/height. kts 2013-11-17 16:37:10 -0800
  • 7e7a4bd2fe Added drawScaledSpriteOutline function that (basically) draws an outline of the given sprite from the passed spritesheet. Although this function could later be used for drawing items/players behind tall objects, it is only used to outline the selected item while in the inventory screen at the moment. The function produces many warnings during compile, but they will be fixed later. Most of the draw*Sprite* functions should be combined - that is to say, drawScaledSprite and drawSprite should likely be the same function that chooses which spritesheet to use via a passed flag. kts 2013-11-17 16:02:49 -0800
  • 81b566f9c8 No real changes, only minor tweaks to the trasparency of the inventory UI. kts 2013-11-16 23:23:43 -0800
  • 2776c9a91c Updated devcpp projects to use inventory.c and inventory.h - works ok. kts 2013-11-16 16:22:43 -0800
  • 6ad2ae9a5b NULL wasn't declared on non-xcode environment, so string.h was included (over stddef.h, as sprintf was required). Inventory window, such as it is, is created according to the max_slots/slots_per_row properties of the Inventory, thus adjusting for larger inventories. The current item's name is now shown at the center-bottom of the window. Dropping items is also tidier, as the inventory->selected property is adjusted if it is equal to count (i.e., the selected cursor is pushed back when the last item is removed so selected always corresponds to an existing item). kts 2013-11-16 16:15:22 -0800
  • d50282effa We now have a mostly working inventory system. Items can be picked up via ` and dropped using ` within the inventory. Currently using a new playerPickup() function, but it should be abstracted to a tilePickup(struct Tile *tile) function so that npcs, etc., can share in the fun. kts 2013-11-16 04:38:42 -0800
  • 4b7e0db3e0 Added rudimentary Inventory display, however we must have some way to keep track of the selected item in inventory offset. Perhaps through a global variable or, if it must be done, through a new Inventory struct that contains pertinent information. It should likely be the latter, so the same system can be expanded to chests and the like. Also added the ITEM type in general. kts 2013-11-16 02:15:03 -0800
  • 57a1b46db4 Created a new Spritesheet struct for loading and managing spritesheets - has two SDL_Surfaces, one scaled, the other original. Also has various properties related to scale size, columns in a row, etc.. Changed interfaceDraw() to use the new system. Also, the tile in front of the player is drawn at partial opacity if it is a WALL or a DOOR. Moved the position of the UI around. kts 2013-11-15 18:19:54 -0800
  • 981e0cd2f2 Added SDL_image.framework as a framework to include in the produced app, thus allowing timesynk.app to run w/o dependencies. kts 2013-11-15 14:00:26 -0800
  • 81c3ea6fdc Moved a portion of the user messages (e.g., 'You open the %s.') to various #define MESSAGE_* in message.h. Also fixed the bug I never looked into where entries in consoleLog would read past the string into neighboring memory - this was due to using strlen(string) for the byte-length in memcpy, as strlen does not count the terminating character '\0'. Fixed by adding +1 to the return value of strlen kts 2013-11-14 16:21:53 -0800
  • 23455ccd5c Tidied up interface/sdl.h somewhat. Fixed most of the compiler warnings from interface/sdl.c. Also touched up font_mini.png to make it a bit more readable. kts 2013-11-14 15:15:42 -0800
  • 8893eb35d4 Did a hack to get transparency working on big endian systems - basically it grabs a portion of the pixel color value and uses that for alpha. This is terrible, but I did not want to waste time trying to figure out what was wrong, as it is more of a tertiary feature. Beyond that, added a new font_mini.png spritesheet that contains an 8x8 ASCII font. This is currently used in the new UI messages system, which is basically a window that is drawn over the map with the current in-games messages. At some point this will be split into two different categories, one from the PC perspective and the other from the player perspective (e.g., 'you bludgeon the nupi' - '4 damage (1d6+1)'). Also added a new Font struct that contains: int width, int height, SDL_Surface *spritesheet, float scale_x, float scale_y, and SDL_Surface *scaled_spritesheet. Helper function added of loadFontFromMemory(struct Font *font, unsigned char *memory, unsigned int length, int font_width, int font_height) - this creates a new SDL_Surface from the passed memory and sets the passed font's surface to it along with the width and height. Also added was a setFontScale(struct Font *font, float scale_x, float scale_y) - this calls interfaceScaleSurface on the font's spritesheet and sets scaled_spritesheet to point to that new surface. For the time being, the new font is used through interfaceDrawStringF and interfaceDrawCharF, two functions that closely match their normal counterparts, but instead use a passed font and its values for drawing. The normal draw char/string functions will likely be replaced with the new ones. kts 2013-11-14 03:03:10 -0800
  • d7ad2c3bd6 Added uiInit(), a function that creates ui_hotbar_surface, blits the appropriate ui.png sprites to it, then sets the opacity to 0.75. At the moment, ui.png must be in RGBA format due to my lack of knowledge on alpha blending, etc. - this shall be changed later for optimization. Added the SDL_SetOpacity(SDL_Surface *surface, double opacity) function that sets the alpha layer of the target surface to the desired amount. Along with this is the uiSetOpacity helper, which simply calls SDL_SetOpacity on ui_hotbar_surface. Also added uiSetScale which simply calls interfaceScaleSurface(SDL_Surface *surface, float x, float y) on ui_hotbar_surface. interfaceScaleSurface does a rough up/down-scale of the target surface - has not been thoroughly tested for bugs, so it has the potential to break. kts 2013-11-12 02:41:32 -0800