[Scummvm-cvs-logs] SF.net SVN: scummvm:[53388] scummvm/trunk/engines/sword25/fmv

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Oct 13 02:06:37 CEST 2010


Revision: 53388
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53388&view=rev
Author:   sev
Date:     2010-10-13 00:06:37 +0000 (Wed, 13 Oct 2010)

Log Message:
-----------
SWORD25: Enforce code naming conventions in fmv/*

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
    scummvm/trunk/engines/sword25/fmv/movieplayer.h
    scummvm/trunk/engines/sword25/fmv/movieplayer_script.cpp
    scummvm/trunk/engines/sword25/fmv/yuvtorgba.cpp
    scummvm/trunk/engines/sword25/fmv/yuvtorgba.h

Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.cpp	2010-10-13 00:06:12 UTC (rev 53387)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.cpp	2010-10-13 00:06:37 UTC (rev 53388)
@@ -50,7 +50,7 @@
 }
 
 MoviePlayer::MoviePlayer(Kernel *pKernel) : Service(pKernel), _decoder(g_system->getMixer()) {
-	if (!_RegisterScriptBindings())
+	if (!registerScriptBindings())
 		BS_LOG_ERRORLN("Script bindings could not be registered.");
 	else
 		BS_LOGLN("Script bindings registered.");
@@ -60,7 +60,7 @@
 	_decoder.close();
 }
 
-bool MoviePlayer::LoadMovie(const Common::String &filename, uint z) {
+bool MoviePlayer::loadMovie(const Common::String &filename, uint z) {
 	// Get the file and load it into the decoder
 	Common::SeekableReadStream *in = Kernel::GetInstance()->GetPackage()->getStream(filename);
 	_decoder.load(in);
@@ -93,24 +93,24 @@
 	return true;
 }
 
-bool MoviePlayer::UnloadMovie() {
+bool MoviePlayer::unloadMovie() {
 	_decoder.close();
 	_outputBitmap.erase();
 
 	return true;
 }
 
-bool MoviePlayer::Play() {
+bool MoviePlayer::play() {
 	_decoder.pauseVideo(false);
 	return true;
 }
 
-bool MoviePlayer::Pause() {
+bool MoviePlayer::pause() {
 	_decoder.pauseVideo(true);
 	return true;
 }
 
-void MoviePlayer::Update() {
+void MoviePlayer::update() {
 	if (_decoder.isVideoLoaded()) {
 		Graphics::Surface *s = _decoder.decodeNextFrame();
 
@@ -121,22 +121,22 @@
 	}
 }
 
-bool MoviePlayer::IsMovieLoaded() {
+bool MoviePlayer::isMovieLoaded() {
 	return _decoder.isVideoLoaded();
 }
 
-bool MoviePlayer::IsPaused() {
+bool MoviePlayer::isPaused() {
 	return _decoder.isPaused();
 }
 
-float MoviePlayer::GetScaleFactor() {
+float MoviePlayer::getScaleFactor() {
 	if (_decoder.isVideoLoaded())
 		return _outputBitmap->getScaleFactorX();
 	else
 		return 0;
 }
 
-void MoviePlayer::SetScaleFactor(float scaleFactor) {
+void MoviePlayer::setScaleFactor(float scaleFactor) {
 	if (_decoder.isVideoLoaded()) {
 		_outputBitmap->setScaleFactor(scaleFactor);
 
@@ -147,7 +147,7 @@
 	}
 }
 
-double MoviePlayer::GetTime() {
+double MoviePlayer::getTime() {
 	return _decoder.getElapsedTime() / 1000.0;
 }
 

Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.h
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.h	2010-10-13 00:06:12 UTC (rev 53387)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.h	2010-10-13 00:06:37 UTC (rev 53388)
@@ -35,10 +35,6 @@
 #ifndef SWORD25_MOVIEPLAYER_H
 #define SWORD25_MOVIEPLAYER_H
 
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-
 #include "sword25/kernel/common.h"
 #include "sword25/kernel/service.h"
 #include "sword25/fmv/theora_decoder.h"
@@ -46,10 +42,6 @@
 
 namespace Sword25 {
 
-// -----------------------------------------------------------------------------
-// Class definitions
-// -----------------------------------------------------------------------------
-
 class MoviePlayer : public Service {
 public:
 	// -----------------------------------------------------------------------------
@@ -73,14 +65,14 @@
 	 * @param Z             Z indicates the position of the film on the main graphics layer
 	 * @return              Returns false if an error occured while loading, otherwise true.
 	*/
-	bool LoadMovie(const Common::String &Filename, uint Z);
+	bool loadMovie(const Common::String &filename, uint z);
 
 	/**
 	 * Unloads the currently loaded movie file.
 	 * @return              Returns false if an error occurred while unloading, otherwise true.
 	 * @remark              This method can only be called when IsMovieLoaded() returns true.
 	 */
