[colobot] 20/390: Merge branch 'dev' into dev-physfs
Didier Raboud
odyx at moszumanska.debian.org
Fri Jun 12 14:21:23 UTC 2015
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch upstream/latest
in repository colobot.
commit 96d49d84aafecd78c902681f20de6207badf7e85
Merge: 5223ef1 8522232
Author: krzys-h <krzys_h at interia.pl>
Date: Fri Jul 11 15:24:44 2014 +0200
Merge branch 'dev' into dev-physfs
Conflicts:
data
src/app/gamedata.cpp
src/ui/control.cpp
src/ui/edit.cpp
src/ui/maindialog.cpp
CMakeLists.txt | 4 +-
data | 2 +-
po/colobot.pot | 34 +-
po/de.po | 2384 ++++++++++++++++----------------
po/fr.po | 2380 ++++++++++++++++----------------
po/pl.po | 2439 +++++++++++++++++----------------
po/ru.po | 2401 ++++++++++++++++----------------
src/common/event.cpp | 2 -
src/common/event.h | 2 -
src/common/image.cpp | 41 +
src/common/image.h | 6 +
src/common/misc.cpp | 18 -
src/common/restext.cpp | 4 -
src/common/restext.h | 2 -
src/graphics/core/device.h | 3 +
src/graphics/core/vertex.h | 4 +-
src/graphics/engine/camera.cpp | 3 -
src/graphics/engine/engine.cpp | 17 +-
src/graphics/opengl/gldevice.cpp | 13 +
src/graphics/opengl/gldevice.h | 2 +
src/object/auto/autobase.cpp | 4 -
src/object/brain.cpp | 20 -
src/object/robotmain.cpp | 69 -
src/object/robotmain.h | 1 -
src/object/task/taskterraform.cpp | 23 -
src/physics/physics.cpp | 16 +-
src/script/script.cpp | 22 +-
src/ui/color.cpp | 34 +-
src/ui/control.cpp | 4 -
src/ui/displayinfo.cpp | 6 -
src/ui/edit.cpp | 4 -
src/ui/maindialog.cpp | 377 +----
src/ui/studio.cpp | 16 -
src/ui/window.cpp | 3 -
test/envs/opengl/light_test.cpp | 4 +-
test/envs/opengl/transform_test.cpp | 4 +-
test/unit/graphics/core/device_mock.h | 2 +
test/unit/ui/edit_test.cpp | 20 +-
test/unit/ui/stubs/app_stub.cpp | 10 -
39 files changed, 5019 insertions(+), 5381 deletions(-)
diff --cc data
index aa3b09f,d9ad327..bacf4c9
--- a/data
+++ b/data
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit aa3b09f4dfbc0d6fae888f528dae724e8fbedf31
-Subproject commit d9ad3270af60905f53929cdf44aa47b4f910f603
++Subproject commit bacf4c9dac9efc817907ab4e172231d3396a421d
diff --cc src/common/image.cpp
index 9916c8f,e3d1ef7..dd905a7
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@@ -428,3 -418,44 +428,44 @@@ bool CImage::SavePNG(const std::string
return true;
}
+ void CImage::SetDataPixels(void *pixels){
+
+ Uint8* srcPixels = static_cast<Uint8*> (pixels);
+ Uint8* resultPixels = static_cast<Uint8*> (m_data->surface->pixels);
+
+ Uint32 pitch = m_data->surface->pitch;
+
+ for(int line = 0; line < m_data->surface->h; ++line) {
+ Uint32 pos = line * pitch;
+ memcpy(&resultPixels[pos], &srcPixels[pos], pitch);
+ }
+ }
+
+ void CImage::flipVertically(){
+
+ SDL_Surface* result = SDL_CreateRGBSurface( m_data->surface->flags,
+ m_data->surface->w,
+ m_data->surface->h,
+ m_data->surface->format->BytesPerPixel * 8,
+ m_data->surface->format->Rmask,
+ m_data->surface->format->Gmask,
+ m_data->surface->format->Bmask,
+ m_data->surface->format->Amask);
+
+ assert(result != nullptr);
+
+ Uint8* srcPixels = static_cast<Uint8*> (m_data->surface->pixels);
+ Uint8* resultPixels = static_cast<Uint8*> (result->pixels);
+
+ Uint32 pitch = m_data->surface->pitch;
+ Uint32 pxLength = pitch*m_data->surface->h;
+
+ for(int line = 0; line < m_data->surface->h; ++line) {
+ Uint32 pos = line * pitch;
+ memcpy(&resultPixels[pos], &srcPixels[(pxLength-pos)-pitch], pitch);
+ }
+
+ SDL_FreeSurface(m_data->surface);
+
+ m_data->surface = result;
-}
++}
diff --cc src/ui/color.cpp
index 00af8a5,d1dc746..57e78d5
--- a/src/ui/color.cpp
+++ b/src/ui/color.cpp
@@@ -138,41 -138,10 +138,10 @@@ void CColor::Draw(
DrawShadow(m_pos, m_dim);
}
- m_engine->SetTexture("button1.png");
+ m_engine->SetTexture("interface/button1.png");
m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
CControl::Draw();
-
- #if _TEEN
- // color = GetColor(m_color);
- color = GetColor();
-
- m_engine->SetTexture(""); // no texture
- m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
-
- device = m_engine->GetDevice();
-
- p1.x = m_pos.x + (4.0f / 640.0f);
- p1.y = m_pos.y + (4.0f / 480.0f);
- p2.x = m_pos.x + m_dim.x - (4.0f / 640.0f);
- p2.y = m_pos.y + m_dim.y - (4.0f / 480.0f);
- vertex[0] = Gfx::Vertex(Math::Vector(p1.x, p1.y, 0.0f), 0x00000000,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[1] = Gfx::Vertex(Math::Vector(p1.x, p2.y, 0.0f), 0x00000000,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[2] = Gfx::Vertex(Math::Vector(p2.x, p1.y, 0.0f), 0x00000000,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[3] = Gfx::Vertex(Math::Vector(p2.x, p2.y, 0.0f), 0x00000000,0x00000000, Math::Point( 0.0f, 0.0f));
- device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
-
- p1.x = m_pos.x + (5.0f / 640.0f);
- p1.y = m_pos.y + (5.0f / 480.0f);
- p2.x = m_pos.x + m_dim.x - (5.0f / 640.0f);
- p2.y = m_pos.y + m_dim.y - (5.0f / 480.0f);
- vertex[0] = Gfx::Vertex(Math::Vector(p1.x, p1.y, 0.0f), color,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[1] = Gfx::Vertex(Math::Vector(p1.x, p2.y, 0.0f), color,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[2] = Gfx::Vertex(Math::Vector(p2.x, p1.y, 0.0f), color,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[3] = Gfx::Vertex(Math::Vector(p2.x, p2.y, 0.0f), color,0x00000000, Math::Point( 0.0f, 0.0f));
- device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
-
- m_engine->AddStatisticTriangle(4);
- #else
+
p1.x = m_pos.x + (3.0f / 640.0f);
p1.y = m_pos.y + (3.0f / 480.0f);
p2.x = m_pos.x + m_dim.x - (3.0f / 640.0f);
diff --cc src/ui/control.cpp
index 1eff38c,4e64ee9..6686c55
--- a/src/ui/control.cpp
+++ b/src/ui/control.cpp
@@@ -506,11 -506,7 +506,7 @@@ void CControl::Draw(
if ( icon >= 192 )
{
icon -= 192;
- #if _POLISH
- m_engine->SetTexture("interface/textp.png");
- #else
- m_engine->SetTexture("text.png");
+ m_engine->SetTexture("interface/text.png");
- #endif
m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE);
}
else if ( icon >= 128 )
diff --cc src/ui/edit.cpp
index fb2fcb4,e2df62b..f9b7837
--- a/src/ui/edit.cpp
+++ b/src/ui/edit.cpp
@@@ -1225,11 -1225,7 +1225,7 @@@ void CEdit::DrawPart(Math::Point pos, M
Math::Point uv1, uv2;
float dp;
- #if _POLISH
- m_engine->SetTexture("interface/textp.png");
- #else
- m_engine->SetTexture("text.png");
+ m_engine->SetTexture("interface/text.png");
- #endif
m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
uv1.x = (16.0f/256.0f)*(icon%16);
diff --cc src/ui/maindialog.cpp
index dffa424,39e7aa9..fd6cd2e
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@@ -789,11 -718,10 +719,10 @@@ void CMainDialog::ChangePhase(Phase pha
m_accessChap = GetChapPassed();
}
- if ( m_phase == PHASE_TRAINER ) strcpy(m_sceneName, "train");
- if ( m_phase == PHASE_DEFI ) strcpy(m_sceneName, "defi" );
- if ( m_phase == PHASE_MISSION ) strcpy(m_sceneName, "scene");
- if ( m_phase == PHASE_FREE ) strcpy(m_sceneName, "free");
+ if ( m_phase == PHASE_TRAINER ) strcpy(m_sceneName, "exercises");
+ if ( m_phase == PHASE_DEFI ) strcpy(m_sceneName, "challenges" );
+ if ( m_phase == PHASE_MISSION ) strcpy(m_sceneName, "missions");
+ if ( m_phase == PHASE_FREE ) strcpy(m_sceneName, "freemissions");
- if ( m_phase == PHASE_TEEN ) strcpy(m_sceneName, "teen");
if ( m_phase == PHASE_USER ) strcpy(m_sceneName, "user");
ReadGamerInfo();
@@@ -1924,9 -1661,8 +1662,8 @@@
ddim.y = 30.0f/480.0f;
pb = pw->CreateButton(pos, ddim, 49, EVENT_INTERFACE_ABORT);
pb->SetState(STATE_SHADOW);
- // #endif
- m_engine->SetBackground("generico.png",
+ m_engine->SetBackground("interface/generico.png",
Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f),
Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f),
Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f),
@@@ -4876,26 -4563,9 +4588,11 @@@ void CMainDialog::UpdateSceneList(int c
for ( j=0 ; j<99 ; j++ )
{
- /* TODO: #if _SCHOOL
- if ( m_phase == PHASE_MISSION ) break;
- if ( m_phase == PHASE_FREE ) break;
- #if _CEEBOTDEMO
- #if _TEEN
- if ( m_phase == PHASE_TRAINER && j >= 5 ) break;
- #else
- if ( m_phase == PHASE_TRAINER && j >= 3 ) break;
- #endif
- #endif
- #endif
- #if _DEMO
- if ( m_phase == PHASE_MISSION && j >= 3 ) break;
- if ( m_phase == PHASE_TRAINER && j >= 5 ) break;
- #endif */
BuildSceneName(fileName, m_sceneName, (chap+1)*100+(j+1));
- file = fopen(fileName.c_str(), "r");
- if ( file == NULL ) break;
+
+ CInputStream stream;
+ stream.open(fileName);
+ if (!stream.is_open()) break;
BuildResumeName(name, m_sceneName, j+1); // default name
sprintf(op, "Title.E");
@@@ -4936,17 -4606,8 +4633,9 @@@
j ++;
break;
}
-
- /* TODO: #if _TEEN
- if ( m_phase == PHASE_TRAINER && !m_main->GetShowAll() && !bPassed )
- {
- j ++;
- break;
- }
- #endif*/
}
+ /* TODO: ?????
BuildSceneName(fileName, m_sceneName, (chap+1)*100+(j+1));
file = fopen(fileName.c_str(), "r");
if ( file == NULL )
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list