Module CS/plugins/video/renderer/software/i386/

back to main page

Summary Period: 1999-05-06 to 2003-03-01

Modules

[root]/CS/plugins/video/renderer/software/i386

Lines Of Code


Total Lines Of Code: 3741 (2003-07-11 20:29)

Authors

Author Changes Lines of code Lines per change
Totals 113 (100.0%) 5416 (100.0%) 47.9
jorrit 24 (21.2%) 2660 (49.1%) 110.8
andy 26 (23.0%) 1810 (33.4%) 69.6
bdavis 7 (6.2%) 532 (9.8%) 76.0
andyz 44 (38.9%) 350 (6.5%) 7.9
iplayfast 1 (0.9%) 19 (0.4%) 19.0
tomriemer 2 (1.8%) 11 (0.2%) 5.5
sunshine 2 (1.8%) 11 (0.2%) 5.5
ab031ns 3 (2.7%) 9 (0.2%) 3.0
wouter 1 (0.9%) 8 (0.1%) 8.0
res2002 1 (0.9%) 4 (0.1%) 4.0
norman 2 (1.8%) 2 (0.0%) 1.0

Most Recent Commits

res2002 2003-03-01 04:17

- fixed my latest fix: I changed struct csScanSetup in scan.h
but not scan.ash, causing funky colors and crashes for those using
the asm scanline drawing routines.

4 lines of code changed in:

ab031ns 2002-12-23 22:27

Renamed/corrected header defines to CS coding-style.

9 lines of code changed in:

jorrit 2002-10-19 07:40

After my changes yesterday the NASM version of the software
renderer was totally broken. After long debugging I found
out why. Seems that in scan.ash there is a mirror of
the scan.h include file but for assembly. I removed several
fields in scan.h but I forgot to remove them in scan.ash
with the result that the two structures didn't match.

0 lines of code changed in:

jorrit 2002-10-18 13:15

Completely removed 8-bit support from the software renderer.
If people want it back we can always make 8-bit emulation mode
(by rendering internally to 16-bit and then transforming to
8-bit in Print()).

0 lines of code changed in:

jorrit 2002-01-18 11:47

Slight code cleanup: removed all trailing spaces and tabs from
all lines in all source and make files throughout the entire project.
Note that this will most likely not result in a significant
FPS increase :-)

9 lines of code changed in:

norman 2001-12-16 18:24

added SSE detection bit, wonder what i'm up to :=)

1 lines of code changed in:

norman 2001-08-21 22:42

corrected comment, these are for 32 bit, not 16 bit

1 lines of code changed in:

wouter 2001-02-26 09:40

Trial at removing the blending tables bug.

Added BlendingTableProc to csScan struct.
csScan_CalcBlendTables takes a table to fill as argument.
added GetMainTextureManager and GetProcTextureManager routines
in ScanSetup it chooses which blending tables to fill.
In StartPolygonFX it chooses which blending tables to use.

8 lines of code changed in:

andyz 2000-12-19 10:13

-*- Fixed a error in inifile.cpp. The array allocated with new[] was
realloc()'ated. Now it is new/memcpy/delete'd.

-*- Fixed a minor memory leak in system driver. Event cords weren't deleted
at shutdown.

-*- Fixed a bad error in inifile.cpp triggered by [Macintosh] section in
vfs.cfg: the loader switches to base64 mode due to empty assignments like:

HOME =

(such lines are used to denote base64 keys) and then doesn't switch back
when it detects invalid base64 symbols. I changed the ini loader so that
it switches to base64 mode by '==' statement, e.g.:

HOME ==
ODAwMDAwMDAgd2hpbGUKICAgIHNoYXJlZCBs
aWJyYXJpZXMgdXN1YWxseSBoYXZlIGFkZHJl
c3NlcyBsaWtlIDB4NHh4eHh4eHgpLgo=
===
;/HOME

If you want to assign the '=' value to a key, insert a space, e.g:

HOME = =

is interpreted as a normal key, not the head of a base64 stream.
csIniFile::Save() inserts spaces automatically, thus a saved ini file
should read perfectly. Also if something other than newline follows the
second equal sign, it is also interpreted as a normal key.

-*- Fixed a few memory leaks in MazeD.

