Giter Club home page Giter Club logo

eternity's Introduction

+ Feb 19 / 2010
  First commit
  Work to be done is in main.cpp

+ Feb 19 / 2010
  Added GDI+ rendering to textures with preservation of alpha channel
  This means you can now load .gif through GDI+ (but not through D3DX)

+ Feb 20 / 2010 v0.0.1-boxedText
  This is a developmental branch where I'm trying to get boxedText to work.
  Basically it should render to texture some text and lay a box behind it.
  A bit like a dialog box.  See main.cpp for details.  Considering using
  a rendering toolkit like Qt, but that may be very heavy.  Another option
  was IWebBrowser2, instantiate an IE basically and use it to render text.
  Probably not the best choice.

+ Feb 20 / 2010 v0.0.1-boxedText-merge
  BoxedText now working, rendered in DirectX.  GDI+ boxed text was
  stripped out (GDIPlusTexture::boxedText()) because of difference
  in kerning in d3d vs GDI+, even for the same font with the same
  parameters -- the computed size was still different.

+ Feb 21 / 2010 v0.0.2-lib
  Separated out code into a .lib file (for the engine core) and a
  "game" project, which uses the engine.
  
+ Feb 21 / 2010 v0.0.2-lib
  Window::drawBox().  Initially was bad version of the drawBox()
  (unnecessary use of a cached map), but that actually got lost
  due to misuse of git reset function.. shall remain unnamed.
  Going to use modulating color instead on white tex, that's
  this version anyway.
  
  * Sprite scaling fixed to allow rotation.
    USE:  vec2Scale, rotation, vec2Trans, vec3Center
    DO NOT USE:  vec2ScalingCenter, scalingRotation, vecRotCenter, vec3Pos

+ Feb 21 / 2010 v0.0.3-uoit-gdw
  A branch of the code to publish for week 6 of gdw.
  Basically it should contain only the MOST BASIC,
  STRIPPED DOWN FUNCTIONS that maximize __ABILITY__ TO DO THINGS,
  NOT NECESSARILY FLEXIBILITY.
  - I will also break some of the overload groups of functions
    into functions that aren't overloads of each other..

+ Feb 23 / 2010 v0.0.3-uoit-gdw
  Pre-release alpha.  Here are notes from main.cpp
  that haven't been completed yet.


  Restructure inheritance:
  GameWindow : Direct3DWindow : BasicWindow
  Need an object for a SpriteManager (spriteMan)
    (he records drawSprite calls)..
    its functions are callable through GameWindow though
    (gameWindow.drawSprite(x,y,z))

  For drawText, it should accept a va_list..
  
  State parameters?  Perhaps using state parameters
  for all drawing isn't such a bad idea after all
    window->setPos( x, y ) ;
    window->drawSprite( 1 ) ; // uses its default width/height, draws
    // at last setPos'd position.
    
  - OpenGL supports quadrics through the GLU* functions,
  does Direct3d?

  - Improve the framerate by batching properly
  
  - http://stackoverflow.com/questions/84556/whats-your-favorite-programmer-cartoon#answer-84609 

+ Mar 5 / 2010 v0.0.4-mouse-improvement
  - Some improvement to mouse functionality
  