-	bool UnloadMovie();
+	bool unloadMovie();
 
 	/**
 	 * Plays the loaded movie.
@@ -90,7 +82,7 @@
 	 * @return              Returns false if an error occurred while starting, otherwise true.
 	 * @remark              This method can only be called when IsMovieLoaded() returns true.
 	 */
-	bool Play();
+	bool play();
 
 	/**
 	 * Pauses movie playback.
@@ -99,23 +91,23 @@
 	 * @return              Returns false if an error occurred while pausing, otherwise true.
 	 * @remark              This method can only be called when IsMovieLoaded() returns true.
 	 */
-	bool Pause();
+	bool pause();
 
 	/**
 	 * This function must be called once per frame.
 	 */
-	void Update();
+	void update();
 
 	/**
 	 * Returns whether a film is loaded for playback.
 	 */
-	bool IsMovieLoaded();
+	bool isMovieLoaded();
 
 	/**
 	 * Returns whether the movie playback is paused.
 	 * @remark              This method can only be called when IsMovieLoaded() returns true.
 	*/
-	bool IsPaused();
+	bool isPaused();
 
 	/**
 	 * Returns the scaling factor for the loaded film.
@@ -125,22 +117,23 @@
 	 * @return              Returns the scaling factor of the film.
 	 * @remark              This method can only be called when IsMovieLoaded() returns true.
 	 */
-	float GetScaleFactor();
+	float getScaleFactor();
 
 	/**
 	 * Sets the factor by which the loaded film is to be scaled.
 	 * @param ScaleFactor   The desired scale factor.
 	 * @remark              This method can only be called when IsMovieLoaded() returns true.
 	 */
-	void SetScaleFactor(float ScaleFactor);
+	void setScaleFactor(float scaleFactor);
 
 	/**
 	 * Returns the current playing position in seconds.
 	 * @remark              This method can only be called when IsMovieLoaded() returns true.
 	 */
-	double GetTime();
+	double getTime();
+
 private:
-	bool _RegisterScriptBindings();
+	bool registerScriptBindings();
 
 	TheoraDecoder _decoder;
 

Modified: scummvm/trunk/engines/sword25/fmv/movieplayer_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer_script.cpp	2010-10-13 00:06:12 UTC (rev 53387)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer_script.cpp	2010-10-13 00:06:37 UTC (rev 53388)
@@ -32,10 +32,6 @@
  *
  */
 
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-
 #include "sword25/kernel/common.h"
 #include "sword25/kernel/kernel.h"
 #include "sword25/script/script.h"
@@ -45,133 +41,113 @@
 
 namespace Sword25 {
 
-int LoadMovie(lua_State *L) {
+int loadMovie(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	lua_pushbooleancpp(L, FMVPtr->LoadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast<uint>(luaL_checknumber(L, 2)) : 10));
+	lua_pushbooleancpp(L, FMVPtr->loadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast<uint>(luaL_checknumber(L, 2)) : 10));
 
 	return 1;
 }
 