-*- Finished material manager dialog. Now it is functional, use Ctrl+m to
invoke it, model manager has moved to Ctrl+M. Fixed several bugs that
leads to MazeD crashes related to materials.

-*- Fixed a bad bug in common texture manager object (txtmgr.cpp): the
constructor did no CONSTRUCT_IBASE.

-*- I have enhanced the memory debugger so that on Linux and OS/2 it is able
to debug malloc/realloc/free's as well as new's and delete's. There is a
drawback on Linux though: it will intercept all malloc/free's from all
dynamic libraries (even from libX11.so) thus you will see a lot of memory
leaks belonging to other libraries (notably libc and libX11). You can
filter them by address (in Linux program address is > 0x80000000 while
shared libraries usually have addresses like 0x4xxxxxxx). If you want
to debug memory leaks in plug-ins, build executable in static link mode.

-*- Fixed a memory leak in csfont plug-in.

-*- By the way, Crystal Space currently consists of about 350.000 lines
of code :-)

-*- Rearrangement of some aspects of the texture manager to simplify interface
API for textures and materials. Previously you had to call texture manager's
RegisterXXX (where XXX is Texture or Material) then you had to call
PrepareXXX to force texture manager recompute the internal representation
of the texture/material; when you are done you had to call UnregisterXXX.
Now it works a little different: by calling RegisterXXX you create a new
texture/material handle, and further you work only with that handle:
call handle->Prepare() to prepare texture or material for usage; call
handle->DecRef() enough times to destroy the handle (you don't have to
call UnregisterXXX anymore).

