diff --git a/_release/mediaview/mediaview.bb b/_release/mediaview/mediaview.bb new file mode 100644 index 0000000..209e9db --- /dev/null +++ b/_release/mediaview/mediaview.bb @@ -0,0 +1,111 @@ + +;Blitz media viewer. +; +;Create executable in 'bin' + +AppTitle CommandLine$() +fil$=Lower$( CommandLine$() ) + +index=Instr( fil$,"." ) +If index>0 ext$=Mid$( fil$,index+1 ) +Select ext$ +Case "x","3ds" + ShowModel( fil$,False ) +Case "md2" + ShowModel( fil$,True ) +Case "bmp","jpg","png","pcx","tga","iff" + ShowImage( fil$ ) +Case "wav" + ShowSound( fil$ ) +Case "mp3","mid","mod","x3m","xm","it" + ShowMusic( fil$ ) +Default + RuntimeError "Unknown File Extension" +End Select + +End + +Function ShowModel( fil$,md2 ) + If Windowed3D() + Graphics3D 400,300,0,2 + Else + Graphics3D 640,480,0,1 + EndIf + If md2 + model=LoadMD2( fil$ ) + If model ScaleEntity model,.025,.025,.025 + Else + model=LoadMesh( fil$ ) + If model FitMesh model,-1,-1,-1,2,2,2,True + EndIf + If model=0 RuntimeError "Unable to load 3D mesh:"+fil$ + sc=CountSurfaces(model) + For k=1 To sc + vc=vc+CountVertices( GetSurface( model,k ) ) + tc=tc+CountTriangles( GetSurface( model,k ) ) + Next + camera=CreateCamera() + CameraClsColor camera,0,0,64 + CameraRange camera,.01,10 + xr#=0:yr#=0:z#=2.1 + light=CreateLight() + TurnEntity light,45,45,0 + Repeat + RotateEntity model,xr,yr,0 + PositionEntity model,0,0,z + UpdateWorld + RenderWorld + Text 0,0,"Triangles:"+tc+" Vertices:"+vc+" Surfaces:"+sc + Flip + key=False + Repeat + If KeyHit(1) End + If KeyDown(200) xr=xr-3:key=True + If KeyDown(208) xr=xr+3:key=True + If KeyDown(203) yr=yr+3:key=True + If KeyDown(205) yr=yr-3:key=True + If KeyDown( 30) z=z-.1:key=True + If KeyDown( 44) z=z+.1:key=True + If Not key WaitKey + Until key + Forever +End Function + +Function ShowImage( fil$ ) + Graphics 400,300,0,2 + SetBuffer BackBuffer() + image=LoadImage( fil$ ) + If image=0 RuntimeError "Unable to load image:"+fil$ + MidHandle image + x=200:y=150:t=4 + Repeat + Cls + DrawImage image,x,y + Flip + key=False + Repeat + If KeyHit(1) End + If KeyDown(200) y=y-t:key=True + If KeyDown(208) y=y+t:key=True + If KeyDown(203) x=x-t:key=True + If KeyDown(205) x=x+t:key=True + If Not key WaitKey + Until key + Forever +End Function + +Function ShowSound( fil$ ) + sound=LoadSound( fil$ ) + If sound=0 RuntimeError "Unable to load sound:"+fil$ + Repeat + PlaySound sound + WaitKey + If KeyHit(1) End + Forever +End Function + +Function ShowMusic( fil$ ) + music=PlayMusic( fil$ ) + If music=0 RuntimeError "Unable to play music: "+fil$ + WaitKey +End Function \ No newline at end of file diff --git a/_release/userlibs/UserLibs.txt b/_release/userlibs/UserLibs.txt new file mode 100644 index 0000000..1f1d3de --- /dev/null +++ b/_release/userlibs/UserLibs.txt @@ -0,0 +1,123 @@ + +New DLL interface spec +---------------------- + +There is now a directory in the root blitzpath called 'userlibs'. + +By adding DLLs and '.decls' files to this directory, you can extend blitz's command set. + +DLLs contain actually library code, while .decls files contain 'declarations' to be added to the +base command set. These declarations describe the functions contained in the Dll. + + +Format of decls files +--------------------- + +Decls files should always start with a '.lib' directive, followed by the quoted name of the DLL to be +loaded, eg: + +.lib "mylib.dll" + +Following the .lib is a list of function declarations. The syntax of these is identical to +function declarations in Blitz, with the following exceptions: + +* No default parameter values are allowed. + +* If no function return type is specified, the function is a 'void' function - ie: it returns nothing. + +* Instead of object parameters, you can only specify 'void*' parameters using a '*' type tag. Such +parameters can be assigned ANY object or bank, so BE CAREFUL! + +* A declaration may be optionally followed by a 'decorated name'. This takes the form of a ':' +followed by a quoted string denoting the decorated name, eg: + +MyFunction( text$ ):"_MyFunction@4" +MessageBox%( hwnd,text$,title$,style ):"MessageBoxA" + +The decorated name is the name of the function as it appears in the dll, and only needs to be +specified if it is different from the actual function name. + + +Writing DLLs +------------ + +All functions MUST use the _stdcall calling convention. + +Floats are passed and returned as per standard C/C++ conventions. + +Strings are passed and returned in 'C' format - ie: a pointer to a null-terminated sequence of +characters. + +Returned strings must be in a 'static' memory buffer. Once the function returns, this string is +immediately copied into an internal Blitz style string, so its OK to share this buffer between +multiple functions. + +Both banks and objects can be passed to functions. The value passed is the address of the first byte +of storage. No information is sent regarding the size or type of memory passed so, again, BE CAREFUL! + +Neither Banks or objects can be returned from functions. + +Arrays are not supported at all. + +VisualC decorates symbols quite heavily! If you are coding in 'C', the necessary stdcall specifier +will cause a '_' to be prepended, and a '@' (followed by the number of bytes passed to the function +- ie: number of parameters*4) to be appended. So, something like: 'void _stdcall MyFunc( int x )' +will end up as '_MyFunc@4'. In C++, the name decoration is even messier! But you can supress it by +using the 'extern "C"' feature (see examples below) so you're just left with the 'C' stdcall mess. + +Other languages such as Delphi and Purebasic don't appear to suffer from this feature, but it can be +worthwhile looking through dll symbols if you're having problems. Check out PEview at +http://www.magma.ca/~wjr Open your dll and select 'SECTION .rdata'/'EXPORT address table' +to have a look at the exported symbols your compiler has seen fit to bestow upon your dll. + +Example +------- + +Ok, here's a little C++ example, as it would appear in VisualC. + +First, we write the DLL: + +//demo.dll +// +#include +#include +#include + +#define BBDECL extern "C" _declspec(dllexport) +#define BBCALL _stdcall + +//returns a float and has 6 float parameters +BBDECL float BBCALL VecDistance( float x1,float y1,float z1,float x2,float y2,float z2 ){ + float dx=x1-x2,dy=y1-y2,dz=z1-z2; + return sqrtf( dx*dx+dy*dy+dz*dz ); +} + +//returns a string and has one string parameter +BBDECL const char * BBCALL ShuffleString( const char *str ){ + static char *_buf; + + int sz=strlen(str); + + delete[] _buf; + _buf=new char[ sz+1 ]; + strcpy( _buf,str ); + + for( int k=0;k.5 to get lightening. Roll on Ico in Blitz! + +Multiple bone weights. Each vertex can now be influenced by up to 4 bones, each with an +arbitrary weight. If more than 4 weights are present, the 'heaviest' 4 are used. Weights +are always normalized so that they sum to 1. Bones can still only be imported/created via +B3D files. + +Note: + +The EntityRoll function and Dynamic mesh system have been tweaked a bit. Post any poroblems in the bug reports forum + +***** V1.85 ***** + +Added: + +brush=GetEntityBrush( entity ) +brush=GetSurfaceBrush( surface ) +texture=GetBrushTexture( brush[,index] ) +name$=TextureName$( texture ) + +Note: + +You should release the brush/texture returned by GetEntityBrush()/GetSurfaceBrush()/GetBrushTexture() after use to prevent leaks! Use FreeBrush/FreeTexture to do this. + +Added: + +class_name$=EntityClass$( entity ) + +Returns the actual 'class' of an entity. Possible return values are: + +Pivot +Light +Camera +Mirror +Listener +Sprite +Terrain +Plane +Mesh +MD2 +BSP + +***** V1.84 ***** + +Added: cubic environment mapping. + +Use texture flag 128 with CreateTexture/LoadTexture. + +Cubemap textures *must* be square 'power of 2' sizes. Recommended sizes are 32,64,128 or +256. + +The new SetCubeFace command allows you to select cube faces for direct rendering. + +The syntax is: 'SetCubeFace texture,face' + +Face should be one of: + +0 : left (negative X) face +1 : forward (positive Z) face - this is the default. +2 : right (positive X) face +3 : backward (negative Z) face +4 : up (positive Y) face +5 : down (negative Y) face + +All rendering to a texture buffer affects the currently selected face. Do not change cube face while a buffer is locked. + +To load prerendered images into a cubemap using LoadTexture, faces should be laid out in a horizontal strip in the above order. + + +Added: GfxDriverCaps3D() + +Returns the 'caps level' of the current graphics driver. Values are: + +100: card supports all 'standard' Blitz3D operations. +110: card supports all standard ops plus cubic environment mapping. + +Fixed: a reasonably major collision bug that affected 'stop' response collisions. + + +***** V1.83 ***** + +Fixed hide/show light bug. + +Fixed unscaled CollisionY bug with ellipsoid collisions. + +Changed EntityOrder so it can be used with cameras as well as models. This allows you to +force certain camera views to be rendered before or after others. + +Custom mesh vertices now have a default color of 255,255,225 and alpha of 1. Perviously, vertex +colors defaulted to the less useful value of 0,0,0. This improvement was actually 'accidentally' +introduced in V1.81. + +Userlibs problem with duplicate identifiers fixed. Compiler will now refuse to run if there's +anything suspect in userlibs. + +Changed runtime to only open userlibs that are actually used by the program. Previously, +everything in userlibs was automatically opened at runtime. + + +***** V1.82 ***** + +Re-release - major bug in 1.81! + +***** V1.81 ***** + +B3D: + +Userlibs system added - see 'specs and utils' page. + +Ellipsoid collisions added. Entity radius now takes 2 parameters: x_radius and y_radius. + +EntityType ID's for collisions are now limited to a range of 1...999, or 0 for 'no collisions'. +This has allowed me to replace a 'sparse' array in the system with a real one for more speed. + +The entity system was given a semi-major overhaul in the interest of speeding up Hide/Show entity. +All demo code I have tested works fine with the new system, but its a reasonably radical overhaul +and its possible that some of the more esoteric stuff going on out there could encounter problems. +But, ShowEntity and HideEntity are now instantaneous. + +Vertex Alpha has been added, via an extra, optional parameter on the end of VertexColor. +This is currently rather limited: polys are NOT sorted for you, and you'll need to use the +new entityfx value of 32 which 'forces' alpha blending even if an entity is apparantly opaque. +The alternative would have been to add some 'per vertex' overhead to calculate/update whether a +surface has at least one vertex with alpha<1 - but I wasn't happy about doing this. + +FMOD channels upped to 1024 - get noisy! + +Minor bug in b3d loader fixed. Files that contain multiple anims (although they still need to be +under a common root node) should now work. + + +***** V1.80 ***** + +B2D/B3D + +Added: + +RndSeed() +SetGamma red,green,blue,dest_red#,dest_green#,dest_blue# +UpdateGamma [calibrate] +GammaRed( red ) +GammaGreen( green ) +GammaBlue( blue ) + +B3D Only + +Added: + +SetAnimTime entity,time#[,anim_seq] + + +***** V1.79 ***** + +Hopefully stable release! + +Lots of little fixes/tweaks/rearrangements... + +Mouse and Keyboard input are no longer DirectInput based, and now just use +standard Windows messages. This has come about due to a few reports from end- +users of games written in Blitz who have suffered mouse/keyboard lockups. These +are usually fixed with a driver update, but I feel its unrealistic to expect +end users to perform such updates (do you know where YOUR mouse driver is? I +don't...), and when you're trying to sell a shareware game its HUGELY important +that it works first time on as many machines as possible. + +The debugger is still 'not quite there' yet. A few things it yet needs to be +capable of are highlighting of runtime error statements and a persistant log - +probably in the form of being able to 'log-to-file'. + +***** V1.78 ***** + +B2D/B3D + +Compiler and Debugger have been separated from the IDE! + +blitzcc.exe is now a standalone exe that compiles/runs a program, launching the debugger if required. The debugger is now a separate DLL. + +The general syntax for using BlitzCC is: + +blitzcc [options] [sourcefile] + +Where options can be: + +-h : show help +-q : operate quietly ++q : operate very quietly +-d : compile and run in debug mode +-k : print a list of all keywords to stdout ++k : print a list of all keywords plus 'quickhelp' to stdout +-o exefile : create an executable called 'exefile'. + +eg: + +blitzcc -d myprogram.bb + +...will compile and run 'myprogram.bb' in debug mode. + +I have successfully used BlitzCC with several 3rd party 'programmer editors' including ConText (my favourite), SourceEdit and CrimsonEditor. ConText can even be setup to 'catch' error output so that you're taken to the correct line if there are any compilation errors. + +IMPORTANT: If you are planning to use BlitzCC with a 3rd party editor, you must setup an environment variable called 'blitzpath' that points at the blitz directory (ie: the one 'blitzbasic.exe' is in). + +There is no longer an 'End Program' button in the IDE. This has been moved to the debugger along with step/stepin/stepout etc, but be careful with running non-debug programs as you'll no longer be able to terminate them from within the IDE. + +Programs are now individual processes, which should make for a more stable system in general. Previously, programs just ran in a separate thread which meant they could corrupt IDE memory if something went wrong. + +Control is now returned to the IDE as soon as a program has finished compiling. This means you can launch multiple instances of the same/different programs from within the IDE - great for client/server stuff! + +The IDE toolbar image is now hardcoded to 'cfg/ide_toolbar.bmp' and the debugger toolbar to 'cfg/dbg_toolbar.bmp', so customized toolbars will have to be renamed. Also note that some buttons have gone. + +Added JoyU(),JoyUDir(),JoyV(),JoyVDir(),JoyYaw(),JoyPitch(),JoyRoll(). Some way of detecting which axis/buttons are present is still required... + +Implemented FMOD3.60 using 'safer' settings. On my machine, this has also meant a slight speed improvement! Go figure... + + +B3D Only: + +Fixed CameraPick with orthographic mode bug. + + +***** V1.77 ***** + +B2D/B3D: + +Had another crack at fixing the weird, intermitant font bug. Seems to be working now, although I'm not 100% sure why. Looks suspicously like a Windows GDI bug... + +Implemented Floyds FTOA() routine. This should result in more accurate float-to-string conversions. + +DLLs fixed. CDECL and STDCALL dlls should both work properly now. + + +B3D Only: + +CopyMesh bug fixed. + +Added texture flag 512 to force the use of high color textures in low bit depth graphics modes. + +'CameraProjMode camera,mode' added. 'mode' should be one of: + +0 : no projection - disables camera (faster than HideEntity) +1 : perspective projection - the default +2 : orthographic projection - new! + +Use 'CameraZoom' to control the scale of graphics rendered with orthographic projection. I will be adding commands to give more precise control over just what's on screen at a later date.... + +Orthographic projection will not work properly with terrains. Terrains depend on perspective to calculate level-of-detail, and with no perspective this system goes out the window! + + +***** V1.76 ***** + +B2D/B3D: + +FMOD now loops MIDIs, meaning that all music started with PlayMusic now loops. ChannelPlaying has been modified (only when used with music) to indicate whether the music has played through at least once. + +Note that autolooping of music means there is no way to play music just once without a noticable glitch when it ends! I have to talked to the FMOD guy about this and a fix is coming. + + +B3D Only: + +Fixed bug with nested meshes in b3d files. + +Fixed bug where a 'null' root node in B3D files would cause a crash. + +Fixed normals bug with scalemesh/fitmesh/rotatemesh etc. This resulted in dodgy lighting of meshes that had been transformed. + +Normals from .X and .B3D files now preserved. UpdateNormals will still overwrite all normals, and is still used if file contains no normals. + +Added texture flag 256, for creating non-managed textures. Use this flag for textures that need to be frequently updated. Note: Highly experimental! + +Fixed bug with high vertex count models. More work to be done here, as per surface/material vertex counts>65535 will still blow up, but at least its back to the way it was. + +Added CopyMesh( mesh,[parent] ). You should still use CopyEntity whenever possible, as this allows mesh geometry to be shared between multiple entities. + +Added a new texture flag value '65536' to the B3D file format, to emulate the TextureCoords command. See the B3D format docs for more... + + +***** V1.75 ***** + +B2D/B3D: + +B2D gets the 3.51 FMOD update! + +Fixed memleak with arrays of objects. + +B3D: + +B3D File format introduced. + +Basic Bone support added - only internally for now via b3d file loader. + +ExtractAnimSeq command added to extract a single animseq from an anim 'series'. + +Fixed multitexturing bug where textures were being reused. + + +***** V1.74 ***** + +FMOD 3.51 implemented, including midi StopChannel fix. + +Problem with single texture scenes fixed. This problem typically manifested itself as a 'wrong texture' glitch when rendering scenes which only contained a single texture. + +Texture format selection modified a bit. Now tries to use 16 bit textures if mode depth is 16 (was just going for 'max bits' textures in all modes), which will save on videomem for the 'low color' modes. Also, texture format argb 3328 is NOT used unless necessary, which gives much better results on 16 bit cards like the Voodoo etc. + +Sprite tweening behaviour now mimics other entities completely. Sprites were 'zooming in/out' if created then immediately scaled with render tweening enabled. No more! + + +***** V1.73 ***** + +FMOD DX7 problem fixed. + +Hardware acceleration and 'forcemono' flag added to Load3DSound. + + +***** V1.72 ***** + +AlignToVector bug fixed, and an optional 'rate#' parameter added. A rate of 1 will 'snap' an entity to the vector, and rates between 0 and 1 will cause an entity to smoothly 'tend towards' the vector. Defaults to '1'. + +Terrain crash bug fixed. Terrain 'LOD' algorithm also changed slightly. Gotta find a better algorithm for this stuff... + +Alpha values<.5 should now work with new style masked textures. + +FMOD 350 implemented. Ogg Vorbis (cool name!) support added. + + +***** V1.71 ***** + +B2D/B3D + +Some simple movie and DLL commands added: + +OpenMovie( file$ ) +-------------------------- +Opens a movie file and returns a movie handle. + +CloseMovie movie +-------------------------- +Closes a movie. + +DrawMovie movie,x,y[,width,height] +--------------------------------------------------- +Draws a movie at x,y on the current buffer. Width/height default to movie width/height. Returns true if the movie is still playing. + +Viewport and Origin are not taken into account, and the movie must be positioned entirely 'on screen'. + +Movie support relys on DirectShow, so you will need to ensure the correct drivers are installed. + +Movies will typically playback fastest at their natural size. + +MovieWidth( movie ) +----------------------------- +Returns the width of a movie. + +MovieHeight( movie ) +------------------------------ +Returns the height of a movie. + +MoviePlaying( movie ) +------------------------------- +Returns true if the specified movie is playing. + +CallDLL( dll_name$,proc_name$[,in_bank,out_bank] ) +------------------------------------------------------------------- +Calls the specified procedure in the specified DLL, and returns the integer value returned by the DLL procedure. + +The DLL is called with pointers to and sizes of bank memory. Dll function prototypes should like something like this (Visual C++) example: + +extern "C"{ +_declspec(dllexport) int _cdecl my_dll_func( const void *in,int in_size,void *out,int out_sz ); +} + +The 'extern "C"' bit prevents C++ 'name-mangling', and the _cdecl bit prevents name decoration. You could call this function using something like: + +in_bank=CreateBank(...) +out_bank=CreateBank(...) + +;poke input parameters into in_bank +result=CallDLL( "mydll","my_dll_func",bank1,bank2 ) +;peek output results from out_bank + + +***** V1.70 ***** + +B2D/B3D + +TCPStreamIP and TCPSTreamPort now return the IP and port of the computer at the other end of the connection. I haven't had a chance to test this, but it should work. + +App title for executables now defaults to a single space - ie: blank. + +B3D Only: + +Masked texture mode changed to use alpha reference value instead of alpha blending. + + +***** V1.69 ***** + +B2D/B3D: + +Bug in ReadString$() fixed, where a chr$(0) was terminating the string. + +B3D Only: + +Some subtle UpdateNormals weirdness fixed. UpdateNormals now also normalizes normals. This is not strictly necessary, but makes the normals more useful. + +TrisRendered() command added - returns number of triangles rendered by most recent RenderWorld. This is the number of triangles sent to Direct3D, so will include triangles that are back-faced culled, but not triangles culled by Blitz's frustum (ie:camera viewport/zoom/range) culling. + +***** V1.68 ***** + +Quake3 BSP loader in! + +* Shaders are *not* supported! + +* BSP's cannot (yet) be painted, textured, colored, faded etc. + +* A BSP model is just an entity. Use the standard entity commands to scale, rotate and position the BSP, and the standard collision commands to setup collisions with the BSP. + +* BSP models are not lit by either 'normal' AmbientLight, or by any directional lighting. This allows you to setup lighting for in-game models without affecting the BSP lighting. However, BSP models *will* be lit by point or spot lights. + +* Textures for the BSP model must be in the same directory as the BSP file itself. I'll be working on a generic solution to locating textures at some time in the future. + +* This is fairly experimental! Please post your impressions on the Blitz website. + + +Commands added: + +bsp=LoadBSP( file$[,gamma_adjust#][,parent] ) +--------------------------------------------- + +Loads a BSP model. + +gamma_adjust# can be used to 'boost' the intensity of the BSP lightmaps. Valid values range from 0...1 inclusive. Defaults to 0 - ie: no gamma adjustment. This can result in very dark levels! + +BSPAmbientLight bsp,red#,green#,blue# +------------------------------------- + +Sets the ambient lighting for a BSP model. Note that BSP models do not use the normal AmbientLight setting. This can also be used to increase the brightness of a BSP model, but the effect is not as 'nice' as using the gamma_adjust parameter of LoadBSP. + +BSPLighting bsp,use_lightmaps +----------------------------- + +Controls whether BSP models are illuminated using lightmaps, or by vertex lighting. Vertex lighting will be faster on some graphics cards, but doesn't look as good! + + +Other changes: + +TCPStreamIP/TCPStreamPort should now work with TCPServer 'accepted' streams. + +CopyEntity now copies entity name too. + +Sprite viewmode 3 modified to allow the sprite to pitch. + +Alpha tweening/autofading bug fixed. + +Fixed UpdateNormals bug/memleak. + + +***** V1.67 ***** + +MD2 transitions in - AnimateMD2 now has an extra transition# parameter. + + +***** V1.66 ***** + +Fixed a UDP buffering problem. Also removed UDP stream closing down if there is an ICMP 'port not found' error - very important for servers! + +Clamped windowed mode y position to >=0. This prevents the title bar getting lost when window is larger than desktop. + + +***** V1.65 ***** + +Net commands added: + +CountHostIPs +HostIP +DottedIP + +UDP commands added: + +CreateUDPStream +CloseUDPStream +SendUDPMsg +RecvUDPMsg +UDPStreamIP +UDPStreamPort +UDPMsgIP +UDPMsgPort +UDPTimeouts + +TCP commands added: + +TCPStreamIP +TCPStreamPort +TCPTimeouts + + +***** V1.64 ***** + +3D Runtime: + +Fixed terrain crashing/corruption bug. + + +***** V1.63 ***** + +MD2 Support back in - hurrah! + + +***** V1.62 ***** + +Runtime: + +A few 3D bug fixes. + +Final Blitz3D Release build! + + +***** V1.61 ***** + +IDE: + +Better handling of file extensions. + +F1/F1 handler changed to Si H's docs format. + +Windowed modes are now centred. + + +Runtime: + +MouseZ()/MouseZSpeed() added for wheely mice. + +FreeImage updated to 2.4.1, apparantley fixes some mem-leaks, definitely fixes a BMP loading problem! + +AppTitle takes an extra, optional, close_prompt$ parameter. This sets up a prompt to be displayed when a windows close gadget is hit. + +***** V1.60 ***** + +3D Runtime: + +Picks and Collisions unified a bit. Both now return surface handle and triangle index +if pick/collision was with a mesh. + +Commands changed/added: + +PickedX,PickedY,PickedZ, +PickedNX,PickedNY,PickedNZ, +PickedTime,PickedEntity,PickedSurface,PickedTriangle + +CollisionX,CollisionY,CollisionZ, +CollisionNX,CollisionNY,CollisionNZ, +CollisionTime,CollisionEntity,CollisionSurface,CollisionTriangle + + +***** V1.59 ***** + +3D Runtime: + +Very nasty mipmapping bug fixed. It affected textures with an aspect ratio of >=2:1, resulting in the occasional random 'illegal memory address'. Its been in there forever, too! + +EntityOrder/transparancy fixed. + + +***** V1.58 ***** + +IDE: + +Simple 'mediaview' hook added to IDE. Source code available in core release. + +3D Runtime: + +Fixed alpha tweening problem. + +Fixed MD2 loading bug. + +Cleaned up md2 animations a bit. *NOTE* MD2s have their own set of anim commands! + +WBuffering available only for 16 bit modes - on by default. + +Load commands should now return 0 if resource cannot be loaded. + +AlignToVector changed - now uses relative quaternions which should be more flexible. + +Beta Autodoc back in. + +Commands added/changed: + +WBuffer +MD2AnimTime +MD2AnimLength +MD2Animating + + +***** V1.57 ***** + +3D Runtime: + +Another crack at W buffering. + +Mask texture format detection routine slightly modified. + + +***** V1.56 ***** + +3D Runtime: + +Optimized dynamic meshes a bit. + +Optimized per-entity overhead a bit. + +Dummy objects in 3DS files now named. + + +***** V1.55 ***** + +Bug with Image mask building on images with alpha fixed. + +CurrentDir$() now has '\' appended. + +SystemProperty$( property$ ) added for returning windows specific stuff. property$ should be one of: "os", "windowsdir", "systemdir", "appdir", "tempdir". + +Rand() with negative 'from' value fixed. + +FontWidth() fixed to return something else apart from '8'! + +LoadFont fixed to recognize path properly, eg: LoadFont( "media\blitz.fon" ) now works. + +Minimize and close gadgets added to windowed-mode window. Close abruptly closes for now... + + +***** V1.54 ***** + +Another bug in ImagesCollide fixed - an oldy, too. One more, and I'm rewriting the thing! + +Links with wsock32.lib instead of ws2_32.lib, so should run on minimum install systems without complaining about DLLs. + +ShowPointer/HidePointer added to show/hide the mouse pointer in windowed mode. + +Resurrected a hack that may reduce Flip 'jitters' on some cards. + +Joystick re-acquired if focus lost in windowed mode. + +Faster non-GDI Line routine courtesy of Simon Armstrong. + + +***** V1.53 ***** + +Replace$ bug with same strings fixed. + +ReadLine$() returns all chars except chr$(13)/chr$(10). + +ImagesCollided fixed. + + +READPIXEL AND READPIXELFAST USERS PLEASE READ: +---------------------------------------------- + +Some issues with ReadPixel and ReadPixelFast have arisen. + +While working on the 3D, it has been necessary to make ReadPixel and ReadPixelFast "alpha-aware". + +This means that the high 8 bits of the color returned ReadPixel/ReadPixelFast now contain valid alpha information. + +However, in the case of Blitz2D apps, there is no alpha information in images! + +I have decided that in the abscence of any alpha information, a pixel is assumed to have 'full' alpha. + +Therefore, values returned by ReadPixel/ReadPixelFast will now (usually) have their high 8 bits sets. The exception will be when reading pixels from Blitz3D textures created with an alpha channel. + +To get the old behaviour of ReadPixel/ReadPixelFast, use the following: + +rgb=ReadPixel( x,y ) And $FFFFFF + +This will 'mask out' the 8 high bits of alpha and return just the red, green and blue components of the pixel. + +I apologize for any inconvenience this change may have caused/be causing, but I believe that, long term, this approach is the right way to go... + + +***** V1.52 ***** + +Sanity check release - mainly making sure all the 3D tweaking hasn't upset anything! + +Some simple TCP client/server stuff added - more coming! + +The file system has changed a little internally, but all file commands SHOULD work the way they used to. + +The idea of a 'stream' has been introduced. Open files and TCP connections are both types of streams. You can use the following commands with any type of stream: + +Eof( stream ) +ReadAvail( stream ) ;NEW +ReadByte( stream ) +ReadShort( stream ) +ReadInt( stream ) +ReadFloat#( stream ) +ReadString$( stream ) +ReadBytes( bank,stream,offset,count ) +ReadLine( stream ) +Writebyte stream,value +WriteShort stream,value +WriteInt stream,value +WriteFloat stream,value +WriteString stream,value# +WriteLine stream,line$ +WriteBytes( bank,stream,offset,count ) + +...so, these commands are not strictly file commands any more, but since a file is now a type of stream, they can still be used successfully with files! + +----- New commands ----- + +* OpenTCPStream( ip$,port ) + +Opens a client TCP stream to the specified server, and returns a stream handle if successful or 0 if not. You'll need to be online for this to work over the internet. + +ip$ can either be of the form "1.2.3.4" or "www.w3.org". + +* CloseTCPStream tcp_stream + +Closes the specified tcp stream. + +* CreateTCPServer( port ) + +Creates a TCP server on the specified port. Returns a tcp server handle if successful or 0 if not. + +* AcceptTCPStream( tcp_server ) + +Accepts an incoming tcp stream, and returns a tcp stream if one is available, or 0 if not. + +* CloseTCPServer tcp_server + +Closes a TCP server. + +* ReadAvil( stream ) + +Returns how many bytes are guaranteed to be successfully read from a stream. In the case of file streams, this reflects how much data is internally buffered. In the case of TCP streams, this reflects how much data has 'arrived'. + +* BankSize( bank ) + +Returns the size of a bank. + +* ResizeBank bank,new_size + +Resizes a bank. Existing bank data is unmodified, but may be moved in memory. + +* CopyBank src_bank,src_offset,dest_bank,dest_offset,count + +Copies data from one bank to another. If copying between the same banks, handles overlapping memory ranges. + +* CopyRect src_x,src_y,src_width,src_height,dest_x,dest_y[,src_buffer][,dest_buffer] + +Copies a rectangle of graphics from one buffer to another. If a buffer is omitted, the current buffer is used. + + +----- Changes ------ + +ReadBytes/WriteBytes now return how many bytes successfully read/written from/to the stream. They used to return nothing. + +Eof returns 1 if eof has been reached or, in the case of a TCP stream, the stream has been 'nicely' closed. + +Eof now returns -1 if something has gone wrong during stream processing. + +***** V1.50 ***** + +FMOD Library updated to 3.33 - ChannelPlaying() now works with MIDI! + +Added Labels list to editor. + + +***** V1.49 ***** + +Re-dimming arrays of objects and strings fixed. + + +***** V1.48 ***** + +Optimized Text clipping. + +Fixed '&' char not printing. + +Fixed IDE program command line. + +Added F6 to re-run last program - useful for projects with Includes. + +Added integer version of Rnd(): + +* Rand( n ) ;returns random integer from 1 to n inclusive +* Rand( x,y ) ;returns random integer from x to y inclusive + +Added copy pixel commands: + +* CopyPixel src_x,src_y,src_buffer,dest_x,dest_y[,dest_buffer] +* CopyPixelFast src_x,src_y,src_buffer,dest_x,dest_y[,dest_buffer] + +Note: CopyPixelFast requires both source and destination buffers to be locked, and does no clipping or origin translation - be careful! May be useful for BlitzDoom?.. + + +***** V1.47 ***** + +ExecFile now uses ShellExecute instead of CreateProcess, so should be able to open documents +now. + +Played with the Win/DX internals a bit, so there may be some minor issues. + + +***** V1.46 ***** + +CommandLine$() and 'Program command line' requester added, so you can now get at the command line parameters used when a Blitz exe is run. + + +***** V1.45 ***** + +Double spaced save file fixed. +MoveMouse drifting in windowed mode fixed. +Editor not tokenizing before compile/save fixed. + + +***** V1.44 ***** + +Bank commands added at last! + +bank=CreateBank( size ) +FreeBank bank +PeekByte( bank,offset ) +PeekShort( bank,offset ) +PeekInt( bank,offset ) +PeekFloat( bank,offset ) +PokeByte bank,offset,value +PokeShort bank,offset,value +PokeInt bank,offset,value +PokeFloat bank,offset,value +ReadBytes bank,file,offset,count +WriteBytes bank,file,offset,count + + +***** V1.43 ***** + +Oval bug fixed. + +ImageRectCollide fixed. + +Print in tight loop fixed. + +Dragging editor to death fixed. + +Font corruption fixed - smoothing disabled for now. + +Temporarily disabled secondary device detection. + +Note: All fonts are discarded when graphics mode changes. + +Note: Print/Write/Input ignore viewport & origin, and always write to the front buffer. + + +***** V1.42 ***** + +Runtime window made topmost in debug mode. + + +***** V1.41 ***** + +Mouse leap to 0,0 fixed. + +Joystick unacquired fixed. + +Debug log shortcut to F9. + +Cls damage rect applied. + +WaitMouse waits for mouse. + +Text bounding clipped before rendering. + +Print with default empty string fixed. + +Font setup bug fixed? Maybe. + +Font bold/italic/underline fixed. + +WritePixelFast/ReadPixelFast fixed. + + +***** V1.40 ***** + +MAJOR internal re-working - all directX stuff rewritten from scratch! + +Added recent files list to IDE. + +Added function and type lists to IDE. + +Added DebugLog text$ command. Select 'View Log' from the 'Debug' menu to view a programs DebugLog output. + +Cleaned up include file debugging/error reporting. Should work OK now... + +Windowed mode now usable in exes. Graphics command has an extra 'mode' parameter: + +0 : auto - windowed in debug, fullscreen in non-debug (this is the default) +1 : fullscreen mode +2 : windowed mode +3 : scaled window mode + +The depth parameter is ignored in windowed mode. + +LoadFont now actually loads fonts. + +Text command greatly improved - should be much faster. + +Commands for using mulitple graphics drivers: + +CountGfxDrivers() +GfxDriverName$( driver ) +SetGfxDriver driver + +The CountGfxModes, GfxModeWidth, GfxModeHeight and GfxModeDepth commands are now dependant on the driver set by 'SetGfxDriver'. + +Timers rewritten and are much more accurate. + +Implemented a kludge for ye old 'jerky flipping if not much on-screen' problem - works on my machine, but not very scientific. Based on a flash-back to DOS days... + +Low-level/high-speed functions for reading/writing pixels - for advanced/brave users only: + +LockBuffer [buffer] +UnlockBuffer [buffer] +rgb=ReadPixel( x,y[,buffer] ) +WritePixel x,y,rgb[,buffer] +rgb=ReadPixelFast( x,y[,buffer] ) +WritePixelFast x,y,rgb[,buffer] + +After you use LockBuffer on a buffer, the only graphics commands you can use are the read/write pixel commands listed above. You must UnlockBuffer before using other graphics commands. + +If a buffer parameter is omitted, the current buffer selected by 'SetBuffer' is used. + +ReadPixel/WritePixel may be used anywhere in your program, but will work faster if buffer is locked. ReadPixelFast/WritePixelFast MUST be used on a locked buffer. + +ReadPixelFast/WritePixelFast do no clipping - if your pixel is off-screen you may crash Blitz! + +The rgb values for read/write pixel are packed into a 32 bit integer. The red component occupies bits 16-23, green 8-15 and blue 0-7. + +These are STILL not really fast enough for fullscreen fades/wipes, but may be of use to someone out there... + + +***** V1.36 ***** + +FMOD sound system implemented! + +This is really a BETA version, as I have only tested this on my computer and there may be some compatibility problems - audio stuff REALLY hits the hardware! Therefore, I wouldn't recommend releasing executables with this version just yet. + +The eagle eyed will notice that Blitz executables are getting bigger! I will be working at reducing this in the near future, and there is quite a bit of 'fat' yet to be trimmed from the FMOD library. + +Sound commands have changed substantially. I was nervous about doing this, but better sooner than later. We are working on new help files for Blitz owners, and plan to eventually release help files along with each Blitz update. + +You can now play a single sound as many times as you want, so CopySound has gone. + +LoopSound/SoundPitch/SoundVolume/SoundPan all set up a sound for the next time it is played, and have no immediate effect. + +Playing a sound, music file, or CD track returns a channel number. Modifying a channel WILL have an immediate effect. Note that not all formats/device support all channel effects. For example, you can't control the pitch of a CD track. + +You can now play multiple songs simultaneously. Using ChannelVolume, you can even cross-fade between songs! + +Summary of new sound commands: + +* sound=LoadSound( filename$ ) + +Loads a sound file and returns a sound number. + +Formats supported: raw/wav/mp3 + +* LoopSound sound + +Sets loop mode for a sound. Sound will loop when next played. + +* SoundPitch sound,hertz + +Sets pitch for when sound is next played. + +* SoundVolume sound,volume# + +Sets volume for when sound is next played. Volume is in the range 0...1, where 0=silence, and 1=full volume. + +* SoundPan sound,pan# + +Sets the left/right pan for when sound is next played. Pan is in the range -1...+1, where -1=full left and +1=full right. + +* channel=PlaySound( sound ) + +Starts a sound playing and returns a channel number. + +* channel=PlayMusic( filename$ ) + +Starts a piece of music playing and returns a channel number. If a piece of music with the same filename is already playing, it will be restarted. + +Formats supported: raw/wav/mp3/mod/s3m/xm/it/mid/rmi + +* channel=PlayCDTrack( track[,mode] ) + +Starts a CD track playing and returns a channel number. Set mode to 1 to play the track once, 2 to loop the track and 3 to play the entire CD starting from the track. The default mode is 1. + +* StopChannel channel + +Stops a channel playing. + +* PauseChannel channel + +Pauses a channel playing. + +* ResumeChannel channel + +Resumes a channel playing after PauseChannel. + +* ChannelPitch channel,hertz + +Sets the pitch of a channel. + +* ChannelVolume channel,volume# + +Sets the volume of a channel. See 'SoundVolume' for volume values. + +* ChannelPan channel,pan# + +Sets the pan of a channel. See 'SoundPan' for pan values. + +* ChannelPlaying( channel ) + +Returns 1 if channel is playing, otherwise 0. + +Have FUN! + + +***** V1.35 ***** + +TFormImage/ScaleImage/ResizeImage/RotateImage fixed: the output size was being calculated incorrectly. + + +***** V1.34 ***** + +Finally tidied up Includes. Error reporting and debugging should now work across +multiple source files. + + +***** V1.33 ***** + +FreeImage library implemented! Formats supported: BMP,PNG,JPG + +Asc() fixed to return positive values only - except for null strings where it returns -1. + + +***** V1.32 ***** + +Added HostNetGame( game_name$ ) and JoinNetGame( game_name$,server_ip$ ) for TCP/IP only. + +Return values are the same as for StartNetGame() - 0 if failed, 1 if joined, 2 if hosting. + +These allow you to bypass the grungy 'connection dialog' bit. + + +***** V1.31 ***** + +Fixed multiplayer dialog bug, typically manifested as a 'Can't enumerate sessions' error. + + +***** V1.30 ***** + +Unselectable debugger control fixed. + + +***** V1.29 ***** + +Stray mouse pointer fixed? Here's hoping... + +Optional 'vwait' parameter added to 'Flip'. Defaults to 'True' for compatible behaviour. May be useful for timer synced games. + +Internal cleanup of nightmare 'surface-lost' code. You can now run 2 full-screen BB progs and Alt-Tab between them: on my machine, anyway. Not even slightly recommended. + + +***** V1.28 ***** + +'About' requester removed from start of final version. + +Source code position set to error position for runtime errors. + +GetJoy() fixed. + + +***** V1.27 ***** + +Multiple joystick support added. All joystick commands except FlushJoy now take an optional port paramter - see quick help. + +Includes cleaned up a little. Still not ideal. + + +***** V1.21 ***** + +Include command added. + +initialdir for create exec fixed. + +More consistant error messages. + +Fixed globals not appearing in debugger. + +Fixed FlushMouse, FlushJoy. + + +***** V1.20 ***** + +VWait fails quietly. + +FP rounding mode changed to 'nearest'. + +Added FlushKeys, FlushMouse, FlushJoy. + + +***** V1.17 ***** + +Weird assembler error nailed. + +Case insensitive identifiers added. + +Separate namespaces for types, functions and vars. + +Keywords not tokenized until cursor leaves identifier. + +PlayMusic wont play same music twice if first attempt fails. + +Fixed sound mono->stereo bug. + +Fixed sound sample rate conversion bug. + + +***** V1.15 ***** + +Fixed 'Mod 0' bug. + +Majorly souped up optimizer. + +Added command reference docs to demo. + + +***** V1.14 ***** + +Fixed ImagesCollide bug. + +Fixed 'Error loading source' bug. + + +***** V1.13 ***** + +Fixed Asc memleak. + +Fixed Restore bug. + + +***** V1.12 ***** + +First demo release.