summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--HOWTO.txt12
-rw-r--r--README-DEV.txt4
-rw-r--r--README.txt44
-rw-r--r--src/graphics/core/vertex.h18
-rw-r--r--src/graphics/engine/engine.cpp16
-rw-r--r--src/graphics/engine/text.cpp75
-rw-r--r--src/graphics/engine/text.h7
-rw-r--r--src/graphics/opengl/gldevice.cpp8
-rw-r--r--src/ui/color.cpp8
9 files changed, 106 insertions, 86 deletions
diff --git a/HOWTO.txt b/HOWTO.txt
index 4c17234..0dfb593 100644
--- a/HOWTO.txt
+++ b/HOWTO.txt
@@ -6,6 +6,10 @@ How to...
1.1 Windows:
+ NOTE: currently, there are some issues when compiling on Windows, connected mostly with
+ clashing macros defined in windows headers. Most probably, a special development package
+ will be provided, which will include MinGW, CMake and all necessary libraries.
+
1. Download and install MinGW and MSYS:
http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20111118/
When installing, select all available components.
@@ -13,7 +17,7 @@ How to...
http://www.cmake.org/cmake/resources/software.html (the Windows zip file)
Unpack the contents of the archive to where MinGW is installed (files from bin/ should go into bin/, etc.)
3. Download the following libraries, installing them in your MinGW directory like with CMake:
- SDL >=1.2.10, SDL_imgage >= 1.2, SDL_ttf >= 2.0, libpng >= 1.2, GLEW >= 1.8.0
+ SDL >=1.2.10, SDL_imgage >= 1.2, SDL_ttf >= 2.0, libpng >= 1.2, GLEW >= 1.8.0, Boost >= 1.51 (with filesystem)
Note #1: For most libraries, you can download binary packages with compiled files.
However, you must ensure that they work with MinGW as some are built with MSVC
and may be incompatible. If that is the case, you should compile the libraries from sources
@@ -59,6 +63,10 @@ Jak...
1.1 Windows:
+ UWAGA: obecnie występują problemy z kompilacją na Windowsie, głównie ze względu na konflikt w makrach,
+ jakie definiują nagłówki windowsowe. Najprawdopodobniej, zostanie wydana specjalna paczka
+ dla developerów, która będzie zawierała MinGW, CMake i wszystkie potrzebne biblioteki.
+
1. Ściągamy i instalujemy MinGW i MSYS:
http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20111118/
Przy instalacji zaznaczamy wszystkie komponenty do instalacji.
@@ -66,7 +74,7 @@ Jak...
http://www.cmake.org/cmake/resources/software.html (plik zip dla Windowsa)
Zip rozpakowujemy do katalogu, gdzie zainstalowany jest MinGW (pliki z bin/ mają trafić do bin/ itd.).
3. Ścągamy następujące biblioteki i instalujemy je tam, gdzie MinGW, podobnie jak z CMake:
- SDL >= 1.2.10, SDL_image >= 1.2, SDL_ttf >= 2.0, libpng >= 1.2
+ SDL >= 1.2.10, SDL_image >= 1.2, SDL_ttf >= 2.0, libpng >= 1.2, Boost >= 1.51 (wraz z filesystem)
Uwaga #1: W większości wymienionych bibliotek można ściągnąć paczki binarne ze skompilowanymi plikami.
Jednak musisz się upewnić, że pliki te będą współpracowały z MinGW, bo część z nich
jest kompilowana MSVC i może być niezgodna. W takim wypadku, musisz skompilować bibliotekę
diff --git a/README-DEV.txt b/README-DEV.txt
deleted file mode 100644
index eabd8b3..0000000
--- a/README-DEV.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-README for Developers
-
-Please refer to our wiki for developers for current information. Its current address is:
-http://colobot.info/wiki/
diff --git a/README.txt b/README.txt
index 7745186..071444b 100644
--- a/README.txt
+++ b/README.txt
@@ -2,11 +2,15 @@ EN
Welcome to Colobot project repository
+NOTE: this is the new repository which was moved here from https://github.com/adiblol/colobot. The new repository has been purged of binary files cluttering the history, so all commits have been overwritten. If you have been using the old repository, you have to clone from scratch the new one.
+
This is official repository for the open-source Colobot project developed by Polish Portal of Colobot (PPC; Polish: Polski Portal Colobota) with the official site at: http://colobot.cba.pl/.
-The source code contained here was released by Epsitec -- the original creator of the game -- on open source (GPLv3) license. The code was given and the rights granted specifically to PPC community in March 2012. Since then, we have been modifying the code and working on our goals, which are briefly summed up below. More information about the project in general will soon appear on our site and a wiki we are writing.
+The source code contained here was released by Epsitec -- the original creator of the game -- on open source (GPLv3) license. The code was given and the rights granted specifically to PPC community in March 2012. Since then, we have been modifying the code and working on our goals, which are briefly summed up below.
+
+More information for developers can be found at developer wiki at: http://colobot.info/wiki. However, the freshest source of information is our IRC channel #colobot at pirc.pl.
-This repository contains only the source code of the game. The game requires also data files which will soon be made available in separate packages. For now, though, you can download the original download package released by Epsitec (the link is on our site).
+This repository contains only the source code of the project. The game requires also data files which are available in separate packages, currently from http://colobot.info/files. The packages are named colobot-data-YYYY-MM-DD.zip. Make sure you have the latest package before compiling and running the code in repository.
Status
@@ -15,11 +19,13 @@ Our main goals can be summed up in three milestones:
Milestone 1 - Colobot Classic
-This is a version of the game that is comprised of the original source files with only minor changes and bugfixes. It is currently maintained in branch named "original" and the master branch is synced to it to provide a working version of the project. There will soon be download packages for the game, in several language versions.
+This is the original version of the game, as released to us by Epsitec with only minor changes and bugfixes. It is available as a tag named colobot-original in the repository. This version will not be developed further. The compiled version and data packs needed to run the game (split by language version) can be found at: http://colobot.info/files.
Milestone 2 - Colobot Gold
-This is a version of the game that we are now focusing our efforts on. It will be the original, refreshed game rewritten using SDL and OpenGL libraries, thus making it multiplatform. Development for this version is continued in dev branch and sub-branches dev-*. The data files will not be altered and the game will be as close to the original as possible. With this release, we hope to reach wider audience and gain more support.
+This is a version of the game that is currently being developed in this repository. It is based on the original code, but refreshed and rewritten using SDL and OpenGL libraries, thus making it multiplatform.
+
+As of September 2012, we have rewritten almost all of the original code and we are in the process of testing and fixing issues that are still present in the game. The game runs and compiles under Windows and Linux. The master branch contains the current snapshot code which should always compile and run with the latest data pack. The dev branch and dev-* sub-branches are used for general development.
Milestone 3 - Colobot 2
@@ -30,40 +36,52 @@ Compiling and running the game
For these instructions see HOWTO.txt file.
+
Contact
-If you want to help in the project, please contact us on our IRC channel #colobot at pirc.pl or the forum on our website: http://colobot.cba.pl/forum (there is also an English board).
+If you want to help in the project, please contact us on our IRC channel #colobot at pirc.pl or the forum on our website: http://colobot.cba.pl/forum (there is also an English board). We're in the process of moving to a new site and forum so not all information on our old site is up-to-date, but we're be done soon.
+
+
PL
Witamy w repozytorium projektu Colobot
+UWAGA: to jest nowe repozytorium, które zostało przeniesione tu z https://github.com/adiblol/colobot. Nowe repozytorium zostało wyczyszczone z plików binarnych, które zostały w historii, więc wszystkie commity zostały nadpisane. Jeżeli korzystałeś/aś ze starego repozytorium, musisz sklonować od zera te nowe.
+
To jest oficjalne repozytorium z kodem projektu open-source Colobot rozwijanego przez Polski Portal Colobota (PPC; angielski: Polish Portal of Colobot) z oficjalną stroną: http://colobot.cba.pl/.
-Kod źródłowy zawarty tutaj został wydany przez Epsitec -- oryginalnego twórcę gry -- na otwartej licencji (GPLv3). Kod został wydany i prawa nadane specjalnie dla społeczności PPC w marcu 2012. Od tamtej pory, zajmujemy się modyfikowaniem kodu i pracowaniem nad naszymi celami, które są krótko podsumowane poniżej. Więcej informacji o projekcie w ogóle pojawi się wkrótce na naszej stronie i na wiki, które w tej chwili piszemy.
+Kod źródłowy zawarty tutaj został wydany przez Epsitec -- oryginalnego twórcę gry -- na otwartej licencji (GPLv3). Kod został wydany i prawa nadane specjalnie dla społeczności PPC w marcu 2012. Od tamtej pory, zajmujemy się modyfikowaniem kodu i pracowaniem nad naszymi celami, które są krótko podsumowane poniżej.
+
+Więcej informacji dla developerów projektu można znaleźć na wiki dla developerów: http://colobot.info/wiki. Jednak źródłem najświeższych informacji jest nasz kanał IRC #colobot na pirc.pl.
+
+To repozytorium zawiera jedynie kod źródłowy projektu. Gra wymaga jeszcze plików danych, które są dostępne w osobnych paczkach, obecnie na stronie http://colobot.info/files. Paczki są nazwane colobot-data-RRRR-MM-DD.zip. Upewnij się, że masz najnowszą wersję paczki zanim skompilujesz i uruchomisz kod z repozytorium.
-To repozytorium zawiera tylko kod źródłowy gry. Gra wymaga też plików danych, które niedługo zostaną przygotowane w osobnej paczce. Na razie, możesz pobrać oryginalną paczkę wydaną przez Epsitec (link znajduje się na naszej stronie).
Status
-Nasze główne cele można podsumować w trzech krokach, które chcemy osiągnąć:
+Nasze główne cele można podsumować w trzech cel, które chcemy osiągnąć:
-Krok 1 - Colobot Classic
+Cel 1 - Colobot Classic
-To jest wersja gry, która składa się z oryginalnych źródeł, z jedynie niewielkimi zmianami i poprawkami. Obecnie znajduje się w gałęzi nazwanej "original", a gałąź master jest z nią zsynchronizowana, aby udostępnić działającą wersję projektu. Niedługo pojawią się paczki do pobrania gry w kilku wersjach językowych.
+To jest oryginalna wersja gry, dokładnie taka, jaką otrzymaliśmy od Epsiteca z jedynie niewielkimi zmianami i poprawkami. Jest dostępna jako tag nazwany colobot-original w repozytorium. Ta wersja nie będzie dalej rozwijana. Skompilowaną wersję wraz z potrzebnymi paczkami danych (podzielone wg wersji językowej) można pobrać z http://colobot.info/files.
-Krok 2 - Colobot Gold
+Cel 2 - Colobot Gold
-To jest wersja gry, na której obecnie się skupiamy. Jest to oryginalna, odświeżona gra, przepisana z użyciem bibliotek SDL i OpenGL, w ten sposób czyniąc ją wieloplatformową. Rozwój tej wersji kontynuujemy w gałęzi dev i podgałęziach dev-*. Pliki danych nie będą zmienione dla tej wersji i gra będzie na tyle zbliżona do oryginału na ile to możliwe. Z tym wydaniem, chcemy dotrzeć do szerszej społeczności i uzyskać większe poparcie.
+Jest to wersja gry, którą obecnie rozwijamy w tym repozytorium. Jest oparta na oryginalnym kodzie, ale odświeżonym i przepisanym z wykorzystaniem bibliotek SDL i OpenGL, czyniąc ją wieloplatformową.
+
+Do września 2012, przepisaliśmy prawie cały oryginalny kod i jesteśmy teraz w trakcie testowania i poprawiania błędów nadal obecnych w grze. Gałąź master zawiera obecny snapshot kodu, który powinien zawsze dać się skompilować i uruchomić z najnowszą paczką danych. Gałęzie dev i podgałęzie dev-* są wykorzystywane do ogólnego rozwoju.
Krok 3 - Colobot 2
To będzie nowa część z cyklu gier Colobot. Mamy wiele pomysłów na nową grę i nadal dyskutujemy nad nimi. Ogólnie, rozwój tej wersji zacznie się po skończeniu wersji Colobot Gold (prawdopodobnie będzie hostowane w osobnym repozytorium, sforkowanym z kodu Colobot Gold).
+
Kompilacja i uruchomienie gry
Instrukcje te znajdują się w pliku HOWTO.txt.
+
Kontakt
-Jeżeli chcesz pomóc w projekcie, prosimy o kontakt na naszym kanale IRC: #colobot na pirc.pl albo na forum na naszej stronie: http://colobot.cba.pl/forum. \ No newline at end of file
+Jeżeli chcesz pomóc w projekcie, prosimy o kontakt na naszym kanale IRC: #colobot na pirc.pl albo na forum na naszej stronie: http://colobot.cba.pl/forum. Jesteśmy teraz w trakcie przenoszenia strony i forum w nowe miejsce i nie wszystkie informacje na starej stronie są aktualne, ale już niedługo skończymy przenosiny.
diff --git a/src/graphics/core/vertex.h b/src/graphics/core/vertex.h
index 9ab4dbb..e2c35c3 100644
--- a/src/graphics/core/vertex.h
+++ b/src/graphics/core/vertex.h
@@ -69,36 +69,28 @@ struct Vertex
/**
* \struct VertexCol
- * \brief Vertex with color information
- *
- * This structure was created as analog to DirectX's D3DLVERTEX.
+ * \brief Colored vertex
*
* It contains:
* - vertex coordinates (x,y,z) as Math::Vector,
- * - RGBA color as Color,
- * - RGBA specular color as Color,
- * - texture coordinates (u,v) as Math::Point.
+ * - RGBA color as Color
*/
struct VertexCol
{
Math::Vector coord;
Color color;
- Color specular;
- Math::Point texCoord;
explicit VertexCol(Math::Vector aCoord = Math::Vector(),
Color aColor = Color(),
- Color aSpecular = Color(),
Math::Point aTexCoord = Math::Point())
- : coord(aCoord), color(aColor), specular(aSpecular), texCoord(aTexCoord) {}
+ : coord(aCoord), color(aColor) {}
- //! Returns a string "(c: [...], col: [...], sp: [...], tc: [...])"
+ //! Returns a string "(c: [...], col: [...])"
inline std::string ToString() const
{
std::stringstream s;
s.precision(3);
- s << "(c: " << coord.ToString() << ", col: " << color.ToString() << ", sp: "
- << specular.ToString() << ", tc: " << texCoord.ToString() << ")";
+ s << "(c: " << coord.ToString() << ", col: " << color.ToString() << ")";
return s.str();
}
};
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 37f9b00..c170922 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -3417,10 +3417,10 @@ void CEngine::DrawBackgroundGradient(const Color& up, const Color& down)
VertexCol vertex[4] =
{
- VertexCol(Math::Vector(p1.x, p1.y, 0.0f), color[1], color[2]),
- VertexCol(Math::Vector(p1.x, p2.y, 0.0f), color[0], color[2]),
- VertexCol(Math::Vector(p2.x, p1.y, 0.0f), color[1], color[2]),
- VertexCol(Math::Vector(p2.x, p2.y, 0.0f), color[0], color[2])
+ VertexCol(Math::Vector(p1.x, p1.y, 0.0f), color[1]),
+ VertexCol(Math::Vector(p1.x, p2.y, 0.0f), color[0]),
+ VertexCol(Math::Vector(p2.x, p1.y, 0.0f), color[1]),
+ VertexCol(Math::Vector(p2.x, p2.y, 0.0f), color[0])
};
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
@@ -3567,10 +3567,10 @@ void CEngine::DrawOverColor()
VertexCol vertex[4] =
{
- VertexCol(Math::Vector(p1.x, p1.y, 0.0f), color[1], color[2]),
- VertexCol(Math::Vector(p1.x, p2.y, 0.0f), color[0], color[2]),
- VertexCol(Math::Vector(p2.x, p1.y, 0.0f), color[1], color[2]),
- VertexCol(Math::Vector(p2.x, p2.y, 0.0f), color[0], color[2])
+ VertexCol(Math::Vector(p1.x, p1.y, 0.0f), color[1]),
+ VertexCol(Math::Vector(p1.x, p2.y, 0.0f), color[0]),
+ VertexCol(Math::Vector(p2.x, p1.y, 0.0f), color[1]),
+ VertexCol(Math::Vector(p2.x, p2.y, 0.0f), color[0])
};
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp
index 36ad660..00b6617 100644
--- a/src/graphics/engine/text.cpp
+++ b/src/graphics/engine/text.cpp
@@ -150,8 +150,8 @@ void CText::FlushCache()
}
void CText::DrawText(const std::string &text, const std::vector<FontMetaChar> &format,
- float size, Math::Point pos, float width, TextAlign align,
- int eol)
+ float size, Math::Point pos, float width, TextAlign align,
+ int eol)
{
float sw = 0.0f;
@@ -172,8 +172,8 @@ void CText::DrawText(const std::string &text, const std::vector<FontMetaChar> &f
}
void CText::DrawText(const std::string &text, FontType font,
- float size, Math::Point pos, float width, TextAlign align,
- int eol)
+ float size, Math::Point pos, float width, TextAlign align,
+ int eol)
{
float sw = 0.0f;
@@ -194,8 +194,8 @@ void CText::DrawText(const std::string &text, FontType font,
}
void CText::SizeText(const std::string &text, const std::vector<FontMetaChar> &format,
- float size, Math::Point pos, TextAlign align,
- Math::Point &start, Math::Point &end)
+ float size, Math::Point pos, TextAlign align,
+ Math::Point &start, Math::Point &end)
{
start = end = pos;
@@ -217,8 +217,8 @@ void CText::SizeText(const std::string &text, const std::vector<FontMetaChar> &f
}
void CText::SizeText(const std::string &text, FontType font,
- float size, Math::Point pos, TextAlign align,
- Math::Point &start, Math::Point &end)
+ float size, Math::Point pos, TextAlign align,
+ Math::Point &start, Math::Point &end)
{
start = end = pos;
@@ -277,7 +277,7 @@ float CText::GetHeight(FontType font, float size)
float CText::GetStringWidth(const std::string &text,
- const std::vector<FontMetaChar> &format, float size)
+ const std::vector<FontMetaChar> &format, float size)
{
assert(StrUtils::Utf8StringLength(text) == format.size());
@@ -344,7 +344,7 @@ float CText::GetCharWidth(UTF8Char ch, FontType font, float size, float offset)
int CText::Justify(const std::string &text, const std::vector<FontMetaChar> &format,
- float size, float width)
+ float size, float width)
{
assert(StrUtils::Utf8StringLength(text) == format.size());
@@ -427,7 +427,7 @@ int CText::Justify(const std::string &text, FontType font, float size, float wid
}
int CText::Detect(const std::string &text, const std::vector<FontMetaChar> &format,
- float size, float offset)
+ float size, float offset)
{
assert(StrUtils::Utf8StringLength(text) == format.size());
@@ -500,7 +500,7 @@ int CText::Detect(const std::string &text, FontType font, float size, float offs
}
void CText::DrawString(const std::string &text, const std::vector<FontMetaChar> &format,
- float size, Math::Point pos, float width, int eol)
+ float size, Math::Point pos, float width, int eol)
{
assert(StrUtils::Utf8StringLength(text) == format.size());
@@ -509,24 +509,18 @@ void CText::DrawString(const std::string &text, const std::vector<FontMetaChar>
FontType font = FONT_COLOBOT;
float start = pos.x;
- unsigned int index = 0;
unsigned int fmtIndex = 0;
- while (index < text.length())
+
+ std::vector<UTF8Char> chars;
+ StringToUTFCharList(text, chars);
+ for (auto it = chars.begin(); it != chars.end(); ++it)
{
font = static_cast<FontType>(format[fmtIndex] & FONT_MASK_FONT);
// TODO: if (font == FONT_BUTTON)
if (font == FONT_BUTTON) continue;
- UTF8Char ch;
-
- int len = StrUtils::Utf8CharSizeAt(text, index);
- if (len >= 1)
- ch.c1 = text[index];
- if (len >= 2)
- ch.c2 = text[index+1];
- if (len >= 3)
- ch.c3 = text[index+2];
+ UTF8Char ch = *it;
float offset = pos.x - start;
float cw = GetCharWidth(ch, font, size, offset);
@@ -545,22 +539,16 @@ void CText::DrawString(const std::string &text, const std::vector<FontMetaChar>
DrawHighlight(hl, pos, charSize);
}
- DrawChar(ch, font, size, pos);
+ DrawCharAndAdjustPos(ch, font, size, pos);
- index += len;
fmtIndex++;
}
// TODO: eol
}
-void CText::DrawString(const std::string &text, FontType font,
- float size, Math::Point pos, float width, int eol)
+void CText::StringToUTFCharList(const std::string &text, std::vector<UTF8Char> &chars)
{
- assert(font != FONT_BUTTON);
-
- m_engine->SetState(ENG_RSTATE_TEXT);
-
unsigned int index = 0;
while (index < text.length())
{
@@ -568,15 +556,30 @@ void CText::DrawString(const std::string &text, FontType font,
int len = StrUtils::Utf8CharSizeAt(text, index);
if (len >= 1)
- ch.c1 = text[index];
+ ch.c1 = text[index];
if (len >= 2)
- ch.c2 = text[index+1];
+ ch.c2 = text[index+1];
if (len >= 3)
- ch.c3 = text[index+2];
+ ch.c3 = text[index+2];
index += len;
- DrawChar(ch, font, size, pos);
+ chars.push_back(ch);
+ }
+}
+
+void CText::DrawString(const std::string &text, FontType font,
+ float size, Math::Point pos, float width, int eol)
+{
+ assert(font != FONT_BUTTON);
+
+ m_engine->SetState(ENG_RSTATE_TEXT);
+
+ std::vector<UTF8Char> chars;
+ StringToUTFCharList(text, chars);
+ for (auto it = chars.begin(); it != chars.end(); ++it)
+ {
+ DrawCharAndAdjustPos(*it, font, size, pos);
}
}
@@ -660,7 +663,7 @@ void CText::DrawHighlight(FontHighlight hl, Math::Point pos, Math::Point size)
m_device->SetRenderState(RENDER_STATE_TEXTURING, true);
}
-void CText::DrawChar(UTF8Char ch, FontType font, float size, Math::Point &pos)
+void CText::DrawCharAndAdjustPos(UTF8Char ch, FontType font, float size, Math::Point &pos)
{
// TODO: if (font == FONT_BUTTON)
if (font == FONT_BUTTON) return;
diff --git a/src/graphics/engine/text.h b/src/graphics/engine/text.h
index e587609..bb9a32d 100644
--- a/src/graphics/engine/text.h
+++ b/src/graphics/engine/text.h
@@ -292,10 +292,11 @@ protected:
void DrawString(const std::string &text, FontType font,
float size, Math::Point pos, float width, int eol);
void DrawHighlight(FontHighlight hl, Math::Point pos, Math::Point size);
- void DrawChar(UTF8Char ch, FontType font, float size, Math::Point &pos);
+ void DrawCharAndAdjustPos(UTF8Char ch, FontType font, float size, Math::Point &pos);
+ void StringToUTFCharList(const std::string &text, std::vector<UTF8Char> &chars);
protected:
- CInstanceManager* m_iMan;
+ CInstanceManager* m_iMan;
CEngine* m_engine;
CDevice* m_device;
@@ -305,7 +306,7 @@ protected:
std::map<FontType, MultisizeFont*> m_fonts;
FontType m_lastFontType;
- int m_lastFontSize;
+ int m_lastFontSize;
CachedFont* m_lastCachedFont;
};
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index 1f9c6b0..bbad0a7 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -101,7 +101,7 @@ bool CGLDevice::Create()
return false;
}
- if ( (! GLEW_ARB_multitexture) || (! GLEW_EXT_texture_env_combine) || (! GLEW_EXT_secondary_color) )
+ if ( (! GLEW_ARB_multitexture) || (! GLEW_EXT_texture_env_combine) )
{
GetLogger()->Error("GLEW reports required extensions not supported\n");
return false;
@@ -887,8 +887,6 @@ void CGLDevice::DrawPrimitive(PrimitiveType type, const VertexCol *vertices, int
for (int i = 0; i < vertexCount; ++i)
{
glColor4fv(const_cast<GLfloat*>(vertices[i].color.Array()));
- glSecondaryColor3fv(const_cast<GLfloat*>(vertices[i].specular.Array()));
- glMultiTexCoord2fv(GL_TEXTURE0, const_cast<GLfloat*>(vertices[i].texCoord.Array()));
glVertex3fv(const_cast<GLfloat*>(vertices[i].coord.Array()));
}
@@ -1244,6 +1242,7 @@ void CGLDevice::SetFogParams(FogMode mode, const Color &color, float start, floa
glFogf(GL_FOG_START, start);
glFogf(GL_FOG_END, end);
glFogf(GL_FOG_DENSITY, density);
+ glFogfv(GL_FOG_COLOR, color.Array());
}
void CGLDevice::GetFogParams(FogMode &mode, Color &color, float &start, float &end, float &density)
@@ -1258,6 +1257,9 @@ void CGLDevice::GetFogParams(FogMode &mode, Color &color, float &start, float &e
glGetFloatv(GL_FOG_START, static_cast<GLfloat*>(&start));
glGetFloatv(GL_FOG_END, static_cast<GLfloat*>(&end));
glGetFloatv(GL_FOG_DENSITY, static_cast<GLfloat*>(&density));
+ GLfloat col[4] = { 0.0f };
+ glGetFloatv(GL_FOG_COLOR, col);
+ color = Color(col[0], col[1], col[2], col[3]);
}
void CGLDevice::SetCullMode(CullMode mode)
diff --git a/src/ui/color.cpp b/src/ui/color.cpp
index 2ba87a3..65f9770 100644
--- a/src/ui/color.cpp
+++ b/src/ui/color.cpp
@@ -190,10 +190,10 @@ void CColor::Draw()
m_engine->SetTexture(""); // no texture
m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
- vertex[0] = Gfx::VertexCol(Math::Vector(p1.x, p1.y, 0.0f), color, Gfx::Color(), Math::Point(0.0f, 0.0f));
- vertex[1] = Gfx::VertexCol(Math::Vector(p1.x, p2.y, 0.0f), color, Gfx::Color(), Math::Point(0.0f, 0.0f));
- vertex[2] = Gfx::VertexCol(Math::Vector(p2.x, p1.y, 0.0f), color, Gfx::Color(), Math::Point(0.0f, 0.0f));
- vertex[3] = Gfx::VertexCol(Math::Vector(p2.x, p2.y, 0.0f), color, Gfx::Color(), Math::Point(0.0f, 0.0f));
+ vertex[0] = Gfx::VertexCol(Math::Vector(p1.x, p1.y, 0.0f), color);
+ vertex[1] = Gfx::VertexCol(Math::Vector(p1.x, p2.y, 0.0f), color);
+ vertex[2] = Gfx::VertexCol(Math::Vector(p2.x, p1.y, 0.0f), color);
+ vertex[3] = Gfx::VertexCol(Math::Vector(p2.x, p2.y, 0.0f), color);
device = m_engine->GetDevice();
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);