I have fixed all the 3D renderers for this, however I'm not sure about
Direct3D and Glide renderers (haven't compiled them). All others are
fully functional.

You can still call PrepareTextures() and PrepareMaterials() on texture
manager object to call Prepare on all objects at once.

-*- Renamed csTextureMMSoftware into csSoftwareTextureHandle and csTextureMM
into csTextureHandle for cleaner names.

-*- Before closing the system (System::Close) the engine will free all texture
and material handles since after closing the graphics driver the handles
become invalid no matter whenever we did IncRef or not.

-*- Implemented alpha textures support for DrawPolygon, DrawPFX and DrawPixmap
in OpenGL renderer.

-*- Re-worked OpenGL texture cache. Texture unloading happens now in a
centralized routine, which minimizes the effort required to fix any
bugs in it (one of which was causing SIGSEGV on exit).

12 lines of code changed in:

andyz 2000-11-27 08:42

-*- Removed all inline assembly code (GAS and MSVC): both were broken
(GAS because of gcc 2.95.2 and MSVC because it was unmaintained).
The only working assembly code now is NASM code. We should think of
a way to make NASM assembly available to MSVC users.

-*- Removed outdated drline.h file (which wasn't used anyway). Line drawing
should be very accurate; I doubt this assembly routine is as accurate
as the C version is (and I'm not sure it is faster).

-*- Removed outdated m68k assembly code; I doubt it was in a working state.

-*- VERY nice hack borrowed from FreeType OS/2-specific source code: now all
OS/2 executables are compiled as console executable (rather than GUI
executables); the canvases that need GUI (such as csdive or OpenGL) will
call System->SystemExtension ("StartGUI") and the executable will be
re-qualified (at runtime!) as a GUI executable. This is simply VERY VERY
nice for debugging since it allows to use normal console for debugging now
(like in X11). Also it allows for autodetection of canvas - if the program
is launched in full screen, the MGL driver is used; if it is launched
from a GUI console, the GUI canvas is used. Also this means that ASCIIART
canvas (and any other non-GUI canvas) can be used without any bother.

-*- Fixed a bug in freetype font server that caused sometimes characters
to be displayed out of character cell (shifted vertically too much).
It was caused by the incorrect (I believe) usage of the OS/2 TTF header.

-*- Rewrote from scratch the ttf2fnt converter. Now it is called csfgen,
it doesn't use the engine and unneeded plugins (it uses only VFS and
freetype plugins), uses normal command line interface (and getopt()).

-*- I have changed the format of .csf files (which are binary bitmap fonts),
so that they are easier to parse. Also I have changed the format of binary
fonts so that they are a lot smaller, esp. for proportional fonts - every
character is stored separately rather than using a fixed NxM grid. This is
also used for C++ format fonts. Also added ability to use a subset of the
entire character set; for example you can create fonts which contains
only characters 32-127, if you need only basic Latin character set.

-*- Further progress of Material Manager dialog in MazeD.

6 lines of code changed in:

andyz 2000-08-28 11:09

-*- Fixed unlighted textures in 32 bit videomodes.

-*- Fixed halo drawing in 32-bit modes. Halos with R > 1 used to overflow
because the highest of the 32 bits is used for sign. Now halos are limited
to R [0..2] G [0..2] B [0..2].

-*- Changed HALO() keyword a bit; the old syntax is supported for backward
compatibility still. The new syntax is:

HALO (halo_type, ...)

The arguments after halo_type depends of the halo type. Currently there
are two types of halo supported:

CROSS, the old halo type. Two arguments are expected: halo intensity
(float) and "cross-factor" (float).

NOVA, a new halo type (stolen from GIMP). Three arguments are expected:
initial random seed (integer), number of spokes (integer) and roundness
(float).

Nova halo looks best if used with bright whitish lights (e.g. R||G||B > 1).
Example: LIGHT (CENTER (xx,xx,xx) RADIUS (xx) COLOR (1,1.2,1.4) HALO (NOVA))

-*- Changed a bit the loader: added the FindMaterial(char*) routine which
tries to find a material with given name; if not found it tries to find
a texture with this name; if it is found a material is created from it.
This way it is compatible with old worlds, and with new worlds as well.

-*- Changed the loader so that polygons with portals and with alpha == 0
(e.g. absolutely transparent) will get the POLYTXT_NONE shading type.
If you are going to change the alpha value later (e.g. to make a portal
dynamically appear/disappear) you should call poly->SetTextureType ()
manually. This conserves quite a bit of memory which is normally not used.
For example, with flarge.zip this reduces the size of lightmaps from
415K to 312K.

3 lines of code changed in:

andyz 2000-08-24 12:12

- Documented the -fs/-nofs switch in help (fullscreen toggle).
- Fixed the 32-bit unlighted texture drawing bug (long-standing)

20 lines of code changed in:

andyz 2000-08-04 15:05

-*- 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
event queue.

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
reader :-)

-*- 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
driver.

-*- 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
something like:

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:

- DOS/DJGPP

Converted but not tested:

- MacOS
- Win32
- BeOS

Not converted (Objective C :-():

- NeXT

-*- 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
for this.

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
this yourself.

-*- 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);
G3D->DrawPolygonFX (...)

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
at all.

-*- 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
information.

-*- 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:

blocks
cswstest
demonets (at least compiles)
dnapp (same)
dtsimple
makedep (:-)
map2cs
mazed
mdl2spr (I hope)
metademo
ndrvdemo (compiles)
nstp (not tested, but I believe)
perftest (same)
phyztest (same)
pysimp (hell knows)
scfreg
simple
squawk
walktest (hah)

Still broken:

cctest
shooter and libs/csgame
wscs3d

11 lines of code changed in:

andyz 2000-07-03 12:42

-*- Renamed everywhere the term "transparent" to the correct term "keycolor".
It was a misunderstanding because the term "transparent" is related to
both alpha transparency and key color. Now "transparent" is used only
where alpha transparency is involved.

-*- Changed naming convention of csScan_X_draw_scanline_xxx routines. I tried
to make the names shorter and at the same time add the information of
what the routine actually does into its name.

-*- Added a lot of new scanline routines:

- Textured Gouraud-shaded polygons with key color transparency
- Textured flat-shaded polygons with key color transparency
- Textured flat-shaded polygons with table-driven effects (FX)
- Flat-color flat-shaded polygons with table-driven effects (FX)
- Flat-color Gouraud-shaded polygons with table-driven effects (FX)

The routines were added for all supported modes (8, 15, 16, 32 bits).
Note that not all of them were tested (time for a G3D test app?)
thus some may be buggy. If you find bugs, tell me and I will fix them.

-*- Added support for 15-bits modes to MGL 2D driver.

-*- Fixed 8-bit fog. There was a strange error in there (strange because
it was in its initial state (nobody has changed anything) and still
gcc generated wrong code (unsigned shift instead of signed)). I wonder
how it worked when I initially wrote it.

-*- Implemented alpha-mapped textures support. Preliminary though, several
details about how the Z-buffer is to be filled are unclear for now.
The routines work surprisingly fast, and were implemented for all
supported modes (8, 15, 16, 32 bits).

The following drawing modes support per-pixel alpha-blending:

- DrawPolygon() with Z-fill and Z-use modes.
This means you may use alpha-mapped textures for walls and
things; the engine does not support this too well for now.

- DrawPolygonFX() supports just flat-shaded alpha-mapped textures.
That is, if the texture has an alpha channel, the blending modes
and Gouraud shading flag are ignored for now.

Usage is pretty simple: no changes to world file is required for this.
Simply create a texture with alpha-channel and save it to a format that
supports alpha channel (I have used .PNG). Then use it as a regular
texture; anywhere you use it (walls, things and sprites) it should
work.

166 lines of code changed in:

sunshine 2000-05-07 09:31

Hopefully the last of the updates to account for the move of drivers from
CS/libs to CS/plugins:

cs2d --> video/canvas
cs3d --> video/renderer
csdnddrv --> sound/driver
csdndrdr --> sound/renderer

This update includes source code, makefiles, scripts, and documentation.

11 lines of code changed in:

tomriemer 2000-05-07 01:32

Change paths for include files.

11 lines of code changed in:

iplayfast 2000-04-30 05:29

Changed inline asm code to be Borland Compatible

19 lines of code changed in:

andyz 2000-04-11 11:12

-*- Added CAMERA keyword to the new loader. Not to the old one though
-*- Added named camera positions support in the engine. Now START (...)
is just an alias for CAMERA 'Start' (POSITION (...))

5 lines of code changed in:

andyz 2000-03-17 11:47

-*- Re-implemented bi-linear filtering (enabled by "trilinear" command because
"bilinear" enables some kind of bilinear dithering Denis Dmitriev wrote
which is still somewhat faster than bilinear filtering) for 16-bit modes.
Now both 565 and 555 pixel formats are supported. Also it is way faster
than the old routine Denis wrote (two memory references and 6 multiplies
per pixel vs 16 memory lookups in Denis' code). On my computer the assembly
draw_scanline_map does 23 fps, the "bilinear" code does 18 fps and the
"trilinear" code does 14fps. Still useable (60% of no-filtering code speed).

-*- Implemented draw_scanline_map_zfill with bilinear filtering (565 and 555
modes). Now things are also filtered thus the image looks more consistent.

-*- Removed two lookup tables used by the old bi-linear filtering routine.
Now software renderer eats 128K less memory.

-*- Fully implemented bilinear filtering for 32bpp. I was able to implement it
using same 6 multiplies per pixel, and four memory references. Both zfil
and zuse versions are there.

-*- Fixed a bug in archive.cpp that made walktest crash in some cases (if
data directory is not under CS but under CS/../data).

-*- Fixed a bug in makedep - it used to parse sometimes incorrectly the C++
"//" comment (if comment is empty, i.e. followed by a newline, the
entire next line was skipped).

0 lines of code changed in:

andyz 2000-03-10 09:47

-*- Fixed a bug with ALPHA=50 textures in 32bpp modes. It was there from
the very beginning. It's strange Seth did not complained about it...

-*- Fixed the bug with unlighted textures being sometimes shifted relatively
to lighted versions of same textures. The problem was that IMinU/IMinV
was not taken into account with unlighted textures.

-*- Improved the "CACHE=" statement of soft3d.cfg. Now you can use suffixes
to specify the units in which you measure cache size. Possible suffixes
are "KB", "MB" (for kilo/mega bytes) and "KP", "MP" (for kilo/mega pixels).
There is no way to specify cache size in bytes/pixels (what for?)

-*- Phew! Found and fixed a very strange bug that caused at least on OS/2 the
GUI window to suddenly jump while dragging if using CSWS. This was caused
by the fact that csws calls SetMouseCursor() on each frame, even if cursor
shape has not changed (!).

33 lines of code changed in:

(22 more)


Generated by StatCvs v0.2-dev