You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-23 18:15:02
|
Module: performous
Branch: master
Commit: f72c6ce6211284a999f32f48c974fcbcd72b8c87
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Dec 23 20:14:47 2009 +0200
Avoid crash when non-fret buttons are pressed on guitar/drums (needs testing).
---
game/guitargraph.cc | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 5a8e814..790121c 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -252,7 +252,7 @@ void GuitarGraph::activateStarpower() {
/// Mark the holding of a note as ended
void GuitarGraph::endHold(int fret, double time) {
- if (!m_holds[fret]) return;
+ if (fret >= 5 || !m_holds[fret]) return;
m_events[m_holds[fret] - 1].glow.setTarget(0.0);
m_events[m_holds[fret] - 1].whammy.setTarget(0.0, true);
m_holds[fret] = 0;
@@ -286,6 +286,7 @@ void GuitarGraph::fail(double time, int fret) {
/// Handle drum hit scoring
void GuitarGraph::drumHit(double time, int fret) {
+ if (fret >= 5) return;
// Find any suitable note within the tolerance
double tolerance = maxTolerance;
Chords::iterator best = m_chords.end();
@@ -335,6 +336,7 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
frets[fret] = ev.pressed[fret];
}
} else { // Attempt to tap
+ if (ev.button >= 5) return;
if (m_correctness.get() < 0.5 && m_starpower.get() < 0.001) return; // Hammering not possible at the moment
for (int fret = ev.button + 1; fret < 5; ++fret) {
if (ev.pressed[fret]) return; // Extra buttons on right side
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-23 18:14:58
|
Module: performous
Branch: master
Commit: 553e02b66b580ce18a9243fcb40adae4924b3d91
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Dec 23 19:39:07 2009 +0200
Fix preprocessor directive indentation, add FIXMEs
---
game/screen_sing.cc | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index aa0e027..aecdbfb 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -124,9 +124,9 @@ void ScreenSing::instrumentLayout(double time) {
}
if (time < -0.5) {
glColor4f(1.0f, 1.0f, 1.0f, clamp(-1.0 - 2.0 * time));
- #ifndef _WIN32
+#ifndef _WIN32 // FIXME
m_help->draw();
- #endif
+#endif
glColor3f(1.0f, 1.0f, 1.0f);
}
// Set volume levels (averages of all instruments playing that track)
@@ -159,9 +159,9 @@ void ScreenSing::danceLayout(double time) {
}
if (time < -0.5) {
glColor4f(1.0f, 1.0f, 1.0f, clamp(-1.0 - 2.0 * time));
- #ifndef _WIN32
+#ifndef _WIN32 // FIXME
m_help->draw();
- #endif
+#endif
glColor3f(1.0f, 1.0f, 1.0f);
}
}
@@ -172,7 +172,7 @@ void ScreenSing::exit() {
m_dancers.clear();
m_layout_singer.reset();
m_engine.reset();
-#ifndef _WIN32
+#ifndef _WIN32 // FIXME
m_help.reset();
#endif
m_pause_icon.reset();
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-23 11:13:07
|
Module: performous
Branch: master
Commit: 50f7d8fe38eb16975236550a65998c117b368ee4
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Dec 23 13:12:54 2009 +0200
Fix non-integer and duplicate TS BPM handling. This allows more songs to load and fixes sync issues with a lot of songs.
---
game/songparser.hh | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/game/songparser.hh b/game/songparser.hh
index 02372bc..1e05a05 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -107,19 +107,22 @@ class SongParser {
double m_maxScore;
std::vector<std::pair<double,double> > m_stops;
struct BPM {
- BPM(double _begin, unsigned int _ts, double bpm): begin(_begin), step(0.25 * 60.0 / bpm), ts(_ts) {}
+ BPM(double _begin, double _ts, double bpm): begin(_begin), step(0.25 * 60.0 / bpm), ts(_ts) {}
double begin; // Time in seconds
double step; // Seconds per quarter note
- unsigned int ts;
+ double ts;
};
typedef std::vector<BPM> bpms_t;
bpms_t m_bpms;
- void addBPM(unsigned int ts, double bpm) {
- if (!m_bpms.empty() && m_bpms.back().ts >= ts) throw std::runtime_error("Invalid BPM timestamp");
+ void addBPM(double ts, double bpm) {
if (!(bpm >= 1.0 && bpm < 1e12)) throw std::runtime_error("Invalid BPM value");
+ if (!m_bpms.empty() && m_bpms.back().ts >= ts) {
+ if (m_bpms.back().ts < ts) throw std::runtime_error("Invalid BPM timestamp");
+ m_bpms.pop_back(); // Some ITG songs contain repeated BPM definitions...
+ }
m_bpms.push_back(BPM(tsTime(ts), ts, bpm));
}
- double tsTime(unsigned int ts) const {
+ double tsTime(double ts) const {
if (m_bpms.empty()) {
if (ts != 0) throw std::runtime_error("BPM data missing");
return m_gap;
|
|
From: Stefano A. <xa...@us...> - 2009-12-23 07:21:27
|
Module: performous
Branch: master
Commit: bc69c429eaf1eaad468f68fe5ea7a6d4dc43f180
Author: Xaldyz <xa...@us...>
Date: Wed Dec 23 08:21:06 2009 +0100
Added automatic version numeric to rc file (if enabled). Extract the most-right numeric value by version that's comma or dot separated (only Windows)
---
CMakeLists.txt | 3 +++
game/CMakeLists.txt | 35 +++++++++++++++++++++++++++++++++++
win32/performous.cmake.rc | 6 +++---
3 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e89b173..00e61e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,3 +64,6 @@ if (ENABLE_TOOLS)
add_subdirectory(tools)
endif (ENABLE_TOOLS)
+if(WIN32)
+ option(ENABLE_VERSIONING "Add number version information. This allows to add version information to exe. Be carefull, in beta (and a lot useless)" OFF)
+endif(WIN32)
\ No newline at end of file
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index bf08bf2..52d50a6 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -4,6 +4,41 @@ FILE(GLOB SOURCE_FILES "*.cc")
FILE(GLOB HEADER_FILES "*.hh")
if(WIN32)
+ if(ENABLE_VERSIONING)
+ set(COMMENTS)
+ string(REGEX MATCHALL "([^\\.,^$]+)(\\.|,|$)" VERSIONING ${PROJECT_VERSION})
+ set(VERSIONS "MAJOR" "MINOR" "PATCH" "TWEAK")
+ foreach(s ${VERSIONING})
+ #we get the most-right number
+ string(REGEX REPLACE "[^0-9]+$" "" s ${s})#removes most right part non-numeric (like .)
+ #now we have a string in format <numbers-letters..........numbers>
+ #take last numbers (if there are)
+ #if string not empty, there are some numbers in right of string
+ #otherwise, set a 0, to be sure that there's a number
+ if(s STREQUAL "")
+ set(s "0")
+ endif()
+ string(REGEX MATCH "[0-9]*$" s ${s})
+
+ foreach(v ${VERSIONS})
+ if(NOT VERSION_${v}_DONE)
+ set(VERSION_${v}_DONE 1)
+ set(VERSION_${v} "${s}")
+ break()
+ endif()
+ endforeach()
+ endforeach()
+
+ foreach(v ${VERSIONS})
+ if(NOT VERSION_${v}_DONE OR VERSION_${v} STREQUAL "") #For the substitution did before, in VERSION_${v} we have or a empty string (if all letters) or a number
+ set(VERSION_${v} "0")
+ endif()
+ endforeach()
+ message(STATUS "Setting .exe version: ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_TWEAK}")
+ else(ENABLE_VERSIONING)
+ set(COMMENTS "//")
+ endif(ENABLE_VERSIONING)
+
set(RESOURCE_FILES "${CMAKE_BINARY_DIR}/performous.rc")
set(RESOURCE_OBJECT)#nothing
diff --git a/win32/performous.cmake.rc b/win32/performous.cmake.rc
index 102d54b..80fc79c 100644
--- a/win32/performous.cmake.rc
+++ b/win32/performous.cmake.rc
@@ -3,11 +3,11 @@
LANGUAGE 9, 1
-1 ICON "${CMAKE_SOURCE_DIR}/win32/performous.ico"
+1 ICON "@CMAKE_SOURCE_DIR@/win32/performous.ico"
VS_VERSION_INFO VERSIONINFO
- //FILEVERSION 0, 4, 0, 0
- //PRODUCTVERSION 0, 4, 0, 0
+@COMMENTS@ FILEVERSION @VERSION_MAJOR@, @VERSION_MINOR@, @VERSION_PATCH@, @VERSION_TWEAK@
+@COMMENTS@ PRODUCTVERSION @VERSION_MAJOR@, @VERSION_MINOR@, @VERSION_PATCH@, @VERSION_TWEAK@
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
|
|
From: John S. <jst...@us...> - 2009-12-23 06:33:46
|
Module: performous
Branch: master
Commit: bd1eca7ada0c822866da874e8142e2ccaed68518
Author: John Stumpo <st...@js...>
Date: Wed Dec 23 00:17:57 2009 -0500
Remove calls to IMG_Init and IMG_Quit, which are unnecessary when SDL_image is linked directly to the libraries it uses.
(Also, older versions of SDL_image lack them, including the version in Ubuntu.)
---
game/surface.cc | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/game/surface.cc b/game/surface.cc
index 476c273..a72f769 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -91,9 +91,7 @@ template <typename T> void loader(T& target, std::string filename, bool autocrop
rsvg_term();
} else {
#ifdef LESS_MAGIC
- IMG_Init(0);
SDL_Surface* imgsurf = IMG_Load(filename.c_str());
- IMG_Quit();
if (imgsurf == NULL) {
throw std::runtime_error("Unable to load " + filename + ": " + IMG_GetError());
}
|
|
From: John S. <jst...@us...> - 2009-12-23 06:33:46
|
Module: performous
Branch: master
Commit: ae3c8488b6464ed17c49d6581b0747cb202aff32
Author: John Stumpo <st...@js...>
Date: Wed Dec 23 00:52:31 2009 -0500
Fix a warning in the TGA screenshot saving code.
---
game/video_driver.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index e65d1bd..d4f7b43 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -102,7 +102,7 @@ void Window::screenshot() {
tgaout << static_cast<char>(height >> 8);
tgaout << static_cast<char>(24); /* bits per pixel */
tgaout << static_cast<char>(0x00); /* no special flags */
- for (int i = 0; i < width*height*3; i += 3)
+ for (unsigned i = 0; i < width*height*3; i += 3)
std::swap(buffer[i], buffer[i+2]); /* fix the channel order */
tgaout.write(&buffer[0], width*height*3); /* dump the image data */
tgaout.close();
|
|
From: John S. <jst...@us...> - 2009-12-23 06:33:45
|
Module: performous Branch: master Commit: d9116b0d31b2627a26ef537bb81c5cc5cf2e516b Author: John Stumpo <st...@js...> Date: Wed Dec 23 00:17:57 2009 -0500 Add a FindSDL_image.cmake. --- cmake/Modules/FindSDL_image.cmake | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/cmake/Modules/FindSDL_image.cmake b/cmake/Modules/FindSDL_image.cmake new file mode 100644 index 0000000..34e7011 --- /dev/null +++ b/cmake/Modules/FindSDL_image.cmake @@ -0,0 +1,29 @@ +# - Try to find SDL_image +# Once done, this will define +# +# SDL_image_FOUND - system has SDL_image +# SDL_image_INCLUDE_DIRS - the SDL include directories +# SDL_image_LIBRARIES - link these to use SDL_image +# +# See documentation on how to write CMake scripts at +# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries + +include(LibFindMacros) + +libfind_pkg_check_modules(SDL_image_PKGCONF sdl) + +find_path(SDL_image_INCLUDE_DIR + NAMES SDL_image.h + PATH_SUFFIXES SDL + HINTS ${SDL_PKGCONF_INCLUDE_DIRS} +) + +find_library(SDL_image_LIBRARY + NAMES SDL_image + HINTS ${SDL_PKGCONF_LIBRARY_DIRS} +) + +set(SDL_image_PROCESS_INCLUDES SDL_image_INCLUDE_DIR) +set(SDL_image_PROCESS_LIBS SDL_image_LIBRARY) +libfind_process(SDL_image) + |
|
From: John S. <jst...@us...> - 2009-12-23 06:33:45
|
Module: performous
Branch: master
Commit: 3f2b0c4ab1b876a9fdd38906b7e9ccbff51e0469
Author: John Stumpo <st...@js...>
Date: Wed Dec 23 00:17:58 2009 -0500
Don't require Magick++ to be present if SDL_image is present.
---
game/CMakeLists.txt | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index a7f51ab..bf08bf2 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -44,7 +44,7 @@ else()
endif()
# Find all the libs that don't require extra parameters
-foreach(lib ${OUR_LIBS} SDL PangoCairo LibRSVG LibXML++ Magick++ GLEW AVFormat SWScale OpenGL Z Jpeg Tiff Png)
+foreach(lib ${OUR_LIBS} SDL PangoCairo LibRSVG LibXML++ GLEW AVFormat SWScale OpenGL Z Jpeg Tiff Png)
find_package(${lib} REQUIRED)
include_directories(${${lib}_INCLUDE_DIRS})
list(APPEND LIBS ${${lib}_LIBRARIES})
@@ -79,6 +79,10 @@ if(SDL_image_FOUND)
message(STATUS "SDL_image: found, enabling replacements for Magick++ code")
else()
message(STATUS "SDL_image: not found, falling back to Magick++")
+ find_package(Magick++ REQUIRED)
+ include_directories(${Magick++_INCLUDE_DIRS})
+ list(APPEND LIBS ${Magick++_LIBRARIES})
+ add_definitions(${Magick++_DEFINITIONS})
endif()
# Set default compile flags for GCC
|
|
From: John S. <jst...@us...> - 2009-12-23 05:59:55
|
Module: performous
Branch: master
Commit: 880be96cea05a3c985719354363d1a1079e9b647
Author: John Stumpo <st...@js...>
Date: Wed Dec 23 00:17:58 2009 -0500
Fix a slight mis-merge in the screenshot code.
---
game/video_driver.cc | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 7ecdffa..e65d1bd 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -119,9 +119,6 @@ void Window::screenshot() {
image.flip();
image.write(fnstr.str().c_str());
#endif
- char filename[256];
- sprintf(filename,"/tmp/performous_screenshot_%u.png",count);
- image.write(filename);
count++;
}
|
|
From: John S. <jst...@us...> - 2009-12-23 05:59:33
|
Module: performous
Branch: master
Commit: e434b681c86d996b989adcc7df6321393178b754
Author: John Stumpo <st...@js...>
Date: Wed Dec 23 00:17:57 2009 -0500
Blit the surface returned by SDL_image onto an RGBA surface so we know it is in the right format to be loaded into a texture.
---
game/surface.cc | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/game/surface.cc b/game/surface.cc
index aa09180..476c273 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -97,14 +97,22 @@ template <typename T> void loader(T& target, std::string filename, bool autocrop
if (imgsurf == NULL) {
throw std::runtime_error("Unable to load " + filename + ": " + IMG_GetError());
}
- // TODO: blit to a new RGBA surface to ensure it actually *is* RGBA
- try {
- target.load(imgsurf->w, imgsurf->h, pix::CHAR_RGBA, reinterpret_cast<const unsigned char*>(imgsurf->pixels));
- SDL_FreeSurface(imgsurf);
- } catch (...) {
+ // Copy the image to an RGBA surface to ensure that it is indeed RGBA.
+ SDL_Surface* rgbasurf = SDL_CreateRGBSurface(SDL_SWSURFACE, imgsurf->w, imgsurf->h, 32,
+#if SDL_BYTEORDER == SDL_BIGENDIAN
+ 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff
+#else
+ 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
+#endif
+ );
+ if (rgbasurf == NULL) {
SDL_FreeSurface(imgsurf);
- throw;
+ throw std::runtime_error(std::string("Unable to allocate image surface: ") + IMG_GetError());
}
+ SDL_BlitSurface(imgsurf, NULL, rgbasurf, NULL);
+ SDL_FreeSurface(imgsurf);
+ target.load(rgbasurf->w, rgbasurf->h, pix::CHAR_RGBA, reinterpret_cast<const unsigned char*>(rgbasurf->pixels));
+ SDL_FreeSurface(rgbasurf);
#else
Magick::Image image;
Magick::Blob blob;
|
|
From: Stefano A. <xa...@us...> - 2009-12-22 22:51:18
|
Module: performous
Branch: master
Commit: 0a26c90e3bf7614a99d96cf6c5f25519af181e70
Author: Xaldyz <xa...@us...>
Date: Tue Dec 22 23:51:05 2009 +0100
Added support to adding icon executable for Windows
Modified rc file so it can set directly by CMake
---
game/CMakeLists.txt | 25 +++++++++++++++++++------
win32/performous.cmake.rc | 34 ++++++++++++++++++++++++++++++++++
win32/performous.rc | 36 ------------------------------------
3 files changed, 53 insertions(+), 42 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index e4aae15..a7f51ab 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -4,14 +4,27 @@ FILE(GLOB SOURCE_FILES "*.cc")
FILE(GLOB HEADER_FILES "*.hh")
if(WIN32)
- if(MSVC)
- set(RESOURCE_FILES ../win32/performous.rc)
- else()
- # mingw32 - TODO
- set(RESOURCE_FILES) #nothing
+ set(RESOURCE_FILES "${CMAKE_BINARY_DIR}/performous.rc")
+ set(RESOURCE_OBJECT)#nothing
+
+ configure_file("../win32/performous.cmake.rc" "${RESOURCE_FILES}")
+ if(NOT MSVC)
+ #in according to MinGW tools, we need to compile the rc file, and then link it into projects:
+ #windres foo.rc foores.o
+ #gcc -o foo.exe foo.o foores.o
+ find_program(WINDRES windres)
+ if(NOT WINDRES)
+ message(STATUS "Cannot find windres. Will not create a versioned exe")
+ set(RESOURCE_FILES)
+ set(RESOURCE_OBJECT)
+ else()
+ set(RESOURCE_OBJECT "${CMAKE_BINARY_DIR}/performous.rc.o")
+ execute_process(COMMAND "${WINDRES}" "${RESOURCE_FILES}" "${RESOURCE_OBJECT}")
+ endif(NOT WINDRES)
endif()
else()
set(RESOURCE_FILES) #nothing
+ set(RESOURCE_OBJECT)#nothing
endif()
set(SOURCES ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES})
@@ -77,7 +90,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions("-D__STDC_CONSTANT_MACROS")
endif(CMAKE_COMPILER_IS_GNUCXX)
-add_executable(performous ${SOURCES} ${SDL_SOURCES})
+add_executable(performous ${SOURCES} ${SDL_SOURCES} ${RESOURCE_OBJECT})
target_link_libraries(performous ${LIBS})
# Store library paths in executable
diff --git a/win32/performous.cmake.rc b/win32/performous.cmake.rc
new file mode 100644
index 0000000..102d54b
--- /dev/null
+++ b/win32/performous.cmake.rc
@@ -0,0 +1,34 @@
+#include <winuser.h>
+#include <winver.h>
+
+LANGUAGE 9, 1
+
+1 ICON "${CMAKE_SOURCE_DIR}/win32/performous.ico"
+
+VS_VERSION_INFO VERSIONINFO
+ //FILEVERSION 0, 4, 0, 0
+ //PRODUCTVERSION 0, 4, 0, 0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEOS VOS_NT_WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "@CMAKE_PROJECT_NAME@ Developers"
+ VALUE "FileDescription", "@CMAKE_PROJECT_NAME@ Game"
+ VALUE "FileVersion", "@PROJECT_VERSION@"
+ VALUE "InternalName", "performous.exe"
+ VALUE "LegalCopyright", "Copyright © 2009 @CMAKE_PROJECT_NAME@ Team - GNU GPL v2 or later"
+ VALUE "OriginalFilename", "performous.exe"
+ VALUE "ProductName", "@CMAKE_PROJECT_NAME@"
+ VALUE "ProductVersion", "@PROJECT_VERSION@"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/win32/performous.rc b/win32/performous.rc
deleted file mode 100644
index 8f4b90d..0000000
--- a/win32/performous.rc
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <winuser.h>
-#include <winver.h>
-
-#include "config.hh"
-
-LANGUAGE 9, 1
-
-1 ICON "performous.ico"
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0, 4, 0, 0
- PRODUCTVERSION 0, 4, 0, 0
- FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
- FILEOS VOS_NT_WINDOWS32
- FILETYPE VFT_APP
- FILESUBTYPE VFT2_UNKNOWN
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", PACKAGE " Developers"
- VALUE "FileDescription", PACKAGE " Game"
- VALUE "FileVersion", VERSION
- VALUE "InternalName", "performous.exe"
- VALUE "LegalCopyright", "Copyright © 2009 " PACKAGE " Team - GNU GPL v2 or later"
- VALUE "OriginalFilename", "performous.exe"
- VALUE "ProductName", PACKAGE
- VALUE "ProductVersion", VERSION
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
|
|
From: John S. <jst...@us...> - 2009-12-22 21:23:46
|
Module: performous
Branch: master
Commit: de45455289043f50c8ad14f2d140e3807eb6e674
Author: John Stumpo <st...@js...>
Date: Tue Dec 22 19:19:42 2009 -0500
Add a Windows icon and version info when built under MSVC. This should not be overly hard to get working under MinGW as well.
---
game/CMakeLists.txt | 13 ++++++++++++-
win32/performous.ico | Bin 0 -> 264520 bytes
win32/performous.rc | 36 ++++++++++++++++++++++++++++++++++++
3 files changed, 48 insertions(+), 1 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 0b58bf3..e4aae15 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -3,7 +3,18 @@ cmake_minimum_required(VERSION 2.6)
FILE(GLOB SOURCE_FILES "*.cc")
FILE(GLOB HEADER_FILES "*.hh")
-set(SOURCES ${SOURCE_FILES} ${HEADER_FILES})
+if(WIN32)
+ if(MSVC)
+ set(RESOURCE_FILES ../win32/performous.rc)
+ else()
+ # mingw32 - TODO
+ set(RESOURCE_FILES) #nothing
+ endif()
+else()
+ set(RESOURCE_FILES) #nothing
+endif()
+
+set(SOURCES ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES})
# Libraries
diff --git a/win32/performous.ico b/win32/performous.ico
new file mode 100644
index 0000000..2f52ed6
Binary files /dev/null and b/win32/performous.ico differ
diff --git a/win32/performous.rc b/win32/performous.rc
new file mode 100644
index 0000000..8f4b90d
--- /dev/null
+++ b/win32/performous.rc
@@ -0,0 +1,36 @@
+#include <winuser.h>
+#include <winver.h>
+
+#include "config.hh"
+
+LANGUAGE 9, 1
+
+1 ICON "performous.ico"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 0, 4, 0, 0
+ PRODUCTVERSION 0, 4, 0, 0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEOS VOS_NT_WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", PACKAGE " Developers"
+ VALUE "FileDescription", PACKAGE " Game"
+ VALUE "FileVersion", VERSION
+ VALUE "InternalName", "performous.exe"
+ VALUE "LegalCopyright", "Copyright © 2009 " PACKAGE " Team - GNU GPL v2 or later"
+ VALUE "OriginalFilename", "performous.exe"
+ VALUE "ProductName", PACKAGE
+ VALUE "ProductVersion", VERSION
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
|
|
From: Stefano A. <xa...@us...> - 2009-12-22 20:58:15
|
Module: performous
Branch: master
Commit: e26d63a8be53076bcb104926793a3e502c430e66
Author: Xaldyz <xa...@us...>
Date: Tue Dec 22 21:57:59 2009 +0100
Added stump hacking to switch from Magick++ to SDL_Image (if this one is found)
---
game/CMakeLists.txt | 10 ++++++++
game/surface.cc | 26 ++++++++++++++++++++-
game/video_driver.cc | 59 ++++++++++++++++++++++++++++++++++++++++++++-----
3 files changed, 87 insertions(+), 8 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 7c411c9..0b58bf3 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -47,6 +47,16 @@ else()
message(STATUS "MIDI I/O: Disabled (libportmidi not found)")
endif()
+find_package(SDL_image)
+if(SDL_image_FOUND)
+ include_directories(${SDL_image_INCLUDE_DIRS})
+ add_definitions(-DLESS_MAGIC) # ;)
+ list(APPEND LIBS ${SDL_image_LIBRARIES})
+ message(STATUS "SDL_image: found, enabling replacements for Magick++ code")
+else()
+ message(STATUS "SDL_image: not found, falling back to Magick++")
+endif()
+
# Set default compile flags for GCC
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
diff --git a/game/surface.cc b/game/surface.cc
index f46936f..aa09180 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -6,13 +6,18 @@
#include <librsvg/rsvg.h>
#include <librsvg/rsvg-cairo.h>
-#include <Magick++.h>
+#ifdef LESS_MAGIC
+ #include <SDL_image.h>
+#else
+ #include <Magick++.h>
+ using boost::uint32_t;
+#endif
#include <fstream>
#include <stdexcept>
#include <sstream>
#include <vector>
-using boost::uint32_t;
+
float Dimensions::screenY() const {
switch (m_screenAnchor) {
@@ -85,6 +90,22 @@ template <typename T> void loader(T& target, std::string filename, bool autocrop
gdk_pixbuf_unref(pb);
rsvg_term();
} else {
+ #ifdef LESS_MAGIC
+ IMG_Init(0);
+ SDL_Surface* imgsurf = IMG_Load(filename.c_str());
+ IMG_Quit();
+ if (imgsurf == NULL) {
+ throw std::runtime_error("Unable to load " + filename + ": " + IMG_GetError());
+ }
+ // TODO: blit to a new RGBA surface to ensure it actually *is* RGBA
+ try {
+ target.load(imgsurf->w, imgsurf->h, pix::CHAR_RGBA, reinterpret_cast<const unsigned char*>(imgsurf->pixels));
+ SDL_FreeSurface(imgsurf);
+ } catch (...) {
+ SDL_FreeSurface(imgsurf);
+ throw;
+ }
+ #else
Magick::Image image;
Magick::Blob blob;
try {
@@ -112,6 +133,7 @@ template <typename T> void loader(T& target, std::string filename, bool autocrop
{
throw std::runtime_error("Image Error");
}
+ #endif
}
}
diff --git a/game/video_driver.cc b/game/video_driver.cc
index ac6a69d..7ecdffa 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -7,7 +7,17 @@
#include "joystick.hh"
#include <SDL.h>
-#include <Magick++.h>
+#ifdef LESS_MAGIC
+ #include <sstream>
+ #include <fstream>
+#else
+ #include <Magick++.h>
+#endif
+
+#ifdef _WIN32
+ // for GetTempPathA
+ #include <windows.h>
+#endif
namespace {
unsigned s_width;
@@ -63,8 +73,42 @@ void Window::screenshot() {
std::vector<char> buffer(width*height*3);
glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, &buffer[0]);
+ std::ostringstream fnstr;
+#ifdef _WIN32
+ char tmppath[256];
+ GetTempPathA(256, tmppath); /* this includes a backslash at the end */
+ fnstr << tmppath;
+#else
+ fnstr << "/tmp/";
+#endif
+ fnstr << "performous_screenshot_" << count;
+#ifdef LESS_MAGIC
+ /* Write the image out as an uncompressed tga. */
+ fnstr << ".tga";
+ std::ofstream tgaout(fnstr.str().c_str(), std::ios::binary);
+ char tga_hdr_part1[] = {
+ 0x00, /* no identification field */
+ 0x00, /* no palette */
+ 0x02, /* 24-bit RGB */
+ 0x00, 0x00, 0x00, 0x00, 0x00, /* palette info (ignored) */
+ 0x00, 0x00, /* x-origin */
+ 0x00, 0x00, /* y-origin */
+ };
+ tgaout.write(tga_hdr_part1, sizeof(tga_hdr_part1));
+ /* two 16-bit little endian words for width and height */
+ tgaout << static_cast<char>(width & 0xff);
+ tgaout << static_cast<char>(width >> 8);
+ tgaout << static_cast<char>(height & 0xff);
+ tgaout << static_cast<char>(height >> 8);
+ tgaout << static_cast<char>(24); /* bits per pixel */
+ tgaout << static_cast<char>(0x00); /* no special flags */
+ for (int i = 0; i < width*height*3; i += 3)
+ std::swap(buffer[i], buffer[i+2]); /* fix the channel order */
+ tgaout.write(&buffer[0], width*height*3); /* dump the image data */
+ tgaout.close();
+#else
+ fnstr << ".png";
Magick::Blob blob( &buffer[0], width*height*3);
-
Magick::Image image;
char geometry[16];
sprintf(geometry,"%dx%d",width,height);
@@ -73,6 +117,8 @@ void Window::screenshot() {
image.magick( "RGB" );
image.read(blob);
image.flip();
+ image.write(fnstr.str().c_str());
+#endif
char filename[256];
sprintf(filename,"/tmp/performous_screenshot_%u.png",count);
image.write(filename);
@@ -119,14 +165,15 @@ void Window::resize() {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
float h = virtH();
- const float near = 1.5f; // This determines FOV: the value is your distance from the monitor (the unit being the width of the Performous window)
- const float far = 100.0f; // How far away can things be seen
+ // stump: under MSVC, near and far are #defined to nothing for compatibility with ancient code, hence the underscores.
+ const float near_ = 1.5f; // This determines FOV: the value is your distance from the monitor (the unit being the width of the Performous window)
+ const float far_ = 100.0f; // How far away can things be seen
// Set model-view matrix
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
const float f = 0.9f; // Avoid texture surface being exactly at the near plane (MacOSX fix)
- glFrustum(-0.5f * f, 0.5f * f, 0.5f * h * f, -0.5f * h * f, f * near, far);
- glTranslatef(0.0f, 0.0f, -near); // So that z = 0.0f is still on monitor surface
+ glFrustum(-0.5f * f, 0.5f * f, 0.5f * h * f, -0.5f * h * f, f * near_, far_);
+ glTranslatef(0.0f, 0.0f, -near_); // So that z = 0.0f is still on monitor surface
}
|
|
From: Stefano A. <xa...@us...> - 2009-12-22 18:19:25
|
Module: performous
Branch: master
Commit: d5c0df2f19449eae91eadfe217aa2a4fe996cd1f
Author: Xaldyz <xa...@us...>
Date: Tue Dec 22 19:19:04 2009 +0100
Added Cmake script to lang folder
Added italian language support
Added gettext model
---
lang/CMakeLists.txt | 8 ++++
lang/it.po | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++
lang/performous.pot | 90 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 193 insertions(+), 0 deletions(-)
diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt
new file mode 100644
index 0000000..5dcecef
--- /dev/null
+++ b/lang/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 2.6)
+file(GLOB LANGUAGES *.po)
+foreach(language ${LANGUAGES})
+ string(REGEX REPLACE "(.+(\\\\|/))+" "" language ${language})
+ string(REGEX REPLACE "\\.po$" "" language ${language})
+ execute_process(COMMAND ${MSGFMT} ${CMAKE_CURRENT_SOURCE_DIR}/${language}.po -o ${CMAKE_CURRENT_BINARY_DIR}/${language}.mo)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${language}.mo DESTINATION ${LOCALE_DIR}/${language}/LC_MESSAGES/${CMAKE_PROJECT_NAME}.mo)
+endforeach(language)
\ No newline at end of file
diff --git a/lang/it.po b/lang/it.po
new file mode 100644
index 0000000..c7783da
--- /dev/null
+++ b/lang/it.po
@@ -0,0 +1,95 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Performous\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-12-07 01:56+0100\n"
+"PO-Revision-Date: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _\n"
+"X-Poedit-Basepath: .\n"
+"Last-Translator: Xaldyz <xa...@us...>\n"
+"X-Poedit-SearchPath-0: ../game\n"
+
+#: ../game/screen_hiscore.cc:104
+msgid "Hiscore for "
+msgstr "Punteggi per "
+
+#: ../game/screen_intro.cc:9
+msgid "Perform"
+msgstr "Perform"
+
+#: ../game/screen_intro.cc:9
+msgid "Start performing!"
+msgstr "Start perform! (Comincia a cantare)"
+
+#: ../game/screen_intro.cc:10
+msgid "Practice"
+msgstr "Pratica"
+
+#: ../game/screen_intro.cc:10
+msgid "Check your skills or test the microphones"
+msgstr "Controlla la tua bravura! / Test microfono"
+
+#: ../game/screen_intro.cc:11
+msgid "Configure"
+msgstr "Configura"
+
+#: ../game/screen_intro.cc:11
+msgid "Configure game options"
+msgstr "Opzioni di configurazione gioco"
+
+#: ../game/screen_intro.cc:12
+msgid "Quit"
+msgstr "Esci"
+
+#: ../game/screen_intro.cc:12
+msgid "Leave the game"
+msgstr "Lascia il gioco"
+
+#: ../game/screen_intro.cc:19
+msgid "No playback devices could be used.\n"
+msgstr "Nessun dispositivo di riproduzione può essere usato.\n"
+
+#: ../game/screen_intro.cc:20
+msgid "No microphones found.\n"
+msgstr "Nessun microfono trovato.\n"
+
+#: ../game/screen_intro.cc:21
+msgid ""
+"\n"
+"Please configure some before playing."
+msgstr ""
+"\n"
+"Per favore entra in configurazione prima di giocare"
+
+#: ../game/screen_players.cc:110
+msgid "No players found!"
+msgstr "Nessun giocatore trovato!"
+
+#: ../game/screen_players.cc:111
+msgid "Enter a name to create a new player."
+msgstr "Inserisci un nome per creare un nuovo giocatore."
+
+#: ../game/screen_players.cc:113
+msgid "Press enter to create player!"
+msgstr "Premi invio per creare il giocatore!"
+
+#: ../game/screen_songs.cc:209
+msgid "No songs found!"
+msgstr "Nessuna canzone trovata!"
+
+#: ../game/screen_songs.cc:210
+msgid ""
+"Visit performous.org\n"
+"for free songs"
+msgstr ""
+"Visita performous.org\n"
+"per canzoni gratis"
+
+#: ../game/screen_songs.cc:212
+msgid "no songs match search"
+msgstr "nessuna canzone trovata"
+
diff --git a/lang/performous.pot b/lang/performous.pot
new file mode 100644
index 0000000..8a48f37
--- /dev/null
+++ b/lang/performous.pot
@@ -0,0 +1,90 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Performous\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-12-07 01:56+0100\n"
+"PO-Revision-Date: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-SearchPath-0: ../game\n"
+
+#: ../game/screen_hiscore.cc:104
+msgid "Hiscore for "
+msgstr ""
+
+#: ../game/screen_intro.cc:9
+msgid "Perform"
+msgstr ""
+
+#: ../game/screen_intro.cc:9
+msgid "Start performing!"
+msgstr ""
+
+#: ../game/screen_intro.cc:10
+msgid "Practice"
+msgstr ""
+
+#: ../game/screen_intro.cc:10
+msgid "Check your skills or test the microphones"
+msgstr ""
+
+#: ../game/screen_intro.cc:11
+msgid "Configure"
+msgstr ""
+
+#: ../game/screen_intro.cc:11
+msgid "Configure game options"
+msgstr ""
+
+#: ../game/screen_intro.cc:12
+msgid "Quit"
+msgstr ""
+
+#: ../game/screen_intro.cc:12
+msgid "Leave the game"
+msgstr ""
+
+#: ../game/screen_intro.cc:19
+msgid "No playback devices could be used.\n"
+msgstr ""
+
+#: ../game/screen_intro.cc:20
+msgid "No microphones found.\n"
+msgstr ""
+
+#: ../game/screen_intro.cc:21
+msgid ""
+"\n"
+"Please configure some before playing."
+msgstr ""
+
+#: ../game/screen_players.cc:110
+msgid "No players found!"
+msgstr ""
+
+#: ../game/screen_players.cc:111
+msgid "Enter a name to create a new player."
+msgstr ""
+
+#: ../game/screen_players.cc:113
+msgid "Press enter to create player!"
+msgstr ""
+
+#: ../game/screen_songs.cc:209
+msgid "No songs found!"
+msgstr ""
+
+#: ../game/screen_songs.cc:210
+msgid ""
+"Visit performous.org\n"
+"for free songs"
+msgstr ""
+
+#: ../game/screen_songs.cc:212
+msgid "no songs match search"
+msgstr ""
+
|
|
From: Stefano A. <xa...@us...> - 2009-12-22 18:02:52
|
Module: performous Branch: master Commit: 6c7eab8c97d4087957fcbcd484ab9b8af9443a14 Author: Xaldyz <xa...@us...> Date: Tue Dec 22 19:02:23 2009 +0100 Added CMake support to compile files needed by Gettext Added support to FindGettext to find conversion utility (from .po to .mo) Added Visual Studio library name for Magick and Magick++ libraries Added NSIS support under Windows (require that NSIS is in PATH) Fixed iterator to const_iterator on game/players.cc and game/songitems.cc Fixed some things to compiling under MSVC (using boost int format) Updated win32/msvc/install-msvc.sh to compile correctly --- CMakeLists.txt | 12 + cmake/Modules/FindBoost.cmake | 2 +- cmake/Modules/FindGettext.cmake | 6 + cmake/Modules/FindMagick++.cmake | 2 +- cmake/Modules/FindMagick.cmake | 2 +- cmake/performous-packaging.cmake | 16 ++ game/audio.hh | 1 + game/ffmpeg.hh | 3 +- game/midifile.hh | 3 + game/players.cc | 2 +- game/songitems.cc | 2 +- lang/README | 4 +- lang/it/LC_MESSAGES/performous.mo | Bin 1703 -> 0 bytes lang/it/LC_MESSAGES/performous.po | 96 --------- libs/plugin++/src/dll.cc | 2 +- tools/cmake/Modules/FindBoost.cmake | 402 ----------------------------------- win32/msvc/install-msvc.sh | 18 ++- 17 files changed, 61 insertions(+), 512 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-21 23:54:58
|
Module: performous
Branch: master
Commit: d4e55d6c4933bd3df1aeb49940da36202b9f1f6c
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Dec 22 01:54:44 2009 +0200
Add itg_pck to build
---
tools/CMakeLists.txt | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 16c32ee..7a1611e 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -6,7 +6,7 @@ find_package(Boost 1.34 REQUIRED COMPONENTS filesystem program_options)
include_directories(${Boost_INCLUDE_DIRS})
# Find all the libs that don't require extra parameters
-foreach(lib LibXML++ Magick++ Z Jpeg Tiff Png Freetype)
+foreach(lib LibXML++ Magick++ Z Jpeg Tiff Png Freetype Z)
find_package(${lib})
if (${lib}_FOUND)
include_directories(${${lib}_INCLUDE_DIRS})
@@ -48,12 +48,16 @@ endif (LibXML++_FOUND)
if (Boost_FOUND)
add_executable(ss_pak_extract pak_extract.cpp pak.cpp)
target_link_libraries(ss_pak_extract ${Boost_LIBRARIES})
+ if (Z_FOUND)
+ add_executable(itg_pck itg_pck.cc)
+ target_link_libraries(itg_pck ${Boost_LIBRARIES} ${Z_LIBRARIES})
+ endif()
endif (Boost_FOUND)
add_executable(ss_adpcm_decode adpcm_decode.cpp pak.cpp)
add_executable(ss_ipu_decode ipu_decode.cpp)
add_executable(ss_ipu_conv ipu_conv.cpp ipuconvmain.cpp pak.cpp)
-set(targets ${targets} ss_pak_extract ss_adpcm_decode ss_ipu_decode ss_ipu_conv)
+set(targets ${targets} ss_pak_extract ss_adpcm_decode ss_ipu_decode ss_ipu_conv itg_pck)
# add install target:
install(TARGETS ${targets} DESTINATION bin)
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-21 22:25:33
|
Module: performous
Branch: master
Commit: 625bfb5ed7197d1a3a516d8b4ddac4908e7834b3
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Dec 22 00:23:39 2009 +0200
Add very simple ITG .PCK format extractor
---
tools/itg_pck.cc | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 115 insertions(+), 0 deletions(-)
diff --git a/tools/itg_pck.cc b/tools/itg_pck.cc
new file mode 100644
index 0000000..0593e37
--- /dev/null
+++ b/tools/itg_pck.cc
@@ -0,0 +1,115 @@
+#include <boost/filesystem.hpp>
+#include <algorithm>
+#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+
+template <typename It> void test(It it, std::string text) {
+ if (!std::equal(text.begin(), text.end(), it)) throw std::runtime_error("PCKF header missing");
+}
+
+template <typename It> std::string read(It it, unsigned chars) {
+ std::string ret;
+ while (chars--) ret += *it++;
+ return ret.substr(0, ret.find_last_not_of('\0') + 1);
+}
+
+template <typename It> unsigned read32(It it) {
+ unsigned ret = 0;
+ for (unsigned i = 0; i < 4; ++i) ret |= static_cast<unsigned char>(*it++) << i * 8;
+ return ret;
+}
+
+namespace fs = boost::filesystem;
+
+struct File {
+ fs::path name;
+ unsigned size;
+ unsigned sizeCompressed;
+ unsigned mode; // 0 = stored, 1 = compressed
+ unsigned offset;
+};
+
+#include <zlib.h>
+
+struct Extract {
+ std::ifstream& archive;
+ Extract(std::ifstream& archive): archive(archive) {}
+ void operator()(File const& file) {
+ std::cout << " " << file.name << " " << file.size << " at " << file.offset << std::endl;
+ if (file.mode == 1) std::cout << " " << file.size << "->" << file.sizeCompressed << std::endl;
+ std::vector<char> buffer(file.sizeCompressed);
+ archive.seekg(file.offset);
+ archive.read(&buffer[0], buffer.size());
+ std::string ext;
+ if (file.mode == 1) {
+ std::vector<char> buf2(file.size);
+ z_stream strm = {};
+ strm.avail_in = buffer.size();
+ strm.next_in = reinterpret_cast<Bytef*>(&buffer[0]);
+ strm.avail_out = buf2.size();
+ strm.next_out = reinterpret_cast<Bytef*>(&buf2[0]);
+
+ inflateInit2(&strm, -15);
+ int ret = inflate(&strm, Z_SYNC_FLUSH);
+ inflateEnd(&strm);
+ std::cout << ret << std::endl;
+ if (ret == Z_STREAM_END) buf2.swap(buffer);
+ else {
+ std::ostringstream oss;
+ oss << ".comp-" << file.size;
+ ext = oss.str();
+ }
+ if (strm.msg) std::cerr << " Error: " << strm.msg << std::endl;
+ }
+ // Make directory
+ makeDir(file.name);
+ std::ofstream of((file.name.string() + ext).c_str(), std::ios::binary);
+ of.write(&buffer[0], buffer.size());
+ }
+ void makeDir(fs::path p) {
+ p.remove_filename();
+ if (p.empty()) return;
+ makeDir(p);
+ fs::create_directory(p);
+ }
+};
+
+int main(int argc, char** argv) {
+ if (argc != 2) throw std::logic_error("Need pck filename as argument");
+ std::ifstream f(argv[1], std::ios::binary);
+ f.exceptions(std::ios::failbit);
+ std::istreambuf_iterator<char> it(f), end;
+ // PCKF header:
+ // 17 bytes "PCKFdefault base "
+ // Name (title) of the package, padded with zeroes until offset 0x84
+ // Little-endian u32 file count
+ test(it, "PCKFdefault base ");
+ std::string title = read(it, 0x73);
+ std::cout << "Title: " << title << std::endl;
+ unsigned filecount = read32(it);
+ std::cout << filecount << " files:" << std::endl;
+ std::vector<File> files;
+ while (files.size() < filecount) {
+ // File entry: (array of filecount file entries)
+ // Little-endian u32: size of compressed/stored data
+ // Little-endian u32: size of uncompressed data
+ // Little-endian u32: position in pck file (in bytes)
+ // Little-endian u32: name length (in bytes)
+ // char[namelen]: file name with path, uses '/' as path separator
+ // Little-endian u32: compression mode (0 = stored, 1 = deflated)
+ File file;
+ file.sizeCompressed = read32(it);
+ file.size = read32(it);
+ file.offset = read32(it);
+ unsigned namelen = read32(it);
+ file.mode = read32(it);
+ file.name = fs::path(title) / read(it, namelen);
+ files.push_back(file);
+ }
+ std::cout << "Header ends at " << f.tellg() << std::endl;
+ std::for_each(files.begin(), files.end(), Extract(f));
+}
+
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-21 22:20:53
|
Module: performous
Branch: master
Commit: 57194ebd8c0d0d3aad226761222ed25c63724c8d
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Dec 22 00:20:35 2009 +0200
Guess music.ogg if music file is not found for SM format songs (because ITG is broken)
---
game/songparser-sm.cc | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index 0f03b5f..e7c6eba 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -1,5 +1,6 @@
#include "songparser.hh"
+#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <algorithm>
@@ -62,7 +63,10 @@ void SongParser::smParse() {
while (getline(line) && smParseField(line)) {}
if (m_song.danceTracks.empty() ) throw std::runtime_error("No note data in the file");
if (s.title.empty() || s.artist.empty()) throw std::runtime_error("Required header fields missing");
-
+ std::string& music = s.music["background"];
+ std::string tmp = s.path + "music.ogg";
+ namespace fs = boost::filesystem;
+ if ((music.empty() || !fs::exists(music)) && fs::exists(tmp)) music = tmp;
}
bool SongParser::smParseField(std::string line) {
|
|
From: Stefano A. <xa...@us...> - 2009-12-21 17:54:55
|
Module: performous
Branch: master
Commit: 5d893adeb7900692fd9fda4da122b74a03a21b49
Author: Xaldyz <xa...@us...>
Date: Mon Dec 21 18:54:38 2009 +0100
Fixed variable problems into FindGettext.cmake
---
cmake/Modules/FindGettext.cmake | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/cmake/Modules/FindGettext.cmake b/cmake/Modules/FindGettext.cmake
index 2582a1c..1b13934 100644
--- a/cmake/Modules/FindGettext.cmake
+++ b/cmake/Modules/FindGettext.cmake
@@ -10,10 +10,9 @@
include(LibFindMacros)
-# On Linux there is no pkgconfig script and gettext is part of glibc
+# On Linux there is no pkgconfig script, but with this we force Gettext_PKGCONF_INCLUDE_DIRS to ""
+libfind_pkg_check_modules(Gettext_PKGCONF Gettext)
if(WIN32 OR APPLE)
- libfind_pkg_check_modules(Gettext_PKGCONF Gettext)
-
set(Gettext_LIBRARY_SEARCH_DIRS
${Gettext_PKGCONF_LIBRARY_DIRS}
/opt/local/lib
|
|
From: Stefano A. <xa...@us...> - 2009-12-21 17:48:13
|
Module: performous
Branch: master
Commit: 73d4a131ef162e2c9d4177e4934853ebce6ca8ad
Author: Xaldyz <xa...@us...>
Date: Mon Dec 21 18:47:29 2009 +0100
Improved Gettext search detection
---
cmake/Modules/FindGettext.cmake | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/cmake/Modules/FindGettext.cmake b/cmake/Modules/FindGettext.cmake
index 78a62a6..2582a1c 100644
--- a/cmake/Modules/FindGettext.cmake
+++ b/cmake/Modules/FindGettext.cmake
@@ -11,18 +11,11 @@
include(LibFindMacros)
# On Linux there is no pkgconfig script and gettext is part of glibc
-if(WIN32)
- libfind_pkg_check_modules(Gettext_PKGCONF Gettext)
-
- find_library(Gettext_LIBRARY
- NAMES libintl
- PATHS ${Gettext_PKGCONF_LIBRARY_DIRS}
- )
- set(Gettext_PROCESS_LIBS Gettext_LIBRARY)
-endif()
-
-if(APPLE)
+if(WIN32 OR APPLE)
+ libfind_pkg_check_modules(Gettext_PKGCONF Gettext)
+
set(Gettext_LIBRARY_SEARCH_DIRS
+ ${Gettext_PKGCONF_LIBRARY_DIRS}
/opt/local/lib
/sw/local/lib
)
|
|
From: Tapio V. <aa...@us...> - 2009-12-21 16:31:02
|
Module: performous Branch: master Commit: c6b223b68cebbce079fe3b029d12657c8202a9a2 Author: Tapio Vierros <tap...@gm...> Date: Mon Dec 21 18:30:08 2009 +0200 Added some useful stuff to git help. --- docs/git.txt | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 50 insertions(+), 4 deletions(-) diff --git a/docs/git.txt b/docs/git.txt index f57cc17..621c4b1 100644 --- a/docs/git.txt +++ b/docs/git.txt @@ -42,11 +42,18 @@ To update your working copy do a simple: $ git pull +Discover and investigate changes others made: + + $ git log + $ git show <commit-hash> (ommit <commit-hash> to see latest) + +Note that only a few characters (of 40) from the commit hash id is needed. + Discovering and investigating your changes isn't any different than subversion: $ git status - $ git diff <file> + $ git diff <file> (ommit <file> to see all changes) Committing changes in git usually takes two steps. First add the files you want to commit: @@ -58,9 +65,13 @@ you to enter a commit message and have a last glance at what changed: $ git commit -Again: this will not interact with the main repository in any way and -doesn't require an internet connection. All that is altered is your -local repository. +You can also pass -a parameter to add all your changes (and bypass the +git-add stage). These operations won't interact with the main repository +in any way and no internet connection is needed. All that is altered is +your local repository. + +If you are not sure what you should do next, git status usually provides +some good suggestions. Sharing @@ -95,3 +106,38 @@ change the project url with this command: $ git config remote.origin.url <SF.net username>@git.performous.org:/gitroot/performous/performous +Be also sure to set your name and email before committing +(if you haven't done that already): + + $ git config --global user.name "My Name" + $ git config --global user.email "my...@ex..." + + +Tricks +------ + +If you have already learned the basics of Git, you may find the following +things useful. + +Stash: + +If you e.g. need to do a hot-fix or switch branch, but you are in a middle +of some hacking you don't want to commit just yet, you can use stash to +put your changes aside, "under the carpet": + + $ git stash + +When you are ready to continue, just type: + + $ git stash pop + +If you want to keep the stuff in the stash, use 'apply' instead of 'pop'. +You can have multiple things stashed away at once. + +Cherry-pick: + +If you e.g. committed to a wrong branch and don't want to merge the whole +branch, you can cherry-pick (merge) just the one commit: + + $ git cherry-pick <commit-hash> + |
|
From: Yoda-JM <yo...@us...> - 2009-12-21 11:13:25
|
Module: web Branch: master Commit: 2e5f34613e9967a544db33be1270a31b8f327722 Author: Vincent Le Ligeour <yo...@us...> Date: Mon Dec 21 12:13:05 2009 +0100 Made website almost XHTML 1.0 Strict valid --- htdocs-binary/style.css | 1 + htdocs-source/Model.htm | 20 ++++++++++---------- htdocs-source/history.txt | 8 ++++---- htdocs-source/index.txt | 6 +++--- htdocs-source/screenshots.txt | 26 +++++++++++++------------- htdocs-source/songs.txt | 16 ++++++++-------- 6 files changed, 39 insertions(+), 38 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-20 17:16:39
|
Module: performous
Branch: master
Commit: 49d00abac0330267e715f48bbd8eb37b3e69f29c
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Dec 20 19:16:12 2009 +0200
Add support for Impact Dance Pad
---
game/joystick.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 457ca15..527f6fc 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -238,6 +238,9 @@ void input::SDL::init() {
} else if( name.find("RedOctane USB Pad") != std::string::npos ) {
std::cout << " Detected as: Generic Dance Pad" << std::endl;
input::Private::devices[i] = input::Private::InputDevPrivate(input::Private::DANCEPAD_GENERIC);
+ } else if( name.find("Positive Gaming Impact USB pad") != std::string::npos ) {
+ std::cout << " Detected as: Generic Dance Pad" << std::endl;
+ input::Private::devices[i] = input::Private::InputDevPrivate(input::Private::DANCEPAD_GENERIC);
} else {
std::cout << " Detected as: Unknwown (please report the name, assuming Guitar Hero Drums)" << std::endl;
input::Private::devices[i] = input::Private::InputDevPrivate(input::Private::DRUMS_GH);
|
|
From: Stefano A. <xa...@us...> - 2009-12-20 13:25:42
|
Module: performous Branch: master Commit: 4cf91f12df98ec6931f8e5f02772d085f9525b1d Author: Xaldyz <xa...@us...> Date: Sun Dec 20 14:25:13 2009 +0100 Merge branch 'master' of ssh://performous.git.sourceforge.net/gitroot/performous/performous --- |
|
From: Stefano A. <xa...@us...> - 2009-12-20 13:25:39
|
Module: performous
Branch: master
Commit: 681dfb60106f81a7a3fe386638dcd97f09cce6cd
Author: Xaldyz <xa...@us...>
Date: Sun Dec 20 14:22:21 2009 +0100
Added msvc script
---
win32/{ => gcc}/README | 0
win32/{ => gcc}/gettext-0.17-variables.patch | 0
win32/{ => gcc}/install.sh | 2 +-
win32/{ => gcc}/mingw-cwchar.patch | 0
win32/{ => gcc}/mingw-libstdc++.patch | 0
win32/{ => gcc}/pkg-config.exe | Bin 1387520 -> 1387520 bytes
win32/{ => gcc}/portaudio.patch | 0
win32/msvc/fontconfig-cmake.patch | 24 +
win32/msvc/install-msvc.sh | 1383 ++++++++++++++++++++++++++
9 files changed, 1408 insertions(+), 1 deletions(-)
|