Date: Friday August 4, 2000 @ 5:58
Update of /cvsroot/crystal/CS/libs/cssys/general
In directory slayer.i.sourceforge.net:/tmp/cvs-serv24123/cssys/general
-*- Implemented a new low-level event system architecture. Most programs won't
notice any difference in top-level interface, only low-level interaction
has been changed a little.
Events are generated by iEventPlug objects. Any event plug plugs into an
iEventOutlet which is the "front door" into the system driver event queue
for the respective event source. When you register an iEventPlug object
with the system driver, you get a pointer to the respective iEventOutlet.
The QueueXXXEvent() methods are gone from iSystem. Instead, use the
respective methods from iEventOutlet interface. Also there is an default
system outlet (the 'back door' :-) which may be queried through
GetSystemEventOutlet, use it if you don't consider that your plugin
is worth to have a full-fledged connection with the system driver
Note that the new event system allows to write a new generic "record/play"
plugin which will, in record mode, record all events that pass through
the system queue, and on other hand, emit all recorded events back
into the system event queue. Writing one is left as homework for the
-*- New file: include/ievent.h. It defines the interface for any plugin which
desires to generate events into the system event queue. Also it defines
the interface for iEventOutlet objects, which are provided by system
-*- No more SetSystemDefaults routine in system-dependent drivers.
Any settings must be queried from the respective plugins. For example if
some canvas needs the "-shm/-noshm" option it should query it itself
rather than relying on iUnixSystem driver to do it.
Also most system-dependent interfaces (such as iDosSystem, iUnixSystem,
iOS2System) are gone. I believe there is no need anymore in a private
interface, and if you need just one-two additional system-dependent
functions, you can always implement them through the new SystemExtension
method of iSystem.
-*- Cleaned up the iSystem interface. Lots of methods are gone, several new
have been added.
-*- The canvas-dependent command-line options have been moved to respective
canvas drivers. The respective command-line help have been moved there
as well. From now on: if you want to display any plugin-specific help,
you should implement HandleEvent and handle the cscmdCommandLineHelp
broadcast event. Upon reception of such an event you should display
Options for X-Windows 2D graphics driver:
-sdepth=<depth> set simulated depth (8, 15, 16, or 32) (default=none)
-shm/noshm SHM extension (default 'shm')
-[no]sysmouse use/don't use system mouse cursor (default=use)
-*- Note that because all QueueXXXEvent methods are gone from iSystem
interface, some canvas drivers may not build. Here is the list of
canvas drivers that I have fixed, use any of the drivers below
for reference when fixing other canvas plugins.
Fixed and tested:
- CSDIVE canvas.
- X-Windows 2D canvas
- X-Windows Line2D canvas
- OS/2 OpenGL canvas
- MGL 2D canvas
- AsciiArt canvas
Fixed but not tested:
- csalleg (cross-platform Allegro) canvas
- unixglide canvas
- svgalib canvas
- gl/x canvas
- ggi driver
Not fixed at all:
- BeOS drivers
- Mac drivers
Sorry, couldn't understand how they work :-)
Some system drivers also can generate events. The following drivers
were converted and tested to use new event architecture:
Converted but not tested:
Not converted (Objective C :-():
-*- Implemented National Keyboard Support. Every event plug has to provide
two key codes - one is the "raw" keycode (Event.Key.Code) and one is the
"cooked" code (Event.Code.Char). Old programs that use Event.Key.Code will
still work but they will get just low-case characters (e.g. even Shift
and/or Ctrl will be ignored). This also means that hotkeys like "shift+!"
won't work anymore (instead use shift+1). I have fixed autoexec.cfg
National Keyboard Support should already work with most canvas drivers.
I have tested it with X-Windows driver, OS/2 DIVE driver, MGL driver.
If some driver cannot provide the "cooked" keycode (such as the DOS driver)
it should provide "-1" as the character code, and the system driver will
"cook" it itself.
-*- Fixed X-Windows drivers so that they handle correctly the MappingNotify
event. This enables support for languages that need more than one keymap
(e.g. Cyrillic and others, maybe Japanese).
-*- Removed elapsed_time and current_time arguments from NextFrame. Instead,
I have added a new method called GetElapsedTime (time_t&, time_t&) into
the iSystem interface. Call it if you really need the elapsed time.
You can call it any times per frame you need. The time is updated only
at the start of every frame. The NextFrame() method has no arguments now.
-*- Redesigned the main application loop. The Loop method in system driver
is still there, but it is basically just an:
while (!Shutdown) NextFrame();
If your application does not need the loop, feel free to call NextFrame
without arguments at appropiate times.
Fixed all applications in CVS to use the new NextFrame prototype.
However, for applications not in the repository you will have to fix
-*- Added the new -I or --info switch to gfxtest tool. Using this switch you
can easily see the cause of translucent cubes in blocks: the respective
png files (cubef3 and cubef4) have an alpha channel.
-*- Added -a or --strip-alpha switch to same tool. Note that the blocks data
file in repository has NOT been fixed; somebody still have to do it.
-*- Fixed dependency generation with makedep - instead of $(OUT) prefix it
used the expanded value of $(OUT) - thus when switching compilation mode,
it was needed to rebuild dependencies. Not it is not the case anymore.
-*- Added Z-none counterparts to ALL DrawPFX modes. In this mode the Z-buffer
is ignored at all, thus it is the fastest mode. It can be used to display
non-3D graphics with DrawPFX, for example user interface elements and so
on (and even 3D graphics in depth sorted order).
-*- Added Z-none, Z-fill and Z-use modes to per-pixel alpha routines. Now
you can do:
G3D->SetRenderState (G3DRENDERSTATE_ZBUFFERMODE, CS_ZBUF_ZUSE);
The CS_ZBUF_NONE routine has the lesser overhead, of course.
-*- Implemented Z-use and Z-fill modes for alpha-mapped walls (DrawPolygon).
-*- Redesigned the iConsole interface. Basically I have tried to simplify it
as much as possible; having very sophisticated interfaces does not make
easy to write new plugins. Removed the dumb iCursor interface. The cursor
should be provided by the console; if you don't like the cursor, write
your own console. Redesigned the iConsoleInput interface.
-*- Reimplemented cstools/simpcons as a new plugin. cstools library is now
empty; don't know if it is really needed.
-*- Fixed walktest to use the new console plugin. It is not tied anymore to
csSimpleConsole private interface, thus can use any console plugins you
will write in future :-) Also walktest will run now without a console
-*- Fixed a very seldom happening bug in software 3D driver that leads to
crashes due to division overflow.
-*- When the palette changes in 256-color modes, the texture manager will
emmit an broadcast event so that all interested plugins (including
consoles) can intercept it and query the appropiate drivers for new
-*- Fixed the cscon plugin. The "xstdin" plugin has been removed (use the
one in simpcon instead, it has absolutely same functionality), the
"console.output.standard" and "console.output.funky" consoles works.
You can even enable them in walktest application by uncommenting
the respective lines from cryst.cfg.
-*- Fixed an strange bug in software texture manager - in 8-bit modes the
Scan.GlobalCMap was deleted at the end of PrepareTextures() although
it is extensively used while the program is running ...
-*- Fixed an very old bug in DrawPolygonFX() for software 8-bit modes.
DST was incorrectly missed the screen palette table, thus all modes
that involved DST (fixed-value alpha transparency and blending)
did not worked.
-*- Due to above event system redesign, Crystal Space Windowing System has
been redesigned a little as well. The csApp class is now a plugin from
system driver's point of view and receives events absolutely same way
like any other plugin. Thus the look of the simplest CSWS application
has been changed a little. See cswstest for details.
-*- Crystal Space Windowing System does not implement its own system driver
anymore. Instead, the csApp class is an "almost-normal" plugin now,
except that it is created not via SCF (but rather with `new'). Also
CSWS works with the system driver completely through the iSystem
interface; this means CSWS and system driver don't have to be in
the same module anymore.
-*- Fixed MazeD so that it works with the new CSWS architecture. No other
enhancements though :-(
-*- The list of applications that were fixed after my changes:
demonets (at least compiles)
mdl2spr (I hope)
nstp (not tested, but I believe)
pysimp (hell knows)
shooter and libs/csgame