4983 Commits

Author SHA1 Message Date
Peter Cawley
398431c909 Added Linux Makefile for AnimView tool (from / fixes issue #8).
Fixed usage of MSVC-specific integer types in AnimView's th.h
2009-09-12 19:27:37 +00:00
Peter Cawley
af1412ef02 Added staff dialog (from patch in issue #10).
Added class.is function to test if a variable is an instance of a given class.
Removed "patient dialog" from the debug menu (as it can now be launched by clicking any patient).
Modified staff placement dialog to handle existing staff as well as new staff.
Fixed right/middle mouse buttons launching patient dialog, when only left was intended.
Fixed bug with "modal" windows sometimes having their close method called when they were created.
2009-09-12 18:26:50 +00:00
Peter Cawley
a2b33490bd Reorganised Lua cursor code.
Added context sensitive cursors for patients, staff, and doors.
Clicking a patient now opens the patient dialog (clicking staff does the same, but not for long).
Improved Lua simulated cursors.
Fixed meander action sometimes causing staff to stand still unnecessarily.
2009-09-11 21:25:55 +00:00
Peter Cawley
0a2b0cb078 Added support for cursors other than SDL's default.
Started the transition of THRenderTarget to a full class rather than a typedef/weak struct (for SDL rendering engine).
Removed defunct ensureHardwareSurface from the Lua video API.
Made hit tests pixel perfect.
Fixed inclusion and usages of limits.h and th_gfx.cpp (fixes issue #9).
2009-09-11 17:04:54 +00:00
Peter Cawley
cb30e1e704 Added hit-test functionality (to convert screen co-ordinates to the entity drawn on that pixel).
Fixed Lua stack overflow in meander action when there was nowhere to meander to.
Made the reported FPS values smoother.
2009-09-09 20:32:07 +00:00
Peter Cawley
251c4d1e1d Implemented remainder of buttons on the jukebox dialog (see patch / issue #4).
Pressing ESC will now close most dialogs.
Fixed error from staff hire dialog when pressing the next / previous buttons with no category selected (fixes issue #5).
Removed code from hire_staff.lua which never executed and shouldn't have been there anyway.
Finished staff hire dialog (staff can now be hired and placed in the hospital).
The patient dialog now has a close button (see issue #7).
The patient dialog now scrolls the map to the patient when the preview circle is clicked.
2009-09-08 21:09:59 +00:00
Peter Cawley
890cbb0617 Changed behaviour of freeing the SDL rwop in a music_t destructor (fixes issue #3). 2009-09-08 19:48:14 +00:00
Peter Cawley
0de0f7481a Fixed anim:getTile() returning erroneous results when the animation was in the early list, and the code was compiled with gcc for the x64 platform (fixes #6).
Improved error message when anim:setTile() is called with an invalid map index.
2009-09-08 18:48:51 +00:00
Peter Cawley
4982f2c4c8 Finished staff hire dialog, with the exception of the actual hiring button.
Tweaked staff wage calculations.
Fixed math.random bugs with negative minimums.
Fixed x64 compile warning in LFS.
2009-09-07 15:33:00 +00:00
Peter Cawley
70fd5298d9 Added description and face generation to staff profile randomisation.
Added drawRect method to Lua graphics API for drawing solid filled rectangles.
Implemented more of hire staff dialog.
The world now has a pool of available staff (changing on a monthly basis).
Fixed entrance doors rendering in wrong order relative to those walking through it.
Fixed entrance doors not always rendering when at the screen edge.
2009-09-06 22:42:35 +00:00
Peter Cawley
a64da28352 Added entrance (automatic sliding) doors.
Started to implement "Hire Staff" dialog.
Changed animation x origin from 140 to 141 pixels.
Added crude sprite viewer (for when AnimView cannot be compiled).
2009-09-06 18:12:06 +00:00
Peter Cawley
c8ac228cb8 Information about objects in loaded maps is now passed to Lua 2009-09-04 21:54:04 +00:00
Peter Cawley
96dd72e8bd Audio failing to initialise at the SDL level is not longer a fatal error.
Lua now receives the SDL error if audio fails to initialise.
2009-09-03 20:07:49 +00:00
Peter Cawley
9633d91e37 Updated win32 x86 binary (correctly this time). 2009-09-02 17:34:59 +00:00
Peter Cawley
91ad624123 Updated win32 x86 and x64 binaries to latest trunk code. 2009-09-02 17:32:06 +00:00
Peter Cawley
9f5bfef359 Added THPathfinder::findIdleTile and THPathfinder::visitObjects methods (visible to high-level Lua as World:getIdleTile and World:getFreeBench).
Added THOB numbers to each Lua object type definition, and THOB numbers are now set on tiles when objects are created / destroyed.
Added THMN_DoNotIdle flag for map tiles.
Added "use_object" humanoid action.
Added double-free prevention to music_t and THPathfinder object destructors.
Improved humanoid queueing.
2009-09-02 17:27:07 +00:00
Peter Cawley
59712e0fbe Refactored humanoid walk code to a more generic and extensible action queue system.
Added bench animation numbers.
2009-09-01 02:22:35 +00:00
Peter Cawley
824ef58455 Moved raw bitmap loading to the rendering engine C++ API (was in the Lua API).
Removed newSurface, getHeight, freeSurface, draw, saveBitmap, and loadBitmap functions from the rendering engine Lua API.
Removed THPalette::assign from the rendering engine C++ API.
The DX9 rendering engine now uses indexed primitive drawing.
The DX9 rendering engine compile time "CORSIX_TH_DX9_UNLIMITED_FPS" option is now a runtime option called "present immediate".
D3D9X is no longer required or used in any situations.
Implemented error reporting in DX9 rendering engine's Lua setMode function.
Removed redundant device state initialisation statements from DX9 rendering engine.
Clarified function binding code in th_lua.cpp
2009-08-29 18:19:52 +00:00
Peter Cawley
1cfc83d7e4 Fixed 64 bit SDL DLLs targeting wrong version of MSVC9 runtime DLLs. 2009-08-17 12:26:49 +00:00
Peter Cawley
38ac8c1dcc Added --lua-dir, --bitmap-dir, and --config-file command line options.
Added native 64 bit support.
Added option to load high-quality MP3 background music rather than MIDI.
Improved error reporting when asynchronously loading music.
Fixed crash resulting from music data being garbage collected while still in use.
2009-08-17 12:06:42 +00:00
Peter Cawley
091bf28b82 There are now multiple debug patients rather than just one.
Debug patients now have a randomised appearance.
Added various source code comments.
Unified construction of data directory filenames.
Modified Lua strict mode to require functions (and other globals) to be pre-declared.
Modified call signature of Graphics:loadFont to make it more natural.
Fixed bug whereby corridor objects could be placed inside rooms or straddle room walls.
Fixed bug with multiple humanoids walking through a door causing all but the last humanoid to glitch.
2009-08-12 01:14:22 +00:00
Peter Cawley
1839a6a873 Language files are properly loaded again under Linux (fixes issue #1).
Fixed bug in non-D3DX DX9 renderer relating to interaction of a clipped blit with a horizontal flip.
Placing an object now marks its footprint as unbuildable (so that other things cannot be built on top on it).
Marked appropriate parts of the reception desk footprint as only requiring passability.
Re-added platform detection around rendering engine selection in config.h
2009-08-11 10:38:32 +00:00
Peter Cawley
1b0a575984 D3D9X (Microsoft's standard DirectX9 extension library) is no longer required by the DX9 renderer.
DX9 renderer now tries to pack TH sprite sheets onto a single texture (for efficiency).
Added Lua API for toggling non-overlapping rendering mode.
Optimised menu bar rendering by enabling usage of non-overlapping rendering.
Text is now rendered in non-overlapping mode.
The "flags" debug overlay now regularly updates to reflect changes to flags.
2009-08-10 20:41:40 +00:00
Peter Cawley
e8904e2b98 Added debug overlay bitmaps for showing map tile flags.
Added more debug map overlays.
Various flags now loaded from level files rather than being based on tile numbers.
Finished place objects dialog.
Linked furnish corridor dialog to place objects dialog.
Ingame date is no longer constant.
Fixed door and window blueprint markers.
2009-08-10 01:00:46 +00:00
Peter Cawley
37c4baf080 Implemented jukebox dialog.
Implemented some of object placement dialog.
Added automatic palette greyscale-ghost generation.
Added object idle animation numbers and available orientations.
Organised dialogs into exclusivity groups.
2009-08-08 23:12:15 +00:00
Peter Cawley
024e2c591c Added asynchronous music loading.
Added check for available language files.
Added music over callbacks to move onto a new background track when one finishes.
Packed custom bitmaps into a sprite sheet.
Left clicking no longer causes the patient to move to the cursor (right click still does).
Modified users of custom bitmaps to use the sprite sheet version of the bitmap.
Modified map cell outline bitmap to use standard palette.
2009-08-08 01:58:35 +00:00
Peter Cawley
5c68b19cae Added menu system.
Added Decoda project file.
Added beginnings of an OpenGL rendering engine.
Added workaround for non-floor tiles commonly used as floor tiles.
Fixed map debug text ignoring canvas destination x/y.
Fixed map tile lookup table.
2009-08-05 15:51:54 +00:00
Peter Cawley
12c47bca56 Added audio subsystem.
Implemented more of the furnish corridor dialog.
Added debug rendering capability to map class.
Added Mersenne twister random number generator.
Fixed transparency of loading screen when using SDL renderer.
Updated binaries to use latest MSVC runtime version.
2009-08-02 21:48:18 +00:00
Peter Cawley
4a5cc8aeb1 Added accessors for X and Y position to THAnimation.
Added minimal patient dialog to test rendering of the world as part of the UI.
Finished DX9 renderer clipping code.
Corrected wall shadow drawing to intersect its clip rectangle with the existing clip rectangle.
Broke up lines of th_map.cpp which were longer than 80 characters.
2009-07-29 16:37:03 +00:00
Peter Cawley
695f87932d Starting to implement "Furnish Corridor" dialog.
Added strict mode to Lua.
Added C config options to make the Windows Platform SDK optional (rather then required) on Windows.
Added sanity checks to ensure that exactly one renderer is enabled in the C config file.
Added ability for renderer to optimise the situation of multiple non-overlapping sprites.
Relaxed checks on sub-directories of Theme Hospital directory being present.
Changed meaning of "north", "east", "south", and "west" to be more natural.
Optimised path finding code.
Optimised usage of ID3DXSprite in DX9 renderer.
Fixed bug in FPS counter.
Fixed some documentation in sdl_video.cpp.
2009-07-28 00:13:15 +00:00
Peter Cawley
a8d05e1919 Added windows icon file. 2009-07-24 21:29:05 +00:00
Peter Cawley
6def3b5ae3 Commit of existing codebase 2009-07-24 20:29:53 +00:00
(no author)
1f315dbe70 Initial directory structure. 2009-07-24 20:22:52 +00:00