+ Mar 6 / 2010 v0.0.5-bug-fixes
  - Fixed modulating color bug in drawSprite overloads (it
    would always use white)
  - Changed signature of a drawSprite version from
    void drawSprite( int id, float x, float y, float width, float height, D3DCOLOR modulatingColor ) ;
  - to
    void drawSprite( int id, float x, float y, float width, float height, float angle ) ;
    [credit: Nick Taylor's suggestion]
  
  - Fixed cursor clip rectangle, not adjusted, on start with
    different window size, class Mouse
    [credit: Nick Taylor's find]

+ Mar 9 / 2010 v0.0.6-looping-sound
  - Added a function Window::loopSound( int id, int loopCount )
    that can loop a sound any number of times.
    Pass it -1 to loop forever.
    
    /*
    Observational note:  If you play an FMOD_SOUND* twice,
    AND that sound was created with FMOD_CREATESTREAM,
    then, you don't get another "instance"
    of that sound, rather that sound starts over.
    That doesn't happen with normal (NON FMOD_CREATESTREAM)
    sounds though.
    */
    
+ Mar 10 / 2010 v0.0.6-looping-sound
  - Added guards on loadSound() for
    file-not-found errors,
  - Added handler code for sound already loaded id,
    just replaces previously loaded sound
    and removes the old sound from map.
    
  - Added capability to STOP a sound;
    that's done on a CHANNEL.
    
    Maintaining ANOTHER multimap<int, FMOD_CHANNEL*>
    that retains active channels.  When a sound starts
    playing, we save off the channel in that map.
    
    Using MULTIMAP because its possible
    that a sound with a given ID
    can be started playing TWICE.
    
    If you want to stop playing a sound by ID,
    we retrieve ALL occurrences of that sound
    in the map (BY ID!)
    
    We also needed to expire a channel
    (remove it from the map<>) when the playing
    sound stops playing.
    
    What we really needed to do here is to 
    have a callback function to remove the
    finished sound from the map<> when it
    is done playing.  FMOD supplies
    FMOD_CHANNEL_CALLBACK, which is great.
    
    Because more than one instance of
    a sound can be playing at a time
    (but it will be on a different channel)
    I had to use a linear search in the multimap<int, FMOD_CHANNEL*>
    to remove the specific FMOD_CHANNEL* that
    had just finished playing.
    
    The only issue with the callback was that
    the Window::fmodChannels map was actually
    in accessible in the callback function...
    on account of FMOD not accepting an
    object member function as a parameter.
    
    So its made as a static function
    Window::channelEndCallback.
    
    The multimap was made static as well.
    One irritating error is 
    !! Bug::"map/set iterator not incrementable"
    
    Removed the line that causes it, but this
    should be tracked down some time in the future.

+ Mar 10 / 2010 v0.0.7-custom-fonts
  - Add custom fonts

+ Mar 11 / 2010 v0.0.8-new-project-layout
  * NEW PROJECT LAYOUT:  individual projects
    for each week of GDW.
  
  * Common directory to store
    assets in:  $solutionDir/assets.
    * Added ASSET macro
      
  - Note:  I've disabled warnings:
    - C4244:  'conversion' conversion from 'type1' to 'type2', possible loss of data
      http://msdn.microsoft.com/en-us/library/th7a07tz%28VS.80%29.aspx
      
    - C4482:  nonstandard extension used: enum 'enum' used in qualified name
      http://msdn.microsoft.com/en-us/library/ms173704%28VS.80%29.aspx
    
    - C4800:  'type' : forcing value to bool 'true' or 'false' (performance warning)
      http://msdn.microsoft.com/en-us/library/b6801kcy%28VS.71%29.aspx
      
  - We've disabled the warnings in the interests of keeping
    code UNCLUTTERED with casts.
    (warnings disabled in Visual Studio project settings, not
     using #pragma's.)
     
+ Mar 11 / 2010 v0.0.9-gdw-week-8
  - Paused sounds using FMOD when Window::pause() is
    called.
    
  - Changed function signatures of drawString
    to ALL require a FONT ID.
    
  - Added auto-center drawString() function
    void drawString( int fontId, char *str, D3DCOLOR color ) ;
    
  - bunch of other things in the pacman project
  
+ Mar 12 / 2010 v0.0.10-loopSound-fix
  - Minor fix to loopSound()
  - A few changes to the layout of default projects
        
+ Mar 17 / 2010 v0.0.11-soc
  [[ + Mar 6 / 2010 v0.0.5-split-concerns [[ originally Feb 26 / 2010 v0.0.4-split-concerns ]] ]]
  * ( This note was copied from another abandoned branch.
      I'm re-doing this now )
  In splitting the concerns, there were a few possibilities.
  
  These are the development notes, one branch
  (which never got committed) is here as well
  
  THE BRANCH THAT NEVER COMMITTED:
  --------------------------------
  Final separation of concerns - WindowClass.h has
  been split into
    + Game.h - extends WindowClass.h with Direct3D specific
               capabilities.
    + InputMan.h - manages mouse and keyboard input.
    + SoundMan.h - manages sound loading and playing
    + SpriteMan.h - manages sprite loading and drawing, including
                    the ability to draw simple boxes, text,
                    and generate sprites from GDI+
  A Game : is a Window, and a Game CONTAINS
  an InputManager, a SoundManager, and a SpriteManager.
  Each of these should be singletons, but we didn't
  correctly implement the singleton pattern with
  a static member here and a constructor that
  returns that instance.  That can added in later,
  or simply left out if people understand that its unnecessary.
  
  
  Notes:
  Do you know what's happened here?
  A lot of the functions we had before
  in WindowClass.h we were able to keep
  PRIVATE because of the mish-mash of
  all these hidden concerns in WindowClass.h
  
  When we put them into child classes of
  Game.h (InputMan, SoundMan), we had
  to make the functions public, so now,
  some of the maintenance code (to do with
  restarting the GPU etc) are PUBLIC to
  users of the Game class, by virtue that
  they needed to be PUBLIC for Game.h
  to even call them.
  
  One solution is
    :: Make InputMan and SoundMan friend class Game.
       This means Game may access and
       modify InputMan's private members,
       as well as call its member functions
       Does this break encapsulation?  not really
       if you consider Game.h is SUPPOSED TO 
       abstract these things to the point Window.h did
       
    :: Another solution is to PRIVATIZE
       inputMan, soundMan and leave the original
       access functions being window->playSound() etc.
       [ This was very annoying because of the huge
         amount of duplication of functions, basically,
         every function that's in any of inputManager,
         SoundManager, needs a duplicate in Window,
         so there's no point... the code is high maintenance,
         and its confusing to have a function implemented somewhere
         only to see its actual implementation is actually
         delegated some place else ]
    
  SpriteManager now manages and caches fonts and text.
  ** DrawText should use id3dxSpriteRenderer, but
  right now it doesn't [[ This hasn't been completed in this branch yet ]]
 
  game->getGPU() was given superglobal access,
  so there's no need to pass around the IDirect3DDirect9 interface
  anymore (idea was to define a single extern'd Game* instance,
  in Game.h, so every file #includes "Game.h"
 
  To address the annoyance of the new access pattern,
  game->inputMan->justPressed( VK_SPACE ) ;
 
  BESIDES DELEGATE PATTERN, COULD ALSO JUST DO:
#define a bunch of macros here, where the
 
#define mouseX game->inputMan->getMouseX()
#define mouseY game->inputMan->getMouseY()
 
  Put these in a SUPERGLOBAL INHERIT FILE,
  which would be nice, because now there's
  an illusion of superglobal variables that
  have this constantly updated value,
  the access pattern is very short then.
  
  :: another interesting pattern would be to exploit
  multiple inerhetance on game and inherit
  from all of Soundman, inputman, ...
 
  * This the route I've decided to go down.
    GameWindow will inherit from ALL of
    InputManager, SoundManager, and SpriteManager.
    
    The code should be separated for separation of
    concerns reasons, for maintainability and
    as the functionality expands, Window will get
    clobbered.

  - I ended up choosing multiple inheritance.
    It provides a clean separation of concerns
    and doesn't include that pesky delegate pattern.
    
  - One negative side-effect of the inheritance
    is I had to write functions soundStep() and
    soundPause().. instead of just a "pause" function
    With composition it would have looked nicer
    from this perspective, but that's ok, because
    we DID eliminate the delegate pattern and extra 
    pass-thru calls there.  The main reason I
    don't like pass-thrus is because it tends to
    give these illusions in the code base about WHERE
    THINGS HAPPEN.

+ Mar 18 / 2010 v0.1.0-XInput
  * Working in XInput for XBox 360 controller control.
  - The minor version increment is for separation of
    concerns being done.
  
+ Mar 18 / 2010 v0.1.1-gdw-week-9
  - renamed all "id" in drawSprite to "spriteId"
  - doxygenated InputMan.h
    http://www.doxygen.nl/docblocks.html
  - The sentinel value SPRITE_READ_FROM_FILE
    was changed from -1 to -5925499.
    You couldn't scale a sprite to -1 pixel
    when it was -1, but nobody will ever
    want to scale a sprite to -5925499 pixels

+ Mar 20 / 2010 v0.1.2-callbacks
  - addition of a simple timer/callback mechanism.
    - uses boost 1.42
      - at what level should callbacks be provided?
      - as a principal MOST of what eternity provides
        that draws or plays a sound or.. "seems to" come
        out of the WINDOW is added as a member function
        to WindowClass, D3DWindow, or GameWindow
        
      - But callback functionality.. needs to be
        part of GameWindow because it needs
        direct access to GameWindow::Timer.
        
        * Callbacks were implemented inside
          the GameWindow object.
      
    - added GameWindow::drawTimer() to draw current game_time
    
    - added Gamepad::isPresent() to check if gamepad
      connected or not
      
    - created and added gdw-week-10-xbox-controller-callbacks
      example
      
    - added round() to helperFunctions.h
    
    - added InputMan::anyKeyPushed()
      to see if any key was pushed at keyboard or any
      of the gamepads
    
    - notice compilation time increased quite a bit
      with introduction of templates
      http://xkcd.com/303/.
      - Consider using PCH to reduce compilation time
    
  - plenty of updates to the pacman project

+ Mar 27 / 2010 v0.1.3-pacman
  - Updates to Pacman

+ Mar 29 / 2010 v0.1.3-pacman
  - Created gdw-week-11-pathfinding example project
  - Brought in Perlin noise from http://local.wasp.uwa.edu.au/~pbourke/texture_colour/perlin/
    for smooth random map generation
  - Updates to Pacman

+ Apr 16 / 2010 v0.1.4-3d-caps
  - Added in project3D() function, rewired default
    projection through project2D() function.
    
  + 2D line drawing caps thru
    SpriteMan::drawLine( start, end, color, thickness )
    
    These are 2d lines ONLY, not 3d lines (can't go
    "into the screen", you'd have to use polygon
    geometry for that).
  
  - Engine can draw in 3d now

+ Apr 17 / 2010 v0.1.5-3d-camera
  - adding a 3d player controlled camera for fly/space
    and walk motion
  
  - Added dx, dy vars to Mouse object, so it knows
    change in mouseX and mouseY since last frame
    
  - FIXED a long running (undetected!) bug where you
    could not check (would miss information about)
    if the mouse had been pressed or not in the DRAW
    function.  Practically you really shouldn't check
    logic in the draw function but you could want to
    only draw something if a mouse button is down,
    conceivably.. anyway it was a bug and it has been
    fixed (with dx, dy addition)
  
+ Apr 19 / 2010 v0.1.6-obj-loading
  - OBJ file format parse, load and render
  - More fixes to the camera (double-message problem
    with mouse clicks fixed, related to the "FIXED"
    long running bug referred to on April 17th patch)
    
  - OBJ file parser notes:
    * At one point I'm using C-style strings, and
      creating a map<char*, Group> to store the
      collection of groups, for example.
      - I think this approach has adverse effects
        because its requiring me to be really careful
        about how I insert into the std::map,
        since if I do map.insert( string, GroupObject )
        two negative things can happen:
          - the string is a straight pointer and could 
            go away if not properly copied
          - the GroupObject goes through unnecessary
            amounts of copy construction
          - I'm committing now, and then I'll revise
            this most likely to map<std::string, Group*>
            OR AT LEAST map<char*, Group*>

    * YEAH OOPS!!  you can't even key a map on char*.
      it doesn't overload== or<
      
    "Because map requires a strict weak ordering, a map
     keyed on floating-point numbers can produce
     undefined behavior if any of the keys are NaNs."
  
+ Apr 23 / 2010 v0.1.6-obj-loading
  - OBJ loader has progressed
  - Added functions to change current directory,
    WindowClass.h, cd() and cdPop()
  - Fixed up D3DVertex declarations (just v, vc, vt, vn, vtn)

+ Apr 23 / 2010 v0.1.7-obj-robust
  - Some OBJ files have really bad anomolies, like
    this .OBJ that has v//n format, then v/t/n format.
	The solution is to to allow vertex format to change
	BY GROUP, which just means in the TIE-TOGETHER _AND_
	render code, we have to check the vertex format
	BY GROUP.
  - This will slow down the code __a lot__ vs
    the efficiency we get without having to check this,
	but if its how models are specified, there's nothing
	we can do about it.
  - The other option is to use a WHITE PIXEL texture
    when rendering the seconds of the model that
	have no texture applied to them.
	- This still means we have to check vertex format
	  BY GROUP instead of on a per-model basis.
	- Logically we _should_ have to do this since
	  really in Maya you can texture one surface but
	  not the other.

+ Apr 24 / 2010 v0.1.7-obj-robust
  - Its working now, obj file loading with textures and all
    Its very robust, can handle obj files that mix v/t/n and v//n
	and v/t formats, correctly handles textures etc.
	Just remember to FLIP the texture vertically if
	it was intended for use with OpenGL as it IS inverted
	texture coordinates from OpenGL in D3D.

+ May 1 / 2010 master
  - Some work on the CarSim project only.
  - Added ability to rotate a body
    in any direction using a matrix:
	[  forward    0  ]
	[  right      0  ]
	[  up         0  ]
	[  trans      1  ]
  
+ May 2 / 2010 v0.1.8-carsim
  - started addition of DSP effects from FMOD
  - abandoned effort to quickly add a pitch shift.
    It's not working for some reason
	
  - Brought CarSim DLL exports into CarsimProject
  
+ May 4 / 2010 v0.1.8-carsim
  - got imports working (it was the PARSFILE.. you
    need to REPLACE IMP_STEERSW in the parsfile)
  - finished road render and track find
  - Added hacky- support for rpm sound thru pitch shift
  
+ May 5 / 2010 v0.1.8-carsim
  - Added ability to take screen captures
  - Added ability to draw lines
  - (yesterday) added ability to createQuadVC, VTC
  - Finished autonomous vehicle controller
  - Added 3d sound
  
May 6 / 2010 v0.1.8-carsim
  - Controller tuning

May 7 / 2010 v0.1.8-carsim
  - Button and TextField
  - Changed all `char *` signatures 
    in SpriteMan to `const char *`
    This is a major change but shouldn't
    break anything
    The motivation for this was to allow
    use of STL strings because STL string.c_str()
    always is const char*.
  
June 14 / 2010 v0.1.9-fixes
  - Just coming back to this now.  Found a bug in
    start up to do with deleting an already deleted
	array.. use DESTROY_ARRAY to make the bug easy
	to find (now gives warning with line and file in
	debug mode)
  - Upgraded entire solution to VS 2010.  VS 2010 IS
    in every way superior to VS 2005/2008.  MS did
	release express eds of 2010, so there is really
	no excuse to stick with 2008 at this point.  If
	you are with an educational facility you can get
	a free copy of VS 2010 Pro through the MS sponsorship
	program
  - Fixed reference problems that cropped up after 2010 upgrade.
    In VS 2010, it isn't enough to say "Project_A _depends_ on
    eternity", you have to SET UP A REFERENCE (by right clicking
    Project_A, selecting "References..." and adding a new reference
    to eternity.)
    This may have been the "warning" issue we kept ignoring and
    continually rebuilding until it went away last year.
    Still get PDB missing errors on first build though.
    (Warning	7	warning LNK4099: PDB 'vc100.pdb' was not found with 'callbacks.obj' or at 'D:\CPP\eternity\Build\vc100.pdb'; 
      linking object as if no debug info)

  - Renamed projects gdw-week-* to example-*
  - Merely THOUGHT about completing Asteriod..
  
  - Upgraded clean.bat to match VS 2010
  - Added a .gitignore file to exclude the
    sdf and new (HUGE) ipch directory


  
  
  - TODO:
    - DOXYGEN-ATE all files
    - Fix the ORDER of the functions listed in
      WindowClass.h with the .cpp file
    - thought about adding feature to cancel
      a callback.  maybe later.
    - pch
    - Its currently not easily possible to set up different
      rates of animation / frames for different GameObjects
      that use the same Sprite*..
      - It should be possible through the engine
        to "clone" a Sprite* object without necessarily
        cloning the underlying texture for efficiency
    - BOOST can be removed from the /eternity folder,
      since its installation is required anyways
    - message queue wiht messages that go away
      after 5 seconds or so
    - FMOD DSP EFFECT WRAPPERS
    - particle engine
    - physics from havok:  PhysicsMan
    - networking:  NetworkMan
        NetworkMan.addPlaymate( ipaddress, port ) ;
        NetworkMan.broadcastToAllPlaymates( packet ) ;
    - add ability for fmod feature detection
    - fix the powerof2 textures thing
    - add bounding boxes?
    - what does eternity do?
      #include <eternity/eternity.h> // EVERYTHING
      
      
      #include <eternity/window.h>   // must have
      #include <eternity/aabb.h>     // bounding boxes
      #include <eternity/SpriteMan.h> 
      #include <eternity/SoundMan.h> 
      
      #define ETERNITY_SPRITES
      #define ETERNITY_SOUNDS
      #define ETERNITY_AABB
      #define ETERNITY_3D
      #define ETERNITY...
      
      then
      #include <eternity.h>
      
      
      
      
      
    

eternity's People

Contributors

mo-e avatar

Watchers

James Cloos avatar M Rasyid Aqmar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.