[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus data/ccl/human/ui.ccl data/ccl/orc/ui...
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus data/ccl/human/ui.ccl data/ccl/orc/ui... |
Date: |
Wed, 08 Oct 2003 00:10:50 -0000 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/10/07 20:06:44
Modified files:
data/ccl/human : ui.ccl
data/ccl/orc : ui.ccl
src/clone : ccl_player.c mainloop.c player.c unit_draw.c
src/editor : editloop.c
src/game : game.c intro.c
src/include : player.h ui.h unit.h video.h
src/map : map_fog.c minimap.c
src/ui : ccl_ui.c icons.c mainscr.c menu_proc.c ui.c
src/video : cursor.c font.c linedraw.c sdl.c sprite.c
video.c
Log message:
Changed VideoDraw functions to use a VMemType instead of an offset in
the global palette
Patches:
Index: stratagus/data/ccl/human/ui.ccl
diff -u stratagus/data/ccl/human/ui.ccl:1.39
stratagus/data/ccl/human/ui.ccl:1.40
--- stratagus/data/ccl/human/ui.ccl:1.39 Sat Oct 4 01:26:48 2003
+++ stratagus/data/ccl/human/ui.ccl Tue Oct 7 20:06:40 2003
@@ -26,7 +26,7 @@
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
;;
-;; $Id: ui.ccl,v 1.39 2003/10/04 05:26:48 jsalmon3 Exp $
+;; $Id: ui.ccl,v 1.40 2003/10/08 00:06:40 jsalmon3 Exp $
(define-cursor 'cursor-point 'human
'image "ui/human/cursors/human_gauntlet.png"
@@ -78,7 +78,7 @@
'info-panel (list "graphics/ui/human/infopanel.png" 0 160 176 176)
'completed-bar '(
- color 149
+ color (48 100 4)
pos ( 12 313)
size (152 14)
text "% Complete"
Index: stratagus/data/ccl/orc/ui.ccl
diff -u stratagus/data/ccl/orc/ui.ccl:1.38 stratagus/data/ccl/orc/ui.ccl:1.39
--- stratagus/data/ccl/orc/ui.ccl:1.38 Sat Oct 4 01:26:48 2003
+++ stratagus/data/ccl/orc/ui.ccl Tue Oct 7 20:06:40 2003
@@ -26,7 +26,7 @@
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
;;
-;; $Id: ui.ccl,v 1.38 2003/10/04 05:26:48 jsalmon3 Exp $
+;; $Id: ui.ccl,v 1.39 2003/10/08 00:06:40 jsalmon3 Exp $
(define-cursor 'cursor-point 'orc
'image "ui/orc/cursors/orcish_claw.png"
@@ -78,7 +78,7 @@
'info-panel (list "graphics/ui/orc/infopanel.png" 0 160 176 176)
'completed-bar '(
- color 149
+ color (48 100 4)
pos ( 12 313)
size (152 14)
text "% Complete"
Index: stratagus/src/clone/ccl_player.c
diff -u stratagus/src/clone/ccl_player.c:1.39
stratagus/src/clone/ccl_player.c:1.40
--- stratagus/src/clone/ccl_player.c:1.39 Sun Aug 17 11:57:06 2003
+++ stratagus/src/clone/ccl_player.c Tue Oct 7 20:06:40 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_player.c,v 1.39 2003/08/17 15:57:06 n0body Exp $
+// $Id: ccl_player.c,v 1.40 2003/10/08 00:06:40 jsalmon3 Exp $
//@{
@@ -78,19 +78,19 @@
int i;
char* str;
- i=gh_scm2int(gh_car(list));
- player=&Players[i];
- if( NumPlayers<=i ) {
- NumPlayers=i+1;
+ i = gh_scm2int(gh_car(list));
+ player = &Players[i];
+ if (NumPlayers <= i) {
+ NumPlayers = i + 1;
}
player->Player = i;
- player->Color=PlayerColors[i];
- if( !(player->Units=(Unit**)calloc(UnitMax,sizeof(Unit*))) ) {
+ player->Color = PlayerColors[i];
+ if (!(player->Units = (Unit**)calloc(UnitMax, sizeof(Unit*)))) {
DebugLevel0("Not enough memory to create player %d.\n" _C_ i);
return SCM_UNSPECIFIED;
}
- list=gh_cdr(list);
+ list = gh_cdr(list);
//
// Parse the list: (still everything could be changed!)
Index: stratagus/src/clone/mainloop.c
diff -u stratagus/src/clone/mainloop.c:1.146
stratagus/src/clone/mainloop.c:1.147
--- stratagus/src/clone/mainloop.c:1.146 Tue Oct 7 08:03:39 2003
+++ stratagus/src/clone/mainloop.c Tue Oct 7 20:06:40 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mainloop.c,v 1.146 2003/10/07 12:03:39 martinxyz Exp $
+// $Id: mainloop.c,v 1.147 2003/10/08 00:06:40 jsalmon3 Exp $
//@{
@@ -508,26 +508,26 @@
const Viewport* evp;
// Draw all map viewports
- evp=TheUI.Viewports+TheUI.NumViewports;
- for( vp=TheUI.Viewports; vp<evp; ++vp) {
+ evp = TheUI.Viewports+TheUI.NumViewports;
+ for (vp = TheUI.Viewports; vp < evp; ++vp) {
DrawMapViewport(vp);
}
// if we a single viewport, no need to denote the "selected" one
- if( TheUI.NumViewports==1 ) {
+ if (TheUI.NumViewports == 1) {
return;
}
//
// Separate the viewports and mark the active viewport.
//
- for( vp=TheUI.Viewports; vp<evp; ++vp ) {
- enum _sys_colors_ color;
+ for (vp = TheUI.Viewports; vp < evp; ++vp) {
+ VMemType color;
- if( vp==TheUI.SelectedViewport ) {
- color=ColorOrange;
+ if (vp == TheUI.SelectedViewport) {
+ color = ColorOrange;
} else {
- color=ColorBlack;
+ color = ColorBlack;
}
// -
Index: stratagus/src/clone/player.c
diff -u stratagus/src/clone/player.c:1.92 stratagus/src/clone/player.c:1.93
--- stratagus/src/clone/player.c:1.92 Tue Oct 7 08:03:39 2003
+++ stratagus/src/clone/player.c Tue Oct 7 20:06:41 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: player.c,v 1.92 2003/10/07 12:03:39 martinxyz Exp $
+// $Id: player.c,v 1.93 2003/10/08 00:06:41 jsalmon3 Exp $
//@{
@@ -66,26 +66,8 @@
/**
** Colors used for minimap. FIXME: make this configurable
*/
-global int PlayerColors[PlayerMax] = {
- 208, // red
- 1, // blue
- 216, // green
- 220, // violet
- 224, // orange
- 228, // black
- 255, // white
- 2, // yellow
-
- 208, // red
- 1, // blue
- 216, // green
- 220, // violet
- 224, // orange
- 228, // black
- 255, // white
-
- 251, // yellow
-};
+global VMemType PlayerColorsRGB[PlayerMax];
+global VMemType PlayerColors[PlayerMax];
global char* PlayerColorNames[PlayerMax] = {
"red",
@@ -121,12 +103,12 @@
{
int i;
- for( i=0; i<PlayerRaces.Count; ++i ) {
- if( PlayerRaces.Race[i]==race ) {
+ for (i = 0; i < PlayerRaces.Count; ++i) {
+ if (PlayerRaces.Race[i] == race) {
return i;
}
}
- fprintf(stderr,"Invalid race: %d\n", race);
+ fprintf(stderr, "Invalid race: %d\n", race);
DebugCheck(1);
return PlayerRaceNeutral;
}
@@ -137,12 +119,42 @@
global void InitPlayers(void)
{
int p;
+ // FIXME: remove this
+ struct {
+ int R; int G; int B;
+ } PColors[PlayerMax] = {
+ { 164, 0, 0 },
+ { 0, 148, 252 },
+ { 44, 180, 148 },
+ { 152, 72, 176 },
+ { 248, 140, 20 },
+ { 40, 40, 60 },
+ { 252, 252, 252 },
+ { 252, 208, 0 },
+ { 164, 0, 0 },
+ { 0, 148, 252 },
+ { 44, 180, 148 },
+ { 152, 72, 176 },
+ { 248, 140, 20 },
+ { 40, 40, 60 },
+ { 252, 252, 252 },
+ { 252, 252, 0 },
+ };
- for( p=0; p<PlayerMax; ++p ) {
- Players[p].Player=p;
- if( !Players[p].Type ) {
- Players[p].Type=PlayerNobody;
+ // FIXME: remove this
+ for (p = 0; p < PlayerMax; ++p) {
+ PlayerColorsRGB[p].D24.a = PColors[p].R;
+ PlayerColorsRGB[p].D24.b = PColors[p].G;
+ PlayerColorsRGB[p].D24.c = PColors[p].B;
+ }
+
+ for (p = 0; p < PlayerMax; ++p) {
+ Players[p].Player = p;
+ if (!Players[p].Type) {
+ Players[p].Type = PlayerNobody;
}
+ PlayerColors[p] = VideoMapRGB(PlayerColorsRGB[p].D24.a,
+ PlayerColorsRGB[p].D24.b, PlayerColorsRGB[p].D24.c);
}
}
@@ -153,28 +165,28 @@
{
int p;
- for( p=0; p<PlayerMax; ++p ) {
- if( Players[p].Name ) {
+ for (p = 0; p < PlayerMax; ++p) {
+ if (Players[p].Name) {
free(Players[p].Name);
}
- if( Players[p].Units ) {
+ if (Players[p].Units) {
free(Players[p].Units);
}
}
- ThisPlayer=NULL;
- memset(Players,0,sizeof(Players));
- NumPlayers=0;
+ ThisPlayer = NULL;
+ memset(Players, 0, sizeof(Players));
+ NumPlayers = 0;
//
// Mapping the original race numbers in puds to our internal strings
//
- for( p=0; p<PlayerRaces.Count; ++p ) {
+ for (p = 0; p < PlayerRaces.Count; ++p) {
free(PlayerRaces.Name[p]);
free(PlayerRaces.Display[p]);
}
- PlayerRaces.Count=0;
+ PlayerRaces.Count = 0;
- NoRescueCheck=0;
+ NoRescueCheck = 0;
}
/**
@@ -189,143 +201,145 @@
int i;
int j;
- CLprintf(file,"\n;;; -----------------------------------------\n");
- CLprintf(file,";;; MODULE: players $Id: player.c,v 1.92 2003/10/07
12:03:39 martinxyz Exp $\n\n");
+ CLprintf(file, "\n;;; -----------------------------------------\n");
+ CLprintf(file, ";;; MODULE: players $Id: player.c,v 1.93 2003/10/08
00:06:41 jsalmon3 Exp $\n\n");
//
// Dump table wc2 race numbers -> internal symbol.
//
- if( PlayerRaces.Count ) {
- CLprintf(file,"(define-race-names");
- for( i=0; i<PlayerRaces.Count; ++i ) {
- CLprintf(file,"\n 'race '(");
- CLprintf(file,"\n race %d",PlayerRaces.Race[i]);
- CLprintf(file,"\n name %s",PlayerRaces.Name[i]);
- CLprintf(file,"\n display \"%s\"",PlayerRaces.Display[i]);
- if( PlayerRaces.Visible[i] ) {
- CLprintf(file,"\n visible");
+ if (PlayerRaces.Count) {
+ CLprintf(file, "(define-race-names");
+ for (i = 0; i < PlayerRaces.Count; ++i) {
+ CLprintf(file, "\n 'race '(");
+ CLprintf(file, "\n race %d", PlayerRaces.Race[i]);
+ CLprintf(file, "\n name %s", PlayerRaces.Name[i]);
+ CLprintf(file, "\n display \"%s\"", PlayerRaces.Display[i]);
+ if (PlayerRaces.Visible[i]) {
+ CLprintf(file, "\n visible");
}
- CLprintf(file,")");
+ CLprintf(file, ")");
}
- CLprintf(file,")\n\n");
+ CLprintf(file, ")\n\n");
}
//
// Dump table wc2 race numbers -> internal symbol.
//
- if( PlayerRaces.Count ) {
- CLprintf(file,"(define-race-names");
- for( i=0; i<PlayerRaces.Count; ++i ) {
- CLprintf(file,"\n 'race '(");
- CLprintf(file,"\n race %d",PlayerRaces.Race[i]);
- CLprintf(file,"\n name %s",PlayerRaces.Name[i]);
- CLprintf(file,"\n display \"%s\"",PlayerRaces.Display[i]);
- if( PlayerRaces.Visible[i] ) {
- CLprintf(file,"\n visible");
+ if (PlayerRaces.Count) {
+ CLprintf(file, "(define-race-names");
+ for (i = 0; i < PlayerRaces.Count; ++i) {
+ CLprintf(file, "\n 'race '(");
+ CLprintf(file, "\n race %d", PlayerRaces.Race[i]);
+ CLprintf(file, "\n name %s", PlayerRaces.Name[i]);
+ CLprintf(file, "\n display \"%s\"", PlayerRaces.Display[i]);
+ if (PlayerRaces.Visible[i]) {
+ CLprintf(file, "\n visible");
}
- CLprintf(file,")");
+ CLprintf(file, ")");
}
- CLprintf(file,")\n\n");
+ CLprintf(file, ")\n\n");
}
//
// Dump all players
//
- for( i=0; i<NumPlayers; ++i ) {
- CLprintf(file,"(player %d\n",i);
- CLprintf(file," 'name \"%s\"\n",Players[i].Name);
- CLprintf(file," 'type ");
- switch( Players[i].Type ) {
- case PlayerNeutral: CLprintf(file,"'neutral");
break;
- case PlayerNobody: CLprintf(file,"'nobody"); break;
- case PlayerComputer: CLprintf(file,"'computer"); break;
- case PlayerPerson: CLprintf(file,"'person"); break;
- case PlayerRescuePassive: CLprintf(file,"'rescue-passive"); break;
- case PlayerRescueActive: CLprintf(file,"'rescue-active"); break;
- default: CLprintf(file,"%d",Players[i].Type);
break;
- }
- CLprintf(file," 'race \"%s\"",Players[i].RaceName);
- CLprintf(file," 'ai %d\n",Players[i].AiNum);
- CLprintf(file," 'team %d",Players[i].Team);
-
- CLprintf(file," 'enemy \"");
- for( j=0; j<PlayerMax; ++j ) {
- CLprintf(file,"%c",(Players[i].Enemy&(1<<j)) ? 'X' : '_');
- }
- CLprintf(file,"\" 'allied \"");
- for( j=0; j<PlayerMax; ++j ) {
- CLprintf(file,"%c",(Players[i].Allied&(1<<j)) ? 'X' : '_');
- }
- CLprintf(file,"\" 'shared-vision \"");
- for( j=0; j<PlayerMax; ++j ) {
- CLprintf(file,"%c",(Players[i].SharedVision&(1<<j)) ? 'X' : '_');
+ for (i = 0; i < NumPlayers; ++i) {
+ CLprintf(file, "(player %d\n", i);
+ CLprintf(file, " 'name \"%s\"\n", Players[i].Name);
+ CLprintf(file, " 'type ");
+ switch (Players[i].Type) {
+ case PlayerNeutral: CLprintf(file, "'neutral"); break;
+ case PlayerNobody: CLprintf(file, "'nobody"); break;
+ case PlayerComputer: CLprintf(file, "'computer"); break;
+ case PlayerPerson: CLprintf(file, "'person"); break;
+ case PlayerRescuePassive: CLprintf(file, "'rescue-passive");break;
+ case PlayerRescueActive: CLprintf(file, "'rescue-active"); break;
+ default: CLprintf(file, "%d",Players[i].Type);
break;
+ }
+ CLprintf(file, " 'race \"%s\"", Players[i].RaceName);
+ CLprintf(file, " 'ai %d\n", Players[i].AiNum);
+ CLprintf(file, " 'team %d", Players[i].Team);
+
+ CLprintf(file, " 'enemy \"");
+ for (j = 0; j < PlayerMax; ++j) {
+ CLprintf(file, "%c",(Players[i].Enemy&(1<<j)) ? 'X' : '_');
+ }
+ CLprintf(file, "\" 'allied \"");
+ for (j = 0; j < PlayerMax; ++j) {
+ CLprintf(file, "%c", (Players[i].Allied & (1 << j)) ? 'X' : '_');
+ }
+ CLprintf(file, "\" 'shared-vision \"");
+ for (j = 0; j < PlayerMax; ++j) {
+ CLprintf(file, "%c", (Players[i].SharedVision & (1 << j)) ? 'X' :
'_');
}
- CLprintf(file,"\"\n 'start '(%d %d)\n",Players[i].StartX,
- Players[i].StartY);
+ CLprintf(file, "\"\n 'start '(%d %d)\n", Players[i].StartX,
+ Players[i].StartY);
// Resources
- CLprintf(file," 'resources '(");
- for( j=0; j<MaxCosts; ++j ) {
- if( j ) {
- if( j==MaxCosts/2 ) {
- CLprintf(file,"\n ");
+ CLprintf(file, " 'resources '(");
+ for (j = 0; j < MaxCosts; ++j) {
+ if (j) {
+ if (j == MaxCosts / 2) {
+ CLprintf(file, "\n ");
} else {
- CLprintf(file," ");
+ CLprintf(file, " ");
}
}
- CLprintf(file,"%s
%d",DefaultResourceNames[j],Players[i].Resources[j]);
+ CLprintf(file, "%s %d", DefaultResourceNames[j],
+ Players[i].Resources[j]);
}
// Incomes
- CLprintf(file,")\n 'incomes '(");
- for( j=0; j<MaxCosts; ++j ) {
- if( j ) {
- if( j==MaxCosts/2 ) {
- CLprintf(file,"\n ");
+ CLprintf(file, ")\n 'incomes '(");
+ for (j = 0; j < MaxCosts; ++j) {
+ if (j) {
+ if (j == MaxCosts / 2) {
+ CLprintf(file, "\n ");
} else {
- CLprintf(file," ");
+ CLprintf(file, " ");
}
}
- CLprintf(file,"%s
%d",DefaultResourceNames[j],Players[i].Incomes[j]);
+ CLprintf(file, "%s %d", DefaultResourceNames[j],
+ Players[i].Incomes[j]);
}
- CLprintf(file,";;FIXME: new members must be saved\n");
+ CLprintf(file, ";;FIXME: new members must be saved\n");
// UnitTypesCount done by load units.
- CLprintf(file,")\n '%s\n",Players[i].AiEnabled ?
- "ai-enabled" : "ai-disabled");
+ CLprintf(file, ")\n '%s\n",Players[i].AiEnabled ?
+ "ai-enabled" : "ai-disabled");
// Ai done by load ais.
CLprintf (file, " 'food %d", Players[i].Food);
- CLprintf(file," 'food-unit-limit %d",Players[i].FoodUnitLimit);
- CLprintf(file," 'building-limit %d",Players[i].BuildingLimit);
- CLprintf(file," 'total-unit-limit %d",Players[i].TotalUnitLimit);
-
- CLprintf(file,"\n 'score %d",Players[i].Score);
- CLprintf(file,"\n 'total-units %d",Players[i].TotalUnits);
- CLprintf(file,"\n 'total-buildings %d",Players[i].TotalBuildings);
- CLprintf(file,"\n 'total-razings %d",Players[i].TotalRazings);
- CLprintf(file,"\n 'total-kills %d",Players[i].TotalKills);
- CLprintf(file,"\n 'total-resources '(");
- for( j=0; j<MaxCosts; ++j ) {
- CLprintf(file,"%d ",Players[i].TotalResources[j]);
+ CLprintf(file, " 'food-unit-limit %d", Players[i].FoodUnitLimit);
+ CLprintf(file, " 'building-limit %d", Players[i].BuildingLimit);
+ CLprintf(file, " 'total-unit-limit %d", Players[i].TotalUnitLimit);
+
+ CLprintf(file, "\n 'score %d", Players[i].Score);
+ CLprintf(file, "\n 'total-units %d", Players[i].TotalUnits);
+ CLprintf(file, "\n 'total-buildings %d", Players[i].TotalBuildings);
+ CLprintf(file, "\n 'total-razings %d", Players[i].TotalRazings);
+ CLprintf(file, "\n 'total-kills %d", Players[i].TotalKills);
+ CLprintf(file, "\n 'total-resources '(");
+ for (j = 0; j < MaxCosts; ++j) {
+ CLprintf(file, "%d ", Players[i].TotalResources[j]);
}
- CLprintf(file,")");
+ CLprintf(file, ")");
// Colors done by init code.
// Allow saved by allow.
- CLprintf(file,"\n 'timers '(");
- for( j=0; j<UpgradeMax; ++j ) {
- if( j ) {
- CLprintf(file," ");
+ CLprintf(file, "\n 'timers '(");
+ for (j = 0; j < UpgradeMax; ++j) {
+ if (j) {
+ CLprintf(file, " ");
}
- CLprintf(file,"%d",Players[i].UpgradeTimers.Upgrades[j]);
+ CLprintf(file, "%d",Players[i].UpgradeTimers.Upgrades[j]);
}
- CLprintf(file,")");
+ CLprintf(file, ")");
- CLprintf(file,")\n\n");
+ CLprintf(file, ")\n\n");
}
DebugLevel0Fn("FIXME: must unit-stats?\n");
@@ -333,7 +347,7 @@
//
// Dump local variables
//
- CLprintf(file,"(set-this-player! %d)\n\n",ThisPlayer->Player);
+ CLprintf(file, "(set-this-player! %d)\n\n", ThisPlayer->Player);
}
/**
@@ -349,17 +363,17 @@
DebugLevel3("Player %d, type %d\n" _C_ NumPlayers _C_ type);
- if( NumPlayers==PlayerMax ) { // already done for bigmaps!
+ if (NumPlayers == PlayerMax) { // already done for bigmaps!
return;
}
- player=&Players[NumPlayers];
- player->Player=NumPlayers;
+ player = &Players[NumPlayers];
+ player->Player = NumPlayers;
// Allocate memory for the "list" of this player's units.
// FIXME: brutal way, as we won't need UnitMax for this player...
// FIXME: ARI: is this needed for 'PlayerNobody' ??
// FIXME: A: Johns: currently we need no init for the nobody player.
- if( !(player->Units=(Unit**)calloc(UnitMax,sizeof(Unit*))) ) {
+ if (!(player->Units = (Unit**)calloc(UnitMax, sizeof(Unit*)))) {
DebugLevel0("Not enough memory to create player %d.\n" _C_ NumPlayers);
return;
}
@@ -368,23 +382,23 @@
// Take first slot for person on this computer,
// fill other with computer players.
//
- if( type==PlayerPerson && !NetPlayers ) {
- if( !ThisPlayer ) {
- ThisPlayer=player;
+ if (type == PlayerPerson && !NetPlayers) {
+ if (!ThisPlayer) {
+ ThisPlayer = player;
} else {
- type=PlayerComputer;
+ type = PlayerComputer;
}
}
- if( NetPlayers && NumPlayers==NetLocalPlayerNumber ) {
- ThisPlayer=&Players[NetLocalPlayerNumber];
+ if (NetPlayers && NumPlayers == NetLocalPlayerNumber) {
+ ThisPlayer = &Players[NetLocalPlayerNumber];
}
- if( NumPlayers==PlayerMax ) {
+ if (NumPlayers == PlayerMax) {
static int already_warned;
- if( !already_warned ) {
+ if (!already_warned) {
DebugLevel0("Too many players\n");
- already_warned=1;
+ already_warned = 1;
}
return;
}
@@ -393,26 +407,26 @@
// Make simple teams:
// All person players are enemies.
//
- switch( type ) {
+ switch (type) {
case PlayerNeutral:
case PlayerNobody:
default:
- team=0;
- player->Name=strdup("Neutral");
+ team = 0;
+ player->Name = strdup("Neutral");
break;
case PlayerComputer:
- team=1;
- player->Name=strdup("Computer");
+ team = 1;
+ player->Name = strdup("Computer");
break;
case PlayerPerson:
- team=2+NumPlayers;
- player->Name=strdup("Person");
+ team = 2 + NumPlayers;
+ player->Name = strdup("Person");
break;
case PlayerRescuePassive:
case PlayerRescueActive:
// FIXME: correct for multiplayer games?
- player->Name=strdup("Computer");
- team=2+NumPlayers;
+ player->Name = strdup("Computer");
+ team = 2 + NumPlayers;
break;
}
@@ -427,50 +441,50 @@
//
// Calculate enemy/allied mask.
//
- for( i=0; i<NumPlayers; ++i ) {
- switch( type ) {
+ for (i = 0; i < NumPlayers; ++i) {
+ switch (type) {
case PlayerNeutral:
case PlayerNobody:
default:
break;
case PlayerComputer:
// Computer allied with computer and enemy of all persons.
- if( Players[i].Type==PlayerComputer ) {
- player->Allied|=(1<<i);
- Players[i].Allied|=(1<<NumPlayers);
- } else if( Players[i].Type==PlayerPerson
- || Players[i].Type==PlayerRescueActive ) {
- player->Enemy|=(1<<i);
- Players[i].Enemy|=(1<<NumPlayers);
+ if (Players[i].Type == PlayerComputer) {
+ player->Allied |= (1 << i);
+ Players[i].Allied |= (1 << NumPlayers);
+ } else if (Players[i].Type == PlayerPerson ||
+ Players[i].Type == PlayerRescueActive) {
+ player->Enemy |= (1 << i);
+ Players[i].Enemy |= (1 << NumPlayers);
}
break;
case PlayerPerson:
// Humans are enemy of all?
- if( Players[i].Type==PlayerComputer
- || Players[i].Type==PlayerPerson ) {
- player->Enemy|=(1<<i);
- Players[i].Enemy|=(1<<NumPlayers);
- } else if( Players[i].Type==PlayerRescueActive
- || Players[i].Type==PlayerRescuePassive ) {
- player->Allied|=(1<<i);
- Players[i].Allied|=(1<<NumPlayers);
+ if (Players[i].Type == PlayerComputer ||
+ Players[i].Type == PlayerPerson) {
+ player->Enemy |= (1 << i);
+ Players[i].Enemy |= (1 << NumPlayers);
+ } else if (Players[i].Type == PlayerRescueActive ||
+ Players[i].Type == PlayerRescuePassive) {
+ player->Allied |= (1 << i);
+ Players[i].Allied |= (1 << NumPlayers);
}
break;
case PlayerRescuePassive:
// Rescue passive are allied with persons
- if( Players[i].Type==PlayerPerson ) {
- player->Allied|=(1<<i);
- Players[i].Allied|=(1<<NumPlayers);
+ if (Players[i].Type == PlayerPerson) {
+ player->Allied |= (1 << i);
+ Players[i].Allied |= (1 << NumPlayers);
}
break;
case PlayerRescueActive:
// Rescue active are allied with persons and enemies of computer
- if( Players[i].Type==PlayerComputer ) {
- player->Enemy|=(1<<i);
- Players[i].Enemy|=(1<<NumPlayers);
- } else if( Players[i].Type==PlayerPerson ) {
- player->Allied|=(1<<i);
- Players[i].Allied|=(1<<NumPlayers);
+ if (Players[i].Type == PlayerComputer) {
+ player->Enemy |= (1 << i);
+ Players[i].Enemy |= (1 << NumPlayers);
+ } else if (Players[i].Type == PlayerPerson) {
+ player->Allied |= (1 << i);
+ Players[i].Allied |= (1 << NumPlayers);
}
break;
}
@@ -479,37 +493,37 @@
//
// Initial default resources.
//
- for( i=0; i<MaxCosts; ++i ) {
- player->Resources[i]=DefaultResources[i];
+ for (i = 0; i < MaxCosts; ++i) {
+ player->Resources[i] = DefaultResources[i];
}
//
// Initial default incomes.
//
- for( i=0; i<MaxCosts; ++i ) {
- player->Incomes[i]=DefaultIncomes[i];
+ for (i = 0; i < MaxCosts; ++i) {
+ player->Incomes[i] = DefaultIncomes[i];
}
/*
- for( i=0; i<UnitTypeMax/32; ++i ) {
- player->UnitFlags[i]=0;
+ for (i = 0; i < UnitTypeMax / 32; ++i) {
+ player->UnitFlags[i] = 0;
}
*/
- memset( &(player->UnitTypesCount), 0, sizeof(player->UnitTypesCount));
+ memset(&(player->UnitTypesCount), 0, sizeof(player->UnitTypesCount));
- player->Food=0;
- player->NumFoodUnits=0;
- player->NumBuildings=0;
- player->TotalNumUnits=0;
- player->Score=0;
-
- player->Color=PlayerColors[NumPlayers];
-
- if( Players[NumPlayers].Type==PlayerComputer
- || Players[NumPlayers].Type==PlayerRescueActive) {
- player->AiEnabled=1;
+ player->Food = 0;
+ player->NumFoodUnits = 0;
+ player->NumBuildings = 0;
+ player->TotalNumUnits = 0;
+ player->Score = 0;
+
+ player->Color = PlayerColors[NumPlayers];
+
+ if (Players[NumPlayers].Type == PlayerComputer ||
+ Players[NumPlayers].Type == PlayerRescueActive) {
+ player->AiEnabled = 1;
} else {
- player->AiEnabled=0;
+ player->AiEnabled = 0;
}
++NumPlayers;
@@ -521,13 +535,13 @@
** @param player Pointer to player.
** @param side New side (Race).
*/
-global void PlayerSetSide(Player* player,int side)
+global void PlayerSetSide(Player* player, int side)
{
- DebugCheck(side<0 || side>=PlayerRaces.Count);
+ DebugCheck(side < 0 || side >= PlayerRaces.Count);
DebugCheck(!PlayerRaces.Name[side]);
- player->Race=side;
- player->RaceName=PlayerRaces.Name[side];
+ player->Race = side;
+ player->RaceName = PlayerRaces.Name[side];
}
/**
@@ -536,12 +550,12 @@
** @param player Pointer to player.
** @param name New name.
*/
-global void PlayerSetName(Player* player,const char *name)
+global void PlayerSetName(Player* player, const char *name)
{
- if( player->Name ) {
+ if (player->Name) {
free(player->Name);
}
- player->Name=strdup(name);
+ player->Name = strdup(name);
}
/**
@@ -550,9 +564,9 @@
** @param player Pointer to player.
** @param ai AI type.
*/
-global void PlayerSetAiNum(Player* player,int ai)
+global void PlayerSetAiNum(Player* player, int ai)
{
- player->AiNum=ai;
+ player->AiNum = ai;
}
/*----------------------------------------------------------------------------
@@ -566,12 +580,12 @@
** @param resource Resource to change.
** @param value How many of this resource.
*/
-global void PlayerSetResource(Player* player,int resource,int value)
+global void PlayerSetResource(Player* player, int resource, int value)
{
- player->Resources[resource]=value;
+ player->Resources[resource] = value;
- if( player==ThisPlayer ) {
- MustRedraw|=RedrawResources;
+ if (player == ThisPlayer) {
+ MustRedraw |= RedrawResources;
}
}
@@ -585,23 +599,23 @@
**
** @note The return values of the PlayerCheck functions are inconsistent.
*/
-global int PlayerCheckLimits(const Player* player,const UnitType* type)
+global int PlayerCheckLimits(const Player* player, const UnitType* type)
{
// FIXME: currently all units costs 1 unit slot.
//
// Check game limits.
//
- if( NumUnits<UnitMax ) {
- if( (type->Building ? player->NumBuildings<player->BuildingLimit
- : player->NumFoodUnits+type->Demand<=player->FoodUnitLimit)
- && player->TotalNumUnits<player->TotalUnitLimit ) {
+ if (NumUnits < UnitMax) {
+ if ((type->Building ? player->NumBuildings < player->BuildingLimit :
+ player->NumFoodUnits + type->Demand <= player->FoodUnitLimit) &&
+ player->TotalNumUnits < player->TotalUnitLimit) {
return 1;
}
}
- NotifyPlayer(player,NotifyYellow,0,0,"Cannot create more units.");
- if( player->Ai ) {
- // AiNoMoreUnits(player,type);
+ NotifyPlayer(player, NotifyYellow, 0, 0, "Cannot create more units.");
+ if (player->Ai) {
+ // AiNoMoreUnits(player, type);
}
return 0;
}
@@ -615,13 +629,13 @@
**
** @note The return values of the PlayerCheck functions are inconsistent.
*/
-global int PlayerCheckFood(const Player* player,const UnitType* type)
+global int PlayerCheckFood(const Player* player, const UnitType* type)
{
// FIXME: currently all units costs 1 food
- if( player->Food<player->NumFoodUnits+type->Demand ) {
- NotifyPlayer(player,NotifyYellow,0,0,"Not enough food...build more
farms.");
- if( player->Ai ) {
+ if (player->Food < player->NumFoodUnits + type->Demand) {
+ NotifyPlayer(player, NotifyYellow, 0, 0, "Not enough food...build more
farms.");
+ if (player->Ai) {
// FIXME: message to AI, called too much
DebugLevel3("Ai: Not enough food...build more farms.\n");
}
@@ -639,22 +653,22 @@
**
** @note The return values of the PlayerCheck functions are inconsistent.
*/
-global int PlayerCheckCosts(const Player* player,const int* costs)
+global int PlayerCheckCosts(const Player* player, const int* costs)
{
int i;
int err;
- err=0;
- for( i=1; i<MaxCosts; ++i ) {
- if( player->Resources[i]<costs[i] ) {
- NotifyPlayer(player,NotifyYellow,0,0,"Not enough %s...%s more %s.",
-
DefaultResourceNames[i],DefaultActions[i],DefaultResourceNames[i]);
+ err = 0;
+ for (i = 1; i < MaxCosts; ++i) {
+ if (player->Resources[i] < costs[i]) {
+ NotifyPlayer(player, NotifyYellow, 0, 0, "Not enough %s...%s more
%s.",
+ DefaultResourceNames[i], DefaultActions[i],
DefaultResourceNames[i]);
- if( player->Ai ) {
+ if (player->Ai) {
DebugLevel3("Ai: Not enough %s...%s more %s." _C_
- DefaultResourceNames[i] _C_ DefaultActions[i] _C_
DefaultResourceNames[i]);
+ DefaultResourceNames[i] _C_ DefaultActions[i] _C_
DefaultResourceNames[i]);
}
- err|=1<<i;
+ err |= 1 << i;
}
}
@@ -668,9 +682,9 @@
** @param type Type of unit.
** @return False if all enought, otherwise a bit mask.
*/
-global int PlayerCheckUnitType(const Player* player,const UnitType* type)
+global int PlayerCheckUnitType(const Player* player, const UnitType* type)
{
- return PlayerCheckCosts(player,type->Stats[player->Player].Costs);
+ return PlayerCheckCosts(player, type->Stats[player->Player].Costs);
}
/**
@@ -679,15 +693,15 @@
** @param player Pointer to player.
** @param costs How many costs.
*/
-global void PlayerAddCosts(Player* player,const int* costs)
+global void PlayerAddCosts(Player* player, const int* costs)
{
int i;
- for( i=1; i<MaxCosts; ++i ) {
- player->Resources[i]+=costs[i];
+ for (i = 1; i < MaxCosts; ++i) {
+ player->Resources[i] += costs[i];
}
- if( player==ThisPlayer ) {
- MustRedraw|=RedrawResources;
+ if (player == ThisPlayer) {
+ MustRedraw |= RedrawResources;
}
}
@@ -697,10 +711,10 @@
** @param player Pointer of player, to which the resources are added.
** @param type Type of unit.
*/
-global void PlayerAddUnitType(Player* player,const UnitType* type)
+global void PlayerAddUnitType(Player* player, const UnitType* type)
{
// FIXME: a player could make money by upgrading and than cancel
- PlayerAddCosts(player,type->Stats[player->Player].Costs);
+ PlayerAddCosts(player, type->Stats[player->Player].Costs);
}
/**
@@ -710,16 +724,16 @@
** @param costs How many costs.
** @param factor Factor of the costs to apply.
*/
-global void PlayerAddCostsFactor(Player* player,const int* costs,int factor)
+global void PlayerAddCostsFactor(Player* player, const int* costs, int factor)
{
int i;
- for( i=1; i<MaxCosts; ++i ) {
- DebugLevel3("%d %d\n" _C_ i _C_ costs[i]*factor/100);
- player->Resources[i]+=costs[i]*factor/100;
+ for (i = 1; i < MaxCosts; ++i) {
+ DebugLevel3("%d %d\n" _C_ i _C_ costs[i] * factor / 100);
+ player->Resources[i] += costs[i] * factor / 100;
}
- if( player==ThisPlayer ) {
- MustRedraw|=RedrawResources;
+ if (player == ThisPlayer) {
+ MustRedraw |= RedrawResources;
}
}
@@ -729,15 +743,15 @@
** @param player Pointer to player.
** @param costs How many costs.
*/
-global void PlayerSubCosts(Player* player,const int* costs)
+global void PlayerSubCosts(Player* player, const int* costs)
{
int i;
- for( i=1; i<MaxCosts; ++i ) {
- player->Resources[i]-=costs[i];
+ for (i = 1; i < MaxCosts; ++i) {
+ player->Resources[i] -= costs[i];
}
- if( player==ThisPlayer ) {
- MustRedraw|=RedrawResources;
+ if (player == ThisPlayer) {
+ MustRedraw |= RedrawResources;
}
}
@@ -747,9 +761,9 @@
** @param player Pointer of player, from which the resources are removed.
** @param type Type of unit.
*/
-global void PlayerSubUnitType(Player* player,const UnitType* type)
+global void PlayerSubUnitType(Player* player, const UnitType* type)
{
- PlayerSubCosts(player,type->Stats[player->Player].Costs);
+ PlayerSubCosts(player, type->Stats[player->Player].Costs);
}
/**
@@ -759,15 +773,15 @@
** @param costs How many costs.
** @param factor Factor of the costs to apply.
*/
-global void PlayerSubCostsFactor(Player* player,const int* costs,int factor)
+global void PlayerSubCostsFactor(Player* player, const int* costs, int factor)
{
int i;
- for( i=1; i<MaxCosts; ++i ) {
- player->Resources[i]-=costs[i]*100/factor;
+ for (i = 1; i < MaxCosts; ++i) {
+ player->Resources[i] -= costs[i] * 100 / factor;
}
- if( player==ThisPlayer ) {
- MustRedraw|=RedrawResources;
+ if (player == ThisPlayer) {
+ MustRedraw |= RedrawResources;
}
}
@@ -778,7 +792,7 @@
** @param type Type of unit.
** @return How many exists, false otherwise.
*/
-global int HaveUnitTypeByType(const Player* player,const UnitType* type)
+global int HaveUnitTypeByType(const Player* player, const UnitType* type)
{
return player->UnitTypesCount[type->Type];
}
@@ -792,7 +806,7 @@
**
** @note This function should not be used during run time.
*/
-global int HaveUnitTypeByIdent(const Player* player,const char* ident)
+global int HaveUnitTypeByIdent(const Player* player, const char* ident)
{
return player->UnitTypesCount[UnitTypeByIdent(ident)->Type];
}
@@ -804,8 +818,8 @@
{
int player;
- for( player=0; player<NumPlayers; ++player ) {
- if( Players[player].AiEnabled ) {
+ for (player = 0; player < NumPlayers; ++player) {
+ if (Players[player].AiEnabled) {
AiInit(&Players[player]);
}
}
@@ -818,8 +832,8 @@
{
int player;
- for( player=0; player<NumPlayers; ++player ) {
- if( Players[player].AiEnabled ) {
+ for (player = 0; player < NumPlayers; ++player) {
+ if (Players[player].AiEnabled) {
AiEachCycle(&Players[player]);
}
}
@@ -858,25 +872,25 @@
** @param player Pointer to player.
** @param sprite The sprite in which the colors should be changed.
*/
-global void GraphicPlayerPixels(const Player* player,const Graphic* sprite)
+global void GraphicPlayerPixels(const Player* player, const Graphic* sprite)
{
- switch( VideoBpp ) {
+ switch (VideoBpp) {
case 8:
- *((struct __4pixel8__*)(((VMemType8*)sprite->Pixels)+208))
- =player->UnitColors.Depth8;
+ *((struct __4pixel8__*)(((VMemType8*)sprite->Pixels) + 208)) =
+ player->UnitColors.Depth8;
break;
case 15:
case 16:
- *((struct __4pixel16__*)(((VMemType16*)sprite->Pixels)+208))
- =player->UnitColors.Depth16;
+ *((struct __4pixel16__*)(((VMemType16*)sprite->Pixels) + 208)) =
+ player->UnitColors.Depth16;
break;
case 24:
- *((struct __4pixel24__*)(((VMemType24*)sprite->Pixels)+208))
- =player->UnitColors.Depth24;
+ *((struct __4pixel24__*)(((VMemType24*)sprite->Pixels) + 208)) =
+ player->UnitColors.Depth24;
break;
case 32:
- *((struct __4pixel32__*)(((VMemType32*)sprite->Pixels)+208))
- =player->UnitColors.Depth32;
+ *((struct __4pixel32__*)(((VMemType32*)sprite->Pixels) + 208)) =
+ player->UnitColors.Depth32;
break;
}
}
@@ -889,20 +903,20 @@
global void PlayerPixels(const Player* player)
{
// FIXME: use function pointer
- switch( VideoBpp ) {
- case 8:
- *((struct __4pixel8__*)(Pixels8+208))=player->UnitColors.Depth8;
- break;
- case 15:
- case 16:
- *((struct __4pixel16__*)(Pixels16+208))=player->UnitColors.Depth16;
- break;
- case 24:
- *((struct __4pixel24__*)(Pixels24+208))=player->UnitColors.Depth24;
- break;
- case 32:
- *((struct __4pixel32__*)(Pixels32+208))=player->UnitColors.Depth32;
- break;
+ switch (VideoBpp) {
+ case 8:
+ *((struct __4pixel8__*)(Pixels8 + 208)) = player->UnitColors.Depth8;
+ break;
+ case 15:
+ case 16:
+ *((struct __4pixel16__*)(Pixels16 + 208)) =
player->UnitColors.Depth16;
+ break;
+ case 24:
+ *((struct __4pixel24__*)(Pixels24 + 208)) =
player->UnitColors.Depth24;
+ break;
+ case 32:
+ *((struct __4pixel32__*)(Pixels32 + 208)) =
player->UnitColors.Depth32;
+ break;
}
}
@@ -918,129 +932,129 @@
int i;
int o;
- //o=rand()&0x7; // FIXME: random colors didn't work
- o=0;
- switch( VideoBpp ) {
+ //o = rand() & 0x7; // FIXME: random colors didn't
work
+ o = 0;
+ switch (VideoBpp) {
case 8:
// New player colors setup
- if( !Pixels8 ) {
+ if (!Pixels8) {
DebugLevel0Fn("Wrong setup order\n");
return;
}
- for( i=0; i<7; ++i ) {
- Players[o].UnitColors.Depth8.Pixels[0]=Pixels8[i*4+208];
- Players[o].UnitColors.Depth8.Pixels[1]=Pixels8[i*4+209];
- Players[o].UnitColors.Depth8.Pixels[2]=Pixels8[i*4+210];
- Players[o].UnitColors.Depth8.Pixels[3]=Pixels8[i*4+211];
-
- Players[o+8].UnitColors.Depth8.Pixels[0]=Pixels8[i*4+208];
- Players[o+8].UnitColors.Depth8.Pixels[1]=Pixels8[i*4+209];
- Players[o+8].UnitColors.Depth8.Pixels[2]=Pixels8[i*4+210];
- Players[o+8].UnitColors.Depth8.Pixels[3]=Pixels8[i*4+211];
- o=(o+1)&0x7;
- }
-
- Players[o].UnitColors.Depth8.Pixels[0]=Pixels8[12];
- Players[o].UnitColors.Depth8.Pixels[1]=Pixels8[13];
- Players[o].UnitColors.Depth8.Pixels[2]=Pixels8[14];
- Players[o].UnitColors.Depth8.Pixels[3]=Pixels8[15];
- Players[o+8].UnitColors.Depth8.Pixels[0]=Pixels8[12];
- Players[o+8].UnitColors.Depth8.Pixels[1]=Pixels8[13];
- Players[o+8].UnitColors.Depth8.Pixels[2]=Pixels8[14];
- Players[o+8].UnitColors.Depth8.Pixels[3]=Pixels8[15];
+ for (i = 0; i < 7; ++i) {
+ Players[o].UnitColors.Depth8.Pixels[0] = Pixels8[i * 4 + 208];
+ Players[o].UnitColors.Depth8.Pixels[1] = Pixels8[i * 4 + 209];
+ Players[o].UnitColors.Depth8.Pixels[2] = Pixels8[i * 4 + 210];
+ Players[o].UnitColors.Depth8.Pixels[3] = Pixels8[i * 4 + 211];
+
+ Players[o + 8].UnitColors.Depth8.Pixels[0] = Pixels8[i * 4 + 208];
+ Players[o + 8].UnitColors.Depth8.Pixels[1] = Pixels8[i * 4 + 209];
+ Players[o + 8].UnitColors.Depth8.Pixels[2] = Pixels8[i * 4 + 210];
+ Players[o + 8].UnitColors.Depth8.Pixels[3] = Pixels8[i * 4 + 211];
+ o = (o + 1) & 0x7;
+ }
+
+ Players[o].UnitColors.Depth8.Pixels[0] = Pixels8[12];
+ Players[o].UnitColors.Depth8.Pixels[1] = Pixels8[13];
+ Players[o].UnitColors.Depth8.Pixels[2] = Pixels8[14];
+ Players[o].UnitColors.Depth8.Pixels[3] = Pixels8[15];
+ Players[o+8].UnitColors.Depth8.Pixels[0] = Pixels8[12];
+ Players[o+8].UnitColors.Depth8.Pixels[1] = Pixels8[13];
+ Players[o+8].UnitColors.Depth8.Pixels[2] = Pixels8[14];
+ Players[o+8].UnitColors.Depth8.Pixels[3] = Pixels8[15];
break;
case 15:
case 16:
// New player colors setup
- if( !Pixels16 ) {
+ if (!Pixels16) {
DebugLevel0Fn("Wrong setup order\n");
return;
}
- for( i=0; i<7; ++i ) {
- Players[o].UnitColors.Depth16.Pixels[0]=Pixels16[i*4+208];
- Players[o].UnitColors.Depth16.Pixels[1]=Pixels16[i*4+209];
- Players[o].UnitColors.Depth16.Pixels[2]=Pixels16[i*4+210];
- Players[o].UnitColors.Depth16.Pixels[3]=Pixels16[i*4+211];
-
- Players[o+8].UnitColors.Depth16.Pixels[0]=Pixels16[i*4+208];
- Players[o+8].UnitColors.Depth16.Pixels[1]=Pixels16[i*4+209];
- Players[o+8].UnitColors.Depth16.Pixels[2]=Pixels16[i*4+210];
- Players[o+8].UnitColors.Depth16.Pixels[3]=Pixels16[i*4+211];
- o=(o+1)&0x7;
- }
-
- Players[o].UnitColors.Depth16.Pixels[0]=Pixels16[12];
- Players[o].UnitColors.Depth16.Pixels[1]=Pixels16[13];
- Players[o].UnitColors.Depth16.Pixels[2]=Pixels16[14];
- Players[o].UnitColors.Depth16.Pixels[3]=Pixels16[15];
- Players[o+8].UnitColors.Depth16.Pixels[0]=Pixels16[12];
- Players[o+8].UnitColors.Depth16.Pixels[1]=Pixels16[13];
- Players[o+8].UnitColors.Depth16.Pixels[2]=Pixels16[14];
- Players[o+8].UnitColors.Depth16.Pixels[3]=Pixels16[15];
+ for (i = 0; i < 7; ++i) {
+ Players[o].UnitColors.Depth16.Pixels[0] = Pixels16[i * 4 + 208];
+ Players[o].UnitColors.Depth16.Pixels[1] = Pixels16[i * 4 + 209];
+ Players[o].UnitColors.Depth16.Pixels[2] = Pixels16[i * 4 + 210];
+ Players[o].UnitColors.Depth16.Pixels[3] = Pixels16[i * 4 + 211];
+
+ Players[o+8].UnitColors.Depth16.Pixels[0] = Pixels16[i * 4 + 208];
+ Players[o+8].UnitColors.Depth16.Pixels[1] = Pixels16[i * 4 + 209];
+ Players[o+8].UnitColors.Depth16.Pixels[2] = Pixels16[i * 4 + 210];
+ Players[o+8].UnitColors.Depth16.Pixels[3] = Pixels16[i * 4 + 211];
+ o = (o + 1) & 0x7;
+ }
+
+ Players[o].UnitColors.Depth16.Pixels[0] = Pixels16[12];
+ Players[o].UnitColors.Depth16.Pixels[1] = Pixels16[13];
+ Players[o].UnitColors.Depth16.Pixels[2] = Pixels16[14];
+ Players[o].UnitColors.Depth16.Pixels[3] = Pixels16[15];
+ Players[o + 8].UnitColors.Depth16.Pixels[0] = Pixels16[12];
+ Players[o + 8].UnitColors.Depth16.Pixels[1] = Pixels16[13];
+ Players[o + 8].UnitColors.Depth16.Pixels[2] = Pixels16[14];
+ Players[o + 8].UnitColors.Depth16.Pixels[3] = Pixels16[15];
break;
case 24:
// New player colors setup
- if( !Pixels24 ) {
+ if (!Pixels24) {
DebugLevel0Fn("Wrong setup order\n");
return;
}
- for( i=0; i<7; ++i ) {
- Players[o].UnitColors.Depth24.Pixels[0]=Pixels24[i*4+208];
- Players[o].UnitColors.Depth24.Pixels[1]=Pixels24[i*4+209];
- Players[o].UnitColors.Depth24.Pixels[2]=Pixels24[i*4+210];
- Players[o].UnitColors.Depth24.Pixels[3]=Pixels24[i*4+211];
-
- Players[o+8].UnitColors.Depth24.Pixels[0]=Pixels24[i*4+208];
- Players[o+8].UnitColors.Depth24.Pixels[1]=Pixels24[i*4+209];
- Players[o+8].UnitColors.Depth24.Pixels[2]=Pixels24[i*4+210];
- Players[o+8].UnitColors.Depth24.Pixels[3]=Pixels24[i*4+211];
- o=(o+1)&0x7;
- }
-
- Players[o].UnitColors.Depth24.Pixels[0]=Pixels24[12];
- Players[o].UnitColors.Depth24.Pixels[1]=Pixels24[13];
- Players[o].UnitColors.Depth24.Pixels[2]=Pixels24[14];
- Players[o].UnitColors.Depth24.Pixels[3]=Pixels24[15];
- Players[o+8].UnitColors.Depth24.Pixels[0]=Pixels24[12];
- Players[o+8].UnitColors.Depth24.Pixels[1]=Pixels24[13];
- Players[o+8].UnitColors.Depth24.Pixels[2]=Pixels24[14];
- Players[o+8].UnitColors.Depth24.Pixels[3]=Pixels24[15];
+ for (i = 0; i < 7; ++i) {
+ Players[o].UnitColors.Depth24.Pixels[0] = Pixels24[i * 4 + 208];
+ Players[o].UnitColors.Depth24.Pixels[1] = Pixels24[i * 4 + 209];
+ Players[o].UnitColors.Depth24.Pixels[2] = Pixels24[i * 4 + 210];
+ Players[o].UnitColors.Depth24.Pixels[3] = Pixels24[i * 4 + 211];
+
+ Players[o + 8].UnitColors.Depth24.Pixels[0] = Pixels24[i * 4 + 208];
+ Players[o + 8].UnitColors.Depth24.Pixels[1] = Pixels24[i * 4 + 209];
+ Players[o + 8].UnitColors.Depth24.Pixels[2] = Pixels24[i * 4 + 210];
+ Players[o + 8].UnitColors.Depth24.Pixels[3] = Pixels24[i * 4 + 211];
+ o = (o + 1) & 0x7;
+ }
+
+ Players[o].UnitColors.Depth24.Pixels[0] = Pixels24[12];
+ Players[o].UnitColors.Depth24.Pixels[1] = Pixels24[13];
+ Players[o].UnitColors.Depth24.Pixels[2] = Pixels24[14];
+ Players[o].UnitColors.Depth24.Pixels[3] = Pixels24[15];
+ Players[o + 8].UnitColors.Depth24.Pixels[0] = Pixels24[12];
+ Players[o + 8].UnitColors.Depth24.Pixels[1] = Pixels24[13];
+ Players[o + 8].UnitColors.Depth24.Pixels[2] = Pixels24[14];
+ Players[o + 8].UnitColors.Depth24.Pixels[3] = Pixels24[15];
break;
case 32:
// New player colors setup
- if( !Pixels32 ) {
+ if (!Pixels32) {
DebugLevel0Fn("Wrong setup order\n");
return;
}
- for( i=0; i<7; ++i ) {
- Players[o].UnitColors.Depth32.Pixels[0]=Pixels32[i*4+208];
- Players[o].UnitColors.Depth32.Pixels[1]=Pixels32[i*4+209];
- Players[o].UnitColors.Depth32.Pixels[2]=Pixels32[i*4+210];
- Players[o].UnitColors.Depth32.Pixels[3]=Pixels32[i*4+211];
-
- Players[o+8].UnitColors.Depth32.Pixels[0]=Pixels32[i*4+208];
- Players[o+8].UnitColors.Depth32.Pixels[1]=Pixels32[i*4+209];
- Players[o+8].UnitColors.Depth32.Pixels[2]=Pixels32[i*4+210];
- Players[o+8].UnitColors.Depth32.Pixels[3]=Pixels32[i*4+211];
- o=(o+1)&0x7;
- }
-
- Players[o].UnitColors.Depth32.Pixels[0]=Pixels32[12];
- Players[o].UnitColors.Depth32.Pixels[1]=Pixels32[13];
- Players[o].UnitColors.Depth32.Pixels[2]=Pixels32[14];
- Players[o].UnitColors.Depth32.Pixels[3]=Pixels32[15];
- Players[o+8].UnitColors.Depth32.Pixels[0]=Pixels32[12];
- Players[o+8].UnitColors.Depth32.Pixels[1]=Pixels32[13];
- Players[o+8].UnitColors.Depth32.Pixels[2]=Pixels32[14];
- Players[o+8].UnitColors.Depth32.Pixels[3]=Pixels32[15];
+ for (i = 0; i < 7; ++i) {
+ Players[o].UnitColors.Depth32.Pixels[0] = Pixels32[i * 4 + 208];
+ Players[o].UnitColors.Depth32.Pixels[1] = Pixels32[i * 4 + 209];
+ Players[o].UnitColors.Depth32.Pixels[2] = Pixels32[i * 4 + 210];
+ Players[o].UnitColors.Depth32.Pixels[3] = Pixels32[i * 4 + 211];
+
+ Players[o + 8].UnitColors.Depth32.Pixels[0] = Pixels32[i * 4 + 208];
+ Players[o + 8].UnitColors.Depth32.Pixels[1] = Pixels32[i * 4 + 209];
+ Players[o + 8].UnitColors.Depth32.Pixels[2] = Pixels32[i * 4 + 210];
+ Players[o + 8].UnitColors.Depth32.Pixels[3] = Pixels32[i * 4 + 211];
+ o = (o + 1) & 0x7;
+ }
+
+ Players[o].UnitColors.Depth32.Pixels[0] = Pixels32[12];
+ Players[o].UnitColors.Depth32.Pixels[1] = Pixels32[13];
+ Players[o].UnitColors.Depth32.Pixels[2] = Pixels32[14];
+ Players[o].UnitColors.Depth32.Pixels[3] = Pixels32[15];
+ Players[o + 8].UnitColors.Depth32.Pixels[0] = Pixels32[12];
+ Players[o + 8].UnitColors.Depth32.Pixels[1] = Pixels32[13];
+ Players[o + 8].UnitColors.Depth32.Pixels[2] = Pixels32[14];
+ Players[o + 8].UnitColors.Depth32.Pixels[3] = Pixels32[15];
break;
}
@@ -1062,15 +1076,15 @@
DebugLevel0("Nr Color I Name Type Race Ai\n");
DebugLevel0("-- -------- - -------- ------------ ------- -- ---\n");
- for( i=0; i<PlayerMax; ++i ) {
- if( Players[i].Type==PlayerNobody ) {
+ for (i = 0; i < PlayerMax; ++i) {
+ if (Players[i].Type == PlayerNobody) {
continue;
}
- DebugLevel0("%2d: %8.8s %c %-8.8s " _C_ i _C_ colors[i]
- _C_ ThisPlayer==&Players[i] ? '*'
- : Players[i].AiEnabled ? '+' : ' '
- _C_ Players[i].Name);
- switch( Players[i].Type ) {
+ DebugLevel0("%2d: %8.8s %c %-8.8s " _C_ i _C_ colors[i] _C_
+ ThisPlayer==&Players[i] ? '*' :
+ Players[i].AiEnabled ? '+' : ' ' _C_
+ Players[i].Name);
+ switch (Players[i].Type) {
case 0: DebugLevel0("Don't know 0 "); break;
case 1: DebugLevel0("Don't know 1 "); break;
case 2: DebugLevel0("neutral "); break;
@@ -1080,10 +1094,10 @@
case 6: DebugLevel0("rescue pas. "); break;
case 7: DebugLevel0("rescue akt. "); break;
}
- k=PlayerRacesIndex(Players[i].Race);
+ k = PlayerRacesIndex(Players[i].Race);
DebugLevel0("%9s" _C_ PlayerRaces.Name[k]);
DebugLevel0("%2d " _C_ Players[i].AiNum);
- switch( Players[i].AiNum ) {
+ switch (Players[i].AiNum) {
case PlayerAiLand: DebugLevel0("(land)"); break;
case PlayerAiPassive: DebugLevel0("(passive)"); break;
case PlayerAiAir: DebugLevel0("(air)"); break;
@@ -1109,23 +1123,23 @@
** @todo FIXME: We must also notfiy allied players.
*/
global void NotifyPlayer(const Player* player,
- int type __attribute__((unused)),int x,int y,const char* fmt, ...)
+ int type __attribute__((unused)), int x, int y, const char* fmt, ...)
{
char temp[128];
va_list va;
- if( player!=ThisPlayer ) { // Currently only notfiy me
+ if (player != ThisPlayer) { // Currently only notfiy me
return;
}
- va_start( va, fmt );
- vsprintf( temp, fmt, va );
- va_end( va );
+ va_start(va, fmt);
+ vsprintf(temp, fmt, va);
+ va_end(va);
//
// FIXME: show minimap animation for the event.
//
- SetMessageEvent(x,y,"%s",temp);
+ SetMessageEvent(x, y, "%s", temp);
}
//@}
Index: stratagus/src/clone/unit_draw.c
diff -u stratagus/src/clone/unit_draw.c:1.164
stratagus/src/clone/unit_draw.c:1.165
--- stratagus/src/clone/unit_draw.c:1.164 Thu Oct 2 23:28:53 2003
+++ stratagus/src/clone/unit_draw.c Tue Oct 7 20:06:41 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_draw.c,v 1.164 2003/10/03 03:28:53 mr-russ Exp $
+// $Id: unit_draw.c,v 1.165 2003/10/08 00:06:41 jsalmon3 Exp $
//@{
@@ -91,8 +91,8 @@
** @param x1,y1 Coordinates of the top left corner.
** @param x2,y2 Coordinates of the bottom right corner.
*/
-global void (*DrawSelection)(int color,int x1,int y1,int x2,int y2)
- =DrawSelectionNone;
+global void (*DrawSelection)(VMemType color, int x1, int y1,
+ int x2, int y2) = DrawSelectionNone;
/*----------------------------------------------------------------------------
-- Functions
@@ -110,29 +110,30 @@
**
** @param unit Pointer to the unit.
**
-** @return Color for selection, or -1 if not selected.
+** @return Color for selection, or NULL if not selected.
*/
-local int SelectionColor(const Unit* unit)
+local VMemType* SelectionColor(const Unit* unit)
{
- if( unit->Selected || (unit->Blink&1) ) {
- if( unit->Player->Player==PlayerNumNeutral ) {
- return ColorYellow;
+ if( unit->Selected || (unit->Blink & 1) ) {
+ if (unit->Player->Player == PlayerNumNeutral) {
+ return &ColorYellow;
}
// FIXME: better allied?
- if( unit->Player==ThisPlayer ) {
- return ColorGreen;
+ if (unit->Player == ThisPlayer) {
+ return &ColorGreen;
}
- if( IsEnemy(ThisPlayer,unit) ) {
- return ColorRed;
+ if (IsEnemy(ThisPlayer, unit)) {
+ return &ColorRed;
}
- return unit->Player->Color;
+ return &unit->Player->Color;
}
// If building mark all own buildings
- if( CursorBuilding && unit->Type->Building && unit->Player==ThisPlayer ) {
- return ColorGray;
+ if (CursorBuilding && unit->Type->Building &&
+ unit->Player == ThisPlayer) {
+ return &ColorGray;
}
- return -1;
+ return NULL;
}
/**
@@ -142,24 +143,24 @@
*/
global void DrawUnitSelection(const Unit* unit)
{
- int color;
+ VMemType* color;
int x;
int y;
UnitType* type;
- type=unit->Type;
+ type = unit->Type;
- color=SelectionColor(unit);
- if (color<0) {
+ color = SelectionColor(unit);
+ if (!color) {
return;
}
- x=Map2ViewportX(CurrentViewport,unit->X)+unit->IX
- +type->TileWidth*TileSizeX/2-type->BoxWidth/2
- -(type->Width-VideoGraphicWidth(type->Sprite))/2;
- y=Map2ViewportY(CurrentViewport,unit->Y)+unit->IY
- +type->TileHeight*TileSizeY/2-type->BoxHeight/2
- -(type->Height-VideoGraphicHeight(type->Sprite))/2;
- DrawSelection(color,x,y,x+type->BoxWidth,y+type->BoxHeight);
+ x = Map2ViewportX(CurrentViewport, unit->X) + unit->IX +
+ type->TileWidth * TileSizeX / 2 - type->BoxWidth / 2 -
+ (type->Width - VideoGraphicWidth(type->Sprite)) / 2;
+ y = Map2ViewportY(CurrentViewport, unit->Y) + unit->IY +
+ type->TileHeight * TileSizeY / 2 - type->BoxHeight/2 -
+ (type->Height - VideoGraphicHeight(type->Sprite)) / 2;
+ DrawSelection(*color, x, y, x + type->BoxWidth, y + type->BoxHeight);
}
/**
@@ -169,10 +170,8 @@
** @param x1,y1 Coordinates of the top left corner.
** @param x2,y2 Coordinates of the bottom right corner.
*/
-global void DrawSelectionNone(int color,int x1,int y1,int x2,int y2)
-/*global void DrawSelectionNone(int color __attribute__((unused)),
- int x1 __attribute__((unused)),int y1 __attribute__((unused)),
- int x2 __attribute__((unused)),int y2 __attribute__((unused)))*/
+global void DrawSelectionNone(VMemType color, int x1, int y1,
+ int x2, int y2)
{
}
@@ -183,13 +182,13 @@
** @param x1,y1 Coordinates of the top left corner.
** @param x2,y2 Coordinates of the bottom right corner.
*/
-global void DrawSelectionCircle(int color,int x1,int x2,int y1,int y2)
+global void DrawSelectionCircle(VMemType color, int x1, int x2,
+ int y1, int y2)
{
- DebugCheck(color<0);
- VideoDrawCircleClip(color,(x1+x2)/2,(y1+y2)/2,
- min((x2-x1)/2,(y2-y1)/2));
- VideoDrawCircleClip(color,(x1+x2)/2,(y1+y2)/2,
- min((x2-x1)/2,(y2-y1)/2)+2);
+ VideoDrawCircleClip(color, (x1 + x2) / 2, (y1 + y2) / 2,
+ min((x2 - x1) / 2, (y2 - y1) / 2));
+ VideoDrawCircleClip(color, (x1 + x2) / 2, (y1 + y2) / 2,
+ min((x2 - x1) / 2, (y2 - y1) / 2) + 2);
}
/**
@@ -199,13 +198,13 @@
** @param x1,y1 Coordinates of the top left corner.
** @param x2,y2 Coordinates of the bottom right corner.
*/
-global void DrawSelectionCircleWithTrans(int color,int x1,int y1,int x2,int y2)
-{
- DebugCheck(color<0);
- VideoFill75TransCircleClip(color,(x1+x2)/2,(y1+y2)/2,
- min((x2-x1)/2,(y2-y1)/2)-2);
- VideoDrawCircleClip(color,(x1+x2)/2,(y1+y2)/2,
- min((x2-x1)/2,(y2-y1)/2));
+global void DrawSelectionCircleWithTrans(VMemType color, int x1, int y1,
+ int x2, int y2)
+{
+ VideoFill75TransCircleClip(color, (x1 + x2) / 2, (y1 + y2) / 2,
+ min((x2 - x1) / 2, (y2 - y1) / 2) - 2);
+ VideoDrawCircleClip(color, (x1 + x2) / 2, (y1 + y2) / 2,
+ min((x2 - x1) / 2, (y2 - y1) / 2));
}
/**
@@ -215,10 +214,10 @@
** @param x1,y1 Coordinates of the top left corner.
** @param x2,y2 Coordinates of the bottom right corner.
*/
-global void DrawSelectionRectangle(int color,int x1,int y1,int x2,int y2)
+global void DrawSelectionRectangle(VMemType color, int x1, int y1,
+ int x2, int y2)
{
- DebugCheck(color<0);
- VideoDrawRectangleClip(color,x1,y1,x2-x1,y2-y1);
+ VideoDrawRectangleClip(color, x1, y1, x2 - x1, y2 - y1);
}
/**
@@ -228,11 +227,12 @@
** @param x1,y1 Coordinates of the top left corner.
** @param x2,y2 Coordinates of the bottom right corner.
*/
-global void DrawSelectionRectangleWithTrans(int color,int x1,int y1,int x2,int
y2)
+global void DrawSelectionRectangleWithTrans(VMemType color, int x1, int y1,
+ int x2, int y2)
{
- DebugCheck(color<0);
- VideoDrawRectangleClip(color,x1,y1,x2-x1,y2-y1);
- VideoFill75TransRectangleClip(color,x1+1,y1+1,x2-x1-2,y2-y1-2);
+ VideoDrawRectangleClip(color, x1, y1, x2 - x1, y2 - y1);
+ VideoFill75TransRectangleClip(color, x1 + 1, y1 + 1,
+ x2 - x1 - 2, y2 - y1 - 2);
}
/**
@@ -242,22 +242,22 @@
** @param x1,y1 Coordinates of the top left corner.
** @param x2,y2 Coordinates of the bottom right corner.
*/
-global void DrawSelectionCorners(int color,int x1,int y1,int x2,int y2)
+global void DrawSelectionCorners(VMemType color, int x1, int y1,
+ int x2, int y2)
{
- DebugCheck(color<0);
#define CORNER_PIXELS 6
- VideoDrawVLineClip(color,x1,y1,CORNER_PIXELS);
- VideoDrawHLineClip(color,x1+1,y1,CORNER_PIXELS-1);
+ VideoDrawVLineClip(color, x1, y1, CORNER_PIXELS);
+ VideoDrawHLineClip(color, x1 + 1, y1, CORNER_PIXELS - 1);
- VideoDrawVLineClip(color,x2,y1,CORNER_PIXELS);
- VideoDrawHLineClip(color,x2-CORNER_PIXELS+1,y1,CORNER_PIXELS-1);
+ VideoDrawVLineClip(color, x2, y1, CORNER_PIXELS);
+ VideoDrawHLineClip(color, x2 - CORNER_PIXELS + 1, y1, CORNER_PIXELS - 1);
- VideoDrawVLineClip(color,x1,y2-CORNER_PIXELS+1,CORNER_PIXELS);
- VideoDrawHLineClip(color,x1,y2,CORNER_PIXELS-1);
+ VideoDrawVLineClip(color, x1, y2 - CORNER_PIXELS + 1, CORNER_PIXELS);
+ VideoDrawHLineClip(color, x1, y2, CORNER_PIXELS - 1);
- VideoDrawVLineClip(color,x2,y2-CORNER_PIXELS+1,CORNER_PIXELS);
- VideoDrawHLineClip(color,x2-CORNER_PIXELS+1,y2,CORNER_PIXELS-1);
+ VideoDrawVLineClip(color, x2, y2 - CORNER_PIXELS + 1, CORNER_PIXELS);
+ VideoDrawHLineClip(color, x2 - CORNER_PIXELS + 1, y2, CORNER_PIXELS - 1);
}
/**
@@ -577,7 +577,7 @@
global void SaveDecorations(CLFile* file)
{
CLprintf(file,"\n;;; -----------------------------------------\n");
- CLprintf(file,";;; MODULE: decorations $Id: unit_draw.c,v 1.164 2003/10/03
03:28:53 mr-russ Exp $\n\n");
+ CLprintf(file,";;; MODULE: decorations $Id: unit_draw.c,v 1.165 2003/10/08
00:06:41 jsalmon3 Exp $\n\n");
CLprintf(file,"(mana-sprite \"%s\" %d %d %d %d)\n",
ManaSprite.File,ManaSprite.HotX,ManaSprite.HotY,
@@ -775,7 +775,7 @@
local void DrawDecoration(const Unit* unit,const UnitType* type,int x,int y)
{
int f;
- int color;
+ VMemType color;
int w;
int x1;
int y1;
@@ -806,13 +806,13 @@
&& !(ShowNoFull && unit->HP==stats->HitPoints) ) {
f=(100*unit->HP)/stats->HitPoints;
if( f>75) {
- color=ColorDarkGreen;
+ color = ColorDarkGreen;
} else if( f>50 ) {
- color=ColorYellow;
+ color = ColorYellow;
} else if( f>25 ) {
- color=ColorOrange;
+ color = ColorOrange;
} else {
- color=ColorRed;
+ color = ColorRed;
}
if ( ShowHealthHorizontal ) {
//
@@ -1352,31 +1352,36 @@
** @param x Resulting screen X cordinate.
** @param y Resulting screen Y cordinate.
*/
-local void GetOrderPosition(const Unit* unit,const Order* order,int* x,int* y)
+local void GetOrderPosition(const Unit* unit, const Order* order, int* x, int*
y)
{
Unit* goal;
+
// FIXME: n0body: Check for goal gone?
- if ((goal=order->Goal)&&(!goal->Removed)) {
+ if ((goal = order->Goal) && (!goal->Removed)) {
// Order has a goal, get it's location.
- *x =
Map2ViewportX(CurrentViewport,goal->X)+goal->IX+goal->Type->TileWidth*TileSizeX/2;
- *y =
Map2ViewportY(CurrentViewport,goal->Y)+goal->IY+goal->Type->TileHeight*TileSizeY/2;
+ *x = Map2ViewportX(CurrentViewport, goal->X) + goal->IX +
+ goal->Type->TileWidth * TileSizeX / 2;
+ *y = Map2ViewportY(CurrentViewport, goal->Y) + goal->IY +
+ goal->Type->TileHeight * TileSizeY / 2;
} else {
- if (order->X>=0 && order->Y >=0) {
+ if (order->X >= 0 && order->Y >= 0) {
// Order is for a location, show that.
- *x = Map2ViewportX(CurrentViewport,order->X)+TileSizeX/2;
- *y = Map2ViewportY(CurrentViewport,order->Y)+TileSizeY/2;
+ *x = Map2ViewportX(CurrentViewport, order->X) + TileSizeX / 2;
+ *y = Map2ViewportY(CurrentViewport, order->Y) + TileSizeY / 2;
} else {
// Some orders ignore x,y (like StandStill).
// Use the unit's position instead.
-
*x=Map2ViewportX(CurrentViewport,unit->X)+unit->IX+unit->Type->TileWidth*TileSizeX/2;
-
*y=Map2ViewportY(CurrentViewport,unit->Y)+unit->IY+unit->Type->TileHeight*TileSizeY/2;
+ *x = Map2ViewportX(CurrentViewport, unit->X) + unit->IX +
+ unit->Type->TileWidth * TileSizeX / 2;
+ *y = Map2ViewportY(CurrentViewport, unit->Y) + unit->IY +
+ unit->Type->TileHeight * TileSizeY / 2;
}
- if (order->Action==UnitActionBuild) {
+ if (order->Action == UnitActionBuild) {
// FIXME: mr-russ, can this be removed? since the build order now
has a goal?
// When building a building point to the center of the would-be
building.
// The -1 is because of what we have above.
- *x += (order->Type->TileWidth-1)*TileSizeX/2;
- *y += (order->Type->TileHeight-1)*TileSizeY/2;
+ *x += (order->Type->TileWidth - 1) * TileSizeX / 2;
+ *y += (order->Type->TileHeight - 1) * TileSizeY / 2;
}
}
DebugLevel3Fn(": (%d,%d)\n" _C_ order->X _C_ order->Y);
@@ -1394,11 +1399,11 @@
{
int x2;
int y2;
- int color;
- int e_color;
+ VMemType color;
+ VMemType e_color;
int dest;
- GetOrderPosition(unit,order,&x2,&y2);
+ GetOrderPosition(unit, order, &x2, &y2);
dest = 0;
switch (order->Action) {
@@ -1481,8 +1486,10 @@
break;
case UnitActionBuild:
-
DrawSelection(ColorGray,x2-order->Type->BoxWidth/2,y2-order->Type->BoxHeight/2,
- x2+order->Type->BoxWidth/2,y2+order->Type->BoxHeight/2);
+ DrawSelection(ColorGray, x2 - order->Type->BoxWidth / 2,
+ y2 - order->Type->BoxHeight / 2,
+ x2 + order->Type->BoxWidth / 2,
+ y2 + order->Type->BoxHeight / 2);
e_color = color = ColorGreen;
dest = 1;
break;
Index: stratagus/src/editor/editloop.c
diff -u stratagus/src/editor/editloop.c:1.132
stratagus/src/editor/editloop.c:1.133
--- stratagus/src/editor/editloop.c:1.132 Sat Oct 4 01:26:48 2003
+++ stratagus/src/editor/editloop.c Tue Oct 7 20:06:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: editloop.c,v 1.132 2003/10/04 05:26:48 jsalmon3 Exp $
+// $Id: editloop.c,v 1.133 2003/10/08 00:06:42 jsalmon3 Exp $
//@{
@@ -664,7 +664,7 @@
*/
local void DrawTileIcon(unsigned tilenum,unsigned x,unsigned y,unsigned flags)
{
- int color;
+ VMemType color;
color = (flags & IconActive) ? ColorGray : ColorBlack;
Index: stratagus/src/game/game.c
diff -u stratagus/src/game/game.c:1.107 stratagus/src/game/game.c:1.108
--- stratagus/src/game/game.c:1.107 Mon Oct 6 16:03:29 2003
+++ stratagus/src/game/game.c Tue Oct 7 20:06:42 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: game.c,v 1.107 2003/10/06 20:03:29 jsalmon3 Exp $
+// $Id: game.c,v 1.108 2003/10/08 00:06:42 jsalmon3 Exp $
//@{
@@ -283,7 +283,8 @@
}
InitVisionTable(); // build vision table for fog of war
-
+ InitPlayers();
+
if (filename) {
s = NULL;
// FIXME: LibraryFile here?
Index: stratagus/src/game/intro.c
diff -u stratagus/src/game/intro.c:1.101 stratagus/src/game/intro.c:1.102
--- stratagus/src/game/intro.c:1.101 Thu Oct 2 11:39:32 2003
+++ stratagus/src/game/intro.c Tue Oct 7 20:06:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: intro.c,v 1.101 2003/10/02 15:39:32 jsalmon3 Exp $
+// $Id: intro.c,v 1.102 2003/10/08 00:06:42 jsalmon3 Exp $
//@{
@@ -876,7 +876,7 @@
/**
** Draw a box with the text inside
*/
-local void DrawStatBox(int x, int y, char* text, unsigned color, int percent)
+local void DrawStatBox(int x, int y, char* text, VMemType color, int percent)
{
VideoFillRectangleClip(ColorBlack, x, y, 80, 24);
VideoDrawRectangleClip(ColorYellow, x + 1, y + 1, 78, 22);
Index: stratagus/src/include/player.h
diff -u stratagus/src/include/player.h:1.74 stratagus/src/include/player.h:1.75
--- stratagus/src/include/player.h:1.74 Fri Sep 26 14:52:19 2003
+++ stratagus/src/include/player.h Tue Oct 7 20:06:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: player.h,v 1.74 2003/09/26 18:52:19 jsalmon3 Exp $
+// $Id: player.h,v 1.75 2003/10/08 00:06:42 jsalmon3 Exp $
#ifndef __PLAYER_H__
#define __PLAYER_H__
@@ -346,7 +346,7 @@
int TotalKills; /// How many unit killed
// Display video
- unsigned Color; /// color of units on minimap
+ VMemType Color; /// color of units on minimap
UnitColors UnitColors; /// Unit colors for new units
@@ -456,7 +456,7 @@
extern Player Players[PlayerMax]; /// All players
extern Player* ThisPlayer; /// Player on local computer
extern int NoRescueCheck; /// Disable rescue check
-extern int PlayerColors[PlayerMax]; /// Player colors
+extern VMemType PlayerColors[PlayerMax]; /// Player colors
extern char* PlayerColorNames[PlayerMax]; /// Player color names
extern PlayerRace PlayerRaces; /// Player races
Index: stratagus/src/include/ui.h
diff -u stratagus/src/include/ui.h:1.70 stratagus/src/include/ui.h:1.71
--- stratagus/src/include/ui.h:1.70 Tue Oct 7 12:27:18 2003
+++ stratagus/src/include/ui.h Tue Oct 7 20:06:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ui.h,v 1.70 2003/10/07 16:27:18 jsalmon3 Exp $
+// $Id: ui.h,v 1.71 2003/10/08 00:06:42 jsalmon3 Exp $
#ifndef __UI_H__
#define __UI_H__
@@ -214,7 +214,8 @@
int InfoPanelH; /// Info panel height
// Complete bar
- int CompleteBarColor; /// color for complete bar
+ VMemType CompleteBarColorRGB; /// color for complete bar
+ VMemType CompleteBarColor; /// color for complete bar
int CompleteBarX; /// complete bar X position
int CompleteBarY; /// complete bar Y position
int CompleteBarW; /// complete bar width
@@ -264,7 +265,7 @@
int MinimapPosX; /// minimap screen X position
int MinimapPosY; /// minimap screen Y position
int MinimapTransparent; /// unexplored areas are
transparent
- int ViewportCursorColor; /// minimap cursor color
+ VMemType ViewportCursorColor; /// minimap cursor color
// The status line
GraphicConfig StatusLine; /// Status line background
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.217 stratagus/src/include/unit.h:1.218
--- stratagus/src/include/unit.h:1.217 Sat Sep 27 02:16:37 2003
+++ stratagus/src/include/unit.h Tue Oct 7 20:06:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.h,v 1.217 2003/09/27 06:16:37 mr-russ Exp $
+// $Id: unit.h,v 1.218 2003/10/08 00:06:42 jsalmon3 Exp $
#ifndef __UNIT_H__
#define __UNIT_H__
@@ -492,7 +492,7 @@
Unit** UnitSlot; /// Slot pointer of Units
Unit** PlayerSlot; /// Slot pointer of Player->Units
- Unit* Next; /// Generic link pointer (on map)
+ Unit* Next; /// Generic link pointer (on map)
int InsideCount; /// Number of units inside.
Unit* UnitInside; /// Pointer to one of the units inside.
@@ -564,7 +564,7 @@
unsigned Blink : 3; /// Let selection rectangle blink
unsigned Moving : 1; /// The unit is moving
/** set to random 1..100 when MakeUnit()
- ** ,used for fancy buildings
+ ** used for fancy buildings
*/
unsigned Rs : 8;
unsigned char CurrentResource;
@@ -640,8 +640,8 @@
** attacked)?
*/
#define UnitUnusable(unit) \
- ( (unit)->Removed || (unit)->Orders[0].Action==UnitActionDie || \
- (unit)->Orders[0].Action==UnitActionBuilded)
+ ((unit)->Removed || (unit)->Orders[0].Action == UnitActionDie || \
+ (unit)->Orders[0].Action == UnitActionBuilded)
/**
** Returns unit number (unique to this unit)
@@ -724,7 +724,7 @@
extern char RevealAttacker; /// Config: reveal attacker enabled
extern const Viewport* CurrentViewport; /// CurrentViewport
extern void DrawUnitSelection(const Unit*);
-extern void (*DrawSelection)(int,int,int,int,int);
+extern void (*DrawSelection)(VMemType, int, int, int, int);
// in selection.c
extern Unit* Selected[MaxSelectable]; /// currently selected units
@@ -747,9 +747,9 @@
/// Create a new unit
extern Unit* MakeUnit(UnitType* type,Player* player);
/// Place an unit on map
-extern void PlaceUnit(Unit* unit,int x,int y);
+extern void PlaceUnit(Unit* unit, int x, int y);
/// Create a new unit and place on map
-extern Unit* MakeUnitAndPlace(int x,int y,UnitType* type,Player* player);
+extern Unit* MakeUnitAndPlace(int x, int y, UnitType* type,Player* player);
/// Add an unit inside a container. Only deal with list stuff.
extern void AddUnitInContainer(Unit* unit, Unit* host);
/// Remove an unit from inside a container. Only deals with list stuff.
@@ -759,18 +759,18 @@
/// Handle the loose of an unit (food,...)
extern void UnitLost(Unit* unit);
/// Remove the Orders of a Unit
-extern void UnitClearOrders(Unit *unit);
+extern void UnitClearOrders(Unit* unit);
/// FIXME: more docu
-extern void UpdateForNewUnit(const Unit* unit,int upgrade);
+extern void UpdateForNewUnit(const Unit* unit, int upgrade);
/// FIXME: more docu
-extern void NearestOfUnit(const Unit* unit,int tx,int ty,int *dx,int *dy);
+extern void NearestOfUnit(const Unit* unit, int tx, int ty, int *dx, int *dy);
/// Returns true, if unit is visible on the map
extern int UnitVisibleOnMap(const Unit* unit);
/// Returns true, if building is known on the map
extern int BuildingVisibleOnMap(const Unit* unit);
/// Updates seen data
-extern void UnitsMarkSeen(int x,int y);
+extern void UnitsMarkSeen(int x, int y);
/// Checks and updates if a Unit's seen information
extern void UnitMarkSeen(Unit* unit);
/// Returns true, if unit is known on the map
@@ -779,72 +779,72 @@
/// FIXME: more docu
extern int CheckUnitToBeDrawn(const Unit* unit);
/// FIXME: more docu
-extern void GetUnitMapArea( const Unit* unit,
- int *sx, int *sy, int *ex, int *ey );
+extern void GetUnitMapArea(const Unit* unit, int *sx, int *sy,
+ int *ex, int *ey);
#ifdef HIERARCHIC_PATHFINDER
/// FIXME: more docu
-extern int UnitGetNextPathSegment (const Unit * , int * , int * );
+extern int UnitGetNextPathSegment(const Unit*, int*, int*);
#endif
/// Check for rescue each second
extern void RescueUnits(void);
/// Change owner of unit
-extern void ChangeUnitOwner(Unit* unit,Player* newplayer);
+extern void ChangeUnitOwner(Unit* unit, Player* newplayer);
/// Convert direction (dx,dy) to heading (0-255)
-extern int DirectionToHeading(int,int);
+extern int DirectionToHeading(int, int);
/// Update frame from heading
extern void UnitUpdateHeading(Unit* unit);
/// Heading and frame from delta direction x,y
-extern void UnitHeadingFromDeltaXY(Unit* unit,int x,int y);
+extern void UnitHeadingFromDeltaXY(Unit* unit, int x, int y);
/// FIXME: more docu
-extern void DropOutOnSide(Unit* unit,int heading,int addx,int addy);
+extern void DropOutOnSide(Unit* unit, int heading, int addx, int addy);
/// FIXME: more docu
-extern void DropOutNearest(Unit* unit,int x,int y,int addx,int addy);
+extern void DropOutNearest(Unit* unit, int x, int y, int addx, int addy);
/// Drop out all units in the unit
extern void DropOutAll(const Unit* unit);
/// FIXME: more docu
-extern int CanBuildHere(const UnitType* type,int x,int y);
+extern int CanBuildHere(const UnitType* type, int x, int y);
/// FIXME: more docu
-extern int CanBuildOn(int x,int y,int mask);
+extern int CanBuildOn(int x, int y, int mask);
/// FIXME: more docu
-extern int CanBuildUnitType(const Unit* unit,const UnitType* type,int x,int y);
+extern int CanBuildUnitType(const Unit* unit,const UnitType* type, int x, int
y);
/// Find resource
-extern Unit* FindResource(const Unit* unit,int x,int y,int range,int resource);
+extern Unit* FindResource(const Unit* unit, int x, int y, int range, int
resource);
/// Find nearest deposit
-extern Unit* FindDeposit(const Unit* unit,int x,int y,int range,int resource);
+extern Unit* FindDeposit(const Unit* unit, int x, int y, int range, int
resource);
/// Find the next idle worker
extern Unit* FindIdleWorker(const Player* player,const Unit* last);
/// Find the neareast piece of terrain with specific flags.
-extern int FindTerrainType(int movemask,int resmask,int rvresult,int range,
- const Player *player,int x,int y,int* px,int* py);
+extern int FindTerrainType(int movemask, int resmask, int rvresult, int range,
+ const Player *player, int x, int y, int* px, int* py);
/// Find the nearest piece of wood in sight range
-extern int FindWoodInSight(const Unit* unit,int* x,int* y);
+extern int FindWoodInSight(const Unit* unit, int* x, int* y);
/// FIXME: more docu
-extern Unit* UnitOnScreen(Unit* unit,int x,int y);
+extern Unit* UnitOnScreen(Unit* unit, int x, int y);
/// Let an unit die
extern void LetUnitDie(Unit* unit);
/// Destory all units inside another unit
extern void DestroyAllInside(Unit* source);
/// Hit unit with damage, if destroyed give attacker the points
-extern void HitUnit(Unit* attacker,Unit* target,int damage);
+extern void HitUnit(Unit* attacker, Unit* target, int damage);
/// Returns the map distance between two points
-extern int MapDistance(int x1,int y1,int x2,int y2);
+extern int MapDistance(int x1, int y1, int x2, int y2);
/// Returns the map distance between two points with unit-type
-extern int MapDistanceToType(int x1,int y1,const UnitType* type,int x2,int y2);
+extern int MapDistanceToType(int x1, int y1,const UnitType* type, int x2, int
y2);
/// Returns the map distance to unit
-extern int MapDistanceToUnit(int x,int y,const Unit* dest);
+extern int MapDistanceToUnit(int x, int y,const Unit* dest);
/// Returns the map distance between two units
extern int MapDistanceBetweenUnits(const Unit* src,const Unit* dst);
/// Calculate the distance from current view point to coordinate
-extern int ViewPointDistance(int x,int y);
+extern int ViewPointDistance(int x, int y);
/// Calculate the distance from current view point to unit
extern int ViewPointDistanceToUnit(const Unit* dest);
@@ -877,19 +877,19 @@
/// Change unit position in cache
extern void UnitCacheChange(Unit* unit);
/// Select units in range
-extern int UnitCacheSelect(int x1,int y1,int x2,int y2,Unit** table);
+extern int UnitCacheSelect(int x1, int y1, int x2, int y2, Unit** table);
/// Select units on tile
-extern int UnitCacheOnTile(int x,int y,Unit** table);
+extern int UnitCacheOnTile(int x, int y, Unit** table);
/// Select unit on X,Y of type naval,fly,land
-extern Unit* UnitCacheOnXY(int x,int y,unsigned type);
+extern Unit* UnitCacheOnXY(int x, int y, unsigned type);
/// Print unit-cache statistic
extern void UnitCacheStatistic(void);
/// Initialize unit-cache
extern void InitUnitCache(void);
/// Inserts a corpse into the corpse list cache
-extern void DeadCacheInsert(Unit* unit,Unit** List );
+extern void DeadCacheInsert(Unit* unit, Unit** List);
/// Removes a corpse from the corpse cache
-extern void DeadCacheRemove(Unit* unit,Unit** List );
+extern void DeadCacheRemove(Unit* unit, Unit** List);
#define CorpseCacheInsert(unit) \
(DeadCacheInsert((unit),&CorpseList))
@@ -906,17 +906,17 @@
// in unit_draw.c
//--------------------
/// Draw nothing around unit
-extern void DrawSelectionNone(int,int,int,int,int);
+extern void DrawSelectionNone(VMemType, int, int, int, int);
/// Draw circle around unit
-extern void DrawSelectionCircle(int,int,int,int,int);
+extern void DrawSelectionCircle(VMemType, int, int, int, int);
/// Draw circle filled with alpha around unit
-extern void DrawSelectionCircleWithTrans(int,int,int,int,int);
+extern void DrawSelectionCircleWithTrans(VMemType, int, int, int, int);
/// Draw rectangle around unit
-extern void DrawSelectionRectangle(int,int,int,int,int);
+extern void DrawSelectionRectangle(VMemType, int, int, int, int);
/// Draw rectangle filled with alpha around unit
-extern void DrawSelectionRectangleWithTrans(int,int,int,int,int);
+extern void DrawSelectionRectangleWithTrans(VMemType, int, int, int, int);
/// Draw corners around unit
-extern void DrawSelectionCorners(int,int,int,int,int);
+extern void DrawSelectionCorners(VMemType, int, int, int, int);
/// Register CCL decorations features
extern void DecorationCclRegister(void);
@@ -937,33 +937,33 @@
// in unit_find.c
/// Select units in rectangle range
-extern int SelectUnits(int x1,int y1,int x2,int y2,Unit** table);
+extern int SelectUnits(int x1, int y1, int x2, int y2, Unit** table);
/// Select units on map tile
-extern int SelectUnitsOnTile(int x,int y,Unit** table);
+extern int SelectUnitsOnTile(int x, int y, Unit** table);
/// Find all units of this type
-extern int FindUnitsByType(const UnitType* type,Unit** table);
+extern int FindUnitsByType(const UnitType* type, Unit** table);
/// Find all units of this type of the player
-extern int FindPlayerUnitsByType(const Player*,const UnitType*,Unit**);
+extern int FindPlayerUnitsByType(const Player*,const UnitType*, Unit**);
/// Return any unit on that map tile
-extern Unit* UnitOnMapTile(int tx,int ty);
+extern Unit* UnitOnMapTile(int tx, int ty);
/// Return repairable unit on that map tile
-extern Unit* RepairableOnMapTile(int tx,int ty);
+extern Unit* RepairableOnMapTile(int tx, int ty);
/// Return possible attack target on a tile
extern Unit* TargetOnMapTile(const Unit* soruce, int tx, int ty);
/// Return possible attack target on that map area
-extern Unit* TargetOnMap(const Unit* unit,int x1,int y1,int x2,int y2);
+extern Unit* TargetOnMap(const Unit* unit, int x1, int y1, int x2, int y2);
/// Return transporter unit on that map tile
-extern Unit* TransporterOnMapTile(int tx,int ty);
+extern Unit* TransporterOnMapTile(int tx, int ty);
/// Return unit of a fixed type on a map tile.
-extern Unit* UnitTypeOnMap(int tx,int ty,UnitType* type);
+extern Unit* UnitTypeOnMap(int tx, int ty, UnitType* type);
/// Return resource, if on map tile
-extern Unit* ResourceOnMap(int tx,int ty,int resource);
+extern Unit* ResourceOnMap(int tx, int ty, int resource);
/// Return resource deposit, if on map tile
-extern Unit* ResourceDepositOnMap(int tx,int ty,int resource);
+extern Unit* ResourceDepositOnMap(int tx, int ty, int resource);
/// Find best enemy in numeric range to attack
-extern Unit* AttackUnitsInDistance(Unit* unit,int range);
+extern Unit* AttackUnitsInDistance(Unit* unit, int range);
/// Find best enemy in attack range to attack
extern Unit* AttackUnitsInRange(Unit* unit);
/// Find best enemy in reaction range to attack
@@ -987,23 +987,23 @@
/// Remove all units from a group
extern void ClearGroup(int num);
/// Add the array of units to the group
-extern void AddToGroup(Unit **units,int nunits,int num);
+extern void AddToGroup(Unit** units, int nunits, int num);
/// Set the contents of a particular group with an array of units
-extern void SetGroup(Unit **units,int nunits,int num);
+extern void SetGroup(Unit** units, int nunits, int num);
/// Remove a unit from a group
-extern void RemoveUnitFromGroups(Unit *unit);
+extern void RemoveUnitFromGroups(Unit* unit);
/// Register CCL group features
extern void GroupCclRegister(void);
// in selection.c
/// Check if unit is the currently only selected
-#define IsOnlySelected(unit) (NumSelected==1 && Selected[0]==(unit))
+#define IsOnlySelected(unit) (NumSelected == 1 && Selected[0] == (unit))
/// Clear current selection
extern void UnSelectAll(void);
/// Select group as selection
-extern void ChangeSelectedUnits(Unit** units,int num_units);
+extern void ChangeSelectedUnits(Unit** units, int num_units);
/// Add a unit to selection
extern int SelectUnit(Unit* unit);
/// Select one unit as selection
@@ -1023,17 +1023,17 @@
/// Select the units from the same group as the one in parameter
extern int SelectGroupFromUnit(Unit* unit);
/// Select the units in the selection rectangle
-extern int SelectUnitsInRectangle(int tx,int ty,int w,int h);
+extern int SelectUnitsInRectangle(int tx, int ty, int w, int h);
/// Select ground units in the selection rectangle
-extern int SelectGroundUnitsInRectangle(int tx,int ty,int w,int h);
+extern int SelectGroundUnitsInRectangle(int tx, int ty, int w, int h);
/// Select flying units in the selection rectangle
-extern int SelectAirUnitsInRectangle(int tx,int ty,int w,int h);
+extern int SelectAirUnitsInRectangle(int tx, int ty, int w, int h);
/// Add the units in the selection rectangle to the current selection
-extern int AddSelectedUnitsInRectangle(int tx,int ty,int w,int h);
+extern int AddSelectedUnitsInRectangle(int tx, int ty, int w, int h);
/// Add ground units in the selection rectangle to the current selection
-extern int AddSelectedGroundUnitsInRectangle(int tx,int ty,int w,int h);
+extern int AddSelectedGroundUnitsInRectangle(int tx, int ty, int w, int h);
/// Add flying units in the selection rectangle to the current selection
-extern int AddSelectedAirUnitsInRectangle(int tx,int ty,int w,int h);
+extern int AddSelectedAirUnitsInRectangle(int tx, int ty, int w, int h);
/// Init selections
extern void InitSelections(void);
Index: stratagus/src/include/video.h
diff -u stratagus/src/include/video.h:1.91 stratagus/src/include/video.h:1.92
--- stratagus/src/include/video.h:1.91 Fri Sep 12 13:44:37 2003
+++ stratagus/src/include/video.h Tue Oct 7 20:06:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: video.h,v 1.91 2003/09/12 17:44:37 n0body Exp $
+// $Id: video.h,v 1.92 2003/10/08 00:06:42 jsalmon3 Exp $
#ifndef __VIDEO_H__
#define __VIDEO_H__
@@ -75,10 +75,10 @@
-- Declarations
----------------------------------------------------------------------------*/
-typedef unsigned char VMemType8; /// 8 bpp modes pointer
-typedef unsigned short VMemType16; /// 16 bpp modes pointer
-typedef struct { char a,b,c;} VMemType24;/// 24 bpp modes pointer
-typedef unsigned int VMemType32; /// 32 bpp modes pointer
+typedef unsigned char VMemType8; /// 8 bpp modes pointer
+typedef unsigned short VMemType16; /// 16 bpp modes pointer
+typedef struct { char a, b, c;} VMemType24; /// 24 bpp modes pointer
+typedef unsigned int VMemType32; /// 32 bpp modes pointer
/**
** General video mode pointer.
@@ -129,20 +129,16 @@
// FIXME: not quite correct for new multiple palette version
/// System-Wide used colors.
-enum _sys_colors_ {
- ColorBlack = 0, /// use for black
- ColorDarkGreen = 149,
- ColorBlue = 206,
- ColorOrange = 224,
- ColorWhite = 246,
- ColorNPC = 247,
- ColorGray = 248,
- ColorRed = 249,
- ColorGreen = 250,
- ColorYellow = 251,
- ColorBlinkRed = 252,
- ColorViolet = 253,
-};
+extern VMemType ColorBlack;
+extern VMemType ColorDarkGreen;
+extern VMemType ColorBlue;
+extern VMemType ColorOrange;
+extern VMemType ColorWhite;
+extern VMemType ColorNPC;
+extern VMemType ColorGray;
+extern VMemType ColorRed;
+extern VMemType ColorGreen;
+extern VMemType ColorYellow;
extern int ColorWaterCycleStart; /// color # start for color cycling
extern int ColorWaterCycleEnd; /// color # end for color cycling
@@ -173,132 +169,38 @@
** General graphic object type.
*/
typedef struct _graphic_type_ {
- /**
- ** Draw the object unclipped.
- **
- ** @param o pointer to object
- ** @param f number of frame (object index)
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*Draw) (const Graphic* o,unsigned f,int x,int y);
- /**
- ** Draw the object unclipped and flipped in X direction.
- **
- ** @param o pointer to object
- ** @param f number of frame (object index)
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*DrawX) (const Graphic* o,unsigned f,int x,int y);
- /**
- ** Draw the object clipped to the current clipping.
- **
- ** @param o pointer to object
- ** @param f number of frame (object index)
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*DrawClip) (const Graphic* o,unsigned f,int x,int y);
- /**
- ** Draw the object clipped and flipped in X direction.
- **
- ** @param o pointer to object
- ** @param f number of frame (object index)
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*DrawClipX) (const Graphic* o,unsigned f,int x,int y);
- /**
- ** Draw the shadow object clipped to the current clipping.
- **
- ** @param o pointer to object
- ** @param f number of frame (object index)
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*DrawShadowClip) (const Graphic* o,unsigned f,int x,int y);
- /**
- ** Draw the shadow object clipped and flipped in X direction.
- **
- ** @param o pointer to object
- ** @param f number of frame (object index)
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*DrawShadowClipX) (const Graphic* o,unsigned f,int x,int y);
- /**
- ** Draw part of the object unclipped.
- **
- ** @param o pointer to object
- ** @param gx X offset into object
- ** @param gy Y offset into object
- ** @param w width to display
- ** @param h height to display
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*DrawSub) (const Graphic* o,int gx,int gy
- ,int w,int h,int x,int y);
- /**
- ** Draw part of the object unclipped and flipped in X direction.
- **
- ** @param o pointer to object
- ** @param gx X offset into object
- ** @param gy Y offset into object
- ** @param w width to display
- ** @param h height to display
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*DrawSubX) (const Graphic* o,int gx,int gy
- ,int w,int h,int x,int y);
- /**
- ** Draw part of the object clipped to the current clipping.
- **
- ** @param o pointer to object
- ** @param gx X offset into object
- ** @param gy Y offset into object
- ** @param w width to display
- ** @param h height to display
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*DrawSubClip) (const Graphic* o,int gx,int gy
- ,int w,int h,int x,int y);
- /**
- ** Draw part of the object clipped and flipped in X direction.
- **
- ** @param o pointer to object
- ** @param gx X offset into object
- ** @param gy Y offset into object
- ** @param w width to display
- ** @param h height to display
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
- void (*DrawSubClipX)(const Graphic* o,int gx,int gy
- ,int w,int h,int x,int y);
-
- /**
- ** Draw the object unclipped and zoomed.
- **
- ** @param o pointer to object
- ** @param f number of frame (object index)
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param z Zoom factor X 10 (10 = 1:1).
- */
- void (*DrawZoom) (const Graphic* o,unsigned f,int x,int y,int z);
+ /// Draw the object unclipped.
+ void (*Draw)(const Graphic* o, unsigned f, int x, int y);
+ /// Draw the object unclipped and flipped in X direction.
+ void (*DrawX)(const Graphic* o, unsigned f, int x, int y);
+ /// Draw the object clipped to the current clipping.
+ void (*DrawClip)(const Graphic* o, unsigned f, int x, int y);
+ /// Draw the object clipped and flipped in X direction.
+ void (*DrawClipX)(const Graphic* o, unsigned f, int x, int y);
+ /// Draw the shadow object clipped to the current clipping.
+ void (*DrawShadowClip)(const Graphic* o, unsigned f, int x, int y);
+ /// Draw the shadow object clipped and flipped in X direction.
+ void (*DrawShadowClipX)(const Graphic* o, unsigned f, int x, int y);
+ /// Draw part of the object unclipped.
+ void (*DrawSub)(const Graphic* o, int gx, int gy,
+ int w, int h, int x, int y);
+ /// Draw part of the object unclipped and flipped in X direction.
+ void (*DrawSubX)(const Graphic* o, int gx, int gy,
+ int w, int h, int x, int y);
+ /// Draw part of the object clipped to the current clipping.
+ void (*DrawSubClip)(const Graphic* o, int gx, int gy,
+ int w, int h, int x, int y);
+ /// Draw part of the object clipped and flipped in X direction.
+ void (*DrawSubClipX)(const Graphic* o, int gx, int gy,
+ int w, int h, int x, int y);
+
+ /// Draw the object unclipped and zoomed.
+ void (*DrawZoom)(const Graphic* o, unsigned f, int x, int y, int z);
// FIXME: add zooming functions.
- /*
- ** Free the object.
- **
- ** @param o pointer to object
- */
- void (*Free) (Graphic* o);
+ /// Free the object.
+ void (*Free)(Graphic* o);
} GraphicType;
/**
@@ -323,7 +225,7 @@
GLfloat TextureWidth; /// Width of the texture
GLfloat TextureHeight; /// Height of the texture
int NumTextureNames; /// Number of textures
- GLuint *TextureNames; /// Texture names
+ GLuint* TextureNames; /// Texture names
#endif
};
@@ -360,25 +262,25 @@
typedef struct _event_callback_ {
/// Callback for mouse button press
- void (*ButtonPressed)(unsigned buttons);
+ void (*ButtonPressed)(unsigned buttons);
/// Callback for mouse button release
- void (*ButtonReleased)(unsigned buttons);
+ void (*ButtonReleased)(unsigned buttons);
/// Callback for mouse move
- void (*MouseMoved)(int x,int y);
+ void (*MouseMoved)(int x, int y);
/// Callback for mouse exit of game window
- void (*MouseExit)(void);
+ void (*MouseExit)(void);
/// Callback for key press
- void (*KeyPressed)(unsigned keycode,unsigned keychar);
+ void (*KeyPressed)(unsigned keycode, unsigned keychar);
/// Callback for key release
- void (*KeyReleased)(unsigned keycode,unsigned keychar);
+ void (*KeyReleased)(unsigned keycode, unsigned keychar);
/// Callback for key repeated
- void (*KeyRepeated)(unsigned keycode,unsigned keychar);
+ void (*KeyRepeated)(unsigned keycode, unsigned keychar);
/// Callback for network event
- void (*NetworkEvent)(void);
+ void (*NetworkEvent)(void);
/// Callback for sound output ready
- void (*SoundReady)(void);
+ void (*SoundReady)(void);
} EventCallback;
@@ -400,9 +302,7 @@
// 1 if mouse cursor is inside main window, else 0
extern int InMainWindow;
- /**
- ** Wanted videomode, fullscreen or windowed.
- */
+ /// Wanted videomode, fullscreen or windowed.
extern char VideoFullScreen;
/**
@@ -471,14 +371,13 @@
/// FIXME: docu
extern VMemType8 *lookup50trans8;
/// FIXME: docu
-extern void (*VideoAllocPalette8)( Palette *palette,
- Palette *syspalette,
- unsigned long syspalette_defined[8] );
+extern void (*VideoAllocPalette8)(Palette* palette, Palette* syspalette,
+ unsigned long syspalette_defined[8]);
//FIXME: following function should be local in video.c, but this will also
// need VideoCreateNewPalette to be there (will all video still work?).
/// FIXME: docu
-extern global VMemType8* VideoFindNewPalette8( const VMemType8 *cube,
- const Palette *palette );
+extern global VMemType8* VideoFindNewPalette8(const VMemType8 *cube,
+ const Palette *palette);
/**
@@ -498,588 +397,206 @@
*/
extern volatile int VideoInterrupts;
- /**
- ** Draw pixel unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
-extern void (*VideoDrawPixel)(SysColors color,int x,int y);
+ /// Draw pixel unclipped.
+extern void (*VideoDrawPixel)(VMemType color, int x, int y);
- /**
- ** Draw 25% translucent pixel (Alpha=64) unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
-extern void (*VideoDraw25TransPixel)(SysColors color,int x,int y);
+ /// Draw 25% translucent pixel (Alpha=64) unclipped.
+extern void (*VideoDraw25TransPixel)(VMemType color, int x, int y);
- /**
- ** Draw 50% translucent pixel (Alpha=128) unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
-extern void (*VideoDraw50TransPixel)(SysColors color,int x,int y);
+ /// Draw 50% translucent pixel (Alpha=128) unclipped.
+extern void (*VideoDraw50TransPixel)(VMemType color, int x, int y);
- /**
- ** Draw 75% translucent pixel (Alpha=192) unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
-extern void (*VideoDraw75TransPixel)(SysColors color,int x,int y);
+ /// Draw 75% translucent pixel (Alpha=192) unclipped.
+extern void (*VideoDraw75TransPixel)(VMemType color, int x, int y);
- /**
- ** Draw translucent pixel unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param alpha alpha value of pixel.
- */
-extern void (*VideoDrawTransPixel)(SysColors color,int x,int y,unsigned char
alpha);
+ /// Draw translucent pixel unclipped.
+extern void (*VideoDrawTransPixel)(VMemType color, int x, int y,
+ unsigned char alpha);
- /**
- ** Draw pixel clipped to current clip setting.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
-extern void (*VideoDrawPixelClip)(SysColors color,int x,int y);
+ /// Draw pixel clipped to current clip setting.
+extern void (*VideoDrawPixelClip)(VMemType color, int x, int y);
- /**
- ** Draw 25% translucent pixel clipped to current clip setting.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
-extern void VideoDraw25TransPixelClip(SysColors color,int x,int y);
+ /// Draw 25% translucent pixel clipped to current clip setting.
+extern void VideoDraw25TransPixelClip(VMemType color, int x, int y);
- /**
- ** Draw 50% translucent pixel clipped to current clip setting.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
-extern void VideoDraw50TransPixelClip(SysColors color,int x,int y);
+ /// Draw 50% translucent pixel clipped to current clip setting.
+extern void VideoDraw50TransPixelClip(VMemType color, int x, int y);
- /**
- ** Draw 75% translucent pixel clipped to current clip setting.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- */
-extern void VideoDraw75TransPixelClip(SysColors color,int x,int y);
+ /// Draw 75% translucent pixel clipped to current clip setting.
+extern void VideoDraw75TransPixelClip(VMemType color, int x, int y);
- /**
- ** Draw translucent pixel clipped to current clip setting.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param alpha alpha value of pixel.
- */
-extern void VideoDrawTransPixelClip(SysColors color,int x,int y,unsigned char
alpha);
+ /// Draw translucent pixel clipped to current clip setting.
+extern void VideoDrawTransPixelClip(VMemType color, int x, int y,
+ unsigned char alpha);
- /**
- ** Draw vertical line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- */
-extern void (*VideoDrawVLine)(SysColors color,int x,int y
- ,int height);
+ /// Draw vertical line unclipped.
+extern void (*VideoDrawVLine)(VMemType color, int x, int y,
+ int height);
- /**
- ** Draw 25% translucent vertical line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- */
-extern void (*VideoDraw25TransVLine)(SysColors color,int x,int y
- ,int height);
+ /// Draw 25% translucent vertical line unclipped.
+extern void (*VideoDraw25TransVLine)(VMemType color, int x, int y,
+ int height);
- /**
- ** Draw 50% translucent vertical line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- */
-extern void (*VideoDraw50TransVLine)(SysColors color,int x,int y
- ,int height);
+ /// Draw 50% translucent vertical line unclipped.
+extern void (*VideoDraw50TransVLine)(VMemType color, int x, int y,
+ int height);
- /**
- ** Draw 75% translucent vertical line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- */
-extern void (*VideoDraw75TransVLine)(SysColors color,int x,int y
- ,int height);
+ /// Draw 75% translucent vertical line unclipped.
+extern void (*VideoDraw75TransVLine)(VMemType color, int x, int y,
+ int height);
- /**
- ** Draw translucent vertical line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- ** @param alpha alpha value of pixel.
- */
-extern void (*VideoDrawTransVLine)(SysColors color,int x,int y
- ,int height,unsigned char alpha);
+ /// Draw translucent vertical line unclipped.
+extern void (*VideoDrawTransVLine)(VMemType color, int x, int y,
+ int height, unsigned char alpha);
- /**
- ** Draw vertical line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- */
-extern void VideoDrawVLineClip(SysColors color,int x,int y
- ,int height);
+ /// Draw vertical line clipped to current clip setting
+extern void VideoDrawVLineClip(VMemType color, int x, int y,
+ int height);
- /**
- ** Draw 25% translucent vertical line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- */
-extern void VideoDraw25TransVLineClip(SysColors color,int x,int y
- ,int height);
+ /// Draw 25% translucent vertical line clipped to current clip
setting
+extern void VideoDraw25TransVLineClip(VMemType color, int x, int y,
+ int height);
- /**
- ** Draw 50% translucent vertical line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- */
-extern void VideoDraw50TransVLineClip(SysColors color,int x,int y
- ,int height);
+ /// Draw 50% translucent vertical line clipped to current clip
setting
+extern void VideoDraw50TransVLineClip(VMemType color, int x, int y,
+ int height);
- /**
- ** Draw 75% translucent vertical line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- */
-extern void VideoDraw75TransVLineClip(SysColors color,int x,int y
- ,int height);
+ /// Draw 75% translucent vertical line clipped to current clip
setting
+extern void VideoDraw75TransVLineClip(VMemType color, int x, int y,
+ int height);
- /**
- ** Draw translucent vertical line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param height height of line.
- ** @param alpha alpha value of pixel.
- */
-extern void VideoDrawTransVLineClip(SysColors color,int x,int y
- ,int height,unsigned char alpha);
+ /// Draw translucent vertical line clipped to current clip setting
+extern void VideoDrawTransVLineClip(VMemType color, int x, int y,
+ int height, unsigned char alpha);
- /**
- ** Draw horizontal line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- */
-extern void (*VideoDrawHLine)(SysColors color,int x,int y
- ,int width);
+ /// Draw horizontal line unclipped.
+extern void (*VideoDrawHLine)(VMemType color, int x, int y,
+ int width);
- /**
- ** Draw 25% translucent horizontal line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- */
-extern void (*VideoDraw25TransHLine)(SysColors color,int x,int y
- ,int width);
+ /// Draw 25% translucent horizontal line unclipped.
+extern void (*VideoDraw25TransHLine)(VMemType color, int x, int y,
+ int width);
- /**
- ** Draw 50% translucent horizontal line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- */
-extern void (*VideoDraw50TransHLine)(SysColors color,int x,int y
- ,int width);
+ /// Draw 50% translucent horizontal line unclipped.
+extern void (*VideoDraw50TransHLine)(VMemType color, int x, int y,
+ int width);
- /**
- ** Draw 75% translucent horizontal line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- */
-extern void (*VideoDraw75TransHLine)(SysColors color,int x,int y
- ,int width);
+ /// Draw 75% translucent horizontal line unclipped.
+extern void (*VideoDraw75TransHLine)(VMemType color, int x, int y,
+ int width);
- /**
- ** Draw translucent horizontal line unclipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- ** @param alpha alpha value of pixel.
- */
-extern void (*VideoDrawTransHLine)(SysColors color,int x,int y
- ,int width,unsigned char alpha);
+ /// Draw translucent horizontal line unclipped.
+extern void (*VideoDrawTransHLine)(VMemType color, int x, int y,
+ int width, unsigned char alpha);
- /**
- ** Draw horizontal line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- */
-extern void VideoDrawHLineClip(SysColors color,int x,int y
- ,int width);
+ /// Draw horizontal line clipped to current clip setting
+extern void VideoDrawHLineClip(VMemType color, int x, int y,
+ int width);
- /**
- ** Draw 25% translucent horizontal line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- */
-extern void VideoDraw25TransHLineClip(SysColors color,int x,int y
- ,int width);
+ /// Draw 25% translucent horizontal line clipped to current clip
setting
+extern void VideoDraw25TransHLineClip(VMemType color, int x, int y,
+ int width);
- /**
- ** Draw 50% translucent horizontal line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- */
-extern void VideoDraw50TransHLineClip(SysColors color,int x,int y
- ,int width);
+ /// Draw 50% translucent horizontal line clipped to current clip
setting
+extern void VideoDraw50TransHLineClip(VMemType color, int x, int y,
+ int width);
- /**
- ** Draw 75% translucent horizontal line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- */
-extern void VideoDraw75TransHLineClip(SysColors color,int x,int y
- ,int width);
+ /// Draw 75% translucent horizontal line clipped to current clip
setting
+extern void VideoDraw75TransHLineClip(VMemType color, int x, int y,
+ int width);
- /**
- ** Draw translucent horizontal line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param width width of line.
- ** @param alpha alpha value of pixel.
- */
-extern void VideoDrawTransHLineClip(SysColors color,int x,int y
- ,int width,unsigned char alpha);
+ /// Draw translucent horizontal line clipped to current clip setting
+extern void VideoDrawTransHLineClip(VMemType color, int x, int y,
+ int width, unsigned char alpha);
- /**
- ** Draw line unclipped.
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- */
-extern void (*VideoDrawLine)(SysColors color,int sx,int sy,int dx,int dy);
+ /// Draw line unclipped.
+extern void (*VideoDrawLine)(VMemType color, int sx, int sy, int dx, int dy);
- /**
- ** Draw 25% translucent line unclipped.
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- */
-extern void (*VideoDraw25TransLine)(SysColors color,int sx,int sy
- ,int dx,int dy);
+ /// Draw 25% translucent line unclipped.
+extern void (*VideoDraw25TransLine)(VMemType color, int sx, int sy,
+ int dx, int dy);
- /**
- ** Draw 50% translucent line unclipped.
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- */
-extern void (*VideoDraw50TransLine)(SysColors color,int sx,int sy
- ,int dx,int dy);
+ /// Draw 50% translucent line unclipped.
+extern void (*VideoDraw50TransLine)(VMemType color, int sx, int sy,
+ int dx, int dy);
- /**
- ** Draw 75% translucent line unclipped.
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- */
-extern void (*VideoDraw75TransLine)(SysColors color,int sx,int sy
- ,int dx,int dy);
+ /// Draw 75% translucent line unclipped.
+extern void (*VideoDraw75TransLine)(VMemType color, int sx, int sy,
+ int dx, int dy);
- /**
- ** Draw translucent line unclipped.
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- ** @param alpha alpha value of pixel.
- */
-extern void (*VideoDrawTransLine)(SysColors color,int sx,int sy,int dx,int dy
- ,unsigned char alpha);
+ /// Draw translucent line unclipped.
+extern void (*VideoDrawTransLine)(VMemType color, int sx, int sy, int dx, int
dy,
+ unsigned char alpha);
- /**
- ** Draw line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- */
-extern void VideoDrawLineClip(SysColors color,int sx,int sy,int dx,int dy);
+ /// Draw line clipped to current clip setting
+extern void VideoDrawLineClip(VMemType color, int sx, int sy, int dx, int dy);
- /**
- ** Draw 25% translucent line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- */
-extern void VideoDraw25TransLineClip(SysColors color,int sx,int sy
- ,int dx,int dy);
+ /// Draw 25% translucent line clipped to current clip setting
+extern void VideoDraw25TransLineClip(VMemType color, int sx, int sy,
+ int dx, int dy);
- /**
- ** Draw 50% translucent line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- */
-extern void VideoDraw50TransLineClip(SysColors color,int sx,int sy,
- int dx,int dy);
+ /// Draw 50% translucent line clipped to current clip setting
+extern void VideoDraw50TransLineClip(VMemType color, int sx, int sy,
+ int dx, int dy);
- /**
- ** Draw 75% translucent line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- */
-extern void VideoDraw75TransLineClip(SysColors color,int sx,int sy
- ,int dx,int dy);
+ /// Draw 75% translucent line clipped to current clip setting
+extern void VideoDraw75TransLineClip(VMemType color, int sx, int sy,
+ int dx, int dy);
- /**
- ** Draw translucent line clipped to current clip setting
- **
- ** @param color Color index.
- ** @param sx Source x coordinate on the screen
- ** @param sy Source y coordinate on the screen
- ** @param dx Destination x coordinate on the screen
- ** @param dy Destination y coordinate on the screen
- ** @param alpha alpha value of pixel.
- */
-extern void VideoDrawTransLineClip(SysColors color,int sx,int sy
- ,int dx,int dy,unsigned char alpha);
+ /// Draw translucent line clipped to current clip setting
+extern void VideoDrawTransLineClip(VMemType color, int sx, int sy,
+ int dx, int dy, unsigned char alpha);
- /**
- ** Draw rectangle.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- */
-extern void (*VideoDrawRectangle)(SysColors color,int x,int y
- ,int w,int h);
+ /// Draw rectangle.
+extern void (*VideoDrawRectangle)(VMemType color, int x, int y,
+ int w, int h);
- /**
- ** Draw 25% translucent rectangle.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- */
-extern void (*VideoDraw25TransRectangle)(SysColors color,int x,int y
- ,int w,int h);
+ /// Draw 25% translucent rectangle.
+extern void (*VideoDraw25TransRectangle)(VMemType color, int x, int y,
+ int w, int h);
- /**
- ** Draw 50% translucent rectangle.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- */
-extern void (*VideoDraw50TransRectangle)(SysColors color,int x,int y
- ,int w,int h);
+ /// Draw 50% translucent rectangle.
+extern void (*VideoDraw50TransRectangle)(VMemType color, int x, int y,
+ int w, int h);
- /**
- ** Draw 75% translucent rectangle.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- */
-extern void (*VideoDraw75TransRectangle)(SysColors color,int x,int y
- ,int w,int h);
+ /// Draw 75% translucent rectangle.
+extern void (*VideoDraw75TransRectangle)(VMemType color, int x, int y,
+ int w, int h);
- /**
- ** Draw translucent rectangle.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- ** @param alpha alpha value of pixel.
- */
-extern void (*VideoDrawTransRectangle)(SysColors color,int x,int y
- ,int w,int h,unsigned char alpha);
+ /// Draw translucent rectangle.
+extern void (*VideoDrawTransRectangle)(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha);
- /**
- ** Draw rectangle clipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- */
-extern void VideoDrawRectangleClip(SysColors color,int x,int y
- ,int w,int h);
+ /// Draw rectangle clipped.
+extern void VideoDrawRectangleClip(VMemType color, int x, int y,
+ int w, int h);
- /**
- ** Draw 25% translucent rectangle clipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- */
-extern void VideoDraw25TransRectangleClip(SysColors color,int x,int y
- ,int w,int h);
+ /// Draw 25% translucent rectangle clipped.
+extern void VideoDraw25TransRectangleClip(VMemType color, int x, int y,
+ int w, int h);
- /**
- ** Draw 50% translucent rectangle clipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- */
-extern void VideoDraw50TransRectangleClip(SysColors color,int x,int y
- ,int w,int h);
+ /// Draw 50% translucent rectangle clipped.
+extern void VideoDraw50TransRectangleClip(VMemType color, int x, int y,
+ int w, int h);
- /**
- ** Draw 75% translucent rectangle clipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- */
-extern void VideoDraw75TransRectangleClip(SysColors color,int x,int y
- ,int w,int h);
+ /// Draw 75% translucent rectangle clipped.
+extern void VideoDraw75TransRectangleClip(VMemType color, int x, int y,
+ int w, int h);
- /**
- ** Draw translucent rectangle clipped.
- **
- ** @param color Color index.
- ** @param x x coordinate on the screen
- ** @param y y coordinate on the screen
- ** @param h height of rectangle.
- ** @param w width of rectangle.
- ** @param alpha alpha value of pixel.
- */
-extern void VideoDrawTransRectangleClip(SysColors color,int x,int y
- ,int w,int h,unsigned char alpha);
+ /// Draw translucent rectangle clipped.
+extern void VideoDrawTransRectangleClip(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha);
- /**
- ** Draw 8bit raw graphic data clipped, using given pixel pallette
- **
- ** @param pixels VMemTypeXX 256 color palette to translate given data
- ** ( @note it has proper type VMemType8..VMemType32)
- ** @param data raw graphic data in 8bit color indexes of above palette
- ** @param x left-top corner x coordinate in pixels on the screen
- ** @param y left-top corner y coordinate in pixels on the screen
- ** @param w width of above graphic data in pixels
- ** @param h height of above graphic data in pixels
- */
-extern void (*VideoDrawRawClip)( VMemType *pixels,
- const unsigned char *data,
- int x, int y,
- int w, int h );
+ /// Draw 8bit raw graphic data clipped, using given pixel pallette
+extern void (*VideoDrawRawClip)(VMemType *pixels, const unsigned char *data,
+ int x, int y, int w, int h);
/// Does ColorCycling..
extern void (*ColorCycle)(void);
- /**
- ** Draw part of a graphic clipped and faded.
- */
-extern void VideoDrawSubClipFaded(Graphic* graphic,int gx,int gy,
- int w,int h,int x,int y,unsigned char fade);
+ /// Draw part of a graphic clipped and faded.
+extern void VideoDrawSubClipFaded(Graphic* graphic, int gx, int gy,
+ int w, int h, int x, int y, unsigned char fade);
/*----------------------------------------------------------------------------
-- Macros
@@ -1093,66 +610,66 @@
#define VideoGraphicFrames(o) ((o)->NumFrames)
/// Draw a graphic object unclipped.
-#define VideoDraw(o,f,x,y) ((o)->Type->Draw)((o),(f),(x),(y))
+#define VideoDraw(o, f, x, y) ((o)->Type->Draw)((o), (f), (x), (y))
/// Draw a graphic object unclipped and flipped in X direction.
-#define VideoDrawX(o,f,x,y) ((o)->Type->DrawX)((o),(f),(x),(y))
+#define VideoDrawX(o, f, x, y) ((o)->Type->DrawX)((o), (f), (x), (y))
/// Draw a graphic object clipped to the current clipping.
-#define VideoDrawClip(o,f,x,y) ((o)->Type->DrawClip)((o),(f),(x),(y))
+#define VideoDrawClip(o, f, x, y) ((o)->Type->DrawClip)((o), (f), (x),
(y))
/// Draw a graphic object clipped and flipped in X direction.
-#define VideoDrawClipX(o,f,x,y) ((o)->Type->DrawClipX)((o),(f),(x),(y))
+#define VideoDrawClipX(o, f, x, y) ((o)->Type->DrawClipX)((o), (f), (x),
(y))
/// Draw a shadow graphic object clipped to the current clipping.
-#define VideoDrawShadowClip(o,f,x,y)
((o)->Type->DrawShadowClip)((o),(f),(x),(y))
+#define VideoDrawShadowClip(o, f, x, y)
((o)->Type->DrawShadowClip)((o),(f),(x),(y))
/// Draw a shadow graphic object clipped and flipped in X direction.
-#define VideoDrawShadowClipX(o,f,x,y)
((o)->Type->DrawShadowClipX)((o),(f),(x),(y))
+#define VideoDrawShadowClipX(o, f, x, y)
((o)->Type->DrawShadowClipX)((o),(f),(x),(y))
/// Draw a part of graphic object unclipped.
-#define VideoDrawSub(o,ix,iy,w,h,x,y) \
- ((o)->Type->DrawSub)((o),(ix),(iy),(w),(h),(x),(y))
+#define VideoDrawSub(o, ix, iy, w, h, x, y) \
+ ((o)->Type->DrawSub)((o), (ix), (iy), (w), (h), (x), (y))
/// Draw a part of graphic object unclipped and flipped in X
direction.
-#define VideoDrawSubX(o,ix,iy,w,h,x,y) \
- ((o)->Type->DrawSubX)((o),(ix),(iy),(w),(h),(x),(y))
+#define VideoDrawSubX(o, ix, iy, w, h, x, y) \
+ ((o)->Type->DrawSubX)((o), (ix), (iy), (w), (h), (x), (y))
/// Draw a part of graphic object clipped to the current clipping.
-#define VideoDrawSubClip(o,ix,iy,w,h,x,y) \
- ((o)->Type->DrawSubClip)((o),(ix),(iy),(w),(h),(x),(y))
+#define VideoDrawSubClip(o, ix, iy, w, h, x, y) \
+ ((o)->Type->DrawSubClip)((o), (ix), (iy), (w), (h), (x), (y))
/// Draw a part of graphic object clipped and flipped in X
direction.
-#define VideoDrawSubClipX(o,ix,iy,w,h,x,y) \
- ((o)->Type->DrawSubClipX)((o),(ix),(iy),(w),(h),(x),(y))
+#define VideoDrawSubClipX(o, ix, iy, w, h, x, y) \
+ ((o)->Type->DrawSubClipX)((o), (ix), (iy), (w), (h), (x), (y))
#if 0
// FIXME: not written
/// Draw a graphic object zoomed unclipped.
-#define VideoDrawZoom(o,f,x,y,z) \
- ((o)->Type->DrawZoom)((o),(f),(x),(y),(z))
+#define VideoDrawZoom(o, f, x, y, z) \
+ ((o)->Type->DrawZoom)((o), (f), (x), (y), (z))
/// Draw a graphic object zoomed unclipped flipped in X direction.
-#define VideoDrawZoomX(o,f,x,y,z) \
- ((o)->Type->DrawZoomX)((o),(f),(x),(y),(z))
+#define VideoDrawZoomX(o, f, x, y, z) \
+ ((o)->Type->DrawZoomX)((o), (f), (x), (y), (z))
/// Draw a graphic object zoomed clipped to the current clipping.
-#define VideoDrawZoomClip(o,f,x,y,z) \
- ((o)->Type->DrawZoomClip)((o),(f),(x),(y),(z))
+#define VideoDrawZoomClip(o, f, x, y, z) \
+ ((o)->Type->DrawZoomClip)((o), (f), (x), (y), (z))
/// Draw a graphic object zoomed clipped and flipped in X direction.
-#define VideoDrawZoomClipX(o,f,x,y,z) \
- ((o)->Type->DrawZoomClipX)((o),(f),(x),(y),(z))
+#define VideoDrawZoomClipX(o, f, x, y, z) \
+ ((o)->Type->DrawZoomClipX)((o), (f), (x), (y), (z))
/// Draw a part of graphic object zoomed unclipped.
-#define VideoDrawZoomSub(o,ix,iy,w,h,x,y,z) \
- ((o)->Type->DrawZoomSub)((o),(ix),(iy),(w),(h),(x),(y),(z))
+#define VideoDrawZoomSub(o, ix, iy, w, h, x, y, z) \
+ ((o)->Type->DrawZoomSub)((o), (ix), (iy), (w), (h), (x), (y), (z))
/// Draw a part of graphic object zoomed unclipped flipped in X
direction.
-#define VideoDrawZoomSubX(o,ix,iy,w,h,x,y,z) \
- ((o)->Type->DrawZoomSubX)((o),(ix),(iy),(w),(h),(x),(y),(z))
+#define VideoDrawZoomSubX(o, ix, iy, w, h, x, y, z) \
+ ((o)->Type->DrawZoomSubX)((o), (ix), (iy), (w), (h), (x), (y), (z))
/// Draw a part of graphic object zoomed clipped to the current
clipping.
-#define VideoDrawZoomSubClip(o,ix,iy,w,h,x,y,z) \
- ((o)->Type->DrawZoomSubClip)((o),(ix),(iy),(w),(h),(x),(y),(z))
+#define VideoDrawZoomSubClip(o, ix, iy, w, h, x, y, z) \
+ ((o)->Type->DrawZoomSubClip)((o), (ix), (iy), (w), (h), (x), (y), (z))
/// Draw a part of graphic object zoomed clipped flipped in X
direction.
-#define VideoDrawZoomSubClipX(o,ix,iy,w,h,x,y,z) \
- ((o)->Type->DrawZoomSubClipX)((o),(ix),(iy),(w),(h),(x),(y),(z))
+#define VideoDrawZoomSubClipX(o, ix, iy, w, h, x, y, z) \
+ ((o)->Type->DrawZoomSubClipX)((o), (ix), (iy), (w), (h), (x), (y), (z))
#endif
/// Free a graphic object.
-#define VideoFree(o) ((o)->Type->Free)((o))
+#define VideoFree(o) ((o)->Type->Free)((o))
/// Save (NULL) free a graphic object.
#define VideoSaveFree(o) \
- do { if( (o) ) ((o)->Type->Free)((o)); } while( 0 )
+ do { if ((o)) ((o)->Type->Free)((o)); } while(0)
/*----------------------------------------------------------------------------
@@ -1162,23 +679,15 @@
/// initialize the video part
extern void InitVideo(void);
- /**
- ** Invalidates selected area on window or screen. Use for accurate
- ** redrawing. in so
- ** @param x x screen coordinate
- ** @param y y screen coordinate
- ** @param w width in pixel
- ** @param h height in pixel
- */
-extern void InvalidateArea(int x,int y,int w,int h);
+ /// Invalidates selected area on window or screen. Use for accurate
+ /// redrawing. in so
+extern void InvalidateArea(int x, int y, int w, int h);
/// Simply invalidates whole window or screen.
extern void Invalidate(void);
- /**
- ** Realize videomemory. X11 implemenataion just does XFlush.
- ** SVGALIB without linear addressing should use this.
- */
+ /// Realize videomemory. X11 implemenataion just does XFlush.
+ /// SVGALIB without linear addressing should use this.
extern void RealizeVideoMemory(void);
/// Process all system events. Returns if the time for a frame is
over
@@ -1189,28 +698,29 @@
#ifdef USE_OPENGL
/// Make an OpenGL texture
-extern void MakeTexture(Graphic* graphic,int width,int height);
+extern void MakeTexture(Graphic* graphic, int width, int height);
/// Make an OpenGL texture of the player color pixels only.
-extern void MakePlayerColorTexture(Graphic** g,Graphic* graphic,int
frame,unsigned char *map,int maplen);
+extern void MakePlayerColorTexture(Graphic** g, Graphic* graphic, int frame,
+ unsigned char* map, int maplen);
#endif
/// Save a screenshot to a PNG file
extern void SaveScreenshotPNG(const char* name);
/// New graphic
-extern Graphic* NewGraphic(unsigned d,int w,int h);
+extern Graphic* NewGraphic(unsigned d, int w, int h);
/// Make graphic
-extern Graphic* MakeGraphic(unsigned,int,int,void*,unsigned);
+extern Graphic* MakeGraphic(unsigned, int, int, void*, unsigned);
/// Resize a graphic
-extern void ResizeGraphic(Graphic *g,int w,int h);
+extern void ResizeGraphic(Graphic* g, int w, int h);
/// Load graphic
extern Graphic* LoadGraphic(const char* file);
/// Load sprite
-extern Graphic* LoadSprite(const char* file,int w,int h);
+extern Graphic* LoadSprite(const char* file, int w, int h);
/// Init graphic
extern void InitGraphic(void);
@@ -1222,207 +732,148 @@
extern void InitLineDraw(void);
/// Draw circle.
-extern void VideoDrawCircle(SysColors color,int x,int y,int r);
+extern void VideoDrawCircle(VMemType color, int x, int y, int r);
/// Draw 25% translucent circle.
-extern void VideoDraw25TransCircle(SysColors color,int x,int y,int r);
+extern void VideoDraw25TransCircle(VMemType color, int x, int y, int r);
/// Draw 50% translucent circle.
-extern void VideoDraw50TransCircle(SysColors color,int x,int y,int r);
+extern void VideoDraw50TransCircle(VMemType color, int x, int y, int r);
/// Draw 75% translucent circle.
-extern void VideoDraw75TransCircle(SysColors color,int x,int y,int r);
+extern void VideoDraw75TransCircle(VMemType color, int x, int y, int r);
/// Draw translucent circle.
-extern void VideoDrawTransCircle(SysColors color,int x,int y,int r
- ,unsigned char alpha);
+extern void VideoDrawTransCircle(VMemType color, int x, int y, int r,
+ unsigned char alpha);
/// Draw circle clipped.
-extern void VideoDrawCircleClip(SysColors color,int x,int y,int r);
+extern void VideoDrawCircleClip(VMemType color, int x, int y, int r);
/// Draw 25% translucent circle clipped.
-extern void VideoDraw25TransCircleClip(SysColors color,int x,int y,int r);
+extern void VideoDraw25TransCircleClip(VMemType color, int x, int y, int r);
/// Draw 50% translucent circle clipped.
-extern void VideoDraw50TransCircleClip(SysColors color,int x,int y,int r);
+extern void VideoDraw50TransCircleClip(VMemType color, int x, int y, int r);
/// Draw 75% translucent circle clipped.
-extern void VideoDraw75TransCircleClip(SysColors color,int x,int y,int r);
+extern void VideoDraw75TransCircleClip(VMemType color, int x, int y, int r);
/// Draw translucent circle clipped.
-extern void VideoDrawTransCircleClip(SysColors color,int x,int y,int r
- ,unsigned char alpha);
+extern void VideoDrawTransCircleClip(VMemType color, int x, int y, int r,
+ unsigned char alpha);
/// Fill rectangle.
-extern void (*VideoFillRectangle)(SysColors color,int x,int y
- ,int w,int h);
+extern void (*VideoFillRectangle)(VMemType color, int x, int y,
+ int w, int h);
/// Fill 25% translucent rectangle.
-extern void (*VideoFill25TransRectangle)(SysColors color,int x,int y
- ,int w,int h);
+extern void (*VideoFill25TransRectangle)(VMemType color, int x, int y,
+ int w, int h);
/// Fill 50% translucent rectangle.
-extern void (*VideoFill50TransRectangle)(SysColors color,int x,int y
- ,int w,int h);
+extern void (*VideoFill50TransRectangle)(VMemType color, int x, int y,
+ int w, int h);
/// Fill 75% translucent rectangle.
-extern void (*VideoFill75TransRectangle)(SysColors color,int x,int y
- ,int w,int h);
+extern void (*VideoFill75TransRectangle)(VMemType color, int x, int y,
+ int w, int h);
/// Fill translucent rectangle.
-extern void (*VideoFillTransRectangle)(SysColors color,int x,int y
- ,int w,int h,unsigned char alpha);
+extern void (*VideoFillTransRectangle)(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha);
/// Fill rectangle clipped.
-extern void VideoFillRectangleClip(SysColors color,int x,int y
- ,int w,int h);
+extern void VideoFillRectangleClip(VMemType color, int x, int y,
+ int w, int h);
/// Fill 25% translucent rectangle clipped.
-extern void VideoFill25TransRectangleClip(SysColors color,int x,int y
- ,int w,int h);
+extern void VideoFill25TransRectangleClip(VMemType color, int x, int y,
+ int w, int h);
/// Fill 50% translucent rectangle clipped.
-extern void VideoFill50TransRectangleClip(SysColors color,int x,int y
- ,int w,int h);
+extern void VideoFill50TransRectangleClip(VMemType color, int x, int y,
+ int w, int h);
/// Fill 75% translucent rectangle clipped.
-extern void VideoFill75TransRectangleClip(SysColors color,int x,int y
- ,int w,int h);
+extern void VideoFill75TransRectangleClip(VMemType color, int x, int y,
+ int w, int h);
/// Fill translucent rectangle clipped.
-extern void VideoFillTransRectangleClip(SysColors color,int x,int y
- ,int w,int h,unsigned char alpha);
+extern void VideoFillTransRectangleClip(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha);
/// Fill circle.
-extern void VideoFillCircle(SysColors color,int x,int y,int r);
+extern void VideoFillCircle(VMemType color, int x, int y, int r);
/// Fill 25% translucent circle.
-extern void VideoFill25TransCircle(SysColors color,int x,int y,int r);
+extern void VideoFill25TransCircle(VMemType color, int x, int y, int r);
/// Fill 50% translucent circle.
-extern void VideoFill50TransCircle(SysColors color,int x,int y,int r);
+extern void VideoFill50TransCircle(VMemType color, int x, int y, int r);
/// Fill 75% translucent circle.
-extern void VideoFill75TransCircle(SysColors color,int x,int y,int r);
+extern void VideoFill75TransCircle(VMemType color, int x, int y, int r);
/// Fill translucent circle.
-extern void VideoFillTransCircle(SysColors color,int x,int y,int r
- ,unsigned char alpha);
+extern void VideoFillTransCircle(VMemType color, int x, int y, int r,
+ unsigned char alpha);
/// Fill circle clipped.
-extern void VideoFillCircleClip(SysColors color,int x,int y,int r);
+extern void VideoFillCircleClip(VMemType color, int x, int y, int r);
/// Fill 25% translucent circle clipped.
-extern void VideoFill25TransCircleClip(SysColors color,int x,int y,int r);
+extern void VideoFill25TransCircleClip(VMemType color, int x, int y, int r);
/// Fill 50% translucent circle clipped.
-extern void VideoFill50TransCircleClip(SysColors color,int x,int y,int r);
+extern void VideoFill50TransCircleClip(VMemType color, int x, int y, int r);
/// Fill 75% translucent circle clipped.
-extern void VideoFill75TransCircleClip(SysColors color,int x,int y,int r);
+extern void VideoFill75TransCircleClip(VMemType color, int x, int y, int r);
/// Fill translucent circle clipped.
-extern void VideoFillTransCircleClip(SysColors color,int x,int y,int r
- ,unsigned char alpha);
+extern void VideoFillTransCircleClip(VMemType color, int x, int y, int r,
+ unsigned char alpha);
- /**
- ** Set clipping for nearly all vector primitives. Functions which support
- ** clipping will be marked Clip. Set the system-wide clipping rectangle.
- **
- ** @param left Left x coordinate
- ** @param top Top y coordinate
- ** @param right Right x coordinate
- ** @param bottom Bottom y coordinate
- */
-extern void SetClipping(int left,int top,int right,int bottom);
+ /// Set clipping for nearly all vector primitives. Functions which
support
+ /// clipping will be marked Clip. Set the system-wide clipping
rectangle.
+extern void SetClipping(int left, int top, int right, int bottom);
- /**
- ** Push current clipping.
- */
+ /// Push current clipping.
extern void PushClipping(void);
- /**
- ** Pop current clipping.
- */
+ /// Pop current clipping.
extern void PopClipping(void);
- /**
- ** Load a picture and display it on the screen (full screen),
- ** changing the colormap and so on..
- **
- ** @param name name of the picture (file) to display
- */
+ /// Load a picture and display it on the screen (full screen),
+ /// changing the colormap and so on..
extern void DisplayPicture(const char *name);
- /**
- ** Load palette from resource. Just loads palette, to set it use
- ** VideoCreatePalette, which sets system palette.
- **
- ** @param pal buffer to store palette (256-entries long)
- ** @param name resource file name
- **
- ** @see VideoCreatePalette
- */
+ /// Load palette from resource. Just loads palette, to set it use
+ /// VideoCreatePalette, which sets system palette.
extern void LoadRGB(Palette* pal,const char* name);
- /**
- ** Maps RGB to a hardware dependent pixel.
- **
- ** @param r Red color.
- ** @param g Green color.
- ** @param b Blue color.
- **
- ** @return A hardware dependent pixel.
- */
-extern unsigned long VideoMapRGB(int r, int g, int b);
+ /// Maps RGB to a hardware dependent pixel.
+extern VMemType VideoMapRGB(int r, int g, int b);
- /**
- ** Creates a hardware palette from an independent Palette struct.
- **
- ** @param palette System independent palette structure.
- **
- ** @return A palette in hardware dependent format.
- */
+ /// Creates a hardware palette from an independent Palette struct.
extern VMemType* VideoCreateNewPalette(const Palette* palette);
- /**
- ** Creates a shared hardware palette from an independent Palette struct.
- **
- ** @param palette System independent palette structure.
- **
- ** @return A palette in hardware dependent format.
- */
+ /// Creates a shared hardware palette from an independent Palette
struct.
extern VMemType* VideoCreateSharedPalette(const Palette* palette);
- /**
- ** Free a shared hardware palette.
- **
- ** @param pixel palette in hardware dependent format
- */
+ /// Free a shared hardware palette.
extern void VideoFreeSharedPalette(VMemType* pixels);
- /**
- ** Initialize Pixels[] for all players.
- ** (bring Players[] in sync with Pixels[])
- **
- ** @see VideoSetPalette
- */
+ /// Initialize Pixels[] for all players.
+ /// (bring Players[] in sync with Pixels[])
extern void SetPlayersPalette(void);
- /**
- ** Initializes system palette. Also calls SetPlayersPalette to set
- ** palette for all players.
- **
- ** @param palette VMemType structure, as created by VideoCreateNewPalette
- ** @see SetPlayersPalette
- */
+ /// Initializes system palette. Also calls SetPlayersPalette to set
+ /// palette for all players.
extern void VideoSetPalette(const VMemType* palette);
- /**
- ** Set the system hardware palette from an independend Palette struct.
- **
- ** @param palette System independ palette structure.
- */
+ /// Set the system hardware palette from an independend Palette
struct.
extern void VideoCreatePalette(const Palette* palette);
/// Initializes video synchronization.
Index: stratagus/src/map/map_fog.c
diff -u stratagus/src/map/map_fog.c:1.107 stratagus/src/map/map_fog.c:1.108
--- stratagus/src/map/map_fog.c:1.107 Thu Oct 2 01:33:50 2003
+++ stratagus/src/map/map_fog.c Tue Oct 7 20:06:43 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: map_fog.c,v 1.107 2003/10/02 05:33:50 jsalmon3 Exp $
+// $Id: map_fog.c,v 1.108 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -496,7 +496,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType8*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -577,7 +577,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType8*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -619,7 +619,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType8*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -700,7 +700,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType8*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -744,7 +744,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType16*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -825,7 +825,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType16*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -866,7 +866,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType16*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -947,7 +947,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType16*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -990,7 +990,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType24*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -1071,7 +1071,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType24*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -1112,7 +1112,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType24*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -1193,7 +1193,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType24*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -1236,7 +1236,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType16*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -1317,7 +1317,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType32*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -1358,7 +1358,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType16*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -1439,7 +1439,7 @@
while (sp < gp) {
#undef UNROLL1
#define UNROLL1(x) \
- if(COLOR_FOG_P(sp[x])) { \
+ if (COLOR_FOG_P(sp[x])) { \
dp[x] = ((VMemType32*)TheMap.TileData->Pixels)[COLOR_FOG]; \
}
@@ -2779,7 +2779,7 @@
unsigned int trans_color;
int j;
- trans_color = Pixels8[ColorBlack];
+ trans_color = ColorBlack.D8;
trans_color <<= 8;
//FIXME: determine which lookup table to use based on
Index: stratagus/src/map/minimap.c
diff -u stratagus/src/map/minimap.c:1.70 stratagus/src/map/minimap.c:1.71
--- stratagus/src/map/minimap.c:1.70 Tue Oct 7 12:05:04 2003
+++ stratagus/src/map/minimap.c Tue Oct 7 20:06:43 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: minimap.c,v 1.70 2003/10/07 16:05:04 jsalmon3 Exp $
+// $Id: minimap.c,v 1.71 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -53,7 +53,7 @@
----------------------------------------------------------------------------*/
local Graphic* MinimapTerrainGraphic; /// generated minimap terrain
-local Graphic* MinimapGraphic; /// generated minimap
+local VMemType* MinimapGraphic; /// generated minimap
local int* Minimap2MapX; /// fast conversion table
local int* Minimap2MapY; /// fast conversion table
local int Map2MinimapX[MaxMapWidth]; /// fast conversion table
@@ -228,23 +228,26 @@
MinimapTerrainGraphic = NewGraphic(8, TheUI.MinimapW, TheUI.MinimapH);
memset(MinimapTerrainGraphic->Frames, 0, TheUI.MinimapW * TheUI.MinimapH);
- MinimapGraphic = NewGraphic(8, TheUI.MinimapW, TheUI.MinimapH);
- MinimapGraphic->Pixels = VideoCreateNewPalette(GlobalPalette);
+ MinimapGraphic = calloc(TheUI.MinimapW * TheUI.MinimapH, sizeof(VMemType));
// FIXME: looks too complicated
for (y = 0; y < TheUI.MinimapH; ++y) {
for (x = 0; x < TheUI.MinimapW; ++x) {
+ Palette p;
// this only copies the panel background... honest.
- ((unsigned char*)MinimapGraphic->Frames)[x + y * TheUI.MinimapW] =
- ((unsigned
char*)TheUI.MinimapPanel.Graphic->Frames)[x+(TheUI.MinimapPosX-TheUI.MinimapPanelX)
+ (y+TheUI.MinimapPosY-TheUI.MinimapPanelY) *
TheUI.MinimapPanel.Graphic->Width];
+ p = GlobalPalette[
+ ((unsigned char*)TheUI.MinimapPanel.Graphic->Frames)[
+ x + (TheUI.MinimapPosX - TheUI.MinimapPanelX) +
+ (y + TheUI.MinimapPosY - TheUI.MinimapPanelY) *
+ TheUI.MinimapPanel.Graphic->Width]];
+ MinimapGraphic[x + y * TheUI.MinimapW] = VideoMapRGB(p.r, p.g, p.b);
}
}
if (!TheUI.MinimapTransparent) {
// make only the inner part which is going to be used black
for (y = MinimapY; y < TheUI.MinimapH - MinimapY; ++y) {
for (x = MinimapX; x < TheUI.MinimapW - MinimapX; ++x) {
- ((unsigned char*)MinimapGraphic->Frames)[x + y *
TheUI.MinimapW] =
- ColorBlack;
+ MinimapGraphic[x + y * TheUI.MinimapW] = ColorBlack;
}
}
}
@@ -260,11 +263,9 @@
VideoSaveFree(MinimapTerrainGraphic);
MinimapTerrainGraphic = NULL;
if (MinimapGraphic) {
- free(MinimapGraphic->Pixels);
- MinimapGraphic->Pixels = NULL;
+ free(MinimapGraphic);
+ MinimapGraphic = NULL;
}
- VideoSaveFree(MinimapGraphic);
- MinimapGraphic = NULL;
free(Minimap2MapX);
Minimap2MapX = NULL;
free(Minimap2MapY);
@@ -305,11 +306,12 @@
visiontype = IsTileVisible(ThisPlayer, Minimap2MapX[mx],
Minimap2MapY[my] / TheMap.Width);
}
if (MinimapWithTerrain && (visiontype > 1 || (visiontype == 1 &&
((mx & 1) == (my & 1))))) {
- ((unsigned char*)MinimapGraphic->Frames)[mx + my *
TheUI.MinimapW] =
- ((unsigned char*)MinimapTerrainGraphic->Frames)[mx + my *
TheUI.MinimapW];
+ Palette p;
+ p = GlobalPalette[
+ ((unsigned char*)MinimapTerrainGraphic->Frames)[mx + my *
TheUI.MinimapW]];
+ MinimapGraphic[mx + my * TheUI.MinimapW] = VideoMapRGB(p.r,
p.g, p.b);
} else if (visiontype > 0) {
- ((unsigned char*)MinimapGraphic->Frames)[mx + my *
TheUI.MinimapW] =
- ColorBlack;
+ MinimapGraphic[mx + my * TheUI.MinimapW] = ColorBlack;
}
}
}
@@ -324,7 +326,7 @@
// Draw Destroyed Buildings On Map
table = &DestroyedBuildings;
while (*table) {
- SysColors color;
+ VMemType color;
if (!BuildingVisibleOnMap(*table) && (*table)->SeenState != 3
&& !(*table)->SeenDestroyed && (type = (*table)->SeenType) ) {
@@ -356,8 +358,7 @@
while (w-- >= 0) {
h = h0;
while (h-- >= 0) {
- ((unsigned char*)MinimapGraphic->Frames)[
- mx + w + (my + h) * TheUI.MinimapW] = color;
+ MinimapGraphic[mx + w + (my + h) * TheUI.MinimapW] = color;
}
}
}
@@ -365,7 +366,7 @@
}
for (table = Units; table < Units + NumUnits; ++table) {
- SysColors color;
+ VMemType color;
unit = *table;
@@ -423,8 +424,7 @@
while (w-- >= 0) {
h = h0;
while (h-- >= 0) {
- ((unsigned char*)MinimapGraphic->Frames)[
- mx + w + (my + h) * TheUI.MinimapW] = color;
+ MinimapGraphic[mx + w + (my + h) * TheUI.MinimapW] = color;
}
}
@@ -444,9 +444,60 @@
global void DrawMinimap(int vx __attribute__((unused)),
int vy __attribute__((unused)))
{
- VideoDrawSubClip(MinimapGraphic, 0, 0,
- MinimapGraphic->Width, MinimapGraphic->Height,
- TheUI.MinimapPosX, TheUI.MinimapPosY);
+ int i;
+ int j;
+
+ switch (VideoBpp) {
+ case 8: {
+ VMemType8* v;
+
+ v = VideoMemory8 + TheUI.MinimapPosY * VideoWidth +
TheUI.MinimapPosX;
+ for (i = 0; i < TheUI.MinimapH; ++i) {
+ for (j = 0; j < TheUI.MinimapW; ++j) {
+ v[j] = MinimapGraphic[i * TheUI.MinimapW + j].D8;
+ }
+ v += VideoWidth;
+ }
+ break;
+ }
+ case 15:
+ case 16: {
+ VMemType16* v;
+
+ v = VideoMemory16 + TheUI.MinimapPosY * VideoWidth +
TheUI.MinimapPosX;
+ for (i = 0; i < TheUI.MinimapH; ++i) {
+ for (j = 0; j < TheUI.MinimapW; ++j) {
+ v[j] = MinimapGraphic[i * TheUI.MinimapW + j].D16;
+ }
+ v += VideoWidth;
+ }
+ break;
+ }
+ case 24: {
+ VMemType24* v;
+
+ v = VideoMemory24 + TheUI.MinimapPosY * VideoWidth +
TheUI.MinimapPosX;
+ for (i = 0; i < TheUI.MinimapH; ++i) {
+ for (j = 0; j < TheUI.MinimapW; ++j) {
+ v[j] = MinimapGraphic[i * TheUI.MinimapW + j].D24;
+ }
+ v += VideoWidth;
+ }
+ break;
+ }
+ case 32: {
+ VMemType32* v;
+
+ v = VideoMemory32 + TheUI.MinimapPosY * VideoWidth +
TheUI.MinimapPosX;
+ for (i = 0; i < TheUI.MinimapH; ++i) {
+ for (j = 0; j < TheUI.MinimapW; ++j) {
+ v[j] = MinimapGraphic[i * TheUI.MinimapW + j].D32;
+ }
+ v += VideoWidth;
+ }
+ break;
+ }
+ }
}
/**
Index: stratagus/src/ui/ccl_ui.c
diff -u stratagus/src/ui/ccl_ui.c:1.133 stratagus/src/ui/ccl_ui.c:1.134
--- stratagus/src/ui/ccl_ui.c:1.133 Tue Oct 7 12:27:18 2003
+++ stratagus/src/ui/ccl_ui.c Tue Oct 7 20:06:43 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_ui.c,v 1.133 2003/10/07 16:27:18 jsalmon3 Exp $
+// $Id: ccl_ui.c,v 1.134 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -916,7 +916,9 @@
if (gh_eq_p(value, gh_symbol2scm("color"))) {
value = gh_car(sublist);
sublist = gh_cdr(sublist);
- ui->CompleteBarColor = gh_scm2int(value);
+ ui->CompleteBarColorRGB.D24.a = gh_scm2int(gh_car(value));
+ ui->CompleteBarColorRGB.D24.b =
gh_scm2int(gh_car(gh_cdr(value)));
+ ui->CompleteBarColorRGB.D24.c =
gh_scm2int(gh_car(gh_cdr(gh_cdr(value))));
} else if (gh_eq_p(value, gh_symbol2scm("pos"))) {
value = gh_car(sublist);
sublist = gh_cdr(sublist);
Index: stratagus/src/ui/icons.c
diff -u stratagus/src/ui/icons.c:1.47 stratagus/src/ui/icons.c:1.48
--- stratagus/src/ui/icons.c:1.47 Tue Oct 7 02:59:50 2003
+++ stratagus/src/ui/icons.c Tue Oct 7 20:06:43 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: icons.c,v 1.47 2003/10/07 06:59:50 jsalmon3 Exp $
+// $Id: icons.c,v 1.48 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -371,7 +371,7 @@
global void DrawUnitIcon(const Player* player, Icon* icon, unsigned flags,
int x, int y)
{
- int color;
+ VMemType color;
int width;
int height;
@@ -429,7 +429,7 @@
int i;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: icons $Id: icons.c,v 1.47 2003/10/07 06:59:50
jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: icons $Id: icons.c,v 1.48 2003/10/08 00:06:43
jsalmon3 Exp $\n\n");
//
// Mapping the original icon numbers in puds to our internal strings
Index: stratagus/src/ui/mainscr.c
diff -u stratagus/src/ui/mainscr.c:1.129 stratagus/src/ui/mainscr.c:1.130
--- stratagus/src/ui/mainscr.c:1.129 Tue Oct 7 12:27:19 2003
+++ stratagus/src/ui/mainscr.c Tue Oct 7 20:06:43 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mainscr.c,v 1.129 2003/10/07 16:27:19 jsalmon3 Exp $
+// $Id: mainscr.c,v 1.130 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -85,7 +85,7 @@
local void UiDrawLifeBar(const Unit* unit, int x, int y)
{
int f;
- int color;
+ VMemType color;
y += IconHeight + 7;
VideoFillRectangleClip(ColorBlack, x, y, IconWidth + 7, 7);
@@ -189,10 +189,10 @@
type = unit->Type;
stats = unit->Stats;
#ifdef DEBUG
- if (!type) {
- DebugLevel1Fn(" FIXME: free unit selected\n");
- return;
- }
+ if (!type) {
+ DebugLevel1Fn(" FIXME: free unit selected\n");
+ return;
+ }
#endif
//
Index: stratagus/src/ui/menu_proc.c
diff -u stratagus/src/ui/menu_proc.c:1.104 stratagus/src/ui/menu_proc.c:1.105
--- stratagus/src/ui/menu_proc.c:1.104 Tue Oct 7 08:03:41 2003
+++ stratagus/src/ui/menu_proc.c Tue Oct 7 20:06:43 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: menu_proc.c,v 1.104 2003/10/07 12:03:41 martinxyz Exp $
+// $Id: menu_proc.c,v 1.105 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -266,7 +266,8 @@
if (flags & MenuButtonDisabled) {
VideoDrawRectangleClip(ColorGray, x, y, w - 1, h);
} else {
- VideoDrawRectangleClip(165, x, y, w - 1, h);
+ // FIXME: wrong color
+ VideoDrawRectangleClip(ColorRed, x, y, w - 1, h);
}
}
} else {
Index: stratagus/src/ui/ui.c
diff -u stratagus/src/ui/ui.c:1.77 stratagus/src/ui/ui.c:1.78
--- stratagus/src/ui/ui.c:1.77 Tue Oct 7 12:27:20 2003
+++ stratagus/src/ui/ui.c Tue Oct 7 20:06:43 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ui.c,v 1.77 2003/10/07 16:27:20 jsalmon3 Exp $
+// $Id: ui.c,v 1.78 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -154,6 +154,8 @@
SetViewportMode(VIEWPORT_SINGLE);
}
+ TheUI.CompleteBarColor = VideoMapRGB(TheUI.CompleteBarColorRGB.D24.a,
+ TheUI.CompleteBarColorRGB.D24.b, TheUI.CompleteBarColorRGB.D24.c);
TheUI.ViewportCursorColor = ColorWhite;
}
@@ -512,7 +514,7 @@
int i;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.77 2003/10/07 16:27:20
jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.78 2003/10/08 00:06:43
jsalmon3 Exp $\n\n");
// Contrast, Brightness, Saturation
CLprintf(file, "(set-contrast! %d)\n", TheUI.Contrast);
Index: stratagus/src/video/cursor.c
diff -u stratagus/src/video/cursor.c:1.69 stratagus/src/video/cursor.c:1.70
--- stratagus/src/video/cursor.c:1.69 Tue Oct 7 08:03:44 2003
+++ stratagus/src/video/cursor.c Tue Oct 7 20:06:43 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: cursor.c,v 1.69 2003/10/07 12:03:44 martinxyz Exp $
+// $Id: cursor.c,v 1.70 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -701,7 +701,7 @@
int y1;
int mx;
int my;
- int color;
+ VMemType color;
int f;
int w;
int w0;
@@ -1120,7 +1120,7 @@
int i;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.69 2003/10/07
12:03:44 martinxyz Exp $\n\n");
+ CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.70 2003/10/08
00:06:43 jsalmon3 Exp $\n\n");
for (i = 0; Cursors[i].OType; ++i) {
CLprintf(file, "(define-cursor '%s '%s\n",
Index: stratagus/src/video/font.c
diff -u stratagus/src/video/font.c:1.55 stratagus/src/video/font.c:1.56
--- stratagus/src/video/font.c:1.55 Sun Sep 28 15:55:48 2003
+++ stratagus/src/video/font.c Tue Oct 7 20:06:43 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: font.c,v 1.55 2003/09/28 19:55:48 jsalmon3 Exp $
+// $Id: font.c,v 1.56 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -838,8 +838,6 @@
unsigned i;
FontColorMapping* fcm;
void* pixels;
- int v;
- char* vp;
//
// First select the font drawing procedure.
@@ -886,27 +884,27 @@
while (fcm) {
pixels = fcm->Pixels;
for (i = 0; i < NumFontColors; ++i) {
+ VMemType c;
+
+ c = VideoMapRGB(fcm->RGB[i].R, fcm->RGB[i].G, fcm->RGB[i].B);
+
switch (VideoBpp) {
case 8:
- ((VMemType8*)pixels)[i] = VideoMapRGB(fcm->RGB[i].R,
fcm->RGB[i].G, fcm->RGB[i].B);
+ ((VMemType8*)pixels)[i] = c.D8;
break;
case 15:
case 16:
- ((VMemType16*)pixels)[i] = VideoMapRGB(fcm->RGB[i].R,
fcm->RGB[i].G, fcm->RGB[i].B);
+ ((VMemType16*)pixels)[i] = c.D16;
break;
case 24:
- v = VideoMapRGB(fcm->RGB[i].R, fcm->RGB[i].G,
fcm->RGB[i].B);
- vp = (char*)(&v);
- ((VMemType24*)pixels)[i].a = vp[0];
- ((VMemType24*)pixels)[i].b = vp[1];
- ((VMemType24*)pixels)[i].c = vp[2];
+ ((VMemType24*)pixels)[i] = c.D24;
break;
case 32:
- ((VMemType32*)pixels)[i] = VideoMapRGB(fcm->RGB[i].R,
fcm->RGB[i].G, fcm->RGB[i].B);
+ ((VMemType32*)pixels)[i] = c.D32;
break;
}
}
- fcm=fcm->Next;
+ fcm = fcm->Next;
}
}
Index: stratagus/src/video/linedraw.c
diff -u stratagus/src/video/linedraw.c:1.38 stratagus/src/video/linedraw.c:1.39
--- stratagus/src/video/linedraw.c:1.38 Sun Sep 28 19:00:52 2003
+++ stratagus/src/video/linedraw.c Tue Oct 7 20:06:43 2003
@@ -10,7 +10,7 @@
//
/address@hidden linedraw.c - The general linedraw functions. */
//
-// (c) Copyright 2000-2002 by Lutz Sammer, Stephan Rasenberg.
+// (c) Copyright 2000-2003 by Lutz Sammer, Stephan Rasenberg, Jimmy Salmon
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: linedraw.c,v 1.38 2003/09/28 23:00:52 jsalmon3 Exp $
+// $Id: linedraw.c,v 1.39 2003/10/08 00:06:43 jsalmon3 Exp $
//@{
@@ -65,38 +65,38 @@
/**
** Draw pixel unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-global void (*VideoDrawPixel)(SysColors color, int x, int y);
+global void (*VideoDrawPixel)(VMemType color, int x, int y);
/**
** Draw 25% translucent pixel (Alpha = 64) unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-global void (*VideoDraw25TransPixel)(SysColors color, int x, int y);
+global void (*VideoDraw25TransPixel)(VMemType color, int x, int y);
/**
** Draw 50% translucent pixel (Alpha = 128) unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-global void (*VideoDraw50TransPixel)(SysColors color, int x, int y);
+global void (*VideoDraw50TransPixel)(VMemType color, int x, int y);
/**
** Draw 75% translucent pixel (Alpha = 192) unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-global void (*VideoDraw75TransPixel)(SysColors color, int x, int y);
+global void (*VideoDraw75TransPixel)(VMemType color, int x, int y);
/**
** Draw translucent pixel unclipped.
@@ -108,307 +108,307 @@
** not be calculate in an unsigned char (can deliver overflow):
** newcolor = (oldcolor*alpha+color*(255 - alpha)+127)/255
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param alpha alpha value of pixel.
*/
-global void (*VideoDrawTransPixel)(SysColors color, int x, int y,
+global void (*VideoDrawTransPixel)(VMemType color, int x, int y,
unsigned char alpha);
/**
** Draw pixel clipped to current clip setting.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-global void (*VideoDrawPixelClip)(SysColors color, int x, int y);
+global void (*VideoDrawPixelClip)(VMemType color, int x, int y);
/**
** Draw vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line.
*/
-global void (*VideoDrawVLine)(SysColors color, int x, int y, int height);
+global void (*VideoDrawVLine)(VMemType color, int x, int y, int height);
/**
** Draw 25% translucent vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line.
*/
-global void (*VideoDraw25TransVLine)(SysColors color, int x, int y, int
height);
+global void (*VideoDraw25TransVLine)(VMemType color, int x, int y, int height);
/**
** Draw 50% translucent vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line.
*/
-global void (*VideoDraw50TransVLine)(SysColors color, int x, int y, int
height);
+global void (*VideoDraw50TransVLine)(VMemType color, int x, int y, int height);
/**
** Draw 75% translucent vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line.
*/
-global void (*VideoDraw75TransVLine)(SysColors color, int x, int y, int
height);
+global void (*VideoDraw75TransVLine)(VMemType color, int x, int y, int height);
/**
** Draw translucent vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line.
** @param alpha alpha value of pixel.
*/
-global void (*VideoDrawTransVLine)(SysColors color, int x, int y,
- int height,unsigned char alpha);
+global void (*VideoDrawTransVLine)(VMemType color, int x, int y,
+ int height, unsigned char alpha);
/**
** Draw horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line.
*/
-global void (*VideoDrawHLine)(SysColors color, int x, int y, int width);
+global void (*VideoDrawHLine)(VMemType color, int x, int y, int width);
/**
** Draw 25% translucent horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line.
*/
-global void (*VideoDraw25TransHLine)(SysColors color, int x, int y, int width);
+global void (*VideoDraw25TransHLine)(VMemType color, int x, int y, int width);
/**
** Draw 50% translucent horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line.
*/
-global void (*VideoDraw50TransHLine)(SysColors color, int x, int y, int width);
+global void (*VideoDraw50TransHLine)(VMemType color, int x, int y, int width);
/**
** Draw 75% translucent horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line.
*/
-global void (*VideoDraw75TransHLine)(SysColors color, int x, int y, int width);
+global void (*VideoDraw75TransHLine)(VMemType color, int x, int y, int width);
/**
** Draw translucent horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line.
** @param alpha alpha value of pixel.
*/
-global void (*VideoDrawTransHLine)(SysColors color, int x, int y,
- int width,unsigned char alpha);
+global void (*VideoDrawTransHLine)(VMemType color, int x, int y,
+ int width, unsigned char alpha);
/**
** Draw line unclipped.
**
-** @param color Color index.
+** @param color color
** @param sx Source x coordinate on the screen
** @param sy Source y coordinate on the screen
** @param dx Destination x coordinate on the screen
** @param dy Destination y coordinate on the screen
*/
-global void (*VideoDrawLine)(SysColors color, int sx, int sy, int dx, int dy);
+global void (*VideoDrawLine)(VMemType color, int sx, int sy, int dx, int dy);
/**
** Draw 25% translucent line unclipped.
**
-** @param color Color index.
+** @param color color
** @param sx Source x coordinate on the screen
** @param sy Source y coordinate on the screen
** @param dx Destination x coordinate on the screen
** @param dy Destination y coordinate on the screen
*/
-global void (*VideoDraw25TransLine)(SysColors color, int sx, int sy,
+global void (*VideoDraw25TransLine)(VMemType color, int sx, int sy,
int dx, int dy);
/**
** Draw 50% translucent line unclipped.
**
-** @param color Color index.
+** @param color color
** @param sx Source x coordinate on the screen
** @param sy Source y coordinate on the screen
** @param dx Destination x coordinate on the screen
** @param dy Destination y coordinate on the screen
*/
-global void (*VideoDraw50TransLine)(SysColors color, int sx, int sy,
+global void (*VideoDraw50TransLine)(VMemType color, int sx, int sy,
int dx, int dy);
/**
** Draw 75% translucent line unclipped.
**
-** @param color Color index.
+** @param color color
** @param sx Source x coordinate on the screen
** @param sy Source y coordinate on the screen
** @param dx Destination x coordinate on the screen
** @param dy Destination y coordinate on the screen
*/
-global void (*VideoDraw75TransLine)(SysColors color, int sx, int sy,
+global void (*VideoDraw75TransLine)(VMemType color, int sx, int sy,
int dx, int dy);
/**
** Draw translucent line unclipped.
**
-** @param color Color index.
+** @param color color
** @param sx Source x coordinate on the screen
** @param sy Source y coordinate on the screen
** @param dx Destination x coordinate on the screen
** @param dy Destination y coordinate on the screen
** @param alpha alpha value of pixel.
*/
-global void (*VideoDrawTransLine)(SysColors color, int sx, int sy,
+global void (*VideoDrawTransLine)(VMemType color, int sx, int sy,
int dx, int dy, unsigned char alpha);
/**
** Draw rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
*/
-global void (*VideoDrawRectangle)(SysColors color, int x, int y,
+global void (*VideoDrawRectangle)(VMemType color, int x, int y,
int w, int h);
/**
** Draw 25% translucent rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
*/
-global void (*VideoDraw25TransRectangle)(SysColors color, int x, int y,
+global void (*VideoDraw25TransRectangle)(VMemType color, int x, int y,
int w, int h);
/**
** Draw 50% translucent rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
*/
-global void (*VideoDraw50TransRectangle)(SysColors color, int x, int y,
+global void (*VideoDraw50TransRectangle)(VMemType color, int x, int y,
int w, int h);
/**
** Draw 75% translucent rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
*/
-global void (*VideoDraw75TransRectangle)(SysColors color, int x, int y,
+global void (*VideoDraw75TransRectangle)(VMemType color, int x, int y,
int w, int h);
/**
** Draw translucent rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
** @param alpha alpha value of pixel.
*/
-global void (*VideoDrawTransRectangle)(SysColors color, int x, int y,
- int w, int h,unsigned char alpha);
+global void (*VideoDrawTransRectangle)(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha);
/**
** Fill rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
*/
-global void (*VideoFillRectangle)(SysColors color, int x, int y,
+global void (*VideoFillRectangle)(VMemType color, int x, int y,
int w, int h);
/**
** Draw 25% translucent filled rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
*/
-global void (*VideoFill25TransRectangle)(SysColors color, int x, int y,
+global void (*VideoFill25TransRectangle)(VMemType color, int x, int y,
int w, int h);
/**
** Draw 50% translucent filled rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
*/
-global void (*VideoFill50TransRectangle)(SysColors color, int x, int y,
+global void (*VideoFill50TransRectangle)(VMemType color, int x, int y,
int w, int h);
/**
** Draw 75% translucent filled rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
*/
-global void (*VideoFill75TransRectangle)(SysColors color, int x, int y,
+global void (*VideoFill75TransRectangle)(VMemType color, int x, int y,
int w, int h);
/**
** Draw translucent filled rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle.
** @param w width of rectangle.
** @param alpha alpha value of pixel.
*/
-global void (*VideoFillTransRectangle)(SysColors color, int x, int y,
+global void (*VideoFillTransRectangle)(VMemType color, int x, int y,
int w, int h, unsigned char alpha);
@@ -419,67 +419,67 @@
/**
** Draw pixel unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void DrawPixel8(SysColors color, int x, int y)
+local void DrawPixel8(VMemType color, int x, int y)
{
- VideoMemory8[x + y * VideoWidth] = Pixels8[color];
+ VideoMemory8[x + y * VideoWidth] = color.D8;
}
/**
** Draw pixel unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void DrawPixel16(SysColors color, int x, int y)
+local void DrawPixel16(VMemType color, int x, int y)
{
- VideoMemory16[x + y * VideoWidth] = Pixels16[color];
+ VideoMemory16[x + y * VideoWidth] = color.D16;
}
/**
** Draw pixel unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void DrawPixel24(SysColors color, int x, int y)
+local void DrawPixel24(VMemType color, int x, int y)
{
- VideoMemory24[x + y * VideoWidth] = Pixels24[color];
+ VideoMemory24[x + y * VideoWidth] = color.D24;
}
/**
** Draw pixel unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void DrawPixel32(SysColors color, int x, int y)
+local void DrawPixel32(VMemType color, int x, int y)
{
- VideoMemory32[x + y * VideoWidth] = Pixels32[color];
+ VideoMemory32[x + y * VideoWidth] = color.D32;
}
/**
** Draw pixel unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
#ifdef USE_OPENGL
-local void DrawPixelOpenGL(SysColors color, int x, int y)
+local void DrawPixelOpenGL(VMemType color, int x, int y)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -495,33 +495,33 @@
/**
** Draw 25% translucent pixel unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw25TransPixel8(SysColors color, int x, int y)
+local void Draw25TransPixel8(VMemType color, int x, int y)
{
VMemType8* p;
p = VideoMemory8 + x + y * VideoWidth;
- *p = lookup25trans8[(Pixels8[color] << 8) | *p];
+ *p = lookup25trans8[(color.D8 << 8) | *p];
}
/**
** Draw 25% translucent pixel unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw25TransPixel15(SysColors color, int x, int y)
+local void Draw25TransPixel15(VMemType color, int x, int y)
{
VMemType16* p;
unsigned long sp;
unsigned long dp;
p = VideoMemory16 + x + y * VideoWidth;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x03E07C1F) * 3;
dp = *p;
@@ -533,18 +533,18 @@
/**
** Draw 25% translucent pixel unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw25TransPixel16(SysColors color, int x, int y)
+local void Draw25TransPixel16(VMemType color, int x, int y)
{
VMemType16* p;
unsigned long sp;
unsigned long dp;
p = VideoMemory16 + x + y * VideoWidth;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x07E0F81F) * 3;
dp = *p;
@@ -556,24 +556,24 @@
/**
** Draw 25% translucent pixel unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw25TransPixel24(SysColors color, int x, int y)
+local void Draw25TransPixel24(VMemType color, int x, int y)
{
//FIXME: does 24bpp represents R|G|B?
- VideoMemory24[x + y * VideoWidth] = Pixels24[color];
+ VideoMemory24[x + y * VideoWidth] = color.D24;
}
/**
** Draw 25% translucent pixel unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw25TransPixel32(SysColors color, int x, int y)
+local void Draw25TransPixel32(VMemType color, int x, int y)
{
VMemType32* p;
unsigned long sp1;
@@ -581,7 +581,7 @@
unsigned long dp1;
unsigned long dp2;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
// FIXME: pre multiply?
sp2 = ((sp1 & 0xFF00FF00) >> 8) * 3;
sp1 = (sp1 & 0x00FF00FF) * 3;
@@ -599,19 +599,19 @@
/**
** Draw 25% translucent pixel unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
#ifdef USE_OPENGL
-local void Draw25TransPixelOpenGL(SysColors color, int x, int y)
+local void Draw25TransPixelOpenGL(VMemType color, int x, int y)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -627,33 +627,33 @@
/**
** Draw 50% translucent pixel unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw50TransPixel8(SysColors color, int x, int y)
+local void Draw50TransPixel8(VMemType color, int x, int y)
{
VMemType8* p;
p = VideoMemory8 + x + y * VideoWidth;
- *p = lookup50trans8[(Pixels8[color] << 8) | *p];
+ *p = lookup50trans8[(color.D8 << 8) | *p];
}
/**
** Draw 50% translucent pixel unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw50TransPixel15(SysColors color, int x, int y)
+local void Draw50TransPixel15(VMemType color, int x, int y)
{
VMemType16* p;
unsigned long sp;
unsigned long dp;
p = VideoMemory16 + x + y * VideoWidth;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
dp = *p;
dp = ((dp << 16) | dp) & 0x03E07C1F;
@@ -664,18 +664,18 @@
/**
** Draw 50% translucent pixel unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw50TransPixel16(SysColors color, int x, int y)
+local void Draw50TransPixel16(VMemType color, int x, int y)
{
VMemType16* p;
unsigned long sp;
unsigned long dp;
p = VideoMemory16 + x + y * VideoWidth;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
dp = *p;
dp = ((dp << 16) | dp) & 0x07E0F81F;
@@ -686,24 +686,24 @@
/**
** Draw 50% translucent pixel unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw50TransPixel24(SysColors color, int x, int y)
+local void Draw50TransPixel24(VMemType color, int x, int y)
{
//FIXME: does 24bpp represents R|G|B?
- VideoMemory24[x + y * VideoWidth] = Pixels24[color];
+ VideoMemory24[x + y * VideoWidth] = color.D24;
}
/**
** Draw 50% translucent pixel unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw50TransPixel32(SysColors color, int x, int y)
+local void Draw50TransPixel32(VMemType color, int x, int y)
{
VMemType32* p;
unsigned long sp1;
@@ -711,7 +711,7 @@
unsigned long dp1;
unsigned long dp2;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -728,19 +728,19 @@
/**
** Draw 50% translucent pixel unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
#ifdef USE_OPENGL
-local void Draw50TransPixelOpenGL(SysColors color, int x, int y)
+local void Draw50TransPixelOpenGL(VMemType color, int x, int y)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -756,33 +756,33 @@
/**
** Draw 75% translucent pixel unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw75TransPixel8(SysColors color, int x, int y)
+local void Draw75TransPixel8(VMemType color, int x, int y)
{
VMemType8* p;
p = VideoMemory8 + x + y * VideoWidth;
- *p = lookup25trans8[(*p << 8) | Pixels8[color]];
+ *p = lookup25trans8[(*p << 8) | color.D8];
}
/**
** Draw 75% translucent pixel unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw75TransPixel15(SysColors color, int x, int y)
+local void Draw75TransPixel15(VMemType color, int x, int y)
{
VMemType16* p;
unsigned long sp;
unsigned long dp;
p = VideoMemory16 + x + y * VideoWidth;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
dp = *p;
dp = ((dp << 16) | dp) & 0x03E07C1F;
@@ -793,18 +793,18 @@
/**
** Draw 75% translucent pixel unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw75TransPixel16(SysColors color, int x, int y)
+local void Draw75TransPixel16(VMemType color, int x, int y)
{
VMemType16* p;
unsigned long sp;
unsigned long dp;
p = VideoMemory16 + x + y * VideoWidth;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
dp = *p;
dp = ((dp << 16) | dp) & 0x07E0F81F;
@@ -815,24 +815,24 @@
/**
** Draw 75% translucent pixel unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw75TransPixel24(SysColors color, int x, int y)
+local void Draw75TransPixel24(VMemType color, int x, int y)
{
//FIXME: does 24bpp represents R|G|B?
- VideoMemory24[x + y * VideoWidth] = Pixels24[color];
+ VideoMemory24[x + y * VideoWidth] = color.D24;
}
/**
** Draw 75% translucent pixel unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void Draw75TransPixel32(SysColors color, int x, int y)
+local void Draw75TransPixel32(VMemType color, int x, int y)
{
VMemType32* p;
unsigned long sp1;
@@ -840,7 +840,7 @@
unsigned long dp1;
unsigned long dp2;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -857,19 +857,19 @@
/**
** Draw 75% translucent pixel unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
#ifdef USE_OPENGL
-local void Draw75TransPixelOpenGL(SysColors color, int x, int y)
+local void Draw75TransPixelOpenGL(VMemType color, int x, int y)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -885,12 +885,12 @@
/**
** Draw translucent pixel unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param alpha alpha value of pixel.
*/
-local void DrawTransPixel8(SysColors color, int x, int y,
+local void DrawTransPixel8(VMemType color, int x, int y,
unsigned char alpha)
{
VMemType8* p;
@@ -898,16 +898,16 @@
p = VideoMemory8 + x + y * VideoWidth;
switch (((unsigned int)alpha * 4) / 255) {
case 0:
- *p = Pixels8[color];
+ *p = color.D8;
break;
case 1:
- *p = lookup25trans8[(Pixels8[color] << 8) | *p];
+ *p = lookup25trans8[(color.D8 << 8) | *p];
break;
case 2:
- *p = lookup50trans8[(*p << 8) | Pixels8[color]];
+ *p = lookup50trans8[(*p << 8) | color.D8];
break;
case 3:
- *p = lookup25trans8[(*p << 8) | Pixels8[color]];
+ *p = lookup25trans8[(*p << 8) | color.D8];
break;
default:
break;
@@ -917,12 +917,12 @@
/**
** Draw pixel unclipped into 8bit framebuffer (ignoring alpha).
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param alpha alpha value of pixel.
*/
-local void DrawNoTransPixel8(SysColors color, int x, int y,
+local void DrawNoTransPixel8(VMemType color, int x, int y,
unsigned char alpha __attribute__((unused)))
{
DrawPixel8(color, x, y);
@@ -931,7 +931,7 @@
/**
** Draw translucent pixel unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param alpha alpha value of pixel.
@@ -945,7 +945,7 @@
** * alpha = |-GGGGGGGGGGSRRRRRRRRR-SBBBBBBBBB|
** newcolor = |------GGGGG-----RRRRR------BBBBB|
*/
-local void DrawTransPixel15(SysColors color, int x, int y,
+local void DrawTransPixel15(VMemType color, int x, int y,
unsigned char alpha)
{
VMemType16* p;
@@ -953,7 +953,7 @@
unsigned long dp;
p = VideoMemory16 + x + y * VideoWidth;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
alpha >>= 3; //FIXME: only 5bits available between colors
dp = *p;
@@ -965,7 +965,7 @@
/**
** Draw translucent pixel unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param alpha alpha value of pixel.
@@ -980,7 +980,7 @@
** * alpha = |SGGGGGGGGGGSRRRRRRRRRSBBBBBBBBBB|
** newcolor = |-----GGGGGG-----RRRRR------BBBBB|
*/
-local void DrawTransPixel16(SysColors color, int x, int y,
+local void DrawTransPixel16(VMemType color, int x, int y,
unsigned char alpha)
{
VMemType16* p;
@@ -988,7 +988,7 @@
unsigned long dp;
p = VideoMemory16 + x + y * VideoWidth;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
alpha >>= 3; //FIXME: only 5bits available between colors
dp = *p;
@@ -1000,22 +1000,22 @@
/**
** Draw translucent pixel unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param alpha alpha value of pixel.
*/
-local void DrawTransPixel24(SysColors color, int x, int y,
+local void DrawTransPixel24(VMemType color, int x, int y,
unsigned char alpha __attribute__((unused)))
{
//FIXME: does 24bpp represents R|G|B?
- VideoMemory24[x + y * VideoWidth] = Pixels24[color];
+ VideoMemory24[x + y * VideoWidth] = color.D24;
}
/**
** Draw translucent pixel unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param alpha alpha value of pixel.
@@ -1036,7 +1036,7 @@
**
** FIXME: alpha blending the A-value of 32bit may not be needed.. always 0
*/
-local void DrawTransPixel32(SysColors color, int x, int y,
+local void DrawTransPixel32(VMemType color, int x, int y,
unsigned char alpha)
{
VMemType32* p;
@@ -1045,7 +1045,7 @@
unsigned long dp1;
unsigned long dp2;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -1063,13 +1063,13 @@
/**
** Draw translucent pixel unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param alpha alpha value of pixel.
*/
#ifdef USE_OPENGL
-local void DrawTransPixelOpenGL(SysColors color, int x, int y,
+local void DrawTransPixelOpenGL(VMemType color, int x, int y,
unsigned char alpha)
{
VMemType32 c;
@@ -1077,7 +1077,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -1093,76 +1093,76 @@
/**
** Draw pixel clipped to current clip setting into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void DrawPixelClip8(SysColors color, int x, int y)
+local void DrawPixelClip8(VMemType color, int x, int y)
{
// Clipping:
if (x < ClipX1 || x > ClipX2 || y < ClipY1 || y > ClipY2) {
return;
}
- VideoMemory8[x + y * VideoWidth] = Pixels8[color];
+ VideoMemory8[x + y * VideoWidth] = color.D8;
}
/**
** Draw pixel clipped to current clip setting into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void DrawPixelClip16(SysColors color, int x, int y)
+local void DrawPixelClip16(VMemType color, int x, int y)
{
// Clipping:
if (x < ClipX1 || x > ClipX2 || y < ClipY1 || y > ClipY2) {
return;
}
- VideoMemory16[x + y * VideoWidth] = Pixels16[color];
+ VideoMemory16[x + y * VideoWidth] = color.D16;
}
/**
** Draw pixel clipped to current clip setting into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void DrawPixelClip24(SysColors color, int x, int y)
+local void DrawPixelClip24(VMemType color, int x, int y)
{
// Clipping:
if (x < ClipX1 || x > ClipX2 || y < ClipY1 || y > ClipY2) {
return;
}
- VideoMemory24[x + y * VideoWidth] = Pixels24[color];
+ VideoMemory24[x + y * VideoWidth] = color.D24;
}
/**
** Draw pixel clipped to current clip setting into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-local void DrawPixelClip32(SysColors color, int x, int y)
+local void DrawPixelClip32(VMemType color, int x, int y)
{
// Clipping:
if (x < ClipX1 || x > ClipX2 || y < ClipY1 || y > ClipY2) {
return;
}
- VideoMemory32[x + y * VideoWidth] = Pixels32[color];
+ VideoMemory32[x + y * VideoWidth] = color.D32;
}
/**
** Draw pixel clipped to current clip setting.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
#ifdef USE_OPENGL
-local void DrawPixelClipOpenGL(SysColors color, int x, int y)
+local void DrawPixelClipOpenGL(VMemType color, int x, int y)
{
VMemType32 c;
GLubyte r;
@@ -1174,7 +1174,7 @@
return;
}
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -1190,11 +1190,11 @@
/**
** Draw 25% translucent pixel clipped to current clip setting.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-global void VideoDraw25TransPixelClip(SysColors color, int x, int y)
+global void VideoDraw25TransPixelClip(VMemType color, int x, int y)
{
// Clipping:
if (x < ClipX1 || x > ClipX2 || y < ClipY1 || y > ClipY2) {
@@ -1206,11 +1206,11 @@
/**
** Draw 50% translucent pixel clipped to current clip setting.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-global void VideoDraw50TransPixelClip(SysColors color, int x, int y)
+global void VideoDraw50TransPixelClip(VMemType color, int x, int y)
{
// Clipping:
if (x < ClipX1 || x > ClipX2 || y < ClipY1 || y > ClipY2) {
@@ -1222,11 +1222,11 @@
/**
** Draw 75% translucent pixel clipped to current clip setting.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
*/
-global void VideoDraw75TransPixelClip(SysColors color, int x, int y)
+global void VideoDraw75TransPixelClip(VMemType color, int x, int y)
{
// Clipping:
if (x < ClipX1 || x > ClipX2 || y < ClipY1 || y > ClipY2) {
@@ -1238,12 +1238,12 @@
/**
** Draw translucent pixel clipped to current clip setting.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param alpha alpha value of pixels.
*/
-global void VideoDrawTransPixelClip(SysColors color, int x, int y,
+global void VideoDrawTransPixelClip(VMemType color, int x, int y,
unsigned char alpha)
{
// Clipping:
@@ -1260,12 +1260,12 @@
/**
** Draw horizontal line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line.
*/
-local void DrawHLine8(SysColors color, int x, int y, int width)
+local void DrawHLine8(VMemType color, int x, int y, int width)
{
VMemType8* p;
VMemType8* e;
@@ -1275,7 +1275,7 @@
w = VideoWidth;
p = VideoMemory8 + y * w + x;
e = p + width;
- f = Pixels8[color];
+ f = color.D8;
while (p < e) { // FIXME: better!
*p++ = f;
@@ -1285,12 +1285,12 @@
/**
** Draw horizontal line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void DrawHLine16(SysColors color, int x, int y, int width)
+local void DrawHLine16(VMemType color, int x, int y, int width)
{
VMemType16* p;
VMemType16* e;
@@ -1300,7 +1300,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
e = p + width-1;
- f = ((unsigned long)Pixels16[color] << 16) | Pixels16[color];
+ f = ((unsigned long)color.D16 << 16) | color.D16;
while (p < e) { // draw 2 pixels
*((unsigned long*)p)++ = f;
@@ -1314,12 +1314,12 @@
/**
** Draw horizontal line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void DrawHLine24(SysColors color, int x, int y, int width)
+local void DrawHLine24(VMemType color, int x, int y, int width)
{
VMemType24* p;
VMemType24* e;
@@ -1329,7 +1329,7 @@
w = VideoWidth;
p = VideoMemory24 + y * w + x;
e = p + width;
- f = Pixels24[color];
+ f = color.D24;
while (p < e) {
*p++ = f;
@@ -1339,12 +1339,12 @@
/**
** Draw horizontal line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void DrawHLine32(SysColors color, int x, int y, int width)
+local void DrawHLine32(VMemType color, int x, int y, int width)
{
VMemType32* p;
VMemType32* e;
@@ -1354,7 +1354,7 @@
w = VideoWidth;
p = VideoMemory32 + y * w + x;
e = p + width;
- f = Pixels32[color];
+ f = color.D32;
while (p < e) {
*p++ = f;
@@ -1364,20 +1364,20 @@
/**
** Draw horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
#ifdef USE_OPENGL
-local void DrawHLineOpenGL(SysColors color, int x, int y, int width)
+local void DrawHLineOpenGL(VMemType color, int x, int y, int width)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -1394,12 +1394,12 @@
/**
** Draw 25% translucent horizontal line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw25TransHLine8(SysColors color, int x, int y, int width)
+local void Draw25TransHLine8(VMemType color, int x, int y, int width)
{
VMemType8* p;
VMemType8* e;
@@ -1407,7 +1407,7 @@
p = VideoMemory8 + x + y * VideoWidth;
e = p + width;
- c = Pixels8[color] << 8;
+ c = color.D8 << 8;
while (p < e) {
*p = lookup25trans8[c | *p];
@@ -1418,12 +1418,12 @@
/**
** Draw 25% translucent horizontal line unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw25TransHLine15(SysColors color, int x, int y, int width)
+local void Draw25TransHLine15(VMemType color, int x, int y, int width)
{
VMemType16* p;
VMemType16* e;
@@ -1433,7 +1433,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
e = p + width;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x03E07C1F) * 3;
@@ -1450,12 +1450,12 @@
/**
** Draw 25% translucent horizontal line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw25TransHLine16(SysColors color, int x, int y, int width)
+local void Draw25TransHLine16(VMemType color, int x, int y, int width)
{
VMemType16* p;
VMemType16* e;
@@ -1465,7 +1465,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
e = p + width;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x07E0F81F) * 3;
@@ -1482,12 +1482,12 @@
/**
** Draw 25% translucent horizontal line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw25TransHLine24(SysColors color, int x, int y, int width)
+local void Draw25TransHLine24(VMemType color, int x, int y, int width)
{
// FIXME: does 24bpp holds R|G|B ?
DrawHLine24(color, x, y, width); // no trans functionaility for the moment
:(
@@ -1496,12 +1496,12 @@
/**
** Draw 25% translucent horizontal line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw25TransHLine32(SysColors color, int x, int y, int width)
+local void Draw25TransHLine32(VMemType color, int x, int y, int width)
{
VMemType32* p;
VMemType32* e;
@@ -1512,7 +1512,7 @@
w = VideoWidth;
p = VideoMemory32 + y * w + x;
e = p + width;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
// FIXME: pre multiply?
sp2 = ((sp1 & 0xFF00FF00) >> 8) * 3;
sp1 = (sp1 & 0x00FF00FF) * 3;
@@ -1534,20 +1534,20 @@
/**
** Draw 25% translucent horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
#ifdef USE_OPENGL
-local void Draw25TransHLineOpenGL(SysColors color, int x, int y, int width)
+local void Draw25TransHLineOpenGL(VMemType color, int x, int y, int width)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -1564,12 +1564,12 @@
/**
** Draw 50% translucent horizontal line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw50TransHLine8(SysColors color, int x, int y, int width)
+local void Draw50TransHLine8(VMemType color, int x, int y, int width)
{
VMemType8* p;
VMemType8* e;
@@ -1577,7 +1577,7 @@
p = VideoMemory8 + x + y * VideoWidth;
e = p + width;
- c = Pixels8[color] << 8;
+ c = color.D8 << 8;
while (p < e) {
*p = lookup50trans8[c | *p];
@@ -1588,12 +1588,12 @@
/**
** Draw 50% translucent horizontal line unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw50TransHLine15(SysColors color, int x, int y, int width)
+local void Draw50TransHLine15(VMemType color, int x, int y, int width)
{
VMemType16* p;
VMemType16* e;
@@ -1603,7 +1603,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
e = p + width;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
while (p < e) {
@@ -1619,12 +1619,12 @@
/**
** Draw 50% translucent horizontal line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw50TransHLine16(SysColors color, int x, int y, int width)
+local void Draw50TransHLine16(VMemType color, int x, int y, int width)
{
VMemType16* p;
VMemType16* e;
@@ -1634,7 +1634,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
e = p + width;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
while (p < e) {
@@ -1650,12 +1650,12 @@
/**
** Draw 50% translucent horizontal line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw50TransHLine24(SysColors color, int x, int y, int width)
+local void Draw50TransHLine24(VMemType color, int x, int y, int width)
{
// FIXME: does 24bpp holds R|G|B ?
DrawHLine24(color, x, y, width); // no trans functionaility for the moment
:(
@@ -1664,12 +1664,12 @@
/**
** Draw 50% translucent horizontal line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw50TransHLine32(SysColors color, int x, int y, int width)
+local void Draw50TransHLine32(VMemType color, int x, int y, int width)
{
VMemType32* p, *e;
unsigned long sp1, sp2;
@@ -1678,7 +1678,7 @@
w = VideoWidth;
p = VideoMemory32 + y * w + x;
e = p + width;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -1698,20 +1698,20 @@
/**
** Draw 50% translucent horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
#ifdef USE_OPENGL
-local void Draw50TransHLineOpenGL(SysColors color, int x, int y, int width)
+local void Draw50TransHLineOpenGL(VMemType color, int x, int y, int width)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -1728,12 +1728,12 @@
/**
** Draw 75% translucent horizontal line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw75TransHLine8(SysColors color, int x, int y, int width)
+local void Draw75TransHLine8(VMemType color, int x, int y, int width)
{
VMemType8* p;
VMemType8* e;
@@ -1741,7 +1741,7 @@
p = VideoMemory8 + x + y * VideoWidth;
e = p + width;
- c = Pixels8[color];
+ c = color.D8;
while (p < e) {
*p = lookup25trans8[(*p << 8) | c];
@@ -1752,12 +1752,12 @@
/**
** Draw 75% translucent horizontal line unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw75TransHLine15(SysColors color, int x, int y, int width)
+local void Draw75TransHLine15(VMemType color, int x, int y, int width)
{
VMemType16* p;
VMemType16* e;
@@ -1767,7 +1767,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
e = p + width;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
while (p < e) {
@@ -1783,12 +1783,12 @@
/**
** Draw 75% translucent horizontal line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw75TransHLine16(SysColors color, int x, int y, int width)
+local void Draw75TransHLine16(VMemType color, int x, int y, int width)
{
VMemType16* p;
VMemType16* e;
@@ -1798,7 +1798,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
e = p + width;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
while (p < e) {
@@ -1814,12 +1814,12 @@
/**
** Draw 75% translucent horizontal line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw75TransHLine24(SysColors color, int x, int y, int width)
+local void Draw75TransHLine24(VMemType color, int x, int y, int width)
{
// FIXME: does 24bpp holds R|G|B ?
DrawHLine24(color, x, y, width); // no trans functionaility for the moment
:(
@@ -1828,12 +1828,12 @@
/**
** Draw 75% translucent horizontal line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-local void Draw75TransHLine32(SysColors color, int x, int y, int width)
+local void Draw75TransHLine32(VMemType color, int x, int y, int width)
{
VMemType32* p;
VMemType32* e;
@@ -1844,7 +1844,7 @@
w = VideoWidth;
p = VideoMemory32 + y * w + x;
e = p + width;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -1865,20 +1865,20 @@
/**
** Draw 75% translucent horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
#ifdef USE_OPENGL
-local void Draw75TransHLineOpenGL(SysColors color, int x, int y, int width)
+local void Draw75TransHLineOpenGL(VMemType color, int x, int y, int width)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -1895,13 +1895,13 @@
/**
** Draw translucent horizontal line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransHLine8(SysColors color, int x, int y, int width,
+local void DrawTransHLine8(VMemType color, int x, int y, int width,
unsigned char alpha)
{
VMemType8* p;
@@ -1910,7 +1910,7 @@
p = VideoMemory8 + x + y * VideoWidth;
e = p + width;
- c = Pixels8[color];
+ c = color.D8;
switch (((unsigned int)alpha * 4) / 255) {
case 0:
@@ -1952,7 +1952,7 @@
** @param width Line width in pixel
** @param alpha alpha value of pixel
*/
-local void DrawNoTransHLine8(SysColors color, int x, int y, int width,
+local void DrawNoTransHLine8(VMemType color, int x, int y, int width,
unsigned char alpha __attribute__((unused)))
{
DrawHLine8(color, x, y, width);
@@ -1961,13 +1961,13 @@
/**
** Draw translucent horizontal line unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransHLine15(SysColors color, int x, int y, int width,
+local void DrawTransHLine15(VMemType color, int x, int y, int width,
unsigned char alpha)
{
VMemType16* p;
@@ -1976,7 +1976,7 @@
p = VideoMemory16 + y * VideoWidth + x;
e = p + width;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = ((sp << 16) | sp) & 0x03E07C1F;
alpha >>= 3; // FIXME: only 5bits
@@ -1994,13 +1994,13 @@
/**
** Draw translucent horizontal line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransHLine16(SysColors color, int x, int y, int width,
+local void DrawTransHLine16(VMemType color, int x, int y, int width,
unsigned char alpha)
{
VMemType16* p;
@@ -2009,7 +2009,7 @@
p = VideoMemory16 + y * VideoWidth + x;
e = p + width;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = ((sp << 16) | sp) & 0x07E0F81F;
alpha >>= 3; // FIXME: only 5bits
@@ -2027,13 +2027,13 @@
/**
** Draw translucent horizontal line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransHLine24(SysColors color, int x, int y, int width,
+local void DrawTransHLine24(VMemType color, int x, int y, int width,
unsigned char alpha)
{
VMemType24 c;
@@ -2045,7 +2045,7 @@
p = VideoMemory24 + y * VideoWidth + x;
e = p + width;
- c = Pixels24[color];
+ c = color.D24;
spR = c.a;
spG = c.b;
spB = c.c;
@@ -2076,13 +2076,13 @@
/**
** Draw translucent horizontal line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransHLine32(SysColors color, int x, int y, int width,
+local void DrawTransHLine32(VMemType color, int x, int y, int width,
unsigned char alpha)
{
VMemType32* p;
@@ -2092,7 +2092,7 @@
p = VideoMemory32 + y * VideoWidth + x;
e = p + width;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -2137,14 +2137,14 @@
/**
** Draw translucent horizontal line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
#ifdef USE_OPENGL
-local void DrawTransHLineOpenGL(SysColors color, int x, int y, int width,
+local void DrawTransHLineOpenGL(VMemType color, int x, int y, int width,
unsigned char alpha)
{
VMemType32 c;
@@ -2152,7 +2152,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -2168,12 +2168,12 @@
/**
** Draw horizontal line clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-global void VideoDrawHLineClip(SysColors color, int x, int y, int width)
+global void VideoDrawHLineClip(VMemType color, int x, int y, int width)
{
CLIP_HLINE(x, y, width);
VideoDrawHLine(color, x, y, width);
@@ -2182,12 +2182,12 @@
/**
** Draw 25% translucent horizontal line clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-global void VideoDraw25TransHLineClip(SysColors color, int x, int y, int width)
+global void VideoDraw25TransHLineClip(VMemType color, int x, int y, int width)
{
CLIP_HLINE(x, y, width);
VideoDraw25TransHLine(color, x, y, width);
@@ -2196,12 +2196,12 @@
/**
** Draw 50% translucent horizontal line clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-global void VideoDraw50TransHLineClip(SysColors color, int x, int y, int width)
+global void VideoDraw50TransHLineClip(VMemType color, int x, int y, int width)
{
CLIP_HLINE(x, y, width);
VideoDraw50TransHLine(color, x, y, width);
@@ -2210,12 +2210,12 @@
/**
** Draw 75% translucent horizontal line clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param width width of line (0=don't draw).
*/
-global void VideoDraw75TransHLineClip(SysColors color, int x, int y, int width)
+global void VideoDraw75TransHLineClip(VMemType color, int x, int y, int width)
{
CLIP_HLINE(x, y, width);
VideoDraw75TransHLine(color, x, y, width);
@@ -2230,7 +2230,7 @@
** @param width Width of line (0=don't draw)
** @param alpha Alpha value of pixels
*/
-global void VideoDrawTransHLineClip(SysColors color, int x, int y, int width,
+global void VideoDrawTransHLineClip(VMemType color, int x, int y, int width,
unsigned char alpha)
{
CLIP_HLINE(x, y, width);
@@ -2244,12 +2244,12 @@
/**
** Draw vertical line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void DrawVLine8(SysColors color, int x, int y, int height)
+local void DrawVLine8(VMemType color, int x, int y, int height)
{
VMemType8* p;
VMemType8* e;
@@ -2259,7 +2259,7 @@
w = VideoWidth;
p = VideoMemory8 + y * w + x;
e = p + height * w;
- f = Pixels8[color];
+ f = color.D8;
while (p < e) { // FIXME: better
*p = f;
p += w;
@@ -2269,12 +2269,12 @@
/**
** Draw vertical line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void DrawVLine16(SysColors color, int x, int y, int height)
+local void DrawVLine16(VMemType color, int x, int y, int height)
{
VMemType16* p;
VMemType16* e;
@@ -2284,7 +2284,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
e = p + height * w;
- f = Pixels16[color];
+ f = color.D16;
while (p < e) { // FIXME: better
*p = f;
p += w;
@@ -2294,12 +2294,12 @@
/**
** Draw vertical line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void DrawVLine24(SysColors color, int x, int y, int height)
+local void DrawVLine24(VMemType color, int x, int y, int height)
{
VMemType24* p;
VMemType24* e;
@@ -2309,7 +2309,7 @@
w = VideoWidth;
p = VideoMemory24 + y * w + x;
e = p + height * w;
- f = Pixels24[color];
+ f = color.D24;
while (p < e) { // FIXME: better
*p = f;
p += w;
@@ -2319,12 +2319,12 @@
/**
** Draw vertical line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void DrawVLine32(SysColors color, int x, int y, int height)
+local void DrawVLine32(VMemType color, int x, int y, int height)
{
VMemType32* p;
VMemType32* e;
@@ -2334,7 +2334,7 @@
w = VideoWidth;
p = VideoMemory32 + y * w + x;
e = p + height * w;
- f = Pixels32[color];
+ f = color.D32;
while (p < e) { // FIXME: better
*p = f;
p += w;
@@ -2344,20 +2344,20 @@
/**
** Draw vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
#ifdef USE_OPENGL
-local void DrawVLineOpenGL(SysColors color, int x, int y, int height)
+local void DrawVLineOpenGL(VMemType color, int x, int y, int height)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -2374,12 +2374,12 @@
/**
** Draw 25% translucent vertical line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw25TransVLine8(SysColors color, int x, int y, int height)
+local void Draw25TransVLine8(VMemType color, int x, int y, int height)
{
VMemType8* p;
unsigned int c;
@@ -2387,7 +2387,7 @@
w = VideoWidth;
p = VideoMemory8 + x + y * w;
- c = Pixels8[color] << 8;
+ c = color.D8 << 8;
while (height--) {
*p = lookup25trans8[c | *p];
p += w;
@@ -2397,12 +2397,12 @@
/**
** Draw 25% translucent vertical line unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw25TransVLine15(SysColors color, int x, int y, int height)
+local void Draw25TransVLine15(VMemType color, int x, int y, int height)
{
VMemType16* p;
unsigned long sp;
@@ -2410,7 +2410,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x03E07C1F) * 3;
@@ -2428,12 +2428,12 @@
/**
** Draw 25% translucent vertical line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw25TransVLine16(SysColors color, int x, int y, int height)
+local void Draw25TransVLine16(VMemType color, int x, int y, int height)
{
VMemType16* p;
unsigned long sp;
@@ -2441,7 +2441,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x07E0F81F) * 3;
@@ -2459,12 +2459,12 @@
/**
** Draw 25% translucent vertical line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw25TransVLine24(SysColors color, int x, int y, int height)
+local void Draw25TransVLine24(VMemType color, int x, int y, int height)
{
// FIXME: does 24bpp holds R|G|B ?
DrawVLine24(color, x, y, height); // no trans functionaility for the
moment :(
@@ -2473,12 +2473,12 @@
/**
** Draw 25% translucent vertical line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw25TransVLine32(SysColors color, int x, int y, int height)
+local void Draw25TransVLine32(VMemType color, int x, int y, int height)
{
VMemType32* p;
unsigned long sp1,sp2;
@@ -2486,7 +2486,7 @@
w = VideoWidth;
p = VideoMemory32 + y * w + x;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
// FIXME: pre multiply?
sp2 = ((sp1 & 0xFF00FF00) >> 8) * 3;
sp1 = (sp1 & 0x00FF00FF) * 3;
@@ -2509,18 +2509,18 @@
/**
** Draw 25% translucent vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
#ifdef USE_OPENGL
-local void Draw25TransVLineOpenGL(SysColors color, int x, int y, int height)
+local void Draw25TransVLineOpenGL(VMemType color, int x, int y, int height)
{
VMemType32 c;
GLubyte r,g,b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -2537,12 +2537,12 @@
/**
** Draw 50% translucent vertical line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw50TransVLine8(SysColors color, int x, int y, int height)
+local void Draw50TransVLine8(VMemType color, int x, int y, int height)
{
VMemType8* p;
unsigned int c;
@@ -2550,7 +2550,7 @@
w = VideoWidth;
p = VideoMemory8 + x + y * w;
- c = Pixels8[color] << 8;
+ c = color.D8 << 8;
while (height--) {
*p = lookup50trans8[c | *p];
p += w;
@@ -2560,12 +2560,12 @@
/**
** Draw 50% translucent vertical line unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw50TransVLine15(SysColors color, int x, int y, int height)
+local void Draw50TransVLine15(VMemType color, int x, int y, int height)
{
VMemType16* p;
unsigned long sp;
@@ -2573,7 +2573,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
while (height--) {
@@ -2590,12 +2590,12 @@
/**
** Draw 50% translucent vertical line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw50TransVLine16(SysColors color, int x, int y, int height)
+local void Draw50TransVLine16(VMemType color, int x, int y, int height)
{
VMemType16* p;
unsigned long sp;
@@ -2603,7 +2603,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = ((sp << 16) | sp) & 0x07E0F81F;
@@ -2621,12 +2621,12 @@
/**
** Draw 50% translucent vertical line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw50TransVLine24(SysColors color, int x, int y, int height)
+local void Draw50TransVLine24(VMemType color, int x, int y, int height)
{
// FIXME: does 24bpp holds R|G|B ?
DrawVLine24(color, x, y, height); // no trans functionaility for the
moment :(
@@ -2635,12 +2635,12 @@
/**
** Draw 50% translucent vertical line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw50TransVLine32(SysColors color, int x, int y, int height)
+local void Draw50TransVLine32(VMemType color, int x, int y, int height)
{
VMemType32* p;
unsigned long sp1;
@@ -2649,7 +2649,7 @@
w = VideoWidth;
p = VideoMemory32 + y * w + x;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -2672,20 +2672,20 @@
/**
** Draw 50% translucent vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
#ifdef USE_OPENGL
-local void Draw50TransVLineOpenGL(SysColors color, int x, int y, int height)
+local void Draw50TransVLineOpenGL(VMemType color, int x, int y, int height)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -2702,12 +2702,12 @@
/**
** Draw 75% translucent vertical line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw75TransVLine8(SysColors color, int x, int y, int height)
+local void Draw75TransVLine8(VMemType color, int x, int y, int height)
{
VMemType8* p;
unsigned int c;
@@ -2715,7 +2715,7 @@
w = VideoWidth;
p = VideoMemory8 + x + y * w;
- c = Pixels8[color];
+ c = color.D8;
while (height--) {
*p = lookup25trans8[(*p << 8) | c];
p += w;
@@ -2725,12 +2725,12 @@
/**
** Draw 75% translucent vertical line unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw75TransVLine15(SysColors color, int x, int y, int height)
+local void Draw75TransVLine15(VMemType color, int x, int y, int height)
{
VMemType16* p;
unsigned long sp;
@@ -2738,7 +2738,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = ((sp << 16) | sp) & 0x03E07C1F;
@@ -2756,12 +2756,12 @@
/**
** Draw 75% translucent vertical line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw75TransVLine16(SysColors color, int x, int y, int height)
+local void Draw75TransVLine16(VMemType color, int x, int y, int height)
{
VMemType16* p;
unsigned long sp;
@@ -2769,7 +2769,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = ((sp << 16) | sp) & 0x07E0F81F;
@@ -2787,12 +2787,12 @@
/**
** Draw 75% translucent vertical line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw75TransVLine24(SysColors color, int x, int y, int height)
+local void Draw75TransVLine24(VMemType color, int x, int y, int height)
{
// FIXME: does 24bpp holds R|G|B ?
DrawVLine24(color, x, y, height); // no trans functionaility for the
moment :(
@@ -2801,12 +2801,12 @@
/**
** Draw 75% translucent vertical line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-local void Draw75TransVLine32(SysColors color, int x, int y, int height)
+local void Draw75TransVLine32(VMemType color, int x, int y, int height)
{
VMemType32* p;
unsigned long sp1;
@@ -2815,7 +2815,7 @@
w = VideoWidth;
p = VideoMemory32 + y * w + x;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -2838,20 +2838,20 @@
/**
** Draw 75% translucent vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
#ifdef USE_OPENGL
-local void Draw75TransVLineOpenGL(SysColors color, int x, int y, int height)
+local void Draw75TransVLineOpenGL(VMemType color, int x, int y, int height)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -2868,13 +2868,13 @@
/**
** Draw translucent vertical line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransVLine8(SysColors color, int x, int y, int height,
+local void DrawTransVLine8(VMemType color, int x, int y, int height,
unsigned char alpha)
{
VMemType8* p;
@@ -2883,7 +2883,7 @@
w = VideoWidth;
p = VideoMemory8 + x + y * w;
- c = Pixels8[color];
+ c = color.D8;
switch (((unsigned int)alpha * 4) / 255) {
case 0:
@@ -2920,13 +2920,13 @@
/**
** Draw vertical line unclipped into 8bit framebuffer (ignoring alpha).
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height Height = length of the line.
** @param alpha alpha value of pixel.
*/
-local void DrawNoTransVLine8(SysColors color, int x, int y, int height,
+local void DrawNoTransVLine8(VMemType color, int x, int y, int height,
unsigned char alpha __attribute__((unused)))
{
DrawVLine8(color, x, y, height);
@@ -2935,13 +2935,13 @@
/**
** Draw translucent vertical line unclipped into 15bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransVLine15(SysColors color, int x, int y, int height,
+local void DrawTransVLine15(VMemType color, int x, int y, int height,
unsigned char alpha)
{
VMemType16* p;
@@ -2950,7 +2950,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = ((sp << 16) | sp) & 0x03E07C1F;
alpha >>= 3; // FIXME: only 5bits
@@ -2969,13 +2969,13 @@
/**
** Draw translucent vertical line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransVLine16(SysColors color, int x, int y, int height,
+local void DrawTransVLine16(VMemType color, int x, int y, int height,
unsigned char alpha)
{
VMemType16* p;
@@ -2984,7 +2984,7 @@
w = VideoWidth;
p = VideoMemory16 + y * w + x;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = ((sp << 16) | sp) & 0x07E0F81F;
alpha >>= 3; // FIXME: only 5bits
@@ -3003,13 +3003,13 @@
/**
** Draw translucent vertical line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransVLine24(SysColors color, int x, int y, int height,
+local void DrawTransVLine24(VMemType color, int x, int y, int height,
unsigned char alpha __attribute__((unused)))
{
// FIXME: does 24bpp holds R|G|B ?
@@ -3019,13 +3019,13 @@
/**
** Draw translucent vertical line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-local void DrawTransVLine32(SysColors color, int x, int y, int height,
+local void DrawTransVLine32(VMemType color, int x, int y, int height,
unsigned char alpha)
{
VMemType32* p;
@@ -3035,7 +3035,7 @@
w = VideoWidth;
p = VideoMemory32 + y * w + x;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -3079,14 +3079,14 @@
/**
** Draw translucent vertical line unclipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
#ifdef USE_OPENGL
-local void DrawTransVLineOpenGL(SysColors color, int x, int y, int height,
+local void DrawTransVLineOpenGL(VMemType color, int x, int y, int height,
unsigned char alpha)
{
VMemType32 c;
@@ -3094,7 +3094,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -3111,12 +3111,12 @@
/**
** Draw vertical line clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-global void VideoDrawVLineClip(SysColors color, int x, int y, int height)
+global void VideoDrawVLineClip(VMemType color, int x, int y, int height)
{
CLIP_VLINE(x, y, height);
VideoDrawVLine(color, x, y, height);
@@ -3125,12 +3125,12 @@
/**
** Draw 25% translucent vertical line clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-global void VideoDraw25TransVLineClip(SysColors color, int x, int y,
+global void VideoDraw25TransVLineClip(VMemType color, int x, int y,
int height)
{
CLIP_VLINE(x, y, height);
@@ -3140,12 +3140,12 @@
/**
** Draw 50% translucent vertical line clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-global void VideoDraw50TransVLineClip(SysColors color, int x, int y,
+global void VideoDraw50TransVLineClip(VMemType color, int x, int y,
int height)
{
CLIP_VLINE(x, y, height);
@@ -3155,12 +3155,12 @@
/**
** Draw 75% translucent vertical line clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
*/
-global void VideoDraw75TransVLineClip(SysColors color, int x, int y,
+global void VideoDraw75TransVLineClip(VMemType color, int x, int y,
int height)
{
CLIP_VLINE(x, y, height);
@@ -3170,14 +3170,14 @@
/**
** Draw translucent vertical line clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param height height of line (0=don't draw).
** @param alpha alpha value of pixels.
*/
-global void VideoDrawTransVLineClip(SysColors color, int x, int y,
- int height,unsigned char alpha)
+global void VideoDrawTransVLineClip(VMemType color, int x, int y,
+ int height, unsigned char alpha)
{
CLIP_VLINE(x, y, height);
VideoDrawTransVLine(color, x, y, height, alpha);
@@ -3190,13 +3190,13 @@
/**
** Draw line unclipped into 8bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x1 Source x coordinate on the screen
** @param y1 Source y coordinate on the screen
** @param x2 Destination x coordinate on the screen
** @param y2 Destination y coordinate on the screen
*/
-local void DrawLine8(SysColors color, int x1, int y1, int x2, int y2)
+local void DrawLine8(VMemType color, int x1, int y1, int x2, int y2)
{
int d;
int dx;
@@ -3226,7 +3226,7 @@
// initialize
w = VideoWidth;
- f = Pixels8[color];
+ f = color.D8;
if (y1 > y2) { // exchange coordinates
x1 ^= x2; x2 ^= x1; x1 ^= x2;
@@ -3290,13 +3290,13 @@
/**
** Draw line unclipped into 16bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x1 Source x coordinate on the screen
** @param y1 Source y coordinate on the screen
** @param x2 Destination x coordinate on the screen
** @param y2 Destination y coordinate on the screen
*/
-local void DrawLine16(SysColors color, int x1, int y1, int x2, int y2)
+local void DrawLine16(VMemType color, int x1, int y1, int x2, int y2)
{
int d;
int dx;
@@ -3326,7 +3326,7 @@
// initialize
w = VideoWidth;
- f = Pixels16[color];
+ f = color.D16;
if (y1 > y2) { // exchange coordinates
x1 ^= x2; x2 ^= x1; x1 ^= x2;
@@ -3390,13 +3390,13 @@
/**
** Draw line unclipped into 24bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x1 Source x coordinate on the screen
** @param y1 Source y coordinate on the screen
** @param x2 Destination x coordinate on the screen
** @param y2 Destination y coordinate on the screen
*/
-local void DrawLine24(SysColors color, int x1, int y1, int x2, int y2)
+local void DrawLine24(VMemType color, int x1, int y1, int x2, int y2)
{
int d;
int dx;
@@ -3426,7 +3426,7 @@
// initialize
w = VideoWidth;
- f = Pixels24[color];
+ f = color.D24;
if (y1 > y2) { // exchange coordinates
x1 ^= x2; x2 ^= x1; x1 ^= x2;
@@ -3490,13 +3490,13 @@
/**
** Draw line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x1 Source x coordinate on the screen
** @param y1 Source y coordinate on the screen
** @param x2 Destination x coordinate on the screen
** @param y2 Destination y coordinate on the screen
*/
-local void DrawLine32(SysColors color, int x1, int y1, int x2, int y2)
+local void DrawLine32(VMemType color, int x1, int y1, int x2, int y2)
{
int d;
int dx;
@@ -3526,7 +3526,7 @@
// initialize
w = VideoWidth;
- f = Pixels32[color];
+ f = color.D32;
if (y1 > y2) { // exchange coordinates
x1 ^= x2; x2 ^= x1; x1 ^= x2;
@@ -3590,21 +3590,21 @@
/**
** Draw line unclipped into 32bit framebuffer.
**
-** @param color Color index.
+** @param color color
** @param x1 Source x coordinate on the screen
** @param y1 Source y coordinate on the screen
** @param x2 Destination x coordinate on the screen
** @param y2 Destination y coordinate on the screen
*/
#ifdef USE_OPENGL
-local void DrawLineOpenGL(SysColors color, int x1, int y1, int x2, int y2)
+local void DrawLineOpenGL(VMemType color, int x1, int y1, int x2, int y2)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -3676,13 +3676,13 @@
** (Replaces Liang/Barksy clipping algorithm in CVS version 1.18, which
** might be faster, but that one contained some BUGs)
**
-** @param color Color index.
+** @param color color
** @param x1 Source x coordinate on the screen
** @param y1 Source y coordinate on the screen
** @param x2 Destination x coordinate on the screen
** @param y2 Destination y coordinate on the screen
*/
-global void VideoDrawLineClip(SysColors color, int x1, int y1, int x2, int y2)
+global void VideoDrawLineClip(VMemType color, int x1, int y1, int x2, int y2)
/* Based on Sutherland-Cohen clipping technique */
{
ClipCode code1;
@@ -3738,20 +3738,20 @@
/**
** Draw rectangle into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawRectangle8(SysColors color, int x, int y, int w, int h)
+local void DrawRectangle8(VMemType color, int x, int y, int w, int h)
{
VMemType8* p;
VMemType8 f;
int swidth;
int ofs;
- f = Pixels8[color];
+ f = color.D8;
swidth = VideoWidth;
p = VideoMemory8 + y * swidth + x;
if (h && (ofs = w)) {
@@ -3775,20 +3775,20 @@
/**
** Draw rectangle into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawRectangle16(SysColors color, int x, int y, int w, int h)
+local void DrawRectangle16(VMemType color, int x, int y, int w, int h)
{
VMemType16* p;
VMemType16 f;
int swidth;
int ofs;
- f = Pixels16[color];
+ f = color.D16;
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
if (h && (ofs = w)) {
@@ -3812,13 +3812,13 @@
/**
** Draw rectangle into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawRectangle24(SysColors color, int x, int y
+local void DrawRectangle24(VMemType color, int x, int y
, int w, int h)
{
VMemType24* p;
@@ -3826,7 +3826,7 @@
int swidth;
int ofs;
- f = Pixels24[color];
+ f = color.D24;
swidth = VideoWidth;
p = VideoMemory24 + y * swidth + x;
if (h && (ofs = w)) {
@@ -3850,13 +3850,13 @@
/**
** Draw rectangle into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawRectangle32(SysColors color, int x, int y
+local void DrawRectangle32(VMemType color, int x, int y
, int w, int h)
{
VMemType32* p;
@@ -3864,7 +3864,7 @@
int swidth;
int ofs;
- f = Pixels32[color];
+ f = color.D32;
swidth = VideoWidth;
p = VideoMemory32 + y * swidth + x;
if (h && (ofs = w)) {
@@ -3888,21 +3888,21 @@
/**
** Draw rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
#ifdef USE_OPENGL
-local void DrawRectangleOpenGL(SysColors color, int x, int y, int w, int h)
+local void DrawRectangleOpenGL(VMemType color, int x, int y, int w, int h)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -3921,13 +3921,13 @@
/**
** Draw 25% translucent rectangle into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw25TransRectangle8(SysColors color, int x, int y, int w, int h)
+local void Draw25TransRectangle8(VMemType color, int x, int y, int w, int h)
{
VMemType8* p;
int swidth;
@@ -3936,7 +3936,7 @@
swidth = VideoWidth;
p = VideoMemory8 + y * swidth + x;
- c = Pixels8[color] << 8;
+ c = color.D8 << 8;
if (h && (ofs = w)) {
do { // Draw top horizontal line
*p = lookup25trans8[c | *p];
@@ -3969,13 +3969,13 @@
/**
** Draw 25% translucent rectangle into 15bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw25TransRectangle15(SysColors color, int x, int y, int w, int h)
+local void Draw25TransRectangle15(VMemType color, int x, int y, int w, int h)
{
VMemType16* p;
unsigned long sp;
@@ -3983,7 +3983,7 @@
int swidth;
int ofs;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x03E07C1F) * 3;
swidth = VideoWidth;
@@ -4035,13 +4035,13 @@
/**
** Draw 25% translucent rectangle into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw25TransRectangle16(SysColors color, int x, int y, int w, int h)
+local void Draw25TransRectangle16(VMemType color, int x, int y, int w, int h)
{
VMemType16* p;
unsigned long sp;
@@ -4049,7 +4049,7 @@
int swidth;
int ofs;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x07E0F81F) * 3;
swidth = VideoWidth;
@@ -4101,13 +4101,13 @@
/**
** Draw 25% translucent rectangle into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw25TransRectangle24(SysColors color, int x, int y, int w, int h)
+local void Draw25TransRectangle24(VMemType color, int x, int y, int w, int h)
{
//FIXME: does 24bpp represents R|G|B?
DrawRectangle24(color, x, y, w, h); // no trans functionaility for the
moment :(
@@ -4116,13 +4116,13 @@
/**
** Draw 25% translucent rectangle into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw25TransRectangle32(SysColors color, int x, int y, int w, int h)
+local void Draw25TransRectangle32(VMemType color, int x, int y, int w, int h)
{
VMemType32* p;
unsigned long sp1;
@@ -4132,7 +4132,7 @@
int swidth;
int ofs;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
// FIXME: pre multiply?
sp2 = ((sp1 & 0xFF00FF00) >> 8) * 3;
sp1 = (sp1 & 0x00FF00FF) * 3;
@@ -4196,14 +4196,14 @@
/**
** Draw 25% translucent rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
#ifdef USE_OPENGL
-local void Draw25TransRectangleOpenGL(SysColors color, int x, int y,
+local void Draw25TransRectangleOpenGL(VMemType color, int x, int y,
int w, int h)
{
VMemType32 c;
@@ -4211,7 +4211,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -4230,13 +4230,13 @@
/**
** Draw 50% translucent rectangle into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw50TransRectangle8(SysColors color, int x, int y, int w, int h)
+local void Draw50TransRectangle8(VMemType color, int x, int y, int w, int h)
{
VMemType8* p;
int swidth;
@@ -4245,7 +4245,7 @@
swidth = VideoWidth;
p = VideoMemory8 + y * swidth + x;
- c = Pixels8[color] << 8;
+ c = color.D8 << 8;
if (h && (ofs = w)) {
do { // Draw top horizontal line
*p = lookup50trans8[c | *p];
@@ -4278,13 +4278,13 @@
/**
** Draw 50% translucent rectangle into 15bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw50TransRectangle15(SysColors color, int x, int y, int w, int h)
+local void Draw50TransRectangle15(VMemType color, int x, int y, int w, int h)
{
VMemType16* p;
unsigned long sp;
@@ -4292,7 +4292,7 @@
int swidth;
int ofs;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
@@ -4343,13 +4343,13 @@
/**
** Draw 50% translucent rectangle into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw50TransRectangle16(SysColors color, int x, int y, int w, int h)
+local void Draw50TransRectangle16(VMemType color, int x, int y, int w, int h)
{
VMemType16* p;
unsigned long sp;
@@ -4357,7 +4357,7 @@
int swidth;
int ofs;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
@@ -4408,13 +4408,13 @@
/**
** Draw 50% translucent rectangle into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw50TransRectangle24(SysColors color, int x, int y, int w, int h)
+local void Draw50TransRectangle24(VMemType color, int x, int y, int w, int h)
{
//FIXME: does 24bpp represents R|G|B?
DrawRectangle24(color, x, y, w, h); // no trans functionaility for the
moment :(
@@ -4423,13 +4423,13 @@
/**
** Draw 50% translucent rectangle into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw50TransRectangle32(SysColors color, int x, int y, int w, int h)
+local void Draw50TransRectangle32(VMemType color, int x, int y, int w, int h)
{
VMemType32* p;
unsigned long sp1;
@@ -4439,7 +4439,7 @@
int swidth;
int ofs;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
// FIXME: pre multiply?
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -4503,14 +4503,14 @@
/**
** Draw 50% translucent rectangle into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
#ifdef USE_OPENGL
-local void Draw50TransRectangleOpenGL(SysColors color, int x, int y,
+local void Draw50TransRectangleOpenGL(VMemType color, int x, int y,
int w, int h)
{
VMemType32 c;
@@ -4518,7 +4518,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -4537,13 +4537,13 @@
/**
** Draw 75% translucent rectangle into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw75TransRectangle8(SysColors color, int x, int y, int w, int h)
+local void Draw75TransRectangle8(VMemType color, int x, int y, int w, int h)
{
VMemType8* p;
int swidth;
@@ -4552,7 +4552,7 @@
swidth = VideoWidth;
p = VideoMemory8 + y * swidth + x;
- c = Pixels8[color];
+ c = color.D8;
if (h && (ofs = w)) {
do { // Draw top horizontal line
*p = lookup25trans8[(*p << 8) | c];
@@ -4585,13 +4585,13 @@
/**
** Draw 75% translucent rectangle into 15bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw75TransRectangle15(SysColors color, int x, int y, int w, int h)
+local void Draw75TransRectangle15(VMemType color, int x, int y, int w, int h)
{
VMemType16* p;
unsigned long sp;
@@ -4599,7 +4599,7 @@
int swidth;
int ofs;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
@@ -4650,13 +4650,13 @@
/**
** Draw 75% translucent rectangle into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw75TransRectangle16(SysColors color, int x, int y, int w, int h)
+local void Draw75TransRectangle16(VMemType color, int x, int y, int w, int h)
{
VMemType16* p;
unsigned long sp;
@@ -4664,7 +4664,7 @@
int swidth;
int ofs;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
@@ -4715,13 +4715,13 @@
/**
** Draw 75% translucent rectangle into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw75TransRectangle24(SysColors color, int x, int y, int w, int h)
+local void Draw75TransRectangle24(VMemType color, int x, int y, int w, int h)
{
//FIXME: does 24bpp represents R|G|B?
DrawRectangle24(color, x, y, w, h); // no trans functionaility for the
moment :(
@@ -4730,13 +4730,13 @@
/**
** Draw 75% translucent rectangle into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void Draw75TransRectangle32(SysColors color, int x, int y, int w, int h)
+local void Draw75TransRectangle32(VMemType color, int x, int y, int w, int h)
{
VMemType32* p;
unsigned long sp1;
@@ -4746,7 +4746,7 @@
int swidth;
int ofs;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
// FIXME: pre multiply?
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -4810,14 +4810,14 @@
/**
** Draw 75% translucent rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
#ifdef USE_OPENGL
-local void Draw75TransRectangleOpenGL(SysColors color, int x, int y,
+local void Draw75TransRectangleOpenGL(VMemType color, int x, int y,
int w, int h)
{
VMemType32 c;
@@ -4825,7 +4825,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -4844,14 +4844,14 @@
/**
** Draw translucent rectangle into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawTransRectangle8(SysColors color, int x, int y,
+local void DrawTransRectangle8(VMemType color, int x, int y,
int w, int h, unsigned char alpha)
{
switch (((unsigned int)alpha * 4) / 255) {
@@ -4882,7 +4882,7 @@
** @param h Height in pixel of the rectangle
** @param alpha Alpha value of pixel
*/
-local void DrawNoTransRectangle8(SysColors color, int x, int y,
+local void DrawNoTransRectangle8(VMemType color, int x, int y,
int w, int h, unsigned char alpha __attribute__((unused)))
{
DrawRectangle8(color, x, y, w, h);
@@ -4891,14 +4891,14 @@
/**
** Draw translucent rectangle into 15bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawTransRectangle15(SysColors color, int x, int y,
+local void DrawTransRectangle15(VMemType color, int x, int y,
int w, int h, unsigned char alpha)
{
VMemType16* p;
@@ -4907,7 +4907,7 @@
int swidth;
int ofs;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
@@ -4960,14 +4960,14 @@
/**
** Draw translucent rectangle into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawTransRectangle16(SysColors color, int x, int y,
+local void DrawTransRectangle16(VMemType color, int x, int y,
int w, int h, unsigned char alpha)
{
VMemType16* p;
@@ -4976,7 +4976,7 @@
int swidth;
int ofs;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
@@ -5029,14 +5029,14 @@
/**
** Draw translucent rectangle into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawTransRectangle24(SysColors color, int x, int y,
+local void DrawTransRectangle24(VMemType color, int x, int y,
int w, int h, unsigned char alpha __attribute__((unused)))
{
//FIXME: does 24bpp represents R|G|B?
@@ -5046,14 +5046,14 @@
/**
** Draw translucent rectangle into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawTransRectangle32(SysColors color, int x, int y,
+local void DrawTransRectangle32(VMemType color, int x, int y,
int w, int h, unsigned char alpha)
{
VMemType32* p;
@@ -5064,7 +5064,7 @@
int swidth;
int ofs;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
// FIXME: pre multiply?
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -5128,7 +5128,7 @@
/**
** Draw translucent rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
@@ -5136,7 +5136,7 @@
** @param alpha alpha value of pixel.
*/
#ifdef USE_OPENGL
-local void DrawTransRectangleOpenGL(SysColors color, int x, int y,
+local void DrawTransRectangleOpenGL(VMemType color, int x, int y,
int w, int h, unsigned char alpha)
{
VMemType32 c;
@@ -5144,7 +5144,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -5163,13 +5163,13 @@
/**
** Draw rectangle clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-global void VideoDrawRectangleClip(SysColors color, int x, int y,
+global void VideoDrawRectangleClip(VMemType color, int x, int y,
int w, int h)
{
#define _x x
@@ -5192,13 +5192,13 @@
/**
** Draw 25% translucent rectangle clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-global void VideoDraw25TransRectangleClip(SysColors color, int x, int y,
+global void VideoDraw25TransRectangleClip(VMemType color, int x, int y,
int w, int h)
{
#define _x x
@@ -5221,13 +5221,13 @@
/**
** Draw 50% translucent rectangle clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-global void VideoDraw50TransRectangleClip(SysColors color, int x, int y,
+global void VideoDraw50TransRectangleClip(VMemType color, int x, int y,
int w, int h)
{
#define _x x
@@ -5250,13 +5250,13 @@
/**
** Draw 75% translucent rectangle clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-global void VideoDraw75TransRectangleClip(SysColors color, int x, int y,
+global void VideoDraw75TransRectangleClip(VMemType color, int x, int y,
int w, int h)
{
#define _x x
@@ -5279,15 +5279,15 @@
/**
** Draw translucent rectangle clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-global void VideoDrawTransRectangleClip(SysColors color, int x, int y,
- int w, int h,unsigned char alpha)
+global void VideoDrawTransRectangleClip(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha)
{
#define _x x
#define _y y
@@ -5315,12 +5315,12 @@
/**
** Draw circle.
**
-** @param color Color index.
+** @param color color
** @param x Center x coordinate on the screen
** @param y Center y coordinate on the screen
** @param r radius of circle
*/
-global void VideoDrawCircle(SysColors color, int x, int y, int r)
+global void VideoDrawCircle(VMemType color, int x, int y, int r)
{
int cx;
int cy;
@@ -5374,12 +5374,12 @@
/**
** Draw circle clipped.
**
-** @param color Color index.
+** @param color color
** @param x Center x coordinate on the screen
** @param y Center y coordinate on the screen
** @param r radius of circle
*/
-global void VideoDrawCircleClip(SysColors color, int x, int y, int r)
+global void VideoDrawCircleClip(VMemType color, int x, int y, int r)
{
int cx;
int cy;
@@ -5437,20 +5437,20 @@
/**
** Fill rectangle into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFillRectangle8(SysColors color, int x, int y, int w, int h)
+local void DrawFillRectangle8(VMemType color, int x, int y, int w, int h)
{
VMemType8* p;
VMemType8 f;
int swidth;
int i;
- f = Pixels8[color];
+ f = color.D8;
swidth = VideoWidth;
p = VideoMemory8 + y * swidth + x;
swidth -= w;
@@ -5468,20 +5468,20 @@
/**
** Fill rectangle into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFillRectangle16(SysColors color, int x, int y, int w, int h)
+local void DrawFillRectangle16(VMemType color, int x, int y, int w, int h)
{
VMemType16* p;
VMemType16 f;
int swidth;
int i;
- f = Pixels16[color];
+ f = color.D16;
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
swidth -= w;
@@ -5499,20 +5499,20 @@
/**
** Fill rectangle into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFillRectangle24(SysColors color, int x, int y, int w, int h)
+local void DrawFillRectangle24(VMemType color, int x, int y, int w, int h)
{
VMemType24* p;
VMemType24 f;
int swidth;
int i;
- f = Pixels24[color];
+ f = color.D24;
swidth = VideoWidth;
p = VideoMemory24 + y * swidth + x;
swidth -= w;
@@ -5530,20 +5530,20 @@
/**
** Fill rectangle into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFillRectangle32(SysColors color, int x, int y, int w, int h)
+local void DrawFillRectangle32(VMemType color, int x, int y, int w, int h)
{
VMemType32* p;
VMemType32 f;
int swidth;
int i;
- f = Pixels32[color];
+ f = color.D32;
swidth = VideoWidth;
p = VideoMemory32 + y * swidth + x;
swidth -= w;
@@ -5561,14 +5561,14 @@
/**
** Fill rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
#ifdef USE_OPENGL
-local void DrawFillRectangleOpenGL(SysColors color, int x, int y,
+local void DrawFillRectangleOpenGL(VMemType color, int x, int y,
int w, int h)
{
VMemType32 c;
@@ -5576,7 +5576,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -5595,13 +5595,13 @@
/**
** Fill rectangle 25% translucent clipped into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill25TransRectangle8(SysColors color, int x, int y,
+local void DrawFill25TransRectangle8(VMemType color, int x, int y,
int w, int h)
{
VMemType8* p;
@@ -5612,7 +5612,7 @@
swidth = VideoWidth;
p = VideoMemory8 + y * swidth + x;
swidth -= w;
- c = Pixels8[color] << 8;
+ c = color.D8 << 8;
if (w) {
while (h--) {
@@ -5629,13 +5629,13 @@
/**
** Fill rectangle 25% translucent clipped into 15bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill25TransRectangle15(SysColors color, int x, int y,
+local void DrawFill25TransRectangle15(VMemType color, int x, int y,
int w, int h)
{
VMemType16* p;
@@ -5646,7 +5646,7 @@
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
swidth -= w;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x03E07C1F) * 3;
@@ -5668,13 +5668,13 @@
/**
** Fill rectangle 25% translucent clipped into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill25TransRectangle16(SysColors color, int x, int y,
+local void DrawFill25TransRectangle16(VMemType color, int x, int y,
int w, int h)
{
VMemType16* p;
@@ -5685,7 +5685,7 @@
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
swidth -= w;
- sp = Pixels16[color];
+ sp = color.D16;
// FIXME: pre multiply?
sp = (((sp << 16) | sp) & 0x07E0F81F) * 3;
@@ -5707,13 +5707,13 @@
/**
** Fill rectangle 25% translucent clipped into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill25TransRectangle24(SysColors color, int x, int y,
+local void DrawFill25TransRectangle24(VMemType color, int x, int y,
int w, int h)
{
// FIXME: does 24bpp holds R|G|B ?
@@ -5723,13 +5723,13 @@
/**
** Fill rectangle 25% translucent clipped into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill25TransRectangle32(SysColors color, int x, int y,
+local void DrawFill25TransRectangle32(VMemType color, int x, int y,
int w, int h)
{
VMemType32* p;
@@ -5742,7 +5742,7 @@
p = VideoMemory32 + y * swidth + x;
swidth -= w;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
// FIXME: pre multiply?
sp2 = ((sp1 & 0xFF00FF00) >> 8) * 3;
sp1 = (sp1 & 0x00FF00FF) * 3;
@@ -5770,14 +5770,14 @@
/**
** Fill rectangle 25% translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
#ifdef USE_OPENGL
-local void DrawFill25TransRectangleOpenGL(SysColors color, int x, int y,
+local void DrawFill25TransRectangleOpenGL(VMemType color, int x, int y,
int w, int h)
{
VMemType32 c;
@@ -5785,7 +5785,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -5804,13 +5804,13 @@
/**
** Fill rectangle 50% translucent clipped into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill50TransRectangle8(SysColors color, int x, int y,
+local void DrawFill50TransRectangle8(VMemType color, int x, int y,
int w, int h)
{
VMemType8* p;
@@ -5821,7 +5821,7 @@
swidth = VideoWidth;
p = VideoMemory8 + y * swidth + x;
swidth -= w;
- c = Pixels8[color] << 8;
+ c = color.D8 << 8;
if (w) {
while (h--) {
@@ -5838,13 +5838,13 @@
/**
** Fill rectangle 50% translucent clipped into 15bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill50TransRectangle15(SysColors color, int x, int y,
+local void DrawFill50TransRectangle15(VMemType color, int x, int y,
int w, int h)
{
VMemType16* p;
@@ -5855,7 +5855,7 @@
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
swidth -= w;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
if (w) {
@@ -5876,13 +5876,13 @@
/**
** Fill rectangle 50% translucent clipped into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill50TransRectangle16(SysColors color, int x, int y,
+local void DrawFill50TransRectangle16(VMemType color, int x, int y,
int w, int h)
{
VMemType16* p;
@@ -5893,7 +5893,7 @@
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
swidth -= w;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
if (w) {
@@ -5914,13 +5914,13 @@
/**
** Fill rectangle 50% translucent clipped into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill50TransRectangle24(SysColors color, int x, int y,
+local void DrawFill50TransRectangle24(VMemType color, int x, int y,
int w, int h)
{
// FIXME: how does 24bpp represents RGB ?
@@ -5930,13 +5930,13 @@
/**
** Fill rectangle 50% translucent clipped into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill50TransRectangle32(SysColors color, int x, int y,
+local void DrawFill50TransRectangle32(VMemType color, int x, int y,
int w, int h)
{
VMemType32* p;
@@ -5949,7 +5949,7 @@
p = VideoMemory32 + y * swidth + x;
swidth -= w;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -5976,14 +5976,14 @@
/**
** Fill rectangle 50% translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
#ifdef USE_OPENGL
-local void DrawFill50TransRectangleOpenGL(SysColors color, int x, int y,
+local void DrawFill50TransRectangleOpenGL(VMemType color, int x, int y,
int w, int h)
{
VMemType32 c;
@@ -5991,7 +5991,7 @@
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -6010,13 +6010,13 @@
/**
** Fill rectangle 75% translucent clipped into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill75TransRectangle8(SysColors color, int x, int y,
+local void DrawFill75TransRectangle8(VMemType color, int x, int y,
int w, int h)
{
VMemType8* p;
@@ -6027,7 +6027,7 @@
swidth = VideoWidth;
p = VideoMemory8 + y * swidth + x;
swidth -= w;
- c = Pixels8[color];
+ c = color.D8;
if (w) {
while (h--) {
@@ -6044,13 +6044,13 @@
/**
** Fill rectangle 75% translucent clipped into 15bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill75TransRectangle15(SysColors color, int x, int y,
+local void DrawFill75TransRectangle15(VMemType color, int x, int y,
int w, int h)
{
VMemType16* p;
@@ -6061,7 +6061,7 @@
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
swidth -= w;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x03E07C1F;
if (w) {
@@ -6082,13 +6082,13 @@
/**
** Fill rectangle 75% translucent clipped into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill75TransRectangle16(SysColors color, int x, int y,
+local void DrawFill75TransRectangle16(VMemType color, int x, int y,
int w, int h)
{
VMemType16* p;
@@ -6099,7 +6099,7 @@
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
swidth -= w;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
if (w) {
@@ -6120,13 +6120,13 @@
/**
** Fill rectangle 75% translucent clipped into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill75TransRectangle24(SysColors color, int x, int y,
+local void DrawFill75TransRectangle24(VMemType color, int x, int y,
int w, int h)
{
// FIXME: does 24bpp holds R|G|B ?
@@ -6136,13 +6136,13 @@
/**
** Fill rectangle 75% translucent clipped into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-local void DrawFill75TransRectangle32(SysColors color, int x, int y,
+local void DrawFill75TransRectangle32(VMemType color, int x, int y,
int w, int h)
{
VMemType32* p;
@@ -6155,7 +6155,7 @@
p = VideoMemory32 + y * swidth + x;
swidth -= w;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -6182,14 +6182,14 @@
/**
** Fill rectangle 75% translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
#ifdef USE_OPENGL
-local void DrawFill75TransRectangleOpenGL(SysColors color, int x, int y,
+local void DrawFill75TransRectangleOpenGL(VMemType color, int x, int y,
int w, int h)
{
VMemType32 c;
@@ -6197,7 +6197,7 @@
GLubyte g;
Glubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -6216,14 +6216,14 @@
/**
** Draw translucent rectangle into 8bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawFillTransRectangle8(SysColors color, int x, int y,
+local void DrawFillTransRectangle8(VMemType color, int x, int y,
int w, int h, unsigned char alpha)
{
VMemType8* p;
@@ -6234,7 +6234,7 @@
swidth = VideoWidth;
p = VideoMemory8 + y * swidth + x;
swidth -= w;
- c = Pixels8[color];
+ c = color.D8;
if (w) {
switch (((unsigned int)alpha * 4) / 255) {
@@ -6289,14 +6289,14 @@
/**
** Draw rectangle into 8bpp frame buffer (ignoring alpha).
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawFillNoTransRectangle8(SysColors color, int x, int y,
+local void DrawFillNoTransRectangle8(VMemType color, int x, int y,
int w, int h, unsigned char alpha __attribute__((unused)))
{
DrawFillRectangle8(color, x, y, w, h);
@@ -6305,14 +6305,14 @@
/**
** Draw translucent rectangle into 15bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawFillTransRectangle15(SysColors color, int x, int y,
+local void DrawFillTransRectangle15(VMemType color, int x, int y,
int w, int h, unsigned char alpha)
{
VMemType16* p;
@@ -6323,7 +6323,7 @@
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
swidth -= w;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
alpha >>= 3; //FIXME: only 5bits
@@ -6345,15 +6345,15 @@
/**
** Draw translucent rectangle into 16bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawFillTransRectangle16(SysColors color, int x, int y,
- int w, int h,unsigned char alpha)
+local void DrawFillTransRectangle16(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha)
{
VMemType16* p;
unsigned long sp;
@@ -6363,7 +6363,7 @@
swidth = VideoWidth;
p = VideoMemory16 + y * swidth + x;
swidth -= w;
- sp = Pixels16[color];
+ sp = color.D16;
sp = ((sp << 16) | sp) & 0x07E0F81F;
alpha >>= 3; //FIXME: only 5bits
@@ -6385,15 +6385,15 @@
/**
** Draw translucent rectangle into 24bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawFillTransRectangle24(SysColors color, int x, int y,
- int w, int h,unsigned char alpha __attribute__((unused)))
+local void DrawFillTransRectangle24(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha __attribute__((unused)))
{
//FIXME: does 24bpp represents R|G|B?
DrawFillRectangle24(color, x, y, w, h); // no trans functionaility :(
@@ -6402,15 +6402,15 @@
/**
** Draw translucent rectangle into 32bpp frame buffer.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixel.
*/
-local void DrawFillTransRectangle32(SysColors color, int x, int y,
- int w, int h,unsigned char alpha)
+local void DrawFillTransRectangle32(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha)
{
VMemType32* p;
unsigned long sp1;
@@ -6422,7 +6422,7 @@
p = VideoMemory32 + y * swidth + x;
swidth -= w;
- sp1 = Pixels32[color];
+ sp1 = color.D32;
sp2 = (sp1 & 0xFF00FF00) >> 8;
sp1 &= 0x00FF00FF;
@@ -6450,7 +6450,7 @@
/**
** Draw translucent rectangle.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
@@ -6458,15 +6458,15 @@
** @param alpha alpha value of pixel.
*/
#ifdef USE_OPENGL
-local void DrawFillTransRectangleOpenGL(SysColors color, int x, int y,
- int w, int h,unsigned char alpha)
+local void DrawFillTransRectangleOpenGL(VMemType color, int x, int y,
+ int w, int h, unsigned char alpha)
{
VMemType32 c;
GLubyte r;
GLubyte g;
GLubyte b;
- c = Pixels32[color];
+ c = color.D32;
r = (c >> 16) & 0xff;
g = (c >> 8) & 0xff;
b = (c >> 0) & 0xff;
@@ -6485,13 +6485,13 @@
/**
** Fill rectangle clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-global void VideoFillRectangleClip(SysColors color, int x, int y,
+global void VideoFillRectangleClip(VMemType color, int x, int y,
int w, int h)
{
CLIP_RECTANGLE(x, y, w, h);
@@ -6501,13 +6501,13 @@
/**
** Fill rectangle 25% translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-global void VideoFill25TransRectangleClip(SysColors color, int x, int y,
+global void VideoFill25TransRectangleClip(VMemType color, int x, int y,
int w, int h)
{
CLIP_RECTANGLE(x, y, w, h);
@@ -6517,13 +6517,13 @@
/**
** Fill rectangle 50% translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-global void VideoFill50TransRectangleClip(SysColors color, int x, int y,
+global void VideoFill50TransRectangleClip(VMemType color, int x, int y,
int w, int h)
{
CLIP_RECTANGLE(x, y, w, h);
@@ -6533,13 +6533,13 @@
/**
** Fill rectangle 75% translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
*/
-global void VideoFill75TransRectangleClip(SysColors color, int x, int y,
+global void VideoFill75TransRectangleClip(VMemType color, int x, int y,
int w, int h)
{
CLIP_RECTANGLE(x, y, w, h);
@@ -6549,14 +6549,14 @@
/**
** Fill rectangle translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x x coordinate on the screen
** @param y y coordinate on the screen
** @param h height of rectangle (0=don't draw).
** @param w width of rectangle (0=don't draw).
** @param alpha alpha value of pixels.
*/
-global void VideoFillTransRectangleClip(SysColors color, int x, int y,
+global void VideoFillTransRectangleClip(VMemType color, int x, int y,
int w, int h, unsigned char alpha)
{
CLIP_RECTANGLE(x, y, w, h);
@@ -6570,12 +6570,12 @@
/**
** Fill circle clipped.
**
-** @param color Color index.
+** @param color color
** @param x Center x coordinate on the screen
** @param y Center y coordinate on the screen
** @param r radius of circle
*/
-global void VideoFillCircleClip(SysColors color, int x, int y, int r)
+global void VideoFillCircleClip(VMemType color, int x, int y, int r)
{
int cx;
int cy;
@@ -6616,12 +6616,12 @@
/**
** Fill circle 25% translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x Center x coordinate on the screen
** @param y Center y coordinate on the screen
** @param r radius of circle
*/
-global void VideoFill25TransCircleClip(SysColors color, int x, int y, int r)
+global void VideoFill25TransCircleClip(VMemType color, int x, int y, int r)
{
int cx;
int cy;
@@ -6662,12 +6662,12 @@
/**
** Fill circle 50% translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x Center x coordinate on the screen
** @param y Center y coordinate on the screen
** @param r radius of circle
*/
-global void VideoFill50TransCircleClip(SysColors color, int x, int y, int r)
+global void VideoFill50TransCircleClip(VMemType color, int x, int y, int r)
{
int cx;
int cy;
@@ -6708,12 +6708,12 @@
/**
** Fill circle 75% translucent clipped.
**
-** @param color Color index.
+** @param color color
** @param x Center x coordinate on the screen
** @param y Center y coordinate on the screen
** @param r radius of circle
*/
-global void VideoFill75TransCircleClip(SysColors color, int x, int y, int r)
+global void VideoFill75TransCircleClip(VMemType color, int x, int y, int r)
{
int cx;
int cy;
Index: stratagus/src/video/sdl.c
diff -u stratagus/src/video/sdl.c:1.98 stratagus/src/video/sdl.c:1.99
--- stratagus/src/video/sdl.c:1.98 Mon Sep 29 22:53:03 2003
+++ stratagus/src/video/sdl.c Tue Oct 7 20:06:44 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: sdl.c,v 1.98 2003/09/30 02:53:03 jsalmon3 Exp $
+// $Id: sdl.c,v 1.99 2003/10/08 00:06:44 jsalmon3 Exp $
//@{
@@ -259,6 +259,17 @@
InitOpenGL();
#endif
+ ColorBlack = VideoMapRGB(0, 0, 0);
+ ColorDarkGreen = VideoMapRGB(48, 100, 4);
+ ColorBlue = VideoMapRGB(0, 0, 252);
+ ColorOrange = VideoMapRGB(248, 140, 20);
+ ColorWhite = VideoMapRGB(252, 248, 240);
+ ColorNPC = VideoMapRGB(160, 160, 164);
+ ColorGray = VideoMapRGB(128, 128, 128);
+ ColorRed = VideoMapRGB(252, 0, 0);
+ ColorGreen = VideoMapRGB(0, 252, 0);
+ ColorYellow = VideoMapRGB(252, 252, 0);
+
DebugLevel3Fn("Video init ready %d %d\n" _C_ VideoDepth _C_ VideoBpp);
// FIXME: Setup InMainWindow correct.
@@ -779,11 +790,16 @@
**
** @return A hardware dependent pixel.
*/
-global unsigned long VideoMapRGB(int r, int g, int b)
+global VMemType VideoMapRGB(int r, int g, int b)
{
+ VMemType c;
+ unsigned long map;
+
DebugCheck(!Screen);
- return SDL_MapRGB(Screen->format, r, g, b);
+ map = SDL_MapRGB(Screen->format, r, g, b);
+ memcpy(&c, &map, sizeof(c));
+ return c;
}
/**
Index: stratagus/src/video/sprite.c
diff -u stratagus/src/video/sprite.c:1.36 stratagus/src/video/sprite.c:1.37
--- stratagus/src/video/sprite.c:1.36 Sat Sep 27 21:52:07 2003
+++ stratagus/src/video/sprite.c Tue Oct 7 20:06:44 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: sprite.c,v 1.36 2003/09/28 01:52:07 jsalmon3 Exp $
+// $Id: sprite.c,v 1.37 2003/10/08 00:06:44 jsalmon3 Exp $
//@{
@@ -1701,15 +1701,15 @@
dp += *sp++; // transparent
pp = dp - 1 + *sp++; // opaque
while (dp < pp) { // unroll
- *dp = lookup50trans8[(Pixels8[ColorBlack] >> 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 >> 8) | *dp];
++dp;
++sp;
- *dp = lookup50trans8[(Pixels8[ColorBlack] >> 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 >> 8) | *dp];
++dp;
++sp;
}
if (dp <= pp) {
- *dp = lookup50trans8[(Pixels8[ColorBlack] >> 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 >> 8) | *dp];
++dp;
++sp;
}
@@ -1754,14 +1754,14 @@
middle_pixel:
if (pp < lp) {
while (dp < pp) {
- *dp = lookup50trans8[(Pixels8[ColorBlack] >> 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 >> 8) | *dp];
++dp;
++sp;
}
continue;
}
while (dp < lp) {
- *dp = lookup50trans8[(Pixels8[ColorBlack] >> 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 >> 8) | *dp];
++dp;
++sp;
}
@@ -2311,15 +2311,15 @@
dp -= *sp++; // transparent
pp = dp + 1 - *sp++; // opaque
while (dp > pp) {
- *dp = lookup50trans8[(Pixels8[ColorBlack] << 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 << 8) | *dp];
--dp;
++sp;
- *dp = lookup50trans8[(Pixels8[ColorBlack] << 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 << 8) | *dp];
--dp;
++sp;
}
if (dp >= pp) {
- *dp = lookup50trans8[(Pixels8[ColorBlack] << 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 << 8) | *dp];
--dp;
++sp;
}
@@ -2364,14 +2364,14 @@
middle_pixel:
if (pp > lp) {
while (dp > pp) {
- *dp = lookup50trans8[(Pixels8[ColorBlack] << 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 << 8) | *dp];
--dp;
++sp;
}
continue;
}
while (dp > lp) {
- *dp = lookup50trans8[(Pixels8[ColorBlack] << 8) | *dp];
+ *dp = lookup50trans8[(ColorBlack.D8 << 8) | *dp];
--dp;
++sp;
}
Index: stratagus/src/video/video.c
diff -u stratagus/src/video/video.c:1.65 stratagus/src/video/video.c:1.66
--- stratagus/src/video/video.c:1.65 Mon Sep 29 01:36:46 2003
+++ stratagus/src/video/video.c Tue Oct 7 20:06:44 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: video.c,v 1.65 2003/09/29 05:36:46 jsalmon3 Exp $
+// $Id: video.c,v 1.66 2003/10/08 00:06:44 jsalmon3 Exp $
//@{
@@ -300,6 +300,18 @@
/// Does ColorCycling..
global void (*ColorCycle)(void);
+
+VMemType ColorBlack;
+VMemType ColorDarkGreen;
+VMemType ColorBlue;
+VMemType ColorOrange;
+VMemType ColorWhite;
+VMemType ColorNPC;
+VMemType ColorGray;
+VMemType ColorRed;
+VMemType ColorGreen;
+VMemType ColorYellow;
+
/*----------------------------------------------------------------------------
-- Functions
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus data/ccl/human/ui.ccl data/ccl/orc/ui...,
Jimmy Salmon <=