[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus data/ccl/tilesets/summer.lua data/ccl...
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus data/ccl/tilesets/summer.lua data/ccl... |
Date: |
9 Jan 2004 16:44:51 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/01/09 16:44:48
Modified files:
data/ccl/tilesets: summer.lua swamp.lua wasteland.lua winter.lua
src/game : game.c loadgame.c
src/include : map.h player.h tileset.h video.h
src/map : ccl_tileset.c map_fog.c minimap.c tileset.c
src/stratagus : ccl_player.c mainloop.c player.c stratagus.c
src/ui : botpanel.c ccl_ui.c mainscr.c menu_proc.c
menus.c mouse.c
src/video : linedraw.c video.c
Log message:
Removed GlobalPalette
Patches:
Index: stratagus/data/ccl/tilesets/summer.lua
diff -u stratagus/data/ccl/tilesets/summer.lua:1.1
stratagus/data/ccl/tilesets/summer.lua:1.2
--- stratagus/data/ccl/tilesets/summer.lua:1.1 Thu Nov 20 07:23:48 2003
+++ stratagus/data/ccl/tilesets/summer.lua Fri Jan 9 16:44:35 2004
@@ -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: summer.lua,v 1.1 2003/11/19 20:23:48 jsalmon3 Exp $
+-- $Id: summer.lua,v 1.2 2004/01/09 05:44:35 jsalmon3 Exp $
--=============================================================================
-- Define a tileset
@@ -35,7 +35,6 @@
--
DefineTileset("tileset-summer", "class", "summer", "name", "Forest",
"image", "tilesets/summer/terrain/summer.png",
- "palette", "tilesets/summer/summer.rgb",
-- Slots descriptions
"slots", { "special", { -- Can't be in pud
"top-one-tree", 121, "mid-one-tree", 122, "bot-one-tree", 123,
Index: stratagus/data/ccl/tilesets/swamp.lua
diff -u stratagus/data/ccl/tilesets/swamp.lua:1.1
stratagus/data/ccl/tilesets/swamp.lua:1.2
--- stratagus/data/ccl/tilesets/swamp.lua:1.1 Thu Nov 20 07:23:48 2003
+++ stratagus/data/ccl/tilesets/swamp.lua Fri Jan 9 16:44:35 2004
@@ -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: swamp.lua,v 1.1 2003/11/19 20:23:48 jsalmon3 Exp $
+-- $Id: swamp.lua,v 1.2 2004/01/09 05:44:35 jsalmon3 Exp $
--=============================================================================
-- Define a tileset
@@ -35,7 +35,6 @@
--
DefineTileset("tileset-swamp", "class", "swamp", "name", "Swamp",
"image", "tilesets/swamp/terrain/swamp.png",
- "palette", "tilesets/swamp/swamp.rgb",
-- Slots descriptions
"slots", { "special", { -- Can't be in pud
"top-one-tree", 121, "mid-one-tree", 122, "bot-one-tree", 123,
Index: stratagus/data/ccl/tilesets/wasteland.lua
diff -u stratagus/data/ccl/tilesets/wasteland.lua:1.1
stratagus/data/ccl/tilesets/wasteland.lua:1.2
--- stratagus/data/ccl/tilesets/wasteland.lua:1.1 Thu Nov 20 07:23:48 2003
+++ stratagus/data/ccl/tilesets/wasteland.lua Fri Jan 9 16:44:35 2004
@@ -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: wasteland.lua,v 1.1 2003/11/19 20:23:48 jsalmon3 Exp $
+-- $Id: wasteland.lua,v 1.2 2004/01/09 05:44:35 jsalmon3 Exp $
--=============================================================================
-- Define a tileset
@@ -35,7 +35,6 @@
--
DefineTileset("tileset-wasteland", "class", "wasteland", "name", "Wasteland",
"image", "tilesets/wasteland/terrain/wasteland.png",
- "palette", "tilesets/wasteland/wasteland.rgb",
-- Slots descriptions
"slots", { "special", {
"top-one-tree", 121, "mid-one-tree", 122, "bot-one-tree", 123,
Index: stratagus/data/ccl/tilesets/winter.lua
diff -u stratagus/data/ccl/tilesets/winter.lua:1.1
stratagus/data/ccl/tilesets/winter.lua:1.2
--- stratagus/data/ccl/tilesets/winter.lua:1.1 Thu Nov 20 07:23:48 2003
+++ stratagus/data/ccl/tilesets/winter.lua Fri Jan 9 16:44:35 2004
@@ -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: winter.lua,v 1.1 2003/11/19 20:23:48 jsalmon3 Exp $
+-- $Id: winter.lua,v 1.2 2004/01/09 05:44:35 jsalmon3 Exp $
--=============================================================================
-- Define a tileset
@@ -35,7 +35,6 @@
--
DefineTileset("tileset-winter", "class", "winter", "name", "Winter",
"image", "tilesets/winter/terrain/winter.png",
- "palette", "tilesets/winter/winter.rgb",
-- Slots descriptions
"slots", { "special", { -- Can't be in pud
"top-one-tree", 121, "mid-one-tree", 122, "bot-one-tree", 123,
Index: stratagus/src/game/game.c
diff -u stratagus/src/game/game.c:1.120 stratagus/src/game/game.c:1.121
--- stratagus/src/game/game.c:1.120 Fri Jan 2 08:24:06 2004
+++ stratagus/src/game/game.c Fri Jan 9 16:44:36 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: game.c,v 1.120 2004/01/01 21:24:06 jsalmon3 Exp $
+// $Id: game.c,v 1.121 2004/01/09 05:44:36 jsalmon3 Exp $
//@{
@@ -169,8 +169,8 @@
int i;
int j;
- for (i = 0; i < 15; ++i) {
- for (j = 0; j < 15; ++j) {
+ for (i = 0; i < PlayerMax - 1; ++i) {
+ for (j = 0; j < PlayerMax - 1; ++j) {
if (i != j) {
CommandDiplomacy(i, DiplomacyEnemy, j);
}
@@ -189,9 +189,9 @@
int middle;
middle = TheMap.Height / 2;
- for (i = 0; i < 15; ++i) {
+ for (i = 0; i < PlayerMax - 1; ++i) {
top = Players[i].StartY <= middle;
- for (j = 0; j < 15; ++j) {
+ for (j = 0; j < PlayerMax - 1; ++j) {
if (i != j) {
if ((top && Players[j].StartY <= middle) ||
(!top && Players[j].StartY >
middle)) {
@@ -216,9 +216,9 @@
int middle;
middle = TheMap.Width / 2;
- for (i = 0; i < 15; ++i) {
+ for (i = 0; i < PlayerMax - 1; ++i) {
left = Players[i].StartX <= middle;
- for (j = 0; j < 15; ++j) {
+ for (j = 0; j < PlayerMax - 1; ++j) {
if (i != j) {
if ((left && Players[j].StartX <= middle) ||
(!left && Players[j].StartX >
middle)) {
@@ -240,11 +240,11 @@
int i;
int j;
- for (i = 0; i < 15; ++i) {
+ for (i = 0; i < PlayerMax - 1; ++i) {
if (Players[i].Type != PlayerPerson && Players[i].Type !=
PlayerComputer ) {
continue;
}
- for (j = 0; j < 15; ++j) {
+ for (j = 0; j < PlayerMax - 1; ++j) {
if (i != j) {
if (Players[i].Type == Players[j].Type) {
CommandDiplomacy(i, DiplomacyAllied, j);
@@ -394,18 +394,7 @@
//
// Graphic part
//
-#ifdef USE_SDL_SURFACE
- GlobalPalette = LoadRGB(s = strdcat3(StratagusLibPath, "/graphics/",
- TheMap.Tileset->PaletteFile));
- free(s);
SetPlayersPalette();
-#else
- LoadRGB(GlobalPalette,
- s = strdcat3(StratagusLibPath, "/graphics/",
- TheMap.Tileset->PaletteFile));
- free(s);
- VideoCreatePalette(GlobalPalette);
-#endif
InitIcons();
LoadIcons();
Index: stratagus/src/game/loadgame.c
diff -u stratagus/src/game/loadgame.c:1.76 stratagus/src/game/loadgame.c:1.77
--- stratagus/src/game/loadgame.c:1.76 Fri Jan 2 08:24:06 2004
+++ stratagus/src/game/loadgame.c Fri Jan 9 16:44:36 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: loadgame.c,v 1.76 2004/01/01 21:24:06 jsalmon3 Exp $
+// $Id: loadgame.c,v 1.77 2004/01/09 05:44:36 jsalmon3 Exp $
//@{
@@ -151,6 +151,7 @@
InitDependencies();
InitButtons();
+ InitTriggers();
InitAiModule();
@@ -168,8 +169,7 @@
*/
global void LoadModules(void)
{
- char* s;
-
+ LoadFonts();
LoadIcons();
LoadCursors(ThisPlayer->RaceName);
LoadUserInterface();
@@ -197,18 +197,7 @@
}
#endif
-#ifdef USE_SDL_SURFACE
- GlobalPalette = LoadRGB(s = strdcat3(StratagusLibPath, "/graphics/",
- TheMap.Tileset->PaletteFile));
- free(s);
SetPlayersPalette();
-#else
- LoadRGB(GlobalPalette,
- s = strdcat3(StratagusLibPath, "/graphics/",
- TheMap.Tileset->PaletteFile));
- free(s);
- VideoCreatePalette(GlobalPalette);
-#endif
CreateMinimap();
SetDefaultTextColors(TheUI.NormalFontColor, TheUI.ReverseFontColor);
@@ -232,6 +221,8 @@
CleanModules();
// log will be enabled if found in the save game
CommandLogDisabled = 1;
+
+ LoadCcl();
CclGarbageCollect(0);
InitVisionTable();
Index: stratagus/src/include/map.h
diff -u stratagus/src/include/map.h:1.110 stratagus/src/include/map.h:1.111
--- stratagus/src/include/map.h:1.110 Wed Dec 24 11:35:20 2003
+++ stratagus/src/include/map.h Fri Jan 9 16:44:37 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: map.h,v 1.110 2003/12/24 00:35:20 wizzard Exp $
+// $Id: map.h,v 1.111 2004/01/09 05:44:37 jsalmon3 Exp $
#ifndef __MAP_H__
#define __MAP_H__
@@ -318,12 +318,11 @@
int Terrain; /// terrain type (summer,winter,...)
Tileset* Tileset; /// tileset data
+ unsigned TileCount; /// how many tiles,
#ifdef USE_SDL_SURFACE
- unsigned int TileCount; /// how many tiles,
/// == TileGraphic->NFrames
Graphic* TileGraphic; /// graphic for all the tiles
#else
- unsigned TileCount; /// how many tiles are available
unsigned char** Tiles; /// pointer to tile data
Graphic* TileData; /// tiles graphic for map
#endif
Index: stratagus/src/include/player.h
diff -u stratagus/src/include/player.h:1.81 stratagus/src/include/player.h:1.82
--- stratagus/src/include/player.h:1.81 Mon Dec 22 16:52:33 2003
+++ stratagus/src/include/player.h Fri Jan 9 16:44:37 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: player.h,v 1.81 2003/12/22 05:52:33 wizzard Exp $
+// $Id: player.h,v 1.82 2004/01/09 05:44:37 jsalmon3 Exp $
#ifndef __PLAYER_H__
#define __PLAYER_H__
@@ -458,9 +458,9 @@
extern Player* ThisPlayer; /// Player on local computer
extern int NoRescueCheck; /// Disable rescue check
#ifdef USE_SDL_SURFACE
-extern Uint32 PlayerColors[PlayerMax];
+extern Uint32 PlayerColors[PlayerMax][4];
#else
-extern VMemType PlayerColors[PlayerMax]; /// Player colors
+extern VMemType PlayerColors[PlayerMax][4]; /// Player colors
#endif
extern char* PlayerColorNames[PlayerMax]; /// Player color names
@@ -525,9 +525,6 @@
extern void PlayersEachCycle(void);
/// Called each second for a given player handler (AI)
extern void PlayersEachSecond(int player);
-
- /// Change current color set to new player
-extern void PlayerPixels(const Player* player);
/// Change current color set to new player of the sprite
extern void GraphicPlayerPixels(const Player* player, const Graphic * sprite);
Index: stratagus/src/include/tileset.h
diff -u stratagus/src/include/tileset.h:1.47
stratagus/src/include/tileset.h:1.48
--- stratagus/src/include/tileset.h:1.47 Sat Dec 20 16:33:28 2003
+++ stratagus/src/include/tileset.h Fri Jan 9 16:44:37 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: tileset.h,v 1.47 2003/12/20 05:33:28 jsalmon3 Exp $
+// $Id: tileset.h,v 1.48 2004/01/09 05:44:37 jsalmon3 Exp $
#ifndef __TILESET_H__
#define __TILESET_H__
@@ -86,12 +86,6 @@
** @li 527 pixel: 16 tiles pro row
with 1 pixel gap
** @li 626 pixel: 19 tiles pro row
with 1 pixel gap
**
-** Tileset::PaletteFile
-**
-** Name of the palette file, containing the RGB
colors to use
-** as global sytem palette.
-** @see GlobalPalette, VideoSetPalette.
-**
** Tileset::NumTiles
**
** The number of different tiles in the tables.
@@ -295,7 +289,6 @@
char* Class; ///
Class for future extensions
char* Name; ///
Nice name to display
char* ImageFile; /// File
containing image data
- char* PaletteFile; /// File
containing the global palette
int NumTiles;
/// Number of tiles in the tables
int TileSizeX;
/// Size of a tile in X
Index: stratagus/src/include/video.h
diff -u stratagus/src/include/video.h:1.106 stratagus/src/include/video.h:1.107
--- stratagus/src/include/video.h:1.106 Sat Dec 20 16:33:29 2003
+++ stratagus/src/include/video.h Fri Jan 9 16:44:37 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: video.h,v 1.106 2003/12/20 05:33:29 jsalmon3 Exp $
+// $Id: video.h,v 1.107 2004/01/09 05:44:37 jsalmon3 Exp $
#ifndef __VIDEO_H__
#define __VIDEO_H__
@@ -41,7 +41,6 @@
{
SDL_Surface *Surface;
SDL_Surface *SurfaceFlip;
- SDL_Palette *Palette;
int Width;
int Height;
int NumFrames;
@@ -237,12 +236,6 @@
#define AMASK 0xff000000
#endif
-extern SDL_Palette *Pixels;
-
- /// Loaded system palette. 256-entries long, active system
palette.
-// FIXME: use SDL_Palette
-extern SDL_Palette* GlobalPalette;
-
typedef unsigned char GraphicData; /// generic graphic data type
/// initialize the video part
@@ -301,11 +294,6 @@
/// Realize video memory.
extern void RealizeVideoMemory(void);
- /// Load palette from resource. Just loads palette, to set
it use
- /// VideoCreatePalette, which sets system palette.
-// FIXME: use SDL_Palette
-extern SDL_Palette* LoadRGB(const char* name);
-
/// Load sprite
extern Graphic* LoadSprite(const char* file, int w, int h);
@@ -872,22 +860,6 @@
#define VideoMemory32 (&VideoMemory->D32) /// video
memory 32bpp
/**
- ** Architecture-dependant system palette. Applies as
conversion between
- ** GlobalPalette colors and their representation in
videomemory.
- ** Set by VideoCreatePalette or VideoSetPalette.
- ** @see VideoCreatePalette VideoSetPalette
- */
-extern VMemType* Pixels;
-
-#define Pixels8 (&Pixels->D8)
/// global pixels 8bpp
-#define Pixels16 (&Pixels->D16) ///
global pixels 16bpp
-#define Pixels24 (&Pixels->D24) ///
global pixels 24bpp
-#define Pixels32 (&Pixels->D32) ///
global pixels 32bpp
-
- /// Loaded system palette. 256-entries long, active system
palette.
-extern Palette GlobalPalette[256];
-
- /**
** Special 8bpp functionality, only to be used in ../video
** @todo use CommonPalette names!
*/
@@ -1391,10 +1363,6 @@
/// 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.
-extern void LoadRGB(Palette* pal,const char* name);
-
/// Maps RGB to a hardware dependent pixel.
extern VMemType VideoMapRGB(int r, int g, int b);
@@ -1410,13 +1378,6 @@
/// 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.
-extern void VideoSetPalette(const VMemType* palette);
-
- /// Set the system hardware palette from an independend
Palette struct.
-extern void VideoCreatePalette(const Palette* palette);
/// Initializes video synchronization.
extern void SetVideoSync(void);
Index: stratagus/src/map/ccl_tileset.c
diff -u stratagus/src/map/ccl_tileset.c:1.36
stratagus/src/map/ccl_tileset.c:1.37
--- stratagus/src/map/ccl_tileset.c:1.36 Fri Jan 2 08:24:09 2004
+++ stratagus/src/map/ccl_tileset.c Fri Jan 9 16:44:38 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_tileset.c,v 1.36 2004/01/01 21:24:09 jsalmon3 Exp $
+// $Id: ccl_tileset.c,v 1.37 2004/01/09 05:44:38 jsalmon3 Exp $
//@{
@@ -592,7 +592,6 @@
free(Tilesets[type]->Class);
free(Tilesets[type]->Name);
free(Tilesets[type]->ImageFile);
- free(Tilesets[type]->PaletteFile);
free(Tilesets[type]->Table);
free(Tilesets[type]->Tiles);
free(Tilesets[type]->TileTypeTable);
@@ -638,8 +637,6 @@
tileset->Name = strdup(LuaToString(l, j + 1));
} else if (!strcmp(value, "image")) {
tileset->ImageFile = strdup(LuaToString(l, j + 1));
- } else if (!strcmp(value, "palette")) {
- tileset->PaletteFile = strdup(LuaToString(l, j + 1));
} else if (!strcmp(value, "size")) {
if (!lua_istable(l, j + 1)) {
lua_pushstring(l, "incorrect argument");
Index: stratagus/src/map/map_fog.c
diff -u stratagus/src/map/map_fog.c:1.134 stratagus/src/map/map_fog.c:1.135
--- stratagus/src/map/map_fog.c:1.134 Wed Dec 24 11:35:21 2003
+++ stratagus/src/map/map_fog.c Fri Jan 9 16:44:38 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: map_fog.c,v 1.134 2003/12/24 00:35:21 wizzard Exp $
+// $Id: map_fog.c,v 1.135 2004/01/09 05:44:38 jsalmon3 Exp $
//@{
@@ -3249,9 +3249,9 @@
int l;
int d;
- r = GlobalPalette[i].r;
- g = GlobalPalette[i].g;
- b = GlobalPalette[i].b;
+ r =
TheMap.TileData->Palette[i].r;
+ g =
TheMap.TileData->Palette[i].g;
+ b =
TheMap.TileData->Palette[i].b;
DebugLevel3("%d,%d,%d\n" _C_ r
_C_ g _C_ b);
v = r + g + b;
@@ -3274,21 +3274,21 @@
d = 256 * 3 + 256;
for (j = 0; j < 256; ++j) {
// simple color distance
- v =
(abs(GlobalPalette[j].r - r) +
-
abs(GlobalPalette[j].g - g) +
-
abs(GlobalPalette[j].b - b)) * 3 +
+ v =
(abs(TheMap.TileData->Palette[j].r - r) +
+
abs(TheMap.TileData->Palette[j].g - g) +
+
abs(TheMap.TileData->Palette[j].b - b)) * 3 +
// light
-
abs(GlobalPalette[j].r +
-
GlobalPalette[j].g +
-
GlobalPalette[j].b - (r + g + b)) * 1;
+
abs(TheMap.TileData->Palette[j].r +
+
TheMap.TileData->Palette[j].g +
+
TheMap.TileData->Palette[j].b - (r + g + b)) * 1;
if (v < d) {
d = v;
l = j;
}
}
DebugLevel3("%d,%d,%d ->
%d,%d,%d\n" _C_ r _C_ g _C_ b _C_
- GlobalPalette[l].r _C_
GlobalPalette[l].g _C_
- GlobalPalette[l].b);
+
TheMap.TileData->Palette[l].r _C_ TheMap.TileData->Palette[l].g _C_
+
TheMap.TileData->Palette[l].b);
((VMemType8*)FogOfWarAlphaTable)[i] = l;
}
}
Index: stratagus/src/map/minimap.c
diff -u stratagus/src/map/minimap.c:1.87 stratagus/src/map/minimap.c:1.88
--- stratagus/src/map/minimap.c:1.87 Fri Jan 9 06:45:17 2004
+++ stratagus/src/map/minimap.c Fri Jan 9 16:44:38 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: minimap.c,v 1.87 2004/01/08 19:45:17 mohydine Exp $
+// $Id: minimap.c,v 1.88 2004/01/09 05:44:38 jsalmon3 Exp $
//@{
@@ -733,7 +733,7 @@
for (x = 0; x < TheUI.MinimapW; ++x) {
Palette p;
// this only copies the panel background... honest.
- p = GlobalPalette[
+ p = TheMap.TileData->Palette[
((unsigned
char*)TheUI.MinimapPanel.Graphic->Frames)[
x + (TheUI.MinimapPosX -
TheUI.MinimapPanelX) +
(y + TheUI.MinimapPosY -
TheUI.MinimapPanelY) *
@@ -805,7 +805,7 @@
}
if (MinimapWithTerrain && (visiontype > 1 ||
(visiontype == 1 && ((mx & 1) == (my & 1))))) {
Palette p;
- p = GlobalPalette[
+ p = TheMap.TileData->Palette[
((unsigned
char*)MinimapTerrainGraphic->Frames)[mx + my * TheUI.MinimapW]];
MinimapGraphic[mx + my * TheUI.MinimapW] =
VideoMapRGB(p.r, p.g, p.b);
} else if (visiontype > 0) {
Index: stratagus/src/map/tileset.c
diff -u stratagus/src/map/tileset.c:1.60 stratagus/src/map/tileset.c:1.61
--- stratagus/src/map/tileset.c:1.60 Sat Jan 3 11:28:17 2004
+++ stratagus/src/map/tileset.c Fri Jan 9 16:44:39 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: tileset.c,v 1.60 2004/01/03 00:28:17 jsalmon3 Exp $
+// $Id: tileset.c,v 1.61 2004/01/09 05:44:39 jsalmon3 Exp $
//@{
@@ -693,7 +693,6 @@
tileset->Class);
CLprintf(file, "\n 'name \"%s\"", tileset->Name);
CLprintf(file, "\n 'image \"%s\"", tileset->ImageFile);
- CLprintf(file, "\n 'palette \"%s\"", tileset->PaletteFile);
CLprintf(file, "\n ;; Slots descriptions");
CLprintf(file, "\n 'slots (list\n 'special (list\t\t;; Can't be in
pud\n");
CLprintf(file, " 'top-one-tree %d 'mid-one-tree %d 'bot-one-tree
%d\n",
@@ -746,7 +745,7 @@
char** sp;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: tileset $Id: tileset.c,v 1.60 2004/01/03
00:28:17 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: tileset $Id: tileset.c,v 1.61 2004/01/09
05:44:39 jsalmon3 Exp $\n\n");
// Original number to internal tileset name
@@ -787,7 +786,6 @@
free(Tilesets[i]->Class);
free(Tilesets[i]->Name);
free(Tilesets[i]->ImageFile);
- free(Tilesets[i]->PaletteFile);
free(Tilesets[i]->Table);
free(Tilesets[i]->FlagsTable);
free(Tilesets[i]->Tiles);
Index: stratagus/src/stratagus/ccl_player.c
diff -u stratagus/src/stratagus/ccl_player.c:1.53
stratagus/src/stratagus/ccl_player.c:1.54
--- stratagus/src/stratagus/ccl_player.c:1.53 Sat Jan 3 09:53:29 2004
+++ stratagus/src/stratagus/ccl_player.c Fri Jan 9 16:44:40 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_player.c,v 1.53 2004/01/02 22:53:29 jsalmon3 Exp $
+// $Id: ccl_player.c,v 1.54 2004/01/09 05:44:40 jsalmon3 Exp $
//@{
@@ -90,7 +90,7 @@
NumPlayers = i + 1;
}
player->Player = i;
- player->Color = PlayerColors[i];
+ player->Color = PlayerColors[i][0];
if (!(player->Units = (Unit**)calloc(UnitMax, sizeof(Unit*)))) {
DebugLevel0("Not enough memory to create player %d.\n" _C_ i);
return 0;
Index: stratagus/src/stratagus/mainloop.c
diff -u stratagus/src/stratagus/mainloop.c:1.175
stratagus/src/stratagus/mainloop.c:1.176
--- stratagus/src/stratagus/mainloop.c:1.175 Fri Jan 9 06:45:18 2004
+++ stratagus/src/stratagus/mainloop.c Fri Jan 9 16:44:40 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mainloop.c,v 1.175 2004/01/08 19:45:18 mohydine Exp $
+// $Id: mainloop.c,v 1.176 2004/01/09 05:44:40 jsalmon3 Exp $
//@{
@@ -229,35 +229,6 @@
MustRedraw |= RedrawMinimap | RedrawCursors;
}
-#ifdef DEBUG // {
-
-/**
-** FOR DEBUG PURPOSE ONLY, BUT DON'T REMOVE PLEASE !!!
-**
-** Will try all kinds of possible linedraw routines (only one
time) upon
-** current display, making the job of debugging them more eassier..
-*/
-global void DebugTestDisplay(void)
-{
- static int a = 0;
- extern void DebugTestDisplayLines(void);
-
- if (a) {
- return;
- }
- a = 1;
-
- //Enable one function-call as type of test to show one time
- DebugTestDisplayLines();
- //DebugTestDisplayVarious();
- //DebugTestDisplayColorCube();
-
- // put it all on screen (when it is not already there ;)
- InvalidateArea(0, 0, VideoWidth, VideoHeight);
-}
-
-#endif // } DEBUG
-
/**
** Draw menu button area.
**
@@ -591,8 +562,6 @@
TheUI.MinimapPanelX, TheUI.MinimapPanelY);
}
- PlayerPixels(Players); // Reset to default
colors
-
if (MustRedraw & RedrawMinimap) {
// FIXME: redraw only 1* per second!
// HELPME: Viewpoint rectangle must be drawn faster (if
implemented) ?
@@ -607,11 +576,9 @@
if (MustRedraw & RedrawInfoPanel) {
DrawInfoPanel();
- PlayerPixels(Players); // Reset to
default colors
}
if (MustRedraw & RedrawButtonPanel) {
DrawButtonPanel();
- PlayerPixels(Players); // Reset to
default colors
}
if (MustRedraw & RedrawResources) {
DrawResources();
@@ -931,13 +898,10 @@
MustRedraw = RedrawEverything;
}
- //For debuggin only: replace UpdateDisplay by
DebugTestDisplay when
- //
debugging linedraw routines..
//FIXME: this might be better placed somewhere at front
of the
// program, as we now still have
a game on the background and
// need to go through hte
game-menu or supply a pud-file
UpdateDisplay();
- //DebugTestDisplay();
//
// If double-buffered mode, we will display the
contains of
Index: stratagus/src/stratagus/player.c
diff -u stratagus/src/stratagus/player.c:1.108
stratagus/src/stratagus/player.c:1.109
--- stratagus/src/stratagus/player.c:1.108 Sat Jan 3 11:30:48 2004
+++ stratagus/src/stratagus/player.c Fri Jan 9 16:44:40 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: player.c,v 1.108 2004/01/03 00:30:48 jsalmon3 Exp $
+// $Id: player.c,v 1.109 2004/01/09 05:44:40 jsalmon3 Exp $
//@{
@@ -67,11 +67,11 @@
** Colors used for minimap. FIXME: make this
configurable
*/
#ifdef USE_SDL_SURFACE
-local SDL_Color PlayerColorsRGB[PlayerMax];
-global Uint32 PlayerColors[PlayerMax];
+local SDL_Color PlayerColorsRGB[PlayerMax][4];
+global Uint32 PlayerColors[PlayerMax][4];
#else
-global VMemType PlayerColorsRGB[PlayerMax];
-global VMemType PlayerColors[PlayerMax];
+global VMemType PlayerColorsRGB[PlayerMax][4];
+global VMemType PlayerColors[PlayerMax][4];
#endif
global char* PlayerColorNames[PlayerMax] = {
@@ -124,55 +124,58 @@
global void InitPlayers(void)
{
int p;
- // FIXME: remove this
+ int x;
+ // FIXME: make this configurable
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 },
+ } PColors[PlayerMax][4] = {
+ {{ 164, 0, 0 }, { 124, 0, 0 }, { 92, 4, 0 }, { 68, 4, 0 }},
+ {{ 12, 72, 204 }, { 4, 40, 160 }, { 0, 20, 116 }, { 0, 4, 76 }},
+ {{ 44, 180, 148 }, { 20, 132, 92 }, { 4, 84, 44 }, { 0, 40, 12
}},
+ {{ 152, 72, 176 }, { 116, 44, 132 }, { 80, 24, 88 }, { 44, 8,
44 }},
+ {{ 248, 140, 20 }, { 200, 96, 16 }, { 152, 60, 16 }, { 108, 32,
12 }},
+ {{ 40, 40, 60 }, { 28, 28, 44 }, { 20, 20, 32}, { 12, 12, 20 }},
+ {{ 224, 224, 224 }, { 152, 152, 180 }, { 84, 84, 128 }, { 36,
40, 76 }},
+ {{ 252, 252, 72 }, { 228, 204, 40 }, { 204, 160, 16 }, { 180,
116, 0 }},
+ {{ 164, 0, 0 }, { 124, 0, 0 }, { 92, 4, 0 }, { 68, 4, 0 }},
+ {{ 12, 72, 204 }, { 4, 40, 160 }, { 0, 20, 116 }, { 0, 4, 76 }},
+ {{ 44, 180, 148 }, { 20, 132, 92 }, { 4, 84, 44 }, { 0, 40, 12
}},
+ {{ 152, 72, 176 }, { 116, 44, 132 }, { 80, 24, 88 }, { 44, 8,
44 }},
+ {{ 248, 140, 20 }, { 200, 96, 16 }, { 152, 60, 16 }, { 108, 32,
12 }},
+ {{ 40, 40, 60 }, { 28, 28, 44 }, { 20, 20, 32}, { 12, 12, 20 }},
+ {{ 224, 224, 224 }, { 152, 152, 180 }, { 84, 84, 128 }, { 36,
40, 76 }},
+ {{ 252, 252, 72 }, { 228, 204, 40 }, { 204, 160, 16 }, { 180,
116, 0 }},
};
// FIXME: remove this
-#ifdef USE_SDL_SURFACE
for (p = 0; p < PlayerMax; ++p) {
- PlayerColorsRGB[p].r = PColors[p].R;
- PlayerColorsRGB[p].g = PColors[p].G;
- PlayerColorsRGB[p].b = PColors[p].B;
- }
+ for (x = 0; x < 4; ++x) {
+#ifdef USE_SDL_SURFACE
+ PlayerColorsRGB[p][x].r = PColors[p][x].R;
+ PlayerColorsRGB[p][x].g = PColors[p][x].G;
+ PlayerColorsRGB[p][x].b = PColors[p][x].B;
#else
- 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;
- }
+ PlayerColorsRGB[p][x].D24.a = PColors[p][x].R;
+ PlayerColorsRGB[p][x].D24.b = PColors[p][x].G;
+ PlayerColorsRGB[p][x].D24.c = PColors[p][x].B;
#endif
+ }
+ }
for (p = 0; p < PlayerMax; ++p) {
Players[p].Player = p;
if (!Players[p].Type) {
Players[p].Type = PlayerNobody;
}
+ for (x = 0; x < 4; ++x) {
#ifdef USE_SDL_SURFACE
- PlayerColors[p] = SDL_MapRGB(TheScreen->format,
PlayerColorsRGB[p].r,
- PlayerColorsRGB[p].g, PlayerColorsRGB[p].b);
+ PlayerColors[p][x] = SDL_MapRGB(TheScreen->format,
PlayerColorsRGB[p][x].r,
+ PlayerColorsRGB[p][x].g,
PlayerColorsRGB[p][x].b);
#else
- PlayerColors[p] = VideoMapRGB(PlayerColorsRGB[p].D24.a,
- PlayerColorsRGB[p].D24.b, PlayerColorsRGB[p].D24.c);
+ PlayerColors[p][x] =
VideoMapRGB(PlayerColorsRGB[p][x].D24.a,
+ PlayerColorsRGB[p][x].D24.b,
PlayerColorsRGB[p][x].D24.c);
#endif
+ }
}
}
@@ -220,7 +223,7 @@
int j;
CLprintf(file, "\n--- -----------------------------------------\n");
- CLprintf(file, "--- MODULE: players $Id: player.c,v 1.108 2004/01/03
00:30:48 jsalmon3 Exp $\n\n");
+ CLprintf(file, "--- MODULE: players $Id: player.c,v 1.109 2004/01/09
05:44:40 jsalmon3 Exp $\n\n");
#if 0
//
@@ -569,7 +572,7 @@
player->TotalNumUnits = 0;
player->Score = 0;
- player->Color = PlayerColors[NumPlayers];
+ player->Color = PlayerColors[NumPlayers][0];
if (Players[NumPlayers].Type == PlayerComputer ||
Players[NumPlayers].Type == PlayerRescueActive) {
@@ -948,37 +951,6 @@
}
/**
-** Change current color set to new player.
-**
-** @param player Pointer to player.
-*/
-global void PlayerPixels(const Player* player)
-{
-#ifdef USE_SDL_SURFACE
- // FIXME:
- memcpy(&GlobalPalette->colors[208], player->UnitColors.Colors,
- sizeof(SDL_Color) * 4);
-#else
- // 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;
- }
-#endif
-}
-
-/**
** Setup the player colors for the current palette.
**
** @todo
@@ -993,142 +965,41 @@
//o = rand() & 0x7; //
FIXME: random colors didn't work
o = 0;
#ifdef USE_SDL_SURFACE
- for (i = 0; i < 7; ++i) {
- memcpy(Players[o].UnitColors.Colors, &GlobalPalette->colors[208
+ i * 4],
- sizeof(SDL_Color) * 4);
- memcpy(Players[o + 8].UnitColors.Colors,
&GlobalPalette->colors[208 + i * 4],
+ for (i = 0; i < PlayerMax; ++i) {
+ memcpy(Players[o].UnitColors.Colors, PlayerColorsRGB[i],
sizeof(SDL_Color) * 4);
- o = (o + 1) & 0x7;
+ o = (o + 1) % PlayerMax;
}
-
- memcpy(Players[o].UnitColors.Colors, &GlobalPalette->colors[12],
- sizeof(SDL_Color) * 4);
- memcpy(Players[o + 8].UnitColors.Colors, &GlobalPalette->colors[12],
- sizeof(SDL_Color) * 4);
-
#else
switch (VideoBpp) {
case 8:
- // New player colors setup
- if (!Pixels8) {
- DebugLevel0Fn("Wrong setup order\n");
- return;
+ for (i = 0; i < PlayerMax; ++i) {
+ memcpy(Players[o].UnitColors.Depth8.Pixels,
PlayerColors[i],
+ sizeof(VMemType8) * 4);
+ o = (o + 1) % PlayerMax;
}
-
- 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) {
- DebugLevel0Fn("Wrong setup order\n");
- return;
+ for (i = 0; i < PlayerMax; ++i) {
+ memcpy(Players[o].UnitColors.Depth16.Pixels,
PlayerColors[i],
+ sizeof(VMemType16) * 4);
+ o = (o + 1) % PlayerMax;
}
-
- 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) {
- DebugLevel0Fn("Wrong setup order\n");
- return;
+ for (i = 0; i < PlayerMax; ++i) {
+ memcpy(Players[o].UnitColors.Depth24.Pixels,
PlayerColors[i],
+ sizeof(VMemType24) * 4);
+ o = (o + 1) % PlayerMax;
}
-
- 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) {
- 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];
-
+ memcpy(Players[o].UnitColors.Depth32.Pixels,
PlayerColors[i],
+ sizeof(VMemType32) * 4);
+ o = (o + 1) % PlayerMax;
+ }
break;
}
#endif
Index: stratagus/src/stratagus/stratagus.c
diff -u stratagus/src/stratagus/stratagus.c:1.240
stratagus/src/stratagus/stratagus.c:1.241
--- stratagus/src/stratagus/stratagus.c:1.240 Fri Jan 2 08:24:15 2004
+++ stratagus/src/stratagus/stratagus.c Fri Jan 9 16:44:40 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: stratagus.c,v 1.240 2004/01/01 21:24:15 jsalmon3 Exp $
+// $Id: stratagus.c,v 1.241 2004/01/09 05:44:40 jsalmon3 Exp $
//@{
@@ -1028,31 +1028,9 @@
*/
global void PreMenuSetup(void)
{
- char* s;
-
- if (Tilesets == NULL) {
- fprintf(stderr, "Tilesets is null!!\n");
- ExitFatal(-1);
- }
-
//
// Initial menus require some gfx.
//
- // FIXME: must search tileset by identifier or use a gui palette?
- TheMap.TerrainName = Tilesets[0]->Ident;
- LoadTileset();
-#ifdef USE_SDL_SURFACE
- GlobalPalette = LoadRGB(s = strdcat3(StratagusLibPath,
- "/graphics/", Tilesets[0]->PaletteFile));
- TheMap.TerrainName = NULL;
- free(s);
-#else
- LoadRGB(GlobalPalette, s = strdcat3(StratagusLibPath,
- "/graphics/", Tilesets[0]->PaletteFile));
- TheMap.TerrainName = NULL;
- free(s);
- VideoCreatePalette(GlobalPalette);
-#endif
SetDefaultTextColors(FontYellow, FontWhite);
LoadFonts();
Index: stratagus/src/ui/botpanel.c
diff -u stratagus/src/ui/botpanel.c:1.100 stratagus/src/ui/botpanel.c:1.101
--- stratagus/src/ui/botpanel.c:1.100 Sat Jan 3 11:31:49 2004
+++ stratagus/src/ui/botpanel.c Fri Jan 9 16:44:41 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: botpanel.c,v 1.100 2004/01/03 00:31:49 jsalmon3 Exp $
+// $Id: botpanel.c,v 1.101 2004/01/09 05:44:41 jsalmon3 Exp $
//@{
@@ -104,7 +104,7 @@
char* cp;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: buttons $Id: botpanel.c,v 1.100 2004/01/03
00:31:49 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: buttons $Id: botpanel.c,v 1.101 2004/01/09
05:44:41 jsalmon3 Exp $\n\n");
for (i = 0; i < NumUnitButtons; ++i) {
CLprintf(file, "(define-button 'pos %d 'level %d 'icon '%s\n",
@@ -396,9 +396,6 @@
return;
}
- // FIXME: this is unneeded DrawUnitIcon does it self
- PlayerPixels(ThisPlayer); // could only
select own units.
-
for (i = 0; i < TheUI.NumButtonButtons; ++i) {
if (buttons[i].Pos != -1) {
int j;
@@ -502,7 +499,7 @@
}
}
- DrawUnitIcon(ThisPlayer,buttons[i].Icon.Icon,
+ DrawUnitIcon(ThisPlayer, buttons[i].Icon.Icon,
v, TheUI.ButtonButtons[i].X,
TheUI.ButtonButtons[i].Y);
//
Index: stratagus/src/ui/ccl_ui.c
diff -u stratagus/src/ui/ccl_ui.c:1.180 stratagus/src/ui/ccl_ui.c:1.181
--- stratagus/src/ui/ccl_ui.c:1.180 Fri Jan 9 08:12:49 2004
+++ stratagus/src/ui/ccl_ui.c Fri Jan 9 16:44:42 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_ui.c,v 1.180 2004/01/08 21:12:49 jsalmon3 Exp $
+// $Id: ccl_ui.c,v 1.181 2004/01/09 05:44:42 jsalmon3 Exp $
//@{
@@ -223,11 +223,6 @@
lua_error(l);
}
TheUI.Contrast = i;
-#ifdef USE_SDL_SURFACE
- // FIXME
-#else
- VideoCreatePalette(GlobalPalette); // rebuild palette
-#endif
MustRedraw = RedrawEverything;
lua_pushnumber(l, old);
@@ -256,11 +251,6 @@
lua_error(l);
}
TheUI.Brightness = i;
-#ifdef USE_SDL_SURFACE
- // FIXME:
-#else
- VideoCreatePalette(GlobalPalette); // rebuild palette
-#endif
MustRedraw = RedrawEverything;
lua_pushnumber(l, old);
@@ -289,11 +279,6 @@
lua_error(l);
}
TheUI.Saturation = i;
-#ifdef USE_SDL_SURFACE
- // FIXME:
-#else
- VideoCreatePalette(GlobalPalette); // rebuild palette
-#endif
MustRedraw = RedrawEverything;
lua_pushnumber(l, old);
Index: stratagus/src/ui/mainscr.c
diff -u stratagus/src/ui/mainscr.c:1.149 stratagus/src/ui/mainscr.c:1.150
--- stratagus/src/ui/mainscr.c:1.149 Fri Jan 9 06:45:19 2004
+++ stratagus/src/ui/mainscr.c Fri Jan 9 16:44:42 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mainscr.c,v 1.149 2004/01/08 19:45:19 mohydine Exp $
+// $Id: mainscr.c,v 1.150 2004/01/09 05:44:42 jsalmon3 Exp $
//@{
@@ -1113,7 +1113,6 @@
//
// If there are more units selected draw their
pictures and a health bar
//
- PlayerPixels(ThisPlayer); // can only be
own!
DrawInfoPanelBackground(0);
for (i = 0; i < (NumSelected > TheUI.NumSelectedButtons
?
TheUI.NumSelectedButtons :
NumSelected); ++i) {
Index: stratagus/src/ui/menu_proc.c
diff -u stratagus/src/ui/menu_proc.c:1.119 stratagus/src/ui/menu_proc.c:1.120
--- stratagus/src/ui/menu_proc.c:1.119 Tue Dec 23 16:27:28 2003
+++ stratagus/src/ui/menu_proc.c Fri Jan 9 16:44:43 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: menu_proc.c,v 1.119 2003/12/23 05:27:28 jsalmon3 Exp $
+// $Id: menu_proc.c,v 1.120 2004/01/09 05:44:43 jsalmon3 Exp $
//@{
@@ -285,11 +285,11 @@
}
}
if (rb < MenuButtonGfx.Sprite->NumFrames) {
- if (transparent) {
-
VideoDrawClipTrans50(MenuButtonGfx.Sprite, rb, x, y);
- } else {
-
VideoDrawClip(MenuButtonGfx.Sprite, rb, x, y);
- }
+ if (transparent) {
+ VideoDrawClipTrans50(MenuButtonGfx.Sprite, rb,
x, y);
+ } else {
+ VideoDrawClip(MenuButtonGfx.Sprite, rb, x, y);
+ }
} else {
if (rb < button) {
Index: stratagus/src/ui/menus.c
diff -u stratagus/src/ui/menus.c:1.600 stratagus/src/ui/menus.c:1.601
--- stratagus/src/ui/menus.c:1.600 Fri Jan 2 11:57:29 2004
+++ stratagus/src/ui/menus.c Fri Jan 9 16:44:43 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: menus.c,v 1.600 2004/01/02 00:57:29 jsalmon3 Exp $
+// $Id: menus.c,v 1.601 2004/01/09 05:44:43 jsalmon3 Exp $
//@{
@@ -5750,7 +5750,6 @@
Menu *menu;
char *description;
int old;
- char *s;
menu = CurrentMenu;
@@ -5760,7 +5759,7 @@
TheMap.Info->Description = strdup(description);
// Change the terrain
- old=TheMap.Info->MapTerrain;
+ old = TheMap.Info->MapTerrain;
if (old != menu->Items[6].d.pulldown.curopt) {
TheMap.Info->MapTerrain = menu->Items[6].d.pulldown.curopt;
free(TheMap.Info->MapTerrainName);
@@ -5772,19 +5771,7 @@
LoadTileset();
ChangeTilesetPud(old, &TheMap);
-#ifdef USE_SDL_SURFACE
- GlobalPalette = LoadRGB(s =
strdcat3(StratagusLibPath,"/graphics/",
- TheMap.Tileset->PaletteFile));
- free(s);
SetPlayersPalette();
-// VideoCreatePalette(GlobalPalette);
-#else
- LoadRGB(GlobalPalette,
- s=strdcat3(StratagusLibPath,"/graphics/",
- TheMap.Tileset->PaletteFile));
- free(s);
- VideoCreatePalette(GlobalPalette);
-#endif
PreprocessMap();
LoadConstructions();
LoadUnitTypes();
Index: stratagus/src/ui/mouse.c
diff -u stratagus/src/ui/mouse.c:1.166 stratagus/src/ui/mouse.c:1.167
--- stratagus/src/ui/mouse.c:1.166 Sat Dec 20 16:33:43 2003
+++ stratagus/src/ui/mouse.c Fri Jan 9 16:44:45 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mouse.c,v 1.166 2003/12/20 05:33:43 jsalmon3 Exp $
+// $Id: mouse.c,v 1.167 2004/01/09 05:44:45 jsalmon3 Exp $
//@{
@@ -1329,7 +1329,7 @@
return;
}
- if (CursorOn==CursorOnButton) {
+ if (CursorOn == CursorOnButton) {
// FIXME: other buttons?
if (ButtonAreaUnderCursor == ButtonAreaButton) {
DoButtonButtonClicked(ButtonUnderCursor);
Index: stratagus/src/video/linedraw.c
diff -u stratagus/src/video/linedraw.c:1.63 stratagus/src/video/linedraw.c:1.64
--- stratagus/src/video/linedraw.c:1.63 Sat Dec 20 16:33:48 2003
+++ stratagus/src/video/linedraw.c Fri Jan 9 16:44:47 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: linedraw.c,v 1.63 2003/12/20 05:33:48 jsalmon3 Exp $
+// $Id: linedraw.c,v 1.64 2004/01/09 05:44:47 jsalmon3 Exp $
//@{
@@ -1184,10 +1184,6 @@
}
}
-global void DebugTestDisplayLines(void)
-{
-// DebugCheck(1);
-}
#else
/**
** Draw pixel unclipped into 8bit framebuffer.
@@ -1656,9 +1652,7 @@
#endif
#endif // ifdef USE_SDL_SURFACE
-#ifdef USE_SDL_SURFACE
-
-#else
+#ifndef USE_SDL_SURFACE
/**
** Draw translucent pixel unclipped into 8bit framebuffer.
**
@@ -7755,286 +7749,6 @@
#endif
}
-#ifdef DEBUG // {
-
-// ===========================================================================
-//
-// Below are functions which can test above linedraw functionaility
-//
-// FOR DEBUG PURPOSE ONLY, BUT DON'T REMOVE PLEASE !!!
-//
-// ===========================================================================
-/**
-** Will try all kinds of possible linedraw routines on current screen
-** contents (it does not clear the screen to show transparency better)
-** FIXME: all clipping assumes setgm. fault when goin outside screen
-** coordinate, it would be better to set a smaller clip
rectangle
-** in the center of the screen to detect visible errors
outside
-** the clip rectangle..
-*/
-global void DebugTestDisplayVarious(void)
-{
- int x;
- int y;
- int i;
- int j;
-
- x = y = i = j = 0;
- //Should not show anything (segmentation fault when not properly
clipped)
- VideoDrawPixelClip(ColorRed, -1, 0);
- VideoDrawPixelClip(ColorRed, 0, -1);
- VideoDrawPixelClip(ColorRed, VideoWidth, 0);
- VideoDrawPixelClip(ColorRed, 0, VideoHeight);
- VideoDraw25TransPixelClip(ColorRed, -1, 0);
- VideoDraw25TransPixelClip(ColorRed, 0, -1);
- VideoDraw25TransPixelClip(ColorRed, VideoWidth, 0);
- VideoDraw25TransPixelClip(ColorRed, 0, VideoHeight);
- VideoDraw50TransPixelClip(ColorRed, -1, 0);
- VideoDraw50TransPixelClip(ColorRed, 0, -1);
- VideoDraw50TransPixelClip(ColorRed, VideoWidth, 0);
- VideoDraw50TransPixelClip(ColorRed, 0, VideoHeight);
- VideoDraw75TransPixelClip(ColorRed, -1, 0);
- VideoDraw75TransPixelClip(ColorRed, 0, -1);
- VideoDraw75TransPixelClip(ColorRed, VideoWidth, 0);
- VideoDraw75TransPixelClip(ColorRed, 0, VideoHeight);
- VideoDrawTransPixelClip(ColorRed, -1, 0, 0);
- VideoDrawTransPixelClip(ColorRed, 0, -1, 0);
- VideoDrawTransPixelClip(ColorRed, VideoWidth, 0, 0);
- VideoDrawTransPixelClip(ColorRed, 0, VideoHeight, 0);
-
- //Should show blue area getting transparent from left-to-right
- for (y = 0; y < 50; ++y) {
- for (x = 0; x < 50; ++x) {
- VideoDrawPixel(ColorBlue, x, y);
- }
- }
- for (y = 0; y < 50; ++y) {
- for (x = 50; x < 100; ++x) {
- VideoDraw25TransPixel(ColorBlue, x, y);
- }
- }
- for (y = 0; y < 50; ++y) {
- for (x = 100; x < 150; ++x) {
- VideoDraw50TransPixel(ColorBlue, x, y);
- }
- }
- for (y = 0; y < 50; ++y) {
- for (x = 150; x < 200; ++x) {
- VideoDraw75TransPixel(ColorBlue, x, y);
- }
- }
- for (y = 50; y < 100; ++y) {
- for (x = 0; x < 256; ++x) {
- VideoDrawTransPixel(ColorBlue, x, y, x);
- }
- }
-
- // Should show blue+red horizontal bars just below above drawpixel tests
- //getting transparent from top-to-bottom. Clipping should prevent
segm.fault
- for (y = 0; y < 10; ++y) {
- VideoDrawHLine(ColorBlue, 0, y + 100, VideoWidth - 1);
- VideoDrawHLineClip(ColorRed, -100, -1, VideoWidth + 200);
- VideoDrawHLineClip(ColorRed, -100, VideoHeight, VideoWidth +
200);
- VideoDrawHLineClip(ColorRed, -100, y + 110, VideoWidth + 200);
- VideoDraw25TransHLine(ColorBlue, 0, y + 120, VideoWidth - 1);
- VideoDraw25TransHLineClip(ColorRed, -100, -1, VideoWidth + 200);
- VideoDraw25TransHLineClip(ColorRed, -100, VideoHeight,
VideoWidth + 200);
- VideoDraw25TransHLineClip(ColorRed, -100, y + 130, VideoWidth +
200);
- VideoDraw50TransHLine(ColorBlue, 0, y + 140, VideoWidth - 1);
- VideoDraw50TransHLineClip(ColorRed, -100, -1, VideoWidth + 200);
- VideoDraw50TransHLineClip(ColorRed, -100, VideoHeight,
VideoWidth + 200);
- VideoDraw50TransHLineClip(ColorRed, -100, y + 150, VideoWidth +
200);
- VideoDraw75TransHLine(ColorBlue, 0, y + 160, VideoWidth - 1);
- VideoDraw75TransHLineClip(ColorRed, -100, -1, VideoWidth + 200);
- VideoDraw75TransHLineClip(ColorRed, -100, VideoHeight,
VideoWidth + 200);
- VideoDraw75TransHLineClip(ColorRed, -100, y + 170, VideoWidth +
200);
- }
- for (y = 0; y < 64; ++y) {
- VideoDrawTransHLine(ColorBlue, 0, y + 180, VideoWidth - 1, y *
4);
- VideoDrawTransHLineClip(ColorRed, -100, -1, VideoWidth + 200, y
* 4);
- VideoDrawTransHLineClip(ColorRed, -100, VideoHeight, VideoWidth
+ 200, y * 4);
- VideoDrawTransHLineClip(ColorRed, -100, y + 180 + 64 + 6 + 6,
VideoWidth + 200, (63 - y) * 4);
- }
-
- // Should show blue+red vertical bars at the right of the screen
- //getting transparent from left-to-right. Clipping should prevent
segm.fault
- i = ((VideoWidth - 70 - 70 - 50) / 10) * 10; // starting grid pos for
two colums
- for (x = 0; x < 64; ++x) {
- VideoDrawTransVLine(ColorBlue, i + x, 0, VideoHeight - 1, x *
4);
- VideoDrawTransVLineClip(ColorRed, -1, -100, VideoHeight + 200,
x * 4);
- VideoDrawTransVLineClip(ColorRed, VideoWidth, -100, VideoHeight
+ 200,x * 4);
- VideoDrawTransVLineClip(ColorRed, i + 76 + x, -100, VideoHeight
+ 200,(63 - x) * 4);
- }
- i -= 4 * 2 * 10;
- for (x = 0; x < 10; ++x) {
- VideoDrawVLine(ColorBlue, i + x, 0, VideoHeight - 1);
- VideoDrawVLineClip(ColorRed, -1, -100, VideoHeight + 200);
- VideoDrawVLineClip(ColorRed, VideoWidth, -100, VideoHeight +
200);
- VideoDrawVLineClip(ColorRed, i + x + 10, -100, VideoHeight +
200);
- VideoDraw25TransVLine(ColorBlue, i + x + 20, 0, VideoHeight -
1);
- VideoDraw25TransVLineClip(ColorRed, -1, -100, VideoHeight +
200);
- VideoDraw25TransVLineClip(ColorRed, VideoWidth, -100,
VideoHeight + 200);
- VideoDraw25TransVLineClip(ColorRed, i + x + 30, -100,
VideoHeight + 200);
- VideoDraw50TransVLine(ColorBlue, i + x + 40, 0, VideoHeight-1);
- VideoDraw50TransVLineClip(ColorRed, -1, -100, VideoHeight +
200);
- VideoDraw50TransVLineClip(ColorRed, VideoWidth, -100,
VideoHeight + 200);
- VideoDraw50TransVLineClip(ColorRed, i + x + 50, -100,
VideoHeight + 200);
- VideoDraw75TransVLine(ColorBlue, i + x + 60,0, VideoHeight-1);
- VideoDraw75TransVLineClip(ColorRed,-1, -100, VideoHeight + 200);
- VideoDraw75TransVLineClip(ColorRed, VideoWidth, -100,
VideoHeight + 200);
- VideoDraw75TransVLineClip(ColorRed, i + x + 70, -100,
VideoHeight + 200);
- }
-
- //Should show filled rectangles in screen's top-right corners
- VideoFillRectangleClip(ColorGray, VideoWidth - 30, -20, 60, 40);
- VideoFill25TransRectangleClip(ColorBlue, VideoWidth - 29, -19, 58, 38);
- VideoFill50TransRectangleClip(ColorRed, VideoWidth - 28, -18, 56, 36);
- VideoFill75TransRectangleClip(ColorGreen, VideoWidth - 27, -17, 54, 34);
- VideoFillTransRectangleClip(ColorBlue, VideoWidth - 26, -16, 52, 32,
64);
-
- //Should show red area in lower-left getting transparent from
left-to-right
- i = ((VideoHeight - 20) / 10) * 10; // starting grid pos for two colums
- VideoFillRectangle(ColorRed, 0, i, 50, 20);
- VideoFill25TransRectangle(ColorRed, 50, i, 50, 20);
- VideoFill50TransRectangle(ColorRed, 100, i, 50, 20);
- VideoFill75TransRectangle(ColorRed, 150, i, 50, 20);
- i -= 20;
- for (x = 0; x < 256; ++x) {
- VideoFillTransRectangle(ColorRed, x, i, 1, 20, x);
- }
-
- //Should show red/green/blue rectangles in lower-left transparent from
- //left-to-right
- i -= 20;
- for (x = 0; x < 10; ++x) {
- VideoDrawRectangle(ColorBlue, x, i + x, 50 - 2 * x, 20 - 2 * x);
- VideoDraw25TransRectangle(ColorBlue, 50 + x, i + x, 50 - 2 * x,
20 - 2 * x);
- VideoDraw50TransRectangle(ColorBlue, 100 + x, i + x, 50 - 2 *
x, 20 - 2 * x);
- VideoDraw75TransRectangle(ColorBlue, 150 + x, i + x, 50 - 2 *
x, 20 - 2 * x);
- }
- i -= 20;
- for (x = 0;x < 256; ++x) {
- VideoDrawTransRectangle(ColorGreen, x, i, 1, 20, x);
- }
- i -= 20;
- for (x = 0; x < 128; ++x) {
- VideoDrawTransRectangle(ColorRed, 2 * x, i, 2, 20, x * 2);
- }
-
- //Should show rectangles in screen's bottom-right corners
- VideoDrawRectangleClip(ColorGray, VideoWidth - 30, VideoHeight - 20,
60, 40);
- VideoDraw25TransRectangleClip(ColorBlue, VideoWidth - 29, VideoHeight -
19, 58, 38);
- VideoDraw50TransRectangleClip(ColorRed, VideoWidth - 28, VideoHeight -
18, 56, 36);
- VideoDraw75TransRectangleClip(ColorGreen, VideoWidth - 27, VideoHeight
- 17, 54, 34);
- VideoDrawTransRectangleClip(ColorBlue, VideoWidth - 26, VideoHeight -
16, 52, 32, 64);
-
- //Display grid of 10x10 (to detect errors more easier)
- for (y = 0; y < VideoHeight; y += 10) {
- for (x = 0; x < VideoWidth; x += 10) {
- VideoDrawPixel(ColorWhite, x, y);
- }
- }
-
- //Should show white pixel in lower-right corner (not prevented by
clippingi)
- VideoDrawPixelClip(ColorWhite, VideoWidth - 1, VideoHeight - 1);
-}
-
-/**
-** Show colorcube (only for 8bpp!) and common+current palette
-*/
-global void DebugTestDisplayColorCube(void)
-{
- int i;
- int x;
- int y;
-
- for (i = 0; i < 32; ++i) {
- for (y = 0; y < 32; ++y) {
- for (x = 0; x < 32; ++x) {
- int a;
- int b;
- a = (x + (i % 10) * 32) * 2;
- b = (y + (i / 10) * 32) * 2;
- VideoMemory8[a+b*VideoWidth] =
- VideoMemory8[a + 1 + b * VideoWidth] =
- VideoMemory8[a + (b + 1) * VideoWidth] =
- VideoMemory8[a + 1 + (b + 1) *
VideoWidth] =
- colorcube8[(i << 10) | (y << 5) | x];
- }
- }
- }
- for (i = 0; i < 256; ++i) {
- VideoMemory8[i + 400 * VideoWidth] =
- VideoMemory8[i + 401 * VideoWidth] = i;
- }
- for (i = 0; i < 256; ++i) {
- VideoMemory8[i + 403 * VideoWidth] =
- VideoMemory8[i + 404 * VideoWidth] = Pixels8[i];
- }
-}
-
-/**
-** Try all kinds of possible lines (only one time) upon
-** current display, making the job of debugging them more eassier..
-** FIXME: This shows the BUG that 'clipped red lines' are not drawn
-** exactly upon 'unclipped blue lines'.
-*/
-global void DebugTestDisplayLines(void)
-{
- int x;
- int y;
- int i;
- int j;
-
- /* ClearTheScreen */
- for (y = 0; y < VideoHeight; ++y) {
- for (x = 0; x < VideoWidth; ++x) {
- VideoDrawPixel(ColorBlack, x, y);
- }
- }
-
- /* draw lines in each possible direction
- y = VideoHeight < VideoWidth ? VideoHeight : VideoWidth;
- for (x = 0; x < y; x += 10) {
- VideoDrawLine(ColorBlue, 0, x, y - x - 1, 0);
- }
- */
- i = (VideoWidth / 10) * 10;
- j = (VideoHeight / 10) * 10;
- for (x = 0; x <= i; x += 10) {
- VideoDrawLine(ColorBlue, 0, 0, x, j);
- }
- for (y = 0; y <= j; y += 10) {
- VideoDrawLine(ColorBlue, 0, 0, i, y);
- }
-
- SetClipping(20, 20, (VideoWidth / 10) * 10 - 20, (VideoHeight / 10) *
10 - 20);
- for (x = 0; x <= i; x += 10) {
- VideoDrawLineClip(ColorRed, 0, 0, x, j);
- }
- for (y = 0; y <= j; y += 10) {
- VideoDrawLineClip(ColorRed, 0, 0, i, y);
- }
- /*
- i = (VideoWidth / 10) * 10 + 15;
- j = (VideoHeight / 10) * 10 + 15;
- for (x = i; x >= -15; x -= 10) {
- VideoDrawLineClip(ColorRed, i, 0, x, j);
- }
- for (y = j; y >= -15; y -= 10) {
- VideoDrawLineClip(ColorRed, i, 0, -15, y);
- }
- */
-
- /* Display grid of 10x10 (to detect errors more easier) */
- for (y = 0; y < VideoHeight; y += 10) {
- for (x = 0; x < VideoWidth; x += 10) {
- VideoDrawPixel(ColorWhite, x, y);
- }
- }
-}
-#endif // ifdef USE_SDL_SURFACE
-
-#endif // } DEBUG
+#endif // !USE_SDL_SURFACE
//@}
Index: stratagus/src/video/video.c
diff -u stratagus/src/video/video.c:1.81 stratagus/src/video/video.c:1.82
--- stratagus/src/video/video.c:1.81 Sat Dec 20 16:33:51 2003
+++ stratagus/src/video/video.c Fri Jan 9 16:44:47 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: video.c,v 1.81 2003/12/20 05:33:51 jsalmon3 Exp $
+// $Id: video.c,v 1.82 2004/01/09 05:44:47 jsalmon3 Exp $
//@{
@@ -114,12 +114,6 @@
-- Declarations
----------------------------------------------------------------------------*/
-// JOHNS: This is needed, because later I want to support it all with the same
-// executable, choosable at runtime.
-#ifdef USE_SDL
-#define UseSdl 1
-#endif
-
/**
** Structure of pushed clippings.
*/
@@ -196,27 +190,9 @@
global VMemType* VideoMemory;
#endif
- /**
- ** Architecture-dependant system palette. Applies as
conversion between
- ** GlobalPalette colors and their representation in
videomemory.
- ** Set by VideoCreatePalette or VideoSetPalette.
- ** @see VideoCreatePalette @see VideoSetPalette
- */
-#ifdef USE_SDL_SURFACE
-global SDL_Palette* Pixels;
-#else
-global VMemType* Pixels;
-#endif
-
global int VideoSyncSpeed = 100; /// 0 disable interrupts
global volatile int VideoInterrupts; /// be happy, were are quicker
- /// Loaded system palette. 256-entries long, active system palette.
-#ifdef USE_SDL_SURFACE
-global SDL_Palette* GlobalPalette;
-#else
-global Palette GlobalPalette[256];
-#endif
/**
** FIXME: this docu is added only to the first variable!
**
@@ -631,73 +607,6 @@
VideoFree(picture);
}
-/**
-** FIXME
-*/
-#ifdef USE_SDL_SURFACE
-global SDL_Palette* LoadRGB(const char* name)
-{
- CLFile* fp;
- int i;
- unsigned char* p;
- unsigned char buffer[256 * 3];
- SDL_Palette* pal;
-
- if (!(fp = CLopen(name, CL_OPEN_READ)) || CLread(fp, buffer, 256 * 3)
!= 256 * 3) {
- fprintf(stderr, "Can't load palette %s\n", name);
- ExitFatal(-1);
- }
-
- // FIXME: malloc somewhere else ?!?!
- pal = malloc(sizeof(SDL_Palette));
- pal->colors = calloc(256, sizeof(SDL_Color));
-
- pal->ncolors = 256;
-
- p = buffer;
- for (i = 0; i < 256; ++i) {
- pal->colors[i].r = (*p++);
- pal->colors[i].g = (*p++);
- pal->colors[i].b = (*p++);
- }
-
- CLclose(fp);
-
- return pal;
-}
-#else
-/**
-** 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
-*/
-global void LoadRGB(Palette* pal, const char* name)
-{
- CLFile* fp;
- int i;
- unsigned char* p;
- unsigned char buffer[256 * 3];
-
- if (!(fp = CLopen(name, CL_OPEN_READ)) || CLread(fp, buffer, 256 * 3)
!= 256 * 3) {
- fprintf(stderr, "Can't load palette %s\n", name);
- ExitFatal(-1);
- }
-
- p = buffer;
- for (i = 0; i < 256; ++i) {
- pal[i].r = (*p++);
- pal[i].g = (*p++);
- pal[i].b = (*p++);
- }
-
- CLclose(fp);
-}
-#endif
-
// FIXME: this isn't 100% correct
// Color cycling info - forest:
// 3 flash red/green (attacked building on minimap)
@@ -843,24 +752,6 @@
pixels[i] = pixels[i + 1];
}
pixels[ColorWaterCycleEnd] = x;
-
- x = Pixels8[ColorWaterCycleStart];
- for (i = ColorWaterCycleStart; i < ColorWaterCycleEnd; ++i) {
// tileset color cycle
- Pixels8[i] = Pixels8[i + 1];
- }
- Pixels8[ColorWaterCycleEnd] = x;
-
- x = Pixels8[ColorIconCycleStart];
- for (i = ColorIconCycleStart; i < ColorIconCycleEnd; ++i) {
// units/icons color cycle
- Pixels8[i] = Pixels8[i + 1];
- }
- Pixels8[ColorIconCycleEnd] = x;
-
- x = Pixels8[ColorBuildingCycleStart];
- for (i = ColorBuildingCycleStart; i < ColorBuildingCycleEnd;
++i) { // buildings color cycle
- Pixels8[i] = Pixels8[i + 1];
- }
- Pixels8[ColorBuildingCycleEnd] = x;
}
MapColorCycle(); // FIXME: could be
little more informative
@@ -918,24 +809,6 @@
pixels[i] = pixels[i + 1];
}
pixels[ColorWaterCycleEnd] = x;
-
- x = Pixels16[ColorWaterCycleStart];
- for (i = ColorWaterCycleStart; i < ColorWaterCycleEnd; ++i) {
// tileset color cycle
- Pixels16[i] = Pixels16[i + 1];
- }
- Pixels16[ColorWaterCycleEnd] = x;
-
- x = Pixels16[ColorIconCycleStart];
- for (i = ColorIconCycleStart; i < ColorIconCycleEnd; ++i) {
// units/icons color cycle
- Pixels16[i] = Pixels16[i + 1];
- }
- Pixels16[ColorIconCycleEnd] = x;
-
- x = Pixels16[ColorBuildingCycleStart];
- for (i = ColorBuildingCycleStart; i < ColorBuildingCycleEnd;
++i) { // Buildings color cycle
- Pixels16[i] = Pixels16[i + 1];
- }
- Pixels16[ColorBuildingCycleEnd] = x;
}
MapColorCycle(); // FIXME: could be
little more informative
@@ -993,24 +866,6 @@
pixels[i] = pixels[i + 1];
}
pixels[ColorWaterCycleEnd] = x;
-
- x = Pixels24[ColorWaterCycleStart];
- for (i = ColorWaterCycleStart; i < ColorWaterCycleEnd; ++i) {
// tileset color cycle
- Pixels24[i] = Pixels24[i + 1];
- }
- Pixels24[ColorWaterCycleEnd] = x;
-
- x = Pixels24[ColorIconCycleStart];
- for (i = ColorIconCycleStart; i < ColorIconCycleEnd; ++i) {
// units/icons color cycle
- Pixels24[i] = Pixels24[i + 1];
- }
- Pixels24[ColorIconCycleEnd] = x;
-
- x = Pixels24[ColorBuildingCycleStart];
- for (i = ColorBuildingCycleStart; i < ColorBuildingCycleEnd;
++i) { // Buildings color cycle
- Pixels24[i] = Pixels24[i + 1];
- }
- Pixels24[ColorBuildingCycleEnd] = x;
}
MapColorCycle(); // FIXME: could be
little more informative
@@ -1068,24 +923,6 @@
pixels[i] = pixels[i + 1];
}
pixels[ColorWaterCycleEnd] = x;
-
- x = Pixels32[ColorWaterCycleStart];
- for (i = ColorWaterCycleStart; i < ColorWaterCycleEnd; ++i) {
// tileset color cycle
- Pixels32[i] = Pixels32[i + 1];
- }
- Pixels32[ColorWaterCycleEnd] = x;
-
- x = Pixels32[ColorIconCycleStart];
- for (i = ColorIconCycleStart; i < ColorIconCycleEnd; ++i) {
// units/icons color cycle
- Pixels32[i] = Pixels32[i + 1];
- }
- Pixels32[ColorIconCycleEnd] = x;
-
- x = Pixels32[ColorBuildingCycleStart];
- for (i = ColorBuildingCycleStart; i < ColorBuildingCycleEnd;
++i) { // Buildings color cycle
- Pixels32[i] = Pixels32[i + 1];
- }
- Pixels32[ColorBuildingCycleEnd] = x;
}
MapColorCycle(); // FIXME: could be
little more informative
@@ -1462,50 +1299,11 @@
}
#endif
-/*===========================================================================*/
-
-/**
-** Initializes system palette. Also calls SetPlayersPalette to set
-** palette for all players.
-**
-** @param palette VMemType structure, as created by
VideoCreateNewPalette
-**
-** @see SetPlayersPalette
-*/
-#ifndef USE_SDL_SURFACE
-global void VideoSetPalette(const VMemType* palette)
-{
- DebugLevel2Fn("Palette %x used\n" _C_ (unsigned)palette);
-
- if (Pixels) {
- free(Pixels);
- }
- Pixels = (VMemType*)palette;
- SetPlayersPalette();
-}
-#endif
-
/*----------------------------------------------------------------------------
-- Functions
----------------------------------------------------------------------------*/
/**
-** Set the system hardware palette from an independend Palette
struct.
-**
-** @param palette System independ palette structure.
-*/
-#ifndef USE_SDL_SURFACE
-global void VideoCreatePalette(const Palette* palette)
-{
- VMemType* temp;
-
- temp = VideoCreateNewPalette(palette);
-
- VideoSetPalette(temp);
-}
-#endif
-
-/**
** Lock the screen for write access.
*/
global void VideoLockScreen(void)
@@ -1538,7 +1336,7 @@
*/
global unsigned long GetTicks(void)
{
-#if UseSdl
+#ifdef USE_SDL
return SDL_GetTicks();
#endif
}
@@ -1548,20 +1346,8 @@
*/
global void InitVideo(void)
{
-#ifdef __OPTIMIZE__
- if (UseSdl) {
- InitVideoSdl();
- } else {
-#ifdef DEBUG
- abort();
-#endif
- }
-#else
- #if UseSdl
- InitVideoSdl();
- #else
- abort();
- #endif
+#ifdef USE_SDL
+ InitVideoSdl();
#endif
//
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus data/ccl/tilesets/summer.lua data/ccl...,
address@hidden <=