-// -------------------------------------------------------------------------
-
-int UnloadMovie(lua_State *L) {
+int unloadMovie(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	lua_pushbooleancpp(L, FMVPtr->UnloadMovie());
+	lua_pushbooleancpp(L, FMVPtr->unloadMovie());
 
 	return 1;
 }
 
-// -------------------------------------------------------------------------
-
-int Play(lua_State *L) {
+int play(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	lua_pushbooleancpp(L, FMVPtr->Play());
+	lua_pushbooleancpp(L, FMVPtr->play());
 
 	return 1;
 }
 
-// -------------------------------------------------------------------------
-
-int Pause(lua_State *L) {
+int pause(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	lua_pushbooleancpp(L, FMVPtr->Pause());
+	lua_pushbooleancpp(L, FMVPtr->pause());
 
 	return 1;
 }
 
-// -------------------------------------------------------------------------
-
-int Update(lua_State *L) {
+int update(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	FMVPtr->Update();
+	FMVPtr->update();
 
 	return 0;
 }
 
-// -------------------------------------------------------------------------
-
-int IsMovieLoaded(lua_State *L) {
+int isMovieLoaded(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	lua_pushbooleancpp(L, FMVPtr->IsMovieLoaded());
+	lua_pushbooleancpp(L, FMVPtr->isMovieLoaded());
 
 	return 1;
 }
 
-// -------------------------------------------------------------------------
-
-int IsPaused(lua_State *L) {
+int isPaused(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	lua_pushbooleancpp(L, FMVPtr->IsPaused());
+	lua_pushbooleancpp(L, FMVPtr->isPaused());
 
 	return 1;
 }
 
-// -------------------------------------------------------------------------
-
-int GetScaleFactor(lua_State *L) {
+int getScaleFactor(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	lua_pushnumber(L, FMVPtr->GetScaleFactor());
+	lua_pushnumber(L, FMVPtr->getScaleFactor());
 
 	return 1;
 }
 
-// -------------------------------------------------------------------------
-
-int SetScaleFactor(lua_State *L) {
+int setScaleFactor(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	FMVPtr->SetScaleFactor(static_cast<float>(luaL_checknumber(L, 1)));
+	FMVPtr->setScaleFactor(static_cast<float>(luaL_checknumber(L, 1)));
 
 	return 0;
 }
 
-// -------------------------------------------------------------------------
-
-int GetTime(lua_State *L) {
+int getTime(lua_State *L) {
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
-	lua_pushnumber(L, FMVPtr->GetTime());
+	lua_pushnumber(L, FMVPtr->getTime());
 
 	return 1;
 }
 
-// -------------------------------------------------------------------------
-
 const char *LIBRARY_NAME = "Movieplayer";
 
 const luaL_reg LIBRARY_FUNCTIONS[] = {
-	{ "LoadMovie", LoadMovie },
-	{ "UnloadMovie", UnloadMovie },
-	{ "Play", Play },
-	{ "Pause", Pause },
-	{ "Update", Update },
-	{ "IsMovieLoaded", IsMovieLoaded },
-	{ "IsPaused", IsPaused },
-	{ "GetScaleFactor", GetScaleFactor },
-	{ "SetScaleFactor", SetScaleFactor },
-	{ "GetTime", GetTime },
+	{ "LoadMovie", loadMovie },
+	{ "UnloadMovie", unloadMovie },
+	{ "Play", play },
+	{ "Pause", pause },
+	{ "Update", update },
+	{ "IsMovieLoaded", isMovieLoaded },
+	{ "IsPaused", isPaused },
+	{ "GetScaleFactor", getScaleFactor },
+	{ "SetScaleFactor", setScaleFactor },
+	{ "GetTime", getTime },
 	{ 0, 0 }
 };
 
-bool MoviePlayer::_RegisterScriptBindings() {
+bool MoviePlayer::registerScriptBindings() {
 	Kernel *pKernel = Kernel::GetInstance();
 	BS_ASSERT(pKernel);
 	ScriptEngine *pScript = static_cast<ScriptEngine *>(pKernel->GetService("script"));

Modified: scummvm/trunk/engines/sword25/fmv/yuvtorgba.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/yuvtorgba.cpp	2010-10-13 00:06:12 UTC (rev 53387)
+++ scummvm/trunk/engines/sword25/fmv/yuvtorgba.cpp	2010-10-13 00:06:37 UTC (rev 53388)
@@ -32,14 +32,9 @@
  *
  */
 
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-
 #include "sword25/fmv/yuvtorgba.h"
 
 namespace Sword25 {
-// -----------------------------------------------------------------------------
 
 static const int PRECISION = 32768;
 static const int COEFFS_Y[256] = {
@@ -167,7 +162,7 @@
 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 
 };
 
-void YUVtoBGRA::translate(th_ycbcr_buffer &YUVBuffer, const th_info &TheoraInfo, byte *PixelData, int PixelsSize) {
+void YUVtoBGRA::translate(th_ycbcr_buffer &YUVBuffer, const th_info &theoraInfo, byte *pixelData, int pixelsSize) {
 
 	// Width and height of all buffers have to be divisible by 2.
 	BS_ASSERT((YUVBuffer[0].width & 1)   == 0);
@@ -187,8 +182,8 @@
 	const byte *ySrc1 = YUVBuffer[0].data + YUVBuffer[0].stride;
 	const byte *uSrc  = YUVBuffer[1].data;
 	const byte *vSrc  = YUVBuffer[2].data;
-	byte *dst0  = &PixelData[0];
-	byte *dst1  = &PixelData[0] + YUVBuffer[0].width * 4;
+	byte *dst0  = &pixelData[0];
+	byte *dst1  = &pixelData[0] + YUVBuffer[0].width * 4;
 
 	for (int h = 0; h < YUVBuffer[0].height / 2; ++h) {
 		for (int w = 0; w < YUVBuffer[0].width / 2; ++w) {

Modified: scummvm/trunk/engines/sword25/fmv/yuvtorgba.h
===================================================================
--- scummvm/trunk/engines/sword25/fmv/yuvtorgba.h	2010-10-13 00:06:12 UTC (rev 53387)
+++ scummvm/trunk/engines/sword25/fmv/yuvtorgba.h	2010-10-13 00:06:37 UTC (rev 53388)
@@ -35,23 +35,15 @@
 #ifndef SWORD25_YUVTORGBA_H
 #define SWORD25_YUVTORGBA_H
 
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-
 #include "sword25/kernel/common.h"
 #include <theora/theora.h>
 #include <theora/codec.h>
 
 namespace Sword25 {
 
-// -----------------------------------------------------------------------------
-// Class definitions
-// -----------------------------------------------------------------------------
-
 class YUVtoBGRA {
 public:
-	static void translate(th_ycbcr_buffer &YUVBuffer, const th_info &TheoraInfo, byte *PixelData, int PixelsSize);
+	static void translate(th_ycbcr_buffer &YUVBuffer, const th_info &theoraInfo, byte *pixelData, int pixelsSize);
 };
 
 } // End of namespace Sword25


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list